fix(crafter): bound AccessChk memory use during policy evaluation - #3341
Merged
Conversation
Stream the AccessChk parser and size-gate the verbatim raw-text fallback fields so large materials no longer drive peak memory to many GB and OOM-kill the CI runner during client-side policy evaluation. The parser now reads the input line by line instead of building a normalized full-text copy and splitting every line at once, and it stops pinning the whole input via stored substrings. The Raw and per-object RawLines fallback fields are retained only for inputs below a size limit and omitted above it; they are not attested and unused by policies, so the recorded evidence and current evaluations are unchanged. Object detection no longer depends on the Raw field, and the crafter warns when a material exceeds the retention limit. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: 3216ee57-5895-4c05-8891-8bd110d70aa2
Contributor
AI Session Checks —
|
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | pr-description-required |
- |
| ✅ Passed | pr-user-story-linked |
- |
⏭️ 3 scans not applied
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
iac-scan |
no IaC files changed |
Powered by Chainloop and Chainloop Trace
jiparis
approved these changes
Aug 11, 2026
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
SYSINTERNALS_ACCESSCHKmaterial type could drive the CLI to very high peak memory during client-side policy evaluation, risking an OOM kill of the CI runner for large materials. This bounds that memory use.rawand per-objectraw_lines): retain them for inputs below a threshold and omit them above it, keeping the JSON projection handed to the policy engine from ballooning to multiples of the original file size. These fields are not attested and are unused by current policies, so recorded evidence and evaluations are unchanged.rawfield so oversized descriptor-only materials are still recognized.Closes PFM-6922.
AI assistance
This change was produced with the assistance of Claude Code.