Skip to content

An interrupted first snapshot is normal: say so in the player's words, not as a fault - #154

Merged
AliceLafox merged 6 commits into
mainfrom
fix/first-seen-interrupted
Oct 17, 2026
Merged

AliceLafox merged 6 commits into
mainfrom
fix/first-seen-interrupted

Conversation

@AliceLafox

Copy link
Copy Markdown
Member

Closes #146.

The card's first snapshot is taken one slot per job and resumes on the next connect from the slot it reached. When the pedal left mid-run, the next step met the worker's lifecycle gate, and the refusal reached the banner as an orange error in the core's words: "Record the card's first snapshot: pedal is ejecting — refusing to touch the volume". Nothing was wrong and nothing was lost.

  • A gate refusal is a typed outcome, not a string (app/JobOutcome.h): a job that did not run carries why (the gate's state, or no volume mounted); a job whose work failed carries its error; a throw from the history bookkeeping rides beside the ending without changing it. The worker never runs before/work for a refused job, and a quiet job's refusal is not told (nothing ran, nothing to report).
  • The words (app/JobWords.h): a player's job refused at the gate reads " did not run: the pedal was being disconnected" (one wording per state); a failure keeps its shape; the core's sentence goes to the operations log.
  • The first snapshot's interruption waits in app/FirstSnapshotNotice.h until the pedal's departure is told, then rides on that toast: "Pedal disconnected — back on the looper screen. The card's first snapshot stopped; it will finish next time you connect." Said once, whichever is seen first: the refused step or the scan that saw the pedal go (a Finder eject, a yank, a volume ejected while the pedal stayed in STORAGE). The toast widens for two sentences. The History row's note says "stopped when the pedal was disconnected"; the log line keeps the engineering sentence with the slot the run stopped at.
  • A step that fails for a real reason (the card changed underneath) is still a failure and still reaches the banner.
  • Found on the way: an exception with an empty message thrown inside a job used to end the worker thread silently; every catch site now names it ("the job stopped without saying why", the type in the log).

Tests: job_words_tests 182 (new), banner_tests 60, first_seen_tests 1198 (the refused step, the failed step, the scan-first departure, the preserved-slot case, the resume), pedal_monitor_harness (gate refusal never runs the work, wordless throws). Non-GUI ctest 57/57; the six GUI harnesses 6/6 locally.

For the product owner: the two sentences above are first drafts; the live sequence (Disconnect mid-snapshot, a yank, a Finder eject) is worth one look on the pedal.

Every job that did not succeed reached the banner as `description + ": " +
error`, with whatever the core said. For a job the lifecycle gate refused that
read "Push loop.wav to slot 3: pedal is ejecting — refusing to touch the
volume": right for a log, wrong for a window, and it hid the one fact that
mattered — nothing had run (issue #146).

JobOutcome is the ending as a value: success, a failure of the job's own work,
or the gate's refusal with the state it refused in, the core's sentence kept as
the log text. JobWords turns it into sentences: a refusal is "<job> did not
run: <why>", one wording per state the gate refuses in; a failure keeps the
shape it always had; the first snapshot's interruption has its own quiet
sentence for the toast and an engineering line for the log. Asking for a
banner line for a success, or the interruption's words for a failure, is a
caller bug and throws. Both headers are JUCE-free, and job_words_tests proves
the table from the issue's spec.
…the banner

The worker threw the gate's refusal as an Error, and the same string travelled
through `after` and onJobResult as if the job had failed. It had not: neither
`before` nor `work` ran and the card was not touched. The gate now produces a
JobOutcome::refused with the machine's state, a throw from `work` a
JobOutcome::failure, and both hooks take the outcome instead of a sentence. A
throw from `after` is still appended to the error, and turns a refusal into a
failure to tell: a history problem must reach the banner whatever the job did.

A quiet job reports only failures, and a refusal is none, so the first
snapshot's refused step and the card-name read the pedal left behind no longer
raise a banner at all; their `after` still learns the refusal, which is what
the first snapshot resumes from, and the card-name read traces the core's
sentence instead. The player's own jobs are told every ending, as before.

pedal_monitor_harness checks the ghost refusal as a typed ending, that neither
hook ran, and that a quiet job's refusal is not told; first_seen_tests drives
the first snapshot's two endings — refused and failed — and the words for
each.
…d job as one that did not run

A player who connected and disconnected again within the first snapshot's run
saw an orange banner: "Record the card's first snapshot: pedal is ejecting —
refusing to touch the volume". Nothing was wrong and nothing was lost — the
snapshot resumes on the next connect from the slot it reached — and the
sentence answered none of a player's questions (issue #146).

The refused step is now told once, as information: a toast saying the snapshot
stopped when the pedal was disconnected and will finish next time, because the
toast is the app's channel for news and the status line is the disconnect's at
that moment. The operations log gets the engineering line, "first snapshot
interrupted at slot N: pedal is ejecting — refusing to touch the volume", so
the Connect/Disconnect trace still explains itself. A step that fails on its
own — the card changed underneath, a read error — is still a failure and still
reaches the banner as before.

Every other job the gate refused — a push, a trim, a rename asked while the
pedal was leaving — keeps its banner, since the player's own job did not run,
but reads "<job> did not run: the pedal was being disconnected", with the
core's sentence in the log.
The refused step ends while the lifecycle is still ejecting, so its toast went
up a second before "Pedal disconnected — back on the looper screen" replaced
it, and the player never read what happens next (issue #146).

The interruption now waits in a FirstSnapshotNotice until the departure is
told. The app-driven Disconnect says both at once — "Pedal disconnected — back
on the looper screen. The card's first snapshot stopped; it will finish next
time you connect." — and the sentence no longer repeats that the pedal left.
Where the departure had no toast of its own (a yank cleaned up, a Finder
eject, a volume ejected while the pedal stayed in STORAGE), the lifecycle line
and the status told it, and the sentence stands alone on the first scan
without the pedal. Said once: a second disconnect without a new interruption
says only its own sentence, and a new connection resumes the snapshot and
forgets. The log line at refusal time is unchanged.

Two sentences do not fit the strip the toast always drew, and drawText would
end them in an ellipsis: the toast now owns its width, widening around the
anchor its owner gives it as far as the window allows, and one sentence's
width again for the next short one.
…al whole

The review of the first-snapshot change found the interruption lost on every
path where a scan sees the pedal gone before the refused step completes: the
scan cancels the run, the step's completion returns on `cancelled`, and since
a quiet refusal is no longer told by the worker, nothing said or logged it —
always for a Finder eject, a volume ejected while the pedal stayed in STORAGE
or a yank the probe saw first, and under a busy message thread for the app's
own Disconnect. FirstSnapshotNotice now has two ways in: the step's own
completion, and `departed`, called from the scan before the run is cancelled
with the state it saw and the slot reached. Whichever comes first logs the
line; the other is not news, so it is said once either way.

JobOutcome is a class built by its factories only — an open aggregate let a
success be refused at once. A job that did not run carries its reason: the
gate's four states, and now the volume that was there at the last scan and is
not when the job runs, which went down the failure path although nothing had
run either. The history's own failure, a throw from `after`, travels beside
the ending instead of folding a refusal into a plain failure: the banner says
"<job> did not run: <reason>; the history could not record it: <e>", the
trace keeps the refusal, and a quiet job is told when that happens.

A `std::exception` whose `what()` is empty made JobOutcome::failure throw
inside the handler, and a throw out of run() ends the worker thread with no
`after`, no result, no busy(false) and no job or scan ever again. The worker
names such a throw by its type instead, with an assertion, and the harness
proves the job behind it still runs.

The History row of an interrupted snapshot read the core's sentence after the
take's name; it reads "stopped when the pedal was disconnected" now, while the
core's sentence stays in the operations log. A departure sentence that already
ends in a period gets no second one, and a refused Undo or Redo settles with
the banner's words rather than the core's.
…s type out of the banner

The eject starter's catch site still built its failure from `what()` directly,
so a throw without a message there ended the worker thread the way a job's
would have; it goes through the same naming now, and the harness proves a job
behind it still runs. That naming put the mangled type into the player's
banner: the banner now says "the job stopped without saying why", and the type
travels as the failure's detail, for the operations log only.

The departure's log line took the slot reached from the store's count of
recorded slots, which a foreground write preserving a slot ahead of the run
raises past the step: count 7 after step 6 with slot 50 preserved said "slot
8" where the refused step was 7. The run keeps the last slot a step
photographed, and the line names the one after it.

failed() is the job's own ending again — it ran and its work failed — so a
success whose history threw is neither failed nor ok, as the header promised;
told() still speaks up for it. A departure that ends in an ellipsis, "!" or
"?" gets no second period either.
AliceLafox added a commit that referenced this pull request Oct 10, 2026
…s the whole text or none

A quiet job's refusal at the worker's gate is not told since #154, so the single-slot Normalize step, written against the old worker, ended in silence when the pedal was leaving. endNormalizeStep now says it in the words every refused job uses.

targetlufs::parse read a number off the front of anything: a hand-edited "-18,5" became -18 and "-18 LUFS" passed for -18. The whole text must now be the number. An empty stored target is said as empty rather than as "()".
@AliceLafox
AliceLafox merged commit 5a06f38 into main Oct 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An interrupted first snapshot is normal: stop reporting it as a fault, in words meant for the code

1 participant