cc-transcript 14.45.38__tar.gz → 14.46.1__tar.gz

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 (254) hide show
  1. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/Cargo.lock +15 -0
  2. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/PKG-INFO +1 -1
  3. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/pyproject.toml +1 -1
  4. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/activity.rs +1 -1
  5. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/lib.rs +1 -0
  6. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/literals/protocol.rs +4 -2
  7. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/protocol.rs +16 -1
  8. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/render.rs +2 -2
  9. cc_transcript-14.46.1/rust/crates/core/src/snapshot_input.rs +127 -0
  10. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/python.rs +4 -0
  11. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/snapshots.rs +1 -88
  12. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/Cargo.toml +0 -0
  13. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/LICENSE +0 -0
  14. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/README.md +0 -0
  15. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/__init__.py +0 -0
  16. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/__init__.pyi +0 -0
  17. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/_native.pyi +0 -0
  18. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/activity.py +0 -0
  19. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/activity_probe.py +0 -0
  20. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/builders.py +0 -0
  21. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/codex.py +0 -0
  22. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/command.py +0 -0
  23. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/context.py +0 -0
  24. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/corrections.py +0 -0
  25. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/cost.py +0 -0
  26. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/decision_store.py +0 -0
  27. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/decisions.py +0 -0
  28. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/discovery.py +0 -0
  29. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/disktruth.py +0 -0
  30. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/evidence.py +0 -0
  31. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/extract/__init__.py +0 -0
  32. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/extract/correct.py +0 -0
  33. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/facts.py +0 -0
  34. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/filterspec.py +0 -0
  35. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/heartbeats.py +0 -0
  36. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/ids.py +0 -0
  37. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/judge/__init__.py +0 -0
  38. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/judge/llm.py +0 -0
  39. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/judge/similar.py +0 -0
  40. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/judge/verdicts.py +0 -0
  41. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/ledger.py +0 -0
  42. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/literals.py +0 -0
  43. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/__init__.py +0 -0
  44. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/candidates.py +0 -0
  45. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/confidence.py +0 -0
  46. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/engine.py +0 -0
  47. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/formats.py +0 -0
  48. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/sampling.py +0 -0
  49. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/signals.py +0 -0
  50. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/sourcekind.py +0 -0
  51. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/spec.py +0 -0
  52. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/mining/store.py +0 -0
  53. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/models.py +0 -0
  54. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/nlp.py +0 -0
  55. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/notifications.py +0 -0
  56. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/parser.py +0 -0
  57. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/py.typed +0 -0
  58. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/query.py +0 -0
  59. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/render.py +0 -0
  60. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/__init__.py +0 -0
  61. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/buckets.py +0 -0
  62. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/data/afinn-en-165.tsv +0 -0
  63. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/data/domain_overrides.tsv +0 -0
  64. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/data/en-ewt.udpipe +0 -0
  65. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/engine.py +0 -0
  66. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/lexicon.py +0 -0
  67. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/sentiment/scorespec.py +0 -0
  68. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/snapshot_schema/config.schema.json +0 -0
  69. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/snapshot_schema/context.schema.json +0 -0
  70. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/snapshot_schema/request.schema.json +0 -0
  71. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/snapshot_schema/response.schema.json +0 -0
  72. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/snapshot_schema/tool_registry.schema.json +0 -0
  73. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/snapshots.py +0 -0
  74. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/synthetic.py +0 -0
  75. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/tools.py +0 -0
  76. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/cc_transcript/watch.py +0 -0
  77. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/Cargo.toml +0 -0
  78. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/blame.rs +0 -0
  79. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/corpus.rs +0 -0
  80. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/corrections.rs +0 -0
  81. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/digest.rs +0 -0
  82. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/facts.rs +0 -0
  83. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/grep.rs +0 -0
  84. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/list.rs +0 -0
  85. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/mod.rs +0 -0
  86. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/scratchpad.rs +0 -0
  87. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/show.rs +0 -0
  88. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/slice.rs +0 -0
  89. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/stats.rs +0 -0
  90. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/commands/watch.rs +0 -0
  91. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/lib.rs +0 -0
  92. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/output.rs +0 -0
  93. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/target.rs +0 -0
  94. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/cli/src/timearg.rs +0 -0
  95. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/Cargo.toml +0 -0
  96. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/benches/parse.rs +0 -0
  97. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/benches/render.rs +0 -0
  98. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/benches/toolcall.rs +0 -0
  99. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/build.rs +0 -0
  100. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/actor.rs +0 -0
  101. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/blame.rs +0 -0
  102. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/buckets.rs +0 -0
  103. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/discovery.rs +0 -0
  104. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/lower.rs +0 -0
  105. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/mod.rs +0 -0
  106. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/parse.rs +0 -0
  107. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/probe.rs +0 -0
  108. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/protocol.rs +0 -0
  109. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/review_continuation.rs +0 -0
  110. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/codex/types.rs +0 -0
  111. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/command.rs +0 -0
  112. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/context.rs +0 -0
  113. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/corrections.rs +0 -0
  114. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/cost.rs +0 -0
  115. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/discovery.rs +0 -0
  116. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/facts.rs +0 -0
  117. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/feedback.rs +0 -0
  118. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/filter.rs +0 -0
  119. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/gateway.rs +0 -0
  120. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/ids.rs +0 -0
  121. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/judge.rs +0 -0
  122. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/literals/command.rs +0 -0
  123. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/literals/corrections.rs +0 -0
  124. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/literals/feedback.rs +0 -0
  125. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/literals/mining.rs +0 -0
  126. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/literals/mod.rs +0 -0
  127. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/mining.rs +0 -0
  128. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/mining_index.rs +0 -0
  129. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/notifications.rs +0 -0
  130. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/parse.rs +0 -0
  131. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/pystr.rs +0 -0
  132. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/query.rs +0 -0
  133. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/request_body.rs +0 -0
  134. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/rng.rs +0 -0
  135. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan.rs +0 -0
  136. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_checkpoint.rs +0 -0
  137. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_grep.rs +0 -0
  138. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_grep_stream.rs +0 -0
  139. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_grep_stream_tests.rs +0 -0
  140. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_index.rs +0 -0
  141. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_projection.rs +0 -0
  142. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_regressions.rs +0 -0
  143. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/scan_stream.rs +0 -0
  144. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/schema.rs +0 -0
  145. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot.rs +0 -0
  146. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_activity.rs +0 -0
  147. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_admission_report_tests.rs +0 -0
  148. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_cache.rs +0 -0
  149. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_cache_tests.rs +0 -0
  150. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_catalog.rs +0 -0
  151. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_catalog_owner.rs +0 -0
  152. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_catalog_tests.rs +0 -0
  153. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_codec.rs +0 -0
  154. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_codex_append.rs +0 -0
  155. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_common_borrowed_parent_tests.rs +0 -0
  156. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_compact_codex.rs +0 -0
  157. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_compact_codex_tests.rs +0 -0
  158. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_direct_tail.rs +0 -0
  159. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_direct_tail_tests.rs +0 -0
  160. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_graph_anchor_tests.rs +0 -0
  161. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_graph_validation_tests.rs +0 -0
  162. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_hydrate_budget_tests.rs +0 -0
  163. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_hydration_observations.rs +0 -0
  164. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_index_allocations.rs +0 -0
  165. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_interaction_api.rs +0 -0
  166. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_interaction_api_tests.rs +0 -0
  167. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_interactions.rs +0 -0
  168. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_interactions_tests.rs +0 -0
  169. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_labels.rs +0 -0
  170. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_ledger.rs +0 -0
  171. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_ledger_tests.rs +0 -0
  172. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_load_charge_audit_tests.rs +0 -0
  173. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_load_charge_work_tests.rs +0 -0
  174. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_membership_progress.rs +0 -0
  175. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_membership_progress_controls.rs +0 -0
  176. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_membership_progress_tests.rs +0 -0
  177. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_memory.rs +0 -0
  178. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_owned.rs +0 -0
  179. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_persistent.rs +0 -0
  180. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_prepared.rs +0 -0
  181. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_prepared_disk.rs +0 -0
  182. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_prepared_service.rs +0 -0
  183. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_projection.rs +0 -0
  184. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_publication_shared_admission_tests.rs +0 -0
  185. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_query_hydration_tests.rs +0 -0
  186. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_materialization.rs +0 -0
  187. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_projection.rs +0 -0
  188. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_projection_tests.rs +0 -0
  189. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_scope.rs +0 -0
  190. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_scope_tests.rs +0 -0
  191. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_tail_tests.rs +0 -0
  192. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_raw_window.rs +0 -0
  193. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_registered_review_tests.rs +0 -0
  194. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_regressions.rs +0 -0
  195. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_review.rs +0 -0
  196. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_review_context.rs +0 -0
  197. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_review_reader.rs +0 -0
  198. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_review_source.rs +0 -0
  199. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_root_warm.rs +0 -0
  200. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_sidechain_absence.rs +0 -0
  201. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_sidechain_absence_tests.rs +0 -0
  202. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_skill_demand_controls.rs +0 -0
  203. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_skill_demand_tests.rs +0 -0
  204. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_skill_framing.rs +0 -0
  205. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_skills.rs +0 -0
  206. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_source_cache_index_tests.rs +0 -0
  207. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_spine.rs +0 -0
  208. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_spine_tests.rs +0 -0
  209. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_symlink_proof.rs +0 -0
  210. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/snapshot_text.rs +0 -0
  211. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/sqlite.rs +0 -0
  212. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/toolcall.rs +0 -0
  213. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/types.rs +0 -0
  214. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/value.rs +0 -0
  215. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/src/watch.rs +0 -0
  216. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/tests/sonic_arena_model.rs +0 -0
  217. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/core/tests/std_allocation_model.rs +0 -0
  218. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/Cargo.toml +0 -0
  219. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/build.rs +0 -0
  220. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/data/command_prefix_pins.tsv +0 -0
  221. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/actor_bridge.rs +0 -0
  222. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/bin/stub_gen.rs +0 -0
  223. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/codex.rs +0 -0
  224. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/command.rs +0 -0
  225. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/context.rs +0 -0
  226. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/corrections.rs +0 -0
  227. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/discovery.rs +0 -0
  228. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/feedback.rs +0 -0
  229. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/judge.rs +0 -0
  230. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/lexicon.rs +0 -0
  231. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/lib.rs +0 -0
  232. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/mining.rs +0 -0
  233. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/nlp.rs +0 -0
  234. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/render.rs +0 -0
  235. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/score.rs +0 -0
  236. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/snapshot_decode.rs +0 -0
  237. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/snapshots_registered_review.rs +0 -0
  238. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/sqlite.rs +0 -0
  239. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/toolcall.rs +0 -0
  240. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/attachment.rs +0 -0
  241. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/blocks.rs +0 -0
  242. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/command.rs +0 -0
  243. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/convert.rs +0 -0
  244. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/dunder.rs +0 -0
  245. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/events.rs +0 -0
  246. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/meta.rs +0 -0
  247. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/mod.rs +0 -0
  248. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/print.rs +0 -0
  249. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/store.rs +0 -0
  250. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/system.rs +0 -0
  251. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/toolcall.rs +0 -0
  252. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/toolresult.rs +0 -0
  253. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/views/transcript.rs +0 -0
  254. {cc_transcript-14.45.38 → cc_transcript-14.46.1}/rust/crates/py/src/watch.rs +0 -0
