Skip to content

refactor(knowledge): simplify docpage-digest gate scripts without behavior change - #14869

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14601-42704449177-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14601-42704449177-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14601

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Applied simplify's reuse, simplification and efficiency checks to the 11 listed docpage-digest scripts and edited 7 of them. The edits remove redundant code: a one-call fail() wrapper, a dead except SystemExit: raise (SystemExit is not an Exception), repeated payload.split calls, a hand-counted loop counter, duplicated inline-mark branches, a twice-computed H2 map and a twice-checked SOURCES.md. Outputs, exit codes, flags and imported names are unchanged. check-fences-exact.py, check-snippets.py, gate-test-lib.sh and gate_harness.py were already minimal; the remaining simplification in them is cross-file dedup (prose_lines vs iter_h2_sections, prose-terms argparse vs parse_gate_args), which the issue puts out of scope.

Not verified

  • The knowledge plugin's unittest suites (test_check_*.py, test_pin_manifest.py, test_extract_blog_body.py, tests/test_verify_batch_page.py) were not run directly: this lane runs no interpreter. Left to the PR's CI.
  • Python lint (ruff or flake8) on the touched scripts was not run: the lane exposes no linter wrapper. Left to the PR's CI.
  • Tidy, pass 3 proposal (not applied): the local found in check-sources-parity.py:149 is a generic name; source_heads would read better. tidy-diff renames nothing, so it stays a proposal.
  • Tidy, pass 5: ai-slop's detect.sh and digest-guard.sh are not lane-allowed wrappers, so only the hand rubric read ran on the changelog fragment (no findings). The prose linter for pass 4 was not run, for the same reason.
  • check-fences-exact.py, check-snippets.py, gate-test-lib.sh and gate_harness.py were reviewed and left unchanged. What could still be simplified there is deduplication across files, which the issue puts out of scope.

Fix

  • plugins/knowledge/skills/docpage-digest/scripts/check-html-rows.py: split the payload into lines once instead of three times; early continue on a missing fence.
  • plugins/knowledge/skills/docpage-digest/scripts/check-prose-terms.py: return len(lines) instead of a hand-incremented scanned counter.
  • plugins/knowledge/skills/docpage-digest/scripts/check-sources-parity.py: inlined the one-line fail() wrapper as failures.append; source file lookup via next(); renamed the local that shadowed the imported headings module; one H2 line->text map replaces two comprehensions; unit-start sets built…
  • plugins/knowledge/skills/docpage-digest/scripts/digest_fences.py: removed the dead except SystemExit: raise (SystemExit never matches except Exception); NONE_MARKERS on one line; split_lines as one expression.
  • plugins/knowledge/skills/docpage-digest/scripts/extract_blog_body.py: one INLINE_MARKS table replaces the duplicated code/strong/b/em/i branches in the start- and end-tag handlers.
  • plugins/knowledge/skills/docpage-digest/scripts/pin-manifest.py: SOURCES.md is_file() checked once; missing-group list built from one table, same names and order.
  • plugins/knowledge/skills/docpage-digest/scripts/verify-batch-page.py: decide_page uses an if on failed_gates instead of a loop that returns on the first item; read_pin and failed_gates collapse their return-code branches.
  • .changes/knowledge/work-resolve-issue-issue-14601-42704449177-1-a7d6b43c.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 686f865:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 19 fragments valid (run before and after tidy).
  • .lane/checks/bin/check-changed-skills: docpage-digest PASS, 0 errors, 4 pre-existing warnings on SKILL.md size and wording, which this change does not touch (run before and after tidy).
  • .lane/checks/bin/check-affected: 13 passed, 6 skipped over 8 changed files (run before and after tidy).
  • Fresh-context review subagent over the full diff: no behavior difference found; it checked each edit for input edge cases, output ordering, exception paths, name shadowing and importers of removed names (fail in check-sources-parity.py has no references).
  • Diff size: 7 script files plus 1 fragment, 55 added and 98 removed lines, within the issue's 400-line and 15-file limit.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42704449177

Left out: the items under Not verified.

Related

#14601

