kibi-cli 2.32.0 → 2.36.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 (164) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +5 -1
  3. package/dist/commands/check-generated.d.ts +5 -1
  4. package/dist/commands/check-generated.d.ts.map +1 -1
  5. package/dist/commands/check-generated.js +24 -35
  6. package/dist/commands/init-helpers.d.ts.map +1 -1
  7. package/dist/commands/init-helpers.js +8 -5
  8. package/dist/commands/migrate.d.ts.map +1 -1
  9. package/dist/commands/migrate.js +23 -5
  10. package/dist/commands/sync/manifest.d.ts +10 -1
  11. package/dist/commands/sync/manifest.d.ts.map +1 -1
  12. package/dist/commands/sync/manifest.js +87 -14
  13. package/dist/commands/sync.d.ts.map +1 -1
  14. package/dist/commands/sync.js +19 -0
  15. package/dist/extractors/markdown.d.ts +1 -1
  16. package/dist/extractors/markdown.d.ts.map +1 -1
  17. package/dist/extractors/symbol-coordinates.js +2 -2
  18. package/dist/extractors/symbols-coordinator.d.ts +2 -4
  19. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  20. package/dist/extractors/symbols-coordinator.js +1 -2
  21. package/dist/operations/migration/proof-contract-claims.d.ts +23 -10
  22. package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -1
  23. package/dist/operations/migration/proof-contract-claims.js +35 -2
  24. package/dist/operations/migration/schema6.d.ts.map +1 -1
  25. package/dist/operations/migration/schema6.js +2 -4
  26. package/dist/operations/migration/symbol-coordinates-refresh.d.ts +3 -2
  27. package/dist/operations/migration/symbol-coordinates-refresh.d.ts.map +1 -1
  28. package/dist/operations/migration/symbol-coordinates-refresh.js +4 -3
  29. package/dist/operations/migration/untrack-symbol-coordinates.d.ts +23 -0
  30. package/dist/operations/migration/untrack-symbol-coordinates.d.ts.map +1 -0
  31. package/dist/operations/migration/untrack-symbol-coordinates.js +67 -0
  32. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -1
  33. package/dist/operations/modeling/requirement-modeler.js +48 -1
  34. package/dist/operations/modeling/requirement-types.d.ts +2 -1
  35. package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
  36. package/dist/operations/modeling/requirement-utils.d.ts +1 -1
  37. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -1
  38. package/dist/operations/modeling/requirement-utils.js +8 -1
  39. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  40. package/dist/operations/mutation/source-authoring.js +39 -20
  41. package/dist/operations/proof/claim-bindings.d.ts +18 -0
  42. package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
  43. package/dist/operations/proof/claim-bindings.js +157 -4
  44. package/dist/operations/proof/code-certificates.d.ts +34 -14
  45. package/dist/operations/proof/code-certificates.d.ts.map +1 -1
  46. package/dist/operations/proof/code-certificates.js +266 -157
  47. package/dist/operations/proof/code-models.d.ts +96 -0
  48. package/dist/operations/proof/code-models.d.ts.map +1 -0
  49. package/dist/operations/proof/code-models.js +601 -0
  50. package/dist/operations/proof/code-runner.d.ts +40 -0
  51. package/dist/operations/proof/code-runner.d.ts.map +1 -0
  52. package/dist/operations/proof/code-runner.js +164 -0
  53. package/dist/operations/proof/code-scope.d.ts +3 -0
  54. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  55. package/dist/operations/proof/code-scope.js +26 -2
  56. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  57. package/dist/operations/proof/ingest-proof.js +2 -1
  58. package/dist/operations/proof/regular-language.d.ts +89 -0
  59. package/dist/operations/proof/regular-language.d.ts.map +1 -0
  60. package/dist/operations/proof/regular-language.js +943 -0
  61. package/dist/operations/proof/source-code-readers.d.ts +12 -0
  62. package/dist/operations/proof/source-code-readers.d.ts.map +1 -0
  63. package/dist/operations/proof/source-code-readers.js +699 -0
  64. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  65. package/dist/operations/semantic-advisor/analyze-prose.js +2 -1
  66. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
  67. package/dist/operations/semantic-advisor/strict-count-rules.js +8 -2
  68. package/dist/operations/semantic-advisor/strict-rules.d.ts +8 -0
  69. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -1
  70. package/dist/operations/semantic-advisor/strict-rules.js +231 -1
  71. package/dist/operations/semantic-advisor/types.d.ts +1 -1
  72. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  73. package/dist/prolog.d.ts.map +1 -1
  74. package/dist/prolog.js +13 -3
  75. package/dist/public/operations/catalog.d.ts +156 -13
  76. package/dist/public/operations/catalog.d.ts.map +1 -1
  77. package/dist/public/operations/evidence-floor.js +1 -1
  78. package/dist/public/operations/proof-contract-claims.js +1 -1
  79. package/dist/public/operations/specs/composite.d.ts +16 -3
  80. package/dist/public/operations/specs/composite.d.ts.map +1 -1
  81. package/dist/public/operations/specs/modeling.d.ts +16 -3
  82. package/dist/public/operations/specs/modeling.d.ts.map +1 -1
  83. package/dist/public/operations/specs/modeling.js +22 -3
  84. package/dist/public/operations/specs/mutation-schemas.d.ts +140 -10
  85. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  86. package/dist/public/operations/specs/mutation-schemas.js +14 -3
  87. package/dist/public/operations/specs/upsert.d.ts +140 -10
  88. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  89. package/dist/public/proof-certificates.d.ts +75 -1
  90. package/dist/public/proof-certificates.d.ts.map +1 -1
  91. package/dist/public/proof-certificates.js +212 -0
  92. package/dist/public/proof-protocol.d.ts +143 -10
  93. package/dist/public/proof-protocol.d.ts.map +1 -1
  94. package/dist/public/proof-protocol.js +301 -16
  95. package/dist/public/proof-receipt.d.ts +4 -3
  96. package/dist/public/proof-receipt.d.ts.map +1 -1
  97. package/dist/public/proof-receipt.js +6 -1
  98. package/dist/public/proof-sources.d.ts +102 -0
  99. package/dist/public/proof-sources.d.ts.map +1 -0
  100. package/dist/public/proof-sources.js +1292 -0
  101. package/dist/public/schemas/entity.d.ts.map +1 -1
  102. package/dist/public/schemas/entity.js +21 -1
  103. package/dist/public/skills/kibi-commit-review/SKILL.md +8 -8
  104. package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
  105. package/dist/public/skills/kibi-decisions/SKILL.md +5 -2
  106. package/dist/public/skills/kibi-decisions/resources/decision-records.md +4 -1
  107. package/dist/public/skills/kibi-freshness/SKILL.md +2 -2
  108. package/dist/public/skills/kibi-traceability/SKILL.md +3 -2
  109. package/dist/public/skills/kibi-usage/SKILL.md +5 -3
  110. package/dist/public/skills/kibi-usage/resources/proof.md +105 -9
  111. package/dist/report/html-report.css +45 -10
  112. package/dist/report/html-report.d.ts.map +1 -1
  113. package/dist/report/html-report.js +74 -17
  114. package/dist/report/report-view.d.ts +1 -1
  115. package/dist/report/report-view.d.ts.map +1 -1
  116. package/dist/report/report-view.js +1 -0
  117. package/dist/schemas/entity.schema.json +199 -8
  118. package/dist/traceability/evidence-model.d.ts +13 -12
  119. package/dist/traceability/evidence-model.d.ts.map +1 -1
  120. package/dist/traceability/evidence-model.js +1 -1
  121. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  122. package/dist/traceability/staged-diagnostics.js +24 -20
  123. package/dist/traceability/staged-impact-contract.d.ts +4 -4
  124. package/dist/traceability/staged-impact-contract.js +9 -9
  125. package/dist/traceability/staged-symbols-manifest.d.ts +11 -3
  126. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  127. package/dist/traceability/staged-symbols-manifest.js +47 -140
  128. package/dist/types/entities.d.ts +1 -1
  129. package/dist/types/entities.d.ts.map +1 -1
  130. package/dist/utils/rule-registry.generated.d.ts +1 -1
  131. package/dist/utils/rule-registry.generated.js +1 -1
  132. package/dist/utils/schema-version.d.ts +1 -1
  133. package/dist/utils/schema-version.d.ts.map +1 -1
  134. package/dist/utils/schema-version.js +3 -1
  135. package/dist/utils/strict-modeling.d.ts +3 -2
  136. package/dist/utils/strict-modeling.d.ts.map +1 -1
  137. package/dist/utils/strict-modeling.js +37 -4
  138. package/dist/workspace-cwd.d.ts +15 -0
  139. package/dist/workspace-cwd.d.ts.map +1 -0
  140. package/dist/workspace-cwd.js +86 -0
  141. package/package.json +2 -2
  142. package/schema/validation.pl +3 -1
  143. package/src/public/operations/evidence-floor.ts +1 -1
  144. package/src/public/operations/proof-contract-claims.ts +1 -1
  145. package/src/public/operations/specs/modeling.ts +24 -5
  146. package/src/public/operations/specs/mutation-schemas.ts +14 -3
  147. package/src/public/proof-certificates.ts +296 -1
  148. package/src/public/proof-protocol-types.d.ts +54 -2
  149. package/src/public/proof-protocol.ts +396 -20
  150. package/src/public/proof-receipt.ts +8 -2
  151. package/src/public/proof-sources.ts +1656 -0
  152. package/src/public/schemas/entity.ts +32 -2
  153. package/src/public/skills/kibi-commit-review/SKILL.md +8 -8
  154. package/src/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
  155. package/src/public/skills/kibi-decisions/SKILL.md +5 -2
  156. package/src/public/skills/kibi-decisions/resources/decision-records.md +4 -1
  157. package/src/public/skills/kibi-freshness/SKILL.md +2 -2
  158. package/src/public/skills/kibi-traceability/SKILL.md +3 -2
  159. package/src/public/skills/kibi-usage/SKILL.md +5 -3
  160. package/src/public/skills/kibi-usage/resources/proof.md +105 -9
  161. package/src/schemas/entity.schema.json +199 -8
  162. package/dist/traceability/reviewed-coordinate-refresh.d.ts +0 -10
  163. package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +0 -1
  164. package/dist/traceability/reviewed-coordinate-refresh.js +0 -49
