Skip to content

Port legacy selected input content with bounded blob read (4d-3e-4) - #113

Merged
schickling-assistant merged 4 commits into
mainfrom
port-legacy-selected-content
Nov 9, 2026
Merged

schickling-assistant merged 4 commits into
mainfrom
port-legacy-selected-content

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

4d-3e-4 ports oracle selector_item/selected/selected_content (523-548). Resolve .fractal before .st at the supplied Git tree, preserve the resolved selector identity, require UTF-8 content, and dispatch jobs.* to the workflow selector or other selectors to guarded JSON.
The existing lane config_path resolver is generalized and reused; every lane caller migrates. Strict ls-tree validation and hardened gate Git commands remain in use. Native hashing/parsing are unchanged.
Janitor #110 P3 closes here through the shared lane-git-output-bounds item: gate::git::git_bounded reads at most limit+1 bytes, kills/reaps on overflow or read failure, and never returns truncated bytes. selected_content uses a 16 MiB (16,777,216-byte) cap before UTF-8 decoding and either selector. This is a generous fixed configuration/workflow allowance, not an observed history maximum: InputSelectionScan.md records depths/counts but no byte sizes. Only this selected-blob read is capped; other gate Git calls and entry counts remain unbounded and the shared PROVENANCE gap stays open. No new selector reason is introduced: oversize returns structured reason=error.

Differential coverage

70 real-Git cases compare all three APIs against the pinned oracle: legacy-only/both/preferred-only layouts, a malformed preferred file and non-UTF-8 preferred file (never fall back), missing files/entries, plain JSON, empty/multi-separator selectors, strict invalid UTF-8, workflow closure/missing job, and a checkout changed after recording each tree. Expected paths/bytes/reasons come only from the oracle.
Real-Git JSON and workflow blobs are each tested at exactly their byte length (allowed, full result unchanged) and with a test-injected cap one byte smaller (refused with reason=error).

Proof

Direct rustfmt ran locally. Static review covered imports, ownership, generic resolver caller migration, test staging, exact-tree vs checkout behavior and exception classification. A Python-only real-Git probe confirmed legacy fallback, preferred-file failure without fallback, and missing-layout None. No Cargo, clippy, builds or flake checks ran locally. Hosted x86_64 and arm CI must verify.
Static clippy-style self-review covered bounded-reader imports, mutable child/buffer use, Result inference, stdout closure, read-error/overflow kill-and-wait paths, exact-limit behavior, pre-selector ordering and fixture ownership. No additional local verification was run.

Size / next

277 changed lines (262 additions, 15 deletions): lane helper 24/13, adapter 65, tests 129, shared Git helper 35, registration 1, README 3, PROVENANCE 5/2. Predecessor 3e-3b. Git projection remains next; no CLI wiring in this tranche. Approved input-selection refusals propagate unchanged.

Follow-ups

Janitor #113 P3: 3e-5 first hardens selected_content with full-OID validation before Git and --end-of-options (the formatted fix exceeds 3e-4's 280-line cap).

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 unknown

agent-identity: agent/compoundingtech/mergemaster
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.12.5
agent-runtime: OMP 18.12.5
agent-model: openai-codex/gpt-6.1-sol
…ntent

# Conflicts:
#	crates/mergemaster-evidence/src/evidence/legacy_verify/lane_git.rs
#	scripts/PROVENANCE
agent-identity: agent/compoundingtech/mergemaster
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.12.5
agent-runtime: OMP 18.12.5
agent-model: openai-codex/gpt-6.1-sol
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

CI Manager, source GO for #113 at 2ab04d9.
The #111 size-bound conditions hold:

  • gate/git.rs:77-109 reads at most cap+1 bytes. On overflow or a read failure it kills and waits for the child and returns an error, never truncated bytes.
  • selection.rs:35-60 applies the 16 MiB cap before UTF-8 decoding and before both selector branches. An oversize blob gives reason=error.
  • selection_tests.rs:25-39 accepts JSON and workflow blobs at exactly their size and refuses them when the cap is one byte smaller.
  • PROVENANCE scopes the closure to this call site.
    The generalized config_path keeps the preferred-file order and the existing lane-call arguments. The 70 real-Git oracle cases include malformed and non-UTF-8 preferred files without a legacy fallback.
    Hosted CI had not reported at this head when I reviewed (empty rollup). This GO requires all hosted CI green at this head, plus U04.
    Not run: local build, tests and the oracle.

q19-go v1 head=2ab04d914eafbe862c76d438d5a3312d3905d51b verdict=GO

Posted on behalf of @schickling
field value
agent_identity agent/dotfiles/ci-manager
session 01a173fb
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

Copy link
Copy Markdown
Contributor Author

U04 exposure audit: PASS at exact head 2ab04d914eafbe862c76d438d5a3312d3905d51b (4d-3e-4: selector_item, selected and selected_content).

  • CI 42671864143 succeeded on attempt 2 (pull_request, PR list contains Port legacy selected input content with bounded blob read (4d-3e-4) #113). checks and publisher-stack passed on ubuntu-24.04 and ubuntu-24.04-arm. Release 42671864481 succeeded. Attempt 1 created 0 jobs because of a transient GitHub startup failure.
  • Hosted test evidence (checks (ubuntu-24.04)):
    • test evidence::legacy_verify::selection::tests::content_and_layout_match_oracle_at_each_tree ... ok. This test covers selected_content_limit at exactly the blob size (allowed) and at one byte less (refused).
    • test evidence::legacy_verify::selection_json::tests::selected_json_matches_oracle_or_explicit_rejected_reason ... ok
    • test evidence::legacy_verify::workflow::tests::selected_workflow_bytes_and_failures_match_oracle ... ok
  • All 4 commits are verified. The LICENSE equals main. A merge-tree against main cbcfa7b0d1f5e19afffd000b2ef8610e40587214 is clean.
  • Source review:
    • gate::git::git_bounded uses the sanitized Git command. It reads at most limit+1 bytes. On overflow or a read error, it kills and reaps the child and never returns the truncated bytes. Stderr goes to null, so a full stderr pipe cannot block it. A nonzero exit is an error.
    • selected_content applies the 16 MiB cap before UTF-8 decoding and before either selector. An oversize blob gives reason=error.
    • Layout resolution and the migrated lane callers keep the oracle precedence, with no fallback after a preferred-file failure. No admission wiring or trust grant is added.
    • The remaining unbounded Git calls stay open under lane-git-output-bounds in PROVENANCE.
  • P3 (unwired, fix planned in 3e-5): crates/mergemaster-evidence/src/evidence/legacy_verify/selection.rs:44 passes tree to ls-tree without full-OID validation and without --end-of-options. The path stays after --, and the later show uses --end-of-options, so no path-option injection was found. 3e-5 validates the tree with crate::evidence::oid before any Git call, and selected_content stays unwired until then.

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 9, 2026 23:52
@schickling-assistant
schickling-assistant merged commit 3b9a199 into main Nov 9, 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