fix(supply-chain): restore simple-path cycle regressions after Bolt rewrite - #886
fix(supply-chain): restore simple-path cycle regressions after Bolt rewrite#886cursor[bot] wants to merge 14 commits into
Conversation
Bolt reapplied a shared (package_key, matched_count) cache on top of the already-restored simple-path walk. That cache lets one package key satisfy two owner-chain positions through a cycle. Restore path-local frozenset prevention, keep the cycle and distinct-key regressions in two test modules, drop the unauthorized pdfjs-dist Trivy ignore, and record the unsafe optimization as a rejected change. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
…ewrite Head bcf22ee replaced the validated frozenset walk with recursive DFS and deleted the cycle/distinct-key tests plus the simple-path policy citation. Restore the locked iterative walk, both regression modules, and the Cormen et al. (2022) owner-chain authority so the next rewrite cannot drop the lock. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Stale comment
Prefer #887 over this restore
This head
f270d3dfcorrectly restores thedbcbe6d9frozenset walk, cycle/distinct-key tests, and Cormen et al. (2022) citation. Keep it closed or unmerged once #887 lands.#887
593b6fe6is the same restore plustest_dependency_policy_documents_named_dependency_path_simple_path_authority, which fails on the Bolt policy file and would have blocked thebcf22eeadeletion. Do not open a fourth restore PR. Do not merge #867 atbcf22eea.Sent by Cursor Automation: Fix Issues
seonghobae
left a comment
There was a problem hiding this comment.
Independent review of f270d3df vs develop acdbea63, with the full cargo_lock_has_named_dependency_path body (not just the docstring hunk) and a file-level compare to draft #887 593b6fe6.
CodeRabbit CLI is not installed in this environment (coderabbit: command not found); this assessment is from the required walk/diff/pytest checks.
Strengths
- The walk at
scripts/checks/verify_supply_chain.py:1998-2012is an iterative path-localfrozensetstack (pending.pop(),next_seen = seen | {current}). It is not recursive DFS and it does not use a shared(package_key, matched_count)cache. Develop already had this body; this PR only documents the simple-path rule. - Cycle fixture
root → alpha@1 → beta → alpha@1with query("alpha", "alpha", "charlie")is False. Distinct keysalpha@1thenalpha@2are True. Direct("alpha", "charlie")on the cyclic graph is True (reproduced in the PR worktree; the last one is not locked). - The four pytest cases are real
load_modulecalls of the matcher, not mocks. All four passed. - Policy text cites Cormen et al. (2022, Appendix B.4) in APA 7th, and
.jules/bolt.mdrejects the shared-cache rewrite. No.trivyignore/pdfjs-dist/CVE-2026-16633change.
Issues
Critical
None.
Important
- Missing required lock for direct
("alpha", "charlie")on the cyclic graph —services/analysis-engine/tests/test_supply_chain_dependency_path_cycles.py:19-23and the twin attest_supply_chain_policy.py:5126-5130only lock the False cycle case. A rewrite that refuses every remaining-name walk once a back-edge exists would still pass both locked tests and break owner-chain matching. The PR description says this case was reproduced; it is not a regression test. - This head is not the best landing vehicle. #886 and #867 now share SHA
f270d3df. Draft #887593b6fe6is the same restore plustest_dependency_policy_documents_named_dependency_path_simple_path_authority, which is RED on develop's policy file and GREEN on this policy text. That is the lock that would have caught the Bolt deletion of the citation/section. After reading both diffs, prefer #887; do not treat it as better on the walk (the walk files are identical).
Minor
- Cycle and distinct-key cases are duplicated across
test_supply_chain_dependency_path_cycles.pyandtest_supply_chain_policy.pywith no extra assertion in the policy module. .jules/bolt.md:64appends the new learning without a blank line after the previous entry.
Recommendations
- Land #887 (mark ready). Close #886 and #867 as the same-SHA restore without the policy-text lock. Do not open a fourth restore PR. Do not merge #867 at any older DFS head.
- On the landing head, add
assert cargo_lock_has_named_dependency_path(..., ("alpha", "charlie"))on the existing cycle fixture. - Keep inherited
pdfjs-dist/CVE-2026-16633on #783.
Assessment
Ready to merge? With fixes. The restore is behaviorally correct, but do not merge #886 over #887, and do not treat the lock set as complete until the direct cyclic-graph case is a real test.
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "alpha", "charlie"), | ||
| ) |
There was a problem hiding this comment.
This locks the False cycle case only. The required counterpart is still missing: on this same fixture, ("alpha", "charlie") must stay True (direct remaining-name match must not die just because beta points back at alpha@1). I reproduced True on this head; please add that assert here (and in the policy-module twin) on the landing vehicle. A walk that skips every other edge after seeing a back-edge would still pass this test and break owner-chain matching.
There was a problem hiding this comment.
Prefer #887; do not merge this restore over the policy-text lock
Exact head f270d3df restores the dbcbe6d9 authority: iterative path-local frozenset in cargo_lock_has_named_dependency_path, cycle/distinct-key regressions in both test modules, Cormen et al. (2022, Appendix B.4) APA citation, and the rejected shared-cache note in .jules/bolt.md. The walk is not recursive DFS and does not use a shared (package_key, matched_count) cache. Reproduced on this head: cycle False, distinct keys True, direct ("alpha", "charlie") True. No .trivyignore / pdfjs-dist / CVE-2026-16633 change.
#867 now points at the same SHA. Draft #887 593b6fe6 is that restore plus test_dependency_policy_documents_named_dependency_path_simple_path_authority, which fails on the Bolt-deleted policy file and would have blocked the bcf22eea citation deletion. Land #887. Keep this PR and #867 unmerged once #887 is ready. Do not open another restore PR. Do not merge any older DFS head.
Both this head and #887 still omit a locked assert for direct ("alpha", "charlie") on the cyclic fixture. Add that on the landing head so a rewrite that refuses every remaining-name walk after a back-edge cannot stay green.
This run cannot approve or merge. Independent review remains with seonghobae. Inherited JS vulns stay on #783. Next buyer-visible gap is issue #770; do not fold it here.
Sent by Cursor Automation: Fix Issues
| assert not supply_chain.cargo_lock_has_named_dependency_path( | ||
| package_dependencies, | ||
| "root 1.0.0", | ||
| ("alpha", "alpha", "charlie"), | ||
| ) |
There was a problem hiding this comment.
This locks the False cycle case only. On the same fixture, also assert cargo_lock_has_named_dependency_path(..., ("alpha", "charlie")) is True. A rewrite that treats any back-edge as "no remaining-name match" would still pass this test and break a real owner-chain. Add that assert on the #887 landing head, not in a fourth restore PR.


Closed as proven duplicate of canonical #867
Exact duplicate/supersession evidence was revalidated immediately before closure:
bcf22eea40d2a5a1563e738ad7a508bbd3dae565, deleting the locked cycle/distinct-key regressions and replacing the validated path-local simple-path walk.f270d3dfece13ab6d54c260b8b094e9a7335a548is a direct fast-forward descendant of that drifted test(supply-chain): preserve simple dependency-path cycle semantics #867 head:compare(bcf22eea…, f270d3df…)reportsahead_by=1,behind_by=0.frozensetsimple-path implementation, both cycle/distinct-key regression authorities, and the dependency-policy contract.bolt-optimize-supply-chain-check-10739114227262951755was then fast-forwarded without force to this exactf270d3df…commit and refetched successfully.No merge evidence from this PR is transferred. #867 must obtain fresh exact-head CI/security/SBOM/coverage/review evidence on
f270d3df…; inherited #783 and central dependency gates remain unchanged.