@nimiplatform/nimi-coding 0.2.8 → 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 -92
- 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/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 +2 -4
- 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 -658
- 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 -527
- 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 -720
- 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 -533
- 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
package/cli/lib/topic-common.mjs
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { loadTopicRuntimeContracts } from "./contracts.mjs";
|
|
3
|
-
|
|
4
|
-
export const TOPIC_ROOT = path.join(".nimi", "topics"),
|
|
5
|
-
TOPIC_ID_PATTERN = /^\d{4}-\d{2}-\d{2}-[a-z0-9]+(?:-[a-z0-9]+)*$/,
|
|
6
|
-
TOPIC_SLUG_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/,
|
|
7
|
-
WAVE_ID_PATTERN = /^wave-[a-z0-9]+(?:-[a-z0-9]+)*$/,
|
|
8
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY = {
|
|
9
|
-
topicStates: ["proposal", "ongoing", "pending", "closed"],
|
|
10
|
-
minimalRequiredFields: [
|
|
11
|
-
"topic_id",
|
|
12
|
-
"state",
|
|
13
|
-
"created_at",
|
|
14
|
-
"last_transition_at",
|
|
15
|
-
"last_transition_reason",
|
|
16
|
-
],
|
|
17
|
-
enrichedRequiredFields: [
|
|
18
|
-
"title",
|
|
19
|
-
"mode",
|
|
20
|
-
"posture",
|
|
21
|
-
"design_policy",
|
|
22
|
-
"parallel_truth",
|
|
23
|
-
"layering",
|
|
24
|
-
"risk",
|
|
25
|
-
"applicability",
|
|
26
|
-
"entry_justification",
|
|
27
|
-
"execution_mode",
|
|
28
|
-
"selected_next_target",
|
|
29
|
-
"current_true_close_status",
|
|
30
|
-
"forbidden_shortcuts",
|
|
31
|
-
],
|
|
32
|
-
topicEnums: {
|
|
33
|
-
mode: ["greenfield", "landed", "superseding"],
|
|
34
|
-
posture: ["no_legacy_hard_cut", "backward_compat"],
|
|
35
|
-
designPolicy: ["complete_contract_first", "mvp_incremental"],
|
|
36
|
-
parallelTruth: ["forbidden", "admitted"],
|
|
37
|
-
layering: ["ontology", "time_phased"],
|
|
38
|
-
risk: ["high", "low"],
|
|
39
|
-
applicability: [
|
|
40
|
-
"authority_bearing",
|
|
41
|
-
"high_risk_refactor",
|
|
42
|
-
"multi_wave_iteration",
|
|
43
|
-
"complex_remediation",
|
|
44
|
-
],
|
|
45
|
-
executionMode: ["inline_manager_worker", "manager_worker_auditor"],
|
|
46
|
-
trueCloseStatus: ["not_started", "pending", "true_closed", "revoked", "superseded"],
|
|
47
|
-
},
|
|
48
|
-
waveStates: [
|
|
49
|
-
"candidate",
|
|
50
|
-
"preflight_draft",
|
|
51
|
-
"preflight_admitted",
|
|
52
|
-
"implementation_admitted",
|
|
53
|
-
"implementation_active",
|
|
54
|
-
"needs_revision",
|
|
55
|
-
"overflowed",
|
|
56
|
-
"continuation_packet_open",
|
|
57
|
-
"closed",
|
|
58
|
-
"retired",
|
|
59
|
-
"superseded",
|
|
60
|
-
],
|
|
61
|
-
packetRequiredFields: [
|
|
62
|
-
"packet_id",
|
|
63
|
-
"topic_id",
|
|
64
|
-
"wave_id",
|
|
65
|
-
"packet_kind",
|
|
66
|
-
"status",
|
|
67
|
-
"authority_owner",
|
|
68
|
-
"canonical_seams",
|
|
69
|
-
"forbidden_shortcuts",
|
|
70
|
-
"acceptance_invariants",
|
|
71
|
-
"negative_tests",
|
|
72
|
-
"reopen_conditions",
|
|
73
|
-
],
|
|
74
|
-
packetFreezeAllowedStatuses: ["draft", "preflight", "candidate"],
|
|
75
|
-
resultVerdicts: ["PASS", "NEEDS_REVISION", "FAIL", "OVERFLOW"],
|
|
76
|
-
resultKinds: ["preflight", "implementation", "audit", "judgement"],
|
|
77
|
-
resultVerifiedAtFormat: "iso8601_utc_timestamp",
|
|
78
|
-
closeoutScopes: ["wave", "topic"],
|
|
79
|
-
closureStates: ["open", "closed", "blocked"],
|
|
80
|
-
closeoutDispositions: ["complete", "partial", "deferred"],
|
|
81
|
-
remediationKinds: ["a", "b", "continuation", "execution_state_closure"],
|
|
82
|
-
decisionDispositions: ["retired", "superseded", "unchanged"],
|
|
83
|
-
pendingNoteRequiredFields: [
|
|
84
|
-
"pending_note_id",
|
|
85
|
-
"topic_id",
|
|
86
|
-
"entered_from_state",
|
|
87
|
-
"reason",
|
|
88
|
-
"summary",
|
|
89
|
-
"status",
|
|
90
|
-
],
|
|
91
|
-
pendingNoteStatuses: ["active", "resumed", "closed"],
|
|
92
|
-
defaultForbiddenShortcuts: [
|
|
93
|
-
"mvp_subset_contract",
|
|
94
|
-
"legacy_alias",
|
|
95
|
-
"compat_shim",
|
|
96
|
-
"dual_read",
|
|
97
|
-
"dual_write",
|
|
98
|
-
"placeholder_success",
|
|
99
|
-
"happy_path_only_closure",
|
|
100
|
-
"time_phased_layering",
|
|
101
|
-
"app_local_shadow_truth",
|
|
102
|
-
"silent_owner_cut_reopen",
|
|
103
|
-
],
|
|
104
|
-
recommendedFiles: [
|
|
105
|
-
"README.md",
|
|
106
|
-
"design.md",
|
|
107
|
-
"preflight.md",
|
|
108
|
-
"waves.md",
|
|
109
|
-
"candidate-wave-plan.md",
|
|
110
|
-
"implementation-doctrine.md",
|
|
111
|
-
"admission-checklists.md",
|
|
112
|
-
"manager-session-protocol.md",
|
|
113
|
-
"manager-prompts.md",
|
|
114
|
-
],
|
|
115
|
-
closureDimensions: ["authority", "semantic", "consumer", "drift_resistance"],
|
|
116
|
-
waveCloseoutEvidence: { requirePacketLineage: true, requireResultLineage: true },
|
|
117
|
-
trueCloseAuditEvidence: {
|
|
118
|
-
requireWaveCloseoutForClosedWaves: true,
|
|
119
|
-
requirePacketLineageForClosedWaves: true,
|
|
120
|
-
requireResultLineageForClosedWaves: true,
|
|
121
|
-
},
|
|
122
|
-
topicStepDecision: {
|
|
123
|
-
stopClasses: [
|
|
124
|
-
"continue",
|
|
125
|
-
"require_human_confirmation",
|
|
126
|
-
"await_external_evidence",
|
|
127
|
-
"blocked",
|
|
128
|
-
"completed",
|
|
129
|
-
],
|
|
130
|
-
recommendedActions: [
|
|
131
|
-
"admit_wave",
|
|
132
|
-
"freeze_packet",
|
|
133
|
-
"dispatch_worker",
|
|
134
|
-
"dispatch_audit",
|
|
135
|
-
"record_result",
|
|
136
|
-
"open_remediation",
|
|
137
|
-
"continue_overflow",
|
|
138
|
-
"hold_topic",
|
|
139
|
-
"resume_topic",
|
|
140
|
-
"closeout_wave",
|
|
141
|
-
"closeout_topic",
|
|
142
|
-
"no_action",
|
|
143
|
-
],
|
|
144
|
-
},
|
|
145
|
-
topicRunLedger: {
|
|
146
|
-
eventKinds: [
|
|
147
|
-
"decision_emitted",
|
|
148
|
-
"wave_admitted",
|
|
149
|
-
"packet_frozen",
|
|
150
|
-
"worker_dispatched",
|
|
151
|
-
"audit_dispatched",
|
|
152
|
-
"result_recorded",
|
|
153
|
-
"human_gate_opened",
|
|
154
|
-
"human_gate_resolved",
|
|
155
|
-
"wave_closed",
|
|
156
|
-
"topic_closed",
|
|
157
|
-
"runner_blocked",
|
|
158
|
-
],
|
|
159
|
-
runStatuses: [
|
|
160
|
-
"running",
|
|
161
|
-
"awaiting_human_confirmation",
|
|
162
|
-
"awaiting_external_evidence",
|
|
163
|
-
"blocked",
|
|
164
|
-
"completed",
|
|
165
|
-
],
|
|
166
|
-
artifactRefKeys: [
|
|
167
|
-
"decision_ref",
|
|
168
|
-
"packet_ref",
|
|
169
|
-
"prompt_ref",
|
|
170
|
-
"worker_output_ref",
|
|
171
|
-
"audit_output_ref",
|
|
172
|
-
"result_ref",
|
|
173
|
-
"closeout_ref",
|
|
174
|
-
"evidence_ref",
|
|
175
|
-
],
|
|
176
|
-
retryPostures: [
|
|
177
|
-
"not_applicable",
|
|
178
|
-
"retry_allowed_same_command",
|
|
179
|
-
"retry_requires_new_packet",
|
|
180
|
-
"retry_forbidden_until_human_gate",
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
ignoredTopicValidateSemantics: { status: "report_only", canonicalSuccess: false },
|
|
184
|
-
},
|
|
185
|
-
topicRuntimeAuthorityCache = new Map(),
|
|
186
|
-
PENDING_ENTRY_BLOCKER_STATES = new Set([
|
|
187
|
-
"preflight_admitted",
|
|
188
|
-
"implementation_admitted",
|
|
189
|
-
"implementation_active",
|
|
190
|
-
"needs_revision",
|
|
191
|
-
"overflowed",
|
|
192
|
-
"continuation_packet_open",
|
|
193
|
-
]);
|
|
194
|
-
export function formatDate(date = new Date()) {
|
|
195
|
-
const year = date.getFullYear(),
|
|
196
|
-
month = String(date.getMonth() + 1).padStart(2, "0"),
|
|
197
|
-
day = String(date.getDate()).padStart(2, "0");
|
|
198
|
-
return `${year}-${month}-${day}`;
|
|
199
|
-
}
|
|
200
|
-
export function toPortableRelativePath(filePath) {
|
|
201
|
-
return filePath.split(path.sep).join("/");
|
|
202
|
-
}
|
|
203
|
-
export function toStringArray(value, fallback) {
|
|
204
|
-
if (!Array.isArray(value)) return fallback;
|
|
205
|
-
const normalized = value
|
|
206
|
-
.filter((entry) => typeof entry == "string" && entry.length > 0)
|
|
207
|
-
.map((entry) => String(entry));
|
|
208
|
-
return normalized.length > 0 ? normalized : fallback;
|
|
209
|
-
}
|
|
210
|
-
export function normalizeBoolean(value, fallback) {
|
|
211
|
-
return typeof value == "boolean" ? value : fallback;
|
|
212
|
-
}
|
|
213
|
-
export async function loadTopicRuntimeAuthority(projectRoot) {
|
|
214
|
-
const cached = topicRuntimeAuthorityCache.get(projectRoot);
|
|
215
|
-
if (cached) return cached;
|
|
216
|
-
const loaded = await loadTopicRuntimeContracts(projectRoot),
|
|
217
|
-
topicSchema = loaded.topicSchema.data ?? {},
|
|
218
|
-
waveSchema = loaded.waveSchema.data ?? {},
|
|
219
|
-
packetSchema = loaded.packetSchema.data ?? {},
|
|
220
|
-
resultSchema = loaded.resultSchema.data ?? {},
|
|
221
|
-
closeoutSchema = loaded.closeoutSchema.data ?? {},
|
|
222
|
-
remediationSchema = loaded.remediationSchema.data ?? {},
|
|
223
|
-
decisionReviewSchema = loaded.decisionReviewSchema.data ?? {},
|
|
224
|
-
pendingNoteSchema = loaded.pendingNoteSchema.data ?? {},
|
|
225
|
-
topicStepDecisionSchema = loaded.topicStepDecisionSchema.data ?? {},
|
|
226
|
-
topicRunLedgerSchema = loaded.topicRunLedgerSchema.data ?? {},
|
|
227
|
-
forbiddenShortcutsCatalog = loaded.forbiddenShortcutsCatalog.data ?? {},
|
|
228
|
-
lifecycleReport = loaded.lifecycleReport.data?.topic_lifecycle_report ?? {},
|
|
229
|
-
fourClosurePolicy = loaded.fourClosurePolicy.data?.four_closure_policy ?? {},
|
|
230
|
-
validationPolicy = loaded.validationPolicy.data?.topic_validation_policy ?? {},
|
|
231
|
-
minimalRequiredFields = toStringArray(
|
|
232
|
-
lifecycleReport.state_evidence?.required_fields,
|
|
233
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.minimalRequiredFields,
|
|
234
|
-
),
|
|
235
|
-
enrichedRequiredFields = toStringArray(
|
|
236
|
-
topicSchema.required,
|
|
237
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.enrichedRequiredFields,
|
|
238
|
-
).filter((field) => !minimalRequiredFields.includes(field)),
|
|
239
|
-
authority = {
|
|
240
|
-
topicStates: toStringArray(
|
|
241
|
-
topicSchema.state_enum,
|
|
242
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicStates,
|
|
243
|
-
),
|
|
244
|
-
minimalRequiredFields,
|
|
245
|
-
enrichedRequiredFields,
|
|
246
|
-
topicEnums: {
|
|
247
|
-
mode: toStringArray(topicSchema.mode_enum, DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.mode),
|
|
248
|
-
posture: toStringArray(
|
|
249
|
-
topicSchema.posture_enum,
|
|
250
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.posture,
|
|
251
|
-
),
|
|
252
|
-
designPolicy: toStringArray(
|
|
253
|
-
topicSchema.design_policy_enum,
|
|
254
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.designPolicy,
|
|
255
|
-
),
|
|
256
|
-
parallelTruth: toStringArray(
|
|
257
|
-
topicSchema.parallel_truth_enum,
|
|
258
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.parallelTruth,
|
|
259
|
-
),
|
|
260
|
-
layering: toStringArray(
|
|
261
|
-
topicSchema.layering_enum,
|
|
262
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.layering,
|
|
263
|
-
),
|
|
264
|
-
risk: toStringArray(topicSchema.risk_enum, DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.risk),
|
|
265
|
-
applicability: toStringArray(
|
|
266
|
-
topicSchema.applicability_enum,
|
|
267
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.applicability,
|
|
268
|
-
),
|
|
269
|
-
executionMode: toStringArray(
|
|
270
|
-
topicSchema.execution_mode_enum,
|
|
271
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.executionMode,
|
|
272
|
-
),
|
|
273
|
-
trueCloseStatus: toStringArray(
|
|
274
|
-
topicSchema.true_close_status_enum,
|
|
275
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicEnums.trueCloseStatus,
|
|
276
|
-
),
|
|
277
|
-
},
|
|
278
|
-
waveStates: toStringArray(waveSchema.state_enum, DEFAULT_TOPIC_RUNTIME_AUTHORITY.waveStates),
|
|
279
|
-
packetRequiredFields: toStringArray(
|
|
280
|
-
packetSchema.required,
|
|
281
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.packetRequiredFields,
|
|
282
|
-
),
|
|
283
|
-
packetFreezeAllowedStatuses: toStringArray(
|
|
284
|
-
packetSchema.freeze_allowed_status_enum,
|
|
285
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.packetFreezeAllowedStatuses,
|
|
286
|
-
),
|
|
287
|
-
resultVerdicts: toStringArray(
|
|
288
|
-
resultSchema.verdict_enum,
|
|
289
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.resultVerdicts,
|
|
290
|
-
),
|
|
291
|
-
resultKinds: toStringArray(
|
|
292
|
-
resultSchema.result_kind_enum,
|
|
293
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.resultKinds,
|
|
294
|
-
),
|
|
295
|
-
resultVerifiedAtFormat:
|
|
296
|
-
typeof resultSchema.verified_at_format == "string"
|
|
297
|
-
? resultSchema.verified_at_format
|
|
298
|
-
: DEFAULT_TOPIC_RUNTIME_AUTHORITY.resultVerifiedAtFormat,
|
|
299
|
-
closeoutScopes: toStringArray(
|
|
300
|
-
closeoutSchema.scope_enum,
|
|
301
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.closeoutScopes,
|
|
302
|
-
),
|
|
303
|
-
closureStates: toStringArray(
|
|
304
|
-
closeoutSchema.closure_enum,
|
|
305
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.closureStates,
|
|
306
|
-
),
|
|
307
|
-
closeoutDispositions: toStringArray(
|
|
308
|
-
closeoutSchema.disposition_enum,
|
|
309
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.closeoutDispositions,
|
|
310
|
-
),
|
|
311
|
-
remediationKinds: toStringArray(
|
|
312
|
-
remediationSchema.kind_enum,
|
|
313
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.remediationKinds,
|
|
314
|
-
),
|
|
315
|
-
decisionDispositions: toStringArray(
|
|
316
|
-
decisionReviewSchema.disposition_enum,
|
|
317
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.decisionDispositions,
|
|
318
|
-
),
|
|
319
|
-
pendingNoteRequiredFields: toStringArray(
|
|
320
|
-
pendingNoteSchema.required,
|
|
321
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.pendingNoteRequiredFields,
|
|
322
|
-
),
|
|
323
|
-
pendingNoteStatuses: toStringArray(
|
|
324
|
-
pendingNoteSchema.status_enum,
|
|
325
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.pendingNoteStatuses,
|
|
326
|
-
),
|
|
327
|
-
defaultForbiddenShortcuts: Array.isArray(forbiddenShortcutsCatalog.entries)
|
|
328
|
-
? forbiddenShortcutsCatalog.entries
|
|
329
|
-
.map((entry) => (typeof entry?.key == "string" ? entry.key : null))
|
|
330
|
-
.filter(Boolean)
|
|
331
|
-
: DEFAULT_TOPIC_RUNTIME_AUTHORITY.defaultForbiddenShortcuts,
|
|
332
|
-
recommendedFiles: toStringArray(
|
|
333
|
-
lifecycleReport.recommended_files,
|
|
334
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.recommendedFiles,
|
|
335
|
-
).filter((entry) => !entry.includes("*")),
|
|
336
|
-
closureDimensions: toStringArray(
|
|
337
|
-
fourClosurePolicy.closures,
|
|
338
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.closureDimensions,
|
|
339
|
-
),
|
|
340
|
-
waveCloseoutEvidence: {
|
|
341
|
-
requirePacketLineage: normalizeBoolean(
|
|
342
|
-
fourClosurePolicy.wave_closeout_evidence?.require_packet_lineage,
|
|
343
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.waveCloseoutEvidence.requirePacketLineage,
|
|
344
|
-
),
|
|
345
|
-
requireResultLineage: normalizeBoolean(
|
|
346
|
-
fourClosurePolicy.wave_closeout_evidence?.require_result_lineage,
|
|
347
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.waveCloseoutEvidence.requireResultLineage,
|
|
348
|
-
),
|
|
349
|
-
},
|
|
350
|
-
trueCloseAuditEvidence: {
|
|
351
|
-
requireWaveCloseoutForClosedWaves: normalizeBoolean(
|
|
352
|
-
fourClosurePolicy.true_close_audit_evidence?.require_wave_closeout_for_closed_waves,
|
|
353
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.trueCloseAuditEvidence.requireWaveCloseoutForClosedWaves,
|
|
354
|
-
),
|
|
355
|
-
requirePacketLineageForClosedWaves: normalizeBoolean(
|
|
356
|
-
fourClosurePolicy.true_close_audit_evidence?.require_packet_lineage_for_closed_waves,
|
|
357
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.trueCloseAuditEvidence.requirePacketLineageForClosedWaves,
|
|
358
|
-
),
|
|
359
|
-
requireResultLineageForClosedWaves: normalizeBoolean(
|
|
360
|
-
fourClosurePolicy.true_close_audit_evidence?.require_result_lineage_for_closed_waves,
|
|
361
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.trueCloseAuditEvidence.requireResultLineageForClosedWaves,
|
|
362
|
-
),
|
|
363
|
-
},
|
|
364
|
-
topicStepDecision: {
|
|
365
|
-
stopClasses: toStringArray(
|
|
366
|
-
topicStepDecisionSchema.stop_class_enum,
|
|
367
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicStepDecision.stopClasses,
|
|
368
|
-
),
|
|
369
|
-
recommendedActions: toStringArray(
|
|
370
|
-
topicStepDecisionSchema.recommended_action_enum,
|
|
371
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicStepDecision.recommendedActions,
|
|
372
|
-
),
|
|
373
|
-
},
|
|
374
|
-
topicRunLedger: {
|
|
375
|
-
eventKinds: toStringArray(
|
|
376
|
-
topicRunLedgerSchema.event_kind_enum,
|
|
377
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicRunLedger.eventKinds,
|
|
378
|
-
),
|
|
379
|
-
runStatuses: toStringArray(
|
|
380
|
-
topicRunLedgerSchema.run_status_enum,
|
|
381
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicRunLedger.runStatuses,
|
|
382
|
-
),
|
|
383
|
-
artifactRefKeys: toStringArray(
|
|
384
|
-
topicRunLedgerSchema.artifact_ref_keys,
|
|
385
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicRunLedger.artifactRefKeys,
|
|
386
|
-
),
|
|
387
|
-
retryPostures: toStringArray(
|
|
388
|
-
topicRunLedgerSchema.retry_posture_enum,
|
|
389
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.topicRunLedger.retryPostures,
|
|
390
|
-
),
|
|
391
|
-
},
|
|
392
|
-
ignoredTopicValidateSemantics: {
|
|
393
|
-
status:
|
|
394
|
-
typeof validationPolicy.ignored_topic_validate_semantics?.status == "string"
|
|
395
|
-
? validationPolicy.ignored_topic_validate_semantics.status
|
|
396
|
-
: DEFAULT_TOPIC_RUNTIME_AUTHORITY.ignoredTopicValidateSemantics.status,
|
|
397
|
-
canonicalSuccess: normalizeBoolean(
|
|
398
|
-
validationPolicy.ignored_topic_validate_semantics?.canonical_success,
|
|
399
|
-
DEFAULT_TOPIC_RUNTIME_AUTHORITY.ignoredTopicValidateSemantics.canonicalSuccess,
|
|
400
|
-
),
|
|
401
|
-
},
|
|
402
|
-
};
|
|
403
|
-
return (topicRuntimeAuthorityCache.set(projectRoot, authority), authority);
|
|
404
|
-
}
|