@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,15 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
3
|
import { validateSpecAudit, buildValidatorCliReport } from "../lib/validators.mjs";
|
|
4
|
-
import { loadSpecGenerationInputsConfig } from "../lib/contracts.mjs";
|
|
5
4
|
import { localize } from "../lib/ui.mjs";
|
|
6
5
|
|
|
7
6
|
export async function runValidateSpecAudit(args) {
|
|
8
7
|
const normalized = args[0] === "--" ? args.slice(1) : args;
|
|
9
|
-
|
|
10
|
-
let targetPath = generationInputs.ok && generationInputs.mode === "class_filtered"
|
|
11
|
-
? ".nimi/local/state/spec-generation/spec-generation-audit.yaml"
|
|
12
|
-
: ".nimi/spec/_meta/spec-generation-audit.yaml";
|
|
8
|
+
let targetPath = ".nimi/local/state/spec-generation/spec-generation-audit.yaml";
|
|
13
9
|
|
|
14
10
|
if (normalized.length > 1) {
|
|
15
11
|
process.stderr.write(localize(
|
package/cli/constants.mjs
CHANGED
|
@@ -1,143 +1,21 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.3.0";
|
|
2
2
|
export const PACKAGE_NAME = "@nimiplatform/nimi-coding";
|
|
3
3
|
export const BOOTSTRAP_CONTRACT_ID = "nimicoding.bootstrap";
|
|
4
|
-
export const BOOTSTRAP_CONTRACT_VERSION =
|
|
5
|
-
export const HANDOFF_PAYLOAD_CONTRACT_VERSION = "nimicoding.handoff.v1";
|
|
6
|
-
export const CLOSEOUT_PAYLOAD_CONTRACT_VERSION = "nimicoding.closeout.v1";
|
|
7
|
-
export const HIGH_RISK_INGEST_PAYLOAD_CONTRACT_VERSION = "nimicoding.high-risk-ingest.v1";
|
|
8
|
-
export const HIGH_RISK_REVIEW_PAYLOAD_CONTRACT_VERSION = "nimicoding.high-risk-review.v1";
|
|
9
|
-
export const HIGH_RISK_DECISION_PAYLOAD_CONTRACT_VERSION = "nimicoding.high-risk-decision.v1";
|
|
10
|
-
export const HIGH_RISK_ADMISSION_PAYLOAD_CONTRACT_VERSION = "nimicoding.high-risk-admission.v1";
|
|
11
|
-
export const STANDALONE_COMPLETION_PROFILE = "boundary_complete";
|
|
12
|
-
export const STANDALONE_COMPLETION_STATUS = {
|
|
13
|
-
COMPLETE: "complete",
|
|
14
|
-
DRIFTED: "drifted",
|
|
15
|
-
INCOMPLETE: "incomplete",
|
|
16
|
-
};
|
|
17
|
-
export const STANDALONE_COMPLETED_SURFACES = [
|
|
18
|
-
"bootstrap",
|
|
19
|
-
"doctor",
|
|
20
|
-
"handoff",
|
|
21
|
-
"sweep_audit",
|
|
22
|
-
"sweep_design",
|
|
23
|
-
"validators",
|
|
24
|
-
"topic_lifecycle_report_methodology",
|
|
25
|
-
"closeout",
|
|
26
|
-
"ingest",
|
|
27
|
-
"review",
|
|
28
|
-
"decision",
|
|
29
|
-
"admission",
|
|
30
|
-
"host_overlay_recognition",
|
|
31
|
-
];
|
|
32
|
-
export const STANDALONE_DEFERRED_EXECUTION_SURFACES = [
|
|
33
|
-
"packet_bound_run_kernel",
|
|
34
|
-
"provider_backed_execution",
|
|
35
|
-
"scheduler",
|
|
36
|
-
"notification",
|
|
37
|
-
"automation_backend",
|
|
38
|
-
"multi_topic_orchestration",
|
|
39
|
-
];
|
|
40
|
-
export const STANDALONE_PROMOTED_PARITY_GAP_SUMMARY = [
|
|
41
|
-
"packet_bound_run_kernel",
|
|
42
|
-
"provider_backed_execution",
|
|
43
|
-
"scheduler_automation_notification",
|
|
44
|
-
];
|
|
4
|
+
export const BOOTSTRAP_CONTRACT_VERSION = 2;
|
|
45
5
|
|
|
46
|
-
export const LOCAL_GITIGNORE_ENTRIES = [".nimi/local/", ".nimi/cache/"
|
|
6
|
+
export const LOCAL_GITIGNORE_ENTRIES = [".nimi/local/", ".nimi/cache/"];
|
|
7
|
+
export const REQUIRED_LOCAL_DIRS = [".nimi/local", ".nimi/cache"];
|
|
47
8
|
|
|
48
9
|
export const AGENTS_BEGIN = "<!-- nimicoding:managed:agents:start -->";
|
|
49
10
|
export const AGENTS_END = "<!-- nimicoding:managed:agents:end -->";
|
|
50
11
|
export const CLAUDE_BEGIN = "<!-- nimicoding:managed:claude:start -->";
|
|
51
12
|
export const CLAUDE_END = "<!-- nimicoding:managed:claude:end -->";
|
|
52
13
|
|
|
53
|
-
export const
|
|
54
|
-
export const
|
|
55
|
-
export const
|
|
56
|
-
export const
|
|
57
|
-
export const
|
|
58
|
-
export const AUDIT_CHUNK_SCHEMA_REF = ".nimi/contracts/audit-chunk.schema.yaml";
|
|
59
|
-
export const AUDIT_FINDING_SCHEMA_REF = ".nimi/contracts/audit-finding.schema.yaml";
|
|
60
|
-
export const AUDIT_LEDGER_SCHEMA_REF = ".nimi/contracts/audit-ledger.schema.yaml";
|
|
61
|
-
export const AUDIT_REMEDIATION_MAP_SCHEMA_REF = ".nimi/contracts/audit-remediation-map.schema.yaml";
|
|
62
|
-
export const AUDIT_RERUN_SCHEMA_REF = ".nimi/contracts/audit-rerun.schema.yaml";
|
|
63
|
-
export const AUDIT_CLOSEOUT_SCHEMA_REF = ".nimi/contracts/audit-closeout.schema.yaml";
|
|
64
|
-
export const HIGH_RISK_EXECUTION_RESULT_CONTRACT_REF = ".nimi/contracts/high-risk-execution-result.yaml";
|
|
65
|
-
export const HIGH_RISK_ADMISSION_CONTRACT_REF = ".nimi/contracts/high-risk-admission.schema.yaml";
|
|
66
|
-
export const EXTERNAL_HOST_COMPATIBILITY_CONTRACT_REF = ".nimi/contracts/external-host-compatibility.yaml";
|
|
67
|
-
export const HOST_ADAPTER_CONFIG_REF = ".nimi/config/host-adapter.yaml";
|
|
68
|
-
export const EXTERNAL_EXECUTION_ARTIFACTS_CONFIG_REF = ".nimi/config/external-execution-artifacts.yaml";
|
|
69
|
-
export const AUDIT_EXECUTION_ARTIFACTS_CONFIG_REF = ".nimi/config/audit-execution-artifacts.yaml";
|
|
70
|
-
export const EXECUTION_PACKET_SCHEMA_REF = ".nimi/contracts/execution-packet.schema.yaml";
|
|
71
|
-
export const ORCHESTRATION_STATE_SCHEMA_REF = ".nimi/contracts/orchestration-state.schema.yaml";
|
|
72
|
-
export const PROMPT_SCHEMA_REF = ".nimi/contracts/prompt.schema.yaml";
|
|
73
|
-
export const WORKER_OUTPUT_SCHEMA_REF = ".nimi/contracts/worker-output.schema.yaml";
|
|
74
|
-
export const ACCEPTANCE_SCHEMA_REF = ".nimi/contracts/acceptance.schema.yaml";
|
|
75
|
-
export const ADAPTER_PACKAGE_PROFILE_REFS = {
|
|
76
|
-
codex: "adapters/codex/profile.yaml",
|
|
77
|
-
oh_my_codex: "adapters/oh-my-codex/profile.yaml",
|
|
78
|
-
claude: "adapters/claude/profile.yaml",
|
|
79
|
-
};
|
|
80
|
-
export const EXTERNAL_HOST_COMPATIBILITY_REQUIRED_BEHAVIOR = [
|
|
81
|
-
"consume_handoff_json_as_authoritative_contract",
|
|
82
|
-
"treat_handoff_prompt_as_human_projection_only",
|
|
83
|
-
"read_project_local_nimi_truth",
|
|
84
|
-
"route_declared_external_skills",
|
|
85
|
-
"fail_closed_on_missing_authority",
|
|
86
|
-
];
|
|
87
|
-
export const EXTERNAL_HOST_COMPATIBILITY_SUPPORTED_POSTURE = [
|
|
88
|
-
"host_agnostic_external_host",
|
|
89
|
-
];
|
|
90
|
-
export const EXTERNAL_HOST_COMPATIBILITY_FORBIDDEN_BEHAVIOR = [
|
|
91
|
-
"assume_packaged_run_kernel",
|
|
92
|
-
"assume_provider_or_scheduler_ownership",
|
|
93
|
-
"promote_runtime_state_to_semantic_truth",
|
|
94
|
-
"redefine_acceptance_disposition_or_finding_judgment",
|
|
95
|
-
];
|
|
96
|
-
export const EXTERNAL_HOST_COMPATIBILITY_SUPPORTED_HOST_EXAMPLES = [
|
|
97
|
-
"oh_my_codex",
|
|
98
|
-
"codex",
|
|
99
|
-
"claude",
|
|
100
|
-
"gemini",
|
|
101
|
-
];
|
|
102
|
-
|
|
103
|
-
export const HIGH_RISK_ADMISSION_REQUIRED_TOP_LEVEL_KEYS = [
|
|
104
|
-
"admissions",
|
|
105
|
-
"admission_rules",
|
|
106
|
-
"semantic_constraints",
|
|
107
|
-
];
|
|
108
|
-
|
|
109
|
-
export const HIGH_RISK_ADMISSION_RECORD_REQUIRED_FIELDS = [
|
|
110
|
-
"topic_id",
|
|
111
|
-
"packet_id",
|
|
112
|
-
"disposition",
|
|
113
|
-
"admitted_at",
|
|
114
|
-
"manager_review_owner",
|
|
115
|
-
"summary",
|
|
116
|
-
"source_decision_contract",
|
|
117
|
-
];
|
|
118
|
-
|
|
119
|
-
export const HIGH_RISK_ADMISSION_DISPOSITION_ENUM = [
|
|
120
|
-
"complete",
|
|
121
|
-
"partial",
|
|
122
|
-
"deferred",
|
|
123
|
-
];
|
|
124
|
-
|
|
125
|
-
export const SPEC_RECONSTRUCTION_SUMMARY_REQUIRED_FIELDS = [
|
|
126
|
-
"generated_paths",
|
|
127
|
-
"audit_ref",
|
|
128
|
-
"coverage_summary",
|
|
129
|
-
"unresolved_file_count",
|
|
130
|
-
"inferred_file_count",
|
|
131
|
-
"status",
|
|
132
|
-
"summary",
|
|
133
|
-
"verified_at",
|
|
134
|
-
];
|
|
135
|
-
|
|
136
|
-
export const SPEC_RECONSTRUCTION_SUMMARY_STATUS = [
|
|
137
|
-
"reconstructed",
|
|
138
|
-
"partial",
|
|
139
|
-
"blocked",
|
|
140
|
-
];
|
|
14
|
+
export const SPEC_GENERATION_AUDIT_REF = ".nimi/local/state/spec-generation/spec-generation-audit.yaml";
|
|
15
|
+
export const SPEC_GENERATION_AUDIT_CONTRACT_REF = ".nimi/contracts/spec-generation-audit.schema.yaml";
|
|
16
|
+
export const SPEC_GENERATION_INPUTS_REF = ".nimi/config/spec-generation-inputs.yaml";
|
|
17
|
+
export const SPEC_GENERATION_INPUTS_CONTRACT_REF = ".nimi/contracts/spec-generation-inputs.schema.yaml";
|
|
18
|
+
export const BLUEPRINT_REFERENCE_REF = ".nimi/local/state/spec-generation/blueprint-reference.yaml";
|
|
141
19
|
|
|
142
20
|
export const SPEC_GENERATION_AUDIT_REQUIRED_TOP_LEVEL_FIELDS = [
|
|
143
21
|
"generation_mode",
|
|
@@ -146,16 +24,6 @@ export const SPEC_GENERATION_AUDIT_REQUIRED_TOP_LEVEL_FIELDS = [
|
|
|
146
24
|
"input_roots",
|
|
147
25
|
"files",
|
|
148
26
|
];
|
|
149
|
-
|
|
150
|
-
export const SPEC_GENERATION_AUDIT_FILE_REQUIRED_FIELDS = [
|
|
151
|
-
"canonical_path",
|
|
152
|
-
"file_class",
|
|
153
|
-
"source_refs",
|
|
154
|
-
"source_basis",
|
|
155
|
-
"coverage_status",
|
|
156
|
-
"unresolved_items",
|
|
157
|
-
];
|
|
158
|
-
|
|
159
27
|
export const SPEC_GENERATION_AUDIT_SOURCE_BASIS_ENUM = [
|
|
160
28
|
"grounded",
|
|
161
29
|
"mixed_grounded_and_inferred",
|
|
@@ -167,279 +35,3 @@ export const SPEC_GENERATION_AUDIT_COVERAGE_STATUS_ENUM = [
|
|
|
167
35
|
"partial",
|
|
168
36
|
"placeholder_not_allowed",
|
|
169
37
|
];
|
|
170
|
-
|
|
171
|
-
export const DOC_SPEC_AUDIT_SUMMARY_REQUIRED_FIELDS = [
|
|
172
|
-
"compared_paths",
|
|
173
|
-
"finding_count",
|
|
174
|
-
"status",
|
|
175
|
-
"summary",
|
|
176
|
-
"verified_at",
|
|
177
|
-
];
|
|
178
|
-
|
|
179
|
-
export const DOC_SPEC_AUDIT_SUMMARY_STATUS = [
|
|
180
|
-
"aligned",
|
|
181
|
-
"drift_detected",
|
|
182
|
-
"blocked",
|
|
183
|
-
];
|
|
184
|
-
|
|
185
|
-
export const AUDIT_SWEEP_SUMMARY_REQUIRED_FIELDS = [
|
|
186
|
-
"plan_ref",
|
|
187
|
-
"chunk_refs",
|
|
188
|
-
"ledger_ref",
|
|
189
|
-
"report_ref",
|
|
190
|
-
"remediation_map_ref",
|
|
191
|
-
"audit_closeout_ref",
|
|
192
|
-
"evidence_refs",
|
|
193
|
-
"finding_count",
|
|
194
|
-
"unresolved_finding_count",
|
|
195
|
-
"status",
|
|
196
|
-
"coverage_scope",
|
|
197
|
-
"coverage_quality",
|
|
198
|
-
"audit_validity",
|
|
199
|
-
"summary",
|
|
200
|
-
"verified_at",
|
|
201
|
-
];
|
|
202
|
-
|
|
203
|
-
export const AUDIT_SWEEP_SUMMARY_STATUS = [
|
|
204
|
-
"candidate_ready",
|
|
205
|
-
"partial",
|
|
206
|
-
"partial_authority_only",
|
|
207
|
-
"blocked_evidence_incomplete",
|
|
208
|
-
"blocked",
|
|
209
|
-
];
|
|
210
|
-
|
|
211
|
-
export const HIGH_RISK_EXECUTION_SUMMARY_REQUIRED_FIELDS = [
|
|
212
|
-
"packet_ref",
|
|
213
|
-
"orchestration_state_ref",
|
|
214
|
-
"prompt_ref",
|
|
215
|
-
"worker_output_ref",
|
|
216
|
-
"evidence_refs",
|
|
217
|
-
"status",
|
|
218
|
-
"summary",
|
|
219
|
-
"verified_at",
|
|
220
|
-
];
|
|
221
|
-
|
|
222
|
-
export const HIGH_RISK_EXECUTION_SUMMARY_STATUS = [
|
|
223
|
-
"candidate_ready",
|
|
224
|
-
"blocked",
|
|
225
|
-
"failed",
|
|
226
|
-
];
|
|
227
|
-
|
|
228
|
-
export const HIGH_RISK_EXECUTION_ARTIFACT_ROOTS = {
|
|
229
|
-
packet_ref: ".nimi/local/packets",
|
|
230
|
-
orchestration_state_ref: ".nimi/local/orchestration",
|
|
231
|
-
prompt_ref: ".nimi/local/prompts",
|
|
232
|
-
worker_output_ref: ".nimi/local/outputs",
|
|
233
|
-
evidence_refs: ".nimi/local/evidence",
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export const AUDIT_SWEEP_ARTIFACT_ROOTS = {
|
|
237
|
-
plan_ref: ".nimi/local/audit/plans",
|
|
238
|
-
chunk_refs: ".nimi/local/audit/chunks",
|
|
239
|
-
ledger_ref: ".nimi/local/audit/ledgers",
|
|
240
|
-
report_ref: ".nimi/local/audit/reports",
|
|
241
|
-
remediation_map_ref: ".nimi/local/audit/remediation-maps",
|
|
242
|
-
audit_closeout_ref: ".nimi/local/audit/closeouts",
|
|
243
|
-
packet_ref: ".nimi/local/audit/packets",
|
|
244
|
-
evidence_refs: ".nimi/local/audit/evidence",
|
|
245
|
-
run_ledger_ref: ".nimi/local/audit/runs",
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export const HIGH_RISK_EXECUTION_ARTIFACT_HARD_CONSTRAINTS = [
|
|
249
|
-
"external_execution_artifacts_remain_operational_only",
|
|
250
|
-
"imported_refs_must_stay_under_declared_local_roots",
|
|
251
|
-
"candidate_artifacts_must_not_override_semantic_truth",
|
|
252
|
-
];
|
|
253
|
-
|
|
254
|
-
export const AUDIT_SWEEP_ARTIFACT_HARD_CONSTRAINTS = [
|
|
255
|
-
"audit_execution_artifacts_remain_operational_only",
|
|
256
|
-
"imported_refs_must_stay_under_declared_local_roots",
|
|
257
|
-
"candidate_artifacts_must_not_override_semantic_truth",
|
|
258
|
-
];
|
|
259
|
-
|
|
260
|
-
export const DOC_SPEC_AUDIT_DEFAULT_COMPARED_PATHS = [
|
|
261
|
-
"README.md",
|
|
262
|
-
".nimi/spec",
|
|
263
|
-
];
|
|
264
|
-
|
|
265
|
-
export const SPEC_TREE_MODEL_REF = ".nimi/spec/_meta/spec-tree-model.yaml";
|
|
266
|
-
export const BLUEPRINT_REFERENCE_REF = ".nimi/local/state/spec-generation/blueprint-reference.yaml";
|
|
267
|
-
export const COMMAND_GATING_MATRIX_REF = ".nimi/spec/_meta/command-gating-matrix.yaml";
|
|
268
|
-
export const GENERATE_DRIFT_MIGRATION_CHECKLIST_REF = ".nimi/spec/_meta/generate-drift-migration-checklist.yaml";
|
|
269
|
-
export const GOVERNANCE_ROUTING_CUTOVER_CHECKLIST_REF = ".nimi/spec/_meta/governance-routing-cutover-checklist.yaml";
|
|
270
|
-
export const PHASE2_IMPACTED_SURFACE_MATRIX_REF = ".nimi/spec/_meta/phase2-impacted-surface-matrix.yaml";
|
|
271
|
-
export const SPEC_GENERATION_AUDIT_REF = ".nimi/spec/_meta/spec-generation-audit.yaml";
|
|
272
|
-
export const SPEC_GENERATION_INPUTS_REF = ".nimi/config/spec-generation-inputs.yaml";
|
|
273
|
-
export const SPEC_GENERATION_INPUTS_CONTRACT_REF = ".nimi/contracts/spec-generation-inputs.schema.yaml";
|
|
274
|
-
export const SPEC_GENERATION_AUDIT_CONTRACT_REF = ".nimi/contracts/spec-generation-audit.schema.yaml";
|
|
275
|
-
|
|
276
|
-
export const SKILL_RESULT_CONTRACT_REFS = {
|
|
277
|
-
spec_reconstruction: SPEC_RECONSTRUCTION_RESULT_CONTRACT_REF,
|
|
278
|
-
doc_spec_audit: DOC_SPEC_AUDIT_RESULT_CONTRACT_REF,
|
|
279
|
-
audit_sweep: AUDIT_SWEEP_RESULT_CONTRACT_REF,
|
|
280
|
-
high_risk_execution: HIGH_RISK_EXECUTION_RESULT_CONTRACT_REF,
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
export const REQUIRED_LOCAL_DIRS = [".nimi/local", ".nimi/cache"];
|
|
284
|
-
|
|
285
|
-
export const REQUIRED_BOOTSTRAP_DIRS = [
|
|
286
|
-
".nimi/methodology",
|
|
287
|
-
".nimi/spec",
|
|
288
|
-
".nimi/config",
|
|
289
|
-
".nimi/contracts",
|
|
290
|
-
".nimi/local",
|
|
291
|
-
".nimi/cache",
|
|
292
|
-
];
|
|
293
|
-
|
|
294
|
-
export const HIGH_RISK_SCHEMA_SPECS = {
|
|
295
|
-
[EXECUTION_PACKET_SCHEMA_REF]: {
|
|
296
|
-
id: "nimi-coding.execution-packet.v1",
|
|
297
|
-
kind: "execution-packet",
|
|
298
|
-
listFields: {
|
|
299
|
-
required: [
|
|
300
|
-
"packet_id",
|
|
301
|
-
"topic_id",
|
|
302
|
-
"status",
|
|
303
|
-
"owner",
|
|
304
|
-
"created_at",
|
|
305
|
-
"updated_at",
|
|
306
|
-
"baseline_ref",
|
|
307
|
-
"entry_phase_id",
|
|
308
|
-
"phases",
|
|
309
|
-
"escalation_policy",
|
|
310
|
-
"notification_settings",
|
|
311
|
-
"resume_policy",
|
|
312
|
-
],
|
|
313
|
-
status_enum: ["draft", "frozen", "superseded", "archived"],
|
|
314
|
-
phase_required: [
|
|
315
|
-
"phase_id",
|
|
316
|
-
"goal",
|
|
317
|
-
"authority_refs",
|
|
318
|
-
"write_scope",
|
|
319
|
-
"read_scope",
|
|
320
|
-
"required_checks",
|
|
321
|
-
"completion_criteria",
|
|
322
|
-
"escalation_conditions",
|
|
323
|
-
"next_on_success",
|
|
324
|
-
"stop_on_failure",
|
|
325
|
-
],
|
|
326
|
-
phase_stop_on_failure_enum: ["pause", "stop"],
|
|
327
|
-
escalation_policy_required: ["pause_conditions", "manager_decision_required"],
|
|
328
|
-
notification_settings_required: ["on_block", "on_final_completion", "on_progress"],
|
|
329
|
-
resume_policy_required: ["same_revision_resume_allowed_reasons", "new_packet_required_on"],
|
|
330
|
-
},
|
|
331
|
-
requiredRules: [
|
|
332
|
-
"baseline_ref must resolve to a baseline artifact",
|
|
333
|
-
"entry_phase_id must exist in phases[].phase_id",
|
|
334
|
-
"next_on_success must be null or an existing phase_id",
|
|
335
|
-
"packet must not encode transport secrets, runtime state, or semantic acceptance outcomes",
|
|
336
|
-
],
|
|
337
|
-
},
|
|
338
|
-
[ORCHESTRATION_STATE_SCHEMA_REF]: {
|
|
339
|
-
id: "nimi-coding.orchestration-state.v1",
|
|
340
|
-
kind: "orchestration-state",
|
|
341
|
-
listFields: {
|
|
342
|
-
required: [
|
|
343
|
-
"state_id",
|
|
344
|
-
"topic_id",
|
|
345
|
-
"packet_ref",
|
|
346
|
-
"run_status",
|
|
347
|
-
"current_phase_id",
|
|
348
|
-
"last_completed_phase_id",
|
|
349
|
-
"awaiting_human_action",
|
|
350
|
-
"updated_at",
|
|
351
|
-
"owner",
|
|
352
|
-
],
|
|
353
|
-
optional: [
|
|
354
|
-
"pause_reason",
|
|
355
|
-
"notification_refs",
|
|
356
|
-
"current_prompt_ref",
|
|
357
|
-
"latest_worker_output_ref",
|
|
358
|
-
"latest_acceptance_ref",
|
|
359
|
-
"latest_evidence_refs",
|
|
360
|
-
"started_at",
|
|
361
|
-
],
|
|
362
|
-
run_status_enum: [
|
|
363
|
-
"running",
|
|
364
|
-
"paused",
|
|
365
|
-
"awaiting_confirmation",
|
|
366
|
-
"completed",
|
|
367
|
-
"failed",
|
|
368
|
-
"superseded",
|
|
369
|
-
],
|
|
370
|
-
notification_ref_required: ["event", "correlation_id"],
|
|
371
|
-
},
|
|
372
|
-
requiredRules: [
|
|
373
|
-
"packet_ref must resolve to an execution packet artifact",
|
|
374
|
-
"current_phase_id and last_completed_phase_id must be null or existing packet phase ids",
|
|
375
|
-
"running state requires current_phase_id",
|
|
376
|
-
"paused state requires current_phase_id, pause_reason, and awaiting_human_action",
|
|
377
|
-
"awaiting_confirmation state requires current_phase_id and awaiting_human_action and is legacy-only for older runs",
|
|
378
|
-
"failed state requires awaiting_human_action",
|
|
379
|
-
"completed state requires last_completed_phase_id and must not carry current_phase_id, awaiting_human_action, or pause_reason",
|
|
380
|
-
"resume_token and transport secrets are forbidden",
|
|
381
|
-
"notification_refs entries may track event/correlation emission refs, but they must not become notification log state ownership",
|
|
382
|
-
"orchestration state must not encode semantic acceptance or finding judgments",
|
|
383
|
-
],
|
|
384
|
-
},
|
|
385
|
-
[PROMPT_SCHEMA_REF]: {
|
|
386
|
-
id: "nimi-coding.prompt.v1",
|
|
387
|
-
kind: "prompt",
|
|
388
|
-
listFields: {
|
|
389
|
-
required_blocks: [
|
|
390
|
-
"Task Goal",
|
|
391
|
-
"Authority Reads",
|
|
392
|
-
"Confirmed State",
|
|
393
|
-
"Hard Constraints",
|
|
394
|
-
"Must Complete",
|
|
395
|
-
"Explicit Non-Goals",
|
|
396
|
-
"Required Checks",
|
|
397
|
-
"Required Final Output Format",
|
|
398
|
-
"Blocker Escalation Rule",
|
|
399
|
-
],
|
|
400
|
-
},
|
|
401
|
-
requiredRules: [],
|
|
402
|
-
},
|
|
403
|
-
[WORKER_OUTPUT_SCHEMA_REF]: {
|
|
404
|
-
id: "nimi-coding.worker-output.v1",
|
|
405
|
-
kind: "worker-output",
|
|
406
|
-
listFields: {
|
|
407
|
-
required_blocks: [
|
|
408
|
-
"Findings",
|
|
409
|
-
"Implementation summary",
|
|
410
|
-
"Files changed",
|
|
411
|
-
"Checks run",
|
|
412
|
-
"Remaining gaps / risks",
|
|
413
|
-
"Runner Signal",
|
|
414
|
-
],
|
|
415
|
-
optional_blocks: [
|
|
416
|
-
"Chosen decision",
|
|
417
|
-
"Authority / spec impact",
|
|
418
|
-
"Guard behavior decision",
|
|
419
|
-
"Next implementation step",
|
|
420
|
-
"Remaining blockers",
|
|
421
|
-
],
|
|
422
|
-
},
|
|
423
|
-
requiredRules: [],
|
|
424
|
-
},
|
|
425
|
-
[ACCEPTANCE_SCHEMA_REF]: {
|
|
426
|
-
id: "nimi-coding.acceptance.v1",
|
|
427
|
-
kind: "acceptance",
|
|
428
|
-
listFields: {
|
|
429
|
-
required_order: [
|
|
430
|
-
"authority alignment",
|
|
431
|
-
"phase closure",
|
|
432
|
-
"evidence sufficiency",
|
|
433
|
-
"disposition",
|
|
434
|
-
"next step or reopen",
|
|
435
|
-
],
|
|
436
|
-
disposition_enum: ["complete", "partial", "deferred"],
|
|
437
|
-
required_blocks: [
|
|
438
|
-
"Findings",
|
|
439
|
-
"Current Phase Disposition",
|
|
440
|
-
"Next Step or Reopen Condition",
|
|
441
|
-
],
|
|
442
|
-
},
|
|
443
|
-
requiredRules: [],
|
|
444
|
-
},
|
|
445
|
-
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
6
|
+
const cliPath = path.join(repoRoot, "bin", "nimicoding.mjs");
|
|
7
|
+
|
|
8
|
+
for (const args of [["--help"], ["--version"]]) {
|
|
9
|
+
const result = spawnSync(process.execPath, [cliPath, ...args], {
|
|
10
|
+
cwd: repoRoot,
|
|
11
|
+
encoding: "utf8",
|
|
12
|
+
env: { ...process.env, NIMICODING_LANG: "en", NO_COLOR: "1" },
|
|
13
|
+
});
|
|
14
|
+
if (result.error) {
|
|
15
|
+
process.stderr.write(`${args.join(" ")} smoke failed: ${result.error.message}\n`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
if (result.status !== 0) {
|
|
19
|
+
if (result.stdout) process.stdout.write(result.stdout);
|
|
20
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
21
|
+
process.stderr.write(`${args.join(" ")} smoke exited with ${result.status ?? "unknown"}\n`);
|
|
22
|
+
process.exit(result.status ?? 1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
6
|
+
const result = spawnSync(process.execPath, ["--test"], {
|
|
7
|
+
cwd: repoRoot,
|
|
8
|
+
stdio: "inherit",
|
|
9
|
+
env: { ...process.env, NIMICODING_LANG: "en", NO_COLOR: "1" },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
if (result.error) {
|
|
13
|
+
process.stderr.write(`node --test failed: ${result.error.message}\n`);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
process.exit(result.status ?? 1);
|