@nimiplatform/nimi-coding 0.4.0 → 0.6.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 (70) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +92 -55
  4. package/README.zh-CN.md +93 -56
  5. package/cli/commands/authority.mjs +80 -125
  6. package/cli/commands/clear.mjs +3 -2
  7. package/cli/commands/code.mjs +225 -0
  8. package/cli/commands/start.mjs +3 -2
  9. package/cli/constants.mjs +2 -1
  10. package/cli/dev/check-authority-surface.mjs +17 -8
  11. package/cli/dev/check-product-conformance.mjs +4 -32
  12. package/cli/dev/run-cli-smoke.mjs +6 -0
  13. package/cli/help.mjs +8 -3
  14. package/cli/index.mjs +3 -2
  15. package/cli/lib/authority/audit.mjs +262 -185
  16. package/cli/lib/authority/change-candidates.mjs +807 -0
  17. package/cli/lib/authority/closed-sets.mjs +7 -8
  18. package/cli/lib/authority/compile.mjs +6 -24
  19. package/cli/lib/authority/compiled-snapshot.mjs +143 -0
  20. package/cli/lib/authority/consumers.mjs +69 -19
  21. package/cli/lib/authority/diagnostics.mjs +10 -2
  22. package/cli/lib/authority/diff.mjs +77 -54
  23. package/cli/lib/authority/format.mjs +4 -32
  24. package/cli/lib/authority/git-snapshot.mjs +34 -379
  25. package/cli/lib/authority/graph.mjs +10 -10
  26. package/cli/lib/authority/impact.mjs +17 -144
  27. package/cli/lib/authority/review.mjs +33 -43
  28. package/cli/lib/authority/sarif.mjs +1 -8
  29. package/cli/lib/authority/source-yaml.mjs +0 -4
  30. package/cli/lib/authority/surface.mjs +19 -1
  31. package/cli/lib/authority/terms.mjs +10 -9
  32. package/cli/lib/authority/validate.mjs +6 -14
  33. package/cli/lib/code/authority-annotation-response.mjs +43 -0
  34. package/cli/lib/code/authority-annotation-scan.mjs +162 -0
  35. package/cli/lib/code/authority-annotations.mjs +293 -0
  36. package/cli/lib/code/context.mjs +710 -0
  37. package/cli/lib/code/response.mjs +165 -0
  38. package/cli/lib/doctor.mjs +3 -2
  39. package/cli/lib/entrypoints.mjs +13 -5
  40. package/cli/seeds/seed-policy.yaml +2 -2
  41. package/contracts/authority-source.schema.yaml +0 -6
  42. package/contracts/authority-verifier-bindings.schema.yaml +21 -10
  43. package/methodology/authority-authoring.yaml +68 -70
  44. package/methodology/core.yaml +10 -6
  45. package/package.json +5 -3
  46. package/spec/authority-audit.yaml +56 -52
  47. package/spec/authority-authoring.yaml +3 -16
  48. package/spec/authority-change-candidates.yaml +146 -0
  49. package/spec/authority-consumers.yaml +7 -0
  50. package/spec/authority-discovery.yaml +2 -2
  51. package/spec/authority-graph.yaml +1 -1
  52. package/spec/authority-impact.yaml +16 -39
  53. package/spec/authority-review.yaml +29 -47
  54. package/spec/authority-terms.yaml +5 -1
  55. package/spec/code-authority-annotations.yaml +42 -0
  56. package/spec/code-context.yaml +38 -0
  57. package/spec/product-scope.yaml +15 -9
  58. package/cli/commands/validate-ai-governance.mjs +0 -335
  59. package/cli/lib/authority/evidence-snapshot.mjs +0 -1
  60. package/cli/lib/authority/evidence.mjs +0 -1432
  61. package/cli/lib/internal/governance/ai/ai-context-budget-core.mjs +0 -377
  62. package/cli/lib/internal/governance/ai/ai-structure-budget-core.mjs +0 -376
  63. package/cli/lib/internal/governance/ai/check-agents-freshness.mjs +0 -155
  64. package/cli/lib/internal/governance/ai/check-high-risk-doc-metadata-core.mjs +0 -173
  65. package/cli/lib/internal/governance/config.mjs +0 -114
  66. package/cli/lib/internal/governance/shared/read-yaml-with-fragments.mjs +0 -49
  67. package/contracts/authority-evidence-bindings.schema.yaml +0 -53
  68. package/contracts/authority-evidence-probe-results.schema.yaml +0 -38
  69. package/contracts/authority-impact-dispositions.schema.yaml +0 -13
  70. package/spec/authority-evidence.yaml +0 -200
@@ -1,85 +1,89 @@
1
- version: 1
1
+ version: 2
2
2
  spec:
3
- id: nimicoding.authority-audit.v1
3
+ id: nimicoding.authority-audit.v2
4
4
  owner: nimi-coding
5
5
  status: active
6
- product_claim: complete_admitted_snapshot_and_explicit_project_binding_produce_deterministic_governance_bound_observations_findings_and_gaps
6
+ product_claim: complete_admitted_authority_and_one_explicit_closed_binding_list_produce_only_deterministic_violation_findings_and_narrow_counts
7
+ command: nimicoding authority audit <path> --bindings <file> --max-units <positive-safe-integer> --max-edges <positive-safe-integer> --max-bytes <positive-safe-integer> [--json|--sarif]
8
+ surface:
9
+ report_format: nimicoding.authority-audit/v2
10
+ corpus_root: complete_input_authority_corpus
11
+ boolean_flags: [json, sarif]
12
+ value_flags: [bindings]
13
+ integer_flags: [max-units, max-edges, max-bytes]
14
+ repeatable_flags: []
15
+ blocking_findings_change_exit_code: true
16
+ advisory_findings_change_exit_code: false
7
17
  runtime:
8
18
  function: auditAuthorityPath(authorityPath_bindingsPath_budgets)
9
19
  source: one_complete_package_private_AuthorityIR_SourceMap_and_one_closed_binding_document
10
20
  binding:
11
- format: nimicoding.authority-verifier-bindings/v1
21
+ format: nimicoding.authority-verifier-bindings/v2
12
22
  authority: package://@nimiplatform/nimi-coding/contracts/authority-verifier-bindings.schema.yaml
13
- top_level_fields: [format, required_bindings, bindings]
14
- required_bindings: non_empty_so_an_accidentally_emptied_CI_policy_is_refused
15
- binding_fields: [id, detector, premise, targets, minimum, policy]
16
- missing_required_binding: completed_gap
17
- malformed_unknown_detector_or_invalid_authority_ref: refused_with_null_audit
18
- tracked_project_governance: required_before_portable_blocking_adoption_but_not_inferred_or_verified_by_runtime
19
- detector:
20
- id: minimum-independent-incoming-reference/v1
21
- premise: exact_active_rule_selected_by_binding
22
- targets: non_empty_unique_exact_active_definitions_selected_by_binding
23
- attachment: premise_must_have_direct_applies_to_each_target
24
- measurement: distinct_other_active_rule_sources_with_direct_applies_to_target
25
- minimum: positive_safe_integer_from_binding
26
- prose_ID_pattern_owner_scope_inference: forbidden
27
- project_semantics: owner_admitted_governance_verifier_not_package_universal_invariant
23
+ top_level_fields: [format, bindings]
24
+ bindings: non_empty
25
+ binding_ID: unique_exact_dotted_lowercase_identifier
26
+ unknown_detector_extra_field_invalid_authority_ref_or_empty_list: refused_with_null_audit
27
+ detectors:
28
+ minimum-independent-incoming-reference/v1:
29
+ binding_fields: [id, detector, premise, targets, minimum, policy]
30
+ premise: exact_active_rule_selected_by_binding
31
+ targets: non_empty_unique_exact_active_definitions_selected_by_binding
32
+ attachment: premise_must_have_direct_applies_to_each_target
33
+ measurement: distinct_other_active_rule_sources_with_direct_applies_to_target
34
+ minimum: positive_safe_integer_from_binding
35
+ exact-lexical-invariant/v1:
36
+ binding_fields: [id, detector, term, match, expectation, policy]
37
+ corpus: complete_active_authority
38
+ fields: [meaning, statement, condition, failure]
39
+ case: sensitive
40
+ match:
41
+ token: exact_literal_with_boundaries_outside_Unicode_letter_number_underscore_dot_or_hyphen
42
+ phrase: exact_non_overlapping_code_point_substring
43
+ expectation: [present, absent]
44
+ no_synonym_stemming_embedding_normalization_or_diff_derived_policy: true
28
45
  result:
29
- format: nimicoding.authority-audit/v1
30
- top_level_fields: [format, operationStatus, policyStatus, complete, observations, findings, gaps, counts, budgets]
31
- operation_status: [completed]
32
- policy_status:
46
+ format: nimicoding.authority-audit/v2
47
+ top_level_fields: [format, operationStatus, blockingStatus, findings, counts, budgets]
48
+ operationStatus: completed
49
+ blockingStatus:
33
50
  blocked: at_least_one_blocking_finding
34
- indeterminate: no_blocking_finding_and_at_least_one_required_binding_gap
35
- passed: no_blocking_finding_or_gap
36
- complete: false_only_when_required_binding_gap_exists
51
+ clear: no_blocking_finding_advisory_findings_may_still_exist
37
52
  common_item_fields: [code, fingerprint, detector, binding, premise, basis, message, policy, authorityRefs, primaryLocation, relatedLocations, witness]
38
53
  location_fields: [file, range, sourcePointer]
39
54
  related_location_fields: [role, location]
40
- basis:
41
- governance_bound: configured_detector_observation_or_finding
42
- required_coverage: required_binding_declaration_without_configured_detector_execution
43
- required_binding_gap_fields:
44
- detector: null
45
- premise: null
46
- basis: required_coverage
47
- policy: required
48
- observation: exactly_one_governance_bound_structural_observation_per_evaluated_binding
55
+ basis: configured
56
+ positive_binding_records_or_pass_witnesses: forbidden
49
57
  findings:
50
58
  - premise_target_direct_attachment_missing
51
59
  - minimum_independent_incoming_reference_not_met
52
- finding_additional_fields: [target]
60
+ - exact_lexical_expectation_violation
53
61
  ordering:
54
- observations: binding_ID
55
- findings: [binding_ID, target_ID, code]
56
- gaps: binding_ID
62
+ findings: [binding_ID, target_ID_when_present, code]
57
63
  fingerprint:
58
64
  algorithm: SHA-256_with_sha256_colon_prefix
59
- inputs: [fingerprint_format, code, detector_when_present, binding_ID, premise_ID_when_present, target_ID_when_present, minimum_when_present]
60
- excluded: [file, range, sourcePointer, policy, message, corpus_digest, run_identity]
65
+ excludes: [file, range, sourcePointer, policy, message, corpus_digest, run_identity]
61
66
  counts:
62
67
  fields: [bindings, returned, traversal]
63
- binding_fields: [required, configured, evaluated]
64
- returned_fields: [observations, findings, gaps]
68
+ binding_fields: [configured, evaluated]
69
+ returned_fields: [findings]
65
70
  traversal_fields: [units, edges]
66
71
  budgets:
67
72
  required: [maxUnits, maxEdges, maxBytes]
68
73
  values: positive_safe_integers
