feat(tooling): dispatch confirmed campaign findings - #1864
Conversation
🛑 Changes requested — automated reviewTarget advancement prevents the advertised crash-recovery path for an already-bound dispatch, leaving local work state unreconstructable through the CLI. |
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1864 (comment)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v3.0 #1864 +/- ##
================================================
- Coverage 77.06% 77.01% -0.06%
================================================
Files 477 477
Lines 51141 51141
================================================
- Hits 39413 39387 -26
- Misses 8295 8321 +26
Partials 3433 3433
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
be14666 to
1347738
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1864 (comment)
1347738 to
0e4fead
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1864 (comment)
0e4fead to
6f6d756
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot review complete: no remaining inline findings.
Resolved 1 stale NumaryBot review thread (1 fixed, 0 outdated).
Summary: #1864 (comment)
6f6d756 to
c6923c5
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #1864 (comment)
| if observed.ObservedTargetSHA == "" { | ||
| return dispatchStopped(result, "REMOTE_UNAVAILABLE", "target branch could not be resolved", "REFRESH_REQUIRED") | ||
| } | ||
| if observed.ObservedTargetSHA != campaign.AuditedSHA { |
There was a problem hiding this comment.
🟠 [major] Resume bound dispatches after the target advances
When the CLI repeats dispatch after the target branch advances, the fresh inspection reports the new target SHA and this early return prevents reading the already-bound claim, so it returns BASE_UPDATE_REQUIRED without reconstructing a missing worktree or artifact. This contradicts the documented recovery behavior in docs/technical/contributing/ai-campaign.md:320-325; defer this check until after determining whether the claim is already dispatched.
|
SUPERSEDED_BY_SIMPLIFICATION PR #1872 removes the campaign orchestration layer, including dispatch prerequisites and claim state. This PR was not cherry-picked or merged as part of that work. |
What changed
Adds
ai-campaign dispatchto bind an owned confirmed finding to a deterministic work identity, exact-base branch, isolated worktree, immutable claim lineage, and reconstructableai-campaign-work/v1artifact.Extends inspect/next projection, exact PR-marker discovery, claim renewal/takeover preservation, crash recovery, and adversarial bare-remote coverage.
Dispatch does not create Jira issues or PRs, invoke an engineering agent, implement a finding, decide readiness, or merge.
Why
Atomic claims coordinate ownership but do not provide a durable, recoverable engineering-work binding. Starting or resuming confirmed-finding work currently depends on conversation context and manual branch/worktree reconstruction.
Product / operational motivation
Need: A confirmed finding with an owned live claim can be handed to an engineering agent deterministically and recovered after session loss.
Current limitation: Campaign state stops at claim ownership; branch, worktree, Jira, provenance, and future PR identity are not durably bound as one exact work item.
Requirement / constraint: Dispatch must fail closed on stale, ambiguous, expired, conflicting, or raced state; create no product fix; and preserve exact campaign/claim/base/branch identity through remote CAS.
Evidence: Campaign orchestration milestone
CONFIRMED_FINDING_DISPATCH_AND_BINDING; adversarial tests inscripts/aicampaign/dispatch_test.go.Durable repository evidence:
docs/technical/contributing/ai-campaign.md,docs/technical/contributing/ai-audit-jira.md, andscripts/ai-campaign-work.schema.json.Technical decision
Decision: Derive a digest-backed work identity from campaign/finding/qualified-result/Jira identity; create the exact remote work branch with an empty-value lease; attach an isolated worktree; then append the binding to the existing claim through exact CAS and write a reconstructable local artifact.
Why now / why proportionate: The preceding campaign schema, freshness, adoption, and atomic-claim milestones now provide the authoritative inputs needed for deterministic dispatch without expanding into engineering or readiness automation.
Alternatives considered: Conversation-only handoff is not recoverable; branch-name-only binding is ambiguous; automatic Jira/PR/agent invocation would cross explicit authorization and workflow boundaries; replacing the claim backend would duplicate established CAS semantics.
Risk
MEDIUM — this changes distributed orchestration and claim schemas, but not Ledger runtime/product behavior. Exact-CAS transitions, empty-value branch leases, fail-closed classifications, and bare-remote race/crash tests bound the risk.
Validation
bash scripts/agent-checkgo test ./scripts/aicampaign -count=1go test ./scripts/... -count=1during candidate validationThe requirement is satisfied when one owned live confirmed finding yields at most one exact branch/claim binding and another clean session can reconstruct the work item without duplicate Jira, branch, worktree, claim, or PR creation.
Architecture / behavior impact
Tooling only. Extends unreleased
ai-claim/v1and campaign observation schemas with immutable dispatch binding fields and adds localai-campaign-work/v1. No product storage, API, protobuf, FSM, checker, or compatibility behavior changes.Review focus
Please focus on CAS transition invariants, last-mile target/PR races, worktree isolation, idempotent crash recovery, and whether structured stop classifications fail closed.
Known concerns
None. Automatic PR creation/publication, resume/event journal, composite readiness, structured failure envelopes, terminal claim cleanup, and multi-finding scheduling remain intentionally deferred.