Skip to content

Slim more agent output, fix spending report dates, add an output size benchmark - #9

Merged
kwaich merged 5 commits into
mainfrom
claude/adoring-ptolemy-4l00y9
Oct 18, 2026
Merged

kwaich merged 5 commits into
mainfrom
claude/adoring-ptolemy-4l00y9

Conversation

@kwaich

@kwaich kwaich commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  1. Slim the reads that were still raw, and add --fields
    • wf holdings: one flat row per holding (assetId, symbol, quantity, price, and values and gains in the base currency). For a foreign-currency holding it adds fxRate and marketValueLocal. Nulls are left out. --full returns the server rows unchanged.
    • wf budget: only the computed totals, groups and categories, without ids, colours or empty categories. --full returns {state, computed}.
    • wf spending report: leaves out byDay and byDayByCategory unless --full.
    • wf health: also leaves out routes, translation keys and cache keys. fixAction stays whole, because execute_health_fix needs its payload.
    • wf rebalance: leaves out category colours unless --full.
    • --wait: removes the provider request URL from each failed_syncs message.
    • New global --fields a,b.c: keeps only those fields of each row, on every command, wf call included. An empty list exits 2.
  2. Fix wf spending report dates. The server parses startDate/endDate as RFC 3339. A bare YYYY-MM-DD fails with a 500 ("premature end of input") as soon as an account is tracked for spending. The CLI now sends the first and last millisecond of each day in the app's timezone, the same way the web app does (zonedCalendarDateBoundaryToDate). The default --to is also today in the app's timezone. appTimezone(client) is shared with wf health --refresh.
  3. Output size benchmark
    • scripts/bench-seed.sh seeds a fixed data set: 3 accounts, 8 stocks, about 120 activities, and a month of categorised spending with budget targets.
    • scripts/bench.sh [ref] prints a Markdown table of output sizes. Given a git ref, it compares this build with that ref.
    • scripts/test-server.sh gets WF_TEST_PROXY=1 / WF_TEST_CA_BUNDLE, so quote syncs work behind a proxy.

Measured (scripts/bench.sh 10b3395, real Yahoo prices)

Command 0.3.1 This branch
holdings ~3.1k tokens ~1.3k (−58%)
holdings --account ~2.2k ~860 (−60%)
budget ~4.0k ~630 (−84%)
spending report exit 1 ~390
health ~175 ~115 (before fixAction was restored; a little more now)

Breaking changes

These change the default output of holdings and budget. Scripts that read instrument.symbol or state need --full. I suggest releasing this as 0.4.0. The version is not bumped in this PR.

Test plan

  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm test (159 passed)
  • WF_TEST_REFRESH=1 pnpm test:integration against the 3.10.0 image (13 passed), with the default test-server.sh (no proxy). Not run again after the review-fix commits; CI runs it.
  • scripts/bench-seed.sh + scripts/bench.sh 10b3395 against a fresh server with the proxy

🤖 Generated with Claude Code

https://claude.ai/code/session_0178eJr8TT5NezDCgT1yLgZp

Measured against the 3.10.0 server image with 2 accounts, 8 assets and
~100 activities:

- holdings: one flat row per holding, base-currency values, nulls left
  out (9.8 KB -> 3.4 KB). --full keeps the server rows.
- budget: computed rows only, without ids, colours and empty
  categories (13.7 KB -> 0.8 KB with no budget set up).
- spending report: byDay and byDayByCategory only with --full.
- health: also drops routes, translation keys, cache keys and the fix
  payload (8.4 KB -> 5.6 KB).
- rebalance: category colours only with --full.
- --wait: failed_syncs messages lose the provider URL (2.7 KB -> 1.3 KB).
- Global --fields a,b.c projects each row, wf call included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0178eJr8TT5NezDCgT1yLgZp
The server parses startDate and endDate as RFC 3339 instants. With no
account opted into spending it returns zeros before parsing, so a bare
YYYY-MM-DD passed the integration test; once an account is tracked the
report failed with "premature end of input" (500). Send the first and
last millisecond of each day in the app's timezone, as the web app does
(zonedCalendarDateBoundaryToDate).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0178eJr8TT5NezDCgT1yLgZp
scripts/bench-seed.sh fills a fresh test server with a fixed data set
(3 accounts, 8 stocks, ~120 activities, a month of categorised spending
with budget targets). scripts/bench.sh prints a Markdown table of each
read command's output size, and with a git ref builds that ref in a
temporary worktree and compares.

test-server.sh: WF_TEST_PROXY=1 passes HTTPS_PROXY (and
WF_TEST_CA_BUNDLE) to the server, so quote syncs work in sandboxes whose
outbound traffic goes through a proxy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0178eJr8TT5NezDCgT1yLgZp
…ards

- spending report: the default --to is today in the app's timezone, so
  it names the same day as the boundaries sent to the server.
- appTimezone(client) in context.ts serves spending report and
  health --refresh.
- --fields with an empty list exits 2 instead of printing {} rows.
- --fields reads only a row's own properties, not inherited ones such as
  constructor or __proto__.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0178eJr8TT5NezDCgT1yLgZp
execute_health_fix needs the action's payload; an {id, label} stub
looked usable but would run the fix with nothing to act on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0178eJr8TT5NezDCgT1yLgZp
@kwaich
kwaich merged commit 43ab7c2 into main Oct 18, 2026
3 checks passed
@kwaich
kwaich deleted the claude/adoring-ptolemy-4l00y9 branch October 18, 2026 13:58
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.

2 participants