69
- units_and_edges: complete_distinct_inspected_set_including_all_premise_outgoing_and_target_incoming_candidates_before_eligibility_filtering
74
+ units: distinct_units_inspected_by_all_configured_detectors
75
+ edges: distinct_authored_edges_inspected_by_graph_detectors
70
76
  bytes: UTF-8_bytes_of_compact_JSON.stringify_audit
71
77
  overflow: AUTH_AUDIT_BUDGET_with_null_audit_and_partial_false
72
78
  outcomes:
73
- completed: audit_present_even_when_blocked_or_gap_exists
74
- refused: invalid_corpus_binding_authority_reference_or_budget_with_null_audit
79
+ clear: audit_present_blockingStatus_clear_exit_0
80
+ blocked: audit_present_blockingStatus_blocked_exit_1
81
+ refused: invalid_corpus_binding_authority_reference_or_budget_with_null_audit_exit_1
75
82
  partial: forbidden
76
83
  boundaries:
77
84
  writes_authority: false
78
85
  binding_is_canonical_product_authority: false
79
- canonical_rule_ref_proves_predicate_equivalence: false
80
- detector_plugin_DSL_exception_filter_or_dynamic_execution: forbidden
81
- Git_tracking_CI_SARIF_UI_AI_host_or_remediation: not_owned_by_runtime
86
+ natural_language_contradiction_or_business_completeness: not_evaluated
87
+ detector_plugin_DSL_exception_filter_external_result_or_dynamic_execution: forbidden
88
+ blocking_policy_inference_from_diff: forbidden
82
89
  public_JS_exports: none
83
- summary:
84
- result_unitCount: full_compiled_corpus_units
85
- proof_traversal_counts: audit.counts.traversal
@@ -41,11 +41,6 @@ fields:
41
41
  unit_common_resolved_from_container_or_unit: [owner, lifecycle, relations]
42
42
  markdown_frontmatter_also_requires: [format]
43
43
  format: nimicoding.authority/v2
44
- migration_inputs:
45
- format: nimicoding.authority/v1
46
- admitted_by: [fmt --upgrade, check, compile, diff, impact]
47
- rationale: history_snapshots_and_migration_inputs_are_read_not_authored
48
- compatibility_authoring_surface: none
49
44
  identifier: dot_separated_lowercase_segments_start_and_end_alphanumeric
50
45
  kinds: [rule, definition]
51
46
  lifecycles: [active, removed]
@@ -80,24 +75,15 @@ relations:
80
75
  semantic_failures: [unknown_type, duplicate_edge, self_edge, dangling_target, type_mismatch, cardinality, cycle]
81
76
  commands:
82
77
  fmt:
83
- syntax: nimicoding authority fmt <file> [--check] [--upgrade] [--json]
78
+ syntax: nimicoding authority fmt <file> [--check] [--json]
84
79
  semantic_status: not_evaluated
85
80
  writes: one_source_file_atomically_unless_check
86
81
  structural_discriminants: [format, kind, lifecycle]
87
82
  invention: forbidden
88
- upgrade:
89
- admits: nimicoding.authority/v1
90
- emits: nimicoding.authority/v2
91
- lifting: uniform_container_owner_and_single_valued_scope_plus_omission_of_defaulted_unit_fields
92
- semantic_change: none_the_compiled_IR_is_identical_before_and_after
93
83
  check:
94
- syntax: nimicoding authority check <path> [--scope-bindings <file>] [--require-format <format>] [--json]
84
+ syntax: nimicoding authority check <path> [--scope-bindings <file>] [--json]
95
85
  writes: none
96
86
  no_scope_bindings_flag: exact_existing_check_behavior
97
- require_format:
98
- admitted_values: [nimicoding.authority/v2, nimicoding.authority/v1]
99
- enforcement: every_container_must_declare_the_exact_requested_format
100
- default: absent_preserves_history_and_migration_compatibility
101
87
  scope_bindings:
102
88
  format: nimicoding.scope-bindings/v1
103
89
  document: closed_mapping_with_exact_format_and_non_empty_scopes_sequence
@@ -113,6 +99,7 @@ commands:
113
99
  compile:
114
100
  syntax: nimicoding authority compile <path> [--json]
115
101
  writes: none
102
+ source_format: exact_nimicoding.authority/v2_only
116
103
  ir_visibility: package_private
117
104
  public_json: operation_counts_and_diagnostics_only
118
105
  anchors:
@@ -0,0 +1,146 @@
1
+ version: 1
2
+ spec:
3
+ id: nimicoding.authority-change-candidates.v1
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: complete_deterministic_change_derived_recall_of_current_active_non_root_authority_candidates_over_caller_requested_explicit_exact_channels
7
+ source:
8
+ before: one_complete_independently_admitted_package_private_AuthorityIR_and_SourceMap
9
+ after: one_complete_independently_admitted_package_private_AuthorityIR_and_SourceMap
10
+ changes: complete_semantic_diff_between_the_two_admitted_inputs
11
+ command:
12
+ syntax: nimicoding authority change-candidates <before-path> <after-path> --channels <comma-separated-closed-set> --max-candidates <positive-safe-integer> --max-reasons <positive-safe-integer> --max-bytes <positive-safe-integer> [--json]
13
+ channel_selection:
14
+ required: one_non_empty_array
15
+ admitted: [owner, scope, changed_term, direct_relation, definition_identity, definition_title]
16
+ unknown_duplicate_non_string_or_empty: AUTH_CHANGE_CANDIDATES_CHANNELS_with_null_product
17
+ input_order: non_semantic
18
+ output_order: canonical_admitted_channel_order
19
+ completeness_scope: exact_union_of_requested_channels_only
20
+ unrequested_channels: not_evaluated_and_do_not_recall_or_emit_reasons
21
+ roots:
22
+ selection: every_exact_unit_ID_named_by_at_least_one_complete_semantic_diff_change
23
+ included_operations: [unit_added, modified, added, removed]
24
+ metadata_only_changes: included_because_owner_and_title_rename_context_are_product_relevant_recall_inputs
25
+ formatting_profile_file_move_container_regroup_and_source_order_only_change: no_root
26
+ root_record_fields: [id, changes, before, after]
27
+ change_fields: [operation, pointer]
28
+ side_fields: [kind, owner, lifecycle, title, location]
29
+ absent_side: explicit_null
30
+ candidate_universe:
31
+ source: after_only
32
+ lifecycle: active_only
33
+ roots: excluded
34
+ removed_tombstones: excluded
35
+ admission: at_least_one_exact_recall_reason_from_one_declared_channel
36
+ ordering: lexical_unit_ID
37
+ recall_channels:
38
+ owner:
39
+ match: exact_owner_equality_between_candidate_and_each_before_or_after_root
40
+ reason_witness: exact_raw_owner_and_both_SourceMap_locations
41
+ scope:
42
+ match: exact_scope_membership_shared_by_an_active_rule_candidate_and_each_before_or_after_active_rule_root
43
+ reason_witness: exact_raw_scope_and_both_SourceMap_locations
44
+ changed_term:
45
+ root_fields: [title, meaning, statement, condition, failure]
46
+ root_values: only_normalized_terms_present_on_one_changed_field_side_and_absent_from_the_other_side_plus_every_after_term_of_a_unit_added_root
47
+ candidate_fields: [title, meaning, statement, condition, failure]
48
+ normalization: [Unicode_NFKC, split_camelCase_boundary, deterministic_lowercase, Unicode_Letter_or_Number_runs, deduplicate_terms]
49
+ match: one_or_more_exact_normalized_terms_shared_by_one_changed_root_field_and_one_candidate_field
50
+ excluded: [unchanged_root_text, owner, scope, lifecycle, relations, removal_reason, fuzzy_matching, stopwords, synonyms, translation, embedding, model_inference]
51
+ unchanged_terms_within_a_changed_field: excluded
52
+ reason_witness: complete_shared_changed_term_set_plus_both_raw_fields_and_both_SourceMap_locations
53
+ direct_relation:
54
+ source: complete_before_and_after_authored_applies_to_or_supersedes_edges
55
+ match: candidate_is_the_exact_source_or_target_endpoint_of_an_edge_incident_to_a_root
56
+ direction: incoming_or_outgoing_relative_to_the_root_while_preserving_authored_source_and_target
57
+ reason_witness: complete_authored_edge_with_source_relation_target_locations_plus_root_and_candidate_ID_locations
58
+ definition_identity:
59
+ anchors:
60
+ - a_definition_root_on_the_same_side
61
+ - an_exact_definition_target_of_a_relation_authored_by_a_root_on_the_same_side
62
+ match:
63
+ - candidate_authors_a_relation_to_the_exact_same_definition_ID
64
+ - candidate_raw_text_contains_the_exact_NFKC_definition_ID_with_identifier_token_boundaries
65
+ reason_witness: exact_definition_ID_title_and_locations_root_reference_and_candidate_field_or_relation
66
+ definition_title:
67
+ anchors: same_as_definition_identity
68
+ match: candidate_raw_text_contains_the_complete_exact_NFKC_case_sensitive_definition_title_with_Unicode_Letter_Number_boundaries
69
+ excluded: [partial_title, case_fold, fuzzy_phrase, synonym, translation]
70
+ reason_witness: exact_definition_ID_title_and_locations_root_reference_and_candidate_raw_field
71
+ composition:
72
+ selection: set_union_of_every_candidate_admitted_by_any_requested_channel_on_either_side
73
+ reasons: every_unique_exact_requested_channel_side_root_and_witness_tuple
74
+ duplicate_candidates_and_reasons: suppressed
75
+ ranking_top_k_stopwords_frequency_cutoff_or_heuristic_reduction: forbidden
76
+ zero_candidates: successful_complete_empty_union
77
+ semantic_judgment: none
78
+ candidate:
79
+ fields: [id, kind, owner, lifecycle, title, modality, scope, rawFields, relations, primaryIdLocation, reasons]
80
+ modality: exact_must_or_must_not_for_rules_and_explicit_null_for_definitions
81
+ scope: exact_after_scope_for_rules_and_empty_for_definitions
82
+ raw_fields: [meaning, statement, condition, failure]
83
+ absent_raw_fields: explicit_null
84
+ relations: complete_after_authored_relation_records
85
+ reason_fields: [channel, side, rootId, witness]
86
+ reason_channels: [owner, scope, changed_term, direct_relation, definition_identity, definition_title]
87
+ side: before_or_after
88
+ locations:
89
+ fields: [file, range, sourcePointer]
90
+ paths: relative_to_the_corresponding_input_root_when_inside_it
91
+ payload:
92
+ format: nimicoding.authority-change-candidates/v1
93
+ fields: [format, complete, requestedChannels, roots, candidates, counts, budgets, policy]
94
+ requestedChannels: canonical_ordered_exact_caller_set
95
+ complete: true_only_when_the_entire_requested_channel_union_and_every_requested_channel_reason_are_returned
96
+ count_fields: [beforeUnits, afterUnits, changedRoots, eligibleAfterUnits, candidates, reasons]
97
+ budget_fields: [maxCandidates, maxReasons, maxBytes]
98
+ policy_fields: [roots, candidateUniverse, recall, changedTerms, ordering, interpretation]
99
+ excluded:
100
+ - score_or_rank
101
+ - truncated_or_partial_candidates
102
+ - inferred_relation
103
+ - conflict_or_consistency_finding
104
+ - retirement_or_replacement_recommendation
105
+ - authority_pass_or_fail
106
+ - implementation_or_test_conformance
107
+ budgets:
108
+ max_candidates: required_explicit_positive_safe_integer_over_the_complete_requested_channel_candidate_union
109
+ max_reasons: required_explicit_positive_safe_integer_over_all_unique_exact_requested_channel_reasons
110
+ max_bytes: required_explicit_positive_safe_integer_over_UTF-8_bytes_of_compact_JSON_stringify_complete_payload
111
+ candidate_or_reason_overflow: AUTH_CHANGE_CANDIDATES_BUDGET_with_null_product_and_partial_false
112
+ byte_overflow: AUTH_CHANGE_CANDIDATES_BUDGET_with_null_product_and_partial_false
113
+ silent_reduction: forbidden
114
+ evaluation_stages:
115
+ - exact_candidate_ID_union_using_only_light_indexes_and_match_descriptors
116
+ - exact_unique_logical_reason_count_without_global_reason_key_storage_or_SourceMap_witness_objects
117
+ - full_reason_candidate_root_and_payload_materialization_only_after_candidate_and_reason_budgets_pass
118
+ candidate_overflow: return_exact_required_candidate_count_without_reason_witness_candidate_record_or_payload_materialization
119
+ reason_overflow: return_exact_required_reason_count_without_reason_witness_candidate_record_or_payload_materialization
120
+ duplicate_match_occurrences: collapsed_by_each_channel_visitor_before_reason_counting
121
+ indexing:
122
+ snapshot_indexes: [by_ID, by_owner, by_scope, incoming_relations, outgoing_relations, by_container]
123
+ changed_terms: one_precomputed_candidate_field_term_set_plus_exact_term_to_candidate_field_inverted_index_per_side
124
+ definition_patterns:
125
+ normalization: each_candidate_text_field_and_each_unique_definition_identity_or_title_pattern_is_NFKC_normalized_once_per_index_build
126
+ matching: one_deterministic_Aho_Corasick_multi_pattern_scan_per_candidate_field_and_stage
127
+ boundaries: exact_identity_or_Unicode_Letter_Number_title_boundaries_are_checked_on_each_match
128
+ direct_relations: snapshot_adjacency_indexes_without_candidate_linear_search
129
+ persistence: none_indexes_are_transient_and_derived_from_the_two_immutable_compiler_snapshots
130
+ fail_closed:
131
+ invalid_before_or_after_authority: preserve_complete_side_qualified_diff_or_compiler_diagnostics
132
+ invalid_transition: preserve_AUTH_DIFF_TRANSITION_INVALID
133
+ invalid_channels: AUTH_CHANGE_CANDIDATES_CHANNELS
134
+ invalid_runtime_budget: AUTH_CHANGE_CANDIDATES_BUDGET_with_null_product
135
+ partial_product: forbidden
136
+ boundaries:
137
+ read_only: true
138
+ writes_or_durable_artifacts: none
139
+ public_JS_exports: none
140
+ authority_or_product_semantic_decision: not_claimed
141
+ natural_language_contradiction_detection: not_admitted
142
+ relation_generation_or_repair: not_admitted
143
+ hard_cut_workflow_or_report: host_owned_not_admitted
144
+ implementation_code_test_or_gate_location: separate_product_not_included
145
+ source_container_proximity_annotation: not_included_because_it_is_non_semantic_unbounded_and_derivable_from_returned_locations
146
+ cache_SQLite_embedding_or_persistent_index: none
@@ -28,10 +28,17 @@ inputs:
28
28
  scheme_knowledge: none_this_tool_knows_no_particular_project_scheme
