Skip to content

Commit 7907099

Browse files
feat(rhodibot): any .a2ml is a priority-1 finding; stop expecting retired 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>
1 parent af2bd27 commit 7907099

14 files changed

Lines changed: 753 additions & 50 deletions

File tree

‎bots/rhodibot/README.adoc‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,12 @@ Each RSR check has a severity (Required, Recommended, Optional) that varies by p
104104
| CONTRIBUTING.md | Optional | Recommended | Required | Required
105105
| CODE_OF_CONDUCT.md | Optional | Optional | Recommended | Required
106106
| .claude/CLAUDE.md | Optional | Optional | Recommended | Required
107-
| STATE.scm | Optional | Recommended | Required | Required
108-
| META.scm | Optional | Recommended | Required | Required
109-
| ECOSYSTEM.scm | Optional | Optional | Recommended | Required
107+
| `<repo>_chora.deed` | Optional | Recommended | Required | Required
110108
| .editorconfig | Optional | Recommended | Required | Required
111109
| .gitattributes | Optional | Recommended | Required | Required
112110
| .gitignore | Optional | Recommended | Required | Required
113111
| Justfile | Optional | Optional | Recommended | Required
114-
| .bot_directives | Optional | Optional | Recommended | Required
112+
| any `*.a2ml` (`no-*.a2ml`, P1) | Required | Required | Required | Required
115113
|===
116114

117115
Repositories can override severity or skip checks entirely via `.rsr.toml`:
@@ -205,9 +203,11 @@ Options:
205203
| .gitattributes | Structure | 2
206204
| .gitignore | Structure | 2
207205
| Justfile | Structure | 2
208-
| .bot_directives | Structure | 2
209206
|===
210207

208+
RSR-015 (`.machine_readable/bot_directives/`) is retired: its files were `.a2ml`, and
209+
the bot directives are the chora deed's `(bot-directives ...)` clause.
210+
211211
=== Banned Patterns (6)
212212

213213
[cols="2,3"]
@@ -235,9 +235,23 @@ A2ML is retired. The repo facts that used to be `.a2ml` files (manifest, state,
235235
meta, ecosystem, agentic, neurosym, playbook, anchor, rsr-profile) are clauses of
236236
`<repo>_chora.deed`, or of a descriptile deed (`STATE.deed`, `META.deed`,
237237
`ECOSYSTEM.deed`, `AGENTIC.deed`). Rhodibot requires the chora deed and never
238-
demands or suggests an `.a2ml` file. A legacy `.a2ml` that is still present is
239-
read only as a fallback after the deed, and is reported as "migrate", never as
240-
"missing". Whether a deed *conforms* is `deed_lint.js`'s job in
238+
demands or suggests an `.a2ml` file.
239+
240+
*Any `.a2ml` file is a priority-1 finding.* `canon` reports each tracked `.a2ml`
241+
as `rhodibot.no-a2ml` with severity `retired` (above `missing`; `--fail-on
242+
retired` gates on it), naming the deed form its family maps to under the
243+
standards mapping specs and whether kyX can convert it today (only
244+
`ECOSYSTEM.a2ml`, D313). The fleet report-back carries it as `critical`. The
245+
GitHub App check reports `no-*.a2ml` (RSR-A2ML-001) as a Required failure in every
246+
policy pack; `.rsr.toml` cannot skip or downgrade it, it scans the push or PR
247+
head it reports on, and a tree it cannot list fails it closed. Rhodibot only
248+
reports: conversion is kyX's (`kyx a2ml ecosystem SRC --chora CHORA ...`, D313),
249+
run by the fleet's opportunistic fixer once that lands (proposed in #691), never
250+
by hand.
251+
252+
Separately, a legacy `.a2ml` that is still present is read only as a fallback
253+
after the deed, and the criterion it would satisfy is reported as "migrate",
254+
never as "missing". Whether a deed *conforms* is `deed_lint.js`'s job in
241255
`metadatastician/standards`; rhodibot only reads its structure.
242256

243257
The vendored criteria canon is itself still an `.a2ml` file; its deed form is a

‎bots/rhodibot/src/canon.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
//! The failure mode to avoid is the quiet one: a rule set that silently shrinks
4040
//! and reports every repository as compliant.
4141
42+
pub mod a2ml;
4243
pub mod local;
4344
pub mod overlay;
4445
pub mod profile;

