Repository navigation
feat(chat): action decisions across requests and turn cost policy - #205
EmersonBraun wants to merge 12 commits into
Conversation
Protocol event client.action.decide, handler decisions and cost options, Drizzle decision store, tests, ADR-0037 and docs. Manifests reference unreleased upstream versions, so the lockfile is not regenerated yet.
Doc Bridge advisory (Layer 1)Repository: AgentsKit-io/agentskit-chat; PR: 205. Advisory only. Blocking gates are reported independently; interpretation and acceptance remain human-owned. Findings: 0. PendingUpdated in this change — confirm the updateCoverage gaps / policy exclusions: not-analyzed: 16; partial: 373.
Policy routing: excluded: 0; pending-version: 0; generator: 0; routed-to-L2: 0. |
- keep protocol fixture positions stable; append the decide fixture - register an action confirmation before upstream proposeToolCall resolves - cover the Drizzle decision store's boundary checks - accept content parts in the controlled Ink example - refresh the public API snapshot, claim ledgers and README evidence - raise the server bundle budget for decisions and cost
Local gates against the unreleased upstream (still draft)
What the first full run found, and the fixes in
|
…ferenced parts (#205, #206) * docs: record track 04 stage status * wip(chat): action decisions across requests and turn cost policy Protocol event client.action.decide, handler decisions and cost options, Drizzle decision store, tests, ADR-0037 and docs. Manifests reference unreleased upstream versions, so the lockfile is not regenerated yet. * docs: record track 04 checkpoint PRs * fix(chat): pass the gates against core 1.15 - keep protocol fixture positions stable; append the decide fixture - register an action confirmation before upstream proposeToolCall resolves - cover the Drizzle decision store's boundary checks - accept content parts in the controlled Ink example - refresh the public API snapshot, claim ledgers and README evidence - raise the server bundle budget for decisions and cost * docs: keep README review dates; refresh only the changed source hashes * wip(chat): deliver referenced parts to the adapter * test(chat): verify referenced uploads across Node and workerd * fix: meter dispatched turns and reject reused decisions * fix: bound upload delivery and preserve class adapters * test: supply a real request to class adapter regression * fix: deliver parts through session-aware adapters * docs: refresh reviewed server README evidence * fix: resolve published upstream dependencies in lockfile * fix: exclude generated Expo and Wrangler artifacts from scans * fix: preserve pending decisions across evolving transcripts * fix: defer decision replay until the active turn finishes * fix: separate upload budgets and support frozen adapters * docs: refresh server README source hash after budget correction
Durable action decisions and turn cost policy (RF-17–29), with the second independent verification corrections. Current head:
c5386dd3c3ef6db80557d97349922d24e5c7308c.Resulting behavior
Protocol v1 adds
client.action.decide,action-decide-v1, quota utilization/warning, and safe typed errors. The handler consumes upstream durableToolDecisionStoreandCostStore; PostgreSQL uses conditional claims/settlement. Parts delivery remains in stacked #206.Criteria and current local evidence
putPendingaccepts evolving messages without overwriting the original snapshot. Shared real-handler regression passes with in-memory stores and real PostgreSQL.settleCost; existing cost tests pass.createIdcan reuse reservations and bypass quota; no runtime API change.pnpm --filter @agentskit/chat lint,pnpm --filter @agentskit/chat-server lint, andpnpm test:storage:pg:typespassed. Chat coverage suite: 131 passed; server: 61 passed, 1 expected failure, 2 skipped (98.54% lines);pnpm test:storage:pg --maxWorkers=2: 2 passed, including 100 claim races and 100 concurrent-handler rounds plus both proposal regressions. All coverage floors passed.Documentation impact: quota behavior, ID uniqueness and upstream adoption record. Definition of Done for this worker: corrections, mapped checks, propagation to #206, push, green current CI, PR evidence and node_modules cleanup; broader human reviews remain pending.
Verification scope and decisions
Local budget: package chat/server typechecks and coverage suites with
--maxWorkers=2, plus the existing localhost PostgreSQL 16 acceptance contract and its typecheck. Observed machine load stayed below 60; no local full-repository test run, external provider call, merge, or publication. Builds are only prerequisites of the documented package test commands.Upstream adoption: inspected published core 1.15.0
controller.persistPending,ToolDecisionStore,Message,ContentPart,AdapterFactory, and reused controller execution/resume plus serialize/deserialize exports. The application PostgreSQL store preserves insert-if-absent semantics; the handler owns quota policy, turn leases and reference delivery. No upstream code, dependency, coverage floor or provider protocol was copied or changed. Adoption records and ADR-0037/0038 describe the choices.Conservative defaults: keep the first pending snapshot, reject claimed/terminal ID reuse, return the existing 409 for retry during an active decision turn, and retain bounded upload delivery. No merge or publication. All 21 task-installed node_modules directories were removed; the final worktree/diff is clean and pre-existing containers/artifacts are preserved. Automatic approval review rejected deletion of the task stash (
task_c0d3825b51a3 parts fixes) because approval was required while this session cannot request it; the stash is retained as a cleanup limitation.Current CI
All executed checks passed on
c5386dd3c3ef6db80557d97349922d24e5c7308c; no failed or pending check remains. Auxiliary CodeQL is neutral; its JavaScript/TypeScript analysis passed.These checks validate their declared scope; broader human visual and independent evidence review remain pending. No merge or publication was performed.