@tangle-network/agent-runtime 3.0.35 → 3.0.36

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 (27) hide show
  1. package/dist/agent.js +1 -1
  2. package/dist/{coordination-manager-CZzhPx_F.js → coordination-manager-CvWBnD3a.js} +5 -4
  3. package/dist/{coordination-manager-CZzhPx_F.js.map → coordination-manager-CvWBnD3a.js.map} +1 -1
  4. package/dist/{delegate-D0NpQF_z.js → delegate-EaeQed8U.js} +2 -2
  5. package/dist/{delegate-D0NpQF_z.js.map → delegate-EaeQed8U.js.map} +1 -1
  6. package/dist/durable.js +2 -2
  7. package/dist/{graph-BKMPvIk6.js → graph-XqPnqBK7.js} +3 -3
  8. package/dist/{graph-BKMPvIk6.js.map → graph-XqPnqBK7.js.map} +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/kernel.js +6 -6
  11. package/dist/{loop-runner-BmoENiTj.js → loop-runner-8agTjOrD.js} +2 -2
  12. package/dist/{loop-runner-BmoENiTj.js.map → loop-runner-8agTjOrD.js.map} +1 -1
  13. package/dist/loop-runner-bin.js +1 -1
  14. package/dist/mcp/bin.js +2 -2
  15. package/dist/mcp/index.js +3 -3
  16. package/dist/{provision-supervisor-BqbXjSYT.js → provision-supervisor-DFZxaxuY.js} +2 -2
  17. package/dist/{provision-supervisor-BqbXjSYT.js.map → provision-supervisor-DFZxaxuY.js.map} +1 -1
  18. package/dist/{runtime-Cxlb_vie.js → runtime-BmAGI6UG.js} +48 -24
  19. package/dist/runtime-BmAGI6UG.js.map +1 -0
  20. package/dist/{server-DINjmAT0.js → server-B1BzXziA.js} +2 -2
  21. package/dist/{server-DINjmAT0.js.map → server-B1BzXziA.js.map} +1 -1
  22. package/dist/{supervise-CeUM7jMe.js → supervise-zmX0eE6B.js} +2 -2
  23. package/dist/{supervise-CeUM7jMe.js.map → supervise-zmX0eE6B.js.map} +1 -1
  24. package/dist/testing.js +10 -10
  25. package/dist/tui/index.js +1 -1
  26. package/package.json +1 -1
  27. package/dist/runtime-Cxlb_vie.js.map +0 -1
@@ -9,13 +9,13 @@ import { a as writeAtomicDurableFile } from "./durable-file-DstVeHcj.js";
9
9
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-CsW2pfFk.js";
10
10
  import { a as reconcileInterruptedSearchCalls, c as searchExecutor, r as dedicatedLane, x as runtimeShipDecision } from "./search-executor-A2dtsTlx.js";
11
11
  import { y as foldCoordinationRecords } from "./run-cancellation-Cy8NtCtz.js";
12
- import { a as downMessageRefusalReasons, p as createInMemoryRunContext } from "./coordination-manager-CZzhPx_F.js";
13
- import { E as validateFlowGraph, I as kernelPromptRegistry, _ as coordinationControlToolNames, k as validateGraphTopology, t as supervise, y as runBrainLoop } from "./supervise-CeUM7jMe.js";
12
+ import { a as downMessageRefusalReasons, p as createInMemoryRunContext } from "./coordination-manager-CvWBnD3a.js";
13
+ import { E as validateFlowGraph, I as kernelPromptRegistry, _ as coordinationControlToolNames, k as validateGraphTopology, t as supervise, y as runBrainLoop } from "./supervise-zmX0eE6B.js";
14
14
  import { _ as compileGraphParameters, a as graphRegistry, b as graphRouteWhenSchema, d as recordGraphRun, g as bindGraphParameters, h as assertGraphTriggerBindings, i as graphFromStored, l as lookupGraph, m as taskShapeDigest, o as graphRunsFor, r as graphDigest, t as digestOfGraph, v as graphTriggerBindingsSchema, y as graphFileSchema } from "./graph-registry-D6y6zffC.js";
15
15
  import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction-DilFZch5.js";
