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
Copy file name to clipboardExpand all lines: .clinerules
+23-7Lines changed: 23 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -326,19 +326,35 @@ function SuggestedChart({ data, intent }) {
326
326
```
327
327
328
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.
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`, plus `interrogation-asked` / `interrogation-answered` for chat-with-chart sessions. Module-scoped, no React provider needed. Default surface is a no-op — call `enableConversationArc()` to start recording.
330
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
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`).
332
+
- **`getConversationArcStore()`** → returns `{ enabled, sessionId, capacity, record(input), flush(), getEvents(), subscribe(listener), clear(), reset() }`. Methods are safe to call when disabled (no-op). `getEvents()` returns a referentially stable snapshot until the next mutation — safe for `useSyncExternalStore`.
333
+
- **`subscribeToConversationArcChange(fn)`** → fires on any state mutation (record / clear / flush / reset / enable). Used by the React hook for snapshot tracking; sinks should use `subscribe()` (event-typed) instead.
334
+
- **`useConversationArc({ enableOnMount?, disableOnUnmount?, capacity?, sessionId? })`** → React hook returning `{ history, summary, enabled, sessionId, record, clear }`. `summary` is the live `ConversationArcSummary` (per-type counts, components seen, audiences seen, duration, latestArcId). Subscribes via `useSyncExternalStore` for tear-free re-renders.
335
+
- **`summarizeArc(events)`** → pure reducer producing the same `ConversationArcSummary`. Server-safe, replay-safe.
336
+
- **`recordAudienceChange(audience, previous?, { arcId?, meta? }?)`** → sugar over `record({ type: "audience-set", ... })`. Call from your audience-picker's `onChange`.
337
+
- **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`; `InterrogationAnsweredEvent` has `answer`, `annotationCount`, `latencyMs`, `error`).
338
+
- **Auto-instrumented sources**: `useChartSuggestions` emits `suggestion-shown` whenever the suggestion list changes (dedup by component-list + intent signature); `useChartInterrogation` emits `interrogation-asked` on `ask()` and `interrogation-answered` (with `latencyMs`) when the response returns. Zero-overhead when arc store is disabled.
334
339
335
340
```ts
336
-
import { enableConversationArc, getConversationArcStore } from "semiotic/ai"
Copy file name to clipboardExpand all lines: .cursorrules
+23-7Lines changed: 23 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -326,19 +326,35 @@ function SuggestedChart({ data, intent }) {
326
326
```
327
327
328
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.
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`, plus `interrogation-asked` / `interrogation-answered` for chat-with-chart sessions. Module-scoped, no React provider needed. Default surface is a no-op — call `enableConversationArc()` to start recording.
330
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
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`).
332
+
- **`getConversationArcStore()`** → returns `{ enabled, sessionId, capacity, record(input), flush(), getEvents(), subscribe(listener), clear(), reset() }`. Methods are safe to call when disabled (no-op). `getEvents()` returns a referentially stable snapshot until the next mutation — safe for `useSyncExternalStore`.
333
+
- **`subscribeToConversationArcChange(fn)`** → fires on any state mutation (record / clear / flush / reset / enable). Used by the React hook for snapshot tracking; sinks should use `subscribe()` (event-typed) instead.
334
+
- **`useConversationArc({ enableOnMount?, disableOnUnmount?, capacity?, sessionId? })`** → React hook returning `{ history, summary, enabled, sessionId, record, clear }`. `summary` is the live `ConversationArcSummary` (per-type counts, components seen, audiences seen, duration, latestArcId). Subscribes via `useSyncExternalStore` for tear-free re-renders.
335
+
- **`summarizeArc(events)`** → pure reducer producing the same `ConversationArcSummary`. Server-safe, replay-safe.
336
+
- **`recordAudienceChange(audience, previous?, { arcId?, meta? }?)`** → sugar over `record({ type: "audience-set", ... })`. Call from your audience-picker's `onChange`.
337
+
- **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`; `InterrogationAnsweredEvent` has `answer`, `annotationCount`, `latencyMs`, `error`).
338
+
- **Auto-instrumented sources**: `useChartSuggestions` emits `suggestion-shown` whenever the suggestion list changes (dedup by component-list + intent signature); `useChartInterrogation` emits `interrogation-asked` on `ask()` and `interrogation-answered` (with `latencyMs`) when the response returns. Zero-overhead when arc store is disabled.
334
339
335
340
```ts
336
-
import { enableConversationArc, getConversationArcStore } from "semiotic/ai"
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+23-7Lines changed: 23 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -326,19 +326,35 @@ function SuggestedChart({ data, intent }) {
326
326
```
327
327
328
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.
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`, plus `interrogation-asked` / `interrogation-answered` for chat-with-chart sessions. Module-scoped, no React provider needed. Default surface is a no-op — call `enableConversationArc()` to start recording.
330
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
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`).
332
+
-**`getConversationArcStore()`** → returns `{ enabled, sessionId, capacity, record(input), flush(), getEvents(), subscribe(listener), clear(), reset() }`. Methods are safe to call when disabled (no-op). `getEvents()` returns a referentially stable snapshot until the next mutation — safe for `useSyncExternalStore`.
333
+
-**`subscribeToConversationArcChange(fn)`** → fires on any state mutation (record / clear / flush / reset / enable). Used by the React hook for snapshot tracking; sinks should use `subscribe()` (event-typed) instead.
334
+
-**`useConversationArc({ enableOnMount?, disableOnUnmount?, capacity?, sessionId? })`** → React hook returning `{ history, summary, enabled, sessionId, record, clear }`. `summary` is the live `ConversationArcSummary` (per-type counts, components seen, audiences seen, duration, latestArcId). Subscribes via `useSyncExternalStore` for tear-free re-renders.
335
+
-**`summarizeArc(events)`** → pure reducer producing the same `ConversationArcSummary`. Server-safe, replay-safe.
336
+
-**`recordAudienceChange(audience, previous?, { arcId?, meta? }?)`** → sugar over `record({ type: "audience-set", ... })`. Call from your audience-picker's `onChange`.
337
+
-**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`; `InterrogationAnsweredEvent` has `answer`, `annotationCount`, `latencyMs`, `error`).
338
+
-**Auto-instrumented sources**: `useChartSuggestions` emits `suggestion-shown` whenever the suggestion list changes (dedup by component-list + intent signature); `useChartInterrogation` emits `interrogation-asked` on `ask()` and `interrogation-answered` (with `latencyMs`) when the response returns. Zero-overhead when arc store is disabled.
Copy file name to clipboardExpand all lines: .windsurfrules
+23-7Lines changed: 23 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -326,19 +326,35 @@ function SuggestedChart({ data, intent }) {
326
326
```
327
327
328
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.
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`, plus `interrogation-asked` / `interrogation-answered` for chat-with-chart sessions. Module-scoped, no React provider needed. Default surface is a no-op — call `enableConversationArc()` to start recording.
330
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
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`).
332
+
- **`getConversationArcStore()`** → returns `{ enabled, sessionId, capacity, record(input), flush(), getEvents(), subscribe(listener), clear(), reset() }`. Methods are safe to call when disabled (no-op). `getEvents()` returns a referentially stable snapshot until the next mutation — safe for `useSyncExternalStore`.
333
+
- **`subscribeToConversationArcChange(fn)`** → fires on any state mutation (record / clear / flush / reset / enable). Used by the React hook for snapshot tracking; sinks should use `subscribe()` (event-typed) instead.
334
+
- **`useConversationArc({ enableOnMount?, disableOnUnmount?, capacity?, sessionId? })`** → React hook returning `{ history, summary, enabled, sessionId, record, clear }`. `summary` is the live `ConversationArcSummary` (per-type counts, components seen, audiences seen, duration, latestArcId). Subscribes via `useSyncExternalStore` for tear-free re-renders.
335
+
- **`summarizeArc(events)`** → pure reducer producing the same `ConversationArcSummary`. Server-safe, replay-safe.
336
+
- **`recordAudienceChange(audience, previous?, { arcId?, meta? }?)`** → sugar over `record({ type: "audience-set", ... })`. Call from your audience-picker's `onChange`.
337
+
- **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`; `InterrogationAnsweredEvent` has `answer`, `annotationCount`, `latencyMs`, `error`).
338
+
- **Auto-instrumented sources**: `useChartSuggestions` emits `suggestion-shown` whenever the suggestion list changes (dedup by component-list + intent signature); `useChartInterrogation` emits `interrogation-asked` on `ask()` and `interrogation-answered` (with `latencyMs`) when the response returns. Zero-overhead when arc store is disabled.
334
339
335
340
```ts
336
-
import { enableConversationArc, getConversationArcStore } from "semiotic/ai"
0 commit comments