Skip to content

[architecture] Define end-to-end MCP admission regression for #181 - #200

Merged
Joncallim merged 49 commits into
architecture/issue-180-mcp-operator-copyfrom
architecture/issue-181-e2e-admission-regression
Aug 2, 2026
Merged

[architecture] Define end-to-end MCP admission regression for #181#200
Joncallim merged 49 commits into
architecture/issue-180-mcp-operator-copyfrom
architecture/issue-181-e2e-admission-regression

Conversation

@Joncallim

@Joncallim Joncallim commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Source Issue

Refs #181
Refs #172

Status

Round 26 (orthogonal, merge-aware) is complete and this PR is now MERGEABLE.

The key correction from Round 25: that pass reviewed the S6 head in isolation and wrongly called two P0 findings stale. Re-running the review against the merged result of the current #198/#199 stack showed both were real and recur on merge, because the same files are edited on both sides. The branch was 66 commits behind its base with five conflicting files, all at the S6↔S4/S5 seam.

All five conflicts are resolved, and the merged tree is verified green: tsc --noEmit, eslint --max-warnings=0, test:unit:zero-skip (1741 passed / 0 failed), test:mcp:contract, next build, and git diff --check all clean, with every manifest partition collecting exactly its declared scenario IDs. See docs/architecture/issue-181-review-amendments.md ("Integrated review round 25") for the per-conflict resolution table and the beta-scope note.

Round 26 also found, by running the merged suite against a real PostgreSQL 16, that the S6 packet-issuance partition was duplicating coverage #179/S4 already owns — through a routine the packet issuer is now deliberately forbidden to call. That partition has been removed from S6 end to end and handed back to S4; see "Packet issuance belongs to #179/S4" in the amendments doc. The S6 manifest is now five partitions driven by four suite commands.

Not yet covered, and stated plainly: the Playwright mcp-postgres and mcp-operator-* partitions were collected but not executed here, and the host-boundary partition still requires the self-hosted trusted runner.

This PR contains architecture and test scaffolding only. The entire S6 controller surface is imported solely by its own unit tests — no route, worker, CLI, or component references it — so it cannot change application behaviour in this beta.

Summary

Defines the release-critical S6 proof system for Epic #172: exact contract fixtures, real PostgreSQL/routes/workers, thin Playwright operator flows, a separately trusted supported-host controller, signed evidence, output quarantine, teardown/destruction proof, and the ten-node activation gate.

Scope

  • Documentation and test architecture only; no production admission-policy change, implementation, commit automation, or merge authorization.
  • Owns fixtures, partitions, controller seams, supported-host proof, evidence envelopes, release receipts, stop conditions, and operator verification.
  • Imports S1–S5 production contracts without widening or reinterpreting them.

Integrated Review Rounds

Findings Corrected

  • Restored the exact ten-node runtime graph, compatible S5/disabled-S6 placement, post-activation proof, final readiness, and readiness-before-root-scrub rule.
  • Forbade direct retry from bare not_started; only exact durable definitive_not_started may authorize it.
  • Made surviving orphaned invoking recover to uncertain; only the still-live owner may commit returned.
  • Qualified packet-artifact cardinality on coherent terminalization/authorized repair and removed unsafe liveness promises when host/containment proof is unavailable.
  • Added copied-principal token, historical-plan-sink, no-op producer, legacy-digest, crash-after-return-before-CAS, and unavailable-host sentinels.
  • Preserved the external-controller trust boundary, exact GitHub App/check identity, zero-egress runner, signed output allowlist, and teardown/destruction receipt.
  • Added pre-Step-0-schema bootstrap proof, all-node Ed25519 and canonical-transition duplicate tests, and atomic dual-consumption rollback/replay races.
  • Added the exact 1,560-second provisional enablement window, inspect/disable commands, controller/suite/database/check failure closure, and final promotion proof.
  • Added duplicate-key-before-JSONB, protocol-v2 null-identity, human-session/package-session_user reader, historical task-log scrub, append-only reapproval/index migration, branded S5 join, and eight-head attack matrices.
  • Imported distinct durable-evidence and transition-authorization domains, exact authorization-attempt terminology, the direct-controller rotating lease, sole authoritative state enum, replacement pending gate, and exact 660-second five-phase proof.

Round 24 Corrections

  • Imported the exact final public.sessions digest/expiry/revocation/rekey migration and its valid, expiry, cache-failure, crash/resume, concurrency, and raw-key-removal regressions.
  • Imported the exact 32-byte controller secret/digest constants, helper names, shared fixture/vector, constant-time comparison, and negative/race matrix.
  • Required S3 to consume one fresh exact unexpired transition authorization separately from durable Step 0 evidence before recording s3_issue_178.
  • Corrected duplicated normative wording and recorded the Round 24 rationale in the review-amendment history.