16
- import "./provision-supervisor-BqbXjSYT.js";
17
- import "./delegate-D0NpQF_z.js";
18
- import "./graph-BKMPvIk6.js";
16
+ import "./provision-supervisor-DFZxaxuY.js";
17
+ import "./delegate-EaeQed8U.js";
18
+ import "./graph-XqPnqBK7.js";
19
19
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256Bytes, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
20
20
  import { CODING_HARNESSES, DEFAULT_TRACE_ANALYST_KINDS, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, createTraceAnalyst, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
21
21
  import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
@@ -929,8 +929,6 @@ const BOX_TREE = "tree";
929
929
  const BOX_SETUP_SECONDS = 900;
930
930
  /** The box's own process timeout is a backstop behind this module's deadline. */
931
931
  const BOX_PROCESS_BACKSTOP_MS = 3e4;
932
- /** Concurrent file deliveries into one check box. */
933
- const BOX_UPLOADS = 4;
934
932
  /** The box's process supervisor prefixes this to stderr when it cannot start the executable. */
935
933
  const BOX_EXEC_FAILURE = "process-supervisor: exec failed";
936
934
  async function runInBox(options, placement) {
@@ -975,23 +973,22 @@ async function runInBox(options, placement) {
975
973
  const egress = (await box.egress.get()).policy;
976
974
  const wanted = egressFor(placement);
977
975
  if (egress.mode !== wanted.mode || wanted.mode === "strict" && (egress.includeImplicitDomains === true || [...egress.allowDomains ?? []].sort().join(",") !== [...wanted.allowDomains ?? []].sort().join(","))) throw new Error(`Check box egress is ${egress.mode} ${JSON.stringify(egress.allowDomains ?? [])}, not ${wanted.mode} ${JSON.stringify(wanted.allowDomains ?? [])}`);
978
- await box.fs.mkdir(BOX_TREE, { recursive: true });
979
- const digests = new Map(captured.manifest.files.map((entry) => [entry.path, entry.sha256]));
980
- const target = box;
981
- const pending = [...captured.files];
982
- const deliver = async () => {
983
- try {
984
- for (let file = pending.shift(); file; file = pending.shift()) {
985
- options.signal?.throwIfAborted();
986
- const received = await target.fs.uploadData(`${BOX_TREE}/${file.path}`, file.bytes, { mode: file.mode });
987
- if (`sha256:${received.hash.replace(/^sha256:/, "").toLowerCase()}` !== digests.get(file.path) || received.size !== file.bytes.byteLength) throw new Error(`Check box received different bytes for ${file.path}`);
988
- }
989
- } catch (error) {
990
- pending.length = 0;
991
- throw error;
976
+ const staging = await mkdtemp(join(tmpdir(), "runtime-check-box-"));
977
+ try {
978
+ for (const file of captured.files) {
979
+ const path = join(staging, file.path);
980
+ await mkdir(dirname(path), { recursive: true });
981
+ await writeFile(path, file.bytes, { mode: file.mode });
992
982
  }
993
- };
994
- await Promise.all(Array.from({ length: BOX_UPLOADS }, deliver));
983
+ options.signal?.throwIfAborted();
984
+ await box.fs.uploadDir(staging, BOX_TREE);
985
+ } finally {
986
+ await rm(staging, {
987
+ recursive: true,
988
+ force: true
989
+ });
990
+ }
991
+ await verifyBoxTree(box, captured.manifest.files);
995
992
  evidence = {
996
993
  sandboxId: box.id,
997
994
  account,
@@ -1028,6 +1025,33 @@ async function runInBox(options, placement) {
1028
1025
  box: evidence
1029
1026
  } : result;
1030
1027
  }
1028
+ /** Refuse unless the box reads each file with its manifest digest. `find` names the files: a box
1029
+ * process takes 256 arguments at most. A name holding a newline or backslash, which coreutils
1030
+ * escapes, does not compare. */
1031
+ async function verifyBoxTree(box, files) {
1032
+ const child = await box.process.spawnExact("find", [
1033
+ ".",
1034
+ "-type",
1035
+ "f",
1036
+ "-exec",
1037
+ "sha256sum",
1038
+ "{}",
1039
+ "+"
1040
+ ], {
1041
+ cwd: BOX_TREE,
1042
+ env: {
1043
+ PATH: "/usr/bin:/bin",
1044
+ LANG: "C"
1045
+ },
1046
+ inheritEnv: false,
1047
+ timeoutMs: BOX_SETUP_SECONDS * 1e3
1048
+ });
1049
+ let listing = "";
1050
+ for await (const text of child.stdout()) listing += text;
1051
+ if (await child.wait() !== 0) throw new Error("Check box could not hash the tree it received");
1052
+ const read = new Set(listing.split("\n").map((line) => `sha256:${line.slice(0, 64)} ${line.slice(68)}`));
1053
+ for (const file of files) if (!read.has(`${file.sha256} ${file.path}`)) throw new Error(`Check box received different bytes for ${file.path}`);
1054
+ }
1031
1055
  /** Blocked unless the placement names domains; then strict, with no implicit domain list. */
1032
1056
  function egressFor(placement) {
1033
1057
  const domains = [...new Set(placement.egress ?? [])].filter((domain) => domain.trim() !== "");
@@ -10071,4 +10095,4 @@ function tail(s) {
10071
10095
  }
10072
10096
  export { runBenchmark as $, renderLeaderboardHtml as $t, searchPresets as A, sanitizeMcpToolSchema as At, graphFromSessionFacts as B, assertDeclaredCheck as Bt, withUntrackedArtifacts as C, harvestCorpus as Ct, SEARCH_SPEC_CORRELATION_KEY as D, connectStdioMcp as Dt, createFencedSqlRunContext as E, McpSpawnFault as Et, loadProfile as F, secretEnvOfMcpServer as Ft, chatWorkerSeam as G, readDeclaredCheck as Gt, loadGraphFile as H, declaredCheckDeliverable as Ht, pickBestProfile as I, inlineSandboxClient as It, strategyTournament as J, deterministicCompletion as Jt, createChatSessionStore as K, runIsolatedCheck as Kt, profileRegistry as L, loopCampaignDispatch as Lt, connectRemoteSupervisor as M, mcpSecretEnvMetadataKey as Mt, connectRemoteSupervisorControl as N, resolveMcpServerLaunch as Nt, assertSearchSpec as O, materializeLocalMcp as Ot, bestProfileFor as P, resolveSecretEnv as Pt, printBenchmarkReport as Q, pairwiseSignificance as Qt, profileRunsForName as R, loopDispatch as Rt, copyUntrackedIntoClone as S, HarvestError as St, validateStoredGraph as T, resolveSandboxClient as Tt, graphDesignerExtraTools as U, declaredCheckDigest as Ut, GraphFileResolutionError as V, checkProgramDigest as Vt, chatTransportExecutor as W, declaredCheckJudge as Wt, openSandboxRun as X, stopSentinel as Xt, SandboxRunAbortError as Y, sentinelCompletion as Yt, createS3PrivateCasStore as Z, leaderboard as Zt, NOTE_MAX_CHARS as _, buildSteerContext as _t, localShell as a, FileCorpus as at, composeWorkerEvidence as b, observationFromRegistry as bt, createVerifierEnvironment as c, fanout as ct, harvestSurfaceDiffs as d, panel as dt, renderLeaderboardMarkdown as en, createPrivateCasArtifactPort as et, analystsFromRegistry as f, pipeline as ft, EVIDENCE_MAX_CHARS as g, assertTraceDerivedFindings as gt, runCoderChecks as h, widen as ht, jjWorkspace as i, openSqlRunStore as in, runPersonified as it, searchSpecDigest as j, envKeyProvider as jt, compileSearchSpec as k, createMcpEnvironment as kt, boxSurfaceReader as l, flatWidenGate as lt, worktreeFanout as m, verify as mt, makeFinding$1 as n, renderPairwiseMarkdown as nn, trajectoryReport as nt, runInWorkspace as o, InMemoryCorpus as ot, failuresAnalyst as p, selectValidWinner as pt, runStrategyEvolution as q, completionAuthorizes as qt, gitWorkspace as r, SqlRunOwnershipError as rn, definePersona as rt, createWaterfallCollector as s, renderCorpusToInstructions as st, computeFindingId$1 as t, renderLeaderboardSvg as tn, equalKOnCost as tt, fsSurfaceReader as u, loopUntil as ut, VERIFY_TAIL_CHARS as v, createScopeAnalyst as vt, analyzeTrace as w, defineLeaderboard as wt, settledWorkerOut as x, inProcessSandboxClient as xt, closingWorkerNote as y, registryScopeAnalyst as yt, recordProfileRun as z, superviseDispatch as zt };
10073
10097
 
10074
- //# sourceMappingURL=runtime-Cxlb_vie.js.map
10098
+ //# sourceMappingURL=runtime-BmAGI6UG.js.map