LearnNewsExamplesServices
Frontmatter
id13552
titleStabilize Neural Link Bridge liveness unit wait
stateClosed
labels
bugaitestingregression
assigneesneo-gpt
createdAtJun 19, 2026, 2:03 PM
updatedAtJun 19, 2026, 2:19 PM
githubUrlhttps://github.com/neomjs/neo/issues/13552
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 19, 2026, 2:19 PM

Stabilize Neural Link Bridge liveness unit wait

Closed v13.1.0/archive-v13-1-0-chunk-4 bugaitestingregression
neo-gpt
neo-gpt commented on Jun 19, 2026, 2:03 PM

Context

PR #13536 is red after a clean rebase onto current origin/dev because the unit suite repeatedly fails test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs:656 on the Neural Link Bridge supervision test introduced by the closed #13483 feature lane.

Release classification: post-release CI hardening (boardless). This does not add product scope; it removes a CI-only false red that can block unrelated Agent OS documentation/substrate PRs.

Live latest-open sweep: checked the latest 30 open GitHub issues on 2026-06-19 around 12:03 UTC; no open duplicate for the #13483 Neural Link Bridge liveness wait / localStarted === [] CI failure. A2A in-flight sweep: checked latest 30 all-status messages immediately before creation; no competing [lane-claim] or [lane-intent] on this scope.

Memory sweep: query_raw_memories("Orchestrator Neural Link Bridge localStarted empty CI Orchestrator.spec 13483 liveness probe wait") found the original #13483 supervision ticket context from session d1903453-9b2d-4f5d-bb5a-cf51ac2f7538, not a follow-up fix. A second query for supervisor liveness probe CI flake surfaced prior CI-runner timing flakes, reinforcing that this is a test-stability lane, not a product behavior change.

The Problem

The #13483 Neural Link Bridge supervision unit test asserts localStarted after one setTimeout(0) flush:

  • CI job 82341474623 failed on #13536 with Expected { taskName: 'neuralLinkBridge', reason: 'supervisor-restart' }, Received array: [].
  • A rerun job 82342460380 failed with the same assertion.
  • After rebasing #13536 onto current origin/dev, fresh job 82344322498 failed again with the same assertion.
  • Local focused reproduction passes: UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs returned 54 passed on the rebased head.

This makes the test under-waited or CI-sensitive. A single macrotask flush is not a stable proof that the async liveness probe and runTask callback completed under the full CI unit suite.

The Architectural Reality

  • test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs owns the regression surface.
  • ProcessSupervisorService.gateRestartOnLivenessProbe() executes an async liveness probe before scheduling a supervisor restart.
  • The test overrides livenessProbe to return false, overrides runTask to push into localStarted, calls poll(), awaits one zero-delay flush, then asserts synchronously.
  • The product behavior under test remains valid: when the local Neural Link Bridge task is enabled and the liveness probe reports down, the orchestrator schedules a supervisor-restart; cloud mode skips the task.

The Fix

Make the unit wait for the observed side effect instead of assuming one zero-delay tick is enough.

Expected shape:

  • Replace the brittle one-shot flushProbe() assertion for the #13483 Neural Link Bridge supervision test with a bounded polling assertion or equivalent existing local test helper.
  • Keep the assertion focused on the same contract: taskName: 'neuralLinkBridge', reason: 'supervisor-restart'.
  • Avoid broad production changes unless investigation proves the test failure reflects a real scheduling bug.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
#13483 Neural Link Bridge supervision unit test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs Wait for the async liveness-probe restart callback before asserting Bounded wait fails loud if no restart is scheduled Test name/comments only if needed Focused unit spec + CI green
Orchestrator product behavior ai/daemons/orchestrator/Orchestrator.mjs + ProcessSupervisorService No intended behavior change If investigation proves a real race, patch production with focused coverage Existing JSDoc remains authority Existing orchestrator unit suite

Decision Record impact

none — this is CI/test stability for the accepted #13483 supervision behavior.

Acceptance Criteria

  • The #13483 Neural Link Bridge supervision unit no longer relies on a single zero-delay flush before asserting localStarted.
  • The test still verifies local-mode restart scheduling and cloud-mode skip behavior.
  • Focused local run passes: UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs.
  • The affected PR/check lane reaches green CI, or the PR body/comment documents a different remaining failure with fresh evidence.

Out of Scope

  • Reworking Neural Link Bridge supervision product behavior from #13483.
  • Changing orchestrator task definitions or config leaves unless fresh investigation proves the test is exposing a product race.
  • Addressing unrelated flaky tests from the same full-suite CI run.

Avoided Traps

  • Treating the repeated CI failure as a random one-off after three same-signature failures.
  • Hiding the fix inside the unrelated #13535 documentation PR without a ticket authority.
  • Rerunning indefinitely when the assertion is structurally under-waited.

Related

Refs #13483 Related: #13536

Handoff Retrieval Hints: query_raw_memories("Orchestrator Neural Link Bridge localStarted empty CI Orchestrator.spec 13483 liveness probe wait"); CI job anchors 82341474623, 82342460380, 82344322498; file anchor test/playwright/unit/ai/daemons/orchestrator/Orchestrator.spec.mjs.