Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,24 @@ Control (report < 0.85) → Human review required

## Critical Invariants

1. The seven canonical A2ML files (`STATE`, `META`, `ECOSYSTEM`,
`AGENTIC`, `NEUROSYM`, `PLAYBOOK`, `ANCHOR`) live under
`.machine_readable/descriptiles/`, per the current estate-wide policy.
Earlier direct-under-`.machine_readable/`, `6scm/`, and `6a2/` layouts
are retired and must not be restored.
1. **A2ML is retired; repo facts are deeds.** No `.a2ml` file should exist,
and no bot, script or doc here may create, extend or recommend one. The
facts the seven canonical A2ML files held (`STATE`, `META`, `ECOSYSTEM`,
`AGENTIC`, `NEUROSYM`, `PLAYBOOK`, `ANCHOR`), and the manifest, the RSR
profile and the bot directives, are clauses of `<repo>_chora.deed` at the
repo root (one per repo), or of a descriptile deed such as
`.machine_readable/descriptiles/META.deed`, `STATE.deed` or `AGENTIC.deed`
as standards' A7 migration moves them out. Conformance is
`1-formats/deed/tools/deed_lint.js` in `metadatastician/standards`; bots
here only *read* deeds and never hand-convert A2ML (D313).
- **The only exception** is a deed-first **read fallback**: a shared reader
may still read a legacy `.a2ml` file after a deed source, and only while
A7's migration plan (M5–M7) requires it until its callers migrate.
Rhodibot's `canon` command does this (`src/canon/overlay.rs`), reporting a
legacy file as "migrate", never as "missing", and never naming an `.a2ml`
as the form to create.
- Earlier direct-under-`.machine_readable/`, `6scm/`, and `6a2/` layouts
are retired and must not be restored.
2. All shell scripts validate untrusted input before use.
3. No hardcoded secrets — use env vars with `${VAR:-}` defaults.
4. Fix scripts must be idempotent (safe to run multiple times).
Expand Down
46 changes: 41 additions & 5 deletions bots/rhodibot/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ its findings.
| `fleet.rs`
| gitbot-fleet integration: converts compliance reports to `Finding` structs, publishes to shared context

| `deed.rs`
| Read-only reader for the repo's chora deed: which clauses it carries, its `(rsr-profile ...)`, and rhodibot's `(bot-directives ...)` entry

| `canon.rs`, `canon/`
| The vendored RSR criteria canon and the `rhodibot canon` command; `canon/overlay.rs` re-targets the criteria whose files the estate has retired (see below)

| `lib.rs`
| Library root, re-exports all modules
|===
Expand Down Expand Up @@ -191,12 +197,10 @@ Options:
| README.adoc | Documentation | 5
| LICENSE.txt | Governance | 5
| SECURITY.md | Security | 5
| CONTRIBUTING.md | Documentation | 3
| CODE_OF_CONDUCT.md | Governance | 3
| CONTRIBUTING.adoc (or .md) | Documentation | 3
| CODE_OF_CONDUCT.adoc (or .md) | Governance | 3
| .claude/CLAUDE.md | Structure | 2
| STATE.scm | Structure | 3
| META.scm | Structure | 3
| ECOSYSTEM.scm | Structure | 3
| `<repo>_chora.deed` | Structure | 3
| .editorconfig | Structure | 2
| .gitattributes | Structure | 2
| .gitignore | Structure | 2
Expand Down Expand Up @@ -225,6 +229,38 @@ Options:
* **Author attribution** -- flags Cargo.toml using "hyperpolymath" as author
* **License type** -- validates against approved license list

=== The chora deed, and no A2ML

A2ML is retired. The repo facts that used to be `.a2ml` files (manifest, state,
meta, ecosystem, agentic, neurosym, playbook, anchor, rsr-profile) are clauses of
`<repo>_chora.deed`, or of a descriptile deed (`STATE.deed`, `META.deed`,
`ECOSYSTEM.deed`, `AGENTIC.deed`). Rhodibot requires the chora deed and never
demands or suggests an `.a2ml` file. A legacy `.a2ml` that is still present is
read only as a fallback after the deed, and is reported as "migrate", never as
"missing". Whether a deed *conforms* is `deed_lint.js`'s job in
`metadatastician/standards`; rhodibot only reads its structure.

The vendored criteria canon is itself still an `.a2ml` file; its deed form is a
separate piece of work. Until it lands, `canon/overlay.rs` re-targets the
affected criteria as requirements, and `canon/pin.toml` records the divergence
under `[overlay]` so the digest of the vendored copy stays honest.

