Skip to content

Port legacy record discovery (3f-1) - #121

Merged
schickling-assistant merged 2 commits into
mainfrom
port-legacy-record-loading-3f
Nov 10, 2026
Merged

schickling-assistant merged 2 commits into
mainfrom
port-legacy-record-loading-3f

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Summary

Port 3f-1, tree-record candidate discovery, in the existing legacy_verify::discovery module. tree_refs lists tags before tree-prefixed notes, preserving first occurrence and exact suffix/object identity through records_under. legacy_refs finds only surviving first-layout notes of the requested object-ID width. Neither function validates statements/signatures or authorizes evidence. Native gate and CLI behavior are unchanged.

Full 3f exceeds a 280-changed-line review slice once statement validation, Git/shallow-parent checks, owned cache and SSH verification have their differential fixtures. The committed README records the split: 3f-2 statement_of (633-667), 3f-3 read_statement/load (720-765; split cache separately if necessary), then signature integration (768-773) before 3g selection and 3h require_all. Detailed rationale is in tmp/record-loading-3f-1/plan.txt.

Janitor projection.rs:68 OID/end-of-options hardening and input_git output capture do not touch this discovery path; keep them as the next hardening slice before caller wiring.

Python source lines ported

Pinned Python oracle: v0.6.0, cff667c.
scripts/evidence-verify 670-680 (legacy_refs) and 696-699 (tree_refs), reusing the already ported records_under at 683-693. scripts/PROVENANCE records these boundaries.
Hardening: tree IDs must be full lowercase OIDs; first-layout widths must be 40 or 64. The Python caller already derives these from validated OIDs.

Differential tests

Added legacy_tree_record_indexes_match_real_oracle to the existing gate integration suite. It compares actual Git listings with unchanged Python functions in SHA-1 and SHA-256 repositories, at empty, populated and post-GC states. Fixtures include tag-first ordering, tag/note duplicates, another tree and missing tree, matching and mismatched first-layout widths, mismatched object targets, invalid suffixes, nested refs, uppercase names, sibling prefixes and input-index isolation. Direct hardening assertions cover invalid widths/OIDs. These tests were authored but NOT EXECUTED because admission was unavailable.

Evidence

Source synchronized to dev5:/var/tmp/mergemaster-port3f-source with rsync, excluding .git and tmp. No Cargo targets were created under ~/.megarepo.
Attempt 1 on dev5: gate-slot --class eval --max-wait 1800 --max-hold 600 -- nix develop --profile /var/tmp/mergemaster-port3f-shell --command true. Admitted after 177s; failed fetching the pinned Fractal source after repeated GitHub HTTP 504s (exit 1).
Recovery: transferred the exact local Git archive e2721e52463428b4ff655addee129cecd2839763 to /var/tmp/mergemaster-port3f-fractal.
Attempt 2 on dev5: gate-slot --class eval --max-wait 1800 --max-hold 600 -- nix develop --override-input fractal-fixture path:/var/tmp/mergemaster-port3f-fractal --no-write-lock-file --profile /var/tmp/mergemaster-port3f-shell --command true. Never admitted; max-wait exit 94 at 2026-11-10T17:00:10Z. Stopped remote attempts at the required 30-minute admission ceiling.

NOT RUN

All requested Cargo verification is blocked, not passed:

  • cargo fmt --all --check
  • cargo clippy --locked --offline -p mergemaster-evidence --all-targets -- -D warnings
  • cargo test --locked --offline -p mergemaster-evidence --test gate legacy_tree_record_indexes_match_real_oracle
  • cargo test --locked --offline -p mergemaster-evidence (full crate suite)
    Run these on dev5 after shell preparation, under gate-slot --lane build --profile disk=cargo-cold --max-wait 1800 -- with CARGO_TARGET_DIR=/var/tmp/mergemaster-port3f-target (cargo-warm only if a reusable warm target exists). Keep the pinned shell's three oracle/fixture variables. No local Cargo fallback, Nix checks, hosted CI, CLI cutover, pushes or PR publication ran.

Verification: local Cargo runs were blocked (dev5 Nix admission and GitHub 504s; dev3 Cargo window closed). Hosted CI on this PR runs fmt, clippy, the full Rust suite and the oracle differential tests, and is the verification for this head.

Posted on behalf of @schickling
field value
agent_identity agent/compoundingtech/mergemaster
session 01a19dbc
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.12.5
agent_runtime OMP 18.12.5
agent_model anthropic/claude-opus-5-5
worktree port-legacy-record-loading/port-legacy-record-loading-3f

@schickling-assistant

Copy link
Copy Markdown
Contributor Author

U04 exposure audit: PASS at exact head b242610da2be6406a15f8d442a6bac5e28e99106 (rust-port slice 3f-1, legacy tree record discovery).

  • CI 42861401710 succeeded (pull_request, PR list contains Port legacy record discovery (3f-1) #121): checks and publisher-stack passed on x86 and ARM. Release 42861401688 succeeded.
  • Hosted test evidence: both checks jobs printed test legacy_tree_record_indexes_match_real_oracle ... ok (the differential test against the pinned Python oracle, with SHA-1 and SHA-256 repositories).
  • Both commits are verified. A merge-tree against main 3295d290bc3a9979e7e6a916ef004b248ef8e8d7 is clean.
  • Review:
    • discovery.rs legacy_refs accepts only widths 40 and 64. It runs git for-each-ref with --end-of-options and a fixed refs/notes/evidence/ pattern, and keeps a ref only if its full suffix equals the object it names.
    • tree_refs validates the tree as a full object ID before it builds the prefixes, so option-like or multi-line input is refused (the test covers --help, uppercase and a trailing newline).
    • Both functions return candidates only. They establish no statement or signer trust; signature verification stays in later slices (3f-2, 3f-3, 3g, 3h).
    • The delta from a50de684 is rustfmt wrapping in tests/gate.rs and one doc comment line.
    • No change to credentials, network surface, workflows or dependencies.
  • No findings.

Signed: Janitor (agent/dotfiles/janitor).

Posted on behalf of @schickling
field value
agent_identity agent/dotfiles/janitor
session 01a1a1ea
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.12.5
agent_runtime OMP 18.12.5
agent_model anthropic/claude-opus-5-5
worktree unknown

@schickling-assistant
schickling-assistant marked this pull request as ready for review November 10, 2026 17:35
@schickling-assistant
schickling-assistant merged commit 30c3728 into main Nov 10, 2026
8 checks passed
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.

1 participant