Skip to content

[cache] Standardize cache contract across commands (#162)#170

Merged
coisa merged 3 commits intomainfrom
codex/162-negatable-cache-contract
Apr 23, 2026
Merged

[cache] Standardize cache contract across commands (#162)#170
coisa merged 3 commits intomainfrom
codex/162-negatable-cache-contract

Conversation

@coisa
Copy link
Copy Markdown
Contributor

@coisa coisa commented Apr 23, 2026

Related Issue

Closes #162

Motivation / Context

This standardizes the cache contract across cache-aware commands so callers can keep the command default, force cache on, or force cache off with the same mental model. It also makes orchestration commands carry explicit cache intent and nested cache directories consistently.

Changes

  • added a shared HasCacheOption helper for --cache, --cache-dir, and nested cache-dir resolution
  • updated tests, docs, wiki, and phpdoc to follow the same cache contract
  • updated reports and standards to propagate explicit cache intent and explicit nested cache-dir values to child commands
  • refreshed command docs and usage docs to explain default behavior versus explicit --cache / --no-cache
  • expanded command tests for default, forced-off, propagation, and explicit nested cache-dir flows

Verification

  • ./vendor/bin/phpunit tests/Console/Command/DocsCommandTest.php tests/Console/Command/TestsCommandTest.php tests/Console/Command/PhpDocCommandTest.php tests/Console/Command/WikiCommandTest.php tests/Console/Command/ReportsCommandTest.php tests/Console/Command/StandardsCommandTest.php
  • composer dev-tools changelog:check
  • git diff --check
  • manual command runs confirming default vs --no-cache behavior for tests, phpdoc, docs, and wiki
  • manual orchestration runs for reports and standards confirming argument propagation before the known /dev/tty subprocess limitation in this environment

Documentation / Generated Output

  • updated command docs for tests, docs, wiki, phpdoc, reports, and standards
  • updated shared usage docs in docs/running/specialized-commands.rst and docs/usage/testing-and-coverage.rst
  • added changelog entry in Unreleased

Changelog

  • added Changed entry for the standardized cache contract and nested cache-dir propagation

Reviewer Notes

  • composer dev-tools:fix and direct reports / standards subprocess execution still hit the existing /dev/tty environment limitation here; that is not introduced by this change
  • .github/wiki remains a separate local change and is intentionally excluded from this PR

@github-actions
Copy link
Copy Markdown
Contributor

@coisa coisa merged commit 65aa915 into main Apr 23, 2026
28 checks passed
@coisa coisa deleted the codex/162-negatable-cache-contract branch April 23, 2026 07:52
@github-project-automation github-project-automation Bot moved this from Backlog to Released in PHP Fast Forward Project Apr 23, 2026
github-actions Bot added a commit that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Add a consistent negatable cache contract and audit other default-assumed CLI behaviors

1 participant