Signal snapshots: when one is written, what drift is recorded, and what the lens shows while it is frozen

The 100days [trust] row asks for three things: persist the last complete signal cards so the lens reads without Claude; refresh the affected cards when a new codebook is applied; and record internally that hand edits have drifted from the stored cards, while deferring the user-facing freshness UX. The first two are built. This page is about the third, and about the two moments the design doc leaves open: what the lens shows when it is frozen and no model is configured, and which later events earn a rebuild.

Artefact: what ships, real tokensCommentary: why, cost, risk

Built at HEAD (the doc still says “proposed”)

  • SignalSnapshot row, whole-payload JSON: source, payload_version, computed_at (migrations 023–024).
  • Three writers, all LLM-backed: codebook apply (routes/autocode.py), new interviews after run_completed, and a startup repair when the row is missing or on an older contract version (app.py). A build that cannot narrate every card is skipped and the old row kept.
  • Reader GET …/signals/snapshot never calculates; it filters hidden quotes on read (752cb6b50, 30 Oct) and only ever removes.
  • The lens is withheld while the first report builds; “Picking up Signals…” under the project name (75179d809, fde55d8f2).
  • active_project_groups honours a framework’s enabled state, so the doc’s §1 “split-brain” resolver is done.
  • Export embeds the filtered snapshot; the offline report reads the same cards.

Not built — this page’s remainder

  • No record of drift anywhere: no analysis_revision, no fingerprint, no ledger. The row’s “record that drift internally” is unmet.
  • A framework switched off stays in the frozen cards until the next LLM-backed run (the reader filters quotes, not codebooks).
  • No snapshot and no cloud model: the lens is lit and shows the sentiment-only fallback (bare cards), the state the owner walked and rejected on 30 Oct.
  • computed_at and source arrive at SignalsPage.tsx and are not drawn.
  • The coordinator, outbox, lease and candidate_partial (doc §4) — deliberately out of scope here; the row defers the repair UX.

1 · One study, five moments

The same study through analyse, hand edits, a new codebook, the provider key removed, and a later open. Rows show what the store does today; the last row shows what the recommended drift record (§2, option B) would hold at each moment. Left rules: write a snapshot is written · frozen read as stored · drift inputs moved, snapshot did not.

1 · Analysefirst run completes, 6 sessions
2 · Hand editshide 2 quotes, add a tag to 4, rename a theme
3 · New codebookNorman applied, AutoCode finishes
4 · Key removedSettings ▸ LLM Provider, key deleted
5 · Opened a week laterno model configured
What happens
Re-apply runs, then the snapshot build; lens grey with “Picking up Signals…” until cards exist.
Mutations commit. Nothing in the signals path hears them.
Build runs after the apply; cached narratives reused for unchanged cards, new cards narrated.
No writer can run. Nothing is deleted.
Reader returns the row from moment 3.
Snapshot store
write source new_interviews, v6
frozen row from 1
write source codebook_apply, v6
frozen row from 3
frozen row from 3
What the lens reads
Complete cards, every one with a title and claim.
Same cards; the 2 hidden quotes are gone from their cards on read; the 4 tags and the rename are not seen.
Complete cards incl. Norman; hides still filtered; the rename is now in the heading.
Identical to 3.
Identical to 3. No spinner, no sentence. Export reads the same.
Drift record (§2 B)
rev 12 · since: {}
drift rev 19 · since: {hide:2, tag:4, rename:1}
rev 24 · since: {} (reset at write; the apply’s own tag writes do not count against itself)
rev 24 · since: {}
rev 24 · since: {}
Commentary Moment 5 is already right by construction: a frozen row is a complete report, and the reader does not need a provider to serve it. Moment 2 is the gap the row names: the inputs moved and nothing wrote that down, so a later freshness treatment, a scoped refresh, or even a log line has nothing to read. Moment 4 is a non-event for the store, which is the point of the design, and worth saying in the doc’s status line.

2 · Decision 1 — what counts as drift, and where it is written

Every option writes in the same transaction as the mutation (the doc’s rule), at the five sites that already change signal inputs: a hide or unhide, a tag accepted, denied or hand-edited, a framework switched on or off, a section or theme edit, and a quote edit or removal. Opening the lens is never one. The nearest shipped sibling for “a mutation leaves a durable mark that a later pass reads” is AutoCode’s register of sent quotes (AutoCodeSentQuote): a row per fact, never a timestamp.

A Revision counter

Sibling: data_version on /condition — one integer that says “something changed”.
projects row + snapshot row schema
projects.analysis_revision = 19
signal_snapshots.observed_revision = 12
drift = 19 − 12 = 7 mutations, of unknown kind
Build
S · one column each side, one increment helper, five call sites
Layers
models, migration 025, five mutation routes
Says
whether the snapshot is behind, and by how many acts
Cannot say
which cards, or whether the acts matter (a rename is 1, so is a hide)
Rules out
nothing; B and C can be added on top

B Counter + tally by reason

