humanish 0.0.1 → 0.15.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 (196) hide show
  1. package/AGENTS.md +77 -0
  2. package/CONTRIBUTING.md +39 -0
  3. package/LICENSE +21 -0
  4. package/README.md +435 -8
  5. package/SECURITY.md +34 -0
  6. package/dist/actor-contract.d.ts +107 -0
  7. package/dist/actor-contract.js +286 -0
  8. package/dist/actor-contract.js.map +1 -0
  9. package/dist/actor-registry.d.ts +73 -0
  10. package/dist/actor-registry.js +93 -0
  11. package/dist/actor-registry.js.map +1 -0
  12. package/dist/adapter-extension.d.ts +54 -0
  13. package/dist/adapter-extension.js +214 -0
  14. package/dist/adapter-extension.js.map +1 -0
  15. package/dist/argv.d.ts +1 -0
  16. package/dist/argv.js +8 -0
  17. package/dist/argv.js.map +1 -0
  18. package/dist/artifact-reference.d.ts +22 -0
  19. package/dist/artifact-reference.js +47 -0
  20. package/dist/artifact-reference.js.map +1 -0
  21. package/dist/browser-evidence-hygiene.d.ts +7 -0
  22. package/dist/browser-evidence-hygiene.js +40 -0
  23. package/dist/browser-evidence-hygiene.js.map +1 -0
  24. package/dist/claude-agent-sdk.d.ts +94 -0
  25. package/dist/claude-agent-sdk.js +356 -0
  26. package/dist/claude-agent-sdk.js.map +1 -0
  27. package/dist/cli.d.ts +2 -0
  28. package/dist/cli.js +5 -0
  29. package/dist/cli.js.map +1 -0
  30. package/dist/codex-app-server-ui.d.ts +39 -0
  31. package/dist/codex-app-server-ui.js +327 -0
  32. package/dist/codex-app-server-ui.js.map +1 -0
  33. package/dist/codex-app-server.d.ts +141 -0
  34. package/dist/codex-app-server.js +747 -0
  35. package/dist/codex-app-server.js.map +1 -0
  36. package/dist/command-failure.d.ts +29 -0
  37. package/dist/command-failure.js +54 -0
  38. package/dist/command-failure.js.map +1 -0
  39. package/dist/computer-use-actor.d.ts +52 -0
  40. package/dist/computer-use-actor.js +48 -0
  41. package/dist/computer-use-actor.js.map +1 -0
  42. package/dist/computer-use.d.ts +232 -0
  43. package/dist/computer-use.js +615 -0
  44. package/dist/computer-use.js.map +1 -0
  45. package/dist/concurrency.d.ts +1 -0
  46. package/dist/concurrency.js +27 -0
  47. package/dist/concurrency.js.map +1 -0
  48. package/dist/concurrent-shared-world-lab.d.ts +115 -0
  49. package/dist/concurrent-shared-world-lab.js +1092 -0
  50. package/dist/concurrent-shared-world-lab.js.map +1 -0
  51. package/dist/core/git-state.d.ts +31 -0
  52. package/dist/core/git-state.js +142 -0
  53. package/dist/core/git-state.js.map +1 -0
  54. package/dist/core/index.d.ts +4 -0
  55. package/dist/core/index.js +3 -0
  56. package/dist/core/index.js.map +1 -0
  57. package/dist/core/run-primitives.d.ts +66 -0
  58. package/dist/core/run-primitives.js +120 -0
  59. package/dist/core/run-primitives.js.map +1 -0
  60. package/dist/cua-actor-lab.d.ts +620 -0
  61. package/dist/cua-actor-lab.js +2834 -0
  62. package/dist/cua-actor-lab.js.map +1 -0
  63. package/dist/device-presets.d.ts +67 -0
  64. package/dist/device-presets.js +50 -0
  65. package/dist/device-presets.js.map +1 -0
  66. package/dist/e2b-desktop-executor.d.ts +101 -0
  67. package/dist/e2b-desktop-executor.js +309 -0
  68. package/dist/e2b-desktop-executor.js.map +1 -0
  69. package/dist/e2b-desktop-launch.d.ts +144 -0
  70. package/dist/e2b-desktop-launch.js +59 -0
  71. package/dist/e2b-desktop-launch.js.map +1 -0
  72. package/dist/e2b-detached.d.ts +53 -0
  73. package/dist/e2b-detached.js +130 -0
  74. package/dist/e2b-detached.js.map +1 -0
  75. package/dist/e2b-terminal-lab.d.ts +345 -0
  76. package/dist/e2b-terminal-lab.js +1467 -0
  77. package/dist/e2b-terminal-lab.js.map +1 -0
  78. package/dist/env-file.d.ts +14 -0
  79. package/dist/env-file.js +108 -0
  80. package/dist/env-file.js.map +1 -0
  81. package/dist/feedback.d.ts +51 -0
  82. package/dist/feedback.js +313 -0
  83. package/dist/feedback.js.map +1 -0
  84. package/dist/image-evidence.d.ts +2 -0
  85. package/dist/image-evidence.js +33 -0
  86. package/dist/image-evidence.js.map +1 -0
  87. package/dist/index.d.ts +63 -0
  88. package/dist/index.js +33 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/init-templates.d.ts +12 -0
  91. package/dist/init-templates.js +369 -0
  92. package/dist/init-templates.js.map +1 -0
  93. package/dist/init.d.ts +26 -0
  94. package/dist/init.js +343 -0
  95. package/dist/init.js.map +1 -0
  96. package/dist/lab-app-runner.d.ts +78 -0
  97. package/dist/lab-app-runner.js +403 -0
  98. package/dist/lab-app-runner.js.map +1 -0
  99. package/dist/lab-config.d.ts +578 -0
  100. package/dist/lab-config.js +1751 -0
  101. package/dist/lab-config.js.map +1 -0
  102. package/dist/lab-engine.d.ts +77 -0
  103. package/dist/lab-engine.js +216 -0
  104. package/dist/lab-engine.js.map +1 -0
  105. package/dist/lab-preflight.d.ts +67 -0
  106. package/dist/lab-preflight.js +385 -0
  107. package/dist/lab-preflight.js.map +1 -0
  108. package/dist/labs.d.ts +53 -0
  109. package/dist/labs.js +176 -0
  110. package/dist/labs.js.map +1 -0
  111. package/dist/observer-assets.d.ts +2 -0
  112. package/dist/observer-assets.js +2630 -0
  113. package/dist/observer-assets.js.map +1 -0
  114. package/dist/observer-data.d.ts +63 -0
  115. package/dist/observer-data.js +145 -0
  116. package/dist/observer-data.js.map +1 -0
  117. package/dist/observer-static.d.ts +39 -0
  118. package/dist/observer-static.js +192 -0
  119. package/dist/observer-static.js.map +1 -0
  120. package/dist/observer.d.ts +46 -0
  121. package/dist/observer.js +353 -0
  122. package/dist/observer.js.map +1 -0
  123. package/dist/openai-responses-cu.d.ts +113 -0
  124. package/dist/openai-responses-cu.js +531 -0
  125. package/dist/openai-responses-cu.js.map +1 -0
  126. package/dist/oss-lab.d.ts +52 -0
  127. package/dist/oss-lab.js +299 -0
  128. package/dist/oss-lab.js.map +1 -0
  129. package/dist/oss-meta-lab-scoring.d.ts +15 -0
  130. package/dist/oss-meta-lab-scoring.js +145 -0
  131. package/dist/oss-meta-lab-scoring.js.map +1 -0
  132. package/dist/oss-meta-lab.d.ts +279 -0
  133. package/dist/oss-meta-lab.js +4889 -0
  134. package/dist/oss-meta-lab.js.map +1 -0
  135. package/dist/oss-remote-telemetry.d.ts +77 -0
  136. package/dist/oss-remote-telemetry.js +403 -0
  137. package/dist/oss-remote-telemetry.js.map +1 -0
  138. package/dist/persona.d.ts +35 -0
  139. package/dist/persona.js +133 -0
  140. package/dist/persona.js.map +1 -0
  141. package/dist/pi-agent-core.d.ts +77 -0
  142. package/dist/pi-agent-core.js +203 -0
  143. package/dist/pi-agent-core.js.map +1 -0
  144. package/dist/program.d.ts +54 -0
  145. package/dist/program.js +2347 -0
  146. package/dist/program.js.map +1 -0
  147. package/dist/redaction.d.ts +90 -0
  148. package/dist/redaction.js +292 -0
  149. package/dist/redaction.js.map +1 -0
  150. package/dist/run.d.ts +784 -0
  151. package/dist/run.js +4555 -0
  152. package/dist/run.js.map +1 -0
  153. package/dist/scripted-browser-actor.d.ts +294 -0
  154. package/dist/scripted-browser-actor.js +1286 -0
  155. package/dist/scripted-browser-actor.js.map +1 -0
  156. package/dist/scripted-browser-lab.d.ts +107 -0
  157. package/dist/scripted-browser-lab.js +738 -0
  158. package/dist/scripted-browser-lab.js.map +1 -0
  159. package/dist/shared-world-lab.d.ts +208 -0
  160. package/dist/shared-world-lab.js +1048 -0
  161. package/dist/shared-world-lab.js.map +1 -0
  162. package/dist/source-archive.d.ts +82 -0
  163. package/dist/source-archive.js +365 -0
  164. package/dist/source-archive.js.map +1 -0
  165. package/dist/stop-conditions.d.ts +26 -0
  166. package/dist/stop-conditions.js +66 -0
  167. package/dist/stop-conditions.js.map +1 -0
  168. package/dist/terminal-agent-actor.d.ts +36 -0
  169. package/dist/terminal-agent-actor.js +23 -0
  170. package/dist/terminal-agent-actor.js.map +1 -0
  171. package/docs/architecture/actor-contract.md +431 -0
  172. package/docs/architecture/github-feedback-loop.md +189 -0
  173. package/docs/architecture/local-codex-tui-actor.md +213 -0
  174. package/docs/architecture/observer.md +118 -0
  175. package/docs/architecture/oss-lab-poc.md +242 -0
  176. package/docs/architecture/project-layout.md +166 -0
  177. package/docs/architecture/state-driven-executor.md +203 -0
  178. package/docs/architecture/terminal-product-lane.md +148 -0
  179. package/docs/contracts/adapter-fixtures.md +80 -0
  180. package/docs/contracts/core.md +71 -0
  181. package/docs/contracts/feedback.md +145 -0
  182. package/docs/contracts/policy.md +305 -0
  183. package/docs/contracts/run-bundle.md +358 -0
  184. package/docs/contracts/schemas.md +984 -0
  185. package/docs/goals/current.md +409 -0
  186. package/docs/principles/invariants-and-defaults.md +135 -0
  187. package/docs/principles/self-driving-harness.md +129 -0
  188. package/docs/product/open-source-install-experience.md +229 -0
  189. package/docs/ramp/README.md +200 -0
  190. package/docs/release/open-source-readiness.md +208 -0
  191. package/docs/release/public-readiness-standard.md +205 -0
  192. package/docs/roadmap/world-class-open-source-v0.md +311 -0
  193. package/package.json +102 -8
  194. package/skills/humanish/SKILL.md +244 -0
  195. package/skills/humanish/agents/openai.yaml +7 -0
  196. package/index.js +0 -1
