@nimiplatform/nimi-coding 0.1.0 → 0.2.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 (121) hide show
  1. package/README.md +19 -20
  2. package/adapters/oh-my-codex/README.md +8 -9
  3. package/cli/commands/audit-sweep.mjs +10 -10
  4. package/cli/commands/classify-spec-tree.mjs +5 -0
  5. package/cli/commands/closeout.mjs +3 -0
  6. package/cli/commands/generate-spec-derived-docs.mjs +20 -0
  7. package/cli/commands/generate-spec-migration-plan.mjs +30 -0
  8. package/cli/commands/start.mjs +5 -1
  9. package/cli/commands/surface-validator-command.mjs +49 -0
  10. package/cli/commands/sweep-design.mjs +295 -0
  11. package/cli/commands/sweep.mjs +22 -0
  12. package/cli/commands/sync.mjs +132 -0
  13. package/cli/commands/topic-formatters.mjs +8 -8
  14. package/cli/commands/validate-ai-governance.mjs +167 -46
  15. package/cli/commands/validate-domain-admission.mjs +5 -0
  16. package/cli/commands/validate-guidance-bodies.mjs +5 -0
  17. package/cli/commands/validate-placement.mjs +5 -0
  18. package/cli/commands/validate-projection-edges.mjs +5 -0
  19. package/cli/commands/validate-spec-audit.mjs +5 -1
  20. package/cli/commands/validate-table-family.mjs +5 -0
  21. package/cli/commands/validate-tracked-output-admission.mjs +5 -0
  22. package/cli/constants.mjs +5 -49
  23. package/cli/help.mjs +33 -11
  24. package/cli/index.mjs +20 -2
  25. package/cli/lib/audit-sweep-runtime/admissions.mjs +38 -29
  26. package/cli/lib/audit-sweep-runtime/audit-validity.mjs +8 -0
  27. package/cli/lib/audit-sweep-runtime/chunks.mjs +11 -11
  28. package/cli/lib/audit-sweep-runtime/closeout.mjs +8 -8
  29. package/cli/lib/audit-sweep-runtime/codex-auditor-evidence.mjs +3 -3
  30. package/cli/lib/audit-sweep-runtime/codex-auditor.mjs +10 -10
  31. package/cli/lib/audit-sweep-runtime/common.mjs +7 -7
  32. package/cli/lib/audit-sweep-runtime/format.mjs +3 -3
  33. package/cli/lib/audit-sweep-runtime/ingest.mjs +8 -8
  34. package/cli/lib/audit-sweep-runtime/inventory-spec-chunks.mjs +24 -27
  35. package/cli/lib/audit-sweep-runtime/inventory.mjs +58 -18
  36. package/cli/lib/audit-sweep-runtime/ledger.mjs +1 -1
  37. package/cli/lib/audit-sweep-runtime/p0p1-profile.mjs +2 -2
  38. package/cli/lib/audit-sweep-runtime/remediation.mjs +6 -6
  39. package/cli/lib/audit-sweep-runtime/rerun.mjs +6 -6
  40. package/cli/lib/audit-sweep-runtime/status.mjs +1 -1
  41. package/cli/lib/audit-sweep-runtime/validators.mjs +2 -2
  42. package/cli/lib/authority-convergence.mjs +397 -2
  43. package/cli/lib/blueprint-audit.mjs +5 -5
  44. package/cli/lib/closeout.mjs +126 -3
  45. package/cli/lib/contracts.mjs +21 -17
  46. package/cli/lib/handoff.mjs +29 -11
  47. package/cli/lib/high-risk-admission.mjs +60 -11
  48. package/cli/lib/high-risk-decision.mjs +31 -2
  49. package/cli/lib/high-risk-ingest.mjs +5 -1
  50. package/cli/lib/high-risk-review.mjs +5 -1
  51. package/cli/lib/internal/contracts-parse.mjs +195 -24
  52. package/cli/lib/internal/contracts-validators.mjs +3 -2
  53. package/cli/lib/internal/doctor-bootstrap-surface.mjs +82 -35
  54. package/cli/lib/internal/doctor-delegated-surface.mjs +1 -1
  55. package/cli/lib/internal/doctor-finalize.mjs +12 -8
  56. package/cli/lib/internal/doctor-inspectors.mjs +34 -1
  57. package/cli/lib/internal/governance/ai/ai-context-budget-core.mjs +74 -12
  58. package/cli/lib/internal/governance/ai/ai-structure-budget-core.mjs +24 -6
  59. package/cli/lib/internal/governance/ai/check-agents-freshness.mjs +18 -23
  60. package/cli/lib/internal/surface-taxonomy-validators.mjs +931 -0
  61. package/cli/lib/internal/validators-spec.mjs +229 -20
  62. package/cli/lib/sweep-design-runtime/common.mjs +246 -0
  63. package/cli/lib/sweep-design-runtime/engine.mjs +733 -0
  64. package/cli/lib/sweep-design-runtime/fix-topic.mjs +414 -0
  65. package/cli/lib/sweep-design-runtime/lifecycle.mjs +54 -0
  66. package/cli/lib/sweep-design-runtime/results.mjs +324 -0
  67. package/cli/lib/sweep-design.mjs +8 -0
  68. package/cli/lib/sync.mjs +143 -0
  69. package/cli/lib/topic-artifacts.mjs +186 -0
  70. package/cli/lib/topic-authority-coverage.mjs +73 -0
  71. package/cli/lib/topic-closeout.mjs +560 -0
  72. package/cli/lib/topic-common.mjs +404 -0
  73. package/cli/lib/topic-decisions.mjs +332 -0
  74. package/cli/lib/topic-draft-packets.mjs +126 -7
  75. package/cli/lib/topic-execution.mjs +515 -0
  76. package/cli/lib/topic-goal.mjs +112 -33
  77. package/cli/lib/topic-ledger.mjs +281 -0
  78. package/cli/lib/topic-lifecycle-artifacts.mjs +173 -0
  79. package/cli/lib/topic-root-validation.mjs +288 -0
  80. package/cli/lib/topic-runner-commands.mjs +174 -0
  81. package/cli/lib/topic-runner-deferral.mjs +532 -0
  82. package/cli/lib/topic-runner-stale-gates.mjs +114 -0
  83. package/cli/lib/topic-runner-validation.mjs +138 -0
  84. package/cli/lib/topic-runner.mjs +109 -154
  85. package/cli/lib/topic-scaffold.mjs +252 -0
  86. package/cli/lib/topic-waves.mjs +403 -0
  87. package/cli/lib/topic.mjs +81 -93
  88. package/cli/lib/value-helpers.mjs +6 -1
  89. package/cli/seeds/bootstrap.mjs +96 -20
  90. package/cli/seeds/seed-policy.yaml +67 -0
  91. package/config/bootstrap.yaml +1 -1
  92. package/config/skill-manifest.yaml +4 -2
  93. package/config/spec-generation-inputs.yaml +41 -19
  94. package/contracts/audit-remediation-map.schema.yaml +1 -0
  95. package/contracts/audit-sweep-result.yaml +4 -0
  96. package/contracts/domain-admission.schema.yaml +56 -0
  97. package/contracts/migration-inventory.schema.yaml +80 -0
  98. package/contracts/negative-fixtures.yaml +91 -0
  99. package/contracts/placement-contract.schema.yaml +163 -0
  100. package/contracts/projection-edge.schema.yaml +130 -0
  101. package/contracts/shared-enums.yaml +68 -0
  102. package/contracts/spec-generation-audit.schema.yaml +19 -4
  103. package/contracts/spec-generation-inputs.schema.yaml +130 -29
  104. package/contracts/spec-reconstruction-result.yaml +9 -5
  105. package/contracts/surface-taxonomy.schema.yaml +201 -0
  106. package/contracts/sweep-design-result.yaml +349 -0
  107. package/contracts/table-family.schema.yaml +114 -0
  108. package/contracts/topic-goal.schema.yaml +10 -1
  109. package/contracts/tracked-output-admission.schema.yaml +70 -0
  110. package/contracts/workflow-consumer.schema.yaml +112 -0
  111. package/methodology/audit-sweep-p0p1-recall.yaml +1 -1
  112. package/methodology/spec-reconstruction.yaml +53 -30
  113. package/package.json +5 -4
  114. package/spec/_meta/command-gating-matrix.yaml +33 -0
  115. package/spec/_meta/generate-drift-migration-checklist.yaml +44 -62
  116. package/spec/_meta/governance-routing-cutover-checklist.yaml +3 -3
  117. package/spec/_meta/phase2-impacted-surface-matrix.yaml +14 -14
  118. package/spec/_meta/spec-authority-cutover-readiness.yaml +3 -5
  119. package/spec/_meta/spec-tree-model.yaml +104 -36
  120. package/spec/bootstrap-state.yaml +36 -36
  121. package/spec/product-scope.yaml +13 -10
