LearnNewsExamplesServices
Frontmatter
id16838
titleHeap-observation topology guard cannot bind source identity
stateOpen
labels
bugaitestingarchitectureagent-os
assigneesneo-opus-ada
createdAtAug 9, 2026, 11:28 PM
updatedAtAug 11, 2026, 4:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/16838
authorneo-gpt-emmy
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Heap-observation topology guard cannot bind source identity

Open Backlog/active-chunk-14 bugaitestingarchitectureagent-os
neo-gpt-emmy
neo-gpt-emmy commented on Aug 9, 2026, 11:28 PM

Context

PR #16811 fixes a real deployment defect: its two Compose deltas give the KB/MC reporters one shared heap-observation volume and the orchestrator the same volume read-only in both canonical and parity profiles. Exact-head rendered configuration at 7d041fe733 proves the runtime topology is correct.

The PR also adds a 538-line static topology guard. After five repair cycles, that guard still accepts two independent whole-file mutations that change the production authority while leaving all five focused tests green. The failure is now in the inference substrate, not in one more missing syntax case.

The Problem

At exact head 7d041fe733:

  1. Replacing the authoritative declaration with

       var planeDataRootDefault = resolvePlaneDataRoot({rootDir: neoRootDir});
    var planeDataRootDefault = neoRootDir;

    is valid JavaScript (node --check exits 0), moves the executed heapObservation.dir default from <repo>/.neo-ai-data/heap-observation to <repo>/heap-observation, and leaves the focused guard 5/5 green. findModuleConst() accepts any VariableDeclaration, returns the first matching declarator, and proves neither const nor uniqueness.

  2. Renaming the exported KB server's real hook to getHeapObservationServiceKeyDisabled() and adding an unrelated top-level decoy class with getHeapObservationServiceKey() { return 'kb-server' } is also valid JavaScript and leaves the guard 5/5 green. The production server falls back to BaseServer.getHeapObservationServiceKey() => null, but the census scans every ClassBody in the file and attributes the decoy to the server directory.

Both directions are silent permission failures: the guard reports that the source/config authority is bound when it is not.

The Architectural Reality

  • ADR-0019 makes the resolved AiConfig leaf the configuration source of truth. A parallel parser may validate syntax, but it cannot substitute a same-named declaration for the binding production executes.
  • Reporter identity belongs to the actual exported server class (or a first-class production registry), not to any class body located in the same file.
  • The current Compose repair is independently correct. This ticket owns only the proof instrument that must prevent a future regression.
  • Structure-map places the guard beside the existing deployment topology specs in test/playwright/unit/ai/deploy/; placement is not the defect.

The Fix

Replace the file-wide semantic approximation with authority-bound inputs:

  1. Bind the expected path to the executed canonical config descriptor, or to a structurally unique exported declaration whose exact binding is also consumed by production. Do not accept “first declaration with this spelling.”
  2. Bind reporter discovery to the class actually exported by each server module, or introduce one canonical reporter registry/metadata surface consumed by both production and the topology guard. Do not infer ownership from every class in a directory-named file.
  3. Reduce the AST scanner's semantic surface. Adding another list of syntax exceptions without binding the production identity does not satisfy this ticket.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
heap-observation default path in the topology guard executed ConfigBase descriptor / uniquely bound production declaration guard observes the same binding production executes fail closed on ambiguous or duplicate declarations guard JSDoc duplicate-var mutation reds
reporter roster in the topology guard exported server class or canonical production registry one exported producer identity maps to one Compose service fail closed on decoys, ambiguous exports, or unresolved identity guard JSDoc decoy-class mutation reds
current Compose topology #16810 replacement PR unchanged RW/RW/RO mounts in base and parity none Compose comments exact rendered config

Decision Record impact

Aligned-with ADR-0019. This does not amend the Provider model; it removes a test-side parallel authority that only approximates it.

Acceptance Criteria

  • The duplicate-var planeDataRootDefault mutation is valid and makes the focused guard red.
  • The disabled-exported-hook + unrelated-decoy-class mutation is valid and makes the focused guard red.
  • Existing missing-writer, writable-reader, wrong-target, parity-path, private-key, and computed-key witnesses remain discriminating.
  • Baseline focused tests and exact rendered canonical/parity topology remain green.
  • The repair binds an actual production authority and reduces or removes file-wide AST inference; it does not add another syntax-only exception layer.
  • The #16810 Compose repair remains independently mergeable and is not coupled to completion of this guard successor.

Out of Scope

  • Changing the heap-observation wire format, cadence, or L3 live receipt.
  • Reworking the already-correct Compose mount direction.
  • Generalizing a repository-wide JavaScript semantic analyzer.

Avoided Traps

  • Cycle 6 by accretion. More AST cases preserve the false premise that file-local syntax equals runtime identity.
  • Throwing away the runtime fix. The two Compose deltas are salvageable and should land separately under #16810.
  • Calling green CI authority. Baseline and both false-green mutations are green; the mutation population is the evidence.

Related

#16810 · PR #16811 · #16763 · ADR-0019

Live latest-open sweep: checked the latest 20 open issues on 2026-08-09; no equivalent found. A2A in-flight sweep: checked the latest 30 messages across read states immediately before creation; no competing claim found. Knowledge Base and repository content sweeps found adjacent #15800/#15932 authority lessons but no duplicate.

Origin Session ID: 878f05af-2c4e-4da2-a5c2-9e4af666fcb8

Retrieval Hint: query_raw_memories("PR 16811 heap observation topology guard duplicate var decoy exported server false green")

tobiu referenced in commit 6f6c9ca - "fix(deploy): give the heap-observation channel a shared mount (#16810) (#16839) on Aug 10, 2026, 12:37 AM
tobiu unassigned from @neo-gpt-emmy on Aug 10, 2026, 10:29 PM