Skip to content

Commit 4fd6d9a

Browse files
peasclaude
andcommitted
Update CLAUDE.md: add classify-stories command + stories pipeline docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 53b85b9 commit 4fd6d9a

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,34 @@ npm run build # sync + build-signals + astro build
2929
npx astro preview # preview production build locally
3030
```
3131

32+
### Sensitivity classification (classify-stories.ts)
33+
34+
Runs **Haiku** on each story to classify public vs private. Flags: internal company data, employee criticism, offensive language, political content, private conversations. Writes `public` boolean + `reason` to stories.json.
35+
36+
```bash
37+
npx tsx scripts/classify-stories.ts # classify all unclassified stories
38+
npx tsx scripts/classify-stories.ts --limit 5 # classify 5 stories
39+
npx tsx scripts/classify-stories.ts --force # reclassify all (even already done)
40+
npx tsx scripts/classify-stories.ts --dry-run # preview without writing
41+
```
42+
43+
Requires ANTHROPIC_API_KEY (loads from .env or ~/pkm/.env).
44+
45+
### Stories pipeline flow
46+
47+
```
48+
vault signals → build-signals.ts (dedup + group + quality filter) → stories.json
49+
→ editorialize-stories.ts (Sonnet: titles, body, quotes) → stories.json (enriched)
50+
→ classify-stories.ts (Haiku: public/private sensitivity) → stories.json (classified)
51+
→ /stories (public only, top by weight) + /stories/all (everything for review)
52+
```
53+
54+
Key steps:
55+
1. **Dedup**: signals from same source + same day + 2+ shared tags are merged before story creation. Cross-source (Telegram + WhatsApp) dedup by shared tags + 2-day window.
56+
2. **Editorialize**: Sonnet generates journalistic titles, subtitle, editorial body with indirect speech + direct quotes.
57+
3. **Classify sensitivity**: Haiku flags stories with internal data, employee criticism, offensive language, etc.
58+
4. **Render**: `/stories` shows only `public: true` top stories. `/stories/all` shows everything.
59+
3260
### Signals pipeline (build-signals.ts)
3361

3462
Reads 3 sources from Stromae vault, normalizes, groups by thread, filters quality, enriches links with OG metadata, builds graph. Outputs `signals.json`, `stories.json`, `graph.json` to `src/data/`.

0 commit comments

Comments
 (0)