Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/e2e/owner-budget-testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ async function run(execute: boolean): Promise<void> {
if (kind === 'human_sbt' && b.body.binding?.human_token_id) {
// A proof-of-human wallet binds as human_sbt. Its budget is the stake of the account that holds the
// same wallet (step 1), but only where the server has HUMAN_SBT_OWNER_BUDGET_ENABLED=true
// (owner-budget.ts ownerBuilderOfAgent). Not readable from here: step 3b answers no_owner_budget
// where it is off, before any USDC moves.
// (owner-budget.ts ownerBuilderOfAgent). Not readable from here. Where it is off, the first owner-budget
// read answers no_owner_budget before any USDC moves: step 3b in stake mode (the spend-limit route), and
// step R in wallet mode, where 3b does not run.
log('3-bind', `${a.name} bound to the owner as a verified human (${b.body.binding.human_token_id}); its budget is account ${builderId}'s stake`, b.body);
} else if (kind !== 'builder' || String(b.body.binding?.builder_id) !== builderId) {
stop('3-bind', `bound as ${kind} ${b.body.binding?.builder_id ?? b.body.binding?.human_token_id}, not builder ${builderId}.`, b.body);
Expand Down
6 changes: 5 additions & 1 deletion src/routes/agent-spend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ export interface AgentSpendDeps {
/** The wallet bound as this agent's owner, or null if nobody has bound it. */
loadOwnerWallet?: (agentId: string) => Promise<string | null>;
enabled?: () => boolean;
/** The owner's account (builder) whose stake is the shared budget, or null if not a builder. */
/**
* The owner's account (builder) whose stake is the shared budget, or null if there is none
* (owner-budget.ts ownerBuilderOfAgent): a builder owner's own account, or, only with
* HUMAN_SBT_OWNER_BUDGET_ENABLED=true, the account holding a verified human owner's wallet.
*/
loadOwnerBuilder?: (agentId: string) => Promise<string | null>;
ownerBudget?: OwnerBudgetStore;
budgetMode?: () => OwnerBudgetMode;
Expand Down
11 changes: 8 additions & 3 deletions src/services/owner-budget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,14 @@ export const supabaseAgentLimits: AgentLimitStore = {
* proof-of-human owner could not hold a budget at all and the first live run stopped at bind
* (reports/2026-11-16/owner-budget-e2e-execute.attempt1-sbt-wallet.json). With
* HUMAN_SBT_OWNER_BUDGET_ENABLED=true it is the account that holds the same wallet. That wallet is
* the binding's, which bind took from human_sbt_registry, never from the caller, and an account is
* only created for a wallet that signed (POST /account/connect). The binding itself is unchanged, so
* the owner's assurance label stays proof-of-human.
* the binding's, which bind took from human_sbt_registry, never from the caller. The binding itself is
* unchanged, so the owner's assurance label stays proof-of-human.
*
* An account for a wallet does NOT prove that wallet signed. A signed connect (POST /account/connect)
* makes one, but so does POST /builder/register, behind an API key and with no signature from the
* wallet. This comment said "only created for a wallet that signed" until 2026-11-16 (review of #1557).
* What funds the budget is the account's stake, not the account; two accounts for one wallet are
* refused below as ambiguous rather than picked between.
*/
export async function ownerBuilderOfAgent(
agentId: string,
Expand Down
Loading