---
description: Stream K4: Review: the proposals file loaded under a named pass, the sheet at /review with spot-checks first, approve per row, per line and all except spot-checks, reject as Keep separate, undo per batch, rehearsed end to end on a CHANEL file and replayed onto a second copy
---

You are running **Stream K4** of the Duty Free Professor catalogue refactor, as an autonomous
session. Start by running `pwd`; it must be
`/srv/apps/dutyfreeprofessor/.claude/worktrees/table-layout-db-structure-1d5bc2` (the refactor
branch's worktree; the checkpoint hook walks up to its `.logs/`), or stop. Confirm with
`git branch --show-current` that you are on `claude/table-layout-db-structure-1d5bc2`.

Read first, in this order: `.logs/planning/streams/OVERNIGHT-RULES.md` (binding; where it says the
cwd must be the workspace root, this worktree is the root for the refactor), then your brief
`.logs/planning/streams/K4-review.md` (it names what already exists; build on it), the accepted plan
`.logs/planning/catalogue-refactor-plan-2026-09-16.md` (section 1's decision for your items, section
9's order), `main/docs/VOCABULARY.md` (the words; a bare "product" is never written), `agents.md`,
`brief.md`, `main/docs/REVIEW-PROCESS.md` (from K0), the top three entries of `.logs/handoff.md`, and
`python3 main/scripts/items.py list --decisions`. Runs: in the Thursday-night wave with K3 and K5; never alongside a collection; writes proposals and decisions only through K2's signatures.

Tell rian as you go with `srv-gw notify --from "K4" "<one line>"`: on start, on each task done with the count, on blocked, and at hand-back (OVERNIGHT-RULES, "Telling rian as you go"). Never put a secret in a message.

Then work the brief's tasks in order, K4.1, K4.2, K4.3, K4.4, K4.5, K4.6, one at a time, each verified and committed and
recorded on `/plan` with `main/scripts/plan-set.py` (`doing` when you start, `done` with a `--note`
that says what proves it, `blocked` with why). Delegate mechanical edits to a cheaper model with
the exact files and the acceptance test and verify the diff yourself; never delegate identity or
matching rules, a security-relevant change, or anything a person reads on a page. Rehearse every
migration and backfill on `dfp-devdb` (127.0.0.1:5433) in a fresh copy of the newest nightly dump and
report the numbers it produced, read from that database. **Never deploy, never touch the live
database, never run a collection.** Stay inside the files your brief lists under Owns; a change you
need elsewhere is an issue on the running list owned by that stream.

## Goal, and exactly when you are done

**Goal:** the load and withdraw CLI, the sheet reads, the approval with its batch and its loud counts, the reject as Keep separate, the undo routes, the /review page with the panel slot for K6 and no cell editor, and the CHANEL rehearsal loaded, approved, undone and replayed onto a second copy with every number in the handoff, to the verified-and-committed standard.

**You are done when ALL of the following are true**, and not before:
1. Every one of these task ids in `import/progress.json` is `done`, or is `blocked` with a
   note saying why: **K4.1, K4.2, K4.3, K4.4, K4.5, K4.6**. (Check with `python3 -c "import json;d=json.load(open('import/progress.json'));print({t['id']:t['status'] for s in d['streams'] for t in s['tasks'] if t['id'] in ['K4.1','K4.2','K4.3','K4.4','K4.5','K4.6']})"`.)
2. `../.venv-dev/bin/pytest tests -q` (from `main/`) passes and `main/check.sh` prints "checks passed" on the
   current tree.
3. Every finished task has its own commit prefixed `K4:` (`git log --oneline | grep "^[0-9a-f]* K4:"`).
4. A handoff entry for this session exists at the top of `.logs/handoff.md` (≤25 lines: what
   landed and how it was verified with the numbers from the rehearsal, any migration id and the
   after-deploy commands in order, what is blocked and why, what rian must do), and `/checkpoint`
   has been run.
5. Anything only rian can decide is on the running list (`python3 main/scripts/items.py add
   --kind decide --by "Stream K4" --blocks <task> --weight ...`) with the assumption you proceeded under.

A task you cannot finish is not a reason to keep going or to stop early: mark it `blocked`
with the reason, record the decision if one is needed, and move to the next. If all tasks
are done or blocked, finish steps 2 to 5 and stop. If eight hours have passed, mark every
unfinished task `blocked` with the note "eight-hour cap; resume with /stream-k4", write the handoff,
run `/checkpoint`, and stop.

## The goal line (rian pastes this after the first turn ends)
Start the session with `/stream-k4`. When that first turn ends, paste this one line:

```
/goal Stream K4 of the Duty Free Professor catalogue refactor is complete: in import/progress.json every one of the task ids K4.1, K4.2, K4.3, K4.4, K4.5, K4.6 has status done, or blocked with a note saying why; main/check.sh has printed "checks passed" on the final tree; every finished task has its own commit prefixed "K4:"; a handoff entry for this session is at the top of .logs/handoff.md naming any migration id and the after-deploy commands, and /checkpoint has been run; anything only rian can decide has been added to the running list with main/scripts/items.py. Or stop after 140 turns.
```