Cross-Slice Contracts

  • Imports S3’s lock/grant/reconciliation contracts, S4’s typed evidence/recovery/three-lease contracts, and S5’s compatible presentation mapping.
  • Does not create production enums, action identities, migrations, grants, retries, or artifacts.
  • Uses the one [FEATURE] S4 — Specialist prompt and bounded context packet assembly with run evidence #179-owned release manifest and proves separate code dependency and runtime activation.
  • Records s5_s6_release_ready only after ingress/issuance enablement evidence; legacy-root scrub is forbidden before that exact receipt.

Remaining Implementation Risks

Architecture readiness is not release proof. Implementation must still execute real PostgreSQL interleavings, supported Ubuntu containment, distinct principals, copied-token attacks, controller signature/App checks, zero-egress and output-leak sentinels, teardown/destruction, exact manifest counts, and every stop condition.

Exact Implementation Order

  1. [FEATURE] S1 — Unified MCP admission contract and capability taxonomy #176 / S1 — canonical MCP admission.
  2. [FEATURE] S2 — Consolidate MCP admission onto the shared core and enforce it at approval #177 / S2 — planning and handoff persistence.
  3. [FEATURE] S4 — Specialist prompt and bounded context packet assembly with run evidence #179 Step 0 — retention bridge; close and drain all project-management ingress.
  4. [FEATURE] S3 — Deterministic bounded filesystem context grant/denial recovery #178 / S3 — filesystem grant recovery and canonical lock manifest.
  5. Remaining [FEATURE] S4 — Specialist prompt and bounded context packet assembly with run evidence #179 / S4 — bounded packet issuance, evidence, and recovery.
  6. [FEATURE] S5 — Unified operator UI copy and recovery-action contract for MCP admission #180 / S5 — compatible operator readers and presentation.
  7. [FEATURE] S6 — End-to-end MCP admission regression (tiny task-tracker flow) and preview==handoff invariant #181 / S6 — disabled controller and pre-activation evidence.
  8. Controlled activation, then exact post-activation evidence while writers and ingress stay closed.
  9. Open the signed ingress_and_issuance_enabled node as the non-extendable 1,560-second provisional operation; every boundary also requires the direct-controller 10-second heartbeat and at-most-45-second live lease_expires_at.
  10. Run the exact no-retry 60+30+420+120+30 = 660-second enabled proof; atomically consume both enablement and enabled_build_tests_green, append s5_s6_release_ready, and promote only that exact live operation.
  11. Only then run the legacy-root scrub.

Validation

  • Head: c86e6d3 (merged with base c7d2dcd; PR reports MERGEABLE / CLEAN)
  • Base: architecture/issue-180-mcp-operator-copy at 277f5d5a757b1e50ab303956d73b28fd8cdc46d4
  • Draft/open; no merge requested.
  • Architecture, test scaffolding, and CI wiring; git diff --check clean.
  • Web CI green on the merged tree. Every manifest partition executed rather than skipped: test:mcp:contractMCP_VITEST_CONTRACT_PASSED; test:mcp:postgres and e2e:mcp-operatorMCP_PLAYWRIGHT_CONTRACT_PASSED (the wrapper runs with --forbid-skips --forbid-retries and proves collected IDs = executed IDs = manifest); mandatory S4 PostgreSQL zero-skip proof, mandatory S3 PostgreSQL concurrency proof (14 passed), Step 0 disabled-ingress (1 passed), and the fail-closed Step 0 E2E bridge suite (23 passed) all ran.
  • The 14 + 2 split across the generic and mcp-postgres projects matches the merged filesystem-grant-lifecycle-concurrency.spec.ts exactly (16 tests, 2 tagged @mcp-postgres), independently confirming that conflict resolution.

Copy link
Copy Markdown
Owner Author

Architecture review update

Completed two orthogonal architecture passes for #181.

Round 1 findings addressed

Architecture updates are in docs/architecture/issue-181-review-amendments.md.

Round 2 result

No further architecture findings identified in the reviewed scope. #181 remains test-only and must not introduce test-only production bypasses or a second admission implementation.

This is an architecture-only PR and does not implement #181.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — round 3 findings (before correction)

Verdict: Needs architecture changes. Implementation must not proceed from this revision.

