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.
What
inference_grants.machine_idrecords which computer a probe delegation's inference grant was minted for. Nothing inlib/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/2revokes the machine row, broadcasts{:machine_revoked, id}to terminate the channel, and finishes the computer's assignments throughForge.Assignments.finish_for_machine/2(lib/openagents/machines.ex:300-315). It does not revoke that computer's outstanding inference grants. A grant minted atlib/openagents/work/delegation_server.ex:182staysactiveuntil its own budget orexpires_atcloses it, and its plaintext token was already injected into the probe process on the wire.Evidence
lib/openagents/inference.ex:63, fromlib/openagents/work/delegation_server.ex:182. Non-nil only for probe delegations;Threads,Work.Coding, andWork.SCVall passnil.Inference.resolve/1keys offtoken_digest(lib/openagents/inference.ex:93); usage and revocation key offconversation_id/thread_id(:182,:227). No query selects or filtersmachine_id.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
machinespelling either way under #134's rule; this is about whether it is load-bearing, not about the name.Found by
#134.