@@ -0,0 +1,214 @@
1
+ import path from "node:path";
2
+ export async function applyBrowserAdapterHooks(args) {
3
+ const { hooks, context, bundle, sanitize, warnings, hookLabel } = args;
4
+ if (!hooks?.score && !hooks?.deriveFeedback && !hooks?.deriveArtifacts)
5
+ return;
6
+ const scrubValue = (value) => {
7
+ const encoded = JSON.stringify(value);
8
+ return encoded === undefined ? value : JSON.parse(sanitize(encoded));
9
+ };
10
+ if (hooks.score) {
11
+ try {
12
+ const score = await hooks.score(context);
13
+ const cleaned = scrubValue(score);
14
+ if (isAdapterScoreShape(cleaned)) {
15
+ bundle.adapterScore = cleaned;
16
+ applyAdapterScoreFailureToReview(bundle);
17
+ }
18
+ else {
19
+ warnings.push(`${hookLabel}.score returned a value that is not a well-formed humanish.adapter-score.v1 (non-empty namespace + status + numeric score + summary); dropped so the bundle stays verifiable.`);
20
+ }
21
+ }
22
+ catch (error) {
23
+ warnings.push(`${hookLabel}.score threw (${sanitize(error instanceof Error ? error.message : String(error))}); dropped so the bundle stays verifiable.`);
24
+ }
25
+ }
26
+ if (hooks.deriveFeedback) {
27
+ try {
28
+ const candidates = await hooks.deriveFeedback(context);
29
+ const accepted = [];
30
+ for (const candidate of Array.isArray(candidates) ? candidates : []) {
31
+ const cleaned = scrubValue(candidate);
32
+ if (isAdapterFeedbackCandidateShape(cleaned))
33
+ accepted.push(cleaned);
34
+ else
35
+ warnings.push(`${hookLabel}.deriveFeedback returned a candidate that is not a well-formed humanish.feedback-candidate.v1 (or its adapter block lacked a non-empty namespace + data record); dropped so the bundle stays verifiable.`);
36
+ }
37
+ if (accepted.length > 0) {
38
+ bundle.feedbackCandidates = [...bundle.feedbackCandidates, ...accepted];
39
+ }
40
+ }
41
+ catch (error) {
42
+ warnings.push(`${hookLabel}.deriveFeedback threw (${sanitize(error instanceof Error ? error.message : String(error))}); dropped so the bundle stays verifiable.`);
43
+ }
44
+ }
45
+ if (hooks.deriveArtifacts) {
46
+ try {
47
+ const artifacts = await hooks.deriveArtifacts(context);
48
+ const accepted = [];
49
+ for (const artifact of Array.isArray(artifacts) ? artifacts : []) {
50
+ const cleaned = scrubValue(artifact);
51
+ if (isAdapterArtifactShape(cleaned))
52
+ accepted.push(cleaned);
53
+ else
54
+ warnings.push(`${hookLabel}.deriveArtifacts returned an artifact that is not a well-formed humanish.adapter-artifact.v1 (non-empty namespace + label + local path + supported kind); dropped so the bundle stays verifiable.`);
55
+ }
56
+ if (accepted.length > 0) {
57
+ bundle.adapterArtifacts = [...(bundle.adapterArtifacts ?? []), ...accepted];
58
+ }
59
+ }
60
+ catch (error) {
61
+ warnings.push(`${hookLabel}.deriveArtifacts threw (${sanitize(error instanceof Error ? error.message : String(error))}); dropped so the bundle stays verifiable.`);
62
+ }
63
+ }
64
+ }
65
+ export function adapterScoreFailureMessage(bundle) {
66
+ return bundle.adapterScore?.status === "fail"
67
+ ? `Adapter scorer failed the run: ${bundle.adapterScore.summary}`
68
+ : undefined;
69
+ }
70
+ export function applyAdapterScoreFailureToReview(bundle) {
71
+ const message = adapterScoreFailureMessage(bundle);
72
+ if (message === undefined)
73
+ return undefined;
74
+ if (bundle.review.verdict === "pass" || bundle.review.verdict === "contract_proof_only") {
75
+ bundle.review.verdict = "fail";
76
+ bundle.review.summary = message;
77
+ }
78
+ if (!bundle.review.gaps.includes(message)) {
79
+ bundle.review.gaps = [...bundle.review.gaps, message];
80
+ }
81
+ return message;
82
+ }
83
+ function isAdapterScoreShape(value) {
84
+ return typeof value === "object" && value !== null && !Array.isArray(value)
85
+ && value.schema === "humanish.adapter-score.v1"
86
+ && typeof value.namespace === "string"
87
+ && value.namespace.trim().length > 0
88
+ && ["pass", "partial", "fail"].includes(value.status)
89
+ && typeof value.score === "number"
90
+ && Number.isFinite(value.score)
91
+ && typeof value.summary === "string"
92
+ && (value.data === undefined
93
+ || (typeof value.data === "object"
94
+ && value.data !== null
95
+ && !Array.isArray(value.data)));
96
+ }
97
+ function isAdapterFeedbackCandidateShape(value) {
98
+ if (!isRecord(value))
99
+ return false;
100
+ const candidate = value;
101
+ if (candidate.schema !== "humanish.feedback-candidate.v1"
102
+ || typeof candidate.id !== "string"
103
+ || typeof candidate.run_id !== "string"
104
+ || (candidate.stream_id !== undefined && typeof candidate.stream_id !== "string")
105
+ || typeof candidate.adapter_id !== "string"
106
+ || typeof candidate.scenario_id !== "string"
107
+ || typeof candidate.persona_id !== "string"
108
+ || !isFeedbackActor(candidate.actor)
109
+ || !isFeedbackSubstrate(candidate.substrate)
110
+ || !isFeedbackFailureOwner(candidate.failure_owner)
111
+ || typeof candidate.summary !== "string"
112
+ || candidate.summary.trim().length === 0
113
+ || typeof candidate.expected !== "string"
114
+ || typeof candidate.actual !== "string"
115
+ || !Array.isArray(candidate.evidence)
116
+ || !candidate.evidence.every(isFeedbackEvidence)
117
+ || !isRecord(candidate.redaction)
118
+ || candidate.redaction.status !== "passed"
119
+ || typeof candidate.redaction.notes !== "string"
120
+ || typeof candidate.idempotency_key !== "string"
121
+ || !isFeedbackNextState(candidate.proposed_next_state)
122
+ || !Array.isArray(candidate.acceptance_proof)
123
+ || !candidate.acceptance_proof.every((item) => typeof item === "string")) {
124
+ return false;
125
+ }
126
+ if (candidate.adapter !== undefined) {
127
+ const adapter = candidate.adapter;
128
+ if (!isRecord(adapter)
129
+ || typeof adapter.namespace !== "string" || adapter.namespace.trim().length === 0
130
+ || !isRecord(adapter.data)) {
131
+ return false;
132
+ }
133
+ }
134
+ return true;
135
+ }
136
+ function isAdapterArtifactShape(value) {
137
+ if (!isRecord(value))
138
+ return false;
139
+ const artifact = value;
140
+ return artifact.schema === "humanish.adapter-artifact.v1"
141
+ && typeof artifact.namespace === "string"
142
+ && artifact.namespace.trim().length > 0
143
+ && typeof artifact.label === "string"
144
+ && artifact.label.trim().length > 0
145
+ && typeof artifact.path === "string"
146
+ && isSafeRelativeArtifactPath(artifact.path)
147
+ && isAdapterArtifactKind(artifact.kind)
148
+ && typeof artifact.note === "string"
149
+ && artifact.note.trim().length > 0;
150
+ }
151
+ function isRecord(value) {
152
+ return typeof value === "object" && value !== null && !Array.isArray(value);
153
+ }
154
+ function isSafeRelativeArtifactPath(value) {
155
+ return value.trim().length > 0
156
+ && !path.isAbsolute(value)
157
+ && !value.includes("://")
158
+ && !value.split(/[\\/]/).some((part) => part === ".." || part === "." || part.length === 0);
159
+ }
160
+ function isAdapterArtifactKind(value) {
161
+ return value === "state"
162
+ || value === "review"
163
+ || value === "log"
164
+ || value === "trace"
165
+ || value === "screenshot"
166
+ || value === "filesystem"
167
+ || value === "summary";
168
+ }
169
+ function isFeedbackActor(value) {
170
+ return value === "codex-tui"
171
+ || value === "codex-exec"
172
+ || value === "codex-app-server"
173
+ || value === "synthetic-dry-run"
174
+ || value === "unknown";
175
+ }
176
+ function isFeedbackSubstrate(value) {
177
+ return value === "e2b-desktop"
178
+ || value === "e2b-terminal"
179
+ || value === "local-filesystem"
180
+ || value === "codex-app-server"
181
+ || value === "unknown";
182
+ }
183
+ function isFeedbackFailureOwner(value) {
184
+ return value === "harness"
185
+ || value === "target-app"
186
+ || value === "actor"
187
+ || value === "environment"
188
+ || value === "unknown";
189
+ }
190
+ function isFeedbackNextState(value) {
191
+ return value === "watch"
192
+ || value === "adapter-hardening"
193
+ || value === "target-app-setup"
194
+ || value === "actor-auth"
195
+ || value === "setup-quality-review"
196
+ || value === "study-quality-review";
197
+ }
198
+ function isFeedbackEvidence(value) {
199
+ if (!isRecord(value))
200
+ return false;
201
+ return typeof value.path === "string"
202
+ && value.path.length > 0
203
+ && !path.isAbsolute(value.path)
204
+ && !value.path.includes("://")
205
+ && !value.path.includes("..")
206
+ && (value.kind === "review"
207
+ || value.kind === "state"
208
+ || value.kind === "log"
209
+ || value.kind === "trace"
210
+ || value.kind === "screenshot"
211
+ || value.kind === "filesystem")
212
+ && typeof value.note === "string";
213
+ }
214
+ //# sourceMappingURL=adapter-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-extension.js","sourceRoot":"","sources":["../src/adapter-extension.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AA0D7B,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAO9C;IACC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACvE,IAAI,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,cAAc,IAAI,CAAC,KAAK,EAAE,eAAe;QAAE,OAAO;IAE/E,MAAM,UAAU,GAAG,CAAI,KAAQ,EAAK,EAAE;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,C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AAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;WAC1B,CACD,KAAK,CAAC,IAAI,KAAK,QAAQ;eACpB,KAAK,CAAC,IAAI,KAAK,OAAO;eACtB,KAAK,CAAC,IAAI,KAAK,KAAK;eACpB,KAAK,CAAC,IAAI,KAAK,OAAO;eACtB,KAAK,CAAC,IAAI,KAAK,YAAY;eAC3B,KAAK,CAAC,IAAI,KAAK,YAAY,CAC/B;WACE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AACtC,CAAC"}
package/dist/argv.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function normalizeCliArgv(argv: string[]): string[];
package/dist/argv.js ADDED
@@ -0,0 +1,8 @@
1
+ export function normalizeCliArgv(argv) {
2
+ const [runtime, entrypoint, separator, ...rest] = argv;
3
+ if (runtime && entrypoint && separator === "--") {
4
+ return [runtime, entrypoint, ...rest];
5
+ }
6
+ return argv;
7
+ }
8
+ //# sourceMappingURL=argv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argv.js","sourceRoot":"","sources":["../src/argv.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,IAAc;IAC7C,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEvD,IAAI,OAAO,IAAI,UAAU,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Decide whether to include a recorded artifact path in published evidence.
3
+ *
4
+ * Returns the path only when the producer confirms it actually wrote (or, for a
5
+ * surface that attempts the write inline, attempted to write) the artifact. When
6
+ * `wrote` is false the producer is declaring "I have no artifact here" and the
7
+ * reference is dropped so the bundle never claims evidence that does not exist.
8
+ *
9
+ * This is intentionally producer-driven, not status-driven: a successful step that
10
+ * failed to write its file should pass `wrote: true` (it believes it wrote one) so
11
+ * the strict verifier still catches the broken producer. Only a step whose recorded
12
+ * evidence IS the failure passes `wrote: false`.
13
+ */
14
+ export declare function artifactReferenceIfWritten(path: string | undefined, wrote: boolean): string | undefined;
15
+ /**
16
+ * True when a captured surface/step recorded a real screenshot artifact that the
17
+ * producer wrote. A blocked capture/step whose evidence is the failure itself wrote
18
+ * no screenshot, so it has no `screenshotPath` to reference.
19
+ */
20
+ export declare function hasWrittenScreenshot(capture: {
21
+ screenshotPath?: string;
22
+ }): boolean;
@@ -0,0 +1,47 @@
1
+ // Artifact-reference discipline: "never reference an artifact you did not write."
2
+ //
3
+ // `verifyRun` fails closed when a run bundle references a local evidence artifact
4
+ // (a screenshot path, an embed URL, a `ui.screenshotUrl`) that does not exist on
5
+ // disk or is zero-byte. That fail-closed behavior is correct and must NOT be
6
+ // weakened. The honest fix lives on the PRODUCER side: a step or capture that did
7
+ // not write an artifact must not claim one.
8
+ //
9
+ // A blocked/failed step where the failure itself is the recorded evidence wrote no
10
+ // screenshot — so it must omit the reference, keeping its blocked status + reason
11
+ // (the failure is the evidence). A step that claims SUCCESS but failed to write its
12
+ // screenshot must STILL carry the reference so verify can catch the broken producer:
13
+ // this guard never blanket-omits by status, it only lets a producer decline to
14
+ // reference a path it knows it never wrote.
15
+ //
16
+ // The browser lane (src/run.ts + src/scripted-browser-actor.ts) imports this; the
17
+ // terminal-product lane (SLICE 2, src/e2b-terminal-lab.ts) inherits the same
18
+ // discipline so neither path can reintroduce the missing-artifact verify failure.
19
+ /**
20
+ * Decide whether to include a recorded artifact path in published evidence.
21
+ *
22
+ * Returns the path only when the producer confirms it actually wrote (or, for a
23
+ * surface that attempts the write inline, attempted to write) the artifact. When
24
+ * `wrote` is false the producer is declaring "I have no artifact here" and the
25
+ * reference is dropped so the bundle never claims evidence that does not exist.
26
+ *
27
+ * This is intentionally producer-driven, not status-driven: a successful step that
28
+ * failed to write its file should pass `wrote: true` (it believes it wrote one) so
29
+ * the strict verifier still catches the broken producer. Only a step whose recorded
30
+ * evidence IS the failure passes `wrote: false`.
31
+ */
32
+ export function artifactReferenceIfWritten(path, wrote) {
33
+ if (!wrote) {
34
+ return undefined;
35
+ }
36
+ const trimmed = path?.trim();
37
+ return trimmed ? trimmed : undefined;
38
+ }
39
+ /**
40
+ * True when a captured surface/step recorded a real screenshot artifact that the
41
+ * producer wrote. A blocked capture/step whose evidence is the failure itself wrote
42
+ * no screenshot, so it has no `screenshotPath` to reference.
43
+ */
44
+ export function hasWrittenScreenshot(capture) {
45
+ return Boolean(capture.screenshotPath?.trim());
46
+ }
47
+ //# sourceMappingURL=artifact-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-reference.js","sourceRoot":"","sources":["../src/artifact-reference.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,kFAAkF;AAClF,iFAAiF;AACjF,6EAA6E;AAC7E,kFAAkF;AAClF,4CAA4C;AAC5C,EAAE;AACF,mFAAmF;AACnF,kFAAkF;AAClF,oFAAoF;AACpF,qFAAqF;AACrF,+EAA+E;AAC/E,4CAA4C;AAC5C,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAC7E,kFAAkF;AAElF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAwB,EAAE,KAAc;IACjF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAoC;IACvE,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Browser chrome that belongs to the host environment (update prompts, password
3
+ * save bubbles, first-run UI) pollutes product evidence. Keep these knobs in one
4
+ * place so browser-backed lanes can prefer product pixels over browser UI.
5
+ */
6
+ export declare const CHROMIUM_EVIDENCE_HYGIENE_FLAGS: readonly ["--disable-background-networking", "--disable-component-update", "--disable-default-apps", "--disable-domain-reliability", "--disable-extensions", "--disable-sync", "--no-default-browser-check", "--no-first-run", "--password-store=basic", "--use-mock-keychain"];
7
+ export declare function chromiumEvidenceProfilePreferencesJson(): string;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Browser chrome that belongs to the host environment (update prompts, password
3
+ * save bubbles, first-run UI) pollutes product evidence. Keep these knobs in one
4
+ * place so browser-backed lanes can prefer product pixels over browser UI.
5
+ */
6
+ export const CHROMIUM_EVIDENCE_HYGIENE_FLAGS = [
7
+ "--disable-background-networking",
8
+ "--disable-component-update",
9
+ "--disable-default-apps",
10
+ "--disable-domain-reliability",
11
+ "--disable-extensions",
12
+ "--disable-sync",
13
+ "--no-default-browser-check",
14
+ "--no-first-run",
15
+ "--password-store=basic",
16
+ "--use-mock-keychain"
17
+ ];
18
+ const CHROMIUM_EVIDENCE_PROFILE_PREFERENCES = {
19
+ autofill: {
20
+ credit_card_enabled: false,
21
+ profile_enabled: false
22
+ },
23
+ browser: {
24
+ check_default_browser: false
25
+ },
26
+ credentials_enable_service: false,
27
+ payments: {
28
+ can_make_payment_enabled: false
29
+ },
30
+ profile: {
31
+ default_content_setting_values: {
32
+ notifications: 2
33
+ },
34
+ password_manager_enabled: false
35
+ }
36
+ };
37
+ export function chromiumEvidenceProfilePreferencesJson() {
38
+ return JSON.stringify(CHROMIUM_EVIDENCE_PROFILE_PREFERENCES);
39
+ }
40
+ //# sourceMappingURL=browser-evidence-hygiene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-evidence-hygiene.js","sourceRoot":"","sources":["../src/browser-evidence-hygiene.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,iCAAiC;IACjC,4BAA4B;IAC5B,wBAAwB;IACxB,8BAA8B;IAC9B,sBAAsB;IACtB,gBAAgB;IAChB,4BAA4B;IAC5B,gBAAgB;IAChB,wBAAwB;IACxB,qBAAqB;CACb,CAAC;AAEX,MAAM,qCAAqC,GAAG;IAC5C,QAAQ,EAAE;QACR,mBAAmB,EAAE,KAAK;QAC1B,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,qBAAqB,EAAE,KAAK;KAC7B;IACD,0BAA0B,EAAE,KAAK;IACjC,QAAQ,EAAE;QACR,wBAAwB,EAAE,KAAK;KAChC;IACD,OAAO,EAAE;QACP,8BAA8B,EAAE;YAC9B,aAAa,EAAE,CAAC;SACjB;QACD,wBAAwB,EAAE,KAAK;KAChC;CACO,CAAC;AAEX,MAAM,UAAU,sCAAsC;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,qCAAqC,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { type ActorCompletionReason, type ActorPersonaRef, type ActorStatus, type ActorTrace } from "./actor-contract.js";
2
+ export type ClaudeResultSubtype = "success" | "error_during_execution" | "error_max_turns" | "error_max_budget_usd" | "error_max_structured_output_retries";
3
+ export type ClaudeContentBlock = {
4
+ type: "text";
5
+ text: string;
6
+ } | {
7
+ type: "thinking";
8
+ thinking: string;
9
+ } | {
10
+ type: "tool_use";
11
+ id: string;
12
+ name: string;
13
+ } | {
14
+ type: "tool_result";
15
+ tool_use_id: string;
16
+ is_error?: boolean;
17
+ };
18
+ export type ClaudeMessage = {
19
+ type: "system";
20
+ subtype: string;
21
+ session_id?: string;
22
+ model?: string;
23
+ } | {
24
+ type: "assistant";
25
+ message: {
26
+ content: ClaudeContentBlock[];
27
+ };
28
+ } | {
29
+ type: "user";
30
+ message: {
31
+ content: ClaudeContentBlock[] | string;
32
+ };
33
+ } | {
34
+ type: "result";
35
+ subtype: ClaudeResultSubtype;
36
+ is_error?: boolean;
37
+ duration_ms?: number;
38
+ num_turns?: number;
39
+ session_id?: string;
40
+ total_cost_usd?: number;
41
+ usage?: {
42
+ input_tokens?: number;
43
+ output_tokens?: number;
44
+ };
45
+ result?: string;
46
+ };
47
+ export interface ClaudeSessionResult {
48
+ messages: ClaudeMessage[];
49
+ startedAt: string;
50
+ completedAt: string;
51
+ providerVersion?: string;
52
+ }
53
+ export declare function claudeResultSubtypeToStatus(subtype: ClaudeResultSubtype): ActorStatus;
54
+ export declare function claudeStatusToCompletionReason(status: ActorStatus): ActorCompletionReason;
55
+ /**
56
+ * Map a Claude Agent SDK session into the provider-neutral ActorTrace. Pure and
57
+ * side-effect-free; mirrors codexResultToActorTrace / piSessionToActorTrace. The
58
+ * persona reference is supplied by the harness.
59
+ */
60
+ export declare function claudeSessionToActorTrace(session: ClaudeSessionResult, persona: ActorPersonaRef): ActorTrace;
61
+ export type ClaudeQueryFn = (args: {
62
+ prompt: string;
63
+ options: Record<string, unknown>;
64
+ }) => AsyncIterable<unknown>;
65
+ export interface ClaudeAgentSessionOptions {
66
+ cwd: string;
67
+ runRoot: string;
68
+ prompt: string;
69
+ persona: ActorPersonaRef;
70
+ timeoutMs: number;
71
+ model?: string;
72
+ maxTurns?: number;
73
+ systemPrompt?: string;
74
+ queryFn?: ClaudeQueryFn;
75
+ loadQueryFn?: () => Promise<ClaudeQueryFn>;
76
+ }
77
+ export interface ClaudeAgentSessionResult {
78
+ status: ActorStatus;
79
+ reason: string;
80
+ durationMs: number;
81
+ trace: ActorTrace;
82
+ session: ClaudeSessionResult;
83
+ transcriptPath: string;
84
+ tracePath: string;
85
+ eventsPath: string;
86
+ tail: string;
87
+ }
88
+ /**
89
+ * Drive a Claude Agent SDK session (or an injected fake) and write the three
90
+ * provider-neutral evidence artifacts, mirroring runCodexAppServerSession. The
91
+ * mapping is delegated to the pure claudeSessionToActorTrace. A load failure or
92
+ * timeout still produces a (failed/timed_out) bundle rather than throwing.
93
+ */
94
+ export declare function runClaudeAgentSession(options: ClaudeAgentSessionOptions): Promise<ClaudeAgentSessionResult>;