Skip to content

Commit 8bdf5a3

Browse files
hyperpolymathclaudeHoTT-stuff
authored
feat(finishingbot,glambot): read the chora deed, not the retired .scm files (#689)
## Why Repo facts are clauses of the one `<repo>_chora.deed` at the root (D312, D313). Neither finishingbot nor glambot read the deed: - finishingbot still **validated** legacy `STATE/META/….scm` files. Its `SCM-005` advised **moving** a root `STATE.scm` into `.machine_readable/`, which restores a retired layout (CLAUDE.md invariant 1). - glambot required a `.machine_readable/` directory, and its fixtures built the retired `.scm` layout. ## What **`deed-reader/` (new, std-only, read-only).** panicbot's grammar-faithful reader, extracted so bots read the deed one way, plus the lookup conventions of `scripts/deed-field.sh`: | `deed-field.sh` | `deed_reader` | |---|---| | `--find DIR` | `find_chora(dir)`: exactly one `*_chora.deed`, `Multiple` otherwise | | `--has DEED PATH` | `Clause::has(path)` | | `DEED PATH KEY` | `clause_at(path)` then `field(key)`: key at the clause's top level only | `load_chora` requires the `repo-deed` doc-head. One tightening against `deed.abnf`: a bare CR is now an error (`line-end = CRLF / LF`). It stays a reader; `deed_lint.js` remains the conformance gate. **finishingbot.** The type `ScmFilesAnalyzer` and the report key `scm_files` keep their names, so the API and JSON shape are stable. | ID | Severity | When | |---|---|---| | DEED-001 | warning | no chora deed | | DEED-002 | error | more than one (D312) | | DEED-003 | error | unreadable, unparseable (with line), or not a `repo-deed` | | DEED-004 | warning | no `(status …)` clause and no `descriptiles/STATE.deed` (A7 J15) | | SCM-006-`<NAME>.scm` | warning | legacy file at the root, `.machine_readable/` or `6scm/`: **migrate**, never validated, never "move" | | SCM-002…005 | retired | (SCM-001 already was) | **glambot.** - MACH-006 (missing `.machine_readable/`) is retired: a repo whose facts all live in its deed needs no such directory. - New: MACH-008 (warning, no chora deed) and MACH-009 (error: several, unreadable, unparseable or wrong head). - Fixtures now use a chora deed. - Neither finding is auto-fixable: bots never write a deed. **CI.** `deed-reader` and `finishingbot` join the `rust.yml` matrix. **finishingbot had never been built or tested in CI.** glambot stays out because it has about 60 pre-existing clippy diagnostics under `-D warnings`. With `--keep-going`, this branch has **one fewer** than main and adds none. ## Validation (local) | Crate | build `--locked` | tests | clippy `-D warnings` | fmt | |---|---|---|---|---| | deed-reader | ✅ | 7 passed | ✅ 0 | ✅ | | finishingbot | ✅ | 69 + 69 + 38 passed | ✅ 0 | ✅ | | glambot | ✅ | 36 + 36 + 6 passed | 63 pre-existing (main: 64) | ✅ | Each new rule has positive and negative tests: none / one / two deeds, parse error with line, wrong head, status vs `STATE.deed`, and legacy `.scm` at all three locations reported as migrate and never validated. ## Not in this PR (follow-ups) - Move panicbot's and rhodibot's private readers onto `deed-reader`. rhodibot's is under #687, so this waits on that. - Pay glambot's clippy debt, then add glambot to the matrix. --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDhFeexmokLqLRfZNce)_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Repository checks now recognize a root-level chora deed, report when it is missing or invalid, and include parse-error locations. * Finishingbot checks deed status and maturity, and warns when it finds legacy `.scm` files. * **Changes** * Legacy SCM document validation and related findings have been retired. `.scm` files are no longer required or validated. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: CLAUDE <355856132+HoTT-stuff@users.noreply.github.com>
1 parent d077960 commit 8bdf5a3

19 files changed

Lines changed: 1616 additions & 762 deletions

File tree

‎.github/workflows/rust.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ jobs:
8080
dir: bots/ponsbot
8181
- module: idris-dependents
8282
dir: idris-dependents
83+
# deed-reader: the shared, std-only reader for <repo>_chora.deed.
84+
- module: deed-reader
85+
dir: deed-reader
86+
# finishingbot reads the chora deed through deed-reader; it was
87+
# never built, tested or linted in CI before (2026-11-17). glambot
88+
# also uses deed-reader but stays out until its pre-existing clippy
89+
# debt (about 60 diagnostics under -D warnings) is paid.
90+
- module: finishingbot
91+
dir: bots/finishingbot
8392
defaults:
8493
run:
8594
working-directory: ${{ matrix.dir }}

‎bots/finishingbot/Cargo.lock‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bots/finishingbot/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ keywords = ["release", "validation", "ci-cd", "compliance", "gitbot-fleet"]
1111
categories = ["development-tools", "command-line-utilities"]
1212

1313
[dependencies]
14+
# Repo deed reader (shared, std-only, in-repo)
15+
gitbot-deed-reader = { path = "../../deed-reader" }
16+
1417
# Async runtime
1518
tokio = { version = "1.52.3", features = ["full"] }
1619

‎bots/finishingbot/Containerfile‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,28 @@
22
# Cerro Torre - The Challenging Peak
33
# Patagonian mountain known for difficulty and technical climbing
44
# Purpose: Release readiness validation (conquering the final ascent)
5+
#
6+
# Build from the REPOSITORY ROOT, so the in-repo deed-reader crate is in the
7+
# context (finishingbot reads the chora deed through it):
8+
# podman build -f bots/finishingbot/Containerfile -t cerro-torre .
59

610
FROM docker.io/library/rust:latest AS builder
711

8-
WORKDIR /build
12+
WORKDIR /build/bots/finishingbot
913

1014
# Install dependencies and nightly toolchain
1115
RUN apt-get update && \
1216
apt-get install -y pkg-config libssl-dev && \
1317
rm -rf /var/lib/apt/lists/* && \
1418
rustup default nightly
1519

16-
# Copy source
17-
COPY Cargo.toml Cargo.lock ./
18-
COPY src ./src
20+
# Copy source, keeping the repository layout so ../../deed-reader resolves
21+
COPY deed-reader /build/deed-reader
22+
COPY bots/finishingbot/Cargo.toml bots/finishingbot/Cargo.lock ./
23+
COPY bots/finishingbot/src ./src
24+
# Cargo.toml declares a [[bench]]; without it the manifest does not parse
25+
# (this image failed to build on main for that reason alone).
26+
COPY bots/finishingbot/benches ./benches
1927

2028
# Remove path dependency that isn't available in container context
2129
RUN sed -i '/gitbot-shared-context.*path.*optional/d' Cargo.toml && \
@@ -32,7 +40,7 @@ RUN apt-get update && \
3240
apt-get install -y ca-certificates libssl3 && \
3341
rm -rf /var/lib/apt/lists/*
3442

35-
COPY --from=builder /build/target/release/finishing-bot /usr/local/bin/cerro-torre
43+
COPY --from=builder /build/bots/finishingbot/target/release/finishing-bot /usr/local/bin/cerro-torre
3644

3745
# Run as non-root
3846
RUN useradd -r -s /bin/false cerro-torre

‎bots/finishingbot/README.adoc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ the gitbot-fleet shared context layer and makes the final release-readiness dete
4848
|Version consistency across files, debug statement detection, sensitive data patterns, SECURITY.md, release profiles
4949
|No
5050

51-
|**SCM Files**
52-
|Legacy `.machine_readable/` SCM files (STATE.scm, META.scm, ECOSYSTEM.scm, PLAYBOOK.scm, AGENTIC.scm, NEUROSYM.scm) are validated only if present (SPDX headers, required sections, content completeness); their absence is canonical, since those descriptiles are now clauses of `<name>_chora.deed`
51+
|**Repo Deed** (the `scm_files` report key)
52+
|Reads the one `<repo>_chora.deed` at the root (through `deed-reader/`): none is DEED-001 (warning), more than one is DEED-002 (error, D312), unreadable or not a `repo-deed` is DEED-003 (error), no `(status …)` or `(maturity …)` clause and no `.machine_readable/descriptiles/STATE.deed` is DEED-004 (warning). A retired STATE, META, ECOSYSTEM, PLAYBOOK, AGENTIC or NEUROSYM `.scm` at the root, under `.machine_readable/` or under `.machine_readable/6scm/` is SCM-006 (warning, "migrate"): it is not validated and is never to be moved
5353
|No
5454

5555
|**Testing**
@@ -179,7 +179,7 @@ The analyzers accept the estate's canonical locations, not only one spelling:
179179
* `mise.toml` in place of `.tool-versions` (TOOL-001).
180180
* `tests/fuzz/` as well as `fuzz/` and `.clusterfuzzlite/` (TEST-RU-003); a crate with no code yet (no `.rs` line that is not blank or a comment) is exempt from TEST-RU-005 and TEST-RU-006.
181181
* A workflow named by file name in prose resolves under `.github/workflows/` (CLM-006).
182-
* SCM-001 is retired: STATE, META, ECOSYSTEM, PLAYBOOK, AGENTIC and NEUROSYM are clauses of `<name>_chora.deed`, not files.
182+
* SCM-001 to SCM-005 are retired: STATE, META, ECOSYSTEM, PLAYBOOK, AGENTIC and NEUROSYM are clauses of `<name>_chora.deed`, not files, so a legacy `.scm` is neither required nor validated, and SCM-005 no longer advises moving one into `.machine_readable/` (a retired layout).
183183
* REL-008 matches key material (PEM headers, AWS key ids, vendor token shapes, long key literals), not the words "private key".
184184

185185
A repository can acknowledge a finding in its `.hypatia-baseline.json`, the estate's documented exemption mechanism (`docs/upstream-proposals/standards--hypatia-baseline-consumer/docs/EXEMPTION-MECHANISMS.adoc`, "Layer 2"). `.hypatia-ignore` is not read: that document rejects it. An entry uses this bot's `rule_module`, `finishing_bot`, and the finding id as `type`, with the estate severity word (error = `high`, warning = `medium`, info = `info`, suggestion = `low`) and exactly one of `file` or `file_pattern`: `{"severity": "medium", "rule_module": "finishing_bot", "type": "PH-001", "file_pattern": "build/just/**", "note": "scanner names the tokens"}`. Matching is exact on severity, module and type, so a rule family needs one entry per id. Entries past `expires_at`, or carrying `severity_override` (this bot does not downgrade), acknowledge nothing; other modules' entries (`cicd_rules`, ...) are Hypatia's and are not read. Currently only the placeholder analyzer (PH-nnn, hence PH-100) honours it. See `src/baseline.rs`.
@@ -418,7 +418,7 @@ src/
418418
placeholder.rs Placeholder detection and removal
419419
claims.rs Documentation claims verification
420420
release.rs Release artifact and security checks
421-
scm_files.rs .machine_readable/ SCM file validation
421+
scm_files.rs Repo deed (<repo>_chora.deed) checks; retired .scm reported as "migrate"
422422
testing.rs Testing infrastructure analysis
423423
tooling.rs Tooling and CI workflow validation
424424
v1_readiness.rs V1 release readiness assessment

0 commit comments

Comments
 (0)