@ludecker/aaac 1.1.6 → 1.2.0
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/package.json +9 -9
- package/src/cli.mjs +0 -0
- package/src/run-engine/debug-run.mjs +0 -0
- package/src/run-engine/log-dump.mjs +0 -0
- package/src/run-engine/log-trace.mjs +0 -0
- package/templates/cursor/aaac/enforcement.json +84 -3
- package/templates/cursor/aaac/graph.project.yaml +28 -0
- package/templates/cursor/aaac/lifecycle/lifecycle.json +14 -0
- package/templates/cursor/aaac/lifecycle/phases.json +7 -1
- package/templates/cursor/aaac/ontology.json +1 -0
- package/templates/cursor/aaac/project.config.json +36 -0
- package/templates/cursor/aaac/scripts/remediation/auto-check-swarm-synthesis.mjs +75 -0
- package/templates/cursor/aaac/scripts/remediation/auto-dispatch-queue-from-health.mjs +78 -0
- package/templates/cursor/aaac/scripts/remediation/bootstrap-autonomous.mjs +113 -0
- package/templates/cursor/aaac/scripts/remediation/capture-verify-baseline.mjs +66 -0
- package/templates/cursor/aaac/scripts/remediation/capture-wave-snapshot.mjs +79 -0
- package/templates/cursor/aaac/scripts/remediation/check-swarm-raw.template.json +26 -0
- package/templates/cursor/aaac/scripts/remediation/classify-fallow-issues.mjs +77 -0
- package/templates/cursor/aaac/scripts/remediation/classify-verify-failure.mjs +176 -0
- package/templates/cursor/aaac/scripts/remediation/compute-satisfaction.mjs +344 -0
- package/templates/cursor/aaac/scripts/remediation/debt-sweep-gate.mjs +202 -0
- package/templates/cursor/aaac/scripts/remediation/dispatch-rules.json +44 -0
- package/templates/cursor/aaac/scripts/remediation/fallow-fp-rules.json +87 -0
- package/templates/cursor/aaac/scripts/remediation/fallow-scan.mjs +219 -0
- package/templates/cursor/aaac/scripts/remediation/handle-yield.mjs +240 -0
- package/templates/cursor/aaac/scripts/remediation/init-campaign.mjs +211 -0
- package/templates/cursor/aaac/scripts/remediation/lib/autonomous-mode.mjs +63 -0
- package/templates/cursor/aaac/scripts/remediation/lib/campaign-focus.mjs +87 -0
- package/templates/cursor/aaac/scripts/remediation/lib/fallow-classifier.mjs +190 -0
- package/templates/cursor/aaac/scripts/remediation/lib/fallow-health-targets.mjs +56 -0
- package/templates/cursor/aaac/scripts/remediation/lib/fallow-metrics.mjs +119 -0
- package/templates/cursor/aaac/scripts/remediation/lib/invoke-cursor-agent.mjs +51 -0
- package/templates/cursor/aaac/scripts/remediation/lib/reconcile-run-manifest.mjs +41 -0
- package/templates/cursor/aaac/scripts/remediation/lib/regression-analysis.mjs +55 -0
- package/templates/cursor/aaac/scripts/remediation/lib/remediation-config.mjs +69 -0
- package/templates/cursor/aaac/scripts/remediation/lib/remediation-progress.mjs +58 -0
- package/templates/cursor/aaac/scripts/remediation/lib/remediation-watch-loop.mjs +168 -0
- package/templates/cursor/aaac/scripts/remediation/lib/runner-exec.mjs +156 -0
- package/templates/cursor/aaac/scripts/remediation/lib/runner-state.mjs +145 -0
- package/templates/cursor/aaac/scripts/remediation/lib/verify-metrics.mjs +205 -0
- package/templates/cursor/aaac/scripts/remediation/merge-check-swarm.mjs +257 -0
- package/templates/cursor/aaac/scripts/remediation/plan-waves-from-queue.mjs +85 -0
- package/templates/cursor/aaac/scripts/remediation/prepare-check-context.mjs +148 -0
- package/templates/cursor/aaac/scripts/remediation/record-fallow-fp.mjs +107 -0
- package/templates/cursor/aaac/scripts/remediation/record-iteration-step.mjs +56 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-cli.mjs +157 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-cursor-watch.sh +10 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-runner-daemon.sh +13 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-runner.mjs +748 -0
- package/templates/cursor/aaac/scripts/remediation/remediation-yield-watcher.mjs +40 -0
- package/templates/cursor/aaac/scripts/remediation/remediator-gate.mjs +405 -0
- package/templates/cursor/aaac/scripts/remediation/repair-fallow-start-baseline.mjs +118 -0
- package/templates/cursor/aaac/scripts/remediation/runner-health-check.mjs +164 -0
- package/templates/cursor/aaac/scripts/remediation/satisfaction-loop-gate.mjs +286 -0
- package/templates/cursor/aaac/scripts/remediation/validate-campaign-complete.mjs +191 -0
- package/templates/cursor/aaac/scripts/remediation/verify-remediation-iteration.mjs +112 -0
- package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +0 -0
- package/templates/cursor/aaac/scripts/run-engine/log-dump.mjs +0 -0
- package/templates/cursor/aaac/scripts/run-engine/log-trace.mjs +0 -0
- package/templates/cursor/agents/remediation-check-app-inventory.md +32 -0
- package/templates/cursor/agents/remediation-check-app-ssot.md +24 -0
- package/templates/cursor/agents/remediation-check-app-trace.md +29 -0
- package/templates/cursor/agents/remediation-check-architecture-boundaries.md +21 -0
- package/templates/cursor/agents/remediation-check-architecture-decomposition.md +25 -0
- package/templates/cursor/agents/remediation-check-architecture-deps.md +23 -0
- package/templates/cursor/agents/remediation-check-risk.md +37 -0
- package/templates/cursor/agents/remediation-e2e-gate.md +30 -0
- package/templates/cursor/agents/remediation-remediator.md +69 -0
- package/templates/cursor/commands/remediate-app.md +212 -0
- package/templates/cursor/hooks/aaac-before-submit.sh +0 -0
- package/templates/cursor/hooks/aaac-pre-tool.sh +0 -0
- package/templates/cursor/hooks/aaac-stop.sh +0 -0
- package/templates/cursor/hooks/aaac-subagent-start.sh +0 -0
- package/templates/cursor/skills/shared/remediation/SKILL.md +51 -0
- package/templates/cursor/skills/shared/remediation/babysit/SKILL.md +223 -0
- package/templates/cursor/skills/shared/remediation/check-swarm/SKILL.md +114 -0
- package/templates/cursor/skills/shared/remediation/orchestrator/SKILL.md +275 -0
- package/templates/cursor/skills/shared/remediation/orchestrator/contract.yaml +116 -0
- package/templates/docs/agentic_architecture.md +1 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Record swarm/check-risk false-positive or protected findings into campaign SSOT.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node record-fallow-fp.mjs --campaign-id <id> --path <file> \
|
|
7
|
+
* --classification false_positive|review|true_positive \
|
|
8
|
+
* [--export <name>] [--reason <text>] [--source check-risk] [--iteration <n>]
|
|
9
|
+
*
|
|
10
|
+
* Batch:
|
|
11
|
+
* node record-fallow-fp.mjs --campaign-id <id> --from-json <entries.json>
|
|
12
|
+
*/
|
|
13
|
+
import fs from "fs";
|
|
14
|
+
import path from "path";
|
|
15
|
+
import { REPO_ROOT, isoNow, readJson, writeJson } from "../run-engine/lib.mjs";
|
|
16
|
+
|
|
17
|
+
const CAMPAIGNS_ROOT = path.join(REPO_ROOT, ".cursor/aaac/state/campaigns");
|
|
18
|
+
|
|
19
|
+
function parseArgs(argv) {
|
|
20
|
+
const out = {
|
|
21
|
+
campaignId: null,
|
|
22
|
+
filePath: null,
|
|
23
|
+
exportName: null,
|
|
24
|
+
classification: null,
|
|
25
|
+
reason: "",
|
|
26
|
+
source: "check-risk",
|
|
27
|
+
iteration: null,
|
|
28
|
+
fromJson: null,
|
|
29
|
+
};
|
|
30
|
+
for (let i = 0; i < argv.length; i++) {
|
|
31
|
+
const a = argv[i];
|
|
32
|
+
if (a === "--campaign-id") out.campaignId = argv[++i];
|
|
33
|
+
else if (a === "--path") out.filePath = argv[++i];
|
|
34
|
+
else if (a === "--export") out.exportName = argv[++i];
|
|
35
|
+
else if (a === "--classification") out.classification = argv[++i];
|
|
36
|
+
else if (a === "--reason") out.reason = argv[++i];
|
|
37
|
+
else if (a === "--source") out.source = argv[++i];
|
|
38
|
+
else if (a === "--iteration") out.iteration = Number(argv[++i]);
|
|
39
|
+
else if (a === "--from-json") out.fromJson = argv[++i];
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function normalizePath(p) {
|
|
45
|
+
return p.replace(/^frontend\//, "").replace(/^\//, "");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function entryId(filePath, exportName) {
|
|
49
|
+
const p = normalizePath(filePath);
|
|
50
|
+
return exportName ? `path:${p}:export:${exportName}` : `path:${p}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const args = parseArgs(process.argv.slice(2));
|
|
54
|
+
if (!args.campaignId) {
|
|
55
|
+
console.error("record-fallow-fp: --campaign-id required");
|
|
56
|
+
process.exit(2);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const campaignDir = path.join(CAMPAIGNS_ROOT, args.campaignId);
|
|
60
|
+
const registryPath = path.join(campaignDir, "fallow-false-positives.json");
|
|
61
|
+
const registry = readJson(registryPath, { version: 1, entries: [] });
|
|
62
|
+
|
|
63
|
+
let newEntries = [];
|
|
64
|
+
if (args.fromJson) {
|
|
65
|
+
const batch = readJson(args.fromJson, { entries: [] });
|
|
66
|
+
newEntries = batch.entries ?? batch;
|
|
67
|
+
} else if (args.filePath && args.classification) {
|
|
68
|
+
newEntries = [
|
|
69
|
+
{
|
|
70
|
+
path: normalizePath(args.filePath),
|
|
71
|
+
export_name: args.exportName ?? null,
|
|
72
|
+
classification: args.classification,
|
|
73
|
+
reason: args.reason || args.source,
|
|
74
|
+
source: args.source,
|
|
75
|
+
iteration: args.iteration,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
} else {
|
|
79
|
+
console.error("record-fallow-fp: --path + --classification or --from-json required");
|
|
80
|
+
process.exit(2);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
for (const e of newEntries) {
|
|
84
|
+
const id = e.id ?? entryId(e.path, e.export_name);
|
|
85
|
+
const record = {
|
|
86
|
+
id,
|
|
87
|
+
path: normalizePath(e.path),
|
|
88
|
+
export_name: e.export_name ?? null,
|
|
89
|
+
classification: e.classification ?? "false_positive",
|
|
90
|
+
reason: e.reason ?? "manual",
|
|
91
|
+
source: e.source ?? args.source,
|
|
92
|
+
iteration: e.iteration ?? args.iteration,
|
|
93
|
+
recorded_at: isoNow(),
|
|
94
|
+
};
|
|
95
|
+
registry.entries = (registry.entries ?? []).filter((x) => x.id !== id);
|
|
96
|
+
registry.entries.push(record);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
registry.updated_at = isoNow();
|
|
100
|
+
writeJson(registryPath, registry);
|
|
101
|
+
|
|
102
|
+
fs.appendFileSync(
|
|
103
|
+
path.join(campaignDir, "journal.md"),
|
|
104
|
+
`\n- **Fallow FP registry** +${newEntries.length} entries (total ${registry.entries.length})\n`,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
console.log(JSON.stringify({ ok: true, added: newEntries.length, total: registry.entries.length }));
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Append a structured step record to campaign journal and optionally advance iteration.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node record-iteration-step.mjs --campaign-id <id> --step <name> --detail "<text>" [--status pass|fail]
|
|
7
|
+
*/
|
|
8
|
+
import fs from "fs";
|
|
9
|
+
import path from "path";
|
|
10
|
+
import { REPO_ROOT, isoNow, readJson, writeJson } from "../run-engine/lib.mjs";
|
|
11
|
+
|
|
12
|
+
const CAMPAIGNS_ROOT = path.join(REPO_ROOT, ".cursor/aaac/state/campaigns");
|
|
13
|
+
|
|
14
|
+
function parseArgs(argv) {
|
|
15
|
+
const out = { campaignId: null, step: "step", detail: "", status: "info", iteration: null };
|
|
16
|
+
for (let i = 0; i < argv.length; i++) {
|
|
17
|
+
const a = argv[i];
|
|
18
|
+
if (a === "--campaign-id") out.campaignId = argv[++i];
|
|
19
|
+
else if (a === "--step") out.step = argv[++i];
|
|
20
|
+
else if (a === "--detail") out.detail = argv[++i];
|
|
21
|
+
else if (a === "--status") out.status = argv[++i];
|
|
22
|
+
else if (a === "--iteration") out.iteration = Number(argv[++i]);
|
|
23
|
+
}
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const args = parseArgs(process.argv.slice(2));
|
|
28
|
+
if (!args.campaignId) {
|
|
29
|
+
console.error("record-iteration-step: --campaign-id required");
|
|
30
|
+
process.exit(2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const dir = path.join(CAMPAIGNS_ROOT, args.campaignId);
|
|
34
|
+
const stepsPath = path.join(dir, "steps.jsonl");
|
|
35
|
+
const line = JSON.stringify({
|
|
36
|
+
at: isoNow(),
|
|
37
|
+
step: args.step,
|
|
38
|
+
status: args.status,
|
|
39
|
+
detail: args.detail,
|
|
40
|
+
iteration: args.iteration,
|
|
41
|
+
});
|
|
42
|
+
fs.appendFileSync(stepsPath, `${line}\n`);
|
|
43
|
+
|
|
44
|
+
const journal = `\n- \`${args.step}\` (${args.status}) — ${args.detail}\n`;
|
|
45
|
+
fs.appendFileSync(path.join(dir, "journal.md"), journal);
|
|
46
|
+
|
|
47
|
+
if (args.iteration !== null) {
|
|
48
|
+
const campaign = readJson(path.join(dir, "campaign.json"));
|
|
49
|
+
if (campaign) {
|
|
50
|
+
campaign.iteration = args.iteration;
|
|
51
|
+
campaign.updated_at = isoNow();
|
|
52
|
+
writeJson(path.join(dir, "campaign.json"), campaign);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
console.log(JSON.stringify({ ok: true }));
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Remediation CLI — foreground watch with readable progress for Cursor terminal.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node remediation-cli.mjs watch --run-id <id> --campaign-id <id>
|
|
7
|
+
* node remediation-cli.mjs status --campaign-id <id> [--run-id <id>]
|
|
8
|
+
* node remediation-cli.mjs cursor --run-id <id> --campaign-id <id>
|
|
9
|
+
*/
|
|
10
|
+
import { spawnSync } from "child_process";
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
import path from "path";
|
|
13
|
+
import { REPO_ROOT, readJson } from "../run-engine/lib.mjs";
|
|
14
|
+
import { campaignDir } from "./lib/runner-state.mjs";
|
|
15
|
+
import {
|
|
16
|
+
buildProgressSnapshot,
|
|
17
|
+
formatProgressLine,
|
|
18
|
+
writeProgressArtifact,
|
|
19
|
+
} from "./lib/remediation-progress.mjs";
|
|
20
|
+
import { runRemediationWatchLoop } from "./lib/remediation-watch-loop.mjs";
|
|
21
|
+
import { resolveCursorBin } from "./lib/invoke-cursor-agent.mjs";
|
|
22
|
+
|
|
23
|
+
function parseArgs(argv) {
|
|
24
|
+
const out = {
|
|
25
|
+
command: argv[0] ?? "help",
|
|
26
|
+
runId: null,
|
|
27
|
+
campaignId: null,
|
|
28
|
+
pollMs: 5000,
|
|
29
|
+
maxRetries: 5,
|
|
30
|
+
};
|
|
31
|
+
const rest = argv[0]?.startsWith("-") ? argv : argv.slice(1);
|
|
32
|
+
if (!argv[0]?.startsWith("-")) {
|
|
33
|
+
out.command = argv[0] ?? "help";
|
|
34
|
+
}
|
|
35
|
+
for (let i = 0; i < argv.length; i++) {
|
|
36
|
+
const a = argv[i];
|
|
37
|
+
if (a === "watch" || a === "status" || a === "cursor" || a === "help") out.command = a;
|
|
38
|
+
else if (a === "--run-id") out.runId = argv[++i];
|
|
39
|
+
else if (a === "--campaign-id") out.campaignId = argv[++i];
|
|
40
|
+
else if (a === "--poll-ms") out.pollMs = Number(argv[++i]);
|
|
41
|
+
else if (a === "--max-retries") out.maxRetries = Number(argv[++i]);
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function printBanner(args) {
|
|
47
|
+
console.log("");
|
|
48
|
+
console.log("═══════════════════════════════════════════════════════════");
|
|
49
|
+
console.log(" Remediation watch — health focus until satisfaction goal");
|
|
50
|
+
console.log(` campaign: ${args.campaignId}`);
|
|
51
|
+
console.log(` run: ${args.runId}`);
|
|
52
|
+
console.log(` progress: .cursor/aaac/state/campaigns/${args.campaignId}/progress.json`);
|
|
53
|
+
console.log(" Ctrl+C to stop (campaign state is persisted; resume with watch)");
|
|
54
|
+
console.log("═══════════════════════════════════════════════════════════");
|
|
55
|
+
console.log("");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function cmdStatus(args) {
|
|
59
|
+
if (!args.campaignId) {
|
|
60
|
+
console.error("status requires --campaign-id");
|
|
61
|
+
process.exit(2);
|
|
62
|
+
}
|
|
63
|
+
const snap = buildProgressSnapshot(args.campaignId, args.runId ?? "—");
|
|
64
|
+
writeProgressArtifact(args.campaignId, snap);
|
|
65
|
+
console.log(formatProgressLine(snap));
|
|
66
|
+
console.log(JSON.stringify(snap, null, 2));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function cmdWatch(args) {
|
|
70
|
+
if (!args.runId || !args.campaignId) {
|
|
71
|
+
console.error("watch requires --run-id and --campaign-id");
|
|
72
|
+
process.exit(2);
|
|
73
|
+
}
|
|
74
|
+
printBanner(args);
|
|
75
|
+
const code = await runRemediationWatchLoop({
|
|
76
|
+
...args,
|
|
77
|
+
reporter: {
|
|
78
|
+
onProgress: (snap, event) => {
|
|
79
|
+
console.log(formatProgressLine(snap, event));
|
|
80
|
+
},
|
|
81
|
+
onEvent: (event, detail) => {
|
|
82
|
+
if (event === "handle_failed" || event === "blocked" || event === "runner_error") {
|
|
83
|
+
console.log(` ⚠ ${event}: ${(detail.stderr ?? detail.message ?? JSON.stringify(detail)).slice(0, 200)}`);
|
|
84
|
+
}
|
|
85
|
+
if (event === "goal_achieved" || event === "runner_complete") {
|
|
86
|
+
console.log("");
|
|
87
|
+
console.log("✓ Remediation campaign complete.");
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
process.exit(code);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function cmdCursor(args) {
|
|
96
|
+
if (!args.runId || !args.campaignId) {
|
|
97
|
+
console.error("cursor requires --run-id and --campaign-id");
|
|
98
|
+
process.exit(2);
|
|
99
|
+
}
|
|
100
|
+
const bin = resolveCursorBin();
|
|
101
|
+
if (!bin) {
|
|
102
|
+
console.error("cursor CLI not found");
|
|
103
|
+
process.exit(127);
|
|
104
|
+
}
|
|
105
|
+
const cliPath = path.join(REPO_ROOT, ".cursor/aaac/scripts/remediation/remediation-cli.mjs");
|
|
106
|
+
const watchCmd = `node ${cliPath} watch --run-id ${args.runId} --campaign-id ${args.campaignId}`;
|
|
107
|
+
const prompt = [
|
|
108
|
+
"You are driving an autonomous remediation campaign until satisfaction threshold is met.",
|
|
109
|
+
"Run this command in the FOREGROUND with live stdout (never background it):",
|
|
110
|
+
watchCmd,
|
|
111
|
+
"Summarize each [remediate] progress line. If the command exits non-zero, diagnose from progress.json and retry watch once.",
|
|
112
|
+
"Do not stop until watch exits 0 (goal achieved) or reports blocked.",
|
|
113
|
+
].join("\n");
|
|
114
|
+
|
|
115
|
+
console.log("Launching Cursor agent with foreground remediation watch…");
|
|
116
|
+
console.log(`Command: ${watchCmd}`);
|
|
117
|
+
console.log("");
|
|
118
|
+
|
|
119
|
+
const result = spawnSync(bin, ["agent", "-p", "-f", "--approve-mcps", "--output-format", "text", prompt], {
|
|
120
|
+
cwd: REPO_ROOT,
|
|
121
|
+
encoding: "utf8",
|
|
122
|
+
stdio: "inherit",
|
|
123
|
+
});
|
|
124
|
+
process.exit(result.status ?? 1);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function cmdHelp() {
|
|
128
|
+
console.log(`Usage:
|
|
129
|
+
node remediation-cli.mjs watch --run-id <id> --campaign-id <id>
|
|
130
|
+
node remediation-cli.mjs status --campaign-id <id> [--run-id <id>]
|
|
131
|
+
node remediation-cli.mjs cursor --run-id <id> --campaign-id <id>
|
|
132
|
+
|
|
133
|
+
Recommended (Cursor integrated terminal — readable live progress):
|
|
134
|
+
node .cursor/aaac/scripts/remediation/remediation-cli.mjs watch \
|
|
135
|
+
--run-id run_20260618_remediate-app-frontend-9431df20 \
|
|
136
|
+
--campaign-id campaign_20260618_remediate-app-health
|
|
137
|
+
|
|
138
|
+
Or via Cursor agent CLI (agent session monitors the watch command):
|
|
139
|
+
node .cursor/aaac/scripts/remediation/remediation-cli.mjs cursor \
|
|
140
|
+
--run-id <run_id> --campaign-id <campaign_id>
|
|
141
|
+
`);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const args = parseArgs(process.argv.slice(2));
|
|
145
|
+
switch (args.command) {
|
|
146
|
+
case "watch":
|
|
147
|
+
cmdWatch(args);
|
|
148
|
+
break;
|
|
149
|
+
case "status":
|
|
150
|
+
cmdStatus(args);
|
|
151
|
+
break;
|
|
152
|
+
case "cursor":
|
|
153
|
+
cmdCursor(args);
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
cmdHelp();
|
|
157
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Launch remediation watch via Cursor CLI (foreground, monitorable).
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
ROOT="$(cd "$(dirname "$0")/../../../.." && pwd)"
|
|
5
|
+
cd "$ROOT"
|
|
6
|
+
RUN_ID="${1:?run_id required}"
|
|
7
|
+
CAMPAIGN_ID="${2:?campaign_id required}"
|
|
8
|
+
exec node .cursor/aaac/scripts/remediation/remediation-cli.mjs cursor \
|
|
9
|
+
--run-id "$RUN_ID" \
|
|
10
|
+
--campaign-id "$CAMPAIGN_ID"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Deprecated for interactive use — prefer remediation-cli.mjs watch in Cursor terminal.
|
|
3
|
+
# This wrapper still runs the machine sentinel watcher for headless CI.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
ROOT="$(cd "$(dirname "$0")/../../../.." && pwd)"
|
|
6
|
+
cd "$ROOT"
|
|
7
|
+
RUN_ID="${1:?run_id required}"
|
|
8
|
+
CAMPAIGN_ID="${2:?campaign_id required}"
|
|
9
|
+
echo "Tip: for readable progress in Cursor, run:" >&2
|
|
10
|
+
echo " node .cursor/aaac/scripts/remediation/remediation-cli.mjs watch --run-id $RUN_ID --campaign-id $CAMPAIGN_ID" >&2
|
|
11
|
+
exec node .cursor/aaac/scripts/remediation/remediation-cli.mjs watch \
|
|
12
|
+
--run-id "$RUN_ID" \
|
|
13
|
+
--campaign-id "$CAMPAIGN_ID"
|