feat(miner-plan): add analyze and prepare plan-DAG templates to the shared engine#2718
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2718 +/- ##
==========================================
- Coverage 96.11% 96.01% -0.11%
==========================================
Files 241 245 +4
Lines 27057 27316 +259
Branches 9834 9922 +88
==========================================
+ Hits 26006 26227 +221
- Misses 433 462 +29
- Partials 618 627 +9
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 08:18:50 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 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.
|
29fdc95 to
5b6ca30
Compare
Summary
Adds a small library of reusable plan TEMPLATES to the shared engine as
packages/gittensory-engine/src/plan-templates.ts, so a miner does not have to invent its step graph from scratch for each lifecycle stage. Each template is a pure, deterministic builder that returns raw steps in exactly the shapegittensory_build_planaccepts (rawPlanStepSchemainsrc/mcp/server.ts), sobuild_plancan normalize them into a validated DAG. Templates only describe steps and their ordering; they never actuate anything.Closes #2317
Deliverables
analyzePlanTemplate(context?)andpreparePlanTemplate(context?)returningRawPlanStep[]in the{ id, title, actionClass?, dependsOn?, maxAttempts? }shapegittensory_build_planexpects.feasibility-checkandrag-retrievalrun independently, thenprompt-packetdepends on both.branch-createthencoding-agent(a placeholder step, no actuation) thenlocal-test.PLAN_TEMPLATE_BUILDERS(a stage to builder registry) andbuildPlanTemplate(stage, context?)so callers can enumerate or dispatch by stage.context.subjectis woven into every step title as a single clean line, whitespace-collapsed and length-bounded so a long subject can never push a title past the schema's 300-character limit.Notes
RawPlanSteptype mirrorsrawPlanStepSchemaso the engine package stays standalone and imports no app code. The unit tests import the ACTUALrawPlanStepSchema(now exported fromsrc/mcp/server.ts) and assert every template round-trips through it, so the templates can never drift from whatgittensory_build_planaccepts.exportto the existingrawPlanStepSchemaso the drift-guard tests can reference the real schema.Validation
rawPlanStepSchema, ids are unique with only in-plan acyclic dependencies, output is deterministic, the subject is woven as one clean line (and omitted when absent), an oversized subject stays within the 300-char title limit, and the analyze ordering (prompt-packet depends on both feasibility and retrieval).npm run build --workspace @jsonbored/gittensory-enginesucceeds;npm run typecheckis clean; the new tests pass under Vitest.