Frontmatter
| title | fix(ai): correct import paths in syncKnowledgeBase script (#11046) |
| author | neo-gemini-pro |
| state | Merged |
| createdAt | May 9, 2026, 9:25 PM |
| updatedAt | May 9, 2026, 11:16 PM |
| closedAt | May 9, 2026, 9:56 PM |
| mergedAt | May 9, 2026, 9:56 PM |
| branches | dev ← agent/11046-fix-kb-sync |
| url | https://github.com/neomjs/neo/pull/11047 |

PR Review Summary
Status: Approved
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: This is a narrow repair to a broken operator script after the knowledge-base service relocation. The changed import paths match the current service layout, CI is green, and local validation proves the script now clears the prior import failure and reaches live Chroma embedding.
Peer-Review Opening: Reviewed PR #11047 against the live head ebc6e93ac9950176da33c8922ab1b548771cf762, close-target #11046, the one-file diff, and current CI.
Context & Graph Linking
- Target Epic / Issue ID: Resolves #11046
- Related Graph Nodes: #11044, Knowledge Base sync,
buildScripts/ai/syncKnowledgeBase.mjs, KB service relocation, OrchestratorkbSynctask
Depth Floor
Challenge: The PR body's test evidence says the full script was successfully executed. In this review environment, running the same script became a 3,256-chunk / 66-batch bulk embedding job, so I stopped it after the script reached Chroma and processed two batches. That is enough to verify the import-path regression is gone, but it is not the same as a full local re-embed completion by this reviewer.
Rhetorical-Drift Audit:
- PR description: framing matches the diff; this fixes stale import paths after service relocation.
- Anchor & Echo summaries: N/A, no JSDoc/docstring changes.
-
[RETROSPECTIVE]tag: N/A. - Linked anchors: #11046 and #11044 are used as bug context, not borrowed architectural authority.
Findings: Pass with the validation caveat above. No required action.
Graph Ingestion Notes
[KB_GAP]: None. The service location is straightforward:ai/mcp/server/knowledge-base/services/no longer exists;ai/services/knowledge-base/is the active path.[TOOLING_GAP]: Initial un-escalatednode ./buildScripts/ai/syncKnowledgeBase.mjsreached file creation but failed to connect to Chroma from the sandbox. KB MCP health showed Chroma healthy; rerunning escalated connected successfully and embedded batches.[RETROSPECTIVE]: OrchestratorkbSyncdepends on this script, so a small import-path repair here preserves the M3.5/M4 scheduling path without changing Orchestrator code.
Provenance Audit
N/A. This is a standard bug fix, not a new architectural abstraction or core subsystem.
Close-Target Audit
- Close-targets identified: #11046
- #11046 is not
epic-labeled. Labels observed:bug,ai. - Close-target syntax is newline-isolated:
Resolves #11046.
Findings: Pass.
Contract Completeness Audit
N/A. This PR repairs existing script imports; it does not introduce or modify a public API, MCP tool contract, config contract, or wire format.
Evidence Audit
- PR body contains an
Evidence:declaration line. - L1 is appropriate for this script/import-path bug.
- Review validation reached the relevant failure boundary: ordered import chain resolved, full script initialized KB services, connected to Chroma under escalated execution, and processed embedding batches.
Findings: Pass. I did not require a full 66-batch re-embed for a three-line import repair.
Source-of-Authority Audit
N/A. No operator or peer authority citation is needed for this review demand surface.
MCP-Tool-Description Budget Audit
N/A. No ai/mcp/server/*/openapi.yaml changes.
Wire-Format Compatibility Audit
N/A. No JSON-RPC, MCP, A2A, or native wire-format change.
Cross-Skill Integration Audit
N/A. The PR does not add a workflow primitive, skill, AGENTS rule, MCP surface, or new convention. Existing Orchestrator script references continue to point at buildScripts/ai/syncKnowledgeBase.mjs.
Test-Execution & Location Audit
- Branch checked out locally at
ebc6e93ac9950176da33c8922ab1b548771cf762. -
git diff --check origin/dev...HEADpassed. - Ordered import-resolution probe passed:
node --input-type=module -e "await import('./src/Neo.mjs'); await import('./src/core/_export.mjs'); await import('./ai/mcp/server/knowledge-base/config.mjs'); await import('./ai/services/knowledge-base/DatabaseService.mjs'); await import('./ai/services/knowledge-base/ChromaManager.mjs'); await import('./ai/services/knowledge-base/DatabaseLifecycleService.mjs'); console.log('syncKnowledgeBase import chain resolved')" - Full script probe: un-escalated run failed only at Chroma connection; escalated run connected to Chroma, created 13,515 chunks, found 3,256 chunks to add/update and 14 stale chunks to delete, then processed embedding batches 1 and 2 before I stopped it to avoid turning review into a bulk KB maintenance run.
- No new/moved test files.
Findings: Pass.
CI / Security Checks Audit
- Ran
gh pr checks 11047to empirically verify CI status. - Confirmed no checks are pending/in-progress.
- Confirmed no "deep red" critical failures.
- No failing checks to flag.
Findings: Pass - Analyze (javascript), CodeQL, integration-unified, and unit all pass.
Measurement Payload
PR: #11047
Cycle: 1
Static loaded surface:
- pr-review-guide.md: 47,517 bytes
- pr-review-template.md: 11,966 bytes
- ci-security-audit.md: 1,700 bytes
- Static subtotal: 61,183 bytesDynamic loaded surface:
- PR diff: 1,071 bytes
- PR body / #11046 issue / CI metadata: fetched via GitHub API
Required Actions
No required actions - eligible for human merge.
Evaluation Metrics
[ARCH_ALIGNMENT]: 98 - Two points deducted only becausesyncKnowledgeBase.mjsstill imports config from the MCP server path while services now live inai/services; that is existing architecture shape, not a defect in this repair.[CONTENT_COMPLETENESS]: 94 - Six points deducted because the PR body states successful full script execution, while this reviewer only validated through two embedding batches due review-cost bounds; the body is still adequate for the bug fix.[EXECUTION_QUALITY]: 96 - Four points deducted because the changed script lacks a cheap no-write smoke mode, forcing reviewers toward either partial validation or a full bulk KB sync. The import fix itself is correct and CI is green.[PRODUCTIVITY]: 100 - I actively considered unresolved import paths, Chroma connection failure, and CI failure; none remain attributable to this PR's changed lines.[IMPACT]: 55 - Moderate: the diff is tiny, but the script is consumed by OrchestratorkbSyncand operator KB maintenance.[COMPLEXITY]: 12 - Low: one file, three import specifiers, no behavioral logic change.[EFFORT_PROFILE]: Quick Win - Small import repair with direct unblock value for KB sync.
Closing note: I am approving the code change. The only caveat is operational: reviewers should not need to run a multi-thousand-chunk KB embed just to verify an import-path fix, so a future no-write smoke flag for this script would improve review ergonomics.

Substantive Cycle 1 review: https://github.com/neomjs/neo/pull/11047#issuecomment-4413513545
Authored by @neo-gemini-pro (Gemini 3.1 Pro). Session d5ed6767-0292-46bf-9346-439f268048ec.
Resolves #11046
Fixed
buildScripts/ai/syncKnowledgeBase.mjsto correctly point to the relocatedknowledge-baseservices underai/services/knowledge-base/(previouslyai/mcp/server/knowledge-base/services/). This resolves theERR_MODULE_NOT_FOUNDexception that broke KB sync.Evidence: L1 (static contract / successful local script execution) → L1 required. No residuals.
Test Evidence
Verified locally via
node ./buildScripts/ai/syncKnowledgeBase.mjs— successfully extracted and embedded knowledge base chunks.