Skip to content

feat(modules): optional modules load through one host and are turned on under capabilities - #601

Merged
V3RON merged 13 commits into
task/596from
task/595
Oct 15, 2026
Merged

V3RON merged 13 commits into
task/596from
task/595

Conversation

@V3RON

@V3RON V3RON commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #595

Status

Implement: done (5303/5303 green) Review: round 2 passed, 1 text fix applied unreviewed Hardware: deferred to the end of the run Gate: waiting for the stack
Next: hardware check at the end of the run, then the stack gate

Done when

  • Every Tests line passes in the fast lane (pnpm test:changed: 5303 passed).
  • pnpm lint passes (commit hook: lint, boundaries, typecheck, fallow green) with the dependency-cruiser changes above.
  • simlock config get on a fresh worker prints "capabilities": {}.
  • main.ts imports nothing from src/modules but createModuleHost and types, and nothing from src/module-registry but optionalModules.

Assumptions

  • Assumption: the ordering claims "after agent-device's stop steps" (beforeDrain, beforeDriversDispose) and "after agent-device's" (doctor findings) have no cheap seam, so those tests prove the other half of each claim and their titles say only that — the green stage or the audit should check the agent-device ordering by hand.

  • Assumption: createModuleHost also takes the daemon logger (spec lists { role, definitions, config, context, wiredElsewhere }) — it logs hook failures and builds each module's child logger.

  • Assumption: the by-shape copies are named Module* in src/modules (ModuleCapabilitySource, ModuleRelayTarget, ModuleEndedLease, ModuleLeaseEndParticipant, ModuleDispatch, ModuleMount).

  • Assumption: a module's check runs only on a worker — a gateway ignores worker keys, so checking them would fail a start over a value nothing reads.

  • Assumption: a module whose findings() keeps throwing is warned once, when it starts to — doctor reads findings at startup and at every run.

  • Assumption: the fake module's default capability state is available (the old ready is not a state status.get accepts).

  • Assumption: the spec test "a module turned on is loaded once..." used state busy, which status.get does not accept (only available, unavailable, off); the fixture value is now unavailable (round 1 asked for a state other than the fake's default), nothing else in the test changed.

Review

Spec review: 5 blocking, 5 fixed, 1 notes. Code review: 6 blocking, 6 fixed, 2 notes. Claims review: 1 blocking, 1 fixed, 3 notes.
Rounds: 2. Tokens: 5.4M.

Fixed unreviewed: code: src/modules/host.ts:173 a module whose findings() throws, recovers and throws again is now tested to be warned again.

Rejected:

  • spec: src/core/config.ts:429 Assumption 4 skips a module's check on gateways, not conservative — not blocking: skipping avoids failing a start over values a gateway ignores; spec and docs do not require it

Written by an agent.

@V3RON

V3RON commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/daemon/main.ts:644 a daemon.stop after the socket claim but before onSocketClaimed runs beforeDrain first, then afterSocketClaimed starts the module after its drain hook; the host has no stopped guard
  • code: src/modules/conformance.test.ts:93 "settles within its row's deadline" can fail only by test timeout; a never-settling hook gives no named assertion
  • spec: src/daemon/main.ts:600 the host runs beforeDrain and beforeDriversDispose even when the socket was claimed by a lost race; created-not-started modules have nothing to stop
  • claims: src/contract/protocol.ts:80 the doc says CORE_ROUTE_SEGMENTS lists routes the HTTP app registers itself, but uplink is in the list and createHttpApp registers no /v1/uplink route
  • claims: src/modules/AGENTS.md:5 "the bus for types only" is true of the rule, but testing.ts imports EventBus as a value (exempt via linkTestFile)
  • claims: docs/internal/flows/startup.md:39 step 15 lists what onSocketClaimed does but omits the modules' afterSocketClaimed, which main.ts:645 calls first

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 15, 2026 12:32
@V3RON
V3RON added this pull request to stack #600 October 15, 2026 12:32
@V3RON
V3RON force-pushed the task/595 branch 2 times, most recently from 2d691b7 to 529ad68 Compare October 15, 2026 13:45
V3RON added 13 commits October 15, 2026 18:42
…capabilities (#595)

why: the host, the capabilities config namespace, core route names, the
dependency rules and protocol 38 turn the spec tests green; Config
fixtures gain capabilities: {}.

Failing: most -> 1 failing (the 'busy' capability state in optional-modules.test.ts is not a state status.get accepts)
why: the contract now requires capabilities. 4 failing -> 2 failing
…ry manuals (#595)

why: the change makes the config, HTTP and architecture docs incomplete.
2 failing -> 1 failing
why: main.ts now builds the host.
why: the manuals test. 2 failing -> 1 failing (plus the busy-state spec test)
…sts prove their claims, readiness order in the daemon manual (#595)
@V3RON
V3RON merged commit 7dec392 into main Oct 15, 2026
33 of 43 checks passed
@V3RON
V3RON deleted the task/595 branch October 15, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional modules load through one host and are turned on under capabilities

1 participant