ci(repo-size): phase-1 prevention for AWS Security Agent 512 MB clone limit - #758
ci(repo-size): phase-1 prevention for AWS Security Agent 512 MB clone limit#758emooreatx wants to merge 2 commits into
Conversation
… limit AWS Security Agent's code review refuses to clone repos >512 MB. Working tree is 397 MB and .git is 207 MB (~600 MB total), mostly historical binary churn (Resources.zip × 12, libciris_verify_ffi.so × 33, etc). Phase 1 (this commit) installs guardrails so the situation can't recur and shrinks the pip-shipped tree slightly. The destructive history rewrite that actually drops repo size below 512 MB is deferred to Phase 2 (separate coordinated PR; needs CI updates so Resources.zip + jniLibs are rebuilt from source instead of expected in-tree). Changes: - .pre-commit-config.yaml: tighten check-added-large-files 500 → 250 KB, document the intentionally-tracked allowlist (cities.db, android wheels) - .gitignore: add coverage.json (sibling of coverage.xml / .coverage) - coverage.json: git rm --cached (2.3 MB; generated artifact, working tree copy preserved) - .github/workflows/repo-size-audit.yml: advisory CI job that reports pack size + largest blobs and warns at 250 MiB, fails at 450 MiB - CLAUDE.md: add Repo Size entry under Quality Standards pointing at the canonical fetch-from-release pattern (tools/update_ciris_verify.py) Honest caveat: this PR does NOT bring the repo under 512 MB. GitHub still reports it >512 MB because the historical churn is in the pack. AWS Security Agent will continue to refuse to clone until Phase 2 lands. https://claude.ai/code/session_01SVPXzanrJYFBdhpkg8HsfB
|
|
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d332bcf404
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - id: check-added-large-files | ||
| args: ['--maxkb=500'] | ||
| args: ['--maxkb=250'] |
There was a problem hiding this comment.
Honor allowlisted binaries in large-file pre-commit hook
The new check-added-large-files setting enforces --maxkb=250 but does not configure any exclude for the files this same block describes as intentionally allowlisted (cities.db and Android wheel artifacts). Because this hook checks newly added files, routine wheel version bumps (new client/androidApp/wheels/pydantic_core-...whl filenames) will be rejected and force developers to bypass hooks, which directly contradicts the stated policy and can block normal Android packaging updates.
Useful? React with 👍 / 👎.
Per PR feedback (P2 Badge Honor): the new check-added-large-files hook at --maxkb=250 doesn't actually exclude the files this same block describes as intentionally allowlisted. Wheel version-bumps (e.g., pydantic_core-2.23.4-...whl → 2.24.0-...whl) are "new files" to the hook and would be rejected — forcing developers to bypass with --no-verify, contradicting the policy stated in the comment. Fix: add an `exclude:` regex covering cities.db + the wheels/ glob. Same `(?x)^(...)$` shape as the global exclude at the bottom of the file. Documented requirement for additions: must meet the same justification standard as bypassing the hook would. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
…1 gate Two bugs in the size-audit workflow (cherry-picked from PR #758): 1. **Broken pipe**: `sort | head -20` with `set -euo pipefail` failed step 2 (and would fail step 3) with exit 141 from SIGPIPE — the top-20 listing prints correctly but the step fails on cleanup, masking the real signal. Fixed by switching to `awk 'NR<=20'` which reads its full input and never closes the pipe early. 2. **Thresholds dead-letter for Phase 1 state**: workflow had WARN=250 / FAIL=450 MiB but actual repo pack is ~1,121 MiB from historical binary churn (libciris_verify_ffi × N platforms × N versions, Resources.zip × N, llama-server-arm64, etc.). The FAIL was a permanent red ❌ on every CI run with no actionable fix in this PR (the BFG history rewrite is Phase 2). That trains alert fatigue — exactly the failure mode the workflow exists to prevent. Fix: Phase 1 is advisory-only. New env knob `FAIL_HARD=false` downgrades >=FAIL to a warning instead of a hard error. Bumped WARN=1300 / FAIL=1500 so we surface regressions worse than today's baseline without spamming the current state. Phase 2 plan documented inline: when BFG history rewrite drops pack to ~205 MiB, flip the env block to WARN=250 / FAIL=450 / FAIL_HARD=true and the gate becomes blocking again. Net effect: workflow now does its actual job — lists the largest tracked files + largest historical blobs without erroring, surfaces size growth as warnings, doesn't block CI on a pre-existing condition that has its own remediation plan. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Subsumed by #759. All Phase 1 repo-size work has been brought into the 2.8.12 patch release for consolidated shipping:
This PR can be closed after #759 merges. Closing will be tracked in #759's description. 🤖 Generated with Claude Code |



AWS Security Agent's code review refuses to clone repos >512 MB. Working
tree is 397 MB and .git is 207 MB (~600 MB total), mostly historical binary
churn (Resources.zip × 12, libciris_verify_ffi.so × 33, etc).
Phase 1 (this commit) installs guardrails so the situation can't recur and
shrinks the pip-shipped tree slightly. The destructive history rewrite that
actually drops repo size below 512 MB is deferred to Phase 2 (separate
coordinated PR; needs CI updates so Resources.zip + jniLibs are rebuilt
from source instead of expected in-tree).
Changes:
document the intentionally-tracked allowlist (cities.db, android wheels)
copy preserved)
size + largest blobs and warns at 250 MiB, fails at 450 MiB
canonical fetch-from-release pattern (tools/update_ciris_verify.py)
Honest caveat: this PR does NOT bring the repo under 512 MB. GitHub still
reports it >512 MB because the historical churn is in the pack. AWS Security
Agent will continue to refuse to clone until Phase 2 lands.
https://claude.ai/code/session_01SVPXzanrJYFBdhpkg8HsfB