Skip to content

Refuse an entity outside its directory's namespace, including revocation targets (issue 3) - #157

Open
Hafeok wants to merge 2 commits into
claude/great-feynman-zcdsdd-step-10-repository-storefrom
claude/great-feynman-zcdsdd-step-03-belonging
Open

Hafeok wants to merge 2 commits into
claude/great-feynman-zcdsdd-step-10-repository-storefrom
claude/great-feynman-zcdsdd-step-03-belonging

Conversation

@Hafeok

@Hafeok Hafeok commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #146 — PRD ledger/prd/namespace-independence-prd.md §6 issue 3 (§3.7; ruling 45; AC-45).

Stacked on #156 (issue 10): the diff against main includes #154, #155 and #156. Review the last commit alone, 61bd97ed.

What lands

A file's namespace is its directory (LP-3.34), so every entity under ns/<ns>/ belongs to <ns>. The new verify::belonging stage makes each one that does not a SCHEMA fault naming the entity:

  • a decision id of another namespace; a version or an acceptance of such a decision;
  • a binding or a policy whose namespace is another;
  • a revocation of an acceptance or a grant filed under another directory (the second half of N12, with ruling 49's duplicate-id fault);
  • a grant acceptance or an interval naming a grant filed elsewhere; an availability ending an interval filed elsewhere;
  • a sidecar under a namespace other than its entity's.

A record whose target is not filed is already a fault (authority::references) and is left to that finding. A change-set the writer can home nowhere carries an empty namespace and is judged by the finding that says why, not here. No class is added. The writer side of LP-3.33 (homing a change-set by its one namespace, refusing a mixed one) already landed in #154 and is cited, not rebuilt.

verify::verify had its landing-free file checks moved into file_findings so the function stays under the 40-line gate.

Tests (AC-45)

Each failed before the change.

  • ledger-core/src/verify/belonging_tests.rs: a decision, its version and its acceptance of another namespace each named; a binding, a policy and a revocation target of another namespace named; an unhomed candidate not judged here.
  • ledger-cli/tests/belonging.rs: a decision of B under A; an acceptance of B under A; a revocation under A of B's acceptance (and the same revocation under B in its place, conformant); B's opening change-set under A, its policy and binding each named.
  • One existing unit-test store (genesis_role_tests) had homed a fixture.ledger policy under a hafeok.ledger file; its policy now names the file's namespace.

Protocol

LP-3.33 loses its not-implemented mark and its note on the implemented format; LP-8.8 gains the clause; Appendix B row; Appendix C note "An entity outside its namespace's directory is refused". No digest moves; CANONICAL_FORM stays v1; no committed file in this repository is mixed (0 of 187).

Checks

cargo build, cargo t, cargo clippy --workspace -- -D warnings -D clippy::unwrap_used, the quality scripts, and ledger verify --export on this repository (same output as on main: 284 entries, 93 decisions, 3 awaiting, 2 notices, exports matching).

🤖 Generated with Claude Code

https://claude.ai/code/session_01GgRcHXmnAu43hChNxhnqxU


Generated by Claude Code

Hafeok commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI, standing down on one step. The check job fails at the contract-surface gate (ddd diff-contracts <base>..HEAD): 2 undischarged exposed-surface changes, both this PR's — verify/belonging.rs#findings added and verify/mod.rs#belonging added. Every other step of check passed (build, tests, clippy, ledger verify --export, ddd validate).

The remedy the gate names is ddd bind claude/great-feynman-zcdsdd-step-10-repository-store..HEAD (with --verdict), which files seam declarations under .ddd/seams/. The session's instructions forbid me to edit .ddd/, and a declaration's verdict_knowledge is the author's judgment, so I am not filing them. Please run ddd bind on this branch and push, or tell me to. Recorded in the close-out, ledger/sessions/2026-10-namespace-layout-authority.md.


Generated by Claude Code

@Hafeok
Hafeok force-pushed the claude/great-feynman-zcdsdd-step-10-repository-store branch from 92b8e57 to efc4bc5 Compare October 11, 2026 06:13
@Hafeok
Hafeok force-pushed the claude/great-feynman-zcdsdd-step-03-belonging branch from 61bd97e to 74fb858 Compare October 11, 2026 06:14
Hafeok added a commit that referenced this pull request Oct 11, 2026
Issue #147 (PRD issue 4, §3.7; rulings 43 and 75; AC-43). Only
`based_on` crosses a namespace. The new `verify::crossing` stage makes a
decision's latest version whose `supersedes` names a decision of another
namespace a `SCHEMA` fault naming the decision, the edge and the other
namespace. Earlier versions are history and are not judged, so a next
version that drops the edge repairs the store — the same withdrawal
LP-8.21 records for a losing claimant. The writer refuses the verb by the
gate it runs over the store as it would be; `G001` keeps the dangling
target, whichever namespace it names. No class is added.

Tests (each failing before the change): `crossing_tests` over in-memory
stores (a latest version superseding another namespace is named with
both ids; a next version dropping the edge repairs it while history keeps
the claim; a supersession within the namespace is not a crossing), and
`ledger-cli/tests/crossing.rs` over a two-namespace store: `supersede`
across namespaces is refused in both directions and writes nothing; a
crossing filed by hand past the verb fails the gate,
and a hand-filed next version without the edge makes the store
conformant again; a supersession at home still stands.

Protocol: LP-3.31 loses its not-implemented mark and its note; LP-8.8
gains the clause; Appendix B row. No Appendix C note (the issue row says
none). No digest moves; no such edge in this repository or the fixtures.

Stacked on #157 (issue 3).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgRcHXmnAu43hChNxhnqxU
Hafeok and others added 2 commits October 11, 2026 06:22
…s included

Issue #146 (PRD issue 3, §3.7; ruling 45; AC-45). A file's namespace is
its directory (LP-3.34), so every entity under `ns/<ns>/` belongs to
`<ns>`. `verify::belonging` makes each one that does not a `SCHEMA`
fault naming the entity: a decision id of another namespace, a version
or an acceptance of such a decision, a binding or a policy whose
`namespace` is another, a revocation of an acceptance or a grant filed
under another directory, a grant acceptance or an interval naming a
grant filed elsewhere, an availability ending an interval filed
elsewhere, and a sidecar under a namespace other than its entity's. A
record whose target is not filed is already a fault and is left to that
finding; a candidate the writer could home nowhere is judged by the
finding that says why, not here. No class is added.

Tests (each failing before the change): `belonging_tests` over in-memory
stores (a decision, its version and its acceptance of another namespace
each named; a binding, a policy and a revocation target of another
namespace named; an unhomed candidate left alone), and
`ledger-cli/tests/belonging.rs` over stores the verbs built and a hand
misfiled: a decision of B under A, an acceptance of B under A, a
revocation under A of B's acceptance (and the same revocation under B in
its place), and B's opening change-set under A, its policy and binding
named. One unit-test store had homed a `fixture.ledger` policy under a
`hafeok.ledger` file; its policy now names the file's namespace.

