Skip to content

feat(enrichment): add leftover conflict-marker analyzer#3338

Merged
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaso0n0818:feat/conflict-marker-analyzer-2032
Jul 5, 2026
Merged

feat(enrichment): add leftover conflict-marker analyzer#3338
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaso0n0818:feat/conflict-marker-analyzer-2032

Conversation

@jaso0n0818

Copy link
Copy Markdown
Contributor

Closes #2032

What

A new local REES analyzer, conflictMarker, that flags leftover VCS conflict markers — <<<<<<< (ours), ||||||| (diff3 base), ======= (separator), >>>>>>> (theirs) — accidentally committed in the ADDED lines of a PR diff. A mechanical, near-zero-false-positive catch that should block a merge. Pure compute, no network.

Detection (structural, near-zero false positive)

  • Each marker is an exactly-seven-character run at column 0 (six or eight does not match), so a run of </|/> is never valid prose or code. The ours/base/theirs markers may carry a trailing space + label (a branch or commit); the separator is a bare seven =.
  • The ambiguous bare ======= separator is a legitimate Markdown setext-H1 underline / AsciiDoc section rule, so it is not flagged in markup files (.md/.markdown/.mdx/.rst/.adoc/.asciidoc/.textile) — but the unambiguous <<<<<<</|||||||/>>>>>>> markers still are, so a real conflict landing in a Markdown file is caught by those.
  • Detection is purely structural — no comment/string state to track. Added lines only, line-cited via hunk headers, with the shared \ No newline line-counter fix; findings capped (maxFindings: 25) per file and globally.

Registration

Registered as a local descriptor (category quality, cost local, requires ["files"]) with an inline render(), following the actions-pin added-line-walk shape. All wiring updated: types.ts (ConflictMarkerFinding + conflictMarker? key), render.ts, analyzer-registry.test.ts, root src/review/enrichment-analyzer-names.ts (the canonical REES_ANALYZER_NAMES), root test/unit/enrichment-wire.test.ts, and the generated analyzer-metadata.json / rees-analyzers.ts / .env.example via node scripts/generate-analyzer-metadata.mjs.

Tests

review-enrichment/test/conflict-marker.test.ts (11 tests) covers: each of the four marker shapes with and without a label, exactly-seven enforcement (six/eight/indented rejected), the bare-separator-vs-labeled distinction, the markup-file ======= suppression (with ours/theirs still firing there), a full three-way conflict flagged at correct locations, a Markdown setext-H1 underline not flagged, a real conflict in a Markdown file still caught, added-lines-only with line-number accuracy across mixed hunks, the per-file cap + maxFindings: 0, the entrypoint's global cap across files, and the no-files case. Analyzer metadata is regenerated and committed.

@jaso0n0818 jaso0n0818 requested a review from JSONbored as a code owner July 5, 2026 04:05
@superagent-security

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.88%. Comparing base (9ff086e) to head (ae56183).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3338   +/-   ##
=======================================
  Coverage   93.88%   93.88%           
=======================================
  Files         279      279           
  Lines       30530    30530           
  Branches    11118    11118           
=======================================
  Hits        28662    28662           
  Misses       1211     1211           
  Partials      657      657           
Files with missing lines Coverage Δ
src/review/enrichment-analyzer-names.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb gittensory-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 1.25x multiplier. label Jul 5, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 Gittensory is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing

@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 9e87b4c into JSONbored:main Jul 5, 2026
9 checks passed
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 1.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(enrichment): merge-conflict-marker / leftover-artifact analyzer

1 participant