@manyoars/oars 0.1.1 → 0.3.0

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.
Files changed (240) hide show
  1. package/README.md +134 -26
  2. package/dist/api.js +1 -1
  3. package/dist/bin.js +6 -29
  4. package/dist/cli.d.ts +6 -3
  5. package/dist/cli.js +370 -72
  6. package/dist/commands/keys.d.ts +31 -0
  7. package/dist/commands/keys.js +65 -0
  8. package/dist/commands/login.d.ts +1 -1
  9. package/dist/commands/login.js +3 -5
  10. package/dist/errors.d.ts +13 -13
  11. package/dist/errors.js +28 -11
  12. package/dist/gate/checks.d.ts +68 -0
  13. package/dist/gate/checks.js +584 -0
  14. package/dist/gate/command.d.ts +14 -0
  15. package/dist/gate/command.js +61 -0
  16. package/dist/gate/hook-fill-main.d.ts +1 -0
  17. package/dist/gate/hook-fill-main.js +16 -0
  18. package/dist/gate/hook-fill.d.ts +38 -0
  19. package/dist/gate/hook-fill.js +94 -0
  20. package/dist/gate/hook-main.d.ts +1 -0
  21. package/dist/gate/hook-main.js +35 -0
  22. package/dist/gate/hook-process.d.ts +14 -0
  23. package/dist/gate/hook-process.js +64 -0
  24. package/dist/gate/hook.d.ts +46 -0
  25. package/dist/gate/hook.js +256 -0
  26. package/dist/gate/install.d.ts +25 -0
  27. package/dist/gate/install.js +126 -0
  28. package/dist/gate/local-bin.d.ts +8 -0
  29. package/dist/gate/local-bin.js +36 -0
  30. package/dist/gate/notes.d.ts +19 -0
  31. package/dist/gate/notes.js +27 -0
  32. package/dist/gate/novelty.d.ts +35 -0
  33. package/dist/gate/novelty.js +99 -0
  34. package/dist/gate/policy.d.ts +25 -0
  35. package/dist/gate/policy.js +73 -0
  36. package/dist/gate/record.d.ts +120 -0
  37. package/dist/gate/record.js +125 -0
  38. package/dist/gate/registry-state.d.ts +10 -0
  39. package/dist/gate/registry-state.js +30 -0
  40. package/dist/gate/registry.d.ts +56 -0
  41. package/dist/gate/registry.js +94 -0
  42. package/dist/gate/replay.d.ts +20 -0
  43. package/dist/gate/replay.js +257 -0
  44. package/dist/gate/report.d.ts +50 -0
  45. package/dist/gate/report.js +89 -0
  46. package/dist/gate/scope.d.ts +7 -0
  47. package/dist/gate/scope.js +27 -0
  48. package/dist/gate/transcripts.d.ts +68 -0
  49. package/dist/gate/transcripts.js +232 -0
  50. package/dist/hook-bin.d.ts +1 -0
  51. package/dist/hook-bin.js +25 -0
  52. package/dist/issuer.d.ts +16 -0
  53. package/dist/issuer.js +55 -0
  54. package/dist/main.d.ts +1 -0
  55. package/dist/main.js +64 -0
  56. package/dist/oidc.js +1 -1
  57. package/dist/sessions/actions.d.ts +35 -0
  58. package/dist/sessions/actions.js +351 -0
  59. package/dist/sessions/allow.d.ts +14 -0
  60. package/dist/sessions/allow.js +51 -0
  61. package/dist/sessions/archive.d.ts +11 -0
  62. package/dist/sessions/archive.js +38 -0
  63. package/dist/sessions/audit.d.ts +42 -0
  64. package/dist/sessions/audit.js +104 -0
  65. package/dist/sessions/baseline.d.ts +62 -0
  66. package/dist/sessions/baseline.js +188 -0
  67. package/dist/sessions/capture-runtime.d.ts +10 -0
  68. package/dist/sessions/capture-runtime.js +12 -0
  69. package/dist/sessions/cell-increments.d.ts +43 -0
  70. package/dist/sessions/cell-increments.js +209 -0
  71. package/dist/sessions/cells.d.ts +79 -0
  72. package/dist/sessions/cells.js +181 -0
  73. package/dist/sessions/codex.d.ts +53 -0
  74. package/dist/sessions/codex.js +679 -0
  75. package/dist/sessions/command.d.ts +117 -0
  76. package/dist/sessions/command.js +373 -0
  77. package/dist/sessions/copilot.d.ts +40 -0
  78. package/dist/sessions/copilot.js +432 -0
  79. package/dist/sessions/cursor.d.ts +24 -0
  80. package/dist/sessions/cursor.js +324 -0
  81. package/dist/sessions/derive.d.ts +57 -0
  82. package/dist/sessions/derive.js +320 -0
  83. package/dist/sessions/exclusion.d.ts +81 -0
  84. package/dist/sessions/exclusion.js +353 -0
  85. package/dist/sessions/extract.d.ts +179 -0
  86. package/dist/sessions/extract.js +1774 -0
  87. package/dist/sessions/fold.d.ts +17 -0
  88. package/dist/sessions/fold.js +71 -0
  89. package/dist/sessions/frame.d.ts +24 -0
  90. package/dist/sessions/frame.js +95 -0
  91. package/dist/sessions/gemini.d.ts +37 -0
  92. package/dist/sessions/gemini.js +613 -0
  93. package/dist/sessions/gold-arms.d.ts +67 -0
  94. package/dist/sessions/gold-arms.js +172 -0
  95. package/dist/sessions/gold.d.ts +197 -0
  96. package/dist/sessions/gold.js +463 -0
  97. package/dist/sessions/graph.d.ts +12 -0
  98. package/dist/sessions/graph.js +34 -0
  99. package/dist/sessions/grok.d.ts +36 -0
  100. package/dist/sessions/grok.js +421 -0
  101. package/dist/sessions/hook-calls.d.ts +3 -0
  102. package/dist/sessions/hook-calls.js +47 -0
  103. package/dist/sessions/hook-index.d.ts +53 -0
  104. package/dist/sessions/hook-index.js +157 -0
  105. package/dist/sessions/hooks.d.ts +13 -0
  106. package/dist/sessions/hooks.js +170 -0
  107. package/dist/sessions/identity.d.ts +22 -0
  108. package/dist/sessions/identity.js +101 -0
  109. package/dist/sessions/install.d.ts +54 -0
  110. package/dist/sessions/install.js +201 -0
  111. package/dist/sessions/lineage.d.ts +19 -0
  112. package/dist/sessions/lineage.js +118 -0
  113. package/dist/sessions/mcp.d.ts +6 -0
  114. package/dist/sessions/mcp.js +153 -0
  115. package/dist/sessions/merkle.d.ts +7 -0
  116. package/dist/sessions/merkle.js +28 -0
  117. package/dist/sessions/motif.d.ts +43 -0
  118. package/dist/sessions/motif.js +59 -0
  119. package/dist/sessions/package-resolve.d.ts +30 -0
  120. package/dist/sessions/package-resolve.js +183 -0
  121. package/dist/sessions/pending.d.ts +34 -0
  122. package/dist/sessions/pending.js +142 -0
  123. package/dist/sessions/pool-command.d.ts +44 -0
  124. package/dist/sessions/pool-command.js +542 -0
  125. package/dist/sessions/pool-delta.d.ts +54 -0
  126. package/dist/sessions/pool-delta.js +190 -0
  127. package/dist/sessions/pool-outbox.d.ts +63 -0
  128. package/dist/sessions/pool-outbox.js +260 -0
  129. package/dist/sessions/pool-print.d.ts +26 -0
  130. package/dist/sessions/pool-print.js +68 -0
  131. package/dist/sessions/pool-wire.d.ts +225 -0
  132. package/dist/sessions/pool-wire.js +620 -0
  133. package/dist/sessions/pool.d.ts +32 -0
  134. package/dist/sessions/pool.js +164 -0
  135. package/dist/sessions/projection.d.ts +75 -0
  136. package/dist/sessions/projection.js +165 -0
  137. package/dist/sessions/public-vocabulary.d.ts +73 -0
  138. package/dist/sessions/public-vocabulary.js +302 -0
  139. package/dist/sessions/query.d.ts +111 -0
  140. package/dist/sessions/query.js +246 -0
  141. package/dist/sessions/read-adoption.d.ts +2 -0
  142. package/dist/sessions/read-adoption.js +27 -0
  143. package/dist/sessions/read-call-shape.d.ts +2 -0
  144. package/dist/sessions/read-call-shape.js +25 -0
  145. package/dist/sessions/read-change.d.ts +2 -0
  146. package/dist/sessions/read-change.js +30 -0
  147. package/dist/sessions/read-cost.d.ts +4 -0
  148. package/dist/sessions/read-cost.js +37 -0
  149. package/dist/sessions/read-day-move.d.ts +3 -0
  150. package/dist/sessions/read-day-move.js +65 -0
  151. package/dist/sessions/read-fit.d.ts +7 -0
  152. package/dist/sessions/read-fit.js +41 -0
  153. package/dist/sessions/read-interaction.d.ts +5 -0
  154. package/dist/sessions/read-interaction.js +62 -0
  155. package/dist/sessions/read-lead-lag.d.ts +15 -0
  156. package/dist/sessions/read-lead-lag.js +81 -0
  157. package/dist/sessions/read-live.d.ts +6 -0
  158. package/dist/sessions/read-live.js +38 -0
  159. package/dist/sessions/read-method.d.ts +2 -0
  160. package/dist/sessions/read-method.js +29 -0
  161. package/dist/sessions/read-next-step.d.ts +2 -0
  162. package/dist/sessions/read-next-step.js +35 -0
  163. package/dist/sessions/read-order.d.ts +54 -0
  164. package/dist/sessions/read-order.js +62 -0
  165. package/dist/sessions/read-readable.d.ts +8 -0
  166. package/dist/sessions/read-readable.js +24 -0
  167. package/dist/sessions/read-recovery.d.ts +20 -0
  168. package/dist/sessions/read-recovery.js +97 -0
  169. package/dist/sessions/read-rows.d.ts +13 -0
  170. package/dist/sessions/read-rows.js +47 -0
  171. package/dist/sessions/read-substitution.d.ts +5 -0
  172. package/dist/sessions/read-substitution.js +51 -0
  173. package/dist/sessions/read-support.d.ts +48 -0
  174. package/dist/sessions/read-support.js +73 -0
  175. package/dist/sessions/read-tool-day.d.ts +2 -0
  176. package/dist/sessions/read-tool-day.js +26 -0
  177. package/dist/sessions/read-version-boundary.d.ts +31 -0
  178. package/dist/sessions/read-version-boundary.js +95 -0
  179. package/dist/sessions/read.d.ts +79 -0
  180. package/dist/sessions/read.js +84 -0
  181. package/dist/sessions/recall-consequence.d.ts +45 -0
  182. package/dist/sessions/recall-consequence.js +179 -0
  183. package/dist/sessions/recall-object.d.ts +137 -0
  184. package/dist/sessions/recall-object.js +77 -0
  185. package/dist/sessions/recall-pool.d.ts +19 -0
  186. package/dist/sessions/recall-pool.js +96 -0
  187. package/dist/sessions/recall-push.d.ts +26 -0
  188. package/dist/sessions/recall-push.js +95 -0
  189. package/dist/sessions/recall-reads.d.ts +117 -0
  190. package/dist/sessions/recall-reads.js +410 -0
  191. package/dist/sessions/recall-render.d.ts +19 -0
  192. package/dist/sessions/recall-render.js +168 -0
  193. package/dist/sessions/redact.d.ts +6 -0
  194. package/dist/sessions/redact.js +54 -0
  195. package/dist/sessions/repo-root.d.ts +10 -0
  196. package/dist/sessions/repo-root.js +101 -0
  197. package/dist/sessions/schema.d.ts +644 -0
  198. package/dist/sessions/schema.js +148 -0
  199. package/dist/sessions/session-shape.d.ts +73 -0
  200. package/dist/sessions/session-shape.js +342 -0
  201. package/dist/sessions/sources.d.ts +50 -0
  202. package/dist/sessions/sources.js +159 -0
  203. package/dist/sessions/steps.d.ts +105 -0
  204. package/dist/sessions/steps.js +250 -0
  205. package/dist/sessions/store.d.ts +297 -0
  206. package/dist/sessions/store.js +1478 -0
  207. package/dist/sessions/strata.d.ts +26 -0
  208. package/dist/sessions/strata.js +77 -0
  209. package/dist/sessions/survival.d.ts +25 -0
  210. package/dist/sessions/survival.js +230 -0
  211. package/dist/sessions/verify.d.ts +53 -0
  212. package/dist/sessions/verify.js +286 -0
  213. package/dist/sessions/vocab-load.d.ts +26 -0
  214. package/dist/sessions/vocab-load.js +61 -0
  215. package/dist/sessions/vscode-copilot.d.ts +38 -0
  216. package/dist/sessions/vscode-copilot.js +477 -0
  217. package/package.json +4 -5
  218. package/vocab/crates.json +1 -0
  219. package/vocab/go.json +1 -0
  220. package/vocab/harness.json +1 -0
  221. package/vocab/homebrew.json +1 -0
  222. package/vocab/manifest.json +1 -0
  223. package/vocab/maven.json +1 -0
  224. package/vocab/models.json +1 -0
  225. package/vocab/npm.json +1 -0
  226. package/vocab/programs.json +1 -0
  227. package/vocab/pypi.json +1 -0
  228. package/vocab/rubygems.json +1 -0
  229. package/dist/commands/deploy-input.d.ts +0 -35
  230. package/dist/commands/deploy-input.js +0 -107
  231. package/dist/commands/deploy.d.ts +0 -22
  232. package/dist/commands/deploy.js +0 -120
  233. package/dist/commands/status.d.ts +0 -7
  234. package/dist/commands/status.js +0 -18
  235. package/dist/commands/test-charge.d.ts +0 -11
  236. package/dist/commands/test-charge.js +0 -34
  237. package/dist/journal.d.ts +0 -26
  238. package/dist/journal.js +0 -58
  239. package/parity/deploy-plans/paid-api.json +0 -34
  240. package/parity/deploy-plans/per-task-agent.json +0 -34
