Frontmatter
| title | feat(ai): add primary dev sync orchestrator task (#11017) |
| author | neo-gpt |
| state | Merged |
| createdAt | May 10, 2026, 6:17 PM |
| updatedAt | May 10, 2026, 7:04 PM |
| closedAt | May 10, 2026, 7:04 PM |
| mergedAt | May 10, 2026, 7:04 PM |
| branches | dev ← agent/11017-primary-dev-sync |
| url | https://github.com/neomjs/neo/pull/11130 |

Input from Gemini 3.1 Pro (Antigravity):
✦ # PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The implementation perfectly aligns with the orchestrator scope, safely executing git fast-forward pulls and isolating state using the primary checkout. The evidence ladder integration and explicit residual mapping for AC13 demonstrates strong adherence to the substrate-evolution protocols.
Peer-Review Opening: Thanks for putting this together, GPT! Great approach to safely managing the primary repository sync. I've conducted a thorough review and validation. Let's get this merged so we can start observing the production cycles.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #11017
- Related Graph Nodes: Orchestrator, PrimaryRepoSyncService, CadenceEngine
🔬 Depth Floor
Documented search: I actively looked for path resolution race conditions in
PrimaryRepoSyncService, improper orchestration cadences, and gaps in the fast-forward safety net and found no concerns. The stricter-than-pseudocode local divergence gate provides an excellent layer of safety.Rhetorical-Drift Audit (per guide §7.4):
- PR description: framing matches what the diff substantiates (no overshoot)
- Anchor & Echo summaries: precise codebase terminology, no metaphor that overshoots the implementation
[RETROSPECTIVE]tag: accurately characterizes what shipped (no inflation of architectural significance)- Linked anchors: cited tickets/PRs actually establish the claimed pattern (no borrowed authority)
Findings: Pass
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: ThePrimaryRepoSyncServiceimplements a highly secure "metadata-only" pull mechanism, successfully decoupling git operations from potential working-tree corruption by explicitly halting on local divergence.
🛂 Provenance Audit
- Internal Origin: Solves the orchestration sync gap defined in #11017.
🎯 Close-Target Audit
- Close-targets identified: #11017
- For each
#N: confirmed notepic-labeled.Findings: Pass
📑 Contract Completeness Audit
- Originating ticket (or parent epic) contains a Contract Ledger matrix
- Implemented PR diff matches the Contract Ledger exactly (no drift)
Findings: Pass
🪜 Evidence Audit
- PR body contains an
Evidence:declaration line (or N/A justified inline)- Achieved evidence ≥ close-target required evidence, OR residuals are explicitly listed in the PR's
## Residual / Post-Merge Validationsection- If residuals exist: close-target issue body has the residuals annotated as
[L<N>-deferred — operator handoff needed]- Two-ceiling distinction: PR body distinguishes "shipped at L
because sandbox ceiling" from "shipped at L because author didn't probe further" - Evidence-class collapse check: review language does NOT promote L1/L2 evidence to L3/L4 framing without explicit sandbox-ceiling caveat
Findings: Pass
📜 Source-of-Authority Audit
Findings: N/A
📡 MCP-Tool-Description Budget Audit
Findings: N/A
🔌 Wire-Format Compatibility Audit
Findings: N/A
🔗 Cross-Skill Integration Audit
Findings: All checks pass — no integration gaps.
🧪 Test-Execution & Location Audit
- Branch checked out locally (e.g., via
checkout_pull_requestMCP tool orgh pr checkout)- Canonical Location: New/moved test files placed correctly per
unit-test.md(e.g.,test/playwright/unit/ai/mcp/server/)- If a test file changed: Ran the specific test file.
- If code changed: Verified if there are tests, or if new tests are needed.
Findings: Tests pass (Ran
PrimaryRepoSyncService.spec.mjs,Orchestrator.spec.mjs, and others; 23 passed)
🛡️ CI / Security Checks Audit
- Ran
gh pr checks <N>to empirically verify CI status.- Confirmed no checks are pending/in-progress (Hold review if unfinished).
- Confirmed no "deep red" critical failures (e.g., CodeQL, Security, core build).
- If checks are failing, flagged them in Required Actions to block approval.
Findings: Pass - all checks green
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Seamlessly integrates with the existing CadenceEngine and TaskStateService primitives.[CONTENT_COMPLETENESS]: 100 - Satisfies all conditions of the contract matrix.[EXECUTION_QUALITY]: 100 - High-quality test coverage and robust error handling.[PRODUCTIVITY]: 100 - Delivered safely with excellent evidence ladder annotation.[IMPACT]: 90 - Essential for background KB synchronization, laying the groundwork for continuous multi-clone dev sync.[COMPLEXITY]: 75 - Handled the intricacies of multi-worktree git resolution effectively.[EFFORT_PROFILE]: Heavy Lift - Introduces a critical background auto-pull component.Great job getting this through, GPT. Looking forward to observing the production cycles!
Resolves #11017
Authored by GPT-5.5 (Codex Desktop). Session 20a824b0-29d1-4082-ae12-87705ec69c3f.
Adds
PrimaryRepoSyncServiceas the Orchestrator-owned primary-checkoutdevauto-sync lane. The service resolves the primary checkout, verifies it is ondev, fetchesorigin/dev, fast-forwards when safe, applies the narrow generated-metadata reset only forresources/content/.sync-metadata.json, and cascadesnpm run ai:sync-kbfrom the primary checkout after successful pulls. Orchestrator wiring keeps the logic inai/daemons/services/and adds noai/scripts/entry.Evidence: L2 (unit-tested git/npm command seams + Orchestrator service routing) -> L4 required (3 successful production primary-dev-sync cycles before Shape B sunset-probe retirement). Residual: AC13 [#11017].
Deltas From Ticket
git worktree list --porcelainfirst, withgit rev-parse --git-common-dirfallback. This preserves the ticket's worktree support while matching existing primary-checkout resolver precedent.git pull. Layer 2 remains metadata-only.running/completed/failed/skippedvocabulary, with details carryingreasonCode,layer, andresolved.Structural Pre-Flight
PrimaryRepoSyncService.mjspassed the Stage 1 sibling-file fast path: it lives besideSummarizationCoordinatorService.mjsandBackupCoordinatorService.mjsunderai/daemons/services/, andai/scripts/orchestrator-daemon.mjsremains a thin boot wrapper.Slot Rationale
learn/agentos/v13-path.md: modified existing D3 task inventory and structure block; disposition stayskeepbecause this is the chief-architect path map for Orchestrator scope, high failure-severity if stale, and review-enforceable by source citation.learn/agentos/DeploymentCookbook.md: modified existing env-var inventory; disposition stayskeepbecause operator deployment knobs need a single discoverable table.Test Evidence
npm run test-unit -- test/playwright/unit/ai/daemons/services/TaskStateService.spec.mjs test/playwright/unit/ai/daemons/services/CadenceEngine.spec.mjs test/playwright/unit/ai/daemons/services/PrimaryRepoSyncService.spec.mjs test/playwright/unit/ai/daemons/Orchestrator.spec.mjs test/playwright/unit/ai/scripts/orchestrator-daemon.spec.mjs-> 23 passed.npm run test-unit -- test/playwright/unit/ai/daemons-> 96 passed, 2 pre-existing/environmental failures:ConceptIngestor.spec.mjshitSqliteError: attempt to write a readonly database.DreamServiceGoldenPath.spec.mjsexpectedGUIDESedges but received 0, with Chroma connection noise in the same run.git diff --check origin/dev...HEAD-> passed.Post-Merge Validation
npm run ai:orchestratorwithNEO_ORCHESTRATOR_PRIMARY_DEV_SYNC_INTERVAL_MSset low enough for observation and verify a clean primary checkout records a no-opskipped/up-to-datecycle.origin/devadvance, verify the primary checkout fast-forwards andnpm run ai:sync-kbstarts fromcwd = $PRIMARY_ROOT.Commit
99d03bebe-feat(ai): add primary dev sync orchestrator task (#11017)