feat(linkedin-studio): N15 — do-next-kontrakt (recordDoNext + skrivere/lesere + forrige-utgave-kalibrering) [skip-docs]

Måling som ikke endrer neste utgave er teater: report/analyze/ab-test/48h-monitor
endte alle i chat (grep do.next = 0 i hele repoet). N15 gjør kanalen til en kontrakt.

- recordDoNext i hooks/scripts/state-updater.mjs (TDD, 17 nye tester): seksjonen
  Do-Next Directives, rader "[dato] (kilde) direktiv — evidence: peker".
  Levetid = erstatt-per-kilde + 60-dagers aldersgulv, maks 3 per skriv, additiv
  scalar last_donext_date, $-sikre replacement-funksjoner. CLI: --record-do-next.
- Skrivere: report Step 7b, analyze Step 6b, ab-test 2c.6 (kun Adopt),
  post-feedback-monitor (kun 48h-sjekken); analytics-interpreter emitterer nå
  anbefalinger på do-next-form (imperativ + evidens).
- Lesere: post/quick/batch/create Step 0 + newsletter Step 1, som i tillegg
  kalibrerer på forrige utgaves MÅLTE tall via queue-id-match (queue.json →
  analytics/posts) med eksplisitt honest-miss — aldri estimert.
- Guards: test-runner Section 16v (15 ubetingede sjekker, floor 198 → 213),
  $-safety-batteriet dekker recordDoNext (coverage-gate fanget den nye eksporten).

Suiter: test-runner 232/0, hooks 191/0, trends 300/0, brain 134/0, editions 72/0,
specifics-bank 45/0, contract-gate 33/0, tests 35/0, render 60/0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QxvWAjte7vPcF79QeSRvRJ
This commit is contained in:
Kjell Tore Guttormsen 2026-07-25 15:23:35 +02:00
commit b45fdad911
16 changed files with 713 additions and 6 deletions

View file

@ -371,6 +371,39 @@ what genuinely changes the work.
> discovery→production loop automatically at Step 10 (scheduling flips the trend to
> `acted`).
> **Calibration from measurement (A2-F14 — the do-next contract).** Two reads, both
> cheap, both BEFORE the dimensions below. Neither asks the operator anything.
>
> 1. **`## Do-Next Directives` in `~/.claude/linkedin-studio.local.md`.** What the last
> measurement pass (`/linkedin:report`, `/linkedin:analyze`, an A/B Adopt verdict, the
> 48h monitor) decided the next piece should do differently, each row carrying its
> evidence pointer. Apply the ones that apply to long-form and **name them in the brief**
> — a directive that shaped this edition must be visible in the brief, not silently
> absorbed. Never edit or clear the section here (each source manages its own rows).
> 2. **The previous edition's MEASURED numbers — queue-id match.** The prior edition of
> this series was registered at its Step 10 under the stable queue id
> `<series-slug>-<NN1>`. Resolve its numbers:
> - read `${LINKEDIN_STUDIO_DATA:-$HOME/.claude/linkedin-studio}/drafts/queue.json`,
> take the entry whose `id` is `<series-slug>-<NN1>` → its `scheduled_date`,
> `hook_preview` and `status`;
> - read the analytics batches in
> `${LINKEDIN_STUDIO_DATA:-$HOME/.claude/linkedin-studio}/analytics/posts/*.json` and
> select the `.posts[]` row whose `publishedDate` equals that `scheduled_date`
> (a rescheduled edition may be a day or two off — widen to ±2 days and disambiguate
> on a `title` that matches `hook_preview`);
> - carry forward `impressions`, `engagementRate`, `comments` and `saves` (when present).
>
> Read them as calibration, not as a verdict: **low impressions** points at hook /
> topic-relevance (a Step 9 problem for this edition), **decent impressions with weak
> comments** points at resonance (a Step 6 persona problem), and a strong prior edition
> says keep the structure that worked. State the comparison in one line in the brief.
>
> **Honest miss.** No queue entry, no analytics match, or the edition simply is not measured
> yet (`status: scheduled`, or the import has not been run) → say so in one line — *"forrige
> utgave er ikke målt ennå; kalibrerer på skjelett og persona alene"* — and continue.
> **Never estimate** the previous edition's numbers, and never let a missing measurement
> block the brief. This is edition NN=1 of a new series' normal state.
Settle these dimensions (most should come from context, not questions):
- **Angle** — the one premise this edition argues.