GeezerVison is showing github.com — id: implement #5751 invite terms extension — InviteBody target/uses/depth/redeemer/parent, postcard versioning, 512-byte budget · Issue #12983 · developing-today/code
id: implement #5751 invite terms extension — InviteBody target/uses/depth/redeemer/parent, postcard versioning, 512-byte budget #12983DescriptionRefs #5751, #12922.
Scope
Implement step 1 of the #5751 design record's implementation shape (§5): extend the signed invite event's body with the delegation terms the record specifies. Today InviteBody (pkgs/id/crates/id-directory/src/invites/event.rs) is a fixed-layout format carrying only inviter / ticket_digest / group / role / expires_ms — none of the §2–§4 terms exist in code yet, and every later #5751 step (redemption journaling, per-link listing) plus the #5959 §7 capability_pin term (#12922) attaches to this terms object.
- Extend
InviteBody (postcard, versioned, per id: design: Wire format & transport adapters — postcard schema, non-UDP carriers, relays/proxies #5674): target (group, or world + its fronting group), uses_cap: Option<u32> + redemption counting, depth_remaining: u8, parent_digest: Option<[u8; 32]>, redeemer: Option<[u8; 32]>.
- Enforce the §1 budgets: event body ≤ 512 bytes as a hard parser limit (an over-budget body is refused at decode), and the paste form ≤ 512 chars at mint.
- Defaults per §3/§4: source invites under open delegation mint
depth_remaining = 1 (policy may raise to at most 3), moderator-grant invites default 0; link invites default to 7-day expiry and a 25-use cap unless the inviter sets otherwise.
- The existing fixed-layout events are the v1 wire form: the versioned body must keep reading them (or name the migration explicitly) — do not silently break invites already minted.
Dependency / ordering
This is the prerequisite slice for #12922 (invite capability_pin term): the pin is one optional field in the terms object this issue creates. #12922's redemption side additionally rides #12921 (baseline store + release-record resolution).
Test oracles
- Round-trip: a body carrying every term encodes/decodes byte-identically; a v1 fixed-layout event still parses.
- Budget: a body encoded over 512 bytes is refused at decode; mint refuses a paste form over 512 chars.
- Terms: redeemer-pinned invite refuses a different redeemer and accepts the pinned one; depth never increases along a re-mint (child depth < parent depth); default expiry/use-cap land when the inviter sets neither.
Design of record: #5751 §1–§5. Filed by Lane HH (archer) from the #12922 premise check, 2026-11-23: #12922 named this terms object as its home and no tracking issue existed for it. Activitydeveloping-today commented on Nov 23, 2026 dezren39 commented on Nov 23, 2026 🤖 Agent note · Lane HN (archer) claiming this slice.
Premise check: issue open, no live claim (only the bot link comment above), #5751 design record closed/landed. Plan: extend InviteBody per §5 step 1 — versioned postcard body carrying target / uses_cap / depth_remaining / parent_digest / redeemer, 512-byte decode budget + 512-char paste budget at mint, §3/§4 defaults, v1 fixed-layout events still parse. One PR with the declared test oracles (round-trip, budget refusal, terms enforcement). dezren39 commented on Nov 23, 2026 🤖 Agent note · Lane HN (archer): PR open — PR #13046 implements this slice (step 1 of the #5751 record's §5 shape).
What landed in the PR: v2 wire form (IDINV magic + version, postcard body per #5674) carrying target / uses_cap / depth_remaining / parent_digest / redeemer; the v1 fixed layout becomes the legacy read form (parses, verifies, re-serializes in its own form, legacy terms); §1 budgets enforced at decode (body ≤ 512 B) and at mint (paste form ≤ 512 chars via Invitation::link/bare); §2/§3 mechanics (InviteTerms::source/link defaults, source-depth cap 3, child_terms strict depth decrease + parent digest, check_redeemer, admits_redemption).
Verification: cargo test -p id-directory 281 passed / 0 failed; facade cargo test --test invites 23 passed / 0 failed; rustfmt clean; clippy exit 0 with no warning sites in the changed files. Merging on this evidence; the close will follow the merge. dezren39 commented on Nov 23, 2026 🤖 Agent note · Lane HN (archer): done — PR #13046 merged (4a69436ddd80, head-SHA guarded at 5aee03f23f3), and this issue is closed as completed.
Final verification on the merged tree (laptop worktree off origin/main, nix develop in pkgs/id): cargo test -p id-directory 281 passed / 0 failed (9 invite-event tests, 6 new); facade cargo test --test invites 23 passed / 0 failed (3 new); cargo clippy -p id-directory --all-targets exit 0, no warning sites in the changed files; rustfmt clean; Cargo.lock diff is the single postcard edge.
What this unlocks: #12922's capability_pin term now has its terms object to attach to. Remaining #5751 steps stay as filed in the record's §5: redemption journaling + counting (step 2), revocation/rotation (step 3), group fronting-set evaluation (step 4), client defaults wiring beyond the terms constructors (step 5).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|