Skip to content

docs: correct stale runtime-core architecture facts - #3523

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Joob1n:docs/correct-runtime-core-facts
Aug 22, 2026
Merged

docs: correct stale runtime-core architecture facts#3523
Astro-Han merged 1 commit into
apache:mainfrom
Joob1n:docs/correct-runtime-core-facts

Conversation

@Joob1n

Copy link
Copy Markdown
Contributor

Summary

Chapter 1 of the runtime-core architecture documents still described a file-backed run store and the removed per-call permission model. Both language versions carried the same drift, so translation_status: synced was no longer true; this change updates them together.

Corrected against the code:

  • PermissionEngine and its allow/block/prompt evaluation no longer exist. A tool that crosses the sandbox boundary returns sandbox_boundary_required with a concrete expansion, and the model raises the request through request_sandbox_boundary.
  • The decision is routed by RuntimeKernel.respondToSandboxBoundary(), not respondToPermission().
  • Durable state is SQLite, not sessions/<id>/runs/<id>/{run.json,events.jsonl,runtime-events.jsonl}. RuntimeEvents land in runtime_events, ordered by event_seq under a (invocation_id, event_seq) uniqueness constraint.
  • maxSteps is number | undefined and undefined is unbounded; the documented default of 50 appears nowhere in the repository.
  • packages/storage/src/__tests__/agent-run-store.test.ts no longer exists. The ledger repair coverage is packages/runtime/src/__tests__/runtime-ledger-repair.test.ts.
  • Startup recovery and continuation were described in a way that contradicted itself. They are now stated as the two distinct paths they are, naming safe_boundary_continuation, continuationSource and runAdmittedRuntimeContinuation.

Two facts are added because the corrected text would otherwise be incomplete: AiSdkFlow rejects permission_request / permission_answer_ack / permission_closure_ack / permission_decision_ack at the mapping boundary, and the boundary decision fact carries role=system with author=user.

No new sections or examples. This change only brings existing statements back in line with the implementation, and the net diff is shorter than the original.

Refs #3522

Verification

Every corrected statement was checked against the code rather than inferred from the wording:

StatementCheckResult
PermissionEngine removedgrep -rn PermissionEngine packages/*/srcno matches
respondToSandboxBoundary()packages/runtime/src/runtime-kernel.ts:149,2339present; no respondToPermission
no file-backed ledgergrep -rln 'runtime-events.jsonl|events.jsonl' packages/storage/srcno matches
maxSteps unboundedpackages/runtime/src/ai-sdk-backend.ts:739,1053maxSteps?: number / number | undefined
no default of 50grep -rn 'maxSteps.*50' packages/no matches
stale test pathls packages/storage/src/__tests__/agent-run-store.test.tsNo such file
replacement test pathls packages/runtime/src/__tests__/runtime-ledger-repair.test.tspresent
continuation symbolspackages/core/src/agent-run.ts:71,167, packages/runtime/src/runtime-runner.ts:421present
legacy permission eventspackages/runtime/src/ai-sdk-flow.ts:148-170the four listed types throw

Repository checks:

npm run format:check Checked 1590 files. No fixes applied.
npm run check:stale dist is fresh.

No test covers prose, and this PR changes no code, so no suite was added. npm test was not run.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Opus 5 via Claude Code — ran the documentation audit against the code, drafted the corrected prose in both languages, and wrote the commit message. Every claim in the table above was verified by running the listed command. The commit carries a Generated-by trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Chapter 1 still described a file-backed run store and the removed
per-call permission model. Both languages carried the same drift, so
`translation_status: synced` was no longer true.
Corrected against the code:
- `PermissionEngine` and its allow/block/prompt evaluation no longer
exist; a tool that crosses the sandbox boundary returns
`sandbox_boundary_required` with a concrete expansion, and the model
raises the request through `request_sandbox_boundary`.
- The decision is routed by `RuntimeKernel.respondToSandboxBoundary()`,
not `respondToPermission()`.
- Durable state is SQLite, not `sessions/<id>/runs/<id>/*.jsonl`.
RuntimeEvents land in `runtime_events`, ordered by `event_seq` under a
`(invocation_id, event_seq)` uniqueness constraint.
- `maxSteps` is `number | undefined` and `undefined` is unbounded; the
documented default of 50 appears nowhere in the repository.
- `packages/storage/src/__tests__/agent-run-store.test.ts` no longer
exists; the ledger repair coverage is
`packages/runtime/src/__tests__/runtime-ledger-repair.test.ts`.
- Startup recovery and continuation are now stated as the two distinct
paths they are, naming `safe_boundary_continuation`,
`continuationSource` and `runAdmittedRuntimeContinuation`.
Also records that `AiSdkFlow` rejects the four legacy permission events
at the mapping boundary, and that the boundary decision fact carries
`role=system` with `author=user`.
No new sections or examples: this change only brings existing statements
back in line with the implementation.
Refs apache#3522
Generated-by: Claude Opus 5 via Claude Code

@jackwenerjackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checked the claims against current main, not the old prose.

  • PermissionEngine / respondToPermission() are gone; respondToSandboxBoundary() exists.
  • Durable runtime events are SQLite runtime_events with UNIQUE (invocation_id, event_seq), not per-run JSONL.
  • maxSteps is number | undefined; no default 50 in packages/.
  • Ledger repair test path is runtime-ledger-repair.test.ts.
  • AiSdkFlow throws on the four legacy permission event types.
  • sandbox_boundary_decision_ack is role=system / author=user in the mapping comments.
  • Continuation is a separate path (safe_boundary_continuation, continuationSource, runAdmittedRuntimeContinuation).
  • EN/ZH stay in lockstep; translation_status: synced holds.

This only un-drifts Chapter 1. Approve.

@Astro-HanAstro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks — correcting a stale architecture document is unglamorous and it is exactly the kind of drift that costs the next reader an hour. Net −20 lines is the right shape for it: fewer claims, each of them true.

Reviewed at exact head 1d014d481c484caa6d6c953df0ca247a970aa71e. test is green on this head.

We spot-checked three of the load-bearing claims against current main rather than taking the prose at its word:

  • PermissionEngine and respondToPermission() return no hits anywhere under packages/ or apps/, and respondToSandboxBoundary() is what exists in their place.
  • maxSteps is declared maxSteps?: number and held as number | undefined, resolved through input.maxSteps ?? this.maxSteps — there is no default of 50.
  • Durable runtime events live in the SQLite runtime_events table, not per-run JSONL.

Each matches what this PR now says. @jackwener had already worked through the full list against main, which is the review that carries the weight here; ours agrees with it on the points we re-derived independently.

One thing worth naming for whoever reads this later: a documentation change that deletes claims is harder to review than one that rewrites them, because a wrongly-deleted line leaves nothing behind to notice. The deletions here are removals of superseded mechanisms, not of still-true statements.

No findings — no P0, P1, P2 or P3. Approving.


This review was AI-assisted. Findings were verified against the exact head listed above; any mistakes are ours to correct — please push back where we got it wrong.

@Astro-Han
Astro-Han merged commit 3fda238 into apache:mainAug 22, 2026
1 check passed
Sign up for freeto 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.

3 participants

@Joob1n@jackwener@Astro-Han