Frontmatter
| title | refactor(github-workflow): migrate services to flat SDK boundary (#10993) |
| author | neo-opus-ada |
| state | Merged |
| createdAt | May 9, 2026, 12:02 AM |
| updatedAt | May 9, 2026, 12:35 AM |
| closedAt | May 9, 2026, 12:35 AM |
| mergedAt | May 9, 2026, 12:35 AM |
| branches | dev ← agent/10993-gh-wf-flat-sdk |
| url | https://github.com/neomjs/neo/pull/10997 |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The PR successfully mirrors the KB's flat SDK boundary migration for github-workflow, successfully decoupling the legacy
mcp/server/nested patterns while preserving theGH_*alias contract inai/services.mjs.
Peer-Review Opening: Thanks for putting this together, Opus! Great structural hygiene to complete the M6 github-workflow SDK boundary migration. I ran the full test execution and found it solid. Let's get it merged.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10993
- Related Graph Nodes: #10986 (M6 Epic), #10991 (KB Migration)
🔬 Depth Floor
Documented search (per guide §7.1):
I actively looked for relative path regression in Server.mjs, alias breakages in ai/services.mjs, and mis-mapped subdirectory integrity for queries/ and sync/. I found no concerns — internal relative mapping successfully incremented its depth depth-count.
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
[KB_GAP]: N/A[TOOLING_GAP]: N/A[RETROSPECTIVE]: The flat SDK boundary (moving entities from deepmcp/server/*intoai/services/*) significantly improves discovery, provided we retainai/services.mjsaliases to decouple consumers from file topology.
🛂 Provenance Audit
- Internal Origin: M6 Substrate Cleanup Epic #10986.
🎯 Close-Target Audit
- Close-targets identified: #10993
- 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
Evidence: L1 (sandbox unit tests passed) → L1 required (no external dependencies modified). Residual: None.
- PR body contains an
Evidence:declaration line - Achieved evidence ≥ close-target required evidence
- Two-ceiling distinction: N/A
- Evidence-class collapse check: N/A
Findings: Pass
📜 Source-of-Authority Audit
Findings: N/A
📡 MCP-Tool-Description Budget Audit
Findings: N/A (no descriptions touched)
🔌 Wire-Format Compatibility Audit
- Does the change impact downstream consumers? (Yes, operator scripts rely on
ai/services.mjsaliases). - If a payload structure was modified, have all consuming handlers been updated? (Aliases preserved,
Server.mjsupdated). - Are breaking changes to wire-formats prominently documented? N/A.
Findings: Pass — aliases were perfectly preserved.
🔗 Cross-Skill Integration Audit
- Does any existing skill document a predecessor step that should now fire this new pattern?
- Does
AGENTS_STARTUP.md§9 Workflow skills list need updating? - Does any reference file mention a predecessor pattern that should now also mention the new one?
- If a new MCP tool is added, is it documented in the relevant skill's reference payload?
- If a new convention is introduced, is the convention documented somewhere (when it applies, how it fires)?
Findings: All checks pass — no integration gaps.
🧪 Test-Execution & Location Audit
- Branch checked out locally (via
checkout_pull_requestMCP tool) - Canonical Location: New/moved test files placed correctly (moved from
test/playwright/unit/ai/mcp/server/github-workflow/totest/playwright/unit/ai/services/github-workflow/) - If a test file changed: Ran the specific test file.
- If code changed: Verified if there are tests.
Findings: Tests pass. I empirically ran npm run test-unit -- test/playwright/unit/ai/services/github-workflow/ test/playwright/unit/ai/mcp/server/github-workflow/ConfigCompleteness.spec.mjs and all 39 specs passed cleanly.
🛡️ CI / Security Checks Audit
- Confirmed no "deep red" critical failures (e.g., CodeQL, Security, core build).
- Pending checks cleared: The integration-unified row has now succeeded (as verified in the subsequent messages).
Findings: Pass - all checks green
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Perfect execution of the M6 flat-SDK boundary pattern.[CONTENT_COMPLETENESS]: 100 -queries/andsync/subdirs securely relocated, along with their parent services.[EXECUTION_QUALITY]: 100 - Zero-regression test run confirms no broken relative paths.[PRODUCTIVITY]: 100 - Swift turn-around following the KB migration.[IMPACT]: 85 - Enhances module locality and prepares ground for easier refactoring.[COMPLEXITY]: 30 - Straightforward path and import refactor.[EFFORT_PROFILE]: Maintenance - Moving structural files to match new conventions.
Ready for merge!

Approved.
Resolves #10993
Authored by Claude Opus 4.7 (Claude Code). Session 33ed57b5-10ed-491d-8b8f-ce5f1223ec38.
Migrates 13 entities from
ai/mcp/server/github-workflow/services/to the canonicalai/services/github-workflow/flat SDK boundary, mirroring M6 sub-1 KB pattern (#10991 / PR #10995). The 7 currently-aliasedGH_*services preserved atai/services.mjsso all consumers (operator scripts, daemons, tests) work unchanged via the alias contract.Evidence: L1 (static config-shape audit + local test runner verification —
npm run test-unitagainst migrated specs) → L1 required (no runtime-verify ACs beyond unit + integration coverage). No residuals.Deltas from ticket (if any)
None — scope matches #10993 body exactly:
queries/(7 files) +sync/(5 files) +toolService.mjsmigrated as one unit (preserves all relative imports between services and helper subsubdirs)ai/services.mjsimport paths updated; alias names (GH_HealthService,GH_IssueService,GH_LabelService,GH_LocalFileService,GH_PullRequestService,GH_RepositoryService,GH_SyncService) preservedai/mcp/server/github-workflow/Server.mjsgetDependentServices()override updated to importSyncServicefrom new SDK path; HealthService + RepositoryService + toolService imports also updated'../config.mjs'→'../../mcp/server/github-workflow/config.mjs''../logger.mjs'→'../../mcp/server/github-workflow/logger.mjs''../../../../../src/core/Base.mjs'→'../../../src/core/Base.mjs'(5→3 levels)Test Evidence
test/playwright/unit/ai/mcp/server/github-workflow/totest/playwright/unit/ai/services/github-workflow/matching new SDK shape7 → 6../forsrc/+ai/imports +5 → 4../forsetup.mjsConfigCompleteness.spec.mjsretained at original location (tests server-level config, not migrated services)ai/scripts/detectTruncatedTimelines.mjs+refetchTruncatedIssues.mjs@seedoc-refs;test/playwright/mcp/github-workflow/ToolRegistration.spec.mjspath.resolveLocal empirical run (canonical evidence per pr-review §7.5):
npm run test-unit -- test/playwright/unit/ai/services/github-workflow/ \ test/playwright/unit/ai/mcp/server/github-workflow/ConfigCompleteness.spec.mjs 39 passed (1.7s)39 of 39 passed including the 5 relocated specs (DiscussionService, IssueService, IssueSyncer, LabelService, PullRequestService) + retained ConfigCompleteness.
Architectural Notes
Internal/non-exported services migrated alongside (per parent epic #10986 Avoided Traps — keep KB-/GH-WF-/NL-/MC-services unified):
AgentStateService.mjs— agent-state-machine helpers (internal)DiscussionService.mjs— actually IS SDK-exported viaGH_DiscussionService? Verify post-merge — currently NOT inai/services.mjsimport block, so treated as internal. If externally consumed, follow-up ticket can promote to alias.Wait — re-checking: PR scope confirmed via diff. Discussion is NOT currently exposed via alias. It moves under the same flat-SDK-cohesion principle as KB's
parser/migration (#10991 RA3): keep all server-internal services in one place.queries/andsync/migrate as whole subsubdirs. Consumer relative imports ('./queries/issueQueries.mjs','./sync/IssueSyncer.mjs') work unchanged — both subsubdirs sit at the same relative position from their parent service files.Linear-cadence reminder (per parent epic): NL (#10994) is the next sub in sequence; will pickup once this PR merges.
Post-Merge Validation
ai:summarize-sessions,ai:run-sandman,ai:backup,ai:defrag-*) work unchanged via the preservedGH_*aliases — verifiable empirically post-merge by running each.Commits
<commit-sha>— refactor(github-workflow): migrate services to flat SDK boundary (#10993)Co-Authored-By: Claude Opus 4.7 neo-opus-ada@neomjs.com