Skip to content

feat(miner-foundation): scaffold packages/gittensory-engine package skeleton - #2357

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
GildardoDev:feat/engine-scaffold
Jul 1, 2026
Merged

feat(miner-foundation): scaffold packages/gittensory-engine package skeleton#2357
JSONbored merged 1 commit into
JSONbored:mainfrom
GildardoDev:feat/engine-scaffold

Conversation

@GildardoDev

Copy link
Copy Markdown
Contributor

Summary

Stands up the new shared engine package packages/gittensory-engine/ (@jsonbored/gittensory-engine), packaging-only with no logic moved yet, mirroring the existing packages/gittensory-mcp/ conventions. This is the skeleton that later issues extract deterministic src/ logic into.

Closes #2275

Deliverables

  • packages/gittensory-engine/package.json — name @jsonbored/gittensory-engine, version 0.1.0, AGPL-3.0-only, type: module, repository.directory set, publishConfig.access: public, engines.node >=22.0.0, and files scoped to dist + CHANGELOG.md (no src). A real tsc build via main/types/exports pointing at dist.
  • packages/gittensory-engine/tsconfig.json — extends the root tsconfig.json so it inherits strict, noUncheckedIndexedAccess, and exactOptionalPropertyTypes, with its own outDir: dist, rootDir: src, and a Node ESM emit (NodeNext) plus declaration.
  • packages/gittensory-engine/src/index.ts — placeholder barrel export marking the extraction target for later issues.
  • build script (tsc -p tsconfig.json), verified: npm run build --workspace @jsonbored/gittensory-engine emits dist/index.js and dist/index.d.ts.
  • Root package.json already globs packages/* in workspaces, so npm ci discovers the package with no additional wiring; the README notes this.
  • packages/gittensory-engine/README.md stub explaining the package purpose and independent versioning, plus LICENSE and a CHANGELOG.md stub to match the sibling package layout.

Scope

Validation

  • npm run build --workspace @jsonbored/gittensory-engine succeeds and emits dist/ (build artifact, gitignored).
  • git diff --check clean.
  • No existing file changed; root workspaces auto-discovers the package.

@loopover-orb

loopover-orb Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-01 20:13:18 UTC

8 files · 1 AI reviewer · no blockers · readiness 55/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
The diff cleanly adds a packaging-only `@​jsonbored/gittensory-engine` workspace with a real `tsc` build, NodeNext package metadata, an empty ESM barrel, README, license, lockfile wiring, and focused scaffold tests for the publish contract. The package shape is internally consistent: entry points target `dist`, `files` excludes source, `tsconfig.json` emits declarations from `src`, and the empty `export {}` keeps the placeholder module buildable. The main maintainership concern is that the PR also hand-edits a package changelog stub, which conflicts with the repo guidance that changelogs are generated rather than edited in ordinary PRs.

Blockers

  • packages/gittensory-engine/CHANGELOG.md:1 adds a hand-written changelog in a normal feature PR even though the repo convention says changelogs are generated by release tooling, so remove this file from the PR or point to the existing sibling-package precedent that requires per-package changelogs at scaffold time.
Nits — 7 non-blocking
  • test/unit/gittensory-engine-scaffold.test.ts:1 only pins `package.json`; consider adding a small assertion for `tsconfig.json` so the package cannot silently lose `declaration`, `rootDir`, or NodeNext emit settings.
  • packages/gittensory-engine/package.json:20 includes forward-looking keywords before any runtime modules exist; keep the metadata minimal unless these are already used by the sibling package convention.
  • Remove `packages/gittensory-engine/CHANGELOG.md` from the scaffold, or document the package-specific exception if this package layout intentionally differs from the repo-wide changelog rule.
  • Extend `test/unit/gittensory-engine-scaffold.test.ts` to import `packages/gittensory-engine/tsconfig.json` and assert the build contract alongside the package contract.
  • Diff looks like trivial or whitespace-only churn — Reduce whitespace-only or formatting-only churn and keep the diff focused on substantive changes.
  • Pull request duplicates other open work — Check for an existing pull request or issue covering this change and coordinate or consolidate before continuing.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2275
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:M; 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: 219 registered-repo PR(s), 161 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor GildardoDev; Gittensor profile; 219 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: GildardoDev
  • 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: 219 PR(s), 0 issue(s).
  • Related work: Titles/paths share 10 meaningful terms. (PR #2389)
  • Related work: Titles/paths share 8 meaningful terms. (PR #2378)
  • Related work: Titles/paths share 6 meaningful terms. (PR #2392)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
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 added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 1, 2026
@GildardoDev
GildardoDev force-pushed the feat/engine-scaffold branch from 75644c0 to fab3d1d Compare July 1, 2026 12:42
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.73%. Comparing base (981355c) to head (ebb9769).
⚠️ Report is 11 commits behind head on main.

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is the scaffold, not a normal feature PR. Redact blocker.

@JSONbored
JSONbored self-requested a review July 1, 2026 20:15
@dosubot dosubot Bot added the lgtm label Jul 1, 2026
@JSONbored
JSONbored merged commit 94f30db into JSONbored:main Jul 1, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 1, 2026
nickmopen added a commit to nickmopen/gittensory that referenced this pull request Jul 1, 2026
…-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.
JSONbored pushed a commit that referenced this pull request Jul 2, 2026
…-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(miner-foundation): scaffold packages/gittensory-engine package skeleton

2 participants