Files

4.7 KiB

Row 189: stack-release.sh activate --no-send

Gitea #1687. Vikunja P19 #413 (Q175 interim, #412). Brief: docs/plans/2026-10-20_activate-no-send.md. Rulings: mos-0972 (the Console runs without --send until Q175 phase 2), mos-0973 (go; Sage builds, Dewey reviews; gate is the cli suite plus every scripts/test-*.sh). Base: def2e7932 (refactor, the brief commit on 9ae8c73ac).

What it does

activate ID BUSINESS --no-send drops --send from RUN_CONSOLE in a new send_for_target, which console_for_target calls after proof_for_target. install_stack renders the unit from RUN_CONSOLE and write_pointer writes the pointer from it, so both lose the flag and flags_drift stays quiet afterwards. Only activate takes the flag; the parser sends every other op to usage (exit 4).

check_target lets a --no-send activate name the pointer's copy only when the pointer's Console flags hold --send. That run is a live-copy re-pin, the same path row 187 uses for the proof pair: the plan prints the live-copy note, the run stops both units, backs up the stopped store and starts them again. A plain same-copy activate, or a same-copy --no-send once --send is gone, still refuses already-active.

--plan prints one send: line after the proof: line, for activate and rollback:

  • send: dropped; --no-send was given
  • send: off; --no-send was given and the pointer holds no --send
  • send: carried (the pointer's --send goes on unchanged)
  • send: off

The steps log gets drop --send; --no-send was given, or --no-send was given and the pointer holds no --send, so there is nothing to drop.

Rollback and pm-on carry the pointer's flags as they are, so once --no-send has run, nothing adds --send back. There is no re-enable flag (mos-0973). Q175 phase 2 changes the Console flags in its own row.

docs/TOOLS.md: [--no-send] in the usage block and one paragraph after the proof paragraph.

Tests (packages/cli/tests/stack-release.test.mjs, T55)

  1. Seeded preview pointer with --send --tester-port 7333: a same-copy activate B acme --no-send passes. The pointer and the unit ExecStart lack --send and keep the other flags in order, status says the unit flags match, the steps log has the drop line, the log line has from = to = B and the backup sum equals the stopped store's, and the units stop and start in order.
  2. Plain same-copy activate, with --tester-port and with --no-proof, refuses already-active. So does a same-copy --no-send once --send is gone, and on a pointer that never held it.
  3. The four send: lines, the live-copy note on the same-copy plan only, and the Console line right after send: without --send. The run on a pointer with no --send logs the nothing-to-drop line and no drop line.
  4. After --no-send on C1, a rollback to B leaves --send out of the pointer and the unit, the steps log never names --send, and status matches. pm-on after activate --pm-after-harness --no-send keeps it off.
  5. --no-send on rollback (with and without --plan), pm-on, status, adopt and rehearse is a usage error with the usage text, nothing written, started or logged. The usage text shows [--no-send].
  6. A pointer holding both the proof pair and --send: the plans for --no-proof, --no-send and both name what each drops and carries. --no-send keeps the pair, --no-send with a new pair replaces it, --no-proof keeps --send, and both together leave neither. Status matches after each.

planTail gains 'send: off' after 'proof: off', because every plan now prints the line. T36 takes out.slice(-n) around planTail, so its four slice counts grow by one.

Mutants

mutants.sh in this packet, run on the candidate. Each mutates scripts/stack-release.sh and runs T55 plus T1 and T2.

  • M1: the same-copy exception ignores --no-send.
  • M2: the same-copy exception allows --no-send without --send in the pointer.
  • M3: with --no-send, the pointer is written from P_CONSOLE, so it keeps --send while the unit drops it.
  • M4: rollback re-adds --send.
  • M5: the parser accepts --no-send for rollback.

Results: mutants-run.log, all five killed (M1 5 failures, M2 2, M3 7, M4 2, M5 2).

Deviations from the brief

  • The brief's line numbers were taken before row 163 landed. The candidate corrects them to the 9ae8c73ac lines (check_target :249-256, flags_drift :646-657, console_for_target :664-693, adopt :828).
  • Test 5 also covers rehearse and rollback --plan, which the brief did not list.

Outbound calls

None. The change edits an array before the existing unit render and pointer write. Every test uses the stand-in systemctl, units, stores and data root the file already builds; no test touches ~/.mosaic-dev, the live units or a slot file.