Skip to content

feat(tooling): feed recorded drafting misses back into every issue draft as a pre-publish checklist - #8150

Merged
JSONbored merged 1 commit into
mainfrom
feat/drafting-miss-feedback
Jul 23, 2026
Merged

feat(tooling): feed recorded drafting misses back into every issue draft as a pre-publish checklist#8150
JSONbored merged 1 commit into
mainfrom
feat/drafting-miss-feedback

Conversation

@JSONbored

@JSONbored JSONbored commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes the learning loop Capture drafting-quality feedback: feed post-merge gaps back into #8103's issue-drafting tool #8118 asked for on top of tooling: maintainer CLI to expand a loose issue prompt into a gate-ready contributor issue #8103's drafting core (built on feat(tooling): pure issue-drafting core + CLI to expand a loose prompt into a gate-ready draft #8148, which merged while this was in flight — rebased onto main):
    • scripts/record-drafting-miss.ts — the cheap, manual recorder: when a real post-merge gap traces back to a drafted issue, one command appends {recordedAt, loosePrompt, missing, category?} to scripts/drafting-misses.json (a plain committed file — the issue's "no new database" boundary). The recorder re-validates the whole file through the core parser on every append, so a broken hand-edit surfaces at record time, not on the next draft.
    • parseDraftingMisses in the core — deliberately fail-loud (contrast the corpus parsers' fail-open posture): silently dropping a malformed lesson would defeat the loop.
    • draftIssueBody now applies accumulated misses on every draft: a "Pre-publish checklist" section grouped per category (repeats counted, most-recent lesson wording wins, deterministic ordering), under the same resolve-then-DELETE contract as the UNGROUNDED markers so it can never survive publishing. scripts/draft-issue.ts auto-picks up the default file when it exists; --misses overrides, and an explicit path that doesn't exist fails loudly instead of silently drafting without the checklist.
  • Still zero auto-detection: a human decides what counts as a miss (the issue's own boundary).

Closes #8118

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Full npm run test:ci ran green end-to-end on this branch (includes every box above). The extended core keeps 100% line AND branch coverage (31 tests, scoped v8 report: 87/87 branches). record-drafting-miss.ts is thin IO glue under the established scripts exemption; its validation logic lives in the tested core parser.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

The misses file is maintainer-authored content in the public repo — the recorder is manual by design, so nothing sensitive can enter it without a human typing it there.

UI Evidence

Not applicable — no UI change.

Notes

  • No scripts/drafting-misses.json is seeded — the checklist section only appears once a real miss is recorded, so drafts stay unchanged until the loop has actual lessons.

…aft as a pre-publish checklist (#8118)

Every draft was independent -- the tool had no memory of past post-merge gaps,
the exact failure mode the maintainer named as the bottleneck. Now a real gap,
once found, is recorded manually via scripts/record-drafting-miss.ts (appends
to scripts/drafting-misses.json -- a plain committed file, no new database)
and draftIssueBody applies the accumulated lessons on EVERY subsequent draft:
a checklist section grouped per category (repeats counted, most recent lesson
wording wins), under the same resolve-then-DELETE contract as the UNGROUNDED
markers so it can never survive publishing.

parseDraftingMisses is deliberately fail-loud -- silently dropping a malformed
lesson would defeat the loop -- and the recorder re-validates the whole file
through the same parser on every append so a broken hand-edit surfaces at
record time, not on the next draft. Still zero auto-detection: a human decides
what counts as a miss (#8118's own boundary). 100% line+branch coverage on the
extended core.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 23, 2026
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.04%. Comparing base (8b62071) to head (f21c43f).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8150   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         765      765           
  Lines       77638    77668   +30     
  Branches    23461    23472   +11     
=======================================
+ Hits        71463    71493   +30     
  Misses       5062     5062           
  Partials     1113     1113           
Flag Coverage Δ
shard-1 52.13% <0.00%> (-0.03%) ⬇️
shard-2 54.13% <100.00%> (+0.01%) ⬆️
shard-3 56.58% <0.00%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
src/services/issue-drafting.ts 100.00% <100.00%> (ø)

@JSONbored
JSONbored enabled auto-merge (squash) July 23, 2026 06:11
@JSONbored
JSONbored disabled auto-merge July 23, 2026 06:12
@JSONbored
JSONbored merged commit f31ab7e into main Jul 23, 2026
13 checks passed
@JSONbored
JSONbored deleted the feat/drafting-miss-feedback branch July 23, 2026 06:12
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capture drafting-quality feedback: feed post-merge gaps back into #8103's issue-drafting tool

1 participant