Skip to content

refactor(lint): runLint becomes a 23-line dispatcher over named verbs - #707

Merged
joyful-ii-V-I merged 6 commits into
mainfrom
integration/ge-lint-r
Nov 20, 2026
Merged

joyful-ii-V-I merged 6 commits into
mainfrom
integration/ge-lint-r

Conversation

@joyful-ii-V-I

@joyful-ii-V-I joyful-ii-V-I commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

runLint goes from 839 lines (cx 144, tangle S 23.7) to a 23-line dispatcher: catalog -> runMatchVerb -> runPatternVerb -> runLintVerb, plus its named steps (collectBuiltInLintFindings, the runLintVerb steps, a shared enclosing-symbol index in dedupeLintFindings, reuse of OwnerIndex, vrPath and any_of).

Why: the tangle census ranked runLint #9. After the change runLint is cx 8, no tangle (S 0); the biggest new step is runLintVerb (cx 10, S 0).

Refactor only, byte-identical output.

Verification

  • fire321: 0 changed / 321 compared
  • lint identity set: 110/110 identical (stdout, stderr and rc across every arm)
  • md5check: 10/12 equal; the 2 envoy map stderr diffs come from run order, and main's binary run in the same order reproduces them
  • perf flat (instructions and wall within noise)
  • 81 touched-file gates rc 0 (crashsweepcheck red only under pool load; alone rerun passes)
  • qd: 0 gating, runLint credited under improved

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Profile annotations now skip rows with invalid, non-positive, or out-of-range line numbers.
  • Refactor
    • Lint, match, and pattern commands continue to provide their existing findings and output formats, with a consistent default output limit of 100,000 bytes unless paging is requested.

