Skip to content

fix(manifest): close the review findings left on the deed migration (#298) - #300

Merged
hyperpolymath merged 7 commits into
mainfrom
fix/deed-manifest-review-followups
Nov 14, 2026
Merged

hyperpolymath merged 7 commits into
mainfrom
fix/deed-manifest-review-followups

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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

  1. 2b114c3, docs. docs/campaigns/2026-05-26/README.adoc gets its === Scripts heading back. The note that had been pasted over it now sits in the table cell it belongs to.
  2. 30649f1, load errors propagate. panic-attack manifest now uses a new Manifest::load_if_exists: defaults only when the file is missing, and any other error stops the command, so -o no longer overwrites with empty Nickel. diagnostics without --manifest re-reads the default path the same way.
  3. fc5c15b, pointer-only profile. 0-AI-MANIFEST.deed must carry exactly one (front-doors …) clause, with non-empty :machine and :human. Extra front doors and clauses are still accepted, because the estate's own front doors carry more. A chora deed passed with --path is not held to the profile.
  4. a31b70b, deed types survive into Nickel.
    • Lists are always arrays.
    • #t/#f become booleans.
    • A clause is always a record.
    • Integers become numbers.
  5. a3217f1, diagnostics.
    • A PanicbotDirectives result (NoRepoDeed / NotDeclared / Declared) replaces Option. A missing repo deed is a WARN, not "no directives".
    • read_dir and per-entry errors now reach the warning arm.
  6. c46be8b, extra, not a review finding (its own commit, so it can be dropped). The manifest export was not valid Nickel at all: it used ; between fields and let x = {…};\nx. nickel export (1.18.0) rejected it. It now uses , and let … in x.

Tests

Each behaviour fix has a test that fails without it:

  • a2ml::tests::load_if_exists_defaults_only_when_the_file_is_missing
  • new tests/manifest_cli.rs (MPL-2.0):
    • manifest_export_fails_on_a_malformed_default_deed, which also checks that -o is not overwritten
    • diagnostics_fails_on_a_malformed_default_deed
  • a2ml::tests::pointer_manifest_requires_its_front_doors
  • 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
  • diagnostics::tests::panicbot_directives_tells_a_missing_repo_deed_from_no_directives, diagnostics::tests::panicbot_directives_propagates_a_listing_error
  • manifest_nickel_uses_nickel_record_and_let_syntax, which also runs nickel export when the tool is installed

Verification

  • cargo build and cargo 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 without http: clean.
  • cargo fmt --check: clean.
  • No .a2ml is created. The legacy-format fixture is legacy-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.deed carries identity fields (:canonical-name, :repo-uuid, :beholding-chora). Whether Q15's "only :schema-version at top level" applies here is the owner's call.
  • docs/campaigns/2026-05-26/README.adoc lines 1–2 hold a broken comment and no SPDX line. Licence headers are flag only.
  • When no manifest exists, every command prints "warning: failed to read AI manifest", which is not a real failure.

Generated by Claude Code

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
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f9c106c1-dc0e-4495-9fa1-914ba8f3b395
Commits

Reviewing files that changed from the base of the PR and between 656b248 and 72e727d.

Files selected for processing: 5

  • docs/campaigns/2026-05-26/README.adoc
  • src/a2ml/mod.rs
  • src/diagnostics.rs
  • src/main.rs
  • tests/manifest_cli.rs
  • 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

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 14, 2026 21:02
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T21:04:55.065169Z 72e727d Draft marked ready
🔒 Security Review ✅ Completed 2026-11-14T21:06:38.995104Z 72e727d Draft marked ready
ℹ️ 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.

@hyperpolymath
hyperpolymath merged commit e9c8331 into main Nov 14, 2026
47 of 48 checks passed
@hyperpolymath
hyperpolymath deleted the fix/deed-manifest-review-followups branch November 14, 2026 21:02
@sonarqubecloud

Copy link
Copy Markdown

hyperpolymath added a commit that referenced this pull request Nov 14, 2026
…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>
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