Skip to content

feat(review): require the owner's decision to pass a loosened check - #17203

Merged
kyle-sexton merged 5 commits into
mainfrom
feat/loosened-check-needs-owner-decision
Nov 18, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
feat/loosened-check-needs-owner-decision

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

No related issue: the owner set this rule directly in a session, and no tracked issue carries it.

Summary

A repository can now require a spec to cite the owner's decision before a loosened check passes
review. The review plugin names no organization's record: the new optional
loosened_check_decision_record key in docs/conventions/review.yaml holds the record's https URL
prefix. This repository sets it, so /review:quality-gate, /review:fanout and the code-reviewer
agent ask for the citation here, and pr-verify asks for it through its own prompt. The
/review:code-review CI lane does not enforce it yet: no wrapper writes the setting's line into its
prompt, so the lane says in its summary that the citation requirement was not checked.

loosened_check_decision_record: value What a loosening, a removed check or a flaky-test quarantine needs
A URL prefix The spec names it and gives the reason as before, plus a line link under the prefix and the owner's words after verbatim: in double quotes
unset (the key is absent) The spec names it and gives the reason, as on main today
unreadable (the value is invalid or could not be read) The citation counts as unmet, so no spec allows the loosening on that run

The key has only the repository layer, with no user option, and is read from the default branch's
committed copy. A person's settings cannot switch it off and a pull request cannot change it for its
own review.

Fix

  • plugins/review/scripts/loosened-check-settings.mjs: prints a loosened_check_decision_record:
    line with its layer. Only an absent key prints unset. It prints unreadable and a WARN with no
    --ref, an unreadable default branch, a committed file that does not parse, or a key present with
    an invalid value, so a merged typo cannot switch the citation off.
  • plugins/review/schemas/review.schema.json, plugins/review/reference/config.md,
    plugins/review/README.md and plugins/review/skills/setup/SKILL.md: define the key.
  • plugins/review/skills/quality-gate/context/loosened-check.md: states the rule in terms of the
    configured record. A finding asks for the change to be undone or for the spec to supply what it
    lacks, never for an issue to be linked or filed.
  • plugins/review/skills/code-review/SKILL.md: a thread's answer or resolution never settles a
    loosened-check finding. This lane runs no settings script, so without the line it asks for no
    citation and says in its summary that the requirement was not checked.
  • plugins/review/workflows/fanout-sweep.js, plugins/review/agents/code-reviewer.md and the
    quality-gate and fanout skill files carry the new line to reviewers. The workflow rebuilds a
    missing, repeated or malformed line as unreadable.
  • plugins/review/skills/security-review/SKILL.md: drops an organization-specific basis sentence,
    with no rule changed.
  • .github/scripts/pr-verify/prompt.md and docs/conventions/pr-pipeline/README.md: this
    repository's own pipeline asks for the same citation.
  • Evals use a neutral example host and supply the setting through the fixture. The new
    code-reviewer-loosening-spec-no-record-configured case covers a trusted, reasoned spec with no
    record configured.
  • Changelog fragments for review and pr-pipeline.

Verification

  • node --test --test-concurrency=4 plugins/review/tests/fanout-sweep.test.mjs: 53 passed, 0 failed.

  • plugins/review/scripts/loosened-check-settings.test.sh: 90 of 90 checks passed.

  • plugins/review/skills/setup/scripts/setup-apply.test.sh: 436 of 436 checks passed.

  • plugins/review/tests/turn-budget.test.sh: all assertions passed.

  • Static eval validation: 0 FAIL.

  • Judge calibration with opus for the new case's no-loosening-finding grader: 15 of 15 runs agreed
    with the labeled samples.

  • claude plugin eval, 3 runs per arm with a no-plugin baseline, one case per run, judged by opus.
    Each run is VALID, with one warning that no skill-fired grader applies to these agent-dispatch
    cases. The noise report reads n too small to call for each, because one case is below the 3
    comparable cases it needs, so no measured gain is established and the result is do not promote
    on that measure. The scores show the cases behave as written:

    Case With plugin Without plugin List-price cost
    code-reviewer-loosening-spec-no-record-configured 1.00 0.50 1.31 USD
    code-reviewer-loosening-spec-requested 1.00 0.17 1.26 USD
    code-reviewer-quarantine-flaky-test-reasoned 1.00 0.33 1.22 USD
    code-reviewer-loosening-spec-no-owner-citation 1.00 0.00 1.17 USD
    code-reviewer-loosening-spec-untrusted-author 1.00 0.11 1.29 USD

