@nimiplatform/nimi-coding 0.2.7 → 0.3.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/CHANGELOG.md +8 -80
- package/CONTRIBUTING.md +5 -34
- package/README.md +47 -350
- package/README.zh-CN.md +33 -287
- package/cli/commands/start.mjs +48 -688
- package/cli/commands/validate-spec-audit.mjs +1 -5
- package/cli/constants.mjs +9 -417
- package/cli/dev/run-cli-smoke.mjs +24 -0
- package/cli/dev/run-suite.mjs +17 -0
- package/cli/help.mjs +28 -145
- package/cli/index.mjs +5 -33
- package/cli/lib/blueprint-audit.mjs +5 -12
- package/cli/lib/bootstrap.mjs +0 -9
- package/cli/lib/contracts.mjs +0 -163
- package/cli/lib/doctor.mjs +155 -10
- package/cli/lib/entrypoints.mjs +63 -167
- package/cli/lib/internal/contracts-loaders.mjs +0 -85
- package/cli/lib/internal/contracts-parse.mjs +84 -520
- package/cli/lib/internal/governance/ai/check-agents-freshness.mjs +13 -8
- package/cli/lib/internal/surface-taxonomy-validators.mjs +316 -66
- package/cli/lib/internal/validators-shared.mjs +0 -16
- package/cli/lib/internal/validators-spec-helpers.mjs +7 -140
- package/cli/lib/internal/validators-spec.mjs +103 -342
- package/cli/lib/shared.mjs +1 -42
- package/cli/lib/validators.mjs +0 -48
- package/cli/seeds/seed-policy.yaml +0 -3
- package/config/bootstrap.yaml +4 -4
- package/config/spec-generation-inputs.yaml +6 -12
- package/contracts/domain-admission.schema.yaml +3 -3
- package/contracts/migration-inventory.schema.yaml +12 -75
- package/contracts/negative-fixtures.yaml +19 -99
- package/contracts/placement-contract.schema.yaml +49 -78
- package/contracts/projection-edge.schema.yaml +37 -121
- package/contracts/shared-enums.yaml +4 -8
- package/contracts/spec-generation-inputs.schema.yaml +15 -112
- package/contracts/spec-layout.schema.yaml +32 -0
- package/contracts/surface-taxonomy.schema.yaml +43 -94
- package/contracts/table-family.schema.yaml +1 -1
- package/contracts/tracked-output-admission.schema.yaml +13 -66
- package/methodology/core.yaml +33 -25
- package/methodology/four-closure-policy.yaml +18 -26
- package/methodology/role-separation-policy.yaml +21 -27
- package/methodology/spec-reconstruction.yaml +17 -34
- package/package.json +4 -6
- package/spec/_meta/spec-tree-model.yaml +5 -101
- package/spec/product-scope.yaml +25 -57
- package/adapters/README.md +0 -25
- package/adapters/claude/README.md +0 -89
- package/adapters/claude/profile.yaml +0 -70
- package/adapters/codex/README.md +0 -53
- package/adapters/codex/profile.yaml +0 -78
- package/adapters/oh-my-codex/README.md +0 -184
- package/adapters/oh-my-codex/profile.yaml +0 -46
- package/cli/commands/admit-high-risk-decision.mjs +0 -108
- package/cli/commands/audit-sweep.mjs +0 -364
- package/cli/commands/closeout.mjs +0 -186
- package/cli/commands/decide-high-risk-execution.mjs +0 -124
- package/cli/commands/handoff.mjs +0 -123
- package/cli/commands/ingest-high-risk-execution.mjs +0 -95
- package/cli/commands/review-high-risk-execution.mjs +0 -95
- package/cli/commands/sweep-design.mjs +0 -295
- package/cli/commands/sweep.mjs +0 -22
- package/cli/commands/topic-formatters.mjs +0 -382
- package/cli/commands/topic-goal.mjs +0 -33
- package/cli/commands/topic-options-shared.mjs +0 -27
- package/cli/commands/topic-options-workflow.mjs +0 -767
- package/cli/commands/topic-options.mjs +0 -626
- package/cli/commands/topic-runner.mjs +0 -169
- package/cli/commands/topic.mjs +0 -795
- package/cli/commands/validate-acceptance.mjs +0 -5
- package/cli/commands/validate-execution-packet.mjs +0 -5
- package/cli/commands/validate-orchestration-state.mjs +0 -5
- package/cli/commands/validate-prompt.mjs +0 -5
- package/cli/commands/validate-worker-output.mjs +0 -5
- package/cli/lib/adapter-profiles.mjs +0 -403
- package/cli/lib/audit-execution.mjs +0 -52
- package/cli/lib/audit-sweep-runtime/admissions.mjs +0 -508
- package/cli/lib/audit-sweep-runtime/audit-validity.mjs +0 -356
- package/cli/lib/audit-sweep-runtime/chunks.mjs +0 -697
- package/cli/lib/audit-sweep-runtime/claude-auditor.mjs +0 -647
- package/cli/lib/audit-sweep-runtime/closeout.mjs +0 -144
- package/cli/lib/audit-sweep-runtime/codex-auditor-evidence.mjs +0 -654
- package/cli/lib/audit-sweep-runtime/codex-auditor.mjs +0 -516
- package/cli/lib/audit-sweep-runtime/common.mjs +0 -341
- package/cli/lib/audit-sweep-runtime/coverage-quality.mjs +0 -172
- package/cli/lib/audit-sweep-runtime/evidence-assignment.mjs +0 -155
- package/cli/lib/audit-sweep-runtime/format.mjs +0 -57
- package/cli/lib/audit-sweep-runtime/ingest.mjs +0 -486
- package/cli/lib/audit-sweep-runtime/inventory-spec-chunks.mjs +0 -425
- package/cli/lib/audit-sweep-runtime/inventory.mjs +0 -798
- package/cli/lib/audit-sweep-runtime/ledger.mjs +0 -315
- package/cli/lib/audit-sweep-runtime/p0p1-profile.mjs +0 -101
- package/cli/lib/audit-sweep-runtime/remediation.mjs +0 -349
- package/cli/lib/audit-sweep-runtime/rerun.mjs +0 -129
- package/cli/lib/audit-sweep-runtime/risk-budget.mjs +0 -300
- package/cli/lib/audit-sweep-runtime/status.mjs +0 -62
- package/cli/lib/audit-sweep-runtime/validators-ledger.mjs +0 -215
- package/cli/lib/audit-sweep-runtime/validators.mjs +0 -797
- package/cli/lib/audit-sweep.mjs +0 -19
- package/cli/lib/authority-convergence.mjs +0 -704
- package/cli/lib/closeout.mjs +0 -732
- package/cli/lib/codex-sdk-runner.mjs +0 -76
- package/cli/lib/external-execution.mjs +0 -101
- package/cli/lib/handoff.mjs +0 -812
- package/cli/lib/high-risk-admission.mjs +0 -512
- package/cli/lib/high-risk-decision.mjs +0 -353
- package/cli/lib/high-risk-ingest.mjs +0 -321
- package/cli/lib/high-risk-review.mjs +0 -267
- package/cli/lib/internal/contracts-parse-high-risk.mjs +0 -131
- package/cli/lib/internal/contracts-validators.mjs +0 -399
- package/cli/lib/internal/doctor-bootstrap-surface.mjs +0 -406
- package/cli/lib/internal/doctor-delegated-surface.mjs +0 -256
- package/cli/lib/internal/doctor-finalize.mjs +0 -383
- package/cli/lib/internal/doctor-format.mjs +0 -286
- package/cli/lib/internal/doctor-inspectors.mjs +0 -327
- package/cli/lib/internal/doctor-state.mjs +0 -205
- package/cli/lib/internal/validators-artifacts.mjs +0 -515
- package/cli/lib/sweep-design-runtime/common.mjs +0 -246
- package/cli/lib/sweep-design-runtime/engine.mjs +0 -733
- package/cli/lib/sweep-design-runtime/fix-topic.mjs +0 -414
- package/cli/lib/sweep-design-runtime/lifecycle.mjs +0 -54
- package/cli/lib/sweep-design-runtime/results.mjs +0 -324
- package/cli/lib/sweep-design.mjs +0 -8
- package/cli/lib/topic-artifacts.mjs +0 -186
- package/cli/lib/topic-authority-coverage.mjs +0 -73
- package/cli/lib/topic-closeout.mjs +0 -560
- package/cli/lib/topic-common.mjs +0 -404
- package/cli/lib/topic-decisions.mjs +0 -332
- package/cli/lib/topic-draft-packets.mjs +0 -167
- package/cli/lib/topic-execution.mjs +0 -515
- package/cli/lib/topic-goal.mjs +0 -440
- package/cli/lib/topic-ledger.mjs +0 -281
- package/cli/lib/topic-lifecycle-artifacts.mjs +0 -173
- package/cli/lib/topic-root-validation.mjs +0 -288
- package/cli/lib/topic-runner-commands.mjs +0 -174
- package/cli/lib/topic-runner-deferral.mjs +0 -532
- package/cli/lib/topic-runner-stale-gates.mjs +0 -114
- package/cli/lib/topic-runner-validation.mjs +0 -138
- package/cli/lib/topic-runner.mjs +0 -727
- package/cli/lib/topic-scaffold.mjs +0 -252
- package/cli/lib/topic-waves.mjs +0 -403
- package/cli/lib/topic.mjs +0 -81
- package/config/audit-execution-artifacts.yaml +0 -20
- package/config/external-execution-artifacts.yaml +0 -16
- package/config/host-adapter.yaml +0 -30
- package/config/host-profile.yaml +0 -29
- package/config/installer-evidence.yaml +0 -31
- package/config/skill-installer.yaml +0 -23
- package/config/skill-manifest.yaml +0 -48
- package/config/skills.yaml +0 -30
- package/contracts/acceptance.schema.yaml +0 -16
- package/contracts/admission-checklist.schema.yaml +0 -15
- package/contracts/audit-chunk.schema.yaml +0 -123
- package/contracts/audit-closeout.schema.yaml +0 -51
- package/contracts/audit-finding.schema.yaml +0 -61
- package/contracts/audit-ledger.schema.yaml +0 -138
- package/contracts/audit-plan.schema.yaml +0 -138
- package/contracts/audit-remediation-map.schema.yaml +0 -52
- package/contracts/audit-rerun.schema.yaml +0 -31
- package/contracts/audit-sweep-result.yaml +0 -53
- package/contracts/authority-convergence-audit.schema.yaml +0 -19
- package/contracts/closeout.schema.yaml +0 -25
- package/contracts/decision-review.schema.yaml +0 -16
- package/contracts/doc-spec-audit-result.yaml +0 -19
- package/contracts/execution-packet.schema.yaml +0 -49
- package/contracts/external-host-compatibility.yaml +0 -22
- package/contracts/forbidden-shortcuts.catalog.yaml +0 -23
- package/contracts/high-risk-admission.schema.yaml +0 -23
- package/contracts/high-risk-execution-result.yaml +0 -20
- package/contracts/orchestration-state.schema.yaml +0 -41
- package/contracts/overflow-continuation.schema.yaml +0 -12
- package/contracts/packet.schema.yaml +0 -30
- package/contracts/pending-note.schema.yaml +0 -17
- package/contracts/prompt.schema.yaml +0 -12
- package/contracts/remediation.schema.yaml +0 -16
- package/contracts/result.schema.yaml +0 -24
- package/contracts/spec-reconstruction-result.yaml +0 -41
- package/contracts/sweep-design-result.yaml +0 -349
- package/contracts/topic-goal.schema.yaml +0 -87
- package/contracts/topic-run-ledger.schema.yaml +0 -72
- package/contracts/topic-step-decision.schema.yaml +0 -45
- package/contracts/topic.schema.yaml +0 -65
- package/contracts/true-close.schema.yaml +0 -15
- package/contracts/wave.schema.yaml +0 -29
- package/contracts/worker-output.schema.yaml +0 -15
- package/contracts/workflow-consumer.schema.yaml +0 -110
- package/methodology/audit-sweep-p0p1-recall.yaml +0 -45
- package/methodology/authority-convergence-policy.yaml +0 -42
- package/methodology/overflow-continuation-policy.yaml +0 -14
- package/methodology/skill-exchange-projection.yaml +0 -114
- package/methodology/skill-handoff.yaml +0 -34
- package/methodology/skill-installer-result.yaml +0 -27
- package/methodology/skill-installer-summary-projection.yaml +0 -181
- package/methodology/skill-runtime.yaml +0 -23
- package/methodology/spec-target-truth-profile.yaml +0 -46
- package/methodology/topic-lifecycle-report.yaml +0 -144
- package/methodology/topic-lifecycle.yaml +0 -37
- package/methodology/topic-naming-ontology.yaml +0 -21
- package/methodology/topic-ontology.yaml +0 -38
- package/methodology/topic-validation-policy.yaml +0 -9
- package/methodology/wave-dag-policy.yaml +0 -14
- package/spec/_meta/command-gating-matrix.yaml +0 -143
- package/spec/_meta/generate-drift-migration-checklist.yaml +0 -137
- package/spec/_meta/governance-routing-cutover-checklist.yaml +0 -35
- package/spec/_meta/phase2-impacted-surface-matrix.yaml +0 -44
- package/spec/_meta/spec-authority-cutover-readiness.yaml +0 -102
- package/spec/bootstrap-state.yaml +0 -99
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import process from "node:process";
|
|
2
|
-
|
|
3
|
-
import { runTopicRunner, runTopicRunnerStep } from "../lib/topic-runner.mjs";
|
|
4
|
-
import { resolveTopicProjectRoot } from "../lib/topic.mjs";
|
|
5
|
-
import {
|
|
6
|
-
localize,
|
|
7
|
-
styleHeading,
|
|
8
|
-
styleLabel,
|
|
9
|
-
} from "../lib/ui.mjs";
|
|
10
|
-
|
|
11
|
-
const ADAPTER_IDS = ["codex", "oh_my_codex", "claude"];
|
|
12
|
-
|
|
13
|
-
function requireOptionValue(name, next) {
|
|
14
|
-
if (!next || next.startsWith("--")) {
|
|
15
|
-
return {
|
|
16
|
-
ok: false,
|
|
17
|
-
error: `nimicoding topic-runner refused: ${name} requires a value.\n`,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return { ok: true };
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function parseTopicRunnerOptions(args) {
|
|
24
|
-
const [mode, topicInput, ...rest] = args;
|
|
25
|
-
if (!["step", "run"].includes(mode) || !topicInput) {
|
|
26
|
-
return {
|
|
27
|
-
ok: false,
|
|
28
|
-
error: localize(
|
|
29
|
-
"nimicoding topic-runner refused: expected <step|run> <topic-id> --run-id <id> --adapter <codex|oh_my_codex|claude>.\n",
|
|
30
|
-
"nimicoding topic-runner 已拒绝:需要 <step|run> <topic-id> --run-id <id> --adapter <codex|oh_my_codex|claude>。\n",
|
|
31
|
-
),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const options = {
|
|
36
|
-
mode,
|
|
37
|
-
topicInput,
|
|
38
|
-
runId: null,
|
|
39
|
-
adapter: null,
|
|
40
|
-
executeHost: false,
|
|
41
|
-
threadId: null,
|
|
42
|
-
maxSteps: 20,
|
|
43
|
-
verifiedAt: null,
|
|
44
|
-
json: false,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
for (let index = 0; index < rest.length; index += 1) {
|
|
48
|
-
const arg = rest[index];
|
|
49
|
-
const next = rest[index + 1];
|
|
50
|
-
if (arg === "--json") {
|
|
51
|
-
options.json = true;
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (arg === "--execute-host") {
|
|
55
|
-
options.executeHost = true;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (arg === "--run-id") {
|
|
59
|
-
const check = requireOptionValue("--run-id", next);
|
|
60
|
-
if (!check.ok) return check;
|
|
61
|
-
options.runId = next;
|
|
62
|
-
index += 1;
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
if (arg === "--adapter") {
|
|
66
|
-
const check = requireOptionValue("--adapter", next);
|
|
67
|
-
if (!check.ok) return check;
|
|
68
|
-
options.adapter = next;
|
|
69
|
-
index += 1;
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
if (arg === "--thread-id") {
|
|
73
|
-
const check = requireOptionValue("--thread-id", next);
|
|
74
|
-
if (!check.ok) return check;
|
|
75
|
-
options.threadId = next;
|
|
76
|
-
index += 1;
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (arg === "--max-steps") {
|
|
80
|
-
const check = requireOptionValue("--max-steps", next);
|
|
81
|
-
if (!check.ok) return check;
|
|
82
|
-
options.maxSteps = Number(next);
|
|
83
|
-
index += 1;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (arg === "--verified-at") {
|
|
87
|
-
const check = requireOptionValue("--verified-at", next);
|
|
88
|
-
if (!check.ok) return check;
|
|
89
|
-
options.verifiedAt = next;
|
|
90
|
-
index += 1;
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
ok: false,
|
|
95
|
-
error: `nimicoding topic-runner refused: unknown option ${arg}.\n`,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (!options.runId || !options.adapter) {
|
|
100
|
-
return {
|
|
101
|
-
ok: false,
|
|
102
|
-
error: "nimicoding topic-runner refused: --run-id and --adapter are required.\n",
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
if (!ADAPTER_IDS.includes(options.adapter)) {
|
|
106
|
-
return {
|
|
107
|
-
ok: false,
|
|
108
|
-
error: `nimicoding topic-runner refused: --adapter must be one of ${ADAPTER_IDS.join(", ")}.\n`,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
if (!Number.isInteger(options.maxSteps) || options.maxSteps <= 0) {
|
|
112
|
-
return {
|
|
113
|
-
ok: false,
|
|
114
|
-
error: "nimicoding topic-runner refused: --max-steps must be a positive integer.\n",
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return { ok: true, options };
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function writeJson(command, payload) {
|
|
122
|
-
process.stdout.write(`${JSON.stringify({
|
|
123
|
-
contract: "nimicoding.topic-runner-result.v1",
|
|
124
|
-
command,
|
|
125
|
-
...payload,
|
|
126
|
-
}, null, 2)}\n`);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function formatRunnerResult(payload) {
|
|
130
|
-
return `${styleHeading(`nimicoding topic-runner: ${payload.topicId ?? "unknown"}`)}
|
|
131
|
-
|
|
132
|
-
${styleLabel(localize("Run", "Run"))}: ${payload.runId ?? "unknown"}
|
|
133
|
-
${styleLabel(localize("Adapter", "Adapter"))}: ${payload.adapter ?? "unknown"}
|
|
134
|
-
${styleLabel(localize("Status", "状态"))}: ${payload.runnerStatus ?? (payload.ok ? "ok" : "failed")}
|
|
135
|
-
${styleLabel(localize("Stop Class", "Stop Class"))}: ${payload.stopClass ?? "none"}
|
|
136
|
-
${styleLabel(localize("Action", "动作"))}: ${payload.recommendedAction ?? "none"}
|
|
137
|
-
${styleLabel(localize("Ledger", "Ledger"))}: ${payload.ledgerRef ?? "none"}
|
|
138
|
-
`;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export async function runTopicRunnerCommand(args) {
|
|
142
|
-
const parsed = parseTopicRunnerOptions(args);
|
|
143
|
-
if (!parsed.ok) {
|
|
144
|
-
process.stderr.write(parsed.error);
|
|
145
|
-
return 2;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const projectRoot = await resolveTopicProjectRoot(process.cwd());
|
|
149
|
-
const { options } = parsed;
|
|
150
|
-
const payload = options.mode === "step"
|
|
151
|
-
? await runTopicRunnerStep(projectRoot, options)
|
|
152
|
-
: await runTopicRunner(projectRoot, options);
|
|
153
|
-
|
|
154
|
-
if (!payload.ok) {
|
|
155
|
-
if (options.json) {
|
|
156
|
-
writeJson(`topic-runner.${options.mode}`, payload);
|
|
157
|
-
} else {
|
|
158
|
-
process.stderr.write(`${payload.error}\n`);
|
|
159
|
-
}
|
|
160
|
-
return 1;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (options.json) {
|
|
164
|
-
writeJson(`topic-runner.${options.mode}`, payload);
|
|
165
|
-
} else {
|
|
166
|
-
process.stdout.write(formatRunnerResult(payload));
|
|
167
|
-
}
|
|
168
|
-
return 0;
|
|
169
|
-
}
|