Skip to content

fix(deed): Hypatia.Deed matches deed.abnf v2.0.0, with a standards-fixture conformance test - #1133

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/deed-parser-v2
Nov 14, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
fix/deed-parser-v2

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

The owner approved this on 2026-11-14. Hypatia.Deed claimed to match the deed gate but was behind deed.abnf v2.0.0. It refused the descriptile-deed and contractile-deed heads and the ! token, and it accepted #u5 identities and lines over 998 octets.

Changes

  • lib/hypatia/deed.ex:
    • accepts the contractile-deed and descriptile-deed heads;
    • maps a file name to its head in dispatch/1, which parse/2 checks;
    • accepts ! only on the :id of a top-level (rule …) in a contractile-deed, as {:field, "id", v, :bang};
    • checks that #uuid is version 5 or 8 with the right variant;
    • caps lines at 998 octets;
    • refuses #u5, and any #uuid that is not version 8, in identity fields.
  • New test/deed_conformance_test.exs runs the standards core fixtures (18 valid, 39 invalid), vendored under test/fixtures/deed/standards/ with UPSTREAM.adoc (standards b2aaeb0c).
    • HYPATIA_DEED_FIXTURES can point it at a full standards checkout.
    • There is one case per v1.4→v2.0 change.
  • Refreshed fixtures: the egress fixtures and the template copy (they used #u5, and the template had a 1159-octet line), plus four test deeds whose #u5 ids became #u8"chora-registry:…".

Verification

  • This parser and deed_lint.js give the same verdict on all 343 standards fixtures and on 4,000 mutants. Main's parser disagreed on 152 fixtures.
  • Deed suites: 356 tests, 0 failures. Conformance against the full upstream tree: 119 tests, 0 failures.
  • Full mix test: 3331 tests, 10 failures. All 10 are the known HttpcRedirectCredentialsTest baseline.
  • mix compile --warnings-as-errors and mix format --check-formatted are clean.

Profile-level checks are left to deed_lint on purpose (--anchor, --state, --ecosystem and the rest). Egress is the only profile this parser reads.


Generated by Claude Code

The reader claimed to agree with the standards gate but read deed.abnf
v1.2.1. It refused the contractile-deed and descriptile-deed heads
(v1.4.0) and the "!" token (v1.5.0), so 5 of the 18 valid standards
grammar fixtures failed, and it accepted two the gate refuses: a line
over 998 octets (v1.3.0) and a #u5 in an identity field (owner ruling
Q2).

Now, as deed_lint.js FILE judges a deed:
- doc-heads contractile-deed and descriptile-deed; anchor-deed stays
  out (v2.0.0);
- dispatch/1 maps a file name to its doc-head (exact names first, the
  case-sensitive J14 names, then _praxis/_chora), and parse/2 checks
  it; egress_declarations/1 now uses it;
- field = keyword sep value [sep "!"], the bang allowed only on the :id
  of a top-level (rule ...) clause in a contractile-deed, read as
  {:field, "id", value, :bang};
- #uuid is version 5 or 8 with variant 10 (grammar since v1.3.0);
- no line over 998 octets;
- no #u5, and no #uuid but version 8, after an identity field name,
  read lexically on the raw and the comment-blanked text, as the gate
  and check-uuid-v8.sh read it.

test/deed_conformance_test.exs runs the standards core fixtures
(valid, invalid, heads, bang: 18 valid, 39 invalid), vendored under
test/fixtures/deed/standards/ from standards b2aaeb0 with an UPSTREAM
note; HYPATIA_DEED_FIXTURES or :deed_standards_fixtures points it at a
standards checkout, where every profile valid/ fixture must parse too.
Against deed_lint.js, the reader gives the same verdict on all 343
standards fixtures and 4,000 mutants. The clause profiles deed_lint
runs under flags (anchor, contractiles, edict, verb-descriptile,
ecosystem, state, rsr-scorecard, mustfile, proof-receipt) are not
checked here, by design.

The vendored egress fixtures and the template's live deed are
re-copied (standards b2aaeb0, rsr-template-repo 202085a): the old
copies wrote #u5 identities and a 1159-octet line the gate now
refuses. Test deeds that wrote :repo-uuid #u5 now write #u8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 49 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: 7f97cba8-c77f-4b55-9cb4-7b00480f9466
Commits

