Skip to content

Commit 0cfd505

Browse files
committed
merge: integrate main into the registry hive runtime ceiling branch
GitHub CI tests the merge with main. Main now removes copied authentication even when command cleanup fails, which the evaluation command test still required to remain.
2 parents 5096a4d + fe791ff commit 0cfd505

278 files changed

Lines changed: 7784 additions & 6042 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** Remove copied authentication independently; retain ordinary files until commands release. */
2+
export function closeAgentEvaluation(options: {
3+
readonly commands: { close(): Promise<void> };
4+
readonly authPath: string;
5+
readonly evaluationRoot: string;
6+
readonly keepFixtures: boolean;
7+
}): Promise<void>;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { rm } from "node:fs/promises";
2+
3+
import { closeVerifierResources } from "./verifier-cleanup.mjs";
4+
5+
/** Remove copied authentication independently; retain ordinary files until commands release. */
6+
export async function closeAgentEvaluation({
7+
commands,
8+
authPath,
9+
evaluationRoot,
10+
keepFixtures,
11+
}) {
12+
let commandsReleased = false;
13+
await closeVerifierResources([
14+
async () => {
15+
await commands.close();
16+
commandsReleased = true;
17+
},
18+
() => rm(authPath, { force: true }),
19+
async () => {
20+
if (commandsReleased && !keepFixtures)
21+
await rm(evaluationRoot, { recursive: true, force: true });
22+
},
23+
]);
24+
}

