Skip to content

fix(deploy): blueprint MANAGER pattern everywhere — never hand-run the instance binary#53

Merged
drewstone merged 1 commit into
mainfrom
fix/blueprint-manager-pattern
Jun 16, 2026
Merged

fix(deploy): blueprint MANAGER pattern everywhere — never hand-run the instance binary#53
drewstone merged 1 commit into
mainfrom
fix/blueprint-manager-pattern

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

The recurring mistake

Agents keep deploying inference-bazaar-operator run directly (hardcoded SERVICE_ID / TEST_MODE=true) as if that is the blueprint. It isn't — that's local testing only. In production each operator box runs the Blueprint Manager daemon (cargo-tangle blueprint run), which watches the chain and spawns the per-service instance itself when a user's service request is approved.

This PR encodes the rule so it stops happening, and fixes the artifacts (including one I just introduced).

Prevention (so it never recurs)

  • CLAUDE.md (NEW, repo-level — loaded every session in this repo): the rule front-and-center, the full on-chain lifecycle (deploy manager → operator registers → user requests a service → operators approve → manager spawns the instance), plus the resell-backend + 1.91/PROTOC + stale-ref gotchas.
  • A persistent agent memory was also written.

Fixes

  • deploy/gen-resell-operator.sh — rewritten to generate a Blueprint Manager systemd unit (cargo-tangle blueprint run --keystore-uri … --data-dir …/bpm-data --settings-file …) + the operator settings.env (the resell config the manager hands the spawned instance; no SERVICE_ID — the manager assigns it). It previously ExecStart-ed the operator binary — this PR supersedes deploy: gen-resell-operator.sh — one-command resell operator unit + runbook #51.
  • docs/OPERATOR_ONBOARDING.md §7/§8 — split testing (direct run) vs production (manager spawns the instance); corrected the lifecycle prose and the unit it pointed at.
  • deploy/hetzner/*-blueprint-runtime.service — headers marked TEST/DEV (they direct-run the binary).

Also fixed in the Tangle skills (separate repos, edited in place by a fan-out)

tangle-blueprint-expert (×3 copies), blueprint-launch (caught presenting a wrong-pattern step and corrected it), blueprint-frontend, sandbox-blueprint — each now carries the "production = Blueprint Manager, never the instance binary" rule. (4 unrelated skills correctly skipped.)

Reference that does it right: ai-trading-blueprint/deploy/go-live.sh + trading-blueprint.service.

Verification: bash -n on the script; the unit ExecStart is cargo-tangle blueprint run, not the binary.

…e instance binary

Recurring mistake: agents deploy 'inference-bazaar-operator run' directly (with a
hardcoded SERVICE_ID / TEST_MODE) as if that IS the blueprint. It is not — that's
local testing only. Production runs the Blueprint Manager daemon (cargo-tangle
blueprint run), which spawns the per-service instance itself when a user's service
request is approved. Encode this so it stops happening:

- CLAUDE.md (NEW, repo-level, loaded every session here): the rule front-and-center
  + the on-chain lifecycle (deploy manager -> register -> request -> approve -> spawn)
  + the resell-backend + toolchain gotchas.
- deploy/gen-resell-operator.sh: rewritten to generate a Blueprint MANAGER systemd
  unit (cargo-tangle blueprint run + --keystore-uri + EnvironmentFile=settings.env)
  and the operator settings.env (no SERVICE_ID — the manager assigns it). Was
  wrongly ExecStart-ing the operator binary.
- docs/OPERATOR_ONBOARDING.md §7/§8: split testing (direct run) vs production
  (manager spawns the instance); fixed the lifecycle prose + the unit it pointed at.
- deploy/hetzner/*-blueprint-runtime.service: marked TEST/DEV (they direct-run).

Also fixed in the Tangle skills (separate repos, edited in place): tangle-blueprint-
expert (3 copies), blueprint-launch (corrected a wrong-pattern step), blueprint-
frontend, sandbox-blueprint. Reference pattern: ai-trading-blueprint/deploy/go-live.sh.
@drewstone drewstone merged commit 6ca4762 into main Jun 16, 2026
7 of 8 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