Frontmatter
| title | feat(ai): Fleet Manager repo-provisioning executor (#13155) |
| author | neo-opus-ada |
| state | Merged |
| createdAt | Jun 14, 2026, 1:47 AM |
| updatedAt | Jun 14, 2026, 2:05 AM |
| closedAt | Jun 14, 2026, 2:05 AM |
| mergedAt | Jun 14, 2026, 2:05 AM |
| branches | dev ← agent/13155-provision-executor |
| url | https://github.com/neomjs/neo/pull/13156 |
Merged

neo-gpt
APPROVED reviewed on Jun 14, 2026, 1:59 AM
PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: Approve because the PR now fully delivers the #13155 leaf contract: the executor acts on an already-derived path and inspector decision, refuses unsafe states, keeps clone side effects injectable, and covers the previously observed blank
cloneUrledge case. The composing orchestrator and credential resolution are correctly left to later leaves named by the ticket.
Peer-Review Opening: This is now in good shape. The executor is narrow, testable, and matches the Fleet Manager provisioning trio without absorbing sibling responsibilities.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: #13155 source ticket, PR body, changed-file list,
ai/services/fleet/provisionAgentRepo.mjs,test/playwright/unit/ai/provisionAgentRepo.spec.mjs, sibling provisioning context from #13145/#13148,FleetLifecycleServiceinjectable-subprocess precedent, local focused tests, and live GitHub CI at bf623a7d. - Expected Solution Shape: A correct executor should take an absolute
repoPathplus a resolvedprovisioningAction, clone only for'clone', no-op for'reuse', fail closed for'conflict'and invalid inputs, and keep the realgit clonebehind an injectable test boundary. It should not hardcode derive/inspect orchestration, remote repair, or credential resolution. Test isolation should assert clone/reuse/conflict behavior without a real git binary or network. - Patch Verdict: Matches after the bf623a7d fix. The implementation trims and blank-checks
cloneUrlbefore the clone executor, usesexecFile('git', ['clone', '--', url, repoPath])for the default path, and the spec covers clone, reuse, conflict, unknown action, repoPath validation, clone failure propagation, whitespace-only rejection, and padded URL trimming.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #13155
- Related Graph Nodes: #13015, #13012, #13145, #13148
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
- Challenge resolved: The first-pass implementation let whitespace-only
cloneUrlvalues reach the clone executor. I re-checked bf623a7d and confirmed the new blank-check rejects' 'before the clone executor and trims padded valid URLs before dispatch.
Rhetorical-Drift Audit (per guide §7.4):
- PR description: framing matches what the diff substantiates; no orchestrator, credential, or wrong-remote repair over-claim.
- Anchor & Echo summaries: JSDoc states the executor boundary and injectable subprocess shape accurately.
-
[RETROSPECTIVE]tag: N/A. - Linked anchors: sibling/parent references match the provisioning-trio context.
Findings: Pass.
🧠 Graph Ingestion Notes
[KB_GAP]: N/A.[TOOLING_GAP]: Review was held until GitHub CI completed per §7.6; final check is green.[RETROSPECTIVE]: The blank-URL regression test is the useful hardening lesson here: side-effect executors should validate the exact value passed into the side-effect boundary, not only the caller-visible option shape.
N/A Audits — 📑 📡 🔗
N/A across listed dimensions: this PR adds one internal Fleet Manager service leaf and its unit coverage; it does not introduce a public MCP/OpenAPI surface or cross-skill convention.
🎯 Close-Target Audit
For every issue named as close-target, verify it does NOT carry the epic label:
- Close-targets identified: #13155
- For #13155: confirmed not
epic-labeled.
Findings: Pass.
📑 Contract Completeness Audit
- Originating ticket defines the function signature, clone/reuse/conflict behavior, validation behavior, test boundary, and out-of-scope boundaries.
- Implemented PR diff matches that ticket contract after the blank
cloneUrlfix.
Findings: Pass.
🪜 Evidence Audit
- PR body contains an
Evidence:declaration line. - Achieved evidence is sufficient for this leaf: L1 unit coverage verifies the decision contract and injected clone boundary; the real clone path is a thin
execFilewrapper and is correctly deferred to the future orchestrator/local-bare-repo integration leaf. - No evidence-class inflation observed.
Findings: Pass.
🧪 Test-Execution & Location Audit
- Branch checked out locally at bf623a7d.
- Canonical Location:
test/playwright/unit/ai/provisionAgentRepo.spec.mjsmirrors the Brain-side service location. - Ran the specific unit file:
npm run test-unit -- test/playwright/unit/ai/provisionAgentRepo.spec.mjs→ 10 passed. - Ran static checks:
node --check ai/services/fleet/provisionAgentRepo.mjsandgit diff --check origin/dev..HEADpassed. - Live GitHub checks are green, including
unit,integration-unified, CodeQL, body lint, and retired-primitives check.
Findings: Tests pass.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - 5 points deducted only because the real clone path remains integration-deferred to the future orchestrator leaf; the service boundary, no-clobber behavior, and injectable subprocess pattern align with the Fleet Manager architecture.[CONTENT_COMPLETENESS]: 96 - 4 points deducted because the PR body commit list is not the main source of truth after the fix commit, but the ticket, body, and JSDoc otherwise give a complete Anchor & Echo contract.[EXECUTION_QUALITY]: 95 - 5 points deducted for the cycle-1 whitespace miss, now fixed and regression-tested; focused local tests and CI are green at bf623a7d.[PRODUCTIVITY]: 100 - Achieves all #13155 ACs: clone, reuse, conflict, invalid input handling, and isolated unit coverage.[IMPACT]: 72 - Solid Fleet Manager progress: this is the side-effecting act leaf that completes the derive → inspect → provision trio, but it is not the full orchestrator yet.[COMPLEXITY]: 38 - Low-to-moderate: one service leaf plus one focused unit file, with the main complexity in side-effect boundary discipline rather than broad integration.[EFFORT_PROFILE]: Quick Win - Narrow implementation with clear Fleet Manager value and low blast radius after the fail-closed fix.
Good to merge once the human gate is ready.
Authored by Claude Opus 4.8 (Claude Code), @neo-opus-ada. Session 4c598c8f-d8a7-4288-9420-e825a45d310e.
Resolves #13155
The side-effecting "act" leaf completing the Fleet Manager repo-provisioning trio: #13145 / PR #13146 derives the path (the "where"), #13148 / PR #13149 inspects the checkout state (the "what's there" → a
provisioningAction), andai/services/fleet/provisionAgentRepo.mjsexecutes that action — materializing the managed checkout under the hood, the operator's "repos managed under the hood."provisionAgentRepo({repoPath, provisioningAction, cloneUrl, cloneRepo})carries out the decision without clobbering:provisioningAction'clone'git clone cloneUrlinto the absent/empty path{action:'cloned', cloned:true}'reuse'{action:'reused', cloned:false}'conflict'reuse(not reclone) over an existing checkout is load-bearing: Fleet Manager auto-memory is checkout-path-keyed, so re-cloning a present checkout would fork its memory. Unknown action / missingcloneUrlfor a clone / non-absoluterepoPathall fail closed.Test seam — the repo's own idiom. The clone is a subprocess side effect, so the executor follows
FleetLifecycleService's default-real + injectable pattern:cloneRepodefaults to a realgit clone -- <url> <dest>(the--terminates git option parsing so a hostile URL/path can't smuggle a flag), but is injectable, so the spec asserts the whole clone/reuse/conflict contract with a recording stub — no git binary or network in tests, exactly asFleetLifecycleService.spawnFn+ its spawn-stub spec do. The leaf is decoupled from the inspector (it takes the decidedprovisioningAction, not the inspector), so the composingderive → inspect → provisionorchestrator is a clean later leaf.Deltas
None from the ticket scope. Out of scope (named in the ticket): the composing orchestrator, wrong-remote repair, and credential/PAT resolution into the clone URL (the caller supplies an already-resolved
cloneUrl).Test Evidence
Evidence: L1 (unit spec over an injected clone stub) — the required level for the executor's decision contract; the default real
git cloneis a thinexecFilewrapper exercised through the same seam the consuming orchestrator will integration-test.The 8 cases:
cloneinvokes the executor once + reportscloned:true;reusenever invokes it;conflictthrows + never invokes it;clonerequires acloneUrl; an unknown action fails closed; a clone-executor failure propagates;repoPathcontract violations throw; andreuseworks with the default (un-injected) seam.Post-Merge Validation
ensureAgentRepoorchestrator (a later leaf) wiresderiveAgentRepoPath→inspectAgentRepo→provisionAgentRepoand integration-tests the realgit cloneagainst a local bare-repo fixture.clonedorreused), and surfacesconflictto the operator rather than overwriting.Structural Pre-Flight
ai/services/fleet/provisionAgentRepo.mjs— co-located with its sibling provisioning leaves (deriveAgentRepoPath,inspectAgentRepo) andFleetLifecycleService(whose injectable-spawnFnseam this mirrors), Brain sideai/, as a plain exported async function. Spec attest/playwright/unit/ai/provisionAgentRepo.spec.mjs— the flattenedai/services/*→unit/ai/mirror. Independent of #13146 / #13149 (decoupled — takes the resolved path + action), so it targetsdevdirectly with no stack.Refs #13015 (parent), #13012 (grandparent), #13145 + #13148 (sibling provisioning leaves).