High — the required failure/recovery matrix is absent

  • Architecture: docs/architecture/issue-181-e2e-admission-regression.md:90-161 covers representative flows and race bullets, but not the complete lifecycle.
  • Failure: orphan runs, burned nonces, missing artifacts, task dead-ends, and unsafe automatic retry can all escape the suite.
  • Invariant/downstream: [FEATURE] S6 — End-to-end MCP admission regression (tiny task-tracker flow) and preview==handoff invariant #181 must prove the integrated S3/S4 state machine, not just happy paths.
  • Smallest correction: add an exact table for before approval; after approval/pre-handoff; execution/issuance claim transaction rollback; post-claim/preassembly; assembly; assembled/pre-exposure; submission; submitted/pre-finalize; artifact upsert; Redis loss; restart; and lease expiry. Each row names package/task, nonce, claim, run, artifact, operator action, auto-recovery, and owning lower slice.
  • Proof: one sentinel per row, including concurrent finalizers and both lease orderings.

High — migration/mixed-version/rollback proof is unowned

Current schema lacks nonce/claim fields and artifact uniqueness. S6 must exercise additive expand, dual read/write, legacy allow_once fail-closed, historical audit unknown_legacy, worker protocol gate/drain, cutover, and forward-only schema rollback. Include old-web/new-worker and new-web/old-worker compatibility fixtures; prove an old issuer cannot run after v2 claims exist.

Medium — CI partitioning has no executable commands or numeric budgets

The amendment asks for partitions but web/package.json currently exposes only generic test and e2e. Define exact scripts/tags and budgets for fast invariant, PostgreSQL integration, issuance race/recovery, and thin Playwright suites; use bounded barriers and workers=1 where the shared database requires it. Upload sanitized tuple/ID diagnostics only.

Medium — lease tests cannot use a mocked worker clock

Lines 191-199 say “fixed clocks.” Claim/expiry comparisons must use PostgreSQL time. Use database timestamps, relative expired rows, and deterministic barriers; test both lock acquisition orders and ownership compare-and-set failure.

Coverage gaps

  • GitHub planning context with materialized overlay must stay allowed when health is absent, unhealthy, disabled, or auth-required; it is not runtime health-gated.
  • Both allow_once and always_allow packet runs need per-run claims; one-time adds nonce uniqueness.
  • Persistence-wide sentinels must query task logs, audit/artifact JSON, run errors, exports, and captured diagnostics for paths, packet content, rejected overlays, fake system markers, and credential-like text. Current prompt-log sanitization must remain intact.
  • ADR 0008’s older denied/missing runtime-audit wording is superseded: a preclaim S3 hold has a package marker/task log but no run, issuance audit, or packet artifact.
  • Add migration/schema/index/conflict-predicate introspection and deliberate mutation sentinels.

Inspected scope: all slice/ADR documents, current route/handoff/executor/schema/migration, package scripts/CI shape, real-PostgreSQL concurrency spec, and UI test seams. Confidence: high. Provider-specific ACP cancellation and rendered UI remain unchecked; this is not proof of correctness.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — round 7 findings before correction

The fresh integrated pass found the following S6 evidence gaps:

  1. Test both epoch lock orderings under the exact supported isolation protocol, plus a genuine pre-trigger drain and every post-cutover claim mode (packet, packet-free, and no-op handoff).
  2. Exercise the real generic handoff selector so a valid packet_issuance marker can never be promoted automatically, including sibling-completion continuation and post-submission acknowledgement states.
  3. Add the missing crash point after terminal packet audit/artifact commit but before run/package/lease cleanup; prove the S4 repair is idempotent and does not rewrite immutable evidence or resubmit.
  4. Replace independent enum checks with an expected valid/invalid terminal and recovery tuple matrix, including assembled/not_exposed failure and accepted-but-invalid submitted failure.
  5. Make the static manifest use project-qualified execution keys so one operator source scenario can run once on desktop and once on mobile without violating global uniqueness. Preserve static expected → collected → first-attempt executed equality for Vitest and Playwright.
  6. Prove the S4 sibling-task reconciler exposes actions only after the last live lease ends, and prove absolute/relative path-bearing exceptions never enter packet-owned persistence, logs, events, APIs, or copy.

These are architecture/test-contract corrections only. The PR remains draft and no production feature or merge is part of this pass.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 8 findings (before correction)