@@ -0,0 +1,67 @@
1
+ policy_id: nimicoding.seed-projection.v1
2
+ description: |
3
+ Single source of truth for how nimi-coding package source is projected into
4
+ a host project's .nimi/** bootstrap surface. Every entry under the declared
5
+ source dirs is projected unless excluded; per-path ownership overrides
6
+ control whether the projected file stays package-canonical (refresh on sync,
7
+ drift is an error) or only carries the initial seed (host owns drift).
8
+
9
+ projections:
10
+ - source_dir: config
11
+ output_dir: .nimi/config
12
+ - source_dir: contracts
13
+ output_dir: .nimi/contracts
14
+ - source_dir: methodology
15
+ output_dir: .nimi/methodology
16
+
17
+ default_ownership: package_canonical
18
+
19
+ ownership_semantics:
20
+ package_canonical:
21
+ initial_seed: true
22
+ refresh_on_sync: true
23
+ drift_is_error: true
24
+ description: |
25
+ Package source is canonical truth. nimicoding sync --apply rewrites
26
+ drifted host copies. nimicoding sync --check exits non-zero on any
27
+ drift or missing entry. doctor performs byte comparison.
28
+ host_state_seed:
29
+ initial_seed: true
30
+ refresh_on_sync: false
31
+ drift_is_error: false
32
+ description: |
33
+ Package ships an initial seed, but host owns the canonical content
34
+ after first install. nimicoding sync --apply only writes when the
35
+ host file is missing. Drift never fails sync or doctor.
36
+ host_profile_override:
37
+ initial_seed: true
38
+ refresh_on_sync: false
39
+ drift_is_error: false
40
+ description: |
41
+ Package ships the generic default, but an admitted host profile may own
42
+ the canonical content after bootstrap. nimicoding sync --apply only
43
+ writes when the host file is missing. Drift never fails sync or doctor.
44
+
45
+ excluded_projection:
46
+ - methodology/spec-target-truth-profile.yaml
47
+
48
+ ownership_overrides:
49
+ - path: .nimi/config/spec-generation-inputs.yaml
50
+ ownership: host_state_seed
51
+ reason: |
52
+ spec-generation-inputs carries host-specific reconstruction inputs
53
+ (code_roots, docs_roots, human_note_paths, blueprint refs). Package
54
+ only seeds the initial template; once the host populates real input
55
+ paths, sync --apply must not overwrite them.
56
+ - path: .nimi/contracts/domain-admission.schema.yaml
57
+ ownership: host_profile_override
58
+ reason: |
59
+ domain-admission is host-profile-specific. The package owns the generic
60
+ default project skeleton, while a product host such as Nimi owns its
61
+ admitted product domain list.
62
+ - path: .nimi/methodology/spec-reconstruction.yaml
63
+ ownership: host_profile_override
64
+ reason: |
65
+ spec-reconstruction declares host-specific required output domains and
66
+ generation shape. The package owns the generic default project skeleton,
67
+ while a product host may own a more specific reconstruction profile.
@@ -1,6 +1,6 @@
1
1
  version: 1
