@autonoma-ai/planner 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,8 +41,8 @@ inside the dashboard; the terminal is handed over only for the
41
41
  SDK-integration handoff below, and the dashboard comes back when the agent exits.
42
42
 
43
43
  Piped output, CI, and `--non-interactive` keep the plain line-based output. See
44
- `docs/ui-design-brief.md` for the design rationale and `docs/tui-plan.md` for the build plan;
45
- `pnpm ui:gallery` steps through every dashboard state with fixture data (Tab / Shift+Tab).
44
+ `docs/ui-design-brief.md` for the design rationale; `pnpm ui:gallery` steps through every
45
+ dashboard state with fixture data (Tab / Shift+Tab).
46
46
  Pass a past run's output directory - `pnpm ui:gallery ~/.autonoma/<slug>` - to add a scene
47
47
  backed by real files, so navigation and scrolling can be tested on real documents.
48
48
 
@@ -76,10 +76,11 @@ of a copy-paste guide, the CLI hands the whole integration to your **locally-ins
76
76
  one interactive, autonomous session - like `git commit` with no `-m` opening your editor. You watch
77
77
  it install the SDK, build the endpoint, write the factories, **generate the test-data recipe**, and
78
78
  validate each entity itself: for every entity it runs `up`, checks your database for the new rows,
79
- runs `down`, and checks they're gone. It drives the endpoint through the CLI's own signed client
80
- (`autonoma-planner sdk discover|up|down`), so its checks use the exact request signing the platform
81
- uses. When it reports the session complete, the CLI uploads the recipe it produced and continues to
82
- test generation.
79
+ runs `down`, and checks they're gone. It finishes by seeding two instances at once, proving your
80
+ recipe survives concurrent test runs. It drives the endpoint through the CLI's own signed client
81
+ (`autonoma-planner sdk discover|up|down`), so its checks use the exact request signing and the exact
82
+ recipe-token substitution the platform uses. When it reports the session complete, the CLI uploads
83
+ the recipe it produced and continues to test generation.
83
84
 
84
85
  - `--agent <name>` - preselect the agent to hand off to (`claude` or `codex`). Omit to auto-detect;
85
86
  if both are installed you're prompted to pick.
@@ -108,8 +109,15 @@ Artifacts are written to `~/.autonoma/<project-slug>/`:
108
109
  ├── recipe.json # scenario recipes (SDK factories); the agent generates + validates it
109
110
  ├── integration-prompt.md # rendered SDK-integration instructions (drives the agent + manual fallback)
110
111
  └── qa-tests/ # generated test cases (markdown)
