Skip to content

test: pin daemon modularity migration contracts - #1487

Merged
thymikee merged 3 commits into
mainfrom
agent/1478-p0-contract-ratchets-pr
Jul 29, 2026
Merged

test: pin daemon modularity migration contracts#1487
thymikee merged 3 commits into
mainfrom
agent/1478-p0-contract-ratchets-pr

Conversation

@thymikee

@thymikee thymikee commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

Pin the released behavior and architecture baselines needed to safely execute the daemon modularity work in #1478.

This adds characterization coverage for replay-test reporters and Maestro-compatible discovery, plus executable ratchets for SessionState ownership, dependency-cycle size and zone membership, external daemon/types.ts importers, logical-module direction, and private internal/ trees. Production behavior is unchanged.

The ratchet implementation keeps one source of truth for each concept: the cycle total is derived from its zone ceilings, layering violations share one model type, and SessionState field counts live with the ownership model.

Scope is limited to P0: 12 touched files. P1 and the in-progress P2 cutover are intentionally excluded.

Part of #1478.

Validation

check:affected passed formatting, lint, typecheck, layering, Fallow, metadata sync, build, and all 19 directly affected tests. The layering gate reports R6 at 7, all SessionState fields classified, R7 at 30 writer-owned fields / 42 owner claims, and R9 at 102 files.

The full unit lane saturated the host and produced unrelated five-second timeouts across eight files. All eight failure files were rerun serially; 173 tests passed, including an exact comparison run of the remaining Apple runner cancellation case on both origin/main and the PR head. CI remains authoritative for the full aggregate and platform jobs.

No device verification was required because this PR changes tests, documentation, and enforcement tooling only.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-29 16:05 UTC

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.87 MB 1.87 MB 0 B
JS gzip 602.9 kB 602.9 kB 0 B
npm tarball 720.7 kB 720.7 kB +7 B
npm unpacked 2.52 MB 2.52 MB +43 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.9 ms 28.4 ms +0.5 ms
CLI --help 57.9 ms 57.0 ms -0.9 ms

Top changed chunks: no changes in the largest emitted chunks.

@thymikee

Copy link
Copy Markdown
Member Author

Review at 1af5d3d: not ready for the P0 migration baseline.

  • P1 — reporter characterization misses the risky contract. src/replay/test/reporters/__tests__/registry.test.ts covers only non-throwing synchronous onTestResult. It still passes if live-hook isolation in registry.ts is removed or if a later extraction starts awaiting live-hook promises. refactor(daemon): extract replay, Maestro, and replay-test modules #1478 requires preserving hook timing and error handling. Add throwing and rejecting live hooks, prove later reporters/final rendering continue with diagnostics, and prove a pending live promise is not awaited.
  • P2 — accidental SessionState shape ratchet. scripts/layering/daemon-modularity.test.ts hard-codes total fields as 41, but R10 only ratchets writer-owned fields and owner claims while R7 already enforces exhaustive classification. This rejects a valid new immutable/store-owned field. Remove the assertion, or explicitly make and document total state size as a deliberate migration metric.

The discovery tests and remaining edge-derived R10 guards are durable, and exact-head CI is green. No ready-for-human until these two contract gaps are tightened.

@thymikee

Copy link
Copy Markdown
Member Author

Addressed both findings in 2b14abd59.

  • Reporter characterization now covers synchronous throws, rejected promises, diagnostic output, continuation to later reporters/final hooks, and a pending live-hook promise that is demonstrably not awaited.
  • Removed the hard-coded total SessionState field assertion. R7 still proves exhaustive one-owner/store-owned classification against the declaration, while R10 remains limited to its documented writer-owned-field and owner-claim metrics.

Validated with format, typecheck, lint, 39 layering tests, 19 focused characterization tests, and Fallow.

@thymikee

Copy link
Copy Markdown
Member Author

Exact-head code review is clean. The new R10 ratchets match the declared daemon-modularity migration constraints, and the reporter/discovery tests exercise production behavior with meaningful counterfactuals rather than source spelling. Static, integration, coverage, Fallow, mutation, and non-iOS smoke checks are green.

Readiness is currently held only by the failed iOS smoke: the fixture alert wait timed out while unrelated runner/preflight/replay coverage passed. This head does not change an iOS production path, so it is not a confirmed code regression, but the required check must be rerun or explicitly classified before merge. No ready-for-human label while CI is failing.

@thymikee
thymikee merged commit 2316fd3 into main Jul 29, 2026
31 of 32 checks passed
@thymikee
thymikee deleted the agent/1478-p0-contract-ratchets-pr branch July 29, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant