Skip to content

feat(workspace): a broker's declaration report names the box's listing and its spend - #3509

Merged
lex00 merged 2 commits into
mainfrom
ws-f4-broker-report
Oct 4, 2026
Merged

lex00 merged 2 commits into
mainfrom
ws-f4-broker-report

Conversation

@lex00

@lex00 lex00 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

ws-097 defined the declaration report as { capabilities }, while studio's steward has sent the box's listing and the month's spend in it since arugula-salad/studio#369 and #384, and studio's lobby checks and keeps both. lex00 decided on 2026-10-04 to name them in chant's report schema (part of the studio#394 follow-up), recorded here as ws-102.

The declarationReport and declarationKept bodies in broker-protocol.schema.json gain two optional fields, in the shapes the lobby already checks. listing is the box block's listing less the cover, { published, title, line }, with published defaulting to true and the bounds box listing set writes with (title at most 60 characters, line at most 140, no control characters). spend is what the run records say the box spent in one month, { month, usd, runs, unpriced, byPrincipal: [{ principal, usd, runs, unpriced }] }: USD only, runs with no USD cost counted as unpriced and never as zero, at most 50 principals, null for runs that name none.

In broker-protocol.ts, parseDeclarationReport now checks and returns listing and spend (a malformed one is a 400, as in the lobby), KeptDeclaration carries them, and a new spendFromRuns(doc, month) computes spend from chant workspace runs --json the way studio's steward does. The reference broker keeps and echoes them. The broker conformance suite gains declaration-listing-spend: a report that also carries both is answered 200, and an answer that echoes them echoes them unchanged. A broker that ignores the fields passes. The broker protocol reference documents the fields and the new check, and ws-102 was written with chant workspace records new --by lex00 (scripts/import-decisions.mjs --check passes).

Verification: per the burn-down's testing rule, only tsc --noEmit for packages/core, which is clean. I added unit cases to broker-protocol.test.ts for the fields, the refusals and spendFromRuns, but did not run them or the conformance suite; the coordinator runs one pass at the end. origin/main (with #3507) is merged in, and the only conflict was the decisions README's list of records.

Closes #3508

lex00 added 2 commits October 4, 2026 14:26
…g and its spend (#3508)

The declaration report and its answer gain two optional fields (ws-102), in the shapes studio's
lobby already checks: listing, the box block's listing less the cover, and spend, the month's
figures from the run records, USD per principal with runs that have no USD cost counted as
unpriced. parseDeclarationReport checks and returns them, spendFromRuns computes spend from
chant workspace runs --json, and the broker conformance suite gains declaration-listing-spend.

Closes #3508
# Conflicts:
#	docs/design/decisions/README.md
@lex00 lex00 added the area:workspace chant workspace epic (#2525) label Oct 4, 2026
@lex00
lex00 merged commit 1ada3aa into main Oct 4, 2026
10 of 11 checks passed
@lex00
lex00 deleted the ws-f4-broker-report branch October 4, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace chant workspace epic (#2525)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workspace: name listing and spend in the broker protocol's declaration report

1 participant