feat(miner-foundation): scaffold packages/gittensory-engine package skeleton - #2357
Conversation
db1b7dd to
d803eef
Compare
d803eef to
75644c0
Compare
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 20:13:18 UTC
⏸️ Suggested Action - Manual Review Review summary Blockers
Nits — 7 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.
|
75644c0 to
fab3d1d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2357 +/- ##
=======================================
Coverage 95.73% 95.73%
=======================================
Files 223 223
Lines 24741 24741
Branches 8969 8969
=======================================
Hits 23685 23685
Misses 433 433
Partials 623 623 🚀 New features to boost your workflow:
|
fab3d1d to
0402577
Compare
0402577 to
c676326
Compare
c676326 to
bc60940
Compare
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
bc60940 to
ebb9769
Compare
…-engine (JSONbored#2302) Adds the core Phase-1 miner-discovery ranker on top of the merged JSONbored#2357 scaffold: a PURE, deterministic function composing five already-normalized [0,1] signals into one ordinal opportunity score, so a later gittensory_find_opportunities tool has something deterministic to sort by. No IO, no Date, no random — following the src/signals/duplicate-winner.ts convention. - src/opportunity-ranker.ts: - rankOpportunityScore(input) = potential * feasibility * laneFit * freshness * (1 - dupRisk), with every field clamped to [0,1] first. Positive factors clamp a non-finite value to 0; dupRisk FAILS CLOSED (non-finite → 1 → max risk), so a broken contention signal collapses the score instead of masking it as safe. - rankOpportunities(candidates): descending sort annotating each with rankScore, with an explicit index tie-break so equal scores keep input order by contract. - src/index.ts: export the ranker from the previously-empty barrel. - test/ + tsconfig.test.json: node:test suite compiled to dist-test/ (no experimental flags, so it runs across the whole engines range). Adds @types/node and typescript devDeps; registers them in the root lockfile. npm test: 11/11 pass.
…-engine (#2302) (#2378) * feat(miner-discovery): pure opportunity-ranker in packages/gittensory-engine (#2302) Adds the core Phase-1 miner-discovery ranker on top of the merged #2357 scaffold: a PURE, deterministic function composing five already-normalized [0,1] signals into one ordinal opportunity score, so a later gittensory_find_opportunities tool has something deterministic to sort by. No IO, no Date, no random — following the src/signals/duplicate-winner.ts convention. - src/opportunity-ranker.ts: - rankOpportunityScore(input) = potential * feasibility * laneFit * freshness * (1 - dupRisk), with every field clamped to [0,1] first. Positive factors clamp a non-finite value to 0; dupRisk FAILS CLOSED (non-finite → 1 → max risk), so a broken contention signal collapses the score instead of masking it as safe. - rankOpportunities(candidates): descending sort annotating each with rankScore, with an explicit index tie-break so equal scores keep input order by contract. - src/index.ts: export the ranker from the previously-empty barrel. - test/ + tsconfig.test.json: node:test suite compiled to dist-test/ (no experimental flags, so it runs across the whole engines range). Adds @types/node and typescript devDeps; registers them in the root lockfile. npm test: 11/11 pass. * test(miner-discovery): exercise the public barrel in ranker tests (#2302) Import through ../dist/index.js instead of the impl file so the package's export contract is covered, and add a barrel smoke test asserting the named exports are present. * fix(miner-discovery): fail closed on below-range dupRisk too (#2302) clampRisk previously failed closed only on non-finite dupRisk; a negative value clamped to 0 (no penalty), letting a malformed contention signal masquerade as a safe opportunity. Now ANY dupRisk outside [0,1] — non-finite, negative, or above 1 — fails closed to max risk (1), so (1 - risk) = 0 and the score collapses. Makes the fail-closed contract uniform in both directions. - clampRisk: return 1 for anything not in [0,1]; pass through in-range values. - Tests: negative dupRisk now asserts a 0 score (folded into the out-of-range fail-closed table). - README + doc-comment: document below-range fail-closed handling. - Drop the drift-prone "~lines 88-93" reward-risk.ts line reference. npm test: 12/12 pass. * refactor(miner-discovery): clamp finite dupRisk, fail closed only on non-finite (#2302) Aligns dupRisk with the documented "every field clamped to [0,1]" contract: a FINITE out-of-range dupRisk is now clamped like the other fields (-0.1 -> 0 = no contention, 1.4 -> 1 = full contention) instead of failing closed. Only a NON-finite dupRisk (NaN/±Infinity), which genuinely can't be clamped, fails closed to max risk (1) — keeping the original guarantee that a broken signal never masquerades as a safe opportunity. Docs (module header, clampRisk, formula) now match this exactly. Also type rankOpportunities' result as Omit<T, "rankScore"> & ... & { rankScore } so the computed annotation cleanly replaces any rankScore a caller already carries, instead of producing an awkward intersection. npm test: 12/12 pass. --------- Co-authored-by: Nick M <274344962+nickmopen@users.noreply.github.com>
Summary
Stands up the new shared engine package
packages/gittensory-engine/(@jsonbored/gittensory-engine), packaging-only with no logic moved yet, mirroring the existingpackages/gittensory-mcp/conventions. This is the skeleton that later issues extract deterministicsrc/logic into.Closes #2275
Deliverables
packages/gittensory-engine/package.json— name@jsonbored/gittensory-engine, version0.1.0,AGPL-3.0-only,type: module,repository.directoryset,publishConfig.access: public,engines.node >=22.0.0, andfilesscoped todist+CHANGELOG.md(nosrc). A realtscbuild viamain/types/exportspointing atdist.packages/gittensory-engine/tsconfig.json— extends the roottsconfig.jsonso it inheritsstrict,noUncheckedIndexedAccess, andexactOptionalPropertyTypes, with its ownoutDir: dist,rootDir: src, and a Node ESM emit (NodeNext) plusdeclaration.packages/gittensory-engine/src/index.ts— placeholder barrel export marking the extraction target for later issues.buildscript (tsc -p tsconfig.json), verified:npm run build --workspace @jsonbored/gittensory-engineemitsdist/index.jsanddist/index.d.ts.package.jsonalready globspackages/*inworkspaces, sonpm cidiscovers the package with no additional wiring; the README notes this.packages/gittensory-engine/README.mdstub explaining the package purpose and independent versioning, plusLICENSEand aCHANGELOG.mdstub to match the sibling package layout.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; does not touchsite/,CNAME, or reintroduce removed tooling.Validation
npm run build --workspace @jsonbored/gittensory-enginesucceeds and emitsdist/(build artifact, gitignored).git diff --checkclean.