‎bots/rhodibot/src/canon/a2ml.rs‎

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
// SPDX-License-Identifier: MPL-2.0
2+
3+
//! Any `.a2ml` file is a priority-1 finding.
4+
//!
5+
//! A2ML is retired (owner rulings D99, D269c, D312, D313): no `.a2ml` file
6+
//! should exist anywhere in a repository. Rhodibot used to *expect* some of
7+
//! them; now every tracked `*.a2ml` is reported as [`Severity::Retired`], the
8+
//! worst a canon report holds, one finding per file so a grid can place each
9+
//! one against a change.
10+
//!
11+
//! Each finding names the form the file's facts belong in, from the standards
12+
//! mapping specs (`metadatastician/standards` `1-formats/deed/mappings/`), and
13+
//! says how it gets there: conversion is kyX's front end (D313), never a hand
14+
//! conversion, and a family with no mapping spec waits for one. Rhodibot only
15+
//! reports; the fleet's `fix-a2ml-via-kyx.sh` is what tries the conversion.
16+
//!
17+
//! This is the report, not the read path: the legacy read fallback in
18+
//! [`super::overlay`] (a legacy file read as "migrate" when its deed form is
19+
//! absent) is unchanged.
20+
21+
use super::report::Finding;
22+
use super::verdict::Severity;
23+
24+
/// The finding id. Not a canon criterion: a rhodibot rule on top of it.
25+
pub const NO_A2ML_ID: &str = "rhodibot.no-a2ml";
26+
27+
/// Where one A2ML family's facts go, and whether kyX can take them there.
28+
#[derive(Debug, Clone, PartialEq, Eq)]
29+
pub struct Destination {
30+
/// The deed form, as a report names it.
31+
pub form: &'static str,
32+
/// The mapping spec that decides it, or `None` when there is none yet.
33+
pub spec: Option<&'static str>,
34+
/// Whether kyX has a front end for the family today.
35+
pub kyx: bool,
36+
}
37+
38+
/// The family a path belongs to, by its file name (and, for bot directives and
39+
/// contractiles, its directory).
40+
pub fn destination(path: &str) -> Destination {
41+
let lower = path.to_ascii_lowercase();
42+
let name = lower.rsplit('/').next().unwrap_or(&lower);
43+
let d = |form, spec, kyx| Destination { form, spec, kyx };
44+
match name {
45+
"ecosystem.a2ml" => d(
46+
".machine_readable/descriptiles/ECOSYSTEM.deed, or the chora (ecosystem ...) clause",
47+
Some("meta-ecosystem-to-repo-deed.adoc"),
48+
true,
49+
),
50+
"meta.a2ml" => d(
51+
".machine_readable/descriptiles/META.deed, or the chora (meta ...) clause",
52+
Some("meta-ecosystem-to-repo-deed.adoc"),
53+
false,
54+
),
55+
"state.a2ml" => d(
56+
".machine_readable/descriptiles/STATE.deed, or the chora (status ...) clause",
57+
Some("state-v1-decision.adoc"),
58+
false,
59+
),
60+
"agentic.a2ml" | "neurosym.a2ml" | "playbook.a2ml" => d(
61+
"the chora (agentic ...) / (neurosym ...) / (playbook ...) clause",
62+
Some("agentic-neurosym-playbook-to-repo-deed.adoc"),
63+
false,
64+
),
65+
"clade.a2ml" => d(
66+
"the chora (identity ...) (clade ...) (forges ...) (lineage ...) clauses",
67+
Some("clade-to-repo-deed.adoc"),
68+
false,
69+
),
70+
"0-ai-manifest.a2ml" => d(
71+
"the chora (manifest ...) clause",
72+
Some("ai-manifest-decision.adoc"),
73+
false,
74+
),
75+
"anchor.a2ml" => d("the chora (anchor ...) clause", None, false),
76+
"rsr-profile.a2ml" => d("the chora (rsr-profile ...) clause", None, false),
77+
"rsr-criteria-v2.a2ml" => d(
78+
"a criteria praxis deed",
79+
Some("rsr-criteria-to-praxis-deed.adoc"),
80+
false,
81+
),
82+
_ if lower.contains("bot_directives/") => {
83+
d("the chora (bot-directives ...) clause", None, false)
84+
}
85+
_ if name.ends_with("file.a2ml") && lower.contains("contractiles/") => d(
86+
"a contractile deed (<Verb>file.deed) attesting its .k9.ncl contract",
87+
None,
88+
false,
89+
),
90+
_ => d("a deed form a mapping spec has yet to decide", None, false),
91+
}
92+
}
93+
94+
/// Whether a tracked path is an A2ML file.
95+
pub fn is_a2ml(path: &str) -> bool {
96+
path.to_ascii_lowercase().ends_with(".a2ml")
97+
}
98+
99+
/// One [`Severity::Retired`] finding per `.a2ml` file, in path order.
100+
pub fn findings(files: &[String]) -> Vec<Finding> {
101+
let mut paths: Vec<&String> = files.iter().filter(|p| is_a2ml(p)).collect();
102+
paths.sort();
103+
paths.dedup();
104+
paths
105+
.into_iter()
106+
.map(|path| {
107+
let dest = destination(path);
108+
let how = match (dest.spec, dest.kyx) {
109+
(Some(spec), true) => format!(
110+
"convert it with kyX under {spec} (D313); a refusal is a P1 issue, never a \
111+
hand conversion"
112+
),
113+
(Some(spec), false) => format!(
114+
"{spec} decides it, but kyX has no front end for it yet: it waits for kyX \
115+
(D313); do not hand-convert"
116+
),
117+
(None, _) => "no mapping spec decides it yet: it waits for one and for kyX \
118+
(D313); do not hand-convert"
119+
.to_string(),
120+
};
121+
Finding {
122+
id: NO_A2ML_ID.to_string(),
123+
name: "A2ML is retired (D99, D269c, D312, D313)".to_string(),
124+
tier: "P1".to_string(),
125+
severity: Severity::Retired,
126+
canon_keeps_it_at: None,
127+
expected: vec![dest.form.to_string()],
128+
found: vec![path.clone()],
129+
deprecated_copies: Vec::new(),
130+
details: vec![format!(
131+
"{path}: retired A2ML; its facts belong in {}; {how}",
132+
dest.form
133+
)],
134+
}
135+
})
136+
.collect()
137+
}
138+
139+
#[cfg(test)]
140+
mod tests {
141+
use super::*;
142+
143+
fn files(paths: &[&str]) -> Vec<String> {
144+
paths.iter().map(|p| p.to_string()).collect()
145+
}
146+
147+
#[test]
148+
fn every_a2ml_is_one_retired_finding_and_nothing_else_is() {
149+
let got = findings(&files(&[
150+
"README.adoc",
151+
".machine_readable/descriptiles/STATE.a2ml",
152+
"0-AI-MANIFEST.a2ml",
153+
"x_chora.deed",
154+
"deep/nested/Thing.A2ML",
155+
".machine_readable/descriptiles/STATE.a2ml",
156+
]));
157+
let paths: Vec<&str> = got.iter().map(|f| f.found[0].as_str()).collect();
158+
assert_eq!(
159+
paths,
160+
[
161+
".machine_readable/descriptiles/STATE.a2ml",
162+
"0-AI-MANIFEST.a2ml",
163+
"deep/nested/Thing.A2ML"
164+
]
165+
);
166+
for f in &got {
167+
assert_eq!(f.severity, Severity::Retired);
168+
assert_eq!(f.id, NO_A2ML_ID);
169+
assert_eq!(f.tier, "P1");
170+
// Never asks for an .a2ml, never suggests a hand conversion.
171+
assert!(f.expected.iter().all(|e| !e.ends_with(".a2ml")), "{f:?}");
172+
assert!(f.details[0].contains("D313"), "{f:?}");
173+
}
174+
}
175+
176+
#[test]
177+
fn only_ecosystem_is_routed_to_kyx_today() {
178+
assert!(destination(".machine_readable/descriptiles/ECOSYSTEM.a2ml").kyx);
179+
assert!(destination(".machine_readable/6a2/ECOSYSTEM.a2ml").kyx);
180+
for path in [
181+
"STATE.a2ml",
182+
"META.a2ml",
183+
"AGENTIC.a2ml",
184+
"CLADE.a2ml",
185+
"0-AI-MANIFEST.a2ml",
186+
".machine_readable/bot_directives/coverage.a2ml",
187+
"contractiles/must/Mustfile.a2ml",
188+
"audits/assail-classifications.a2ml",
189+
] {
190+
assert!(!destination(path).kyx, "{path}");
191+
}
192+
}
193+
194+
#[test]
195+
fn families_name_their_deed_form() {
196+
assert!(
197+
destination("x/bot_directives/debt.a2ml")
198+
.form
199+
.contains("(bot-directives")
200+
);
201+
assert!(
202+
destination("contractiles/trust/Trustfile.a2ml")
203+
.form
204+
.contains("contractile deed")
205+
);
206+
assert!(destination("STATE.a2ml").form.contains("STATE.deed"));
207+
assert_eq!(destination("odd.a2ml").spec, None);
208+
// A name ending in "file" outside a contractiles directory is not a
209+
// contractile: it waits for a mapping spec like any other stray file.
210+
for stray in ["docs/profile.a2ml", "data/myfile.a2ml"] {
211+
assert!(
212+
destination(stray).form.contains("yet to decide"),
213+
"{stray}: {}",
214+
destination(stray).form
215+
);
216+
}
217+
}
218+
219+
#[test]
220+
fn a_finding_says_ecosystem_goes_through_kyx_and_others_wait() {
221+
let got = findings(&files(&["ECOSYSTEM.a2ml", "META.a2ml", "odd.a2ml"]));
222+
assert!(
223+
got[0].details[0].contains("convert it with kyX"),
224+
"{:?}",
225+
got[0]
226+
);
227+
assert!(got[1].details[0].contains("waits for kyX"), "{:?}", got[1]);
228+
assert!(
229+
got[2].details[0].contains("no mapping spec"),
230+
"{:?}",
231+
got[2]
232+
);
233+
}
234+
}

‎bots/rhodibot/src/canon/local.rs‎

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,22 @@ fn tracked_files(root: &Path) -> Option<Vec<String>> {
113113
.arg("-C")
114114
.arg(root)
115115
.arg("ls-files")
116+
.arg("-z")
116117
.output()
117118
.ok()?;
118119

119120
if !output.status.success() {
120121
return None;
121122
}
122123

123-
let listing = String::from_utf8(output.stdout).ok()?;
124-
let mut files: Vec<String> = listing
125-
.lines()
126-
.map(str::trim)
127-
.filter(|line| !line.is_empty())
128-
.map(str::to_string)
124+
// NUL-separated and raw: without `-z`, git C-quotes an unusual name (a
125+
// newline, a quote, non-ASCII), and a quoted `"x.a2ml"` would slip past a
126+
// suffix test. A name that is not UTF-8 is kept, lossily, rather than lost.
127+
let mut files: Vec<String> = output
128+
.stdout
129+
.split(|b| *b == 0)
130+
.filter(|name| !name.is_empty())
131+
.map(|name| String::from_utf8_lossy(name).into_owned())
129132
.collect();
130133
files.sort();
131134
files.dedup();
@@ -229,6 +232,30 @@ mod tests {
229232
);
230233
}
231234

235+
#[test]
236+
fn git_listing_keeps_unusual_names_raw() {
237+
// Without `ls-files -z`, git C-quotes a name with a newline in it and
238+
// the quoted form no longer ends in `.a2ml`.
239+
let scratch = Scratch::new("ls-files-z");
240+
scratch.write("evil\nname.a2ml", "x");
241+
scratch.write("plain.adoc", "x");
242+
let git = |args: &[&str]| {
243+
let ok = Command::new("git")
244+
.arg("-C")
245+
.arg(scratch.path())
246+
.args(args)
247+
.output()
248+
.map(|o| o.status.success())
249+
.unwrap_or(false);
250+
assert!(ok, "git {args:?}");
251+
};
252+
git(&["init", "-q"]);
253+
git(&["add", "-A"]);
254+
let files = tracked_files(scratch.path()).expect("git can list the index");
255+
assert!(files.contains(&"evil\nname.a2ml".to_string()), "{files:?}");
256+
assert!(files.contains(&"plain.adoc".to_string()), "{files:?}");
257+
}
258+
232259
#[test]
233260
fn a_profile_is_read_from_either_allowed_path() {
234261
let estate = Scratch::new("profile-estate");

0 commit comments

Comments
 (0)