Skip to content

refactor: split shim library and binary#35

Merged
suzuke merged 1 commit into
mainfrom
feat/shim-lib-bin-split
Jul 13, 2026
Merged

refactor: split shim library and binary#35
suzuke merged 1 commit into
mainfrom
feat/shim-lib-bin-split

Conversation

@suzuke

@suzuke suzuke commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Implements task22 / issue #30: moves production shim into src/lib.rs with public shim_entry and leaves src/main.rs as a thin binary caller. Updates source invariants to audit lib.rs. Validation: focused tests, clippy, release build, diff check. Task22 scope only; no Cargo.toml or unrelated changes.

@suzuke

suzuke commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

VERIFIED — root exact-head review of 47bb3ea against task22 and d-20260713005740094423-4.

Evidence

  • ran: normalized origin/main src/main.rs (fn mainpub fn shim_entry) SHA-256 = b8548d66dd78a3e71b7c898e0a6180790afc8c3aaa7c998ec45b861cce446e5f; HEAD src/lib.rs SHA-256 is byte-identical.
  • cited: crates/agentic-git/src/main.rs — thin binary contains only agentic_git::shim_entry();.
  • ran: cargo test --workspace → lib 156/156, bin 0/0, all non-ignored integration suites pass.
  • ran: cargo clippy --workspace --all-targets -- -D warnings → pass.
  • ran: cargo build --workspace --release → pass.
  • ran: git diff --check origin/main...HEAD and tracked git diff --quiet → pass.
  • inspected: exactly lib.rs, thin main.rs, and source-path-only changes in exec_reachability_invariant.rs/shim_phase2.rs; Cargo.toml and unrelated modules unchanged.

scope_source: task t-20260713005800717233-15764-22 + decision d-20260713005740094423-4
audit_mode: full exact-head behavioral-parity review
reviewed_head: 47bb3ea
files: crates/agentic-git/src/{lib.rs,main.rs}, crates/agentic-git/tests/{exec_reachability_invariant.rs,shim_phase2.rs}

No blocking findings. Independent Fable review and final CI merge gate remain required.


codex-125550 · Codex GPT-5

@suzuke

suzuke commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

VERIFIED — exact head 47bb3ea (independent heterogeneous review, seat claude-aef7c0/Fable, task t-20260713211816327397-70517-156, review_class=dual; all evidence gathered independently, no reliance on prior review comments or implementer claims)

Scope matches the frozen d-4/task22 boundary exactly: 4 files, entrypoint-only source delta, no manifest drift.

Evidence

  • ran: git show 4a0022eb:crates/agentic-git/src/main.rs | diff - crates/agentic-git/src/lib.rssingle-line delta at :128 fn main() {pub fn shim_entry() {; the remaining 3,283 lines are byte-identical. New src/main.rs is 3 lines calling agentic_git::shim_entry().
  • ran: git diff --stat 4a0022eb..HEAD → exactly 4 files (src/lib.rs, src/main.rs, tests/exec_reachability_invariant.rs, tests/shim_phase2.rs). Cargo.toml/Cargo.lock untouched; crate manifest has no [lib]/[[bin]] sections, so cargo auto-discovery covers both targets — "no manifest change" holds.
  • invariant enforcement preserved with NO blind spot: scan_crate_src() recursively walks all of src/ (exec_reachability_invariant.rs:306-315, fail-loud if empty), so the thin main.rs remains in the scan basis. Empirical: injected a decoy fn exec_real_git() {} into the thin main.rs → invariant went RED with UNEXPECTED (x1): main.rs :: <top-level> :: def exec_real_git; reverted, tracked tree clean at exact head. Whitelist + RED-arm label rewrites (main.rs→lib.rs) are exactly what the directory walk produces.
  • ran: cargo test (workspace) → lib unittests 156 passed / 0 failed (suite runs ONCE via the library); bin unittests running 0 tests (bin harness zero — the duplicate-suite failure mode d-4 rejected is confirmed absent); all integration suites green (exec-invariant 8, shim_phase2 13+4 ignored, snapshots 24, session_mode 18, smoke 5, recursion-guard 2, phase1 5; stress suites ignored-by-default); agentic-git-core 10/10.
  • ran: cargo clippy --workspace --all-targets -- -D warnings → clean (strict superset of CI's --workspace); cargo build --release -p agentic-git → PASS.
  • ran (release binary, argv0 dual-mode): direct invocation → session CLI usage output; argv0=git symlink with agent env unset → non-agent passthrough, output byte-identical to /usr/bin/git --version. argv0 dispatch reads process-global env::args, unaffected by the split.
  • CI at exact head: all 4 checks green (test ubuntu/macos, test-windows-advisory, legacy-env-adoption).
  • tracked cleanliness: tracked state byte-clean after all runs; the only untracked path is the daemon-owned .agend-managed session binding marker at the worktree root — fleet infrastructure, not PR dirt, and irrelevant to cargo packaging (which operates under crates/).

@suzuke
suzuke merged commit e3adc1a into main Jul 13, 2026
4 checks passed
@suzuke
suzuke deleted the feat/shim-lib-bin-split branch July 13, 2026 21:24
suzuke added a commit that referenced this pull request Jul 14, 2026
Publishes the lib+bin split from PR #35 so registry consumers
can depend on agentic_git::shim_entry().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Agend-Agent: claude-aef7c0
Agend-Task: t-20260714011836271616-46776-5
Agend-Branch: release/agentic-git-0.2.3-lib-entry
Agend-Issued-At: 2026-07-14T10:56:00.905970+00:00
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