From dc12924740fa591f71ac9778ad8fc9d7292c66ae Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 3 Nov 2026 19:23:12 +0000 Subject: [PATCH] test: pin the capy skill's context budget for the read-view line (5315 -> 5425) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- changelog.d/garrytan-r68-crew-threads-attach.md | 2 +- test/context-budget-ratchet.test.ts | 5 +++++ test/fixtures/context-budget.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.d/garrytan-r68-crew-threads-attach.md b/changelog.d/garrytan-r68-crew-threads-attach.md index 17b23509a..d37f3eca1 100644 --- a/changelog.d/garrytan-r68-crew-threads-attach.md +++ b/changelog.d/garrytan-r68-crew-threads-attach.md @@ -3,4 +3,4 @@ ### Changed - **docs/captain.md** has a new section, "New threads join the crew". A crew thread asks its Captain for a new thread, and the Captain creates it in the crew. A thread the crew thread already made gets reported by code in that turn, so the Captain can add it with `crew.add`. A thread in another project goes Captain to Captain: the receiving Captain creates it in its own crew as work, briefs it and returns the result. Only a project with no Captain lets the crew thread create the thread itself, with the code recorded on the work's issue. The cause: GBRA-240 created GBEV-33 directly in another project, and that thread ran outside every crew. - **The Capy factory context (`factory.md` point 12)** now has the short version and cites that section. Its byte budget in `test/capy-skill-wrapper.test.ts` goes from 3,300 to 3,450: the page's new size rounded up to the next 25 bytes, and no other point was trimmed. -- **The Capy skill's host adaptations** say that `tools.capy.read` returns about the first 38,000 characters, with each line cut at 2,000. So a read, change and `tools.capy.write` program saves a truncated file, Drive files included. Edit long files with `tools.capy.edit`, or read and write the whole file in bash or Python and check the line count. `tools.drive.history` restores a recent version. This is how the org knowledge base's rules.md lost 37 rules. +- **The Capy skill's host adaptations** say that `tools.capy.read` returns about the first 38,000 characters, with each line cut at 2,000. So a read, change and `tools.capy.write` program saves a truncated file, Drive files included. Edit long files with `tools.capy.edit`, or read and write the whole file in bash or Python and check the line count. `tools.drive.history` restores a recent version. This is how the org knowledge base's rules.md lost 37 rules. The skill's context-budget ceiling (`test/fixtures/context-budget.json`) goes from 5,315 to 5,425 tokens, the measured 5,409 rounded up to the next 25, for this one line. diff --git a/test/context-budget-ratchet.test.ts b/test/context-budget-ratchet.test.ts index 4ef193913..1124ee059 100644 --- a/test/context-budget-ratchet.test.ts +++ b/test/context-budget-ratchet.test.ts @@ -23,6 +23,11 @@ * copy-paste): fix the bloat instead. * 3. After a token-reduction phase lands: re-run the capture so ceilings * ratchet down and the win is locked against regression. + * + * Hand pin: capy/skill/gstack went from 5315 to 5425 (measured 5409, rounded up + * to the next 25, no headroom) for the host-adaptation line saying + * tools.capy.read returns a cut-down view, so a read-then-write truncates + * (2026-11-03). Raise a hand pin only by what the change needs. */ import { describe, test, expect } from 'bun:test'; import * as fs from 'fs'; diff --git a/test/fixtures/context-budget.json b/test/fixtures/context-budget.json index 48a84e702..ec423fe43 100644 --- a/test/fixtures/context-budget.json +++ b/test/fixtures/context-budget.json @@ -9,7 +9,7 @@ "browser-skills/hackernews-frontpage": 371, "canary": 7738, "captain": 6551, - "capy/skill/gstack": 5315, + "capy/skill/gstack": 5425, "careful": 1239, "codex": 9890, "context-restore": 6287,