@@ -785,13 +785,40 @@
785
785
  "exhaustive",
786
786
  "typecheck",
787
787
  "arithmetic",
788
- "smt"
788
+ "smt",
789
+ "rule",
790
+ "state_machine",
791
+ "regex",
792
+ "source"
789
793
  ],
790
- "description": "What the checker establishes; absent means e2e. exhaustive, typecheck, arithmetic and smt must leave a kibi.code-certificate.v1 that Kibi re-checks before the receipt counts as proved."
794
+ "description": "What the checker establishes; absent means e2e. exhaustive, typecheck, arithmetic, smt, rule, state_machine and regex must leave a kibi.code-certificate.v1 that Kibi re-checks before the receipt counts as proved. source reads the contract's source itself: the run may leave {version, kind: source, test_id, source} or nothing, and Kibi stores its own read as the certificate."
795
+ },
796
+ "source": {
797
+ "type": "object",
798
+ "description": "source: the project source a source proof reads. A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?}. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.",
799
+ "required": [
800
+ "reader"
801
+ ],
802
+ "properties": {
803
+ "reader": {
804
+ "type": "string",
805
+ "enum": [
806
+ "json",
807
+ "yaml",
808
+ "glob",
809
+ "openapi",
810
+ "references",
811
+ "schema",
812
+ "routes",
813
+ "validator"
814
+ ]
815
+ }
816
+ },
817
+ "additionalProperties": true
791
818
  },
792
819
  "domain_source": {
793
820
  "type": "object",
794
- "description": "exhaustive and typecheck: the symbol that defines the finite domain. The proof must import it from its source file; a hand-listed domain downgrades the receipt to example. Kibi reads the export named `export`, or the symbol's title when `export` is absent.",
821
+ "description": "exhaustive and typecheck: the symbol that defines the finite domain (typecheck: also the type whose fields a required_fields fact names). state_machine: the transition table or next-state function. The proof must import it from its source file; a hand-listed domain downgrades the receipt to example. Kibi reads the export named `export`, or the symbol's title when `export` is absent.",
795
822
  "required": [
796
823
  "symbol_id"
797
824
  ],
@@ -824,7 +851,7 @@
824
851
  },
825
852
  "proves": {
826
853
  "type": "array",
827
- "description": "Certificate kinds: the requirement claim keys (CLAIM-...) this certificate proves. Each must be a modeled claim of a current requirement the test reaches through its scenarios. Kibi derives what the certificate must establish from the claim's grounding fact (a set fact for exhaustive or typecheck, a numeric fact for arithmetic or smt); a claim with no such derivation is only attested and never counts as proved.",
854
+ "description": "Certificate kinds: the requirement claim keys (CLAIM-...) this certificate proves. Each must be a modeled claim of a current requirement the test reaches through its scenarios. Kibi derives what the certificate must establish from the claim's grounding fact (a set fact for exhaustive or typecheck, a numeric fact for arithmetic or smt, a rule, predicate or set fact for rule and state_machine, a string fact for regex); a claim with no such derivation is only attested and never counts as proved.",
828
855
  "minItems": 1,
829
856
  "items": {
830
857
  "type": "string",
@@ -834,9 +861,59 @@
834
861
  },
835
862
  "value_source": {
836
863
  "type": "array",
837
- "description": "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base.",
864
+ "description": "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).",
838
865
  "minItems": 1,
839
866
  "items": {
867
+ "type": "object",
868
+ "properties": {
869
+ "symbol_id": {
870
+ "type": "string",
871
+ "minLength": 1
872
+ },
873
+ "export": {
874
+ "type": "string",
875
+ "minLength": 1
876
+ },
877
+ "source": {
878
+ "type": "object",
879
+ "description": "A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?}. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.",
880
+ "required": [
881
+ "reader"
882
+ ],
883
+ "properties": {
884
+ "reader": {
885
+ "type": "string",
886
+ "enum": [
887
+ "json",
888
+ "yaml",
889
+ "glob",
890
+ "openapi",
891
+ "references",
892
+ "schema",
893
+ "routes",
894
+ "validator"
895
+ ]
896
+ }
897
+ },
898
+ "additionalProperties": true
899
+ },
900
+ "measure": {
901
+ "type": "string",
902
+ "enum": [
903
+ "value",
904
+ "count"
905
+ ],
906
+ "description": "value (default for an export): the export is a number. count (the only measure of a source): the number of members of a list, set, map or object export, or of a source."
907
+ }
908
+ },
909
+ "additionalProperties": false
910
+ }
911
+ },
912
+ "predicate_source": {
913
+ "type": "object",
914
+ "description": "rule: the code function behind each predicate a claim's rule, predicate or set fact names, keyed by predicate name. Each export takes the predicate's arguments in order and returns a boolean; Kibi calls it on every combination of its argument domains.",
915
+ "minProperties": 1,
916
+ "additionalProperties": {
840
917
  "type": "object",
841
918
  "required": [
842
919
  "symbol_id"
@@ -848,12 +925,116 @@
848
925
  },
849
926
  "export": {
850
927
  "type": "string",
851
- "minLength": 1
928
+ "minLength": 1,
929
+ "description": "The exported function's name in the symbol's source file. Without it Kibi reads the export named by the symbol's title."
930
+ },
931
+ "harness_for": {
932
+ "type": "array",
933
+ "minItems": 1,
934
+ "items": {
935
+ "type": "string",
936
+ "minLength": 1
937
+ },
938
+ "description": "The predicate is a test harness that decides the predicate by driving these code symbols (for example by calling the handler with each role). The symbols must be covered_by the test; a claim the harness proves is bound with scope harness."
852
939
  }
853
940
  },
854
941
  "additionalProperties": false
855
942
  }
856
943
  },
