@nimiplatform/nimi-coding 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.
Files changed (186) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +348 -0
  3. package/adapters/README.md +25 -0
  4. package/adapters/claude/README.md +89 -0
  5. package/adapters/claude/profile.yaml +70 -0
  6. package/adapters/codex/README.md +53 -0
  7. package/adapters/codex/profile.yaml +78 -0
  8. package/adapters/oh-my-codex/README.md +185 -0
  9. package/adapters/oh-my-codex/profile.yaml +46 -0
  10. package/bin/nimicoding.mjs +6 -0
  11. package/cli/commands/admit-high-risk-decision.mjs +108 -0
  12. package/cli/commands/audit-sweep.mjs +341 -0
  13. package/cli/commands/blueprint-audit.mjs +91 -0
  14. package/cli/commands/clear.mjs +168 -0
  15. package/cli/commands/closeout.mjs +183 -0
  16. package/cli/commands/decide-high-risk-execution.mjs +124 -0
  17. package/cli/commands/doctor.mjs +53 -0
  18. package/cli/commands/generate-spec-derived-docs.mjs +131 -0
  19. package/cli/commands/handoff.mjs +123 -0
  20. package/cli/commands/ingest-high-risk-execution.mjs +95 -0
  21. package/cli/commands/review-high-risk-execution.mjs +95 -0
  22. package/cli/commands/start.mjs +717 -0
  23. package/cli/commands/topic-formatters.mjs +382 -0
  24. package/cli/commands/topic-goal.mjs +33 -0
  25. package/cli/commands/topic-options-shared.mjs +27 -0
  26. package/cli/commands/topic-options-workflow.mjs +767 -0
  27. package/cli/commands/topic-options.mjs +626 -0
  28. package/cli/commands/topic-runner.mjs +169 -0
  29. package/cli/commands/topic.mjs +795 -0
  30. package/cli/commands/validate-acceptance.mjs +5 -0
  31. package/cli/commands/validate-ai-governance.mjs +214 -0
  32. package/cli/commands/validate-execution-packet.mjs +5 -0
  33. package/cli/commands/validate-orchestration-state.mjs +5 -0
  34. package/cli/commands/validate-prompt.mjs +5 -0
  35. package/cli/commands/validate-spec-audit.mjs +27 -0
  36. package/cli/commands/validate-spec-governance.mjs +124 -0
  37. package/cli/commands/validate-spec-tree.mjs +27 -0
  38. package/cli/commands/validate-worker-output.mjs +5 -0
  39. package/cli/constants.mjs +489 -0
  40. package/cli/help.mjs +134 -0
  41. package/cli/index.mjs +103 -0
  42. package/cli/lib/adapter-profiles.mjs +403 -0
  43. package/cli/lib/audit-execution.mjs +52 -0
  44. package/cli/lib/audit-sweep-runtime/admissions.mjs +381 -0
  45. package/cli/lib/audit-sweep-runtime/audit-validity.mjs +333 -0
  46. package/cli/lib/audit-sweep-runtime/chunks.mjs +697 -0
  47. package/cli/lib/audit-sweep-runtime/closeout.mjs +144 -0
  48. package/cli/lib/audit-sweep-runtime/codex-auditor-evidence.mjs +639 -0
  49. package/cli/lib/audit-sweep-runtime/codex-auditor.mjs +515 -0
  50. package/cli/lib/audit-sweep-runtime/common.mjs +329 -0
  51. package/cli/lib/audit-sweep-runtime/coverage-quality.mjs +172 -0
  52. package/cli/lib/audit-sweep-runtime/evidence-assignment.mjs +152 -0
  53. package/cli/lib/audit-sweep-runtime/format.mjs +57 -0
  54. package/cli/lib/audit-sweep-runtime/ingest.mjs +486 -0
  55. package/cli/lib/audit-sweep-runtime/inventory-spec-chunks.mjs +198 -0
  56. package/cli/lib/audit-sweep-runtime/inventory.mjs +728 -0
  57. package/cli/lib/audit-sweep-runtime/ledger.mjs +315 -0
  58. package/cli/lib/audit-sweep-runtime/p0p1-profile.mjs +101 -0
  59. package/cli/lib/audit-sweep-runtime/remediation.mjs +349 -0
  60. package/cli/lib/audit-sweep-runtime/rerun.mjs +129 -0
  61. package/cli/lib/audit-sweep-runtime/risk-budget.mjs +300 -0
  62. package/cli/lib/audit-sweep-runtime/status.mjs +62 -0
  63. package/cli/lib/audit-sweep-runtime/validators-ledger.mjs +215 -0
  64. package/cli/lib/audit-sweep-runtime/validators.mjs +758 -0
  65. package/cli/lib/audit-sweep.mjs +18 -0
  66. package/cli/lib/authority-convergence.mjs +309 -0
  67. package/cli/lib/blueprint-audit.mjs +370 -0
  68. package/cli/lib/bootstrap.mjs +228 -0
  69. package/cli/lib/closeout.mjs +623 -0
  70. package/cli/lib/codex-sdk-runner.mjs +76 -0
  71. package/cli/lib/contracts.mjs +180 -0
  72. package/cli/lib/doctor.mjs +18 -0
  73. package/cli/lib/entrypoints.mjs +274 -0
  74. package/cli/lib/external-execution.mjs +101 -0
  75. package/cli/lib/fs-helpers.mjs +33 -0
  76. package/cli/lib/handoff.mjs +785 -0
  77. package/cli/lib/high-risk-admission.mjs +442 -0
  78. package/cli/lib/high-risk-decision.mjs +324 -0
  79. package/cli/lib/high-risk-ingest.mjs +317 -0
  80. package/cli/lib/high-risk-review.mjs +263 -0
  81. package/cli/lib/internal/contracts-loaders.mjs +132 -0
  82. package/cli/lib/internal/contracts-parse-high-risk.mjs +131 -0
  83. package/cli/lib/internal/contracts-parse.mjs +457 -0
  84. package/cli/lib/internal/contracts-validators.mjs +398 -0
  85. package/cli/lib/internal/doctor-bootstrap-surface.mjs +359 -0
  86. package/cli/lib/internal/doctor-delegated-surface.mjs +256 -0
  87. package/cli/lib/internal/doctor-finalize.mjs +385 -0
  88. package/cli/lib/internal/doctor-format.mjs +286 -0
  89. package/cli/lib/internal/doctor-inspectors.mjs +294 -0
  90. package/cli/lib/internal/doctor-state.mjs +205 -0
  91. package/cli/lib/internal/governance/ai/ai-context-budget-core.mjs +315 -0
  92. package/cli/lib/internal/governance/ai/ai-structure-budget-core.mjs +358 -0
  93. package/cli/lib/internal/governance/ai/check-agents-freshness.mjs +155 -0
  94. package/cli/lib/internal/governance/ai/check-high-risk-doc-metadata-core.mjs +173 -0
  95. package/cli/lib/internal/governance/config.mjs +150 -0
  96. package/cli/lib/internal/governance/runner.mjs +35 -0
  97. package/cli/lib/internal/governance/shared/read-yaml-with-fragments.mjs +49 -0
  98. package/cli/lib/internal/validators-artifacts.mjs +515 -0
  99. package/cli/lib/internal/validators-shared.mjs +28 -0
  100. package/cli/lib/internal/validators-spec-helpers.mjs +186 -0
  101. package/cli/lib/internal/validators-spec.mjs +410 -0
  102. package/cli/lib/shared.mjs +83 -0
  103. package/cli/lib/topic-draft-packets.mjs +48 -0
  104. package/cli/lib/topic-goal.mjs +361 -0
  105. package/cli/lib/topic-runner.mjs +772 -0
  106. package/cli/lib/topic.mjs +93 -0
  107. package/cli/lib/ui.mjs +178 -0
  108. package/cli/lib/validators.mjs +78 -0
  109. package/cli/lib/value-helpers.mjs +24 -0
  110. package/cli/lib/yaml-helpers.mjs +133 -0
  111. package/cli/nimicoding.mjs +1 -0
  112. package/cli/seeds/bootstrap.mjs +47 -0
  113. package/config/audit-execution-artifacts.yaml +20 -0
  114. package/config/bootstrap.yaml +6 -0
  115. package/config/external-execution-artifacts.yaml +16 -0
  116. package/config/host-adapter.yaml +30 -0
  117. package/config/host-profile.yaml +29 -0
  118. package/config/installer-evidence.yaml +31 -0
  119. package/config/skill-installer.yaml +23 -0
  120. package/config/skill-manifest.yaml +46 -0
  121. package/config/skills.yaml +30 -0
  122. package/config/spec-generation-inputs.yaml +25 -0
  123. package/contracts/acceptance.schema.yaml +16 -0
  124. package/contracts/admission-checklist.schema.yaml +15 -0
  125. package/contracts/audit-chunk.schema.yaml +110 -0
  126. package/contracts/audit-closeout.schema.yaml +51 -0
  127. package/contracts/audit-finding.schema.yaml +61 -0
  128. package/contracts/audit-ledger.schema.yaml +138 -0
  129. package/contracts/audit-plan.schema.yaml +123 -0
  130. package/contracts/audit-remediation-map.schema.yaml +51 -0
  131. package/contracts/audit-rerun.schema.yaml +31 -0
  132. package/contracts/audit-sweep-result.yaml +49 -0
  133. package/contracts/authority-convergence-audit.schema.yaml +19 -0
  134. package/contracts/closeout.schema.yaml +25 -0
  135. package/contracts/decision-review.schema.yaml +16 -0
  136. package/contracts/doc-spec-audit-result.yaml +19 -0
  137. package/contracts/execution-packet.schema.yaml +49 -0
  138. package/contracts/external-host-compatibility.yaml +22 -0
  139. package/contracts/forbidden-shortcuts.catalog.yaml +23 -0
  140. package/contracts/high-risk-admission.schema.yaml +23 -0
  141. package/contracts/high-risk-execution-result.yaml +20 -0
  142. package/contracts/orchestration-state.schema.yaml +41 -0
  143. package/contracts/overflow-continuation.schema.yaml +12 -0
  144. package/contracts/packet.schema.yaml +30 -0
  145. package/contracts/pending-note.schema.yaml +17 -0
  146. package/contracts/prompt.schema.yaml +12 -0
  147. package/contracts/remediation.schema.yaml +16 -0
  148. package/contracts/result.schema.yaml +24 -0
  149. package/contracts/spec-generation-audit.schema.yaml +31 -0
  150. package/contracts/spec-generation-inputs.schema.yaml +39 -0
  151. package/contracts/spec-reconstruction-result.yaml +37 -0
  152. package/contracts/topic-goal.schema.yaml +78 -0
  153. package/contracts/topic-run-ledger.schema.yaml +72 -0
  154. package/contracts/topic-step-decision.schema.yaml +45 -0
  155. package/contracts/topic.schema.yaml +65 -0
  156. package/contracts/true-close.schema.yaml +15 -0
  157. package/contracts/wave.schema.yaml +29 -0
  158. package/contracts/worker-output.schema.yaml +15 -0
  159. package/methodology/audit-sweep-p0p1-recall.yaml +45 -0
  160. package/methodology/authority-convergence-policy.yaml +42 -0
  161. package/methodology/core.yaml +25 -0
  162. package/methodology/four-closure-policy.yaml +28 -0
  163. package/methodology/overflow-continuation-policy.yaml +14 -0
  164. package/methodology/role-separation-policy.yaml +28 -0
  165. package/methodology/skill-exchange-projection.yaml +114 -0
  166. package/methodology/skill-handoff.yaml +34 -0
  167. package/methodology/skill-installer-result.yaml +27 -0
  168. package/methodology/skill-installer-summary-projection.yaml +181 -0
  169. package/methodology/skill-runtime.yaml +23 -0
  170. package/methodology/spec-reconstruction.yaml +63 -0
  171. package/methodology/spec-target-truth-profile.yaml +53 -0
  172. package/methodology/topic-lifecycle-report.yaml +144 -0
  173. package/methodology/topic-lifecycle.yaml +37 -0
  174. package/methodology/topic-naming-ontology.yaml +21 -0
  175. package/methodology/topic-ontology.yaml +38 -0
  176. package/methodology/topic-validation-policy.yaml +9 -0
  177. package/methodology/wave-dag-policy.yaml +14 -0
  178. package/package.json +50 -0
  179. package/spec/_meta/command-gating-matrix.yaml +110 -0
  180. package/spec/_meta/generate-drift-migration-checklist.yaml +155 -0
  181. package/spec/_meta/governance-routing-cutover-checklist.yaml +35 -0
  182. package/spec/_meta/phase2-impacted-surface-matrix.yaml +44 -0
  183. package/spec/_meta/spec-authority-cutover-readiness.yaml +104 -0
  184. package/spec/_meta/spec-tree-model.yaml +72 -0
  185. package/spec/bootstrap-state.yaml +99 -0
  186. package/spec/product-scope.yaml +56 -0
@@ -0,0 +1,78 @@
1
+ version: 1
2
+ adapter_profile:
3
+ id: codex
4
+ host_class: native_codex_sdk_host
5
+ upstream_seed_profile: external_ai_host
6
+ purpose: >
7
+ Constrain native Codex SDK execution to act as a direct Codex host for
8
+ nimicoding topic-loop dispatch, using @openai/codex-sdk thread runs without
9
+ promoting Codex thread state into semantic truth.
10
+ semantic_owner:
11
+ - .nimi/methodology
12
+ - .nimi/spec
13
+ - .nimi/contracts
14
+ - .nimi/config
15
+ operational_owner:
16
+ - .codex
17
+ - .nimi/local
18
+ - .nimi/cache
19
+ admitted_skill_surfaces:
20
+ - spec_reconstruction
21
+ - doc_spec_audit
22
+ - audit_sweep
23
+ - high_risk_execution
24
+ - topic_loop_execution
25
+ - authority_convergence_audit
26
+ prompt_handoff:
27
+ bootstrap_surface:
28
+ - nimicoding handoff --skill spec_reconstruction --prompt
29
+ - nimicoding handoff --skill doc_spec_audit --prompt
30
+ - nimicoding handoff --skill audit_sweep --prompt
31
+ - nimicoding handoff --skill high_risk_execution --prompt
32
+ future_surface:
33
+ status: active_via_codex_sdk
34
+ commands:
35
+ - Codex.startThread().run
36
+ - Codex.resumeThread().run
37
+ output_handoff:
38
+ worker_output_target: .nimi/local/outputs/** candidate artifact
39
+ evidence_target: .nimi/local/evidence/** candidate artifact
40
+ closeout_target: local-only closeout payload unless later admitted
41
+ authority_convergence_audit:
42
+ execution_projection: codex_subagent_auditor
43
+ dispatch_source: nimicoding topic audit dispatch
44
+ output_target: .nimi/local/outputs/** candidate audit evidence
45
+ semantic_effect: none_until_manager_records_topic_audit_result
46
+ required_prompt_posture:
47
+ - audit_only_no_code_or_spec_edits
48
+ - report_PASS_NEEDS_REVISION_or_FAIL
49
+ - list_blocking_findings_concerns_deferred_non_blockers_and_authority_refs
50
+ native_review_boundary:
51
+ approval_review:
52
+ scope: lower_layer_permission_review
53
+ semantic_effect: none
54
+ evidence_target: .nimi/local/evidence/** candidate artifact
55
+ github_auto_review:
56
+ scope: lower_layer_pr_review_findings
57
+ semantic_effect: evidence_only
58
+ evidence_target: .nimi/local/evidence/** candidate artifact
59
+ forbidden_semantic_substitutions:
60
+ - wave_admission
61
+ - packet_freeze
62
+ - result_verdict
63
+ - wave_closeout
64
+ - topic_closeout
65
+ - true_close
66
+ hard_constraints:
67
+ - codex_sdk_must_not_become_semantic_owner
68
+ - codex_sdk_must_not_write_canonical_.nimi/spec_truth_directly_without_validator_admission
69
+ - codex_sdk_must_not_define_acceptance_disposition_or_finding_judgment
70
+ - codex_thread_state_must_remain_operational_only
71
+ - codex_sdk_runs_must_be_recorded_in_topic_run_ledger
72
+ - codex_native_approval_review_must_remain_permission_review_only
73
+ - codex_github_auto_review_must_remain_evidence_only
74
+ - codex_review_must_not_substitute_nimicoding_semantic_commands
75
+ - unresolved_authority_or_missing_context_must_fail_closed
76
+ - codex_subagent_authority_convergence_output_must_remain_candidate_evidence
77
+ current_gaps:
78
+ - topic_semantic_orchestrator_command_surface_not_yet_packaged
@@ -0,0 +1,185 @@
1
+ # oh-my-codex Adapter Sketch
2
+
3
+ This adapter sketch defines how to use `@nimiplatform/nimi-coding` with
4
+ `oh-my-codex` (OMX) without turning OMX into the semantic owner.
5
+
6
+ ## Intent
7
+
8
+ Use OMX for:
9
+
10
+ - multi-agent or role-based execution
11
+ - external host routing
12
+ - long-running or autonomy-first execution behavior
13
+ - operational observability
14
+
15
+ Keep `nimicoding` responsible for:
16
+
17
+ - project-local `.nimi/**` truth
18
+ - authority boundaries
19
+ - handoff constraints
20
+ - packet, prompt, worker-output, and acceptance schema ownership
21
+ - fail-closed validation
22
+
23
+ ## Boundary
24
+
25
+ Treat the systems as layered rather than merged:
26
+
27
+ - `@nimiplatform/nimi-coding` is the semantic kernel.
28
+ - `oh-my-codex` is a constrained external execution host.
29
+ - This adapter is only the bridge.
30
+
31
+ OMX may read `.nimi/**` and produce execution artifacts, but it must not:
32
+
33
+ - become the owner of `.nimi/spec/**`
34
+ - treat cutover readiness as an authority flip
35
+ - decide semantic acceptance or final disposition
36
+ - redefine methodology state from `.omx/**` runtime state
37
+ - bypass `nimicoding doctor`, `handoff`, or validator gates
38
+
39
+ ## Current Audit Summary
40
+
41
+ The current package is already boundary-complete for standalone adapter use:
42
+
43
+ - bootstrap seeding includes `skill-manifest`, `host-profile`, delegated
44
+ `skill-runtime`, and `skill-handoff`
45
+ - `doctor` fail-closes when delegated-runtime posture, host-adapter truth, or
46
+ the package-owned OMX adapter overlay drifts
47
+ - the generic external-host compatibility contract remains the baseline, and
48
+ OMX only adds an admitted overlay on top of it
49
+ - `nimicoding doctor` and `nimicoding handoff` now report the supported
50
+ host posture directly from that packaged compatibility contract, alongside
51
+ named overlay status and future-only host-specific surfaces
52
+ - `handoff --json` exports the authoritative machine contract, while
53
+ `handoff --prompt` remains a human-readable projection, and both include
54
+ selected OMX overlay metadata
55
+ - `closeout` safely projects external results into local-only artifacts
56
+ - execution artifact validators already exist for packet, orchestration-state,
57
+ prompt, worker-output, and acceptance
58
+
59
+ The main remaining gap is not boundary definition. It is automation:
60
+
61
+ - `high_risk_execution` now has a packaged local-only result contract
62
+ - this package intentionally does not ship a packet-bound run kernel,
63
+ provider execution, or automatic canonical semantic promotion loop
64
+ - the adapter profile marks `run-next-prompt` as a future-only, not-packaged
65
+ surface rather than an available standalone command
66
+
67
+ That means OMX interop is already viable for prompt/output/evidence handoff,
68
+ named host-profile recognition, and explicit manager-owned admission, but
69
+ final high-risk completion should still stay bounded by `nimicoding`
70
+ validators, explicit local closeout/decision/ingest/review surfaces, and
71
+ manual manager-side admission rather than automatic semantic promotion. The
72
+ canonical admission target is now also shape-validated by a package-owned
73
+ admission schema contract before `nimicoding` accepts it as semantic truth.
74
+
75
+ ## Recommended First-User Flow
76
+
77
+ ### 1. Bootstrap project-local truth
78
+
79
+ Run inside the target project:
80
+
81
+ ```sh
82
+ nimicoding start
83
+ nimicoding doctor
84
+ ```
85
+
86
+ The result must keep delegated runtime ownership and non-self-hosted posture
87
+ clean before OMX is introduced.
88
+
89
+ ### 2. Reconstruct `.nimi/spec/**` through explicit handoff
90
+
91
+ Export the authoritative bootstrap handoff contract:
92
+
93
+ ```sh
94
+ nimicoding handoff --skill spec_reconstruction --json
95
+ ```
96
+
97
+ Use the JSON payload as OMX's machine contract. `--prompt` may still be used
98
+ as a host briefing, but it is not the authoritative surface. OMX should
99
+ return only the declared canonical tree outputs and must not invent new semantic
100
+ owners. In this monorepo the explicit cutover batch has already made
101
+ `.nimi/spec/**` the current authority root; OMX still must not redefine that
102
+ authority or promote its own runtime state into semantic truth.
103
+
104
+ Then project the closeout locally:
105
+
106
+ ```sh
107
+ nimicoding closeout \
108
+ --skill spec_reconstruction \
109
+ --outcome completed \
110
+ --verified-at 2026-04-11T00:00:00Z \
111
+ --from <result.json> \
112
+ --write-local
113
+ ```
114
+
115
+ ### 3. Audit drift before execution
116
+
117
+ If needed:
118
+
119
+ ```sh
120
+ nimicoding handoff --skill doc_spec_audit --prompt
121
+ nimicoding closeout --skill doc_spec_audit --outcome completed --verified-at <utc> --from <result.json> --write-local
122
+ ```
123
+
124
+ This stays local-only and must not replace semantic truth.
125
+
126
+ ### 4. Dispatch high-risk execution through OMX
127
+
128
+ Export the high-risk handoff contract:
129
+
130
+ ```sh
131
+ nimicoding handoff --skill high_risk_execution --json
132
+ ```
133
+
134
+ OMX should consume the declared `.nimi/**` context and produce:
135
+
136
+ - packet/orchestration/prompt/worker-output/evidence refs under the declared
137
+ local artifact roots in `.nimi/config/external-execution-artifacts.yaml`
138
+ - a local-only external execution summary that satisfies the packaged
139
+ `high_risk_execution` result contract
140
+ - no claim of semantic completion, acceptance, or disposition
141
+
142
+ The worker output must satisfy the seeded schema and include the strict
143
+ `Runner Signal` block shape expected by the promoted internal methodology.
144
+
145
+ ### 5. Keep semantic review in `nimicoding`
146
+
147
+ For now, treat OMX output as execution candidate material:
148
+
149
+ - validate packet, prompt, worker-output, and acceptance mechanically
150
+ - keep final acceptance/disposition under manager-owned `nimicoding` review
151
+ - keep `.omx/**` state operational only
152
+
153
+ In practice, this means the first real user can use OMX as the execution host
154
+ today, while standalone `nimicoding` remains the host-agnostic semantic and
155
+ interop boundary package. The promoted internal
156
+ [`nimi-coding`](/Users/snwozy/nimi-realm/nimi/nimi-coding) still owns
157
+ packet-bound runtime, provider-backed execution, scheduler, notification, and
158
+ automation surfaces, even though standalone
159
+ `nimicoding closeout` can now import a fail-closed local-only execution
160
+ summary and `nimicoding ingest-high-risk-execution` can mechanically validate
161
+ the referenced packet/prompt/output candidates while
162
+ `nimicoding review-high-risk-execution` can project a manager-ready local
163
+ attachment bundle, `nimicoding decide-high-risk-execution` can record a
164
+ manager-owned local disposition, and `nimicoding admit-high-risk-decision`
165
+ can explicitly write canonical summary admission into `.nimi/spec` without
166
+ promoting OMX runtime state.
167
+
168
+ ## Mapping
169
+
170
+ | OMX concern | Adapter rule | `nimicoding` owner |
171
+ |---|---|---|
172
+ | planning/execution routing | operational only | none |
173
+ | prompt handoff | consume exported prompt/context | `.nimi/methodology/skill-handoff.yaml` |
174
+ | worker output | write candidate artifact only under declared local roots | `.nimi/contracts/worker-output.schema.yaml` |
175
+ | evidence | write candidate artifact only under declared local roots | packet/evidence contract family |
176
+ | final disposition | OMX must not decide | manager-reviewed `nimicoding` semantics |
177
+
178
+ ## Next Product Steps
179
+
180
+ The minimum follow-up work from here is:
181
+
182
+ 1. Add canonical semantic promotion automation around the explicit admission
183
+ surface so manager-owned decisions no longer require manual admission steps.
184
+ 2. Keep host-specific runtime execution support out of standalone unless a
185
+ later admitted packet explicitly expands package ownership.
@@ -0,0 +1,46 @@
1
+ version: 1
2
+ adapter_profile:
3
+ id: oh_my_codex
4
+ host_class: external_execution_host
5
+ upstream_seed_profile: external_ai_host
6
+ purpose: >
7
+ Constrain oh-my-codex to act as an external execution host for
8
+ nimicoding handoff/prompt/output/evidence exchange without promoting OMX
9
+ runtime state into semantic truth.
10
+ semantic_owner:
11
+ - .nimi/methodology
12
+ - .nimi/spec
13
+ - .nimi/contracts
14
+ - .nimi/config
15
+ operational_owner:
16
+ - .omx
17
+ - .nimi/local
18
+ - .nimi/cache
19
+ admitted_skill_surfaces:
20
+ - spec_reconstruction
21
+ - doc_spec_audit
22
+ - audit_sweep
23
+ - high_risk_execution
24
+ prompt_handoff:
25
+ bootstrap_surface:
26
+ - nimicoding handoff --skill spec_reconstruction --prompt
27
+ - nimicoding handoff --skill doc_spec_audit --prompt
28
+ - nimicoding handoff --skill audit_sweep --prompt
29
+ - nimicoding handoff --skill high_risk_execution --prompt
30
+ future_surface:
31
+ status: future_only_not_packaged
32
+ commands:
33
+ - nimicoding run-next-prompt
34
+ output_handoff:
35
+ worker_output_target: .nimi/local/outputs/** candidate artifact
36
+ evidence_target: .nimi/local/evidence/** candidate artifact
37
+ closeout_target: local-only closeout payload unless later admitted
38
+ hard_constraints:
39
+ - omx_must_not_become_semantic_owner
40
+ - omx_must_not_write_canonical_.nimi/spec_truth_directly_without_validator_admission
41
+ - omx_must_not_define_acceptance_disposition_or_finding_judgment
42
+ - omx_runtime_state_must_remain_operational_only
43
+ - unresolved_authority_or_missing_context_must_fail_closed
44
+ current_gaps:
45
+ - automatic_semantic_admission_automation_not_packaged_in_standalone
46
+ - host_specific_runtime_execution_not_packaged_in_standalone
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runCli } from "../cli/nimicoding.mjs";
4
+
5
+ const exitCode = await runCli(process.argv.slice(2));
6
+ process.exit(exitCode);
@@ -0,0 +1,108 @@
1
+ import {
2
+ buildHighRiskAdmissionPayload,
3
+ formatHighRiskAdmissionPayload,
4
+ writeHighRiskAdmission,
5
+ } from "../lib/high-risk-admission.mjs";
6
+ import { localize } from "../lib/ui.mjs";
7
+
8
+ function parseAdmitHighRiskDecisionOptions(args) {
9
+ const options = {
10
+ fromPath: null,
11
+ admittedAt: null,
12
+ json: false,
13
+ writeSpec: false,
14
+ };
15
+
16
+ for (let index = 0; index < args.length; index += 1) {
17
+ const arg = args[index];
18
+
19
+ if (arg === "--json") {
20
+ options.json = true;
21
+ continue;
22
+ }
23
+
24
+ if (arg === "--write-spec") {
25
+ options.writeSpec = true;
26
+ continue;
27
+ }
28
+
29
+ if (arg === "--from" || arg === "--admitted-at") {
30
+ const next = args[index + 1];
31
+ if (!next || next.startsWith("--")) {
32
+ return {
33
+ ok: false,
34
+ error: `${localize(
35
+ `nimicoding admit-high-risk-decision refused: ${arg} requires a value.`,
36
+ `nimicoding admit-high-risk-decision 已拒绝:${arg} 需要一个值。`,
37
+ )}\n`,
38
+ };
39
+ }
40
+
41
+ if (arg === "--from") {
42
+ options.fromPath = next;
43
+ } else {
44
+ options.admittedAt = next;
45
+ }
46
+ index += 1;
47
+ continue;
48
+ }
49
+
50
+ return {
51
+ ok: false,
52
+ error: `${localize(
53
+ `nimicoding admit-high-risk-decision refused: unknown option ${arg}.`,
54
+ `nimicoding admit-high-risk-decision 已拒绝:未知选项 ${arg}。`,
55
+ )}\n`,
56
+ };
57
+ }
58
+
59
+ if (!options.fromPath) {
60
+ return {
61
+ ok: false,
62
+ error: `${localize(
63
+ "nimicoding admit-high-risk-decision refused: explicit --from is required.",
64
+ "nimicoding admit-high-risk-decision 已拒绝:必须显式提供 `--from`。",
65
+ )}\n`,
66
+ };
67
+ }
68
+
69
+ if (!options.admittedAt) {
70
+ return {
71
+ ok: false,
72
+ error: `${localize(
73
+ "nimicoding admit-high-risk-decision refused: explicit --admitted-at is required.",
74
+ "nimicoding admit-high-risk-decision 已拒绝:必须显式提供 `--admitted-at`。",
75
+ )}\n`,
76
+ };
77
+ }
78
+
79
+ return { ok: true, options };
80
+ }
81
+
82
+ export async function runAdmitHighRiskDecision(args) {
83
+ const parsed = parseAdmitHighRiskDecisionOptions(args);
84
+ if (!parsed.ok) {
85
+ process.stderr.write(parsed.error);
86
+ return 2;
87
+ }
88
+
89
+ const payload = await buildHighRiskAdmissionPayload(process.cwd(), parsed.options);
90
+ if (payload.inputError) {
91
+ process.stderr.write(payload.error);
92
+ return payload.exitCode;
93
+ }
94
+
95
+ if (payload.ok && parsed.options.writeSpec) {
96
+ await writeHighRiskAdmission(process.cwd(), payload);
97
+ }
98
+
99
+ if (parsed.options.json) {
100
+ process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
101
+ } else {
102
+ process.stdout.write(formatHighRiskAdmissionPayload(payload));
103
+ }
104
+
105
+ return payload.exitCode;
106
+ }
107
+
108
+ export { parseAdmitHighRiskDecisionOptions };