feat(linkedin-studio): N7.5 — MR-F9 etterspørsels-sveip (Tier-5-kilder + smertepunkt + vokabular-oversettelse + arc-kontrakt) [skip-docs]

The «innenfra og ut» demand-sweep: the mechanism that FILLS the N6 reader fields
(readerQuestion/painPoint/saturation). Discovery finds "what happened"; this layer
translates it into "the problem the reader is stuck on".

- demand-spotter agent (agents 19->20, inherits session): three passes after
  discovery, before drafting — demand-sweep -> pain-point map -> vocabulary translation.
- Tier 5 demand sources in config/trends-sources.template.md (inverse of Tier 1-4;
  honest blind spots: YouTube API, Reddit approximate, HN/GitHub ground truth).
- demand signal on TrendRecord (strength + answered) — rankable twin of the verbatim
  saturation text; additive-optional, store schema stays v4 (no migration).
- arc.ts (§4 output contract): groupIntoArcs (relatedIds transitive closure),
  rankArcQuestions (etterspørsel x kan-svare x ikke-besvart), classifyMarketGap
  (supply-gap != demand-gap != saturated). Pure + deterministic (TDD).
- arcs CLI verb + /linkedin:trends --demand mode (commands stay 30); morning brief
  shows the per-candidate demand signal.

Suites: trends 276->300, test-runner 139->140, tsc clean. Others unchanged
(brain 134, hooks 140, tests 35, render 60).

MR-F9 built (bygget-men-ubevist) — the (a)/(b)/(c) evidence gate is a runtime
demonstration, proven consumer-side (plugin agents don't resolve in the dev repo).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014bE7VbkmR3cqHFEeGfzgwb
This commit is contained in:
Kjell Tore Guttormsen 2026-07-23 22:26:39 +02:00
commit 9de38c4939
16 changed files with 968 additions and 8 deletions

View file

@ -36,11 +36,17 @@ All flags are optional, given after the command name:
| `--mode kortform\|long-form` | Scoring mode (see the SSOT for what each rewards) | **long-form** — no arguments means a long-form discovery pass |
| `--fresh-days N` | Freshness window for the morning brief | CLI default (7) |
| `--brief-only` | Skip the discovery poll entirely; render the brief from the existing store | off |
| `--demand` | Run the **demand-sweep** (`demand-spotter`, «innenfra og ut») instead of supply-side discovery: poll where readers ASK, fill the reader fields, render the §4 arc map | off |
| `--dry-run` | Poll + score, but persist nothing: no capture, no brief, no status writes, no last-run marker | off |
Note the mode inversion deliberately: the **agent's** own default is kortform, this
**command's** default is long-form. That is why Step 2 must always pass the mode explicitly.
**`--demand` reroutes the pass** (Step 2D below) to the demand side — a different agent
(`demand-spotter`), a different unit (the arc/åre, not the news-item), a different output (the §4
arc map, not the pillar brief). The two are complementary: run discovery to find *what happened*,
then `--demand` on a chosen theme to see *what the reader is stuck on*.
## Step 1: Load context
1. **Pillars:** Read `${DATA}/profile/user-profile.md` and extract the content pillars /
@ -52,6 +58,27 @@ Note the mode inversion deliberately: the **agent's** own default is kortform, t
the agent owns Research Routing (its own "Research Routing" section reads the profile's
`### Research Tooling` block); duplicating it here would drift.
## Step 2D: Run the demand-sweep (only on `--demand`)
**If `--demand`:** this replaces Steps 24 (the supply-side discovery pass). Delegate to the
demand-spotter agent — invoke it via `Task` with `subagent_type: linkedin-studio:demand-spotter`
(foreground). The prompt MUST state explicitly:
- The pillars and the resolved source-list path from Step 1 (its **Tier 5** demand sources are what
this pass polls — the inverse of the Tier 14 supply sources).
- The theme(s) to sweep (from `--topics` if given, else the user's pillars).
- That the three passes are mandatory: demand-sweep (verbatim questions + signal strength + is-it-answered) → pain-point map (fills `painPoint`) → vocabulary translation (fills `readerQuestion`).
- That persistence is **mandatory unless `--dry-run`**: the agent runs `capture` with the reader
fields (`readerQuestion`/`painPoint`/`saturation`/`demand`/`verdict`/`actionability`), then renders
the §4 arc map with `CLI arcs`.
- That an **honest null is a finding** — a thin/un-swept source is reported, never filled in.
Then present the arc map the agent returns: per vein, the ranked question inventory (reader's words),
the honest market verdict (supply-gap = write here · demand-gap = high-value/low-audience · saturated
= skip), and the BÆRENDE/STØTTE reading order. On `--dry-run`, present the same map but state that
nothing was persisted. **Skip Steps 24.** Hand off: a chosen vein feeds `/linkedin:newsletter`
Step 1 (its reader question, pain point, and angle prefill the edition).
## Step 2: Run the discovery pass
**If `--brief-only`:** skip the agent entirely — go to Step 3 and render the brief from the