8000 A chunked Audit under-reports its model-call count by one by kiran-brahma · Pull Request #73 · 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 - #73

Merged
kiran-brahma merged 1 commit into
v1.3from
v1.3-54
Sep 26, 2026
Merged

kiran-brahma merged 1 commit into
v1.3from
v1.3-54

Conversation

@kiran-brahma
Copy link
Copy Markdown
Owner

Closes #54.

Per the Writer's decision on the issue, 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.

  • src/core/audit.ts: a chunked Audit reports chunks.length + 1. Doc comments updated to match.
  • src/storage/auditAccounts.ts, harness/constitution.ts: field docs now say "model calls".
  • src/editor/BandPanel.tsx: the Audit report line was "Read in N overlapping chunks, then synthesized." and would now have been off by one. It now reads "Read in N−1 overlapping chunks, then synthesized: N calls."
  • harness/constitution.test.ts: new test on the existing characterLimit: 250 chunked Audit case. It checks each case's reported count against the requests its fixture transport recorded.
  • src/core/audit.test.ts: the existing unit test asserted the old meaning (requests.length === chunks + 1). It now asserts requests.length === chunks.

Acceptance criteria

  • The reported count is the true call count: chunks + 1 when a synthesis ran. Verified by the harness test and the unit test.
  • The one-chunk case stays 1. It goes through the unchanged finishAudit path, and the existing tests that expect chunks: 1 still pass.
  • A test goes through the existing characterLimit harness case that forces a chunked Audit. The new harness test failed before the fix (5 reported, 6 calls made) and passes after it.
  • How the report line looks in the running app has not been checked visually. Showing it takes a live chunked Audit against a configured provider, which I couldn't run here. The text change is a single template string.

Checks: pnpm test (998 passed), pnpm typecheck, pnpm run gates (clean), pnpm build: all pass. There is no Dexie migration, the findings schema is unchanged, and there is no new affordance.

🤖 Generated with Claude Code


Generated by Claude Code

A chunked Audit makes one call per Section chunk plus a synthesis call, but
reported only the chunk count. Per the Writer's decision on #54, `chunks` is
how many model calls the Run took (story 131): N chunk calls plus one for the
synthesis. A Document that fits one call still reports 1.

The harness's chunked Audit case now checks the reported count against the
calls the fixture transport recorded, and the Audit report line names both
the chunks and the calls.

Closes #54.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Sep 26, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-26T09:34:47.770325Z 6ec6ab3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

0