Context
The Institution's FleetPermanenceMatrixRow4NL saves the live Fleet dock document through the real writer with perspectiveStore.savePerspective(record, {activate: false, replace: true}) into an empty library. It has been refused since at least engine pin 9 (retained on neomjs/neo-agent-institution#10, 2026-09-14): ["activeLayoutId must name an existing layout when layouts are present"]. The refusal reproduces on engine 2965d82 and on dev a50ae57ce8 (neomjs/neo-agent-institution#274).
The Problem
savePerspective's activate option is documented as "Point activeLayoutId at the saved record". Into an empty library, activate: false leaves activeLayoutId: null with one layout present. The whole-candidate validator (PerspectiveLibrary's collection check) refuses exactly that state, so the option can never succeed on the first save. The caller gets saved: false and an error that names an invariant it could not have satisfied. Every product caller today activates (the Institution's CockpitPerspectives and cockpit controller, the engine's DockService), so the defect is latent. PerspectiveLibrary.spec only uses activate: false after an activating first save.
The Architectural Reality
src/dashboard/dock/persistence/PerspectiveLibrary.mjs#savePerspective already resolves one dangling pointer: a replaced active holder hands its activeness to the replacement, "rather than leaving the pointer dangling (the whole-candidate validator would reject)". An empty library's null pointer is the same case. The saved record is the only layout, so it is the only valid active one.
The Fix
In savePerspective, a candidate whose activeLayoutId is still null after the save takes the saved record as active, whatever activate says; activate: false keeps meaning "do not move an existing pointer". Update the option's JSDoc to say so.
Acceptance Criteria
Out of Scope
- Relaxing the collection validator: a non-empty library keeps its active record.
Related
neomjs/neo-agent-institution#274, neomjs/neo-agent-institution#10. The perspective-selection contract is ADR 0029 (#18606 / #18618).
Live latest-open sweep: the latest 20 open neo issues at 2026-09-27T00:39Z hold no equivalent; gh search for savePerspective / activeLayoutId finds none. A2A: none in the last 30 messages. Memory Core: the 09-14 pin-9 observation is the only prior record.
Origin Session ID: 6408fcd4-3571-4ec2-8009-b4dae5d18917
Retrieval Hint: "savePerspective activate false empty library activeLayoutId refused"
Context
The Institution's
FleetPermanenceMatrixRow4NLsaves the live Fleet dock document through the real writer withperspectiveStore.savePerspective(record, {activate: false, replace: true})into an empty library. It has been refused since at least engine pin 9 (retained on neomjs/neo-agent-institution#10, 2026-09-14):["activeLayoutId must name an existing layout when layouts are present"]. The refusal reproduces on engine2965d82and on deva50ae57ce8(neomjs/neo-agent-institution#274).The Problem
savePerspective'sactivateoption is documented as "PointactiveLayoutIdat the saved record". Into an empty library,activate: falseleavesactiveLayoutId: nullwith one layout present. The whole-candidate validator (PerspectiveLibrary's collection check) refuses exactly that state, so the option can never succeed on the first save. The caller getssaved: falseand an error that names an invariant it could not have satisfied. Every product caller today activates (the Institution'sCockpitPerspectivesand cockpit controller, the engine'sDockService), so the defect is latent.PerspectiveLibrary.speconly usesactivate: falseafter an activating first save.The Architectural Reality
src/dashboard/dock/persistence/PerspectiveLibrary.mjs#savePerspectivealready resolves one dangling pointer: a replaced active holder hands its activeness to the replacement, "rather than leaving the pointer dangling (the whole-candidate validator would reject)". An empty library's null pointer is the same case. The saved record is the only layout, so it is the only valid active one.The Fix
In
savePerspective, a candidate whoseactiveLayoutIdis stillnullafter the save takes the saved record as active, whateveractivatesays;activate: falsekeeps meaning "do not move an existing pointer". Update the option's JSDoc to say so.Acceptance Criteria
savePerspective(record, {activate: false})into an empty library saves and makes the record active (aPerspectiveLibrary.specarm, red on dev).activate: falsestill leaves the pointer where it was (the existing arms stay green).FleetPermanenceMatrixRow4NLpasses. Owner: neomjs/neo-agent-institution#277 (the pin that carries this fix; #274 closes with its PR first).Out of Scope
Related
neomjs/neo-agent-institution#274, neomjs/neo-agent-institution#10. The perspective-selection contract is ADR 0029 (
#18606/#18618).Live latest-open sweep: the latest 20 open neo issues at 2026-09-27T00:39Z hold no equivalent;
gh searchfor savePerspective / activeLayoutId finds none. A2A: none in the last 30 messages. Memory Core: the 09-14 pin-9 observation is the only prior record.Origin Session ID: 6408fcd4-3571-4ec2-8009-b4dae5d18917 Retrieval Hint: "savePerspective activate false empty library activeLayoutId refused"