Verdict for this round: blocked because S6 does not yet prove four newly exposed cross-slice boundaries.

  1. Add failure injection after a valid submitted response for every closed stage: sandbox apply, validation, host apply (including failure after one successful file), repository evidence, and completion/review-gate materialization. Assert one external submission, exact terminal tuple, immutable packet evidence, no automatic resubmission, and bounded possible-partial-write recovery copy.
  2. Split the seeded terminal-audit/live-package repair row. Terminal failure must preserve the exact immutable failure code/delivery; terminal success may take only a fully proven success reconstruction or a neutral non-retryable integrity hold. Audit/artifact mismatch must fail closed.
  3. Add two-order barrier races between stale S4 recovery and packet-free/handoff-only ready → running claims. Every writer must contend on task then package, and recovery must lock all sibling packages before deciding task running → approved.
  4. Add durable-state presenter tests proving a new web/worker process renders only persisted live stages; non-durable failed_finalizing states must not be synthesized.

Release proof must also exercise the actual checked-in epoch-activation command/runbook under both bridge-trigger orderings and a genuine pre-trigger worker fixture.

Inspected stack head: 6598f7926c90ed50e2a2b01f0ff5cfeacda87c4c. This is a scoped architecture/current-call-path review, not proof of correctness.

@Joncallim

Copy link
Copy Markdown
Owner Author

Round 8 addendum — additional required races

S6 must also cover:

  • atomic finalizer versus a stale review-gate decision in both lock orderings, proving top-down gate locking and in-transaction source-run/artifact/package/lease freshness;
  • pairwise packet, packet-free, and handoff-only claims in both orderings, proving all siblings are locked and eligibility is recomputed under lock so only one specialist runs;
  • definitive submission_failed staged immediately before a crash, proving recovery preserves submission_rejected instead of reclassifying the terminal tuple as lease expiry;
  • recovery-marker validation against the exact prior audit/artifact, including mismatch and terminal-success/failure-marker rejection.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 9 downstream findings (before correction)

S6 must add executable proof for the post-submission quiescence contract:

  • lease expiry/recovery before the first host rename, between two renames, and after the final rename before evidence persistence;
  • crash after applying intent and after rename/before applied, yielding bounded unknown ledger state;
  • recovery and stale worker contend on the host fence in both orderings, with no actionable marker/new run until quiescence;
  • exact ledger-fingerprint acknowledgement is required before retry after unknown/partial host state;
  • pre-transaction completion_preparation failure persists the closed stage, while gate/finalizer transaction failure fully rolls back and persists no such cause;
  • one deduplicated bounded integrity alert, Release/DevOps runbook existence, unauthorized repair rejection, compare-and-set fingerprint protection, and append-only resolution evidence;
  • static documentation/operator-copy sentinel that ADR 0008 never claims ACP host confinement or already-implemented S4–S6 behavior.

Posted before correction.

@Joncallim

Copy link
Copy Markdown
Owner Author

Round 9 addendum — final state/order tests

Add these S6 proofs before readiness:

  • later package claim and packet recovery versus an awaiting_review sibling and review decision in both orderings; no claim/CTA until required gates complete;
  • duplicate action, exact replay, one-time reapproval, success repair, and review decision races across the complete artifact → recovery-action → review-gate tail;
  • every normal retry/acknowledgement/reapproval path leaves both integrity-hold reasons unchanged; only authorized fingerprint-bound privileged repair may resolve one.

Posted before correction.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 10 downstream finding (before correction)

S6 must include host-ledger and integrity alert/resolution rows in the declared complete lock tail and race per-file intent/outcome, quiescence alert insertion, privileged repair, recovery, and finalization in both relevant orderings. No transaction may wait for the host fence while holding a database row lock.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 10 additional blocking finding

Severity: High
Disposition: Blocking until the upstream S4 fence contract and S6 coverage are corrected

Project management can bypass the host-effect exclusion boundary

The S6 matrix does not race host apply/recovery against project-root repoint, project deletion, path swaps, or reuse of the same canonical host path by another project. A project-ID-only worker/recovery fence cannot exclude those current management-route filesystem operations.

Required S6 additions:

  • host apply versus project localPath repoint;
  • host apply versus project deletion/recursive cleanup;
  • two-project same-path and path-reuse attempts;
  • old/new root dual-fence acquisition in both orderings;
  • management-route crash/retry and bounded wait/reject behavior;
  • proof that no database lock is held while acquiring either host-root fence.

The same pass also found two stale shorthand lock-tail summaries in this PR/ADR that still say artifacts → actions → gates. They must include host ledgers/entries and integrity alerts/resolutions.

The upstream design correction belongs in #198; this PR must consume and prove it.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 10 test-contract addendum

