Skip to content

refactor(layering): centralize architecture ownership - #2150

Open
thymikee wants to merge 1 commit into
mainfrom
codex/issue-2126
Open

refactor(layering): centralize architecture ownership#2150
thymikee wants to merge 1 commit into
mainfrom
codex/issue-2126

Conversation

@thymikee

@thymikee thymikee commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Closes #2126

Centralize architecture ownership evidence in scripts/layering/architecture-ownership.ts and make the existing logical-module and snapshot-policy layering tests consume it.

  • The shared declaration now owns logical-module roots, the ADR 0004 src/snapshot/ executable-policy boundary, four exact public contracts facades (client, capture, replay, progress), and two exact capability roots with enumerated exports.
  • The old logical-module table is deleted from daemon-modularity.ts; no production src/ or packages/ imports or runtime behavior changed.
  • The root matcher is boundary-aware: file roots require equality and directory roots require the declared directory prefix. No filename guessing, numerical threshold, compatibility shim, or second parser was added.
  • Rebased onto current origin/main ed26b31c94 after refactor: retire platforms source seam #2119/refactor: prune platform split residue #2123/refactor: contract Apple platform surface #2125. The genuine overlap in scripts/layering/daemon-modularity.ts was resolved by retaining the shared declaration import and current main's retired-platform semantics; obsolete src/platforms/ logical-policy entries were removed.

Validation

  • Current base for this maintenance rebase: local origin/main and remote main ed26b31c94.
  • Planted snapshot import of src/daemon/types.ts made pnpm check:layering fail at the snapshot boundary; removing it restored the gate.
  • Removing the shared replay-test src/daemon/ prohibition made the existing logical-module test fail with zero violations; restoring it returned the test to green.
  • Focused ownership, daemon-modularity, and snapshot-boundary tests: 15/15 passed.
  • pnpm check:layering: 165/165 tests passed; layering guard OK.
  • pnpm check:affected --run: all runnable checks passed after the rebase. The selector chose the full 56-check set; GitHub-authoritative native/device/coverage lanes were skipped locally.
  • pnpm format, typecheck, lint, build, package, integration smoke, depgraph, gate-manifest, fallow, and mutation-model checks passed through the affected gate.
  • Independent read-only adversarial review against tooling: centralize machine-readable architecture ownership declarations #2126 and ADR 0004 completed with no actionable findings before this maintenance rebase; the rebase-only path reconciliation was separately audited.

Size

  • Touched files in the PR diff: 4, all under scripts/layering/.
  • Gross diff relative to current origin/main: +211 / -49 lines.
  • Move-adjusted net tooling LOC: +162 (211 - 49). The logical policy/type core is relocated and reformatted, not counted as new ownership surface; the move-adjusted net remains unchanged after reconciling the retired-platform paths.
  • Unavoidable growth: 70 lines of exact ownership data/helper, 88 lines of root/export/consumer/lookalike proof, and 22 lines wiring the existing checks to the shared declaration = 180 lines. The relocation accounting leaves 18 lines of non-relocation cleanup deleted; daemon-modularity.ts deletes 45 lines and the snapshot test deletes 4.

Residual risks

  • Native/device/coverage lanes remain GitHub-authoritative and must pass for the new rebased head; this tooling-only change does not alter those paths.
  • The vocabulary/capability lists are intentionally initial and exact. Follow-up depgraph work must add entries explicitly rather than infer ownership from names or paths.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.53 MB 2.53 MB 0 B
JS gzip 847.4 kB 847.4 kB 0 B
npm tarball 973.6 kB 973.6 kB 0 B
npm unpacked 3.36 MB 3.36 MB 0 B

npm unpacked components

Component Base Current Diff
JS / dist source 2.68 MB 2.68 MB 0 B
Apple runner source/project 581.1 kB 581.1 kB 0 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 0 B 0 B 0 B
Other package files 45.6 kB 45.6 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.6 ms 27.5 ms -0.1 ms
CLI --help 74.3 ms 74.0 ms -0.3 ms

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

Top changed packed files

No changed packed files.

@thymikee

Copy link
Copy Markdown
Member Author

Review found no code or architecture-design issues. The new architecture-ownership module centralizes the shared facts rather than adding a hand-synced oracle: existing logical-module and snapshot-policy gates consume it, while tests validate roots, public facades, exact capability exports, real consumers, and lookalikes. It leaves ADR 0003 daemon policy, ADR 0009 Apple ownership, and ADR 0019 request-binding/platform composition unchanged. The move-adjusted tooling growth is justified; no materially smaller design preserves this locality and proof. Remaining status is CI only: Smoke, Coverage, and Repo Guards were still pending at review time.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Aug 28, 2026
@thymikee

Copy link
Copy Markdown
Member Author

Re-review of exact head 340a99f0155071df6821177137e5d27ffde61b0f found no code or architecture issues. The apparent large delta is the rebase carrying merged #2078/#2119/#2123/#2125; the PR itself remains four layering-tool files. Its only rebase reconciliation removes obsolete src/platforms/ logical-policy entries while retaining current main's retired-platform boundary. #2126 remains fully satisfied: one boundary-aware declaration owns the facts consumed by the logical-module and ADR 0004 snapshot gates, with exact-root/export/consumer/lookalike and planted-red proof. No production runtime or import path changes; Size is 0 B and exact-head CI is fully green. The existing ready-for-human label remains valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tooling: centralize machine-readable architecture ownership declarations

1 participant