Skip to content

feat(engine): extract path-matchers.ts's pure classifier family to gittensory-engine - #4444

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/extract-path-matchers-engine
Jul 9, 2026
Merged

feat(engine): extract path-matchers.ts's pure classifier family to gittensory-engine#4444
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
joaovictor91123:feat/extract-path-matchers-engine

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

  • Closes feat(engine): extract path-matchers.ts's pure classifier family to gittensory-engine #4252 by moving src/signals/path-matchers.ts's pure classifier family (classifyChangedFile, isGeneratedFile, isVendoredFile, isLockfile, isMinifiedFile, isDocsFile, isDependencyManifestFile, isConfigFile, isNonSubstantivePaddingFile, isTestFile, isCodeFile) to packages/gittensory-engine/src/signals/path-matchers.ts, mirroring the already-shipped test-evidence.ts extraction exactly.
  • src/signals/path-matchers.ts becomes a thin re-export shim (export * from "../../packages/gittensory-engine/src/signals/path-matchers";) over the canonical engine implementation, matching src/signals/test-evidence.ts's established pattern (relative source import, not the published package, so typecheck/test:coverage don't depend on the engine's built dist/ output).
  • Added the ./signals/path-matchers subpath to packages/gittensory-engine/package.json's exports map, matching the ./signals/test-evidence / ./signals/check-summary precedent. Not added to the main barrel (index.ts), consistent with those two siblings, which also aren't barrel-exported.
  • The moved copy's only import (isCodeFile/isTestPath from ./test-evidence.js) now resolves within packages/gittensory-engine/src/signals/ instead of the sibling src/signals/test-evidence.ts shim.
  • Dropped two genuinely dead, unreferenced private helpers (basename, extension) during the move — extension() was called nowhere in the original file (only basename() fed it, and basename() had no other caller), so carrying them into the new home would have left 100%-uncovered lines threatening this diff's Codecov patch-coverage requirement. Nothing public changed: neither function was exported.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused: a pure code move (one new engine file, one file reduced to a shim, one package.json exports entry). No unrelated backend/UI/docs/dependency changes, and no behavior change to any existing caller.
  • 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.

Validation

  • git diff --check
  • npm run actionlint — not run; no workflow files touched.
  • npm run typecheck (clean on this diff; the repo's one pre-existing failure — a missing aws4fetch type declaration in src/selfhost/s3-blob-store.ts — reproduces identically on a clean main checkout and is unrelated). Also ran npm run ui:typecheck directly given this file's documented UI-reachability constraint (via focus-manifest.tsapps/gittensory-ui/src/lib/registration-workspace.ts) — clean.
  • npm run test:coverage locally — ran the new engine file's coverage in isolation against every existing consumer test (test/unit/path-matchers.test.ts, changed-files-classify.test.ts, finding-category-classify.test.ts, review-effort.test.ts): 100% statements/branches/functions/lines on packages/gittensory-engine/src/signals/path-matchers.ts. Also ran the full downstream surface (those four plus every focus-manifest* suite, 739 tests total) to confirm the shim conversion is fully transparent — all pass unmodified, per the issue's explicit "existing test coverage passes unmodified" deliverable. Did not run the full unsharded npm run test:coverage (this dev machine is shared with several other concurrent contributor sessions and a full run does not complete in reasonable time).
  • npm run test:workers — not run; no Cloudflare Worker code touched.
  • npm run build:mcp / npm run test:mcp-pack / miner-pack equivalents — not run directly, but npm --workspace @jsonbored/gittensory-engine run build was run locally to produce a fresh dist/ and re-verify the tests against the compiled package; it succeeds. test:mcp-pack/test:miner-pack themselves fail on this Windows machine for an unrelated, pre-existing reason (spawnSync("npm", ...) needs shell:true on Windows; reproduces identically on a clean main checkout).
  • npm run engine-parity:drift-check — ran directly: the new engine file is correctly recognized as backing a valid thin re-export shim (not flagged). The check's only reported failures are two pre-existing, unrelated files (signals/check-summary.ts, signals/test-evidence.ts) that are themselves false positives from this Windows machine's CRLF checkout tripping a \r-handling gap in the checker's own shim-detection regex (.replace(/\/\/.*$/, ""). doesn't match \r without the s flag, so a trailing \r blocks the match) — confirmed by re-running the same comparison with line endings normalized to LF (matching real Linux CI), which reports zero failures.
  • npm run docs:drift-check — clean, unaffected.
  • npm run ui:openapi:check / ui:lint / ui:build — not run; no OpenAPI/UI-behavior changes (ui:typecheck was run directly, see above).
  • npm audit --audit-level=moderate — not run; no dependency changes.
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries: this is a pure move with no behavior change, so the existing 52-test path-matchers.test.ts suite (already comprehensive: generated/vendored/lockfile/minified/docs/config/dependency-manifest classification, path normalization, defensive null handling, and a perf benchmark) is the coverage, and it passes unmodified against the moved implementation exactly as the issue requires.

If any required check was skipped, explain why:

  • Everything skipped above is either inapplicable to a pure code-move touching no UI/Worker/OpenAPI/dependency surface, or blocked by pre-existing, reproducible-on-clean-main Windows-local environment issues (CRLF checkout, npm pack's spawnSync Windows incompatibility) that do not reflect real CI behavior (GitHub Actions runs on Linux with an LF checkout, and a dedicated CI step already builds @jsonbored/gittensory-engine before test:coverage runs).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session behavior is not changed.
  • API/OpenAPI/MCP behavior is not changed.
  • No visible UI changes; UI evidence is not applicable (verified via ui:typecheck that the UI's reachability path to this module still compiles).
  • Public docs/changelogs are not changed.

UI Evidence

Not applicable; pure internal code move, no UI behavior change.

Notes

@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:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.98%. Comparing base (4daceaa) to head (84e5468).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4444      +/-   ##
==========================================
+ Coverage   93.97%   93.98%   +0.01%     
==========================================
  Files         414      414              
  Lines       37317    37311       -6     
  Branches    13636    13634       -2     
==========================================
  Hits        35068    35068              
+ Misses       1594     1588       -6     
  Partials      655      655              
Files with missing lines Coverage Δ
...ges/gittensory-engine/src/signals/path-matchers.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 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

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

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-09 19:12:56 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a clean, mechanical extraction of the pure path-classifier functions from src/signals/path-matchers.ts into packages/gittensory-engine/src/signals/path-matchers.ts, leaving the original as a thin re-export shim — exactly mirroring the already-shipped test-evidence.ts pattern (relative-source import, not the built dist, so typecheck/test:coverage don't depend on the engine's dist output). The two dropped helpers (basename, extension) are confirmed dead in both the diff and the full file content: normalizeForMatch/normalize inline the same logic and neither helper has a call site in the new file, so nothing public or behavioral changed. The package.json exports entry for ./signals/path-matchers follows the existing ./signals/test-evidence and ./signals/check-summary precedent exactly.

Nits — 6 non-blocking
  • No new test file accompanies a 411-line move with several regex edge cases (protobuf variants, config prefixes, lockfile names); since this is a pure move, existing tests that import src/signals/path-matchers still exercise it transitively through the shim, but confirm those existing tests actually live somewhere and weren't dropped in this PR.
  • packages/gittensory-engine/src/signals/path-matchers.ts is now 411 lines, just over the repo's apparent 400-line file-size flag — consider whether the large CONFIG_FILE_NAMES/LOCKFILE_NAMES/DEPENDENCY_MANIFEST_NAMES data sets belong in a separate constants file, matching how other large matcher tables are organized elsewhere.
  • Verify that packages/gittensory-engine/src/signals/path-matchers.ts is actually included in whatever coverage config enforces the ~97% patch-coverage bar — if patch coverage only scans root src/**, this new file's regex branches could be silently excluded from measurement even though it now holds the canonical logic.
  • Double check that the pre-existing test suite for the old src/signals/path-matchers.ts (untouched by this diff) is still the one running against the moved implementation via the shim, and wasn't itself relocated/deleted separately.
  • If packages/gittensory-engine has its own dedicated test file for test-evidence.ts (the prior extraction), add a sibling test file for path-matchers.ts there too for parity, rather than relying solely on the src/ shim's coverage.
  • 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 #4252
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: 95 registered-repo PR(s), 45 merged, 11 issue(s).
Contributor context ✅ Confirmed Gittensor contributor joaovictor91123; Gittensor profile; 95 PR(s), 11 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The diff moves the full path-matchers classifier family into packages/gittensory-engine/src/signals/path-matchers.ts, reduces src/signals/path-matchers.ts to a thin re-export shim mirroring test-evidence.ts's pattern, and adds the ./signals/path-matchers subpath to the engine package.json exports map exactly as requested.

Review context
  • Author: joaovictor91123
  • 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: 95 PR(s), 11 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.

🟩 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 6a4f54c into JSONbored:main Jul 9, 2026
10 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 9, 2026
@joaovictor91123
joaovictor91123 deleted the feat/extract-path-matchers-engine branch July 9, 2026 19:14
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 9, 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(engine): extract path-matchers.ts's pure classifier family to gittensory-engine

2 participants