944
+ "domains": {
945
+ "type": "object",
946
+ "description": "rule: the finite domain of each argument type, keyed by type name (an array, Set, Map or object export, or a Python list, set, dict or Enum), or {source} for the members Kibi reads from a project source (every route, every table, every environment variable). state_machine with a next-state function: the `state` and `event` domains it is called on.",
947
+ "minProperties": 1,
948
+ "additionalProperties": {
949
+ "anyOf": [
950
+ {
951
+ "type": "object",
952
+ "required": [
953
+ "symbol_id"
954
+ ],
955
+ "properties": {
956
+ "symbol_id": {
957
+ "type": "string",
958
+ "minLength": 1
959
+ },
960
+ "export": {
961
+ "type": "string",
962
+ "minLength": 1
963
+ }
964
+ },
965
+ "additionalProperties": false
966
+ },
967
+ {
968
+ "type": "object",
969
+ "required": [
970
+ "source"
971
+ ],
972
+ "properties": {
973
+ "source": {
974
+ "type": "object",
975
+ "description": "A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?}. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.",
976
+ "required": [
977
+ "reader"
978
+ ],
979
+ "properties": {
980
+ "reader": {
981
+ "type": "string",
982
+ "enum": [
983
+ "json",
984
+ "yaml",
985
+ "glob",
986
+ "openapi",
987
+ "references",
988
+ "schema",
989
+ "routes",
990
+ "validator"
991
+ ]
992
+ }
993
+ },
994
+ "additionalProperties": true
995
+ }
996
+ },
997
+ "additionalProperties": false
998
+ }
999
+ ]
1000
+ }
1001
+ },
1002
+ "initial_source": {
1003
+ "type": "object",
1004
+ "required": [
1005
+ "symbol_id"
1006
+ ],
1007
+ "properties": {
1008
+ "symbol_id": {
1009
+ "type": "string",
1010
+ "minLength": 1
1011
+ },
1012
+ "export": {
1013
+ "type": "string",
1014
+ "minLength": 1
1015
+ }
1016
+ },
1017
+ "additionalProperties": false,
1018
+ "description": "state_machine: the export holding the initial state (or states), needed for initial_states and reachable_states facts."
1019
+ },
1020
+ "pattern_source": {
1021
+ "type": "object",
1022
+ "required": [
1023
+ "symbol_id"
1024
+ ],
1025
+ "properties": {
1026
+ "symbol_id": {
1027
+ "type": "string",
1028
+ "minLength": 1
1029
+ },
1030
+ "export": {
1031
+ "type": "string",
1032
+ "minLength": 1
1033
+ }
1034
+ },
1035
+ "additionalProperties": false,
1036
+ "description": "regex: the export holding the code's pattern (a RegExp, or a Python re.Pattern) or string constant that a string fact is about."
1037
+ },
857
1038
  "constraint_source": {
858
1039
  "type": "object",
859
1040
  "description": "arithmetic and smt: the typed numeric property_value facts the certificate's assumptions come from. Kibi checks the assumptions (or the query's assertions) are exactly these facts' constraints, so the proof is about the knowledge base, not numbers the test chose.",
@@ -1199,7 +1380,11 @@
1199
1380
  "exhaustive",
1200
1381
  "typecheck",
1201
1382
  "arithmetic",
1202
- "smt"
1383
+ "smt",
1384
+ "rule",
1385
+ "state_machine",
1386
+ "regex",
1387
+ "source"
1203
1388
  ]