PR #200 must consume the full Round 10 corrections and prove the following missing cases:

  1. two project IDs using the same canonical physical root, including symlink/alias/case variants;
  2. active apply versus root repoint, delete, old/new path swap, and later path reuse, with dual fences acquired in both deterministic orderings;
  3. recovery on the wrong/unreachable host remains alert-only;
  4. worker death with a stubborn descendant cannot release the resource fence until the entire supervised process group exits;
  5. S3 grant denial/revocation versus a sibling awaiting_review and both review decisions;
  6. every acknowledgement, retry, one-time resolution, success repair, integrity adjudication, and gate decision uses host ledgers → all artifacts → recovery actions → integrity rows → gates;
  7. activation rejects missing, stale, extra, incompatible, or undrained host registrations and records the exact capability snapshot;
  8. every valid and invalid terminal/effect/ledger/host-review cross-product, including stage equality and success with no incomplete/unknown ledger entries; and
  9. a true audit/artifact mismatch reaches only the authorized append-only quarantine/abandon outcome and can never become retryable.

The two stale shorthand summaries in this PR/ADR that say artifacts → actions → gates must also be expanded to the complete tail.

CI manifest, budget, no-skip/no-retry, and forward-schema rollback design were otherwise coherent in this pass. Runtime/PostgreSQL/process-tree/browser proof remains an implementation prerequisite.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 11 test findings

S6 must add two exact cases from the fresh state-table pass:

  1. wrong-host recovery with effectIntent:'not_started' checks the locked run/package host pin without reading a nonexistent intent host; wrong-host active/quiesced recovery checks both;
  2. atomic replacement succeeds but the subsequent applying → applied persistence fails (and ownership loss races that update). The live owner maps uncertainty to unknown under the resource fence or remains nonterminal for recovery, terminal failure requires exact fingerprint-bound host review, and terminal success is rejected.

The expected effect/ledger table and PostgreSQL/finalizer/parser fixtures must consume these same outcomes.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 11 lifecycle test addendum

S6 must add exact executable barriers for:

  1. every pre-v2 approval lacking root-binding evidence remains non-issuable and requires explicit reapproval; no command can “prove” historical authority from today's path;
  2. protocol-v2 project deletion becomes a tombstone and retains every evidence/action/alert/resolution row while releasing only the live root/path binding;
  3. two creates for one nonexistent destination, clone loser cleanup, crash at every reservation/materialization/bind step, aliases beneath the same canonical parent, and deletion/recreation object-identity mismatch;
  4. post-activation unregistered, stale, draining, wrong-host, insufficient-supervisor, and divergent-binding-key same-host workers fail at the running-transition trigger; exact instance ID is pinned;
  5. supervisor-first, worker-first, simultaneous death, descriptor close, setsid/double-fork, ACP descendants, validation children, read, submission, rename, and finalizer boundaries remain actionless unless the OS containment adapter proves the group empty;
  6. old project create/repoint writers race activation before/after statement two; epoch-1 writes invalidate binding and epoch-2 malformed/legacy writes are rejected;
  7. binding-key backup/rotation requires disabled issuance, drained instances, tombstoned/or explicitly rebound roots, and a new audited activation snapshot.

The canonical lock-order assertions must include worker-instance rows immediately after the protocol epoch.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 11 evidence-bypass test addendum

S6 must add exact executable cases for both new S4 blockers:

  1. An unconfined ACP runtime changes the repository before Forge's first local stage, then succeeds, crashes, or leaves submission uncertain. Baseline/post-quiescence fingerprints are captured under the resource fence; detected or unverifiable changes require exact fingerprint-bound review and block acknowledgement, retry, reapproval, root management, and new execution.
  2. Sibling Q has a quiesced packet marker with an unknown host-ledger outcome and required review; sibling P has a true audit/artifact mismatch. Quarantining P must not cancel away Q's root-management barrier. Repoint, tombstone/delete, and path reuse remain blocked until an authorized repository-abandonment action binds every affected marker, baseline/change fingerprint, ledger fingerprint, and review disposition.

Run each lifecycle in both transaction orderings and prove no database lock is held while waiting for the namespace, resource, or containment fence.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 test findings (before correction)

S6 must add two exact downstream assertions:

  1. PostgreSQL constraints, finalizers, repair, parsers, APIs, and S5 reject every successful terminal tuple with repository comparison changed|unverifiable or repository review review_required|reviewed. Only unchanged + not_applicable can succeed; changed/unverifiable produces one failed external-change marker/action flow.
  2. Project deletion uses the existing archived_at lifecycle field as the sole tombstone predicate. Live-root uniqueness, normal-list filtering, task creation, evidence/history access, root reuse, and hard-purge rejection must not depend on a second deleted_at state.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 additional test findings (before correction)

S6 must add exact failure-injection coverage for two corrected lifecycle contracts:

  1. Two-phase binding-key rotation: disabled ingress, fully drained old fleet, pending-key/token creation, bounded batch compare-and-set of every live root and reservation, complete-set verification, atomic promotion/credential rotation, and deterministic crash resume or rollback at every batch and promotion boundary. Old and pending writers must never be simultaneously authoritative.
  2. Reservation writer identity: planning, materialization, cleanup, and bind lock and validate protocol epoch -> exact root-writer instance -> reservation after the namespace fence is held. Tests must reject stale, draining, unregistered, wrong-host, wrong-key, and wrong-credential-generation writers after planning and after filesystem creation, and cover activation/drain races without leaking or deleting another reservation's root.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 state-machine test finding (before correction)

S6 must exhaust the corrected disjoint success branches:

  • no response-driven local stage: succeeded + not_started + no ledger + host review not_applicable + repository unchanged/not_applicable;
  • one or more local stages: succeeded + quiesced(actualLastStage), with a complete applied ledger when a host-write plan exists, no uncertain/incomplete entries, host review not_applicable, and repository unchanged/not_applicable.

Database constraints, finalizer, repair, parser, API, and S5 fixtures must reject success in the generic pre-stage row, a fabricated quiesced stage for no-effect work, and every incomplete/unknown ledger cross-product.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 recovery and presentation test findings (before correction)

S6 must add exact coverage for three corrected contracts:

  1. Worker W1 claims and crashes; a fresh registered same-host W2 is durably selected as the recovery owner, both historical/current instance rows are locked in ascending order after the epoch, and W2 alone may recover under a new token/lease. Reject stale, draining, wrong-host/key/protocol/containment W2 and any process that reuses W1's stable instance ID.
  2. S5's authoritative join compares packet marker/artifact, host ledger/review, and the complete repository baseline/change/review fingerprint. Missing or mismatched repository evidence produces a neutral integrity hold and no action.
  3. Normal repository review accepts only not_applicable|review_required|reviewed; abandoned exists only in the separate integrity-quarantine resolution. Exhaust SQL/S4/parser/S5 parity and prove that only the exact fingerprint-bound acknowledgement may cross the review barrier to complete it.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 containment test finding (before correction)

S6 must prove that normal success empties the per-run execution group and releases the resource fence without terminating the long-lived queue/control worker. It must also prove authenticated child handoff, descendants unable to escape the run group, queue-worker crash with child survival becoming orphaned, child/control crash ordering, and release only after the trusted adapter proves the complete per-run group empty.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 root-exclusion test finding (before correction)

S6 must cover existing and nonexistent parent/child creates, repoints, cleanup, tombstone, and root reuse in both acquisition orderings. Include crash after parent or child materialization, alias/case normalization, concurrent reservation-to-binding conversion, and recursive cleanup. No parent operation may delete or absorb a live/reserved descendant, and no child may bind beneath a live/reserved parent.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 sibling-claim test finding (before correction)

S6 must create terminal package A with host-apply review required, repository-change review required, and each independently, then race independent ready sibling B in packet, packet-free, and handoff-only modes. B must create zero claim, lease, run, repository read, or write until the exact A review/quarantine barrier is resolved. Task reconciliation, periodic sweeps, direct progression, Redis replay, and review-decision paths must share the same barrier and lock order.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 mixed-version test finding (before correction)

S6 must exercise a genuine old project create/repoint/delete at each rollout boundary. It must either be safely completed before the maintenance barrier or fail before path read/filesystem work after v1 ingress/credentials are revoked. Race cutover reconciliation with v2 grant/claim and activation in both lock orderings; assert no project -> epoch -> task/package lock path, no stale issuable decision, and no old service restart.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 recovery-action test finding (before correction)

S6 must cover both grant modes with submission_failed + changed and submission_failed + unverifiable. The marker first exposes only exact local-change review; stale fingerprints and direct retry/reapproval fail. After matching review commits, immutable delivery remains submission_failed and the correct allow_once reapproval or always_allow retry action becomes eligible. Exercise host-only, repository-only, and both-review cross-products.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 evidence-scanner test finding (before correction)

S6 must exercise FIFO, socket/device/special entries, symlink loops and out-of-root links, huge files/trees, ignored and untracked secrets, concurrent mutation, and Forge runtime-directory churn. The versioned scanner must finish within hard bounds, never follow a link or read a special file, fail preflight before exposure when a baseline cannot be proved, and return post-call unverifiable plus the exact review barrier when comparison cannot be proved.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 fence-service trust test finding (before correction)

S6 must adversarially test unauthorized socket/API calls, state-file mutation/deletion, service SIGKILL, stale-token replay, cross-run/root release, forged worker identity, peer-credential mismatch, and restart with missing/corrupt state. None may release or reuse a root; the service must mark the lease orphaned/disabled until protected-state and independent kernel emptiness proof succeeds.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 tombstone-state test finding (before correction)

S6 must seed queued pending|ready|approved|blocked packages in packet, packet-free, and handoff-only modes, then archive/tombstone the project. The transaction closes every nonterminal task/package with the bounded removal audit, queue wakes become harmless, and direct progression/periodic sweep/all-mode claim create zero runs, reads, writes, or action CTAs. Immutable task/run/audit/artifact/review/quarantine evidence remains addressable only through authorized history paths.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 rootless-project test finding (before correction)

S6 must create a rootless GitHub/remote project after epoch 2 with every local binding field null and prove it has no filesystem authority. Reject partial root/binding sets. Then attach a local root only through the full namespace reservation, exact writer-instance, hierarchical exclusion, binding revision, and grant-reconciliation protocol.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 rollout-sequence test finding (before correction)

S6's rollout rehearsal and runbook assertions must distinguish project-roots:bind-v2 from protocol:activate-work-package-v2 and enforce the exact order: disabled ingress/issuance, v1 credential/session revocation and drain, reconciliation/binding, epoch activation, registered S3/root-writer enablement, then packet issuance. No earlier command may implicitly advance the epoch.

@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 root-revision test finding (before correction)

S6 must seed unbound legacy projects, perform zero/one/multiple pre-bind path changes, then bind and repoint away/back. The revision starts in the single explicit unbound state, every bind/repoint compare-and-set strictly increases it, no command forces revision 1 after a prior increment, and no old decision becomes issuable again.

@Joncallim
Joncallim force-pushed the architecture/issue-181-e2e-admission-regression branch from 0bf42e2 to e3ed7e4 Compare July 15, 2026 03:15
@Joncallim

Copy link
Copy Markdown
Owner Author

Integrated architecture review — Round 12 corrections

Corrected in e3ed7e48:

S6 now requires exact SQL/finalizer/repair/parser/API/S5 and race/failure-injection coverage for the corrected success tuples, review-first action flow, repository-evidence joins, audit-versus-quarantine abandonment, sibling local-change barriers, authenticated W2 recovery, protected per-run containment/service attacks, bounded scanning, hierarchical root exclusion, writer-pinned reservations, archived-project cancellation, rootless projects, monotonic root revisions, two-phase key rotation, and the post-drain root-trigger/activation sequence.

The failure matrix and rollout rehearsal use the exact binding and activation commands, preserve immutable delivery, and keep the four PRs draft-only.

Validation: documentation-only diff; git diff --check passed; branch stack rebased and pushed. Round 13 will re-run all 12 passes from this integrated head before readiness is declared.

@Joncallim
Joncallim marked this pull request as ready for review July 22, 2026 06:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3aeeef378

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/mcp-host-boundary-trusted.yml
Comment thread web/lib/mcps/epic-172-s6-release-adapter.ts Outdated
Joncallim and others added 7 commits July 29, 2026 07:50
…d 25 review resolution

- mcp-host-boundary-trusted.yml now rejects any reviewed_sha that is not an
  exact 40-char lowercase hex commit SHA, closing the moving-ref checkout gap
  flagged by chatgpt-codex-connector (P1).
- issue-181-review-amendments.md records Round 25: the five earlier
  Joncallim P0/blocker findings are verified resolved at current head
  (rechecked tsc/lint/vitest/playwright --list), the codex P1 SHA fix is
  noted, and the codex P2 S6-transition SQL mismatch is documented as a
  known, deferred limitation (dead code path, controller disabled by
  default) acceptable for this beta-scoped architecture PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Both manifest wrappers quarantine child stdout/stderr, so a CI failure
previously printed only MCP_*_CONTRACT_REJECTED with no indication of what
went wrong -- and with no raw report upload there was nothing else to read.

Emit a fixed reason code from a closed enum, plus the canonical scenario IDs
involved in an identity mismatch. The output-quarantine contract explicitly
permits fixed schema-free status codes and canonical IDs on the live runner
channel; it forbids child bytes, which are still never emitted. Reported
identifiers are filtered to the canonical execution-key shape and anything
else is reduced to a suppressed count.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…partition

