feat: execute isolated candidates - #35
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 19 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
dd67464 to
d6d19a7
Compare
There was a problem hiding this comment.
All reported issues were addressed across 12 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 7 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/ofw/evolution/candidate_service.py">
<violation number="1" location="src/ofw/evolution/candidate_service.py:81">
P2: When an existing candidate state was written by the previous service format, this state migration rejects its `outcome_receipts` and `blockers` fields and returns `INVALID_RESULT` instead of resuming or replaying the candidate. Add a versioned compatibility migration before replacing the persisted fields.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|
|
||
| @dataclass(frozen=True, slots=True) | ||
| class _OutcomeReduction: | ||
| receipts: tuple[EvaluatedTaskReceipt, ...] |
There was a problem hiding this comment.
P2: When an existing candidate state was written by the previous service format, this state migration rejects its outcome_receipts and blockers fields and returns INVALID_RESULT instead of resuming or replaying the candidate. Add a versioned compatibility migration before replacing the persisted fields.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/ofw/evolution/candidate_service.py, line 81:
<comment>When an existing candidate state was written by the previous service format, this state migration rejects its `outcome_receipts` and `blockers` fields and returns `INVALID_RESULT` instead of resuming or replaying the candidate. Add a versioned compatibility migration before replacing the persisted fields.</comment>
<file context>
@@ -72,24 +72,22 @@ class _CandidateState(StrictModel):
class _OutcomeReduction:
- receipts: tuple[CandidateOutcomeReceipt, ...]
- blockers: tuple[CandidateBlocker, ...]
+ receipts: tuple[EvaluatedTaskReceipt, ...]
+ blockers: tuple[EvaluatedRunBlocker, ...]
</file context>
6de892f to
1e56f29
Compare
Summary
Evidence and trust flow
MCP execute_candidate -> CandidateExecutionService -> PR1 policy/hypothesis repository -> CandidateGitGateway -> HarborExperimentRunner -> bounded Langfuse root-trace locator -> existing LangfuseOutcomeStore.
Caller paths identify local runtime locations only. The accepted commit, exact editable targets, model, ordered task IDs, verifier, config digest, environment, concurrency, and retries come from the immutable PR1 snapshot and are revalidated before launch and poll. CandidateId binds the policy digest, hypothesis ID, accepted source commit, candidate Git tree, and controls digest. Local state retains only IDs, digests, paths, counts, blockers, and outcome receipts; Langfuse trace payloads remain remote.
Verification
Risks
Stacked on PR #34. Do not merge before its base is accepted.
Summary by cubic
The closed-loop flow now executes recorded hypotheses in isolated candidate worktrees and records durable evaluated-run receipts instead of stopping after hypothesis creation. It still stops before admission or mutation of the accepted branch.
Candidate execution
execute_candidateMCP tool with re-entrant launch, polling, recovery, and timeout cancellation.Verification
Written for commit b9df048. Summary will update on new commits.