1204
1389
  },
1205
1390
  "evidence_level": {
@@ -1254,6 +1439,8 @@
1254
1439
  "type": "string",
1255
1440
  "enum": [
1256
1441
  "code",
1442
+ "source",
1443
+ "harness",
1257
1444
  "intent"
1258
1445
  ]
1259
1446
  },
@@ -1338,7 +1525,11 @@
1338
1525
  "lt",
1339
1526
  "lte",
1340
1527
  "gt",
1341
- "gte"
1528
+ "gte",
1529
+ "matches",
1530
+ "includes",
1531
+ "subset_of",
1532
+ "excludes"
1342
1533
  ]
1343
1534
  },
1344
1535
  "value_type": {
@@ -1,10 +0,0 @@
1
- import type { HostSourceAnalysisResultV2, SourceAnalysisService } from "../plugins/source-analysis-service.js";
2
- import type { GitChangeSnapshot } from "./git-change-snapshot.js";
3
- import type { Fingerprint } from "./impact-review.js";
4
- /** Authorize lexical coordinate migration only from a captured local staged review.
5
- * Protected PR hosts must use their target-base evaluator, not this HEAD policy. */
6
- export declare function createReviewedDecoratorCoordinateVerifier(snapshot: GitChangeSnapshot, service: SourceAnalysisService, bindings: {
7
- providerSetFingerprint: Fingerprint;
8
- evaluatorFingerprint: Fingerprint;
9
- }): (path: string, analysis: HostSourceAnalysisResultV2) => Promise<void>;
10
- //# sourceMappingURL=reviewed-coordinate-refresh.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reviewed-coordinate-refresh.d.ts","sourceRoot":"","sources":["../../src/traceability/reviewed-coordinate-refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;oFACoF;AACpF,wBAAgB,yCAAyC,CACvD,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE;IACR,sBAAsB,EAAE,WAAW,CAAC;IACpC,oBAAoB,EAAE,WAAW,CAAC;CACnC,GACA,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,KAAK,OAAO,CAAC,IAAI,CAAC,CA4DvE"}
@@ -1,49 +0,0 @@
1
- import { analyzeSourceChanges } from "../plugins/source-change-analysis.js";
2
- import { evaluateImpactReview, loadBaseImpactPolicy, } from "./impact-evaluator.js";
3
- /** Authorize lexical coordinate migration only from a captured local staged review.
4
- * Protected PR hosts must use their target-base evaluator, not this HEAD policy. */
5
- export function createReviewedDecoratorCoordinateVerifier(snapshot, service, bindings) {
6
- if (process.env.CI)
7
- throw new Error("Reviewed partial coordinate migration is unavailable in CI without a protected target-base snapshot");
8
- const policy = loadBaseImpactPolicy(snapshot);
9
- let reviewValidation;
10
- return async (path, analysis) => {
11
- snapshot.assertUnchanged();
12
- if (analysis.status !== "partial" ||
13
- analysis.language !== "python" ||
14
- analysis.sourceFile !== path ||
15
- analysis.module.analysisMode !== "parser" ||
16
- analysis.stamp?.pluginId !== "kibi-plugin-treesitter" ||
17
- analysis.uncoveredRanges.length === 0 ||
18
- analysis.providerId !== "kibi-plugin-treesitter.tree-sitter.v2" ||
19
- analysis.diagnostics.length === 0 ||
20
- analysis.providerFingerprint === null ||
21
- !analysis.diagnostics.every((diagnostic) => diagnostic.code === "TREESITTER_DECORATOR_EXPANSION_UNAVAILABLE" &&
22
- policy.allowedPartial.some((allowed) => allowed.providerId === analysis.providerId &&
23
- allowed.providerFingerprint ===
24
- `sha256:${analysis.providerFingerprint}` &&
25
- allowed.diagnosticCode === diagnostic.code &&
26
- allowed.limitationClass === "python-decorator-expansion")))
27
- throw new Error(`Decorator coordinates for ${path} are not allowed by the captured base policy`);
28
- reviewValidation ??= (async () => {
29
- const analyses = await analyzeSourceChanges(snapshot.inventory, service);
30
- // Use the same host normalization as staged check, without changing the
31
- // original captured inventory used by the generated-byte comparison.
32
- const evaluatedSnapshot = {
33
- ...snapshot,
34
- inventory: snapshot.inventory.map((file) => analyses.get(file.path)?.after?.status === "ok"
35
- ? { ...file, analysisDepth: "symbol", disposition: "checked" }
36
- : { ...file }),
37
- };
38
- const result = evaluateImpactReview(evaluatedSnapshot, {
39
- ...bindings,
40
- analyses,
41
- });
42
- if (!result.passed)
43
- throw new Error(`Reviewed coordinate migration failed: ${result.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
44
- snapshot.assertUnchanged();
45
- })();
46
- await reviewValidation;
47
- snapshot.assertUnchanged();
48
- };
49
- }