fix(cli): filter raw HARs from publishable manuscripts#2525
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 require-ready-label-and-ciWonderful, this rule succeeded.
|
Greptile SummaryThis PR prevents raw HAR captures and oversized capture files from being bundled into published CLI packages by routing all manuscript copy operations through a new
Confidence Score: 5/5Safe to merge. The filter is applied consistently across all three copy sites (archive, promote, publish), the two-pass symlink check correctly covers both symlink names and resolved targets, and every changed code path has a corresponding test that verifies both exclusion and inclusion behavior. The filter logic in copyDirFiltered is straightforward — regular files are checked directly by name and size, symlinks get a two-pass check (symlink name first, then os.Stat-followed target name and size). CopyDir is unchanged and backward-compatible. The publish-package fallback cleanly strips the staged manuscripts directory before re-adding through the filter, sourcing from the original dir rather than the staged copy. Test coverage spans all three call sites and explicitly exercises the threshold boundary (exactly 100 MB file, symlink-to-.har, symlink-to-large-file). No files require special attention. Important Files Changed
|
Merge Queue Status
This pull request spent 17 minutes 29 seconds in the queue, including 14 minutes 29 seconds running CI. Required conditions to merge
|
Summary
Publishable manuscripts no longer carry raw browser-sniff HAR captures or huge capture files. Archive, lock promote, and publish package now all copy manuscript trees through the same publishable filter, while derived artifacts such as research notes, proofs, traffic analysis, and unique-path reports remain bundled.
publish packagealso strips any.manuscriptsdirectory copied from the source CLI before re-adding manuscripts through that filter, with a fallback for embedded manuscript runs when the archive root is unavailable.Closes #2321
Verification
go test ./internal/pipeline -run 'TestArchiveRunArtifactsCopiesDiscovery|TestPromoteWorkingCLI_StagesRunstateManuscripts' -count=1go test ./internal/cli -run 'TestPublishPackageIncludesManuscripts|TestPublishPackageFiltersEmbeddedManuscriptsFallback' -count=1go test ./...go build -o ./cli-printing-press ./cmd/cli-printing-pressgolangci-lint run ./...