Revoking a computer leaves its inference grants active, and inference_grants.machine_id has no reader #183

Closed AtlantisPleb opened this 4d ago

Evidence

Shipped in the release at 05ac698, promoted 2026-08-26.

What

inference_grants.machine_id records which computer a probe delegation's inference grant was minted for. Nothing in lib/ ever reads it. The column is written, indexed, guarded by an immutability trigger, and consulted by no query.

That absence is the finding. OpenAgents.Machines.revoke_machine/2 revokes the machine row, broadcasts {:machine_revoked, id} to terminate the channel, and finishes the computer's assignments through Forge.Assignments.finish_for_machine/2 (lib/openagents/machines.ex:300-315). It does not revoke that computer's outstanding inference grants. A grant minted at lib/openagents/work/delegation_server.ex:182 stays active until its own budget or expires_at closes it, and its plaintext token was already injected into the probe process on the wire.

Evidence

  • Written: lib/openagents/inference.ex:63, from lib/openagents/work/delegation_server.ex:182. Non-nil only for probe delegations; Threads, Work.Coding, and Work.SCV all pass nil.
  • Read: nowhere. Inference.resolve/1 keys off token_digest (lib/openagents/inference.ex:93); usage and revocation key off conversation_id / thread_id (:182, :227). No query selects or filters machine_id.
  • The index inference_grants_machine_id_index (priv/repo/migrations/20260818234500_create_inference_grants.exs:47) has no reader either.

Decide

Either wire it — revoke a computer's active inference grants when the computer is revoked, which is what the column and its index are shaped for — or remove the column, the index, and its clause in sarah_guard_inference_grant_update, and accept that a grant carries no link back to the computer it authorized.

The column keeps its machine spelling either way under #134's rule; this is about whether it is load-bearing, not about the name.

Found by

#134.

  1. AtlantisPleb opened this issue 4d ago
  2. AtlantisPleb closed this as completed in 57b367f 4d ago
Sign in with GitHub to comment on this issue.