Skip to content

Sweep and books on /apps/v1, the sweep as an AG-UI run - #122

Merged
jlwaugh merged 1 commit into
mainfrom
sweep-books
Nov 5, 2026
Merged

jlwaugh merged 1 commit into
mainfrom
sweep-books

Conversation

@jlwaugh

@jlwaugh jlwaugh commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

ADR 2: shielding and the books reconciliation, on the proposals page through the app server.

  • Sweep: POST …/sweep ({ execute }) reads the platform's stream to its end, sent once, a shield recorded before and after. Its answer is the run as AG-UI 1.0 events (@ag-ui/core 1.0.3 schemas), delivered whole as JSON: RUN_STARTED (protocolVersion), an ACTIVITY_SNAPSHOT of treasury.sweep after each platform event (public balances as exact decimal strings, shields with their status), then RUN_FINISHED, or RUN_ERROR with the failure's kind as code and the server's own words. A stream lost after it began has no terminal event: a truncated run, read as unknown and never sent again.
  • Books: GET …/books (reconcileBooks) as an owner read; a Books table in Portfolio shows public drift from the chain and private balances not attributed.
  • Page: Shield public balances in Funding: Preview, a review dialog, Shield now, each shield's status; decided by the owner UI's settle, so after an unknown or partly sent run Shield isn't offered again. Enabled once the executor holds a treasury grant (account).
  • Tests: server unit (well-formed runs checked against AG-UI's own EventSchemas, truncation, RUN_ERROR without the platform's text, audit, not_owner); web unit (the run reader); stack: 1 wNEAR previewed and shielded through the server and in the browser, and the books read.

@jlwaugh
jlwaugh merged commit a6fcd25 into main Nov 5, 2026
6 checks passed
@jlwaugh
jlwaugh deleted the sweep-books branch November 5, 2026 05:05
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.

1 participant