Protocol: LP-3.33 loses its not-implemented mark and its note; LP-8.8
gains the clause; Appendix B row; Appendix C note "An entity outside its
namespace's directory is refused". No digest moves; no committed file in
this repository is mixed (0 of 187).

Stacked on #156 (issue 10).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgRcHXmnAu43hChNxhnqxU
Files the signed bindings the contract-surface gate demands for this
step's two exposed Rust surface changes: a new declaration for
verify/belonging.rs with its verdict_knowledge written, and the
verify/mod.rs declaration amended with the binding for the new module.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgRcHXmnAu43hChNxhnqxU
@Hafeok
Hafeok force-pushed the claude/great-feynman-zcdsdd-step-10-repository-store branch from efc4bc5 to ef2ce1a Compare October 11, 2026 06:22
@Hafeok
Hafeok force-pushed the claude/great-feynman-zcdsdd-step-03-belonging branch from 74fb858 to eb6bf21 Compare October 11, 2026 06:22
Hafeok added a commit that referenced this pull request Oct 11, 2026
Issue #147 (PRD issue 4, §3.7; rulings 43 and 75; AC-43). Only
`based_on` crosses a namespace. The new `verify::crossing` stage makes a
decision's latest version whose `supersedes` names a decision of another
namespace a `SCHEMA` fault naming the decision, the edge and the other
namespace. Earlier versions are history and are not judged, so a next
version that drops the edge repairs the store — the same withdrawal
LP-8.21 records for a losing claimant. The writer refuses the verb by the
gate it runs over the store as it would be; `G001` keeps the dangling
target, whichever namespace it names. No class is added.

Tests (each failing before the change): `crossing_tests` over in-memory
stores (a latest version superseding another namespace is named with
both ids; a next version dropping the edge repairs it while history keeps
the claim; a supersession within the namespace is not a crossing), and
`ledger-cli/tests/crossing.rs` over a two-namespace store: `supersede`
across namespaces is refused in both directions and writes nothing; a
crossing filed by hand past the verb fails the gate,
and a hand-filed next version without the edge makes the store
conformant again; a supersession at home still stands.

Protocol: LP-3.31 loses its not-implemented mark and its note; LP-8.8
gains the clause; Appendix B row. No Appendix C note (the issue row says
none). No digest moves; no such edge in this repository or the fixtures.

Stacked on #157 (issue 3).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgRcHXmnAu43hChNxhnqxU
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.

1 participant