2
2
  initialized_by: "@nimiplatform/nimi-coding"
3
- cli_version: "0.1.0"
3
+ cli_version: "0.2.0"
4
4
  bootstrap_contract: "nimicoding.bootstrap"
5
5
  bootstrap_contract_version: 1
6
6
  profile: default
@@ -15,8 +15,10 @@ skills:
15
15
  inputs:
16
16
  - .nimi/config/spec-generation-inputs.yaml
17
17
  - .nimi/methodology/spec-reconstruction.yaml
18
- - .nimi/spec/_meta/spec-tree-model.yaml
19
- - .nimi/spec/bootstrap-state.yaml
18
+ - .nimi/contracts/surface-taxonomy.schema.yaml
19
+ - .nimi/contracts/placement-contract.schema.yaml
20
+ - .nimi/contracts/table-family.schema.yaml
21
+ - .nimi/contracts/domain-admission.schema.yaml
20
22
  - id: doc_spec_audit
21
23
  source: external
22
24
  required: true
@@ -1,25 +1,47 @@
1
- version: 1
1
+ version: 2
2
2
  contract_ref: .nimi/contracts/spec-generation-inputs.schema.yaml
3
3
  spec_generation_inputs:
4
- mode: mixed
4
+ mode: class_filtered
5
5
  canonical_target_root: .nimi/spec