Merge-Risk: max=MEDIUM demote=false head=686f8653033e63b74cfcefb425d6951545b8141f rubric=8.2.0 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 686f8653033e63b74cfcefb425d6951545b8141f: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14869 (head 686f8653)

I found no security issues.

critical-findings: 0

I read every hunk of all 8 changed files in .claude-lane/pr.diff: one changelog fragment and seven docpage-digest gate scripts under plugins/knowledge/skills/docpage-digest/scripts/. None of them matches a trusted-path glob. The PR touches no trust control, no merge hold, no plugin manifest and no instruction surface (no skill or agent body, no CLAUDE.md, no hook list).

I checked each edit to make sure it keeps what a gate decides:

  • check-sources-parity.py: The old unit-start set and the new {1, *h2_text} both always contain line 1 plus every H2 line. Inlining fail() as failures.append leaves the if not listed and not failures check reading the same list. Finding the source file with next() keeps the same order (source.md first, then source.txt) and still raises Unusable when neither exists.
  • digest_fences.py: Removing except SystemExit: raise keeps exit codes the same. SystemExit derives from BaseException, so except Exception never caught it.
  • verify-batch-page.py:
    • decide_page still returns on the first failed gate.
    • In failed_gates, a timeout still counts as a failure, and a non-zero return code is still a failure.
    • The gate subprocess call keeps -I -B and its timeout.
    • read_pin still returns moved for any non-zero return code.
  • pin-manifest.py: The pinned files and their order are unchanged (sources, then SOURCES.md if it is a file, then digests), and the missing-group names come out in the same order.
  • extract_blog_body.py, check-html-rows.py, check-prose-terms.py: These are pure refactors and produce the same output.

Nothing in the PR context file tells the review lane what to do. This is the lane's first review of this PR (blocking only: no), and there are no earlier findings.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 686f8653033e63b74cfcefb425d6951545b8141f: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings. I read all 8 changed files in full. This was a first review, not blocking only.

I checked each edit against the "no behavior change" criterion of issue #14601:

  • check-html-rows.py: The new continue after the missing-fence branch skips nothing. The if/elif chain was the last statement in the loop (check-html-rows.py:96-113). Splitting payload once gives the same lines as the three separate splits.
  • check-prose-terms.py: len(lines) matches the removed counter, because lines is the fully consumed list.
  • check-sources-parity.py:
    • source_headings adds at most one tuple per line (check-sources-parity.py:77-98). So len(h2_text) equals the old count of H2 entries, and the {n: t} map loses nothing.
    • want = {1, *h2_text} equals the old sorted(set(([1] if ... else []) + h2s)) in every case, since 1 is in the set either way.
    • The next(...) lookup keeps the source.md-then-source.txt order.
    • Inlining fail() changes nothing, and no other file references it.
  • digest_fences.py: Removing except SystemExit: raise is safe. SystemExit derives from BaseException, so except Exception never caught it. split_lines gives the same result.
  • extract_blog_body.py: The code, strong/b and em/i branches were mutually exclusive, so the INLINE_MARKS lookup appends the same marks in the start-tag and end-tag handlers.
  • pin-manifest.py: Same missing-group names in the same order, and the returned order is unchanged.
  • verify-batch-page.py: ev["failed_gates"] is always a list ([] default at :304, failed_gates() result at :312), so [0] behaves like the old first-item loop. The read_pin and failed_gates rewrites keep the same branches, including the timeout path.

Acceptance criteria:

  • Scope: Only listed files plus the changelog fragment are edited, and nothing is renamed or deleted.
  • Size: The diff is well under the 400-line and 15-file limits.
  • Changelog fragment: It has bump: patch, a ### Changed heading and the required line.
  • Tests and CI: I did not run any tests or CI. "ci-status is green" and the unittest runs are author-claimed and unverified.

No manifest files, path-scoped rules or paved-path entries apply to this diff.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 686f8653033e63b74cfcefb425d6951545b8141f, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 686f865

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14869-686f8653033e63b74cfcefb425d6951545b8141f, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit b5d1812 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14601-42704449177-1 branch November 10, 2026 01:01
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.

Simplify the docpage-digest knowledge plugin code

0 participants