Skip to content

feat(engine): add isPlanBlocked plan DAG helper - #3551

Closed
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/plan-blocked-2298
Closed

feat(engine): add isPlanBlocked plan DAG helper#3551
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/plan-blocked-2298

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Closes #2298

Summary

  • Add isPlanBlocked in @jsonbored/gittensory-engine — returns whether pending steps remain but none are runnable (deadlock), mirroring hosted planProgress's blocked status.
  • Document the helper in packages/gittensory-engine/README.md under Plan DAG status helpers (advances the engine README export-list deliverable in docs(miner-foundation): gittensory-miner and gittensory-engine README + package docs #2298).
  • Vitest coverage at 100% patch on the new helper.

Conflict avoidance

Touches only packages/gittensory-engine/src/plan-blocked.ts (new), one export line in index.ts, one engine README bullet, and test/unit/plan-blocked.test.ts (new). No overlap with open PRs #3513, #3545#3549.

Test plan

  • COVERAGE_NO_THRESHOLDS=1 npx vitest run test/unit/plan-blocked.test.ts --coverage
  • npx diff-cover coverage/lcov.info --compare-branch=main --fail-under=99 → 100%
  • npm run build --workspace @jsonbored/gittensory-engine && npm run build:miner

Made with Cursor

Pure deadlock predicate mirroring planProgress blocked status for miner
and dashboard progress summaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev requested a review from JSONbored as a code owner July 5, 2026 16:45
@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

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-05 16:53:43 UTC

4 files · 1 AI reviewer · no blockers · readiness 62/100 · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
Adds a small pure helper isPlanBlocked(plan) that mirrors hosted planProgress's 'blocked' status: pending steps remain but none are ready to run (all completed/skipped, no failed/running step takes precedence). The logic correctly reuses the existing dependsOn/status shape from plan-export.js, is exported from the barrel, and documented in the README bullet list alongside the other plan-status helpers. Implementation is correct for well-formed plans; the one gap is an untested fallback branch when nextReadySteps encounters a dependsOn id with no matching step (statusById.get(dep) ?? "pending"), which likely explains the 92.3% patch coverage failure.

Nits — 6 non-blocking
  • plan-blocked.ts:6 — the `?? "pending"` fallback for a dependsOn id with no matching step in `statusById` isn't exercised by any test; add a case with a dangling dependency id to close the coverage gap (codecov/patch is currently failing at 92.30% vs the 99% target).
  • test/unit/plan-blocked.test.ts — the 'cyclic deadlock' test and the 'exported from the package barrel' test use the exact same two-step plan; consider varying the barrel test's fixture (or trimming it to just check the export exists) to avoid duplicate assertions.
  • No PR-issue link check needed here since the description explicitly closes docs(miner-foundation): gittensory-miner and gittensory-engine README + package docs #2298, but confirm docs(miner-foundation): gittensory-miner and gittensory-engine README + package docs #2298 actually scopes 'add isPlanBlocked' rather than just the README export-list deliverable — the description frames this PR as 'advancing' that issue rather than fully closing it.
  • Add a test case with a step whose dependsOn references a non-existent step id to cover plan-blocked.ts:6's fallback branch and push patch coverage back over the 99% threshold.
  • Consider consolidating the barrel-export test in plan-blocked.test.ts with one of the earlier scenario tests rather than duplicating the cyclic-deadlock fixture verbatim.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

CI checks failing

  • codecov/patch — 92.30% of diff hit (target 99.00%)
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

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.11%. Comparing base (d432c8b) to head (4888025).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/gittensory-engine/src/plan-blocked.ts 92.30% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (92.30%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3551      +/-   ##
==========================================
- Coverage   93.11%   93.11%   -0.01%     
==========================================
  Files         303      304       +1     
  Lines       31517    31530      +13     
  Branches    11505    11508       +3     
==========================================
+ Hits        29346    29358      +12     
  Misses       1517     1517              
- Partials      654      655       +1     
Files with missing lines Coverage Δ
packages/gittensory-engine/src/plan-blocked.ts 92.30% <92.30%> (ø)
🚀 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 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 5, 2026
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