Skip to content

refactor(engine): move the unlinked-issue candidate pre-filter into the shared engine - #5778

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
luciferlive112116:chore/engine-extract-unlinked-issue-candidates
Jul 14, 2026
Merged

refactor(engine): move the unlinked-issue candidate pre-filter into the shared engine#5778
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
luciferlive112116:chore/engine-extract-unlinked-issue-candidates

Conversation

@luciferlive112116

Copy link
Copy Markdown
Contributor

Summary

Extracts the deterministic unlinked-issue candidate pre-filter (findUnlinkedIssueCandidates) out of src/signals/unlinked-issue-candidates.ts into the shared @loopover/engine package, per #4883 ("Extract the rest of signals/"). The module is confirmed-pure — no IO, no AI call, no other-src/ imports — so it relocates cleanly:

  • new packages/loopover-engine/src/signals/unlinked-issue-candidates.ts — the canonical implementation (moved verbatim).
  • src/signals/unlinked-issue-candidates.ts becomes a thin re-export shim, imported via the relative source path (matching src/signals/slop.ts / check-summary.ts), so check-engine-parity recognizes it as a shim rather than a hand-duplicated twin and it never depends on the engine's built dist/ during typecheck/test:coverage.
  • re-exported from the engine barrel (packages/loopover-engine/src/index.ts) so the published loopover-miner / loopover-mcp CLIs can run the identical recall pass the maintainer gate uses instead of a driftable second copy.

No behavior change. The existing test/unit/unlinked-issue-candidates.test.ts imports the shim path unchanged and passes; findUnlinkedIssueCandidates keeps identical logic, and check-engine-parity treats the host file as a shim (not a twin).