Reviewing files that changed from the base of the PR and between 665dc59 and 27d2ae2.

Files selected for processing: 98

  • lib/hypatia/deed.ex
  • test/deed_conformance_test.exs
  • test/deed_test.exs
  • test/egress_decision_mirror_test.exs
  • test/fixtures/deed/standards/UPSTREAM.adoc
  • test/fixtures/deed/standards/bang/invalid/Adjustfile.deed
  • test/fixtures/deed/standards/bang/invalid/Bustfile.deed
  • test/fixtures/deed/standards/bang/invalid/Dustfile.deed
  • test/fixtures/deed/standards/bang/invalid/Intentfile.deed
  • test/fixtures/deed/standards/bang/invalid/Mustfile.deed
  • test/fixtures/deed/standards/bang/invalid/Trustfile.deed
  • test/fixtures/deed/standards/bang/invalid/rules_praxis.deed
  • test/fixtures/deed/standards/bang/invalid/top_chora.deed
  • test/fixtures/deed/standards/bang/valid/Adjustfile.deed
  • test/fixtures/deed/standards/bang/valid/Trustfile.deed
  • test/fixtures/deed/standards/heads/invalid/ANCHOR.deed
  • test/fixtures/deed/standards/heads/invalid/INTENT.deed
  • test/fixtures/deed/standards/heads/invalid/State.deed
  • test/fixtures/deed/standards/heads/invalid/Trustfile.deed
  • test/fixtures/deed/standards/heads/invalid/anchor.deed
  • test/fixtures/deed/standards/heads/invalid/mustfile.deed
  • test/fixtures/deed/standards/heads/valid/CLADE.deed
  • test/fixtures/deed/standards/heads/valid/Mustfile.deed
  • test/fixtures/deed/standards/heads/valid/STATE.deed
  • test/fixtures/deed/standards/invalid/inbot-bare-name_chora.deed
  • test/fixtures/deed/standards/invalid/incomment-control_chora.deed
  • test/fixtures/deed/standards/invalid/incomment-no-line-end_chora.deed
  • test/fixtures/deed/standards/invalid/indel-string_chora.deed
  • test/fixtures/deed/standards/invalid/inequals_chora.deed
  • test/fixtures/deed/standards/invalid/inescape-u_chora.deed
  • test/fixtures/deed/standards/invalid/inhead_chora.deed
  • test/fixtures/deed/standards/invalid/inheader-control_chora.deed
  • test/fixtures/deed/standards/invalid/inline-999_chora.deed
  • test/fixtures/deed/standards/invalid/inmissing-schema_chora.deed
  • test/fixtures/deed/standards/invalid/inno-header_chora.deed
  • test/fixtures/deed/standards/invalid/inquote-space_chora.deed
  • test/fixtures/deed/standards/invalid/insection_chora.deed
  • test/fixtures/deed/standards/invalid/intab_chora.deed
  • test/fixtures/deed/standards/invalid/intrailing_chora.deed
  • test/fixtures/deed/standards/invalid/intrue-literal_chora.deed
  • test/fixtures/deed/standards/invalid/inu5-identity_chora.deed
  • test/fixtures/deed/standards/invalid/inu7_chora.deed
  • test/fixtures/deed/standards/invalid/inu8-empty-domain_chora.deed
  • test/fixtures/deed/standards/invalid/inu8-no-colon_chora.deed
  • test/fixtures/deed/standards/invalid/inu8-no-string_chora.deed
  • test/fixtures/deed/standards/invalid/inunbalanced_chora.deed
  • test/fixtures/deed/standards/invalid/inuuid-no-string_chora.deed
  • test/fixtures/deed/standards/invalid/inuuid-short_chora.deed
  • test/fixtures/deed/standards/invalid/inuuid-uppercase_chora.deed
  • test/fixtures/deed/standards/valid/booleans-uuid_chora.deed
  • test/fixtures/deed/standards/valid/bot-directives-clause_chora.deed
  • test/fixtures/deed/standards/valid/canon-clause_chora.deed
  • test/fixtures/deed/standards/valid/list-leading-separator_chora.deed
  • test/fixtures/deed/standards/valid/maturity-clause_chora.deed
  • test/fixtures/deed/standards/valid/minimal_chora.deed
  • test/fixtures/deed/standards/valid/nested_chora.deed
  • test/fixtures/deed/standards/valid/nostos-clause_chora.deed
  • test/fixtures/deed/standards/valid/quoted-list-symbols-007_chora.deed
  • test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed
  • test/fixtures/deed/standards/valid/updates-clause_chora.deed
  • test/fixtures/deed/standards/valid/uuid-opaque_chora.deed
  • test/fixtures/deed/standards/valid/uuid8-clade_chora.deed
  • test/fixtures/deed_egress/README.adoc
  • test/fixtures/deed_egress/invalid/bad-host_chora.deed
  • test/fixtures/deed_egress/invalid/bad-port_chora.deed
  • test/fixtures/deed_egress/invalid/bad-var_chora.deed
  • test/fixtures/deed_egress/invalid/duplicate-job_chora.deed
  • test/fixtures/deed_egress/invalid/duplicate-secret_chora.deed
  • test/fixtures/deed_egress/invalid/empty-secrets_chora.deed
  • test/fixtures/deed_egress/invalid/enforcement-string_chora.deed
  • test/fixtures/deed_egress/invalid/enforcement-unknown_chora.deed
  • test/fixtures/deed_egress/invalid/github-token-lowercase_chora.deed
  • test/fixtures/deed_egress/invalid/github-token_chora.deed
  • test/fixtures/deed_egress/invalid/job-id_chora.deed
  • test/fixtures/deed_egress/invalid/label-leading-hyphen_chora.deed
  • test/fixtures/deed_egress/invalid/label-trailing-hyphen_chora.deed
  • test/fixtures/deed_egress/invalid/missing-enforcement_chora.deed
  • test/fixtures/deed_egress/invalid/nested-egress_chora.deed
  • test/fixtures/deed_egress/invalid/repeated-field_chora.deed
  • test/fixtures/deed_egress/invalid/secret-endpoint-unlisted_chora.deed
  • test/fixtures/deed_egress/invalid/secret-lowercase_chora.deed
  • test/fixtures/deed_egress/invalid/secrets-symbols_chora.deed
  • test/fixtures/deed_egress/invalid/stray-member_chora.deed
  • test/fixtures/deed_egress/invalid/two-clauses_chora.deed
  • test/fixtures/deed_egress/invalid/unknown-field_chora.deed
  • test/fixtures/deed_egress/invalid/var-lowercase_chora.deed
  • test/fixtures/deed_egress/invalid/workflow-dot-start_chora.deed
  • test/fixtures/deed_egress/invalid/workflow-double-dot_chora.deed
  • test/fixtures/deed_egress/invalid/workflow-path_chora.deed
  • test/fixtures/deed_egress/rsr-template-repo_chora.deed
  • test/fixtures/deed_egress/template-main/rsr-template-repo_chora.deed
  • test/fixtures/deed_egress/valid/empty-clause_chora.deed
  • test/fixtures/deed_egress/valid/github-only_chora.deed
  • test/fixtures/deed_egress/valid/hyphenated-host_chora.deed
  • test/fixtures/deed_egress/valid/no-egress_chora.deed
  • test/fixtures/deed_egress/valid/template-pair_chora.deed
  • test/research_extensions_equivalence_test.exs
  • test/research_extensions_test.exs
  • 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-14T20:33:39.434254Z 27d2ae2 New commits
