humanish 0.111.4 → 0.112.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 (93) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/actors/computer-use/openai-conversation.d.ts +91 -0
  3. package/dist/actors/computer-use/openai-conversation.js +209 -0
  4. package/dist/actors/computer-use/openai-provider.js +25 -41
  5. package/dist/actors/contract.d.ts +2 -0
  6. package/dist/analysis/diagnostics.js +7 -12
  7. package/dist/analysis/execute.d.ts +1 -1
  8. package/dist/analysis/execute.js +35 -5
  9. package/dist/analysis/service.js +7 -1
  10. package/dist/analysis/types.d.ts +23 -0
  11. package/dist/analysis/validation.d.ts +80 -35
  12. package/dist/analysis/validation.js +58 -11
  13. package/dist/cli/commands/runs.js +4 -10
  14. package/dist/cli/findings.d.ts +34 -3
  15. package/dist/cli/findings.js +136 -18
  16. package/dist/cli/io.d.ts +2 -1
  17. package/dist/cli/io.js +3 -2
  18. package/dist/feedback/draft.js +14 -4
  19. package/dist/observer/run-routes.js +8 -4
  20. package/dist/observer-app.html +4 -4
  21. package/dist/routes/computer-use/bundle.d.ts +1 -1
  22. package/dist/routes/computer-use/bundle.js +6 -16
  23. package/dist/routes/computer-use/fanout-bundle.js +40 -37
  24. package/dist/routes/computer-use/fanout-records.d.ts +2 -0
  25. package/dist/routes/computer-use/fanout-records.js +18 -26
  26. package/dist/routes/computer-use/participant-execution.js +4 -11
  27. package/dist/routes/computer-use/participant-facts.d.ts +2 -2
  28. package/dist/routes/computer-use/participant-facts.js +10 -1
  29. package/dist/routes/computer-use/result.js +7 -15
  30. package/dist/routes/computer-use/single-bundle.d.ts +2 -0
  31. package/dist/routes/computer-use/single-bundle.js +81 -37
  32. package/dist/routes/scripted/bundle.d.ts +1 -1
  33. package/dist/routes/scripted/bundle.js +9 -19
  34. package/dist/routes/scripted/surface-records.d.ts +0 -1
  35. package/dist/routes/scripted/surface-records.js +27 -13
  36. package/dist/routes/shared-world/bundle-records.d.ts +2 -2
  37. package/dist/routes/shared-world/bundle-records.js +21 -28
  38. package/dist/routes/shared-world/bundle.d.ts +1 -1
  39. package/dist/routes/shared-world/bundle.js +70 -78
  40. package/dist/routes/shared-world/participant-specs.d.ts +1 -2
  41. package/dist/routes/shared-world/participant-specs.js +0 -8
  42. package/dist/routes/shared-world/result.js +8 -12
  43. package/dist/routes/terminal/bundle.d.ts +1 -1
  44. package/dist/routes/terminal/bundle.js +10 -19
  45. package/dist/routes/terminal/dry-run.js +1 -0
  46. package/dist/routes/terminal/live-sandbox.js +9 -2
  47. package/dist/routes/terminal/plan.js +1 -0
  48. package/dist/routes/terminal/runtime.d.ts +1 -0
  49. package/dist/routes/terminal/runtime.js +1 -0
  50. package/dist/routes/terminal/session.js +1 -0
  51. package/dist/run/costs.js +9 -20
  52. package/dist/run/detail.d.ts +1 -1
  53. package/dist/run/detail.js +10 -1
  54. package/dist/run/display.d.ts +2 -2
  55. package/dist/run/display.js +15 -18
  56. package/dist/run/dry-run.js +10 -25
  57. package/dist/run/judge.d.ts +24 -0
  58. package/dist/run/judge.js +54 -0
  59. package/dist/run/liveness.d.ts +18 -0
  60. package/dist/run/liveness.js +24 -0
  61. package/dist/run/outcomes.d.ts +8 -1
  62. package/dist/run/outcomes.js +58 -12
  63. package/dist/run/participant-caption.d.ts +30 -0
  64. package/dist/run/participant-caption.js +50 -0
  65. package/dist/run/participant-records.d.ts +1 -1
  66. package/dist/run/review-markdown.d.ts +11 -0
  67. package/dist/run/review-markdown.js +22 -0
  68. package/dist/run/run-cost.d.ts +7 -0
  69. package/dist/run/run-cost.js +25 -5
  70. package/dist/run/run-index.d.ts +4 -50
  71. package/dist/run/run-index.js +57 -87
  72. package/dist/run/run.d.ts +2 -2
  73. package/dist/run/run.js +5 -3
  74. package/dist/run/stats.js +2 -12
  75. package/dist/run/transient-comms-secrets.d.ts +8 -3
  76. package/dist/run/transient-comms-secrets.js +21 -1
  77. package/dist/study/keys.d.ts +1 -0
  78. package/dist/study/keys.js +1 -1
  79. package/dist/study/parse/execution.js +7 -1
  80. package/dist/study/plan-types.d.ts +1 -0
  81. package/dist/study/types.d.ts +4 -1
  82. package/dist/study/warnings.d.ts +2 -1
  83. package/dist/study/warnings.js +3 -2
  84. package/dist/tui-app.js +73 -73
  85. package/dist/verify/liveness.d.ts +2 -2
  86. package/dist/verify/liveness.js +7 -4
  87. package/docs/architecture/terminal-product-route.md +14 -0
  88. package/docs/contracts/run-bundle.md +10 -0
  89. package/docs/contracts/schemas.md +9 -1
  90. package/docs/contracts/study-analysis.md +71 -22
  91. package/package.json +2 -1
  92. package/dist/actors/computer-use/openai-requests.d.ts +0 -62
  93. package/dist/actors/computer-use/openai-requests.js +0 -144
package/dist/cli/io.js CHANGED
@@ -15,12 +15,13 @@ export const JSON_OPTION_DESCRIPTION = "Print a machine-readable JSON response."
15
15
  export const CWD_OPTION_DESCRIPTION = "Project directory.";
16
16
  export const RUN_OPTION_DESCRIPTION = "Run id, or latest.";
17
17
  export const DOTENV_OPTION_DESCRIPTION = "Load unset variables from this dotenv file. Values are never printed or saved.";
18
- const ENV_FILE_RENAMED = "`--env-file` is now `--dotenv`; `--env-file` is removed in 0.112.0.";
18
+ const ENV_FILE_RENAMED = "`--env-file` is now `--dotenv`; `--env-file` is removed in the first minor release on or after 2026-11-03.";
19
19
  /**
20
20
  * The hidden `--env-file <path>` that `--dotenv` replaced. Node scans the whole argv for
21
21
  * `--env-file` before a script runs, and stops only at `--` (src/node_dotenv.cc), so a missing file
22
22
  * exits 9 through Node and never reaches humanish. `--dotenv` does not collide.
23
- * Removed in 0.112.0: deprecated in 0.110.0 on 2026-10-03, it stays 30 days and one minor release.
23
+ * Removed in the first minor release on or after 2026-11-03: deprecated in 0.110.0 on 2026-10-03, it stays at least 30 days and one
24
+ * minor release.
24
25
  */
