Skip to content

fix(spend,docs): a large Claude Code log no longer closes the cap; the install docs give a runnable sakk (F-244, F-245) - #9

Merged
RayGuo96 merged 1 commit into
mainfrom
fix/install-docs-big-logs
Nov 12, 2026
Merged

RayGuo96 merged 1 commit into
mainfrom
fix/install-docs-big-logs

Conversation

@RayGuo96

Copy link
Copy Markdown

First half of the 0.4.1 sync, split out so each answers file is judged on its own range (the release commit follows in #8).

  • F-244 — a Claude Code transcript over 512 MiB no longer closes the spend cap with SPEND_LOGS_UNLISTABLE. Logs are read in 8 MiB pieces and split on newline bytes; a deny names the error code and says "fix permissions" only for EACCES/EPERM. A single line over 3 MiB still counts as unreadable (with a cap set: SPEND_UNREADABLE).
  • F-245 — install docs (README, README.zh-CN, tutorials) install with npm install -g @sakk-dev/sakk, run sakk --version, name --user for a whole-machine guard and Claude Code 2.1.295+, and give a no-risk real-session check.

Same commit as the private repository's merged change, history filtered as in ADR-0012.

🤖 Generated with Claude Code

…e install docs give a runnable sakk (F-244, F-245)

F-244: a Claude Code transcript past Node's longest string (about 512 MiB)
made the spend read throw ERR_STRING_TOO_LONG, which the cap reported as
SPEND_LOGS_UNLISTABLE with "fix the permissions", so a set cap would deny
every call. Found on the owner's machine during a real install (one
transcript had reached about 800 MB).

- The unread tail is read in 8 MiB pieces and split on the newline byte.
  A carried line is held as bytes; a line over 3 x MAX_LINE bytes counts as
  one unreadable line without being decoded.
- Parsed lines are booked only after the whole read of the file succeeds,
  so a failed read leaves the stored offset where it was.
- The deny and sakk spend name the error code and say to fix permissions
  only for EACCES/EPERM. Error codes are unchanged.
- Red before: the new test writes a log past the running Node's limit and
  failed with ERR_STRING_TOO_LONG in the deny; green after. Piece sizes
  1, 7, 64 and the default give the same offsets and spend.

F-245: the README installed with `npm install @sakk-dev/sakk` (not on
PATH), showed only the per-project guard and did not say Claude Code
2.1.295+ is needed for a fail-closed guard.

- Both READMEs install with -g, show `sakk guard install claude-code
  --user` and its uninstall, name 2.1.295 and `claude update`, and give a
  no-risk check in a folder with no remote.
- Both tutorials point a real install to the README.
- New test reads every fenced npm install of the package in the READMEs
  and tutorials and the minimum version from src/guard-install.mjs. Red
  before on README.md:115 and README.zh-CN.md:110.

Release prep for 0.4.1: package.json, plugin.json and the Python package
move to 0.4.1 (F-111). The tutorials' install, guard, try, cap, spend,
hook, cap raise, json, prices, halt/status and uninstall steps were re-run
with 0.4.1 in a throwaway home; outputs match apart from dates and the
version lines, which now say 0.4.1, and one punctuation fix the run showed
("changes the policy. If").

Gate: 1513 + 106 pass, 0 fail.

Signed-off-by: sakk-dev <maintainers@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RayGuo96
RayGuo96 merged commit 899a5eb into main Nov 12, 2026
10 checks passed
@RayGuo96
RayGuo96 deleted the fix/install-docs-big-logs branch November 12, 2026 13:01
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.

1 participant