@ascenda-one/history-import 0.1.24 → 0.1.25

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
@@ -170,9 +170,6 @@ Code also writes `user` lines on your behalf, and none of these count:
170
170
  variant.
171
171
 
172
172
  Each session carries `syntheticPromptLines`, the number of lines it left out.
173
- The handoff stamps `promptBasis: "typed"`. A handoff without the stamp counted
174
- every `user` line that wasn't a tool result, so its prompt counts run higher for
175
- the same week. The schema number doesn't move.
176
173
 
177
174
  These lines aren't you, and they aren't the agent, so they don't start or end a
178
175
  hands-on span. Prompt events, after-hours prompts and quick re-prompts all
@@ -180,6 +177,31 @@ follow the same count. The desktop app's importer declines the same lines; the
180
177
  test is `isTypedPromptLine` in
181
178
  [`src/interruptedRuns.ts`](./src/interruptedRuns.ts).
182
179
 
180
+ Two more rules need the whole store, so the extractor reads every transcript
181
+ once before it folds any session ([`src/promptLedger.ts`](./src/promptLedger.ts)):
182
+
183
+ - **Each typed line counts once.** Resuming or forking a session writes a new
184
+ transcript that copies the history it inherited, line ids and timestamps
185
+ included. The copy is counted by one transcript only: the one the line's
186
+ `sessionId` names, or, where that file is gone, the first in the walk's
187
+ sorted order. A line with no id is counted wherever it appears. Active and
188
+ hands-on minutes aren't deduplicated this way. A resumed session still
189
+ carries its ancestors' minutes.
190
+ - **A chip's prompt isn't typed.** A session launched from a `spawn_task` chip
191
+ opens on the chip's prompt. When a line's text, wrappers stripped, matches a
192
+ chip that some session in the store offered, it counts in
193
+ `dispatchedPromptLines`, not `promptCount`. The agent still runs on it, so an
194
+ interrupt during that first turn is still a cut-short run. Only hashes of
195
+ chip prompts are kept, and only for the run. If the store's cleanup has
196
+ already removed the session that offered the chip, there's nothing to match
197
+ and the opener counts as typed.
198
+
199
+ The handoff stamps `promptBasis: "typed_once"`. `"typed"` means the rules above
200
+ the list, with every resumed copy counted again and chip prompts counted as
201
+ typed. A handoff without the stamp counted every `user` line that wasn't a tool
202
+ result. Prompt counts for the same week run highest under that rule and lowest
203
+ under `typed_once`. The schema number doesn't move.
204
+
183
205
  ### Autonomy bands
184
206
 
185
207
  `permissionMode` is on the transcript's human-prompt lines and nowhere else —