Skip to content

feat(enrichment): classify long-form doc extensions as docs#3329

Merged
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat/classify-longform-doc-extensions
Jul 5, 2026
Merged

feat(enrichment): classify long-form doc extensions as docs#3329
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat/classify-longform-doc-extensions

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Summary

categorizeFile (in review-enrichment/src/analysis-context.ts) assigns each changed file a category (docs, source, asset, lockfile, …) used for review scheduling/scope. Its docs list recognized only .md/.mdx/.rst/.txt, so the long-form doc spellings .markdown, .adoc, and .asciidoc fell through to the source category — a NOTES.markdown or guide.adoc change was mischaracterized as a source change rather than documentation.

This adds the three spellings to the docs extension list:

  • Consistency anchor: the canonical DOCS_EXTENSIONS set in src/signals/path-matchers.ts (md, mdx, markdown, rst, adoc, asciidoc) and rag.ts's DOC_EXT_RE already classify all three as docs — rag.ts even carries a comment noting these long-form spellings were a known miss elsewhere. This brings the categorizer in line.
  • Case-insensitive: matching uses the existing lowercased-extension path, so README.ADOC classifies as docs.
  • Additive-only: three list entries plus a test; no existing category changes for any other extension.

No linked issue

This is a no-issue PR by design: a self-contained classification-coverage fix that adds three doc extensions to categorizeFile plus a focused test, touching only review-enrichment/. There is no behavior change beyond correctly categorizing these docs, so no tracking issue is needed. It mirrors the accepted no-issue precedent for the same kind of classification-inventory change (e.g. the recently-merged #3204 and #3264).

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.
  • No linked issue — see the No linked issue section above.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage — no src/** lines changed (this change is under review-enrichment/, which Codecov does not measure), so codecov/patch has no diff to gate; suite is green.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New behavior has tests — a new case in review-enrichment/test/analysis-context.test.ts drives createAnalysisContext and asserts .markdown/.adoc/.asciidoc (and uppercase .ADOC) categorize as docs, while .ts stays source. npm run rees:test passes (863 tests; analyzer-metadata check clean).

Validated green against the full GitHub CI validate-code check set — actionlint, db:migrations:check, db:schema-drift:check, cf-typegen:check, selfhost:validate-observability, typecheck, test:coverage, test:workers, build:mcp, test:mcp-pack, build:miner, rees:test, ui:openapi:check, ui:openapi:settings-parity, ui:version-audit, ui:lint, ui:typecheck, ui:test, ui:build. Branch rebased on latest main.

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.
  • No auth, cookie, CORS, GitHub App, Cloudflare, or session changes (N/A — pure classification-list addition).
  • No API/OpenAPI/MCP behavior change (N/A).
  • No UI changes (N/A — this is a review-enrichment helper).
  • No visible UI change, so no UI Evidence section is required.
  • No docs/changelog changes needed.

Notes

Analogues followed end-to-end: the existing category tests in analysis-context.test.ts (e.g. the .zst asset and case-insensitive lockfile cases), and the recently-merged classification-inventory PRs #3204 and #3264. .txt is intentionally left in the docs list (it is not in the canonical DOCS_EXTENSIONS but is present in rag.ts's DOC_EXT_RE) — this PR only adds the missing long-form spellings and changes nothing else.

categorizeFile (analysis-context.ts) recognized only .md/.mdx/.rst/.txt as
docs, so the long-form spellings .markdown, .adoc, and .asciidoc fell through
to the source category — a NOTES.markdown or guide.adoc change was treated as
source rather than documentation.

Add the three spellings to the docs extension list. This matches the canonical
DOCS_EXTENSIONS set in src/signals/path-matchers.ts and rag.ts's DOC_EXT_RE,
which already treat them as docs. Matching is case-insensitive via the existing
lowercased-extension path (README.ADOC classifies as docs).
@davion-knight davion-knight requested a review from JSONbored as a code owner July 5, 2026 03:08
@superagent-security

Copy link
Copy Markdown

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

@gittensory-orb gittensory-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier. label Jul 5, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 03:09:06 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This change correctly extends `categorizeFile` so `.markdown`, `.adoc`, and `.asciidoc` now land in the existing `docs` category, with case-insensitive coverage coming from the existing `extensionOf(...).toLowerCase()` path. The added test exercises the real `createAnalysisContext` path and verifies both the new long-form spellings and the existing source fallback, so the fix is grounded in production wiring. I do not see a reachable correctness issue in the visible diff.

Nits — 5 non-blocking
  • nit: `review-enrichment/src/analysis-context.ts:443` continues the duplicated docs-extension inventory rather than sharing the canonical set mentioned in the comment, so this can drift again the next time docs extensions change.
  • nit: `review-enrichment/test/analysis-context.test.ts:548` uses PR number `3264`, which is unrelated test metadata; a neutral local fixture number would make the test less coupled to prior PR history.
  • `review-enrichment/src/analysis-context.ts:443`: consider hoisting the docs extension list into a local `const DOC_EXTENSIONS = new Set([...])`, or reuse the canonical matcher if the package boundary allows it, so additions are not buried inside `categorizeFile`.
  • `review-enrichment/test/analysis-context.test.ts:548`: use a neutral fixture `prNumber` unless this test intentionally documents behavior from that prior PR.
  • 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 ⚠️ 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: 31 registered-repo PR(s), 23 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 31 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: davion-knight
  • 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: 31 PR(s), 0 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

@gittensory-orb gittensory-orb Bot left a comment

Copy link
Copy Markdown

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.

@gittensory-orb gittensory-orb Bot merged commit c556d78 into JSONbored:main Jul 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant