fix(acquisition): bind commercial source records - #526
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRevenue 및 transfer evidence의 ChangesAcquisition evidence integrity
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: 🟡 Moderate · up to Failed-output cleanup can hang indefinitely if a locally authorized actor replaces the target with a FIFO, delaying report generation and potentially retaining the writer lock. Merge should wait for the non-blocking cleanup fix or explicit owner acceptance. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 12 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks 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 |
…with README/license/runner-pin PR #530/#532 Fast-forwards this PR's branch past two merges it was behind (5aad3e4 -> 6b2b3e9): PR #532 (pinned GitHub-hosted runner selectors, fixing a floating-runner CI stall) and PR #530 (product-first README, Apache-2.0 root LICENSE + docs/index.md, dependency-license gap tracking for issue #531). Both merged cleanly via git's 3-way merge except for one genuine text conflict, plus one non-textual semantic incompatibility surfaced only by running the test suite. Text conflict resolved: - docs/product-technical-gap-baseline.md: both PRs independently rewrote the same "Authority and update rule" snapshot line and the same three-row "Live external observation" table (this PR's lane recorded open-PR/hourly-loop governance state as of dd6ff2a; #530's lane recorded README/license-lane state as of 5aad3e4). Combined both lanes' distinct observations into one merged snapshot paragraph and a six-row table (kept both PR lanes' rows, merged the two differently-worded "Release/publication" rows into one), and corrected the now-stale "PR #530 is open" claim to reflect that it has since merged into protected main at 6b2b3e9 (directly evidenced by this merge, not fabricated). No test asserts this table's exact wording (test/documentation-architecture-contract.test.ts only checks for specific issue-number substrings), so no other file needed this treatment. Files independently changed by only one side (ci.yml, patch-validator-image.yml, reviewer-ci.yml, README.md, docs/LICENSING_AND_IP_TRANSFER.md, docs/security/private-vulnerability-reporting-audit.md, scripts/lib/private-vulnerability-reporting-audit.mjs, scripts/private-vulnerability-reporting-audit.mjs, associated tests) and files both sides touched in disjoint regions (CHANGELOG.md; scripts/acquisition-readiness-audit.mjs, where this PR's new MAX_SOURCE_DOCUMENTS/source_documents digest-binding logic near the top of the file and #530's packageDistributionApplies/ packageMetadataDeclared licensing logic near the bottom do not overlap) merged automatically with no marker conflicts; verified by diffing each side against the merge base and confirming both sides' additions are present in the merged result. Semantic fix (not a git conflict, found via tests): - test/acquisition-source-only-license.test.ts (added by #530, so written without knowledge of this PR's stricter contract) built its transfer-evidence.json fixture with the pre-#526 loose format `source_documents: ["legal/review-record.pdf"]` (a bare string label). This PR's whole purpose is to replace that with bounded structured `{path, sha256}` retained-artifact bindings, so the new validateDigestBoundArtifact check correctly rejected the old-format fixture ("source_documents[0] artifact binding required"). Updated the fixture to emit a real digest-bound artifact via the file's own existing digestArtifact() helper, matching the same pattern already used by the currently-passing test/acquisition-transfer-rights.test.ts fixture. This is the deliberate, intended tightening this PR introduces; the fixture simply hadn't been written against it yet. Verification: - npm run typecheck: clean, no errors. - npm test (Node 24.19.0, matching devEngines/CI): 3737 passed, 0 failed, 1 pre-existing unrelated skip, after the fixture fix above. - Established a pre-existing-failure baseline by running the full suite twice on an unmodified fresh origin/main checkout: it is not perfectly stable under this sandbox's full-parallel test run (534/534 on one run, 1 failure in test/acquisition-review-regressions.test.ts on another, both with byte-identical source) - a pre-existing, environment-specific flake where tests that fail-closed-verify the live working tree against exact HEAD, or share one on-disk output directory, race against sibling test files under full-suite parallelism. The 5 non-source_documents failures initially observed on this branch before finishing the merge commit (acquisition-data- room-manifest x2, acquisition-output-symlink x2, dependency-license-inventory-release-wiring x1) were an artifact of running those exact-HEAD integrity checks against a working tree that legitimately did not yet match any commit (HEAD was still eaebeec while the tree already held the in-progress merge); each passes individually once run against a worktree whose HEAD matches its tree, confirmed by rerunning them standalone both before and after this commit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Merged current
|
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Investigated independently — both previously-flagged problems are already fixed on the current headWorking in an isolated worktree off 1.
|
…e-document-authority
|
Triage: this branch was 63 commits behind
One review thread remains unresolved ( Generated by Claude Code |
writeAcquisitionPrivateFile's pre-replacement verification open of an existing target used O_RDONLY | O_NOFOLLOW without O_NONBLOCK, even though O_NONBLOCK was already required as a filesystem capability. A locally authorized actor racing the prior lstatSync regular-file check with a FIFO substitution could make this open block indefinitely waiting for a writer, wedging the writer lease and delaying report generation (CodeRabbit finding on PR #526). Add O_NONBLOCK to that open: it is a no-op on regular files, and on a FIFO the open now returns immediately so the existing descriptor-type check fails closed instead of hanging. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPmJErfkcHer4UVEgrQxUX
# Conflicts: # CHANGELOG.md
|
Exact head Generated by Claude Code |
|
Fresh protected-base repair supersedes the prior exact-head block. Protected |
|
2026-09-06 KST post-#546 repair finding: protected base advanced to |
Scope
Keep acquisition/commercial evidence fail closed: retained source-document byte identity, distributed-package metadata identity, filesystem race resistance, report schema, runner-assignment evidence integrity and buyer/legal authority separation. Hashes, CI, SBOMs, scanners and source licensing do not create acquisition/legal truth.
Current exact authority — 2026-09-06 KST
Protected Noema is
main@e26d771470a4ece873c367b40b3cd6cb03ac7de3. Ordinary two-parent/non-force restackbd4c9079b5c81c0cd63cae6fb0bdd4a845e9fbf2preserves bounded retained{path, sha256}source authority, protected package digest semantics and the filesystem regressions while adopting merged #527 OIDC trust. The global product-gap baseline remains owned only by #547.Fresh exact-head
reviewer-ci 34026914275,ci 34026914283,patch-validator-image 34026914307, and requiredSecurity Scan 34026914268are queued. Predecessor GREEN does not transfer. Keep Draft until current terminal gate/review evidence is complete.