fix(score): bound native PDF reads before allocation - #865
seonghobae wants to merge 13 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@opencode-agent EXECUTION-FIRST owner repair on the existing This is the canonical owner of accepted high-priority issue #864. Non-destructively integrate the live protected Before resolving the Draft, apply If the merged exact head is clean, update the PR body to the actual head/base and current evidence, move out of Draft only when the branch itself is review-ready, request/obtain independent non-author review through the existing authorized review path, and resolve only findings proven addressed. Do not merge unless every applicable required exact-head check and qualifying independent approval pass on the unchanged head. |
Integrate protected develop@749511c3ad4000090048718f685c6bee6b3d2c25 into the canonical #864 owner branch without rewriting history. Preserve the shipped npm/PDF security baseline and first-playable-range changelog truth while retaining the bounded native score-PDF read implementation and regressions.
|
@OpenCode EXECUTION-FIRST continuation on the existing canonical #864 owner branch only. Apply Fresh identity immediately before this handoff: PR #865 remains open/Draft/unmerged at exact The current hosted repository evidence is stale/incomplete rather than GREEN: exact-head First verify the current source still implements the #864 native pre-allocation boundary and run the focused Rust regressions for valid bytes, empty/short/wrong magic, sparse >25 MiB, same-descriptor growth probe, truncation-after-snapshot, missing/non-file paths where supported. Then run the repository's canonical full quickcheck/rustfmt/clippy/rustdoc/owned coverage and any locally executable release/security checks. If a BandScope-owned defect appears, reproduce RED and repair it narrowly on this same branch, then rerun focused/full GREEN. If source is clean, use the repository-authorized PR-state path to move this exact unchanged head out of Draft so fresh required workflows can materialize; do not fabricate success from the old queued/cancelled runs. After Ready, refetch exact head/base and let the normal exact-head CI/build/security/OpenCode/Noema/Strix gates run. Do not request an independent review until deterministic exact-head gates have materialized cleanly. |
Re-emit the unchanged #864 tree so cancelled/never-materialized current-head workflow evidence is replaced by fresh exact-head runs. No production, test, dependency, workflow, or documentation content changes.
|
@opencode-agent review Review exact current head Revalidate the native stored-score trust boundary: pre-allocation 25 MiB ceiling, same-descriptor exact read plus growth probe, truncation failure, PDF magic revalidation, path/payload-safe errors, preserved path-containment ownership, Rust regressions/rustdoc, and current security/supply-chain evidence. Bind any formal verdict only to |
|
Fresh gate RCA for exact
Keep #865 Draft and preserve the score-read delta. Its local product repair is not the causal source of either failure; wait for ordinary integration of the formatter prerequisite and central Strix/CodeQL owner settlement, then obtain fresh exact-head evidence rather than manufacturing a wake commit. |
|
Central owner path now exists for the deterministic Strix binder failure: ContextualWisdomLab/.github#2292. #865 should consume that repair only after it is integrated/released through the protected central required-workflow contract; do not vendor |
Security gap
Closes #864 after protected merge. The native score-read command previously resolved the app-owned score path and then used an unbounded file read, so a stored PDF that grew after attachment could allocate beyond the 25 MiB product ceiling before the JavaScript bridge rejected it.
Exact current identity
develop@314ddeae7b775a4957594b599358c8255617eb2e.1f4877413e2eed30b224eaf1b095af3b0b905cb0.fix/bounded-score-pdf-read-864.The former head
c2c86b8b4f82cbdceabdc52516a33d8d2bd8614ahad diverged from protecteddevelopbecause two repository workflow/backstop commits landed after its merge base749511c3ad4000090048718f685c6bee6b3d2c25. This was repaired without force-push or destructive rebase:1f487741…is an ordinary two-parent merge ofc2c86b…and protecteddevelop@314ddeae…, with the one overlapping CHANGELOG entry reconciled. Fresh compare reportsbehind_by=0; the unique score-read delta remains exactly six files.Regression-first repair
RED head
f83a1baebc793658c4d1805be00f11238f09ceaccommitted the GUI-independent regression before production changes. Current production behavior:MAX_SCORE_PDF_BYTESbefore heap allocation;%PDF-magic on the bytes actually returned to IPC;read_score_pdfthroughread_validated_score_pdfinstead ofstd::fs::read.The regression set covers valid content, empty/short/wrong-magic content, a sparse
MAX_SCORE_PDF_BYTES + 1file, missing paths, a non-file descriptor where supported, growth after the metadata snapshot, and truncation after the metadata snapshot.Scope / ownership
This PR owns only the native read-time allocation/content boundary.
resolve_existing_score_pdfremains the path-authority owner; broader filesystem/workspace authority remains outside this slice. #1239 / PR #1241 is the separate Score Storage write/publication owner and non-force descends from this exact foundation. No dependency/root-lock, network, database, model, review credential, or new IPC-command authority is added by the score-read delta.Exact-current-head RCA
Exact
1f4877413e2eed30b224eaf1b095af3b0b905cb0has terminal repository evidence rather than the older queued state:build-baseline35452436519: SUCCESS;35452436616: SUCCESS;35452436569: SUCCESS;35452436556: SUCCESS;ci35452436567: FAILURE only inci / build-and-testatRun quickcheck; the separate Rust gate is SUCCESS;35452436510: FAILURE in the compatibility-verdict jobs for Python, JavaScript/TypeScript and Actions, while language detection and the later dispatch job succeed.The
ci / build-and-testfailure is inherited protected-base Ruff formatting debt inservices/analysis-engine/tests/test_supply_chain_policy.py, not this six-file score-read delta. Canonical single-writer repair remains #1176 exact8fe6b6d99c009527ef0bcba419e6f6debdb23c23, whose only live diff is that formatter repair. Do not duplicate it into #865.The CodeQL failure is likewise not evidence for changing #865 score-read source: the compatibility jobs fail while enforcing the central current-head dispatch verdict. Central CodeQL/required-workflow settlement remains a
.githubcontrol-plane responsibility; do not restore duplicate repository scanners, synthesize statuses or create a no-op descendant here.Merge gate
Keep Draft. #1176 must normally integrate first, then #865 must ordinary/non-force reconcile to the new protected
developand reacquire exact-head evidence. A qualifying independent non-author current-head approval is also absent. No force-push, destructive rebase, copied formatter delta, gate weakening, synthetic status, source-neutral wake commit, blind rerun or predecessor-evidence transfer.