The S6 issuance suite drove forge.insert_packet_authorization_snapshot_v2
directly as forge_packet_issuer. Three deliberate changes in the #198->#199
stack make that invalid:

- 7876621 dropped epic_172_s4_protocol_state; activation is now derived from
  Step 0's forge_epic_172_enablement_state singleton.
- The routine gained p_local_claim_token, splitting local from packet claims.
- The routine became an internal helper the packet issuer is forbidden to
  call. epic-172-s4-context.test.ts asserts the GRANT is absent, and a live
  has_function_privilege check confirms it.

epic-172-s4-postgres.test.ts already implements the same three scenarios under
the same names and passes against real PostgreSQL 16, so porting would
duplicate lower-slice coverage that the architecture's Coverage ownership
section explicitly reserves for #179.

Remove the issuance partition from S6 end to end: spec file, Playwright
project and tag, manifest partition, bridge inventory, wrapper and
suite-contract maps, controller budget, and the ordinary-CI step. Neither
definition of test:mcp:issuance survives -- the base's alias is unused and its
three files are already covered by test:unit:zero-skip and test:mcp:s4-postgres.

The S6 manifest is now five partitions driven by four suite commands; docs and
sentinels updated to match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Removing the issuance partition left a stale `partitions.length !== 6`
literal in run-playwright-contract.mjs. The manifest check runs before
anything is spawned, so every Playwright partition failed at startup in
under a second -- CI showed only MCP_PLAYWRIGHT_CONTRACT_REJECTED with
reason=wrapper_error.

Derive the expected count from MANIFEST_PARTITIONS, and give the manifest
and partition-contract failures an `invalid_manifest` reason code so this
class of error names itself instead of collapsing into wrapper_error.

Add a regression test asserting the wrapper's partition map matches the
checked-in manifest and that the count stays derived. Verified it fails
when the old literal is put back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Joncallim
Joncallim marked this pull request as draft July 30, 2026 17:35
@Joncallim
Joncallim marked this pull request as ready for review August 2, 2026 17:59
@Joncallim
Joncallim merged commit a0f4861 into architecture/issue-180-mcp-operator-copy Aug 2, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e634bcf9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

steps:
- name: Require an immutable full-length commit SHA
run: |
if [[ ! "${{ inputs.reviewed_sha }}" =~ ^[0-9a-f]{40}$ ]]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate the SHA without shell interpolation

When a dispatcher supplies a value such as $(malicious-command), GitHub substitutes it directly into this double-quoted Bash expression and command substitution runs before the regex can reject it, allowing checkout-independent code execution on the trusted self-hosted runner after environment approval. Pass the input through env: and validate the quoted environment variable instead. Fresh evidence beyond the prior immutable-ref comment is that the newly added guard is itself the pre-checkout injection sink.

AGENTS.md reference: AGENTS.md:L141-L143

Useful? React with 👍 / 👎.

expect(result).toEqual({ code: 124, stderr: 'DEADLINE_EXCEEDED\n' })
descendantPid = Number(await readFile(descendantPidFile, 'utf8'))
expect(Number.isSafeInteger(descendantPid) && descendantPid > 0).toBe(true)
expect(() => process.kill(descendantPid!, 0)).toThrow()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat killed zombie descendants as terminated

On Linux runners where PID 1 does not immediately reap orphaned children, the killed descendant remains a zombie, so process.kill(pid, 0) succeeds even though it can no longer execute. In the inspected environment this made the newly mandatory npm run test:mcp:contract fail solely at this assertion, with /proc/<pid>/stat reporting state Z and PPID 1; affected CI environments therefore remain red. Check for a non-running state or use a reaping harness rather than requiring immediate PID disappearance.

Useful? React with 👍 / 👎.

controller budget described above. Workflow/process ceilings remain defensive inner
bounds and cannot authorize a retry or extend that controller deadline.

The release-blocking host-boundary job in `.github/workflows/web-ci.yml` targets a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point operators at the actual host-boundary authority

Operators following this architecture are directed to a release-blocking host-boundary job in web-ci.yml, but that workflow contains only the contract, PostgreSQL, and operator partitions. The self-hosted job is actually in mcp-host-boundary-trusted.yml, and that workflow explicitly states that its completion is advisory while the external controller owns the required Check Run. Correcting both the path and authority description is necessary so release verification does not inspect the wrong workflow or treat runner success as the gate.

Useful? React with 👍 / 👎.

@Joncallim
Joncallim deleted the architecture/issue-181-e2e-admission-regression branch August 2, 2026 18:22
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.

2 participants