agentlock-harness 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +211 -2
- package/README.zh-CN.md +211 -0
- package/RELEASE_NOTES.md +35 -0
- package/bin/agentlock-harness.mjs +249 -0
- package/harness-templates/en-US/common/CLAUDE.md.tmpl +7 -0
- package/harness-templates/en-US/common/GEMINI.md.tmpl +7 -0
- package/harness-templates/en-US/common/agentlock-harness.json.tmpl +45 -0
- package/harness-templates/en-US/common/claude-settings.json +36 -0
- package/harness-templates/en-US/common/codex-config.toml.tmpl +11 -0
- package/harness-templates/en-US/common/copilot-instructions.md.tmpl +3 -0
- package/harness-templates/en-US/common/gemini-settings.json +42 -0
- package/harness-templates/en-US/common/git-hooks/pre-commit +24 -0
- package/harness-templates/en-US/common/git-hooks/pre-push +11 -0
- package/harness-templates/en-US/common/harness-gitignore +3 -0
- package/harness-templates/en-US/common/hooks/post-edit-check.mjs +57 -0
- package/harness-templates/en-US/common/hooks/pre-tool-guard.mjs +122 -0
- package/harness-templates/en-US/common/hooks/rules-drift-check.mjs +69 -0
- package/harness-templates/en-US/common/hooks/staged-guard.mjs +197 -0
- package/harness-templates/en-US/common/hooks/stop-gate.mjs +164 -0
- package/harness-templates/en-US/common/rules/00-testing-integrity.md +11 -0
- package/harness-templates/en-US/common/rules/01-security-boundaries.md +11 -0
- package/harness-templates/en-US/common/skills/atomic-tdd/SKILL.md +21 -0
- package/harness-templates/en-US/common/skills/brainstorming/SKILL.md +24 -0
- package/harness-templates/en-US/common/skills/code-grounding/SKILL.md +20 -0
- package/harness-templates/en-US/common/skills/cross-model-review/SKILL.md +22 -0
- package/harness-templates/en-US/common/skills/worktree-isolation/SKILL.md +19 -0
- package/harness-templates/en-US/dual-core/HARNESS_GUIDE.md +19 -0
- package/harness-templates/en-US/dual-core/scripts/cross-review.mjs +141 -0
- package/harness-templates/en-US/enterprise-platform/ci/agentlock-harness-gate.yml +32 -0
- package/harness-templates/en-US/enterprise-platform/governance/mcp-gateway.template.json +18 -0
- package/harness-templates/en-US/enterprise-platform/governance/policy.json +26 -0
- package/harness-templates/en-US/ralph-factory/PROMPT.loop.md.tmpl +12 -0
- package/harness-templates/en-US/ralph-factory/SPRINT_CONTRACT.md.tmpl +25 -0
- package/harness-templates/en-US/ralph-factory/sandbox/Dockerfile.sandbox +13 -0
- package/harness-templates/en-US/ralph-factory/sandbox/docker-compose.sandbox.yml +22 -0
- package/harness-templates/en-US/ralph-factory/sandbox/run-sandbox-loop.sh +8 -0
- package/harness-templates/zh-CN/common/CLAUDE.md.tmpl +7 -0
- package/harness-templates/zh-CN/common/GEMINI.md.tmpl +7 -0
- package/harness-templates/zh-CN/common/agentlock-harness.json.tmpl +45 -0
- package/harness-templates/zh-CN/common/claude-settings.json +36 -0
- package/harness-templates/zh-CN/common/codex-config.toml.tmpl +11 -0
- package/harness-templates/zh-CN/common/copilot-instructions.md.tmpl +3 -0
- package/harness-templates/zh-CN/common/gemini-settings.json +42 -0
- package/harness-templates/zh-CN/common/git-hooks/pre-commit +24 -0
- package/harness-templates/zh-CN/common/git-hooks/pre-push +11 -0
- package/harness-templates/zh-CN/common/harness-gitignore +3 -0
- package/harness-templates/zh-CN/common/hooks/post-edit-check.mjs +57 -0
- package/harness-templates/zh-CN/common/hooks/pre-tool-guard.mjs +122 -0
- package/harness-templates/zh-CN/common/hooks/rules-drift-check.mjs +69 -0
- package/harness-templates/zh-CN/common/hooks/staged-guard.mjs +197 -0
- package/harness-templates/zh-CN/common/hooks/stop-gate.mjs +164 -0
- package/harness-templates/zh-CN/common/rules/00-testing-integrity.md +11 -0
- package/harness-templates/zh-CN/common/rules/01-security-boundaries.md +11 -0
- package/harness-templates/zh-CN/common/skills/atomic-tdd/SKILL.md +21 -0
- package/harness-templates/zh-CN/common/skills/brainstorming/SKILL.md +24 -0
- package/harness-templates/zh-CN/common/skills/code-grounding/SKILL.md +20 -0
- package/harness-templates/zh-CN/common/skills/cross-model-review/SKILL.md +22 -0
- package/harness-templates/zh-CN/common/skills/worktree-isolation/SKILL.md +19 -0
- package/harness-templates/zh-CN/dual-core/HARNESS_GUIDE.md +19 -0
- package/harness-templates/zh-CN/dual-core/scripts/cross-review.mjs +141 -0
- package/harness-templates/zh-CN/enterprise-platform/ci/agentlock-harness-gate.yml +32 -0
- package/harness-templates/zh-CN/enterprise-platform/governance/mcp-gateway.template.json +18 -0
- package/harness-templates/zh-CN/enterprise-platform/governance/policy.json +26 -0
- package/harness-templates/zh-CN/ralph-factory/PROMPT.loop.md.tmpl +12 -0
- package/harness-templates/zh-CN/ralph-factory/SPRINT_CONTRACT.md.tmpl +25 -0
- package/harness-templates/zh-CN/ralph-factory/sandbox/Dockerfile.sandbox +13 -0
- package/harness-templates/zh-CN/ralph-factory/sandbox/docker-compose.sandbox.yml +22 -0
- package/harness-templates/zh-CN/ralph-factory/sandbox/run-sandbox-loop.sh +8 -0
- package/package.json +64 -4
- package/scripts/bootstrap.ps1 +13 -0
- package/scripts/bootstrap.sh +23 -0
- package/src/cli/colors.mjs +42 -0
- package/src/cli/commands/adopt.mjs +378 -0
- package/src/cli/commands/change.mjs +92 -0
- package/src/cli/commands/doctor.mjs +56 -0
- package/src/cli/commands/eval.mjs +193 -0
- package/src/cli/commands/hooks.mjs +97 -0
- package/src/cli/commands/init.mjs +231 -0
- package/src/cli/commands/passthrough.mjs +27 -0
- package/src/cli/commands/ralph.mjs +208 -0
- package/src/cli/commands/rules.mjs +73 -0
- package/src/cli/commands/stats.mjs +71 -0
- package/src/cli/commands/task.mjs +123 -0
- package/src/cli/commands/ui.mjs +84 -0
- package/src/cli/commands/verify.mjs +267 -0
- package/src/cli/prompt.mjs +55 -0
- package/src/core/adopt.mjs +807 -0
- package/src/core/agent-runner.mjs +118 -0
- package/src/core/audit.mjs +181 -0
- package/src/core/catalog.mjs +160 -0
- package/src/core/change-flow.mjs +344 -0
- package/src/core/detector.mjs +141 -0
- package/src/core/doc-drift.mjs +94 -0
- package/src/core/eval-fixtures.mjs +676 -0
- package/src/core/eval-frontier-fixtures.mjs +657 -0
- package/src/core/eval-hard-fixtures.mjs +923 -0
- package/src/core/eval-runner.mjs +754 -0
- package/src/core/eval-telemetry.mjs +338 -0
- package/src/core/harness-writer.mjs +286 -0
- package/src/core/installer.mjs +42 -0
- package/src/core/rules-compiler.mjs +356 -0
- package/src/core/task-ledger.mjs +327 -0
- package/src/core/version.mjs +10 -0
- package/src/ui/public/app.mjs +2199 -0
- package/src/ui/public/index.html +203 -0
- package/src/ui/public/styles.css +1200 -0
- package/src/ui/server.mjs +457 -0
- package/src/ui/service.mjs +860 -0
- package/templates/en-US/AGENTS.md +38 -0
- package/templates/en-US/DOCS_MAINTENANCE.md +65 -0
- package/templates/en-US/MIGRATION.md +46 -0
- package/templates/en-US/NEW_PROJECT_CHECKLIST.md +46 -0
- package/templates/en-US/README.md +41 -0
- package/templates/en-US/SESSION.md +29 -0
- package/templates/en-US/docs/00-context.md +38 -0
- package/templates/en-US/docs/01-vision/README.md +36 -0
- package/templates/en-US/docs/02-requirements/PRD.md +24 -0
- package/templates/en-US/docs/02-requirements/glossary.md +20 -0
- package/templates/en-US/docs/02-requirements/use-cases.md +36 -0
- package/templates/en-US/docs/03-architecture/composite-ai-framework.md +36 -0
- package/templates/en-US/docs/03-architecture/integration-architecture.md +36 -0
- package/templates/en-US/docs/03-architecture/system-architecture.md +16 -0
- package/templates/en-US/docs/04-design/README.md +21 -0
- package/templates/en-US/docs/04-design/a2a-integration-spec.md +36 -0
- package/templates/en-US/docs/04-design/agent-specs.md +36 -0
- package/templates/en-US/docs/04-design/data-model.md +18 -0
- package/templates/en-US/docs/04-design/external-api-spec.md +26 -0
- package/templates/en-US/docs/04-design/mcp-interface-spec.md +36 -0
- package/templates/en-US/docs/04-design/phase1-minimal-implementation-interfaces.md +36 -0
- package/templates/en-US/docs/04-design/responsibility-model.md +36 -0
- package/templates/en-US/docs/04-design/runtime-control-plane-spec.md +36 -0
- package/templates/en-US/docs/04-design/safety-governance.md +18 -0
- package/templates/en-US/docs/04-design/sample-scenarios-architecture-refinement.md +20 -0
- package/templates/en-US/docs/04-design/skill-syntax-spec.md +36 -0
- package/templates/en-US/docs/04-design/storage-schema.md +18 -0
- package/templates/en-US/docs/04-design/task-capability-architecture-and-evolution.md +36 -0
- package/templates/en-US/docs/05-project/adr/ADR-000-template.md +32 -0
- package/templates/en-US/docs/05-project/adr/README.md +15 -0
- package/templates/en-US/docs/05-project/doc-code-map.md +17 -0
- package/templates/en-US/docs/05-project/evolution-backlog.md +14 -0
- package/templates/en-US/docs/05-project/feature-registry.md +16 -0
- package/templates/en-US/docs/05-project/master-delivery-tracker.md +14 -0
- package/templates/en-US/docs/05-project/risk-register.md +36 -0
- package/templates/en-US/docs/05-project/roadmap.md +36 -0
- package/templates/en-US/docs/05-project/stage-view.md +14 -0
- package/templates/en-US/docs/05-project/tech-stack.md +36 -0
- package/templates/en-US/docs/06-dev-guide/SPEC.md +18 -0
- package/templates/en-US/docs/06-dev-guide/coding-standards.md +36 -0
- package/templates/en-US/docs/06-dev-guide/deployment-architecture.md +20 -0
- package/templates/en-US/docs/06-dev-guide/project-scaffold.md +16 -0
- package/templates/en-US/docs/06-dev-guide/testing-strategy.md +42 -0
- package/templates/en-US/docs/07-frontend/README.md +36 -0
- package/templates/en-US/docs/07-frontend/user-personas.md +36 -0
- package/templates/en-US/docs/08-process/README.md +27 -0
- package/templates/en-US/docs/08-process/ai-collaboration-protocol.md +28 -0
- package/templates/en-US/docs/08-process/autopilot.md +18 -0
- package/templates/en-US/docs/08-process/code-grounding.md +32 -0
- package/templates/en-US/docs/08-process/context-loading-strategy.md +35 -0
- package/templates/en-US/docs/08-process/conventions.md +75 -0
- package/templates/en-US/docs/08-process/debugging.md +25 -0
- package/templates/en-US/docs/08-process/design-gate.md +22 -0
- package/templates/en-US/docs/08-process/git-protocol.md +20 -0
- package/templates/en-US/docs/08-process/multi-agent-orchestration.md +27 -0
- package/templates/en-US/docs/08-process/planning.md +18 -0
- package/templates/en-US/docs/08-process/project-intake.md +47 -0
- package/templates/en-US/docs/08-process/reflection.md +18 -0
- package/templates/en-US/docs/08-process/review.md +30 -0
- package/templates/en-US/docs/08-process/session-handoff.md +27 -0
- package/templates/en-US/docs/08-process/tdd.md +24 -0
- package/templates/en-US/docs/08-process/tool-execution.md +32 -0
- package/templates/en-US/docs/08-process/workflow-contract.md +46 -0
- package/templates/en-US/docs/08-process/workflow.md +23 -0
- package/templates/en-US/docs/README.md +58 -0
- package/templates/en-US/docs/design-checklist.md +36 -0
- package/templates/en-US/docs/discussions/README.md +13 -0
- package/templates/en-US/docs/plans/README.md +13 -0
- package/templates/en-US/docs/proposed-design/README.md +13 -0
- package/templates/en-US/docs/temp-reference/README.md +11 -0
- package/templates/en-US/docs.config.json +46 -0
- package/templates/en-US/profiles/README.md +23 -0
- package/templates/en-US/profiles/agent-platform/README.md +23 -0
- package/templates/en-US/profiles/cli-tool/README.md +23 -0
- package/templates/en-US/profiles/library-sdk/README.md +23 -0
- package/templates/en-US/profiles/multi-agent/README.md +23 -0
- package/templates/en-US/profiles/profiles.json +31 -0
- package/templates/en-US/profiles/software-automation/README.md +23 -0
- package/templates/en-US/profiles/web-saas/README.md +23 -0
- package/templates/en-US/scripts/README.md +89 -0
- package/templates/en-US/scripts/doc-find.mjs +156 -0
- package/templates/en-US/scripts/doc-map.mjs +50 -0
- package/templates/en-US/scripts/doc-tools.mjs +311 -0
- package/templates/en-US/scripts/init-docs.mjs +214 -0
- package/templates/en-US/scripts/validate-docs.mjs +141 -0
- package/templates/zh-CN/AGENTS.md +38 -0
- package/templates/zh-CN/DOCS_MAINTENANCE.md +77 -0
- package/templates/zh-CN/MIGRATION.md +45 -0
- package/templates/zh-CN/NEW_PROJECT_CHECKLIST.md +54 -0
- package/templates/zh-CN/README.md +55 -0
- package/templates/zh-CN/SESSION.md +29 -0
- package/templates/zh-CN/docs/00-context.md +42 -0
- package/templates/zh-CN/docs/01-vision/README.md +33 -0
- package/templates/zh-CN/docs/02-requirements/PRD.md +26 -0
- package/templates/zh-CN/docs/02-requirements/glossary.md +35 -0
- package/templates/zh-CN/docs/02-requirements/use-cases.md +31 -0
- package/templates/zh-CN/docs/03-architecture/composite-ai-framework.md +27 -0
- package/templates/zh-CN/docs/03-architecture/integration-architecture.md +30 -0
- package/templates/zh-CN/docs/03-architecture/system-architecture.md +26 -0
- package/templates/zh-CN/docs/04-design/README.md +21 -0
- package/templates/zh-CN/docs/04-design/a2a-integration-spec.md +45 -0
- package/templates/zh-CN/docs/04-design/agent-specs.md +46 -0
- package/templates/zh-CN/docs/04-design/data-model.md +18 -0
- package/templates/zh-CN/docs/04-design/external-api-spec.md +34 -0
- package/templates/zh-CN/docs/04-design/mcp-interface-spec.md +44 -0
- package/templates/zh-CN/docs/04-design/phase1-minimal-implementation-interfaces.md +38 -0
- package/templates/zh-CN/docs/04-design/responsibility-model.md +37 -0
- package/templates/zh-CN/docs/04-design/runtime-control-plane-spec.md +47 -0
- package/templates/zh-CN/docs/04-design/safety-governance.md +18 -0
- package/templates/zh-CN/docs/04-design/sample-scenarios-architecture-refinement.md +38 -0
- package/templates/zh-CN/docs/04-design/skill-syntax-spec.md +43 -0
- package/templates/zh-CN/docs/04-design/storage-schema.md +18 -0
- package/templates/zh-CN/docs/04-design/task-capability-architecture-and-evolution.md +46 -0
- package/templates/zh-CN/docs/05-project/adr/ADR-000-template.md +34 -0
- package/templates/zh-CN/docs/05-project/adr/README.md +35 -0
- package/templates/zh-CN/docs/05-project/doc-code-map.md +19 -0
- package/templates/zh-CN/docs/05-project/evolution-backlog.md +14 -0
- package/templates/zh-CN/docs/05-project/feature-registry.md +16 -0
- package/templates/zh-CN/docs/05-project/master-delivery-tracker.md +14 -0
- package/templates/zh-CN/docs/05-project/risk-register.md +21 -0
- package/templates/zh-CN/docs/05-project/roadmap.md +31 -0
- package/templates/zh-CN/docs/05-project/stage-view.md +14 -0
- package/templates/zh-CN/docs/05-project/tech-stack.md +36 -0
- package/templates/zh-CN/docs/06-dev-guide/SPEC.md +24 -0
- package/templates/zh-CN/docs/06-dev-guide/coding-standards.md +29 -0
- package/templates/zh-CN/docs/06-dev-guide/deployment-architecture.md +22 -0
- package/templates/zh-CN/docs/06-dev-guide/project-scaffold.md +16 -0
- package/templates/zh-CN/docs/06-dev-guide/testing-strategy.md +46 -0
- package/templates/zh-CN/docs/07-frontend/README.md +29 -0
- package/templates/zh-CN/docs/07-frontend/user-personas.md +27 -0
- package/templates/zh-CN/docs/08-process/README.md +29 -0
- package/templates/zh-CN/docs/08-process/ai-collaboration-protocol.md +30 -0
- package/templates/zh-CN/docs/08-process/autopilot.md +18 -0
- package/templates/zh-CN/docs/08-process/code-grounding.md +40 -0
- package/templates/zh-CN/docs/08-process/context-loading-strategy.md +35 -0
- package/templates/zh-CN/docs/08-process/conventions.md +77 -0
- package/templates/zh-CN/docs/08-process/debugging.md +27 -0
- package/templates/zh-CN/docs/08-process/design-gate.md +22 -0
- package/templates/zh-CN/docs/08-process/git-protocol.md +20 -0
- package/templates/zh-CN/docs/08-process/multi-agent-orchestration.md +27 -0
- package/templates/zh-CN/docs/08-process/planning.md +18 -0
- package/templates/zh-CN/docs/08-process/project-intake.md +53 -0
- package/templates/zh-CN/docs/08-process/reflection.md +18 -0
- package/templates/zh-CN/docs/08-process/review.md +30 -0
- package/templates/zh-CN/docs/08-process/session-handoff.md +29 -0
- package/templates/zh-CN/docs/08-process/tdd.md +24 -0
- package/templates/zh-CN/docs/08-process/tool-execution.md +34 -0
- package/templates/zh-CN/docs/08-process/workflow-contract.md +48 -0
- package/templates/zh-CN/docs/08-process/workflow.md +23 -0
- package/templates/zh-CN/docs/README.md +62 -0
- package/templates/zh-CN/docs/design-checklist.md +18 -0
- package/templates/zh-CN/docs/discussions/README.md +36 -0
- package/templates/zh-CN/docs/plans/README.md +15 -0
- package/templates/zh-CN/docs/proposed-design/README.md +41 -0
- package/templates/zh-CN/docs/temp-reference/README.md +13 -0
- package/templates/zh-CN/docs.config.json +46 -0
- package/templates/zh-CN/profiles/README.md +23 -0
- package/templates/zh-CN/profiles/agent-platform/README.md +23 -0
- package/templates/zh-CN/profiles/cli-tool/README.md +23 -0
- package/templates/zh-CN/profiles/library-sdk/README.md +23 -0
- package/templates/zh-CN/profiles/multi-agent/README.md +23 -0
- package/templates/zh-CN/profiles/profiles.json +31 -0
- package/templates/zh-CN/profiles/software-automation/README.md +23 -0
- package/templates/zh-CN/profiles/web-saas/README.md +23 -0
- package/templates/zh-CN/scripts/README.md +97 -0
- package/templates/zh-CN/scripts/doc-find.mjs +156 -0
- package/templates/zh-CN/scripts/doc-map.mjs +50 -0
- package/templates/zh-CN/scripts/doc-tools.mjs +311 -0
- package/templates/zh-CN/scripts/init-docs.mjs +214 -0
- package/templates/zh-CN/scripts/validate-docs.mjs +141 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentLock Harness v3.3 — Version-Adaptive Multi-Agent CLI Runner
|
|
3
|
+
*
|
|
4
|
+
* Dynamically probes local CLI `--help` (cached once per process) so breaking upstream flag changes
|
|
5
|
+
* work out-of-the-box and `eval` runs automatically enable native JSON telemetry (`--json` for Codex,
|
|
6
|
+
* `--output-format json` for Claude Code & Gemini CLI) whenever supported.
|
|
7
|
+
*/
|
|
8
|
+
import { spawnSync } from "node:child_process";
|
|
9
|
+
import { DEFAULT_AGENT_FLAGS } from "./catalog.mjs";
|
|
10
|
+
|
|
11
|
+
const helpCache = new Map();
|
|
12
|
+
|
|
13
|
+
export function probeCliHelp(cmd, helpArgs = ["--help"]) {
|
|
14
|
+
const key = `${cmd}:${helpArgs.join(" ")}`;
|
|
15
|
+
if (helpCache.has(key)) return helpCache.get(key);
|
|
16
|
+
try {
|
|
17
|
+
const res = spawnSync(cmd, helpArgs, {
|
|
18
|
+
encoding: "utf-8",
|
|
19
|
+
shell: process.platform === "win32",
|
|
20
|
+
timeout: 5000,
|
|
21
|
+
});
|
|
22
|
+
const text = `${res.stdout || ""}\n${res.stderr || ""}`;
|
|
23
|
+
helpCache.set(key, text);
|
|
24
|
+
return text;
|
|
25
|
+
} catch {
|
|
26
|
+
helpCache.set(key, "");
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function splitShellTokens(str) {
|
|
32
|
+
const tokens = [];
|
|
33
|
+
const re = /"([^"]*)"|'([^']*)'|(\S+)/g;
|
|
34
|
+
let m;
|
|
35
|
+
while ((m = re.exec(String(str || ""))) !== null) {
|
|
36
|
+
tokens.push(m[1] ?? m[2] ?? m[3]);
|
|
37
|
+
}
|
|
38
|
+
return tokens;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function resolveCodexWriteFlags(helpText, { ephemeral = false, jsonOutput = false } = {}) {
|
|
42
|
+
let flags;
|
|
43
|
+
if (helpText.includes("--approve-for-me")) {
|
|
44
|
+
flags = ["exec", "--approve-for-me"];
|
|
45
|
+
} else if (helpText.includes("--full-auto")) {
|
|
46
|
+
flags = ["exec", "--full-auto"];
|
|
47
|
+
} else if (helpText.includes("--sandbox")) {
|
|
48
|
+
flags = ["exec", "--sandbox", "workspace-write"];
|
|
49
|
+
} else {
|
|
50
|
+
flags = [...DEFAULT_AGENT_FLAGS.ralph.codex];
|
|
51
|
+
}
|
|
52
|
+
if (ephemeral && helpText.includes("--ephemeral") && !flags.includes("--ephemeral")) {
|
|
53
|
+
flags.push("--ephemeral");
|
|
54
|
+
}
|
|
55
|
+
if (jsonOutput && helpText.includes("--json") && !flags.includes("--json")) {
|
|
56
|
+
flags.push("--json");
|
|
57
|
+
}
|
|
58
|
+
return flags;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function buildAgentInvocation(agent, intent, promptText, cfg = {}, opts = {}) {
|
|
62
|
+
const isReview = intent === "review";
|
|
63
|
+
const isEval = intent === "eval";
|
|
64
|
+
const wantJsonTelemetry = isEval && opts.jsonOutput !== false;
|
|
65
|
+
const configBucket = isReview ? "review" : "ralph";
|
|
66
|
+
const supported = ["claude", "codex", "gemini"];
|
|
67
|
+
if (!supported.includes(agent)) {
|
|
68
|
+
throw new Error(`不支持的智能体驱动: ${agent}(支持: ${supported.join(", ")})`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let baseFlags;
|
|
72
|
+
if (opts.agentFlags) {
|
|
73
|
+
baseFlags = Array.isArray(opts.agentFlags) ? [...opts.agentFlags] : splitShellTokens(opts.agentFlags);
|
|
74
|
+
} else if (Array.isArray(cfg?.agentFlags?.[configBucket]?.[agent])) {
|
|
75
|
+
baseFlags = [...cfg.agentFlags[configBucket][agent]];
|
|
76
|
+
if (agent === "codex" && !isReview) {
|
|
77
|
+
const help = opts.helpText ?? probeCliHelp("codex", ["exec", "--help"]);
|
|
78
|
+
if (baseFlags.includes("--full-auto") && help && !help.includes("--full-auto") && help.includes("--approve-for-me")) {
|
|
79
|
+
baseFlags = baseFlags.map((f) => (f === "--full-auto" ? "--approve-for-me" : f));
|
|
80
|
+
}
|
|
81
|
+
if (isEval && help.includes("--ephemeral") && !baseFlags.includes("--ephemeral")) {
|
|
82
|
+
baseFlags.push("--ephemeral");
|
|
83
|
+
}
|
|
84
|
+
if (wantJsonTelemetry && help.includes("--json") && !baseFlags.includes("--json")) {
|
|
85
|
+
baseFlags.push("--json");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} else if (agent === "codex" && !isReview) {
|
|
89
|
+
const help = opts.helpText ?? probeCliHelp("codex", ["exec", "--help"]);
|
|
90
|
+
baseFlags = resolveCodexWriteFlags(help, { ephemeral: isEval, jsonOutput: wantJsonTelemetry });
|
|
91
|
+
} else {
|
|
92
|
+
baseFlags = [...DEFAULT_AGENT_FLAGS[configBucket][agent]];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Auto-enable native `--output-format json` for Claude Code & Gemini CLI during `eval` runs
|
|
96
|
+
if (wantJsonTelemetry && (agent === "claude" || agent === "gemini") && !opts.agentFlags) {
|
|
97
|
+
if (!baseFlags.includes("--output-format")) {
|
|
98
|
+
const help = opts.helpText ?? probeCliHelp(agent, ["--help"]);
|
|
99
|
+
if (help.includes("--output-format")) {
|
|
100
|
+
baseFlags.push("--output-format", "json");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Optional --model override
|
|
106
|
+
if (opts.model) {
|
|
107
|
+
const modelFlag = agent === "claude" ? "--model" : "-m";
|
|
108
|
+
if (!baseFlags.includes("-m") && !baseFlags.includes("--model")) {
|
|
109
|
+
baseFlags.push(modelFlag, String(opts.model));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
cmd: agent,
|
|
115
|
+
args: [...baseFlags, promptText],
|
|
116
|
+
displayArgs: [...baseFlags, "<PROMPT>"],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentLock Harness v2.3 — Unified Zero-PII Event Telemetry & Stats Aggregator
|
|
3
|
+
*
|
|
4
|
+
* Writes structured JSONL events to `.agentlock-harness/audit-logs/events.jsonl`.
|
|
5
|
+
* Opt-out via `AGENTLOCK_HARNESS_NO_AUDIT=1`.
|
|
6
|
+
* Never logs raw shell commands, credentials, or PII—only source, action, matched rule category, and durationMs.
|
|
7
|
+
*/
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { HARNESS_DIR } from "./harness-writer.mjs";
|
|
11
|
+
|
|
12
|
+
export const AUDIT_EVENTS_REL = `${HARNESS_DIR}/audit-logs/events.jsonl`;
|
|
13
|
+
export const RALPH_RUNS_REL = `${HARNESS_DIR}/audit-logs/ralph-runs.jsonl`;
|
|
14
|
+
|
|
15
|
+
export function recordEvent(targetRoot, { source, action, rule = null, detail = null, durationMs = null } = {}) {
|
|
16
|
+
if (process.env.AGENTLOCK_HARNESS_NO_AUDIT === "1") return false;
|
|
17
|
+
try {
|
|
18
|
+
const absRoot = path.resolve(targetRoot);
|
|
19
|
+
const logPath = path.join(absRoot, AUDIT_EVENTS_REL);
|
|
20
|
+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
21
|
+
const entry = {
|
|
22
|
+
ts: new Date().toISOString(),
|
|
23
|
+
source: String(source || "unknown"),
|
|
24
|
+
action: String(action || "event"),
|
|
25
|
+
...(rule ? { rule: String(rule).slice(0, 120) } : {}),
|
|
26
|
+
...(detail ? { detail: String(detail).slice(0, 160) } : {}),
|
|
27
|
+
...(typeof durationMs === "number" && Number.isFinite(durationMs) ? { durationMs: Math.max(0, Math.round(durationMs)) } : {}),
|
|
28
|
+
};
|
|
29
|
+
fs.appendFileSync(logPath, JSON.stringify(entry) + "\n", "utf-8");
|
|
30
|
+
return true;
|
|
31
|
+
} catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function readJsonlSafe(absPath) {
|
|
37
|
+
if (!fs.existsSync(absPath)) return [];
|
|
38
|
+
const lines = fs.readFileSync(absPath, "utf-8").split(/\r?\n/);
|
|
39
|
+
const rows = [];
|
|
40
|
+
for (const line of lines) {
|
|
41
|
+
const trimmed = line.trim();
|
|
42
|
+
if (!trimmed) continue;
|
|
43
|
+
try {
|
|
44
|
+
const obj = JSON.parse(trimmed);
|
|
45
|
+
if (obj && typeof obj === "object") rows.push(obj);
|
|
46
|
+
} catch {
|
|
47
|
+
// ignore corrupted partial lines
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return rows;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function readEvents(targetRoot, { days = null } = {}) {
|
|
54
|
+
const absRoot = path.resolve(targetRoot);
|
|
55
|
+
const cutoffMs =
|
|
56
|
+
typeof days === "number" && Number.isFinite(days) && days > 0
|
|
57
|
+
? Date.now() - days * 24 * 60 * 60 * 1000
|
|
58
|
+
: null;
|
|
59
|
+
|
|
60
|
+
const events = readJsonlSafe(path.join(absRoot, AUDIT_EVENTS_REL));
|
|
61
|
+
const ralphRuns = readJsonlSafe(path.join(absRoot, RALPH_RUNS_REL));
|
|
62
|
+
|
|
63
|
+
const filterByTime = (row) => {
|
|
64
|
+
if (cutoffMs === null) return true;
|
|
65
|
+
const rawTs = row.ts || row.timestamp;
|
|
66
|
+
if (!rawTs) return true;
|
|
67
|
+
const ms = Date.parse(rawTs);
|
|
68
|
+
return !Number.isFinite(ms) || ms >= cutoffMs;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
events: events.filter(filterByTime),
|
|
73
|
+
ralphRuns: ralphRuns.filter(filterByTime),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function computeStats(targetRoot, { days = null } = {}) {
|
|
78
|
+
const absRoot = path.resolve(targetRoot);
|
|
79
|
+
const { events, ralphRuns } = readEvents(absRoot, { days });
|
|
80
|
+
|
|
81
|
+
const bySource = {};
|
|
82
|
+
const blockedRules = {};
|
|
83
|
+
let totalBlocks = 0;
|
|
84
|
+
let totalPasses = 0;
|
|
85
|
+
let totalFails = 0;
|
|
86
|
+
|
|
87
|
+
for (const ev of events) {
|
|
88
|
+
const src = ev.source || "unknown";
|
|
89
|
+
if (!bySource[src]) bySource[src] = { total: 0, block: 0, pass: 0, fail: 0, other: 0 };
|
|
90
|
+
bySource[src].total++;
|
|
91
|
+
|
|
92
|
+
const act = String(ev.action || "").toLowerCase();
|
|
93
|
+
if (act === "block" || act === "blocked") {
|
|
94
|
+
bySource[src].block++;
|
|
95
|
+
totalBlocks++;
|
|
96
|
+
const ruleKey = `${src}:${ev.rule || "unspecified"}`;
|
|
97
|
+
blockedRules[ruleKey] = (blockedRules[ruleKey] || 0) + 1;
|
|
98
|
+
} else if (act === "pass" || act === "allow" || act === "done" || act === "archive") {
|
|
99
|
+
bySource[src].pass++;
|
|
100
|
+
totalPasses++;
|
|
101
|
+
} else if (act === "fail" || act === "error") {
|
|
102
|
+
bySource[src].fail++;
|
|
103
|
+
totalFails++;
|
|
104
|
+
} else {
|
|
105
|
+
bySource[src].other++;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const topBlockedRules = Object.entries(blockedRules)
|
|
110
|
+
.sort((a, b) => b[1] - a[1] || (a[0] < b[0] ? -1 : 1))
|
|
111
|
+
.slice(0, 10)
|
|
112
|
+
.map(([rule, count]) => ({ rule, count }));
|
|
113
|
+
|
|
114
|
+
// Ralph metrics
|
|
115
|
+
const ralphTotal = ralphRuns.length;
|
|
116
|
+
const ralphPassed = ralphRuns.filter((r) => r.passed === true).length;
|
|
117
|
+
const ralphStalled = ralphRuns.filter((r) => r.stalled === true).length;
|
|
118
|
+
const ralphAvgDurationMs =
|
|
119
|
+
ralphTotal > 0
|
|
120
|
+
? Math.round(ralphRuns.reduce((sum, r) => sum + (Number(r.durationMs) || 0), 0) / ralphTotal)
|
|
121
|
+
: 0;
|
|
122
|
+
|
|
123
|
+
// Task ledger snapshot if present
|
|
124
|
+
const tasksPath = path.join(absRoot, `${HARNESS_DIR}/tasks.json`);
|
|
125
|
+
let tasksSummary = null;
|
|
126
|
+
if (fs.existsSync(tasksPath)) {
|
|
127
|
+
try {
|
|
128
|
+
const ledger = JSON.parse(fs.readFileSync(tasksPath, "utf-8"));
|
|
129
|
+
const list = Array.isArray(ledger.tasks) ? ledger.tasks : [];
|
|
130
|
+
const doneSet = new Set(list.filter((t) => t.status === "done").map((t) => t.id));
|
|
131
|
+
const now = Date.now();
|
|
132
|
+
const readyCount = list.filter((t) => {
|
|
133
|
+
const leaseExpired = t.status === "claimed" && t.leaseUntil && Date.parse(t.leaseUntil) <= now;
|
|
134
|
+
const claimable = t.status === "open" || leaseExpired;
|
|
135
|
+
return claimable && (t.dependsOn || []).every((dep) => doneSet.has(dep));
|
|
136
|
+
}).length;
|
|
137
|
+
tasksSummary = {
|
|
138
|
+
total: list.length,
|
|
139
|
+
open: list.filter((t) => t.status === "open").length,
|
|
140
|
+
ready: readyCount,
|
|
141
|
+
claimed: list.filter((t) => t.status === "claimed").length,
|
|
142
|
+
blocked: list.filter((t) => t.status === "blocked").length,
|
|
143
|
+
done: doneSet.size,
|
|
144
|
+
};
|
|
145
|
+
} catch {
|
|
146
|
+
tasksSummary = null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Active & archived changes snapshot
|
|
151
|
+
const changesDir = path.join(absRoot, `${HARNESS_DIR}/changes`);
|
|
152
|
+
let changesSummary = null;
|
|
153
|
+
if (fs.existsSync(changesDir)) {
|
|
154
|
+
const entries = fs.readdirSync(changesDir, { withFileTypes: true });
|
|
155
|
+
const active = entries.filter((e) => e.isDirectory() && e.name !== "archive").length;
|
|
156
|
+
const archDir = path.join(changesDir, "archive");
|
|
157
|
+
const archived = fs.existsSync(archDir)
|
|
158
|
+
? fs.readdirSync(archDir, { withFileTypes: true }).filter((e) => e.isDirectory()).length
|
|
159
|
+
: 0;
|
|
160
|
+
changesSummary = { active, archived };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
days: days || "all",
|
|
165
|
+
totalEvents: events.length,
|
|
166
|
+
totalBlocks,
|
|
167
|
+
totalPasses,
|
|
168
|
+
totalFails,
|
|
169
|
+
bySource,
|
|
170
|
+
topBlockedRules,
|
|
171
|
+
ralph: {
|
|
172
|
+
runs: ralphTotal,
|
|
173
|
+
passed: ralphPassed,
|
|
174
|
+
passRatePct: ralphTotal > 0 ? Math.round((ralphPassed / ralphTotal) * 100) : null,
|
|
175
|
+
stalled: ralphStalled,
|
|
176
|
+
avgDurationMs: ralphAvgDurationMs,
|
|
177
|
+
},
|
|
178
|
+
tasks: tasksSummary,
|
|
179
|
+
changes: changesSummary,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
export const HARNESS_MODES = {
|
|
2
|
+
"docs-only": {
|
|
3
|
+
id: "docs-only",
|
|
4
|
+
name: "经典模式:纯文档治理(AgentLock v1 Classic)",
|
|
5
|
+
enName: "Classic Mode: Pure Documentation Governance (v1)",
|
|
6
|
+
description: "仅初始化 v1 轻量文档体系与只读校验/检索脚本,不注入 Hooks、Skills 或沙箱",
|
|
7
|
+
recommendedTools: ["git", "node"],
|
|
8
|
+
optionalTools: ["pnpm", "claude", "codex", "gemini"],
|
|
9
|
+
},
|
|
10
|
+
"dual-core": {
|
|
11
|
+
id: "dual-core",
|
|
12
|
+
name: "方案一:高确定性双核主战(Dual-Core Harness)",
|
|
13
|
+
enName: "Preset 1: High-Determinism Dual-Core Harness",
|
|
14
|
+
description: "v1 文档底座 + 6 宿主路径级规则编译 + 反作弊 L2 Skills + L4 Hooks + 异构只读审校",
|
|
15
|
+
recommendedTools: ["git", "node", "pnpm", "claude", "codex"],
|
|
16
|
+
optionalTools: ["gemini", "openspec", "gh"],
|
|
17
|
+
},
|
|
18
|
+
"ralph-factory": {
|
|
19
|
+
id: "ralph-factory",
|
|
20
|
+
name: "方案二:沙箱自治循环工厂(Ralph Factory)",
|
|
21
|
+
enName: "Preset 2: Sandboxed Ralph Autonomous Factory",
|
|
22
|
+
description: "双核底座 + 最小权限 Docker 沙箱 + Sprint 验收契约 + 独立上下文 Ralph 自治循环(带完成检测与双熔断)",
|
|
23
|
+
recommendedTools: ["git", "node", "pnpm", "docker", "claude", "codex"],
|
|
24
|
+
optionalTools: ["gemini", "openspec", "gh"],
|
|
25
|
+
},
|
|
26
|
+
"enterprise-platform": {
|
|
27
|
+
id: "enterprise-platform",
|
|
28
|
+
name: "方案三:企业级双轨智能体平台(Enterprise Platform)",
|
|
29
|
+
enName: "Preset 3: Enterprise Dual-Track Agent Platform",
|
|
30
|
+
description: "工厂模式 + 策略引擎 policy.json(Hook 与 Git 双重拦截)+ Skills SHA-256 防投毒锁 + 内网 MCP 网关模板 + CI 门禁",
|
|
31
|
+
recommendedTools: ["git", "node", "pnpm", "docker", "gh", "claude", "codex"],
|
|
32
|
+
optionalTools: ["gemini", "openspec"],
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const DOMAIN_PROFILES = [
|
|
37
|
+
{ value: "minimal", label: "minimal(最小核心,推荐默认)", description: "6 份基础文档 + project-intake 按需接入 + 零冗余专题" },
|
|
38
|
+
{ value: "cli-tool", label: "cli-tool(命令行工具)", description: "叠加外部接口规范与测试策略" },
|
|
39
|
+
{ value: "web-saas", label: "web-saas(Web / SaaS 全栈)", description: "叠加 API 规范、数据模型、安全治理与测试策略" },
|
|
40
|
+
{ value: "library-sdk", label: "library-sdk(基础库 / SDK)", description: "叠加公共接口契约与测试策略" },
|
|
41
|
+
{ value: "agent-platform", label: "agent-platform(智能体平台产品)", description: "叠加 Agent 规格、安全治理与测试策略" },
|
|
42
|
+
{ value: "software-automation", label: "software-automation(工业 / 自动化系统)", description: "叠加场景架构精化、安全治理与测试策略" },
|
|
43
|
+
{ value: "multi-agent", label: "multi-agent(多智能体并行协作)", description: "叠加并行隔离与集成协议(文档存在不自动拉起多 Agent)" },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export const VALID_HOSTS = ["claude", "codex", "gemini", "cursor", "copilot"];
|
|
47
|
+
export const CLI_AGENTS = ["claude", "codex", "gemini"];
|
|
48
|
+
|
|
49
|
+
export const HOST_PROFILES = [
|
|
50
|
+
{
|
|
51
|
+
value: "all",
|
|
52
|
+
label: "全生态 6 宿主适配:Claude + Codex + Gemini/Antigravity + Cursor + Copilot(推荐)",
|
|
53
|
+
description: "一套规则源自动编译到全部主流 CLI 与 IDE 宿主,零漂移",
|
|
54
|
+
hosts: ["claude", "codex", "gemini", "cursor", "copilot"],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "cli",
|
|
58
|
+
label: "三巨头终端 CLI 组合:Claude Code + Codex CLI + Gemini CLI",
|
|
59
|
+
description: "仅生成终端智能体适配配置(CLAUDE.md/.claude + .codex + GEMINI.md/.gemini)",
|
|
60
|
+
hosts: ["claude", "codex", "gemini"],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: "claude,codex",
|
|
64
|
+
label: "Claude Code + OpenAI Codex CLI 双核组合",
|
|
65
|
+
description: "生成 Claude Hooks/Rules 与 Codex 沙箱策略配置",
|
|
66
|
+
hosts: ["claude", "codex"],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "claude,cursor,copilot",
|
|
70
|
+
label: "IDE + CLI 混合研发:Claude Code + Cursor + GitHub Copilot",
|
|
71
|
+
description: "生成 .claude/rules + .cursor/rules/*.mdc + .github/instructions/*.instructions.md",
|
|
72
|
+
hosts: ["claude", "cursor", "copilot"],
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
export function parseHostsOption(raw) {
|
|
77
|
+
if (!raw || raw === "all") return [...VALID_HOSTS];
|
|
78
|
+
if (raw === "cli") return [...CLI_AGENTS];
|
|
79
|
+
const list = String(raw)
|
|
80
|
+
.split(",")
|
|
81
|
+
.map((s) => s.trim().toLowerCase())
|
|
82
|
+
.filter((s) => VALID_HOSTS.includes(s));
|
|
83
|
+
return list.length > 0 ? [...new Set(list)] : [...VALID_HOSTS];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const AGENTS = [
|
|
87
|
+
{ value: "claude", label: "Claude Code (Anthropic)", description: "深度架构推理与原生 PreToolUse/PostToolUse/Stop Hooks 支持" },
|
|
88
|
+
{ value: "codex", label: "OpenAI Codex CLI", description: "OS 内核级沙箱隔离与高吞吐自动化补丁生成" },
|
|
89
|
+
{ value: "gemini", label: "Gemini CLI / Antigravity", description: "大上下文跨仓库定位、原生 BeforeTool/AfterTool Hooks 与计划先行工作流" },
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
export const DEFAULT_AGENT_FLAGS = {
|
|
93
|
+
review: {
|
|
94
|
+
claude: ["-p", "--permission-mode", "plan", "--allowedTools", "Read,Grep,Glob"],
|
|
95
|
+
codex: ["exec", "--sandbox", "read-only"],
|
|
96
|
+
gemini: ["-p", "--approval-mode", "plan"],
|
|
97
|
+
},
|
|
98
|
+
ralph: {
|
|
99
|
+
claude: ["-p", "--permission-mode", "acceptEdits"],
|
|
100
|
+
codex: ["exec", "--approve-for-me"],
|
|
101
|
+
gemini: ["-p", "--approval-mode", "auto_edit"],
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const TECH_STACKS = [
|
|
106
|
+
{
|
|
107
|
+
value: "node-ts",
|
|
108
|
+
label: "TypeScript / Node.js (pnpm)",
|
|
109
|
+
markerFiles: ["package.json"],
|
|
110
|
+
buildCmd: "pnpm build",
|
|
111
|
+
lintCmd: "pnpm lint",
|
|
112
|
+
typecheckCmd: "pnpm typecheck",
|
|
113
|
+
testCmd: "pnpm test",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
value: "python",
|
|
117
|
+
label: "Python (pytest / ruff / mypy)",
|
|
118
|
+
markerFiles: ["pyproject.toml", "setup.py", "pytest.ini", "requirements.txt"],
|
|
119
|
+
buildCmd: "python3 -m compileall -q .",
|
|
120
|
+
lintCmd: "ruff check .",
|
|
121
|
+
typecheckCmd: "mypy .",
|
|
122
|
+
testCmd: "pytest -q",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
value: "cpp-embedded",
|
|
126
|
+
label: "C/C++ / 嵌入式与工业控制 (CMake + CTest)",
|
|
127
|
+
markerFiles: ["CMakeLists.txt", "Makefile"],
|
|
128
|
+
buildCmd: "cmake -B build && cmake --build build -j",
|
|
129
|
+
lintCmd: "clang-format --dry-run --Werror src/*.cpp include/*.h",
|
|
130
|
+
typecheckCmd: "cmake --build build --target all",
|
|
131
|
+
testCmd: "ctest --test-dir build --output-on-failure",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: "go",
|
|
135
|
+
label: "Go (go vet / go test)",
|
|
136
|
+
markerFiles: ["go.mod"],
|
|
137
|
+
buildCmd: "go build ./...",
|
|
138
|
+
lintCmd: "golangci-lint run",
|
|
139
|
+
typecheckCmd: "go vet ./...",
|
|
140
|
+
testCmd: "go test ./...",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: "rust",
|
|
144
|
+
label: "Rust (cargo test / clippy)",
|
|
145
|
+
markerFiles: ["Cargo.toml"],
|
|
146
|
+
buildCmd: "cargo build",
|
|
147
|
+
lintCmd: "cargo clippy --all-targets -- -D warnings",
|
|
148
|
+
typecheckCmd: "cargo check --all-targets",
|
|
149
|
+
testCmd: "cargo test",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
value: "custom",
|
|
153
|
+
label: "自定义技术栈(手动填写或稍后配置)",
|
|
154
|
+
markerFiles: [],
|
|
155
|
+
buildCmd: "",
|
|
156
|
+
lintCmd: "",
|
|
157
|
+
typecheckCmd: "",
|
|
158
|
+
testCmd: "",
|
|
159
|
+
},
|
|
160
|
+
];
|