Skip to content

fix(plugins): bundle the contracts skills fetched from the publisher - #17442

Merged
kyle-sexton merged 11 commits into
mainfrom
fix/bundle-fetched-contracts
Nov 19, 2026
Merged

kyle-sexton merged 11 commits into
mainfrom
fix/bundle-fetched-contracts

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #17208

Summary

Eight shipped instructions told the model to fetch a contract from this repository's raw GitHub URL before acting. That makes the publisher a runtime dependency, which plugin-philosophy (Design boundary, org-agnosticism) calls non-conforming. It also made every offline persist run report-only. Each plugin now ships its own generated copy of the contract and reads that copy.

Plugin Site Contract
ai-slop skills/audit/context/persist-findings.md (and the matching step in SKILL.md) detector-findings
attribution skills/audit/context/persist-findings.md, rung 2 of the resolution ladder detector-findings
docs-hygiene skills/audit-noise/context/persist-findings.md detector-findings
harness-config skills/audit-instructions/context/persist-findings.md detector-findings
mutation-testing skills/audit/context/persist-findings.md detector-findings
testing skills/audit/SKILL.md, --persist-findings step 1 detector-findings
source-control skills/pull-request/reference/prep.md and ready-for-review.md pre-pr-ordering

ready-for-review.md is an eighth site: the same sentence ("Read it there"), the same contract and the same plugin as prep.md.

