feat(miner): leakage-safe task generation for historical replay - #3146
Conversation
Adds freeze-point selection, forward-reference scrubbing (issue/PR/commit references that resolve only to post-T state), recency-pool provenance, and a one-shot generator that returns the frozen snapshot and the revealed post-T ground truth as separate bundles so a replay run never holds both at once. All pure and deterministic. Closes JSONbored#3011
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-04 16:47:27 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3146 +/- ##
=======================================
Coverage 96.09% 96.09%
=======================================
Files 265 265
Lines 29088 29088
Branches 10595 10595
=======================================
Hits 27951 27951
Misses 493 493
Partials 644 644 🚀 New features to boost your workflow:
|
Summary
Implements leakage-safe task generation for the historical-replay calibration harness (Closes #3011).
New module
packages/gittensory-miner/lib/replay-task-generation.jsselects calibration-worthy freeze points, scrubs forward references out of the frozen context, tags each point's recency pool, and returns the frozen snapshot and the revealed post-T ground truth as separate bundles. Every function is pure and deterministic — no clock, no randomness, no IO — so a given(candidate, context)always yields an identical task.selectFreezePoint(candidate, thresholds)— a freeze point is eligible only with enough real history on both sides of T (minPriorCommits/minRevealedCommits); each unmet threshold is reported as a reason.detectForwardReferences/scrubForwardReferences(text, context)— classify and remove references that resolve only to post-T state:#Nand GitHub issues/pull deep-links withN > knownIssueMax, and raw/URL commit SHAs not in the pre-TknownCommitShasset;lintFrozenContext(texts, context)— the check that rejects a freeze-point candidate if any text still carries an unscrubbable forward reference after scrubbing.classifyRecencyPool(candidate, { modelCutoffIso })— records therecent/olderpool provenance (ISO-8601 sorts lexicographically, so no clock is needed) for later pool-sliced scoring.generateReplayTask(candidate, context, options)— one-shot: select → lint → scrub, returningfrozenandrevealedas separate top-level bundles (never merged, so the replay pipeline never holds both at once); ineligible or un-scrubbable candidates are rejected without producing a task.Pure, self-contained, additive — a new foundation module alongside
replay-objective-anchor. No existing module, CLI surface, or dependency changes; nosrc/**touched.Scope
lib/*.js+ hand-written.d.ts(package convention), registered in thebuildnode-check line. Nosite//CNAME/**/lovable/**; noCHANGELOG.md.Validation
npm run build --workspace @jsonbored/gittensory-miner(node --check, incl. the new module)npm run typecheckgit diff --check;command-reference:check+docs:drift-checkcleangenerateReplayTaskeligible (frozen/revealed separation asserted) / selection-reject / unscrubbable-reject / determinism.Safety