@@ -0,0 +1,644 @@
1
+ import type { CanonicalAction } from './actions.js';
2
+ import type { RepoSize } from './public-vocabulary.js';
3
+ import type { SessionFunnel, SessionSetup, SessionTrust } from './session-shape.js';
4
+ /** Stamped `cv` on every captured record. Bump it when the captured field list changes or a stored value of an existing captured record or skeleton changes: a bump re-reads every transcript. */
5
+ export declare const CAPTURE_VERSION = "17";
6
+ /** Capture versions the reader derives from. A version-3 record is upgraded on read; a newer one is read for the fields this code knows. */
7
+ export declare const OLDEST_READABLE_CAPTURE = 3;
8
+ /** Stamped `v` on every derived record. A bump re-derives from the log; no transcript is read. */
9
+ export declare const EXTRACTOR_VERSION = "12";
10
+ export declare const PROMPT_HEAD_CHARS = 300;
11
+ export declare const ERROR_EXAMPLE_CHARS = 160;
12
+ /** The reference scripts cut a normalized signature at 110 characters. */
13
+ export declare const SIGNATURE_CHARS = 110;
14
+ /** An error-line's `line` is redacted, then cut to this many characters (spec Section 1.2; version 3 stored it uncut). */
15
+ export declare const ERROR_LINE_CHARS = 1000;
16
+ /** Per-session cap on `files` and `fileHashes` (L3): the hand run on the copy store had p99 61 and max 209 files per session; 100 is the round number above p99. */
17
+ export declare const FILES_PER_SESSION_MAX = 100;
18
+ export declare const PROMPT_CLASSES: readonly ["no-tools", "orchestration", "research", "edit-verify", "edit-only", "explore-only", "shell-only", "mixed"];
19
+ export type PromptClass = (typeof PROMPT_CLASSES)[number];
20
+ /** The statuses agents recover from differently (pool vocabulary spec Section 7); any other status is `other`. */
21
+ export declare const HTTP_STATUSES: readonly ["400", "401", "403", "404", "408", "409", "413", "429", "500", "502", "503", "504", "529"];
22
+ /** A shell exit status by what the agent does next: success flagged as failure, the two common failures, not executable, not found, a signal (129 to 192), and the rest. */
23
+ export declare const EXIT_CLASSES: readonly ["0", "1", "2", "126", "127", "signal"];
24
+ /** What a harness says when a call fails before or without a shell: it names the harness's own refusal, never the tool's input or output. */
25
+ export declare const HARNESS_ERROR_CLASSES: readonly ["user-rejected", "interrupted", "permission-denied", "input-validation", "tool-use-error", "timeout"];
26
+ /** The `errorCode` of a failed call (class P): a member of this set, never text from the result. `other` covers an exit status or HTTP status outside the lists, and a failure that names no class. */
27
+ export declare const ERROR_CODES: ReadonlySet<string>;
28
+ export interface Usage {
29
+ input: number;
30
+ cacheWrite: number;
31
+ cacheRead: number;
32
+ output: number;
33
+ thinking: number;
34
+ }
35
+ export type Harness = 'claude-code' | 'cursor' | 'codex' | 'copilot' | 'gemini' | 'grok' | 'vscode-copilot';
36
+ /** The harness a session record came from; a record that does not name one is Claude Code's. */
37
+ export declare const harnessOf: (session: {
38
+ harness?: Harness;
39
+ }) => Harness;
40
+ /** A language's share of the files a transcript touched (pool vocabulary spec Section 7): none, incidental, secondary, primary. The lower edge is inclusive, so 10 percent is secondary and 50 is primary. */
41
+ export declare const LANGUAGE_SHARES: readonly ["0", "under-10", "10-50", "over-50"];
42
+ export type LanguageShare = (typeof LANGUAGE_SHARES)[number];
43
+ /** A repository's tracked-file count by order of magnitude (Section 7). The lower edge is inclusive, so exactly 100 is `100-1k` and exactly 100000 is `over-100k`, as `repoSizeOf` buckets them. */
44
+ export declare const REPO_FILE_BUCKETS: readonly ["under-100", "100-1k", "1k-10k", "10k-100k", "over-100k"];
45
+ export type RepoFilesBucket = (typeof REPO_FILE_BUCKETS)[number];
46
+ /**
47
+ * The stack strata of a session or a prompt (CAPTURE 14, class A): kept beside `frame`, not inside `frame.stack`, because the wire refuses any extra key
48
+ * in a stack. `languages` lists each touched language of the pinned list (else `other`) with its share bucket, `repoFiles` is the git index's count
49
+ * bucketed (null when there is no index), `frameworks` are the vocabulary's frameworks that a resolved package shows, and `explore` counts the steps that
50
+ * only look: `file.read`, `file.search`, `web.search`, and `web.fetch`. A prompt's `explore` is its own; the rest is the file's.
51
+ */
52
+ export interface Strata {
53
+ languages: Array<{
54
+ language: string;
55
+ share: LanguageShare;
56
+ }>;
57
+ repoFiles: RepoFilesBucket | null;
58
+ frameworks: string[];
59
+ explore: number;
60
+ }
61
+ /** Where a path target is hashed from (class P): the repository root, or the line's working directory when no repository holds the path. */
62
+ export type TargetBase = 'repo' | 'cwd';
63
+ /** The closed vocabulary of a repository: languages, framework names, and a size bucket (D13). Class P. */
64
+ export interface FrameStack {
65
+ languages: string[];
66
+ frameworks: string[];
67
+ size: RepoSize | null;
68
+ }
69
+ /**
70
+ * Where and when something ran (recall spec Section 2.1): the coordinate every comparison uses. The joined frame is class A (EXTRACTOR 11); its fields pool only as cells, and every field is a public name, a
71
+ * UTC day, or null, and a cell is never served below the cell floor, because a set of tools can fingerprint an account. Its `shell` and `stack`
72
+ * belong to the file at this `rev`, so capturing a transcript that has grown can change the `frameId` of its earlier prompts.
73
+ */
74
+ export interface Frame {
75
+ harness: Harness;
76
+ /** The version the prompt's own lines name, else the transcript's last. */
77
+ harnessVersion: string | null;
78
+ /** The prompt's majority model. */
79
+ model: string | null;
80
+ /** The prompt's majority effort. */
81
+ effort: string | null;
82
+ /** The UTC day of the prompt (D1 pools `ts` at a UTC day); the first timestamp of the file on a session's own frame. */
83
+ day: string | null;
84
+ /** `process.platform` of the capturing machine. */
85
+ platform: string;
86
+ /** The file's majority shell tool; null when it ran none, or when the harness does not name its shell. */
87
+ shell: string | null;
88
+ stack: FrameStack;
89
+ }
90
+ /** The environment a transcript was captured in (class P, names and versions only; library versions only when a transcript states them, L6). */
91
+ export interface CaptureEnv {
92
+ /** The harness version the transcript's last versioned line names; null when none. */
93
+ harness: string | null;
94
+ /** The oars package version that captured it. */
95
+ oars: string;
96
+ /** The Node.js version that captured it. */
97
+ node: string;
98
+ /** `process.platform` of the capturing machine. */
99
+ os: string;
100
+ }
101
+ /**
102
+ * One per transcript, captured: the `parse_sessions.py` record, minus anything that is raw content. Classes (spec Section 1.2):
103
+ * `L` local-only: `project`, `files`. `A` account store: `session`, `parent`, `spawnedBy`, `spawnedIn`, `branches`, `urls`, `searches`, `tldrs`,
104
+ * `confidences`, `promptFingerprint`, `repo`, `fileHashes`, `tools`, `setup`, `funnel`, `trust`, `at`, `tsFirst`, `tsLast`. `P` pooled: `kind`, `cv`, `rev`, `sid`,
105
+ * the counts, `versions`, `models`, `env`, `costUsd`, `usage` (`at`, `tsFirst`, and `tsLast` at UTC day). `agentType`, `frame`, and `frameId` moved to `A` at EXTRACTOR 11:
106
+ * a custom agent's name is private, and the joined frame is one value that links rows.
107
+ */
108
+ export interface SessionObservation {
109
+ kind: 'session';
110
+ /**
111
+ * The tool the transcript came from (class P). Only a non-default source writes it: absent reads as `claude-code` (`harnessOf`), so
112
+ * the Claude Code path's records and CAPTURE_VERSION are unchanged and an older oars reads a Cursor session as a session with no harness version.
113
+ */
114
+ harness?: Harness;
115
+ /** CAPTURE_VERSION (a version-2 line has `v` instead). Class P. */
116
+ cv: string;
117
+ /** The first 8 hex characters of SHA-256 of the salt this record's hashes used; null on a record captured before version 4. Class P. */
118
+ sid: string | null;
119
+ /** The session id, or `<parent>~<path>` for a subagent transcript (`<parent>~agent-x`, `<parent>~wf_y~agent-x`). */
120
+ session: string;
121
+ project: string;
122
+ /** The main session a subagent transcript belongs to; null for a main transcript. */
123
+ parent: string | null;
124
+ /** The subagent type from the transcript's `.meta.json` (`general-purpose`, `Explore`); null for a main transcript. Class A: a custom agent's name is private. */
125
+ agentType: string | null;
126
+ /** The parent's `Agent` tool call that spawned this subagent (the meta file's `toolUseId`); null for a main transcript. */
127
+ spawnedBy: string | null;
128
+ /** The transcript holding that call, so `parent` and `spawned` on this transcript's steps have an address: the main session or a sibling subagent's id; null when not known. */
129
+ spawnedIn: string | null;
130
+ rev: number;
131
+ /** When this deposit ran (ISO 8601). */
132
+ at: string;
133
+ bytes: number;
134
+ lines: number;
135
+ badLines: number;
136
+ userTurns: number;
137
+ assistantTurns: number;
138
+ tsFirst: string | null;
139
+ tsLast: string | null;
140
+ versions: string[];
141
+ models: {
142
+ [model: string]: number;
143
+ };
144
+ branches: string[];
145
+ tools: {
146
+ [tool: string]: number;
147
+ };
148
+ /** Class L: the touched file paths as written, redacted. */
149
+ files: string[];
150
+ /** Class A: the per-account salted hash (16 hex characters) of each touched file, relative to the repository root, sorted. */
151
+ fileHashes: string[];
152
+ /** Class A: the salted hash of the repository identity (normalized `origin` remote, else the root path) the transcript's working directory sits in; null when none holds it. */
153
+ repo: string | null;
154
+ urls: string[];
155
+ searches: string[];
156
+ bashCmds: number;
157
+ tldrs: string[];
158
+ confidences: string[];
159
+ compactSummaries: number;
160
+ /** Class A: fingerprint of the `prompt_snapshot` attachment when present, else null (version 3's `contextFingerprint` mixed in the environment). */
161
+ promptFingerprint: string | null;
162
+ /** Class P: where and with what this transcript was captured. */
163
+ env: CaptureEnv;
164
+ /** The frame of a call before the file's first prompt; absent on a record captured before this field existed. Class A (EXTRACTOR 11): its fields pool only as cells. */
165
+ frame?: Frame;
166
+ /** The hash of `frame`. Class A: one value over the whole frame links rows. */
167
+ frameId?: string;
168
+ /** The stack strata of the file (CAPTURE 14). Class A; absent on a record captured earlier. */
169
+ strata?: Strata;
170
+ /** The harness's own `cost-state` totals when the file has one. */
171
+ costUsd: number | null;
172
+ /** Summed assistant usage of the file's own line (a main transcript's sidechain lines are not counted; a subagent transcript is its own line). */
173
+ usage: Usage;
174
+ /** What the transcript shows of the setup the session ran with (class A); absent when it shows none, and on a record captured before version 12. */
175
+ setup?: SessionSetup;
176
+ /** The tool names at each funnel stage the transcript shows (class A); same absence rules. */
177
+ funnel?: SessionFunnel;
178
+ /** How often a human or a policy stopped the session and how long it ran alone (class A); same absence rules. */
179
+ trust?: SessionTrust;
180
+ }
181
+ /**
182
+ * What the last build or test runner after a prompt's last edit returned: `passed` and `failed` when the call's status reads that runner,
183
+ * `masked` when a pipe or a later command hides its exit, `none` when no runner ran or its call has no result, `na` when the prompt edited nothing.
184
+ */
185
+ export type PromptVerify = 'passed' | 'failed' | 'masked' | 'none' | 'na';
186
+ /** How the operator cut a prompt short: Esc or a new message (`interrupt`), or declining a tool call (`rejected`). */
187
+ export type PromptStop = 'interrupt' | 'rejected';
188
+ /**
189
+ * One per user prompt: the `prompt_graphs.py` and `cost_per_class.py` records joined. Derived. Classes: `session`,
190
+ * `contextFingerprint`, `frame`, `head`, `ts`, `skills`, `verify`, `stopped`, `commits`, and `redo` (A); `kind`, `v`, `rev`, `index`, `wallSec`, `cls`, `tools`,
191
+ * `shape`, `errors`, `thinking`, `sideTools`, `turns`, `model`, `efforts`, `usage`, `recovery`, `explore`, `act`, and `bigrams` (P).
192
+ */
193
+ export interface PromptObservation {
194
+ kind: 'prompt';
195
+ /** Where and when the prompt ran, from its capture record; absent on a record captured before frames existed. Class A (EXTRACTOR 11). */
196
+ frame?: Frame;
197
+ v: string;
198
+ session: string;
199
+ rev: number;
200
+ index: number;
201
+ ts: string | null;
202
+ /** Seconds from the prompt to the last main-line line before the next prompt; null when a timestamp is missing. */
203
+ wallSec: number | null;
204
+ /** The first 300 characters, redacted. */
205
+ head: string;
206
+ cls: PromptClass;
207
+ /** The main-line tool names in order (MCP names shortened). */
208
+ tools: string[];
209
+ /** The run-length shape, for example `Read>Editx2>Bash`. */
210
+ shape: string;
211
+ errors: number;
212
+ thinking: number;
213
+ sideTools: number;
214
+ turns: number;
215
+ model: string;
216
+ efforts: string[];
217
+ skills: string[];
218
+ usage: Usage;
219
+ /** The two tools after the first error of each error run (the recovery pair); empty when no error. */
220
+ recovery: string[];
221
+ explore: number;
222
+ /** The user prompt's stack strata with its own action-based `explore` count (CAPTURE 14), carried through derive so the skeleton can send them; absent on a record captured earlier. */
223
+ strata?: Strata;
224
+ act: number;
225
+ /** Transition bigrams `a>b` of `tools`, with counts. */
226
+ bigrams: {
227
+ [bigram: string]: number;
228
+ };
229
+ /** The session's prompt fingerprint at the time of the prompt (kept under this name on the derived record), when one had been seen. */
230
+ contextFingerprint: string | null;
231
+ /** Exit status of a build or test runner, not its coverage. Undefined when a shell call after the edit was captured before `segments` (CAPTURE 6), which cannot say what ran. */
232
+ verify?: PromptVerify;
233
+ stopped?: PromptStop | null;
234
+ /** Commits the prompt's shell calls made, from the captured `commits`. A record captured before CAPTURE 6 counts only a first-line `git commit`. */
235
+ commits?: number;
236
+ /** A later prompt edited a path this one edited, within `REDO_WINDOW` prompts, with no commit `commits` can see between them. */
237
+ redo?: boolean;
238
+ }
239
+ /**
240
+ * One per tool error: the `error_signatures.py` record. Derived. Classes: `session`, `agent`, `ts`, `sig`, `example` (A); `kind`, `v`,
241
+ * `rev`, `tool`, `harnessVersion`, `editFollowed`, `next`, `prompt`, `cls` (P).
242
+ */
243
+ export interface ErrorObservation {
244
+ kind: 'error';
245
+ v: string;
246
+ session: string;
247
+ rev: number;
248
+ ts: string | null;
249
+ harnessVersion: string | null;
250
+ tool: string;
251
+ /** `<tool> | <normalized first informative line>`, the reference scripts' key. */
252
+ sig: string;
253
+ /** The first informative line, 160 characters, redacted. */
254
+ example: string;
255
+ /** The call this result answers, class A (a join id): an uncaptured store keeps a replayed result's line beside the first, so one call is one id. Absent on a version-2 deposit. */
256
+ toolUseId?: string | null;
257
+ /** The next two tool calls after the error (any line, in file order). */
258
+ next: string[];
259
+ /** Whether an Edit, Write, or MultiEdit came within six tool calls. */
260
+ editFollowed: boolean;
261
+ /** The prompt this error happened in (null before the first prompt) and its class. */
262
+ prompt: number | null;
263
+ cls: PromptClass | null;
264
+ /**
265
+ * Set when a subagent made the call: its transcript (`<parent>~agent-x`), class A (a join id). `session` is then the main session that spawned
266
+ * it, and `prompt` and `cls` are the spawning prompt's.
267
+ */
268
+ agent?: string;
269
+ }
270
+ export type ToolStatus = 'ok' | 'error' | 'none';
271
+ /** A package a shell step pulled, in public names (`<literal>` outside the allowlist). */
272
+ export interface PullIdentity {
273
+ registry: string;
274
+ name: string;
275
+ /** Null when the command stated none. */
276
+ version: string | null;
277
+ }
278
+ /** A shell step: its program, subcommand, and flag names, sorted and single. Never a flag's value. */
279
+ export interface ShellIdentity {
280
+ program: string;
281
+ sub: string | null;
282
+ flags: string[];
283
+ /** Absent when the command pulled nothing. */
284
+ pulls?: PullIdentity[];
285
+ }
286
+ export type StepIdentity = ShellIdentity | {
287
+ server: string;
288
+ tool: string;
289
+ } | {
290
+ skill: string;
291
+ } | {
292
+ host: string | null;
293
+ } | null;
294
+ export interface StepCost {
295
+ /** The output tokens of the call's response, shared evenly among that response's calls; null when it reported none. */
296
+ tokens: number | null;
297
+ durationMs: number | null;
298
+ }
299
+ /**
300
+ * How a step came about (recall spec Section 2.3), naming the step it came from by position. `next`: order within a prompt's line of work.
301
+ * `spawned`: the call that started this subagent, in the transcript its session record names as `spawnedIn`. `retried`: the same native name and the same redacted command or target, after that one failed.
302
+ * `after-error`: the call before this one failed.
303
+ */
304
+ export interface StepEdge {
305
+ kind: 'next' | 'spawned' | 'retried' | 'after-error';
306
+ n: number;
307
+ seg: number;
308
+ }
309
+ /** One observed event in the canonical vocabulary of any harness (recall spec Section 2.2). Class P but for `frameId`, which is class A (EXTRACTOR 11): it holds only positions and public names. */
310
+ export interface StepObservation {
311
+ /** The `n` of the tool call this step came from. */
312
+ n: number;
313
+ /** Its position among that call's steps, from 0. */
314
+ seg: number;
315
+ action: CanonicalAction;
316
+ /** The harness's own name for the tool when the action table lists it or every name it holds is public, else `<literal>` (the tool record keeps it, class A). */
317
+ native: string;
318
+ /** What the step acted on, in public names only; null for an action that has none (a file's path never appears here). */
319
+ identity: StepIdentity;
320
+ /** The call's status when it reports this segment; `none` for a segment it does not, such as one a pipe hides. */
321
+ status: ToolStatus;
322
+ /** Held on the first segment of a call; a later segment has nulls. */
323
+ cost: StepCost;
324
+ /** On a subagent's step, the `n` of the call that spawned it, in the transcript its session record names as `spawnedIn`; null otherwise or when that call is not known. */
325
+ parent: number | null;
326
+ /** The edges that arrive at this step. */
327
+ edges: StepEdge[];
328
+ /** The frame of the call's prompt, or the session's own frame before the first prompt. Class A (EXTRACTOR 11). */
329
+ frameId: string;
330
+ }
331
+ /**
332
+ * One per tool call (register A28), captured. Classes: `A` account store: `session`, `parent`, `toolUseId`, `ts`, `tool`, and `target`
333
+ * in either form (a salted hash, or a program and subcommand); `P` pooled: `kind`, `cv`, `sid`, `rev`, `n`, `status`,
334
+ * `durationMs`, `harnessVersion`, `side`, `prompt`, `targetBase`, and `steps`. `agentType` and `keys` moved to `A` at EXTRACTOR 11 (a custom agent's name and a private MCP tool's input keys are private). `tool` and a shell-form `target` moved to `A` at CAPTURE 9: an MCP
335
+ * tool name holds a private server's name and a shell word can be anything, and `steps` carries the public reading of both. `segments`, `pulls`,
336
+ * and `commits` are `A`: a plain word, a private package name, and a sha can each identify private work.
337
+ */
338
+ export interface ToolObservation {
339
+ kind: 'tool';
340
+ cv: string;
341
+ sid: string | null;
342
+ session: string;
343
+ rev: number;
344
+ /** The main session id: the session itself, or the parent of a subagent transcript. */
345
+ parent: string;
346
+ /** The subagent type when the call ran inside one; null on a main transcript. Class A (EXTRACTOR 11). */
347
+ agentType: string | null;
348
+ /** The call's position among the file's tool calls, from 0. */
349
+ n: number;
350
+ ts: string | null;
351
+ tool: string;
352
+ /** The first result's status: `error` when it failed, `ok` when it came back clean, `none` when no result is in the file. */
353
+ status: ToolStatus;
354
+ /**
355
+ * For a call with a path input (`file_path`, `notebook_path`, `path`): a per-account salted SHA-256 (16 hex characters) of the path
356
+ * relative to the repository root of the line's `cwd` (else to the `cwd`: see `targetBase`). For a shell call: its program and subcommand (`shellTarget` in extract.ts, as
357
+ * recovery_episodes.py computes it), redacted. Else null.
358
+ */
359
+ target: string | null;
360
+ /** For a path target: `repo` when it was hashed relative to the repository root, `cwd` when no repository held it; null for any other target. */
361
+ targetBase: TargetBase | null;
362
+ /** The input's key names, sorted. Class A (EXTRACTOR 11). */
363
+ keys: string[];
364
+ /** The class of a failed call (`errorCodeOf`): a member of `ERROR_CODES`, never result text. Absent on a call that did not fail and on a record captured before CAPTURE 14. Class P. */
365
+ errorCode?: string;
366
+ /** From the call's line to its first result's line; null when either timestamp is missing or no result is in the file. */
367
+ durationMs: number | null;
368
+ toolUseId: string | null;
369
+ harnessVersion: string | null;
370
+ /** A sidechain line inside a main transcript. */
371
+ side: boolean;
372
+ /** The prompt index the call ran under; null before the first prompt. */
373
+ prompt: number | null;
374
+ /** What the call was in the canonical vocabulary; absent on a record captured before this field existed. Class P. */
375
+ steps?: StepObservation[];
376
+ /** Each command of a shell call, in order (CAPTURE 6); on every shell call and no other. Absent on a record captured earlier. */
377
+ segments?: ShellSegment[];
378
+ /** What the call pulled (CAPTURE 6). Absent when it pulled nothing. */
379
+ pulls?: ToolPull[];
380
+ /** The packages the call installs or runs, resolved; absent when it names none (CAPTURE 14). Class A. */
381
+ packages?: ToolPackage[];
382
+ /** The dependency names a call read, wrote, or edited in a manifest (CAPTURE 14). Class A. */
383
+ manifest?: ToolManifest;
384
+ /** One entry per commit a clean shell call made, in order: the sha its result names, or null when it names none (CAPTURE 6). Absent when it made none. */
385
+ commits?: Array<string | null>;
386
+ }
387
+ /** One command of a shell call. */
388
+ export interface ShellSegment {
389
+ /** The program's basename and its plain words: no flags, paths, variables, or quoted text; redacted. */
390
+ run: string;
391
+ /** Whether the call's status reports this command: false when a pipe follows it, a later `;`, `&`, newline, or `||` overrides it, or it runs in the background. */
392
+ read: boolean;
393
+ }
394
+ /** One package a call installs or runs, as capture resolved it (class A: a private package's name identifies private work). `package` is `<ecosystem>:<name>` in the registry's spelling, `packageVersion` an exact published version or null. */
395
+ export interface ToolPackage {
396
+ package: string;
397
+ packageVersion: string | null;
398
+ /** True on the first call of the transcript file that names this package at this version (package health counts only that call). */
399
+ first: boolean;
400
+ }
401
+ /** What a call showed of a dependency manifest (class A, CAPTURE 14): names as `<ecosystem>:<name>`. A Read's result and a Write's content list `seen`; an Edit's text gives the names it `added` and `removed`. Absent when none is shown. */
402
+ export interface ToolManifest {
403
+ file: 'package.json' | 'requirements.txt' | 'Cargo.toml';
404
+ seen: string[];
405
+ added: string[];
406
+ removed: string[];
407
+ }
408
+ export type PullEcosystem = 'npm' | 'pypi' | 'cargo' | 'go' | 'gem' | 'brew' | 'skill' | 'plugin' | 'mcp';
409
+ /** One package, MCP server, plugin, or skill a call names as pulled. No registry is asked, so the name is what the command says, redacted. */
410
+ export interface ToolPull {
411
+ ecosystem: PullEcosystem;
412
+ name: string;
413
+ /** The version as stated, with its comparator unless that is `==`; null when none is stated. */
414
+ version: string | null;
415
+ }
416
+ /** One per failed tool result, captured and keyed by `toolUseId`. Classes: `A` account store: `session`, `toolUseId`, `tool`, `line`
417
+ * (switchable text), `ts`; `P` pooled: `kind`, `cv`, `sid`, `rev`, `harnessVersion`, `side`, `prompt`, `after`. */
418
+ export interface ErrorLineObservation {
419
+ kind: 'error-line';
420
+ cv: string;
421
+ sid: string | null;
422
+ session: string;
423
+ rev: number;
424
+ toolUseId: string | null;
425
+ /** The name of the call the result answers, `?` when the call is not in the file. */
426
+ tool: string;
427
+ /** The first informative line, redacted, not normalized, then cut to {@link ERROR_LINE_CHARS}. */
428
+ line: string;
429
+ ts: string | null;
430
+ harnessVersion: string | null;
431
+ side: boolean;
432
+ prompt: number | null;
433
+ /** How many tool calls came before this result in the file, so derive can read what followed it. */
434
+ after: number;
435
+ }
436
+ /** How a prompt opened: `typed`, the operator's own line, or `command`, a slash command or a skill. Closed: it never names the command. Class P. */
437
+ export type PromptOpened = 'typed' | 'command';
438
+ /**
439
+ * One per user prompt, captured: what the transcript says about a prompt besides its tool calls. Classes: `A` account store: `session`, `head` (switchable text),
440
+ * `ts`, `promptFingerprint`, `skills` (a skill's name can be private), `frame`, `frameId` (the joined frame links rows); `P` pooled: `kind`, `cv`, `sid`, `rev`, `index`, `wallSec`, `thinking`, `turns`, `model`, `efforts`, `usage`, `opened`. Derive joins it with the prompt's tool calls and errors into a {@link PromptObservation}.
441
+ */
442
+ export interface UserPromptObservation {
443
+ kind: 'user-prompt';
444
+ cv: string;
445
+ sid: string | null;
446
+ session: string;
447
+ rev: number;
448
+ index: number;
449
+ ts: string | null;
450
+ wallSec: number | null;
451
+ head: string;
452
+ /** Absent on a record captured before CAPTURE 10, when only a typed line opened a prompt. */
453
+ opened?: PromptOpened;
454
+ thinking: number;
455
+ turns: number;
456
+ model: string;
457
+ efforts: string[];
458
+ skills: string[];
459
+ usage: Usage;
460
+ /** Class A: the session's prompt fingerprint at the time of the prompt, when one had been seen. */
461
+ promptFingerprint: string | null;
462
+ /** Where and when this prompt ran; absent on a record captured before this field existed. Class A (EXTRACTOR 11): its fields pool only as cells. */
463
+ frame?: Frame;
464
+ /** The hash of `frame` (`frameIdOf`). Class A (EXTRACTOR 11). */
465
+ frameId?: string;
466
+ /** The stack strata of the file with this prompt's own `explore` count (CAPTURE 14). Class A; absent on a record captured earlier. */
467
+ strata?: Strata;
468
+ }
469
+ export type CaptureRecord = SessionObservation | UserPromptObservation | ToolObservation | ErrorLineObservation;
470
+ /** What a reader finds in the log: version-3 or later capture records, or the version-2 derived lines of a session not deposited since. */
471
+ export type Observation = CaptureRecord | PromptObservation | ErrorObservation;
472
+ /** One recurring-signature record of `derived.json`. */
473
+ export interface SignatureRecord {
474
+ v: string;
475
+ sig: string;
476
+ tool: string;
477
+ example: string;
478
+ sessions: number;
479
+ count: number;
480
+ firstSeen: string | null;
481
+ lastSeen: string | null;
482
+ harnessVersions: string[];
483
+ /** Tools that followed, by count. */
484
+ following: {
485
+ [tool: string]: number;
486
+ };
487
+ editFollowed: number;
488
+ }
489
+ export interface DerivedRecords {
490
+ v: string;
491
+ at: string;
492
+ sessions: number;
493
+ signatures: SignatureRecord[];
494
+ /** Transition bigram counts over all prompts. */
495
+ bigrams: {
496
+ [bigram: string]: number;
497
+ };
498
+ /** Recovery pair counts (`Bash>Write`) over all prompts. */
499
+ recovery: {
500
+ [pair: string]: number;
501
+ };
502
+ /** Prompts per class and the mean explore-to-act ratio of each class. */
503
+ classes: {
504
+ [cls: string]: {
505
+ prompts: number;
506
+ exploreToAct: number;
507
+ };
508
+ };
509
+ /** The per-session summaries (the session observations, latest rev). */
510
+ summaries: SessionSummary[];
511
+ }
512
+ export interface SessionSummary {
513
+ session: string;
514
+ project: string;
515
+ prompts: number;
516
+ errors: number;
517
+ tools: number;
518
+ tsFirst: string | null;
519
+ tsLast: string | null;
520
+ tldrs: number;
521
+ }
522
+ /** One per line of a session file: ids and structure, with a SHA-256 in place of every content field. Class A (a pool would hold only the skeleton's `merkleRoot` and `leaves`). */
523
+ export interface SkeletonLine {
524
+ n: number;
525
+ type: string | null;
526
+ uuid: string | null;
527
+ parentUuid: string | null;
528
+ ts: string | null;
529
+ /** `user` or `assistant` for a message line. */
530
+ role: string | null;
531
+ tools: Array<{
532
+ id: string | null;
533
+ name: string;
534
+ }>;
535
+ /** The `tool_use_id` of each `tool_result` block. */
536
+ results: Array<string | null>;
537
+ usage: Usage | null;
538
+ /** True when the line reports `output_tokens_details.thinking_tokens` (`usage.thinking` is 0 for a line that does not). */
539
+ hasThinking: boolean;
540
+ model: string | null;
541
+ version: string | null;
542
+ requestId: string | null;
543
+ apiBlockIndex: number | null;
544
+ /** SHA-256 of each content block (its text, or its JSON for a block with no text). */
545
+ hashes: string[];
546
+ /** The harness's `cost-state` totals as read, for the sum invariant. */
547
+ costState: CostState | null;
548
+ }
549
+ export interface CostState {
550
+ /**
551
+ * The line's `startTime` as an ISO timestamp: the harness process the totals cover began then, so a resumed session's earlier
552
+ * lines are not in them. Null when the line has none.
553
+ */
554
+ since: string | null;
555
+ input: number | null;
556
+ cacheWrite: number | null;
557
+ cacheRead: number | null;
558
+ output: number | null;
559
+ /**
560
+ * The models in `modelUsage`, sorted by name, each with the usage keys its entry reported a nonzero amount on: a model no assistant line names
561
+ * is a harness side call, and only on a key it reported a nonzero amount on. A skeleton written before the keys were recorded reads with `[]`.
562
+ */
563
+ models: CostModel[];
564
+ }
565
+ /** One `modelUsage` entry: the model's name and which of the four usage keys it reported a nonzero amount on (the transcript writes zeros for the rest). */
566
+ export interface CostModel {
567
+ model: string;
568
+ keys: UsageKey[];
569
+ }
570
+ export type UsageKey = 'input' | 'cacheWrite' | 'cacheRead' | 'output';
571
+ /** The per-session skeleton in `skeletons/<session>.json`. `lines` is class A; a pool would hold only `merkleRoot` and `leaves`. */
572
+ export interface Skeleton {
573
+ /** CAPTURE_VERSION: the skeleton is written at capture. */
574
+ v: string;
575
+ session: string;
576
+ project: string;
577
+ /** SHA-256 Merkle root over the SHA-256 of every raw line (an odd node pairs with itself); the leaves are not stored. */
578
+ merkleRoot: string;
579
+ leaves: number;
580
+ lines: SkeletonLine[];
581
+ }
582
+ /** One MCP recall call, appended to `mcp-calls.jsonl` by the server itself. Class A: `query` and `at`; L: `cwd`; P: `matches`. */
583
+ export interface RecallCall {
584
+ at: string;
585
+ query: string;
586
+ matches: number;
587
+ /** Class L: the server's working directory, unhashed; `measure --repo` scopes calls by it. Calls written before it existed have none and count for every repository. */
588
+ cwd?: string;
589
+ }
590
+ /** One hook invocation, appended to `hook-calls.jsonl` by the hook itself; `measure` counts these per session. Class A: `session`, `at`, `error`; P: `event`, `hit`, `ms`, `startMs`. */
591
+ export interface HookCall {
592
+ at: string;
593
+ event: 'session-start' | 'pre-tool' | 'post-tool' | 'stop' | 'nightly';
594
+ /** The Claude Code session the hook ran in; null for the nightly run. */
595
+ session: string | null;
596
+ /** Whether the hook had something to say (an injected block, a recall hit, or a session deposited). */
597
+ hit: boolean;
598
+ /** In-process work: from the start of `runHook` to the row. */
599
+ ms: number;
600
+ /** The process time before `runHook` began (node start, module load, and the stdin read); `startMs + ms` is the field figure. Calls written before it existed have none. */
601
+ startMs?: number;
602
+ /** The failure's first informative line, redacted and cut to 300 characters, when the hook failed (it still exits 0); null when it ran clean. */
603
+ error: string | null;
604
+ }
605
+ /** The pipeline steps the log names (runtime-commons pipeline spec 3.1); `label` is the local labeler step (A5) that no command runs yet; `index` is the hook-index write the nightly and manual runs log. */
606
+ export declare const STEPS: readonly ["deposit", "verify", "derive", "label", "index", "recall", "read"];
607
+ export type Step = (typeof STEPS)[number];
608
+ /** The trigger names of spec 4.1 (the ones nothing local starts are in the schema only: `weekly` (A21) and the hosted `sync`, `cron`, `release`, `run-end`, and `run-start`). The SessionEnd hook is `stop`, never `session-end`. */
609
+ export declare const TRIGGERS: readonly ["session-start", "pre-tool", "post-tool", "stop", "nightly", "manual", "weekly", "sync", "cron", "release", "run-end", "run-start"];
610
+ export type Trigger = (typeof TRIGGERS)[number];
611
+ /** `deferred`: a Stop deposit that found the store locked and recorded its session in the pending list. It is neither a success nor a failed run. */
612
+ export declare const STEP_STATUSES: readonly ["ok", "error", "skipped", "deferred"];
613
+ export type StepStatus = (typeof STEP_STATUSES)[number];
614
+ /** Counts by record kind or type (`{"session": 1, "tool": 212}`). */
615
+ export interface StepCounts {
616
+ [kind: string]: number;
617
+ }
618
+ /**
619
+ * One run of one pipeline step, appended to `pipeline-runs.jsonl` when the step ends (spec 3.1). A store-level file beside
620
+ * `hook-calls.jsonl`, so it carries no capture `cv` of its own. Classes: `A` account store: `run`, `key`, `error`, `at` (a pool would
621
+ * keep the UTC day); `P` pooled: `trigger`, `step`, `status`, `ms`, `in`, `out`, `cv`, `ev`, `lv`.
622
+ */
623
+ export interface StepRow {
624
+ at: string;
625
+ /** A local run id; the steps of one nightly run share it. */
626
+ run: string;
627
+ trigger: Trigger;
628
+ step: Step;
629
+ status: StepStatus;
630
+ ms: number;
631
+ in: StepCounts;
632
+ out: StepCounts;
633
+ /** The CAPTURE_VERSION and EXTRACTOR_VERSION the step ran at. */
634
+ cv: string;
635
+ ev: string;
636
+ /** The labeler stamp, on `label` rows only. */
637
+ lv?: string;
638
+ /** The step's idempotency key (spec 4.2), a hash, so a repeat is visible; null when the step was skipped before it had one. */
639
+ key: string | null;
640
+ /** The first informative line of the failure, redacted; null when `ok`. */
641
+ error: string | null;
642
+ }
643
+ /** Reads one line of `pipeline-runs.jsonl`; undefined when any key is missing or mistyped, so a torn or foreign line is never counted. */
644
+ export declare const parseStepRow: (value: unknown) => StepRow | undefined;