joyful-ii-V-I and others added 5 commits November 20, 2026 07:42
The --match and --pattern arms leave runLint as runMatchVerb and runPatternVerb over one
LintAnswerView (the enclosing-symbol index, row path, root= and escaper every arm read from
runLint's locals). The two arms' identical <m> row loop is emitSearchHitRows; the auto-capture
decision is captureMatchQuery; the nest_refused= attribute is nestRefusedAttr. Byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… named steps

runLint's --lint block becomes one call. Its steps carry names: builtInLintRuleNames and
builtInLintQueries (the two tables), recordSaturatedQueryRules (floors on the raw captures),
the post-filters isFilledIfBody / isNonEmptyCatchBody / dropUnflaggedMagicNumbers (std::erase_if
over named predicates, not remove_if lambdas nested five deep), and collapseSelfAssignPairs.
The three copies of the capture-text trim are trimCaptureSpace. Byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rb's named steps

runLint now reads catalog -> match -> pattern -> lint. runLintVerb collects into one
LintFindingSet (appendUserRuleFindings for --lint-rules=DIR), selects (lintRuleSelected, the
predicate the tally, floors and filter share), orders, windows (lintFindingsWindow holds the
default payload byte budget), computes the root's floor pair (lintFloorsOf) and emits
(lintRootExtraAttrs, emitLintLegends, emitLintRuleTally, emitLintFindingRows). capOf is
findRuleCap. Byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndex

It built a second symbolsByFile index and a copy of the enclosing lambda; it now takes the
LintAnswerView's EnclosingSymbolIndex, the same in= lookup every printed row uses.
Byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qd_range named three clones the extraction made visible: EnclosingSymbolIndex's scan is atoms.h's
OwnerIndex (now its body), a row's p= is valuerefs.h's vrPath (the spelling every other verb's
rows use), and the floor lookup is a std::any_of (ruleFloored) rather than a second table scan.
dedupeLintFindings takes the index alone (the corpus rides on it). Byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The lint header now shares enclosing-symbol and answer-rendering helpers across match, pattern, and lint execution. It separates search and lint workflows into focused functions. Profile TSV line numbers now require a complete, positive, in-range integer.

Changes: Lint verbs

Layer / File(s) Summary
Shared lookup and answer helpers
src/verbs_lint.h
A shared enclosing-symbol index replaces the local lookup in finding deduplication. A shared answer view provides symbol lookup, root-relative paths, root attributes, and XML escaping.
Match and pattern execution
src/verbs_lint.h
Shared helpers emit search rows and nesting disclosures. runMatchVerb and runPatternVerb handle their respective query and pattern checks, then emit paged XML results.
Lint finding collection
src/verbs_lint.h
Built-in rule queries, filters, self-assignment pairing, and lint-pack findings feed the combined finding set. User-rule execution records findings, saturated rules, and uncompiled rules.
Lint selection and output
src/verbs_lint.h
Lint execution applies rule selection, sorting, deduplication, and paging. Helpers emit disclosures, tallies, and findings. runLint handles catalog requests and dispatches to the match, pattern, or lint workflow.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Suggested reviewers: barefootski

Merge Risk: Minimal · previous review 94bc5

This refactor splits the lint dispatcher into named steps without a demonstrated change in behavior. No concrete merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: runLint is reduced to a short dispatcher that routes to named verbs (match, pattern, lint). The raw summary confirms runLint now dispatches among runMatchVerb, runPatt…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: runLint is reduced to a short dispatcher that routes to named verbs (match, pattern, lint). The raw summary confirms runLint now dispatches among runMatchVerb, runPatternVerb, and runLintVerb after handling --lint-catalog, and the objectives describe the same 839-to-23-line refactor. The title is specific and matches the changeset.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ee8d1a5 and 94bc597.

Files selected for processing: 1

  • src/verbs_lint.h

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

…atchMaxHits to it

capdisclosemapcheck (R) went red on this PR: the runLint split moved the
kMatchMaxHits compares into runMatchVerb, a function that never mentions the
row's sinks saturatedRules / lintDefaultShown. Those sinks were never this
cap's disclosure: the 11-12 draft took them from whatever giant runLint held
(see the map header: a drafted row does not prove the identifier reports THIS
cap). --match discloses the engine cap through hits_capped= and the page
disclosure's collectionCapped (counts_floor= / capped= on the root), both in
runMatchVerb. Name that fact once (hitsCapped), feed both from it, and point
the row at it. Bytes unchanged; the gate is unchanged and now checks the real
disclosure instead of a coincidental identifier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joyful-ii-V-I

Copy link
Copy Markdown
Collaborator Author

Disposition at 390ea83 (new commit since CodeRabbit's review of 94bc597, which had no actionable comments).

  • 390ea83 fix(lint): --match names its engine-cap fact; capdisclose row ties kMatchMaxHits to it. CI went red on test/capdisclosemapcheck.sh (R) in release shard 3/4 and macOS plain 1/4. The split moved the kMatchMaxHits compares into runMatchVerb, and that function never mentions the row's sinks saturatedRules / lintDefaultShown. Those sinks were never this cap's disclosure. The drafted row matched them only because the old single runLint happened to contain them (the map header says a drafted row does not prove the identifier reports this cap). --match discloses the engine cap through hits_capped= and the page disclosure's collectionCapped (counts_floor= / capped= on the root), and both are in runMatchVerb. The commit names that fact once (hitsCapped), feeds both from it and points the row at sink:hitsCapped. The gate is unchanged and now checks the real disclosure.
  • Verified: capdisclosemapcheck is red on the 94bc597 tree and ALL PASS on 390ea83. Output is byte-identical to main ee8d1a5: the lint identity set is 110/110 identical (it includes hits_capped="1" --match runs) and fire321 is 321 compared, 0 changed. The 23 file-keyed and --match cap gates pass. qd-range shows 0 gating rows. Full CI is green on 390ea83.

@joyful-ii-V-I
joyful-ii-V-I merged commit 48e8bed into main Nov 20, 2026
41 checks passed
joyful-ii-V-I added a commit that referenced this pull request Nov 20, 2026
…se.map merges with #707

main 48e8bed (#707, GE-LINT) rewrote the kMatchMaxHits row this train's
kMacroArgNestingDepth row sat under, so the two edits touched one hunk and
git merge-tree reported a conflict. The row moves above kManifestFileRows,
where it sorts; no row changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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