Skip to content

Fix duplicate documentation comments across pushes and add synthetic evals - #35

Merged
pkieltyka merged 1 commit into
masterfrom
fix/docs-comment-identity
Sep 24, 2026
Merged

pkieltyka merged 1 commit into
masterfrom
fix/docs-comment-identity

Conversation

@pkieltyka

Copy link
Copy Markdown
Collaborator

Unchanged documentation findings can open new GitHub threads after a push moves their anchors. For example, moving the same comment from line 81 to line 74 changes its hunk fingerprint and falls outside the existing five-line proximity check.

This replaces #28 with a publication-level fix. Identical sanitized comment content matches across anchors on the same prose file and diff side, while distinct findings retain their existing grouping identities. Thanks to @klaidliadon for identifying the issue and contributing the original reproduction and tests.

Behavior

  • Match unchanged comments in .md, .mdx, .rst and .txt files by their complete sanitized body, normalizing line endings and surrounding whitespace.
  • Persist a content fingerprint before inline truncation so long comments with different conclusions are not mistaken for one another. Existing comments without that fingerprint can match by their body.
  • Keep changed or missing content eligible for posting. File-wide identity and proximity alone cannot suppress a different prose issue.
  • Preserve composer grouping and code fingerprints, including executable examples under docs/.
  • Use the validated publication anchor during matching, including anchors supplied by the posting plan; missing anchors do not establish a match.

The original PR's shifted-hunk fixture now checks the publication result. Its second fixture deliberately expects distinct same-category documentation findings to remain separate, avoiding the original file-wide merging tradeoff.

Synthetic evals and regression coverage

Add evals/synthetics/ and make evals: 13 deterministic scenarios exercise real diff parsing, publication, persisted markers, GitHub response parsing and duplicate detection through a scripted GitHub transport. They cover shifted/different anchors, posting-plan anchors, unrelated nearby and distant issues, paraphrased advice, existing comments, different files and capped bodies. No credentials, network requests or model inference are required.

The synthetic suite also runs in pnpm test and is included in TypeScript checks. Unit/pipeline regressions additionally cover prose extensions, absent anchors, code fingerprint behavior and the two adapted PR #28 fixtures.

Validation

  • pnpm test: 1,390 tests passed across 63 files.
  • make evals: all 13 scenarios passed.
  • pnpm run check: TypeScript and workflow validation passed.
  • pnpm build and git diff --check: passed.

Deliberate limit

This is deterministic content matching, not semantic equivalence. Reworded findings and truncated old comments without a full-content fingerprint may still produce another thread. The tests explicitly preserve that conservative behavior rather than hiding potentially new information.

Address the repeated documentation threads reported in PR #28 at publication
rather than assigning every finding in a document the same location identity.
Composer grouping and existing code fingerprints retain their current semantics,
so unrelated same-category findings and executable examples under docs/ remain
separate.

For Markdown, MDX, reStructuredText and text files, match the complete sanitized
comment body on the same path and diff side. Store its content fingerprint before
the inline size cap and read existing comments without that marker by their body.
Changed wording, missing content and ambiguous truncated legacy comments remain
eligible for posting instead of suppressing a potentially different issue.

Use the validated publication anchor during duplicate detection, including anchors
supplied only by the posting plan. Require a known anchor for prose matching.

Adapt both PR #28 regression fixtures: preserve unchanged comment identity across
a seven-line shift while explicitly keeping distinct documentation findings apart.
Add coverage for code under docs/, existing markers, missing anchors, proximity,
changed content and full-body identity beyond the display truncation boundary.

Introduce evals/synthetics and make evals with 13 deterministic scenarios covering
real diff parsing, publication, persisted markers, GitHub response parsing and
duplicate detection through a scripted transport. Include these scenarios in the
normal test suite and TypeScript checks; document their scope and conservative
wording policy.

Validation: pnpm test (1,390 tests across 63 files), make evals (13 scenarios),
pnpm run check, pnpm build and git diff --check all passed.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🧞 Codegenie review failed (llm_call_failed).

HTTP 400: You have reached your specified API usage limits. You will regain access on 2026-10-01 at 00:00 UTC.

— View Workflow Job

@pkieltyka
pkieltyka merged commit e698964 into master Sep 24, 2026
7 of 8 checks passed
@pkieltyka
pkieltyka deleted the fix/docs-comment-identity branch September 24, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant