Skip to content

yaml: KYAML for the estate-owned container config, with a ratchet (YAML-POLICY step 5) - #245

Merged
hyperpolymath merged 9 commits into
mainfrom
claude/new-session-ywdrth-kyaml
Oct 20, 2026
Merged

hyperpolymath merged 9 commits into
mainfrom
claude/new-session-ywdrth-kyaml

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Does the part of the KYAML migration (standards YAML-POLICY §3.4, §5 step 5, standards#1024) that policy allows right now in the template. It converts the three estate-owned, non-workflow YAML files that no third-party bot rewrites. It also adds a CI ratchet so the converted files stay KYAML. Every repository minted from the template inherits both.

Scope follows standards' own Self Test ratchet. These are deliberately not converted:

  • Workflows (.github/workflows/*.yml). They wait for step 6 (standards#1025). That step does not start until Dependabot and gh actions-lock emit KYAML, or until their drift is accepted in writing.
  • Files a third-party bot or tool reads by schema or rewrites: .github/dependabot.yml, FUNDING.yml, the issue forms, settings.yml (Probot), .coderabbit.yaml, .github/copilot/coding-agent.yml, ci/.gitlab-ci.yml and ci/.pre-commit-config.yaml. pre-commit autoupdate rewrites rev: lines in block style.

Changes

  • build/container/compose.yaml, compose.example.yaml and stapeln/.gatekeeper.yaml are now KYAML content. The names stay, because Compose, the Containerfile label and svalinn find these files by name (§3.4).
  • The only rewriter used was standards' scripts/kyaml-format.sh, the one the step-2 comment-preservation proof covers. It refuses any change to the parsed data.
  • .gatekeeper.yaml is now byte-identical to standards' _shared/container/.gatekeeper.yaml, which it copies.
  • Estate Rules gains Converted YAML stays KYAML. It runs kyaml-format.sh --check from standards 75bd599 with yq 4.53.3, both sha256-verified, so the template carries no copy of the formatter that could drift. A yq that cannot write KYAML makes the script exit 2 (red), never green.
  • Adds a CHANGELOG entry.

RSR Quality Checklist

Required

  • Tests pass
  • Code is formatted (KYAML via kyaml-format.sh)
  • Linter is clean (no new warnings or errors)
  • No banned language patterns (no Python YAML parser; yq only, D293)
  • No unsafe blocks without // SAFETY: comments
  • No banned functions
  • SPDX license headers present on all new/modified source files
  • No secrets, credentials, or .env files included

As Applicable

  • CHANGELOG or release notes updated

Testing

  • kyaml-format.sh raised no data-change refusal on any file. Comment lines are unchanged (31/31, 18/18, 59/59).
  • --check passes on the branch and is idempotent. It exits 1 on main's compose.yaml, so the ratchet can fail.
  • docker compose v5.6.0 config gives the same resolved config before and after:
    • for compose.example.yaml (absolute paths aside);
    • for compose.yaml after a simulated mint (placeholders substituted the way container.just does it).
    • Unminted compose.yaml fails validation on its {{SERVICE_NAME}} placeholder, the same way before and after.
  • The CI step was replayed locally: both pinned downloads passed sha256sum --check.
  • check-lock-sync.sh is in sync. No uses: was added.

Generated by Claude Code

Summary by CodeRabbit

  • Updates
    • Converted the container Compose configurations and Gatekeeper policy to KYAML syntax. Existing services, settings, security rules, and relationships are preserved.
  • Checks
    • Added automated checks to verify the converted configurations retain their data and formatting. Template files are required; files absent from a minted repository are skipped with a notice.

…ML-POLICY step 5)

Converts the three non-workflow YAML files that no third-party bot
rewrites, per standards YAML-POLICY §3.4 and §5 step 5 (standards#1024):

- build/container/compose.yaml
- build/container/compose.example.yaml
- build/container/stapeln/.gatekeeper.yaml

The rewriter is standards scripts/kyaml-format.sh alone, the one rewriter
the step-2 comment-preservation proof covers; it refuses any change to the
parsed data. Names stay (Compose, the Containerfile label and svalinn find
the files by name). .gatekeeper.yaml is now byte-identical to standards'
_shared/container/.gatekeeper.yaml, which it copies.

Estate Rules gains "Converted YAML stays KYAML": kyaml-format.sh --check
from standards 75bd599 with yq 4.53.3, both sha256-verified, so the
template carries no copy of the formatter.

Out of scope, as in standards' own ratchet: workflows (step 6,
standards#1025) and files a third-party bot or tool reads by schema or
rewrites (dependabot, FUNDING, issue forms, settings, CodeRabbit,
Copilot, GitLab CI, pre-commit).

Evidence: comment lines unchanged (31/31, 18/18, 59/59); --check idempotent;
--check exits 1 on main's compose.yaml (the ratchet can fail);
docker compose v5.6.0 config gives an identical resolved config before and
after, for compose.example.yaml and for a simulated mint of compose.yaml;
check-lock-sync.sh in sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: hyperpolymath/rsr-template-repo/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34ebdc7d-91e6-4802-b26a-381457537881
📥 Commits

Reviewing files that changed from the base of the PR and between 26b483a and d43f53e.

📒 Files selected for processing: 7
  • .github/workflows/estate-rules.yml
  • CHANGELOG.adoc
  • build/container/compose.example.yaml
  • build/container/compose.yaml
  • build/container/stapeln/.gatekeeper.yaml
  • tests/workflows/container_kyaml_test.sh
  • tests/workflows/kyaml_ratchet_test.sh
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 19, 2026 16:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T23:12:45.021222Z d43f53e New commits
ℹ️ 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.

Ported unchanged from #243 (93e38a0), whose net change it equals, so this
PR's workflows get past "Set up job". It no-ops once #243 merges.

GitHub's runner now rejects a lock record whose ref is its own SHA:

  Unable to resolve action `actions/checkout@3d3c42e…`: invalid lockfile
  pin. Run `gh actions-lock` to update the lockfile

Every job of Governance, Hypatia Security Scan, Mirror to Git Forges,
Rust CI and Secret Scanner failed at "Set up job" on main (84d4e99).

The six standards reusables move from 6a92510 to 75bd599. Standards'
own lock carries tag refs there (standards#1271, #1285), and
lock-selfcheck.sh reports 75bd599 self-consistent. relock-standards-pin.sh
at 75bd599 re-keyed this lock to it and copied those tags into the nine
action records that had a self-SHA ref (cache, checkout,
editorconfig-checker, setup-beam, codeql-action, setup-zig,
scorecard-action, rust-cache, ssh-agent). No commit value changes; each
tag was checked with git ls-remote to point at its recorded commit.

Only reusable-workflow records keep a SHA ref (cicd-suite x2 and
standards), the form standards' own lock uses.

(cherry picked from commit 93e38a0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t

Copy link
Copy Markdown
Owner Author

CI: why the standards-reusable jobs failed at "Set up job", and the fix ported

Governance, Secret Scanner, Hypatia, Mirror and Rust CI all stopped before any step ran:

Unable to resolve action `actions/checkout@3d3c42e5…`: invalid lockfile pin

This is not this PR's change. The standards reusables are pinned at 6a92510, whose own lock records actions/checkout with its SHA as ref:. The runner now rejects that, and main (84d4e99) fails identically. #243 is the fix: re-pin to 75bd599 and relock.

I ported its fix commit 93e38a0 unchanged as 8bc2c1a. It no-ops once #243 merges.

Checked locally on the new head:

  • check-lock-sync.sh: in sync.
  • validate-actions-lock.sh: passes.
  • validate-template.sh: 0 errors.
  • kyaml-format.sh --check on the three converted files: all KYAML.

Generated by Claude Code

@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: 8bc2c1a8c6

ℹ️ 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/estate-rules.yml Outdated
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

🤖 Coding Agent task started for unit test generation.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 19, 2026 20:51
The ratchet passed all three converted files to kyaml-format.sh by name.
container.just deletes them at mint: no-stapeln drops the gatekeeper
policy, a non-portable selection drops both Compose files, and
no-container drops all three. kyaml-format.sh then fails on the missing
files, so Estate Rules would be red in every narrowed mint.

The step now checks the converted files that exist. In the template
(archetypes/ present) a missing file is an error, so a file cannot drop out
of the ratchet silently. In a minted repository each removed file gets
a notice, and with none left the step says there is nothing to check.

kyaml_ratchet_test.sh (CodeRabbit, be95dda) runs the step on fixture trees
instead of this checkout: the template, the template missing a file, and
the four narrowings. It still propagates formatter exits 0, 1 and 2.
Against the old step it fails at "template missing a file".
container_kyaml_test.sh pins the template's own placeholders, which
container-init substitutes in a mint, so it now SKIPs outside the
template, the same archetypes/ check check-template-conformance.sh uses.
Estate Rules runs both tests.

standards_lock_test.sh is removed. It restated the standards pin and lock
records by hand, which check-lock-sync.sh and validate-actions-lock.sh
already check, and #243 dropped its twin.

Checked: both tests, check-lock-sync, validate-actions-lock (standards
75bd599), validate-template and validate_workflows pass. The new step
passes against the real kyaml-format.sh at 75bd599 on the template's
three files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

SonarCloud failed the quality gate on new code (Security Rating B) over
"Use '[[' instead of '['" in kyaml_ratchet_test.sh and
container_kyaml_test.sh. Both scripts run under bash, so every test,
including those in the mocked curl and sha256sum, now uses [[ ]]. Each
comparison is quoted or literal, so no test changes meaning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

🤖 Coding Agent task started for unit test generation.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Owner Author

SonarCloud still fails "B Security Rating on New Code" on 98d59dd.

26b483a cleared every failure-level annotation (the [ → [[ findings). Nine annotations remain, all warnings:

  • naming: lower-case exported variables in kyaml_ratchet_test.sh
  • "Assign this positional parameter to a local variable" (kyaml_ratchet_test.sh 148 and 157, container_kyaml_test.sh 29)
  • a repeated "service_healthy" literal
  • "Make sure that using clear-text protocols is safe here" at container_kyaml_test.sh:121

The last is the only one with a security flavour. It is the assertion that the minted ROKUR_BACKEND is http://demo-api:$port, the plain hop inside the Compose network behind svalinn's TLS. The test has to assert that value. Rewriting the string so the scanner misses it would hide the finding, not fix it.

I can't confirm which issue sets the rating: sonarcloud.io is outside this session's network policy, so the issue list is unreadable here. Blocked until that's readable or the issue is reviewed in SonarCloud. I've asked the owner. Everything else on this head is green or still running. CodeRabbit's 98d59dd tests pass locally and are already Estate Rules steps.


Generated by Claude Code

#244 landed on main (b4d19ee). It and this branch both appended Estate
Rules steps after the conformance self-test and a Changed entry to the
changelog. Both sides are kept: main's governance steps come first, then
the KYAML install, ratchet and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

#249 landed on main (6a8bd11). It and this branch each added a Changed
entry at the top of the changelog. Both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

🤖 Coding Agent task started for unit test generation.

@hyperpolymath
hyperpolymath merged commit 4bc92ec into main Oct 20, 2026
70 of 71 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-ywdrth-kyaml branch October 20, 2026 00:32
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.

2 participants