Skip to content

feat(engine): wire historical replay into Phase 7 calibration loop - #3225

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
andriypolanski:feat/phase7-calibration-loop-historical-replay-v2
Jul 4, 2026
Merged

feat(engine): wire historical replay into Phase 7 calibration loop#3225
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
andriypolanski:feat/phase7-calibration-loop-historical-replay-v2

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Closes #3014.

Adds the pure engine contract for Phase 7 calibration loop wiring in @jsonbored/gittensory-engine. The historical-replay composite score (from objective-anchor, pairwise-judge, and structured gate-verdict inputs) is combined alongside the live pr_outcome-derived accuracy signal instead of silently replacing it. The loop tracks a combined calibration-accuracy metric anchored to the documented 62% baseline, records provenance per source, recommends replay-run cadence, and fail-closes autonomy-level increases when the replay harness is missing, stale, degraded, unavailable, or below the configured threshold.

Changed files

File Change
packages/gittensory-engine/src/phase7-calibration-loop.ts New pure module: config resolution, pr_outcome accuracy derivation, replay freshness/cadence, combined metric, autonomy gating, audit markdown.
packages/gittensory-engine/test/phase7-calibration-loop.test.ts Unit/regression tests for config, combine, fail-closed holds, baseline anchoring, and markdown rendering.
packages/gittensory-engine/src/index.ts Export Phase 7 calibration loop APIs.
packages/gittensory-engine/README.md Document config surface and usage example.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • 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 an issue, or this is small enough that the summary explains why an issue is not needed.

Linked issue: #3014.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:ci — run before push (~8 min).
  • npm audit --audit-level=moderate

@andriypolanski
andriypolanski requested a review from JSONbored as a code owner July 4, 2026 20:39
@andriypolanski andriypolanski changed the title Feat/phase7 calibration loop historical replay v2 feat(engine): wire historical replay into Phase 7 calibration loop Jul 4, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added the gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 20:40:12 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
The new Phase 7 engine module is coherent: it resolves the opt-in config, derives the live pr_outcome metric from raw counters, combines it with a fresh healthy replay score, and fail-closes autonomy increases when replay evidence is missing or rejected. The tests exercise the main enabled/disabled, stale/degraded, threshold, export, and markdown paths, and the barrel export is consistent with the new module. I do not see a reachable correctness defect in the provided changed files.

Nits — 5 non-blocking
  • nit: packages/gittensory-engine/src/phase7-calibration-loop.ts:52 defines `PrOutcomeCalibrationInput.hold` but `computePrOutcomeCalibrationAccuracy()` never reads it, so either document that held outcomes are intentionally excluded from the decided accuracy denominator or remove the field from this pure contract.
  • nit: packages/gittensory-engine/src/phase7-calibration-loop.ts:210 reports all malformed top-level alias values as `miner.calibration.*` warnings, which can send operators to the wrong config path when they used `calibration.*`; consider including the resolved source path in each warning.
  • nit: packages/gittensory-engine/src/phase7-calibration-loop.ts:292 treats `harnessStatus: "missing"` the same as an otherwise healthy/fresh replay for scheduling if `lastReplayObservedAt` is present; if callers can know the harness is missing independently of the last run timestamp, make that an explicit due reason.
  • packages/gittensory-engine/src/phase7-calibration-loop.ts:52: add a test for a nonzero `hold` counter and assert the intended behavior, because that is the only pr_outcome field whose contribution is not obvious from the helper name.
  • packages/gittensory-engine/src/phase7-calibration-loop.ts:210: change warning construction to name `miner.calibration` or `calibration` based on which raw value actually won the overlay.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3014
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 ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 110 registered-repo PR(s), 74 merged, 5 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 110 PR(s), 5 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 110 PR(s), 5 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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.

🟩 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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 9ff378d into JSONbored:main Jul 4, 2026
7 checks passed
@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 4, 2026
@andriypolanski
andriypolanski deleted the feat/phase7-calibration-loop-historical-replay-v2 branch July 16, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner): wire the historical-replay harness into the live Phase 7 calibration loop

1 participant