Skip to content

Commit ae37409

Browse files
docs(llms): surface deploy-failure auto-debug path + CI discoverability guard (#196)
Closes the agent-discoverability half of the failure-diagnosis CI program: an agent that hits a failed deploy must be able to find, from llms.txt alone, that the classified cause is served back over HTTP — and that can't silently regress. - public/llms.txt: synced to content-repo HEAD (PR #27, a10699f) — adds the "Debugging a failed deploy (agent self-recovery)" section + the /docs/troubleshooting-deploys.md reference (the /events autopsy loop: reason + last_lines + hint → fix → redeploy → re-poll). - src/lib/llmsContract.test.ts: new CONTRACT_MARKERS row asserting llms.txt contains BOTH the 'troubleshooting-deploys' reference AND the '/api/v1/deployments/:id/events' debug surface — so a content sync or docs edit that drops the debug path reds CI (verified: removing the events marker fails the test by name). - scripts/fetch-content.mjs: adds the same two markers to the llms.txt requireMarkers lock-step guard — a future upstream sync missing them PRESERVES the committed copy instead of reverting the documentation (rule 22). Pairs with the FUNCTIONAL live proof in e2e/live-ui-failure-diag.spec.ts (#195): discoverable AND demonstrably working. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5949d0f commit ae37409

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

public/llms.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ Every page has a `.md` mirror at the same path. Examples:
123123
- [/pricing.md](https://instanode.dev/pricing.md) — tier comparison
124124
- [/for-agents.md](https://instanode.dev/for-agents.md) — agent-specific guidance
125125
- [/status.md](https://instanode.dev/status.md) — current status
126-
- [/docs.md](https://instanode.dev/docs.md) — quickstart + service reference (all 9 sections concatenated)
126+
- [/docs.md](https://instanode.dev/docs.md) — quickstart + service reference (all sections concatenated)
127+
- [/docs/troubleshooting-deploys.md](https://instanode.dev/docs/troubleshooting-deploys.md) — agent self-recovery guide for a failed deploy (the `/events` autopsy loop)
127128
- [/blog.md](https://instanode.dev/blog.md) — blog index (post titles + dates + links)
128129
- [/blog/<slug>.md](https://instanode.dev/blog/) — every post
129130
- [/use-cases.md](https://instanode.dev/use-cases.md) — catalogue index (all 104 grouped by category)
@@ -162,6 +163,16 @@ Anonymous tier (24h TTL): no email on file, `DELETE` returns 200 immediately. Se
162163

163164
- [Deployments](https://instanode.dev/docs#deploy): POST /deploy/new + private deploys + custom domains + two-step email-confirmed deletion + 24h-TTL semantics (default; three routes to keep a deploy permanent)
164165

166+
## Debugging a failed deploy (agent self-recovery)
167+
168+
Deploy failed? You don't need cluster access — the platform classifies the failure and serves the real error back over HTTP. Read the classified cause at `GET /api/v1/deployments/:id/events` → `events[]` with `reason`, `last_lines` (the tail of the build-pod log = the actual error output), and `hint` (a plain-language remedy). For the one-line summary use `GET /api/v1/deployments/:id` → `status` + `error_message`. The loop: read `reason` + `last_lines` + `hint` → fix the Dockerfile / tarball / `port` / `env_vars` → redeploy in place (`POST /deploy/:id/redeploy`, or `redeploy=true` on `POST /deploy/new` with the same `name`) → re-poll status until `running`. Watch the build live with the SSE stream `GET /deploy/:id/logs`.
169+
170+
**Anonymous deploys** go through `POST /stacks/new` and have a thinner failure path: `GET /api/v1/stacks/:slug` returns `status="failed"` + the raw error string, and `GET /stacks/:slug/logs/:svc` returns per-service build logs — but there is **no** classified `/events` autopsy for anonymous stacks (a known thinner path). Claim/upgrade and deploy via `/deploy/new` for the full `reason`/`last_lines`/`hint` surface.
171+
172+
**Caveats:** don't rely on the failure email (transactional email delivery is currently blocked — use `/events` and the dashboard failure-autopsy panel instead); there is a brief "diagnostics pending" window right after a failure where `/events` may be empty or `reason="Unknown"` (re-poll); and runtime crash-loops have thinner diagnostics today than build failures.
173+
174+
Full guide: [https://instanode.dev/docs#troubleshooting-deploys](https://instanode.dev/docs#troubleshooting-deploys) (markdown mirror: [/docs/troubleshooting-deploys.md](https://instanode.dev/docs/troubleshooting-deploys.md)).
175+
165176
## How to use this file
166177

167178
If you're an LLM helping a user build something, you can:

scripts/fetch-content.mjs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,23 @@ const SYNC_FILES = [
8080
// version missing the Enterprise line; this PRESERVES the committed local
8181
// copy until content HEAD also carries it. Becomes a no-op once the
8282
// content PR merges.
83-
requireMarkers: ['redeploy=true', '"redeployed":', 'not yet a self-serve tier', '**Enterprise**'],
83+
//
84+
// task #69 (2026-06-06): 'troubleshooting-deploys' + the dedicated debug
85+
// surface '/api/v1/deployments/:id/events' guard agent-discoverability of the
86+
// deploy-failure auto-debug path. An upstream sync that ever drops the
87+
// troubleshooting reference or the events surface from llms.txt PRESERVES the
88+
// committed copy instead of silently reverting the documentation — so an agent
89+
// reading the live https://instanode.dev/llms.txt can always find the
90+
// failure-diagnosis loop. Mirrors the CONTRACT_MARKERS row in
91+
// src/lib/llmsContract.test.ts (content PR #27 already carries both, no-op today).
92+
requireMarkers: [
93+
'redeploy=true',
94+
'"redeployed":',
95+
'not yet a self-serve tier',
96+
'**Enterprise**',
97+
'troubleshooting-deploys',
98+
'/api/v1/deployments/:id/events',
99+
],
84100
},
85101
]
86102

src/lib/llmsContract.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ const CONTRACT_MARKERS: DocsMarker[] = [
8181
file: 'public/llms.txt',
8282
mustContain: ['**Enterprise**', 'sales@instanode.dev'],
8383
},
84+
{
85+
// Task #69 / docs/ci/02-FAILURE-DIAGNOSIS-AND-AUTODEBUG.md (2026-06-06): the
86+
// agent-facing deploy-failure auto-debug path. An agent that hits a failed
87+
// deploy must be able to DISCOVER, from llms.txt alone, that the classified
88+
// cause is served back over HTTP — so this pins BOTH the troubleshooting
89+
// reference (the dedicated guide) AND the dedicated debug surface
90+
// `GET /api/v1/deployments/:id/events` (the reliable machine surface the
91+
// auto-debug loop reads: reason + last_lines + hint). If a content-repo sync
92+
// or a docs edit ever drops the debug path from the manifest, this reds CI so
93+
// agent-discoverability of the failure-diagnosis path can't silently regress.
94+
// Mirrors the requireMarkers guard in scripts/fetch-content.mjs (lock-step,
95+
// rule 22) + the FUNCTIONAL live proof in e2e/live-ui-failure-diag.spec.ts.
96+
field: 'deploy-failure auto-debug path (troubleshooting guide + /events debug surface)',
97+
file: 'public/llms.txt',
98+
mustContain: ['troubleshooting-deploys', '/api/v1/deployments/:id/events'],
99+
},
84100
]
85101

86102
describe('agent docs contract — POST /deploy/new redeploy=true', () => {

0 commit comments

Comments
 (0)