maka-agent 0.2.0-dev.3.20260830 → 0.2.0-dev.5.20260830
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/cli-core.js +1 -0
- package/dist/eval-bundle-path.js +1 -1
- package/dist/pi-tui-runner.js +3 -1
- package/dist/runtime-host-cli.js +37 -3
- package/dist/runtime-host-onboarding.js +10 -1
- package/dist/runtime-host-peer-mesh-management-command.js +17 -0
- package/dist/runtime-host-setup-command.js +33 -15
- package/dist/runtime-host-systemd-service.js +9 -3
- package/dist/runtime-host-tui-context.js +2 -6
- package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
- package/node_modules/@maka/eval/dist/external-subject.js +1 -1
- package/node_modules/@maka/eval/dist/harbor-external-subject.js +2 -2
- package/node_modules/@maka/runtime/dist/sandbox/macos-seatbelt.js +68 -9
- package/node_modules/@maka/runtime-host/dist/client/peer-client.js +22 -3
- package/node_modules/@maka/runtime-host/dist/operator/peer-mesh-management-frame.js +14 -0
- package/{packages/eval/dist/index.js → node_modules/@maka/runtime-host/dist/peer-mesh/display-name.js} +12 -10
- package/node_modules/@maka/runtime-host/dist/peer-mesh/model.js +32 -21
- package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +207 -47
- package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +2 -0
- package/node_modules/@maka/runtime-host/dist/peer-mesh/store.js +18 -5
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +5 -1
- package/node_modules/@maka/runtime-host/dist/protocol/peer-mesh.js +59 -2
- package/node_modules/@maka/runtime-host/dist/server/access-authority.js +11 -7
- package/node_modules/@maka/runtime-host/dist/server/connection-session.js +3 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-service.js +1 -0
- package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/peer-mesh-authority.js +19 -0
- package/package.json +1 -2
- package/packages/eval/dist/attempt-store.js +0 -138
- package/packages/eval/dist/cli.js +0 -119
- package/packages/eval/dist/experiment-directory.js +0 -59
- package/packages/eval/dist/experiment.js +0 -49
- package/packages/eval/dist/external-subject.js +0 -488
- package/packages/eval/dist/harbor-external-subject.js +0 -929
- package/packages/eval/dist/harbor-maka-subject.js +0 -83
- package/packages/eval/dist/harness-environment.js +0 -80
- package/packages/eval/dist/harness-executor.js +0 -1013
- package/packages/eval/dist/install-preflight.js +0 -201
- package/packages/eval/dist/maka-artifacts.js +0 -126
- package/packages/eval/dist/maka-runtime-policy.js +0 -42
- package/packages/eval/dist/maka-subject.js +0 -268
- package/packages/eval/dist/metering-checkpoint.js +0 -80
- package/packages/eval/dist/provider-admission.js +0 -39
- package/packages/eval/dist/provider-metering.js +0 -67
- package/packages/eval/dist/provider-web-tool-surface.js +0 -74
- package/packages/eval/dist/relay-result-frame.js +0 -38
- package/packages/eval/dist/result.js +0 -94
- package/packages/eval/dist/runner.js +0 -290
- package/packages/eval/dist/spec.js +0 -135
- package/packages/eval/dist/toolchain-verification.js +0 -130
- package/packages/eval/harbor/deepseek-codex-models.json +0 -69
- package/packages/eval/harbor/deepseek-harness-profile/cordis.patch.yml +0 -140
- package/packages/eval/harbor/deepseek-harness-profile/cordis.yml +0 -18
- package/packages/eval/harbor/deepseek-harness-profile/package.json +0 -10
- package/packages/eval/harbor/docker-compose-egress-proxy.yaml +0 -57
- package/packages/eval/harbor/egress-proxy/Dockerfile +0 -25
- package/packages/eval/harbor/egress-proxy/entrypoint.sh +0 -62
- package/packages/eval/harbor/egress-proxy/network-policy +0 -148
- package/packages/eval/harbor/egress_filter.py +0 -435
- package/packages/eval/harbor/eval_framework.py +0 -40
- package/packages/eval/harbor/relay_agent.py +0 -686
- package/packages/eval/harbor/run_trial.py +0 -223
- package/packages/eval/package.json +0 -20
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
20
|
-
import { dirname, join } from 'node:path';
|
|
21
|
-
import { runHostedExecution } from '@maka/runtime-host/client';
|
|
22
|
-
import { captureMakaRuntimeArtifacts, writeMakaArtifactCollectionError } from './maka-artifacts.js';
|
|
23
|
-
import { makaEvalRuntimePolicyDocument } from './maka-runtime-policy.js';
|
|
24
|
-
import { takeRelayResultToken, writeRelayResult } from './relay-result-frame.js';
|
|
25
|
-
const resultToken = takeRelayResultToken();
|
|
26
|
-
const payload = JSON.parse(Buffer.from(process.argv[2] ?? '', 'base64url').toString());
|
|
27
|
-
const abort = new AbortController();
|
|
28
|
-
let artifactCapture = Promise.resolve();
|
|
29
|
-
const captureArtifacts = (reason) => {
|
|
30
|
-
artifactCapture = artifactCapture.then(async () => {
|
|
31
|
-
try {
|
|
32
|
-
await captureMakaRuntimeArtifacts({
|
|
33
|
-
stateRoot: payload.rootPath,
|
|
34
|
-
destinationRoot: payload.artifactRoot,
|
|
35
|
-
reason,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
await writeMakaArtifactCollectionError(payload.artifactRoot, error).catch(() => undefined);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return artifactCapture;
|
|
43
|
-
};
|
|
44
|
-
const stop = () => {
|
|
45
|
-
abort.abort();
|
|
46
|
-
void captureArtifacts('signal');
|
|
47
|
-
};
|
|
48
|
-
process.once('SIGINT', stop);
|
|
49
|
-
process.once('SIGTERM', stop);
|
|
50
|
-
const runtimeHome = join(dirname(payload.rootPath), `${process.pid}-home`);
|
|
51
|
-
await mkdir(payload.rootPath, { recursive: true });
|
|
52
|
-
await mkdir(runtimeHome, { recursive: true, mode: 0o700 });
|
|
53
|
-
await writeFile(join(payload.rootPath, 'runtime-policy.json'), `${JSON.stringify(makaEvalRuntimePolicyDocument(process.env.HTTPS_PROXY))}\n`, { flag: 'wx', mode: 0o600 });
|
|
54
|
-
process.env.HOME = runtimeHome;
|
|
55
|
-
process.env.DEEPSEEK_BASE_URL = payload.baseUrl;
|
|
56
|
-
let result;
|
|
57
|
-
try {
|
|
58
|
-
result = await runHostedExecution({
|
|
59
|
-
rootPath: payload.rootPath,
|
|
60
|
-
baseUrl: payload.baseUrl,
|
|
61
|
-
execution: payload.execution,
|
|
62
|
-
signal: abort.signal,
|
|
63
|
-
hostSettlementTimeoutMs: payload.hostSettlementTimeoutMs,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
finally {
|
|
67
|
-
await captureArtifacts(abort.signal.aborted ? 'signal' : 'settled');
|
|
68
|
-
process.removeListener('SIGINT', stop);
|
|
69
|
-
process.removeListener('SIGTERM', stop);
|
|
70
|
-
}
|
|
71
|
-
const failureReason = result.failureReason;
|
|
72
|
-
const framedResult = failureReason !== undefined && Buffer.byteLength(failureReason) > 768
|
|
73
|
-
? {
|
|
74
|
-
...result,
|
|
75
|
-
failureReason: new TextDecoder().decode(Buffer.from(failureReason).subarray(0, 768)),
|
|
76
|
-
}
|
|
77
|
-
: result;
|
|
78
|
-
writeRelayResult(resultToken, framedResult);
|
|
79
|
-
// Same projection as every other wrapper: the exit code reports what this
|
|
80
|
-
// process did, so whatever can read only the exit code reads the status the
|
|
81
|
-
// frame carries. Nothing decides the subject's fate from it while the frame is
|
|
82
|
-
// readable, but the two must not be able to say different things.
|
|
83
|
-
process.exitCode = result.kind === 'settled' && result.status === 'completed' ? 0 : 1;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { realpath } from 'node:fs/promises';
|
|
20
|
-
import { delimiter, dirname, isAbsolute, relative, resolve, sep } from 'node:path';
|
|
21
|
-
import { fileURLToPath } from 'node:url';
|
|
22
|
-
export const BUNDLED_HARNESS_RELAY_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../harbor');
|
|
23
|
-
export function createHarnessPreparationEnvironment(options) {
|
|
24
|
-
const allowed = new Set([
|
|
25
|
-
'HOME',
|
|
26
|
-
'PATH',
|
|
27
|
-
'TMPDIR',
|
|
28
|
-
'TMP',
|
|
29
|
-
'TEMP',
|
|
30
|
-
'LANG',
|
|
31
|
-
'LC_ALL',
|
|
32
|
-
'SSL_CERT_FILE',
|
|
33
|
-
'SSL_CERT_DIR',
|
|
34
|
-
'REQUESTS_CA_BUNDLE',
|
|
35
|
-
'CURL_CA_BUNDLE',
|
|
36
|
-
'XDG_CACHE_HOME',
|
|
37
|
-
...options.declared,
|
|
38
|
-
]);
|
|
39
|
-
const credentials = new Set(options.subjectCredentialNames);
|
|
40
|
-
const inherited = Object.fromEntries([...allowed].flatMap((name) => {
|
|
41
|
-
const value = process.env[name];
|
|
42
|
-
return value === undefined || credentials.has(name) ? [] : [[name, value]];
|
|
43
|
-
}));
|
|
44
|
-
return {
|
|
45
|
-
...inherited,
|
|
46
|
-
PYTHONPATH: [BUNDLED_HARNESS_RELAY_ROOT, inherited.PYTHONPATH].filter(Boolean).join(delimiter),
|
|
47
|
-
...(options.egress
|
|
48
|
-
? {
|
|
49
|
-
MAKA_EVAL_EGRESS_REQUIRED: '1',
|
|
50
|
-
MAKA_EVAL_EGRESS_ALLOWED_HOST: options.egress.allowedHost,
|
|
51
|
-
MAKA_EVAL_NETWORK_POLICY_PATH: options.egress.networkPolicyPath,
|
|
52
|
-
}
|
|
53
|
-
: {}),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export function resolvePathWithinRoot(root, path, label) {
|
|
57
|
-
const resolved = resolve(root, path);
|
|
58
|
-
assertPathWithinRoot(root, resolved, label);
|
|
59
|
-
return resolved;
|
|
60
|
-
}
|
|
61
|
-
export async function resolveRealPathWithinRoot(root, path, label) {
|
|
62
|
-
const resolved = resolvePathWithinRoot(root, path, label);
|
|
63
|
-
let canonicalRoot;
|
|
64
|
-
let canonicalPath;
|
|
65
|
-
try {
|
|
66
|
-
[canonicalRoot, canonicalPath] = await Promise.all([realpath(root), realpath(resolved)]);
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
70
|
-
throw new Error(`${label} cannot be resolved: ${reason}`, { cause: error });
|
|
71
|
-
}
|
|
72
|
-
assertPathWithinRoot(canonicalRoot, canonicalPath, label);
|
|
73
|
-
return canonicalPath;
|
|
74
|
-
}
|
|
75
|
-
function assertPathWithinRoot(root, path, label) {
|
|
76
|
-
const fromRoot = relative(root, path);
|
|
77
|
-
if (fromRoot === '..' || fromRoot.startsWith(`..${sep}`) || isAbsolute(fromRoot)) {
|
|
78
|
-
throw new Error(`${label} escapes its source root`);
|
|
79
|
-
}
|
|
80
|
-
}
|