@nimiplatform/nimi-coding 0.3.1 → 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 +23 -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 -144
  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
@@ -0,0 +1,85 @@
1
+ version: 1
2
+ spec:
3
+ id: nimicoding.authority-audit.v1
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: complete_admitted_snapshot_and_explicit_project_binding_produce_deterministic_governance_bound_observations_findings_and_gaps
7
+ runtime:
8
+ function: auditAuthorityPath(authorityPath_bindingsPath_budgets)
9
+ source: one_complete_package_private_AuthorityIR_SourceMap_and_one_closed_binding_document
10
+ binding:
11
+ format: nimicoding.authority-verifier-bindings/v1
12
+ 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
28
+ 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:
33
+ 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
37
+ common_item_fields: [code, fingerprint, detector, binding, premise, basis, message, policy, authorityRefs, primaryLocation, relatedLocations, witness]
38
+ location_fields: [file, range, sourcePointer]
39
+ 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
49
+ findings:
50
+ - premise_target_direct_attachment_missing
51
+ - minimum_independent_incoming_reference_not_met
52
+ finding_additional_fields: [target]
53
+ ordering:
54
+ observations: binding_ID
55
+ findings: [binding_ID, target_ID, code]
56
+ gaps: binding_ID
57
+ fingerprint:
58
+ 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]
61
+ counts:
62
+ fields: [bindings, returned, traversal]
63
+ binding_fields: [required, configured, evaluated]
64
+ returned_fields: [observations, findings, gaps]
65
+ traversal_fields: [units, edges]
66
+ budgets:
67
+ required: [maxUnits, maxEdges, maxBytes]
68
+ values: positive_safe_integers
69
+ units_and_edges: complete_distinct_inspected_set_including_all_premise_outgoing_and_target_incoming_candidates_before_eligibility_filtering
70
+ bytes: UTF-8_bytes_of_compact_JSON.stringify_audit
71
+ overflow: AUTH_AUDIT_BUDGET_with_null_audit_and_partial_false
72
+ outcomes:
73
+ completed: audit_present_even_when_blocked_or_gap_exists
74
+ refused: invalid_corpus_binding_authority_reference_or_budget_with_null_audit
75
+ partial: forbidden
76
+ boundaries:
77
+ writes_authority: false
78
+ 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
82
+ public_JS_exports: none
83
+ summary:
84
+ result_unitCount: full_compiled_corpus_units
85
+ proof_traversal_counts: audit.counts.traversal
@@ -0,0 +1,150 @@
1
+ version: 1
2
+ spec:
3
+ id: nimicoding.authority-authoring.v2
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: installed_package_deterministically_formats_checks_and_compiles_canonical_authority
7
+ source_authority: downstream_project_.nimi/spec_containing_only_canonical_authority_profiles
8
+ profiles:
9
+ file_suffixes: [.authority.yaml, .authority.md]
10
+ yaml:
11
+ document: closed_top_level_mapping_with_exact_format_and_non_empty_units_sequence_using_YAML_1.2_core_values
12
+ container_fields: [format, owner, scope, units]
13
+ container_defaults:
14
+ owner: applies_to_every_unit_that_omits_owner
15
+ scope: one_scope_value_applied_to_every_active_rule_that_omits_scope
16
+ definitions_do_not_inherit_scope: true
17
+ unit_omission_defaults:
18
+ lifecycle: active
19
+ relations: []
20
+ both_levels_absent: fail_closed_no_inference
21
+ units_per_file: 1_to_N
22
+ unit_identity: explicit_ID_independent_of_file_name_source_index_move_order_or_regroup
23
+ source_order: preserved_for_author_reading_but_non_semantic
24
+ formatter_inputs: [block_collections, syntax_clear_flow_collections, syntax_clear_block_scalars]
25
+ rejected: [legacy_top_level_single_unit_mapping, empty_units, invalid_utf8, duplicate_keys, aliases, anchors, merge_keys, explicit_tags, directives, complex_keys, comments]
26
+ markdown:
27
+ units_per_file: 1
28
+ shared_with_yaml: restricted_lexical_and_syntax_rules_only_not_document_fields
29
+ front_matter_fields: [format, id, kind, owner, lifecycle, modality, scope, relations]
30
+ forbidden_front_matter_fields: [units]
31
+ title: one_plain_level_one_line_required_for_admission_but_omittable_during_fmt
32
+ active_definition_sections: [Meaning]
33
+ active_rule_sections: [Statement, Condition, Failure]
34
+ removed_sections: [Removal reason]
35
+ section_body: exactly_one_plain_text_line
36
+ rejected: [extra_or_duplicate_headings, prose_outside_slots, lists, blockquotes, thematic_breaks, fences, html, links, references, emphasis, comments, trailing_content]
37
+ fields:
38
+ yaml_document_required: [format, units]
39
+ yaml_document_optional: [owner, scope]
40
+ unit_common_required: [id, kind, title]
41
+ unit_common_resolved_from_container_or_unit: [owner, lifecycle, relations]
42
+ markdown_frontmatter_also_requires: [format]
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
+ identifier: dot_separated_lowercase_segments_start_and_end_alphanumeric
50
+ kinds: [rule, definition]
51
+ lifecycles: [active, removed]
52
+ active_definition:
53
+ required: [meaning]
54
+ forbidden: [modality, scope, statement, condition, failure, reason]
55
+ active_rule:
56
+ required: [modality, scope, statement, condition, failure]
57
+ modalities: [must, must_not]
58
+ forbidden: [meaning, reason]
59
+ removed:
60
+ required: [reason]
61
+ forbidden: [meaning, modality, scope, statement, condition, failure]
62
+ text_values:
63
+ fields: [title, meaning, statement, condition, failure, reason]
64
+ unicode: non_empty_trimmed_well_formed_scalar_sequence
65
+ forbidden_line_break_code_points: [U+000A, U+000B, U+000C, U+000D, U+0085, U+2028, U+2029]
66
+ yaml_escaped_values: validated_after_parse_by_check_and_compile
67
+ fmt_semantics: value_preserving_and_not_evaluated
68
+ field_classes:
69
+ normative_governance: [id, kind, owner, lifecycle]
70
+ normative_definition: [meaning]
71
+ normative_rule: [modality, scope, statement, condition, failure]
72
+ normative_graph: [relations, type, target]
73
+ non_normative_metadata: [title, reason]
74
+ relations:
75
+ container: may_be_missing_only_during_draft_formatting
76
+ item_shape: exactly_non_empty_string_type_and_target
77
+ formatting: deterministic_type_then_target_sort_preserving_duplicates_and_unknown_string_types
78
+ applies_to: active_rule_to_active_definition_at_least_one_per_active_rule
79
+ supersedes: active_or_removed_to_removed_same_kind_max_one_incoming_and_outgoing_acyclic
80
+ semantic_failures: [unknown_type, duplicate_edge, self_edge, dangling_target, type_mismatch, cardinality, cycle]
81
+ commands:
82
+ fmt:
83
+ syntax: nimicoding authority fmt <file> [--check] [--upgrade] [--json]
84
+ semantic_status: not_evaluated
85
+ writes: one_source_file_atomically_unless_check
86
+ structural_discriminants: [format, kind, lifecycle]
87
+ 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
+ check:
94
+ syntax: nimicoding authority check <path> [--scope-bindings <file>] [--require-format <format>] [--json]
95
+ writes: none
96
+ 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
+ scope_bindings:
102
+ format: nimicoding.scope-bindings/v1
103
+ document: closed_mapping_with_exact_format_and_non_empty_scopes_sequence
104
+ scope_entry: closed_mapping_with_one_non_empty_single_line_scope_and_non_empty_bindings_sequence
105
+ binding_entry: closed_mapping_with_kind_and_non_empty_single_line_value
106
+ binding_kinds: [path_glob, module, command]
107
+ duplicate_scope: rejected
108
+ enforcement: exact_bidirectional_set_equality_between_registered_scopes_and_active_rule_scope_use
109
+ unregistered_use_diagnostic: every_scope_and_using_unit_ID
110
+ dead_registration_diagnostic: every_registered_scope_without_active_rule_use
111
+ repository_path_resolution: forbidden
112
+ partial_result: forbidden
113
+ compile:
114
+ syntax: nimicoding authority compile <path> [--json]
115
+ writes: none
116
+ ir_visibility: package_private
117
+ public_json: operation_counts_and_diagnostics_only
118
+ anchors:
119
+ syntax: nimicoding authority anchors <repository-path> --spec <corpus-path> [--scope-bindings <file>] [--embedded-paths] --max-units <positive-safe-integer> --max-anchors <positive-safe-integer> --max-bytes <positive-safe-integer> [--json]
120
+ writes_and_execution: none
121
+ active_fields: [meaning, statement, condition, failure]
122
+ grammar: closed_maximal_non_whitespace_path_and_pnpm_script_tokens_defined_by_nimicoding.authority-anchors.v1
123
+ resolution: exact_Git_tracked_file_or_root_package_script_membership_without_inference
124
+ scope_path_globs: every_path_glob_matches_at_least_one_Git_tracked_file
125
+ module_and_command_bindings: structurally_admitted_but_not_resolved
126
+ budgets: complete_active_units_anchor_occurrences_and_compact_UTF-8_product_bytes
127
+ partial_result: forbidden
128
+ compiler:
129
+ ordering: [unit_id, scope_lexical, relation_type_then_target]
130
+ output: [AuthorityIR, SourceMap]
131
+ source_map: every_AuthorityIR_leaf_uses_its_actual_IR_JSON_pointer_and_exact_source_file_range_and_YAML_source_pointer_under_/units/source_index
132
+ non_ir_source_entries: forbidden
133
+ partial_success: forbidden
134
+ diagnostics:
135
+ range: one_based_unicode_scalar_half_open
136
+ missing_field: canonical_insertion_point_in_containing_mapping_or_section
137
+ conflicts: primary_location_plus_sorted_related_locations
138
+ repair: decision_category_only_never_product_semantic_value
139
+ runtime_authority:
140
+ contracts: installed_package_only
141
+ downstream_projection_cannot_change_compiler: true
142
+ historical_document_compatibility_or_inference: forbidden
143
+ sole_downstream_conformance_gate: authority_check_on_complete_canonical_root
144
+ admitted_downstream_consumers: [bounded_lexical_candidate_discovery, exact_query, bounded_context, bounded_graph_navigation, static_lexical_anchor_validation, embedded_repository_path_anchor_validation, corpus_consumer_and_gate_wiring_report, corpus_term_index_and_code_cross_reference, closed_vocabulary_pairing_report, project_bound_deterministic_audit, SARIF_projection, semantic_diff, declared_impact]
145
+ report_product_contracts:
146
+ consumers: nimicoding.authority-consumers.v1
147
+ terms: nimicoding.authority-terms.v1
148
+ closed-sets: nimicoding.authority-closed-sets.v1
149
+ anchors: nimicoding.authority-anchors.v1
150
+ not_admitted: [historical_format_reconstruction, profile_specific_validation, multi_unit_markdown, sqlite, cache, incremental, semantic_search, embedding, visualization, ai_execution, Atlas, qualification, final_cutover]
@@ -0,0 +1,65 @@
1
+ version: 1
2
+ spec:
3
+ id: nimicoding.authority-closed-sets.v1
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: bounded_static_pairing_of_closed_vocabularies_stated_in_active_authority_text_against_proto_enums_and_plain_scalar_sequences_in_tracked_YAML_implementation_sources
7
+ command: nimicoding authority closed-sets <repository-path> --spec <corpus-path> --max-units <positive-safe-integer> --max-sets <positive-safe-integer> --max-bytes <positive-safe-integer> [--json]
8
+ surface:
9
+ report_format: nimicoding.authority-closed-sets/v1
10
+ corpus_root: repository_authority_corpus_only
11
+ boolean_flags: [json]
12
+ value_flags: [spec]
13
+ integer_flags: [max-units, max-sets, max-bytes]
14
+ repeatable_flags: []
15
+ findings_change_exit_code: false
16
+ inputs:
17
+ repository:
18
+ shape: exact_non_symlink_Git_worktree_root
19
+ tracked_files: one_complete_git_ls_files_cached_NUL_inventory
20
+ writes_or_execution: forbidden
21
+ corpus:
22
+ root: exact_repository_relative_.nimi/spec_resolved_realpath
23
+ units: active_only
24
+ fields:
25
+ shared_lexicon: normative_field_set_is_one_shared_definition_across_report_products
26
+ scanned: [meaning, statement, condition, failure]
27
+ rationale: a_rule_states_its_closed_vocabulary_in_the_condition_or_failure_as_often_as_in_the_statement
28
+ canonical_extraction:
29
+ shape: comma_run_enumeration_with_optional_and_or_tail
30
+ minimum_members: 3
31
+ minimum_commas: 1
32
+ rejected: multi_word_items_and_runs_continuing_into_prose
33
+ implementation_extraction:
34
+ proto_enums:
35
+ scope: all_tracked_.proto_files
36
+ values: value_names_with_their_longest_underscore_boundary_prefix_stripped
37
+ config_yaml_sequences:
38
+ scope: all_tracked_.yaml_and_.yml_files_excluding_the_authority_corpus
39
+ values: at_least_three_plain_scalar_tokens
40
+ inventory:
41
+ shape: implementation_kind_inventory_v1
42
+ tracked_files: complete_git_inventory_count
43
+ scanned_files: counts_by_proto_and_yaml_kind
44
+ exclusions:
45
+ every_excluded_file_reported: true
46
+ reasons: [authority-corpus, binary-content, not-utf8, not-a-scanned-kind]
47
+ accounting: tracked_files_equals_proto_scanned_plus_yaml_scanned_plus_excluded_files
48
+ pairing:
49
+ basis: member_overlap_inference_with_no_supplied_mapping
50
+ suppressed: pairs_whose_canonical_group_is_a_pure_subset_of_another_pair_for_the_same_set
51
+ unpaired: reported_as_a_first_class_inventory_never_as_silence
52
+ budgets:
53
+ max_units: complete_active_unit_set_must_fit
54
+ max_sets: complete_implementation_set_inventory_must_fit
55
+ max_bytes: inputBytes_complete_decoded_authority_and_implementation_input_must_fit
56
+ exceeded: refuse_with_one_diagnostic_and_no_partial_inventory_or_pairing
57
+ result:
58
+ trackedPathSetDigest: sha256_hex_of_nimicoding.repository-inventory/v1_canonical_tracked_path_set_preimage
59
+ complete: true_only_when_every_admitted_input_was_read_and_paired
60
+ byte_counts:
61
+ scannedBytes: normative_authority_fields_plus_decoded_proto_and_YAML_extractor_inputs
62
+ inputBytes: complete_decoded_authority_corpus_plus_decoded_proto_and_YAML_extractor_inputs
63
+ partial: never
64
+ findings_change_exit_code: false
65
+ determinism: identical_inputs_produce_byte_identical_output
@@ -0,0 +1,70 @@
1
+ version: 1
2
+ spec:
3
+ id: nimicoding.authority-consumers.v1
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: bounded_static_report_of_which_tracked_files_reference_the_repository_authority_corpus_and_which_package_script_gates_any_workflow_can_reach
7
+ command: nimicoding authority consumers <repository-path> --spec <corpus-path> [--external-root <scheme>=<path>]... --max-files <positive-safe-integer> --max-refs <positive-safe-integer> --max-bytes <positive-safe-integer> [--json]
8
+ surface:
9
+ report_format: nimicoding.authority-consumers/v1
10
+ corpus_root: repository_authority_corpus_only
11
+ boolean_flags: [json]
12
+ value_flags: [spec]
13
+ integer_flags: [max-files, max-refs, max-bytes]
14
+ repeatable_flags: [external-root]
15
+ findings_change_exit_code: false
16
+ inputs:
17
+ repository:
18
+ shape: exact_non_symlink_Git_worktree_root
19
+ tracked_files: one_complete_git_ls_files_cached_NUL_inventory
20
+ scan_selection: every_tracked_non_corpus_file_classified_by_NUL_and_fresh_UTF-8_probe_regardless_of_extension_plus_root_package.json
21
+ exclusions: every_authority_corpus_binary_content_and_non_UTF-8_file_named_with_reason_in_fileInventory
22
+ writes_or_execution: forbidden
23
+ corpus:
24
+ root: exact_repository_relative_.nimi/spec_resolved_realpath
25
+ rationale: a_fixture_directory_must_not_be_able_to_stand_in_as_the_canonical_corpus
26
+ external_roots:
27
+ shape: repeatable_<scheme>=<path>_with_lowercase_scheme_and_one_directory
28
+ scheme_knowledge: none_this_tool_knows_no_particular_project_scheme
29
+ absent_scheme: reference_is_externalUnresolved_never_dead
30
+ reference_grammar:
31
+ local_literal:
32
+ shape: .nimi<separator_run>spec_optionally_followed_by_further_segments
33
+ separators: forward_or_back_slash_runs_because_source_literals_escape_backslashes
34
+ bare_root_admitted: true
35
+ excluded: glob_star_or_angle_bracket_placeholder
36
+ local_constructor:
37
+ shape: adjacent_string_literals_beginning_with_.nimi_then_spec
38
+ reconstruction: only_while_every_further_segment_is_a_string_literal
39
+ non_literal_continuation: reported_as_unresolved_never_dropped
40
+ external:
41
+ shape: <scheme>:spec/<path>[#<unit-id>]
42
+ unit_id: dotted_lowercase_authority_identifier
43
+ canonical_path: dot_and_dot-dot_segments_forbidden_and_realpath_must_remain_within_the_declared_root
44
+ fragment_resolution: when_a_scheme_root_is_supplied_the_named_YAML_container_must_hold_a_unit_with_the_exact_fragment_ID
45
+ non_canonical_path: unresolved_with_reason_non-canonical-external-path
46
+ classification:
47
+ canonical: local_target_exists_in_the_tracked_inventory
48
+ canonicalDead: local_target_absent_from_the_tracked_inventory
49
+ externalAuthority: scheme_root_supplied_and_file_exists_and_any_supplied_fragment_names_a_unit_in_that_container
50
+ externalDead: scheme_root_supplied_and_file_is_absent_or_any_supplied_fragment_is_absent_with_fragment_named_in_the_report_row
51
+ externalUnresolved: no_root_supplied_for_the_scheme
52
+ unresolved: path_constructed_from_a_non_literal_segment
53
+ host_specific_exemptions: forbidden_historical_identity_strings_stay_visible_for_the_host_to_interpret
54
+ gate_wiring:
55
+ workflow_files: .github/workflows/*.yml_and_*.yaml
56
+ reachability: direct_workflow_mention_or_transitive_package_script_reference
57
+ orphan: no_workflow_and_no_referencing_script_and_not_a_lifecycle_script
58
+ budgets:
59
+ max_files: complete_scanned_file_set_must_fit
60
+ max_refs: complete_reference_set_including_unresolved_must_fit_and_the_refusal_names_that_compared_total
61
+ max_bytes: complete_decoded_input_must_fit
62
+ exceeded: refuse_with_one_diagnostic_and_no_partial_report
63
+ result:
64
+ trackedPathSetDigest: sha256_hex_of_nimicoding.repository-inventory/v1_canonical_tracked_path_set_preimage
65
+ complete: true_only_when_every_admitted_input_was_read_and_classified
66
+ partial: never
67
+ counts: [total, canonical, canonicalDead, externalAuthority, externalDead, externalUnresolved, unresolved]
68
+ file_inventory: tracked_text_inventory_v1
69
+ findings_change_exit_code: false
70
+ determinism: identical_inputs_produce_byte_identical_output
@@ -0,0 +1,50 @@
1
+ version: 1
2
+ spec:
3
+ id: nimicoding.authority-context.v1
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: exact_ID_returns_one_unit_or_complete_bounded_declared_outgoing_interpretation_closure_or_fails
7
+ source: admitted_package_private_AuthorityIR_and_SourceMap_only
8
+ commands:
9
+ query:
10
+ syntax: nimicoding authority query <path> <id> --max-bytes <positive-integer> [--json]
11
+ result: exactly_one_unit_packet
12
+ budget: explicit_UTF-8_packet_bytes_required
13
+ context:
14
+ syntax: nimicoding authority context <path> <id> --max-units <positive-integer> --max-bytes <positive-integer> [--json]
15
+ budget: explicit_unit_and_UTF-8_packet_bytes_required
16
+ packet:
17
+ format: nimicoding.authority-context/v1
18
+ fields: [root, closure, units, sourceMap]
19
+ unit_order: lexical_ID
20
+ source_paths: relative_to_input_root_when_inside_it
21
+ schemas_included: false
22
+ unrelated_units_outside_closure_included: false
23
+ corpus_note: A legitimate closure may coincidentally include every corpus unit; no unit outside the closure is attached.
24
+ task_context: not_claimed
25
+ closure:
26
+ direction: outgoing_recursive
27
+ relation_categories: [applies_to, supersedes]
28
+ rationale:
29
+ applies_to: Include definitions explicitly required to interpret a rule.
30
+ supersedes: Include the declared older lineage required to interpret lifecycle relations.
31
+ incoming_relations: excluded_as_unrelated_to_the_root_declared_dependencies
32
+ fail_closed:
33
+ unknown_exact_ID: AUTH_QUERY_NOT_FOUND
34
+ ambiguous_ID: compiler_identity_diagnostic
35
+ invalid_source_or_graph: compiler_diagnostic
36
+ unit_or_UTF-8_packet_byte_budget_overflow: AUTH_CONTEXT_BUDGET_without_packet
37
+ partial_packet: forbidden
38
+ determinism:
39
+ repeated_semantic_output: identical
40
+ packet_units: lexical_ID
41
+ canonical_packet_bytes: UTF-8_byte_length_of_compact_JSON.stringify_packet_without_trailing_newline
42
+ tokenizer_dependency: forbidden
43
+ source_map: every_packet_unit_leaf_traceable
44
+ boundaries:
45
+ writes_authority: false
46
+ durable_artifacts: none
47
+ exposes_AuthorityIR_as_package_export: false
48
+ reads_projected_contracts: false
49
+ complete_task_context: not_admitted
50
+ storage_search_embedding_visualization_AI_execution_Atlas: not_admitted
@@ -0,0 +1,119 @@
1
+ version: 2
2
+ spec:
3
+ id: nimicoding.authority-discovery.v2
4
+ owner: nimi-coding
5
+ status: active
6
+ product_claim: bounded_deterministic_filtered_lexical_candidates_with_field_snippets_and_optional_direct_authored_relation_preview_for_callers_without_an_exact_authority_ID
7
+ source: complete_admitted_package_private_AuthorityIR_SourceMap_and_existing_M1_direct_authored_graph_only
8
+ command:
9
+ syntax: nimicoding authority discover <path> <query> [--kind <rule|definition>] [--owner <exact-owner>] [--scope <exact-scope>] [--lifecycle <active|removed>] --max-candidates <positive-safe-integer> --max-snippet-terms <positive-safe-integer> --max-bytes <positive-safe-integer> [--preview-direction <incoming|outgoing|both> --relations <comma-separated-relation-types> --max-edges <positive-safe-integer>] [--json]
10
+ continuity: same_purpose_specific_discover_command_with_a_hard_cut_payload_from_v1_to_v2
11
+ normalization:
12
+ order: [Unicode_NFKC, split_camelCase_boundary, deterministic_lowercase, Unicode_Letter_or_Number_runs, deduplicate_query_terms]
13
+ snippet_stream: preserve_normalized_field_term_occurrence_order
14
+ excluded: [language_stopwords, stemming, synonyms, translation, fuzzy_typo_matching, model_inference]
15
+ filters:
16
+ cardinality: each_filter_is_optional_singular_and_exact
17
+ kind: exact_rule_or_definition
18
+ owner: exact_known_unit_owner_equality
19
+ scope: exact_known_membership_in_the_unit_scope_sequence
20
+ lifecycle: exact_active_or_removed
21
+ execution: filter_the_complete_admitted_unit_universe_before_lexical_candidate_matching
22
+ effect_on_rank: none_other_than_removing_ineligible_units
23
+ unknown_owner_or_scope: AUTH_DISCOVERY_FILTER_UNKNOWN_with_null_discovery
24
+ structurally_impossible_or_empty_intersection: AUTH_DISCOVERY_FILTER_CONTRADICTORY_with_null_discovery
25
+ zero_lexical_match_in_nonempty_eligible_universe: AUTH_DISCOVERY_NOT_FOUND_without_absence_proof
26
+ fields:
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]
29
+ match: normalized_token_equality
30
+ admission: at_least_one_query_term_matches_one_included_field_of_an_eligible_unit
31
+ ranking:
32
+ public_score: none
33
+ tuple:
34
+ - distinct_query_terms_in_id_or_title_descending
35
+ - distinct_query_terms_in_meaning_or_statement_descending
36
+ - distinct_query_terms_in_all_fields_descending
37
+ - distinct_query_terms_in_scope_descending
38
+ - distinct_query_terms_in_failure_descending
39
+ - distinct_query_terms_in_condition_descending
40
+ - distinct_query_terms_in_reason_descending
41
+ - distinct_query_terms_in_owner_descending
42
+ - unit_ID_lexical_ascending
43
+ invariants:
44
+ - filters_only_remove_ineligible_units_and_do_not_change_the_tuple
45
+ - max_snippet_terms_never_changes_matching_or_rank
46
+ - preview_configuration_and_graph_content_never_change_matching_or_rank
47
+ snippets:
48
+ per_match: one_deterministic_window_over_the_exact_matched_field_value
49
+ normalization: NFKC_camel_boundary_lowercase_Unicode_Letter_Number_terms
50
+ terms: at_most_max_snippet_terms_normalized_terms_in_original_field_occurrence_order
51
+ width: minimum_of_maxSnippetTerms_and_complete_normalized_field_term_count
52
+ selection: maximize_distinct_matched_query_terms_then_choose_the_earliest_window_start
53
+ anchor: first_matched_term_in_the_window_with_exact_normalized_term_and_zero_based_fieldTermIndex_in_the_complete_normalized_field_term_stream
54
+ matched_terms: query_terms_present_in_the_returned_window_in_normalized_query_order
55
+ omissions: exact_nonnegative_omittedBeforeTerms_and_omittedAfterTerms_counts
56
+ complete: true_only_when_no_normalized_field_term_is_omitted
57
+ traceability: exact_portable_field_SourceMap_location_on_every_match
58
+ boundary: snippet_is_lexical_evidence_not_source_prose_context_or_an_explanation
59
+ preview:
60
+ option_group: preview_direction_relations_and_max_edges_must_be_all_present_or_all_absent
61
+ source: existing_M1_direct_authored_graph_over_the_same_complete_compiler_snapshot
62
+ seeds: returned_candidate_IDs_only
63
+ direction: incoming_outgoing_or_both_incidence_selection_around_each_seed
64
+ relations: explicit_nonempty_unique_subset_of_applies_to_and_supersedes
65
+ topology: direct_authored_edges_only_no_transitive_expansion_or_context_assembly
66
+ authored_direction: preserved_even_when_selected_by_incoming_or_both_incidence
67
+ composition: deterministic_unique_nodes_and_unique_authored_edges_across_all_returned_candidates
68
+ nodes: every_returned_candidate_root_plus_every_selected_edge_endpoint_once
69
+ traceability: reuse_M1_node_primary_locations_and_authored_edge_SourceMap_locations
70
+ ordering:
71
+ roots: candidate_rank_order
72
+ relations_and_nodes: lexical_ascending
73
+ edges: source_then_type_then_target_lexical_ascending
74
+ completeness: every_matching_direct_edge_for_every_returned_candidate_or_refuse_the_whole_discovery
75
+ rank_effect: none
76
+ payload:
77
+ format: nimicoding.authority-discovery/v2
78
+ fields: [format, query, filters, counts, truncated, absenceProven, candidates, relationPreview, budgets]
79
+ query_fields: [text, normalizedTerms]
80
+ filter_fields: [kind, owner, scope, lifecycle]
81
+ absent_filters: explicit_null
82
+ count_fields: [corpusUnits, eligibleUnits, matchedUnits, returnedCandidates]
83
+ absenceProven: always_false
84
+ candidate_fields: [rank, id, kind, lifecycle, owner, title, scope, matchedTerms, matches, primaryIdLocation]
85
+ match_fields: [field, terms, location, snippet]
86
+ snippet_fields: [normalization, terms, anchor, matchedTerms, omittedBeforeTerms, omittedAfterTerms, complete]
87
+ relationPreview: null_when_the_preview_option_group_is_absent
88
+ preview_fields: [direction, relations, complete, roots, nodes, edges, counts, budgets, policy]
89
+ preview_count_fields: [roots, units, edges]
90
+ preview_budget_fields: [maxEdges]
91
+ preview_policy_fields: [selection, edgeRepresentation, duplicateNodesAndEdges, rankingEffect]
92
+ budget_fields: [maxCandidates, maxSnippetTerms, maxEdges, maxBytes]
93
+ absent_preview_maxEdges: explicit_null
94
+ excluded: [complete_AuthorityIR_unit, inferred_relation, transitive_relation_closure, inferred_explanation, selected_authority, implementation_or_test_information]
95
+ bounds:
96
+ max_candidates: required_explicit_positive_safe_integer_top_k_after_filters
97
+ max_snippet_terms: required_explicit_positive_safe_integer_per_match_window
98
+ max_edges: required_explicit_positive_safe_integer_only_when_preview_is_requested
99
+ truncation: explicitly_reports_matchedUnits_returnedCandidates_and_truncated_without_claiming_complete_recall
100
+ max_bytes: required_explicit_positive_safe_integer_over_UTF-8_bytes_of_compact_JSON.stringify_complete_v2_discovery_payload
101
+ edge_overflow: AUTH_DISCOVERY_PREVIEW_BUDGET_with_null_discovery_and_no_partial_preview_or_silent_edge_reduction
102
+ byte_overflow: AUTH_DISCOVERY_BUDGET_with_null_discovery_and_no_silent_candidate_snippet_or_preview_reduction
103
+ fail_closed:
104
+ CLI_usage_error: missing_repeated_unknown_or_syntactically_invalid_CLI_argument_exits_2_without_a_discovery_product
105
+ runtime_guard: package_private_runtime_invalid_filter_or_preview_options_return_the_corresponding_diagnostic_with_null_discovery
106
+ invalid_query: AUTH_DISCOVERY_QUERY_INVALID
107
+ invalid_filter: [AUTH_DISCOVERY_FILTER_INVALID, AUTH_DISCOVERY_FILTER_UNKNOWN, AUTH_DISCOVERY_FILTER_CONTRADICTORY]
108
+ invalid_preview_configuration: AUTH_DISCOVERY_PREVIEW_INVALID
109
+ zero_match: AUTH_DISCOVERY_NOT_FOUND_does_not_prove_authority_absence
110
+ invalid_corpus: preserve_complete_compiler_diagnostics
111
+ partial_discovery: forbidden
112
+ boundaries:
113
+ read_only: true
114
+ writes_or_durable_artifacts: none
115
+ reads_projected_contracts: false
116
+ exports_private_AuthorityIR: false
117
+ semantic_search_model_reranking_or_final_selection: not_claimed
118
+ relation_preview: bounded_direct_authored_topology_not_context_or_semantic_inference
119
+ caller_next_step: caller_owned_candidate_selection_followed_by_explicit_exact_query_or_context