feat(miner-plan): issue-to-plan decomposition heuristic (#4292) - #4339
Conversation
Add decomposeIssueToPlan(issue) in @jsonbored/gittensory-engine: a pure, deterministic function that folds issue-level metadata (title / body / labels only — never source content) into a RawPlanStep[] execution DAG in the same raw-step shape plan-templates.ts emits, so gittensory_build_plan normalizes it and plan-store.js's validatePlanDag accepts it unchanged. The spine is always locate -> implement -> test -> verify. A bug signal (keywords or a bug label) inserts a reproduce step before implement and asks test for a regression test; a docs signal inserts a docs step that verify also waits on. Every dependsOn references an earlier-declared step, so the output is unique-id'd, acyclic, and within rawPlanStepSchema's bounds by construction; the same issue always yields the same plan. This is the real logic behind planPlanTemplate's plan-dag-build placeholder, kept standalone (the template describes the miner's fixed lifecycle; this composes the target issue's work). Closes JSONbored#4292
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4339 +/- ##
=======================================
Coverage 93.94% 93.95%
=======================================
Files 397 398 +1
Lines 36760 36781 +21
Branches 13432 13440 +8
=======================================
+ Hits 34535 34556 +21
Misses 1569 1569
Partials 656 656
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 04:46:55 UTC
✅ Suggested Action - Approve/Merge
Review summary
Linked issue satisfactionAddressed 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.
|
Adds
decomposeIssueToPlan(issue)in@jsonbored/gittensory-engine— the missing piece that turns a target issue into an execution plan. The stateless plan-DAG surface (gittensory_build_plan/rawPlanStepSchema, persisted byplan-store.js) already validates and advances a caller-suppliedRawPlanStep[], but nothing built one from an issue;planPlanTemplateeven carries aplan-dag-buildplaceholder with no logic behind it.What it does
RawPlanStep[]in the same shapeplan-templates.tsemits, sobuild_plannormalizes it andplan-store.js'svalidatePlanDagaccepts it unchanged. Same input → identical output (no clock/randomness), matching every other pure composer in the package.locate → implement → test → verify, with two content-driven signals derived from the combined title+body+labels text:reproducestep beforeimplementand askstestfor a regression test;docsstep thatverifythen also waits on.dependsOnreferences an earlier-declared step, so the DAG is unique-id'd, acyclic (ready topo order), and withinrawPlanStepSchema's bounds by construction.planPlanTemplate): that template describes the miner's own fixed lifecycle, whereas this composes the target issue's actual work — a caller runs it to fill the DAG theplan-dag-buildstep stands for. Exported from the package barrel.Tests
test/unit/issue-plan-decomposition.test.ts: bug+docs (6-step), bare-issue baseline (4-step), bug-only, docs-only, free-text kind detection without labels, overlong-title cap to the 300-char schema ceiling, and determinism — every step round-tripped through the realrawPlanStepSchemaand asserted unique-id + in-plan + acyclic. 100% branch coverage on the new file; engine-parity green.Closes #4292