Skip to content

fix: close symlink gaps in selected source inventories - #959

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
yssite:fix/selected-inventory-symlink-closure
Oct 13, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
yssite:fix/selected-inventory-symlink-closure

Conversation

@yssite

@yssite yssite commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

The selected-record checker silently omits directory and dangling symlinks from its source inventory: Path.rglob does not descend through directory links, and the file-only filter drops them. For example, adding supplier/linked -> ../unlisted, with unlisted/extra.py present, makes that file readable through the supplier path while the unchanged manifest still passes. The legacy manifest layout also accepts a pinned file alias whose target escapes the supplier package.

Use one checked iterator in both layouts. Reject directory/dangling links before filtering, and enforce package containment for regular files. Inventoried regular-file aliases whose targets remain inside the package are still accepted and checked against their own recorded digests. The contract assumes a stable, readable filesystem; concurrent mutation and platform-specific junctions are outside scope.

Only the checker and its focused regression module change. No selected certificate, supplier construction, historical artifact, upstream source or mathematical bound changes.

Validation on macOS arm64 / CPython 3.14.5:

  • Eight symlink test methods, five existing selected-result methods and twelve merged Tooling: bind selected primary-proof pointers to verified digests (no new κ) #841 proof-binding methods pass both normally and under -O: 50 method executions, no failures or skips.
  • The bounded comparison with the historical checker reproduces nine false acceptances, verifies ten fixed rejections and preserves four positive controls in the original fixture matrix. Added tests cover nested directory links, self/two-link cycles and an independently incorrect alias digest, in both layouts.
  • make selected-record-check passes. The current selection and all ten historical checkpoints return identical exact kappas under the baseline and candidate; all 21 retained X4 input hashes match.
  • Clean patch application, committed source/test identity checks and three provenance rejection controls pass.

The focused tests can be run from a clean checkout using python3 -I -B tests/test_selected_inventory_links.py -v, and again with -O; the existing modules are tests/test_selected_result.py and tests/test_selected_proof_binding.py.

This is based on main at 007664306fff84fbb1c9a1b4053b69f439764034, including Mihir Srivastava's merged #841 primary-proof binding. Its predicate is retained unchanged and its tests pass. #865 concerns replay-receipt coverage, a separate contract; the final public overlap search found no equivalent inventory-walk repair. No priority claim is made.

A separately reported review of the original patch on Linux / CPython 3.13.5 used reconstructed minimal trees, including 55/55 boundary outcomes and three detected faulty variants. That is not a full-repository or final-commit Linux replay. Full make verify, cold construction replays, Lean and hosted CI were deliberately not run in this pass: this patch changes static inventory traversal, not the construction. These checks do not authenticate coherently edited records or establish a multiplication theorem.

Credit Douglas Colkitt's existing checker, Mihir Srivastava's proof-binding work and the retained community construction lineage. Developed with substantial OpenAI Codex assistance under Apache-2.0.

@Mister-Meeseeks
Mister-Meeseeks merged commit 0a45978 into CrocSwap:main Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants