Repository navigation
Conversation
scripts/static/beacon/compress-assets.mjs and its AGPL-3.0 LICENSE are replaced by scripts/static/precompress.js, written for this repo under its GPLv3 licence. Behaviour is unchanged: the same nine text extensions, Brotli at max quality in text mode and gzip at level 9, and a copy only when it is smaller. On a full packaging of public/ the two scripts produce byte-identical trees (132 .br + 132 .gz). build.sh calls the new script; Dockerfile.web and the Caddyfile are untouched. test-static-build.js now also checks that a second packaging gives identical copies, that gzip carries no mtime, and that nothing under scripts/static is AGPL-licensed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoReplace AGPL asset compress script with GPLv3 precompress.js
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand |
For Kpa-clawbot#2512. This replaces
scripts/static/beacon/compress-assets.mjsand its AGPL-3.0LICENSEwithscripts/static/precompress.js, written for CoreScope under the repo's GPLv3. The repo then carries no AGPL file, and nothing else in Kpa-clawbot#2512 changes.What changes
scripts/static/precompress.js(new): walks the packaged tree and writes.brand.gzcopies beside each text file. It uses the same nine extensions, Brotli at max quality in text mode, gzip at level 9, and only keeps a copy that is smaller.scripts/static/build.sh: thePRECOMPRESSstep calls the new script.Dockerfile.webanddocker/web/Caddyfileare untouched.scripts/static/beacon/is removed.tests/unit/test-static-build.js: the precompression test also checks that a second packaging gives identical copies and that gzip carries no mtime. A new test fails if any file underscripts/staticis AGPL-licensed.The new script was written after reading the original, so this is a rewrite rather than a clean-room one. The work is a handful of Node
zlibcalls, and the code is structured differently (synchronous, its own directory walk, CommonJS).Testing
public/, the old and new scripts produce byte-identical trees (diff -r, 132.br+ 132.gz).node tests/unit/test-static-build.js: 34 passed.node tests/unit/test-web-container.js: 10 passed.LICENSEput back, the new AGPL test fails, as intended.Dockerfile.weband ran the image. For/app.js, Caddy answersContent-Encoding: br,gzipor identity depending onAccept-Encoding, withVary: Accept-Encodingand the rightContent-Type. Both compressed bodies decode to the exact identity body.Merging this into
codex/split-assets-20261129updates Kpa-clawbot#2512.🤖 Generated with Claude Code