Skip to content

docs(prx): ADR — Message Batches API as a second model-call transport - #971

Draft
bdelanghe wants to merge 6 commits into
mainfrom
claude/prx-batch-processing-r8j262
Draft

docs(prx): ADR — Message Batches API as a second model-call transport#971
bdelanghe wants to merge 6 commits into
mainfrom
claude/prx-batch-processing-r8j262

Conversation

@bdelanghe

@bdelanghe bdelanghe commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a proposed ADR — docs/prx/batch-transport.md — scoping the lift to give prx the ability to use the Message Batches API.

The ADR establishes that batch is a second, parallel model-call transport, not a flag on the existing path: everything prx sends today goes through @anthropic-ai/claude-agent-sdk's query(), whereas messages.batches.* lives on the raw @anthropic-ai/sdk (a transitive peer dep, not a direct one). It then frames batch against prx's architecture:

  • The ratchet is already an async queue. prx advances on signed artifacts (submit_planPlanArtifact, checks/v1, predicate-bundle members) and humans are never inside the agentic loop — so non-interactive legs are async-queue-shaped and the 24-hour batch window is a non-event for them.
  • What fits: the single-shot classifiers (triage type-pass, triage prioritize-bulk, eval fan-outs) are the near-term win — already raw-Messages-shaped, tool-free, and running today as a synchronous sequential loop that batch replaces at 50% cost.
  • What's strategic vs. blocked: non-interactive agentic ratchet legs (headless plan capture, headless executor) fit the async-queue model but are gated by transport (CLI subprocess vs. raw Messages); interactive surfaces (session open, --interactive) stay on query() unconditionally.
  • Lift: ~1 week for a real v0 (add the transport + route the classifiers behind an explicit submit/poll lifecycle), with credentials (workspace API key vs. the CLI's OAuth) and lifecycle persistence flagged as the up-front design calls.

Docs are generated from the project graph, so the new ADR is auto-discovered; prx.jsonld and the .claude/context/project.md index were regenerated via bun run docs:render (drift gate green).

Closes #972

Checklist

  • Independent PR — no bundled or speculative changes (docs-only)
  • Changed codepaths verified — n/a, docs-only ADR (no runtime change)
  • Root cause identified — n/a, design doc
  • No duplication — new ADR, cross-links existing ones
  • No unrelated changes — ADR + its regenerated doc-index outputs only
  • Generated artifacts regenerated — ran bun run docs:render; bun run docs:check is green
  • CI is green — pending first run

🤖 Generated with Claude Code

https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL

Scopes the lift to route prx's single-shot classifier surfaces (triage
type-pass, prioritize-bulk, eval fan-outs) through the async Message
Batches API for the 50% discount and a collapsed serial wall-clock,
behind an explicit submit/poll lifecycle. Frames batch against prx's
artifact ratchet: because the pipeline advances on signed artifacts and
humans are never inside the agentic loop, non-interactive legs are
already async-queue-shaped; the near-term gate is transport, not the
interaction model. Interactive surfaces stay on the agent SDK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL
@github-code-quality

github-code-quality Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / unit

The overall coverage remains at 88%, unchanged from the main branch.


Updated July 03, 2026 14:17 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

claude added 5 commits July 3, 2026 13:55
Establishes empirically what a Claude Code on the web session can prove
about itself (no TPM/SEV/IMDS root of trust; base image identifiable but
not attestable) and specifies a broker protocol that gates a privileged
write (e.g. filing a bead) on GitHub-verifiable proofs — branch control
and private-repo read — with zero credentials in the box.

Adds .claude/attest-box.sh, a git-tracked SessionStart hook that emits
the attestation bundle; its bytes are pinned to the head commit the
broker re-verifies, so the attestation and its producer share one anchor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL
The prior commit hand-edited .claude/settings.json to add the
attest-box.sh hook, but that file is generated by buildOrgHarnessSettings
and drift-gated. Add the hook (and update the ordering assertion) in the
builder — the source of truth — so the checked-in settings match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL
The settings-builder change is repo-internal harness config, not a change
to released @bounded-systems/prx behavior, so record a no-release changeset
to satisfy the changeset gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL
Adds the multi-party attenuation model (a caveat chain: launch → box →
artifact → broker → DoltHub, each verified by a different party — "more
than the box, more than the cloud"), GitHub web-flow signing on the
token's authority, passing a root of trust from the launch origin, and
three concrete broker realizations (GitHub Actions + Environments,
Cloudflare Worker/Tunnel, keeperd) with recommended sequencing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL
Records that bd is always the writer (cloud box holds no dolt): keeperd +
dolt-box, or bd → a remote dolt sql-server; never the raw DoltHub HTTP SQL
API (off-model, bypasses bd's ids/events/schema). Adds the bead-write
broker contract (spec-as-schema, mirroring keeperd/contract.ts) and the
fail-closed keeper-side verify → bd create → signed-push pipeline reusing
the prx-b44y host-backed-secret path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Amt3X8s8CEdJW5civefipL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Route single-shot classifier surfaces through the Message Batches API

2 participants