Skip to content

feat(engine): add isPlanTerminated plan DAG helper#3587

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kiannidev:feat/plan-terminated
Jul 5, 2026
Merged

feat(engine): add isPlanTerminated plan DAG helper#3587
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kiannidev:feat/plan-terminated

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

  • Add isPlanTerminated(plan) — returns true when any step failed or every step is completed/skipped
  • Empty plans return false; blocked/running plans return false
  • Composes existing hasPlanFailedSteps and isPlanProgressComplete helpers

Closes #2298

Test plan

  • npx vitest run test/unit/plan-terminated.test.ts --coverage (100% patch via diff-cover)
  • npm run build --workspace @jsonbored/gittensory-engine && npm run build:miner

Made with Cursor

Closes JSONbored#2298

Composes failed/progress-complete checks for terminal plan state.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev requested a review from JSONbored as a code owner July 5, 2026 18:03
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 18:09:13 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This PR adds a small, pure helper `isPlanTerminated(plan)` that composes two already-exported helpers (`hasPlanFailedSteps` and `isPlanProgressComplete`) via a simple OR, exports it from the barrel, documents it in the README, and adds a 5-case unit test suite covering empty, in-flight, failed, completed/skipped, and barrel-export scenarios. The logic is correct by construction: since `isPlanProgressComplete` already treats empty plans as not-complete (per README) and `hasPlanFailedSteps` is false on an empty steps array, the empty-plan case correctly returns false, matching the test and description. This is a low-risk, well-tested, single-purpose addition with no wiring or schema changes.

Nits — 5 non-blocking
  • The linked issue docs(miner-foundation): gittensory-miner and gittensory-engine README + package docs #2298 appears (per the external brief) to be about miner-foundation docs, not a new plan-DAG helper — worth double-checking the issue linkage actually covers this specific addition before merge.
  • packages/gittensory-engine/README.md is flagged as a long file (~546 lines); consider whether plan-helper docs deserve a dedicated section rather than continuing to grow this single file.
  • The test file imports from `.../plan-terminated` and `.../plan-export` without `.js` extensions while the source files use explicit `.js` extensions in imports — confirm this matches the repo's existing test-import convention for consistency.
  • If other `is*`/`has*` plan predicates are composed this way, consider linking to `isPlanTerminated` from `resolvePlanOverallStatus`'s docs/tests to keep terminal-state semantics discoverable in one place (packages/gittensory-engine/src/plan-terminated.ts).
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2298
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 1433 registered-repo PR(s), 732 merged, 48 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 1433 PR(s), 48 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: TypeScript, MDX, C++, HTML, Rust
  • Official Gittensor activity: 1433 PR(s), 48 issue(s).
  • Related work: Titles/paths share 8 meaningful terms. (issue #2278, issue #2297)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.19%. Comparing base (c78c7c2) to head (1fded08).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3587   +/-   ##
=======================================
  Coverage   93.19%   93.19%           
=======================================
  Files         312      313    +1     
  Lines       31864    31865    +1     
  Branches    11661    11662    +1     
=======================================
+ Hits        29695    29696    +1     
  Misses       1517     1517           
  Partials      652      652           
Files with missing lines Coverage Δ
packages/gittensory-engine/src/plan-terminated.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 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 8d6d08a into JSONbored:main Jul 5, 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.

docs(miner-foundation): gittensory-miner and gittensory-engine README + package docs

1 participant