Skip to content

skills: guard example-led opt-ins#5

Merged
cheshirecode merged 7 commits into
mainfrom
codex/example-led-optin-check
Jul 18, 2026
Merged

skills: guard example-led opt-ins#5
cheshirecode merged 7 commits into
mainfrom
codex/example-led-optin-check

Conversation

@cheshirecode

@cheshirecode cheshirecode commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a static checker for compact example-led-instructions opt-ins in skill docs
  • enforce the canonical consumer preamble, duplicate-reference rejection, Markdown code-block handling, and the worklog runtime guard
  • wire the checker into the full dotfiles test harness with red-path fixtures for malformed, fenced, long-fence, and indented-code cases
  • clarify tightening-a-pr handoff rules for final head SHA, validation evidence, CI, and draft-to-ready state

Review and audit trail

  • model route: skills/which-model/bin/model-catalog --env auto --refresh-if-stale --task long_context_review --top 3; used gpt-5.6-terra for independent review because it is selectable in this harness
  • review findings addressed:
    • 0eabd9a: reject fenced worklog runtime guards
    • 977cbcb: cover tilde-fenced opt-ins and runtime guards
    • cfc9fd5: parse matching Markdown fence marker and length, plus indented code
    • bc0e124: detect tab-expanded indented code
    • e358cd7: codify final PR handoff readiness evidence in tightening-a-pr
  • final focused review at bc0e124: no blocking findings; e358cd7 is guidance-only and passed the full harness

Validation

  • head: e358cd7
  • python3 tools/check-skill-opt-ins.py — pass
  • ./tests/run.sh all — 55 pass, 0 fail
  • git diff --check — pass
  • GitHub Actions for this PR head

stripped = line.strip()
reference = strip_bullet(line)

if in_fence:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Please add a red-path fixture for references inside fenced code blocks. The checker reports this case, but the behavior is currently only protected by code review rather than tests.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in 8f7a7b2 by adding a fenced-code red-path fixture and asserting the checker emits the code-fence failure message. Local validation: ./tests/run.sh all.

Comment thread tests/run.sh Outdated
optin_output=$(python3 tools/check-skill-opt-ins.py --root "$optin_tmp" 2>&1)
rc=$?
set -e
if [[ $rc -eq 1 && "$optin_output" == *"must use the exact compact opt-in preamble"* && "$optin_output" == *"needs runtime guard"* ]]; then

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This red-path fixture should also assert duplicate canonical opt-ins. The checker has a duplicate guard, but without a fixture it can regress while this test still passes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in 8f7a7b2 by adding a duplicate canonical opt-in fixture and asserting the checker emits the duplicate-reference failure message. Local validation: ./tests/run.sh all.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Independent review finding: the opt-in checker recognizes triple-backtick code fences but not tilde fences. A valid Markdown ~~~ fenced block containing the canonical opt-in or the worklog runtime guard can bypass the intended fenced-content rejection. I am fixing this by treating both fence styles as fenced content and adding tilde-fence red-path coverage.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Addressed independent review finding in 977cbcb: the checker now treats both backtick and tilde Markdown fences as fenced content, with red-path coverage for tilde-fenced opt-ins and a tilde-fenced worklog runtime guard. Local validation: ./tests/run.sh all (55 pass, 0 fail), python3 tools/check-skill-opt-ins.py, and git diff --check.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Second independent review finding: the fence parser should track the active Markdown fence marker/length, not just toggle on any ``` or ~~~ prefix, and the worklog runtime guard must not count when it is in an indented Markdown code block. I am fixing both bypasses with regression fixtures before marking this ready.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Addressed second independent review finding in cfc9fd5: fence parsing now tracks active marker character and length, closing only on a matching fence, and indented code lines are treated as non-operative for opt-in/runtime-guard checks. Added red-path coverage for long fences and indented-code runtime guards. Local validation: ./tests/run.sh all (55 pass, 0 fail), python3 tools/check-skill-opt-ins.py, and git diff --check.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Third independent review finding: mixed leading spaces plus a tab can create a four-column Markdown code block without matching the current literal indentation checks. I am fixing indentation handling to use column-count semantics and adding mixed-tab red-path coverage.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Addressed third independent review finding in bc0e124: leading indentation is now computed by Markdown column semantics, including tabs, so mixed space+tab indented code does not count as operative opt-in or runtime-guard prose. Added mixed-indent red-path coverage. Local validation: ./tests/run.sh all (55 pass, 0 fail), python3 tools/check-skill-opt-ins.py, and git diff --check.

@cheshirecode

Copy link
Copy Markdown
Owner Author

Final handoff evidence at e358cd7: local validation passed with python3 tools/check-skill-opt-ins.py, ./tests/run.sh all (55 pass, 0 fail), and git diff --check. Waiting for the GitHub Actions run on this head before marking the draft ready.

@cheshirecode
cheshirecode marked this pull request as ready for review July 18, 2026 18:28
@cheshirecode
cheshirecode merged commit f6dae54 into main Jul 18, 2026
4 checks passed
@cheshirecode
cheshirecode deleted the codex/example-led-optin-check branch July 18, 2026 18:29
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