feat(miner-selfimprove): local prediction-ledger schema - #4390
Conversation
Add packages/gittensory-miner/lib/prediction-ledger.js: an append-only local SQLite ledger recording every predicted-gate verdict (conclusion/pack/readiness + blocker/warning codes + the producing ENGINE_VERSION) so a later self-improve pass can score predictions against realized outcomes. Mirrors governor-ledger.js's shape (resolveDbPath/init/append/read/closeDefault) with the same file-resolution convention, close() semantics, and INSERT+SELECT-only invariant; normalization is local like event-ledger.js. Closes JSONbored#4263
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4390 +/- ##
=======================================
Coverage 93.96% 93.96%
=======================================
Files 401 401
Lines 36869 36869
Branches 13480 13480
=======================================
Hits 34644 34644
Misses 1569 1569
Partials 656 656 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 17:17:34 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
What
Adds
packages/gittensory-miner/lib/prediction-ledger.js— an append-only local SQLite ledger that records every predicted-gate verdict the miner computes, so a later self-improve pass can score each prediction against the realizedpr_outcome. It mirrorsgovernor-ledger.js's shape (resolvePredictionLedgerDbPath/initPredictionLedger/appendPrediction/readPredictions/closeDefaultPredictionLedger) with the same SQLite-file-resolution convention,close()semantics, and INSERT+SELECT-only immutability invariant. Normalization is local (likeevent-ledger.js), so the offline miner package pulls in no engine module.A
PredictionLedgerEntryrecords small, stable rows:id,ts,repoFullName,targetId+ optionalheadSha(join key), the verdict'sconclusion/pack/readinessScore, blocker/warning codes only (no free-text detail, so rows stay diffable), and theENGINE_VERSIONthat produced the call.Deliverables
prediction-ledger.js(+.d.ts) mirroringgovernor-ledger.js:resolvePredictionLedgerDbPath(env?),initPredictionLedger(dbPath?),appendPrediction(input),readPredictions(filter?),closeDefaultPredictionLedger().PredictionLedgerEntryrecording id/ts/repo, the join key (targetId+ optionalheadSha),conclusion/pack/readinessScore, blocker/warning codes, and the producingENGINE_VERSION.GITTENSORY_MINER_PREDICTION_LEDGER_DB→ config-dir → XDG → home), sameclose()semantics, same fail-safe validation (throws on invalid input,corrupted_prediction_rowon a bad read).Closes #4263