feat(miner): deterministic objective-anchor scoring for replayed plans - #3141
Conversation
Adds the structural half of the historical-replay calibration score: it compares the modules and change-kind a replayed plan/PR targeted against what the revealed post-T history actually changed, returning a reproducible [0, 1] score with a full audit breakdown and no LLM call in its path. Closes JSONbored#3012
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-04 16:25:13 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 4 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 #3141 +/- ##
=======================================
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 the deterministic structural half of the historical-replay calibration score (Closes #3012).
New module
packages/gittensory-miner/lib/replay-objective-anchor.jscompares what the miner's replayed plan/PR targeted against what the revealed post-T history actually changed, and returns a reproducible[0, 1]objective-anchor score plus a full audit breakdown. There is no LLM call in its path — given the same two feature sets it is byte-for-byte reproducible.extractReplayTargetFeatures(plan)— structural features of the replayed plan/PR: the sorted, de-duplicated set of modules touched (a path's directory) and its change kind (explicitchangeKindwins, else classified from the Conventional-Committitle).extractRevealedFeatures(history)— the same for the revealed post-T history (a list of commits/PRs; a single object is tolerated): modules unioned, change kinds collected into a set.scoreObjectiveAnchor(replay, revealed)—MODULE_OVERLAP_WEIGHT * jaccard(modules) + CHANGE_KIND_WEIGHT * kindMatch(weights0.7/0.3, summing to 1). Disjoint modules + unmatched kind floor at0; both-empty divides-by-zero-safely to0— a zero-overlap comparison is a score floor, not an error.computeObjectiveAnchor({ replayPlan, revealedHistory })— one-shot entry point returning the score together with both extracted feature sets, so a low score is auditable after the fact without re-running extraction.Change kinds collapse onto a frozen vocabulary (
feature/fix/refactor/docs/test/chore/perf/build/ci/style/other); an unknown prefix degrades tootherrather than throwing.Pure, self-contained, additive — a new foundation module alongside
opportunity-ranker. 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-checkcleancomputeObjectiveAnchorend-to-end audit shape.Safety