Skip to content

feat(review): read org standards and REVIEW.md from the standards repository - #18969

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/org-standards-layer
Nov 25, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/org-standards-layer

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #18968

Summary

Standards contract 1.2.0 adds an org layer, so a repository can read the organization's engineering standards, filing guide and REVIEW.md from melodic-software/standards main instead of a synced copy (owner decisions L1, Q296, and L2, Q297; owner words at line 423, verbatim: "OK go w/ recommendations").

Fix

  • Contract (docs/contracts/standards/README.md, 1.2.0): an Org layer section and a "Review criteria: REVIEW.md" section. The org layer is the team layer of the repository standards_repository names in docs/conventions/source-control.yaml, read at its main; it sits beneath the team layer, which adds to it or replaces an org file by name. A repository without the key resolves exactly as before.
  • REVIEW.md in effect: the org file, then the repository's appended (a byte-identical synced copy adds nothing, so today's copies keep working). A repository REVIEW.md whose first non-blank line is <!-- review-base: replace --> is the whole criteria.
  • lib/org-standards.sh (dir, index, review): STANDARDS_DIR in CI, else a depth-1 clone cached under the user cache directory and refreshed hourly; a failed refresh keeps the cache with a notice. Shared into review, planning and improvement.
  • Readers: the code-review skill (a REVIEW CRITERIA: / ORG STANDARDS: prompt line from a shell-less lane, else the repository file as before), the three reviewer agents, quality-gate's criteria and self modes, the pr-review-main lane (composes standards/REVIEW.md from its standards checkout and copies the checkout's criteria and prose to org/; REVIEW.md and docs/standards become copy-if-present), the issue house style, the ecosystem-resolution record table (1.1.2) and AGENTS.md.
  • Managed Code Review condition (Q297): no repository uses it. No Claude Code Review check run on sampled PR heads (this repository chore(release): release 1 plugins #18952, medley docs(docs-hygiene): hedge audit-derivability fork contrast as contested #2443, dotfiles guardrails: block-hook-bypass message overstates enforcement scope (writes inside an invoked script are not inspected) #1802); no Copilot code review rule in the base or trust-root org rulesets.

Verification

  • bash lib/org-standards.test.sh: 22 pass, covering default (no repository file: org only), extend (appended), complete override (marker: repository only), identical copy, no opt-in, STANDARDS_DIR, cache TTL and refresh, failed refresh, clone failure, and index.
  • node --test .github/scripts/pr-review-main/workflow.test.mjs: 49 pass; the copy-step test runs the step's script for extend, override and default.
  • scripts/check-standards-contract-bump.sh origin/main: pass. scripts/sync-shared-copies.sh --check and node scripts/sync-credential-legs.mjs --check: clean. scripts/validate-plugins.sh --only "review planning improvement ...": valid. shellcheck and scripts/check-vocabulary.py on changed files: clean.

Related

  • Next: ci-workflows pr-review-cli.yml stages the composed criteria for the hosted and fleet review lanes once this merges; then standards adds its org index and retires the engineering-standards, filing-guide and review-instructions components; then per-target deletions.

🤖 Generated with Claude Code

…ository

Standards contract 1.2.0 adds an org layer: the team layer of the
repository docs/conventions/source-control.yaml names in
standards_repository, read from its main (STANDARDS_DIR in CI, else a
cached shallow clone) beneath the team layer. Review criteria compose the
org REVIEW.md with the repository's appended, or the repository's alone
behind a first-line <!-- review-base: replace --> marker.
lib/org-standards.sh implements both, shared into review, planning and
improvement; the pr-review-main lane composes REVIEW.md from its
standards checkout.

Closes #18968

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 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-25T03:15:30.850915Z e3148dc 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.

@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: e3148dcf43

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

Comment thread .github/workflows/pr-review-main.yml Resolved
…in spokes

Register scripts/org-standards.sh in the cross-plugin source registry under
its sync-shared-copies.sh check, and replace ${CLAUDE_PLUGIN_ROOT} in the
quality-gate criteria and self spokes with the <plugin-root> placeholder
SKILL.md "Spoke paths" renders.

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

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18969, incremental (d880fe0 → 4d39731)

I found no security issues in this push. This lane already reviewed an earlier head, so the review was blocking only. I read every hunk of all 4 files in .claude-lane/incremental.diff.

What I checked

  • .github/workflows/pr-review-main.yml, the judged step in check-trigger (trusted path). This step decides whether a cached main-run verdict lets a head skip a new review.
    • The change only tightens when a cached verdict counts. It now also needs the verdict's standards_sha to equal STANDARDS_SHA, the commit this run resolved. A missing or different value means the verdict does not count, and so does an empty or malformed STANDARDS_SHA. In each case the review runs again instead of being skipped.
    • STANDARDS_SHA comes from steps.standards.outputs.sha. That is the download-standards step at L158, which runs before the judged step at L254 in the same job.
    • The value is passed through env: and checked against ^[0-9a-f]{40}$ before use. It never appears as ${{ }} inside run:, so there is no expression injection.
    • The verdict's standards_sha is read with jq -r, and a read error goes to unread. The value is only compared as a quoted string and is never run.
    • No merge hold is weakened, no token scope or permission changes, and the kill switch is untouched.
  • write-verdict.mjs and the three verdict-writing steps. standardsSha goes through the same SHA regex check as the head, base and tree values. main now refuses to run when STANDARDS_SHA is unset, so a verdict can no longer be written without a standards commit. The new field is a validated 40-hex value, so it adds no model-controlled text to the artifact.
  • workflow.test.mjs and write-verdict.test.mjs. These are test changes only, with no security surface.

The change only narrows when cached reviews are reused. Spend: a change on the standards repository now triggers fresh review runs instead of reusing a cached verdict. That uses prepaid or subscription review credit and bills nothing.

No plugin manifest changed, so there are no manifest lines.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): standards commit bound to cached main-run verdicts

