Skip to content

feat(miner): add governor event ledger schema and writer - #2798

Closed
pekar9781 wants to merge 16 commits into
JSONbored:mainfrom
pekar9781:feat/miner-metadata-ranker-v2
Closed

feat(miner): add governor event ledger schema and writer#2798
pekar9781 wants to merge 16 commits into
JSONbored:mainfrom
pekar9781:feat/miner-metadata-ranker-v2

Conversation

@pekar9781

@pekar9781 pekar9781 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add typed governor ledger normalization in @jsonbored/gittensory-engine with a fixed decision vocabulary.
  • Add append-only local SQLite writer in @jsonbored/gittensory-miner mirroring the existing event-ledger pattern.
  • Cover happy-path appends, fail-closed unknown event types, repo filtering, and payload round-trips in unit tests.

Closes #2328.

Scope

Validation

  • npm run test:ci locally — Node.js is not installed on the contributor machine; CI will run the full gate on push.
  • New behavior has unit tests for all event types, malformed input rejection, repo filtering, and SQLite permissions.

Safety

  • No secrets, wallet details, hotkeys, or private scoring output in code or PR text.
  • Local-only storage: insert + select only, no GitHub writes, no uploads.

UI Evidence

Not applicable — engine + miner package only.

Notes

  • Mirrors src/selfhost/audit.ts structured-event shape and the miner event-ledger.js local-store pattern.
  • Does not wire governor enforcement yet; this issue defines the storage contract other governor issues will populate.

pekar9781 and others added 16 commits July 3, 2026 11:52
Compose deterministic engine signals from fan-out issue metadata and rank
candidates locally with the shared opportunity ranker, including freshness
and competition parity helpers for local dup-risk estimation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ches

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the engine package node:test file so codecov patch only gates test/unit coverage. Invalid or missing issue timestamps now floor freshness instead of ranking malformed metadata first. Summary skippedInvalid counts malformed rows only, not deduped valid pairs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…anches

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.51163% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.16%. Comparing base (06f33a7) to head (b7f9e14).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...ages/gittensory-engine/src/opportunity-metadata.ts 95.71% 0 Missing and 3 partials ⚠️

❌ Your patch status has failed because the patch coverage (96.51%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2798      +/-   ##
==========================================
+ Coverage   96.12%   96.16%   +0.03%     
==========================================
  Files         248      250       +2     
  Lines       27548    27645      +97     
  Branches    10007    10043      +36     
==========================================
+ Hits        26481    26584     +103     
+ Misses        443      433      -10     
- Partials      624      628       +4     
Files with missing lines Coverage Δ
...ges/gittensory-engine/src/opportunity-freshness.ts 100.00% <100.00%> (ø)
...ages/gittensory-engine/src/opportunity-metadata.ts 95.71% <95.71%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 3, 2026
@loopover-orb

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-03 19:16:09 UTC

12 files · 1 AI reviewer · no blockers · readiness 73/100 · CI failing · dirty

🛑 Suggested Action - Fix Blockers

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 5 non-blocking
  • nit: packages/gittensory-miner/lib/opportunity-ranker.js:97 reparses goalSpecContentByRepo via buildGoalSpecsByRepo a second time just to compute usedDefaultGoalSpec; reuse the map already built for the rank context.
  • nit: packages/gittensory-engine/src/opportunity-metadata.ts:147 and packages/gittensory-engine/src/opportunity-freshness.ts:29 expose test-only internals from production modules; prefer covering behavior through public APIs or make the deep-import surface an explicit supported contract.
  • nit: packages/gittensory-miner/lib/opportunity-ranker.js:19 accepts repoFullName values that are not exactly owner/repo, so malformed slugs like owner/repo/extra still rank with derived owner/repo fields.
  • In packages/gittensory-miner/lib/opportunity-ranker.js, build the goal spec map once in rankCandidateIssuesWithSummary and derive both the rank context and usedDefaultGoalSpec from it.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

CI checks failing

  • codecov/patch — 96.51% of diff hit (target 99.00%)
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
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 (no linked issue context).
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: 885 registered-repo PR(s), 638 merged, 26 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 885 PR(s), 26 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jony376
  • 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: 885 PR(s), 26 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Gittensory closed this because @jony376 has 3 open pull requests, above this repository's configured limit of 2. Close or merge an existing one to open a new one. This is an automated maintenance action.

@loopover-orb loopover-orb Bot closed this Jul 3, 2026
@pekar9781

Copy link
Copy Markdown
Contributor Author

Reopening after rebase onto latest main and codecov patch fixes.

@pekar9781

Copy link
Copy Markdown
Contributor Author

Reopening with governor event ledger work for #2328 (replaces prior metadata ranker attempt, now merged via #2806).

@pekar9781 pekar9781 changed the title feat(miner): add metadata-only opportunity ranker pipeline feat(miner): add governor event ledger schema and writer Jul 3, 2026
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-governor): append-only local event ledger schema + writer

1 participant