cc-transcript 14.40.1__tar.gz → 14.41.0__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.
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/PKG-INFO +1 -1
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/request.schema.json +115 -8
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/response.schema.json +45 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/pyproject.toml +1 -1
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot.rs +14 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_prepared_service.rs +229 -5
- cc_transcript-14.41.0/rust/crates/core/src/snapshot_regressions.rs +1324 -0
- cc_transcript-14.40.1/rust/crates/core/src/snapshot_regressions.rs +0 -505
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/Cargo.lock +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/Cargo.toml +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/LICENSE +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/README.md +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/__init__.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/__init__.pyi +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/_native.pyi +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/activity.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/activity_probe.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/builders.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/codex.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/command.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/context.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/corrections.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/cost.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/decision_store.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/decisions.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/discovery.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/disktruth.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/evidence.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/extract/__init__.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/extract/correct.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/facts.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/filterspec.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/heartbeats.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/ids.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/judge/__init__.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/judge/llm.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/judge/similar.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/judge/verdicts.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/ledger.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/literals.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/__init__.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/candidates.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/confidence.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/engine.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/formats.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/sampling.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/signals.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/sourcekind.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/spec.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/mining/store.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/models.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/nlp.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/notifications.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/parser.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/py.typed +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/query.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/render.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/__init__.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/buckets.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/data/afinn-en-165.tsv +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/data/domain_overrides.tsv +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/data/en-ewt.udpipe +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/engine.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/lexicon.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/sentiment/scorespec.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/config.schema.json +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/context.schema.json +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/tool_registry.schema.json +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshots.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/synthetic.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/tools.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/watch.py +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/Cargo.toml +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/blame.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/corpus.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/corrections.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/digest.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/facts.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/grep.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/list.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/mod.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/scratchpad.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/show.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/slice.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/stats.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/commands/watch.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/lib.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/output.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/target.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/cli/src/timearg.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/Cargo.toml +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/benches/parse.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/benches/render.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/benches/toolcall.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/activity.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/actor.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/blame.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/buckets.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/discovery.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/lower.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/mod.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/parse.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/probe.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/protocol.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/codex/types.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/command.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/context.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/corrections.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/cost.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/discovery.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/facts.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/feedback.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/filter.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/gateway.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/ids.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/judge.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/lib.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/literals/command.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/literals/corrections.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/literals/feedback.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/literals/mining.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/literals/mod.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/literals/protocol.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/notifications.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/parse.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/protocol.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/pystr.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/query.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/render.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/rng.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_checkpoint.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_grep.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_grep_stream.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_grep_stream_tests.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_index.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_projection.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_regressions.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/scan_stream.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/schema.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_activity.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_codec.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_codex_append.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_labels.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_ledger.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_ledger_tests.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_memory.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_owned.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_prepared.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_prepared_disk.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_projection.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_root_warm.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_text.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/sqlite.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/toolcall.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/types.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/value.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/watch.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/tests/sonic_arena_model.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/tests/std_allocation_model.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/Cargo.toml +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/build.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/data/command_prefix_pins.tsv +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/actor_bridge.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/bin/stub_gen.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/codex.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/command.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/context.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/corrections.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/discovery.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/feedback.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/judge.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/lexicon.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/lib.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/mining.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/nlp.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/python.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/render.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/score.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/snapshot_decode.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/snapshots.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/sqlite.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/toolcall.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/attachment.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/blocks.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/command.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/convert.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/dunder.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/events.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/meta.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/mod.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/print.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/store.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/system.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/toolcall.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/toolresult.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/views/transcript.rs +0 -0
- {cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/py/src/watch.rs +0 -0
{cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/request.schema.json
RENAMED
|
@@ -1143,6 +1143,40 @@
|
|
|
1143
1143
|
"title": "PreparedErrorPredicate",
|
|
1144
1144
|
"type": "object"
|
|
1145
1145
|
},
|
|
1146
|
+
"PreparedGlobPredicate": {
|
|
1147
|
+
"additionalProperties": false,
|
|
1148
|
+
"properties": {
|
|
1149
|
+
"kind": {
|
|
1150
|
+
"enum": [
|
|
1151
|
+
"has_edit_to",
|
|
1152
|
+
"has_read_glob"
|
|
1153
|
+
],
|
|
1154
|
+
"title": "Kind",
|
|
1155
|
+
"type": "string"
|
|
1156
|
+
},
|
|
1157
|
+
"subagents": {
|
|
1158
|
+
"const": true,
|
|
1159
|
+
"title": "Subagents",
|
|
1160
|
+
"type": "boolean"
|
|
1161
|
+
},
|
|
1162
|
+
"values": {
|
|
1163
|
+
"items": {
|
|
1164
|
+
"maxLength": 1048576,
|
|
1165
|
+
"type": "string"
|
|
1166
|
+
},
|
|
1167
|
+
"maxItems": 256,
|
|
1168
|
+
"title": "Values",
|
|
1169
|
+
"type": "array"
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
"required": [
|
|
1173
|
+
"kind",
|
|
1174
|
+
"values",
|
|
1175
|
+
"subagents"
|
|
1176
|
+
],
|
|
1177
|
+
"title": "PreparedGlobPredicate",
|
|
1178
|
+
"type": "object"
|
|
1179
|
+
},
|
|
1146
1180
|
"PreparedInputs": {
|
|
1147
1181
|
"additionalProperties": false,
|
|
1148
1182
|
"properties": {
|
|
@@ -1170,10 +1204,8 @@
|
|
|
1170
1204
|
"kind": {
|
|
1171
1205
|
"enum": [
|
|
1172
1206
|
"has_command",
|
|
1173
|
-
"has_edit_to",
|
|
1174
1207
|
"has_skill",
|
|
1175
|
-
"has_skill_suffix"
|
|
1176
|
-
"has_read_glob"
|
|
1208
|
+
"has_skill_suffix"
|
|
1177
1209
|
],
|
|
1178
1210
|
"title": "Kind",
|
|
1179
1211
|
"type": "string"
|
|
@@ -1239,14 +1271,40 @@
|
|
|
1239
1271
|
"title": "PreparedOverridePredicate",
|
|
1240
1272
|
"type": "object"
|
|
1241
1273
|
},
|
|
1274
|
+
"PreparedRegexPredicate": {
|
|
1275
|
+
"additionalProperties": false,
|
|
1276
|
+
"properties": {
|
|
1277
|
+
"kind": {
|
|
1278
|
+
"const": "has_command_regex",
|
|
1279
|
+
"title": "Kind",
|
|
1280
|
+
"type": "string"
|
|
1281
|
+
},
|
|
1282
|
+
"pattern": {
|
|
1283
|
+
"maxLength": 1048576,
|
|
1284
|
+
"title": "Pattern",
|
|
1285
|
+
"type": "string"
|
|
1286
|
+
},
|
|
1287
|
+
"subagents": {
|
|
1288
|
+
"const": true,
|
|
1289
|
+
"title": "Subagents",
|
|
1290
|
+
"type": "boolean"
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
"required": [
|
|
1294
|
+
"kind",
|
|
1295
|
+
"pattern",
|
|
1296
|
+
"subagents"
|
|
1297
|
+
],
|
|
1298
|
+
"title": "PreparedRegexPredicate",
|
|
1299
|
+
"type": "object"
|
|
1300
|
+
},
|
|
1242
1301
|
"PreparedToolPredicate": {
|
|
1243
1302
|
"additionalProperties": false,
|
|
1244
1303
|
"properties": {
|
|
1245
1304
|
"kind": {
|
|
1246
1305
|
"enum": [
|
|
1247
1306
|
"has_tool",
|
|
1248
|
-
"has_read"
|
|
1249
|
-
"has_command_regex"
|
|
1307
|
+
"has_read"
|
|
1250
1308
|
],
|
|
1251
1309
|
"title": "Kind",
|
|
1252
1310
|
"type": "string"
|
|
@@ -1404,6 +1462,49 @@
|
|
|
1404
1462
|
"limits": {
|
|
1405
1463
|
"$ref": "#/$defs/Limits"
|
|
1406
1464
|
},
|
|
1465
|
+
"observers": {
|
|
1466
|
+
"anyOf": [
|
|
1467
|
+
{
|
|
1468
|
+
"items": {
|
|
1469
|
+
"discriminator": {
|
|
1470
|
+
"mapping": {
|
|
1471
|
+
"has_command": "#/$defs/PreparedListPredicate",
|
|
1472
|
+
"has_edit": "#/$defs/PreparedErrorPredicate",
|
|
1473
|
+
"has_error": "#/$defs/PreparedErrorPredicate",
|
|
1474
|
+
"has_override": "#/$defs/PreparedOverridePredicate",
|
|
1475
|
+
"has_read": "#/$defs/PreparedToolPredicate",
|
|
1476
|
+
"has_skill": "#/$defs/PreparedListPredicate",
|
|
1477
|
+
"has_skill_suffix": "#/$defs/PreparedListPredicate",
|
|
1478
|
+
"has_tool": "#/$defs/PreparedToolPredicate"
|
|
1479
|
+
},
|
|
1480
|
+
"propertyName": "kind"
|
|
1481
|
+
},
|
|
1482
|
+
"oneOf": [
|
|
1483
|
+
{
|
|
1484
|
+
"$ref": "#/$defs/PreparedToolPredicate"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
"$ref": "#/$defs/PreparedListPredicate"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"$ref": "#/$defs/PreparedOverridePredicate"
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
"$ref": "#/$defs/PreparedErrorPredicate"
|
|
1494
|
+
}
|
|
1495
|
+
]
|
|
1496
|
+
},
|
|
1497
|
+
"maxItems": 32,
|
|
1498
|
+
"minItems": 1,
|
|
1499
|
+
"type": "array"
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
"type": "null"
|
|
1503
|
+
}
|
|
1504
|
+
],
|
|
1505
|
+
"default": null,
|
|
1506
|
+
"title": "Observers"
|
|
1507
|
+
},
|
|
1407
1508
|
"operation": {
|
|
1408
1509
|
"const": "query_graph",
|
|
1409
1510
|
"title": "Operation",
|
|
@@ -1414,13 +1515,13 @@
|
|
|
1414
1515
|
"mapping": {
|
|
1415
1516
|
"deep_predicate_inputs": "#/$defs/PreparedInputs",
|
|
1416
1517
|
"has_command": "#/$defs/PreparedListPredicate",
|
|
1417
|
-
"has_command_regex": "#/$defs/
|
|
1518
|
+
"has_command_regex": "#/$defs/PreparedRegexPredicate",
|
|
1418
1519
|
"has_edit": "#/$defs/PreparedErrorPredicate",
|
|
1419
|
-
"has_edit_to": "#/$defs/
|
|
1520
|
+
"has_edit_to": "#/$defs/PreparedGlobPredicate",
|
|
1420
1521
|
"has_error": "#/$defs/PreparedErrorPredicate",
|
|
1421
1522
|
"has_override": "#/$defs/PreparedOverridePredicate",
|
|
1422
1523
|
"has_read": "#/$defs/PreparedToolPredicate",
|
|
1423
|
-
"has_read_glob": "#/$defs/
|
|
1524
|
+
"has_read_glob": "#/$defs/PreparedGlobPredicate",
|
|
1424
1525
|
"has_skill": "#/$defs/PreparedListPredicate",
|
|
1425
1526
|
"has_skill_suffix": "#/$defs/PreparedListPredicate",
|
|
1426
1527
|
"has_tool": "#/$defs/PreparedToolPredicate"
|
|
@@ -1434,9 +1535,15 @@
|
|
|
1434
1535
|
{
|
|
1435
1536
|
"$ref": "#/$defs/PreparedToolPredicate"
|
|
1436
1537
|
},
|
|
1538
|
+
{
|
|
1539
|
+
"$ref": "#/$defs/PreparedRegexPredicate"
|
|
1540
|
+
},
|
|
1437
1541
|
{
|
|
1438
1542
|
"$ref": "#/$defs/PreparedListPredicate"
|
|
1439
1543
|
},
|
|
1544
|
+
{
|
|
1545
|
+
"$ref": "#/$defs/PreparedGlobPredicate"
|
|
1546
|
+
},
|
|
1440
1547
|
{
|
|
1441
1548
|
"$ref": "#/$defs/PreparedOverridePredicate"
|
|
1442
1549
|
},
|
{cc_transcript-14.40.1 → cc_transcript-14.41.0}/cc_transcript/snapshot_schema/response.schema.json
RENAMED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"hydrated": "#/$defs/Hydrated",
|
|
90
90
|
"loading": "#/$defs/Loading",
|
|
91
91
|
"located": "#/$defs/Located",
|
|
92
|
+
"observed_scalar": "#/$defs/ObservedScalarResult",
|
|
92
93
|
"prepared_graph": "#/$defs/PreparedGraphResult",
|
|
93
94
|
"records": "#/$defs/RecordsResult",
|
|
94
95
|
"released": "#/$defs/Released",
|
|
@@ -143,6 +144,9 @@
|
|
|
143
144
|
{
|
|
144
145
|
"$ref": "#/$defs/ScalarResult"
|
|
145
146
|
},
|
|
147
|
+
{
|
|
148
|
+
"$ref": "#/$defs/ObservedScalarResult"
|
|
149
|
+
},
|
|
146
150
|
{
|
|
147
151
|
"$ref": "#/$defs/StringsResult"
|
|
148
152
|
},
|
|
@@ -732,6 +736,7 @@
|
|
|
732
736
|
"hydrated": "#/$defs/Hydrated",
|
|
733
737
|
"loading": "#/$defs/Loading",
|
|
734
738
|
"located": "#/$defs/Located",
|
|
739
|
+
"observed_scalar": "#/$defs/ObservedScalarResult",
|
|
735
740
|
"prepared_graph": "#/$defs/PreparedGraphResult",
|
|
736
741
|
"records": "#/$defs/RecordsResult",
|
|
737
742
|
"released": "#/$defs/Released",
|
|
@@ -786,6 +791,9 @@
|
|
|
786
791
|
{
|
|
787
792
|
"$ref": "#/$defs/ScalarResult"
|
|
788
793
|
},
|
|
794
|
+
{
|
|
795
|
+
"$ref": "#/$defs/ObservedScalarResult"
|
|
796
|
+
},
|
|
789
797
|
{
|
|
790
798
|
"$ref": "#/$defs/StringsResult"
|
|
791
799
|
},
|
|
@@ -945,6 +953,43 @@
|
|
|
945
953
|
"title": "Location",
|
|
946
954
|
"type": "object"
|
|
947
955
|
},
|
|
956
|
+
"ObservedScalarResult": {
|
|
957
|
+
"additionalProperties": false,
|
|
958
|
+
"properties": {
|
|
959
|
+
"kind": {
|
|
960
|
+
"const": "observed_scalar",
|
|
961
|
+
"title": "Kind",
|
|
962
|
+
"type": "string"
|
|
963
|
+
},
|
|
964
|
+
"observers": {
|
|
965
|
+
"items": {
|
|
966
|
+
"anyOf": [
|
|
967
|
+
{
|
|
968
|
+
"type": "boolean"
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
"type": "null"
|
|
972
|
+
}
|
|
973
|
+
]
|
|
974
|
+
},
|
|
975
|
+
"maxItems": 32,
|
|
976
|
+
"minItems": 1,
|
|
977
|
+
"title": "Observers",
|
|
978
|
+
"type": "array"
|
|
979
|
+
},
|
|
980
|
+
"value": {
|
|
981
|
+
"title": "Value",
|
|
982
|
+
"type": "boolean"
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
"required": [
|
|
986
|
+
"kind",
|
|
987
|
+
"value",
|
|
988
|
+
"observers"
|
|
989
|
+
],
|
|
990
|
+
"title": "ObservedScalarResult",
|
|
991
|
+
"type": "object"
|
|
992
|
+
},
|
|
948
993
|
"PreparedGraphResult": {
|
|
949
994
|
"additionalProperties": false,
|
|
950
995
|
"properties": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cc-transcript"
|
|
3
|
-
version = "14.
|
|
3
|
+
version = "14.41.0" # 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"
|
|
@@ -1018,6 +1018,7 @@ struct PreparedQueryCursor {
|
|
|
1018
1018
|
query: Value,
|
|
1019
1019
|
pending: Option<PendingPreparedSource>,
|
|
1020
1020
|
input_records: Option<VecDeque<String>>,
|
|
1021
|
+
observers: Observers,
|
|
1021
1022
|
next: usize,
|
|
1022
1023
|
page_output_bytes: usize,
|
|
1023
1024
|
remaining: WorkLimits,
|
|
@@ -1684,6 +1685,7 @@ impl Charge<String> for PreparedQueryCursor {
|
|
|
1684
1685
|
records.capacity() * size_of::<String>()
|
|
1685
1686
|
+ records.iter().map(String::capacity).sum::<usize>()
|
|
1686
1687
|
})
|
|
1688
|
+
+ self.observers.charge()
|
|
1687
1689
|
}
|
|
1688
1690
|
}
|
|
1689
1691
|
|
|
@@ -5062,6 +5064,13 @@ impl NativeStore {
|
|
|
5062
5064
|
query,
|
|
5063
5065
|
pending,
|
|
5064
5066
|
input_records,
|
|
5067
|
+
observers:
|
|
5068
|
+
Observers {
|
|
5069
|
+
declared: _,
|
|
5070
|
+
allowance: _,
|
|
5071
|
+
witnessed: _,
|
|
5072
|
+
pending: observing,
|
|
5073
|
+
},
|
|
5065
5074
|
next: _,
|
|
5066
5075
|
page_output_bytes: _,
|
|
5067
5076
|
remaining: _,
|
|
@@ -5084,6 +5093,11 @@ impl NativeStore {
|
|
|
5084
5093
|
records.capacity() * size_of::<String>()
|
|
5085
5094
|
+ records.iter().map(String::capacity).sum::<usize>()
|
|
5086
5095
|
})
|
|
5096
|
+
+ observing.capacity() * size_of::<(usize, Value)>()
|
|
5097
|
+
+ observing
|
|
5098
|
+
.iter()
|
|
5099
|
+
.map(|(_, query)| value_bytes(query))
|
|
5100
|
+
.sum::<usize>()
|
|
5087
5101
|
}
|
|
5088
5102
|
|
|
5089
5103
|
#[cfg(test)]
|
{cc_transcript-14.40.1 → cc_transcript-14.41.0}/rust/crates/core/src/snapshot_prepared_service.rs
RENAMED
|
@@ -2154,10 +2154,17 @@ impl NativeStore {
|
|
|
2154
2154
|
let predicted = deque_capacity_for(queue, records.len());
|
|
2155
2155
|
queue.extend(records);
|
|
2156
2156
|
assert_eq!(queue.capacity(), predicted);
|
|
2157
|
-
} else
|
|
2158
|
-
let
|
|
2159
|
-
|
|
2160
|
-
|
|
2157
|
+
} else {
|
|
2158
|
+
let found = facts.query(&cursor.query)?["value"].as_bool() == Some(true);
|
|
2159
|
+
cursor.observers.observe(facts);
|
|
2160
|
+
if found {
|
|
2161
|
+
return Ok(QueryPage::Complete(cursor.observers.reply(
|
|
2162
|
+
true,
|
|
2163
|
+
false,
|
|
2164
|
+
output_limit,
|
|
2165
|
+
self.config.output,
|
|
2166
|
+
)?));
|
|
2167
|
+
}
|
|
2161
2168
|
}
|
|
2162
2169
|
cursor.next += 1;
|
|
2163
2170
|
steps += 1;
|
|
@@ -2186,7 +2193,7 @@ impl NativeStore {
|
|
|
2186
2193
|
let data = if inputs {
|
|
2187
2194
|
json!({"kind":"records","record_schema":"cc-transcript.predicate-inputs/1","records_json":records})
|
|
2188
2195
|
} else {
|
|
2189
|
-
|
|
2196
|
+
cursor.observers.reply(false, true, output_limit, self.config.output)?
|
|
2190
2197
|
};
|
|
2191
2198
|
encoded_size(&data, output_limit)?;
|
|
2192
2199
|
return Ok(QueryPage::Complete(data));
|
|
@@ -2408,12 +2415,24 @@ impl NativeStore {
|
|
|
2408
2415
|
} else {
|
|
2409
2416
|
None
|
|
2410
2417
|
};
|
|
2418
|
+
let observers = if kind == "deep_predicate_inputs" {
|
|
2419
|
+
Observers::default()
|
|
2420
|
+
} else {
|
|
2421
|
+
self.admit_observers(
|
|
2422
|
+
request,
|
|
2423
|
+
&root_facts,
|
|
2424
|
+
bounds.deadline_unix_ms,
|
|
2425
|
+
context,
|
|
2426
|
+
&mut reservation,
|
|
2427
|
+
)
|
|
2428
|
+
};
|
|
2411
2429
|
let cursor = PreparedQueryCursor {
|
|
2412
2430
|
claimant: claimant.to_owned(),
|
|
2413
2431
|
graph_id: token.to_owned(),
|
|
2414
2432
|
query: query.clone(),
|
|
2415
2433
|
pending: None,
|
|
2416
2434
|
input_records,
|
|
2435
|
+
observers,
|
|
2417
2436
|
next: 0,
|
|
2418
2437
|
page_output_bytes: bounds.max_output_bytes.min(MAX_DATA_BYTES),
|
|
2419
2438
|
remaining: bounds,
|
|
@@ -2429,6 +2448,84 @@ impl NativeStore {
|
|
|
2429
2448
|
)
|
|
2430
2449
|
}
|
|
2431
2450
|
|
|
2451
|
+
fn admit_observers(
|
|
2452
|
+
&self,
|
|
2453
|
+
request: &Value,
|
|
2454
|
+
root_facts: &crate::snapshot_prepared::PreparedFacts,
|
|
2455
|
+
deadline_unix_ms: u64,
|
|
2456
|
+
context: &Value,
|
|
2457
|
+
reservation: &mut ProjectionReservation<'_>,
|
|
2458
|
+
) -> Observers {
|
|
2459
|
+
let Some(queries) = request
|
|
2460
|
+
.get("observers")
|
|
2461
|
+
.and_then(Value::as_array)
|
|
2462
|
+
.filter(|queries| (1..=OBSERVER_LIMIT).contains(&queries.len()))
|
|
2463
|
+
else {
|
|
2464
|
+
return Observers::default();
|
|
2465
|
+
};
|
|
2466
|
+
let started = std::time::Instant::now();
|
|
2467
|
+
let mut observers = Observers {
|
|
2468
|
+
declared: queries.len(),
|
|
2469
|
+
allowance: std::time::Duration::from_millis(
|
|
2470
|
+
deadline_unix_ms.saturating_sub(now_ms()) / 4,
|
|
2471
|
+
),
|
|
2472
|
+
witnessed: 0,
|
|
2473
|
+
pending: Vec::new(),
|
|
2474
|
+
};
|
|
2475
|
+
let mut pending = 0u64;
|
|
2476
|
+
for (index, query) in queries.iter().enumerate() {
|
|
2477
|
+
if !Observers::observable(query) {
|
|
2478
|
+
continue;
|
|
2479
|
+
}
|
|
2480
|
+
match Observers::timely(root_facts, query, started, observers.allowance) {
|
|
2481
|
+
Some(Some(true)) => observers.witnessed |= 1 << index,
|
|
2482
|
+
Some(Some(false)) => pending |= 1 << index,
|
|
2483
|
+
Some(None) => {}
|
|
2484
|
+
None => break,
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
observers.allowance = observers.allowance.saturating_sub(started.elapsed());
|
|
2488
|
+
if observers.allowance.is_zero() {
|
|
2489
|
+
pending = 0;
|
|
2490
|
+
}
|
|
2491
|
+
let selected = || {
|
|
2492
|
+
queries
|
|
2493
|
+
.iter()
|
|
2494
|
+
.enumerate()
|
|
2495
|
+
.filter(move |(index, _)| pending & (1 << *index) != 0)
|
|
2496
|
+
};
|
|
2497
|
+
let count = pending.count_ones() as usize;
|
|
2498
|
+
let bytes = count * size_of::<(usize, Value)>()
|
|
2499
|
+
+ selected().map(|(_, query)| value_bytes(query)).sum::<usize>();
|
|
2500
|
+
if count > 0 && self.reserve_observers(reservation, context, bytes) {
|
|
2501
|
+
observers.pending = Vec::with_capacity(count);
|
|
2502
|
+
observers
|
|
2503
|
+
.pending
|
|
2504
|
+
.extend(selected().map(|(index, query)| (index, query.clone())));
|
|
2505
|
+
}
|
|
2506
|
+
observers
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
fn reserve_observers(
|
|
2510
|
+
&self,
|
|
2511
|
+
reservation: &mut ProjectionReservation<'_>,
|
|
2512
|
+
context: &Value,
|
|
2513
|
+
bytes: usize,
|
|
2514
|
+
) -> bool {
|
|
2515
|
+
let mut state = self.lock_state();
|
|
2516
|
+
let fits = self.memory_cap(context).is_ok_and(|cap| {
|
|
2517
|
+
number(&Self::gauges(&mut state), "retained_total_accounted_bytes")
|
|
2518
|
+
.is_ok_and(|retained| retained.saturating_add(bytes) <= cap)
|
|
2519
|
+
});
|
|
2520
|
+
if fits {
|
|
2521
|
+
state.ledger.shared.work().admitted(bytes);
|
|
2522
|
+
state.transient_bytes += bytes;
|
|
2523
|
+
reservation.bytes += bytes;
|
|
2524
|
+
state.ledger.shared.work().reserved(bytes);
|
|
2525
|
+
}
|
|
2526
|
+
fits
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2432
2529
|
fn publish_root_slice(
|
|
2433
2530
|
&self,
|
|
2434
2531
|
token: &str,
|
|
@@ -2468,3 +2565,130 @@ impl NativeStore {
|
|
|
2468
2565
|
Ok(facts)
|
|
2469
2566
|
}
|
|
2470
2567
|
}
|
|
2568
|
+
|
|
2569
|
+
const OBSERVER_LIMIT: usize = 32;
|
|
2570
|
+
|
|
2571
|
+
#[cfg(test)]
|
|
2572
|
+
thread_local! {
|
|
2573
|
+
static OBSERVATIONS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
#[derive(Default)]
|
|
2577
|
+
struct Observers {
|
|
2578
|
+
declared: usize,
|
|
2579
|
+
allowance: std::time::Duration,
|
|
2580
|
+
witnessed: u64,
|
|
2581
|
+
pending: Vec<(usize, Value)>,
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
impl Observers {
|
|
2585
|
+
fn observable(query: &Value) -> bool {
|
|
2586
|
+
matches!(
|
|
2587
|
+
query.get("kind").and_then(Value::as_str),
|
|
2588
|
+
Some(
|
|
2589
|
+
"has_tool"
|
|
2590
|
+
| "has_read"
|
|
2591
|
+
| "has_command"
|
|
2592
|
+
| "has_skill"
|
|
2593
|
+
| "has_skill_suffix"
|
|
2594
|
+
| "has_override"
|
|
2595
|
+
| "has_error"
|
|
2596
|
+
| "has_edit"
|
|
2597
|
+
)
|
|
2598
|
+
)
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
fn observed(facts: &crate::snapshot_prepared::PreparedFacts, query: &Value) -> Option<bool> {
|
|
2602
|
+
#[cfg(test)]
|
|
2603
|
+
OBSERVATIONS.with(|count| count.set(count.get() + 1));
|
|
2604
|
+
facts
|
|
2605
|
+
.query(query)
|
|
2606
|
+
.ok()
|
|
2607
|
+
.map(|answer| answer["value"].as_bool() == Some(true))
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
fn timely(
|
|
2611
|
+
facts: &crate::snapshot_prepared::PreparedFacts,
|
|
2612
|
+
query: &Value,
|
|
2613
|
+
started: std::time::Instant,
|
|
2614
|
+
allowance: std::time::Duration,
|
|
2615
|
+
) -> Option<Option<bool>> {
|
|
2616
|
+
(started.elapsed() < allowance)
|
|
2617
|
+
.then(|| Self::observed(facts, query))
|
|
2618
|
+
.filter(|_| started.elapsed() < allowance)
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
fn charge(&self) -> usize {
|
|
2622
|
+
self.pending.capacity() * size_of::<(usize, Value)>()
|
|
2623
|
+
+ self
|
|
2624
|
+
.pending
|
|
2625
|
+
.iter()
|
|
2626
|
+
.map(|(_, query)| value_bytes(query))
|
|
2627
|
+
.sum::<usize>()
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
fn observe(&mut self, facts: &crate::snapshot_prepared::PreparedFacts) {
|
|
2631
|
+
let Self {
|
|
2632
|
+
allowance,
|
|
2633
|
+
witnessed,
|
|
2634
|
+
pending,
|
|
2635
|
+
..
|
|
2636
|
+
} = self;
|
|
2637
|
+
if pending.is_empty() {
|
|
2638
|
+
return;
|
|
2639
|
+
}
|
|
2640
|
+
let started = std::time::Instant::now();
|
|
2641
|
+
let mut expired = false;
|
|
2642
|
+
pending.retain(|(index, query)| {
|
|
2643
|
+
let outcome = (!expired)
|
|
2644
|
+
.then(|| Self::timely(facts, query, started, *allowance))
|
|
2645
|
+
.flatten();
|
|
2646
|
+
expired = outcome.is_none();
|
|
2647
|
+
match outcome {
|
|
2648
|
+
Some(Some(true)) => {
|
|
2649
|
+
*witnessed |= 1 << *index;
|
|
2650
|
+
false
|
|
2651
|
+
}
|
|
2652
|
+
Some(Some(false)) => true,
|
|
2653
|
+
Some(None) | None => false,
|
|
2654
|
+
}
|
|
2655
|
+
});
|
|
2656
|
+
*allowance = allowance.saturating_sub(started.elapsed());
|
|
2657
|
+
if allowance.is_zero() {
|
|
2658
|
+
pending.clear();
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
fn reply(
|
|
2663
|
+
&self,
|
|
2664
|
+
value: bool,
|
|
2665
|
+
exhausted: bool,
|
|
2666
|
+
output_limit: usize,
|
|
2667
|
+
projection_limit: usize,
|
|
2668
|
+
) -> Result<Value, SnapshotError> {
|
|
2669
|
+
let plain = json!({"kind":"scalar","value":value});
|
|
2670
|
+
encoded_size(&plain, output_limit)?;
|
|
2671
|
+
if self.declared == 0 {
|
|
2672
|
+
return Ok(plain);
|
|
2673
|
+
}
|
|
2674
|
+
let outcomes: Vec<Option<bool>> = (0..self.declared)
|
|
2675
|
+
.map(|index| {
|
|
2676
|
+
if self.witnessed & (1 << index) != 0 {
|
|
2677
|
+
Some(true)
|
|
2678
|
+
} else if exhausted && self.pending.iter().any(|(pending, _)| *pending == index) {
|
|
2679
|
+
Some(false)
|
|
2680
|
+
} else {
|
|
2681
|
+
None
|
|
2682
|
+
}
|
|
2683
|
+
})
|
|
2684
|
+
.collect();
|
|
2685
|
+
let observed = json!({"kind":"observed_scalar","value":value,"observers":outcomes});
|
|
2686
|
+
Ok(
|
|
2687
|
+
if encoded_size(&observed, output_limit.min(projection_limit)).is_ok() {
|
|
2688
|
+
observed
|
|
2689
|
+
} else {
|
|
2690
|
+
plain
|
|
2691
|
+
},
|
|
2692
|
+
)
|
|
2693
|
+
}
|
|
2694
|
+
}
|