This review covers only the changes since d880fe0 and reports blocking findings only, because this lane already reviewed an earlier head. I read all 4 files on the incremental list: write-verdict.mjs, its test, workflow.test.mjs and pr-review-main.yml.

The incremental change looks correct.

  • Verdict writing. buildVerdict now requires a 40-hex standards_sha and records it, and main refuses an empty STANDARDS_SHA.
  • All three review jobs pass the same commit. Each review job (review, review-subscription, review-fallback) takes STANDARDS_SHA from its own steps.standards. That step downloads with ref: needs.check-trigger.outputs.standards-sha, so the commit it writes into the verdict is the one the check-trigger job resolved (pr-review-main.yml#L821-L825).
  • The skip step. The judged step runs after steps.standards in check-trigger (#L157-L159).
    • It exits before any API read when the commit is not 40-hex.
    • It skips a verdict whose standards_sha is missing or different.
    • Both outcomes leave no output, so the review runs again. A stricter skip can only cause an extra review, never a wrongly kept one.
  • Tests. The new cases cover all of the above: another standards commit, no standards commit, a moved or empty STANDARDS_SHA, and zero API calls when it is empty.

I ran nothing; none of this is executed or confirmed by me.

Blocking finding still open (restated from the previous round; the file is unchanged since then):

  • lib/org-standards.sh#L28-L30: Setting STANDARDS_DIR turns on the org layer without the repository's opt-in.
    • org_dir returns STANDARDS_DIR before it reads standards_repository (line 33). A repository with no key therefore gets the org layer whenever its shell sets STANDARDS_DIR.
    • That breaks the contract's opt-in rule ("No key ... means no org layer; nothing else changes").
    • It also breaks the closing issue's first acceptance criterion: "A repository without the key resolves as before."
    • Fix: check the standards_repository opt-in first, and use STANDARDS_DIR only as the location once the repository has opted in. Make the fix in the canonical file, then resync the generated copies.
    • Previous post: feat(review): read org standards and REVIEW.md from the standards repository #18969 (comment)

Loosened checks. No check is loosened in this increment.

  • Loosened checks would be marked: fail. This is the default, because the prompt gave no loosened_check_verdict: line; patterns: 0.
  • There was no loosened_check_decision_record: line, so I did not check the citation requirement.

No plugin manifest changes and no embedded instructions in the inputs. Spend: this change can make main-run reviews run again when the org standards commit moves, which spends more prepaid review runs; nothing is billed.

Verifier dropped 0 of 0 candidates.

write-verdict.mjs records the run's standards commit (download-standards'
one SHA per run) as standards_sha, required and SHA-checked. The judged-head
step counts a verdict only when its standards_sha equals the commit this
run resolved; a verdict from another standards commit, or with none, does
not count, so an org-layer change reviews the head again. The subscription
and fallback legs are re-rendered by scripts/sync-credential-legs.mjs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 138a6cd Nov 25, 2026
65 checks passed
@kyle-sexton
kyle-sexton deleted the feat/org-standards-layer branch November 25, 2026 03:55
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 25, 2026
kyle-sexton added a commit to melodic-software/standards that referenced this pull request Nov 25, 2026
## Summary

Publish the team-layer index that standards contract 1.2.0 reads as the
org layer. Until now `org-standards.sh index` exited 5 against this
repository, because it had no index. That blocks retiring the
`engineering-standards` and `filing-guide` copies (owner decision Q296,
L1).

## Fix

- `.claude/standards.yaml` sets `standards_dir: standards`. That is the
directory holding the docs, so every row resolves relative to the index.
- `standards/README.md` becomes the index. It gains the
`standards-contract: 1.2.0` front matter and a `## Standards index`
table of the eleven files the two components sync, as
`engineering/<file>.md` and `process/<file>.md`.
- "How this is consumed" now names the one runtime read: the org layer.
- The component README no longer says skills never fetch remote
standards.
- The sync manifest and
`components/engineering-standards/standards-index.md` are unchanged.
Consumers flatten the files into `docs/standards/`, so their synced
index must keep the bare file names until the components retire.

Why this layout:
- `org-standards.sh` reads the index from a fixed name,
`<standards_dir>/README.md`. See `lib/org-standards.sh:76-78` on
claude-code-plugins main: `dir=$(yaml_value
"$org/.claude/standards.yaml" standards_dir)` and
`index="$org/${dir:-docs/standards}"; index="${index%/}/README.md"`.
- The contract resolves each `File` relative to `<standards_dir>` first,
then from the repository root
(`docs/contracts/standards/README.md:90-92`).
- The eleven docs sit in two directories, `standards/engineering/` and
`standards/process/`. `standards/` is the nearest directory that holds
both, and its `README.md` already documents how the directory is
consumed.
- `components/engineering-standards/` can't be the index directory. Its
`README.md` is the component record, and the docs aren't there.

## Verification

- `STANDARDS_DIR=<worktree> bash lib/org-standards.sh index`
(claude-code-plugins main) prints `standards/README.md` and exits 0.
- Every `File` in the table exists under `standards/`: all eleven
checked.
- lefthook pre-commit passes: markdownlint, editorconfig, typos,
gitleaks and the remote lanes.

## Related

-
[claude-code-plugins#18969](melodic-software/claude-code-plugins#18969):
standards contract 1.2.0, the org layer.
-
[ci-workflows#1221](melodic-software/ci-workflows#1221):
pr-review-cli composes `REVIEW.md` over the org's.
- Retiring the `engineering-standards` and `filing-guide` components is
a later change. Once it lands, this index is the only one.

Refs: melodic-software/claude-code-plugins#18968

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/standards that referenced this pull request Nov 25, 2026
…1135)

No related issue: owner decisions Q296 and Q297 (architecture
docs/owner-decisions.md L424-425) authorize this retirement directly.

## Summary

Stops syncing three components whose readers now use the org layer read
from this repository's `main`:

- `engineering-standards` and `filing-guide` (the `docs/standards/`
docs), now read through the org standards index at
`standards/README.md`;
- `review-instructions` (`REVIEW.md`), now composed by the review lanes
as the org base beneath a repository's own `REVIEW.md`.

This is the manifest step of the retirement procedure
(`distribution/README.md` Lifecycle "Retire" row,
`docs/component-lifecycle.md` "Retirement"): upstream ownership goes
first, and deselection never deletes. Each target deletes its copies
later in its own pull request.

## Fix

- `distribution/sync-manifest.yml`: removes the three component entries,
the `requires: filing-guide` edge on `engineering-standards`, every
target's `managed` entry for them, and medley's `locally-owned`
`review-instructions`. Comments that named them are updated. The
managed-files guard resolves destinations at run time, so it holds no
static path list to prune.
- Deletes `components/engineering-standards/` (`standards-index.md`,
which duplicated the index rows now in `standards/README.md`, and its
README). `standards/README.md`'s index points into
`standards/engineering/` and `standards/process/`, not into that
directory, so no link dangles.
- `distribution/README.md`: removes the obsolete "Review-instructions
reconciliation (medley)" section and rewrites the root-files paragraph
that named `review-instructions`.
- `components/code-review-rules/README.md`: the default pointer line is
now the canonical URL form; a repository that keeps its own `REVIEW.md`
links it in-repo as its additions. The check script already enforces
exactly that split (URL when there is no root `REVIEW.md`), so it is
unchanged.
- `standards/README.md`, `AGENTS.md`, `components/pr-convention-policy/`
(README, including the `filing-guide` admission-evidence block, and the
`contract-docs.mjs` header comment),
`components/issue-body-contract/README.md`,
`distribution/REVIEW-CREDENTIAL.md`, `standards/review/README.md`:
wording that described the synced copies.
- `distribution/sync-manifest.test.sh`: the three per-component
assertions become "no component named X exists (retired)" assertions,
beside the existing `agent-orientation` one.

## Verification

- `distribution/sync-manifest.sh validate`: `Manifest valid: 47
components, 19 targets`.
- `bash distribution/sync-manifest.test.sh`: exit 0, all 326 assertions
pass, including the four retired-component assertions.
- `code-review-rules.test.sh` passes; `code-review-rules.sh file` passes
on this repository's `AGENTS.md`.
- `npm run lint:contract-docs` and `npm run test:contract-docs` pass.
- markdownlint: 0 issues across the 8 changed docs. `lychee --offline`:
0 errors. The pre-commit hooks (typos, gitleaks, shellcheck and the
rest) pass.

## Loosened checks

`distribution/sync-manifest.test.sh` removes four assertions. The reason
for each is the same: the components are retired under owner decisions
Q296 (L1) and Q297 (L2), melodic-software/architecture
`docs/owner-decisions.md` L424-425, owner words "OK go w/
recommendations". An assertion about which targets a retired component
reaches has nothing left to check.

- `REVIEW.md reaches every enrolled ci-workflows-reviewable target,
public and private alike` (the exact 13-target list for
`review-instructions`): replaced by `no component named
review-instructions exists (retired)`. Review lanes now read `REVIEW.md`
from this repository's `main` as the org base.
- `medley locally-owns review-instructions rather than
whole-file-managing it`: replaced by the same `review-instructions`
retired assertion. With the component gone, medley's `REVIEW.md` is its
own file and no ownership label applies.
- `medley's managed list does not also claim review-instructions`:
replaced by the same retired assertion. A target that listed
`review-instructions` again would also fail `sync-manifest.sh validate`
as an unknown component.
- The standalone `no component named agent-orientation exists
(retired)`: not loosened. It moved into the retired-component loop,
which still asserts it under the same name (`PASS: [157]` in the local
run).

Each retired assertion fails if the name reappears. On the real
manifest, the loop's expression `[.components | keys[] | select(. ==
strenv(COMPONENT))] | length` counts 0 for all four names. On a copy
with each name re-added under `components`, it counts 1, so `assert_eq
... '0'` fails.

## Related

- Owner decisions Q296 (L1) and Q297 (L2) in
melodic-software/architecture `docs/owner-decisions.md` L424-425, owner
words "OK go w/ recommendations". Q297 holds only while no repository
uses GitHub's managed Code Review service.
- Readers moved first: melodic-software/claude-code-plugins#18969
(standards contract and review lanes read from standards main),
#1134 (org index at `standards/README.md` via
`.claude/standards.yaml`), melodic-software/ci-workflows#1221 and
melodic-software/ci-workflows#1222 (the CLI and hosted review lanes
compose the base). This PR should merge after #1221 and #1222.
- Next: one deletion PR per target, removing its `docs/standards/`
copies and `REVIEW.md` and fixing the readers that link them.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Read org standards and REVIEW.md from standards main as a layer

1 participant