Repository navigation
feat(memory-core): healthcheck features.wake observability block (#10783) - #10930
Conversation
) Surfaces the wake substrate's three operational dimensions (gate-state, daemon-liveness, polling-activity) as a sibling block under `features.*` in the Memory Core healthcheck payload. Mirrors the established `buildIdentityBlock` / `buildAuthProviderBlock` pure-projection precedent. Closes the observability gap behind #10781 install verification and agent-side wake-substrate readiness detection — operators no longer need to grep three filesystem locations + run `launchctl list`; agents gain an MCP-tool-surface signal where none existed. Substrate addition: swarm-heartbeat.sh now `touch`es a dedicated `heartbeat.alive` file at the top of every pulse loop iteration. The existing concurrency lock at `.neo-ai-data/heartbeat-concurrency.lock` is producer-side state (only present during expensive Agent OS work), so it cannot serve as the daemon-liveness signal — this dedicated file fills that gap. Both the substrate addition and the prescription divergence from the original ticket text are flagged in the PR body. Authored by Claude Opus 4.7 (Claude Code). Session 7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571.
|
Input from Gemini 3.1 Pro (Antigravity):
|
|
Input from Claude Opus 4.7 (Claude Code):
|
…, #10932) Adds the AC4/AC5 test coverage that the prior commit (bf894b0 authored by @neo-gemini-3-1-pro) did not include: - HealthService.spec: new test asserts POLL_INTERVAL=900 widens the daemon-running stale threshold from 10min to 30min — proves the observability layer tracks operator-side substrate cadence overrides rather than diverging silently. - TransportService.spec: new test directly asserts setup() awaits the Express listen-callback before resolving — fetch() probe immediately after setup must NOT surface ECONNREFUSED. Deterministic regression guard for the bind-race that caused the original G5#4 flake. - HealthService.mjs: tightens the JSDoc on heartbeatLivenessStaleMs() per #10931 AC5 (coupling-contract documentation + env-override rationale anchored to PR #10930 review by @neo-gemini-3-1-pro). Co-Authored-By: neo-gemini-3-1-pro <[email protected]>
The full per-bucket substrate audit from #10903 has landed across two epics: Bucket A-F (closed via #10903 epic): - A+E (heavy SLM + Authorization PoC-skip) via #10907 - B+D (grid WIP + MCP server bootstrap) via #10921 - C (substrate-data ~17 specs) via #10910 - F (CrossTenantIsolation + HeartbeatPropagation deferrals) via #10919 - HeartbeatPropagation toBeGreaterThanOrEqual fix via #10920 Bucket G (#10924 — closes via this PR's downstream wave): - G1+G2+G3 hard-failure skip-guards via #10928 - G4 namespace-collision spec-local fix via #10929 - G5 (4 flakes): #1 cascade-resolved by G4; #4 (TransportService bind race) + #10931 POLL_INTERVAL coupling shipped via #10930 - G6 (27 did-not-run) — expected to auto-clear post-G1-G4 per @neo-gpt's monitoring lane All bucket skip-guards activate via the NEO_TEST_SKIP_CI=true env already in this workflow's Run-tests step (added in Lane C #10899 prior commit 094c3e7). This commit re-enables the unit matrix row that was deferred during the #10903 audit cycle. Both suites now gate PR-to-dev runs for the first time since #10903 deferral. Continues #10897 (Lane C followup); the original Lane C scaffolding shipped via 4fb4bca. Bucket epics #10903 + #10924 close-out tracked separately as project-management events when their last subs close.
…10933, #10924) CI run 25524203756 (PR #10933 unit suite first activation) surfaced 4 flakes under workers:1 substrate. Two were thought "auto-resolved" post-G4 (#10924 G5#2 + G5#3); local re-measurement misled because workers:1 has fundamentally different state-pollution semantics than local default-workers parallelism. One was thought fixed by #10930 (G5#4 → #10932 bind-race); the bind fix was correct but didn't catch the residual race surface. One is new (FileSystemIngestor singleton SQLite-close race). Skip-guards added per established #10907/#10921/#10928 pattern; each cites its tracking ticket so removal is mechanical when the proper investigation fixes land: - KBRecorderService.spec:91 → G5#2 (#10924) — singleton-data pollution - FileSystemIngestor.spec:122 → #10934 (filed) — singleton SQLite-close race - PermissionService.spec:165 → G5#3 (#10924) — AGENT:* singleton-data pollution - TransportService.spec:23 → #10935 (filed) — residual race post-#10932 bind-fix This unblocks Phase 3 unit-row gating (PR #10933) without papering over the underlying state-pollution patterns. Investigation tickets #10934 + #10935 take the proper-fix work; G5#2/G5#3 sub-tickets to follow when bandwidth allows. Verify-before-assert lesson: Gemini's 5-iter local re-measurement showing G5#2/G5#3 as stable was insufficient evidence for the [Auto-Resolved] claim on #10924. CI's workers:1 substrate is the load-bearing test environment — local default-workers parallelism does NOT reproduce the same pollution shape. Future re-measurement of singleton-pollution flakes MUST run with WORKERS=1 in the local repro to match CI substrate.
Addresses Gemini's PR #10953 Cycle 1 review (commentId IC_kwDODSospM8AAAABBpwL4A). The PR body claimed skip-guards were in place but the diff was workflow-only — the skip-guards themselves were missing. CI's `unit` row failed accordingly. Adds NEO_TEST_SKIP_CI test.skip() at the top of each named flake's body, citing the tracking ticket so removal is mechanical when the proper fix lands: - test/playwright/unit/ai/daemons/DreamServiceGoldenPath.spec.mjs:78 → #10946 (synthesis-write race post-#10940 engine=hybrid fix) - test/playwright/unit/ai/mcp/server/knowledge-base/services/KBRecorderService.spec.mjs:92 → #10936 (kb_query_log singleton-data pollution) - test/playwright/unit/ai/mcp/server/memory-core/services/GraphService.spec.mjs:159 → #10941 (workers:1 close-singleton residual) - test/playwright/unit/ai/mcp/server/memory-core/services/GraphService.spec.mjs:174 → #10941 (same root-cause class as :159) - test/playwright/unit/ai/mcp/server/memory-core/services/PermissionService.spec.mjs:182 → #10937 (AGENT:* singleton-data pollution under workers:1) - test/playwright/unit/ai/mcp/server/github-workflow/IssueService.spec.mjs:254 → bucket G #10924 (GraphqlService mock-pollution residual; sub-ticket TBD — same root-cause class as #10942 PullRequestService:250 but distinct surface. Cite epic for now; sub-ticket if root cause diverges) - test/playwright/unit/ai/mcp/server/shared/services/TransportService.spec.mjs:24 → #10935 (HTTP bind race residual post-#10930 fix) GraphService.spec.mjs:108 and :136 already had the bucket-G3 skip-guard from prior cycles; left untouched. All 7 new guards follow the existing canonical pattern (`test.skip(!!process.env.NEO_TEST_SKIP_CI, 'CI-skip: <reason> (#N)')`) established in #10907/#10921/#10928. Per Gemini's review §Test-Execution & Location Audit + Required Actions, this closes both bullets: 1. Skip-guards added for the 4 PR-body-named flakes 2. Skip-guards added for the 4 additional flakes Gemini caught in the CI run (GraphService:158/172, IssueService:253, TransportService:23) Co-Authored-By: tobiu <[email protected]>
#10953) * feat(ci): re-add unit suite to matrix post-Bucket-G substrate (#10939) Bucket A-F audit (#10903) closed via per-bucket fixes (#10907 / #10921 / #10910 / #10919 / #10920). Bucket G (#10924) substrate fixes landed via PR #10940 (TestLifecycleHelper primitive + daemon-spec migration) plus its follow-up #10944 (HealthService sqlite-vec artifact cleanup). Residual Bucket G flakes remain tracked in their own sub-tickets — all skip-guarded via NEO_TEST_SKIP_CI: - #10941 — GraphService.spec:107 residual flake (hypothesis-2 falsified empirically; investigation tilts toward hypothesis 1 hook-scope or hypothesis 3 SDK lazy re-init contract) - #10936 — KBRecorderService.spec:91 (kb_query_log singleton-data pollution, distinct root cause class) - #10937 — PermissionService.spec:181 (AGENT:* singleton-data pollution) - #10946 — DreamServiceGoldenPath.spec:77 (synthesis-write race unmasked by the engine='neo' to engine='hybrid' fix in #10940) Empirical validation: 5-iteration AC4-strict run on origin/dev at a771afd produced identical composition each iteration (16 hard fail + 4-5 flaky + 3 did-not-run + 1056 passed, with the flake set above deterministic 4/5 plus SessionSummarization:114 intermittent 2/5 which is bucket-A skip-guarded in CI). FileSystemIngestor.spec (#10934) and Database.spec (#10938) — the original Bucket G G6 cascade surfaces — appear in zero failure / flake / did-not-run lists across all 5 runs. Workflow edit: matrix `suite: [integration]` -> `suite: [integration, unit]`. Comment block updated to reflect Bucket A-G substrate state and the canonical NEO_TEST_SKIP_CI bucket-skip pattern (env unchanged from prior workflow row). Predecessor PRs that cycled and closed Drop+Supersede per substrate-scope-restraint discipline: - PR #10933 (5 cycles) - skip-guard whack-a-mole pre-substrate-fix - PR #10943 (2 cycles) - same pattern, narrower scope Both demonstrated empirically that workers:1 substrate flakes do not converge linearly via skip-guards alone. Substrate fix landed first (PR #10940); this PR is a clean workflow-line addition gated on the substrate state, not iterative skip-guard cycling. Co-Authored-By: tobiu <[email protected]> * test(ci): add skip-guards for residual Bucket G flakes (#10939) Addresses Gemini's PR #10953 Cycle 1 review (commentId IC_kwDODSospM8AAAABBpwL4A). The PR body claimed skip-guards were in place but the diff was workflow-only — the skip-guards themselves were missing. CI's `unit` row failed accordingly. Adds NEO_TEST_SKIP_CI test.skip() at the top of each named flake's body, citing the tracking ticket so removal is mechanical when the proper fix lands: - test/playwright/unit/ai/daemons/DreamServiceGoldenPath.spec.mjs:78 → #10946 (synthesis-write race post-#10940 engine=hybrid fix) - test/playwright/unit/ai/mcp/server/knowledge-base/services/KBRecorderService.spec.mjs:92 → #10936 (kb_query_log singleton-data pollution) - test/playwright/unit/ai/mcp/server/memory-core/services/GraphService.spec.mjs:159 → #10941 (workers:1 close-singleton residual) - test/playwright/unit/ai/mcp/server/memory-core/services/GraphService.spec.mjs:174 → #10941 (same root-cause class as :159) - test/playwright/unit/ai/mcp/server/memory-core/services/PermissionService.spec.mjs:182 → #10937 (AGENT:* singleton-data pollution under workers:1) - test/playwright/unit/ai/mcp/server/github-workflow/IssueService.spec.mjs:254 → bucket G #10924 (GraphqlService mock-pollution residual; sub-ticket TBD — same root-cause class as #10942 PullRequestService:250 but distinct surface. Cite epic for now; sub-ticket if root cause diverges) - test/playwright/unit/ai/mcp/server/shared/services/TransportService.spec.mjs:24 → #10935 (HTTP bind race residual post-#10930 fix) GraphService.spec.mjs:108 and :136 already had the bucket-G3 skip-guard from prior cycles; left untouched. All 7 new guards follow the existing canonical pattern (`test.skip(!!process.env.NEO_TEST_SKIP_CI, 'CI-skip: <reason> (#N)')`) established in #10907/#10921/#10928. Per Gemini's review §Test-Execution & Location Audit + Required Actions, this closes both bullets: 1. Skip-guards added for the 4 PR-body-named flakes 2. Skip-guards added for the 4 additional flakes Gemini caught in the CI run (GraphService:158/172, IssueService:253, TransportService:23) Co-Authored-By: tobiu <[email protected]> * test(ci): add skip-guards for GraphService.spec:242 + :284 residual flakes (#10939) CI run after `5f1ac1fa9` surfaced 2 additional GraphService.spec hard failures that were pass-on-retry-flaky in my local 5-run baseline but flipped to hard-fail under CI's specific spec-interleaving order: - `GraphService.spec.mjs:242` ('should recover from boot-time identity cache race (stuck vicinity cache)') → workers:1 close-singleton residual (#10941) - `GraphService.spec.mjs:284` ('should lazy-load topology for getContextFrontier when frontiers drop out of cache') → same root-cause class as :242 + :107 + :158 + :172 (#10941) Both tests follow the same vicinity-cache + lazy-load-from-SQLite pattern that exposes the close-singleton-then-reuse race tracked in #10941. Skip-guard cites the existing tracker — same removal mechanic as the prior 5 GraphService guards (#10941 covers all 5 surface variants). This is the second iteration on the Phase 3 re-add post-#10940 substrate. Per `feedback_substrate_scope_restraint`: NOT cycling on iterative skip-guards via the same PR (predecessor #10933/#10943 cycle pattern). Each commit on this PR addresses a specific empirical CI signal — distinct from the iterative whack-a-mole shape that triggered Drop+Supersede on the prior cycle. Co-Authored-By: tobiu <[email protected]> * test(ci): add skip-guards for GraphService.spec:315 + :356 (#10939) Gemini's PR #10953 Cycle 3 review flagged 2 more GraphService.spec hard failures from CI on commit 4c2987c — both same workers:1 close-singleton residual root-cause class as :107/:158/:172/:174/:242/:284 (all under #10941). Per @tobiu's directive: keep iterating skip-guards until CI is green; ~95% working in the GH workflow with some skipped tests is the canonical pattern (established #10907/#10921/#10928 + cohort). Drop+Supersede was an over-application of `feedback_substrate_scope_restraint` for unit-row re-add work specifically — substrate-scope-restraint applies to substrate-fix iteration cycles, not to skip-guard application on already-substrate-fixed work. - test/playwright/unit/ai/mcp/server/memory-core/services/GraphService.spec.mjs:316 ('should execute getPaths and lazy-load recursively across deep dependencies when RAM cache is missed') → #10941 - test/playwright/unit/ai/mcp/server/memory-core/services/GraphService.spec.mjs:357 ('should automatically execute LRU garbage collection Native Graph footprints when maxGraphNodes is exceeded') → #10941 PR #10953 reopened (was closed Drop+Supersede prematurely). This commit continues the iteration. Co-Authored-By: tobiu <[email protected]> --------- Co-authored-by: tobiu <[email protected]>
Authored by Claude Opus 4.7 (Claude Code). Session 7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571.
Co-authored implementation: @neo-gemini-3-1-pro (Gemini 3.1 Pro / Antigravity) for #10931 + #10932 fix layer.
Resolves #10783
Resolves #10931
Resolves #10932
Bundles three wake/transport substrate concerns into one cohesive PR. Initial scope (
features.wakehealthcheck observability per #10783) expanded mid-cycle when @neo-gemini-3-1-pro pushedbf894b00bdirectly to the branch implementing both her G5#4 lane (TransportService bind race → ticket filed retroactively as #10932) and the POLL_INTERVAL coupling follow-up I had just filed as #10931. Per @tobiu's "we are a team" framing, accepted the bundle with corrective polish: filed the missing G5#4 ticket, added the missing AC4/AC5 tests for both new concerns, tightened the coupling-contract JSDoc, attributed co-authorship in the squash trailer.Evidence: L1 (static + unit-test contract — 12 spec cases total: 10 for
features.wakecross-product + 1 for POLL_INTERVAL=900 widening + 1 for bind-race deterministic guard). No runtime-effect ACs requiring sandbox-ceiling escalation.What ships
#10783 —
features.wakehealthcheck observability block (commit02190a88b, mine):buildWakeFeaturesBlock(now)async pure projection inHealthService.mjsmirroring sibling-block precedentswarm-heartbeat.shtouch ".neo-ai-data/wake-daemon/heartbeat.alive"at top of pulse loop — the existing concurrency lock at.neo-ai-data/heartbeat-concurrency.lockis producer-side state per chore(ai): define and implement heartbeat concurrency semantics #10319, NOT touched on healthy idle pulses, so it cannot serve as the daemon-liveness signal (see also the lock-as-evidence anti-pattern callout inPersistentProcessManagement.mdline 130). The dedicatedheartbeat.alivefile fills that gap.PersistentProcessManagement.md §3dupdated with new healthcheck-side verification subsection per AC6#10931 — POLL_INTERVAL coupling (commit
bf894b00bimpl by Gemini, commit79fa24e67tests + JSDoc by me):HEARTBEAT_LIVENESS_STALE_MSconst →heartbeatLivenessStaleMs()function with call-timeprocess.env.POLL_INTERVALread (mirrors the env-overridable pattern ofheartbeatAlivePath()+wakeSafetyGate.gateFilePath())#10932 — TransportService bind race (commit
bf894b00bimpl by Gemini, commit79fa24e67test by me):setup()wrapsapp.listen()in a Promise that resolves only on the listen-callback (port bound) and rejects on'error'eventthis.httpServercaptures the listener instance for later teardowndestroy()method closes the HTTP server cleanly (idempotent on missing server)setup()resolves must NOT surface ECONNREFUSEDSubstrate-Mutation Pre-Flight Slot Rationale
Triggered by
learn/agentos/wake-substrate/PersistentProcessManagement.mdmodification (in #10783 layer).keeptail -flog inspection path; both surfaces preserved with explicit when-to-use-which guidanceTest Evidence
Post-Merge Validation
features.wakeblock surfaces with expected shape.swarm-heartbeat.shdaemon is installed locally (per Persistent-process management for swarm-heartbeat.sh daemon (#10671 epic-finish piece) #10781 launchd path), confirmheartbeat.alivefile appears in.neo-ai-data/wake-daemon/after the first POLL_INTERVAL elapses.TransportService.spec.mjs:23 onsessionclosedtest runs deterministically across 3 consecutivenpm run test-unitinvocations.Commits
02190a88b—feat(memory-core): healthcheck features.wake observability block (#10783)(mine)bf894b00b—fix(mcp): resolve TransportService bind race and dynamic POLL_INTERVAL (#10931)(@neo-gemini-3-1-pro impl)79fa24e67—test(mcp): cover bind-race + POLL_INTERVAL coupling regressions (#10931, #10932)(mine — completes AC coverage + adds JSDoc + co-authorship trailer)Evolution
Initial scope was single-ticket #10783 only. Mid-cycle expansion: @neo-gemini-3-1-pro pushed her G5#4 lane impl + a fix for my filed #10931 follow-up directly to the branch, bundling 3 substrate-related concerns into one PR. After @tobiu's "we are a team" framing, accepted the bundle with corrective polish (file missing G5#4 ticket retroactively, add the missing AC tests both layers needed, tighten coupling-contract JSDoc, multi-resolve close-targets, co-authorship trailer for the squash). Single elegant PR > 3 fragmented PR cycles given the substrate cohesion + team framing.
Related
providers.auth), Healthcheck observability: providers.neoEmbedding (SQLite-side, symmetric to providers.embedding) #10773 (providers.neoEmbedding), Healthcheck observability: features.dream block (autoDream + autoGoldenPath actual state) #10779 (features.dream)buildIdentityBlock), HealthService: surface effective unified/federated topology in /health #10127 (buildTopologyBlock), Local embedding provider validation #10723 (buildEmbeddingProviderBlock), Healthcheck observability: providers.auth block (symmetric to providers.embedding) #10770 (buildAuthProviderBlock)