Skip to content

id(graph): signed user-attribute definitions and policy (A-GRAPH-9127-01) - #12862

Merged
dezren39 merged 1 commit into
mainfrom
lane-cv/10222-attribute-definitions
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-cv/10222-attribute-definitions

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Implements slice A-GRAPH-9127-01 for #10222 (design part A §6.1/§12; statements S5.13–S5.19, S5.22–S5.24, S5.29).

Preflight (queue task 17063): native blockers fresh-checked 2026-11-22 — #9083 CLOSED/completed and #10196 CLOSED/completed, so the mandatory preflight passes and implementation proceeded within the approved scope only.

What lands

  • pkgs/id/crates/id-core/src/graph/attribute.rs (new, declared in graph/mod.rs per its same-change rule): AttributeDefinition, a signed owner/group object at (tenant, owner_space, target, name) with kind, optional schema reference, audience, explicit closed | open | moderated append mode, admission rule, retention/deletion policy ID and revision. Canonical-CBOR payload in a signed envelope under domain id/attribute-definition; the envelope context is the tenant ID and must match the payload tenant.
  • Tenant authority is design(pm-stack): tenancy architecture — per-user Turso databases + central tenancy DB, served by Workers and Durable Objects #9083's owned boundary, consumed only via the TenantAuthority trait: authorize_definition (signer authorized in-tenant; revision implies define vs edit) and check_policy_revision (same scope, exactly next revision, predecessor chained, authorized editor — S5.22/S5.23). References homed in another tenant reject unless the authority records a deliberate sharing decision (design §12).
  • pkgs/id/crates/id-core/tests/attribute_definition.rs (new): the reference oracle — an independent schema validator written in the test file plus a design(pm-stack): tenancy architecture — per-user Turso databases + central tenancy DB, served by Workers and Durable Objects #9083 tenant-authority fixture.

Evidence — cargo test -p id-core --test attribute_definition (in nix develop, pkgs/id):

running 6 tests
test explicit_append_modes_are_distinct_states ... ok
test malformed_scope_and_policy_reject ... ok
test cross_tenant_references_reject ... ok
test unauthorized_policy_edits_reject ... ok
test envelope_tenant_binding_and_domain_reject ... ok
test canonical_definitions_round_trip ... ok
test result: ok. 6 passed; 0 failed

Changed files: the two new files above plus the one-line module declaration in graph/mod.rs (3 files, +1455). Rollback per the slice: remove only the new module/test and the declaration; no Atlas or content-location records are touched.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…-01, #10222)

AttributeDefinition: a signed owner/group object at (tenant, owner_space, target, name) with kind, optional schema ref, audience, explicit closed/open/moderated append mode, admission rule, retention policy ID and revision. Envelope context binds the tenant; policy edits must chain scope/revision/predecessor under the #9083 TenantAuthority boundary; cross-tenant references reject without a recorded sharing decision.

Oracle (reference): cargo test -p id-core --test attribute_definition — 6 passed, 0 failed. Independent schema validator plus tenant-authority fixture in the test file.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 04:01
@dezren39
dezren39 merged commit dfeaaf5 into main Nov 23, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

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 28 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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 964287a8-01ea-4c3f-80ff-64684fe83740
Commits

Reviewing files that changed from the base of the PR and between c988f36 and ff20d10.

Files selected for processing: 3

  • pkgs/id/crates/id-core/src/graph/attribute.rs
  • pkgs/id/crates/id-core/src/graph/mod.rs
  • pkgs/id/crates/id-core/tests/attribute_definition.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

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