25
26
  export function envFileAliasOption() {
26
27
  return new Option("--env-file <path>").hideHelp().conflicts("dotenv");
@@ -120,7 +120,8 @@ export async function buildAnalysisDraft(context, options) {
120
120
  const root = path.dirname(context.loaded.bundlePath);
121
121
  const evidenceIds = new Set(finding.observations.flatMap((item) => item.evidenceIds));
122
122
  const evidence = analysis.evidence.filter((item) => evidenceIds.has(item.id));
123
- const claim = correction?.status === "amended" ? correction.replacementClaim : finding.title;
123
+ const amended = correction?.status === "amended";
124
+ const claim = amended ? correction.replacementClaim : (finding.headline ?? finding.title);
124
125
  const firstLine = claim.trim().split(/\r?\n/)[0] || `Reviewed finding ${finding.id}`;
125
126
  const summary = Array.from(firstLine).length > 160
126
127
  ? Array.from(firstLine).slice(0, 159).join("") + "…"
@@ -144,10 +145,19 @@ export async function buildAnalysisDraft(context, options) {
144
145
  summary,
145
146
  expected: "Review the cited behavior against the participant assignment and confirm the expected product behavior.",
146
147
  actual: [
148
+ // The plain account leads; an amendment makes it stale, so the draft says so in its place.
149
+ ...(finding.headline === undefined
150
+ ? []
151
+ : amended
152
+ ? [
153
+ "This finding was corrected in human review. The reviewer's claim above replaces its original headline and account.",
154
+ "",
155
+ ]
156
+ : finding.experience === undefined
157
+ ? []
158
+ : [finding.experience, ""]),
147
159
  "Independent study analysis; does not replace participant feedback or recorded completion outcomes.",
148
- correction?.status === "amended"
149
- ? `Amended claim: ${claim}. Original analysis: ${finding.summary}`
150
- : finding.summary,
160
+ amended ? `Amended claim: ${claim}. Original analysis: ${finding.summary}` : finding.summary,
151
161
  `Impact: ${finding.impact}. ${finding.affectedStreamIds.length} affected / ${finding.exposedStreamIds.length} observed exposed participants. ${finding.exposureReason}`,
152
162
  `Recovery: ${finding.recovery}. Confidence: ${finding.confidence}.`,
153
163
  ...finding.observations.map((item) => `${item.basis}: ${item.claim}${item.limitation ? ` Limitation: ${item.limitation}` : ""}`),
@@ -8,6 +8,7 @@ import { isLocalOnlyRunFile, isLocalOnlyRunFileIdentity } from "../run/local-onl
8
8
  import { listRuns } from "../run/stored-runs.js";
9
9
  import { readAnalysisAccounting } from "../run/costs.js";
10
10
  import { bindExistingRunArtifactPaths, isPathInside, isSafeRunIdSegment, } from "../run/paths.js";
11
+ import { isRunOutcome } from "../run/bundle-shape.js";
11
12
  import { analysisCostOf, runCost, runCostLabel } from "../run/run-cost.js";
12
13
  import { RUN_STATUS_FILE, RUN_STATUS_STALE_MS, isRunStatusRecord, } from "../run/status.js";
13
14
  import { renderObserverHtml } from "./artifact.js";
@@ -138,7 +139,7 @@ async function readObserverData(runRoot, runtimeStreamUrls = []) {
138
139
  if (!bundleBytes)
139
140
  throw new Error("run.json unavailable");
140
141
  const bundle = JSON.parse(bundleBytes.toString("utf8"));
141
- return withRuntimeStreamUrls(withLocalRunStatus(record, buildObserverData(bundle, undefined, record)), runtimeStreamUrls);
142
+ return withRuntimeStreamUrls(withLocalRunStatus(record, buildObserverData(bundle, undefined, record), bundle.outcome), runtimeStreamUrls);
142
143
  }
143
144
  catch { }
144
145
  try {
@@ -166,12 +167,12 @@ async function readLocalRunStatus(runRoot) {
166
167
  }
167
168
  }
168
169
  /**
169
- * Liveness is a current read of a contained local status record, separate from run evidence.
170
+ * A recorded bundle outcome wins; otherwise runtime status reads the contained local heartbeat.
170
171
  * A stale heartbeat means unknown: neither an old timestamp nor a persisted PID proves that a
171
172
  * process died (the evidence may have been copied from another machine). A record its stopped
172
173
  * process wrote is interrupted. No PID is served/probed.
173
174
  */
174
- function withLocalRunStatus(record, input) {
175
+ function withLocalRunStatus(record, input, outcome) {
175
176
  // A served observation must never be inherited from a persisted projection or export.
176
177
  const { runtime: _persistedRuntime, ...data } = input;
177
178
  if (record === undefined || record.runId !== data.run.runId || record.mode !== data.run.mode)
@@ -181,7 +182,10 @@ function withLocalRunStatus(record, input) {
181
182
  const updated = Date.parse(record.updatedAt);
182
183
  const timestampsValid = Number.isFinite(started) && Number.isFinite(updated) && started <= updated && updated <= now;
183
184
  let state = "unknown";
184
- if (timestampsValid) {
185
+ if (isRunOutcome(outcome)) {
186
+ state = outcome.state;
187
+ }
188
+ else if (timestampsValid) {
185
189
  if (record.state === "finished") {
186
190
  state = "finished";
187
191
  }