Skip to content

feat(miner): wire stack detection into the attempt prompt - #5722

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
carlh7777:feat/stack-prompt-and-grafana-all-sentinel-4786
Jul 14, 2026
Merged

feat(miner): wire stack detection into the attempt prompt#5722
JSONbored merged 1 commit into
JSONbored:mainfrom
carlh7777:feat/stack-prompt-and-grafana-all-sentinel-4786

Conversation

@carlh7777

Copy link
Copy Markdown
Contributor

Summary

Closes #4786.

Fresh PR after #5717 (auto-closed for red CI on an unrelated main-branch Grafana test drift). Same feature, plus the missing test sync so validate-tests (6) can go green.

detectRepoStack / renderStackSummary (#4785) already return a structured target-repo stack, but nothing in the attempt path consumed them. This wires the real detection into buildCodingTaskSpec instructions so the coding agent validates against THIS repo's tooling instead of assuming LoopOver/gittensory CI, Codecov, or npm run test:ci.

Also finishes the #5716 follow-up that left maintainer-reviews.json on __ALL__ while selfhost-grafana-dashboard.test.ts still asserted $__all — that mismatch is what redlined shard 6 on every recent PR (including #5717).

How

  • coding-task-spec.js — after a ready acceptance-criteria write, call detectRepoStack(workingDirectory) (injectable; production default is the real detector) and append validation guidance: stack summary, "do not assume gittensory CI", and only non-null commands (fail-closed, no guessing).
  • selfhost-grafana-dashboard.test.ts — align expandGrafanaRange + assertions with __ALL__ (same sentinel as ai-usage / miner-usage after fix(observability): stop using Grafana's $__ macro prefix as the SQL "All" sentinel #5716).
  • README updated to reflect the wire-up.

Acceptance criteria

  • Detected Node/Rust/etc. worktree embeds real stack + commands in instructions
  • Undetected worktree embeds the fail-closed reason (no silent gittensory default)
  • Maintainer Reviews Grafana tests match __ALL__ and no longer expect $__all

Out of scope: replacing self-review's LoopOver predicted-gate with foreign-repo check-run success.

Tests

  • npx vitest run test/unit/miner-coding-task-spec.test.ts
  • npx vitest run test/unit/selfhost-grafana-dashboard.test.ts

Scope

Validation

  • Targeted vitest suites above
  • git diff --check
  • npm run test:ci (run before push)

Safety

  • No secrets, wallets, hotkeys, trust scores, or reward values exposed

@carlh7777
carlh7777 requested a review from JSONbored as a code owner July 14, 2026 07:45
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 14, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.06%. Comparing base (14edb77) to head (10c53b2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5722   +/-   ##
=======================================
  Coverage   95.06%   95.06%           
=======================================
  Files         581      581           
  Lines       46169    46179   +10     
  Branches    14811    14811           
=======================================
+ Hits        43891    43901   +10     
  Misses       1517     1517           
  Partials      761      761           
Flag Coverage Δ
shard-1 43.53% <0.00%> (-0.43%) ⬇️
shard-2 35.85% <0.00%> (+0.13%) ⬆️
shard-3 32.15% <0.00%> (-0.14%) ⬇️
shard-4 31.14% <0.00%> (-1.88%) ⬇️
shard-5 32.54% <100.00%> (+0.95%) ⬆️
shard-6 44.84% <0.00%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/gittensory-miner/lib/coding-task-spec.js 97.82% <100.00%> (+0.60%) ⬆️
🚀 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 14, 2026
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tip

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

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-14 08:06:00 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR wires `detectRepoStack`/`renderStackSummary` into `buildCodingTaskSpec`'s instructions via a new `buildValidationGuidance` helper, injectable for testing with a real production default. The logic is sound: it correctly filters null commands, handles the fail-closed undetected case, and appends guidance not to assume gittensory's own CI conventions. Tests cover the detected/undetected/partial-command branches thoroughly, and the diff closes #4786 as claimed while bundling the unrelated Grafana `__ALL__` test-sync fix that's explicitly called out as a CI-unblocking dependency.

Nits — 5 non-blocking
  • The 'magic numbers' flagged in the brief (Generalized plan → implement → test → submit loop #4786 issue references in comments) are not real magic numbers — they're issue-reference annotations, a repo convention, not a defect.
  • coding-task-spec.js: the Grafana `selfhost-grafana-dashboard.test.ts` change isn't shown in the diff despite being described as included — verify it's actually part of this PR's diff and not just described in the PR body.
  • buildValidationGuidance's stack?.detected check uses optional chaining even though stack is always a RepoStackResult object per the type signature — minor defensive redundancy, harmless but worth a comment or removal for clarity.
  • Consider extracting the four-command filter/list construction in buildValidationGuidance into a small named helper if more command types are added later, though at 4 commands the inline array is fine.
  • packages/gittensory-miner/README.md diff wasn't fully inlined — worth a final skim to confirm the prose change matches the actual wiring described.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4786
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: 182 registered-repo PR(s), 115 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor carlh7777; Gittensor profile; 182 PR(s), 17 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: carlh7777
  • 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: 182 PR(s), 17 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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 14, 2026
…ck commands (JSONbored#4786)

- Updated README to clarify the integration of the detected stack into coding-agent instructions.
- Modified `coding-task-spec.d.ts` to include an injectable `detectRepoStack` function for improved stack detection.
- Enhanced `coding-task-spec.js` to append real stack summaries and confidently inferred commands to the agent's prompt, ensuring validation against the target repo's tooling.
- Added unit tests to verify the correct embedding of detected stack commands and handling of undetected stacks, ensuring no assumptions are made about LoopOver/gittensory CI conventions.
@JSONbored
JSONbored force-pushed the feat/stack-prompt-and-grafana-all-sentinel-4786 branch from 324d55e to 10c53b2 Compare July 14, 2026 08:00
@JSONbored
JSONbored merged commit f7b2352 into JSONbored:main Jul 14, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generalized plan → implement → test → submit loop

2 participants