Skip to content

test(rendered-views): fail a view lane's skill text that lists medium values - #13106

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/13036-replacement
Nov 4, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/13036-replacement

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #13036

Summary

Adds scripts/check-view-medium-lists.mjs, run by scripts/check-changed-skills.sh on every invocation. It fails when a view lane's *.md or evals.json holds a line or JSON string naming two or more distinct backticked medium ids. Medium ids come from MEDIUMS and lanes from the lane(...) entries in lib/view-registry.mjs; CHANGELOG.md, README.md and the lib/rendered-view.md shared copies are skipped. scripts/view-medium-list-exemptions.txt exempts lanes still listing media; a row for a clean or unregistered lane fails, so the list only shrinks.

This replaces #13076, whose CI failed after its exemption list went stale.

Fix

The education, overengineering and prototype slices of #12646 (#12682, #12679, #12684) merged after #13076 was written. Their five lanes (education:illustrate, education:teach, overengineering:audit, prototype:explore-directions, prototype:pressure-test) no longer list media, so the stale-row rule failed both the current-tree test in scripts/check-view-medium-lists.test.mjs and check-skills. This PR deletes those five rows. architecture (#12672) and visualization:visualize (#12669) still list media and keep their rows; codebase-health:audit and visualization:present were already clean and carry no row.

Verification

  • bash scripts/check-view-medium-lists.test.sh: 16 of 16 pass (was 15 of 16).
  • bash scripts/check-changed-skills.sh origin/main: no view lane lists media (2 lane(s) exempt), exit 0.
  • bash scripts/check-changed-skills.test.sh: passes.

Related

🤖 Generated with Claude Code

melodic-automation-lanes Bot and others added 3 commits November 4, 2026 04:01
Lane-Activity: work-resolve-issue/resolve-issue
…s merged

The education, overengineering and prototype view-medium slices of #12646
merged after the check was written, so their lanes no longer list media and
the check's stale-row rule failed the current-tree test and check-skills.
Delete those five rows; architecture and visualization:visualize still list
media and keep theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T06:02:24.628254Z 5b893cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 5b893cf859ba8b5184748f1dd357c05fbde8859c: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13106, no security issues found

