Skip to content

fix: exclude Hack private files from native builds (HACK-2575) - #1135

Open
roodboi wants to merge 3 commits into
nextfrom
codex-hd/native-private-files-next
Open

roodboi wants to merge 3 commits into
nextfrom
codex-hd/native-private-files-next

Conversation

@roodboi

@roodboi roodboi commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Native builds now exclude machine-local .hack/ state, including generated Compose env overrides, and the checkout's .hack.secret.key. The native runtime prunes these paths before hashing or snapshotting, independent of Docker ignore rules. An explicit local COPY of an excluded path fails before the builder runs.

This moves HACK-2575 out of #1129 so it can land without #1112. The shared policy stays in src/ for CLI source copies and is embedded in the native runtime. Native excludes .hack/.env even without a state marker because Hack can write generated output before the marker.

Compose still relies on the effective Docker ignore file. Where that file leaves them exposed, a context containing .hack/ can send lifecycle logs, generated overrides and local env files to Docker. A checkout-root context can also send .hack.secret.key. A follow-up warning before affected Compose builds is tracked separately.

The lead's VM measured three of three builds reused across both retained starts, zero registry requests, and the same context digest across all three starts on a tree with this change. The clean merge with #1106 is being tested separately. #1112 will need conflict resolution in the native build scanner call and release notes.


See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hack-docs Ready Ready Preview Nov 23, 2026 1:09am UTC

Request Review

@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

HACK-2575

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 12600a99626d1d5cf721ebdc111608e9604760ff (verified with git ls-remote).

This is the standalone HACK-2575 change from #1129. On this head, root typecheck, 247 Bun tests, 230 Rust build/scanner/project tests (2 ignored), privacy, and gitleaks passed. The Bun files were native-project-builds, native-project-start, agent-plugin-generation, and hack-gitignore. A local merge with #1106 head 15b888d1f7 was clean. On that combined ref, root typecheck, 254 tests in the same Bun files, and the same 230 Rust tests passed. Hosted gates are pending.

A later merge with #1112 conflicts in packages/runtime-core/src/provider/image_build.rs and docs/versions/v5/release-notes.md. Keep #1112's scan_request split and call the privacy-aware scanner in it. Keep both release-note sections.

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lead check of 12600a9: the change is line for line the one accepted on #1129 (7daccc5), on next. It chains cleanly on the tested set. The VM measurement of that change (three of three builds reused, zero registry requests, one context digest over three starts) is on the issue. Accepted for the next batch.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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