6
- code_roots: []
7
- docs_roots:
8
- - README.md
9
- structure_roots:
10
- - .
11
- human_note_paths: []
12
- benchmark_blueprint_root: null
13
- benchmark_mode: none
14
- acceptance_mode: canonical_tree_validity_without_blueprint
6
+ code_inputs: []
7
+ docs_inputs:
8
+ - root: .nimi/spec
9
+ class_filter: product_authority_only
10
+ allowed_surface_classes: [product_authority, product_authority_table, product_admission_registry, thin_guidance, host_projection_anchor, support_registry]
11
+ forbidden_surface_classes: [derived_view, spec_generation_state, audit_evidence_state, operational_local_artifact, nimicoding_managed_projection, candidate_roadmap, lifecycle_progress_state, methodology_authority]
12
+ owner: nimi_host
13
+ use_as_authority: true
14
+ projection_edge_ref: null
15
+ structure_inputs: []
16
+ topic_inputs:
17
+ - root: .nimi/topics
18
+ owner: topic_lifecycle
19
+ allowed_surface_classes: [lifecycle_progress_state, candidate_roadmap]
20
+ use_as_authority: false
21
+ local_inputs:
22
+ - root: .nimi/local
23
+ owner: local_execution
24
+ allowed_surface_classes: [spec_generation_state, audit_evidence_state, operational_local_artifact, lifecycle_progress_state]
25
+ use_as_authority: false
26
+ forbidden_source_classes:
27
+ - derived_view
28
+ - spec_generation_state
29
+ - audit_evidence_state
30
+ - operational_local_artifact
31
+ - nimicoding_managed_projection
32
+ - candidate_roadmap
33
+ - lifecycle_progress_state
15
34
  generation_order:
16
- - index
17
- - kernel_markdown
18
- - kernel_tables
19
- - generated_views
35
+ - classify_inputs
36
+ - validate_placement
37
+ - product_authority
38
+ - product_authority_tables
20
39
  - thin_guides
40
+ - derived_views
41
+ - generation_audit
21
42
  inference_rules:
22
- - infer_domains_from_available_source_materials_when_no_blueprint_exists
23
- - separate_normative_kernel_from_generated_and_guidance_surfaces
24
- - establish_kernel_markdown_before_thin_guides
25
- - establish_kernel_tables_before_generated_views
43
+ - no_blanket_docs_roots
44
+ - no_generated_as_authority
45
+ - no_derived_views_written_to_local
46
+ - no_audit_or_lifecycle_state_as_authority
47
+ acceptance_mode: placement_validity_before_generation
@@ -49,3 +49,4 @@ hard_constraints:
49
49
  - duplicate_symptoms_do_not_count_as_independent_remediation_obligations_by_default
50
50
  - write_set_conflicts_must_be_visible
51
51
  - needs_decision_findings_require_manager_decision_admission
52
+ - remediation_map_is_not_a_substitute_for_sweep_design_when_fork_review_or_user_decision_is_required
@@ -1,6 +1,9 @@
1
1
  version: 1
2
2
  result_contract:
3
3
  id: delegated_audit_sweep_result
4
+ command_family:
5
+ canonical_entrypoint: "nimicoding sweep audit"
6
+ removed_entrypoint: "nimicoding audit-sweep"
4
7
  summary_required_fields:
5
8
  - plan_ref
6
9
  - chunk_refs
@@ -43,6 +46,7 @@ locality: local_only
43
46
  semantic_constraints:
44
47
  - do_not_promote_audit_sweep_summary_to_project_truth
45
48
  - do_not_treat_external_audit_sweep_summary_as_remediation_or_closure_judgement
49
+ - use_sweep_design_for_finding_confirmation_clustering_fork_review_user_decision_and_wave_planning
46
50
  - candidate_ready_requires_full_authority_and_evidence_coverage
47
51
  - full_coverage_status_requires_candidate_ready_ledger
48
52
  - spec_authority_sweeps_must_report_authority_coverage_and_evidence_coverage_separately