What I read: every hunk of all 6 changed files in .claude-lane/pr.diff, plus the PR context and the prior-findings file (0 earlier rounds, cap 3, not past the cap). None of the changed files matches a trusted-path glob. None is a trust control (trusted-trigger, lane token, kill switch, token broker, merge hold or .github/actions/*). None is a plugin manifest or a standing instruction surface.

What changed: the PR adds a repository lint gate, scripts/check-view-medium-lists.mjs, which scripts/check-changed-skills.sh calls on every run. The gate fails when a view lane's *.md or evals.json names two or more backticked medium ids on one line. The PR also adds its tests and a list of exempt lanes (scripts/view-medium-list-exemptions.txt).

Paths I checked:

  • No code execution from the checked tree. The gate reads lib/view-registry.mjs as text with regexes (readRegistry) and never imports it. Only the test file imports the registry, and tests run on the repository's own tree.
  • Fail-closed wiring. check-changed-skills.sh runs the checker from the script's own directory ($SCRIPT_DIR), not from the checked tree. If the checker is missing it exits 2, and any return code above 1 also exits 2. A medium-list finding (rc 1) now carries through both the "nothing to gate" path and the final exit. The gate tightens checking and loosens nothing.
  • File walk. readdirSync(..., { withFileTypes: true }) with isDirectory() / isFile() does not follow symlinks, so a symlink inside a lane directory is skipped. The walk reads only .md and evals.json files, and the only output is line-number and medium-id hits on stderr and stdout. Lane ids come from the repository's own registry. A crafted id could at most point this read-only walk at other paths, and nothing is written or sent anywhere, so no leak, compromise or charge path exists.
  • Exemption list. This is a data file for the lint gate. It gates no merge hold, token or trust decision.

PR context: it contains no embedded instructions aimed at the review lane.

Spend: none beyond the normal CI test time for one small extra Node check per check-skills run.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 5b893cf859ba8b5184748f1dd357c05fbde8859c: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of all 6 changed files. To check how the checker parses its inputs, I also read lib/view-registry.mjs, the start of scripts/check-changed-skills.test.sh (its helpers), the exit paths in scripts/check-changed-skills.sh, and the lib/rendered-view.md rows in scripts/shared-copies.txt. I ran nothing. The Verification section's results (16 of 16 tests passing, check-changed-skills.sh origin/main exiting 0 with 2 lanes exempt) are the author's claim and I have not confirmed them.

How the change works

  • Reading the registry as text.
    • readRegistry matches how lib/view-registry.mjs is actually written today: the MEDIUMS block opens with Object.freeze({ and a newline, each key starts its own line, and lanes appear as lane("<id>", …). The const lane = ( definition does not match \blane\(.
    • The test compares the parsed result with Object.keys(MEDIUMS) and Object.keys(LANES). That works because LANES is an object keyed by lane id, built in insertion order.
    • If the registry is refactored so the parse finds no mediums or no lanes, the check exits 2 rather than passing silently.
  • Skipping shared copies. scripts/shared-copies.txt rows have the form lib/rendered-view.md plugins/<p>/reference/rendered-view.md. These match the ${dir}/${name} relative paths that walk builds, so the copies are skipped as intended.
  • Wiring into check-changed-skills.sh.
    • The script runs the check for every invocation and treats any exit above 1 as an environment error (exit 2).
    • It feeds medium_lists into both the "no changed skills" exit and the final failure aggregation. No other exit 0 path skips it.
    • In --merge-base mode it runs the trusted $SCRIPT_DIR copy against --root "$PWD" and reads the checked tree only as text, the same way the evals-warrant exemptions are handled.
    • Existing test scenarios stage no lib/view-registry.mjs, so the check doesn't run in them.
  • The new check-changed-skills.test.sh case. base_sha returns HEAD after the commit, so the second run really has no changed skill. The test therefore exercises the "fails though no skill changed" path its name describes.
  • Exemption rows. Rows that name an unregistered lane, a clean lane, a duplicate lane, or cite no issue each produce a finding. Each case has a test.

Closing issue #13036

  • Done when 1 (met). The check runs from check-changed-skills.sh, takes the medium ids from MEDIUMS and the lanes from the lane(...) entries, and scans only *.md and evals.json. The scope-out test in check-view-medium-lists.test.mjs covers the skipped files (CHANGELOG.md, README.md, shared copies, other file types and other skills).
  • Done when 2 (met). The tests cover a failing list in skill markdown, in a bare lane's plugin directory and in an evals.json string. They also cover a passing single-medium fixture prompt and the current tree.
  • Done when 3 (met). The exemption file holds the two lanes that still list media, each citing its open slice. The rule that a row for a clean lane fails keeps the list from growing. Whether exactly these two rows are needed rests on the "passes the current tree" test, which I did not run.

Spend: none.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 38ec1a6 Nov 4, 2026
39 checks passed
@kyle-sexton
kyle-sexton deleted the fix/13036-replacement branch November 4, 2026 06:14
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 5, survived 1, timeout 0, no coverage 0, invalid 0, not run 1.
Covered-code score 83%; mutation score 83%.

File Killed Survived Timeout No coverage Invalid Not run
lib/view-registry.mjs 0 0 0 0 0 1
lib/view-settings.mjs 1 0 0 0 0 0
scripts/check-changed-skills.sh 2 1 0 0 0 0
scripts/check-view-medium-lists.mjs 2 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
scripts/check-changed-skills.sh:284 LCR productive input-gap

The run's summary has the full report.

kyle-sexton added a commit that referenced this pull request Nov 4, 2026
…mptions

This slice removes the architecture lane's medium lists, so the exemption
row #13106 added for it is stale and the check fails it in the merge
group ("lists no media any more; delete the row").

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.

test(rendered-views): fail a view lane's skill text that lists medium values

1 participant