Closes #4883

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 a currently open issue this PR resolves (Closes #4883).

Validation

  • git diff --check
  • npm run typecheck (clean — the shim + barrel export + moved module all resolve @loopover/engine correctly)
  • npm --workspace @loopover/engine run build (the moved file + barrel export compile into dist/)
  • npm run test:coverage scoped to the moved module — 100% lines and branches (24/24 branches, 35/35 statements) via the existing 16-case test, imported through the shim
  • test/contract/engine-parity.test.ts + both consumers (unlinked-issue-guardrail, unlinked-issue-match) green — 84 tests pass
  • New/changed behavior has tests (unchanged behavior; the existing suite fully covers the moved module)

If any required check was skipped, explain why:

  • This is a pure src/@loopover/engine code move with no UI, API/OpenAPI, MCP tool, DB/migration, workflow, or dependency changes, so ui:*, ui:openapi:check, db:*, actionlint, and npm audit have no relevant surface. The full test:ci suite was not run end-to-end locally (several shell/self-host steps are Linux-only and fail on Windows unrelated to this change); the change-relevant gates above were validated directly.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, PATs, private keys, raw trust scores, private rankings, or private maintainer evidence — this is a pure token/path string-matching helper with no new public output.
  • Public GitHub text stays sanitized and unchanged (no comment-text change).
  • No auth/cookie/CORS/GitHub App/Cloudflare/session changes.
  • No API/OpenAPI/MCP behavior change (relative-source re-export; the engine barrel gains one pure helper).
  • No UI changes.
  • No public docs/changelog changes needed.

Notes

  • Line-for-line, the engine copy is the former src/ implementation; the host file is reduced to a re-export shim, keeping check-engine-parity happy (verified locally: isThinEngineReExportShim returns true for the new shim).

…he shared engine

The deterministic unlinked-issue candidate pre-filter (findUnlinkedIssueCandidates) is
confirmed-pure -- no IO, no AI, no other-src imports -- so it moves cleanly into
@loopover/engine (JSONbored#4883), letting the published miner/mcp CLIs run the identical recall
pass the maintainer gate uses instead of maintaining a driftable second copy.

- new packages/loopover-engine/src/signals/unlinked-issue-candidates.ts holds the canonical
  implementation.
- src/signals/unlinked-issue-candidates.ts becomes a thin re-export shim, imported via the
  relative source path (matching src/signals/slop.ts) so check-engine-parity recognizes it as
  a shim rather than a hand-duplicated twin, and so it never depends on the engine's built dist/.
- re-exported from the engine barrel for external @loopover/engine consumers.

No behavior change: the existing test/unit/unlinked-issue-candidates.test.ts imports the shim
path unchanged and passes (100% line/branch coverage of the moved module).

Closes JSONbored#4883
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.07%. Comparing base (0e02a32) to head (adf611e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5778   +/-   ##
=======================================
  Coverage   95.07%   95.07%           
=======================================
  Files         582      582           
  Lines       46219    46219           
  Branches    14822    14822           
=======================================
  Hits        43943    43943           
  Misses       1516     1516           
  Partials      760      760           
Flag Coverage Δ
shard-1 43.93% <17.85%> (-0.01%) ⬇️
shard-2 35.79% <75.00%> (+0.02%) ⬆️
shard-3 32.25% <100.00%> (+<0.01%) ⬆️
shard-4 33.54% <17.85%> (+0.61%) ⬆️
shard-5 31.18% <17.85%> (-0.55%) ⬇️
shard-6 44.61% <71.42%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...er-engine/src/signals/unlinked-issue-candidates.ts 100.00% <100.00%> (ø)
🚀 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 14, 2026
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-14 14:52:36 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This moves findUnlinkedIssueCandidates verbatim into packages/loopover-engine/src/signals/unlinked-issue-candidates.ts, re-exports it from the engine barrel, and turns the original src/signals/unlinked-issue-candidates.ts into a re-export shim via relative source path — matching the stated slop.ts/check-summary.ts convention. The logic itself is byte-for-byte unchanged (same tokenize, path-mention, scoring, and MAX_CANDIDATES=3 behavior), so this is a low-risk pure relocation. The existing test/unit/unlinked-issue-candidates.test.ts still imports the shim path unchanged, so it continues to exercise the same code, and no new test file was added for the move itself, which is expected for a verbatim extraction.

Nits — 6 non-blocking
  • The shim at src/signals/unlinked-issue-candidates.ts:8 uses `export *`, which silently drops the ability to re-export a default if one is ever added — a named re-export list (as engine's index.ts does) would be more explicit and consistent.
  • No test asserts that the engine barrel (packages/loopover-engine/src/index.ts) actually exposes findUnlinkedIssueCandidates/MAX_CANDIDATES to downstream consumers (loopover-miner/loopover-mcp) — worth a smoke test given the stated motivation for the move.
  • packages/loopover-engine/src/index.ts now sits at ~430 lines per the size-smell note; consider whether this barrel should be split, though that's out of scope for this PR.
  • Add a one-line test (or extend the existing suite) that imports findUnlinkedIssueCandidates from '@​loopover/engine' to actually verify the barrel wiring end-to-end, not just the relative-path shim.
  • Confirm check-engine-parity's shim-detection heuristic explicitly recognizes this new `export *` pattern the same way it does for slop.ts/check-summary.ts.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4883
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 ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 83 registered-repo PR(s), 36 merged, 36 issue(s).
Contributor context ✅ Confirmed Gittensor contributor luciferlive112116; Gittensor profile; 83 PR(s), 36 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ⚠️ ℹ️ None detected risk: low · value: none — No structural-improvement signals were detected for this PR. LLM value judgment: minor — This is a mechanical, verbatim code relocation that closes a tracked extraction issue (#4883) with no behavior change and passing CI, which is useful but narrow, low-complexity engine housekeeping.
Linked issue satisfaction

Partially addressed
The PR moves one confirmed-pure signals file (unlinked-issue-candidates.ts) into the shared engine with proper shims in both directions, which is real progress on the issue's ask, but the issue explicitly frames this as extracting 'most of the signals directory' (multiple confirmed-pure files) in one phase, and only a single file is migrated here.

Review context
  • Author: luciferlive112116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 83 PR(s), 36 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver 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 7d59907 into JSONbored:main Jul 14, 2026
16 checks passed
This was referenced Jul 14, 2026
This was referenced Jul 15, 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.

Extract the rest of signals/

1 participant