refactor: sink package-closed src modules into existing packages - #2106
Conversation
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks:
Top changed packed files
|
|
Not ready. This turns contracts/capture-kit into generic sinks: mutable interaction-outcome WeakMap lifecycle is not vocabulary, snapshot warning selection/rendering is executable presentation policy, and request-scoped AsyncLocalStorage inventory dispatch is not durable-capture mechanics. Move them behind focused interaction, snapshot-presentation, and root-runtime owners; add planted semantic/root-shape gates rather than expanding export allowlists. Remove touched history/control-flow narration and wait for exact-head CI. |
|
Addressed on The three sinks are no longer in contracts/capture-kit:
Planted gates instead of export-map growth: R18 rejects those two contracts paths (observed red on the pre-move tree, including the WeakMap/ Exact-head CI on |
06324ae to
f5612d9
Compare
|
Rebased onto |
|
The contracts/capture ownership repair is now sound: runtime state is back in core/request/snapshot-presentation owners, the bad public subpaths are retired, and R18/R70 have planted regression proof. Not ready under current main's comment rule: remove the moved implementation/history narration from packages/ad-script/src/index.ts, src/snapshot/snapshot-presentation/quality-warnings.ts, src/core/interaction-outcome.ts, and src/request/device-inventory-context.ts; names, types, module boundaries, and tests should carry those invariants. Native smoke is still incomplete. |
|
Addressed on Removed the moved implementation/history narration from:
Names, types, module boundaries, and tests carry those invariants. Native smoke is still incomplete; this head is published, not merge-ready. |
|
Re-reviewed Not merge-ready solely on exact-head evidence. Android smoke failed at |
|
Re-reviewed Minor PR-body hygiene: replace the stale “not merge-ready” / |
|
Validation is now stamped to exact-head |
Move closed modules into contracts, kernel, capture-kit, and ad-script, and declare DaemonCommandDescriptor in core so R6/R9 can pin the remaining provider-webdriver type cycle. Co-authored-by: Cursor <cursoragent@cursor.com>
Move interaction-outcome, snapshot warning rendering, and inventory ALS behind focused owners, and plant R18/R70 domain-shape gates so they cannot return as package export-map growth. Co-authored-by: Cursor <cursoragent@cursor.com>
Names, types, and tests already carry those invariants; the relocated files should not keep review-history or control-flow narration. Co-authored-by: Cursor <cursoragent@cursor.com>
W1 moved the verdict into capture-kit and this PR moved warning rendering into snapshot-presentation, so the ranked zone no longer has production files. Co-authored-by: Cursor <cursoragent@cursor.com>
be2c611 to
f48d2d9
Compare
|
Rebased onto Conflicts were the expected mechanical surfaces: kernel/capture-kit Typecheck, layering, and eager-closure budgets are green locally. Exact-head CI on this rebase is still the authority — not merge-ready. |
|
Summary
Operators, CLI, daemon, and MCP behavior are unchanged. Package-closed codec modules move into
@agent-device/ad-script, screenshot geometry into kernel, andDaemonCommandDescriptoris declared in core so the type graph can ratchet. Executable policy does not go into contracts or capture-kit.src/core/interaction-outcome.tssrc/snapshot/snapshot-presentation/quality-warnings.tssrc/request/device-inventory-context.ts@agent-device/kernel/screenshot-geometryparseReplayInput→@agent-device/ad-script(still exports only.)DaemonCommandDescriptoris generic overDispatchedCommandin core; daemon re-exports the live table. R6 inversions 7→5. R9 pins the remaining 6-fileprovider-webdrivertype cycle.R18 rejects
packages/contracts/src/interaction-outcome.tsandsnapshot-quality-warnings.ts. R70 rejects capture-kitasync_hooks/AsyncLocalStorage and a reintroducedsrc/contracts/tree. Both were observed red on the pre-move tree.Related to #2082 (does not close it). Rebased onto main after W1–W3 (#2088 / #2090 / #2100).
Validation
Rebased onto
origin/main(2e87347bee) atf48d2d983b. Local typecheck, layering (including planted R18/R70), and eager-closure budgets are green. Command output and routing are unchanged (moves, specifier swaps, type relocation, and layering gates).Docs: AGENTS.md points cross-layer contracts at
@agent-device/contractsand keeps W1 request-cancel/progress in capture-kit; findings.md §0 records the remaining five R6 inversions. ADR 0012 still cites the historicalsrc/compat/replay-input.tspath.Published and reported, not merge-ready: CI on
f48d2d983bis still the authority.