@nimiplatform/nimi-coding 0.3.0 → 0.4.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 (118) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/CONTRIBUTING.md +3 -3
  3. package/README.md +285 -41
  4. package/README.zh-CN.md +294 -31
  5. package/bin/nimicoding.mjs +1 -1
  6. package/cli/commands/authority.mjs +849 -0
  7. package/cli/commands/clear.mjs +27 -7
  8. package/cli/commands/doctor.mjs +10 -1
  9. package/cli/commands/start.mjs +23 -27
  10. package/cli/commands/sync.mjs +21 -101
  11. package/cli/constants.mjs +7 -31
  12. package/cli/dev/check-authority-surface.mjs +173 -0
  13. package/cli/dev/check-product-conformance.mjs +917 -0
  14. package/cli/help.mjs +10 -17
  15. package/cli/index.mjs +6 -47
  16. package/cli/lib/authority/anchors.mjs +491 -0
  17. package/cli/lib/authority/audit.mjs +490 -0
  18. package/cli/lib/authority/closed-sets.mjs +646 -0
  19. package/cli/lib/authority/compile.mjs +110 -0
  20. package/cli/lib/authority/consumers.mjs +470 -0
  21. package/cli/lib/authority/diagnostics.mjs +87 -0
  22. package/cli/lib/authority/diff.mjs +287 -0
  23. package/cli/lib/authority/discover.mjs +447 -0
  24. package/cli/lib/authority/evidence-snapshot.mjs +1 -0
  25. package/cli/lib/authority/evidence.mjs +1432 -0
  26. package/cli/lib/authority/format.mjs +197 -0
  27. package/cli/lib/authority/git-snapshot.mjs +1065 -0
  28. package/cli/lib/authority/graph.mjs +351 -0
  29. package/cli/lib/authority/impact.mjs +252 -0
  30. package/cli/lib/authority/lexicon.mjs +55 -0
  31. package/cli/lib/authority/query.mjs +162 -0
  32. package/cli/lib/authority/repository-corpus.mjs +37 -0
  33. package/cli/lib/authority/repository-inventory.mjs +34 -0
  34. package/cli/lib/authority/review.mjs +222 -0
  35. package/cli/lib/authority/sarif.mjs +181 -0
  36. package/cli/lib/authority/scope-bindings.mjs +225 -0
  37. package/cli/lib/authority/source-map.mjs +105 -0
  38. package/cli/lib/authority/source-markdown.mjs +167 -0
  39. package/cli/lib/authority/source-yaml.mjs +312 -0
  40. package/cli/lib/authority/surface.mjs +79 -0
  41. package/cli/lib/authority/terms.mjs +421 -0
  42. package/cli/lib/authority/tracked-text.mjs +70 -0
  43. package/cli/lib/authority/validate.mjs +308 -0
  44. package/cli/lib/bootstrap.mjs +55 -71
  45. package/cli/lib/doctor.mjs +40 -123
  46. package/cli/lib/entrypoints.mjs +103 -105
  47. package/cli/lib/fs-helpers.mjs +139 -15
  48. package/cli/lib/internal/governance/config.mjs +0 -36
  49. package/cli/lib/shared.mjs +8 -21
  50. package/cli/lib/sync.mjs +81 -92
  51. package/cli/lib/value-helpers.mjs +0 -26
  52. package/cli/lib/yaml-helpers.mjs +1 -124
  53. package/cli/seeds/bootstrap.mjs +31 -87
  54. package/cli/seeds/seed-policy.yaml +9 -63
  55. package/contracts/authority-evidence-bindings.schema.yaml +53 -0
  56. package/contracts/authority-evidence-probe-results.schema.yaml +38 -0
  57. package/contracts/authority-impact-dispositions.schema.yaml +13 -0
  58. package/contracts/authority-scope-bindings.schema.yaml +15 -0
  59. package/contracts/authority-source.schema.yaml +64 -0
  60. package/contracts/authority-verifier-bindings.schema.yaml +20 -0
  61. package/methodology/authority-authoring.yaml +144 -0
  62. package/methodology/core.yaml +31 -26
  63. package/package.json +10 -6
  64. package/spec/authority-anchors.yaml +99 -0
  65. package/spec/authority-audit.yaml +85 -0
  66. package/spec/authority-authoring.yaml +150 -0
  67. package/spec/authority-closed-sets.yaml +65 -0
  68. package/spec/authority-consumers.yaml +70 -0
  69. package/spec/authority-context.yaml +50 -0
  70. package/spec/authority-discovery.yaml +119 -0
  71. package/spec/authority-evidence.yaml +200 -0
  72. package/spec/authority-graph.yaml +59 -0
  73. package/spec/authority-impact.yaml +84 -0
  74. package/spec/authority-review.yaml +89 -0
  75. package/spec/authority-terms.yaml +59 -0
  76. package/spec/product-scope.yaml +36 -23
  77. package/cli/commands/blueprint-audit.mjs +0 -91
  78. package/cli/commands/classify-spec-tree.mjs +0 -5
  79. package/cli/commands/generate-spec-derived-docs.mjs +0 -151
  80. package/cli/commands/generate-spec-migration-plan.mjs +0 -30
  81. package/cli/commands/surface-validator-command.mjs +0 -49
  82. package/cli/commands/validate-domain-admission.mjs +0 -5
  83. package/cli/commands/validate-guidance-bodies.mjs +0 -5
  84. package/cli/commands/validate-placement.mjs +0 -5
  85. package/cli/commands/validate-projection-edges.mjs +0 -5
  86. package/cli/commands/validate-spec-audit.mjs +0 -27
  87. package/cli/commands/validate-spec-governance.mjs +0 -124
  88. package/cli/commands/validate-spec-tree.mjs +0 -27
  89. package/cli/commands/validate-table-family.mjs +0 -5
  90. package/cli/commands/validate-tracked-output-admission.mjs +0 -5
  91. package/cli/lib/blueprint-audit.mjs +0 -363
  92. package/cli/lib/contracts.mjs +0 -21
  93. package/cli/lib/internal/contracts-loaders.mjs +0 -47
  94. package/cli/lib/internal/contracts-parse.mjs +0 -192
  95. package/cli/lib/internal/governance/runner.mjs +0 -35
  96. package/cli/lib/internal/surface-taxonomy-validators.mjs +0 -1147
  97. package/cli/lib/internal/validators-shared.mjs +0 -12
  98. package/cli/lib/internal/validators-spec-helpers.mjs +0 -52
  99. package/cli/lib/internal/validators-spec.mjs +0 -380
  100. package/cli/lib/validators.mjs +0 -30
  101. package/config/bootstrap.yaml +0 -6
  102. package/config/spec-generation-inputs.yaml +0 -41
  103. package/contracts/domain-admission.schema.yaml +0 -56
  104. package/contracts/migration-inventory.schema.yaml +0 -15
  105. package/contracts/negative-fixtures.yaml +0 -26
  106. package/contracts/placement-contract.schema.yaml +0 -127
  107. package/contracts/projection-edge.schema.yaml +0 -46
  108. package/contracts/shared-enums.yaml +0 -63
  109. package/contracts/spec-generation-audit.schema.yaml +0 -46
  110. package/contracts/spec-generation-inputs.schema.yaml +0 -43
  111. package/contracts/spec-layout.schema.yaml +0 -32
  112. package/contracts/surface-taxonomy.schema.yaml +0 -139
  113. package/contracts/table-family.schema.yaml +0 -133
  114. package/contracts/tracked-output-admission.schema.yaml +0 -17
  115. package/methodology/four-closure-policy.yaml +0 -20
  116. package/methodology/role-separation-policy.yaml +0 -22
  117. package/methodology/spec-reconstruction.yaml +0 -69
  118. package/spec/_meta/spec-tree-model.yaml +0 -44
