GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(world): replay_grants omits first-use grants, diverges from ledger after grant_on_use · Issue #10786 · developing-today/code

id(world): replay_grants omits first-use grants, diverges from ledger after grant_on_use #10786

New issue
Copy link
New issue
Copy link
Closed
#10828
Closed
id(world): replay_grants omits first-use grants, diverges from ledger after grant_on_use#10786
#10828
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 16, 2026
Issue body actions

Summary

replay_grants (pkgs/id/crates/id-worlds/src/world/audit.rs:125) claims to fold the retained log back into the final grants state, but it skips every record whose outcome is not "accepted" and only folds UpdateCaps / SetCapsCeiling. First-use provider grants are audited as provider_use / first_use_grant and also persist JournalEntry::CapsGranted — so after any grant-on-use, replayed granted is missing a capability the live ledger holds.

Evidence (origin/main @ aa3472c)

  • pkgs/id/crates/id-worlds/src/world/audit.rs:128: if record.outcome != "accepted" { continue; }, then match only on UpdateCaps / SetCapsCeiling; _ => {} swallows provider_use.
  • pkgs/id/crates/id-worlds/src/world/actor.rs:647-665 audit_provider_decision: Decision::AllowAndGrant => "first_use_grant", action: "provider_use", parameters: {"capability": capability}.
  • pkgs/id/crates/id-caps/src/world_caps.rs CapLedger::decide_for: under grant_on_use, inserts cap into granted and returns AllowAndGrant.
  • Actor persists on all three AllowAndGrant sites (:1533, :1757, :1823): persist(JournalEntry::CapsGranted { granted }).
  • Existing exit test retained_audit_log_replays_to_the_final_grants (pkgs/id/crates/id-worlds/src/world/tests.rs, F12.6 id: F12.6 audit log and OpenTelemetry export #1063) covers only admin UpdateCaps/SetCapsCeiling actions — no first-use path, so the divergence is untested.

Why it matters

Any consumer using replay_grants (audit export, restore verification, grants reconciliation) silently under-reports grants on worlds with grant_on_use enabled — the exact worlds where grants change without admin action. The journal says granted; the replay says not granted.

Acceptance criteria / fix shape

  • Fold provider_use / first_use_grant capability from parameters.capability into replayed.granted (insert single cap; respect ceiling semantics if needed).
  • Extend the F12.6 replay test with a first-use grant: enable grant-on-use, exercise one provider use, assert replay_grants(&records).granted == caps_report().granted.
  • Keep refused/denied replaying as nothing.

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 16, 2026
  2. developing-today commented on Nov 16, 2026

    @developing-today
    developing-todayBot
    on Nov 16, 2026 – with developing.today
    Contributor
    More actions

    CODE-3903

  3. developing-today
    added
    status:in-review
    on Nov 16, 2026
  4. dezren39
    closed this as completedin #10828on Nov 16, 2026
  5. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.