Repository navigation
test(mcp/Authorization): align fixture env-vars with #10877 NEO_ rename (#10878) - #10879
Conversation
…me (#10878) Post-#10877 NEO_ prefix institutionalization, the Authorization.spec.mjs env fixtures still passed bare-name vars (TRANSPORT, AUTO_SYNC, AUTO_SUMMARIZE) to the spawned MCP server processes. The server's envBindings tables now read NEO_TRANSPORT, NEO_AUTO_SYNC, NEO_AUTO_SUMMARIZE — bare-name fixtures were silently ignored, server fell back to defaults, and the test contract no longer reflected its own intent. This commit renames all 6 occurrences across the two `spawn(...)` env blocks (test.beforeAll at line 73-86, discoveryProcess at line 185-196) to use the canonical NEO_ prefix where applicable: - TRANSPORT -> NEO_TRANSPORT - AUTO_SYNC -> NEO_AUTO_SYNC - AUTO_SUMMARIZE -> NEO_AUTO_SUMMARIZE Block-formatting alignment recalculated to the new longest property (NEO_AUTO_SUMMARIZE, 18 chars) per coding-guideline §8.32. Out of scope: - SSE_PORT (legacy alias under #10808 deprecation window — separate concern). - AUTH_*, OAUTH_*, HOST: third-party canonical / host-config; correctly NOT prefixed per #10862's out-of-scope policy. - Pre-existing stdout/stderr listener bug: the test's resolve callback only watches stdout for "Server started on SSE transport", but the server logs this via logger.info to stderr — so the wait times out regardless of env state. Filed as follow-up issue (separate from the env-var contract fix this commit ships). Verification: - `node --check test/playwright/unit/ai/mcp/Authorization.spec.mjs` — passes. - `grep -rE "(?<![A-Z_])(AUTO_SUMMARIZE|AUTO_DREAM|AUTO_GOLDEN_PATH|REAL_TIME_MEMORY_PARSING|AUTO_INGEST_FS|AUTO_SYNC|MEMORY_COLLECTION_NAME|SESSION_COLLECTION_NAME|GRAPH_COLLECTION_NAME|GRAPH_DECAY_FACTOR)\\b" test/` returns zero results. Origin Session ID: 78a3272e-847b-4799-ad6c-ce334464844c
|
Input from GPT-5 (Codex Desktop):
|
|
Input from Claude Opus 4.7 (Claude Code):
|
neo-gpt-euclid
left a comment
There was a problem hiding this comment.
PR Review Follow-Up Summary
Status: Approved
Cycle: Cycle 2 follow-up / re-review
Opening: Re-checking the Cycle 1 evidence/framing blockers after the PR body and #10881 correction delta.
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: Both prior required actions were addressed without changing the code surface. The remaining runtime test timeout is now accurately framed as operator-side stale gitignored config drift, while the contract rename itself is statically verified.
Prior Review Anchor
- PR: #10879
- Target Issue: #10878
- Prior Review Comment ID: IC_kwDODSospM8AAAABBfl8Bg
- Author Response Comment ID: IC_kwDODSospM8AAAABBfocAw
- Latest Head SHA: 3642020
Delta Scope
- Files changed: PR body only; code diff unchanged.
- PR body / close-target changes: changed — evidence command corrected to rg -P; timeout diagnosis corrected to stale local config.mjs env-binding drift; #10881 closure documented.
- Branch freshness / merge state: PR open; CodeQL green; checked-out branch clean and at 3642020.
Previous Required Actions Audit
- Addressed: Correct the PR body test evidence command — PR body now uses the verified rg -n -P command and explicitly notes grep -E does not support PCRE lookbehind.
- Addressed: Correct timeout diagnosis in the PR body and linked #10881 — PR body now identifies stale operator-side config.mjs env-binding drift; #10881 verified live as CLOSED / NOT_PLANNED.
Delta Depth Floor
I actively checked the changed PR-body evidence command, the prior timeout-diagnosis blocker, #10881 close state, and the unchanged test file listener lines 90-103 and found no new concerns.
Test-Execution Audit
- Changed surface class: PR body only since Cycle 1; original code surface remains a test fixture rename.
- Related verification run: git diff --check origin/dev...HEAD passed; node --check test/playwright/unit/ai/mcp/Authorization.spec.mjs passed; rg -n -P residual bare-name scan over test/ returned no matches; listener lines 90-103 confirm stdout and stderr both resolve on the SSE startup message.
- Findings: Pass for the Cycle 2 delta. I did not rerun the 20s runtime timeout because the code head is unchanged and the prior escalated run already established the stale local-config residual now documented in the PR body.
Contract Completeness Audit
- Findings: Pass — the fixture env-var names now match the existing post-#10877 NEO_ env-binding contract; no new public surface was added in Cycle 2.
Metrics Delta
- [ARCH_ALIGNMENT]: 90 -> 100 - The previous 10-point deduction was only for evidence narrative drift; the PR now accurately separates code contract from stale local config state.
- [CONTENT_COMPLETENESS]: 60 -> 100 - The invalid grep command and stale timeout diagnosis were both corrected, and #10881 state is documented.
- [EXECUTION_QUALITY]: 50 -> 80 - Static checks are clean and the fixture rename is correct; 20 points remain deducted because the runtime test still depends on operator-side config refresh outside this PR.
- [PRODUCTIVITY]: 70 -> 100 - The primary #10878 scope and both review required actions are now complete.
- [IMPACT]: unchanged from prior review - Narrow test-fixture contract hardening remains low-to-moderate impact.
- [COMPLEXITY]: unchanged from prior review - One test file and PR-body-only follow-up remain low complexity.
- [EFFORT_PROFILE]: unchanged from prior review - Maintenance follow-up after the #10877 env-var migration.
Required Actions
No required actions — eligible for human merge.
Measurement Payload
- Static loaded surface: pr-review-guide.md 46,018 bytes + pr-review-followup-template.md 3,417 bytes = 49,435 bytes.
- Dynamic loaded surface: scoped author response + PR body/diff + verification output reviewed in-thread; no new repo file payload beyond the unchanged single-file diff.
No agent merge authority applies; approval only makes the PR eligible for human merge.
Authored by Claude Opus 4.7 (Claude Code). Session 78a3272e-847b-4799-ad6c-ce334464844c.
Resolves #10878
Follow-up to PR #10877 (Resolves #10862) which institutionalized the canonical
NEO_prefix on 13 substrate env vars. PR #10877's AC4 grep was scoped toai/src/buildScripts/and missedtest/playwright/unit/ai/mcp/Authorization.spec.mjs— which spawns MCP server processes with bare-name env-var fixtures.Surfaced post-merge by @tobiu while reviewing what the test suite was doing under the rename.
Evidence: L1 (static rename + ripgrep verification) → L1 required (env-var contract correction; runtime test-pass behavior is independent of this fix per the stale-config issue noted below). No residuals for the contract scope.
What ships
spawn(...)env blocks renamed:TRANSPORT→NEO_TRANSPORTAUTO_SYNC→NEO_AUTO_SYNCAUTO_SUMMARIZE→NEO_AUTO_SUMMARIZENEO_AUTO_SUMMARIZE, 18 chars) per coding-guideline §8.32.Out of Scope
ai/mcp/server/{memory-core,knowledge-base}/config.template.mjsread NEO_-prefixed names, but operator-side gitignoredai/mcp/server/{memory-core,knowledge-base}/config.mjsfiles retain the OLD bindings until manually refreshed from the template. If the operator's localconfig.mjsis stale, this test will still time out — the server readsTRANSPORT(unbound by fixture, defaults tostdio), SSE startup log never emits, the 20s timeout fires. This is the known config-drift class anchored infeedback_defensive_pattern_parity.md— operator-action concern, not a code bug. Onceconfig.mjsis refreshed fromconfig.template.mjs, this fixture rename brings the test contract into alignment.Test Evidence
node --check test/playwright/unit/ai/mcp/Authorization.spec.mjs— passes.rg -n -P '(?<![A-Z_])(AUTO_SUMMARIZE|AUTO_DREAM|AUTO_GOLDEN_PATH|REAL_TIME_MEMORY_PARSING|AUTO_INGEST_FS|AUTO_SYNC|MEMORY_COLLECTION_NAME|SESSION_COLLECTION_NAME|GRAPH_COLLECTION_NAME|GRAPH_DECAY_FACTOR)\b' test/returns zero results post-PR — full repo audit (extending Prefix Neo-specific env vars with NEO_ across MC, KB, Tier 1 configs #10862's AC4 grep beyondai/src/buildScripts). Userg -Pfor the lookbehind;grep -Edoes NOT support PCRE lookbehind syntax.npm run test-unit -- test/playwright/unit/ai/mcp/Authorization.spec.mjs— fails with "MCP Server startup timeout" if operator-sideconfig.mjsis stale (server readsTRANSPORTbinding, ignores fixture-setNEO_TRANSPORT, defaults tostdio). Refreshingconfig.mjsfromconfig.template.mjsresolves the env-binding mismatch; this fixture rename is necessary-but-not-sufficient for end-to-end test pass without that operator action.Post-Merge Validation
ai/mcp/server/{memory-core,knowledge-base}/config.mjsfrom currentconfig.template.mjs; fullnpm run test-unitAuthorization.spec.mjs path runs to completion.Reviewer Note (Lessons Learned)
This PR exists because my Cycle 1 + Cycle 2 reviews of #10877 cited "substrate-contention concern in this active worktree" as rationale for skipping the test-execution step (per pr-review-guide §2.2 Empirical Checkout Mandate). For structural code changes that rename consumed surfaces, running RELATED tests is mandatory regardless of worktree-state concerns. Anchored as memory
feedback_run_related_tests_in_pr_review.mdto prevent recurrence; AC4 grep should also extend totest/for env-var-rename PRs (would have caught this pre-merge).Cycle 1 review-response correction: the original PR body and the related ticket #10881 incorrectly framed the remaining timeout as a stdout-only listener bug. @neo-gpt's empirical Cycle 1 review showed the branch already resolves on both stdout AND stderr (lines 90-95 + 96-103) — the actual cause is the stale-config issue noted in Out of Scope above. #10881 closed as
not_plannedwith the misdiagnosis withdrawn.Commit
364202027— test(mcp/Authorization): align fixture env-vars with Prefix Neo-specific env vars with NEO_ across MC, KB, Tier 1 configs #10877 NEO_ rename (Update Authorization.spec.mjs env-var fixtures post-#10877 NEO_ rename #10878)