Metadata
| Status | done |
|---|---|
| Assigned | agent-919 |
| Agent identity | 6841f97a7a8e6cbc213051ce0ffb3c85c92c80cb61fd699428ab3fed6cb6ba94 |
| Created | 2026-07-26T12:00:12.542946585+00:00 |
| Started | 2026-07-27T20:48:01.138662172+00:00 |
| Completed | 2026-07-27T21:31:37.029372003+00:00 |
| Tokens | 16931441 in / 37184 out |
Description
Objective
Implement the ratified strong-agent merge-resolution lane on top of the authoritative lifecycle and crash-safe immutable-candidate finalizer. Clean deterministic merges remain purely mechanical and make zero model calls. A real textual/semantic/generated integration conflict uses one content-bound explicitly routed full strong coding agent, while ambiguity or unsafe content stops for a human/review decision. No resolution path may silently mutate main.
Prerequisites, scope, and authority
Implement only after docs/design-strong-agent-merge-resolution.md and the crash-safe candidate transaction land. Consume their immutable descriptors, lifecycle projections, evaluator interface, ledger/outbox, and merge authority; do not create a second candidate/status/evaluation/merge path. The worker/source worktree and original candidate are immutable, evaluators are read-only, and only the central merge authority may CAS canonical main after all gates accept.
This task owns the deterministic integration classifier, lazy resolution request/run, explicit strong-route snapshot, isolated integration worktree, resolution descriptor, gate handoff, replay/diagnostics, and user actions. If the ratified lifecycle/finalizer/evaluator seams differ, stop and amend the contract rather than bypassing them.
Deterministic classification
Implement stable evidence-bearing outcomes with fail-closed precedence:
MechanicalMerge: exact candidate/base/target dry merge is conflict free, no unresolved marker or generated/policy/safety ambiguity exists, required integration checks pass, and target is unchanged. It invokes zero LLMs.CandidateRepairRequired: candidate fails its independent deterministic checks; route to source repair, not merger.MergeResolutionRequired::TextualConflict: overlap/add-add/rename-delete/modify-delete/submodule/dependency-lock or equivalent real text/tree conflict.MergeResolutionRequired::SemanticIntegrationConflict: candidate and target checks pass separately, textual merge is clean, but the combined tree fails a pinned compile/test/schema/API/invariant check. Persist all three receipts.MergeResolutionRequired::GeneratedArtifactConflict: only with known source-of-truth ownership and a deterministic pinned generator. Merger edits sources and regenerates; generated output is never hand-edited.NeedsHumanMergeDecision: product/user intent ambiguity, plausible incompatible behaviors, policy-sensitive authority, unknown/nondeterministic generated ownership, or merger uncertainty.SecurityReviewBlocked/ResolutionRejected: canonical lint/review rejects or quarantines malicious/untrusted diff/conflict content before merger launch. Accepted untrusted bytes remain spotlighted inert data and the output is reviewed again.
Unknown/unlabeled state, classifier/tool failure, and policy uncertainty may never take the mechanical path. Persist reason codes, commands, exits, tree IDs, conflict maps, generator evidence, safety verdicts, and policy snapshot.
Exact strong route; no fallback
Resolve and persist one ResolutionRouteSnapshot before enqueue: fully qualified handler-first model spec, provider/model, strong/premium assertion and provenance, high/xhigh reasoning, config/profile revision, budget, and tool policy. Prefer an exact models.merger; a permitted named tier must resolve once to one exact route. Reject weak/fast routes.
Missing/invalid route, auth/executor unavailability, unsupported reasoning, timeout, and budget exhaustion enter visible StrongRouteUnavailable/operator hold. Never downgrade to weak, substitute another model/provider/executor, retry a different route, ask the coordinator/evaluator to edit, or relabel the conflict mechanical. Operator route changes create a new audited route/run generation; retries of the same generation use the same route snapshot.
Isolated, content-bound resolution
- Lazily enqueue exactly one resolution run only after
MergeResolutionRequired, keyed by candidate commit/tree/manifest CID + base + target commit/tree + conflict/evidence digest + policy + route. Clean/human/security/source-repair cases create no merger satellite/call. - Materialize an isolated integration clone/worktree at the exact target and candidate objects. Give the strong agent full edit/build/test tools only there. Deny canonical repository
.git/main, shared-ref mutation, remote push credentials, source worktree/candidate writes, graph/status mutation, and evaluator/merge-authority tools. Prove that a mutation/push/ref-update probe fails. - Provide the ratified content-addressed spotlighted bundle: task/user intent, immutable candidate, base, target, both diffs, dependency/generated metadata, validation/evaluation evidence, conflict map, policies, and repository tools. Treat conflict text and repository files as untrusted data, not model instructions.
- Seal output as a new immutable
ResolutionCandidateDescriptorwith parent candidate/base/target IDs, request/run/session and exact route, commit/tree/manifest CID, changed/conflict disposition, generator command/tool/output digests, test/tool/safety evidence, explanation, and resolved/reject/needs-human outcome. Never mutate or retag the source candidate. - Any modified resolution bytes are new untrusted bytes. Run canonical safety review, full deterministic validation, and newly selected bounded evaluation/deep-readonly FLIP against that exact resolution descriptor. Do not reuse the original candidate verdict as authorization. A reject retains original+resolution descriptors and creates linked repair/new-version state.
- Central acceptance verifies every binding and target-head equality, imports/applies exactly the accepted resolution tree, atomically CASes main, verifies the resulting tree equals the accepted descriptor, and records one content-bound merge receipt. Duplicate delivery/restart returns the same receipt. Target movement marks the request stale and reclassifies against a new immutable target; never auto-rebase or merge a stale resolution.
Replay, human action, rollback, and visibility
Drive classifier, route, workspace, process, descriptor seal, safety/validation/evaluation requests/results, acceptance CAS/receipt, retention, and cleanup through the durable ledger/outbox with stable idempotency keys. Add fault barriers around every durable boundary. Unknown/source-bearing/unaccepted work is retained; cleanup is ancillary and cannot change semantic state.
A human decision is bound to candidate/target/evidence digests and author/rationale/constraints. Resume creates a new resolution generation and still runs every gate; human approval never directly writes main or bypasses route/safety/validation/evaluation. Before acceptance, reject/abort leaves main/source untouched after evidence retention. After acceptance, rollback creates a compensating immutable candidate/commit through the same gates and central CAS; never hard-reset main or erase the original receipt.
Expose CLI/TUI status/actions without eager graph clutter: classifier/reason/evidence, candidate/base/target IDs, safety state, exact route strength/provenance/reasoning, run/session, integration isolation, resolution CID, each fresh gate binding, target drift, merge receipt, retention, and safe actions for inspect/materialize/retry-same-route/change-route/repair/escalate/reject/rollback. No action may imply fallback.
RED-first implementation and permanent validation
Write fixtures first and preserve the pre-change failure evidence. Use a credential-free deterministic fake strong-merger adapter which asserts exact route/reasoning/capability/bundle IDs and records invocation count.
- Classifier table: clean merge calls fake merger zero times; candidate-invalid calls zero; text conflict calls exactly once; clean semantic failure with each side independently passing calls exactly once; deterministic generated conflict regenerates from sources; unknown generated ownership and ambiguous intent stop for human; malicious/untrusted prompt-like conflict is blocked/quarantined or contained as data and cannot change route/tools/verdict.
- Content/authority: source candidate/worktree and canonical main/ref hashes stay unchanged while resolving; direct mutation/push/ref probes fail; resolution descriptor, safety/validator input, new evaluator verdict, merge request/receipt, and resulting tree bind the same resolution CID/tree; post-seal edits require a new version.
- Failure/replay: absent/weak/unavailable route has no fallback; malformed output, timeout/budget, rejection/repair, duplicate request/verdict, concurrent target movement, stale route, daemon restart/fault injection at every boundary, cleanup failure, and repeated human actions converge without duplicate calls/charges/merges or lost bytes.
- Real human flow: through installed
wg, real daemon/service, real immutable source candidate, and real isolated integration worktree (fake merger only for credentials), demonstrate clean -> zero model calls; conflict -> explicit strong resolution -> safety -> revalidation -> fresh evaluation -> exactly-once identical merge; semantic conflict; conflict -> human stop; generated ambiguity; malicious diff; rejection/repair; restart/target movement; inspect/status; and compensating rollback. It must fail on pre-change main and cannot be a helper/library-only substitute.
Add a grow-only scenario such as tests/smoke/scenarios/strong_agent_merge_resolution.sh and register owners = [implement-strong-agent] in tests/smoke/manifest.toml. Name focused unit/model/property tests. Run pinned stable cargo fmt, cargo fmt --check, cargo clippy, cargo build, cargo test, cargo install --path . --locked, then the owned smoke.
Validation
- RED classifier fixtures distinguish mechanical, candidate-invalid, textual, semantic, generated deterministic/ambiguous, human-intent, policy, and malicious/untrusted outcomes; only eligible conflicts invoke exactly one fake strong merger and clean merge invokes zero.
- One exact strong/premium high/xhigh route is snapshotted; weak/missing/unavailable/failed routes hold visibly and never cross-model/provider/executor fallback or become mechanical.
- Strong coding capability is confined to an isolated integration worktree; source candidate/worktree, canonical main, graph, and shared refs cannot be mutated before central acceptance.
- Modified resolution bytes get a new immutable descriptor plus fresh safety review, deterministic validation, and policy evaluation/FLIP; accepted tree is content-identical to the exactly-once merged tree.
- Crash/replay, duplicate events, target movement, rejection/repair, generated regeneration, human escalation, retention/cleanup, and compensating rollback are safe and explicit.
- Permanent installed-binary real-daemon/integration-worktree terminal smoke is owned by this task and exercises conflict->strong->revalidate/reevaluate->merge plus conflict->human stop; focused tests, fmt, clippy, build, test, install, and smoke pass.
Depends on
Required by
Log
- 2026-07-26T12:00:12.528697812+00:00 Task paused
- 2026-07-26T12:00:18.718159654+00:00 Task published
- 2026-07-27T20:46:57.704846772+00:00 Spawn preparation deferred before launch permit; rollback is complete and no circuit-breaker charge was recorded. Repair the reported checkout/configuration condition and retry: spawn transaction for agent-919 rolled back (task remains dispatchable; rollback diagnostics: complete): failed to establish isolated-worktree observer baseline: observer state already exists; use open_at for restart reconciliation
- 2026-07-27T20:48:01.309818211+00:00 Spawned by coordinator --executor pi --model openai-codex:gpt-5.6-sol --isolation required-worktree
- 2026-07-27T20:48:08.544711073+00:00 Starting implementation: inspecting prior WIP, authoritative design, and finalization seams.
- 2026-07-27T21:06:51.132477379+00:00 Operator containment: exact auxiliary worktree observer PID 2381922 (attempt-0-19) was TERM-stopped after reaching 10,066,300 KiB RSS and ~52% CPU while ingesting ignored target/ build churn. Pi PID 2381925, Cargo/Rustc, wrapper PID 2381901, worktree bytes, and observer state files were not signalled or modified. Pre-stop: 2381922 2381922 Ssl 18:48 51.7 16.0 10430972 wg worktree-observer-run --state-dir /home/bot/wg/.wg/attempts/attempt-0-19/worktree-observer --parent-pid 2381901
- 2026-07-27T21:09:00.102333963+00:00 Implemented classifier/route/isolation/descriptor/fresh-gates/CAS lane with CLI, fake adapter, focused integration tests, durable journal, and owned installed-binary smoke; focused tests and smoke pass.
- 2026-07-27T21:28:48.391706144+00:00 Validated: cargo fmt/check, cargo build, cargo clippy, focused classifier/route/integration/finalization tests, cargo install --locked, and installed-binary owned smoke pass. Full cargo test reaches 3830 passes but the pre-existing bin suite has 25 unrelated stale route/lifecycle expectations; the task-focused suites are green. Initial parallel full run also exposed known global-env profile test flakiness, which passes isolated.
- 2026-07-27T21:29:32.896974925+00:00 Committed: b6e71b77 — pushed to remote
- 2026-07-27T21:31:37.029372243+00:00 Task marked as done