Skip to content

fix(rhodibot): refuse unknown (rsr-profile) sub-clauses; read (layout …) - #687

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/determined-fermi-h8ojbr
Nov 17, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
claude/determined-fermi-h8ojbr

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to metadatastician/standards#1630 (owner ruling 2026-11-16, made while working on hyperpolymath/rsr-template-repo#421). That PR adds (layout (module :gate "<row>" :at ("<path>" …))) to (rsr-profile …).

What was wrong

J39 (standards A7) says every reader of (rsr-profile …) fails closed on a key the standards module does not define. Deed::rsr_profile checked only :keyword atoms. Any sub-clause, known or not ((extras …), now (layout …)), was skipped silently. A list after a scalar key, and a repeated key, also slipped through (Codex P1, fixed in e44f179).

Change (bots/rhodibot/src/deed.rs)

  • Only a list after a list key (:capabilities, :add, :remove) is that key's value. Any other list is a sub-clause, and it must be one of RSR_PROFILE_CLAUSES = ["notes", "layout"], each at most once. That is the order deed_lint.js --rsr-profile-keys prints them in.

  • Each key appears once, and its value is checked as the walk reaches it. A list key takes a list. Every other key takes one string or symbol, never a list, a following :keyword, or nothing.

  • (layout …) is read into ProfileClause.layout. This reader checks:

    • :gate is a non-empty string, and each gate appears once;
    • :at is a non-empty list of strings;
    • a module carries :gate and :at only, each once.

    Whether a gate names a real gate-table row, and what each path must be, stays with standards check-rsr-profile.sh and deed_lint.js --rsr-profile.

  • rhodibot canon does not score module paths, so its verdicts are unchanged.

Evidence

  • cargo test: 249 passed (lib 179). cargo fmt --check and cargo clippy --all-targets -- -D warnings are clean.
  • Mutation check: replacing the sub-clause refusal with true fails an_unknown_sub_clause_is_refused_not_skipped.
  • a_list_after_a_scalar_key_is_refused and a_list_key_takes_a_list_value fail before e44f179 and pass after it.
  • rhodibot canon --path on rsr-template-repo branch claude/determined-fermi-h8ojbr, whose deed carries (layout): reads the profile, 12 declared capabilities. On standards: unchanged, 5 declared.
  • CI on e44f179: all green.

Merge order

Any order is safe. This accepts (layout) with or without standards#1630, and it refuses only sub-clauses that the old and new standards modules both refuse.

Follow-up: moved

  • rhodibot still scores retired .a2ml paths (11 high-severity findings on ci(hypatia): pin the scanner to hypatia main 6d8ab66 echo-types#378). Moved. The owner made .a2ml retirement a priority-1, bot-driven task through kyX (D313). That task now belongs to the session "gitbot-fleet: fix red main + P1 auto-retire .a2ml via kyX", including reversing rhodibot's .a2ml expectation. This PR stays limited to deed-clause reading. Leads handed over:
    • bots/rhodibot/canon/rsr-criteria-v2.a2ml still names .a2ml paths;
    • src/canon/overlay.rs has no deed form for CLADE (3.1.9);
    • src/canon/local.rs keeps the legacy rsr-profile.a2ml read fallback.

Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Profiles can now include layout bindings that associate a named gate with one or more paths.
  • Bug Fixes
    • Profile data is checked more strictly: duplicate entries, invalid value types, unknown clauses, and incomplete or malformed layouts are rejected.

J39 (standards A7) says every reader of (rsr-profile …) fails closed on a
key the standards module does not define. rhodibot checked :keyword atoms
only, so an unknown sub-clause such as (extras …) was skipped silently.

* A list that does not follow a :keyword is a sub-clause, and must be one
  of RSR_PROFILE_CLAUSES = ["notes", "layout"], each at most once
  (deed_lint.js --rsr-profile-keys order, metadatastician/standards#1630).
* (layout (module :gate "<row>" :at ("<path>" …))) is read into
  ProfileClause.layout. Its shape and keys are checked here (non-empty
  string :gate, non-empty string-list :at, :gate and :at only and once,
  each gate once); whether a gate names a real gate-table row, and what a
  path must be, stays with standards check-rsr-profile.sh. rhodibot's
  canon command does not score module paths, so its verdicts are unchanged.

Tests: clause set pinned to the module's, unknown sub-clause refused, a
list value after a key is not a sub-clause, the template's binding is
read, eleven malformed layouts refused. cargo test (247), fmt, clippy
-D warnings clean; removing the refusal fails the new test.

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

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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T00:56:13.651264Z e44f179 New commits
🔒 Security Review ❌ Failed 2026-11-17T00:53:41.156400Z
We couldn’t complete this review. Comment @codex security review to try again.
e44f179 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.

Repository owner deleted a comment from coderabbitai Bot Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The profile parser now validates profile fields and sub-clauses. It parses layout bindings into ProfileClause and rejects unknown, repeated, or malformed entries.

Changes: Profile layout parsing

Layer / File(s) Summary
Profile clause and layout validation
bots/rhodibot/src/deed.rs
The parser validates list and scalar values, rejects repeated keys and unsupported sub-clauses, and parses layout bindings with unique non-empty :gate values and non-empty :at lists. ProfileClause now includes the parsed bindings. Tests cover valid layouts and malformed profile and layout inputs.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Possibly related PRs

  • hyperpolymath/gitbot-fleet#678: Adds the deed reader for (rsr-profile …) that this change updates to validate profile fields and parse layout bindings.
Merge Risk: Minimal · up to c50c0

This change makes the profile reader refuse unknown or malformed sub-clauses and read (layout …) bindings. No concrete merge-blocking problem was identified in the supplied change, and it appears ready to merge under normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes: refusing unknown (rsr-profile) sub-clauses and reading (layout ...) into ProfileClause. The raw summary confirms both. The title is specific and matches the chang…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: refusing unknown (rsr-profile) sub-clauses and reading (layout ...) into ProfileClause. The raw summary confirms both. The title is specific and matches the changeset. The fix(rhodibot) prefix is a scope tag, and the title is one line.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 418ccfa and c50c097.

Files selected for processing: 1

  • bots/rhodibot/src/deed.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 17, 2026

@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: 418ccfa82c

ℹ️ 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 bots/rhodibot/src/deed.rs Resolved
Codex on #687 (P1): the sub-clause check exempted any list that followed a
:keyword, so (rsr-profile :preset (extras :x "y")) passed. The list
satisfied the :capabilities-or-:preset requirement, word(":preset") turned
it into None, and the profile resolved to no capabilities, switching every
gated check off.

* Only a list after a list key (:capabilities, :add, :remove) is a value;
  any other list is a sub-clause and must be (notes) or (layout).
* A list key must take a list; every other key takes one string or symbol,
  never a list, a following :keyword or nothing.
* Each key appears once: field() read only the first, so a second
  :capabilities was silently ignored.

Tests: a_list_after_a_scalar_key_is_refused and
a_list_key_takes_a_list_value both failed before this change and pass
after. cargo test 249, fmt, clippy -D warnings clean; the template and
standards deeds still resolve to 12 and 5 declared capabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDhtp4kVy7MGgY47YB3
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
…ired forms (#690)

## Why

The owner's directive (2026-11-17): rid the estate of A2ML, and make any
`.a2ml` a **priority-1** finding in the relevant bots, starting with
rhodibot. Today rhodibot reports a legacy `.a2ml` only as `relocated` (→
**info** on the grid), and its GitHub App check still *demanded*
`.machine_readable/bot_directives/`, a directory whose files were
`.a2ml`.

## What

**`canon` (the report-back path)**
- New severity **`retired`**, ranked above `missing`. Every tracked
`*.a2ml` becomes one `rhodibot.no-a2ml` finding (tier `P1`) **at its own
path**, so the grid can place it against a change.
- Each finding names the deed form its family maps to (from the
standards mapping specs) and whether kyX can convert it today. Only
`ECOSYSTEM.a2ml` can (D313). A finding never asks for an `.a2ml` and
never suggests hand conversion.
- Adds `counts.retired`, a `P1:` summary line, and `--fail-on retired`.
- The legacy *read* fallback is unchanged: the criterion an old file
would satisfy is still "migrate", never "missing" (CLAUDE.md invariant
1).

**GitHub App check (`rsr.rs`)**
- **`no-*.a2ml` (RSR-A2ML-001)**: any `.a2ml` in the default-branch tree
is a **Required failure under every policy pack**, and `.rsr.toml`
cannot skip or downgrade it.
- An unlistable or truncated tree becomes a `Skip` that names the
reason, never a pass.
- **RSR-015 is retired**: demanding `.machine_readable/bot_directives/`
was demanding a retired form, since bot directives are now the deed's
`(bot-directives …)` clause. The legacy `.bot_directives/` advice now
points at that clause.

**Report-back:** `retired` → **`critical`**, above `error` (high).

## Dogfood: `rhodibot canon --path .` on this repo

**42 P1 findings**, worst first. Only **3** (the ECOSYSTEM files) can be
routed to kyX. The other 39 (CLADE, STATE, META, AGENTIC, contractiles,
bot directives, session logs, the vendored canon…) have no kyX front
end, or no mapping spec at all. `--fail-on retired` exits 1 here and 0
on a clean tree.

rhodibot is enrolled here **without `gating`**, so these show on this
repo's grid as advisory and don't block.

## Validation (local)
- rhodibot: **250 tests pass**, with 8 new ones: every family, ranking,
fail-on, all five policy packs, a clean tree, an unlistable tree, and
RSR-015 retired. clippy `-D warnings` is clean, rustfmt is clean, and
`check-canon-drift.sh` is OK.
- `tests/fleet-report-back-test.sh`: **214 passed**, including new
checks that `retired` → `critical` and that the finding is placed at its
path. The build test: 69 passed.

## Coordination
`bots/rhodibot/src/deed.rs` is untouched. #687 owns it, so the two merge
independently.

## Rollout note
Repos that call `fleet-report-back-reusable.yml` at an older fleet SHA
keep the old behaviour. The P1 rule reaches them only when their pin
moves; the rollout options are in the companion fixer PR.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01J4QvDhFeexmokLqLRfZNce)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath added a commit to metadatastician/standards that referenced this pull request Nov 17, 2026
…t …) (#1630)

Owner ruling 2026-11-16 (hyperpolymath/rsr-template-repo#421):
`check-rsr-profile.sh` reads the paths it requires from the repo deed's
`(rsr-profile)` clause instead of hard-coding them, so a repo's layout
and its check cannot drift apart.

## Design (owner-selected: the `(layout)` binding)

`clauses/rsr-profile.abnf` v1.1.0 adds:

```
(layout
  (module :gate "abi.ipkg" :at ("src/interface/abi.ipkg")))
```

The gate table still says **what** a capability owes and its default
location. A binding says **where** this tree keeps it. `:gate` names a
`[gates]` row by one of its alternatives, written exactly as the table
writes it.

`check-rsr-profile.sh` applies these rules on both the awk and the AST
parser paths:

| Case | Verdict |
|---|---|
| capability declared, bound path present | `bound by (layout): <row> ->
<path>` |
| capability declared, a bound path absent | **MISSING** (exit 1). The
row's defaults are not consulted, because the deed is authoritative. |
| capability undeclared, bound path present | **VESTIGIAL** (`[carrier]`
still exempts a spine) |
| capability undeclared, bound path absent | **STALE** (exit 1): the
binding names nothing |
| bound path of a different kind (another file name, or a file for a
directory row) | refused (exit 2) |
| `:gate` names no `[gates]` row, a `[baseline]` row, or one row twice |
refused (exit 2) |
| `:at` absolute, with `.`/`..`/empty segments, a pattern, or an escape
| refused (exit 2) |

Shape obligations follow the artefact, not its row. A bound
Containerfile must be non-empty, and a bound formal-proofs directory
must hold prover sources. No carrier exemption excuses a missing bound
path. The check never weakens: a binding only replaces the default
locations of a row the repo declares, and it is held to the same kind of
artefact.

`deed_lint.js --rsr-profile` owns the new keys (J39).
`--rsr-profile-keys` now prints `(layout)`, and `(module …)` takes
`:gate` and `:at` only.

**Not a canon release.** The gate table and every `canon.lock` artefact
are byte-unchanged.

## Evidence (run locally)

- `bash scripts/tests/check-rsr-profile-test.sh`: awk 80/80, AST 82/82
(was 51/53), plus current-layout controls 29/29. That is 29 new controls
under each parser. The commit message says "34"; that count is wrong,
and 29 is correct.
- Mutation check of the new controls. Each mutation turns some controls
red: `present_at` always true (7 red), no name/kind check (2), STALE
ignored (1), bound rows falling through to defaults (4), unknown gate
accepted (2).
- `bun test deed_lint.test.js`: 335/335. `--rsr-profile-fixtures`: OK,
with 21 new fixtures (2 valid, 19 invalid).
- `tools/deed-abnf-differential`: `deed_lint.js and deed.abnf agree`.
The new invalid fixtures are classified grammar-rejected or
semantic-only.
- Self-conformance (`check-rsr-profile.sh .`) still passes under both
parsers.
- shellcheck 0.10.0 `-S warning`: clean.
- Against hyperpolymath/rsr-template-repo branch
`claude/determined-fermi-h8ojbr`: **OK** (AST path). Against a fixture
whose bound path is missing: **MISSING**, exit 1.

## Downstream (not in this PR)

- **gitbot-fleet / rhodibot**: hyperpolymath/gitbot-fleet#687.
- *Correction:* an earlier version of this description said rhodibot's
key-set test would go red once this merges. It will not. Nothing
compares rhodibot's list against `--rsr-profile-keys` at run time; its
test pins a hard-coded list of `:keys` only.
- The real gap was that rhodibot skipped every sub-clause silently,
against J39. #687 refuses unknown sub-clauses and reads `(layout)`. It
is safe to merge in any order.
- **hypatia** reads only `capabilities`, so it is unaffected as far as I
can see. Not verified by running it.
- **A2ML spellings** still in the gate table's `[baseline]`: tracked for
a canon PATCH in #1631.
- **Merge order:** this PR first, then
hyperpolymath/rsr-template-repo#427. An older checker refuses `(layout)`
as an unknown key.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01J4QvDhtp4kVy7MGgY47YB3)_

Co-authored-by: Claude <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 17, 2026
@hyperpolymath
hyperpolymath merged commit e53ef2f into main Nov 17, 2026
68 checks passed
@hyperpolymath
hyperpolymath deleted the claude/determined-fermi-h8ojbr branch November 17, 2026 20:35
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.

3 participants