Skip to content

docs(agents): backend-agents durable-turn architecture row (H25) - #930

Merged
btipling merged 2 commits into
mainfrom
plan/h25-agents-md-architecture-row
Sep 3, 2026
Merged

docs(agents): backend-agents durable-turn architecture row (H25)#930
btipling merged 2 commits into
mainfrom
plan/h25-agents-md-architecture-row

Conversation

@btipling

@btipling btipling commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Closes #819. Refs #794 (umbrella), #818 (H24 blocker, cleared), #811 (D17, shipped).

What

Implements backend-agents H25 — the final row of the #794 umbrella. Adds a backend-agents architecture statement to AGENTS.md capturing the durable-turn ownership model in timeless terms. Docs-only; no application code, no test gate.

The new bullet sits at the top of the existing "Vercel Workflows (backend-agents)" subsection, ahead of the ops/wiring bullets, and states:

  • The Workflow run owns the turn. A durable turn is owned by the Workflow run started at POST /api/turns, independent of any attached viewport — it survives tab close / refresh / logout. A viewport attaches to a live run (hydrate from Blob + GET /api/turns/:runId/stream); unmount/switch/New/Clear/logout is detach only, never a cancel. Cancel is the explicit POST /api/turns/:runId/cancel.
  • Tools are steps. One 'use step' = one model round or one tool execution or one persist — never a mega-step, never wrap runAgentStream in a single step.
  • /api/agent truth (post-D17). /api/agent is the legacy tests/JSON path; production turns use /api/turns. Stated as the current truth (D17 shipped in backend-agents D17: host runPrompt → POST /api/turns cutover #811), not a pending cutover.

Why

AGENTS.md already had the Workflows infra row (§ "Infrastructure already configured") and the ops subsection (enablement, smoke, caps), but no durable-turn architecture statement: nothing said the Workflow run owns the turn independent of any attached viewport, nothing documented the tools-as-steps granularity, and nothing tied it to the survive-tab-close/refresh product goal. This row closes that gap.

DoD

Gates

Docs-only (AGENTS.md, *.md) → no test gates per the repo scope table. No typecheck/vitest/build run (nothing to compile). Diff is a single 10-line bullet addition.

Notes

Add a backend-agents architecture statement to AGENTS.md capturing the
durable-turn ownership model in timeless terms:

- The Workflow run (POST /api/turns) owns the turn, independent of any
  attached viewport; it survives tab close / refresh / logout. A viewport
  attaches to a live run (hydrate from Blob + GET /api/turns/:runId/stream);
  unmount/switch/New/Clear/logout is detach only, never a cancel. Cancel is
  the explicit POST /api/turns/:runId/cancel.
- Tools are steps: one 'use step' = one model round OR one tool execution OR
  one persist; never a mega-step, never wrap runAgentStream in a single step.
- /api/agent is the legacy tests/JSON path; production turns use /api/turns
  (post-D17 current truth).

Implements #819 (backend-agents H25). Refs #794. Docs-only; no test gate.
@btipling btipling self-assigned this Sep 3, 2026
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
invincible Ignored Ignored Sep 3, 2026 5:48am UTC

Request Review

@btipling btipling left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review — PR #930

Verdict: PASS WITH NOTES
Repo: btipling/invincible
Scope: main ← plan/h25-agents-md-architecture-row · 1 file · docs-only (H25 / #819)
Lenses run: L7 L8 (skip: L1–L6 L9 — no application/UI/CI code; L2/L4 — N/A)
AGENTS.md read: yes (diff + surrounding Workflows subsection + Map of modules toolExecuteStep line; cross-check merged docs/feature-divide.md H23)

Findings

Sev Lens Finding Break scenario Refutation attempt Confidence
Minor L8 New architecture bullet says one 'use step' = “one tool execution”. Same file’s Map of modules already documents toolExecuteStep as one step per model round’s toolCalls. Merged H23 docs/feature-divide.md already uses toolExecuteStep (one model round's toolCalls / waves). DoD promised no contradiction / no drift. An agent following the new top-of-Workflows architecture row 1:1 creates one 'use step' per tool call, fights wave/maxRetries=0 batch semantics, and diverges from feature-divide + the Map row two sections later. Defender: plan #819 DoD reused the shorthand; ownership/attach/cancel//api/agent parts are correct. Fails: AGENTS.md is the agent north star — introducing a looser grain above the precise Map row is exactly the drift H23 already fixed elsewhere. high

What checked clean

  • Workflow run owns the turn; attach = Blob hydrate + GET …/stream; unmount/switch/New/Clear/logout = detach only; cancel = POST …/cancel — matches G22 / feature-divide Stop row.
  • /api/agent legacy tests/JSON; production /api/turns — post-D17 current truth, not a pending cutover.
  • Timeless (no H25 / #819 archaeology). Placement under “Vercel Workflows (backend-agents)” is appropriate.
  • Mega-step / runAgentStream ban matches architecture antonym table.

Residual risk

No worker-Blob-writer sentence here (lives in feature-divide) — fine for this AGENTS architecture row; not a gap for H25 DoD.

Merge guidance

  • PASS WITH NOTES: fix the step-grain wording (or explicitly accept the Minor). No Blockers/Majors. Docs-only.

What was not attacked

Live attach after logout; Production Workflows Observability.

Suggested fix punch list

File / area Expected behavior Acceptance criteria
AGENTS.md Workflows architecture bullet Align with Map of modules + docs/feature-divide.md: one 'use step' = one model round or one toolExecuteStep (one model round’s toolCalls / waves) or one persist — never mega-step / never wrap runAgentStream. No “one tool execution” reading; matches feature-divide H23; ownership/attach/cancel//api/agent sentences unchanged; timeless.

Replace “one tool execution” with the feature-divide grain: one
'use step' is one model round or one toolExecuteStep (one model
round's toolCalls / waves) or one persist.

Punch-list fix for PR #930 review. Refs #819.

Co-authored-by: Bjorn <btipling@users.noreply.github.com>

@btipling btipling left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial re-review — PR #930 @ 9f00b3e

Verdict: clean enough (prior Minor closed)
Scope: Fixer round-1 docs wording only

Claim checklist

Claim Result
Step grain = toolExecuteStep (one round’s toolCalls / waves) PASS — matches Map of modules + merged docs/feature-divide.md
Ownership / attach / detach≠cancel / /api/agent legacy retained; timeless PASS

No new findings.

Merge guidance

Safe to merge from this attack, subject to Bjorn’s call. Not merging from Reviewer.

@btipling
btipling merged commit 506e71b into main Sep 3, 2026
3 checks passed
@btipling
btipling deleted the plan/h25-agents-md-architecture-row branch September 3, 2026 05:50
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.

backend-agents H25: AGENTS.md backend-agents architecture row

1 participant