@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.
- package/dist/{chunk-XBUZ43VQ.js → chunk-F25HBFAM.js} +89 -55
- package/dist/chunk-F25HBFAM.js.map +1 -0
- package/dist/peer-floors/source-entries.d.ts +1 -1
- package/dist/signoff/cli.js +1 -1
- package/dist/signoff/index.js +1 -1
- package/dist/signoff/proof.js +1 -0
- package/dist/signoff/proof.js.map +1 -1
- package/dist/signoff/run.d.ts +0 -17
- package/dist/signoff/types.d.ts +3 -12
- package/package.json +2 -2
- package/dist/chunk-XBUZ43VQ.js.map +0 -1
|
@@ -1688,6 +1688,20 @@ async function runSignoff(options = {}) {
|
|
|
1688
1688
|
options.onEvent?.({ kind: "cache-prune", ...result });
|
|
1689
1689
|
}
|
|
1690
1690
|
};
|
|
1691
|
+
let report;
|
|
1692
|
+
let primaryError;
|
|
1693
|
+
let primaryFailed = false;
|
|
1694
|
+
let workspaceRetained = options.keepWorkspace ?? false;
|
|
1695
|
+
const cleanupErrors = [];
|
|
1696
|
+
const cleanup = async (operation, action) => {
|
|
1697
|
+
try {
|
|
1698
|
+
await action();
|
|
1699
|
+
return true;
|
|
1700
|
+
} catch (error) {
|
|
1701
|
+
cleanupErrors.push(`${operation}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1702
|
+
return false;
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1691
1705
|
try {
|
|
1692
1706
|
await prune(cacheDir);
|
|
1693
1707
|
tree = materializeCleanTree({ repoDir: repoRoot, dest: treePath(), source });
|
|
@@ -1759,7 +1773,7 @@ async function runSignoff(options = {}) {
|
|
|
1759
1773
|
const host = hostFacts(tree.path, nodeRequirement);
|
|
1760
1774
|
const seedBase = options.seed ?? newSeedBase();
|
|
1761
1775
|
if (installResult.exitCode !== 0) {
|
|
1762
|
-
|
|
1776
|
+
report = finish({
|
|
1763
1777
|
ok: false,
|
|
1764
1778
|
startedAt,
|
|
1765
1779
|
wallStart,
|
|
@@ -1784,64 +1798,83 @@ async function runSignoff(options = {}) {
|
|
|
1784
1798
|
source,
|
|
1785
1799
|
options
|
|
1786
1800
|
});
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1801
|
+
} else {
|
|
1802
|
+
assertNodeTypesVersion(tree.path, nodeRequirement);
|
|
1803
|
+
const workerDefaults = checkDefaults ? [runWorkerDefaults(tree.path, config.workerConfigs, options)] : [];
|
|
1804
|
+
const treeRoot = tree.path;
|
|
1805
|
+
const outcomes = await runGraph({
|
|
1806
|
+
nodes: config.steps,
|
|
1807
|
+
maxParallel: options.maxParallel ?? config.maxParallel ?? availableParallelism(),
|
|
1808
|
+
keepGoing: options.keepGoing ?? false,
|
|
1809
|
+
run: async (step, signal) => {
|
|
1810
|
+
const attempts = [];
|
|
1811
|
+
for (const plan of planAttempts(step, seedBase, options.shuffleRuns)) {
|
|
1812
|
+
options.onEvent?.({ kind: "step-start", name: step.name, command: plan.command, seed: plan.seed });
|
|
1813
|
+
const result = await runCommand({
|
|
1814
|
+
command: plan.command,
|
|
1815
|
+
cwd: join9(treeRoot, step.cwd ?? "."),
|
|
1816
|
+
env: buildEnv(sharedEnv, [step.env]),
|
|
1817
|
+
timeoutMs: step.timeoutMs,
|
|
1818
|
+
signal
|
|
1819
|
+
});
|
|
1820
|
+
const ok = result.exitCode === 0;
|
|
1821
|
+
attempts.push(toAttempt(result, plan.seed, ok));
|
|
1822
|
+
if (!ok) {
|
|
1823
|
+
emitStepEnd(options, step.name, "failed", attempts);
|
|
1824
|
+
return { ok: false, value: attempts };
|
|
1825
|
+
}
|
|
1811
1826
|
}
|
|
1827
|
+
emitStepEnd(options, step.name, "passed", attempts);
|
|
1828
|
+
return { ok: true, value: attempts };
|
|
1812
1829
|
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1830
|
+
});
|
|
1831
|
+
const appDefaults = checkDefaults ? [runAppDefaults(tree.path, config, options)] : [];
|
|
1832
|
+
const steps = [...outcomes.map(toStepResult), ...workerDefaults, ...appDefaults];
|
|
1833
|
+
report = finish({
|
|
1834
|
+
ok: steps.every((step) => step.status === "passed"),
|
|
1835
|
+
startedAt,
|
|
1836
|
+
wallStart,
|
|
1837
|
+
tree,
|
|
1838
|
+
origin,
|
|
1839
|
+
selection,
|
|
1840
|
+
host,
|
|
1841
|
+
install,
|
|
1842
|
+
steps,
|
|
1843
|
+
seedBase,
|
|
1844
|
+
keepGoing: options.keepGoing ?? false,
|
|
1845
|
+
workspaceRetained: options.keepWorkspace ?? false,
|
|
1846
|
+
source,
|
|
1847
|
+
options
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
} catch (error) {
|
|
1851
|
+
primaryFailed = true;
|
|
1852
|
+
primaryError = error;
|
|
1835
1853
|
} finally {
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
await prune(active.cacheDir,
|
|
1854
|
+
if (tree && !options.keepWorkspace && existsSync9(tree.path)) {
|
|
1855
|
+
workspaceRetained = !await cleanup("remove workspace", () => removeCleanTree(tree));
|
|
1856
|
+
}
|
|
1857
|
+
for (const active of sessions) {
|
|
1858
|
+
if (await cleanup(`close cache session ${active.cacheDir}`, () => active.close())) {
|
|
1859
|
+
await cleanup(`prune cache ${active.cacheDir}`, () => prune(active.cacheDir, workspaceRetained && tree ? [tree.path] : []));
|
|
1842
1860
|
}
|
|
1843
1861
|
}
|
|
1844
1862
|
}
|
|
1863
|
+
if (primaryFailed) {
|
|
1864
|
+
if (cleanupErrors.length) throw new AggregateError(
|
|
1865
|
+
[primaryError, ...cleanupErrors.map((message) => new Error(message))],
|
|
1866
|
+
`${primaryError instanceof Error ? primaryError.message : String(primaryError)}; cleanup failed: ${cleanupErrors.join("; ")}`,
|
|
1867
|
+
{ cause: primaryError }
|
|
1868
|
+
);
|
|
1869
|
+
throw primaryError;
|
|
1870
|
+
}
|
|
1871
|
+
return {
|
|
1872
|
+
...report,
|
|
1873
|
+
ok: report.ok && cleanupErrors.length === 0,
|
|
1874
|
+
workspaceRetained,
|
|
1875
|
+
wallClockMs: Date.now() - wallStart,
|
|
1876
|
+
...cleanupErrors.length ? { cleanupErrors } : {}
|
|
1877
|
+
};
|
|
1845
1878
|
}
|
|
1846
1879
|
function runWorkerDefaults(treeRoot, workerConfigs, options) {
|
|
1847
1880
|
const command = `agent-app-signoff ${WORKER_DEFAULTS_STEP}`;
|
|
@@ -2059,13 +2092,14 @@ function formatSignoffReport(report) {
|
|
|
2059
2092
|
lines.push(`not judged: ${blocked.map((step) => `${step.name} (${step.status})`).join(", ")}`);
|
|
2060
2093
|
lines.push("");
|
|
2061
2094
|
}
|
|
2095
|
+
if (report.cleanupErrors?.length) lines.push(BAR, "cleanup FAILED", BAR, ...report.cleanupErrors, "");
|
|
2062
2096
|
lines.push(`reproduce: ${report.reproduce}`);
|
|
2063
2097
|
return lines.join("\n");
|
|
2064
2098
|
}
|
|
2065
2099
|
function formatSignoffLine(report) {
|
|
2066
2100
|
const passed = report.steps.filter((step) => step.status === "passed").length;
|
|
2067
2101
|
const scope = report.phase && report.phase !== "all" ? `${report.phase.toUpperCase()} ` : "";
|
|
2068
|
-
return `signoff ${scope}${report.ok ? "PASS" : "FAIL"} ${report.repo.head.slice(0, 12)} \u2014 ${passed}/${report.steps.length} steps, ${ms(report.wallClockMs)} wall (${ms(report.serialMs)} serial), seed ${report.seedBase}, ${report.install.cacheHit ? "warm" : "cold"} store, clean install`;
|
|
2102
|
+
return `signoff ${scope}${report.ok ? "PASS" : "FAIL"} ${report.repo.head.slice(0, 12)} \u2014 ${passed}/${report.steps.length} steps, ${ms(report.wallClockMs)} wall (${ms(report.serialMs)} serial), seed ${report.seedBase}, ${report.install.cacheHit ? "warm" : "cold"} store, clean install` + (report.cleanupErrors?.length ? `; ${report.cleanupErrors.length} cleanup failure(s)` : "");
|
|
2069
2103
|
}
|
|
2070
2104
|
|
|
2071
2105
|
// src/signoff/browser-budget.ts
|
|
@@ -2976,4 +3010,4 @@ export {
|
|
|
2976
3010
|
formatWorkspaceSurfaceReport,
|
|
2977
3011
|
runWorkspaceSurfaceCli
|
|
2978
3012
|
};
|
|
2979
|
-
//# sourceMappingURL=chunk-
|
|
3013
|
+
//# sourceMappingURL=chunk-F25HBFAM.js.map
|