@@ -0,0 +1,56 @@
1
+ version: 1
2
+ contract:
3
+ id: nimicoding.domain-admission.v1
4
+ owner: nimi-coding
5
+ purpose: Require explicit admission for every host spec domain before it is product authority.
6
+ required_top_level_fields:
7
+ - version
8
+ - domain_admissions
9
+ - domain_authority_class_enum
10
+ - semantic_constraints
11
+ domain_admission_required_fields:
12
+ - domain_id
13
+ - domain_root
14
+ - authority_class
15
+ - owner
16
+ - admitted_by
17
+ - allowed_surface_classes
18
+ - forbidden_surface_classes
19
+ - validation_commands
20
+ - migration_disposition_when_unadmitted
21
+ shared_enum_ref: shared-enums.yaml
22
+ domain_admissions:
23
+ - domain_id: project
24
+ domain_root: .nimi/spec/project
25
+ authority_class: active_product
26
+ owner: project
27
+ admitted_by: nimicoding_init_default_project_domain
28
+ allowed_surface_classes: [product_authority, product_authority_table, thin_guidance, support_registry]
29
+ forbidden_surface_classes: [derived_view, spec_generation_state, audit_evidence_state, lifecycle_progress_state, candidate_roadmap, methodology_authority]
30
+ validation_commands: [pnpm exec nimicoding validate-spec-tree -- .nimi/spec]
31
+ migration_disposition_when_unadmitted: block
32
+ domain_authority_class_enum:
33
+ - active_product
34
+ - package_projection_anchor_only
35
+ - migration_input_only
36
+ - excluded_from_spec
37
+ migration_disposition_when_unadmitted_enum:
38
+ - move_local
39
+ - move_package
40
+ - split
41
+ - delete
42
+ - block
43
+ domain_rules:
44
+ - domain_id: project
45
+ required_authority_class: active_product
46
+ admission_required: true
47
+ semantic_constraints:
48
+ - directory_presence_does_not_admit_product_authority
49
+ - unadmitted_domain_must_not_be_used_as_implementation_authority
50
+ - product_domain_admission_must_name_validation_commands
51
+ - package_projection_domains_must_not_define_product_rules
52
+ - active_product_domain_does_not_admit_generated_evidence_or_state_surfaces
53
+ - product_authority_tables_must_declare_table_family
54
+ - thin_guidance_must_not_carry_rule_body
55
+ - package_default_domain_admission_must_remain_generic_project_skeleton
56
+ - product_hosts_must_own_domain_specific_admission_as_host_profile_override
@@ -0,0 +1,80 @@
1
+ version: 1
2
+ contract:
3
+ id: nimicoding.spec-migration-inventory.v1
4
+ owner: nimi-coding
5
+ purpose: Define machine-readable classification and migration output for current host spec surfaces.
6
+ required_top_level_fields:
7
+ - version
8
+ - inventory
9
+ - disposition_enum
10
+ - target_class_enum
11
+ - semantic_constraints
12
+ inventory_entry_required_fields:
13
+ - source_path
14
+ - current_inferred_class
15
+ - target_class
16
+ - disposition
17
+ - target_root
18
+ - owner
19
+ - required_confirmation
20
+ - ambiguity
21
+ - evidence
22
+ - validation_commands
23
+ shared_enum_ref: shared-enums.yaml
24
+ disposition_enum:
25
+ - keep
26
+ - move_package
27
+ - move_local
28
+ - split
29
+ - rewrite
30
+ - delete
31
+ - block
32
+ target_class_enum:
33
+ - product_authority
34
+ - product_authority_table
35
+ - product_admission_registry
36
+ - thin_guidance
37
+ - derived_view
38
+ - spec_generation_state
39
+ - audit_evidence_state
40
+ - operational_local_artifact
41
+ - methodology_authority
42
+ - host_projection_anchor
43
+ - nimicoding_managed_projection
44
+ - candidate_roadmap
45
+ - support_registry
46
+ - lifecycle_progress_state
47
+ required_confirmation_enum:
48
+ - none
49
+ - product_semantic_fork
50
+ - owner_ambiguity
51
+ - package_boundary_ambiguity
52
+ - destructive_deletion
53
+ ambiguity_required_fields:
54
+ - posture
55
+ - reason
56
+ - candidate_owners
57
+ ambiguity_posture_enum:
58
+ - none
59
+ - blocks_migration
60
+ inventory: []
61
+ inventory_generation_rules:
62
+ - classify_every_file_under_.nimi/spec
63
+ - classify_nimicoding_managed_projections_under_.nimi/methodology_.nimi/contracts_and_.nimi/config
64
+ - generate_split_children_for_mixed_authority_and_state_files
65
+ - use_block_only_for_user_confirmation_cases
66
+ - use_keep_for_nimicoding_init_or_sync_managed_projections
67
+ - use_move_package_for_package_methodology_when_copied_under_.nimi/spec
68
+ - use_move_local_for_audit_lifecycle_and_operational_state
69
+ - use_delete_for_derived_views_with_stdout_view_replacement
70
+ - use_delete_for_obsolete_generated_or_one_time_state_without_durable_target
71
+ semantic_constraints:
72
+ - inventory_must_not_modify_files
73
+ - every_candidate_source_gets_one_inventory_entry_or_split_children
74
+ - split_entries_must_name_child_targets
75
+ - block_entries_require_user_confirmation_before_migration
76
+ - future_under_spec_must_not_have_keep_disposition
77
+ - nimicoding_managed_projection_must_have_keep_disposition_and_must_not_be_promoted_to_product_authority
78
+ - product_admission_registry_must_not_be_moved_to_package
79
+ - generated_views_default_to_delete_with_stdout_view
80
+ - audit_state_defaults_to_move_local
@@ -0,0 +1,91 @@
1
+ version: 1
2
+ contract:
3
+ id: nimicoding.spec-surface-negative-fixtures.v1
4
+ owner: nimi-coding
5
+ fixture_required_fields:
6
+ - fixture_id
7
+ - contract_ref
8
+ - setup
9
+ - expected_failure
10
+ - validator_scope
11
+ fixtures:
12
+ - fixture_id: generated_view_under_product_authority
13
+ contract_ref: placement-contract.schema.yaml
14
+ setup: .nimi/spec/runtime/kernel/generated/example.md
15
+ expected_failure: derived_view_under_product_authority_root
16
+ validator_scope: placement
17
+ - fixture_id: spec_generation_state_under_meta
18
+ contract_ref: placement-contract.schema.yaml
19
+ setup: .nimi/spec/_meta/spec-generation-audit.yaml
20
+ expected_failure: spec_generation_state_under_spec
21
+ validator_scope: placement
22
+ - fixture_id: rule_evidence_with_coverage_status_under_kernel_tables
23
+ contract_ref: table-family.schema.yaml
24
+ setup: .nimi/spec/runtime/kernel/tables/rule-evidence.yaml with coverage_status
25
+ expected_failure: table_contains_forbidden_state_or_audit_field
26
+ validator_scope: table_family
27
+ - fixture_id: future_backlog_under_spec
28
+ contract_ref: domain-admission.schema.yaml
29
+ setup: .nimi/spec/future/kernel/tables/backlog-items.yaml
30
+ expected_failure: excluded_domain_retained_under_spec
31
+ validator_scope: domain_admission
32
+ - fixture_id: thin_guidance_with_normative_body
33
+ contract_ref: surface-taxonomy.schema.yaml
34
+ setup: .nimi/spec/desktop/local-ai.md containing MUST or 必须
35
+ expected_failure: guidance_defines_rule_body
36
+ validator_scope: guidance
37
+ - fixture_id: package_methodology_copied_to_spec
38
+ contract_ref: projection-edge.schema.yaml
39
+ setup: .nimi/spec/product-scope.yaml containing package methodology body
40
+ expected_failure: package_body_promoted_to_product_authority
41
+ validator_scope: projection
42
+ - fixture_id: nimicoding_managed_projection_passes
43
+ contract_ref: placement-contract.schema.yaml
44
+ setup: .nimi/contracts/topic.schema.yaml as init-managed projection
45
+ expected_failure: none
46
+ validator_scope: placement
47
+ - fixture_id: nimicoding_config_projection_passes
48
+ contract_ref: placement-contract.schema.yaml
49
+ setup: .nimi/config/spec-generation-inputs.yaml as init-managed projection
50
+ expected_failure: none
51
+ validator_scope: placement
52
+ - fixture_id: nimicoding_methodology_projection_passes
53
+ contract_ref: placement-contract.schema.yaml
54
+ setup: .nimi/methodology/spec-reconstruction.yaml as init-managed projection
55
+ expected_failure: none
56
+ validator_scope: placement
57
+ - fixture_id: blanket_v2_docs_input_root
58
+ contract_ref: spec-generation-inputs.schema.yaml
59
+ setup: .nimi/config/spec-generation-inputs.yaml docs_inputs root "."
60
+ expected_failure: invalid_spec_generation_inputs_config
61
+ validator_scope: doctor
62
+ - fixture_id: lifecycle_cutover_status_under_spec
63
+ contract_ref: placement-contract.schema.yaml
64
+ setup: .nimi/spec/_meta/spec-authority-cutover-readiness.yaml with current phase/status
65
+ expected_failure: lifecycle_progress_state_under_spec
66
+ validator_scope: placement
67
+ - fixture_id: generated_file_referenced_as_authority
68
+ contract_ref: projection-edge.schema.yaml
69
+ setup: product authority markdown links to .nimi/spec/runtime/kernel/generated/rule-evidence.md as authority
70
+ expected_failure: derived_view_referenced_as_authority
71
+ validator_scope: projection
72
+ - fixture_id: kernel_table_without_family
73
+ contract_ref: table-family.schema.yaml
74
+ setup: .nimi/spec/runtime/kernel/tables/example.yaml without table_family
75
+ expected_failure: missing_table_family
76
+ validator_scope: table_family
77
+ - fixture_id: tracked_non_product_without_admission
78
+ contract_ref: tracked-output-admission.schema.yaml
79
+ setup: .nimi/audit/example.yaml
80
+ expected_failure: tracked_non_product_without_admission
81
+ validator_scope: tracked_output
82
+ - fixture_id: valid_state_machine_table_passes
83
+ contract_ref: table-family.schema.yaml
84
+ setup: .nimi/spec/runtime/kernel/tables/job-states.yaml with table_family state_machine
85
+ expected_failure: none
86
+ validator_scope: table_family
87
+ - fixture_id: valid_minimal_package_anchor_passes
88
+ contract_ref: projection-edge.schema.yaml
89
+ setup: .nimi/spec/_meta/nimi-coding-admission-anchor.yaml with package id/version/root/edge refs only
90
+ expected_failure: none
91
+ validator_scope: projection
@@ -0,0 +1,163 @@
1
+ version: 1
2
+ contract:
3
+ id: nimicoding.placement-contract.v1
4
+ owner: nimi-coding
5
+ purpose: Bind roots to surface classes and fail closed on mismatches.
6
+ required_top_level_fields:
7
+ - version
8
+ - placement_rules
9
+ - root_policy
10
+ - forbidden_roots
11
+ - fail_closed_cases
12
+ placement_rule_required_fields:
13
+ - root_pattern
14
+ - allowed_classes
15
+ - owner
16
+ - tracking_policy
17
+ - requires_admission
18
+ - validator_scope
19
+ shared_enum_ref: shared-enums.yaml
20
+ placement_rules:
21
+ - root_pattern: .nimi/spec/<domain>/kernel/*.md
22
+ allowed_classes: [product_authority]
23
+ owner: product_domain
24
+ tracking_policy: tracked_required
25
+ requires_admission: domain_admission
26
+ validator_scope: product_authority
27
+ - root_pattern: .nimi/spec/<domain>/kernel/tables/*.yaml
28
+ allowed_classes: [product_authority_table, support_registry]
29
+ owner: product_domain
30
+ tracking_policy: tracked_required
31
+ requires_admission: domain_admission_and_table_family
32
+ validator_scope: table_family
33
+ - root_pattern: .nimi/spec/<domain>/*.md
34
+ allowed_classes: [thin_guidance]
35
+ owner: product_domain
36
+ tracking_policy: tracked_required
37
+ requires_admission: domain_admission
38
+ validator_scope: thin_guidance
39
+ - root_pattern: .nimi/spec/INDEX.md
40
+ allowed_classes: [thin_guidance]
41
+ owner: product_domain
42
+ tracking_policy: tracked_required
43
+ requires_admission: none
44
+ validator_scope: thin_guidance
45
+ - root_pattern: .nimi/spec/high-risk-admissions.yaml
46
+ allowed_classes: [product_admission_registry]
47
+ owner: product_governance
48
+ tracking_policy: tracked_required
49
+ requires_admission: packaged_schema
50
+ validator_scope: product_admission_registry
51
+ - root_pattern: .nimi/spec/_meta/<package>-admission-anchor.yaml
52
+ allowed_classes: [host_projection_anchor]
53
+ owner: host_projection
54
+ tracking_policy: tracked_only_with_explicit_admission
55
+ requires_admission: projection_edge
56
+ validator_scope: host_projection
57
+ - root_pattern: .nimi/config/host-overlay.yaml
58
+ allowed_classes: [host_projection_anchor]
59
+ owner: host_projection
60
+ tracking_policy: tracked_only_with_explicit_admission
61
+ requires_admission: projection_edge
62
+ validator_scope: host_overlay
63
+ - root_pattern: .nimi/{config,contracts,methodology}/**
64
+ allowed_classes: [nimicoding_managed_projection]
65
+ owner: nimi_coding_package_projection
66
+ tracking_policy: tracked_required
67
+ requires_admission: nimicoding_init_or_sync_projection
68
+ validator_scope: nimicoding_managed_projection
69
+ - root_pattern: package://@nimiplatform/nimi-coding/{spec,methodology,contracts,config}/**
70
+ allowed_classes: [methodology_authority, support_registry]
71
+ owner: nimi_coding_package
72
+ tracking_policy: tracked_required
73
+ requires_admission: package_authority
74
+ validator_scope: package_authority
75
+ - root_pattern: .nimi/topics/**
76
+ allowed_classes: [lifecycle_progress_state, candidate_roadmap]
77
+ owner: topic_lifecycle
78
+ tracking_policy: local_only
79
+ requires_admission: none
80
+ validator_scope: topic_lifecycle
81
+ - root_pattern: .nimi/local/state/**
82
+ allowed_classes: [spec_generation_state, lifecycle_progress_state, operational_local_artifact]
83
+ owner: execution_workflow
84
+ tracking_policy: local_only
85
+ requires_admission: none
86
+ validator_scope: local_state
87
+ - root_pattern: .nimi/local/audit/**
88
+ allowed_classes: [audit_evidence_state, operational_local_artifact]
89
+ owner: audit_workflow
90
+ tracking_policy: local_only
91
+ requires_admission: none
92
+ validator_scope: audit_state
93
+ - root_pattern: .nimi/{derived,state,audit,roadmap}/**
94
+ allowed_classes: [derived_view, spec_generation_state, audit_evidence_state, candidate_roadmap]
95
+ owner: tracked_output_admission
96
+ tracking_policy: tracked_only_with_explicit_admission
97
+ requires_admission: tracked_output_admission
98
+ validator_scope: tracked_output
99
+ allowed_spec_meta_rules:
100
+ - root_pattern: .nimi/spec/_meta/<package>-admission-anchor.yaml
101
+ allowed_classes: [host_projection_anchor]
102
+ required_fields: [package_id, package_version, package_truth_root, projection_edges, must_not_override]
103
+ - root_pattern: .nimi/spec/_meta/**
104
+ allowed_classes: []
105
+ allowed_dispositions: [move_package, move_local, delete]
106
+ - root_pattern: .nimi/config/host-overlay.yaml
107
+ allowed_classes: [host_projection_anchor]
108
+ required_fields: [package_id, package_version, package_truth_root, overlay_fields, drift_check_command]
109
+ root_policy:
110
+ product_authority_root: .nimi/spec
111
+ package_authority_root: package://@nimiplatform/nimi-coding
112
+ topic_lifecycle_root: .nimi/topics
113
+ local_artifact_root: .nimi/local
114
+ tracked_non_product_roots:
115
+ default: disabled
116
+ roots:
117
+ - .nimi/derived
118
+ - .nimi/state
119
+ - .nimi/audit
120
+ - .nimi/roadmap
121
+ forbidden_roots:
122
+ candidate_roadmap:
123
+ - .nimi/spec/**
124
+ derived_view:
125
+ - .nimi/spec/**/kernel/generated/**
126
+ - .nimi/spec/generated/**
127
+ - .nimi/local/derived/**
128
+ spec_generation_state:
129
+ - .nimi/spec/_meta/spec-generation-audit/**
130
+ - .nimi/spec/_meta/spec-generation-audit.yaml
131
+ audit_evidence_state:
132
+ - .nimi/spec/**/kernel/**
133
+ - .nimi/spec/_meta/**
134
+ lifecycle_progress_state:
135
+ - .nimi/spec/**
136
+ methodology_authority:
137
+ - .nimi/spec/**
138
+ forbidden_root_exceptions:
139
+ nimicoding_managed_projection:
140
+ - .nimi/methodology/**
141
+ - .nimi/contracts/**
142
+ - .nimi/config/**
143
+ tracking_policy_notes:
144
+ .nimi/topics/**:
145
+ tracking_policy: local_only
146
+ meaning: local_human_authored_lifecycle_workspace_not_product_authority
147
+ .nimi/{config,contracts,methodology}/**:
148
+ tracking_policy: tracked_required
149
+ meaning: project_local_nimicoding_managed_projection_created_by_init_or_sync_not_product_authority
150
+ fail_closed_cases:
151
+ - class_root_mismatch
152
+ - file_under_.nimi/spec_without_product_or_minimal_anchor_class
153
+ - file_under_kernel_tables_without_table_family
154
+ - _meta_file_without_minimal_anchor_or_package_migration_disposition
155
+ - tracked_non_product_file_without_admission
156
+ - nimicoding_managed_projection_promoted_to_product_authority
157
+ - future_or_backlog_under_.nimi/spec
158
+ - product_admission_registry_contains_package_methodology_body
159
+ semantic_constraints:
160
+ - path_shape_is_never_sufficient_authority_proof
161
+ - keep_move_package_move_local_split_rewrite_delete_block_must_be_explicit
162
+ - product_semantic_forks_block_for_user_confirmation
163
+ - high_risk_admission_records_stay_product_governance_truth_while_schema_and_cli_stay_package_owned