@tangle-network/agent-app 0.63.37 → 0.63.39

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.
@@ -1,6 +1,6 @@
1
1
  /** Read one source directory, applying only shared path-boundary exclusions. Callers retain their own file and directory policy. */
2
2
  export declare function sourceDirectoryEntries(dir: string, repoDir: string, exclude: readonly string[]): {
3
- entry: import("node:fs").Dirent<string>;
3
+ entry: import("fs").Dirent<string>;
4
4
  full: string;
5
5
  rel: string;
6
6
  }[];
@@ -10,7 +10,7 @@ import {
10
10
  runSignoff,
11
11
  runSurfaceLadderCli,
12
12
  runWorkspaceSurfaceCli
13
- } from "../chunk-XBUZ43VQ.js";
13
+ } from "../chunk-F25HBFAM.js";
14
14
  import "../chunk-VEPII3YP.js";
15
15
  import {
16
16
  invokedAsScript
@@ -42,7 +42,7 @@ import {
42
42
  runWorkspaceSurfaceCli,
43
43
  summarizeSurfacePage,
44
44
  surfaceDeltaL
45
- } from "../chunk-XBUZ43VQ.js";
45
+ } from "../chunk-F25HBFAM.js";
46
46
  import "../chunk-VEPII3YP.js";
47
47
  export {
48
48
  HEADER_TOP_TOLERANCE_PX,
@@ -39,6 +39,7 @@ function seedsFromReport(report) {
39
39
  }
40
40
  function proofFromSignoffReport(input) {
41
41
  const { report } = input;
42
+ if (report.cleanupErrors?.length) throw new Error("signoff: cleanup failures cannot issue a sign-off proof");
42
43
  if (report.phase !== void 0 && report.phase !== "all") {
43
44
  throw new Error(`signoff: partial phase ${report.phase} cannot issue a full sign-off proof`);
44
45
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/signoff/proof-from-report.ts"],"sourcesContent":["/**\n * The join between the runner and the proof: one sign-off run produces one\n * report, and this turns that report into the signed, attachable record.\n *\n * Nothing here re-runs or re-judges anything. The runner owns what happened; the\n * proof owns what is provable about it later. Keeping the two in one direction\n * is what stops a second, drifting idea of \"which steps ran\" from appearing.\n */\nimport { hashStepOutput, buildSignoffProof, type SignoffProof, type SignoffProofStep } from './proof-record'\nimport { readCommitFacts } from './proof-git'\nimport type { SignoffReport, SignoffStepResult } from './types'\n\n/**\n * A step that never executed has no exit code, so it is recorded as one no\n * process can produce. `status` is what a reader and the verifier judge on;\n * this exists so the field is never a plausible-looking `0`.\n */\nconst NO_EXIT_CODE = -1\n\n/** The `command` of a step that never executed. A skipped step had no command line. */\nconst NOT_EXECUTED_COMMAND = '(never executed)'\n\nexport interface ProofFromReportInput {\n readonly report: SignoffReport\n /** Repo identity the verifier's required-step table is keyed on. */\n readonly repo: string\n /** Source repository. Defaults to the root the run recorded. */\n readonly repoDir?: string\n /** Step ids the run treated as required. Defaults to every step the report carries. */\n readonly declaredRequired?: readonly string[]\n readonly key?: Uint8Array\n readonly now?: Date\n}\n\nfunction stepFromResult(result: SignoffStepResult, startedAtEpochMs: number): SignoffProofStep {\n const attempts = result.attempts\n const worst = attempts.reduce<number>((worstSoFar, attempt) => (attempt.exitCode !== 0 ? attempt.exitCode : worstSoFar), 0)\n return {\n id: result.name,\n command: attempts[0]?.command ?? NOT_EXECUTED_COMMAND,\n cwd: '.',\n status: result.status,\n exitCode: attempts.length === 0 ? NO_EXIT_CODE : worst,\n durationMs: Math.max(0, Math.round(result.durationMs)),\n startedAt: new Date(startedAtEpochMs + (result.startedAtMs ?? 0)).toISOString(),\n // Every attempt's output, in order — a shuffled step that failed on the\n // second seed must not digest to the same value as one that passed twice.\n outputSha256: hashStepOutput(attempts.map((attempt) => attempt.output).join('\\n')),\n }\n}\n\n/** Every seed the run used, keyed so a reader can replay one step rather than the whole run. */\nfunction seedsFromReport(report: SignoffReport): Record<string, string | number> {\n const seeds: Record<string, string | number> = { base: report.seedBase }\n for (const step of report.steps) {\n step.attempts.forEach((attempt, index) => {\n if (attempt.seed !== null) seeds[`${step.name}#${index}`] = attempt.seed\n })\n }\n return seeds\n}\n\nexport function proofFromSignoffReport(input: ProofFromReportInput): SignoffProof {\n const { report } = input\n if (report.phase !== undefined && report.phase !== 'all') {\n throw new Error(`signoff: partial phase ${report.phase} cannot issue a full sign-off proof`)\n }\n const repoDir = input.repoDir ?? report.repo.root\n\n // HEAD moving during a run makes every later claim ambiguous — the checks ran\n // over one commit and the proof would name another. Refused, not reconciled.\n const facts = readCommitFacts(repoDir, 'HEAD')\n if (facts.commit !== report.repo.head) {\n throw new Error(`HEAD moved during the sign-off: the run verified ${report.repo.head}, ${repoDir} is now at ${facts.commit}`)\n }\n\n const startedAtEpochMs = Date.parse(report.startedAt)\n const install: SignoffProofStep = {\n id: 'install',\n command: report.install.command,\n cwd: report.workspace,\n status: report.install.exitCode === 0 ? 'passed' : 'failed',\n exitCode: report.install.exitCode,\n durationMs: Math.max(0, Math.round(report.install.durationMs)),\n startedAt: new Date(startedAtEpochMs).toISOString(),\n outputSha256: hashStepOutput(report.install.output),\n }\n const steps = [install, ...report.steps.map((step) => stepFromResult(step, startedAtEpochMs))]\n\n return buildSignoffProof({\n repoDir,\n repo: input.repo,\n steps,\n wallClockMs: report.wallClockMs,\n declaredRequired: input.declaredRequired ?? steps.map((step) => step.id),\n seeds: seedsFromReport(report),\n key: input.key,\n now: input.now,\n })\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAM,eAAe;AAGrB,IAAM,uBAAuB;AAc7B,SAAS,eAAe,QAA2B,kBAA4C;AAC7F,QAAM,WAAW,OAAO;AACxB,QAAM,QAAQ,SAAS,OAAe,CAAC,YAAY,YAAa,QAAQ,aAAa,IAAI,QAAQ,WAAW,YAAa,CAAC;AAC1H,SAAO;AAAA,IACL,IAAI,OAAO;AAAA,IACX,SAAS,SAAS,CAAC,GAAG,WAAW;AAAA,IACjC,KAAK;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,UAAU,SAAS,WAAW,IAAI,eAAe;AAAA,IACjD,YAAY,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,UAAU,CAAC;AAAA,IACrD,WAAW,IAAI,KAAK,oBAAoB,OAAO,eAAe,EAAE,EAAE,YAAY;AAAA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M,IAAI,CAAC,SAAS,eAAe,MAAM,gBAAgB,CAAC,CAAC;AAE7F,SAAO,kBAAkB;AAAA,IACvB;AAAA,IACA,MAAM,MAAM;AAAA,IACZ;AAAA,IACA,aAAa,OAAO;AAAA,IACpB,kBAAkB,MAAM,oBAAoB,MAAM,IAAI,CAAC,SAAS,KAAK,EAAE;AAAA,IACvE,OAAO,gBAAgB,MAAM;AAAA,IAC7B,KAAK,MAAM;AAAA,IACX,KAAK,MAAM;AAAA,EACb,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/signoff/proof-from-report.ts"],"sourcesContent":["/**\n * The join between the runner and the proof: one sign-off run produces one\n * report, and this turns that report into the signed, attachable record.\n *\n * Nothing here re-runs or re-judges anything. The runner owns what happened; the\n * proof owns what is provable about it later. Keeping the two in one direction\n * is what stops a second, drifting idea of \"which steps ran\" from appearing.\n */\nimport { hashStepOutput, buildSignoffProof, type SignoffProof, type SignoffProofStep } from './proof-record'\nimport { readCommitFacts } from './proof-git'\nimport type { SignoffReport, SignoffStepResult } from './types'\n\n/**\n * A step that never executed has no exit code, so it is recorded as one no\n * process can produce. `status` is what a reader and the verifier judge on;\n * this exists so the field is never a plausible-looking `0`.\n */\nconst NO_EXIT_CODE = -1\n\n/** The `command` of a step that never executed. A skipped step had no command line. */\nconst NOT_EXECUTED_COMMAND = '(never executed)'\n\nexport interface ProofFromReportInput {\n readonly report: SignoffReport\n /** Repo identity the verifier's required-step table is keyed on. */\n readonly repo: string\n /** Source repository. Defaults to the root the run recorded. */\n readonly repoDir?: string\n /** Step ids the run treated as required. Defaults to every step the report carries. */\n readonly declaredRequired?: readonly string[]\n readonly key?: Uint8Array\n readonly now?: Date\n}\n\nfunction stepFromResult(result: SignoffStepResult, startedAtEpochMs: number): SignoffProofStep {\n const attempts = result.attempts\n const worst = attempts.reduce<number>((worstSoFar, attempt) => (attempt.exitCode !== 0 ? attempt.exitCode : worstSoFar), 0)\n return {\n id: result.name,\n command: attempts[0]?.command ?? NOT_EXECUTED_COMMAND,\n cwd: '.',\n status: result.status,\n exitCode: attempts.length === 0 ? NO_EXIT_CODE : worst,\n durationMs: Math.max(0, Math.round(result.durationMs)),\n startedAt: new Date(startedAtEpochMs + (result.startedAtMs ?? 0)).toISOString(),\n // Every attempt's output, in order — a shuffled step that failed on the\n // second seed must not digest to the same value as one that passed twice.\n outputSha256: hashStepOutput(attempts.map((attempt) => attempt.output).join('\\n')),\n }\n}\n\n/** Every seed the run used, keyed so a reader can replay one step rather than the whole run. */\nfunction seedsFromReport(report: SignoffReport): Record<string, string | number> {\n const seeds: Record<string, string | number> = { base: report.seedBase }\n for (const step of report.steps) {\n step.attempts.forEach((attempt, index) => {\n if (attempt.seed !== null) seeds[`${step.name}#${index}`] = attempt.seed\n })\n }\n return seeds\n}\n\nexport function proofFromSignoffReport(input: ProofFromReportInput): SignoffProof {\n const { report } = input\n if (report.cleanupErrors?.length) throw new Error('signoff: cleanup failures cannot issue a sign-off proof')\n if (report.phase !== undefined && report.phase !== 'all') {\n throw new Error(`signoff: partial phase ${report.phase} cannot issue a full sign-off proof`)\n }\n const repoDir = input.repoDir ?? report.repo.root\n\n // A proof must name the commit that was checked.\n const facts = readCommitFacts(repoDir, 'HEAD')\n if (facts.commit !== report.repo.head) {\n throw new Error(`HEAD moved during the sign-off: the run verified ${report.repo.head}, ${repoDir} is now at ${facts.commit}`)\n }\n\n const startedAtEpochMs = Date.parse(report.startedAt)\n const install: SignoffProofStep = {\n id: 'install',\n command: report.install.command,\n cwd: report.workspace,\n status: report.install.exitCode === 0 ? 'passed' : 'failed',\n exitCode: report.install.exitCode,\n durationMs: Math.max(0, Math.round(report.install.durationMs)),\n startedAt: new Date(startedAtEpochMs).toISOString(),\n outputSha256: hashStepOutput(report.install.output),\n }\n const steps = [install, ...report.steps.map((step) => stepFromResult(step, startedAtEpochMs))]\n\n return buildSignoffProof({\n repoDir,\n repo: input.repo,\n steps,\n wallClockMs: report.wallClockMs,\n declaredRequired: input.declaredRequired ?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AAO,KAAK;AAG7C,QAAM,QAAQ,gBAAgB,SAAS,MAAM;AAC7C,MAAI,MAAM,WAAW,OAAO,KAAK,MAAM;AACrC,UAAM,IAAI,MAAM,oDAAoD,OAAO,KAAK,IAAI,KAAK,OAAO,cAAc,MAAM,MAAM,EAAE;AAAA,EAC9H;AAEA,QAAM,mBAAmB,KAAK,MAAM,OAAO,SAAS;AACpD,QAAM,UAA4B;AAAA,IAChC,IAAI;AAAA,IACJ,SAAS,OAAO,QAAQ;AAAA,IACxB,KAAK,OAAO;AAAA,IACZ,QAAQ,OAAO,QAAQ,aAAa,IAAI,WAAW;AAAA,IACnD,UAAU,OAAO,QAAQ;AAAA,IACzB,YAAY,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,QAAQ,UAAU,CAAC;AAAA,IAC7D,WAAW,IAAI,KAAK,gBAAgB,EAAE,YAAY;AAAA,IAClD,cAAc,eAAe,OAAO,QAAQ,MAAM;AAAA,EACpD;AACA,QAAM,QAAQ,CAAC,SAAS,GAAG,OAAO,MAAM,IAAI,CAAC,SAAS,eAAe,MAAM,gBAAgB,CAAC,CAAC;AAE7F,SAAO,kBAAkB;AAAA,IACvB;AAAA,IACA,MAAM,MAAM;AAAA,IACZ;AAAA,IACA,aAAa,OAAO;AAAA,IACpB,kBAAkB,MAAM,oBAAoB,MAAM,IAAI,CAAC,SAAS,KAAK,EAAE;AAAA,IACvE,OAAO,gBAAgB,MAAM;AAAA,IAC7B,KAAK,MAAM;AAAA,IACX,KAAK,MAAM;AAAA,EACb,CAAC;AACH;","names":[]}
@@ -1,21 +1,4 @@
1
1
  import type { SignoffEvent, SignoffReport, SignoffPhase, SignoffSource } from './types';
2
- /**
3
- * The sign-off run: reproduce a clean CI environment, then go further.
4
- *
5
- * Order matters and each stage exists for a failure this fleet actually paid
6
- * for:
7
- * 1. a pristine checkout (`workspace.ts`) — no warm `node_modules`, no Vite
8
- * cache, because that is the entire mechanical difference between "green
9
- * locally" and "red in CI";
10
- * 2. `--frozen-lockfile` into a store keyed on the lockfile (`store.ts`) — the
11
- * clean install CI does, without paying the download twice;
12
- * 3. the repo's declared steps (`config.ts`), run as a graph rather than a line
13
- * (`schedule.ts`), with the suite re-run under randomized file order and
14
- * recorded seeds (`seeds.ts`) — the part CI does not do at all.
15
- *
16
- * Nothing about a failure is inferred. Every step reports its command, exit
17
- * code, duration, seed and captured output.
18
- */
19
2
  export interface RunSignoffOptions {
20
3
  /** Any directory inside the repo. Defaults to the process cwd. */
21
4
  readonly repoDir?: string;
@@ -1,15 +1,3 @@
1
- /**
2
- * The vocabulary of a local sign-off run: what a repo declares, and what the
3
- * run produces as proof.
4
- *
5
- * A sign-off gate replaces CI as the merge gate, so it has to reproduce what CI
6
- * does structurally (a pristine dependency tree) and then do more than CI does
7
- * (randomized suite order, recorded seeds, a dependency graph run in parallel).
8
- * Both halves are declared here rather than hardcoded, because the three
9
- * workflows this must express — agent-app, legal-agent, tax-agent — differ in
10
- * install filter, step list, language (one has a Python step) and repo-specific
11
- * gates.
12
- */
13
1
  import type { AppDefaultsExemptions } from './app-defaults';
14
2
  import type { CachePruneResult } from './cache';
15
3
  export type SignoffPhase = 'all' | 'release' | 'suites';
@@ -207,10 +195,13 @@ export interface SignoffReport {
207
195
  readonly phase?: SignoffPhase;
208
196
  readonly selection?: SignoffSelection;
209
197
  readonly ok: boolean;
198
+ /** Cleanup refusals retain primary results and make the overall verdict fail. */
199
+ readonly cleanupErrors?: readonly string[];
210
200
  readonly startedAt: string;
211
201
  readonly repo: SignoffRepoFacts;
212
202
  readonly configOrigin: SignoffConfigOrigin;
213
203
  readonly workspace: string;
204
+ /** Kept intentionally, or retirement failed and removal is unconfirmed. */
214
205
  readonly workspaceRetained: boolean;
215
206
  readonly host: SignoffHostFacts;
216
207
  readonly install: SignoffInstallResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.63.37",
3
+ "version": "0.63.39",
4
4
  "packageManager": "pnpm@11.24.0",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [
@@ -820,7 +820,7 @@
820
820
  "@tiptap/starter-kit": "^3.32.0",
821
821
  "@tiptap/suggestion": "^3.32.0",
822
822
  "@types/better-sqlite3": "^9.6.0",
823
- "@types/node": "^26.6.5",
823
+ "@types/node": "^24.19.2",
824
824
  "@types/proper-lockfile": "4.1.4",
825
825
  "@types/react": "^19.3.0",
826
826
  "@types/react-dom": "19.3.0",