mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-13 01:10:45 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
11
openclaw/test/fixtures/child-process-bridge/child.js
vendored
Normal file
11
openclaw/test/fixtures/child-process-bridge/child.js
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
process.stdout.write("ready\n");
|
||||
|
||||
const keepAlive = setInterval(() => {}, 1000);
|
||||
|
||||
const shutdown = () => {
|
||||
clearInterval(keepAlive);
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
process.on("SIGTERM", shutdown);
|
||||
process.on("SIGINT", shutdown);
|
||||
729
openclaw/test/fixtures/cli-startup-bench.json
vendored
Normal file
729
openclaw/test/fixtures/cli-startup-bench.json
vendored
Normal file
|
|
@ -0,0 +1,729 @@
|
|||
{
|
||||
"node": "v25.6.1",
|
||||
"runs": 5,
|
||||
"warmup": 1,
|
||||
"timeoutMs": 30000,
|
||||
"cpuProfDir": null,
|
||||
"heapProfDir": null,
|
||||
"primary": {
|
||||
"entry": "openclaw.mjs",
|
||||
"cases": [
|
||||
{
|
||||
"id": "version",
|
||||
"name": "--version",
|
||||
"args": ["--version"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 96.717625,
|
||||
"maxRssMb": 62.140625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 95.282458,
|
||||
"maxRssMb": 63.609375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 98.361042,
|
||||
"maxRssMb": 62.265625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 100.737375,
|
||||
"maxRssMb": 62.65625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 98.220583,
|
||||
"maxRssMb": 62.484375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 97.86381659999999,
|
||||
"p50": 98.220583,
|
||||
"p95": 100.737375,
|
||||
"min": 95.282458,
|
||||
"max": 100.737375
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 62.63125,
|
||||
"p50": 62.484375,
|
||||
"p95": 63.609375,
|
||||
"min": 62.140625,
|
||||
"max": 63.609375
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "help",
|
||||
"name": "--help",
|
||||
"args": ["--help"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 51.178583,
|
||||
"maxRssMb": 44.671875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 51.062334,
|
||||
"maxRssMb": 44.578125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 51.028625,
|
||||
"maxRssMb": 45.171875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 54.476708,
|
||||
"maxRssMb": 45.578125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 57.570875,
|
||||
"maxRssMb": 45.828125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 53.06342500000001,
|
||||
"p50": 51.178583,
|
||||
"p95": 57.570875,
|
||||
"min": 51.028625,
|
||||
"max": 57.570875
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 45.165625,
|
||||
"p50": 45.171875,
|
||||
"p95": 45.828125,
|
||||
"min": 44.578125,
|
||||
"max": 45.828125
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "health",
|
||||
"name": "health",
|
||||
"args": ["health"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 9451.69,
|
||||
"maxRssMb": 61.046875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9327.157,
|
||||
"maxRssMb": 61.484375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9328.53775,
|
||||
"maxRssMb": 61.5,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9377.894208,
|
||||
"maxRssMb": 61.28125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9362.753917,
|
||||
"maxRssMb": 61.234375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 9369.606575000002,
|
||||
"p50": 9362.753917,
|
||||
"p95": 9451.69,
|
||||
"min": 9327.157,
|
||||
"max": 9451.69
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.309375,
|
||||
"p50": 61.28125,
|
||||
"p95": 61.5,
|
||||
"min": 61.046875,
|
||||
"max": 61.5
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "healthJson",
|
||||
"name": "health --json",
|
||||
"args": ["health", "--json"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 893.690834,
|
||||
"maxRssMb": 61.4375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 888.014083,
|
||||
"maxRssMb": 60.640625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 876.364291,
|
||||
"maxRssMb": 61.328125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 895.80775,
|
||||
"maxRssMb": 60.984375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 892.019584,
|
||||
"maxRssMb": 61.296875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 889.1793083999999,
|
||||
"p50": 892.019584,
|
||||
"p95": 895.80775,
|
||||
"min": 876.364291,
|
||||
"max": 895.80775
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.1375,
|
||||
"p50": 61.296875,
|
||||
"p95": 61.4375,
|
||||
"min": 60.640625,
|
||||
"max": 61.4375
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "statusJson",
|
||||
"name": "status --json",
|
||||
"args": ["status", "--json"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 10240.30475,
|
||||
"maxRssMb": 61.15625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9992.483416,
|
||||
"maxRssMb": 61.71875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9871.820125,
|
||||
"maxRssMb": 61.703125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 9989.689625,
|
||||
"maxRssMb": 61.265625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 10314.48525,
|
||||
"maxRssMb": 61.140625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 10081.756633199999,
|
||||
"p50": 9992.483416,
|
||||
"p95": 10314.48525,
|
||||
"min": 9871.820125,
|
||||
"max": 10314.48525
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.396875,
|
||||
"p50": 61.265625,
|
||||
"p95": 61.71875,
|
||||
"min": 61.140625,
|
||||
"max": 61.71875
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "status",
|
||||
"name": "status",
|
||||
"args": ["status"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 13175.219042,
|
||||
"maxRssMb": 61.546875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 13352.02925,
|
||||
"maxRssMb": 61.359375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 13328.865583,
|
||||
"maxRssMb": 61.34375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 13178.18525,
|
||||
"maxRssMb": 61.609375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 13336.7915,
|
||||
"maxRssMb": 61.765625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 13274.218125000003,
|
||||
"p50": 13328.865583,
|
||||
"p95": 13352.02925,
|
||||
"min": 13175.219042,
|
||||
"max": 13352.02925
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.525,
|
||||
"p50": 61.546875,
|
||||
"p95": 61.765625,
|
||||
"min": 61.34375,
|
||||
"max": 61.765625
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sessions",
|
||||
"name": "sessions",
|
||||
"args": ["sessions"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 7118.772542,
|
||||
"maxRssMb": 61.109375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 6319.220166,
|
||||
"maxRssMb": 61.515625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 8390.35675,
|
||||
"maxRssMb": 62.046875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 6280.020209,
|
||||
"maxRssMb": 61.21875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5861.898708,
|
||||
"maxRssMb": 61.578125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 6794.053675,
|
||||
"p50": 6319.220166,
|
||||
"p95": 8390.35675,
|
||||
"min": 5861.898708,
|
||||
"max": 8390.35675
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.49375,
|
||||
"p50": 61.515625,
|
||||
"p95": 62.046875,
|
||||
"min": 61.109375,
|
||||
"max": 62.046875
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sessionsJson",
|
||||
"name": "sessions --json",
|
||||
"args": ["sessions", "--json"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 7152.919625,
|
||||
"maxRssMb": 62.625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 6019.41,
|
||||
"maxRssMb": 61.40625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 6917.366666,
|
||||
"maxRssMb": 61.890625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5592.944167,
|
||||
"maxRssMb": 61.34375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5591.436042,
|
||||
"maxRssMb": 61.65625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 6254.8153,
|
||||
"p50": 6019.41,
|
||||
"p95": 7152.919625,
|
||||
"min": 5591.436042,
|
||||
"max": 7152.919625
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.784375,
|
||||
"p50": 61.65625,
|
||||
"p95": 62.625,
|
||||
"min": 61.34375,
|
||||
"max": 62.625
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "agentsListJson",
|
||||
"name": "agents list --json",
|
||||
"args": ["agents", "list", "--json"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 974.9935,
|
||||
"maxRssMb": 61.203125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1011.803583,
|
||||
"maxRssMb": 61.375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1008.81175,
|
||||
"maxRssMb": 61.65625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 968.630125,
|
||||
"maxRssMb": 61.40625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1000.931541,
|
||||
"maxRssMb": 62.03125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 993.0340997999999,
|
||||
"p50": 1000.931541,
|
||||
"p95": 1011.803583,
|
||||
"min": 968.630125,
|
||||
"max": 1011.803583
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.534375,
|
||||
"p50": 61.40625,
|
||||
"p95": 62.03125,
|
||||
"min": 61.203125,
|
||||
"max": 62.03125
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gatewayStatus",
|
||||
"name": "gateway status",
|
||||
"args": ["gateway", "status"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 1075.603667,
|
||||
"maxRssMb": 61.1875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1108.246417,
|
||||
"maxRssMb": 61.15625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1071.274458,
|
||||
"maxRssMb": 61.0625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1084.775291,
|
||||
"maxRssMb": 61.46875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1088.898833,
|
||||
"maxRssMb": 61.53125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 1085.7597332,
|
||||
"p50": 1084.775291,
|
||||
"p95": 1108.246417,
|
||||
"min": 1071.274458,
|
||||
"max": 1108.246417
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.28125,
|
||||
"p50": 61.1875,
|
||||
"p95": 61.53125,
|
||||
"min": 61.0625,
|
||||
"max": 61.53125
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gatewayStatusJson",
|
||||
"name": "gateway status --json",
|
||||
"args": ["gateway", "status", "--json"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 1116.443292,
|
||||
"maxRssMb": 61.5,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1076.623208,
|
||||
"maxRssMb": 61.28125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1059.811167,
|
||||
"maxRssMb": 61.78125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1091.463375,
|
||||
"maxRssMb": 61.875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 1080.338709,
|
||||
"maxRssMb": 61.0625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 1084.9359502,
|
||||
"p50": 1080.338709,
|
||||
"p95": 1116.443292,
|
||||
"min": 1059.811167,
|
||||
"max": 1116.443292
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.5,
|
||||
"p50": 61.5,
|
||||
"p95": 61.875,
|
||||
"min": 61.0625,
|
||||
"max": 61.875
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "gatewayHealthJson",
|
||||
"name": "gateway health --json",
|
||||
"args": ["gateway", "health", "--json"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 5477.276208,
|
||||
"maxRssMb": 62.65625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5507.074708,
|
||||
"maxRssMb": 61.453125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5496.467084,
|
||||
"maxRssMb": 61.375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5519.668917,
|
||||
"maxRssMb": 61.703125,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 5498.737875,
|
||||
"maxRssMb": 62.015625,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 5499.844958399999,
|
||||
"p50": 5498.737875,
|
||||
"p95": 5519.668917,
|
||||
"min": 5477.276208,
|
||||
"max": 5519.668917
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.840625,
|
||||
"p50": 61.703125,
|
||||
"p95": 62.65625,
|
||||
"min": 61.375,
|
||||
"max": 62.65625
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "configGetGatewayPort",
|
||||
"name": "config get gateway.port",
|
||||
"args": ["config", "get", "gateway.port"],
|
||||
"samples": [
|
||||
{
|
||||
"ms": 614.115833,
|
||||
"maxRssMb": 61.375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 581.650375,
|
||||
"maxRssMb": 61.59375,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 590.865625,
|
||||
"maxRssMb": 62.421875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 612.827458,
|
||||
"maxRssMb": 61.1875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
},
|
||||
{
|
||||
"ms": 605.788458,
|
||||
"maxRssMb": 61.21875,
|
||||
"exitCode": 0,
|
||||
"signal": null
|
||||
}
|
||||
],
|
||||
"summary": {
|
||||
"sampleCount": 5,
|
||||
"durationMs": {
|
||||
"avg": 601.0495498,
|
||||
"p50": 605.788458,
|
||||
"p95": 614.115833,
|
||||
"min": 581.650375,
|
||||
"max": 614.115833
|
||||
},
|
||||
"maxRssMb": {
|
||||
"avg": 61.559375,
|
||||
"p50": 61.375,
|
||||
"p95": 62.421875,
|
||||
"min": 61.1875,
|
||||
"max": 62.421875
|
||||
},
|
||||
"exitSummary": "code:0x5"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"secondary": null
|
||||
}
|
||||
82
openclaw/test/fixtures/exec-allowlist-shell-parser-parity.json
vendored
Normal file
82
openclaw/test/fixtures/exec-allowlist-shell-parser-parity.json
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
"cases": [
|
||||
{
|
||||
"id": "simple-pipeline",
|
||||
"command": "echo ok | jq .foo",
|
||||
"ok": true,
|
||||
"executables": ["echo", "jq"]
|
||||
},
|
||||
{
|
||||
"id": "chained-commands",
|
||||
"command": "ls && rm -rf /tmp/openclaw-allowlist",
|
||||
"ok": true,
|
||||
"executables": ["ls", "rm"]
|
||||
},
|
||||
{
|
||||
"id": "quoted-chain-operators-remain-literal",
|
||||
"command": "echo \"a && b\"",
|
||||
"ok": true,
|
||||
"executables": ["echo"]
|
||||
},
|
||||
{
|
||||
"id": "reject-command-substitution-unquoted",
|
||||
"command": "echo $(whoami)",
|
||||
"ok": false,
|
||||
"executables": []
|
||||
},
|
||||
{
|
||||
"id": "reject-command-substitution-double-quoted",
|
||||
"command": "echo \"output: $(whoami)\"",
|
||||
"ok": false,
|
||||
"executables": []
|
||||
},
|
||||
{
|
||||
"id": "allow-command-substitution-literal-in-single-quotes",
|
||||
"command": "echo 'output: $(whoami)'",
|
||||
"ok": true,
|
||||
"executables": ["echo"]
|
||||
},
|
||||
{
|
||||
"id": "allow-escaped-command-substitution-double-quoted",
|
||||
"command": "echo \"output: \\$(whoami)\"",
|
||||
"ok": true,
|
||||
"executables": ["echo"]
|
||||
},
|
||||
{
|
||||
"id": "reject-backticks-unquoted",
|
||||
"command": "echo `id`",
|
||||
"ok": false,
|
||||
"executables": []
|
||||
},
|
||||
{
|
||||
"id": "reject-backticks-double-quoted",
|
||||
"command": "echo \"output: `id`\"",
|
||||
"ok": false,
|
||||
"executables": []
|
||||
},
|
||||
{
|
||||
"id": "reject-process-substitution-unquoted-input",
|
||||
"command": "cat <(echo ok)",
|
||||
"ok": false,
|
||||
"executables": []
|
||||
},
|
||||
{
|
||||
"id": "reject-process-substitution-unquoted-output",
|
||||
"command": "echo >(cat)",
|
||||
"ok": false,
|
||||
"executables": []
|
||||
},
|
||||
{
|
||||
"id": "allow-process-substitution-literal-double-quoted-input",
|
||||
"command": "echo \"<(echo ok)\"",
|
||||
"ok": true,
|
||||
"executables": ["echo"]
|
||||
},
|
||||
{
|
||||
"id": "allow-process-substitution-literal-double-quoted-output",
|
||||
"command": "echo \">(cat)\"",
|
||||
"ok": true,
|
||||
"executables": ["echo"]
|
||||
}
|
||||
]
|
||||
}
|
||||
39
openclaw/test/fixtures/exec-wrapper-resolution-parity.json
vendored
Normal file
39
openclaw/test/fixtures/exec-wrapper-resolution-parity.json
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"cases": [
|
||||
{
|
||||
"id": "direct-absolute-executable",
|
||||
"argv": ["/usr/bin/printf", "ok"],
|
||||
"expectedRawExecutable": "/usr/bin/printf"
|
||||
},
|
||||
{
|
||||
"id": "env-assignment-prefix",
|
||||
"argv": ["/usr/bin/env", "FOO=bar", "/usr/bin/printf", "ok"],
|
||||
"expectedRawExecutable": "/usr/bin/env"
|
||||
},
|
||||
{
|
||||
"id": "env-option-with-separate-value",
|
||||
"argv": ["/usr/bin/env", "-u", "HOME", "/usr/bin/printf", "ok"],
|
||||
"expectedRawExecutable": "/usr/bin/env"
|
||||
},
|
||||
{
|
||||
"id": "env-option-with-inline-value",
|
||||
"argv": ["/usr/bin/env", "-uHOME", "/usr/bin/printf", "ok"],
|
||||
"expectedRawExecutable": "/usr/bin/env"
|
||||
},
|
||||
{
|
||||
"id": "nested-env-wrappers",
|
||||
"argv": ["/usr/bin/env", "/usr/bin/env", "FOO=bar", "printf", "ok"],
|
||||
"expectedRawExecutable": "/usr/bin/env"
|
||||
},
|
||||
{
|
||||
"id": "env-shell-wrapper-stops-at-shell",
|
||||
"argv": ["/usr/bin/env", "bash", "-lc", "echo ok"],
|
||||
"expectedRawExecutable": "bash"
|
||||
},
|
||||
{
|
||||
"id": "env-missing-effective-command",
|
||||
"argv": ["/usr/bin/env", "FOO=bar"],
|
||||
"expectedRawExecutable": "/usr/bin/env"
|
||||
}
|
||||
]
|
||||
}
|
||||
202
openclaw/test/fixtures/extension-relative-outside-package-inventory.json
vendored
Normal file
202
openclaw/test/fixtures/extension-relative-outside-package-inventory.json
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
[
|
||||
{
|
||||
"file": "extensions/bluebubbles/src/runtime-api.ts",
|
||||
"line": 1,
|
||||
"kind": "export",
|
||||
"specifier": "../../../src/plugin-sdk/bluebubbles.js",
|
||||
"resolvedPath": "src/plugin-sdk/bluebubbles.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/bluebubbles/src/targets.ts",
|
||||
"line": 8,
|
||||
"kind": "import",
|
||||
"specifier": "../../imessage/api.js",
|
||||
"resolvedPath": "extensions/imessage/api.js",
|
||||
"reason": "imports another extension via relative path outside the extension package"
|
||||
},
|
||||
{
|
||||
"file": "extensions/feishu/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/feishu.js",
|
||||
"resolvedPath": "src/plugin-sdk/feishu.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/googlechat/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/googlechat.js",
|
||||
"resolvedPath": "src/plugin-sdk/googlechat.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/imessage/runtime-api.ts",
|
||||
"line": 16,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/imessage.js",
|
||||
"resolvedPath": "src/plugin-sdk/imessage.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/irc/src/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../../src/plugin-sdk/irc.js",
|
||||
"resolvedPath": "src/plugin-sdk/irc.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/line/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/line.js",
|
||||
"resolvedPath": "src/plugin-sdk/line.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/line/runtime-api.ts",
|
||||
"line": 13,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/line-core.js",
|
||||
"resolvedPath": "src/plugin-sdk/line-core.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/matrix/runtime-api.ts",
|
||||
"line": 19,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/json-store.js",
|
||||
"resolvedPath": "src/plugin-sdk/json-store.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/matrix/runtime-api.ts",
|
||||
"line": 28,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/matrix.js",
|
||||
"resolvedPath": "src/plugin-sdk/matrix.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/matrix/runtime-api.ts",
|
||||
"line": 29,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/matrix.js",
|
||||
"resolvedPath": "src/plugin-sdk/matrix.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/matrix/src/runtime-api.ts",
|
||||
"line": 1,
|
||||
"kind": "export",
|
||||
"specifier": "../../../src/plugin-sdk/matrix.js",
|
||||
"resolvedPath": "src/plugin-sdk/matrix.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/mattermost/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/mattermost.js",
|
||||
"resolvedPath": "src/plugin-sdk/mattermost.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/msteams/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/msteams.js",
|
||||
"resolvedPath": "src/plugin-sdk/msteams.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/nextcloud-talk/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/nextcloud-talk.js",
|
||||
"resolvedPath": "src/plugin-sdk/nextcloud-talk.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/nostr/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/nostr.js",
|
||||
"resolvedPath": "src/plugin-sdk/nostr.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/telegram/runtime-api.ts",
|
||||
"line": 10,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/telegram.js",
|
||||
"resolvedPath": "src/plugin-sdk/telegram.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/telegram/runtime-api.ts",
|
||||
"line": 40,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/telegram.js",
|
||||
"resolvedPath": "src/plugin-sdk/telegram.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/tlon/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/tlon.js",
|
||||
"resolvedPath": "src/plugin-sdk/tlon.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/twitch/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/twitch.js",
|
||||
"resolvedPath": "src/plugin-sdk/twitch.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/voice-call/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/voice-call.js",
|
||||
"resolvedPath": "src/plugin-sdk/voice-call.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/whatsapp/src/runtime-api.ts",
|
||||
"line": 19,
|
||||
"kind": "export",
|
||||
"specifier": "../../../src/plugin-sdk/whatsapp-core.js",
|
||||
"resolvedPath": "src/plugin-sdk/whatsapp-core.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/whatsapp/src/runtime-api.ts",
|
||||
"line": 34,
|
||||
"kind": "export",
|
||||
"specifier": "../../../src/plugin-sdk/whatsapp-shared.js",
|
||||
"resolvedPath": "src/plugin-sdk/whatsapp-shared.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/zalo/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/zalo.js",
|
||||
"resolvedPath": "src/plugin-sdk/zalo.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
},
|
||||
{
|
||||
"file": "extensions/zalouser/runtime-api.ts",
|
||||
"line": 4,
|
||||
"kind": "export",
|
||||
"specifier": "../../src/plugin-sdk/zalouser.js",
|
||||
"resolvedPath": "src/plugin-sdk/zalouser.js",
|
||||
"reason": "re-exports plugin-sdk via relative path; use openclaw/plugin-sdk/<subpath>"
|
||||
}
|
||||
]
|
||||
BIN
openclaw/test/fixtures/hooks-install/npm-pack-hooks.tgz
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/npm-pack-hooks.tgz
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/hooks-install/tar-evil-id.tar
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/tar-evil-id.tar
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/hooks-install/tar-hooks.tar
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/tar-hooks.tar
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/hooks-install/tar-reserved-id.tar
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/tar-reserved-id.tar
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/hooks-install/tar-traversal.tar
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/tar-traversal.tar
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/hooks-install/zip-hooks.zip
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/zip-hooks.zip
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/hooks-install/zip-traversal.zip
vendored
Normal file
BIN
openclaw/test/fixtures/hooks-install/zip-traversal.zip
vendored
Normal file
Binary file not shown.
1
openclaw/test/fixtures/plugin-extension-import-boundary-inventory.json
vendored
Normal file
1
openclaw/test/fixtures/plugin-extension-import-boundary-inventory.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
BIN
openclaw/test/fixtures/plugins-install/voice-call-0.0.1.tgz
vendored
Normal file
BIN
openclaw/test/fixtures/plugins-install/voice-call-0.0.1.tgz
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/plugins-install/voice-call-0.0.2.tgz
vendored
Normal file
BIN
openclaw/test/fixtures/plugins-install/voice-call-0.0.2.tgz
vendored
Normal file
Binary file not shown.
BIN
openclaw/test/fixtures/plugins-install/zipper-0.0.1.zip
vendored
Normal file
BIN
openclaw/test/fixtures/plugins-install/zipper-0.0.1.zip
vendored
Normal file
Binary file not shown.
139
openclaw/test/fixtures/system-run-approval-binding-contract.json
vendored
Normal file
139
openclaw/test/fixtures/system-run-approval-binding-contract.json
vendored
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
{
|
||||
"cases": [
|
||||
{
|
||||
"name": "binding matches when env key order changes",
|
||||
"request": {
|
||||
"host": "node",
|
||||
"command": "git diff",
|
||||
"binding": {
|
||||
"argv": ["git", "diff"],
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "SAFE_A": "1", "SAFE_B": "2" }
|
||||
}
|
||||
},
|
||||
"invoke": {
|
||||
"argv": ["git", "diff"],
|
||||
"binding": {
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "SAFE_B": "2", "SAFE_A": "1" }
|
||||
}
|
||||
},
|
||||
"expected": { "ok": true }
|
||||
},
|
||||
{
|
||||
"name": "binding rejects env mismatch",
|
||||
"request": {
|
||||
"host": "node",
|
||||
"command": "git diff",
|
||||
"binding": {
|
||||
"argv": ["git", "diff"],
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "SAFE": "1" }
|
||||
}
|
||||
},
|
||||
"invoke": {
|
||||
"argv": ["git", "diff"],
|
||||
"binding": {
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "SAFE": "2" }
|
||||
}
|
||||
},
|
||||
"expected": { "ok": false, "code": "APPROVAL_ENV_MISMATCH" }
|
||||
},
|
||||
{
|
||||
"name": "binding rejects mismatched Windows-compatible env values",
|
||||
"request": {
|
||||
"host": "node",
|
||||
"command": "cmd.exe /c echo ok",
|
||||
"binding": {
|
||||
"argv": ["cmd.exe", "/c", "echo", "ok"],
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "ProgramFiles(x86)": "C:\\Program Files (x86)" }
|
||||
}
|
||||
},
|
||||
"invoke": {
|
||||
"argv": ["cmd.exe", "/c", "echo", "ok"],
|
||||
"binding": {
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "ProgramFiles(x86)": "D:\\malicious" }
|
||||
}
|
||||
},
|
||||
"expected": { "ok": false, "code": "APPROVAL_ENV_MISMATCH" }
|
||||
},
|
||||
{
|
||||
"name": "binding rejects unbound env overrides",
|
||||
"request": {
|
||||
"host": "node",
|
||||
"command": "git diff",
|
||||
"binding": {
|
||||
"argv": ["git", "diff"],
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null
|
||||
}
|
||||
},
|
||||
"invoke": {
|
||||
"argv": ["git", "diff"],
|
||||
"binding": {
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null,
|
||||
"env": { "GIT_EXTERNAL_DIFF": "/tmp/pwn.sh" }
|
||||
}
|
||||
},
|
||||
"expected": { "ok": false, "code": "APPROVAL_ENV_BINDING_MISSING" }
|
||||
},
|
||||
{
|
||||
"name": "missing binding rejects requests even with matching argv",
|
||||
"request": {
|
||||
"host": "node",
|
||||
"command": "echo SAFE",
|
||||
"commandArgv": ["echo", "SAFE"]
|
||||
},
|
||||
"invoke": {
|
||||
"argv": ["echo", "SAFE"],
|
||||
"binding": {
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null
|
||||
}
|
||||
},
|
||||
"expected": { "ok": false, "code": "APPROVAL_REQUEST_MISMATCH" }
|
||||
},
|
||||
{
|
||||
"name": "binding stays authoritative when legacy command text diverges",
|
||||
"request": {
|
||||
"host": "node",
|
||||
"command": "echo STALE",
|
||||
"commandArgv": ["echo", "STALE"],
|
||||
"binding": {
|
||||
"argv": ["echo", "SAFE"],
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null
|
||||
}
|
||||
},
|
||||
"invoke": {
|
||||
"argv": ["echo", "SAFE"],
|
||||
"binding": {
|
||||
"cwd": null,
|
||||
"agentId": null,
|
||||
"sessionKey": null
|
||||
}
|
||||
},
|
||||
"expected": { "ok": true }
|
||||
}
|
||||
]
|
||||
}
|
||||
67
openclaw/test/fixtures/system-run-approval-mismatch-contract.json
vendored
Normal file
67
openclaw/test/fixtures/system-run-approval-mismatch-contract.json
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
"cases": [
|
||||
{
|
||||
"name": "request mismatch preserves base details",
|
||||
"runId": "approval-req-1",
|
||||
"match": {
|
||||
"ok": false,
|
||||
"code": "APPROVAL_REQUEST_MISMATCH",
|
||||
"message": "approval id does not match request"
|
||||
},
|
||||
"expected": {
|
||||
"ok": false,
|
||||
"message": "approval id does not match request",
|
||||
"details": {
|
||||
"code": "APPROVAL_REQUEST_MISMATCH",
|
||||
"runId": "approval-req-1"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "missing env binding keeps env key details",
|
||||
"runId": "approval-env-missing",
|
||||
"match": {
|
||||
"ok": false,
|
||||
"code": "APPROVAL_ENV_BINDING_MISSING",
|
||||
"message": "approval id missing env binding for requested env overrides",
|
||||
"details": {
|
||||
"envKeys": ["GIT_EXTERNAL_DIFF"]
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"ok": false,
|
||||
"message": "approval id missing env binding for requested env overrides",
|
||||
"details": {
|
||||
"code": "APPROVAL_ENV_BINDING_MISSING",
|
||||
"runId": "approval-env-missing",
|
||||
"envKeys": ["GIT_EXTERNAL_DIFF"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "env mismatch preserves hash diagnostics",
|
||||
"runId": "approval-env-mismatch",
|
||||
"match": {
|
||||
"ok": false,
|
||||
"code": "APPROVAL_ENV_MISMATCH",
|
||||
"message": "approval id env binding mismatch",
|
||||
"details": {
|
||||
"envKeys": ["SAFE_A"],
|
||||
"expectedEnvHash": "expected-hash",
|
||||
"actualEnvHash": "actual-hash"
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"ok": false,
|
||||
"message": "approval id env binding mismatch",
|
||||
"details": {
|
||||
"code": "APPROVAL_ENV_MISMATCH",
|
||||
"runId": "approval-env-mismatch",
|
||||
"envKeys": ["SAFE_A"],
|
||||
"expectedEnvHash": "expected-hash",
|
||||
"actualEnvHash": "actual-hash"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
84
openclaw/test/fixtures/system-run-command-contract.json
vendored
Normal file
84
openclaw/test/fixtures/system-run-command-contract.json
vendored
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{
|
||||
"cases": [
|
||||
{
|
||||
"name": "direct argv infers display command",
|
||||
"command": ["echo", "hi there"],
|
||||
"expected": {
|
||||
"valid": true,
|
||||
"displayCommand": "echo \"hi there\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "direct argv rejects mismatched raw command",
|
||||
"command": ["uname", "-a"],
|
||||
"rawCommand": "echo hi",
|
||||
"expected": {
|
||||
"valid": false,
|
||||
"errorContains": "rawCommand does not match command"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "shell wrapper accepts shell payload raw command at ingress",
|
||||
"command": ["/bin/sh", "-lc", "echo hi"],
|
||||
"rawCommand": "echo hi",
|
||||
"expected": {
|
||||
"valid": true,
|
||||
"displayCommand": "/bin/sh -lc \"echo hi\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "shell wrapper positional argv carrier requires full argv display binding",
|
||||
"command": ["/bin/sh", "-lc", "$0 \"$1\"", "/usr/bin/touch", "/tmp/marker"],
|
||||
"rawCommand": "$0 \"$1\"",
|
||||
"expected": {
|
||||
"valid": false,
|
||||
"errorContains": "rawCommand does not match command"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "shell wrapper positional argv carrier accepts canonical full argv raw command",
|
||||
"command": ["/bin/sh", "-lc", "$0 \"$1\"", "/usr/bin/touch", "/tmp/marker"],
|
||||
"rawCommand": "/bin/sh -lc \"$0 \\\"$1\\\"\" /usr/bin/touch /tmp/marker",
|
||||
"expected": {
|
||||
"valid": true,
|
||||
"displayCommand": "/bin/sh -lc \"$0 \\\"$1\\\"\" /usr/bin/touch /tmp/marker"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "env wrapper shell payload accepted at ingress when prelude has no env modifiers",
|
||||
"command": ["/usr/bin/env", "bash", "-lc", "echo hi"],
|
||||
"rawCommand": "echo hi",
|
||||
"expected": {
|
||||
"valid": true,
|
||||
"displayCommand": "/usr/bin/env bash -lc \"echo hi\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "env wrapper accepts canonical full argv raw command",
|
||||
"command": ["/usr/bin/env", "bash", "-lc", "echo hi"],
|
||||
"rawCommand": "/usr/bin/env bash -lc \"echo hi\"",
|
||||
"expected": {
|
||||
"valid": true,
|
||||
"displayCommand": "/usr/bin/env bash -lc \"echo hi\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "env assignment prelude requires full argv display binding",
|
||||
"command": ["/usr/bin/env", "BASH_ENV=/tmp/payload.sh", "bash", "-lc", "echo hi"],
|
||||
"rawCommand": "echo hi",
|
||||
"expected": {
|
||||
"valid": false,
|
||||
"errorContains": "rawCommand does not match command"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "env assignment prelude accepts canonical full argv raw command",
|
||||
"command": ["/usr/bin/env", "BASH_ENV=/tmp/payload.sh", "bash", "-lc", "echo hi"],
|
||||
"rawCommand": "/usr/bin/env BASH_ENV=/tmp/payload.sh bash -lc \"echo hi\"",
|
||||
"expected": {
|
||||
"valid": true,
|
||||
"displayCommand": "/usr/bin/env BASH_ENV=/tmp/payload.sh bash -lc \"echo hi\""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
13
openclaw/test/fixtures/ts-topology/basic/extensions/alpha/src/use.ts
vendored
Normal file
13
openclaw/test/fixtures/ts-topology/basic/extensions/alpha/src/use.ts
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { aliasedThing as renamedThing, sharedThing, singleOwnerHelper } from "fixture-sdk";
|
||||
import type { SharedType } from "fixture-sdk";
|
||||
import * as extra from "fixture-sdk/extra";
|
||||
|
||||
export function alphaUse(input: SharedType) {
|
||||
return [
|
||||
sharedThing(),
|
||||
singleOwnerHelper(),
|
||||
renamedThing(),
|
||||
extra.sharedThing(),
|
||||
input.value,
|
||||
].join(":");
|
||||
}
|
||||
6
openclaw/test/fixtures/ts-topology/basic/extensions/beta/src/use.ts
vendored
Normal file
6
openclaw/test/fixtures/ts-topology/basic/extensions/beta/src/use.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { sharedThing } from "fixture-sdk";
|
||||
import type { SharedType } from "fixture-sdk";
|
||||
|
||||
export function betaUse(input: SharedType) {
|
||||
return `${sharedThing()}:${input.value}`;
|
||||
}
|
||||
5
openclaw/test/fixtures/ts-topology/basic/src/internal/use.ts
vendored
Normal file
5
openclaw/test/fixtures/ts-topology/basic/src/internal/use.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { sharedThing } from "fixture-sdk";
|
||||
|
||||
export function internalUse() {
|
||||
return sharedThing();
|
||||
}
|
||||
23
openclaw/test/fixtures/ts-topology/basic/src/lib/shared.ts
vendored
Normal file
23
openclaw/test/fixtures/ts-topology/basic/src/lib/shared.ts
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export function sharedThing() {
|
||||
return "shared";
|
||||
}
|
||||
|
||||
export function singleOwnerHelper() {
|
||||
return "single-owner";
|
||||
}
|
||||
|
||||
export function aliasedThing() {
|
||||
return "aliased";
|
||||
}
|
||||
|
||||
export function testOnlyThing() {
|
||||
return "test-only";
|
||||
}
|
||||
|
||||
export function unusedThing() {
|
||||
return "unused";
|
||||
}
|
||||
|
||||
export type SharedType = {
|
||||
value: string;
|
||||
};
|
||||
1
openclaw/test/fixtures/ts-topology/basic/src/public/extra.ts
vendored
Normal file
1
openclaw/test/fixtures/ts-topology/basic/src/public/extra.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { sharedThing } from "../lib/shared.js";
|
||||
9
openclaw/test/fixtures/ts-topology/basic/src/public/index.ts
vendored
Normal file
9
openclaw/test/fixtures/ts-topology/basic/src/public/index.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export {
|
||||
aliasedThing,
|
||||
sharedThing,
|
||||
singleOwnerHelper,
|
||||
testOnlyThing,
|
||||
unusedThing,
|
||||
} from "../lib/shared.js";
|
||||
export { sharedThing as aliasedSharedThing } from "../lib/shared.js";
|
||||
export type { SharedType } from "../lib/shared.js";
|
||||
5
openclaw/test/fixtures/ts-topology/basic/tests/public.test.ts
vendored
Normal file
5
openclaw/test/fixtures/ts-topology/basic/tests/public.test.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { testOnlyThing } from "fixture-sdk";
|
||||
|
||||
export function testUse() {
|
||||
return testOnlyThing();
|
||||
}
|
||||
14
openclaw/test/fixtures/ts-topology/basic/tsconfig.json
vendored
Normal file
14
openclaw/test/fixtures/ts-topology/basic/tsconfig.json
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"paths": {
|
||||
"fixture-sdk": ["./src/public/index.ts"],
|
||||
"fixture-sdk/*": ["./src/public/*"]
|
||||
},
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "extensions/**/*.ts", "packages/**/*.ts", "tests/**/*.ts"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue