You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce M1 AI surfaces and improve docs prerendering:
- Add conversation-arc telemetry (src/components/ai/conversationArc.ts) — opt-in module-scoped ring buffer store with enable/disable, record/flush/getEvents, subscribe/unsubscribe, capacity handling and tests (conversationArc.test.ts).
- Add annotation provenance/lifecycle type surface and helper (src/components/ai/annotationProvenance.ts) with accompanying tests to validate non-mutating withProvenance and documented shapes.
- Add variant-discovery stubs and tests (src/components/ai/variantDiscovery.ts + variantDiscovery.test.ts) for future proposers/evaluators.
- Enhance prerender tooling (scripts/prerender.mjs and its types) to support per-route ROUTE_META, blog OG card copying, blog-aware generatePage signature, meta injection anchored at <body> (works with minified shells), sitemap.xml and robots.txt generation, and related tests updates for prerender behavior.
- Update documentation (CLAUDE.md) to describe the new AI APIs: conversation arc, annotation provenance/lifecycle, and variant discovery.
These changes add type-safe surfaces and test coverage for AI telemetry and provenance (M1), and improve SEO/static build correctness for blog and section pages.
Copy file name to clipboardExpand all lines: CLAUDE.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -325,6 +325,50 @@ function SuggestedChart({ data, intent }) {
325
325
}
326
326
```
327
327
328
+
### Conversation-arc telemetry (`semiotic/ai`)
329
+
Opt-in event store that records the arc of an AI-assisted session: `suggestion-shown → suggestion-chosen → audience-set → chart-rendered → chart-edited → chart-replaced → chart-exported | chart-abandoned`. Module-scoped, no React provider needed. Default surface is a no-op — call `enableConversationArc()` to start recording.
330
+
-**`enableConversationArc({ capacity?, sessionId? })`** → enables recording. Bounded ring buffer (default 1000 events). Safe to call multiple times; reuses the existing session unless `sessionId` is overridden.
331
+
-**`disableConversationArc()`** → stops recording without dropping buffered events.
332
+
-**`getConversationArcStore()`** → returns `{ enabled, sessionId, capacity, record(input), flush(), getEvents(), subscribe(listener), clear(), reset() }`. Methods are safe to call when disabled (no-op).
333
+
-**Events**: `ConversationArcEvent` discriminated union with `type`, `timestamp`, `sessionId`, optional `arcId` + `meta`. Each variant carries its own payload (e.g. `SuggestionShownEvent` has `components`, `intent`, `topScore`, `audience`).
### Annotation provenance + lifecycle (`semiotic/ai`, types also re-exported from `semiotic`)
345
+
Type surface for "where did this annotation come from?" and "is it stale?" Optional blocks attached to any annotation — existing arrays keep working unchanged.
346
+
-**`provenance`**: `{ author?, source?, confidence?, created_at?, stable_id? }`. `source` is an open string union (`"user" | "ai" | "agent" | "import" | "computed" | "system" | (string & {})`).
347
+
-**`lifecycle`**: `{ freshness?, ttl_hint?, anchor? }`. `freshness` is `"fresh" | "aging" | "stale" | "expired"`. `anchor` is `"fixed" | "latest" | "sticky" | "semantic"`. `ttl_hint` accepts an ISO 8601 duration string (`"P30D"`) or milliseconds.
348
+
-**`withProvenance(annotation, { provenance?, lifecycle? })`** → returns a new annotation with the blocks attached. Pure, SSR-safe.
349
+
-**`Annotated<T>`** type alias: `T & { provenance?, lifecycle? }`. Use for explicit typing.
350
+
- Type surface only at this stage. Freshness computation, default visual treatment, and stable-id anchor resolution land later.
Interface for proposing and scoring chart variants beyond the hand-curated `capability.variants`. Heuristic and model-based proposers plug in through `registerVariantDiscovery`. M1 ships the type surface + stub implementations; behavior arrives in subsequent milestones.
-**`evaluateVariantProposal(proposal, profile, audience?)`** → `VariantScore`. M1 stub returns a neutral baseline with a reason pointing back at the design doc.
370
+
-**`registerVariantDiscovery(fn)`** → registers an external proposer, returns an unregister callback. Pair with `getRegisteredVariantDiscovery()` / `clearVariantDiscovery()` for inspection and teardown.
371
+
- Full design + sequencing in `docs/strategy/variant-discovery.md`.
0 commit comments