What a lane cannot enforce: the record may be private, so a review or verifier checks only that the
line link and the verbatim: words are present. It cannot prove that the row exists, that the
quoted words match it, or who wrote it.

pr-verify reads its prompt from the base branch, so its new condition applies to pull requests
judged after this one merges. The prompt change was not replayed against a live model.

Related

  • #16372 added the criterion
    this change tightens.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 18, 2026 11:47
A trusted spec's reason no longer clears a loosened check on its own,
because sessions post under the owner's GitHub login. The spec must also
cite the owner's decision: a line link to its row in the owner-decisions
record and the owner's words after `verbatim:`.

- The criterion's three pass conditions and its finding text state this.
- /review:code-review never drops a loosened-check finding as settled by
  a thread, and a verifier never rejects one on that ground.
- The pr-verify Safety step and the pipeline README state the same
  condition.
- The reasoned eval cases carry the citation, and a new case flags a
  trusted, reasoned spec that has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 18, 2026 17:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T18:02:09.765598Z f0587f0 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0587f03a5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17203 (incremental, 9e7bb41 → c68e8f1)

No security issues found. I found nothing to report in this push.

This review covers only what changed since 9e7bb41. Because this lane already reviewed an earlier head, it reported blocking findings only. I read the whole change in .claude-lane/incremental.diff, all 5 listed files.

What changed

  • plugins/review/scripts/loosened-check-settings.mjs: adds one branch to repositoryLayer (L194-L196). Suppose the committed settings file parses (at least one PASS line) but the schema check prints no PASS loosened_check_decision_record: line. Before this push, loosened_check_decision_record then resolved unset. Now it resolves unreadable and prints a WARN.
  • loosened-check-settings.test.sh adds tests that pin this:
    • Six invalid values: an empty string, "", 42, true, null and a bracketed URL.
    • A flow map, which resolves to the existing "could not be parsed" branch.
    • A block list.
  • reference/config.md, quality-gate/context/loosened-check.md and the changelog fragment now describe the new behaviour.

Why there is no finding

  • The change tightens. unset means no citation of the owner's decision is required. unreadable makes the criterion treat the citation as unmet, so no spec can allow the loosening on that run. Before this push, a typo merged into docs/conventions/review.yaml could switch the citation requirement off without anyone noticing. Now it fails closed.
  • The unset path still works. A key that is absent still resolves unset, because the schema check's PASS <key>: (unset) line matches the new regex. Only passed() excludes (unset) (L173). The setting is still read only from the default branch's committed copy, so a pull request cannot change it for its own review.
  • No new attack surface. The new regex is built from the constant RECORD_KEY, not from file content. The push adds no new subprocess, path or input.
  • The doc edits weaken nothing. They describe the stricter behaviour and remove no rule.
  • This push changes no manifest, workflow, token scope or trust control, and no file in it matches a trusted-path glob.

critical-findings: 0

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

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #17203, incremental since 9e7bb417 (blocking only)

This lane already reviewed earlier heads of this PR, so this review reports blocking findings only. I read every hunk of the five files in the incremental diff:

  • the review changelog fragment
  • plugins/review/reference/config.md
  • plugins/review/scripts/loosened-check-settings.mjs
  • its .test.sh
  • quality-gate/context/loosened-check.md

What changed

A loosened_check_decision_record key on the default branch that holds an invalid value now resolves unreadable instead of unset. An unreadable record makes the citation count as unmet. Before, the invalid value was dropped with a WARN, so a merged typo could switch the citation requirement off.

