8000 A chunked Audit under-reports its model-call count by one · Issue #54 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

A chunked Audit under-reports its model-call count by one #54

Closed

Description

@kiran-brahma

What

For a chunked Audit, the reported call count is one short of the number of model calls actually made.

  • src/core/audit.ts:396 — chunkedResults(...) returns one result per Section chunk.
  • src/core/audit.ts:402 — an extra synthesis call is made over the chunk accounts.
  • src/core/audit.ts:423 — the result reports chunks: chunks.length.

Spec story 131 describes chunks as how many calls the Run took. With one chunk it is 1 and correct
(src/core/audit.ts:489); with N chunks the Run makes N + 1 calls but reports N.

Impact

Small but it is a number shown to the Writer and used to reason about cost. It under-reports exactly
when the Run was expensive enough to chunk.

Fix

Decide what the field means and make it true — either report the true call count (chunks + 1 when a
synthesis ran), or rename it to what it is (the chunk count) and expose the synthesis separately.
Whichever, add a test using the existing characterLimit harness case, which already forces a
chunked Audit.

Activity

  1. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Decision (Writer, 2026-09-26): report the true call count. chunks is how many model calls the Run took (story 131): N chunk calls plus 1 when a synthesis ran. The one-chunk case stays 1. Add the test through the existing characterLimit case that forces a chunked Audit.

  2. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Fixed in #73 (merged into v1.3), per the decision: a chunked Audit reports N + 1 calls; one chunk stays 1; tested through the characterLimit harness case. The Audit panel line now reads "Read in N−1 overlapping chunks, then synthesized: N calls."

    Known edge: an Audit account stored before this change still holds the old chunk count, so it will display one call short in that line. No migration was added (none allowed this increment).


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentSpec is ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0