feat(linkedin-studio): RE-R3e — brief history + day-over-day diff (surfaced: frontmatter + Nytt siden sist) [skip-docs]
Closes hull #7 ("ingen brief-historikk"). Each morning brief now records the trend ids it showed into its own YAML frontmatter (surfaced: <id-csv> = surfacedIds(ranking)) and renders a day-over-day diff against the most recent prior brief — a "## Nytt siden sist (<prior-date>)" section that leads the ranked list, plus a " N nye siden sist." marker on the one-line summary the SessionStart hook surfaces (no hook change). - brief.ts: BRIEF_SCHEMA_VERSION 1->2 (artifact frontmatter gained surfaced:; the store's SCHEMA_VERSION stays 4 — no store field). Three PURE helpers (diffSurfaced / parseSurfacedFrontmatter / selectPriorBriefFile) + the surfaced: emit + the section + the summary marker. No fs/clock in brief.ts. - cli.ts: the brief handler discovers the prior dated file (existsSync-guarded readdirSync -> selectPriorBriefFile, strict < today so a same-day re-run is byte-identical), parses its surfaced: line, computes the diff, threads it into renderBrief AND the shared briefSummary(ranking, diff) (one-source: file frontmatter == --json summary, cli.test one-source invariant). --json gains a diff:{priorDate,added,carried,dropped} counts object; the console line appends the delta. Any fs error degrades to the empty-prior (first-brief) path. TDD two-phase: stubs -> 17 value-RED (no module-not-found) -> GREEN. Trends suite 216 -> 245 (brief +27, cli +2), 0 fail. New unconditional gate Section 16n (6 checks); ASSERT_BASELINE_FLOOR 117 -> 123; TRENDS_TESTS_FLOOR -> 245. Full gate FAIL=0; hook suite 139/139 + R3c schedule/run-daily green untouched. Behavioural: real two-day rename-real-write diff + same-day byte-identity confirmed. Counts 29/19/27 unchanged; no version bump (additive, v0.5.2 dev). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vmzxpsFpc8q19LaogAWLD
This commit is contained in:
parent
ddedb3d1de
commit
5b51b4baeb
7 changed files with 462 additions and 18 deletions
|
|
@ -348,6 +348,11 @@ not-yet-surfaced trend is ranked up as a **first-mover** (`· 🥇 først ute`)
|
|||
one is ranked down as **saturated** (`· 🔁 mettet`) — computed at render time from the publish/capture
|
||||
dates + the seen-log, with no new capture step. Tune with `--first-mover-days N` / `--saturation-at N`.
|
||||
|
||||
Each brief also **records the trend ids it showed** (frontmatter `surfaced:`) and renders a
|
||||
**day-over-day diff** — a `## 🆕 Nytt siden sist` section listing what is new since the most recent
|
||||
prior brief (plus a ` N nye siden sist` marker on the one-line summary) — no new capture step; the
|
||||
polling/capture path above is unchanged (RE-R3e).
|
||||
|
||||
The morning brief can also be **scheduled** to regenerate autonomously each morning — deterministic,
|
||||
from the current store — via `src/cli.ts schedule` (print-first: it emits a launchd/cron entry firing
|
||||
the `run-daily.sh` headless wrapper). That nightly run re-renders the brief only; your polling above
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue