Skip to content

Commit 48a138c

Browse files
Merge pull request #16 from script-development/engineer/doc-edit-bundle
docs: reconcile CLAUDE.md and README to v0.2.0 + Unreleased reality
2 parents 7ff91c8 + a7c78c1 commit 48a138c

2 files changed

Lines changed: 41 additions & 3 deletions

File tree

CLAUDE.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Composer package distributing war-room-doctrine PHPStan rules across `script-dev
2323
| `EnforceActionTransactionsRule` | ADR-0011 | `enforceActionTransactions.missingTransaction` |
2424
| `ForbidDatabaseManagerInActionsRule` | ADR-0021 §Why ConnectionInterface | `forbidDatabaseManager.inAction` |
2525
| `ForbidAbortHelperRule` | War-room §Explicit over implicit | `forbidAbortHelper.abortUsed` |
26-
| `LogRule` | ADR-0001 §Append-only | `logRule.logModification` |
26+
| `LogRule` | ADR-0001 §Append-only | `logRule.logModification` (covers instance `update`/`delete`/`forceDelete`/`forceDeleteQuietly`; static `Model::destroy()` / `Model::forceDestroy()` ship with v0.3.0 per `[Unreleased]`) |
2727
| `EnforceAuditSnapshotOnRetryRule` | ADR-0001 §Snapshot-on-Retry Safety | `enforceAuditSnapshotOnRetry.firstStatementMustResetState` |
2828
| `EnforceResourceDataValidatorOptInRule` | ADR-0009 §EAGER_LOAD validator opt-in | `enforceResourceDataValidatorOptIn.missingValidatorCall` |
2929
| `ConnectionTransactionReturnTypeExtension` | (type extension, no rule) ||
@@ -42,6 +42,10 @@ Phase 2 expands the rule set: `EnforceAuditSnapshotOnRetryRule` (ADR-0001 §Snap
4242
| Command | Purpose |
4343
|---|---|
4444
| `composer test` | Run PHPUnit tests against rule fixtures |
45+
| `composer test:coverage` | PHPUnit with clover coverage output (`build/logs/clover.xml`) |
46+
| `composer coverage:check` | Line-coverage threshold gate (`bin/coverage-check.php`) |
47+
| `composer mutation` | Run Infection mutation testing (developer-facing, `--threads=max --show-mutations`) |
48+
| `composer mutation:ci` | Run Infection with `--logger-github` for inline PR annotations + threshold gate |
4549
| `composer phpstan` | Self-analysis on the package's own source |
4650
| `composer format` | Pint write |
4751
| `composer format:check` | Pint check |
@@ -54,7 +58,11 @@ SemVer per ADR-0021:
5458
- **Minor** — new rules added, or new options without changing defaults.
5559
- **Patch** — bug fixes, false-positive narrowing, performance.
5660

57-
Consuming territories pin `^1.0`. Any rule that would surface new errors in already-clean code waits for a major bump.
61+
**Pre-1.0 (`0.x`) convention:** within `0.x` the package treats minor bumps as breaking, because Composer's `^0.x` caret locks at minor. A v0.2.0 release does not propagate to consumers pinned `^0.1.0` — they must update their pin to `^0.2` (or a wider constraint that crosses minor). Current pins per consumer are tracked in `campaigns/phpstan-warroom-rules/2026-05-06-first-contact-wave.md` § Outcome.
62+
63+
**Today (v0.x):** consuming territories pin `^0.{minor}` (e.g. `^0.2`). Each minor bump requires a coordinated consumer-side pin update. The CHANGELOG `[Unreleased]` block tracks each pending bump's audit demands.
64+
65+
**At 1.0 (when stability target is met):** consuming territories pin `^1.0` and inherit minor + patch automatically. Any rule that would surface new errors in already-clean code waits for a major bump.
5866

5967
## Release process
6068

@@ -63,6 +71,35 @@ Consuming territories pin `^1.0`. Any rule that would surface new errors in alre
6371
- A release PR moves `[Unreleased]` to a versioned heading and tags the merge commit (`v1.x.y`).
6472
- Packagist's webhook auto-sync picks up the tag and publishes the release; `release.yml` re-runs CI gates on the tagged commit and creates a GitHub release referencing the matching CHANGELOG entry.
6573

74+
## War Room ADR Projections
75+
76+
> Distilled operational rules from cross-project Architecture Decision Records.
77+
> Canonical full ADRs at [adrs.script.nl](https://adrs.script.nl). This section is owned by the war room — do not edit directly.
78+
> Last synced: 2026-05-08
79+
80+
### Applicable
81+
82+
- **ADR-0015 (ADR Governance)** — this section exists because ADR-0015 mandates it for non-BIO territories.
83+
- **ADR-0021 (Canonical PHPStan Rules Package)** — this territory is the implementation. Doctrine source: ADR-0021 §Doctrine source in docblock, §Identifier convention, §No territory-specific exceptions, §Action namespace assumption, §Versioning, §Release process. Self-quality contract documented above.
84+
85+
### Non-applicable (the rules ship, the package does not consume them)
86+
87+
- ADR-0001 (Audit Logging) — package distributes `LogRule` + `EnforceAuditSnapshotOnRetryRule`; does not itself maintain audit logs.
88+
- ADR-0002 (Cascade Deletion) — no application surface.
89+
- ADR-0009 (Unified ResourceData Pattern) — package distributes `EnforceResourceDataValidatorOptInRule` (Phase 2, `[Unreleased]`); does not itself ship API resources.
90+
- ADR-0011 (Action Class Architecture) — package distributes `EnforceActionTransactionsRule` + `ForbidDatabaseManagerInActionsRule`; itself has no Actions.
91+
- ADR-0012 (FormRequest → DTO) — no HTTP surface.
92+
- ADR-0014 (Domain-Driven Frontend) — no frontend.
93+
- ADR-0016 (Config Attribute Injection) — no Laravel container surface.
94+
- ADR-0017 (Page Integration Tests) — no pages.
95+
- ADR-0019 (Explicit Model Hydration) — no models. Phase 2 candidate `EnforceExplicitHydrationRule` will distribute this rule.
96+
- ADR-0020 (Input/Result DTO Split) — no DTOs.
97+
- ADR-0024 (Automated External Provisioning) — no provisioning surface.
98+
99+
### War-room internal ADRs
100+
101+
- ADR-0005 (Spy System) / ADR-0007 (Soldiers) / ADR-0010 (Squads) — these govern the war-room agent fleet that operates *on* this territory; not consumed by the package itself.
102+
66103
## What this territory does NOT do
67104

68105
- Does not enforce its rules on itself's source code beyond syntactic correctness — the rules target Laravel application code (`App\Actions`, `App\*`), not a static-analysis package.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ includes:
4141
| `ForbidDatabaseManagerInActionsRule` | `forbidDatabaseManager.inAction` | Action constructors | Constructor parameter typed `DatabaseManager` is an error. Inject `ConnectionInterface` instead. |
4242
| `ForbidAbortHelperRule` | `forbidAbortHelper.abortUsed` | Function calls | `abort()`, `abort_if()`, `abort_unless()` are errors. Throw an explicit `HttpException` subclass instead. |
4343
| `LogRule` | `logRule.logModification` | `update()` / `delete()` calls | If the receiver type's class name contains `"Log"` or `"logs"` (case-insensitive), error. |
44+
| `EnforceAuditSnapshotOnRetryRule` | `enforceAuditSnapshotOnRetry.firstStatementMustResetState` | `App\Actions\*` whose constructor injects an entity audit logger | The first statement inside `$connection->transaction(...)` must reset the model's in-memory state (`$model->refresh()`, fresh fetch, or fresh instantiation). Doctrine: ADR-0001 §Snapshot-on-Retry Safety. |
4445
| `EnforceResourceDataValidatorOptInRule` | `enforceResourceDataValidatorOptIn.missingValidatorCall` | Classes extending `App\Http\Resources\ResourceData` | If the class declares a non-empty `EAGER_LOAD_COUNT` / `EAGER_LOAD_SUM` constant but never calls `validateRelationsLoaded()` in any method, error. |
4546

4647
### `EnforceActionTransactionsRule` — write-method list
@@ -92,7 +93,7 @@ Semantic versioning:
9293
- **Minor** — a new rule is added, or a rule gains an option that doesn't change defaults.
9394
- **Patch** — bug fixes, false-positive suppression, performance improvements.
9495

95-
Pin to a major version (`^1.0`).
96+
Pin to a 0.x minor version today (`^0.2`); future 1.0 release will allow `^1.0` pinning. See `CLAUDE.md` § Versioning for the 0.x caret-semantics rationale.
9697

9798
## License
9899

0 commit comments

Comments
 (0)