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:
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.
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:
- 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.”
- 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.
- 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
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")
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
7d041fe733proves 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:Replacing the authoritative declaration with
var planeDataRootDefault = resolvePlaneDataRoot({rootDir: neoRootDir}); var planeDataRootDefault = neoRootDir;is valid JavaScript (
node --checkexits 0), moves the executedheapObservation.dirdefault from<repo>/.neo-ai-data/heap-observationto<repo>/heap-observation, and leaves the focused guard 5/5 green.findModuleConst()accepts anyVariableDeclaration, returns the first matching declarator, and proves neitherconstnor uniqueness.Renaming the exported KB server's real hook to
getHeapObservationServiceKeyDisabled()and adding an unrelated top-level decoy class withgetHeapObservationServiceKey() { return 'kb-server' }is also valid JavaScript and leaves the guard 5/5 green. The production server falls back toBaseServer.getHeapObservationServiceKey() => null, but the census scans everyClassBodyin 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
AiConfigleaf the configuration source of truth. A parallel parser may validate syntax, but it cannot substitute a same-named declaration for the binding production executes.test/playwright/unit/ai/deploy/; placement is not the defect.The Fix
Replace the file-wide semantic approximation with authority-bound inputs:
Contract Ledger Matrix
ConfigBasedescriptor / uniquely bound production declarationvarmutation redsDecision 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
var planeDataRootDefaultmutation is valid and makes the focused guard red.Out of Scope
Avoided Traps
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")