feat(agent): multi-step plan DAG tools (#783)#849
Conversation
Phase 2: track a miner's multi-step plan ('close 1 stale PR → land 2 → open a
new direct PR') with per-step state, retries, and resume. STATELESS — the
harness holds the plan and passes it back each call, so gittensory keeps no
record of the miner's plan (boundary-aligned) and resume is just re-sending it.
- src/services/plan-dag.ts: pure DAG state machine — buildPlanDag (normalize +
clamp + drop self/dup deps), validatePlanDag (dup ids, missing deps, cycles
via DFS coloring), nextReadySteps (deps satisfied), markStepRunning,
applyStepResult (completed/skipped terminal; failed retries until maxAttempts
then fails), planProgress (counts + overall pending/running/completed/failed/
blocked).
- src/mcp/server.ts: three stateless tools — gittensory_build_plan,
gittensory_plan_status, gittensory_record_step_result.
Tests: the full state machine + the MCP round-trip driving a 2-step plan to
completion + retry-to-failure. New code 100% covered; full suite green (2117).
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
gittensory · advisory review Reviewed 4 changed file(s) — two independent AI reviewers. Changed files: Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #849 +/- ##
=======================================
Coverage 96.67% 96.68%
=======================================
Files 107 108 +1
Lines 14538 14609 +71
Branches 5274 5288 +14
=======================================
+ Hits 14055 14125 +70
Misses 105 105
- Partials 378 379 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #783
What & why
Phase 2 (#770). Track a miner's multi-step plan ("close 1 stale PR → land 2 → open a new direct PR") with per-step state, retries, and resume. Per the agreed contract: stateless — the harness holds the plan and passes it back each call, so gittensory keeps no record of the miner's plan (boundary-aligned) and "resume" is just re-sending it.
How
src/services/plan-dag.ts— pure DAG state machine:buildPlanDag(normalize defaults, clampmaxAttemptsto [1,10], drop self/duplicate deps)validatePlanDag(duplicate ids, missing deps, cycles via DFS coloring)nextReadySteps(pending steps whose deps are all done)markStepRunningapplyStepResult(completed/skippedterminal;failedretries untilmaxAttemptsthen fails terminally)planProgress(counts + overallpending/running/completed/failed/blocked)src/mcp/server.ts— three stateless tools:gittensory_build_plan,gittensory_plan_status,gittensory_record_step_result— each surfaces progress + the next ready steps.Tests
The full state machine (normalize, validation incl. cycle/missing-dep, ready-step gating, retry-then-fail, lifecycle + blocked/empty status) and the MCP round-trip driving a 2-step plan to completion + a retry-to-failure. New code 100% covered; MCP discovery/output-schema meta-tests green; full suite green (2117 passed).