Repository navigation
fix(manifest): close the review findings left on the deed migration (#298) - #300
Conversation
The A2ML-to-deed migration (#298) inserted the "historical" note for file-ffi-pr-v2.sh in place of the `=== Scripts` heading: the section lost its heading, the note began with the sentence fragment "form was broken under jq operator precedence)", and `|=== Scripts` is not an AsciiDoc heading. Restore `=== Scripts` and append the note to the end of the file-ffi-pr-v2.sh table cell, where the fragment shows it was meant to go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC
`panic-attack manifest` read the manifest with `Manifest::load(&target).unwrap_or_default()`. Since #298 made 0-AI-MANIFEST.deed the default manifest, a malformed or misheaded deed was silently replaced by the empty built-in manifest: the command exited 0, and with `-o` it overwrote the output with empty Nickel. Add `Manifest::load_if_exists`, which returns the defaults only when the file is missing and propagates every other error, and use it in the manifest command. `panic-attack diagnostics` without `--manifest` reused the startup manifest, which also falls back to the defaults on a load error and then reported "no manifest file; built-in defaults"; it now re-reads the default path the same way and fails on a malformed file. Tests: a2ml::tests::load_if_exists_defaults_only_when_the_file_is_missing, and tests/manifest_cli.rs (manifest_export_fails_on_a_malformed_default_deed and diagnostics_fails_on_a_malformed_default_deed fail without this fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC
The deed manifest loader checked only the document head, so a 0-AI-MANIFEST.deed that was a valid repo-deed but had no (front-doors :machine … :human …) clause was accepted as the authoritative manifest, and no legacy manifest was considered, although agents then have no front door to follow (A7 ruling Q15). When the file is named 0-AI-MANIFEST.deed, require exactly one (front-doors …) clause giving :machine and :human once each as non-empty strings. Extra front doors (such as :agent) and other clauses are still accepted: estate manifests, including the standards repository's own, are not yet reduced to pointer-only form, and the deed linter is the gate for that. A repo deed under another name (a `--path` export of <repo>_chora.deed) is not held to the profile. Test: a2ml::tests::pointer_manifest_requires_its_front_doors (fails without this fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC
The deed manifest was converted into the untyped A2ML S-expression tree
before rendering, which lost what each value was:
- a list field contributed its elements to the field, so `:x ()` became
`null` and a one-element list became a scalar;
- a clause with one child clause, such as `(bot-directives (bot …))`,
became the array `["bot", …]` instead of a record;
- `#t`/`#f` became the strings "#t"/"#f";
- an integer became a string ("3").
Keep the parsed deed members on the Manifest and render them directly:
a field is `key = value`, a clause is always a record, a name given more
than once is an array of its values, a list is always an array, booleans
are `true`/`false`, and integers are number literals (leading zeros
dropped, since a deed integer is never octal). Strings, symbols and ids
are strings, as before. The legacy A2ML path is unchanged.
Tests (each fails without this fix): a2ml::tests::
deed_lists_stay_arrays_in_nickel, deed_booleans_render_as_nickel_booleans,
deed_single_child_clause_stays_a_record, deed_integers_render_as_nickel_numbers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC
Not one of the #298 review findings, but it makes the type fixes moot: the manifest export separated record fields with `;` and ended with `let x = { … };\nx`, which is Nix-like syntax. `nickel export` (1.18.0) rejects it with "unexpected token" on the second field, so no Nickel consumer could read the export at all. Separate fields with `,` and bind with `let x = { … } in\nx`. Both the deed and the legacy renderers share the record writer, so both are fixed. Checked by hand with `nickel export` on this repository's 0-AI-MANIFEST.deed, on panic-attack_chora.deed and on a legacy-format manifest. Test: a2ml::tests::manifest_nickel_uses_nickel_record_and_let_syntax (fails without this fix; it also runs `nickel export` on the output when the Nickel CLI is installed). The assault-report Nickel writer (src/report/output.rs) has the same `;` form and is not changed here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC
… directives `panicbot_directives` returned `Ok(None)` in three cases that are not the same: - the directory holds no `*_chora.deed` (for example, the manifest's :machine target was deleted); - `fs::read_dir` failed, or a directory entry could not be read (entries were dropped with `filter_map(.ok())`); - a repo deed parsed and declares no panicbot directives. Only the last one shows that no directives are declared, yet all three were reported as "[OK] no panicbot directives declared (panicbot runs the full suite)". Return a `PanicbotDirectives` value (NoRepoDeed / NotDeclared / Declared), and propagate listing and entry errors as `Err`, which the existing warning arm reports. A missing repo deed is now a warning, the same level as a repo deed that does not parse; it does not fail diagnostics, because diagnostics also runs in repositories that do not carry a chora deed yet. Tests: diagnostics::tests:: panicbot_directives_tells_a_missing_repo_deed_from_no_directives and panicbot_directives_propagates_a_listing_error (on the old code both a deed-less directory and a missing directory returned Ok(None)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC
|
Warning Review limit reachedYou'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 16 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
…er-only manifest (#302) ## Summary This PR fixes five small debts. Four of them were listed under "Seen, not changed" in #300; the fifth is the S1612 closure. ## Changes, by commit 1. **7eca0cf, assault-report Nickel.** `src/report/output.rs` (the `--output-format nickel` writer) had the bug #300 fixed in the manifest export: fields written as `field = value;` and a `};\nassault_report` tail. `nickel export` 1.18.0 rejects that form with "unexpected token". - The writer now uses the a2ml module's `nickel_record` (fields separated by `,`) and a new shared `nickel_let` (`let … in`), so the two writers no longer duplicate this code. `Manifest::to_nickel` uses `nickel_let` too. - NaN and infinite floats now become `null` instead of an unparseable token. - Same commit, Sonar S1612: three `.and_then(|e| e.to_str())` closures in `src/a2ml/mod.rs` become `OsStr::to_str`. 2. **235804b, spurious warning.** `run_main` loaded the manifest with `load_default`, which errors when the file is missing. So every command run in a directory without a manifest printed `warning: failed to read AI manifest`. It now uses `load_if_exists`: a missing manifest is silent, and a manifest that exists but is unreadable or malformed still warns. 3. **66f2b59, chora deed notes.** Both parent `:notes` in `(ecosystem (related …))` named the retired ANCHOR.a2ml. They now say the parent is named in this clause, and point to `docs/history/A2ML-REMOVED.adoc` for the retired source. Only the note text changed. 4. **93469f7, pointer-only manifest (A7 Q15).** `0-AI-MANIFEST.deed` drops `:canonical-name`, `:repo-uuid` and `:beholding-chora`. `panic-attack_chora.deed` carries the same three values and is not changed. ## Tests - `report::output::tests::assault_report_nickel_uses_nickel_record_and_let_syntax` fails against the old writer. Where `nickel` is installed, it also runs `nickel export --format json` and checks that counts and scores come back as numbers. - `report::output::tests::non_finite_numbers_become_null` - In `tests/manifest_cli.rs`: `no_manifest_is_not_a_warning`, `a_valid_pointer_deed_is_not_a_warning` and `a_malformed_manifest_still_warns`. ## Verification - `cargo build`: no warnings. - `cargo test`: 816 passed, 0 failed, 4 ignored. - `cargo test --features http`: 883 passed, 0 failed, 4 ignored. - `cargo clippy --all-targets -- -D warnings` and `cargo clippy --locked --all-targets --features http,sarif,signing -- -D warnings`: clean. - `cargo fmt --check`: clean. - `deed_lint.js` gives `OK` on both deeds. - `panic-attack manifest | nickel export` gives valid JSON. - `panic-attack diagnostics` reports `[OK] AI manifest 0-AI-MANIFEST.deed parsed`. - `git diff --summary origin/main...HEAD`: no mode changes. --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC)_ --------- Co-authored-by: Claude <noreply@anthropic.com>



Summary
#298 (A2ML → deed) merged with nine review findings still open: Codex and CodeRabbit on 088dfbb. The extra commit f08dae4 did not touch them. All nine were real on main. This branch fixes them, plus one related bug.
Changes, by commit
docs/campaigns/2026-05-26/README.adocgets its=== Scriptsheading back. The note that had been pasted over it now sits in the table cell it belongs to.panic-attack manifestnow uses a newManifest::load_if_exists: defaults only when the file is missing, and any other error stops the command, so-ono longer overwrites with empty Nickel.diagnosticswithout--manifestre-reads the default path the same way.0-AI-MANIFEST.deedmust carry exactly one(front-doors …)clause, with non-empty:machineand:human. Extra front doors and clauses are still accepted, because the estate's own front doors carry more. A chora deed passed with--pathis not held to the profile.#t/#fbecome booleans.PanicbotDirectivesresult (NoRepoDeed / NotDeclared / Declared) replacesOption. A missing repo deed is a WARN, not "no directives".read_dirand per-entry errors now reach the warning arm.;between fields andlet x = {…};\nx.nickel export(1.18.0) rejected it. It now uses,andlet … in x.Tests
Each behaviour fix has a test that fails without it:
a2ml::tests::load_if_exists_defaults_only_when_the_file_is_missingtests/manifest_cli.rs(MPL-2.0):manifest_export_fails_on_a_malformed_default_deed, which also checks that-ois not overwrittendiagnostics_fails_on_a_malformed_default_deeda2ml::tests::pointer_manifest_requires_its_front_doorsdeed_lists_stay_arrays_in_nickel,deed_booleans_render_as_nickel_booleans,deed_single_child_clause_stays_a_record,deed_integers_render_as_nickel_numbersdiagnostics::tests::panicbot_directives_tells_a_missing_repo_deed_from_no_directives,diagnostics::tests::panicbot_directives_propagates_a_listing_errormanifest_nickel_uses_nickel_record_and_let_syntax, which also runsnickel exportwhen the tool is installedVerification
cargo buildandcargo build --features http: 0 warnings.cargo test --features http: 878 passed, 0 failed, 4 ignored.cargo test: 811 passed, 0 failed, 4 ignored.cargo clippy --all-targets, with and withouthttp: clean.cargo fmt --check: clean..a2mlis created. The legacy-format fixture islegacy-manifest.txt.Seen, not changed
src/report/output.rs: the assault-report Nickel writer uses the same;form, so it is probably invalid Nickel too.panic-attack_chora.deed: the(ecosystem (related …))note still says "Parent named by ANCHOR.a2ml."0-AI-MANIFEST.deedcarries identity fields (:canonical-name,:repo-uuid,:beholding-chora). Whether Q15's "only:schema-versionat top level" applies here is the owner's call.docs/campaigns/2026-05-26/README.adoclines 1–2 hold a broken comment and no SPDX line. Licence headers are flag only.Generated by Claude Code