Sibling: the source breakdown a card already carries (accepted / pending counts): a small typed count, not a log.
one JSON column on the snapshot row schema
projects.analysis_revision = 19
signal_snapshots.observed_revision = 12
signal_snapshots.drift_since = {
  "hide": 2, "tag": 4, "rename": 1,
  "framework": 0, "quote": 0, "last_at": "2026-11-03T14:02Z"
}
reset to {} when a successor snapshot is written
Build
S+ · A plus one JSON column and a six-key enum; the increment helper takes a reason
Layers
as A, plus one serialiser field on /signals/snapshot (undrawn)
Says
how far behind, in what way; enough for a later “tags changed since” line or a log line at build time
Cannot say
which cards (that needs C)
Rules out
nothing; the tally is what a later freshness line would read

C Drift ledger table

Sibling: AutoCodeSentQuote and ImportConflict — a row per fact, pruned by a rule.
signal_drift_events schema
atreasonscope
14:01hideq-p3-412
14:01hideq-p5-88
14:02tagq-p1-26 × group 7
14:02renametheme 3
Build
M · a table, FKs/cascades, a prune rule, and a deletion path (a hidden quote’s id is a re-identification key in an export)
Layers
models, migration, five routes, export classification (SERVER_ONLY), deletion tests
Says
exactly which cards are stale; what the doc’s scoped refresh (§4) needs
Cost of being early
rows nobody reads until the coordinator exists; a second place quote ids live
Rules out
nothing, but pays now for a refresh the row defers

D Fingerprint on read

Sibling: the elaboration cache key — a content hash, computed when asked.
no schema; computed per GET runtime
hash(active groups, counted quotes, accepted tags) at read
≠ snapshot.input_hash → behind
Build
M · a canonical hash over three tables on every read; one column
Layers
reader route only
Says
behind or not; nothing else
Risk
a read stays cheap today (“reads stay cheap”, eee11f91c); this makes every open a three-table walk, and a “rename” flips it the same as twenty tags
Rules out
the “write in the mutation’s transaction” rule the doc sets
Commentary B is A with a name on each act. It costs one more column than A and gives the only datum a later freshness line could honestly print (“4 tags changed since”), and the only datum a build can log (“rebuilt after 7 edits: 2 hides, 4 tags, 1 rename”). C is the right shape for the deferred coordinator and the wrong time: a per-quote table is a second home for quote ids, with the export and deletion obligations that brings, in exchange for a scoping the row says not to build yet. D breaks the doc’s own rule and makes the read pay.

3 · Decision 2 — which events write a snapshot

A snapshot write is an LLM-backed pass: materialise_completed_signal_snapshot builds every card and narrates the changed ones (the elaboration cache returns the rest). The question is which later events earn one. The three that exist stay; the options differ on what is added.

A As today

Writers: codebook apply · new interviews · startup repair. Hand edits never.
Build
S · nothing
Researcher sees
a framework switched off keeps its cards until the next run or apply; its tags are gone from Quotes, present in Signals
Risk
the one visible contradiction between lenses that no read-time filter removes

B Today + framework on/off

Sibling: the same apply-completion hook in routes/autocode.py, called from the framework-state route after its commit.
what the build costs on a toggle measured shape
Switch off: cards for that codebook drop; every other card’s evidence is unchanged → cache hits, 0 model calls.
Switch on (already coded): its cards return; narratives for them were cached at the last apply → 0 model calls unless evidence moved.
No cloud model: the build is skipped as today and the snapshot stays; the drift tally (§2 B) records framework: 1.
Build
S · one call after the framework-state commit, behind the existing begin/end_signals_preparing so a rebuild never greys a lens that has a report
Layers
one route; a lifecycle test (“a disabled framework leaves the next snapshot”, the doc’s invariant 1)
Researcher sees
Signals agrees with Codebook within the build’s seconds; nothing announced
Risk
a researcher toggling to compare pays a build each time; cheap because cached, but busy.working("signals") holds the reaper during it

C Today + debounced refresh after hand edits

Sibling: AutoCode catch-up (autocode_catch_up.py): a debounced background pass a mutation schedules.
Build
L · the doc’s §4 coordinator: outbox, lease, consent gate, interleaving tests
Researcher sees
cards re-rank and re-word a minute after a hide: a signal that moves under the reader
Cost
model calls on every edit burst; the row says this is “not a v1 problem”
Rules out
the frozen contract readers can trust (“the written headline stays as built”, design-signals-follow-hide.md)
Commentary A framework toggle is not a hand edit: it changes the analytical vocabulary, the one thing the follow-hide filter cannot subtract, and it is already an LLM-adjacent act (the apply that coded it). It is also nearly free, since every other card hits the narrative cache. That is why B is the one addition worth making now, and C is the one the row explicitly defers.

4 · Decision 3 — what the lens shows while frozen and no model is configured

Three states. The first two are the same cards with and without a datum line; the third is the empty case. The nav, heading and card anatomy are the shipped ones (signals.css, design A); the quote rows are drawn as bars so no participant speech appears here.

V0 · frozen, drift recorded, nothing drawnrecommended now

Checkout

Problem · strong
Delivery slot costs read as a penalty

Five of six participants treated the slot fee as a charge for being late rather than a price for a time.

Four describe it as an extra charge, two compare it with a parking fine; the one dissenter had used a competitor’s free slots.

p1 · 04:12
p3 · 11:40
p3 · 12:02
p5 · 02:55
Show all 7 quotes →
CommentaryThe struck row stands for a quote hidden after the build: it is gone on read (shipped). Nothing else changes. The 4 tags added since are not seen and not mentioned. This is the row text (“defer the user-facing freshness UX”) drawn literally, and it is already what HEAD does — once §2 B lands, the only new thing is a tally nobody sees.
V1 · a datum line, date onlylater, if wanted

Signals from 3 Nov 2026

Checkout

Problem · strong
Delivery slot costs read as a penalty

Five of six participants treated the slot fee as a charge for being late rather than a price for a time.

Four describe it as an extra charge, two compare it with a parking fine; the one dissenter had used a competitor’s free slots.

p1 · 04:12
p3 · 11:40
p5 · 02:55
Show all 6 quotes →
CommentaryOne line, page level, in the muted caption that the heatmap pane’s “Based on N tags” banner already uses. It reads computed_at, which is on the wire and undrawn today, through format_finder_date (register: docs/design-shared-formats.md). Owner-written draft string, one key in 21 locales. It is not news on a study nobody has edited, which is why it is a later step, and why the variant below adds the clause only when there is one.
V2 · the datum plus the drift tallylater; needs §2 B

Signals from 3 Nov 2026 · 4 tags and 1 heading changed since

Checkout

Problem · strong
Delivery slot costs read as a penalty

Five of six participants treated the slot fee as a charge for being late rather than a price for a time.

CommentaryThe clause appears only when the tally is non-zero, in the house pattern of the tag sidebar (“no wall of zeros”, W04). It still offers no verb: the row defers the regenerate control, and a sentence that names a problem with no remedy is the needy shape the owner rejects. If this is ever drawn, hides are left out of the clause — they are already followed on read, so saying “2 quotes hidden since” would describe something the card already shows.
V3 · no snapshot and no modeltoday lit; proposed withheld
Sessions lens here. Signals is dim and unclickable, as it is during a first run. No sentence under the project name: nothing is being prepared.
CommentaryToday lens_readiness withholds Signals only while a build is pending, so a study with no report and no model gets a lit lens over the sentiment-only fallback — the bare cards the owner saw on 30 Oct, now permanent. The fix is one more input to lens_readiness: withheld when no snapshot has cards and no cloud model is configured. The reason is already on the popover (“No AI provider is set up yet.” with Set Up Provider…, entry M18-B08-B06), so no new string. An exported report never reaches this state: export is refused while a lens is withheld.

5 · Comparison

QuestionOptionsPickWhy
What is drift, where writtenA counter · B counter + tally · C ledger · D hash on readBWrites in the mutation’s transaction; one column more than A; the only honest datum for a later line; no second home for quote ids
Which events write a snapshotA today · B + framework on/off · C + debounced hand editsBA toggle changes vocabulary, which no read filter can subtract; near-zero model cost through the narrative cache; C is what the row defers
Frozen, model goneV0 nothing · V1 date · V2 date + tally · V3 withhold when no report and no modelV0 now, V3 now, V1/V2 laterV0 is the row text and HEAD’s behaviour; V3 closes the one state the owner already rejected; V1/V2 are the deferred freshness UX, drawn so the data model keeps room for them
Doc statusproposed · partial, truedtrue itSix of its parts ship; a reader of the doc today would re-propose the reader contract
Recommendation. Record drift as a revision counter with a per-reason tally on the snapshot row (§2 B), written at the five mutation sites and reset by every write. Add the framework on/off hook as a fourth writer (§3 B), reusing the apply-completion path and the preparing flag. Draw nothing new on the lens (V0) except the readiness change for the empty, model-less study (V3). Leave V1/V2 as the deferred freshness UX, with the fields they would read already on the wire. Then true the design doc to “partial” and move its component plans A–E into a built/not-built table.
  1. Migration 025: projects.analysis_revision, signal_snapshots.observed_revision, signal_snapshots.drift_since (JSON, six keys). signal_snapshots.note_drift(db, project_id, reason), called in the same transaction by hide, tag, framework-state, heading and quote routes. Build logs the tally it is replacing. Tests: each route increments; a write resets; opening the lens does not change it.
  2. Framework-state route: after commit, begin_signals_preparing → materialise_completed_signal_snapshot(source="framework_toggle") → end, only when a cloud model is configured. Test: a disabled framework is absent from the next snapshot; the lens is never greyed over an existing report.
  3. lens_readiness: Signals withheld when no snapshot has cards and no cloud model is configured. Test in test_lens_readiness.py.
  4. Serialise drift_since and computed_at on /signals/snapshot (classified EMBED as the snapshot already is); nothing in the SPA reads them yet.
Open for the owner