open-standards/joulehook/joulehook-rs/crates/joulehook-hook
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 2a2efdff94
Some checks failed
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Has been cancelled
joulehook: compressed command output, the whole kept by digest
An agent's shell commands can print thousands of lines the model then
reads in full on every later call. joulehook-compress runs the command,
keeps its whole output under its BLAKE3 digest, and prints a view made
by deterministic, versioned rules (compress/1): terminal formatting
dropped; a repeated line said once with its count; four or more lines
alike but for their numbers kept as first and last; passing tests and
build progress said as counts for a recognised test run or cargo build;
past a length budget, the head, the tail and the lines between that look
like trouble, each gap marked. A view that leaves anything out ends by
naming the digest and how to read it whole; the store refuses a file
whose bytes do not hash to its name. Exit status and the error stream
are kept. Each run appends a record with the digests and exact byte and
line counts; tokens are counted at the model boundary, not estimated.

The gate rewrites an allowed shell action into it (SPEC §3.5) only where
nothing else changes: on a host whose hook documents a rewrite field
(Claude Code's updatedInput), not for a background command, not for one
already going through the compressor, and only for a command that runs
the same in a child shell; a cd, export, source, shell option, here-doc
or substitution is left alone. The sealed decision is over the action as
asked; the rewrite is a function of it and the configuration.

Falsified, each turns a test red: a store that trusts its files, unseen
substitutions, cd as harmless, trouble not kept past the budget, no
footer, exit status dropped, background commands rewritten, and any host
rewriting (which also showed a decision could claim a compression that
did not happen; the test now checks the claim).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 03:30:38 -05:00
..
src joulehook: compressed command output, the whole kept by digest 2026-11-12 03:30:38 -05:00
tests joulehook: refresh the published deny receipt to jcp/2, and hold it byte for byte 2026-09-30 14:16:01 -04:00
Cargo.toml joulehook: compressed command output, the whole kept by digest 2026-11-12 03:30:38 -05:00