Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(layering): classify daemon edges that reach platform mechanics through a hub - #2557

Merged
thymikee merged 1 commit into
refactor/provider-device-admissionfrom
chore/gates-daemon-root-visibility
Sep 13, 2026
Merged

test(layering): classify daemon edges that reach platform mechanics through a hub#2557
thymikee merged 1 commit into
refactor/provider-device-admissionfrom
chore/gates-daemon-root-visibility

Conversation

@thymikee

@thymikee thymikee commented Sep 13, 2026

Copy link
Copy Markdown
Member

What

Makes R76 classify daemon edges by what they reach instead of by filename (#2542, first half).

The inventory keyed on the target filename src/platform-runtime*.ts. A daemon import of a root module that imports that family itself — src/provider-device-runtime.ts is the real case — carried the same platform mechanics and was invisible to the gate. Dynamic edges were invisible too, and the ranked spine cannot see a dynamic import's direction at all (R4 cycles, R5 back-edges, R6 inversions all skip it).

computePlatformMechanicsHubs now derives the target set from the tree: the platform-runtime family plus every module outside the daemon zone that reaches it, over static and dynamic edges alike. Intra-daemon hops stay out, so the rule does not flag every file in the zone (the measured alternative was 298 pairs; the real answer is 3).

Newly visible, and classified rather than allowlisted

edge classification
daemon/server/daemon-runtime.ts -> src/provider-device-runtimes.ts composition-essential
daemon/server/daemon-runtime.ts -> src/provider-device-runtime.ts composition-essential
daemon/snapshot-interactor-capture.ts -> src/core/interactors.ts (dynamic) leaked-platform-mechanics, deepened by #2555

The dynamic interactor lookup is the interesting one: a filename pattern never would have asked for a rationale there, and it is the only production edge that leaves the daemon zone dynamically.

Verification

Planted-violation cases in scripts/layering/daemon-platform-runtime-inventory.test.ts (24 tests): a new hub import is red, a symbol added to a classified hub edge is red, a binding added to the dynamic lookup is red, an intra-daemon hop is not a hub, and the accepted paths hold on the real shapes. pnpm check:layering passes on this tip with the three entries; a recorded edge that disappears is still stale, so the inventory cannot drift in either direction.

Not in this PR

The rest of #2542 is the entry half, and it is a different shape of work: declaring the root→daemon entry surface and repairing the eight daemon-client -> src/daemon/** value edges (config.ts, daemon-process.ts, session-repair-tombstone.ts, request-progress-protocol.ts) rather than classifying them. The cut sets are small for three of those four (config.ts has 42 inbound files and needs a subset decision), so it belongs in its own change. I will file it as a child of #2542 rather than grow this PR across both halves.

Part of #2542

…hrough a hub

R76 keyed its inventory on the target filename, so a daemon import of a root module that
imports the platform-runtime family itself was invisible: the daemon could gain or widen an
edge to a root hub without any gate noticing. Dynamic edges were invisible in the same way,
and the ranked spine (R4, R5, R6) cannot see a dynamic import's direction at all.

The target predicate is now computed from the tree: the platform-runtime family plus every
module outside the daemon zone that reaches it, over static and dynamic edges alike. That
made exactly three real edges visible, and all three are classified rather than allowlisted:
the two provider-runtime hubs the daemon runtime composes, and the dynamic interactor lookup
in the snapshot capture, which is a leak and now carries the rationale and the deepening
issue (#2555) that a filename pattern never would have asked for.

Part of #2542
@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.52 MB 4.52 MB 0 B
Package (unpacked) 4.52 MB 4.52 MB 0 B
Package (download) 1.33 MB 1.33 MB -5 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.0 ms 26.9 ms -0.1 ms
CLI --help 76.2 ms 75.2 ms -0.9 ms

@thymikee

Copy link
Copy Markdown
Member Author

No actionable findings on 696a9a9. Hub derivation includes static and dynamic edges while retaining stale-entry and symbol-drift enforcement; the daemon-entry work is explicitly left to #2559. Current checks pass and there are no conflicts; ready for human review after its prerequisites.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 13, 2026
@thymikee
thymikee merged commit ab3d11e into main Sep 13, 2026
18 checks passed
@thymikee
thymikee deleted the chore/gates-daemon-root-visibility branch September 13, 2026 15:00
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-13 15:01 UTC

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.

1 participant