Implement bounded context issuance and evidence for #179#198
Implement bounded context issuance and evidence for #179#198Joncallim wants to merge 93 commits into
Conversation
Architecture review updateCompleted two orthogonal architecture passes for #179. Round 1 findings addressed
Architecture updates are in Round 2 resultNo further architecture findings identified in the reviewed scope. Implementation must still prove one-winning-claim, stale-token fencing, truthful recovery artifacts, and no deadlock using real PostgreSQL race tests. This is an architecture-only PR and does not implement #179. |
Integrated architecture review — round 3 findings (before correction)Verdict: Needs architecture changes. Implementation must not proceed from this revision. Blocker — packet fencing covers
|
Integrated architecture review — round 7 findings before correctionThe fresh 12-axis pass reverified the prior corrections, then found these remaining S4 blockers:
Required tests include both epoch lock orderings, direct/sibling handoff bypass, every claim mode after epoch 2, terminal-known-audit repair, full valid/invalid evidence tuples, and path-bearing exception leakage. This is architecture correction only; no production implementation is included. |
Integrated architecture review — Round 8 findings (before correction)Verdict for this round: blocked. The earlier findings are materially resolved, but the fresh orthogonal passes found four remaining contract gaps in S4.
Required correction: add a closed post-submission failure stage contract and no-auto-resubmit semantics; branch invariant repair by exact terminal outcome; make every all-mode claim and every reconciler contend on task/all siblings in global order; and assign the cutover command/runbook plus executable proofs. Inspected stack head: |
Round 8 addendum — additional findings before correctionThe final independent state-machine pass found one additional High / blocking issue and two consistency advisories. No correction has been applied yet.
The all-mode claim correction will also lock all sibling packages, recompute eligibility under lock, and prove no sibling is running or leased. This preserves Forge's current sequential specialist model, not just task-status consistency. |
Round 8 addendum — ADR 0008 canonical vocabulary driftHigh / blocking: ADR 0008 still says every packet decision audits Required correction: make ADR 0008's evidence summary explicitly defer detailed lifecycle/schema to ADR 0009 and state only the privacy-safe vocabulary: opaque |
Integrated architecture review — Round 9 finding (before correction)Medium / blocking-by-consistency: Round 8 correctly made every recovery reader/action join and validate the exact prior packet artifact, but the route-specific locking prose still stops at the prior runtime audit. The S3 one-time resolver prose has the same omission. An implementation following those numbered locks could validate artifact state outside the transaction even though the normative marker contract says artifact equality is authoritative. Required correction: lock/read the exact Inspected final-stack head before restack: |
Integrated architecture review — Round 9 findings (before correction)Verdict remains blocked on the following fresh post-submission/operability findings.
Required tests: expiry before/between/after atomic file replacements; crash between rename and ledger outcome; fence acquisition in both orders; pre-transaction completion-preparation versus finalizer rollback; bounded alert deduplication and unauthorized repair rejection. Inspected stack head: |
Round 9 addendum — sibling review barrier, complete order, and hold authorityThree further blocking-by-contract findings were found before correction:
Required races: claim/recovery versus an |
Integrated architecture review — Round 10 finding (before correction)Medium / blocking: the canonical order omits rows newly introduced by Round 9: host-apply ledger/entries and integrity alert/resolution rows. Place them explicitly between runtime audits and review gates. Every per-stage/per-file ledger mutation and every alert/repair mutation uses the applicable prefix/tail; unlocked discovery is allowed, but mutation reacquires the order. A quiescence-timeout alert may be inserted without owning the host fence because it changes no execution state, but it must use a short top-down transaction and never wait for the fence while holding database locks. Add observed-lock races for per-file ledger updates/finalization/recovery and alert/repair/finalizer paths. |
Integrated architecture review — Round 10 additional blocking findingSeverity: High Host-tree exclusion is not closed over project management routesThe proposed post-submission fence is keyed only by project ID and is shared by worker/recovery. Current project management routes can repoint Evidence inspected:
Required correction before the next review:
This finding is based on the current implementation's project PUT/DELETE behavior; it is not proof that other filesystem-management paths do not exist. |
Integrated architecture review — Round 10 consolidated addendumThe independent security, QA, and state-machine passes found five additional blocking contract gaps after the top-level order correction. 1. High — Same-root, cross-host, and descendant quiescence are not fenced
2. High — S3/S4 review aggregation is contradictoryThe S4 resolver called from S3 must participate in the task-wide 3. Medium — Individual mutating paths still omit the complete tailThe acknowledgement/retry route, one-time resolver, invariant repair, success repair, integrity resolution, and gate decision must each explicitly acquire applicable rows in the canonical suffix: host ledger/entries → all artifacts → recovery actions → integrity alerts/resolutions → review gates. The route cannot validate host-review or integrity state from unlocked rows. 4. Medium — Activation cannot prove host capability/routingThe planned activation command promises to report every worker/fence/same-host blocker, but no durable capability evidence exists. Keep the initial v2 local-effect rollout explicitly single-active-host. Add a durable worker-host capability registration/heartbeat with stable opaque host ID, supported protocol version, fence-supervisor capability, last-seen time, and drain state. Activation fails unless exactly one fresh active host is registered and every legacy/incompatible worker is drained; its audit snapshots the registrations. Multi-host local effects remain disabled until a later host-affine routing design. 5. Medium — Terminal/effect/ledger and mismatch outcomes are underspecified
These are architecture gaps, not claims that the future implementation or host behavior has been proven. |
Integrated architecture review — Round 11 findingsDisposition: Changes requested before architecture readiness Medium — Wrong-host predicate references a field absent from
|
Integrated architecture review — Round 11 consolidated lifecycle findingsDisposition: Changes requested; all findings block architecture readiness 1. High — Hard project deletion destroys immutable evidenceCurrent foreign keys cascade project deletion through tasks, packages, runs, and artifacts. The proposed root cleanup still ends by deleting the project, contradicting permanent packet evidence, integrity alerts, and quarantine resolution retention. Required correction: protocol-v2 projects use a soft-delete tombstone. Final deletion clears the path and releases the live root binding but retains project/task/package/run/audit/artifact/action/alert/resolution rows. The unique root constraint applies only to non-deleted projects. Normal queries hide tombstones; hard purge is forbidden until a separate retention/export architecture exists. 2. High — A nonexistent clone destination has no physical identity to fenceGitHub/local creation can clone or create a directory before a project row or physical root exists. Two requests can pass Required correction: add a typed pre-create reservation keyed by authoritative host + canonical existing parent identity + platform-normalized missing suffix. Acquire its namespace fence before mkdir/clone, persist 3. High — Worker registration is checked only at activationAn epoch-2 claimant can currently supply protocol/host/supervisor settings without proving a fresh active 4. High — Inherited file descriptors do not prove ACP descendant quiescenceA child can close extra descriptors or daemonize, and supervisor-first death can release the lock while the main worker continues. Replace the inherited-descriptor claim with a host fence service plus an OS-enforced containment adapter that includes the Forge worker, ACP transport, validation children, and every descendant. The service owns the resource lock and durable local lease; worker/service/control loss makes it orphaned and actionless. Automated release requires the containment adapter to prove the group empty. Unsupported or unverifiable hosts fail closed for protocol-v2 local-root execution; no process-memory/process-tree guess is accepted. 5. High — Binding-key and old root writers are not fenced by cutoverEvery worker/epoch/root binding must carry one stable host-binding-key fingerprint; divergent key material on the same host blocks activation/claim. Define backup and rotation as drain → disable → rebind, never silent key replacement. Add an expand-phase project-root mutation trigger serialized with the epoch. At epoch 1, legacy create/repoint clears/invalidate nullable bindings and forces explicit rebind; at epoch 2 it rejects missing/malformed host ID, resource ref, revision, maintenance token, or authorized writer settings. Activation's fresh snapshot plus exclusive epoch lock then durably excludes stale web/root-management writers, not only workers. These corrections must preserve the rule that no database lock is held while waiting for a namespace/resource/containment fence. |
Integrated architecture review — Round 11 evidence-bypass findingSeverity: High Unconfined ACP work can bypass the host-review gateThe architecture correctly says prompt text cannot stop an Agent Communication Protocol (ACP) runtime from making equivalent shell or filesystem changes. However, the normative table treats Required correction: capture a repository baseline before ACP submission and a post-quiescence change fingerprint under the same resource fence. Detected or unverifiable external-runtime changes require fingerprint-bound working-tree review before acknowledgement, retry, reapproval, root management, or a new run. Apply this rule to provider success as well as failure. If that evidence cannot be produced, protocol-v2 packet guarantees must exclude unconfined ACP execution. Privileged quarantine can bypass a sibling's mandatory host review
Required correction: permanent quarantine must either bind and acknowledge every affected sibling's exact repository-change and host-ledger fingerprints, or append a separate privileged repository-abandonment acknowledgement. An unresolved review/marker remains a project-root management barrier even after task terminalization until that explicit evidence-bound action exists. Normal quarantine must never turn unknown physical work into permission to repoint, delete, or reuse the root. These are evidence-state findings. They do not assert that a future containment or fingerprint implementation is correct. |
Takeover handoff — held after orthogonal passAll local commits are now pushed. Remote head is The latest independent pass is blocked on five items:
Passing baseline before the hold:
Resume order:
PR #198 remains open and must not be merged yet. The head branch is stacked under later PRs, so preserve it. |
Live CI addendum after pushThe first hosted
Add this as the first DevOps handoff item: install/provision the Redis CLI in Web CI before running the 0027 proof, then continue to the separately documented shared-database PostgreSQL test isolation fix. This PR remains held and not merge-ready. |
Status
Implementation and review remediation are pushed at
ba24cc2d96614cb6ca3c7990d84109bdb83ddf64.Hold: this PR is not merge-ready. The latest orthogonal Review, Security, and QA pass is complete. Further review passes are paused at the operator's request until a new agent resumes the work.
Implemented scope
Passing evidence
Blocking follow-up
task_questions; store only opaque references and resolve text through protected audited history.Takeover state
architecture/issue-179-context-packet-evidenceba24cc2d96614cb6ca3c7990d84109bdb83ddf64architecture/issue-178-filesystem-grant-recovery