112
+ ├── INDEX.md # table of contents for the suite
113
+ └── _invalid/ # tests that failed structural validation; never uploaded
111
114
  ```
112
115
 
116
+ `qa-tests/INDEX.md` is written once, at the end, from the files on disk - so it always matches
117
+ the suite beside it. Alongside the totals it names what the run could *not* deliver: features it
118
+ walked without producing a test, and tests the review cycle removed that nothing could put back.
119
+ Both are fixed by re-running the planner.
120
+
113
121
  ## Automatic upload
114
122
 
115
123
  When started from Autonoma onboarding, the CLI uploads the artifacts itself once the run finishes -
@@ -129,11 +137,72 @@ If the upload credentials are not set, the CLI just leaves the artifacts on disk
129
137
  | `AUTONOMA_GENERATION_ID` | for upload | The setup id artifacts are uploaded against. Injected by onboarding. |
130
138
  | `AUTONOMA_SHARED_SECRET` | no | Per-application secret used to sign SDK/webhook requests. Injected by onboarding. |
131
139
  | `AUTONOMA_DISTINCT_ID` | no | PostHog identity so CLI events join the signup funnel. Injected by onboarding. |
132
- | `DONT_TRACK` | no | Set to `1`/`true` to disable anonymous analytics. |
140
+ | `DONT_TRACK` | no | Set to `1`/`true` to disable all telemetry - events, log shipping and session replay. |
133
141
 
134
142
  `AUTONOMA_API_TOKEN` + `AUTONOMA_GENERATION_ID` together enable automatic upload (the endpoint
135
143
  defaults to production unless `AUTONOMA_API_URL` is set).
136
144
 
145
+ ## Telemetry
146
+
147
+ Three lanes, all to PostHog, all off when `DONT_TRACK=1`:
148
+
149
+ - **Events** (`core/analytics.ts`) - `cli_run_started`, `cli_step_completed`, `$exception`, and friends,
150
+ posted to the capture endpoint.
151
+ - **Logs** (`core/logs.ts`) - the run's narrative, shipped as OTLP records under the service name
152
+ `autonoma-planner`: run and step lifecycle, every agent tool call, tool errors, retries and nudges,
153
+ and everything the CLI prints to the user.
154
+ - **Session replay** (`src/replay/`) - the dashboard itself, as rrweb events, played back in PostHog's
155
+ session-replay player.
156
+
157
+ All three lanes are indexed by the same identifiers (`core/session.ts`), so one run resolves the same
158
+ way from any of them:
159
+
160
+ | Attribute | What it identifies |
161
+ |-----------|--------------------|
162
+ | `run_id` / `sessionId` | This CLI invocation. `sessionId` is PostHog's own grouping key, so a run's logs sit together. |
163
+ | `generation_id` | The onboarding setup the run is fulfilling - the join back to an Autonoma record. |
164
+ | `posthogDistinctId` | The person, when the app launched the CLI with an identity; otherwise an anonymous per-machine device id. |
165
+ | `project_slug`, `cli_version`, `node_version` | Which project, which build, which runtime. |
166
+
167
+ To read one run: filter logs by `service.name = autonoma-planner` and the `generation_id` (or `run_id`)
168
+ you are chasing, ordered earliest-first.
169
+
170
+ Log records carry **metadata only** - step names, agent and tool names, file paths, patterns, commands,
171
+ durations, and error messages. Model prose and reasoning, prompts, and the contents of any file the
172
+ agent read or wrote are never sent; those are what would carry a user's source code off their machine.
173
+ Records are truncated and a single run is capped at 5000 of them, so a stuck agent loop cannot flood
174
+ ingestion - the cap being reached is itself logged.
175
+
176
+ ### Session replay
177
+
178
+ An interactive run is recorded and plays back in PostHog's normal session-replay player, alongside web
179
+ recordings for the same person. It uses the run id as its `$session_id`, so a recording, its events and
180
+ its logs all resolve to one another.
181
+
182
+ `DONT_TRACK=1` turns it off along with the other two lanes - one switch, no partial opt-out.
183
+
184
+ **This lane captures more than the others, and it is worth being explicit about it.** Events and logs
185
+ are deliberately metadata-only - no prompts, no model prose, no file contents. A replay is a verbatim
186
+ copy of the dashboard, and the dashboard renders repository paths and the contents of the files the run
187
+ generates. Anything visible on screen is in the recording. Keystrokes are the one exception: printable
188
+ characters are recorded as a placeholder, never the literal key, so the upload is not a transcript of
189
+ the keyboard.
190
+
191
+ How it works (`src/replay/`):
192
+
193
+ - Frames come from an off-screen render of the same `<App>` the user sees, using Ink's `debug`
194
+ mode, which writes a complete frame with no cursor escapes. Scraping the terminal repaint stream
195
+ would not work, because Ink can emit either full redraws or per-line incremental updates.
196
+ - Each frame becomes a synthetic DOM: one `<div>` per terminal row, spans for each colour run.
197
+ - Frames are diffed row by row, so a repaint uploads only the rows that changed. A full snapshot of
198
+ the dashboard is tens of kilobytes; a typical repaint is a few hundred bytes.
199
+ - Keystrokes are emitted as rrweb input events, because PostHog derives the active/inactive split
200
+ from interaction events alone. Without them a run of pure repaints reads as entirely idle and the
201
+ player's inactivity-skipping has nothing to skip to. Printable characters are recorded as a
202
+ placeholder rather than the literal key, so the upload is not a transcript of the keyboard.
203
+ - Capture is rate limited to 2 fps, batched under PostHog's size limit, and capped per run. Any
204
+ failure is swallowed - a recording is never worth failing a run over.
205
+
137
206
  ## Development
138
207
 
139
208
  ```bash