Skip to content

Plan 08 steps 1–2: owner-mode signing via the tenant's AA wallet - #83

Merged
JamesReate merged 7 commits into
mainfrom
plan-08-aa-owner-signing
Sep 1, 2026
Merged

JamesReate merged 7 commits into
mainfrom
plan-08-aa-owner-signing

Conversation

@JamesReate

@JamesReate JamesReate commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Plan 08 (docs/plans/08-aa-owner-signing.md, in this PR): an operator tenant configures a Kernel v3.1 AA wallet + root key as an encrypted tenant credential; when that wallet owns a vehicle, this service signs shares and revokes itself through the sudo validator — no passkey, no owner-registered-our-signer arrangement. Managed customers inherit through effective-credential resolution.

Step 1 — credential + config surface. Migration 20260831120000 (two columns on tenant_credentials, both-or-neither CHECK); PUT/GET/DELETE /v1/tenants/{id}/credentials/aa-wallet behind the standard scope check. Strict validation before anything persists: address/key parse, license-holder check, and on chain — RPC answers the configured chain, the kernel is deployed, and the sudo ECDSA validator's owner record (ecdsaValidatorStorage(address), verified against the deployed Polygon contract) matches the supplied key. The key goes in and never comes out; CredentialService.AAWalletSigner decrypts it for one operation at a time.

Step 2 — owner mode in the sharing engine. AuthorizeShare returns the mode; share/revoke workers dispatch by it (sendByMode) — owner mode routes through a new OwnerClient (one long-lived zerodev.Client, per-job wallet + signer, raw-hash sudo signature), signer mode is byte-for-byte the existing path. shareable-owners reports the AA wallet as a configuration-backed positive with an ownerModeWallet field. Owner mode rides the sharing config — one ZeroDev project carries both signing paths (the sponsoring project is BUNDLER_URL's, confirmed), so OwnerModeConfigured() equals SharingConfigured() and the feature's switch is the per-tenant wallet row: clear it to turn one tenant off, empty a sharing setting to turn everything off. Typed shared operations refuse owner-mode vehicles (409 + worker guard) until step 7.

Ships dark: no tenant has an AA wallet until the console lands (step 3).

Note: TestRenewMembershipNeverBackdates fails on origin/main as well (date-sensitive, unrelated); everything else is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk

JamesReate and others added 3 commits August 31, 2026 21:52
An operator tenant configures a Kernel v3.1 AA wallet + root key as a
tenant credential; when that wallet owns a vehicle, this service signs
operations itself through the sudo validator instead of requiring a
passkey or the owner-registered-our-signer arrangement. Decisions locked
2026-08-31; first slice is fleet-lite sharing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk
Two columns on tenant_credentials (aa_wallet_address, aa_wallet_key_enc,
both-or-neither enforced by a CHECK), a strict config endpoint that
refuses a wallet the chain cannot verify — deployed code, sudo ECDSA
validator owner matching the supplied key, RPC answering the configured
chain — and an AAWalletSigner decrypt path with the same
one-operation-lifetime rule as every other key here. Reads resolve
effectively, so a managed customer sees (and will later share with) its
operator's wallet; writes land only where the license lives.

The validator storage getter (0x20709efc) was verified against the
deployed Polygon contract before being coded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk
AuthorizeShare now answers WHICH WAY to sign: when the live owner is the
tenant's own AA wallet, the share or revoke goes through the kernel's
sudo validator, signed with the wallet's root key — no passkey, no
owner-registered-our-signer arrangement. Everything else falls through
to the signer path unchanged.

One switch, three surfaces: AA_BUNDLER_URL (its own ZeroDev project —
sponsorship is per-project, and the sponsoring project was confirmed
2026-08-31) gates the authorizer, the display gate and the workers
through OwnerModeConfigured, so half-configured means off everywhere,
never a wrong-validator attempt. The chart wires it from ASM behind a
values flag rather than into values itself — this repo is public and
the URL embeds the project id.

One long-lived owner client serves every tenant's wallet: the op is
built for the job's wallet, signed by a per-job signer, submitted
pre-signed. Typed shared operations refuse owner-mode vehicles (409 at
the endpoint, a named error in the worker) until step 7.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk
@JamesReate JamesReate changed the title Plan 08: owner-mode signing via the tenant's AA wallet (docs + step 1) Plan 08 steps 1–2: owner-mode signing via the tenant's AA wallet Sep 1, 2026
JamesReate and others added 4 commits September 1, 2026 07:45
The sponsoring ZeroDev project is the one BUNDLER_URL already carries,
so AA_BUNDLER_URL held the same value twice and is folded away, along
with the chart's gated remoteRef and values flags. OwnerModeConfigured
now equals SharingConfigured — kept as its own method because three
surfaces consult it by name. The feature's switch is the per-tenant
aa_wallet credential row: clear it to turn one tenant off, empty a
sharing setting to turn everything off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk
FilterSignable's refactor left tenantSigner unused (lint), and the new
FilterSignableOwnerMode test called testStore with the parent test's t
from inside subtests — on a runner with no database that turns the skip
into a panic. The fixture now takes the subtest's t.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pBnm1rp9MV5SDWj8hkbGk
@JamesReate
JamesReate marked this pull request as ready for review September 1, 2026 14:53
@JamesReate
JamesReate merged commit a807db8 into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant