Crew Cards: What Goes in the Log
Design problem and decision
- Design problem Many things happen in an app: settings change, scores are accepted, messages are sent, attempts are retried. A team that logs all of it gets a trace nobody can replay. A team that logs none of it cannot prove a card was issued.
- Architect's decision Which accepted changes become Rechain actions in each actor, what does each action carry, and what does a reply hand back as its receipt?
- Outcome The viewer can sort candidate changes into
logandnot logwith one question, say how state and a block relate, specify a committed receipt, and explain why replay rebuilds local state without repeating a remote call. - Starting point Lesson 3 left both canisters with their doors. School chain tip
117. Registry chain tip040. - Handoff Lesson 5 draws the workflow that brings an
Issuerequest to the registry. - Pacing Four and a half minutes.
Worked design
Crew Cards is illustrative.
The sort
| Candidate | Tray | Why |
|---|---|---|
Score(344, 12, 91, 70) |
log, school | An accepted academic fact that may be questioned. |
OpenAward(7, 340, 12) |
log, school | The roll now says Mira's award is open. It changes what she may ask for next. |
Issue(harbour, 7, 340, 12) |
log, registry | The public record of a card. |
Suspend(harbour) |
log, registry | It changes what every later Issue is allowed to do. |
set_pass_mark(70) |
not log | A setting. The value that mattered rides in each Score. |
"attempt 2 of IssueCard" |
not log | Workflow progress. Takt saves it. |
| "delivery ACK from the registry" | not log | Transport. Reactor saves it. |
| "award 10 timed out" | not log | Not a decision by any owner. Nothing was accepted. |
The registry at 09:00, looking ahead
Lesson 5 draws how the request gets here. This film watches it from inside the registry.
| Reducer | Before | Checks | After |
|---|---|---|---|
standing |
harbour Good, courses {12}, issued 5 |
harbour is Good and accredited for 12 |
issued 6 |
cards |
valid 31 | award (harbour, 7) has no card and the next number is free |
card 41: 340 · 12 · harbour · award 7 · Valid. valid 32 |
One dispatch of Issue(harbour, 7, 340, 12) forges block 041. The reply is the committed receipt Issued{card 41, block 41}.
The school's roll chain by 09:01, looking ahead
116 Enroll(344, 12) · 117 Score(344, 12, 91, 70) · 118 OpenAward(7, 340, 12) · 119 CloseAward(7, 41)
The story in one pass
Deal eight candidate changes into two trays. Go into the registry and run one Issue through the machine: two reducers accept, both changes land, one block forges. Watch the receipt leave. Follow that receipt into the school's own chain. Then replay the school's chain from its blocks and see the channel to the registry stay dark.
Views and visual objects
Use the shared visual language. This film introduces SortTray.
| View | Framing and anchor |
|---|---|
sheet |
The SortTray over the left third: a column of candidate pills and tags, and two trays labeled log and not log. The map sits dimmed at right. |
registry |
As in lesson 3. The canonical machine is at readable size: dispatch, the symmetric fork, enlarged reducers standing and cards each with its selector badge and state folder, the prepared commit row, the chain with tip 040. |
map |
Both canisters. Used for the receipt and the replay. |
Scene sort — One question
Already on screen The map view from lesson 3, both canisters with doors.
Beat the_question — What the log is for
View and focus sheet.
Narration
Each actor can keep a Rechain log. It is tempting to write everything into it. Don't. The log is the history of changes this actor accepted, in order. One question decides what goes in. Will someone later need to verify this, or replay it?
Cue and animation On “a Rechain log”, a short canonical chain row draws under each dimmed canister. On “One question”, the SortTray slides in with its two empty trays and the question written above them: verify or replay later?
Leaves with Two empty trays and eight candidates in a column.
Beat deal_in — Accepted domain changes
View and focus sheet. Focus on the log tray.
Narration
A score: yes. A student may dispute it. An open award: yes. It changes what Mira may ask for next. An issued card: yes, that is the public record. A suspension: yes. It decides what every later request is allowed to do.
Cue and animation On each named candidate, its warm action pill slides into the log tray: Score(344, 12, 91, 70), OpenAward(7, 340, 12), Issue(harbour, 7, 340, 12), Suspend(harbour). The first two settle on the school side of the tray and the last two on the registry side.
Leaves with Four pills in log, two per actor.
Beat deal_out — What stays out
View and focus sheet. Focus on the not log tray.
Narration
The pass mark setting: no. The mark that mattered already rides inside each score. A retry of a remote step: no. That is the workflow's progress, and Takt keeps it. A delivery acknowledgement: no. That is transport, and Reactor keeps it. A timeout: no. Nobody accepted anything.
Cue and animation On each named candidate, its plain grey tag slides into not log. On “Takt keeps it”, a small Takt node card icon marks that tag. On “Reactor keeps it”, a small tunnel icon marks that tag. On “Nobody accepted anything”, the last tag settles and the log tray pulses once.
Hold PauseAndExplain pointing at the log tray. The balloon reads:
In the log
a change an owner accepted
with everything needed to check it again
Not in the log
settings, attempts, deliveries, timeouts
Leaves with Four pills in log, four tags in not log. The sheet slides away.
Scene one_issue — State and block move together
Already on screen The map view.
Beat enter_registry — Two reducers, one chain
View and focus map to registry.
Narration
Look ahead to nine o'clock, inside the registry. The school has asked for Mira's card. The next lesson draws how that request travels. Here, it has arrived at its door, and the door has let it in. Two reducers share this chain. Standing owns each school's status. Cards owns every card.
Cue and animation On “inside the registry”, the camera moves into the registry. On “arrived at its door”, the pill Issue(harbour, 7, 340, 12) sits just inside the card.issue door at the machine's input slot. On “Standing owns”, the standing reducer brightens, showing harbour Good and issued 5 with badge selector standing. On “Cards owns”, the cards reducer brightens, showing valid 31 with badge selector card.
Leaves with The action pill at the input slot. Chain tip 040.
Beat both_accept — Every reducer first
View and focus registry. Focus on the fork and the two reducers.
Narration
Dispatch sends the action to both. Standing checks its own state. Harbour is in good standing and accredited for course twelve. Cards checks its own records. This award has no card, and the next card number is free. Both reducers prepare their changes before either writes.
Cue and animation On “to both”, the pill enters dispatch and copies travel both branches of the fork. On “accredited for course twelve”, a prepared commit tile leaves standing into the row beneath. On “the next card number is free”, a second tile leaves cards and lines up beside the first. On “before either writes”, both state folders pulse once, unchanged.
Leaves with Two prepared commit tiles in the row. State unchanged.
Beat commit_and_block — Both land, then the block
View and focus registry. Focus on the state folders, then the chain.
Narration
Now both prepared changes run. Harbour's issued count goes from five to six. Valid cards go from thirty-one to thirty-two, and the new card is number forty-one. Then the chain gains block forty-one. The state and the block are one step. You never get one without the other.
Cue and animation On “both prepared changes run”, a delta leaves each tile toward its owner. On “five to six”, +1 lands in green beside issued and the value becomes 6. On “thirty-one to thirty-two”, +1 lands in green beside valid and the value becomes 32, and a row 41: 340 · 12 · harbour · Valid descends into the cards folder. Both values update together. On “block forty-one”, the chain slides left one position, holds an empty spot, and block 041 Issue(harbour, 7, 340, 12) forges and links.
Hold PauseAndExplain pointing at the empty prepared commit row. The balloon reads:
If standing had refused
the cards change is discarded
no state moves
no block 041
Leaves with issued 6, valid 32, card 41 Valid. Chain tip 041.
Scene receipt_and_replay — What a block is good for
Already on screen The registry view at tip 041.
Beat receipt — The reply carries a receipt
View and focus registry to map.
Narration
The registry replies with a receipt. Card forty-one was issued in registry block forty-one. That gives the school a reference to the accepted change. Anyone can ask the registry for the card's current public status.
Cue and animation On “with a receipt”, an OutcomeCard Issued{card 41, block 41} lifts from block 041, with a thin line still tied to the block. On “a reference”, the label registry and the index 041 highlight on the card. On “current public status”, the camera pulls back to map, anyone sends verify(41) through the hollow door, and Valid{340, 12, harbour} returns as an OutcomeCard.
Leaves with The receipt card resting at the registry end of the channel.
Beat two_logs — The receipt enters the other log
View and focus map. Focus on the school's chain.
Narration
The school will write that receipt into its own log. Block one-eighteen opened Mira's award. Block one-nineteen closes it, with card forty-one inside. Two actors, two logs, each in its own order. They point at each other. They are never one chain.
Cue and animation On “into its own log”, the receipt card travels the channel to the school. On “Block one-eighteen”, the school chain slides and block 118 OpenAward(7, 340, 12) forges. On “Block one-nineteen”, it slides again and 119 CloseAward(7, 41) forges. On “point at each other”, a thin dotted reference draws from the 41 inside block 119 to registry block 041. On “never one chain”, the two chain rows pulse separately.
Leaves with School tip 119, registry tip 041, one dotted reference between them.
Beat replay — Replay repeats decisions, never calls
View and focus map. Focus on a replay strip under the school.
Narration
Now the question from the start: replay. Take the roll as it stood at block one-fifteen, and feed it the recorded actions in order. Enroll. Score, against seventy. Open award. Close award, with card forty-one. The roll is rebuilt exactly. And look at the channel. Nothing moved. The call to the registry was never in the log. Only its accepted result was.
Cue and animation On “replay”, a replay strip draws under the school: a ghost roll reducer with state as of 115, and blocks 116 to 119 queued at its left. On each named action, that block feeds the ghost reducer and its row updates: 344·12 Enrolled, Passed{91}, 340·12 Awarding{7}, Carded{41}. On “look at the channel”, the Reactor channel and the award workflow region stay dark and a quiet dashed leader points at them. On “Only its accepted result”, the 41 inside block 119 pulses.
Leaves with The ghost roll equal to the live roll. The channel dark. Registry tip 041.
Brief to hand over
Illustrative.
School chain. One chain, one reducer,
roll. Actions:Enroll,Score,OpenAward,CloseAward,RefuseAward.Scorecarries the pass mark in force.CloseAwardcarries the registry's card number when there is one. Keep each ticket's result readable by its owner, including when a refused award is followed by a new ticket.Registry chain. One chain, two reducers,
standingandcards. Actions:Accredit,Suspend,Reinstate,Issue,Revoke. Both reducers must acceptIssue. Record the authenticated school and award number with the student and course. Cards retains the mapping from(school, award)to the original issuance, including after revocation. A card's number is the index of the block that issued it.Not actions. Settings changes, workflow attempts, retries, timeouts, deliveries and acknowledgements.
Receipts.
card.issuerepliesIssued{card, block}. The school associates its public ticket with the committed award and keeps the workflow ID private.
Acceptance checks, expected and not run
| Given | Command | Expect | Then |
|---|---|---|---|
registry tip 040, harbour Good, issued 5, valid 31 |
Issue(harbour, 7, 340, 12) |
Issued{card 41, block 41} |
issued 6, valid 32, card 41 Valid, tip 041 |
registry tip 040, harbour Suspended |
Issue(harbour, 7, 340, 12) |
Rejected(SchoolSuspended) |
issued 5, valid 31, tip 040 |
registry tip 040 |
Issue(harbour, 7, 340, 15) |
Rejected(NotAccredited) |
nothing changed, tip 040 |
roll state as of block 115 |
replay blocks 116 to 119 |
roll equals the live roll | no message leaves the school |
after block 117, pass mark set to 95 |
replay blocks 116 to 117 |
344·12 Passed{91} |
Settings is not read during replay |
| any time | read the school chain | no block holds an attempt, a retry, a timeout or an ACK | — |
Production and source notes
- Crew Cards, the sort and the action lists are illustrative. Which changes to record is an app decision. This course's rule of thumb, verify or replay later, is a teaching design.
- Dispatch prepares once, finishes all expected rejections before committing, and covers history and reducers in one step: Rechain README, lines 3 to 8. Reducers in a tuple all prepare before any commits: Rechain reducer traits.
- A rejection consumes no block ID: Basic Rechain fixture, lines 20 to 21. Dispatch returns the block ID on success: Rechain crate,
DispatchResultat line 80. - An identifier derived from the next block index: Basic Rechain commands,
create. Crew Cards' "card number is its block index" follows that idea and is this course's design. - The stored record must hold what replay needs, and a Reader replays a checked original prefix through an application callback: Rechain README, lines 22 to 29 and 70 to 78.
- Replay needs a starting state and the reducer rules, and replays recorded actions rather than the original decisions: Rechain reference, replay.
- Workflow progress, attempts and timers are not business actions: Takt guide, lines 606 to 608 and 630 to 633. Reactor hashes no application values and keeps its own saved bytes: Orchestration guide, section "Hash contracts".
verifyis the app's card-status projection. The registry also offers a certified chain tip for a client that needs to verify history. A status reply uses the ordinary result card. Rechain certified tips- Chain recording is a per-chain setting in the SDK and can be turned off. Crew Cards records both chains. Do not show the setting.
- This film looks ahead to 09:00. Say so on screen with the small time tag
09:00. Lesson 5 returns to 09:00 and shows the same blocks from the workflow's side. - Follow the workspace rules for the machine: symmetric fork, commit tiles in one unnamed row, deltas land before the block appears, the chain slides and holds an empty spot.
- The replay strip is a ghost copy of the canonical reducer drawn under the school. It is not a new component and it is removed at the end of the film.
- The
standingfolder showsharbour Goodandissued. Thecardsfolder showsvalidand the newest card row. Other rows stay in the model.