Agent pack
Probes: proving a server-to-server chain end to end
How to prove a service-to-service chain works — the probe method and its failure modes.
Source: the forge-biz session, 2026-10-11 (its tags kept; this is its final account and supersedes earlier versions, including one that named a wrong cause).
Status of the only example, tenant-probe: MERGED in forge-biz (#392; fix #393 merged; a small follow-up PR open). Not published, no version: it is repo scripts. It has run live against production, scratch tenants only, with the operator's approval, and passed.
Everything about conventions is one build's experience, an opinion, not a verified fleet standard.
Why a probe, not an audit
Screen-audit, user-audit (user-flows) and verify-flows are browser or file checks. They cannot prove a chain of API calls between services, or that a running container loaded its config.
A probe is a scripted assertion chain with a read-back and cleanup, run from a terminal (no browser login). Name it <thing>-probe; avoid "audit" (read-only browser tools) and "flow" (UI specs).
No central probe store exists. A probe reports to stdout only; test.run into app-dev-db is possible but needs an operator-provisioned producer secret (app-dev-db.md) and nobody has asked for one.
Example: tenant-probe (forge-biz scripts/ops/tenant-probe.mjs)
- Covers (taskmaster leg):
POST /federation/userstwice (same user+workspace both times), mint a short-livedprojects:writekey, create a project with it, read it back, delete it, revoke the key, then confirm the revoked key gets 401/403. - Second leg,
--via-api(14 vitest cases against a fake API, mutation-checked once; later PASSED live, below): drives forge-biz's own onboarding API (POST /v1/onboarding/orgfor a scratch tenant, thenPOST .../projects) and passes only if the saga's taskmaster-project step isdone, which is what proves the deployed container loadedTASKMASTER_ADMIN_KEY. Credential$BIZ_ONBOARDING_TOKENor a 0600 file in~/.forge-secrets; it never reads the workspace-store tokens in the responses. It leaves a scratch tenant row (forge-biz has no tenant-delete route). The report carriesleg:'taskmaster'|'forge-biz-api'(additive; schema id unchanged). - Interface:
node scripts/ops/tenant-probe.mjs [--confirm] [--slug s] [--url u] [--key-file p] [--json]; no config file. - Output: stdout table, or
--jsonwith{schema:'blueforge.forge-biz.tenant-probe/1', mode:'dry-run'|'live', base, slug, ok, steps:[{name, ok, status, detail}], leftover?}. A test asserts no key string appears in the report. - Exit codes: 0 ok (and every dry run), 1 a step failed, 2 usage/unsafe config, 3 no credential or key rejected at provision. (Exit 2 was run; 1 and 3 are covered only indirectly: UNVERIFIED as process exit codes.)
Safety model to copy
- Dry run by default (no network; prints the plan). A write needs an explicit
--confirm. The plan list doubles as the dry run. - Never a real target: use an allowlist. Act only on a scratch slug (default
probe-<yyyymmdd>); the example now requires the slug to startprobe-(verified: ran the refusal, tests). Its first version used a denylist of two known tenants, which was weak (a new real tenant was unprotected); do not copy that. - Refuse plain http (except localhost) and a credential file wider than 0600. Read credentials from an env var or a 0600 file, never argv, never printed; read the key file only under
--confirm. - Cleanup in
finally: the minted key is always revoked and the probe project deleted, even when an earlier step fails; report what it could not clean up (leftover). Here the scratch tenant's user and workspace cannot be deleted (no route), so reruns reuse them through an idempotent external ref. - Inject
fetchso tests use a fake server that can bend one rule per test. Mutation-check the assertions: break one check and confirm its test fails.
Live results (VERIFIED by the forge-biz session; production, scratch tenants only)
- Taskmaster leg PASSED in full: provision (201, then 200 idempotent), mint into the tenant user, create project, read back, delete project, revoke, revoked key refused with 401.
--via-apiPASSED (forge-biz's own onboarding API, the deployed container): the taskmaster-project step wasdone, first on the old saga, then on the fixed build with no revoke warning.
What the probe found (this is the value):
- taskmaster prod
userslackedpassword_hash(migration 0003; 0008's columns were present), soPOST /federation/usersanswered 500. Fixed by the taskmaster session. The forge-biz session's first two guesses at the cause were wrong; the database's own error line named the column. - Revoke asymmetry: a key minted into a tenant user can be revoked only by that user (the key itself) or
federation:admin; the minter (the provisioner) gets 403. forge-biz's saga swallowed that error, leaving live 7-day write keys. Fixed in forge-biz#393; taskmaster#75 (open, not required) would let the provisioner revoke too. - The deployed container did not have
TASKMASTER_ADMIN_KEYalthough the env store did: env is read at container creation, so a redeploy was needed. Only the--via-apileg could see this.
Lessons: read the database's error, not the query text. Run the probe through the deployed path (--via-api), not only the downstream service. Fail on warnings that signal a live credential (a swallowed revoke error is a live key). A write probe leaves residue when the service has no delete route: say so in the report (leftover, leftoverKey).
Convention (recommended, from one build)
Logic in scripts/lib/<name>/, a thin CLI in scripts/ops/<name>.mjs, tests beside the repo's other script tests. runProbe({base, key, fetch, confirm}) returns a schema-tagged report. Exit codes 0/1/2/3 as above, --json carries a schema id.
CI: none from the author, and do not run a write probe in CI without a dedicated scratch tenant and a scoped key.
Reuse
The code is specific to forge-biz and taskmaster (endpoints hardcoded); nothing is shared or published; there is no central reporting (no app-dev-db or mission-control) and it is not run in CI. The reusable part is the shape (plan list, report schema, fake-server harness). UNVERIFIED that it generalises: it has not been tried in a second repo. A second repo copies the three files and rewrites the step list for its own service.
Rules for agents
- Do not run a probe with
--confirmagainst production, create tenants/projects, or mint keys unless the operator approved that exact run (this one ran in production only with that approval). Dry run is always fine. - Never point a probe at a real tenant. If you write a new probe, copy the safety model above, including cleanup and the leftover report.
- Say plainly when a probe has only run against a fake, and what a failed live run actually showed.