Skip to content

fix(deed): cap nesting, keep metadata errors, keep the error chain; UUID gate green - #296

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/deed-reader-hardening
Nov 14, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
fix/deed-reader-hardening

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

This fixes the four findings left open when #295 merged. Three were bot findings; the fourth is the UUID-gate failure that #295 introduced.

Changes

  1. src/deed.rs: nesting was unbounded. (Codex P1, CodeRabbit Major.) Clause nesting (members) and list nesting (value/list, quoted lists included) had no limit, so a deed of a few MB could overflow the stack and abort the process.
    • The reader now has a shared limit of MAX_NESTING = 64, documented. deed.abnf sets no limit, so this is a limit of this reader only.
    • Parser::deeper checks it before every descent. Past the limit it returns a line-numbered DeedError.
  2. src/assail/classifications.rs: metadata errors were swallowed. (Codex P2, CodeRabbit Minor.) Path::exists() is replaced by fs::symlink_metadata.
    • Only NotFound, or NotADirectory when audits is a regular file, counts as absent and allows the .a2ml fallback.
    • Any other error, a dangling deed symlink included, propagates with the registry path.
  3. src/assemblyline.rs: the error chain was lost. (CodeRabbit Minor.) scan_repo stores format!("{e:#}"), so the deed's file, line and reason reach RepoResult.error.
  4. UUID gate. The two governance / UUID v7/v8 conformance failures on feat(assail): read the user-classification registry as a deed first #295 came from the bare v4 and v5 negative fixtures in src/deed.rs. Those ids are now built at run time from the v8 fixture id.
    • With standards check-uuid-v8.sh --strict at a797d30 (CI's pin): 29ecc73 passes, cbf2b93 fails with CI's two lines, and this head passes.

Verification

  • cargo fmt --check: clean.
  • cargo clippy --all-targets and cargo build --release: 0 warnings.
  • cargo test: 793 passed, 0 failed, 4 ignored. Nine tests are new:
    • the nesting limit: exactly 64 levels parses and 65 fails; 100,000-deep clauses, lists and quoted lists return Err without overflowing; clauses and lists share one limit;
    • the absence probe: a mode-000 audits/ is an error, audits as a regular file counts as absent, and a dangling symlink is an error;
    • the batch error keeps the deed's file, line and reason.
  • The mode-000 test skips when run as root. It was also run with all capabilities dropped, and it fails against the old exists() code.

Generated by Claude Code

…rror chain

Follow-up to #295, addressing three open review findings and the UUID
gate failure on its head.

1. src/deed.rs: clause recursion (members) and list recursion
   (value/list, quoted lists included) were unbounded, so a deed of a
   few MB with ~10,000 nested '(' overflowed the stack and aborted the
   process. One shared limit, MAX_NESTING = 64, is now checked before
   every descent and returns a line-numbered DeedError. deed.abnf sets
   no limit; this is a resource bound of the reader.

2. src/assail/classifications.rs: Path::exists() turned any metadata
   error (e.g. an unreadable audits/) into "no deed", so the reader
   silently fell back to the legacy registry. symlink_metadata now
   decides: NotFound (or NotADirectory, when audits is a regular file)
   means absent; any other error propagates with the registry path.

3. src/assemblyline.rs: scan_repo stored e.to_string(), which keeps
   only the outermost anyhow context and drops the deed's line and
   reason. It now stores format!("{e:#}").

UUID gate: two negative fixtures in deed.rs's tests were bare v4/v5
UUID literals (escaped quotes hide them from the #uuid"..." rule), which
check-uuid-v8.sh --strict rejects. They are now derived at run time
from the v8 fixture id.

Tests: nesting at and past the limit for clauses, lists and the two
combined; 100,000-deep clauses and lists return Err; the error line;
unreadable audits/ (skipped when privileged), audits as a file, a
dangling deed symlink; and the deed line and reason reaching the
assemblyline error string.

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 21 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: 58f4dd6b-5bda-4233-81f6-442110501de8
Commits

Reviewing files that changed from the base of the PR and between cbf2b93 and ac13469.

Files selected for processing: 4

  • src/assail/classifications.rs
  • src/assail/mod.rs
  • src/assemblyline.rs
  • src/deed.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

@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-14T19:53:28.547439Z ac13469 PR opened
🔒 Security Review ✅ Completed 2026-11-14T19:55:55.575527Z ac13469 PR opened
ℹ️ 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.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit ba42348 into main Nov 14, 2026
72 checks passed
@hyperpolymath
hyperpolymath deleted the fix/deed-reader-hardening branch November 14, 2026 20:10
hyperpolymath added a commit that referenced this pull request Nov 14, 2026
## Summary

`panic-attack_chora.deed` writes `:repo-uuid
#u5"hyperpolymath/panic-attack"` and `:beholding-chora
#u5"estate/chora"`. Owner ruling Q2 (CHORA-SPEC 7.1) refuses `#u5` in
identity fields, and so do both `deed_lint` and the current standards
`check-uuid-v8.sh --strict`. The UUID gate here runs the older a797d30
checker, so it passes today. It will fail once its standards pin moves.

## Changes

The fix copies the registered ids; nothing is minted or reminted.
- `:repo-uuid #uuid"a39ad6b1-51e0-854d-aa9a-d9ee97ba519b"`.
- This is the v8 id that chora-registry records for `panic-attacker`,
this repo's birth name. The deed's own `(lineage :previous-names)`
already lists that name.
- It was minted in `gv-clade-index` before V9, and the rename never
reminted it (U1).
- Sources: `verisim/seed/chora-registry_praxis.deed` line 1014,
`worker/data/repos.json`.
- `:beholding-chora #uuid"0889b37b-defb-831f-973c-e119500db00e"`, the
estate chora named in CHORA-SPEC and in the standards manifest.
hypatia_chora.deed uses the same id.
- The `no-self-suppression` obligation note now names
`audits/assail-classifications_praxis.deed`, the registry that #295 made
primary.

## Verification

- `deed_lint` (standards main) on `panic-attack_chora.deed`: OK. It
failed before this change.
- `check-uuid-v8.sh --strict` (standards main): the two deed lines no
longer appear. The only remaining lines are the `src/deed.rs` fixtures
that #296 fixes.

---
_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