Skip to content

feat(miner-plan): issue-to-plan decomposition heuristic (#4292) - #4339

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat/gittensory-issue-plan-decomposition
Jul 9, 2026
Merged

feat(miner-plan): issue-to-plan decomposition heuristic (#4292)#4339
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat/gittensory-issue-plan-decomposition

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

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 by plan-store.js) already validates and advances a caller-supplied RawPlanStep[], but nothing built one from an issue; planPlanTemplate even carries a plan-dag-build placeholder with no logic behind it.

What it does

  • Pure + deterministic: folds issue-level metadata (title / body / labels — never source content) into a RawPlanStep[] in the same shape plan-templates.ts emits, so build_plan normalizes it and plan-store.js's validatePlanDag accepts it unchanged. Same input → identical output (no clock/randomness), matching every other pure composer in the package.
  • Spine locate → implement → test → verify, with two content-driven signals derived from the combined title+body+labels text:
    • a bug signal inserts a reproduce step before implement and asks test for a regression test;
    • a docs signal inserts a docs step that verify then also waits on.
  • Every dependsOn references an earlier-declared step, so the DAG is unique-id'd, acyclic (ready topo order), and within rawPlanStepSchema's bounds by construction.
  • Kept standalone (not wired into 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 the plan-dag-build step 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 real rawPlanStepSchema and asserted unique-id + in-plan + acyclic. 100% branch coverage on the new file; engine-parity green.

Closes #4292

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
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 8, 2026 23:17
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.95%. Comparing base (46a19f8) to head (f93b2da).

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           
Files with missing lines Coverage Δ
.../gittensory-engine/src/issue-plan-decomposition.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-09 04:46:55 UTC

3 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
AI review could not be completed for this PR head. Gittensory is holding this PR for manual review instead of relying on deterministic signals alone.

Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4292
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 93 registered-repo PR(s), 55 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 93 PR(s), 3 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The PR adds a pure, deterministic decomposeIssueToPlan(issue) in gittensory-engine that emits RawPlanStep[] matching plan-templates.ts's type, exports it from the package barrel, and includes unit tests spanning minimal/long/multi-label/no-label issue shapes with acyclic/schema validation via rawPlanStepSchema, covering nearly every deliverable including the explicit alternative of documenting why

Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 93 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit e580525 into JSONbored:main Jul 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-plan): issue-to-plan decomposition heuristic

1 participant