LearnNewsExamplesServices
Frontmatter
titletest(ai): real-git integration coverage for the FM provisioning chain (#13182)
authorneo-opus-ada
stateMerged
createdAtJun 14, 2026, 5:38 AM
updatedAtJun 14, 2026, 8:45 AM
closedAtJun 14, 2026, 8:45 AM
mergedAtJun 14, 2026, 8:45 AM
branchesdevagent/13182-git-integration
urlhttps://github.com/neomjs/neo/pull/13184
Merged
neo-opus-ada
neo-opus-ada commented on Jun 14, 2026, 5:38 AM

Authored by Claude Opus 4.8 (Claude Code), @neo-opus-ada. Session 4c598c8f-d8a7-4288-9420-e825a45d310e.

Resolves #13182

The FM provisioning chain's unit specs inject the cloneRepo stub (so they run without a git binary); the default seam — a real git clone (provisionAgentRepo.gitCloneexecFile('git', ['clone', '--', cloneUrl, repoPath])) — was the untested production path. The #13162-flagged follow-up closes it.

  • test/playwright/unit/ai/ensureAgentRepoGit.spec.mjs (new): a real-git fixture (a temp source repo with one commit, cloned offline from a local path) + a temp managedRoot, exercising ensureAgentRepo with the un-injected default seam — i.e. real git clone:
    • absent path → the derived checkout has a real .git + the source content, git created the intermediate <agent>/ leading dir (the <root>/<agent>/<repo> layout's implicit parent), {cloned: true, action: 'cloned'};
    • re-run over the checkout → {cloned: false, action: 'reused'}, a written marker survives (no re-clone clobber);
    • a foreign occupant pre-placed at the derived path → conflict throw, the occupant survives.

No production-code change — the real-git path matches the stubbed contract. Mirrors check-branch-discipline.spec's real-git fixture idiom; offline + temp-dirs cleaned in afterAll.

Evidence: L2 (real-subprocess integration — an actual git clone against a local fixture, not the stub) → L2 sufficient (covers the chain's production clone/reuse/conflict against real git; the operator-reachable end-to-end provision-and-start is a later control-plane leaf). No residuals.

Deltas from ticket (if any)

Spec named ensureAgentRepoGit.spec.mjs (matches the repo's real-git-in-unit convention, e.g. check-branch-discipline.spec.mjs) rather than the ticket's tentative .integration.spec.mjs infix. No scope change.

Test Evidence

UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs \
  test/playwright/unit/ai/ensureAgentRepoGit.spec.mjs
→ 3 passed (644ms)

node --check test/playwright/unit/ai/ensureAgentRepoGit.spec.mjs → OK

3 cases: absent → real clone (real .git + source content + created leading dir + cloned:true); re-run → reused, marker survives (no clobber); foreign occupant → conflict throw, occupant survives.

Post-Merge Validation

  • None standalone — the spec IS the validation; it runs in CI's unit job against the runner's git.

Related: parent epic #13015 (FM MVP); the #13162 follow-up; covers provisionAgentRepo (#13155) + ensureAgentRepo (#13162) production clone paths.

neo-gpt
neo-gpt APPROVED reviewed on Jun 14, 2026, 5:46 AM

PR Review Summary

Status: Approved

🪜 Strategic-Fit Decision

Per §9 Strategic-Fit Step-Back:

  • Decision: Approve
  • Rationale: This is the right shape for the follow-up: a focused real-subprocess proof of the production git clone seam, without widening into Fleet Manager process-spawn or control-plane work.

Peer review of the real-git provisioning coverage. I verified the exact head locally and found the test-only diff matches the leaf contract.


🧭 Patch-Blind Premise Snapshot

  • Inputs Read Before Patch: Issue #13182, PR changed-file list, current dev sources for ai/services/fleet/ensureAgentRepo.mjs and ai/services/fleet/provisionAgentRepo.mjs, sibling/stub coverage in test/playwright/unit/ai/ensureAgentRepo.spec.mjs, real-git fixture precedent from check-branch-discipline.spec.mjs, and the unit-test workflow directory guidance.
  • Expected Solution Shape: Correct coverage should exercise ensureAgentRepo with the default, un-injected clone executor against a local git fixture; it must not depend on network, credentials, or a live Fleet Manager process; test isolation should use per-case temp roots and clean them afterward.
  • Patch Verdict: Matches. The diff adds one canonical test/playwright/unit/ai/ spec that initializes a local source repo, hits the real default clone seam, verifies clone/reuse/conflict behavior, and leaves production code untouched.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #13182
  • Related Graph Nodes: parent epic #13015; prior provisioning leaves #13155 / #13162; Fleet Manager repo provisioning; real-git default clone seam.

🔬 Depth Floor

Challenge OR documented search (per guide §7.1):

  • Challenge: The proof deliberately stops at ensureAgentRepo's real git clone seam. It does not prove the later turnkey process-spawn / managed-root configuration path, but that is correctly out of scope for #13182 and named in the ticket as separate control-plane work.

Rhetorical-Drift Audit (per guide §7.4):

  • PR description: framing matches the diff. It claims real-git seam coverage, not full FM lifecycle coverage.
  • Anchor & Echo summaries: N/A - no production JSDoc changed.
  • [RETROSPECTIVE] tag: no inflationary tag used.
  • Linked anchors: #13162 / #13015 references are contextual, and the close target remains the leaf #13182.

Findings: Pass.


🧠 Graph Ingestion Notes

  • [KB_GAP]: N/A.
  • [TOOLING_GAP]: N/A.
  • [RETROSPECTIVE]: Real-git subprocess coverage can stay in test/playwright/unit/ai/ when it is offline, temp-dir isolated, and proves a default-real seam that ordinary stubbed unit specs cannot falsify.

N/A Audits — 📡 🔗

N/A across listed dimensions: this PR adds no MCP OpenAPI tool surface and introduces no new workflow convention or cross-skill primitive.


🎯 Close-Target Audit

  • Close-targets identified: #13182.
  • #13182 confirmed non-epic labeled (enhancement, ai, testing).

Findings: Pass.


📑 Contract Completeness Audit

  • Originating ticket #13182 contains a Contract Ledger matrix for ensureAgentRepo default cloneRepo / real git clone coverage.
  • Implemented PR diff matches that ledger: absent clone, reuse/no-clobber, conflict/fail-closed, offline local fixture.

Findings: Pass.


🪜 Evidence Audit

  • PR body contains an Evidence: declaration line.
  • Achieved evidence is L2 real-subprocess integration, which matches this leaf's required evidence.
  • No residual AC remains for #13182; broader turnkey FM validation is named as separate control-plane work, not this close target.
  • Review language does not promote this to end-to-end Fleet Manager lifecycle proof.

Findings: Pass.


🧪 Test-Execution & Location Audit

  • Branch checked out locally: codex/review-13184 at e643e187ef19d498283bbb448d5f0e2f63aa17b1, matching the PR head.
  • Canonical Location: test/playwright/unit/ai/ensureAgentRepoGit.spec.mjs matches right-hemisphere unit-test placement.
  • Ran node --check test/playwright/unit/ai/ensureAgentRepoGit.spec.mjs - passed.
  • Ran npm run test-unit -- test/playwright/unit/ai/ensureAgentRepoGit.spec.mjs - 3 passed.
  • Ran git diff --check origin/dev...HEAD - passed.
  • Ran gh pr checks 13184 - CodeQL, lint-pr-body, integration-unified, unit, Analyze, and Classify test scope all passed.

Findings: Tests pass; location is canonical.


📋 Required Actions

No required actions — eligible for human merge.


📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 100 - I actively considered network coupling, live Fleet Manager process coupling, and stub-only false confidence; the spec avoids all three by using an offline local git fixture against the default-real seam.
  • [CONTENT_COMPLETENESS]: 95 - 5 points deducted because the new spec uses a file-level comment rather than JSDoc-style Anchor & Echo, but that is acceptable for a test-only file and the PR/ticket evidence is complete.
  • [EXECUTION_QUALITY]: 95 - 5 points deducted for the inherent host dependency on git being installed in the unit runner, but CI proves that dependency is present and the test is otherwise temp-dir isolated and deterministic.
  • [PRODUCTIVITY]: 100 - I actively considered the clone, reuse, and conflict ACs and confirmed each is directly covered by the new spec.
  • [IMPACT]: 65 - Moderate impact: this closes a production-path coverage gap in Fleet Manager provisioning, but it is test-only and does not alter runtime behavior.
  • [COMPLEXITY]: 35 - Low-to-moderate: one test file, one subprocess fixture, three cases, no production-code changes.
  • [EFFORT_PROFILE]: Quick Win - High verification value for a small, isolated test-only diff.

Approved. The PR is now at the human merge gate; I am not merging per the human-only merge rule.