What I checked

  • New branch in repositoryLayer (loosened-check-settings.mjs#L194-L196). I checked it against perKeyReport and passLine in plugins/review/lib/setup-apply.mjs#L848-L855 and #L847.
    • Key absent: the check still prints PASS loosened_check_decision_record: (unset). The new regex matches that line and passed() rejects it, so the record stays unset. That matches the new config.md wording ("unset only when the default branch's copy does not have the key").
    • Key with a value problem: a problem of kind value that names this key suppresses only this key's PASS line. The new branch then resolves unreadable while the other keys still resolve. The order is right: the earlier "could not be parsed" branch, which matches when no PASS line is printed at all, still catches a parse or file problem first. The flow-map test expects exactly that.
    • Absent file: this returns before the record is read, so it still resolves unset, as test case 10A says.
  • Tests. The new test cases cover these values: empty, "", numbers, booleans, null, a flow list, a block list and a flow map. Their expected from strings match the two code branches.
  • Prose. The fragment, config.md and loosened-check.md agree on the new rule.

Closing issue

The PR closes no issue, so there are no acceptance criteria to check.

Loosened checks

Loosened-check verdict: fail (default; the wrapper supplied no loosened_check_* lines; patterns: 0). This change makes the requirement stricter (invalid now means unmet), and no check is loosened.

Not verified

I ran nothing. Whether checkValue flags each listed invalid value, and whether the test suite passes, are the author's claims.

Prior findings

The one inline finding from earlier, on the pr-pipeline fragment, was already reported fixed in the last review. This push does not touch that file.

Verifier dropped 0 of 0 candidates.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Held: a review finding about the shipped rule naming this organization's private decision record needs the owner's design decision.

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head f0587f03a51a2aaa73967c33a0970505511a8d4d. What it wrote, as data:

What it wrote (29 lines)
Summary: The spec is the trusted PR body of #17203 (no linked issue): a spec may justify loosening a
  check only if it also cites the owner's decision. That means a line link to the owner-decisions
  record plus the owner's words after `verbatim:`. The diff does this consistently across six
  places: the pr-verify prompt, the pipeline README, `loosened-check.md`, `code-review/SKILL.md`,
  the evals and the changelog fragments. Each new rule is stricter than the old one. The new
  no-citation eval reuses the requested case's scaffold and then overwrites `issue.md` without the
  citation, so it does test the new rule. Every test and check job on head f0587f03 succeeded,
  including Test Node, Test Bash 0-3 and Check Plugins
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/44364803763). CI Status
  failed only because of a person-held comment, which is not test evidence. The capture was blocked
  by a credit stop and has no bearing. Nothing in the PR text tries to steer the reviewer. The
  blocking problem is that the shipped review plugin's criterion hard-codes one organization's
  private record, so this rule breaks for every other repo that installs the plugin. The trusted
  hold comment on the PR raises the same concern.
- plugins/review/skills/quality-gate/context/loosened-check.md:60: the shipped review plugin now
  requires every spec to link to
  `melodic-software/architecture/.../docs/owner-decisions.md#L<line>`, a private record in this
  organization. Any other repo that installs the plugin can never meet that, so every reasoned
  loosening, removed check or quarantine fails there, which breaks those callers. Read the record's
  location from a configurable setting (for example a `loosened_check_*` setting or the consumer
  repo's config, with this org's URL set in this repo's config), or apply the citation requirement
  only when that setting is configured. Do not hard-code the URL in the shipped criterion.
- plugins/review/skills/quality-gate/context/loosened-check.md:65: 'An issue without them gives no
  reason, whoever wrote it' and the Finding section's undo-or-cite request inherit the same
  org-specific requirement. Phrase them in terms of the configured decision record so they still
  make sense in a repo that has none.
- plugins/review/skills/code-review/SKILL.md:108: 'clears only when the change is undone or the spec
  cites the owner's decision' ties the shipped skill to the same hard-coded record. Point it at
  whatever the configurable criterion defines.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 18, 2026
kyle-sexton and others added 2 commits November 18, 2026 13:45
The review plugin named one organization's private record. A repository
now names its own in loosened_check_decision_record, an https URL prefix
read from the default branch, with no user option.

Set, a loosening, a removed check or a flaky-test quarantine also needs
a line link under that prefix and the owner's verbatim words. Unset, a
spec that names the check and gives the reason passes. When the value
cannot be known, the citation counts as unmet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fragment said this repository's reviewers ask for the citation, but
the CI code-review lane receives no decision-record line and reports the
requirement as not checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 25edde89cf67d7d4d3e3f004a7571fcae979d04c; the summary is in this lane's pull request comment.

claude-lane: claude-review

A key present on the default branch with an invalid value resolved
unset, so a merged typo switched the citation requirement off. Only an
absent key now resolves unset; an invalid value resolves unreadable with
a WARN, and the citation counts as unmet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 18, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

The hold has ended: the owner chose an optional repository setting for the decision record on 2026-11-18, and head c68e8f1 implements it.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 18, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit b64e922 Nov 18, 2026
86 of 89 checks passed
@kyle-sexton
kyle-sexton deleted the feat/loosened-check-needs-owner-decision branch November 18, 2026 19:28
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 18, 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.

1 participant