refactor(platforms): sink the shared src/platforms root files into their substrate homes - #2100
refactor(platforms): sink the shared src/platforms root files into their substrate homes#2100thymikee wants to merge 2 commits into
Conversation
|
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks:
Top changed packed files
|
|
[P1] Keep capture-kit an owning domain, not platform-common. ADR-0019 explicitly limits it to durable-capture mechanics, but this head publishes unrelated app-resolution, boot, command-attempt, install-source/network, perf, and toolchain utilities from it. R18’s hint does not supersede that decision. Split the shared files behind cohesive domain owners/interfaces, or explicitly amend and enforce the architecture before W4–W6 cement this dependency. [P2] Also gate W3’s claimed closure: current export/budget tests do not reject a new direct production file under Not ready, and still stacked on open #2090 with failing base Coverage; Android/iOS checks on this head are pending. |
|
Both points addressed on P1 — capture-kit is back to its ADR-0019 durable-capture scope (36 exports; P2 — a Validation on the new head: layering (152/152, R11 now 18 packages / 201 subpaths), boundary pins, budgets (411, rows re-homed and measured), depgraph/mutation/gate-manifest suites, fallow clean vs both W2 and main, Generated by Claude Code |
|
The original capture-kit/root-shape findings are improved, but this head is still not ready.
Remove the remaining touched W3/history/control-flow comments and unused sync tmp helper under current |
dde8f75 to
d00f7af
Compare
|
Both P1s addressed on the new head (stacked on the reworked #2088/#2090, which carry the ADR-0019 substrate amendment and the capture-kit snapshot-behavior move): Contracts is vocabulary-only now. The executable policy left for its owners: The provision-kit direction is enforced, both ways, planted red. Also removed: the unused sync tmp helper in the provision-kit fixture and the touched W3/history comments (budgets section markers, the root-shape docblock narration, the gate message's issue reference). Validated: layering 154/154 (including the two new planted-red cases), boundary pins, budgets 413 with re-homed measured rows, fallow clean vs both W2 and main, typecheck/lint/format, depgraph + mutation model suites, 1,481 targeted tests, and Generated by Claude Code |
|
The contracts and provision-kit direction findings are fixed, but this head is still not ready.
The platform→provision-kit dependency direction and reverse-edge gates are now coherent and planted-red. Exact-head iOS smoke is still pending, and this remains stacked on open #2090, whose current Android and iOS smokes fail. No readiness label. |
|
The comment trims are pushed ( On the remaining P1 — the three helpers have now been rejected in contracts and in capture-kit, and every candidate left has a real cost, so before pushing a third relocation I want to name the design I'd implement and the trade each alternative carries:
Given the round-trips on these exact files I'd rather burn one reply than a fourth speculative push: which shape should W3 carry? If no preference, I'll implement option 1 in full. Generated by Claude Code |
baf9c86 to
15ec144
Compare
|
Exact-head iOS smoke on Generated by Claude Code |
|
Not ready. W3 still moves non-capture settings parsing, generic command-attempt rendering, and unsupported-interactor behavior into capture-kit solely because they are cross-family. Their consumers show separate settings and interaction domains; put them behind named owning seams (or retain family ownership) instead of recreating platform-common in a substrate package. Remove the R13 control-flow narration in |
15ec144 to
8a9c835
Compare
|
Addressed on Family ownership for the four modules you named. None of them is in capture-kit any more:
provision-kit sits on host-kit now, not capture-kit: its archive, exec, path and stream imports resolve to the The R13 control-flow narration in Three provision-kit budget rows moved to their measured values because those modules now close over whole host-kit seams — same deliberate cost as the seam split itself, updated in this PR rather than left as headroom. Green on this head: typecheck, lint, Generated by Claude Code |
|
The prior settings/interaction ownership blocker is resolved: behavior stays with family/root owners instead of capture-kit. Still not ready. Changed-line Coverage is red at 65.31%; add focused colocated tests for Android/Apple settings and Vega unsupported-interactor error/rejection paths with planted proof. Android smoke is red on native-alert cancellation, base #2090 remains DIRTY/open, and this PR is UNSTABLE. Remove the duplicated |
8a9c835 to
ca88f7c
Compare
|
Not ready. [P1] Rebase onto current stacked base #2090 (37f146f): this head's merge-base is the obsolete ea1d6b8 chain, so its 641-file compare and CI do not validate the current narrow host-kit stack. Preserve #2090's current capability seams. [P1] Changed-line coverage is owner-action red at 65.31%: add owning branch tests for the new Android/Apple settings parsers and Vega unsupported-interactor. [P2] Remove the duplicate ./snapshot-desktop-projection export key in packages/capture-kit/package.json; JSON silently masks it. [P2] Remove the new root-shape implementation narration in scripts/layering/platform-package-policy.ts under current comment policy. The provision-kit ownership and planted direction/root-shape gates are otherwise sound. After rebase, rerun or same-load base-compare the red Android and iOS native lanes. |
|
Rebased onto the restructured stack; this branch is now The five conflicts were all the same shape — W3's destinations meeting #2088's new capability ports — and resolve to: The port split also shrank two provision-kit closures, so their rows drop in this PR rather than leaving headroom: Green on this head: typecheck, lint, Android Smoke is red here for the same cause as the rest of the stack; the write-up is on #2088 — it reproduces identically on unrelated PRs while Generated by Claude Code |
|
Re-review after rebase: the stack blocker is fixed — this head is now directly based on current #2090, and the W3 delta is only ~+192 net production lines, so no size escalation. Still not ready: the prior coverage remedy is absent (no owning tests were added for Android/Apple settings-parsing or Vega unsupported-interactor), so the prior 65.31% changed-line failure remains unaddressed until new exact-head Coverage proves otherwise. Remove the still-duplicated ./snapshot-desktop-projection export in packages/capture-kit/package.json. Remove remaining narration in scripts/layering/platform-package-policy.ts, packages/provision-kit/src/tmp-dir.fixtures.ts, and scripts/layering/package-boundaries.test.ts. Provision-kit ownership/root-shape gates are otherwise sound; exact-head coverage/integration/guards/native lanes must finish green. |
|
Still not ready at unchanged Prior code blockers remain: |
ca88f7c to
e1207ca
Compare
|
All four addressed on [P1] Rebased. The one conflict was the kernel budget rows meeting [P1] Coverage. The three moved-out modules arrived without owning tests, so their branches rode on callers. Each has one now:
[P2] Duplicate export key removed. [P2] Root-shape narration removed from Green on this head: typecheck, lint, The Android and iOS native lanes re-run on this push. The write-up on #2088 has the same-load comparison: the Generated by Claude Code |
…eir substrate homes (#2082 W3) The shared files left directly under src/platforms move onto a declared owner: provisioning mechanics (install-source family, toolchain probing, boot-failure classification, app-resolution caching) form @agent-device/provision-kit above capture-kit; host mechanics resolve to host-kit's seams; kernel takes the pure numeric helpers; contracts keeps vocabulary only. Settings parsing, command-attempt rendering, and the unsupported-interactor factory stay with their families rather than pooling in a substrate package: android and apple settings each own their parsing, and the unsupported-interactor factory lives in root core with a vega-local copy. A platforms-root-shape rule rejects any new shared file or directory appearing directly under src/platforms, and the provision-kit direction gates (no platform imports in, no capture-kit importer) are planted red. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VngeKZH6zBuJzNBk5YzUH
…actories The settings parsers and the unsupported-interactor factory arrived without owning tests, so their branches rode on callers. Each now has one: the appearance/state parsers over every accepted spelling and their rejections, the attempt summarizer over its arg join and stderr budget, and both interactor factories over the whole operation surface and the per-instance label. Also drops the duplicate ./snapshot-desktop-projection export key that a rebase left in capture-kit's manifest, where JSON silently keeps the last, and the root-shape docblock the violation message already states. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VngeKZH6zBuJzNBk5YzUH
e1207ca to
39d5c1a
Compare
|
Now on Three of the four items were already fixed on On the Coverage failure, taking your instruction not to call it a flake without the base comparison: I ran the comparison locally rather than waiting on CI. Android, Linux and macOS smoke were green here; iOS and Coverage re-run on this push. Generated by Claude Code |
#2082 W3, stacked on #2090. Retires the shared files sitting directly under
src/platforms, so the family trees can move behind their exports maps.What owns what
@agent-device/provision-kit(new, above capture-kit) owns the provisioning domain — everything that gets a device and app ready to run: install-artifact acquisition (local paths, archives, guarded network downloads), host toolchain probing, device boot-failure classification, and app-resolution caching. It depends on host-kit's ports, never on capture-kit.@agent-device/kerneltakes the pure numeric helpers (roundPercent,roundOneDecimal).@agent-device/contractskeeps vocabulary only.What deliberately did not move
Settings parsing, command-attempt rendering, and the unsupported-interactor factory are cross-family but not one domain, so pooling them in a substrate package would have recreated platform-common under a new name. They stay with their owners instead:
src/platforms/android/settings-parsing.tsandsrc/platforms/apple/core/settings-parsing.tseach own their appearance/state parsing and attempt summarizing.src/core/interactors/unsupported-interactor.tsserves the web interactor, with a local copy insrc/platforms/vega/.Each of those now has an owning test over its accepted spellings, its rejections, and the whole interactor surface.
Enforcement
platforms-root-shaperejects any new shared file or directory appearing directly undersrc/platforms.package-boundaries.test.ts; each carries an exact eager-closure row.Two of those rows drop in this PR rather than leaving headroom, because #2088's capability ports shrank them:
install-artifact-archive-context20 → 10 andtoolchain-probe15 → 8.🤖 Generated with Claude Code
https://claude.ai/code/session_018VngeKZH6zBuJzNBk5YzUH