‎scripts/lib/http3-verifier-lifecycle.test.mjs‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,15 @@ test("dispatch reverses origin completion; client and capture may arrive in othe
375375
test("cleanup verifies and retires a separately owned producer group", async () => {
376376
const root = await mkdtemp(join(tmpdir(), "rea-http3-group-"));
377377
const runId = randomUUID();
378-
const child = spawn("/usr/bin/sleep", ["60"], {
379-
detached: true,
380-
env: { ...process.env, REA_PROCESS_RUN_ID: runId },
381-
stdio: "ignore",
382-
});
378+
const child = spawn(
379+
process.execPath,
380+
["--eval", "setInterval(() => {}, 1000)"],
381+
{
382+
detached: true,
383+
env: { ...process.env, REA_PROCESS_RUN_ID: runId },
384+
stdio: "ignore",
385+
},
386+
);
383387
let primaryError;
384388
let cleaned = false;
385389
try {

‎scripts/lib/real-hopper-fixture.d.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface RealHopperFixtureTargets {
2424
readonly manifestPath: string;
2525
readonly primary: RealHopperFixtureTarget;
2626
readonly secondary: RealHopperFixtureTarget;
27+
readonly unicode?: RealHopperFixtureTarget;
2728
readonly large: RealHopperFixtureTarget;
2829
readonly oracle: RealHopperFixtureOracle;
2930
readonly largeOracle: RealHopperLargeFixtureOracle;

‎scripts/lib/recorded-core-fixtures.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ def note_header(content, note, **changes):
3434

3535
# Authored metadata carriers exercise actual parser projection through public
3636
# inspection, independently of the host that produced the captured amd64 core.
37+
# The named ARCHEXT/UNWIND carriers are written once below using numeric type IDs.
3738
for name, machine, kind in [
38-
("aarch64-archext", "EM_AARCH64", "PT_AARCH64_ARCHEXT"),
39-
("aarch64-unwind", "EM_AARCH64", "PT_AARCH64_UNWIND"),
4039
("aarch64-mte-opaque", "EM_AARCH64", 0x70000002),
4140
("amd64-processor-opaque", "EM_X86_64", 0x70000001),
4241
]:
Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import { Client } from "@modelcontextprotocol/client";
22
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
3-
import { execFile } from "node:child_process";
3+
import { createVerifierMcpOwner } from "./verifier-mcp-owner.mjs";
4+
import { withVerifierCleanup } from "./verifier-cleanup.mjs";
45
import { readFile } from "node:fs/promises";
56
import { join } from "node:path";
6-
import { promisify } from "node:util";
77

88
import { FULL_CATALOG_IDENTITY } from "../../dist/catalogIdentity.js";
99
import { verifyCompleteToolCatalog } from "./verify-package-core.mjs";
1010

11-
const execute = promisify(execFile);
12-
13-
/** Install the selected archive or registry specifier before any protocol deadline. */
14-
export async function installCanaryPackage(specifier, workspace, environment) {
11+
/** Install the selected archive or registry specifier with an owned ten-minute deadline. */
12+
export async function installCanaryPackage(
13+
specifier,
14+
workspace,
15+
environment,
16+
commands,
17+
) {
1518
const prefix = join(workspace, "installed");
16-
await execute(
19+
await commands.exec(
1720
"npm",
1821
[
1922
"install",
@@ -26,7 +29,12 @@ export async function installCanaryPackage(specifier, workspace, environment) {
2629
prefix,
2730
specifier,
2831
],
29-
{ cwd: workspace, env: environment, maxBuffer: 16 * 1024 * 1024 },
32+
{
33+
cwd: workspace,
34+
env: environment,
35+
timeout: 600000,
36+
maxBuffer: 16 * 1024 * 1024,
37+
},
3038
);
3139
return join(prefix, "node_modules", "rea-agents");
3240
}
@@ -36,7 +44,7 @@ export async function verifyInstalledCanaryPackage(
3644
packageRoot,
3745
version,
3846
workspace,
39-
environment,
47+
{ environment, commands },
4048
) {
4149
const installed = JSON.parse(
4250
await readFile(join(packageRoot, "package.json"), "utf8"),
@@ -47,9 +55,10 @@ export async function verifyInstalledCanaryPackage(
4755
);
4856
const launcher = join(packageRoot, "scripts", "rea.mjs");
4957
for (const option of ["--help", "--llms"])
50-
await execute(process.execPath, [launcher, option], {
58+
await commands.exec(process.execPath, [launcher, option], {
5159
cwd: workspace,
5260
env: environment,
61+
timeout: 30000,
5362
maxBuffer: 16 * 1024 * 1024,
5463
});
5564
const transport = new StdioClientTransport({
@@ -65,22 +74,20 @@ export async function verifyInstalledCanaryPackage(
6574
if (stderr.length < 16_384)
6675
stderr += chunk.toString("utf8").slice(0, 16_384 - stderr.length);
6776
});
68-
try {
69-
await client.connect(transport);
70-
const toolNames = await verifyCompleteToolCatalog(client);
71-
return {
72-
mcpTools: toolNames.length,
73-
canonicalMcpTools: FULL_CATALOG_IDENTITY.counts.mcp_tools,
74-
};
75-
} catch (cause) {
76-
throw new Error(`Installed package MCP verification failed: ${stderr}`, {
77-
cause,
78-
});
79-
} finally {
77+
const owner = createVerifierMcpOwner();
78+
commands.adopt(owner, "installed package MCP transport");
79+
return withVerifierCleanup(async () => {
8080
try {
81-
await client.close();
82-
} finally {
83-
await transport.close();
81+
await owner.open(client, transport);
82+
const toolNames = await verifyCompleteToolCatalog(client);
83+
return {
84+
mcpTools: toolNames.length,
85+
canonicalMcpTools: FULL_CATALOG_IDENTITY.counts.mcp_tools,
86+
};
87+
} catch (cause) {
88+
throw new Error(`Installed package MCP verification failed: ${stderr}`, {
89+
cause,
90+
});
8491
}
85-
}
92+
}, [() => owner.close()]);
8693
}

‎scripts/verify-agent-experience.mjs‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { closeAgentEvaluation } from "./lib/agent-evaluation-cleanup.mjs";
12
import { importVerifierSource } from "./lib/verifier-source-loader.mjs";
23

34
import { createHash } from "node:crypto";
@@ -7,7 +8,6 @@ import {
78
mkdir,
89
mkdtemp,
910
readFile,
10-
rm,
1111
writeFile,
1212
} from "node:fs/promises";
1313
import { homedir } from "node:os";
@@ -18,10 +18,7 @@ import { tsImport } from "tsx/esm/api";
1818
import { PRODUCT_IDENTITY } from "../dist/identity.js";
1919
import { createAgentEvaluationCommands } from "./lib/agent-evaluation-commands.mjs";
2020
import { assertAgentEvaluationReportPassed } from "./lib/agent-evaluation-report-gate.mjs";
21-
import {
22-
closeVerifierResources,
23-
withVerifierCleanup,
24-
} from "./lib/verifier-cleanup.mjs";
21+
import { withVerifierCleanup } from "./lib/verifier-cleanup.mjs";
2522
import { completeVerifierRun, createVerifierRun } from "./lib/verifier-run.mjs";
2623

2724
const { parseSkillManifestMetadata } = await importVerifierSource(
@@ -427,16 +424,13 @@ await withVerifierCleanup(
427424
},
428425
// Even a deliberately retained fixture directory must never retain auth.
429426
[
430-
async () => {
431-
// A failed process cleanup retains both its exact owner and its files.
432-
await commands.close();
433-
await closeVerifierResources([
434-
() => rm(authPath, { force: true }),
435-
...(process.env.REA_AGENT_EVAL_KEEP_FIXTURES === "true"
436-
? []
437-
: [() => rm(evaluationRoot, { recursive: true, force: true })]),
438-
]);
439-
},
427+
() =>
428+
closeAgentEvaluation({
429+
commands,
430+
authPath,
431+
evaluationRoot,
432+
keepFixtures: process.env.REA_AGENT_EVAL_KEEP_FIXTURES === "true",
433+
}),
440434
],
441435
);
442436

‎scripts/verify-il2cpp-metadata.mjs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Client } from "@modelcontextprotocol/client";
66
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
77
import { absoluteCallerPath } from "../dist/filesystem/callerPath.js";
88
import { toolContract } from "../dist/contracts/toolContracts.js";
9+
import { il2cppMetadataViewRequestSchema } from "../dist/domain/analysisView/il2cppMetadataView.js";
910
import { ArtifactResourceScope } from "../dist/artifacts/ArtifactResourceScope.js";
1011
import {
1112
requireMcpOutput,
@@ -79,6 +80,32 @@ await withVerifierCleanup(async () => {
7980
assert.equal(error.code, "resource_constraint");
8081
assert.equal(error.details.reported_limits.boundary, "mcp-response");
8182
assert.match(error.details.reported_limits.evidence_id, /^ev_/u);
83+
const collections = il2cppMetadataViewRequestSchema.options.map(
84+
(option) => option.shape.collection.value,
85+
);
86+
const collection =
87+
["methods", ...collections].find(
88+
(name) => Array.isArray(report[name]) && report[name].length > 0,
89+
) ?? "methods";
90+
const expectedRows = report[collection].slice(0, 16);
91+
const retained = (
92+
await call("inspect_analysis_view", {
93+
source: {
94+
kind: "retained-evidence",
95+
evidence_id: error.details.reported_limits.evidence_id,
96+
},
97+
view: { kind: "il2cpp-metadata", collection, limit: 16 },
98+
})
99+
).normalized_result;
100+
assert.deepEqual(
101+
retained.items,
102+
expectedRows.map((row, index) => ({ ...row, index })),
103+
"Failed complete delivery must retain its exact Evidence before reanalysis",
104+
);
105+
if (expectedRows.length === 0)
106+
console.log(
107+
"[unverified] Retention lookup succeeded, but empty queryable tables provide no nonempty row-content witness",
108+
);
82109
console.log(
83110
`[ok] MCP complete delivery refused at the stdio budget (${error.details.reported_limits.response_bytes_at_least} bytes) with retained Evidence`,
84111
);

‎scripts/verify-native-ui.mjs‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ try {
165165
scenario.value.steps.some((step) => step.outcome !== "completed") ||
166166
!scenario.value.steps
167167
.at(-1)
168-
?.after?.nodes.some((node) => node.title === "REA fixture incremented")
168+
?.after?.nodes.some(
169+
(node) => node.title === "REA fixture incremented 1",
170+
)
169171
)
170172
throw new Error(
171173
`Source-owned AX scenario failed: ${JSON.stringify(scenario.value.steps.map(({ outcome, reason }) => ({ outcome, reason })))}`,
@@ -195,7 +197,12 @@ try {
195197
evidence.normalized_result?.steps?.some(
196198
(step) => step.outcome !== "completed",
197199
) ||
198-
evidence.normalized_result?.steps?.length !== 2
200+
evidence.normalized_result?.steps?.length !== 2 ||
201+
!evidence.normalized_result?.steps
202+
?.at(-1)
203+
?.after?.nodes.some(
204+
(node) => node.title === "REA fixture incremented 2",
205+
)
199206
)
200207
throw new Error(
201208
`Native UI CLI did not preserve the selected scenario: ${JSON.stringify(evidence.error ?? evidence.normalized_result?.steps?.map(({ outcome, reason }) => ({ outcome, reason })))}`,
@@ -232,7 +239,7 @@ try {
232239
!captured.steps
233240
.at(-1)
234241
?.after?.nodes.some(
235-
(node) => node.title === "REA fixture incremented",
242+
(node) => node.title === "REA fixture incremented 3",
236243
)
237244
)
238245
throw new Error("MCP did not observe the selected fixture's AX action");

0 commit comments

Comments
 (0)