29
29
  absent_scheme: reference_is_externalUnresolved_never_dead
30
30
  reference_grammar:
31
+ escaped_line_continuation: exact_backslash_LF_or_backslash_CRLF_is_removed_for_matching_while_locations_use_the_original_source_line
32
+ source_string_escape_boundary: one_backslash_followed_by_a_common_escape_starter_ends_the_local_path_while_two_or_more_backslashes_remain_a_Windows_separator_run
31
33
  local_literal:
32
34
  shape: .nimi<separator_run>spec_optionally_followed_by_further_segments
33
35
  separators: forward_or_back_slash_runs_because_source_literals_escape_backslashes
34
36
  bare_root_admitted: true
37
+ terminal_period_disambiguation:
38
+ raw_target_or_prefix_exists: preserve_raw_target
39
+ raw_absent_and_removing_exactly_one_period_resolves: classify_the_single_period_as_sentence_punctuation
40
+ raw_and_single_period_stripped_both_absent: preserve_raw_target_and_report_dead
41
+ raw_and_single_period_stripped_both_exist: preserve_raw_target
35
42
  excluded: glob_star_or_angle_bracket_placeholder
36
43
  local_constructor:
37
44
  shape: adjacent_string_literals_beginning_with_.nimi_then_spec
@@ -25,7 +25,7 @@ filters:
25
25
  zero_lexical_match_in_nonempty_eligible_universe: AUTH_DISCOVERY_NOT_FOUND_without_absence_proof
26
26
  fields:
27
27
  included: [id, title, owner, scope, meaning, statement, condition, failure, reason]
28
- excluded: [relations, container_or_file_name, SourceMap_path_text, derived_context, implementation_evidence, test_evidence]
28
+ excluded: [relations, container_or_file_name, SourceMap_path_text, derived_context, implementation_artifacts, test_artifacts]
29
29
  match: normalized_token_equality
30
30
  admission: at_least_one_query_term_matches_one_included_field_of_an_eligible_unit
31
31
  ranking:
@@ -55,7 +55,7 @@ snippets:
55
55
  omissions: exact_nonnegative_omittedBeforeTerms_and_omittedAfterTerms_counts
