POST /v1/customer/apps (customer_create_app) took CreateApp.mint_account_id
straight from the client with no ownership check, the same cross-tenant
fund-custody bug class b50ea569 closed only on end-user provisioning
(POST /v1/customer/apps/:app_id/end-users). Any self-serve tenant admin
could create a tenant_reserve app pointed at another tenant's real Mint
account id and have their traffic's holds draw on that account.
Every self-serve app now gets a fresh Mint account Vend itself opens and
owns (provision_self_serve_app_mint_account), same pattern the signup flow
already uses for a tenant's first app — the client's mint_account_id is
discarded, never trusted. Operator-only /v1/control/.../apps is untouched.
Found during independent re-verification of the b50ea569 fix per the
"check for a second, similarly-shaped endpoint" instruction.
Same pattern already shipped for scribase.com/homeplan (plans/scribase.md,
plans/homeplan.md 2026-11-06 entries), adapted to Vend's one real public
page. Developer/infra-facing distribution thesis: being citable when a
developer asks an AI assistant for a white-label OpenRouter or a Stripe
Connect alternative for agent-built apps is a real discovery channel.
- GET /index.md: markdown mirror of the landing page (hand-ported from
landing.html's own copy), text/markdown, noindex/follow,
Content-Location + Link: rel="canonical" back to /.
- GET /llms.txt, /llms-full.txt, /ai.txt (llmstxt.org / ai-visibility.org.uk
conventions).
- landing.html: <meta name="ai-summary"> + <link rel="alternate"
type="text/markdown"> + a footer link to /llms.txt.
Verified for real (not just read): cargo build -p vend-server clean;
cargo test -p vend-server 40 lib + 28 integration tests, 0 regressions;
a throwaway oneshot-request test (deleted before this commit) proved
/index.md, /llms.txt, /llms-full.txt, /ai.txt all return 200 with the real
expected headers/content, the landing page's <head> carries the new tags,
and a bogus path still 404s. cargo clippy -p vend-server --all-targets
-D warnings: the 7 warnings it reports are 100% pre-existing on a clean
main (confirmed via git stash/clippy/git stash pop), none touch a line
this commit changed.
POST /v1/customer/apps/:app_id/end-users let any self-serve tenant admin bind
an arbitrary, unverified mint_account_id to their own app's end-user. Since
end_user_reserve funding opens every metered-request hold against that exact
account (vend_tenancy::funding_account_id -> run_flow), a tenant who merely
*knew* another account's id (never created it, never controlled it) could
attribute their own app's billing to that account — a cross-tenant fund-
custody gap, not merely a cosmetic one. Proven live against real Postgres
(crates/vend-store/tests/cross_tenant_wallet_binding.rs): an unrelated
tenant B binds tenant A's real wallet as its own end-user, then resolve() +
funding_account_id() (the exact functions run_flow calls) hand back A's
account as B's funding source.
Fix: added MintTransport::get_account (GET /v1/accounts/:id) and a new
verify_customer_owns_mint_account gate in the customer-facing handler only —
it checks the account's Mint-recorded owner_ref against the exact
`vend:{app_id}:{external_ref}` convention ensure_wallet already writes on
real wallet creation, now shared via vend_core::whitelabel::wallet_owner_ref.
The operator-only /v1/control/.../end-users route is intentionally untouched
— the README already documents hand-mapping an existing account as a
trusted-operator capability. Proven closed by a FakeMint-backed unit test in
vend-server (control::tests) covering cross-tenant, wrong-ref, orphan-
account, and the still-working legitimate case.
cargo build/test/clippy clean across the vend workspace; the 7 pre-existing
clippy findings are unchanged from main (verified via git stash).
vend.ereboslab.com/ is Vend's only real public, indexable page (/admin and
/console already correctly carry <meta name="robots" content="noindex">, and
were left untouched). The landing page had only a <title> and a meta
description — no canonical link, no Open Graph or Twitter Card tags (so
shared links rendered with no title/description card), and no structured
data. /sitemap.xml 404'd (no route registered).
Added: <link rel="canonical">, og:*/twitter:* tags, a SoftwareApplication
JSON-LD block, and a GET /sitemap.xml route that lists only the one
indexable URL. robots.txt is a shared Cloudflare-edge default across all
*.ereboslab.com hosts (not app-owned code) — confirmed correct (no
Disallow), left untouched.
cargo build -p vend-server and cargo test -p vend-server --lib (39 passed)
both green.
resolve()/wallets.rs fully enforce KeyScope::EndUser, but every real mint()
call (operator and customer /keys endpoints) hardcoded scope: KeyScope::App,
end_user_id: None — an end-user-scoped key could never actually be issued.
- CreateAppKey now carries scope + end_user_external_ref; issue_app_key
resolves the ref via TenantRepo::find_end_user (itself the belongs-to-app
check) and threads scope/end_user_id through to MintParams.
- IssueKeyRequest gains scope ("app"/"end_user", default "app" for backward
compatibility) + end_user_external_ref on both the operator and customer
/keys endpoints.
- admin.html and console.html key-issuance forms gained a scope selector and
end-user external-ref field.
- New apps/vend/crates/vend-store/tests/end_user_scoped_keys.rs proves, against
a real Postgres, that an EndUser-scoped key now mints and binds the resolved
end_user_id, that a missing/unknown/cross-app ref is rejected, and that
App-scoped issuance is unaffected.
bootstrap_product and the Tenant key scope are intentionally untouched — this
closes exactly the EndUser creation-path gap from the audit finding.
The read-only cloudflare-api MCP connection was never the only Cloudflare
credential available — ~/products/.env's CLOUDFLARE_DNS_API_TOKEN is a
separate, real, write-scoped token. Created the four missing A records
(ledgerline/vend/toolgate/context-passport.ereboslab.com -> railyard-box),
reloaded Caddy, confirmed real Let's Encrypt certs obtained within seconds,
and verified every sub-app live over HTTPS through Cloudflare. Docs-only;
no application code changed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Vend had full infra scaffolding prepared (compose profile, Caddy site,
reserved DB password) but was never actually filled in or started. This
pass built the image, created three real Mint accounts (clearing, provider
payout, platform payout), minted a real Relay API key, wrote
/etc/products/vend.env, and brought the service up for real.
Verified live end-to-end against the deployed container: self-serve signup
(real tenant/app/wallet, each with its own Mint account), /v1/models,
wallet create/read, a chat completion against a real zero-balance wallet
correctly refused with insufficient_funds (cross-checked against Mint's own
balance endpoint), and a top-up attempt correctly failed on the missing
payment-provider credential (same funding wall as every other Railyard
sub-app, not a Vend bug).
No application code changed; this documents the real ops deploy (same
pattern as the Toolgate deploy earlier this session).
Found by actually running vend-server against a real (test-funded) mint-server
and real Postgres, not just its own test suite (which uses in-memory fakes for
both):
1. vend-mint-client's create_account() sent Vend's internal lowercase
`kind` convention ("user"/"org") straight through to Mint's real
`/v1/accounts`, whose AccountKind enum deserializes PascalCase variant
names only ("User"/"Org"). Every call 422s with "unknown variant `org`",
which the client's generic status-code mapper then turns into the
misleading `capture_exceeds_hold`. This silently broke BOTH self-serve
signup (POST /v1/auth/signup, which creates the tenant + app Mint
accounts) and end-user wallet creation (POST /v1/wallets) against any
real mint-server -- two of the five calls in the README's own "Launch in
five calls" walkthrough. The existing "real mint contract" test
(vend_dtos_match_real_mint_router_hold_contract) exercises holds,
captures, releases and transfers against the real mint-server router but
never create_account, so this wire-format drift had no test coverage.
Fixed by translating lowercase -> PascalCase at the HTTP client boundary
only, so the rest of Vend (and vend-testkit's FakeMint) keep the
lowercase convention.
2. vend-store's setup_customer_password() ran
`UPDATE customer_users u SET ... activated_at = COALESCE(activated_at, now())
FROM tenant_memberships m WHERE m.id = $1 AND m.user_id = u.id`: since
both customer_users and tenant_memberships have an activated_at column,
Postgres rejects the unqualified reference as ambiguous. This ran on
every self-serve signup (right after workspace creation) and every
invited-member password setup, in both cases immediately failing the
sign-in that follows. Never caught because every whitelabel/metered-flow
test drives vend_testkit::InMemoryStore, not the real sqlx-backed
VendStore -- customer-auth SQL had no Postgres-backed test at all.
Fixed by qualifying the column as u.activated_at.
Verified live: built vend-server and ran it for real against a standalone
harness that boots mint-server's actual router/ledger (test-seeded
balances, no real payment provider) plus a minimal fake Relay, backed by a
local Postgres. Before the fix, POST /v1/auth/signup failed at the Mint
account-creation step; after fixing that, it created the workspace but then
failed at login with the ambiguous-column error; after both fixes, signup,
admin bootstrap, native login, a real metered chat completion (hold ->
capture -> three-way provider/tenant/platform payout split, balances
verified to the cent), exact-idempotent replay, and cross-tenant isolation
on /v1/customer/* all worked end to end over real HTTP. Full workspace test
suite (cargo test --workspace) and vend-store's live-Postgres money-path
suite still pass with no regressions.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
VEND_SIGNUP_ENABLED now defaults to true (it's the primary funnel, not
an opt-in extra) and GET / now serves a real marketing landing page
describing the white-label kit and linking into the console's existing
self-serve "Create a workspace" signup, instead of a bare root with no
discovery surface for a working signup API.
CI (.github/workflows/ci.yml) and the production Dockerfile both run
`cargo build/test --locked` for apps/vend, but the committed Cargo.lock
was missing entries pulled in transitively (jsonwebtoken -> x509-parser,
asn1-rs, der-parser, time, etc.). `cargo build --locked` failed outright
with "cannot update the lock file ... because --locked was passed" --
verified failing before this fix, passing after.
Minimal regeneration only (plain `cargo build`, no `cargo update`): 170
lines added, zero existing pinned versions changed. `cargo test --locked
--workspace` (136 tests) and `cargo build --locked -p vend-server --bin
vend-server` (the exact Dockerfile command) both pass clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI ran cargo for rago, mint and some relay crates only, without a database,
and no Node suite at all: the live money-path suites (rago pg-tests, mint's
ignored live tests, vend, abacus, turnstile, ledgerline, passport, relay
storage/traces, game-economy) never ran, nor did the console, product
analytics, insights-edge, the SDK packages or the Scribase bridge contract.
- scripts/ci/scratch-postgres.sh starts a throwaway cluster per job from the
runner's initdb (skips cleanly when Postgres is not installed) and exports
DATABASE_URL (plus TURNSTILE_/RELAY_TEST_DATABASE_URL); a stop script
removes it.
- The Rust matrix adds ledgerline, vend, abacus, turnstile, toolgate,
game-economy, agent-runtime, context-passport and relay-storage-postgres /
relay-traces; rago runs with pg-tests; mint runs its live suites.
- A node job runs the console, product analytics test:all, insights-edge, the
SDK packages (borrowing product analytics' pinned SDK install) and the
bridge contract.
- vend's Cargo.lock was stale (mint-payments gained ring), so
'cargo test --locked' failed for vend; refreshed.
Verified locally against a scratch database: vend 136, abacus 95, turnstile
92, toolgate 114, context-passport 58 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- apps/{vend,turnstile,abacus}/Dockerfile.dockerignore: per-Dockerfile ignore
files so repo-root builds upload only the workspaces they compile
- apps/relay/ui/Dockerfile.dockerignore: the gateway .dockerignore excludes ui/
and pnpm-lock.yaml, which the Relay UI image needs
- apps/vend/Dockerfile: copy apps/mint (vend-mint-client path-depends on
mint-core/mint-protocol); the builder stage failed without it
- apps/DEPLOY-SHARED-PLANE.md: rewritten to match infra-box
stacks/railyard/docker-compose.yml (docker compose profiles, host ports
3100-4000, one Postgres with Relay observability in Postgres, no ClickHouse,
abacus + relay-ui, env matrix, basic_auth/SSH access for the console)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map validation, auth, not-found, 5xx and network errors to plain-language
messages; unknown codes fall back to the server message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Relay UI: user-facing TensorZero strings -> Relay; bug-report links point to
the Relay operator; API Keys card description; tests updated to match
- Vend admin/console, Turnstile admin: load failures render as red role=alert
error state instead of muted empty state
- Rithub web: capitalized brand in title/header/footer/sign-in
- README: complete, current Apps table with console locations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vend + Relay + Mint white-label kit: self-serve workspace signup
(POST /v1/auth/signup, off by default), per-app model pricing with markup,
end-user wallets and top-ups, tenant earnings, migration 0009_whitelabel,
customer console and operator admin pages for the new flows, and matching
TypeScript/Python SDK and mint-client updates. Covered by
tests/whitelabel_flow.rs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- vend-server GET /admin: tenants/apps/keys/usage/users via existing /v1/control (Bearer admin token)
- abacus-proxy GET /admin: receipt lookup by request_id (X-API-Key; only authed read endpoint — labeled)
- turnstile-demo GET /admin: tool catalog + settlement lookup (open endpoints; no challenge-list — labeled)
- same include_str! vanilla-JS pattern as rago /admin; HTML-escaped; noindex; no new auth path
- honest: surfaced only real endpoints, no fabricated views; cargo check 0 all three
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>