@@ -248,6 +248,21 @@ dependencies = [
248
248
  "sonic-rs",
249
249
  ]
250
250
 
251
+ [[package]]
252
+ name = "cc-transcript-owner"
253
+ version = "0.9.0"
254
+ dependencies = [
255
+ "cc-transcript-core",
256
+ "chrono",
257
+ "crossbeam-channel",
258
+ "jsonschema",
259
+ "libc",
260
+ "serde_json",
261
+ "sha2",
262
+ "sonic-rs",
263
+ "tempfile",
264
+ ]
265
+
251
266
  [[package]]
252
267
  name = "cc-transcript-py"
253
268
  version = "0.9.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cc-transcript
3
- Version: 14.45.38
3
+ Version: 14.46.1
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cc-transcript"
3
- version = "14.45.38" # informational — releases stamp the version from the git tag
3
+ version = "14.46.1" # informational — releases stamp the version from the git tag
4
4
  description = "Grep every Claude Code session you've ever run."
5
5
  readme = "README.md"
6
6
  license = "PolyForm-Noncommercial-1.0.0"
@@ -85,7 +85,7 @@ pub struct SessionActivity {
85
85
  /// agent-injected relay banner, with non-blank text. Compact-summary exclusion
86
86
  /// matches captain-hook, which consumes this probe since the 10.2.0
87
87
  /// shared-classifier fix.
88
- fn opens_turn(user: &UserEntry) -> bool {
88
+ pub fn opens_turn(user: &UserEntry) -> bool {
89
89
  !(user.meta.is_meta
90
90
  || user.meta.is_sidechain
91
91
  || user.meta.is_compact_summary
@@ -44,6 +44,7 @@ pub mod snapshot;
44
44
  pub mod snapshot_activity;
45
45
  pub mod snapshot_codec;
46
46
  mod snapshot_index_allocations;
47
+ pub mod snapshot_input;
47
48
  pub mod snapshot_labels;
48
49
  pub mod snapshot_ledger;
49
50
  pub mod snapshot_memory;
@@ -1,5 +1,6 @@
1
- //! CC-protocol marker strings and the flattened interrupt / agent-injection / junk
2
- //! alternations. Hand-owned; mirrored to Python via `_native.embedded_literals()`.
1
+ //! CC-protocol marker strings and the flattened interrupt / agent-injection /
2
+ //! structural-noise / junk alternations. Hand-owned; mirrored to Python via
3
+ //! `_native.embedded_literals()`.
3
4
 
4
5
  pub const DENIAL_PREFIX: &str =
5
6
  "The user doesn't want to proceed with this tool use. The tool use was rejected";
@@ -11,6 +12,7 @@ pub const ANSWERED_PREFIX: &str = "Your questions have been answered: ";
11
12
  pub const ANSWERED_TRAILER: &str = ". You can now continue with these answers in mind.";
12
13
  pub const INTERRUPT_MARKER_PATTERN: &str = "(?:^\\s*\\[Request (?-i:[Ii])nterrupted by user)";
13
14
  pub const AGENT_INJECTION_PATTERN: &str = "(?:\\A\\s*<(?:teammate-message|scheduled-task|agent-message|cross-session-message)(?:[\\s/>]|$))|(?:\\A\\s*Another Claude sess(?-i:[Ii])on sent a message:)|(?:\\A\\s*# Augment Agent(?:\\s|$))|(?:\\A\\s*\\[Role Rem(?-i:[Ii])nder(?:[\\s:\\]]|$))";
15
+ pub const STRUCTURAL_NOISE_PATTERN: &str = "(?:<(?:system[_-](?:instruction|reminder)|local-command-(?:stdout|stderr|caveat)|command-(?:name|message|args)|task-notification|persisted-output|output-file)\\b)|(?:Caveat: The messages below were generated by the user while running local commands\\.)|(?:REMAINING_TASKS_ACKNOWLEDGED)|(?:<<[a-z][a-z0-9-]*>>)|(?:^Base directory for this skill:)|(?:(?:###\\s+[\\w][\\w \\-]{0,30}\\s+){3,}###)|(?:\\A\\s*<(?:teammate-message|scheduled-task|agent-message|cross-session-message)(?:[\\s/>]|$))|(?:\\A\\s*Another Claude sess(?-i:[Ii])on sent a message:)|(?:\\A\\s*# Augment Agent(?:\\s|$))|(?:\\A\\s*\\[Role Rem(?-i:[Ii])nder(?:[\\s:\\]]|$))";
14
16
  pub const TASK_NOTIFICATION_MARKER: &str = "<task-notification>";
15
17
  pub const TOOL_USE_ID_PREFIX: &str = "<tool-use-id>";
16
18
  pub const TOOL_USE_ID_SUFFIX: &str = "</tool-use-id>";
@@ -1,7 +1,9 @@
1
1
  use once_cell::sync::Lazy;
2
2
  use regex::Regex;
3
3
 
4
- use crate::literals::protocol::{AGENT_INJECTION_PATTERN, INTERRUPT_MARKER_PATTERN};
4
+ use crate::literals::protocol::{
5
+ AGENT_INJECTION_PATTERN, INTERRUPT_MARKER_PATTERN, STRUCTURAL_NOISE_PATTERN,
6
+ };
5
7
  use crate::pystr;
6
8
 
7
9
  pub use crate::literals::protocol::{
@@ -30,6 +32,19 @@ pub fn is_agent_injection(text: &str) -> bool {
30
32
  AGENT_INJECTION_RE.is_match(pystr::lstrip(text))
31
33
  }
32
34
 
35
+ /// The structural-noise regex (filterspec.py STRUCTURAL_NOISE_RE): the structural and
36
+ /// agent-injection groups compiled case-insensitively.
37
+ pub static STRUCTURAL_NOISE_RE: Lazy<Regex> = Lazy::new(|| {
38
+ Regex::new(&format!("(?i){STRUCTURAL_NOISE_PATTERN}")).expect("structural noise regex")
39
+ });
40
+
41
+ /// Whether ``text`` opens with structural noise (``STRUCTURAL_NOISE_RE.match``).
42
+ pub fn starts_with_structural_noise(text: &str) -> bool {
43
+ STRUCTURAL_NOISE_RE
44
+ .find(text)
45
+ .is_some_and(|found| found.start() == 0)
46
+ }
47
+
33
48
  /// embedded_user_text (filterspec.py embedded_user_text): the verbatim instruction
34
49
  /// wrapped between the USER_SAID markers, or None.
35
50
  pub fn embedded_user_text(content: &str) -> Option<String> {
@@ -223,7 +223,7 @@ fn py_int(lexeme: &str) -> String {
223
223
 
224
224
  // pad_exp=true: Python repr(float) layout. false: installed-orjson layout (fixed
225
225
  // notation through exponent -5, bare exponent, nonfinite -> null; orjson 3.11.9).
226
- fn py_float_repr(value: f64, pad_exp: bool) -> String {
226
+ pub fn py_float_repr(value: f64, pad_exp: bool) -> String {
227
227
  if !value.is_finite() {
228
228
  return match (pad_exp, value.is_nan(), value.is_sign_negative()) {
229
229
  (false, _, _) => "null".to_string(),
@@ -337,7 +337,7 @@ fn py_repr(value: &Value) -> String {
337
337
 
338
338
  // Python repr() of a str: prefer single quotes (double only when the string has a single
339
339
  // quote and no double), escape the quote/backslash/\n\r\t, \x/\u/\U-escape non-printables.
340
- fn py_string_repr(s: &str) -> String {
340
+ pub fn py_string_repr(s: &str) -> String {
341
341
  let quote = if s.contains('\'') && !s.contains('"') {
342
342
  '"'
343
343
  } else {
@@ -0,0 +1,127 @@
1
+ use serde_json::Value as SchemaValue;
2
+ use sonic_rs::{json, JsonContainerTrait, JsonType, JsonValueTrait, Value};
3
+
4
+ use crate::snapshot::{SnapshotError, Status};
5
+
6
+ fn invalid(reason: impl Into<String>) -> SnapshotError {
7
+ SnapshotError::new(Status::InvalidRequest, reason)
8
+ }
9
+
10
+ pub fn exact_integer(text: &str) -> Result<i64, SnapshotError> {
11
+ const MAX_SAFE: u64 = 9_007_199_254_740_991;
12
+ let (negative, unsigned) = text
13
+ .strip_prefix('-')
14
+ .map_or((false, text), |rest| (true, rest));
15
+ let (coefficient, exponent) = unsigned.split_once(['e', 'E']).unwrap_or((unsigned, "0"));
16
+ let fractional = coefficient
17
+ .split_once('.')
18
+ .map_or(0, |(_, fraction)| fraction.len());
19
+ let digits: String = coefficient.chars().filter(|&digit| digit != '.').collect();
20
+ let digits = digits.trim_start_matches('0');
21
+ if digits.is_empty() {
22
+ return Ok(0);
23
+ }
24
+ let significant = digits.trim_end_matches('0');
25
+ let trailing = digits.len() - significant.len();
26
+ let exponent: i64 = exponent
27
+ .parse()
28
+ .map_err(|_| invalid("integer exponent exceeds safe range"))?;
29
+ let scale = exponent
30
+ .checked_add(trailing as i64)
31
+ .and_then(|value| value.checked_sub(fractional as i64))
32
+ .ok_or_else(|| invalid("integer exponent exceeds safe range"))?;
33
+ if scale < 0 {
34
+ return Err(invalid("fractional metadata number"));
35
+ }
36
+ if scale > 16 || significant.len().saturating_add(scale as usize) > 16 {
37
+ return Err(invalid("metadata integer exceeds safe range"));
38
+ }
39
+ let mut value: u64 = significant
40
+ .parse()
41
+ .map_err(|_| invalid("invalid metadata integer"))?;
42
+ for _ in 0..scale {
43
+ value *= 10;
44
+ }
45
+ if value > MAX_SAFE {
46
+ return Err(invalid("metadata integer exceeds safe range"));
47
+ }
48
+ Ok(if negative {
49
+ -(value as i64)
50
+ } else {
51
+ value as i64
52
+ })
53
+ }
54
+
55
+ pub fn normalize_numbers(value: &mut SchemaValue) -> Result<(), SnapshotError> {
56
+ match value {
57
+ SchemaValue::Array(values) => {
58
+ for value in values {
59
+ normalize_numbers(value)?;
60
+ }
61
+ }
62
+ SchemaValue::Object(values) => {
63
+ for value in values.values_mut() {
64
+ normalize_numbers(value)?;
65
+ }
66
+ }
67
+ SchemaValue::Number(number) => {
68
+ *number = serde_json::Number::from(exact_integer(&number.to_string())?);
69
+ }
70
+ _ => {}
71
+ }
72
+ Ok(())
73
+ }
74
+
75
+ pub fn native_value(value: &SchemaValue) -> Value {
76
+ match value {
77
+ SchemaValue::Null => json!(null),
78
+ SchemaValue::Bool(value) => json!(value),
79
+ SchemaValue::String(value) => json!(value),
80
+ SchemaValue::Number(value) => json!(value.as_i64().expect("normalized metadata integer")),
81
+ SchemaValue::Array(values) => {
82
+ let mut array = sonic_rs::Array::with_capacity(values.len());
83
+ for value in values {
84
+ array.push(native_value(value));
85
+ }
86
+ array.into_value()
87
+ }
88
+ SchemaValue::Object(values) => {
89
+ let mut object = sonic_rs::Object::with_capacity(values.len());
90
+ for (key, value) in values {
91
+ object.insert(key.as_str(), native_value(value));
92
+ }
93
+ object.into_value()
94
+ }
95
+ }
96
+ }
97
+
98
+ /// The owner's unvalidated ingress: object keys sorted and every number an exact
99
+ /// safe integer, as ``native_value`` yields after ``normalize_numbers``.
100
+ pub fn native_input(value: &Value) -> Result<Value, SnapshotError> {
101
+ Ok(match value.get_type() {
102
+ JsonType::Array => {
103
+ let values = value.as_array().expect("array");
104
+ let mut array = sonic_rs::Array::with_capacity(values.len());
105
+ for value in values.iter() {
106
+ array.push(native_input(value)?);
107
+ }
108
+ array.into_value()
109
+ }
110
+ JsonType::Object => {
111
+ let values = value.as_object().expect("object");
112
+ let mut pairs: Vec<_> = values.iter().collect();
113
+ pairs.sort_by(|left, right| left.0.cmp(right.0));
114
+ let mut object = sonic_rs::Object::with_capacity(pairs.len());
115
+ for (key, value) in pairs {
116
+ object.insert(key, native_input(value)?);
117
+ }
118
+ object.into_value()
119
+ }
120
+ JsonType::Number => json!(exact_integer(
121
+ &value
122
+ .as_raw_number()
123
+ .map_or_else(|| value.to_string(), |raw| raw.as_str().to_owned())
124
+ )?),
125
+ _ => value.clone(),
126
+ })
127
+ }
@@ -452,6 +452,10 @@ fn embedded_literals(py: Python<'_>) -> PyResult<Bound<'_, PyDict>> {
452
452
  "protocol.AGENT_INJECTION_PATTERN",
453
453
  protocol::AGENT_INJECTION_PATTERN,
454
454
  )?;
455
+ dict.set_item(
456
+ "protocol.STRUCTURAL_NOISE_PATTERN",
457
+ protocol::STRUCTURAL_NOISE_PATTERN,
458
+ )?;
455
459
  dict.set_item(
456
460
  "protocol.TASK_NOTIFICATION_MARKER",
457
461
  protocol::TASK_NOTIFICATION_MARKER,
@@ -5,6 +5,7 @@ use cc_transcript_core::snapshot::{
5
5
  Cancellation, NativeStore, Projection, SnapshotError, Status, TranscriptSnapshot, WorkLimits,
6
6
  SCHEMA,
7
7
  };
8
+ use cc_transcript_core::snapshot_input::{native_value, normalize_numbers};
8
9
  use cc_transcript_core::toolcall::{with_registry, ToolRegistrySnapshot};
9
10
  use cc_transcript_core::{snapshot_codec, snapshot_projection, snapshot_text};
10
11
  use jsonschema::Validator;
@@ -171,94 +172,6 @@ fn validate(value: &Value, schema: &Validator) -> Result<(), SnapshotError> {
171
172
  .map_err(|_| invalid("input does not match snapshot schema"))
172
173
  }
173
174
 
174
- fn exact_integer(text: &str) -> Result<i64, SnapshotError> {
175
- const MAX_SAFE: u64 = 9_007_199_254_740_991;
176
- let (negative, unsigned) = text
177
- .strip_prefix('-')
178
- .map_or((false, text), |rest| (true, rest));
179
- let (coefficient, exponent) = unsigned.split_once(['e', 'E']).unwrap_or((unsigned, "0"));
180
- let fractional = coefficient
181
- .split_once('.')
182
- .map_or(0, |(_, fraction)| fraction.len());
183
- let digits: String = coefficient.chars().filter(|&digit| digit != '.').collect();
184
- let digits = digits.trim_start_matches('0');
185
- if digits.is_empty() {
186
- return Ok(0);
187
- }
188
- let significant = digits.trim_end_matches('0');
189
- let trailing = digits.len() - significant.len();
190
- let exponent: i64 = exponent
191
- .parse()
192
- .map_err(|_| invalid("integer exponent exceeds safe range"))?;
193
- let scale = exponent
194
- .checked_add(trailing as i64)
195
- .and_then(|value| value.checked_sub(fractional as i64))
196
- .ok_or_else(|| invalid("integer exponent exceeds safe range"))?;
197
- if scale < 0 {
198
- return Err(invalid("fractional metadata number"));
199
- }
200
- if scale > 16 || significant.len().saturating_add(scale as usize) > 16 {
201
- return Err(invalid("metadata integer exceeds safe range"));
202
- }
203
- let mut value: u64 = significant
204
- .parse()
205
- .map_err(|_| invalid("invalid metadata integer"))?;
206
- for _ in 0..scale {
207
- value *= 10;
208
- }
209
- if value > MAX_SAFE {
210
- return Err(invalid("metadata integer exceeds safe range"));
211
- }
212
- Ok(if negative {
213
- -(value as i64)
214
- } else {
215
- value as i64
216
- })
217
- }
218
-
219
- fn normalize_numbers(value: &mut SchemaValue) -> Result<(), SnapshotError> {
220
- match value {
221
- SchemaValue::Array(values) => {
222
- for value in values {
223
- normalize_numbers(value)?;
224
- }
225
- }
226
- SchemaValue::Object(values) => {
227
- for value in values.values_mut() {
228
- normalize_numbers(value)?;
229
- }
230
- }
231
- SchemaValue::Number(number) => {
232
- *number = serde_json::Number::from(exact_integer(&number.to_string())?);
233
- }
234
- _ => {}
235
- }
236
- Ok(())
237
- }
238
-
239
- fn native_value(value: &SchemaValue) -> Value {
240
- match value {
241
- SchemaValue::Null => json!(null),
242
- SchemaValue::Bool(value) => json!(value),
243
- SchemaValue::String(value) => json!(value),
244
- SchemaValue::Number(value) => json!(value.as_i64().expect("normalized metadata integer")),
245
- SchemaValue::Array(values) => {
246
- let mut array = sonic_rs::Array::with_capacity(values.len());
247
- for value in values {
248
- array.push(native_value(value));
249
- }
250
- array.into_value()
251
- }
252
- SchemaValue::Object(values) => {
253
- let mut object = sonic_rs::Object::with_capacity(values.len());
254
- for (key, value) in values {
255
- object.insert(key.as_str(), native_value(value));
256
- }
257
- object.into_value()
258
- }
259
- }
260
- }
261
-
262
175
  fn validated(text: &str, schema: &Validator) -> Result<Value, SnapshotError> {
263
176
  if text.len() > MAX_INPUT_BYTES {
264
177
  return Err(SnapshotError::new(