Fix

  • Registered the copies in scripts/shared-copies.txt: docs/contracts/detector-findings/README.md goes to plugins/<p>/reference/detector-findings.md in the six detector plugins, and docs/contracts/pre-pr-ordering/README.md goes to plugins/source-control/reference/pre-pr-ordering.md. scripts/sync-shared-copies.sh generated all seven. The canonical copies stay in docs/contracts/.
  • Each site now points at the bundled copy, not the URL. A spoke cannot name ${CLAUDE_PLUGIN_ROOT} because the Read tool substitutes no variables (scripts/check-spoke-plugin-root.sh). So the detector spokes name the copy by where it sits in the plugin root, and source-control uses its own <plugin-root> placeholder. Wording that described a fetch now describes a read: "cannot be read", "contract read succeeded", "read-and-refuse gate". The refuse-to-write rule is unchanged.
  • attribution keeps rung 1 (the review plugin's files). Rung 2 is now the bundled copy, and the paragraph explaining the rung order was rewritten to match.
  • Rewrote the canonical copies' links to sibling contracts, to plugin-philosophy.md and to CHANGELOG.md as repository-root-relative links (../../../docs/...). These links resolve from both docs/contracts/<name>/ and plugins/<p>/reference/, so lychee offline passes on the copies and no exclude is needed.
  • Registered the detector-findings copies in scripts/cross-plugin-source-registry.txt, with cluster lines for both contracts. The other generated contract copies are registered the same way.
  • Added a patch changelog fragment for each of the seven plugins.
  • detector-findings 3.11.0: "Where the file goes" now states what a producer needs when the review plugin is not installed. That covers the findings directory and branch slug, the self-ignore guard, the file name and no-overwrite rule, and what the consumer admits (type:, branch:, the ## Findings header, cell escaping, repo-relative paths). review's change-set.md "Findings location" and findings-file-shape.md remain the consumer's statement, and the contract must agree with them. The adopter wording that said a producer fetches the contract at run time now says it reads its bundled copy.
  • check-vocabulary reported two contract lines in each bundled copy, because its allow covers docs/contracts/detector-findings/** only. The two lines are reworded: "Repo-override only" became "Opt-in per repository", and "overrides it" became "replaces it". The copies pass with no new allow.
  • Two eval cases expected the removed fetch. ai-slop's persist-refuses-without-contract now makes the bundled copy unreadable, so the refuse-to-write rule is still tested. attribution's audit-unsourced-restatement-report-only now expects rung 2, the bundled copy, to resolve the contract offline, so a findings file may be written; an Edit or shell redirect into one still fails the case. A new attribution case, audit-contract-unreadable-report-only, keeps rung 3 (neither copy readable, so write nothing) under test with the original no-write graders. Two spoke sentences that sent the slug rule to the review plugin now name the bundled contract.

Verification

  • scripts/sync-shared-copies.sh --check: all 981 copies match, after the update from main. --check-bump origin/main: every carrying plugin has a fragment.
  • scripts/check-changelog-fragments.sh --check-required origin/main: 7 of 7 plugins have a fragment.
  • python3 -I scripts/check-vocabulary.py over the whole tree: exits 0, with no allow for the copies (12 lines reported before the rewording). test_check_vocabulary.py under unittest: 23/23. scripts/check-vocabulary.test.sh: 23/23.
  • scripts/check-cross-plugin-source-drift.sh --check: clean.
  • scripts/check-detector-findings-crosswalk.sh --check: 53 rule rows OK. Its test suite: 16/16.
  • lychee --offline with lychee.toml, over the contract, its changelog and the six copies: 0 errors.
  • validate-cases.py plugins/attribution/evals: no FAIL (warnings only, all about allowed_tools, which this change does not touch). check-evals-quality.sh on the ai-slop evals.json: PASS. check-detector-eval-coverage.sh --check: passes.
  • Earlier on this branch: scripts/check-changed-skills.sh origin/main (7 skills, 0 failed), scripts/sync-shared-copies.test.sh (101/101), scripts/check-publisher-token-alignment.sh and scripts/check-spoke-plugin-root.sh passed. The pre-push check-affected passed on the current head.

Remaining

This pull request removes the runtime fetches of contracts from this repository's raw GitHub URLs in the seven plugins listed above. Still open under #17208:

  • The organization-specific matches the other part pull requests have not covered, each classified as runtime behavior, instruction, permitted citation or test fixture, with the runtime and instruction ones made configurable.
  • The account-rotation link in the rate-limits operable floor and every inlined copy of it.
  • The CI check that fails when shipped content adds a new organization-specific dependency.

Related

  • Remove organization-specific dependencies from shipped plugins #17208
  • Not changed: the remaining raw-URL mentions of detector-findings are citations a reader follows, not fetch instructions. They are in corrections/.../finding-classes.md, code-metrics/.../audit-suppressions/SKILL.md, harness-config/.../criteria.md, review/reference/findings-file-shape.md, review/.../fix-pass-mode.md and code-tidying/.../remove.md.
  • The emit-findings.sh header comments in ai-slop, attribution, docs-hygiene and harness-config still say "fetch-and-refuse gate". Editing those lines trips the comment-lint hook on comments that predate this change, so they are left for a comment-tidy pass.

🤖 Generated with Claude Code

kyle-sexton and others added 5 commits November 19, 2026 09:25
Skills told the model to fetch the detector-findings and pre-PR ordering
contracts from the publisher's raw GitHub URL before acting, which makes
the publisher a runtime dependency (docs/plugin-philosophy.md, Design
boundary) and turns every offline persist run report-only.

Ship each contract inside the plugin that reads it as a generated copy
(scripts/shared-copies.txt) and read it from ${CLAUDE_PLUGIN_ROOT}:
detector-findings into ai-slop, attribution, docs-hygiene,
harness-config, mutation-testing and testing; pre-pr-ordering into
source-control. The canonical stays in docs/contracts/. Its sibling
links now go through the repository root so they resolve from both
the canonical and the copies.

Refs: #17208

Co-authored-by: Claude Opus 5.5 <[email protected]>
check-cross-plugin-source-drift.sh --check fails the six identical
reference/detector-findings.md copies as an unregistered cluster. Register
them, plus duplication-audit cluster lines for both contracts, as the
other generated contract copies are.

Refs: #17208

Co-authored-by: Claude Opus 5.5 <[email protected]>
…pokes

The Read tool substitutes no variables, so a spoke that names
${CLAUDE_PLUGIN_ROOT} hands the model an unresolved path
(scripts/check-spoke-plugin-root.sh). Name the copy by its place in the
plugin root instead, and use source-control's <plugin-root> placeholder,
which its SKILL.md renders.

Refs: #17208

Co-authored-by: Claude Opus 5.5 <[email protected]>
… copies

check-vocabulary allows the contract's severity-tier wording under
docs/contracts/detector-findings/ but reported the same lines in the six
generated copies under plugins/*/reference/detector-findings.md, which
must match the source byte for byte. The copies get the same allow by
path, as the enforcement-ladder copies have, with a test row that shows
the line is still reported outside that path.

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

chatgpt-codex-connector Bot commented Nov 19, 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-19T14:59:37.509690Z d05d70d 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: d05d70d26e

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

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44549479682

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17442 (incremental, since f984da9)

No security issues found. This lane already reviewed an earlier head of this pull request, so this pass was blocking only: it reports only CRITICAL and IMPORTANT findings.

Scope. I read the whole incremental diff. It covers one file, scripts/shared-copies.txt, which matches none of the TRUSTED PATHS globs and is not a hold path.

What changed. Seven existing registry lines were moved, with no change to their text, from after the target-scope entries to sit beside the other docs/contracts/* entries:

  • six lines map docs/contracts/detector-findings/README.md to plugins/<p>/reference/detector-findings.md;
  • one line maps docs/contracts/pre-pr-ordering/README.md to plugins/source-control/reference/pre-pr-ordering.md.

No line was added or removed, and no source or destination path changed. The set of copies that scripts/sync-shared-copies.sh generates is therefore identical to the reviewed head.

What is untouched. This push changes no trust control, token request, kill switch, merge hold, instruction surface or plugin manifest, so there are no manifest lines.

Context files. The PR context file has no text asking the lane to pass the change, skip a check or drop a finding. The one prior finding is a summary with no line anchor and zero findings, so there is nothing to repeat.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: 7b09dd26, incremental and blocking only

No blocking findings. This lane has already reviewed earlier heads, so this round reports only blocking findings.

Scope. One file changed since f984da9e: scripts/shared-copies.txt. I read its whole hunk in .claude-lane/incremental.diff.

What changed. The seven registration lines added earlier in this PR move up to lines 97–103, next to the other docs/contracts/* entries:

  • six lines for docs/contracts/detector-findings/README.md, one per detector plugin's reference/detector-findings.md
  • one line for docs/contracts/pre-pr-ordering/README.md to plugins/source-control/reference/pre-pr-ordering.md

They previously sat in the middle of the target-scope group. Every line is the same as before, with none added or dropped. Each line of the file registers one <canonical> <copy> pair, and nothing in the file's header says order matters, so the move changes only how the file is grouped. The detector-findings and pre-pr-ordering lines now sit together with the other contract copies.

Earlier findings. Both earlier inline findings were settled at heads this push does not touch. This push changes no eval files, so neither is raised again.

Closing issue: none. The PR says Refs: #17208 and closes no issue, so there are no acceptance criteria to check.

Loosened-check verdict: fail (default, because the prompt had no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The prompt also had no loosened_check_decision_record: line, so I did not check the citation requirement. This push changes no checks or graders.

Not checked by me. No plugin.json or marketplace.json changed, so there are no manifest lines. The author says sync-shared-copies.sh --check passes. I ran no commands, so that result is unverified.

Embedded text: none in the PR context, the settled threads or the prior findings.

I dispatched no verifier subagents, because there were no candidates.

Verifier dropped 0 of 0 candidates.

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

Copy link
Copy Markdown
Member Author

Held: claude-review flags the new check-vocabulary allow for plugins/*/reference/detector-findings.md as a loosened check (blocking), and no owner-decisions row or owner statement covers it; without the allow the bundled copies fail the vocabulary check.

kyle-sexton and others added 2 commits November 19, 2026 10:43
Drop the vocabulary allow for plugins/*/reference/detector-findings.md
and its test row. Reword the two contract lines check-vocabulary reported
in the copies ("Repo-override only", "overrides it"), so the copies pass
with no new allow.

"Where the file goes" now states what a producer needs without the
review plugin: the findings directory and branch slug, the self-ignore
guard, the file name and no-overwrite rule, and what the consumer admits.
The review plugin's change-set.md and findings-file-shape.md stay the
consumer's statement, which the contract must agree with. Adopter wording
says a producer reads its bundled copy instead of fetching the contract.
The contract is bumped to 3.11.0 and the six copies regenerated.

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 84a2423f1bcfc184c4329e1c844eb1b0652052df; the summary is in this lane's pull request comment.

claude-lane: claude-review

@kyle-sexton

Copy link
Copy Markdown
Member Author

Removing do-not-merge: the vocabulary allow from d05d70d is removed (the contract was reworded instead in 811d4e0), so no loosened check remains.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
kyle-sexton and others added 2 commits November 19, 2026 11:02
Two eval cases still expected the network fetch this branch removes.
ai-slop's persist-refuses-without-contract now makes the bundled
reference/detector-findings.md unreadable, so it still tests the
refuse-to-write rule. attribution's offline audit case now expects rung 2,
the plugin's bundled copy, to resolve the contract, so a Write of the
findings file is allowed; an Edit or shell redirect into one is still
refused.

Two spoke sentences pointed at the review plugin for the slug rule and
said the contract does not state it; they now name the bundled contract.

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 609e0d82ae0c8f6c9a0d45b3d45c789a7c3eb330; the summary is in this lane's pull request comment.

claude-lane: claude-review

The offline audit case now expects the bundled contract to resolve, so
nothing tested rung 3 of persist-findings.md (neither copy readable, so
write nothing). audit-contract-unreadable-report-only is that case: the
same corpus and the original no-write, no-edit and no-shell-write graders,
with the plugin's bundled reference/detector-findings.md unreadable and a
report-only grader that names both bundled-copy rungs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 19, 2026
… contracts

The seven registry lines sat inside the target-scope block, at the line
another queued change also inserts at, so the merge queue removed this
pull request on a merge conflict. They now follow the enforcement-ladder
copies, with no change to what is registered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgaQE4QB75SPD3ky1jd
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 73cffff Nov 19, 2026
58 checks passed
@kyle-sexton
kyle-sexton deleted the fix/bundle-fetched-contracts branch November 19, 2026 17:41
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 19, 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