@inflexa-ai/harness 0.35.2 → 0.35.4

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 (44) hide show
  1. package/dist/citations/types.d.ts +2 -2
  2. package/dist/config/environment-stores.d.ts +10 -0
  3. package/dist/contracts/schemas/chat-parts.d.ts +11 -11
  4. package/dist/execution/run-canceler.js +20 -4
  5. package/dist/index.d.ts +3 -1
  6. package/dist/index.js +5 -0
  7. package/dist/lib/metrics.d.ts +63 -5
  8. package/dist/lib/metrics.js +104 -5
  9. package/dist/lib/otel-spans.d.ts +77 -0
  10. package/dist/lib/otel-spans.js +123 -0
  11. package/dist/lib/otel.d.ts +12 -3
  12. package/dist/lib/otel.js +15 -4
  13. package/dist/loop/run-agent.js +13 -2
  14. package/dist/prompts/planner.js +6 -0
  15. package/dist/prompts/sandbox-standards.d.ts +1 -1
  16. package/dist/prompts/sandbox-standards.js +8 -3
  17. package/dist/runtime/dbos.d.ts +8 -7
  18. package/dist/sandbox/await-exec.js +16 -9
  19. package/dist/sandbox/notification-sweep.js +5 -2
  20. package/dist/sandbox/package-identity.d.ts +208 -0
  21. package/dist/sandbox/package-identity.js +244 -0
  22. package/dist/sandbox/reaper.js +5 -2
  23. package/dist/sandbox/submit-exec.js +6 -3
  24. package/dist/sandbox/types.d.ts +20 -25
  25. package/dist/sandbox/watchdog.js +8 -3
  26. package/dist/schemas/plan-schemas.d.ts +3 -3
  27. package/dist/schemas/validate-plan.js +32 -15
  28. package/dist/schemas/workflow-state.js +3 -1
  29. package/dist/state/data-profile.d.ts +20 -6
  30. package/dist/state/data-profile.js +16 -8
  31. package/dist/state/index.d.ts +1 -1
  32. package/dist/state/schema.d.ts +2 -2
  33. package/dist/tasks/data-profile.js +26 -12
  34. package/dist/tools/execute-analysis.js +37 -20
  35. package/dist/tools/research/inspect-run.d.ts +1 -1
  36. package/dist/tools/sandbox/link-packages.d.ts +6 -6
  37. package/dist/tools/sandbox/link-packages.js +45 -14
  38. package/dist/tools/sandbox/list-available-packages.d.ts +23 -1
  39. package/dist/tools/sandbox/list-available-packages.js +185 -43
  40. package/dist/workflows/execute-analysis.d.ts +4 -1
  41. package/dist/workflows/execute-analysis.js +40 -4
  42. package/dist/workflows/execute-target-assessment.js +68 -31
  43. package/dist/workflows/sandbox-step.js +7 -1
  44. package/package.json +1 -1
@@ -28,6 +28,7 @@
28
28
  */
29
29
  import { DBOS, Error as DBOSErrors } from "@dbos-inc/dbos-sdk";
30
30
  import { insertStepExecution, updateStepExecution } from "../state/index.js";
31
+ import { recordStepCompleted } from "../lib/metrics.js";
31
32
  import { createNoopLogger } from "../lib/console-logger.js";
32
33
  import { unwrapOrThrow } from "../lib/result.js";
33
34
  import { isBudgetExceeded } from "../loop/budget-exceeded.js";
@@ -286,6 +287,7 @@ export async function runSandboxStepBody(input, deps) {
286
287
  attempts: 1,
287
288
  lastErrorClass: errorClass,
288
289
  }));
290
+ recordStepCompleted({ agentId: input.agentId, status: "failed", durationMs });
289
291
  }, {
290
292
  name: errorClass === "lineage_attestation" ? "mark-failed-attestation" : "mark-failed",
291
293
  });
@@ -468,6 +470,7 @@ export async function runSandboxStepBody(input, deps) {
468
470
  finishReason,
469
471
  hitMaxSteps,
470
472
  }));
473
+ recordStepCompleted({ agentId: input.agentId, status: "failed", durationMs });
471
474
  }, { name: "mark-blocked" });
472
475
  await safeEmit({
473
476
  type: "data-step-blocked",
@@ -577,7 +580,9 @@ export async function runSandboxStepBody(input, deps) {
577
580
  await safeRun(logger, () => vectorIndexStepOutputs(deps, postCtx, postArtifacts), "post-step.vector-index");
578
581
  // (9) teardown — destroy sandbox + clear sandbox_ref.
579
582
  await DBOS.runStep(() => deps.sandboxClient.teardown(sandbox), { name: "sandbox.teardown" });
580
- // (10) mark-terminal + emit.
583
+ // (10) mark-terminal + emit. The outcome metric is recorded inside the same
584
+ // step as the ledger row: a replayed body reads the cached step and records
585
+ // nothing again.
581
586
  const durationMs = (await DBOS.now()) - startedAt;
582
587
  await DBOS.runStep(async () => {
583
588
  unwrapOrThrow(await updateStepExecution(deps.pool, input.runId, input.stepId, {
@@ -588,6 +593,7 @@ export async function runSandboxStepBody(input, deps) {
588
593
  finishReason,
589
594
  hitMaxSteps,
590
595
  }));
596
+ recordStepCompleted({ agentId: input.agentId, status: "completed", durationMs });
591
597
  }, { name: "mark-complete" });
592
598
  // Terminal step-detail parts. file-tree + summary + output each get a
593
599
  // stable id per step so the run-stream fold + client both treat them as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflexa-ai/harness",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "description": "Host-agnostic bioinformatics agent harness — hand-rolled agent loop, DBOS-durable workflows, sandboxed compute.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",