Repository navigation
refactor(move): collocation batch 1 — allocator contract into managed-allocation - #3287
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
2 issues found across 33 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/adr/0032-collocation-decision-table.md">
<violation number="1" location="docs/adr/0032-collocation-decision-table.md:28">
P3: The File column in the capture-kit table mixes path prefixes: the four admission-ledger rows write `capture-admission/audio-probe-admission-ledger.ts` (no `src/`), while the other four rows in the same table write `src/durable-json.ts` and `src/snapshot/...`. Every other zone's rows consistently use the `src/` prefix. Since this column is the table's key (one row per candidate), normalize the ledger rows to `src/capture-admission/...` (files live at `packages/capture-kit/src/capture-admission/`) so all eight rows resolve the same way.</violation>
<violation number="2" location="docs/adr/0032-collocation-decision-table.md:40">
P3: The contracts-section prologue says "every candidate below has dependents in two or more higher-ranked zones, so no single consumer zone can own it without inverting the spine (R5)" — but the `managed-device-allocation.ts` row directly below it is the counterexample: it was moved into managed-allocation precisely because that single consumer zone can own it without new edges (daemon already depends on the package). The universal wording contradicts the table's own outcome and muddies the R5 rationale for a reader checking why this one file moved. Scope the claim to the keep rows, or add the exception.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
62200ec to
d7239c3
Compare
|
This PR is ready at d7239c3, and all 19 checks pass. The diff only touches type imports, the export maps and the ADR docs, so any export-resolution failure would have shown in the typecheck and layering jobs, which are green. There are no conflicts. Not blocking: the intro sentence in docs/adr/0033-collocation-decision-table.md (https://github.com/callstack/agent-device/blob/d7239c3/docs/adr/0033-collocation-decision-table.md#L6) is hard to read and links ADR 0021 for no clear reason, so a rewrite without that link would help. The PR body also says the README lists 0032, but only the 0033 row was added, so there is a 0032 gap until #3286 merges. You can take or leave both. I did not re-run check:affected, check:layering, check:production-exports or the modularity measurement, and I relied on CI and the PR-body numbers for those. I also did not check the R-number reasons on the keep rows (R13, R18, R78) against the layering model. |
d7239c3 to
161b022
Compare
|
Closing the loop on the two non-blocking items — both accepted, pushed as a prose-only amend at
|
|
Design follow-up on
The enduring rule should be ownership and reduced change coupling. Dependency-community scores identify candidates; current guard filenames are constraints to account for, not independent evidence that a location must stay forever. |
161b022 to
2899040
Compare
2899040 to
6701ab9
Compare
|
Both reconciliations landed at
|
…ed-allocation The port and its lease vocabulary had no importer outside managed-allocation and the daemon composition that already depends on that package, so the types now live beside the allocation operations that implement them. The package gains an @agent-device/managed-allocation/managed-device-allocation subpath and contracts drops the old one; consumers re-point to the new specifier.
One row per file in #3276 section 5: move, merge, or keep with the checked direction that fails. Batch 1 moves only the managed-device allocator contract into managed-allocation; the limrun files have no seam and the capture-kit ledger moves would invert an existing package edge. ADR 0021's contract link follows the moved file.
6701ab9 to
d4ac518
Compare
|
The code in 6701ab9 looks good. The move diff is identical to the head I reviewed earlier (d7239c3), so my earlier clean result still holds. Both ADR wording fixes from that round are now in place. All 19 checks pass, and there are no conflicts. I did not re-run the layering or check gates locally, and I did not re-read the full move diff, so this relies on the CI results and the identical diff. Of the three cubic-dev-ai threads, the ADR line 144 thread (#3287 (comment)) and the capture-admission path prefix thread (#3287 (comment)) are fixed at this head, so you can resolve them. The Contracts prologue wording thread (#3287 (comment)) does not apply, since the meaning is unchanged and it is docs-only, so you can resolve it too. Nothing else stands in the way of merging. Since then the branch was rebased to d4ac518. The range-diff shows the same commits, with only the ADR index context changed after ADR 0032 merged, so this result should carry over once CI finishes there. |
|
Summary
Part of #3276 §5. Closes #3281.
0032-layering-graph-engine.md). This PR's README change adds only the 0033 row; docs(adr): retain the current layering engine (ADR 0032) #3286 has since merged with the 0032 row, and the rebase keeps both rows side by side: a decision table with one row per candidate file in the umbrella's collocation list —move,merge, orkeepwith the direction that was checked and fails. Required behavior (a) of Architecture WS5: collocation decisions and first refactor(move) batch #3281.refactor(move):packages/contracts/src/managed-device-allocation.ts→packages/managed-allocation/src/managed-device-allocation.ts, new@agent-device/managed-allocation/managed-device-allocationsubpath; contracts drops the old subpath. The port and its lease vocabulary had no importer outside managed-allocation and the daemon composition that already depends on it.durable-json.tscannot move to managed-allocation because managed-allocation already depends on capture-kit (the move would invert an existing package edge), and the three limrun files have no seam —src/sdk/limrun.tsis the publishedagent-device/limrunfacade entry,limrun-runtime-types.tsis a public-type refinement colliding with the package-internal names, andsrc/provider-limrun-runtime.tsself-builds the root's ADR-0019 dependency factory in its constructor.33 files; the move itself is rename-only (
git diff -M90% --summaryshows the file at 98% similarity; the rest are one-line import re-points and docs). The ADR 0021 link edit is independent of the renumber (it points at the moved contract file, not an ADR number).Validation
d4ac51874(rebase onto origin/main after docs(adr): retain the current layering engine (ADR 0032) #3286/refactor(layering): rank every root module so R5 sees through (root) #3288 merged; conflict resolved keep-both indocs/adr/README.md, 0032 + 0033 rows side by side):pnpm check:affected --runexit 0, "all runnable checks passed";check:layeringgreen on the new spine (R80/R6 at the new merge-base).6701ab987(ADR reconciliation with refactor(layering): rank every root module so R5 sees through (root) #3288/Architecture WS9: physical root-pass moves for daemon-diagnostics-scope, runtime-command-surface, runtime-factory #3294 after the design follow-up):pnpm check:affected --runexit 0, "all runnable checks passed".161b02234(prose-only ADR intro rewording):pnpm check:affected --runexit 0, "all runnable checks passed".d7239c323:pnpm check:affected --runexit 0, "all runnable checks passed" (59 selected checks; the singlecheck:affected: lint failed.line in the log ischeck:affected:test's own envelope fixture, reproduced identically on every run at the same position — standalonepnpm lintexits 0).62200ec25passed the same gate; this round changed onlydocs/adr/files.check:layering,check:agent-guidance,typecheck,format:check, focused vitest (managed-allocation package + daemon allocation + reachability + allocator-fake, 116 tests) green.check:production-exports: identical finding count on origin/main and head (55), so no export-surface delta.Docs-only ADR rows need no runtime evidence.