@@ -1,127 +0,0 @@
1
- version: 2
2
- contract:
3
- id: nimicoding.placement-contract.v2
4
- owner: nimi-coding
5
- purpose: Bind each governed root to its allowed authority class.
6
- required_top_level_fields: [version, placement_rules, root_policy, forbidden_roots, fail_closed_cases]
7
- placement_rule_required_fields: [root_pattern, allowed_classes, owner, tracking_policy, requires_admission, validator_scope]
8
- shared_enum_ref: shared-enums.yaml
9
- placement_rules:
10
- - root_pattern: .nimi/spec/<domain>/kernel/*.md
11
- allowed_classes: [product_authority]
12
- owner: product_domain
13
- tracking_policy: tracked_required
14
- requires_admission: domain_admission
15
- validator_scope: product_authority
16
- - root_pattern: .nimi/spec/<domain>/kernel/tables/*.yaml
17
- allowed_classes: [product_authority_table, support_registry]
18
- owner: product_domain
19
- tracking_policy: tracked_required
20
- requires_admission: domain_admission_and_table_family
21
- validator_scope: table_family
22
- - root_pattern: .nimi/spec/<domain>/*.md
23
- allowed_classes: [thin_guidance]
24
- owner: product_domain
25
- tracking_policy: tracked_required
26
- requires_admission: domain_admission
27
- validator_scope: thin_guidance
28
- - root_pattern: .nimi/spec/INDEX.md
29
- allowed_classes: [thin_guidance]
30
- owner: product_domain
31
- tracking_policy: tracked_required
32
- requires_admission: none
33
- validator_scope: thin_guidance
34
- - root_pattern: host-spec-layout://host_instruction_paths
35
- allowed_classes: [host_instruction]
36
- owner: product_host
37
- tracking_policy: tracked_only_with_explicit_admission
38
- requires_admission: host_spec_layout
39
- validator_scope: host_instruction
40
- - root_pattern: host-spec-layout://tracked_derived_projections
41
- allowed_classes: [tracked_derived_projection]
42
- owner: generator
43
- tracking_policy: tracked_only_with_explicit_admission
44
- requires_admission: host_spec_layout
45
- validator_scope: tracked_derived_projection
46
- - root_pattern: .nimi/spec/_meta/<package>-admission-anchor.yaml
47
- allowed_classes: [host_projection_anchor]
48
- owner: host_projection
49
- tracking_policy: tracked_only_with_explicit_admission
50
- requires_admission: projection_edge
51
- validator_scope: host_projection
52
- - root_pattern: .nimi/config/host-overlay.yaml
53
- allowed_classes: [host_projection_anchor]
54
- owner: host_projection
55
- tracking_policy: tracked_only_with_explicit_admission
56
- requires_admission: projection_edge
57
- validator_scope: host_overlay
58
- - root_pattern: .nimi/{config,contracts,methodology}/**
59
- allowed_classes: [nimicoding_managed_projection]
60
- owner: nimi_coding_package_projection
61
- tracking_policy: tracked_required
62
- requires_admission: nimicoding_start_or_sync_projection
63
- validator_scope: nimicoding_managed_projection
64
- - root_pattern: package://@nimiplatform/nimi-coding/{spec,methodology,contracts,config}/**
65
- allowed_classes: [methodology_authority, support_registry]
66
- owner: nimi_coding_package
67
- tracking_policy: tracked_required
68
- requires_admission: package_authority
69
- validator_scope: package_authority
70
- - root_pattern: .nimi/local/state/spec-generation/**
71
- allowed_classes: [spec_generation_state]
72
- owner: spec_generator
73
- tracking_policy: local_only
74
- requires_admission: none
75
- validator_scope: spec_generation_state
76
- - root_pattern: .nimi/local/audit/**
77
- allowed_classes: [audit_evidence_state, operational_local_artifact]
78
- owner: verification_process
79
- tracking_policy: local_only
80
- requires_admission: none
81
- validator_scope: audit_evidence
82
- - root_pattern: .nimi/local/**
83
- allowed_classes: [operational_local_artifact]
84
- owner: external_tooling
85
- tracking_policy: local_only
86
- requires_admission: none
87
- validator_scope: operational_local
88
- - root_pattern: .nimi/{derived,state,audit}/**
89
- allowed_classes: [derived_view, spec_generation_state, audit_evidence_state]
90
- owner: tracked_output_admission
91
- tracking_policy: tracked_only_with_explicit_admission
92
- requires_admission: tracked_output_admission
93
- validator_scope: tracked_output
94
- allowed_spec_meta_rules:
95
- - root_pattern: .nimi/spec/_meta/<package>-admission-anchor.yaml
96
- allowed_classes: [host_projection_anchor]
97
- required_fields: [package_id, package_version, package_truth_root, projection_edges, must_not_override]
98
- - root_pattern: .nimi/spec/_meta/**
99
- allowed_classes: []
100
- allowed_dispositions: [move_package, move_local, delete]
101
- root_policy:
102
- product_authority_root: .nimi/spec
103
- package_authority_root: package://@nimiplatform/nimi-coding
104
- local_artifact_root: .nimi/local
105
- tracked_non_product_roots:
106
- default: disabled
107
- roots: [.nimi/derived, .nimi/state, .nimi/audit]
108
- forbidden_roots:
109
- derived_view: [".nimi/spec/**/kernel/generated/**", ".nimi/spec/generated/**", ".nimi/local/derived/**"]
110
- spec_generation_state: [".nimi/spec/**"]
111
- audit_evidence_state: [".nimi/spec/**"]
112
- operational_local_artifact: [".nimi/spec/**"]
113
- methodology_authority: [".nimi/spec/**"]
114
- tracked_derived_projection: ["unadmitted:.nimi/spec/**/kernel/generated/**", "unadmitted:.nimi/spec/generated/**"]
115
- forbidden_root_exceptions:
116
- nimicoding_managed_projection: [".nimi/methodology/**", ".nimi/contracts/**", ".nimi/config/**"]
117
- fail_closed_cases:
118
- - root_has_no_matching_placement_rule
119
- - surface_class_not_allowed_for_root
120
- - required_admission_missing
121
- - non_product_state_stored_under_product_authority
122
- - generated_projection_under_spec_without_host_layout_admission
123
- - package_methodology_copied_under_product_authority
124
- - tracked_non_product_output_missing_admission
125
- semantic_constraints:
126
- - placement_is_validated_independently_of_host_execution
127
- - local_evidence_must_not_become_product_authority
@@ -1,46 +0,0 @@
1
- version: 2
2
- contract:
3
- id: nimicoding.projection-edge.v2
4
- owner: nimi-coding
5
- purpose: Declare one-way projections without granting source authority to the projection.
6
- required_top_level_fields: [version, projection_edges, edge_kind_enum, semantic_constraints]
7
- projection_edge_required_fields: [edge_id, edge_kind, source_ref, source_class, source_owner, target_ref, target_class, target_owner, allowed_fields, forbidden_fields, drift_check_command]
8
- projection_edges:
9
- - edge_id: package_to_managed_methodology
10
- edge_kind: package_to_managed_projection
11
- source_ref: package://@nimiplatform/nimi-coding/methodology/**
12
- source_class: methodology_authority
13
- source_owner: nimi-coding
14
- target_ref: .nimi/methodology/**
15
- target_class: nimicoding_managed_projection
16
- target_owner: nimi-coding
17
- allowed_fields: [all_package_owned_fields]
18
- forbidden_fields: [host_product_authority_override]
19
- drift_check_command: pnpm exec nimicoding sync --check
20
- - edge_id: package_to_managed_contracts
21
- edge_kind: package_to_managed_projection
22
- source_ref: package://@nimiplatform/nimi-coding/contracts/**
23
- source_class: methodology_authority
24
- source_owner: nimi-coding
25
- target_ref: .nimi/contracts/**
26
- target_class: nimicoding_managed_projection
27
- target_owner: nimi-coding
28
- allowed_fields: [all_package_owned_fields]
29
- forbidden_fields: [host_product_authority_override]
30
- drift_check_command: pnpm exec nimicoding sync --check
31
- - edge_id: package_to_managed_config
32
- edge_kind: package_to_managed_projection
33
- source_ref: package://@nimiplatform/nimi-coding/config/**
34
- source_class: methodology_authority
35
- source_owner: nimi-coding
36
- target_ref: .nimi/config/**
37
- target_class: nimicoding_managed_projection
38
- target_owner: nimi-coding
39
- allowed_fields: [package_owned_defaults]
40
- forbidden_fields: [host_product_authority_override]
41
- drift_check_command: pnpm exec nimicoding sync --check
42
- edge_kind_enum: [package_to_managed_projection, package_to_host_anchor, authority_to_derived_view, authority_to_audit_evidence]
43
- semantic_constraints:
44
- - projection_target_must_not_gain_more_authority_than_source
45
- - projection_edges_do_not_define_execution_order
46
- - drift_checks_must_be_deterministic
@@ -1,63 +0,0 @@
1
- version: 2
2
- contract:
3
- id: nimicoding.spec-surface-shared-enums.v2
4
- owner: nimi-coding
5
- surface_class_enum:
6
- - product_authority
7
- - product_authority_table
8
- - thin_guidance
9
- - host_instruction
10
- - tracked_derived_projection
11
- - derived_view
12
- - spec_generation_state
13
- - audit_evidence_state
14
- - operational_local_artifact
15
- - methodology_authority
16
- - nimicoding_managed_projection
17
- - host_projection_anchor
18
- - support_registry
19
- authority_rank_enum:
20
- - active_product_canonical
21
- - package_canonical
22
- - package_projection_support
23
- - support_only
24
- - guidance_only
25
- - derived_non_authority
26
- - evidence_only
27
- - operational_local
28
- tracking_policy_enum:
29
- - tracked_required
30
- - tracked_forbidden
31
- - local_only
32
- - tracked_only_with_explicit_admission
33
- mutability_enum:
34
- - human_admitted
35
- - package_admitted
36
- - package_projected
37
- - generated_reproducible
38
- - operational_snapshot
39
- - disposable
40
- disposition_enum:
41
- - keep
42
- - move_package
43
- - move_local
44
- - split
45
- - rewrite
46
- - delete
47
- - block
48
- confirmation_reason_enum:
49
- - none
50
- - product_semantic_fork
51
- - owner_ambiguity
52
- - package_boundary_ambiguity
53
- - destructive_deletion
54
- artifact_class_enum:
55
- - derived_manifest
56
- - derived_summary
57
- - state_manifest
58
- - audit_index
59
- - audit_summary
60
- semantic_constraints:
61
- - all_contracts_must_use_underscore_enum_values
62
- - hyphenated_dispositions_are_forbidden
63
- - missing_enum_ref_fails_contract_validation
@@ -1,46 +0,0 @@
1
- version: 2
2
- audit_contract:
3
- id: canonical_spec_generation_audit
4
- owner: nimi-coding
5
- target_ref: .nimi/local/state/spec-generation/spec-generation-audit.yaml
6
- output_class: spec_generation_state
7
- required_top_level_fields:
8
- - generation_mode
9
- - canonical_target_root
10
- - declared_profile
11
- - input_roots
12
- - placement_report_ref
13
- - files
14
- optional_top_level_fields:
15
- - file_entry_refs
16
- file_entry_ref_contract:
17
- shard_root: .nimi/local/state/spec-generation/spec-generation-audit
18
- shard_payload_field: spec_generation_audit_file_entries
19
- required_shard_fields:
20
- - parent_ref
21
- - files
22
- required_file_entry_fields:
23
- - canonical_path
24
- - surface_class
25
- - source_refs
26
- - source_basis
27
- - coverage_status
28
- - unresolved_items
29
- source_basis_enum:
30
- - grounded
31
- - mixed_grounded_and_inferred
32
- - inferred
33
- coverage_status_enum:
34
- - complete
35
- - partial
36
- - placeholder_not_allowed
37
- hard_constraints:
38
- - every_generated_canonical_file_requires_a_matching_audit_entry
39
- - file_entry_refs_must_stay_under_local_spec_generation_state_root
40
- - file_entry_ref_shards_must_point_back_to_parent_audit
41
- - required_canonical_files_must_not_be_placeholder_not_allowed
42
- - unresolved_or_inferred_content_must_be_explicit
43
- - source_refs_must_stay_within_class_filtered_declared_inputs
44
- - no_empty_success_looking_audit_entries
45
- - generation_audit_must_not_be_written_under_.nimi/spec
46
- - generation_audit_must_not_be_used_as_product_authority
@@ -1,43 +0,0 @@
1
- version: 3
2
- input_contract:
3
- id: canonical_spec_generation_inputs
4
- owner: nimi-coding
5
- purpose: Admit class-filtered evidence for spec construction without owning the host's execution process.
6
- required_fields:
7
- - mode
8
- - canonical_target_root
9
- - code_inputs
10
- - docs_inputs
11
- - structure_inputs
12
- - local_inputs
13
- - forbidden_source_classes
14
- - generation_order
15
- - inference_rules
16
- - acceptance_mode
17
- mode_enum: [class_filtered]
18
- acceptance_mode_enum:
19
- - placement_validity_before_generation
20
- - semantic_and_structural_parity_when_blueprint_exists
21
- generation_order_enum:
22
- - classify_inputs
23
- - validate_placement
24
- - product_authority
25
- - product_authority_tables
26
- - thin_guides
27
- - derived_views
28
- - generation_audit
29
- docs_input_required_fields:
30
- - root
31
- - class_filter
32
- - allowed_surface_classes
33
- - forbidden_surface_classes
34
- - owner
35
- - use_as_authority
36
- - projection_edge_ref
37
- local_input_required_fields: [root, owner, allowed_surface_classes, use_as_authority]
38
- hard_constraints:
39
- - docs_roots_blanket_ingestion_is_forbidden
40
- - each_input_file_must_have_an_accepted_surface_class_before_render
41
- - local_inputs_must_not_be_used_as_product_authority
42
- - generated_or_audit_material_must_not_be_promoted_to_product_authority
43
- - host_native_execution_state_is_outside_this_contract
@@ -1,32 +0,0 @@
1
- version: 1
2
- contract:
3
- id: nimicoding.host-spec-layout.v1
4
- owner: nimi-coding
5
- purpose: Admit host-specific Spec paths without weakening package authority invariants.
6
- host_config_ref: .nimi/config/spec-layout.yaml
7
- required_top_level_fields: [version, contract_ref, spec_layout]
8
- layout_required_fields: [canonical_root, host_instruction_paths, tracked_derived_projections, table_family_extensions]
9
- tracked_derived_projection_required_fields:
10
- - projection_id
11
- - root
12
- - source_roots
13
- - generate_command
14
- - drift_check_command
15
- - required_marker
16
- table_family_extension_required_fields:
17
- - table_family
18
- - authority_class
19
- - required_fields
20
- - forbidden_fields
21
- semantic_constraints:
22
- - host_layout_is_validation_data_not_product_authority
23
- - host_layout_must_define_only_spec_surface_shape
24
- - host_instruction_paths_must_not_overlap_product_authority_patterns
25
- - tracked_derived_projection_is_never_product_authority
26
- - tracked_derived_projection_requires_a_deterministic_generator_and_drift_check
27
- - tracked_derived_projection_root_must_stay_inside_the_canonical_spec_tree
28
- - tracked_derived_projection_roots_must_match_generated_paths
29
- - tracked_derived_projection_root_must_not_overlap_direct_product_authority_files
30
- - host_instruction_paths_may_carry_repository_instructions_but_not_product_rules
31
- - table_family_extensions_define_shape_only_and_must_not_carry_product_rows
32
- - table_family_extensions_must_not_shadow_package_families
@@ -1,139 +0,0 @@
1
- version: 2
2
- contract:
3
- id: nimicoding.surface-taxonomy.v2
4
- owner: nimi-coding
5
- purpose: Define authority, support, generated, evidence, and local surfaces before spec validation.
6
- required_top_level_fields: [version, taxonomy, class_enum, authority_rank_enum, tracking_policy_enum, mutability_enum, semantic_constraints]
7
- class_required_fields: [class_id, owner_kind, authority_rank, allowed_roots, tracking_policy, mutability, reference_rules, promotion_rules, fail_closed_cases]
8
- shared_enum_ref: shared-enums.yaml
9
- taxonomy:
10
- - class_id: product_authority
11
- owner_kind: product_domain
12
- authority_rank: active_product_canonical
13
- allowed_roots: [".nimi/spec/<domain>/kernel/*.md"]
14
- tracking_policy: tracked_required
15
- mutability: human_admitted
16
- reference_rules: [may_reference_product_authority_table, may_reference_thin_guidance]
17
- promotion_rules: [authority_changes_require_explicit_product_decision]
18
- fail_closed_cases: [contains_audit_coverage, contains_operational_state, contains_package_methodology_body]
19
- - class_id: product_authority_table
20
- owner_kind: product_domain
21
- authority_rank: active_product_canonical
22
- allowed_roots: [".nimi/spec/<domain>/kernel/tables/*.yaml"]
23
- tracking_policy: tracked_required
24
- mutability: human_admitted
25
- reference_rules: [must_declare_table_family, may_reference_product_authority]
26
- promotion_rules: [table_family_must_be_product_authority_family]
27
- fail_closed_cases: [missing_table_family, contains_status_or_coverage_fields, unknown_table_family]
28
- - class_id: thin_guidance
29
- owner_kind: product_domain
30
- authority_rank: guidance_only
31
- allowed_roots: [".nimi/spec/<domain>/*.md", ".nimi/spec/INDEX.md"]
32
- tracking_policy: tracked_required
33
- mutability: human_admitted
34
- reference_rules: [may_reference_product_authority, must_not_define_rule_body]
35
- promotion_rules: [normative_content_must_move_to_product_authority]
36
- fail_closed_cases: [contains_must_rule_body, defines_new_rule_id, defines_acceptance_gate]
37
- - class_id: host_instruction
38
- owner_kind: product_host
39
- authority_rank: support_only
40
- allowed_roots: ["host-spec-layout://host_instruction_paths"]
41
- tracking_policy: tracked_only_with_explicit_admission
42
- mutability: human_admitted
43
- reference_rules: [may_define_repository_editing_and_validation_instructions, must_not_define_product_rule_body]
44
- promotion_rules: [product_semantics_must_move_to_product_authority]
45
- fail_closed_cases: [path_not_admitted_by_host_spec_layout, defines_product_rule]
46
- - class_id: tracked_derived_projection
47
- owner_kind: generator
48
- authority_rank: derived_non_authority
49
- allowed_roots: ["host-spec-layout://tracked_derived_projections"]
50
- tracking_policy: tracked_only_with_explicit_admission
51
- mutability: generated_reproducible
52
- reference_rules: [must_declare_source_roots, must_declare_generate_command, must_declare_drift_check, must_not_be_referenced_as_authority]
53
- promotion_rules: [never_promote_derived_output]
54
- fail_closed_cases: [missing_layout_admission, missing_generated_marker, referenced_as_authority, overlaps_direct_product_authority]
55
- - class_id: derived_view
56
- owner_kind: generator
57
- authority_rank: derived_non_authority
58
- allowed_roots: [stdout_view]
59
- tracking_policy: untracked_stdout_only
60
- mutability: generated_reproducible
61
- reference_rules: [may_reference_declared_inputs, must_not_be_referenced_as_authority]
62
- promotion_rules: [never_promote_derived_output]
63
- fail_closed_cases: [referenced_as_authority, stored_under_product_authority_root, written_to_local_derived]
64
- - class_id: spec_generation_state
65
- owner_kind: spec_generator
66
- authority_rank: operational_local
67
- allowed_roots: [".nimi/local/state/spec-generation/**"]
68
- tracking_policy: local_only
69
- mutability: operational_snapshot
70
- reference_rules: [may_cite_inputs_and_generation_command]
71
- promotion_rules: [never_promote_generation_state]
72
- fail_closed_cases: [stored_under_.nimi/spec, used_as_product_authority_input]
73
- - class_id: audit_evidence_state
74
- owner_kind: verification_process
75
- authority_rank: evidence_only
76
- allowed_roots: [".nimi/local/audit/**"]
77
- tracking_policy: local_only
78
- mutability: operational_snapshot
79
- reference_rules: [may_cite_authority_refs, must_not_override_authority]
80
- promotion_rules: [may_justify_an_explicit_authority_change]
81
- fail_closed_cases: [stored_under_product_authority_root, contains_private_material_in_tracked_root]
82
- - class_id: operational_local_artifact
83
- owner_kind: external_tooling
84
- authority_rank: operational_local
85
- allowed_roots: [".nimi/local/**"]
86
- tracking_policy: local_only
87
- mutability: disposable
88
- reference_rules: [may_be_cited_as_non_authoritative_evidence]
89
- promotion_rules: [never_promote_operational_artifact]
90
- fail_closed_cases: [stored_under_.nimi/spec]
91
- - class_id: methodology_authority
92
- owner_kind: nimi_coding_package
93
- authority_rank: package_canonical
94
- allowed_roots: ["package://@nimiplatform/nimi-coding/{spec,methodology,contracts,config}/**"]
95
- tracking_policy: tracked_required
96
- mutability: package_admitted
97
- reference_rules: [may_project_through_declared_projection_edge]
98
- promotion_rules: [may_be_consumed_by_host_anchor_only]
99
- fail_closed_cases: [copied_to_host_product_authority, stranded_in_host_spec]
100
- - class_id: nimicoding_managed_projection
101
- owner_kind: nimi_coding_package_projection
102
- authority_rank: package_projection_support
103
- allowed_roots: [".nimi/methodology/**", ".nimi/contracts/**", ".nimi/config/**"]
104
- tracking_policy: tracked_required
105
- mutability: package_projected
106
- reference_rules: [may_be_read_as_project_local_context, must_not_override_product_authority]
107
- promotion_rules: [created_or_refreshed_only_by_nimicoding_start_or_sync]
108
- fail_closed_cases: [copied_to_host_product_authority, promoted_to_product_spec, drift_without_sync_policy]
109
- - class_id: host_projection_anchor
110
- owner_kind: host_projection
111
- authority_rank: support_only
112
- allowed_roots: [".nimi/spec/_meta/<package>-admission-anchor.yaml", ".nimi/config/host-overlay.yaml"]
113
- tracking_policy: tracked_only_with_explicit_admission
114
- mutability: human_admitted
115
- reference_rules: [may_point_to_methodology_authority, must_be_minimal]
116
- promotion_rules: [never_promote_to_product_authority]
117
- fail_closed_cases: [contains_package_methodology_body, contains_operational_state]
118
- - class_id: support_registry
119
- owner_kind: package_or_product_owner
120
- authority_rank: support_only
121
- allowed_roots: ["package://@nimiplatform/nimi-coding/{config,contracts,spec}/**", ".nimi/spec/<domain>/kernel/tables/*.yaml"]
122
- tracking_policy: tracked_only_with_explicit_admission
123
- mutability: human_admitted
124
- reference_rules: [may_register_evidence_commands, may_reference_product_authority]
125
- promotion_rules: [semantic_rows_move_to_product_authority]
126
- fail_closed_cases: [contains_status_field, contains_coverage_field, contains_audit_date, contains_progress_field]
127
- class_enum: [product_authority, product_authority_table, thin_guidance, host_instruction, tracked_derived_projection, derived_view, spec_generation_state, audit_evidence_state, operational_local_artifact, methodology_authority, nimicoding_managed_projection, host_projection_anchor, support_registry]
128
- authority_rank_enum: [active_product_canonical, package_canonical, package_projection_support, support_only, guidance_only, derived_non_authority, evidence_only, operational_local]
129
- tracking_policy_enum: [tracked_required, tracked_forbidden, local_only, tracked_only_with_explicit_admission]
130
- mutability_enum: [human_admitted, package_admitted, package_projected, generated_reproducible, operational_snapshot, disposable]
131
- semantic_constraints:
132
- - every_candidate_file_gets_exactly_one_surface_class
133
- - unclassified_files_fail_closed
134
- - product_authority_classes_must_not_contain_operational_or_audit_state
135
- - generated_and_derived_classes_are_never_authority
136
- - tracked_derived_projection_requires_host_spec_layout_admission
137
- - package_methodology_and_package_spec_remain_package_owned
138
- - nimicoding_managed_projection_is_not_product_authority
139
- - tracked_non_product_outputs_require_tracked_output_admission
@@ -1,133 +0,0 @@
1
- version: 1
2
- contract:
3
- id: nimicoding.table-family.v1
4
- owner: nimi-coding
5
- purpose: Require every kernel table to declare an allowed semantic family.
6
- required_top_level_fields:
7
- - version
8
- - table_family_enum
9
- - table_family_required_fields
10
- - forbidden_fields_by_authority_class
11
- - semantic_constraints
12
- shared_enum_ref: shared-enums.yaml
13
- table_family_required_fields:
14
- - table_family
15
- - owner
16
- - authority_class
17
- - row_schema
18
- - allowed_references
19
- - forbidden_fields
20
- table_family_enum:
21
- - closed_enum
22
- - state_machine
23
- - protocol_surface
24
- - owner_matrix
25
- - product_catalog
26
- - product_state_machine
27
- - product_record_schema
28
- - gate_registry
29
- - support_registry
30
- authority_class_enum:
31
- - product_authority_table
32
- - support_registry
33
- table_families:
34
- - table_family: closed_enum
35
- authority_class: product_authority_table
36
- required_fields: [table_family, owner, enum_id, values]
37
- allowed_fields: [description, authority_refs, value, label, semantics]
38
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
39
- - table_family: state_machine
40
- authority_class: product_authority_table
41
- required_fields: [table_family, owner, machine_id, states, transitions]
42
- allowed_fields: [description, authority_refs, state, transition, from, to, guard]
43
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
44
- - table_family: protocol_surface
45
- authority_class: product_authority_table
46
- required_fields: [table_family, owner, protocol_id, surfaces]
47
- allowed_fields: [description, authority_refs, event, rpc, field, reason_code]
48
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
49
- - table_family: owner_matrix
50
- authority_class: product_authority_table
51
- required_fields: [table_family, owner, matrix_id, rows]
52
- allowed_fields: [description, authority_refs, owner, responsibility, boundary]
53
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
54
- - table_family: product_catalog
55
- authority_class: product_authority_table
56
- required_fields: [table_family, owner, catalog_id, entries]
57
- allowed_fields: [description, authority_refs, id, name, semantics, owner]
58
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
59
- - table_family: product_state_machine
60
- authority_class: product_authority_table
61
- required_fields: [table_family, owner, state_machine_id, states]
62
- allowed_fields: [description, authority_refs, state, entry_conditions, exit_conditions, invariant, reason_code]
63
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
64
- - table_family: product_record_schema
65
- authority_class: product_authority_table
66
- required_fields: [table_family, owner, record_id, path, schema_version, required_top_level_fields, invariants]
67
- allowed_fields: [description, authority_refs, field, schema_ref, invariant, path, owner]
68
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
69
- - table_family: gate_registry
70
- authority_class: product_authority_table
71
- required_fields: [table_family, owner, registry_id, schema_version, registry_version, profile_id, tiers, targets, reason_codes, gates]
72
- allowed_fields: [description, authority_refs, id, command, tier, target, prerequisite, evidence, blocker_semantics]
73
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
74
- - table_family: support_registry
75
- authority_class: support_registry
76
- required_fields: [table_family, registry_id, owner, schema_ref, allowed_fields, forbidden_state_fields, entries]
77
- allowed_fields: [authority_refs, command_refs, evidence_class, validation_scope, registry_owner]
78
- forbidden_fields: [done, covered, coverage_status, audit_date, evidence_report, current, proposed, backlog_status, migration_status, mapping_status, run_id, ledger_ref]
79
- support_registry_shape:
80
- required_fields:
81
- - table_family
82
- - registry_id
83
- - owner
84
- - schema_ref
85
- - allowed_fields
86
- - forbidden_state_fields
87
- forbidden_state_fields:
88
- - done
89
- - covered
90
- - coverage_status
91
- - audit_date
92
- - evidence_report
93
- - current
94
- - proposed
95
- - backlog_status
96
- - migration_status
97
- - mapping_status
98
- - run_id
99
- - ledger_ref
100
- forbidden_fields_by_authority_class:
101
- product_authority_table:
102
- - done
103
- - covered
104
- - coverage_status
105
- - audit_date
106
- - evidence_report
107
- - current
108
- - proposed
109
- - backlog_status
110
- - migration_status
111
- - mapping_status
112
- - run_id
113
- - ledger_ref
114
- support_registry:
115
- - done
116
- - covered
117
- - coverage_status
118
- - audit_date
119
- - evidence_report
120
- - current
121
- - proposed
122
- - backlog_status
123
- - migration_status
124
- - mapping_status
125
- - run_id
126
- - ledger_ref
127
- semantic_constraints:
128
- - kernel_tables_path_is_not_authority_without_table_family
129
- - support_registry_may_register_evidence_commands_but_not_current_coverage
130
- - operational_state_and_audit_coverage_must_move_local
131
- - unknown_table_family_fails_closed
132
- - product_authority_table_rows_must_define_stable_product_facts
133
- - release_gate_registry_must_use_gate_registry_family_not_closed_enum
@@ -1,17 +0,0 @@
1
- version: 2
2
- contract:
3
- id: nimicoding.tracked-output-admission.v2
4
- owner: nimi-coding
5
- purpose: Make every tracked non-product output explicit and narrow.
6
- required_top_level_fields: [version, admissions, semantic_constraints]
7
- admission_required_fields: [root, allowed_artifact_classes, owner, rationale, validation_commands]
8
- admissions: []
9
- default_policy:
10
- tracked_non_product_outputs: forbidden_without_explicit_admission
11
- local_operational_outputs_root: .nimi/local
12
- generated_views: stdout_only
13
- semantic_constraints:
14
- - empty_admission_list_is_valid_and_means_no_tracked_non_product_outputs
15
- - admission_does_not_promote_output_to_product_authority
16
- - output_root_must_not_overlap_.nimi/spec
17
- - validation_commands_must_be_deterministic
@@ -1,20 +0,0 @@
1
- version: 2
2
- four_closure_policy:
3
- purpose: Require independent proof that a material change is complete.
4
- closures:
5
- functional:
6
- question: Does the implemented behavior satisfy the admitted product rules?
7
- required_evidence: executable_tests_or_equivalent_deterministic_proof
8
- negative:
9
- question: Are forbidden and failure paths explicitly exercised?
10
- required_evidence: negative_tests_or_contract_refusals
11
- structural:
12
- question: Does the result preserve module, dependency, and authority boundaries?
13
- required_evidence: build_lint_static_checks_and_boundary_validators
14
- drift_resistance:
15
- question: Will deterministic checks reject a future divergence?
16
- required_evidence: committed_validator_or_reproducible_check
17
- acceptance:
18
- all_four_must_be_explicit_for_material_change: true
19
- missing_closure_is_not_success: true
20
- evidence_format_and_review_process_are_host_owned: true