56
56
  complete: true_only_when_no_normalized_field_term_is_omitted
57
57
  traceability: exact_portable_field_SourceMap_location_on_every_match
58
- boundary: snippet_is_lexical_evidence_not_source_prose_context_or_an_explanation
58
+ boundary: snippet_is_a_lexical_match_not_source_prose_context_or_an_explanation
59
59
  preview:
60
60
  option_group: preview_direction_relations_and_max_edges_must_be_all_present_or_all_absent
61
61
  source: existing_M1_direct_authored_graph_over_the_same_complete_compiler_snapshot
@@ -38,7 +38,7 @@ budgets:
38
38
  required_all: [max_units, max_edges, max_bytes]
39
39
  path_also_requires: max_hops
40
40
  subgraph_also_requires: depth
41
- units_and_edges: constrain_complete_traversal_proof_not_only_returned_witness
41
+ units_and_edges: constrain_complete_traversal_accounting_not_only_returned_witness
42
42
  bytes: UTF-8_bytes_of_compact_JSON.stringify_graph
43
43
  overflow: AUTH_GRAPH_BUDGET_with_null_graph_and_partial_false
44
44
  outcomes:
@@ -1,12 +1,12 @@
1
- version: 1
1
+ version: 2
2
2
  spec:
3
- id: nimicoding.authority-impact.v1
3
+ id: nimicoding.authority-impact.v2
4
4
  owner: nimi-coding
5
5
  status: active
6
- product_claim: compare_admitted_compiler_outputs_and_report_declared_review_obligations_without_claiming_sync_or_completion
6
+ product_claim: compare_admitted_compiler_outputs_and_report_declared_relation_impact_and_host_owned_follow_up_targets_without_accepting_completion_state
7
7
  commands:
8
8
  diff: nimicoding authority diff <before-path> <after-path> --max-bytes <positive-integer> [--json]
9
- impact: nimicoding authority impact <before-path> <after-path> --dispositions <file> --max-bytes <positive-integer> [--json]
9
+ impact: nimicoding authority impact <before-path> <after-path> --max-bytes <positive-integer> [--json]
10
10
  diff:
11
11
  source: two_independently_admitted_compiler_outputs
12
12
  format: nimicoding.authority-diff/v1
@@ -21,64 +21,41 @@ diff:
21
21
  added: scope_value_or_relation_added
22
22
  removed: scope_value_or_relation_removed
23
23
  source_record_fields: [file, range, sourcePointer]
24
- range_fields: [start, end]
25
- position_fields: [line, column]
26
24
  unit_removed_operation: forbidden
27
25
  physical_unit_deletion: AUTH_DIFF_TRANSITION_INVALID
28
26
  retirement: active_unit_is_replaced_by_a_valid_same_ID_same_kind_removed_tombstone
29
- tombstone_retention: removed_unit_remains_present_until_a_separately_admitted_reserved_ID_mechanism_exists
30
27
  pure_profile_format_file_rename_unit_order_or_container_regroup_change: empty
31
28
  ordering: [unit_ID, JSON_pointer, operation, values]
32
29
  traceability: changed_values_reference_before_and_or_after_SourceMap
33
- invalid_input_diagnostics:
34
- path_identity: before_or_after_prefix_plus_input_root_relative_path
35
- related_paths: same_side_prefix_and_relative_normalization
36
- ordering: global_diagnostic_order_after_normalization
37
- relocated_equivalent_inputs: byte_identical_JSON
38
30
  byte_budget:
39
- scope: semantic_diff_only_not_complete_CLI_report_or_compiler_diagnostics
40
- measure: UTF-8_bytes_of_compact_JSON_stringify_diff
41
- overflow: AUTH_DIFF_BUDGET
42
- result: {diff: null, partial: false}
31
+ measure: UTF-8_bytes_of_compact_JSON.stringify_diff
32
+ overflow: AUTH_DIFF_BUDGET_with_null_diff_and_partial_false
43
33
  impact:
44
- format: nimicoding.authority-impact/v1
45
- top_level_fields: [format, changedUnits, impactedUnits, obligations, complete]
34
+ format: nimicoding.authority-impact/v2
35
+ top_level_fields: [format, analysisStatus, changedUnits, impactedUnits, obligations]
36
+ analysisStatus: completed
46
37
  impacted_unit_fields: [id, kind]
47
- obligation_fields: [ruleId, type, target, disposition]
48
- disposition_fields_when_addressed: [ruleId, type, target, status, evidence]
49
- roots: normative_governance_definition_rule_graph_changes; non_normative_metadata_diff_is_reported_but_creates_no_obligation
38
+ obligation_fields: [ruleId, type, target]
39
+ roots: normative_governance_definition_rule_graph_changes; non_normative_metadata_diff_is_reported_but_creates_no_impact_root
50
40
  direction: reverse_declared_relations_from_changed_units_to_dependents
51
41
  relation_categories: [applies_to, supersedes]
52
42
  unrelated_units: excluded
53
43
  active_rule_obligations:
54
44
  consumer: union_of_before_and_after_declared_scope
55
- test: one_explicit_evidence_disposition_per_impacted_active_rule
56
- missing_disposition: AUTH_IMPACT_UNDISPOSED
57
- complete: every_required_declared_obligation_has_exact_addressed_evidence
58
- proof_boundary: does_not_prove_implementation_consumer_or_test_synchronization
59
- partial_success: false
60
- failure_report: may_list_complete_impacted_units_and_unresolved_obligations_with_ok_false
45
+ test: one_host_follow_up_target_per_impacted_active_rule
46
+ completion_or_disposition_input: forbidden
61
47
  byte_budget:
62
- scope: semantic_diff_and_impact_only_not_complete_CLI_report_or_compiler_diagnostics
63
- measure: UTF-8_bytes_of_compact_JSON_stringify_object_containing_diff_and_impact
64
- overflow: AUTH_IMPACT_BUDGET
65
- result: {diff: null, impact: null, partial: false}
66
- dispositions:
67
- format: nimicoding.authority-impact-dispositions/v1
68
- authority: package://@nimiplatform/nimi-coding/contracts/authority-impact-dispositions.schema.yaml
69
- status: addressed
70
- evidence: explicit_non_empty_text
71
- inference: forbidden
48
+ measure: UTF-8_bytes_of_compact_JSON.stringify_object_containing_diff_and_impact
49
+ overflow: AUTH_IMPACT_BUDGET_with_null_diff_null_impact_and_partial_false
72
50
  fail_closed:
73
51
  invalid_before_or_after_authority: compiler_diagnostics
74
52
  identity_reuse_kind_change_or_physical_deletion: AUTH_DIFF_TRANSITION_INVALID_or_compiler_identity_diagnostics
75
53
  dangling_relation_or_illegal_lifecycle: compiler_diagnostics
76
- malformed_or_extra_disposition: AUTH_IMPACT_DISPOSITION_INVALID
77
54
  missing_or_invalid_max_bytes: CLI_usage_failure
78
55
  boundaries:
79
56
  writes_authority: false
80
57
  durable_artifacts: none
81
58
  git_interpretation: none
59
+ host_obligation_state_receipt_test_execution_or_completion: not_accepted_or_owned
82
60
  natural_language_contradiction_detection: not_claimed
83
61
  implementation_consumer_test_sync_proof: not_admitted
84
- storage_search_embedding_visualization_AI_execution_Atlas: not_admitted
@@ -1,10 +1,10 @@
1
- version: 1
1
+ version: 2
2
2
  spec:
3
- id: nimicoding.authority-review.v1
3
+ id: nimicoding.authority-review.v2
4
4
  owner: nimi-coding
5
5
  status: active
6
- product_claim: one_explicit_Git_base_commit_and_one_stable_current_worktree_produce_an_exact_read_only_change_review_over_complete_canonical_snapshots
7
- command: nimicoding authority review <repository-path> --base <git-ref> --bindings <file> --dispositions <file> --max-units <positive-safe-integer> --max-edges <positive-safe-integer> --max-bytes <positive-safe-integer> [--json]
6
+ product_claim: one_explicit_Git_base_commit_and_one_stable_current_worktree_produce_exact_read_only_authority_analysis_with_narrow_component_statuses
7
+ command: nimicoding authority review <repository-path> --base <git-ref> --bindings <file> --max-units <positive-safe-integer> --max-edges <positive-safe-integer> --max-bytes <positive-safe-integer> [--json]
8
8
  capture:
9
9
  repository: exact_non_bare_Git_worktree_root
10
10
  base_ref:
@@ -14,76 +14,58 @@ capture:
14
14
  base_authority:
15
15
  source: Git_object_database
16
16
  root: .nimi/spec_tree_required
17
- inventory: all_nested_tree_and_leaf_entries_without_suffix_filtering
18
17
  admitted_entry_types: [tree, regular_blob_100644_or_100755]
19
- refused: [symlink_blob, gitlink, unknown_mode_or_type, invalid_UTF-8_path, path_escape, duplicate_path, missing_object]
20
18
  worktree_authority:
21
19
  source: complete_live_filesystem_inventory_under_.nimi/spec
22
20
  includes: [tracked_unchanged, tracked_modification, tracked_deletion, untracked_or_ignored_file, unsupported_regular_file]
23
21
  refused: [missing_root, symlink, non_regular_entry, invalid_UTF-8_path, path_escape]
24
- stability: retain_exact_directory_and_file_handles_while_capturing_paths_types_bytes_and_metadata_then_recapture_complete_live_inventory_and_revalidate_all_held_handles_at_capture_commit
25
22
  race: any_path_type_byte_or_stability_metadata_change_refuses_the_whole_capture
26
23
  materialization:
27
24
  location: independent_0700_temporary_directory
28
- isolation: physical_temporary_root_must_be_outside_worktree_and_Git_administration_roots_before_any_directory_is_created_and_is_rechecked_after_creation
29
- validation: readback_paths_types_and_bytes_must_match_capture
30
25
  cleanup: required_after_success_or_failure
31
- Git_mutation: [checkout, stash, reset, stage, commit, branch_update, worktree_update, index_update]
32
- Git_mutation_posture: forbidden
26
+ Git_mutation: forbidden
33
27
  snapshot_identity:
34
28
  format: sha256_colon_lowercase_hex
35
29
  domain: nimicoding.authority-snapshot-content/v1
36
30
  inputs: sorted_repository_relative_regular_file_paths_entry_type_exact_byte_length_and_bytes
37
- excludes: [base_ref_name, commit_OID, executable_bit, permissions, mtime, ctime, inode, absolute_path, temporary_path, traversal_order]
38
- result:
39
- base: [commitOid, contentIdentity, file_count, unit_count, byte_count]
40
- worktree: [contentIdentity, file_count, unit_count, byte_count]
41
31
  oracles:
42
- admission_and_counts: compileAuthorityPath_on_each_materialized_snapshot
43
- semantic_delta: diffAuthorityPaths
44
- declared_impact: impactAuthorityPaths
45
- current_governance: auditAuthorityPath_on_worktree_snapshot_only
46
- copied_Git_parser_IR_graph_diff_or_detector: forbidden
32
+ admission_and_counts: exactly_one_compileAuthorityPath_call_per_materialized_side
33
+ immutable_read_model: createCompiledAuthoritySnapshot_with_by_ID_owner_scope_container_and_incoming_outgoing_indexes
34
+ semantic_delta: diffAuthoritySnapshots_on_the_two_admitted_read_models
35
+ declared_impact: impactAuthorityDiff_on_the_single_computed_semantic_diff
36
+ configured_audit: auditAuthoritySnapshot_on_the_admitted_worktree_read_model_only
37
+ component_recompile_or_persistent_cache: forbidden
47
38
  product:
48
- format: nimicoding.authority-review/v1
49
- top_level_fields: [format, operationStatus, policyStatus, complete, partial, snapshots, components, diff, impact, audit, budgets]
39
+ format: nimicoding.authority-review/v2
40
+ top_level_fields: [format, operationStatus, analysisComplete, partial, businessSemanticStatus, implementationConformanceStatus, snapshots, components, diff, impact, audit, budgets]
50
41
  operationStatus: completed
51
- policyStatus:
52
- blocked: current_audit_has_a_blocking_finding
53
- indeterminate: no_blocking_finding_and_impact_or_audit_coverage_is_incomplete
54
- passed: review_is_complete_and_current_audit_policy_passed
55
- complete: impact_complete_and_audit_complete_independent_of_blocking_policy
42
+ analysisComplete: snapshot_capture_corpus_admission_diff_impact_and_configured_audit_all_finished
56
43
  partial: false
57
- components: [snapshots, diff, impact, audit]
58
- component_fields: [operationStatus, complete]
59
- logical_products:
60
- diff: nimicoding.authority-diff/v1
61
- impact: nimicoding.authority-impact/v1
62
- audit: nimicoding.authority-audit/v1
63
- audit_claim: current_snapshot_only_without_before_after_finding_attribution
44
+ businessSemanticStatus: not_evaluated
45
+ implementationConformanceStatus: not_evaluated
46
+ components:
47
+ snapshotCapture: {fields: [status], status: captured}
48
+ corpusAdmission: {fields: [status], status: admitted}
49
+ semanticDiff: {fields: [status], status: computed}
50
+ declaredImpact: {fields: [status], status: computed}
51
+ configuredAudit: {fields: [status, blockingStatus], status: evaluated, blockingStatus: [clear, blocked]}
52
+ no_generic_policy_pass_or_conformance_status: true
64
53
  budgets:
65
54
  required: [maxUnits, maxEdges, maxBytes]
66
55
  values: positive_safe_integers
67
- units_and_edges: existing_audit_proof_traversal_semantics
68
56
  component_bytes: same_explicit_maxBytes_passed_to_diff_impact_and_audit
69
57
  review_bytes: UTF-8_bytes_of_compact_JSON.stringify_complete_review
70
58
  overflow: AUTH_REVIEW_BUDGET_or_existing_component_budget_with_review_null_and_partial_false
71
59
  outcomes:
72
- completed_passed: review_present_complete_true_policy_passed_exit_0
73
- completed_blocked: review_present_policy_blocked_exit_1
74
- completed_incomplete: review_present_complete_false_exit_1
75
- refused: invalid_Git_corpus_binding_disposition_capture_transition_or_budget_returns_review_null_partial_false_exit_1
60
+ completed_clear: review_present_analysisComplete_true_configured_audit_clear_exit_0
61
+ completed_blocked: review_present_analysisComplete_true_configured_audit_blocked_exit_1
62
+ refused: invalid_Git_corpus_binding_capture_transition_or_budget_returns_review_null_partial_false_exit_1
76
63
  usage_error: missing_repeated_or_invalid_CLI_argument_exit_2_without_review_product
77
64
  failed: uncaught_IO_resource_or_internal_failure_exit_2_without_review_product
78
- unresolved_impact: only_AUTH_IMPACT_UNDISPOSED_preserves_complete_logical_review_with_complete_false
79
- invalid_disposition: any_AUTH_IMPACT_DISPOSITION_INVALID_refuses_whole_review
80
- required_audit_gap: preserves_complete_logical_review_with_complete_false
81
- blocking_finding: preserves_complete_logical_review_without_claiming_finding_was_introduced_by_change
82
65
  boundaries:
83
66
  writes_authority_or_project_files: false
84
- durable_cache_database_history_or_receipt: none
85
- SARIF_review_aggregation: none
86
- heuristic_rename_split_merge_semantics: forbidden
87
- PR_branch_policy_approval_comment_commit_release_or_task_orchestration: not_owned
67
+ durable_cache_database_history_receipt_or_external_result: none
68
+ impact_disposition_or_host_completion_state: not_accepted
88
69
  arbitrary_shell_plugin_test_model_embedding_or_semantic_search_execution: forbidden
70
+ business_semantic_and_implementation_conformance: explicitly_not_evaluated
89
71
  public_AuthorityIR_or_SourceMap_export: none
@@ -26,7 +26,11 @@ inputs:
26
26
  required_for_code: true
27
27
  admission: must_be_one_exact_term_the_closed_lexical_grammar_admits
28
28
  lexical_grammar:
29
- classes: [snake_case, camelCase, UPPER_SNAKE, PascalCase, dotted]
29
+ classes: [snake_case, camelCase, UPPER_SNAKE, ALL_CAPS, PascalCase, dotted]
30
+ all_caps_shape: '[A-Z]{2,}'
31
+ all_caps_semantics: lexical_shape_only_without_acronym_or_product_identity_inference
32
+ acronym_leading_pascal_shape: '[A-Z]{2,}[a-z][a-z0-9]*([A-Z][a-z0-9]*)*'
33
+ ordinary_title_words: excluded_unless_they_match_the_existing_multi_segment_PascalCase_shape
30
34
  boundaries: ASCII_identifier_boundaries_required
31
35
  excluded: terms_inside_longer_path_like_tokens_containing_a_slash
32
36
  dotted_exclusion: final_segments_that_are_known_code_extensions