Skip to content

C4: retire active Carrier governance from direct Dev MCP operations #471

Description

@James3014

Goal

C4 after C1 (#431), C2 (#449), C3 (#447): retire CarrierBindingStore / ControlPlaneConsumer as admission for new Dev MCP-native cutover and direct dependency_sync operations, while preserving fail-closed historical coordination-bound recovery. DevSpace remains the local execution layer, not Nexus governance.

Fresh baseline

GitHub main at issue creation: 5c008b0b7aca3dbe8b83e192036dabf7ae001d46 (verify again before implementation). Running primary Dev M5 currently 668f5df6a84bed09f0c8d8e4f715676cf182a64d: runtime is healthy/converged to its accepted release but behind main. PR #464 / Issue #462 added a real Carrier-bound terminal cutover CLI; do not remove that historical recovery path as dead code. Open PR #412 (#407) is the older carrier-expansion direction; reconcile before any integration.

Bounded work / sequence

  1. Cutover direct path. New MCP cutover_start must create a durable direct/unbound cutover without a paired Carrier or injected coordination reader, using existing McpCutoverController, cutover file, durable operation identity and restart/finish safety. Never downgrade an existing coordination-bound generation/operation to unbound. Preserve exact durable correlation and lost-ACK same-effect readback.
  2. Dependency sync. Existing single-conversation checkout and managed isolated worktree can invoke dependency_sync under existing workspace conversation/collision/path checks without Carrier authority. Preserve frozen lock/spec hash, Git base revision, attemptKey/replay conflict, terminal witness and outcome_unknown non-replay rules; do not widen shared-checkout admission.
  3. Active wiring. Retire default Carrier/ControlPlane creation on ordinary new execution. Compatibility readers may be loaded only when an actual historical bound record needs recovery/terminalization; no new policy owner, coordinator, database or generic abstraction.
  4. CLI/migration boundary. After direct lifecycle and real live canary, remove/deprecate normal-path carrier and --coordination-reader-* governance entrypoints. Preserve genuinely needed authenticated historical bound cutover recovery including the new finish-bound path from PR feat(cutover): add carrier-bound finish-bound CLI for drained generations (#462) #464, and do not break owner sidecar before its active callers migrate. Separate follow-up gate if external owner-sidecar consumer cannot be safely switched in the same patch.
  5. Proof: deterministic RED (unpaired new cutover and non-managed direct sync fail on old main), GREEN on same inputs; old bound persisted cutover/recovery must still fail closed for unbound/mismatched caller and close with exact carrier identity; crash/lost-ACK/double start, stale source/build/manifest, restart and exact workspace/agent witness negatives; tests for affected CLI/MCP/protocol/durable boundaries, typecheck/build and exact-head CI. Final closeout only after independent review, merge and canonical install/activated build/runtime and tool projection readback.

Non-goals

No Nexus/Core governance, admission, model routing, acceptance, policy, extra controller or migration history rewrite. Do not delete historical DB tables, bound receipts/leases, chat-swarm-carrier.ts, authority_mode, withInstalledNexusCertifyOnPath(), or general provider/process/workspace safety. Do not force merge or active service restart when no exact approved artifact/build-readiness evidence exists.

Expected scope and next gate

Prefer small, independently reviewable Candidates: (A) direct cutover/dependency behavior; (B) active wiring/CLI migration once consumers are proven; (C) exact-head validation and live deployment canary. Collision checks before effects and after worker terminal. Unknown external sidecar dependencies remain explicitly blocked, not silently deleted.

In-progress C4 Candidate status — 2026-10-09 (Asia/Taipei)

NOT COMPLETE / NO AUTOMATIC CHAIN. Source-only change in managed isolated worktree ws_56dddadc8a, physical root /Users/james/.devspace/worktrees/devspace-fe76971e, exact base 5c008b0b7aca3dbe8b83e192036dabf7ae001d46. Source edits are currently uncommitted; no PR, merge, activation, or deployment was attempted for this Candidate.

  • Implemented and tested OWNER_DIRECT durable new cutover_start, exact directOperation request correlation and lost-ACK no-retry reconciliation, direct frozen dependency sync for managed isolated worktrees and single-conversation checkout, and shared-checkout admission rejection.
  • Default Carrier/ControlPlane store instantiation is now gated by actual historical persisted bound operations or explicitly supplied legacy reader bindings. Historic bound cutover/restart/finish and CLI authority recovery remain fail-closed; current no-longer-primary CLI/docs wording was marked legacy.
  • Verified before last documentation/negative-test edits: C4 MCP 2/2, server 68/68, server-ci 75/75, Carrier 51/51, ControlPlane 28/28, cutover-state 32/32, durable 16/16, typecheck and build green; additional direct-lost-ACK, binding-tamper and forged-witness negative cases green. The single npm test command hit its 300-second execution limit after passing the earlier chain; omitted tail groups were run in two chunks and passed. One unrelated PTY timing race failed once under concurrent test load and passed focused + serial rerun; node-pty spawn-helper execute mode was repaired using the repository's existing postinstall script.
  • Final post-test change: an additional negative test to prove historical Carrier-bound generation cannot be silently downgraded to OWNER_DIRECT; legacy CLI/docs description update; one unused server parameter removed. These final edits still require typecheck, focused tests, full diff check and exact-head readback.
  • Blocking concurrent live action: Dev M5 primary runtime at 668f5df6a84bed09f0c8d8e4f715676cf182a64d is in another Carrier-bound cutover 8eaa5969-80b6-44de-877b-400abf011173, phase drained, aiming at 5c008b0b7aca3dbe8b83e192036dabf7ae001d46. This is not C4's cutover. Host correctly returns CUTOVER_RECONCILIATION_REQUIRED on consequential commands. Do not bypass, restart, rebind, or finish that owner-held lease from C4.
  • Next gate: authorized owner must terminally reconcile the existing cutover; rebind live runtime/main/worktree identity, then finish final source validation and immutable Candidate commit. Separate independent review/issue-check/integration and exact accepted deploy/canary remain pending. Standalone nexus-certify executable was not found on this Mac's known PATH locations; do not claim Issue-bound completion without it.

2026-10-09 C4 published Candidate gate

Committed and pushed exact C4 Candidate 67c674fa11f47c98e6b172620830439ee85bee9c (tree 8d8e439658f17cf3dd3963228a5768258815ee79, base 5c008b0b7aca3dbe8b83e192036dabf7ae001d46) on branch c4-retire-carrier-governance-471; opened PR #478. Verified build, typecheck, durable 17/17, server-ci 75/75, Carrier 51/51, ControlPlane 28/28, cutover state 32/32, MCP cutover 16/16, CLI 5/5; source tree clean after commit. Original separate bound cutover 8eaa5969-80b6-44de-877b-400abf011173 is CLOSED; live authoritative primary runtime converged at main 5c008b0b…, not Candidate. Independent review is NOT complete: Claude/HerdR reviewer agt_7674682f failed to launch (provider disabled), Gemini reviewer agt_5d2b340c timed out at its 180-second cap with no terminal semantic verdict. Do NOT infer acceptance from either attempt. Exact-head independent review/Core issue-check/required CI, PR merge, release and live C4 canary remain pending. Issue remains open.

Activity

  1. James3014 commented on Oct 9, 2026

    @James3014
    OwnerAuthor

    C4 read-only verification update — 2026-10-09 (Asia/Taipei)

    Exact immutable Candidate is still 67c674fa11f47c98e6b172620830439ee85bee9c (tree 8d8e439658f17cf3dd3963228a5768258815ee79), base/main 5c008b0b7aca3dbe8b83e192036dabf7ae001d46, PR #478 OPEN / mergeable but GitHub mergeStateStatus=BLOCKED, statusCheckRollup=[]. C4 worktree ws_56dddadc8a clean; no code, branch, PR, runtime or deployment mutation occurred in this verification pass.

    Fresh tests on exact Candidate: npm run typecheck PASS; npm run build PASS (devspace-1.0.7-67c674fa); git diff --check origin/main...HEAD PASS; node --import tsx --test src/durable-operations-ci.test.ts 17/17 PASS; src/server-ci.test.ts 75/75 PASS; combined src/carrier-binding.test.ts src/control-plane-consumer.test.ts 79/79 PASS; combined src/cutover-state.test.ts src/mcp-cutover.test.ts 48/48 PASS. CLI remains unresolved: combined cutover+CLI run 52/53, and isolated src/cli.test.ts 4/5, where a test resource emitted a post-test uncaught assertion 'error' !== 'idle' for a mock Agy worker (source src/cli.test.ts:536). Do not re-label this PASS or attribute it to C4 without a clean-base countercheck; concurrent test/provider load may be a confounder.

    Independent reviewer availability/status:

    • Earlier Claude reviewer agt_7674682f: terminal provider disabled; no verdict.
    • Earlier Agy Gemini agt_5d2b340c: terminal 180s limit; no verdict.
    • Fresh Agy agt_d6ce2838: terminal idle with no semantic review verdict. Requested gemini-3.7-flash, CLI UI displayed Gemini 3.8 Flash, model attestation unavailable; despite read-only tool ceiling, reviewer launched npm test (provider enforcement REQUEST_ONLY_NOT_ENFORCED). Reconciled: no changed repo paths / exact HEAD unchanged. Not valid independent acceptance evidence.
    • Fresh OpenCode Nemotron agt_af8d038b: terminal PROVIDER_EXECUTION_ERROR, Invalid opencode/openai-compatible-chat stream event, no review verdict and no changed paths.

    Additional read-only source review question, not yet adjudicated as a defect: requiresLegacyCarrierRecovery in src/server.ts:6812 treats any cutover journal with coordinationBinding as a recovery reason, even if phase='closed'. This may be intentional to preserve lost-ACK/pin-release recovery; decide from actual persisted lease/terminal receipt evidence before optimizing. Do not remove legacy readers blindly.

    Disposition: INCOMPLETE, NOT ACCEPTED / NOT MERGED / NOT DEPLOYED. Next gate is an independent exact-head source/security review with trustworthy model/transport and qualified verdict, determination of CLI flaky fixture via clean-base comparison or repair, required CI/issue certification, then explicit integration permission and exact accepted cutover/install/runtime/tool-projection canary. Do not bypass branch gates or the existing protected legacy cutover lifecycle.

  2. James3014 commented on Oct 9, 2026

    @James3014
    OwnerAuthor

    C4 final implementation / independently verified source / external GitHub gate — 2026-10-09 Asia/Taipei

    Disposition: CODE_READY / ISSUE_VERIFIED_NOT_RELEASED / GITHUB_ACTIONS_BLOCKED. Not merged, deployed, activated or closed.

    Exact source: PR #478 branch c4-retire-carrier-governance-471, head f954a20cad6e041ef3f689573f031c4d5a6b4b8e, tree 9d0f103c4c9075248acc6c0f8cca70cac7384477, unchanged base/main 5c008b0b7aca3dbe8b83e192036dabf7ae001d46. Git remote head and managed worktree ws_56dddadc8a physically agree; clean status.

    Independent review and repair:

    • Read-only independent Claude Sonnet review of original 67c674fa found F1 HIGH: a closed historical Carrier-bound cutover could be archived before durable lease/operation terminal writeback, permanently stranding recovery. Reproduced deterministic RED in src/durable-operations.test.ts before the fix.
    • New f954a20 adds a twice-checked assertLegacyBoundCutoverIsTerminal gate in src/durable-operations.ts (pre-intent and under atomic effect boundary). It validates exact bound operation, scope, request/binding correlation, terminal receipt and physical journal hash before allowing archive. Fixed RED test went GREEN. Independent read-only Claude re-review of f954a20 reports advisory conditional PASS, no remaining HIGH/CRITICAL. F2 pre-intent active-fence attemptKey poisoning is LOW/MEDIUM fail-closed operational friction, not an unauthorized effect. F3 checkout TOCTOU concern not source-proven and requires separate hardening if confirmed. Reviewer has no Candidate acceptance or Owner approval authority.
    • Fresh local tests on the amended source: durable 18/18, Carrier+ControlPlane 79/79, cutover-state+MCP-cutover 48/48, server-ci 75/75, TypeScript typecheck/build/diff-check all PASS.
    • Exact macOS Node26 src/cli.test.ts remains 4/5 because of an async mock Agy error != idle assertion. This was independently reproduced 4/5 on a fresh isolated clone of the completely unchanged base 5c008b0; this is a pre-existing baseline failure, not a C4 regression.

    Authoritative local Nexus Core evidence:

    • The Issue body has the universe marker sha256:067385413f215bfa515e07d7e20b27b074040c19540e48aef9ae002cd314eec9; PR body has <!-- NEXUS_CORE_ISSUE: 471 -->. nexus-certify issue-init --force --issue 471 bound the Issue.
    • nexus-certify issue-check --issue 471 --require-trusted-config completed in pinned isolated Node22 container verifier(s): issue verification VERIFIED (not RELEASED), both required evidence subjects devspace/full-tests and devspace/typecheck-build-doctor PASS with exit 0; source f954a20, tree 9d0f103, base config 5c008b0. Local evidence receipt .nexus-core/receipts/20261009T075321.740133+0000-ef576579a84d.json.
    • Separate canonical nexus-certify receipt-check with exact subject/head/tree/base/Issue/repository/clean/trusted requirements returns valid:true, eight expectations PASS, reason_codes:[]. This is LOCAL verification evidence, not GitHub's required signed CI check or production release.

    External hard blocker: GitHub Actions platform. GitHub PR #478 remains OPEN, mergeStateStatus=BLOCKED, statusCheckRollup=[] (no required Nexus Core issue completion status). Actions runs for exact f954a20 = zero; no Actions runs for the branch despite PR edit, close/reopen, and a new pushed commit. Manual gh workflow run ci.yml --ref c4-retire-carrier-governance-471 fails HTTP 422 Actions has been disabled for this repository. Yet repository GET /actions/permissions says enabled=true/allowed_actions=all, both workflow definitions show active, and an idempotent PUT of the same enabled settings did not restore dispatch. Root cause is unknown external Actions/account/platform eligibility, not proven billing. No fabricated status, disabled protection, bypass merge, forced release, or Dev M5 runtime restart performed.

    Next gate: Have the GitHub account/platform owner or GitHub Support restore GitHub Actions execution; re-trigger real pull_request and pull_request_target workflows and obtain the required Nexus Core issue completion trusted status on the same exact PR head. Recheck branch rules/head and independent acceptance, then perform protected CAS merge, canonical accepted install/cutover/restart and live primary runtime/tool-projection readback. Only after these gates pass can #471 be CLOSED as C4 complete.

    No automatic retry/resume or background execution claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions