fix(#1408): mosaic-agent@ condition arms on either home shape #1410

Merged
orch-01 merged 2 commits from fix/1408-unit-condition-brain-home into next 2026-08-25 01:17:16 +00:00
2 Commits
Author SHA1 Message Date
veronica a60ae792ca test(#1408): dispatch spec asserts both triggering condition lines per home shape
ci/woodpecker/pr/ci Pipeline was successful
The conditionPath() helper pinned toHaveLength(1) — a count assertion,
and the count pin was the defect: the unit's second triggering line
(brain-home shape, #1408) failed this spec (CI 2651) because it was a
second consumer of the unit template invisible to the shell suite and
the enumeration guard.

- helper returns ALL ConditionPathExists values, asserts content not count
- literal pin covers both |-prefixed lines in order
- new test: every condition line must keep the | triggering prefix
  (ported from test-fleet-units.sh's bare-ANDed-spelling refusal)
- drift-apart guard now per path: each line renders to exactly the file
  the reconciler writes for that home shape (orch-01 requirement)

Sabotage control: unit reverted to base f45928c fails exactly the three
condition tests; restored unit passes 11/11.
2026-08-24 19:55:09 -05:00
veronica 6dbc61ec46 fix(#1408): mosaic-agent@ condition arms on either home shape
ci/woodpecker/pr/ci Pipeline failed
The reconciler writes seat projections into the brain home when one is active
(~/.mosaic/fleet/agents, mirroring start-agent-session.sh's brain-home
resolution) and into MOSAIC_HOME on a legacy single-tree host. The unit's
single config-home ConditionPathExists therefore skipped every seat on
brain-home estates — measured on two estates independently: 27 projections vs
0 at the config path, and 5 vs 0; the gate never fired on either.

Fix: two TRIGGERING conditions (`|` prefix — same-type conditions otherwise
AND, which can never be true across two paths). Either shape arms the unit;
start-agent-session.sh still resolves the authoritative copy itself.

test-fleet-units.sh now asserts both triggering lines and REFUSES a bare
(ANDing) ConditionPathExists spelling — that regression would disable
autostart fleet-wide while reading as "has a condition". Sabotage-controlled:
unit reverted, suite fails on the first new assertion; restored, green.

Closes #1408
2026-08-24 19:28:28 -05:00