Skip to content

docs(design): align 10.14 hunk entry state with the code-token rule - #172

Merged
leo-aa88 merged 1 commit into
leo-aa88:mainfrom
devtechedge:docs/hunk-entry-state
Sep 19, 2026
Merged

leo-aa88 merged 1 commit into
leo-aa88:mainfrom
devtechedge:docs/hunk-entry-state

Conversation

@devtechedge

Copy link
Copy Markdown
Contributor

What and why

Follow-up to #144, per the non-blocking note on the round-6 review.

docs/DESIGN.md §10.14 "Hunk entry state" still described the pre-fix mechanism: a hunk is established by two consecutive context lines that scan clean. The code shipped in #144 is stricter than that. Each of those lines must both leave no multi-line construct open and carry a code token, and blank context lines are neutral, neither extending the run nor breaking it.

Without the code-token half, two lines of docstring prose establish a normal code position that does not exist, which is exactly the round-5 reproduction. DESIGN.md is this repo's stated spec authority, so a reader of the design doc alone would reach for the old, insufficient mental model. The paragraph now matches the _CONTEXT_LINES_TO_ESTABLISH contract in _comment_scan.py, including the residual case that is disclosed in the README rather than claimed impossible.

Not issue-tracked: this comes from a review note on #144.

Design link

§10.14 Excessive code-comment verbosity (issue #143), "Hunk entry state".

Type of change

  • Documentation only

Checklist

  • My change keeps reviewgate.core pure (no Python changed).
  • N/A: no new heuristic.
  • N/A: no §10.2 report or §10.1 input schema change.
  • N/A: no .reviewgate.yml change.
  • Docs only: no Python changed, so the suite is unaffected by this diff. CI is the check here; I did not run pytest in this environment.
  • N/A: no new public API.
  • N/A: no source file changed.

Notes for reviewers

Five lines replaced by fourteen, in one file. No CHANGELOG entry: this corrects a paragraph that shipped with #144 and there is no behaviour change to announce. §12 and docs/QUICKSTART.md already carry policy.code_comments, so this was the last gap from that note.

Follow-up to #144, per the non-blocking note on the round-6 review.

The "Hunk entry state" paragraph still described the pre-fix mechanism:
two consecutive context lines that merely scan clean. The shipped rule
from #144 is stricter. Each of those lines must leave no multi-line
construct open AND carry a code token, and blank context lines are
neutral, neither extending the run nor breaking it.

Without the code-token half, two lines of docstring prose establish a
normal code position that does not exist, which is the round-5
reproduction. DESIGN.md is this repo's stated spec authority, so the
paragraph now matches the _CONTEXT_LINES_TO_ESTABLISH contract in
_comment_scan.py, including the residual case that is disclosed in the
README rather than claimed impossible.

Docs only. No Python, no tests, no behaviour change.

@leo-aa88 leo-aa88 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leo-aa88
leo-aa88 merged commit df7496e into leo-aa88:main Sep 19, 2026
7 checks passed
@devtechedge

Copy link
Copy Markdown
Contributor Author

I appreciate the sharp round-6 note on #144, Leonardo, that made this follow-up easier to write. 📄

Aligning section 10.14 with the shipped code-token rule taught me how much weight DESIGN.md carries as the spec here.

Thanks for the quick approval and for merging it through, the six-round review on #144 genuinely made the hunk logic stick for me.

Really fun thread to close out!

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.

2 participants