=== CONTRIBUTING and CODE_OF_CONDUCT: `.adoc` or `.md`

Either spelling satisfies the check, and neither is ever required in addition
to the other. `.adoc` is the default, because the estate almost always uses it;
it decides which spelling a finding names first. A repository that prefers
`.md` says so in its chora deed's bot directives:

[source]
----
(bot-directives
(bot :name rhodibot
(config :community-doc-format md)))
----

A value other than `adoc` or `md` is an error rather than a silent default.

=== Scoring

Each check has a point value. The final score is `points_earned / max_points * 100`.
Expand Down
21 changes: 21 additions & 0 deletions bots/rhodibot/canon/pin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,24 @@ sha256 = "5c510bba025be718deebb12d0333bfe7db2da43c66578b728b1a334df65290b1"
# inapplicable -- the failure mode is quiet, so the numbers are asserted.
known = 28
presets = 11

# The overlay: where rhodibot DIVERGES from the vendored criteria, on purpose.
#
# The vendored `rsr-criteria-v2.a2ml` above is untouched -- its digest is still
# the standards copy's digest. But the estate has retired A2ML, so rhodibot no
# longer demands the `.a2ml` files that file names, and the .md/.adoc choice for
# CONTRIBUTING / CODE_OF_CONDUCT is toggleable. `src/canon/overlay.rs` re-targets
# these criteria as *requirements*; this table is the explicit record of that,
# and `tests/canon_lockstep.rs` fails if it and the module disagree.
#
# The criteria canon's own deed form is an A7 mapping-spec item (M5, converted
# under kyX or an owner-granted D313 exception, behind a parity gate, with
# `canon.lock` bumped in the same commit). When that lands, delete the overlay
# module and this table in the same commit that re-pins.
[overlay]
module = "src/canon/overlay.rs"
retargeted = ["2.1.3", "2.1.4", "2.1.5", "2.3.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.2.2"]
suspended = ["3.1.9", "3.2.1"]
manual = ["9.1.4"]
extra_checks = ["rhodibot.chora-deed"]
removed_by = "the criteria-praxis-deed re-pin (A7 M5)"
1 change: 1 addition & 0 deletions bots/rhodibot/src/canon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
//! and reports every repository as compliant.

pub mod local;
pub mod overlay;
pub mod profile;
pub mod report;
pub mod requirement;
Expand Down
36 changes: 31 additions & 5 deletions bots/rhodibot/src/canon/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ use std::process::Command;

use anyhow::{Context, Result, ensure};

/// The two paths the canon's baseline allows for a profile, in preference
/// order: both are acceptable, and the first is the estate's.
/// Where a **legacy** `rsr-profile.a2ml` may still be, in preference order.
///
/// A read fallback only, consulted when the chora deed has no
/// `(rsr-profile ...)` clause. Never a thing to create or ask for.
const PROFILE_PATHS: [&str; 2] = [
".machine_readable/rsr-profile.a2ml",
"machine-readable/rsr-profile.a2ml",
Expand All @@ -32,8 +34,10 @@ const PROFILE_PATHS: [&str; 2] = [
pub struct LocalSource {
/// The repository's tracked files, relative to its root.
pub files: Vec<String>,
/// The text of its profile, when it has one.
/// The text of a legacy profile file, when it has one (a read fallback).
pub profile: Option<String>,
/// The text of the root `*_chora.deed`, when it has one.
pub chora_deed: Option<String>,
/// Whether the file list came from git or from a walk.
from_git: bool,
}
Expand All @@ -49,10 +53,16 @@ impl LocalSource {

/// Kept private so a `LocalSource` can only come from `read`, which is the
/// only thing that knows whether the list is the tracked set.
fn new(files: Vec<String>, profile: Option<String>, from_git: bool) -> Self {
fn new(
files: Vec<String>,
profile: Option<String>,
chora_deed: Option<String>,
from_git: bool,
) -> Self {
Self {
files,
profile,
chora_deed,
from_git,
}
}
Expand All @@ -78,7 +88,23 @@ pub fn read(root: &Path) -> Result<LocalSource> {
}
};

Ok(LocalSource::new(files, profile(root)?, from_git))
let chora_deed = match super::overlay::find_chora_deed(&files)? {
Some(name) => {
let path = root.join(&name);
Some(
std::fs::read_to_string(&path)
.with_context(|| format!("reading {}", path.display()))?,
)
}
None => None,
};

Ok(LocalSource::new(
files,
profile(root)?,
chora_deed,
from_git,
))
}

/// The repository's tracked files, when git can be asked.
Expand Down
Loading
Loading