maka-agent 0.2.0-dev.4.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.
Files changed (44) hide show
  1. package/dist/eval-bundle-path.js +1 -1
  2. package/dist/pi-tui-runner.js +3 -1
  3. package/dist/runtime-host-onboarding.js +10 -1
  4. package/dist/runtime-host-tui-context.js +2 -6
  5. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  6. package/node_modules/@maka/eval/dist/external-subject.js +1 -1
  7. package/node_modules/@maka/eval/dist/harbor-external-subject.js +2 -2
  8. package/package.json +1 -2
  9. package/packages/eval/dist/attempt-store.js +0 -138
  10. package/packages/eval/dist/cli.js +0 -119
  11. package/packages/eval/dist/experiment-directory.js +0 -59
  12. package/packages/eval/dist/experiment.js +0 -49
  13. package/packages/eval/dist/external-subject.js +0 -488
  14. package/packages/eval/dist/harbor-external-subject.js +0 -929
  15. package/packages/eval/dist/harbor-maka-subject.js +0 -83
  16. package/packages/eval/dist/harness-environment.js +0 -80
  17. package/packages/eval/dist/harness-executor.js +0 -1013
  18. package/packages/eval/dist/index.js +0 -28
  19. package/packages/eval/dist/install-preflight.js +0 -201
  20. package/packages/eval/dist/maka-artifacts.js +0 -126
  21. package/packages/eval/dist/maka-runtime-policy.js +0 -42
  22. package/packages/eval/dist/maka-subject.js +0 -268
  23. package/packages/eval/dist/metering-checkpoint.js +0 -80
  24. package/packages/eval/dist/provider-admission.js +0 -39
  25. package/packages/eval/dist/provider-metering.js +0 -67
  26. package/packages/eval/dist/provider-web-tool-surface.js +0 -74
  27. package/packages/eval/dist/relay-result-frame.js +0 -38
  28. package/packages/eval/dist/result.js +0 -94
  29. package/packages/eval/dist/runner.js +0 -290
  30. package/packages/eval/dist/spec.js +0 -135
  31. package/packages/eval/dist/toolchain-verification.js +0 -130
  32. package/packages/eval/harbor/deepseek-codex-models.json +0 -69
  33. package/packages/eval/harbor/deepseek-harness-profile/cordis.patch.yml +0 -140
  34. package/packages/eval/harbor/deepseek-harness-profile/cordis.yml +0 -18
  35. package/packages/eval/harbor/deepseek-harness-profile/package.json +0 -10
  36. package/packages/eval/harbor/docker-compose-egress-proxy.yaml +0 -57
  37. package/packages/eval/harbor/egress-proxy/Dockerfile +0 -25
  38. package/packages/eval/harbor/egress-proxy/entrypoint.sh +0 -62
  39. package/packages/eval/harbor/egress-proxy/network-policy +0 -148
  40. package/packages/eval/harbor/egress_filter.py +0 -435
  41. package/packages/eval/harbor/eval_framework.py +0 -40
  42. package/packages/eval/harbor/relay_agent.py +0 -686
  43. package/packages/eval/harbor/run_trial.py +0 -223
  44. 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
- }