feat(linkedin): longform quality rules + edition resumption wiring (S12)

This commit is contained in:
Kjell Tore Guttormsen 2026-05-27 22:30:42 +02:00
commit 8d25dd908e
2 changed files with 223 additions and 45 deletions

View file

@ -109,11 +109,56 @@ the edition left off before doing anything.
premise / freshness rules (e.g. `<serie>/brief.md` or the HANDOVER §3§5).
This anchors angle and scope.
### Deterministic resumption — `currentPhase` → resume step
This command is multi-session: a session may be aborted (context budget, `/clear`,
interruption) at any phase. Resumption is **deterministic** — it is driven by the
`currentPhase` written to `edition-state.json`, never by re-asking the operator
where things stopped. Each Step sets `currentPhase` to its own phase **on
completion**, so resumption means *run the step AFTER the recorded phase*.
Look up `edition-state.json``articles.<currentArticle>` (and the top-level
`currentPhase`) in this table and **jump straight to the resume step**:
| `currentPhase` (last completed) | Resume at |
|---------------------------------|-----------|
| *(no state file)* | **NEW edition** → Step 1 (init state at end of Step 2) |
| `load-context` | Step 1 — Brief + calibration |
| `brief-calibration` | Step 2 — Research |
| `research` | Step 3 — Draft |
| `draft` | Step 4 — Consistency + quality *(see draft-cursor note)* |
| `consistency-quality` | Step 5 — Fact-check sweep |
| `factcheck-sweep` | Step 6 — Persona sweep (pre-lock) |
| `persona-sweep-prelock` | Step 7 — Annotation (optional) → Step 8 |
| `annotation` | Step 8 — LOCK → delivery |
| `lock-delivery` | Step 9 — Hook / conversion gate |
| `hook-conversion-gate` | Step 10 — Scheduling |
| `scheduling` | **Edition complete** — nothing to resume (start the next article or edition) |
The phase identifiers are the canonical ones defined in
`${CLAUDE_PLUGIN_ROOT}/config/edition-state.template.json` (`_doc.phases`); the
Steps below write exactly these strings. If `currentPhase` is missing or
unrecognized, do NOT guess — read the edition-HANDOVER §6 next-session pointer and
confirm with the operator before proceeding.
**Draft-cursor note (Step 3 only).** `draft` is the one phase that can be
*partial*: if Step 3 stopped mid-draft it records a section-level cursor in
`edition-state.json` and a "draft resumes at section <X>" pointer in HANDOVER §6.
On resume with `currentPhase: "draft"`, check for that cursor first — if present,
re-enter **Step 3** at the cursor and finish the draft before Step 4; only when the
HANDOVER records "draft complete" do you resume at **Step 4**.
> **Resumption is the deterministic test (plan §10, archetype E).** Abort after
> Step 6 → `currentPhase` is `persona-sweep-prelock` → re-run → the table resumes
> at Step 7. No operator question, no re-doing the persona sweep. The same holds
> at every row.
Then display a short status:
```
Edition: <series title> — article <currentArticle> "<title>"
Resuming at phase: <currentPhase> (or: NEW edition — starting at load-context)
Last completed phase: <currentPhase> (or: NEW edition)
Resuming at: Step <N> — <step name> (from the resumption table above)
Voice profile: loaded | MISSING
Persona library: <N> personas loaded (active set chosen in Step 1)
```
@ -278,53 +323,38 @@ Run the draft through the long-form quality rules. This is a *tightening* pass
the gap between draft and final is closed by **swapping weaker for sharper and
cutting, not by expansion**; hold the length flat (plan §8).
> **Inlined rules (forward-reference note).** The canonical long-form quality
> rules live in `references/longform-quality-rules.md` — but that file is not
> authored until plan step S12. So the rules are **inlined here now**. When S12
> lands, this block is EXTRACTED to that reference file and replaced with a
> pointer; there is no dangling reference at any point.
> **Canonical rules live in one place.** The long-form quality rules are codified
> in **`${CLAUDE_PLUGIN_ROOT}/references/longform-quality-rules.md`** — read it
> now and apply it. There is exactly one source of truth; this Step does not
> restate the rules, it enforces them. (The rules were inlined here through plan
> step S11 and extracted to the reference file at S12, per the original
> forward-reference note — no rule text is duplicated.)
**Calibration first (a per-sweep user choice, not a default — plan §8):** before
**Calibration first (rule 7 — a per-sweep user choice, not a default):** before
running this pass, confirm fold-in aggressiveness (conservative vs. aggressive),
jargon handling, and — when it matters later — persona weighting on conflict. Ask
once if the Step 1 brief did not already settle it.
Apply each rule and report a pass/flag per rule:
Apply the reference rules and report a **pass/flag per rule**. The operative
checklist (full detail + pass/flag criteria in the reference file):
1. **Threads.** Every thread opened in the ingress/body resolves by the
conclusion — no dropped setups, no orphaned promises.
1. **Threads** *(consistency)* — every thread opened in the ingress/body resolves
by the conclusion; no dropped setups, no orphaned promises.
2. **Leder-takeaway** (rule 1) — ONE takeaway + ONE concrete action; cut references
hard.
3. **Premiss→konklusjon-bue** (rule 2) — ingress-premise == conclusion-premise; the
close grips and twists forward, never just summarizes.
4. **AI-slop-fraser** (rule 3) — strip the Norwegian ban-list on sight (report a
removed-count).
5. **Generell, ikke etat-/person-spesifikk** (rule 4) — opportunities not
provocations; ≤1 structural anchor.
6. **Formaterings-dose** (rule 5) — minimal; no PowerPoint-printout.
7. **Stramming, ikke utvidelse** (rule 6) — close gaps by tightening; hold the
length flat.
2. **Premise→conclusion arc.** The premise set in the ingress (Step 3) is the same
premise the conclusion grips and twists forward. If the draft drifted to a
different premise, realign the conclusion or the ingress — do not leave two
premises.
3. **Leader-takeaway.** The edition lands ONE clear takeaway + ONE concrete action.
Cut references hard; hands-on credibility beats a citation-pile. If the reader
cannot state the takeaway in one sentence, tighten until they can.
4. **AI-slop removal (forbidden phrases — strip on sight).** These are the Seres
ban-list; they read as machine-written and must not appear:
- "her må jeg være ærlig" / "for å være ærlig"
- "ikke bare X, men Y"
- gratuitous three-item listing (rule-of-three as a tic)
- "i en stadig mer kompleks verden"
- tacked-on summary sentences that restate what was just said
5. **General, not org-/person-specific.** No personal agency anecdotes; present
opportunities, not provocations. At most ONE structural anchoring reference per
text — never repeated criticism of a named person.
6. **Formatting dose (minimal).** Bold = at most one point per section. Short lists
(24 items) only where the text already enumerates — never turn load-bearing
reasoning into bullets. Tables sparingly. *"No article should look like a
PowerPoint printout."*
7. **Close gaps by tightening, not expanding.** Swap weaker passages for sharper
ones; keep the length flat.
After the pass, set `currentPhase: "quality"` in `edition-state.json` and append a
"quality pass complete → next: fact-check sweep" pointer to the HANDOVER §6.
After the pass, set `currentPhase: "consistency-quality"` in `edition-state.json`
and append a "quality pass complete → next: fact-check sweep" pointer to the
HANDOVER §6.
```
Consistency + quality pass complete.
@ -398,7 +428,7 @@ because it "feels" right or because it sits in your own research notes.
6. **Persist + checkpoint state.** Write the merged verification log into the
edition-HANDOVER §4 (immutable rules + fact-check log — the durable record of
what was checked), set `currentPhase: "factcheck"` in `edition-state.json`,
what was checked), set `currentPhase: "factcheck-sweep"` in `edition-state.json`,
and append a "fact-check complete → next: persona sweep (BEFORE lock)" pointer
to the HANDOVER §6.
@ -462,7 +492,7 @@ reopening locked texts — the biggest single process error of the series (plan
5. **Persist + checkpoint state.** Record the final per-persona verdicts and the
resolved flags in the edition-HANDOVER §5 (method / persona calibration), set
`currentPhase: "persona"` in `edition-state.json`, and append a "persona sweep
`currentPhase: "persona-sweep-prelock"` in `edition-state.json`, and append a "persona sweep
PASS (primær JA) → next: lock/delivery" pointer to the HANDOVER §6.
```