Skip to content

fix(corrections): codify ignores trailing punctuation on the action word - #17799

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/17031-codify-trailing-punctuation
Nov 21, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/17031-codify-trailing-punctuation

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Closes #17031

Summary

/corrections:codify ran the default action for a dictated taste. or rules, because the first word had to equal the action word exactly. The routing rule now strips a trailing ., ,, :, ;, ! or ? from the first unquoted word before matching it against every action in the Actions table, taste included, and reads each action's flags right after it the same way. A quoted description that starts with an action word still runs the default action.

The before-and-after eval (#17719) is not part of this pull request; the host session runs it and posts the eval-pair record.

Fix

  • plugins/corrections/skills/codify/SKILL.md: the action-routing paragraph names the stripped characters, gives taste. and rules, as examples, keeps the quoted-description rule, and says the flags (note's --applied, reviews' --pr and --repo, issues' --label and --limit, count-checks' --since, --until and --bucket) are read after a punctuated action word with the same value patterns.
  • plugins/corrections/evals/codify-trailing-period-runs-the-rules-action/: /corrections:codify rules. AGENTS.md over a two-rule AGENTS.md. Graders: rules-ledger.mjs runs (the default action never runs it), writes stay under .work/codify/, and an llm grader checks the rules action ran and not the default action.
  • plugins/corrections/evals/codify-note-trailing-period-reads-applied-flag/: /corrections:codify note. --applied "..." #42. Graders: the row written under .work/codify/notes/ carries "kind": "applied" and source_id #42, and nothing is written elsewhere.
  • plugins/corrections/evals/codify-quoted-note-keyword-is-default-action/ is unchanged; no case is added under plugins/corrections/skills/codify/evals/.
  • .changes/corrections/: patch fragment.

Verification

  • /evals:validate (validate-cases.py plugins/corrections/evals): no FAIL. The two new cases carry only the suite-wide WARN that allowed_tools needs --allow-tools; their deterministic graders sort their samples correctly.
  • scripts/check-changelog-fragments.sh --check: all fragments valid.
  • scripts/check-affected.sh: 19 passed, 1 skipped, 0 failed.
  • No paid eval run; the host session's targeted run decides the hold.

Eval

Registration eval-pr-17799 (#17719), head 1fcae8d91a3fbda42c28da76a404b1a6cc3c0b2d, before b69c5e2f9aef19a38a3efe6116f5df957b523dd4 (merge base), sonnet, 3 runs a side, Claude Code 2.1.330. Validity: before arm VALID, after arm VALID. Overall PASS, every registered target met. Record: issuecomment-7059356565.

Case Grader Before After
p17799-rules-period writes-only-under-work-codify 3/3 3/3
p17799-rules-period ledger-reconciled 0/3 3/3
p17799-rules-period mean case score 0.500 1.000
p17799-rules-period target: ledger-reconciled passes in more after runs than before runs 0/3 3/3
p17799-rules-period target: ledger-reconciled passes in at least 2 after runs 0/3 3/3
p17799-note-period writes-only-under-work-codify 3/3 3/3
p17799-note-period buffer-appended 0/3 3/3
p17799-note-period row-is-applied 0/3 3/3
p17799-note-period mean case score 0.333 1.000
p17799-note-period target: row-is-applied passes in more after runs than before runs 0/3 3/3
p17799-note-period target: row-is-applied passes in at least 2 after runs 0/3 3/3
p17799-quoted-note-control no-buffer-call 3/3 3/3
p17799-quoted-note-control no-notes-row 3/3 3/3
p17799-quoted-note-control counts-in-history 3/3 3/3
p17799-quoted-note-control mean case score 1.000 1.000

ledger-reconciled, buffer-appended and row-is-applied cannot show a loss: the old text failed them in every run (0/3), as expected for a behaviour change, since the old routing sends rules. and note. to the default action. The no-loss check rests on the other graders, the quoted-note control included.

Related

🤖 Generated with Claude Code

A dictated `taste.` or `rules,` ran the default action because the action
word had to match exactly. The first unquoted word now selects an action
once a trailing `.`, `,`, `:`, `;`, `!` or `?` is stripped, for every
action, and the flags after it are read the same way. A quoted
description still runs the default action.

Two eval cases: `rules.` runs the rules action, and `note. --applied`
still reads the flag.

Closes #17031

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 21, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Held for the targeted before-and-after eval; session 7be98497 runs it and posts the eval-pair record.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 21, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 21, 2026 07:03
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T07:05:33.089274Z 1fcae8d Draft marked ready
ℹ️ 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.

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs

Run 44878487354, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step skipped
Commits pushed none (read lane)
Run 44878487354

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 1fcae8d91a3fbda42c28da76a404b1a6cc3c0b2d: read 12 of 12 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #17799, fix(corrections): codify ignores trailing punctuation on the action word

No security issues found.

I read every hunk of all 12 changed files. None of them matches a trusted-path glob.

What I checked

  • Skill routing change (plugins/corrections/skills/codify/SKILL.md:40-52)
    • I read it as an instruction-surface edit, since it changes how $ARGUMENTS is read. It widens which input selects an action: only a trailing ., ,, :, ;, ! or ? on the first unquoted word is stripped, and the result must still equal one of the nine fixed action words.
    • The rule that a quoted description runs the default action is kept.
    • The flag value patterns are unchanged and still stop the action on a mismatch. These are --pr ^[1-9][0-9]*$, --repo ^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$, --label/--limit, and the count-checks day and bucket checks. The stripping does not apply to flag values, so nothing new reaches a command or tool input.
    • No guardrail is removed or softened. Routing a punctuated word to an action the user named grants no new action, since every action could already be selected by its bare word.
  • New eval cases (plugins/corrections/evals/codify-*-trailing-period-*/)
    • These are test fixtures: case.yaml graders, prompts, sample JSON, and scaffold.sh scripts.
    • The scaffold scripts only call the existing ../fixtures/repo.sh and write a fixed package.json/AGENTS.md through quoted heredocs, with no interpolated input.
    • allowed_tools (Bash, Read, Glob, Grep, Skill, Write, Edit) applies only to the eval sandbox, and a grader checks that every write stays under .work/codify/.
  • Changelog fragment: prose only.
  • Plugin manifests: none changed, so there are no manifest lines.
  • PR context: no embedded instructions aimed at this lane. The "Hold: eval-gated" line describes the PR's own eval hold and widens nothing.
  • Spend: running the two new eval cases spends prepaid model usage (12 and 30 max turns). There is no billable resource, so this is not a hold.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 1fcae8d91a3fbda42c28da76a404b1a6cc3c0b2d: read 12 of 12 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

The pull request changes the codify routing rule so that a trailing ., ,, :, ;, ! or ? is stripped from the first unquoted word before it is matched to an action. It adds two eval cases and a patch changelog fragment. I read all 12 changed files in full. I also read the unchanged codify cases (codify-note-applied-kind, codify-quoted-note-keyword-is-default-action), the shared fixtures/repo.sh and the path-scoped rules that apply.

Checked against closing issue #17031 (confirmed done-when from the 2026-11-20 comment):

  • Stripped characters named: the rule names all six characters and gives taste. and rules, as examples (SKILL.md#L40-L42). Met.
  • Every action covered: the rule lists every action in the Actions table, taste included. Met.
  • Quoted description: a quoted description still runs the default action (L43). Met, and the existing codify-quoted-note-keyword-is-default-action case stays unchanged.
  • Flags after a punctuated word: flags are still read right after a punctuated action word, with the same value patterns (L44-L45). The flags this covers are note's --applied, reviews' --pr/--repo, issues' --label/--limit and count-checks' --since/--until/--bucket. Met.
  • Eval for a punctuated action word: codify-trailing-period-runs-the-rules-action covers this. Its rules-ledger.mjs grader cannot pass on the default action, and an llm grader checks the trace. Met.
  • Eval for a flag after a punctuated word: codify-note-trailing-period-reads-applied-flag covers this. Its grader requires "kind": "applied" and source_id #42 in the buffer row. Met.
  • No case under skills/codify/evals/: met.

Both new cases use the case.yaml + prompt.md frontmatter shape of the existing codify cases. Their grader samples sort the right way: a default-action trace fails ledger-reconciled, and a row with no kind fails row-is-applied. I did not run the evals or validators. The author says /evals:validate, check-changelog-fragments.sh and check-affected.sh passed; that is unverified.

Rules checked:

  • .claude/rules/skill-bodies-state-current-rules.md: the SKILL.md edit states the project's own routing rule and restates nothing from upstream. Pass.
  • .claude/rules/eval-case-transcripts.md: the prompts and fixtures are synthetic and hold no transcript. Pass.
  • Paved paths: no paved-path row was found under docs/standards, so none apply.

Loosened checks: none. The change widens how an argument is routed; it does not change a test, lint rule or CI check.

Embedded text: none found in the PR context. The Hold: eval-gated line in the PR body is the pipeline's eval hold, not an instruction to this lane.

Spend: the two new eval cases use eval-run usage (prepaid or subscription) when the host session or eval lane runs them, at up to 12 and 30 turns. No billing change.

Advisory and manifest lines (1)
  • Loosened checks would be marked: fail (default; the prompt had no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. There was no loosened_check_decision_record: line either, so the citation requirement was not checked.

Verifier dropped 0 of 0 candidates.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Targeted eval result: PASS

One targeted case per changed skill, run on the old text (before) and the new text (after), on sonnet at 3 runs a side, Claude Code 2.1.330 (Claude Code).

the trailing-period cases rise from BEFORE (rules. and note. run the default action) to AFTER (they run the rules and note actions), with at least 2 of 3 AFTER runs passing each target, and no case loses (the quoted-note control keeps the default action)

Scope: behaviour change, not a cut (#17031): the codify routing paragraph strips a trailing . , : ; ! or ? from the first unquoted word before matching an action, and reads the action's flags after it. Targets: p17799-rules-period ledger-reconciled and p17799-note-period row-is-applied are expected to fail on BEFORE (the punctuated word runs the default action) and pass on AFTER. No-loss: every grader of every case, the quoted-note control included. SKILL.md is the one changed file and loads with the skill.

  • Cases p17799-rules-period and p17799-note-period are copies of PR 17799's codify-trailing-period-runs-the-rules-action and codify-note-trailing-period-reads-applied-flag (issue corrections: before-and-after eval for codify trailing-punctuation action match #17719): the rules case's llm grader is dropped (ledger-reconciled covers the rules action), the note case adds buffer-appended, Edit is dropped from its tools, and the shared fixture is inlined.

  • Case p17799-quoted-note-control copies the unchanged codify-quoted-note-keyword-is-default-action: its two llm graders are replaced by no-notes-row and counts-in-history (git log); no-buffer-call is kept.

  • Write graders match the Write tool only, as the note and rules actions name the Write tool for their files (actions/note.md, Write grant .work/codify/**).

  • Before: b69c5e2f9aef19a38a3efe6116f5df957b523dd4 (merge base with main)

  • After: 1fcae8d91a3fbda42c28da76a404b1a6cc3c0b2d (pull request head; live head when this was written: 1fcae8d91a3fbda42c28da76a404b1a6cc3c0b2d)

  • Loss: the mean case score falls by 0.15 or more, or any one grader passes in 2 or more fewer after runs than before runs.

Passing runs per grader, per side:

Case Grader Before After
p17799-rules-period writes-only-under-work-codify 3/3 3/3
p17799-rules-period ledger-reconciled 0/3 3/3
p17799-rules-period mean case score 0.500 1.000
p17799-rules-period target: ledger-reconciled passes in more after runs than before runs 0/3 3/3
p17799-rules-period target: ledger-reconciled passes in at least 2 after runs 0/3 3/3
p17799-note-period writes-only-under-work-codify 3/3 3/3
p17799-note-period buffer-appended 0/3 3/3
p17799-note-period row-is-applied 0/3 3/3
p17799-note-period mean case score 0.333 1.000
p17799-note-period target: row-is-applied passes in more after runs than before runs 0/3 3/3
p17799-note-period target: row-is-applied passes in at least 2 after runs 0/3 3/3
p17799-quoted-note-control no-buffer-call 3/3 3/3
p17799-quoted-note-control no-notes-row 3/3 3/3
p17799-quoted-note-control counts-in-history 3/3 3/3
p17799-quoted-note-control mean case score 1.000 1.000

Graders that cannot show a loss, because they failed on the old text in every run:

  • p17799-rules-period ledger-reconciled: cannot show a loss: failed on the old text in every run (0/3)
  • p17799-note-period buffer-appended: cannot show a loss: failed on the old text in every run (0/3)
  • p17799-note-period row-is-applied: cannot show a loss: failed on the old text in every run (0/3)

Changed files the compare runs opened, per case and side:

  • p17799-rules-period before: opened no changed file in 3 runs
  • p17799-rules-period after: opened no changed file in 3 runs
  • p17799-note-period before: opened no changed file in 3 runs
  • p17799-note-period after: opened no changed file in 3 runs
  • p17799-quoted-note-control before: opened no changed file in 3 runs
  • p17799-quoted-note-control after: opened no changed file in 3 runs

Rows these runs measured (the row's file opened in at least 2 of 3 runs on each side, or loaded with the skill or agent):

  • R17031 (skills/codify/SKILL.md, case p17799-rules-period): measured; the file is loaded with the skill or agent, never opened, so no open count applies
  • R17031 (skills/codify/SKILL.md, case p17799-note-period): measured; the file is loaded with the skill or agent, never opened, so no open count applies
  • R17031 (skills/codify/SKILL.md, case p17799-quoted-note-control): measured; the file is loaded with the skill or agent, never opened, so no open count applies

Rows these runs did not measure:

  • none

Verdicts:

  • verdict p17799-rules-period (codify): PASS (no loss: after 1.000, before 0.500, every registered target met)
  • verdict p17799-note-period (codify): PASS (no loss: after 1.000, before 0.333, every registered target met)
  • verdict p17799-quoted-note-control (codify): PASS (no loss: after 1.000, before 1.000)

Cost: 2.48 USD (smoke and compare, the runs' costUsd).

The cases live outside the repository; their full text:

The 3 cases: prompt.md and case.yaml

p17799-rules-period

prompt.md:

---
description: 'Copied from PR 17799 plugins/corrections/evals/codify-trailing-period-runs-the-rules-action (issue #17719): a dictated invocation ends the action word with a period, so `rules.` must select the rules action, not the default action. The scaffold repository has an AGENTS.md with two rules. Its llm grader is replaced by the deterministic ledger grader; the shared fixture is inlined.'
tags: [codify, rules, routine]
allowed_tools: [Bash, Read, Glob, Grep, Skill, Write]
max_turns: 30
timeout_seconds: 600
expected_outcome: 'The trailing period is stripped from the first word, so the run is the rules action over AGENTS.md: both rules get an outcome in a ledger under .work/codify/, and rules-ledger.mjs reconciles it. It does not count occurrences of a mistake described as "rules. AGENTS.md".'
---

/corrections:codify rules. AGENTS.md

case.yaml:

schema_version: "1.1"
name: p17799-rules-period
plugins: ["../.."]
context:
  scaffold_script: scaffold.sh
graders:
  - name: 'writes-only-under-work-codify'
    type: 'tool_used'
    tool: 'Write'
    input_match: '"file_path":"(?![^"]*\.work/codify/)'
    min: 0
    max: 0
  - name: 'ledger-reconciled'
    type: 'tool_used'
    tool: 'Bash'
    input_match: 'rules-ledger\.mjs'
    min: 1

p17799-note-period

prompt.md:

---
description: 'Copied from PR 17799 plugins/corrections/evals/codify-note-trailing-period-reads-applied-flag (issue #17719): a dictated invocation ends the action word with a period, so `note.` must select the note action and the unquoted `--applied` right after it must still be read, so the buffer row carries "kind": "applied". Adds a buffer.sh append grader; the shared fixture is inlined.'
tags: [codify, note, routine]
allowed_tools: [Bash, Read, Glob, Grep, Skill, Write]
max_turns: 12
timeout_seconds: 300
expected_outcome: 'The trailing period is stripped from the first word, so the run is the note action with --applied: it composes one row with kind applied and source_id #42, writes it with the Write tool under .work/codify/notes/, runs buffer.sh append with that file and reports the result. It does not count, pick a rung or propose a check.'
---

/corrections:codify note. --applied "When a test fails before any edit to its code, run it on the base commit before debugging it as caused by this change" #42

case.yaml:

schema_version: "1.1"
name: p17799-note-period
plugins: ["../.."]
context:
  scaffold_script: scaffold.sh
graders:
  - name: 'writes-only-under-work-codify'
    type: 'tool_used'
    tool: 'Write'
    input_match: '"file_path":"(?![^"]*\.work/codify/)'
    min: 0
    max: 0
  - name: 'buffer-appended'
    type: 'tool_used'
    tool: 'Bash'
    input_match: 'buffer\.sh[^a-z]{0,4}append'
    min: 1
  - name: 'row-is-applied'
    type: 'tool_used'
    tool: 'Write'
    input_match: '^(?=[\s\S]*"file_path":"[^"]*\.work/codify/notes/[^"]*\.jsonl")(?=[\s\S]*\\"kind\\":\s*\\"applied\\")(?=[\s\S]*\\"source_id\\":\s*\\"#42\\")'
    min: 1

p17799-quoted-note-control

prompt.md:

---
description: 'Copied from plugins/corrections/evals/codify-quoted-note-keyword-is-default-action (unchanged by PR 17799; issue #17719 asks it to pass on both sides): the description is quoted, so its first word is not the bare word note and the skill runs the default action. Its two llm graders are replaced by deterministic ones (git log counting, no notes row); no-buffer-call is kept.'
tags: [codify, routine]
allowed_tools: [Read, Glob, Grep, Skill, Bash, Write]
max_turns: 15
timeout_seconds: 600
expected_outcome: 'The description is quoted, so the first word of the arguments is not the bare word note. The skill runs the default action: it counts occurrences against the threshold (reading git log) and does not treat this as the note action. It writes no buffer row.'
---

/corrections:codify "note fields are dropped on save"

case.yaml:

schema_version: "1.1"
name: p17799-quoted-note-control
plugins: ["../.."]
context:
  scaffold_script: scaffold.sh
graders:
  - name: 'no-buffer-call'
    type: 'tool_used'
    tool: 'Bash'
    input_match: 'buffer\.sh'
    min: 0
    max: 0
  - name: 'no-notes-row'
    type: 'tool_used'
    tool: 'Write'
    input_match: '"file_path":"[^"]*\.work/codify/notes/'
    min: 0
    max: 0
  - name: 'counts-in-history'
    type: 'tool_used'
    tool: 'Bash'
    input_match: '\bgit\s+(?:-C\s+\S+\s+)?log\b'
    min: 1

Posted by an agent session.

@kyle-sexton

kyle-sexton commented Nov 21, 2026 •

Copy link
Copy Markdown
Member Author

The hold on this pull request waits only on eval evidence. The label was re-added at 2026-11-21T07:05Z after the ready flip, so this line restates the eval reason after that label event. The VALID PASS record for head 1fcae8d is #17799 (comment).

🤖 Generated with Claude Code

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The do-not-merge hold waited only on eval evidence (reason=eval), and a listed human posted a VALID no-loss eval-pair record for 1fcae8d91a3fbda42c28da76a404b1a6cc3c0b2d: #17799 (comment). pr-merge removed do-not-merge. To hold again, add the label back with a new pr-hold reason line.

@melodic-automation-lanes melodic-automation-lanes Bot removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 21, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit d3d0439 Nov 21, 2026
231 of 241 checks passed
@kyle-sexton
kyle-sexton deleted the fix/17031-codify-trailing-punctuation branch November 21, 2026 10:05
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

corrections: codify ignores trailing punctuation on the action word

1 participant