🔒 Security Review ✅ Completed 2026-11-14T20:34:02.344315Z 27d2ae2 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 140d84c9a3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/hypatia/deed.ex
base == "0-AI-MANIFEST.deed" -> {:ok, "repo-deed"}
MapSet.member?(@contractile_files, base) -> {:ok, "contractile-deed"}
MapSet.member?(@descriptile_files, base) -> {:ok, "descriptile-deed"}
String.ends_with?(base, "_praxis.deed") -> {:ok, "praxis-deed"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate praxis deed stems before dispatching

When parse/2 receives a praxis filename with an empty or illegal stem, such as _praxis.deed or ☃_praxis.deed, this suffix-only check dispatches it as a praxis-deed and accepts otherwise valid contents. The deed-filename stem is required to be nonempty and limited to ASCII letters, digits, ., _, and -, so praxis filenames need the same stem validation already applied to _chora.deed files to preserve the claimed gate equivalence.

Useful? React with 👍 / 👎.

@hyperpolymath
hyperpolymath merged commit 681b011 into main Nov 14, 2026
8 checks passed
@hyperpolymath
hyperpolymath deleted the fix/deed-parser-v2 branch November 14, 2026 20:30
@sonarqubecloud

Copy link
Copy Markdown

hyperpolymath added a commit that referenced this pull request Nov 14, 2026
#1133 broke (#1136)

## Summary

#1133 (Deed parser v2) merged while one Codex finding and four red
checks were still open. Three of the four reds came from #1133 and are
fixed here. The fourth was already red on main.

## Changes

1. **Codex, `lib/hypatia/deed.ex:104`.** `dispatch/1` accepted any
`*_praxis.deed` without checking the stem.
- In deed.abnf (146–148), `praxis-file` and `repo-file` share one rule:
`stem = 1*( ALPHA / DIGIT / "-" / "." / "_" )`. One `stem/3` now
enforces it for both suffixes.
- Tests: `_praxis.deed`, `☃_praxis.deed`, `café_praxis.deed` and `a
b_praxis.deed` are refused by both `dispatch/1` and `parse/2`.
`my-proj.v2_x_praxis.deed` is accepted. The chora cases still refuse.
2. **Elixir Compile (dogfood toolchain).** `check-no-active-logtalk.sh`
fails on the vendored fixture
`test/fixtures/deed/standards/valid/rsr-template-repo_chora.deed:110`,
which carries the upstream `:report-format "logtalk"`.
- The fixture is added to `.logtalk-allowlist` with the same class
("vendored upstream fixture") and the same removal condition as its two
identical siblings already listed.
- The list's header asks for rule-level review of a new entry. That
review belongs here, because editing the fixture would break its
byte-faithfulness to standards.
3. **governance / UUID v7 and UUID v8 conformance.** `check-uuid-v8.sh
--strict` (pinned at standards 7641c7f) flagged four ids in
`test/deed_conformance_test.exs` that are deliberately not v8.
- Those inputs are now built at run time from one v8 id by swapping its
version and variant nibbles. The assertions are unchanged, and the v5
case now also checks the refusal reason.
- The test file and three vendored invalid fixtures go into
`.uuid-v8-exempt`, following the `test/deed_test.exs` precedent. The
fixtures pass the pinned gate but fail the current standards script, so
the exemption keeps them from breaking when the pin moves.
   - No real id or domain is touched.
4. **Escript packaging soundness: not this change.** It failed on
`undefined function deed_state/1`, which came from #1117's merge. That
red push run sat on 6033a78, before #1125/#1128/#1132. The same error
reproduces on 6033a78, and an unrelated PR failed the same way before
#1133 merged. Current main passes (43638218845).

## Verification

Run with Elixir 1.19.4 / OTP 27.3.4.19, the CI versions:
- `mix compile --warnings-as-errors`: exit 0.
- `mix test`: 3338 tests, 0 failures, 246 excluded (seed 0;
`verisim_data` and the other excluded tags as configured).
- `test/soundness/run-escript-soundness.sh`: 14/14.
- The consumer-shaped scan output passes `check-findings-schema.sh`.
- `mix format --check-formatted` passes on the changed files.
- `check-uuid-v8.sh --strict` passes at the pinned and the current
standards versions. The logtalk guard reports 15 allowlisted, 0
violations.

## For the owner

- **Gate looser than the grammar:** the standards gate `deed_lint.js`
(702–703) doesn't check the praxis stem, so it accepts names the grammar
refuses. The reader now follows the grammar.
- **Formatting on main:** 27 files on main fail `mix format
--check-formatted` under 1.19.4, and no workflow runs that check. Not
touched here.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC)_

---------

Co-authored-by: Claude <[email protected]>
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