@ictechgy/context-guard 0.4.1 → 0.4.4
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.
- package/CHANGELOG.md +15 -0
- package/README.ko.md +62 -33
- package/README.md +91 -23
- package/context-guard-kit/README.md +39 -26
- package/context-guard-kit/benchmark_runner.py +273 -8
- package/context-guard-kit/claude_transcript_cost_audit.py +597 -12
- package/context-guard-kit/context_compress.py +153 -1
- package/context-guard-kit/context_filter.py +446 -0
- package/context-guard-kit/context_guard_cli.py +3 -0
- package/context-guard-kit/context_guard_diet.py +677 -2
- package/context-guard-kit/context_pack.py +1694 -2
- package/context-guard-kit/cost_guard.py +1870 -0
- package/context-guard-kit/setup_wizard.py +820 -29
- package/context-guard-kit/trim_command_output.py +396 -45
- package/docs/benchmark-fixtures/learned-compression.tasks.example.json +24 -0
- package/docs/benchmark-fixtures/learned-compression.variants.example.json +10 -0
- package/docs/benchmark-fixtures/visual-ocr.tasks.example.json +24 -0
- package/docs/benchmark-fixtures/visual-ocr.variants.example.json +10 -0
- package/docs/benchmark-workflow-examples.md +40 -0
- package/docs/benchmark-workflows/context-pack-byte-proxy.example.json +169 -0
- package/docs/benchmark-workflows/measured-token-workflow.example.json +170 -0
- package/docs/benchmark-workflows/provider-cache-telemetry.example.json +170 -0
- package/docs/cache-diagnostics-schema.md +96 -0
- package/docs/cache-diagnostics.example.json +116 -0
- package/docs/cache-diagnostics.schema.json +460 -0
- package/docs/distribution.md +4 -2
- package/docs/experimental-benchmark-fixtures.md +36 -0
- package/package.json +11 -2
- package/packaging/homebrew/context-guard.rb.template +3 -2
- package/plugins/context-guard/.claude-plugin/plugin.json +1 -1
- package/plugins/context-guard/README.ko.md +22 -14
- package/plugins/context-guard/README.md +24 -10
- package/plugins/context-guard/bin/context-guard +3 -0
- package/plugins/context-guard/bin/context-guard-audit +597 -12
- package/plugins/context-guard/bin/context-guard-bench +273 -8
- package/plugins/context-guard/bin/context-guard-compress +153 -1
- package/plugins/context-guard/bin/context-guard-cost +1870 -0
- package/plugins/context-guard/bin/context-guard-diet +677 -2
- package/plugins/context-guard/bin/context-guard-filter +446 -0
- package/plugins/context-guard/bin/context-guard-pack +1694 -2
- package/plugins/context-guard/bin/context-guard-setup +820 -29
- package/plugins/context-guard/bin/context-guard-trim-output +396 -45
- package/plugins/context-guard/brief/README.md +10 -3
- package/plugins/context-guard/skills/optimize/SKILL.md +5 -2
- package/plugins/context-guard/skills/setup/SKILL.md +3 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Workflow benchmark examples
|
|
2
|
+
|
|
3
|
+
These examples show how to read `context-guard-bench` reports for common ContextGuard workflows. They are **synthetic report-shape examples**, not benchmark results for every repository.
|
|
4
|
+
|
|
5
|
+
Use them to decide what evidence a workflow has and what it does **not** prove:
|
|
6
|
+
|
|
7
|
+
- matched successful tasks are the comparison basis;
|
|
8
|
+
- provider-measured primary token/cost fields are required for token/cost savings claims;
|
|
9
|
+
- byte reductions and `chars_div_4` token proxies are local proxy evidence;
|
|
10
|
+
- provider cached-token fields are diagnostic telemetry and must stay separate from token-reduction claims;
|
|
11
|
+
- wall time, human corrections, and shifted external costs are quality/cost guardrails, not standalone savings proof.
|
|
12
|
+
|
|
13
|
+
## Example fixtures
|
|
14
|
+
|
|
15
|
+
| Workflow example | What it demonstrates | Claim boundary |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| [`benchmark-workflows/context-pack-byte-proxy.example.json`](benchmark-workflows/context-pack-byte-proxy.example.json) | `context-guard-pack auto` can reduce selected local bytes and inferred token proxies. | No hosted API token-savings claim because primary provider token fields are unavailable. |
|
|
18
|
+
| [`benchmark-workflows/provider-cache-telemetry.example.json`](benchmark-workflows/provider-cache-telemetry.example.json) | Cache-layout diagnostics can coincide with observed provider cached-token telemetry. | Provider-cache telemetry is not proof that ContextGuard reduced prompt tokens or cost. |
|
|
19
|
+
| [`benchmark-workflows/measured-token-workflow.example.json`](benchmark-workflows/measured-token-workflow.example.json) | A matched successful task pair with measured primary tokens may expose `token_savings_pct`. | The percentage is sample report data only, not a general savings promise; real claims require your own matched successful task runs and quality gates. |
|
|
20
|
+
|
|
21
|
+
## How to use the examples
|
|
22
|
+
|
|
23
|
+
1. Run your own benchmark with `context-guard-bench --tasks ... --variants ... --csv ... --report-json ...`.
|
|
24
|
+
2. Compare your report's `claim_status`, `summary_by_variant`, and `comparisons[].quality_gate` to the examples.
|
|
25
|
+
3. Treat `comparisons[].quality_gate != "pass"` as a warning to inspect failures, correction burden, and unmatched tasks before discussing savings.
|
|
26
|
+
4. Keep byte-proxy, provider-cache, wall-time, and shifted-cost evidence in separate language from provider-measured token/cost claims. Provider-cache telemetry is not independent savings proof.
|
|
27
|
+
|
|
28
|
+
## Safe wording
|
|
29
|
+
|
|
30
|
+
Use language like:
|
|
31
|
+
|
|
32
|
+
> In this matched successful task set, primary token telemetry was observed for both variants and the report shows `token_savings_pct` for the optimized variant. Byte reductions and provider-cache fields are diagnostic context, not independent savings proof.
|
|
33
|
+
|
|
34
|
+
Avoid language like:
|
|
35
|
+
|
|
36
|
+
> ContextGuard guarantees this workflow will save tokens or cost.
|
|
37
|
+
|
|
38
|
+
The fixtures intentionally use full `context-guard-bench-report-v1` shapes so tests can catch schema drift and overclaim wording.
|
|
39
|
+
|
|
40
|
+
For task/variant starter fixtures rather than full report-shape examples, see [`experimental-benchmark-fixtures.md`](experimental-benchmark-fixtures.md). Those files are fixture-only and synthetic dry-run-only starters until users replace the placeholder prompts and success checks; they are not shipped OCR, visual-token, or learned-compression runtime features, and real claims still require provider-measured matched successful tasks plus failure-rate, correction, and shifted-cost guardrails.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "context-guard-bench-report-v1",
|
|
3
|
+
"baseline_variant": "baseline",
|
|
4
|
+
"row_count": 2,
|
|
5
|
+
"summary_by_variant": {
|
|
6
|
+
"baseline": {
|
|
7
|
+
"runs": 1,
|
|
8
|
+
"successful_runs": 1,
|
|
9
|
+
"failed_runs": 0,
|
|
10
|
+
"total_tokens_all_runs": 0,
|
|
11
|
+
"primary_tokens_measured_runs": 0,
|
|
12
|
+
"primary_cost_all_runs_usd": 0.0,
|
|
13
|
+
"primary_cost_measured_runs": 0,
|
|
14
|
+
"wall_time_seconds_all_runs": 12.0,
|
|
15
|
+
"wall_time_seconds_measured_runs": 1,
|
|
16
|
+
"provider_cached_tokens_all_runs": 0,
|
|
17
|
+
"provider_cached_tokens_measured_runs": 0,
|
|
18
|
+
"total_cost_with_shift_all_runs_usd": 0.0,
|
|
19
|
+
"total_cost_with_shift_measured_runs": 0,
|
|
20
|
+
"total_tokens_successful": 0,
|
|
21
|
+
"primary_tokens_measured_successful": 0,
|
|
22
|
+
"primary_cost_successful_usd": 0.0,
|
|
23
|
+
"primary_cost_measured_successful": 0,
|
|
24
|
+
"wall_time_seconds_successful": 12.0,
|
|
25
|
+
"wall_time_seconds_measured_successful": 1,
|
|
26
|
+
"provider_cached_tokens_successful": 0,
|
|
27
|
+
"provider_cached_tokens_measured_successful": 0,
|
|
28
|
+
"external_cost_successful_usd": 0.0,
|
|
29
|
+
"external_cost_unknown_successful": 1,
|
|
30
|
+
"total_cost_with_shift_successful_usd": 0.0,
|
|
31
|
+
"total_cost_with_shift_measured_successful": 0,
|
|
32
|
+
"external_tokens_successful": 0,
|
|
33
|
+
"external_tokens_measured_successful": 0,
|
|
34
|
+
"artifacts_used_successful": 0,
|
|
35
|
+
"corrections_successful": 0,
|
|
36
|
+
"bytes_before_successful": 24000,
|
|
37
|
+
"bytes_after_successful": 24000,
|
|
38
|
+
"turns_successful": 0,
|
|
39
|
+
"hook_triggers_successful": 0,
|
|
40
|
+
"failure_rate": 0.0,
|
|
41
|
+
"task_count": 1,
|
|
42
|
+
"successful_task_count": 1,
|
|
43
|
+
"tokens_per_task_including_failures": null,
|
|
44
|
+
"wall_time_seconds_per_task_including_failures": 12.0,
|
|
45
|
+
"provider_cached_tokens_per_task_including_failures": 0.0,
|
|
46
|
+
"primary_cost_per_task_including_failures_usd": null,
|
|
47
|
+
"total_cost_with_shift_per_task_including_failures_usd": null,
|
|
48
|
+
"tokens_per_successful_task": null,
|
|
49
|
+
"wall_time_seconds_per_successful_task": 12.0,
|
|
50
|
+
"provider_cached_tokens_per_successful_task": 0.0,
|
|
51
|
+
"primary_cost_per_successful_task_usd": null,
|
|
52
|
+
"total_cost_with_shift_per_successful_task_usd": null,
|
|
53
|
+
"external_tokens_per_successful_task": null,
|
|
54
|
+
"artifacts_used_per_successful_task": 0.0,
|
|
55
|
+
"corrections_per_successful_task": 0.0,
|
|
56
|
+
"byte_reduction_ratio": 1.0,
|
|
57
|
+
"compression_strategy": "baseline",
|
|
58
|
+
"is_baseline_strategy": true,
|
|
59
|
+
"bytes_saved_successful": 0,
|
|
60
|
+
"bytes_saved_per_successful_task": 0.0,
|
|
61
|
+
"byte_savings_pct": 0.0,
|
|
62
|
+
"token_proxy_saved_successful": 0,
|
|
63
|
+
"token_proxy_saved_per_successful_task": 0.0,
|
|
64
|
+
"observed_telemetry": {
|
|
65
|
+
"tokens": "unavailable",
|
|
66
|
+
"primary_cost": "unavailable",
|
|
67
|
+
"external_tokens": "unavailable",
|
|
68
|
+
"byte_savings": "observed",
|
|
69
|
+
"token_proxy": "inferred",
|
|
70
|
+
"wall_time": "observed",
|
|
71
|
+
"provider_cache": "unavailable"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"context_pack_auto": {
|
|
75
|
+
"runs": 1,
|
|
76
|
+
"successful_runs": 1,
|
|
77
|
+
"failed_runs": 0,
|
|
78
|
+
"total_tokens_all_runs": 0,
|
|
79
|
+
"primary_tokens_measured_runs": 0,
|
|
80
|
+
"primary_cost_all_runs_usd": 0.0,
|
|
81
|
+
"primary_cost_measured_runs": 0,
|
|
82
|
+
"wall_time_seconds_all_runs": 11.0,
|
|
83
|
+
"wall_time_seconds_measured_runs": 1,
|
|
84
|
+
"provider_cached_tokens_all_runs": 0,
|
|
85
|
+
"provider_cached_tokens_measured_runs": 0,
|
|
86
|
+
"total_cost_with_shift_all_runs_usd": 0.0,
|
|
87
|
+
"total_cost_with_shift_measured_runs": 0,
|
|
88
|
+
"total_tokens_successful": 0,
|
|
89
|
+
"primary_tokens_measured_successful": 0,
|
|
90
|
+
"primary_cost_successful_usd": 0.0,
|
|
91
|
+
"primary_cost_measured_successful": 0,
|
|
92
|
+
"wall_time_seconds_successful": 11.0,
|
|
93
|
+
"wall_time_seconds_measured_successful": 1,
|
|
94
|
+
"provider_cached_tokens_successful": 0,
|
|
95
|
+
"provider_cached_tokens_measured_successful": 0,
|
|
96
|
+
"external_cost_successful_usd": 0.0,
|
|
97
|
+
"external_cost_unknown_successful": 1,
|
|
98
|
+
"total_cost_with_shift_successful_usd": 0.0,
|
|
99
|
+
"total_cost_with_shift_measured_successful": 0,
|
|
100
|
+
"external_tokens_successful": 0,
|
|
101
|
+
"external_tokens_measured_successful": 0,
|
|
102
|
+
"artifacts_used_successful": 0,
|
|
103
|
+
"corrections_successful": 0,
|
|
104
|
+
"bytes_before_successful": 24000,
|
|
105
|
+
"bytes_after_successful": 6000,
|
|
106
|
+
"turns_successful": 0,
|
|
107
|
+
"hook_triggers_successful": 0,
|
|
108
|
+
"failure_rate": 0.0,
|
|
109
|
+
"task_count": 1,
|
|
110
|
+
"successful_task_count": 1,
|
|
111
|
+
"tokens_per_task_including_failures": null,
|
|
112
|
+
"wall_time_seconds_per_task_including_failures": 11.0,
|
|
113
|
+
"provider_cached_tokens_per_task_including_failures": 0.0,
|
|
114
|
+
"primary_cost_per_task_including_failures_usd": null,
|
|
115
|
+
"total_cost_with_shift_per_task_including_failures_usd": null,
|
|
116
|
+
"tokens_per_successful_task": null,
|
|
117
|
+
"wall_time_seconds_per_successful_task": 11.0,
|
|
118
|
+
"provider_cached_tokens_per_successful_task": 0.0,
|
|
119
|
+
"primary_cost_per_successful_task_usd": null,
|
|
120
|
+
"total_cost_with_shift_per_successful_task_usd": null,
|
|
121
|
+
"external_tokens_per_successful_task": null,
|
|
122
|
+
"artifacts_used_per_successful_task": 0.0,
|
|
123
|
+
"corrections_per_successful_task": 0.0,
|
|
124
|
+
"byte_reduction_ratio": 0.25,
|
|
125
|
+
"compression_strategy": "context_pack_auto",
|
|
126
|
+
"is_baseline_strategy": false,
|
|
127
|
+
"bytes_saved_successful": 18000,
|
|
128
|
+
"bytes_saved_per_successful_task": 18000.0,
|
|
129
|
+
"byte_savings_pct": 75.0,
|
|
130
|
+
"token_proxy_saved_successful": 4500,
|
|
131
|
+
"token_proxy_saved_per_successful_task": 4500.0,
|
|
132
|
+
"observed_telemetry": {
|
|
133
|
+
"tokens": "unavailable",
|
|
134
|
+
"primary_cost": "unavailable",
|
|
135
|
+
"external_tokens": "unavailable",
|
|
136
|
+
"byte_savings": "observed",
|
|
137
|
+
"token_proxy": "inferred",
|
|
138
|
+
"wall_time": "observed",
|
|
139
|
+
"provider_cache": "unavailable"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"comparisons": [
|
|
144
|
+
{
|
|
145
|
+
"variant": "context_pack_auto",
|
|
146
|
+
"baseline_variant": "baseline",
|
|
147
|
+
"quality_gate": "pass",
|
|
148
|
+
"baseline_failure_rate": 0.0,
|
|
149
|
+
"variant_failure_rate": 0.0,
|
|
150
|
+
"failure_rate_delta_pp": 0.0,
|
|
151
|
+
"matched_successful_task_count": 1,
|
|
152
|
+
"baseline_successful_task_count": 1,
|
|
153
|
+
"missing_baseline_success_tasks": [],
|
|
154
|
+
"baseline_corrections_per_successful_task": 0.0,
|
|
155
|
+
"variant_corrections_per_successful_task": 0.0,
|
|
156
|
+
"paired_corrections_task_count": 1,
|
|
157
|
+
"corrections_delta_per_successful_task": 0.0,
|
|
158
|
+
"token_savings_pct": null,
|
|
159
|
+
"paired_token_task_count": 0,
|
|
160
|
+
"wall_time_delta_seconds_per_successful_task": -1.0,
|
|
161
|
+
"wall_time_change_pct": -8.333333333333332,
|
|
162
|
+
"paired_wall_time_task_count": 1,
|
|
163
|
+
"cost_savings_pct_with_shift": null,
|
|
164
|
+
"paired_cost_task_count": 0
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"claim_status": "insufficient_paired_data",
|
|
168
|
+
"caveat": "Proxy byte reductions are reported separately from matched-task token/cost metrics; shifted cost savings require measured primary cost and measured external cost when external tokens are present. Wall time and provider cached-token fields are diagnostic telemetry, not proof of ContextGuard-caused token or cost savings; provider-cache discounts must stay separate from token-reduction claims."
|
|
169
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "context-guard-bench-report-v1",
|
|
3
|
+
"baseline_variant": "baseline",
|
|
4
|
+
"row_count": 2,
|
|
5
|
+
"summary_by_variant": {
|
|
6
|
+
"baseline": {
|
|
7
|
+
"runs": 1,
|
|
8
|
+
"successful_runs": 1,
|
|
9
|
+
"failed_runs": 0,
|
|
10
|
+
"total_tokens_all_runs": 1000,
|
|
11
|
+
"primary_tokens_measured_runs": 1,
|
|
12
|
+
"primary_cost_all_runs_usd": 0.0,
|
|
13
|
+
"primary_cost_measured_runs": 0,
|
|
14
|
+
"wall_time_seconds_all_runs": 10.0,
|
|
15
|
+
"wall_time_seconds_measured_runs": 1,
|
|
16
|
+
"provider_cached_tokens_all_runs": 0,
|
|
17
|
+
"provider_cached_tokens_measured_runs": 0,
|
|
18
|
+
"total_cost_with_shift_all_runs_usd": 0.0,
|
|
19
|
+
"total_cost_with_shift_measured_runs": 0,
|
|
20
|
+
"total_tokens_successful": 1000,
|
|
21
|
+
"primary_tokens_measured_successful": 1,
|
|
22
|
+
"primary_cost_successful_usd": 0.0,
|
|
23
|
+
"primary_cost_measured_successful": 0,
|
|
24
|
+
"wall_time_seconds_successful": 10.0,
|
|
25
|
+
"wall_time_seconds_measured_successful": 1,
|
|
26
|
+
"provider_cached_tokens_successful": 0,
|
|
27
|
+
"provider_cached_tokens_measured_successful": 0,
|
|
28
|
+
"external_cost_successful_usd": 0.0,
|
|
29
|
+
"external_cost_unknown_successful": 1,
|
|
30
|
+
"total_cost_with_shift_successful_usd": 0.0,
|
|
31
|
+
"total_cost_with_shift_measured_successful": 0,
|
|
32
|
+
"external_tokens_successful": 0,
|
|
33
|
+
"external_tokens_measured_successful": 0,
|
|
34
|
+
"artifacts_used_successful": 0,
|
|
35
|
+
"corrections_successful": 0,
|
|
36
|
+
"bytes_before_successful": 12000,
|
|
37
|
+
"bytes_after_successful": 12000,
|
|
38
|
+
"turns_successful": 0,
|
|
39
|
+
"hook_triggers_successful": 0,
|
|
40
|
+
"failure_rate": 0.0,
|
|
41
|
+
"task_count": 1,
|
|
42
|
+
"successful_task_count": 1,
|
|
43
|
+
"tokens_per_task_including_failures": 1000.0,
|
|
44
|
+
"wall_time_seconds_per_task_including_failures": 10.0,
|
|
45
|
+
"provider_cached_tokens_per_task_including_failures": 0.0,
|
|
46
|
+
"primary_cost_per_task_including_failures_usd": null,
|
|
47
|
+
"total_cost_with_shift_per_task_including_failures_usd": null,
|
|
48
|
+
"tokens_per_successful_task": 1000.0,
|
|
49
|
+
"wall_time_seconds_per_successful_task": 10.0,
|
|
50
|
+
"provider_cached_tokens_per_successful_task": 0.0,
|
|
51
|
+
"primary_cost_per_successful_task_usd": null,
|
|
52
|
+
"total_cost_with_shift_per_successful_task_usd": null,
|
|
53
|
+
"external_tokens_per_successful_task": null,
|
|
54
|
+
"artifacts_used_per_successful_task": 0.0,
|
|
55
|
+
"corrections_per_successful_task": 0.0,
|
|
56
|
+
"byte_reduction_ratio": 1.0,
|
|
57
|
+
"compression_strategy": "baseline",
|
|
58
|
+
"is_baseline_strategy": true,
|
|
59
|
+
"bytes_saved_successful": 0,
|
|
60
|
+
"bytes_saved_per_successful_task": 0.0,
|
|
61
|
+
"byte_savings_pct": 0.0,
|
|
62
|
+
"token_proxy_saved_successful": 0,
|
|
63
|
+
"token_proxy_saved_per_successful_task": 0.0,
|
|
64
|
+
"observed_telemetry": {
|
|
65
|
+
"tokens": "observed",
|
|
66
|
+
"primary_cost": "unavailable",
|
|
67
|
+
"external_tokens": "unavailable",
|
|
68
|
+
"byte_savings": "observed",
|
|
69
|
+
"token_proxy": "inferred",
|
|
70
|
+
"wall_time": "observed",
|
|
71
|
+
"provider_cache": "unavailable"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"brief_mode_standard": {
|
|
75
|
+
"runs": 1,
|
|
76
|
+
"successful_runs": 1,
|
|
77
|
+
"failed_runs": 0,
|
|
78
|
+
"total_tokens_all_runs": 760,
|
|
79
|
+
"primary_tokens_measured_runs": 1,
|
|
80
|
+
"primary_cost_all_runs_usd": 0.0,
|
|
81
|
+
"primary_cost_measured_runs": 0,
|
|
82
|
+
"wall_time_seconds_all_runs": 9.6,
|
|
83
|
+
"wall_time_seconds_measured_runs": 1,
|
|
84
|
+
"provider_cached_tokens_all_runs": 0,
|
|
85
|
+
"provider_cached_tokens_measured_runs": 0,
|
|
86
|
+
"total_cost_with_shift_all_runs_usd": 0.0,
|
|
87
|
+
"total_cost_with_shift_measured_runs": 0,
|
|
88
|
+
"total_tokens_successful": 760,
|
|
89
|
+
"primary_tokens_measured_successful": 1,
|
|
90
|
+
"primary_cost_successful_usd": 0.0,
|
|
91
|
+
"primary_cost_measured_successful": 0,
|
|
92
|
+
"wall_time_seconds_successful": 9.6,
|
|
93
|
+
"wall_time_seconds_measured_successful": 1,
|
|
94
|
+
"provider_cached_tokens_successful": 0,
|
|
95
|
+
"provider_cached_tokens_measured_successful": 0,
|
|
96
|
+
"external_cost_successful_usd": 0.0,
|
|
97
|
+
"external_cost_unknown_successful": 1,
|
|
98
|
+
"total_cost_with_shift_successful_usd": 0.0,
|
|
99
|
+
"total_cost_with_shift_measured_successful": 0,
|
|
100
|
+
"external_tokens_successful": 0,
|
|
101
|
+
"external_tokens_measured_successful": 0,
|
|
102
|
+
"artifacts_used_successful": 0,
|
|
103
|
+
"corrections_successful": 0,
|
|
104
|
+
"bytes_before_successful": 12000,
|
|
105
|
+
"bytes_after_successful": 9000,
|
|
106
|
+
"turns_successful": 0,
|
|
107
|
+
"hook_triggers_successful": 0,
|
|
108
|
+
"failure_rate": 0.0,
|
|
109
|
+
"task_count": 1,
|
|
110
|
+
"successful_task_count": 1,
|
|
111
|
+
"tokens_per_task_including_failures": 760.0,
|
|
112
|
+
"wall_time_seconds_per_task_including_failures": 9.6,
|
|
113
|
+
"provider_cached_tokens_per_task_including_failures": 0.0,
|
|
114
|
+
"primary_cost_per_task_including_failures_usd": null,
|
|
115
|
+
"total_cost_with_shift_per_task_including_failures_usd": null,
|
|
116
|
+
"tokens_per_successful_task": 760.0,
|
|
117
|
+
"wall_time_seconds_per_successful_task": 9.6,
|
|
118
|
+
"provider_cached_tokens_per_successful_task": 0.0,
|
|
119
|
+
"primary_cost_per_successful_task_usd": null,
|
|
120
|
+
"total_cost_with_shift_per_successful_task_usd": null,
|
|
121
|
+
"external_tokens_per_successful_task": null,
|
|
122
|
+
"artifacts_used_per_successful_task": 0.0,
|
|
123
|
+
"corrections_per_successful_task": 0.0,
|
|
124
|
+
"byte_reduction_ratio": 0.75,
|
|
125
|
+
"compression_strategy": "brief_mode_standard",
|
|
126
|
+
"is_baseline_strategy": false,
|
|
127
|
+
"bytes_saved_successful": 3000,
|
|
128
|
+
"bytes_saved_per_successful_task": 3000.0,
|
|
129
|
+
"byte_savings_pct": 25.0,
|
|
130
|
+
"token_proxy_saved_successful": 750,
|
|
131
|
+
"token_proxy_saved_per_successful_task": 750.0,
|
|
132
|
+
"observed_telemetry": {
|
|
133
|
+
"tokens": "observed",
|
|
134
|
+
"primary_cost": "unavailable",
|
|
135
|
+
"external_tokens": "unavailable",
|
|
136
|
+
"byte_savings": "observed",
|
|
137
|
+
"token_proxy": "inferred",
|
|
138
|
+
"wall_time": "observed",
|
|
139
|
+
"provider_cache": "unavailable"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"comparisons": [
|
|
144
|
+
{
|
|
145
|
+
"variant": "brief_mode_standard",
|
|
146
|
+
"baseline_variant": "baseline",
|
|
147
|
+
"quality_gate": "pass",
|
|
148
|
+
"baseline_failure_rate": 0.0,
|
|
149
|
+
"variant_failure_rate": 0.0,
|
|
150
|
+
"failure_rate_delta_pp": 0.0,
|
|
151
|
+
"matched_successful_task_count": 1,
|
|
152
|
+
"baseline_successful_task_count": 1,
|
|
153
|
+
"missing_baseline_success_tasks": [],
|
|
154
|
+
"baseline_corrections_per_successful_task": 0.0,
|
|
155
|
+
"variant_corrections_per_successful_task": 0.0,
|
|
156
|
+
"paired_corrections_task_count": 1,
|
|
157
|
+
"corrections_delta_per_successful_task": 0.0,
|
|
158
|
+
"token_delta_per_successful_task": -240.0,
|
|
159
|
+
"token_savings_pct": 24.0,
|
|
160
|
+
"paired_token_task_count": 1,
|
|
161
|
+
"wall_time_delta_seconds_per_successful_task": -0.40000000000000036,
|
|
162
|
+
"wall_time_change_pct": -4.0000000000000036,
|
|
163
|
+
"paired_wall_time_task_count": 1,
|
|
164
|
+
"cost_savings_pct_with_shift": null,
|
|
165
|
+
"paired_cost_task_count": 0
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"claim_status": "token_savings_observed_cost_unmeasured",
|
|
169
|
+
"caveat": "Proxy byte reductions are reported separately from matched-task token/cost metrics; shifted cost savings require measured primary cost and measured external cost when external tokens are present. Wall time and provider cached-token fields are diagnostic telemetry, not proof of ContextGuard-caused token or cost savings; provider-cache discounts must stay separate from token-reduction claims."
|
|
170
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "context-guard-bench-report-v1",
|
|
3
|
+
"baseline_variant": "baseline",
|
|
4
|
+
"row_count": 2,
|
|
5
|
+
"summary_by_variant": {
|
|
6
|
+
"baseline": {
|
|
7
|
+
"runs": 1,
|
|
8
|
+
"successful_runs": 1,
|
|
9
|
+
"failed_runs": 0,
|
|
10
|
+
"total_tokens_all_runs": 1200,
|
|
11
|
+
"primary_tokens_measured_runs": 1,
|
|
12
|
+
"primary_cost_all_runs_usd": 0.0,
|
|
13
|
+
"primary_cost_measured_runs": 0,
|
|
14
|
+
"wall_time_seconds_all_runs": 10.0,
|
|
15
|
+
"wall_time_seconds_measured_runs": 1,
|
|
16
|
+
"provider_cached_tokens_all_runs": 0,
|
|
17
|
+
"provider_cached_tokens_measured_runs": 1,
|
|
18
|
+
"total_cost_with_shift_all_runs_usd": 0.0,
|
|
19
|
+
"total_cost_with_shift_measured_runs": 0,
|
|
20
|
+
"total_tokens_successful": 1200,
|
|
21
|
+
"primary_tokens_measured_successful": 1,
|
|
22
|
+
"primary_cost_successful_usd": 0.0,
|
|
23
|
+
"primary_cost_measured_successful": 0,
|
|
24
|
+
"wall_time_seconds_successful": 10.0,
|
|
25
|
+
"wall_time_seconds_measured_successful": 1,
|
|
26
|
+
"provider_cached_tokens_successful": 0,
|
|
27
|
+
"provider_cached_tokens_measured_successful": 1,
|
|
28
|
+
"external_cost_successful_usd": 0.0,
|
|
29
|
+
"external_cost_unknown_successful": 1,
|
|
30
|
+
"total_cost_with_shift_successful_usd": 0.0,
|
|
31
|
+
"total_cost_with_shift_measured_successful": 0,
|
|
32
|
+
"external_tokens_successful": 0,
|
|
33
|
+
"external_tokens_measured_successful": 0,
|
|
34
|
+
"artifacts_used_successful": 0,
|
|
35
|
+
"corrections_successful": 0,
|
|
36
|
+
"bytes_before_successful": 0,
|
|
37
|
+
"bytes_after_successful": 0,
|
|
38
|
+
"turns_successful": 0,
|
|
39
|
+
"hook_triggers_successful": 0,
|
|
40
|
+
"failure_rate": 0.0,
|
|
41
|
+
"task_count": 1,
|
|
42
|
+
"successful_task_count": 1,
|
|
43
|
+
"tokens_per_task_including_failures": 1200.0,
|
|
44
|
+
"wall_time_seconds_per_task_including_failures": 10.0,
|
|
45
|
+
"provider_cached_tokens_per_task_including_failures": 0.0,
|
|
46
|
+
"primary_cost_per_task_including_failures_usd": null,
|
|
47
|
+
"total_cost_with_shift_per_task_including_failures_usd": null,
|
|
48
|
+
"tokens_per_successful_task": 1200.0,
|
|
49
|
+
"wall_time_seconds_per_successful_task": 10.0,
|
|
50
|
+
"provider_cached_tokens_per_successful_task": 0.0,
|
|
51
|
+
"primary_cost_per_successful_task_usd": null,
|
|
52
|
+
"total_cost_with_shift_per_successful_task_usd": null,
|
|
53
|
+
"external_tokens_per_successful_task": null,
|
|
54
|
+
"artifacts_used_per_successful_task": 0.0,
|
|
55
|
+
"corrections_per_successful_task": 0.0,
|
|
56
|
+
"byte_reduction_ratio": null,
|
|
57
|
+
"compression_strategy": "baseline",
|
|
58
|
+
"is_baseline_strategy": true,
|
|
59
|
+
"bytes_saved_successful": null,
|
|
60
|
+
"bytes_saved_per_successful_task": null,
|
|
61
|
+
"byte_savings_pct": null,
|
|
62
|
+
"token_proxy_saved_successful": null,
|
|
63
|
+
"token_proxy_saved_per_successful_task": null,
|
|
64
|
+
"observed_telemetry": {
|
|
65
|
+
"tokens": "observed",
|
|
66
|
+
"primary_cost": "unavailable",
|
|
67
|
+
"external_tokens": "unavailable",
|
|
68
|
+
"byte_savings": "unavailable",
|
|
69
|
+
"token_proxy": "unavailable",
|
|
70
|
+
"wall_time": "observed",
|
|
71
|
+
"provider_cache": "observed"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"cache_layout_check": {
|
|
75
|
+
"runs": 1,
|
|
76
|
+
"successful_runs": 1,
|
|
77
|
+
"failed_runs": 0,
|
|
78
|
+
"total_tokens_all_runs": 1200,
|
|
79
|
+
"primary_tokens_measured_runs": 1,
|
|
80
|
+
"primary_cost_all_runs_usd": 0.0,
|
|
81
|
+
"primary_cost_measured_runs": 0,
|
|
82
|
+
"wall_time_seconds_all_runs": 10.0,
|
|
83
|
+
"wall_time_seconds_measured_runs": 1,
|
|
84
|
+
"provider_cached_tokens_all_runs": 900,
|
|
85
|
+
"provider_cached_tokens_measured_runs": 1,
|
|
86
|
+
"total_cost_with_shift_all_runs_usd": 0.0,
|
|
87
|
+
"total_cost_with_shift_measured_runs": 0,
|
|
88
|
+
"total_tokens_successful": 1200,
|
|
89
|
+
"primary_tokens_measured_successful": 1,
|
|
90
|
+
"primary_cost_successful_usd": 0.0,
|
|
91
|
+
"primary_cost_measured_successful": 0,
|
|
92
|
+
"wall_time_seconds_successful": 10.0,
|
|
93
|
+
"wall_time_seconds_measured_successful": 1,
|
|
94
|
+
"provider_cached_tokens_successful": 900,
|
|
95
|
+
"provider_cached_tokens_measured_successful": 1,
|
|
96
|
+
"external_cost_successful_usd": 0.0,
|
|
97
|
+
"external_cost_unknown_successful": 1,
|
|
98
|
+
"total_cost_with_shift_successful_usd": 0.0,
|
|
99
|
+
"total_cost_with_shift_measured_successful": 0,
|
|
100
|
+
"external_tokens_successful": 0,
|
|
101
|
+
"external_tokens_measured_successful": 0,
|
|
102
|
+
"artifacts_used_successful": 0,
|
|
103
|
+
"corrections_successful": 0,
|
|
104
|
+
"bytes_before_successful": 0,
|
|
105
|
+
"bytes_after_successful": 0,
|
|
106
|
+
"turns_successful": 0,
|
|
107
|
+
"hook_triggers_successful": 0,
|
|
108
|
+
"failure_rate": 0.0,
|
|
109
|
+
"task_count": 1,
|
|
110
|
+
"successful_task_count": 1,
|
|
111
|
+
"tokens_per_task_including_failures": 1200.0,
|
|
112
|
+
"wall_time_seconds_per_task_including_failures": 10.0,
|
|
113
|
+
"provider_cached_tokens_per_task_including_failures": 900.0,
|
|
114
|
+
"primary_cost_per_task_including_failures_usd": null,
|
|
115
|
+
"total_cost_with_shift_per_task_including_failures_usd": null,
|
|
116
|
+
"tokens_per_successful_task": 1200.0,
|
|
117
|
+
"wall_time_seconds_per_successful_task": 10.0,
|
|
118
|
+
"provider_cached_tokens_per_successful_task": 900.0,
|
|
119
|
+
"primary_cost_per_successful_task_usd": null,
|
|
120
|
+
"total_cost_with_shift_per_successful_task_usd": null,
|
|
121
|
+
"external_tokens_per_successful_task": null,
|
|
122
|
+
"artifacts_used_per_successful_task": 0.0,
|
|
123
|
+
"corrections_per_successful_task": 0.0,
|
|
124
|
+
"byte_reduction_ratio": null,
|
|
125
|
+
"compression_strategy": "cache_layout_check",
|
|
126
|
+
"is_baseline_strategy": false,
|
|
127
|
+
"bytes_saved_successful": null,
|
|
128
|
+
"bytes_saved_per_successful_task": null,
|
|
129
|
+
"byte_savings_pct": null,
|
|
130
|
+
"token_proxy_saved_successful": null,
|
|
131
|
+
"token_proxy_saved_per_successful_task": null,
|
|
132
|
+
"observed_telemetry": {
|
|
133
|
+
"tokens": "observed",
|
|
134
|
+
"primary_cost": "unavailable",
|
|
135
|
+
"external_tokens": "unavailable",
|
|
136
|
+
"byte_savings": "unavailable",
|
|
137
|
+
"token_proxy": "unavailable",
|
|
138
|
+
"wall_time": "observed",
|
|
139
|
+
"provider_cache": "observed"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"comparisons": [
|
|
144
|
+
{
|
|
145
|
+
"variant": "cache_layout_check",
|
|
146
|
+
"baseline_variant": "baseline",
|
|
147
|
+
"quality_gate": "pass",
|
|
148
|
+
"baseline_failure_rate": 0.0,
|
|
149
|
+
"variant_failure_rate": 0.0,
|
|
150
|
+
"failure_rate_delta_pp": 0.0,
|
|
151
|
+
"matched_successful_task_count": 1,
|
|
152
|
+
"baseline_successful_task_count": 1,
|
|
153
|
+
"missing_baseline_success_tasks": [],
|
|
154
|
+
"baseline_corrections_per_successful_task": 0.0,
|
|
155
|
+
"variant_corrections_per_successful_task": 0.0,
|
|
156
|
+
"paired_corrections_task_count": 1,
|
|
157
|
+
"corrections_delta_per_successful_task": 0.0,
|
|
158
|
+
"token_delta_per_successful_task": 0.0,
|
|
159
|
+
"token_savings_pct": 0.0,
|
|
160
|
+
"paired_token_task_count": 1,
|
|
161
|
+
"wall_time_delta_seconds_per_successful_task": 0.0,
|
|
162
|
+
"wall_time_change_pct": 0.0,
|
|
163
|
+
"paired_wall_time_task_count": 1,
|
|
164
|
+
"cost_savings_pct_with_shift": null,
|
|
165
|
+
"paired_cost_task_count": 0
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"claim_status": "compare_variants",
|
|
169
|
+
"caveat": "Proxy byte reductions are reported separately from matched-task token/cost metrics; shifted cost savings require measured primary cost and measured external cost when external tokens are present. Wall time and provider cached-token fields are diagnostic telemetry, not proof of ContextGuard-caused token or cost savings; provider-cache discounts must stay separate from token-reduction claims."
|
|
170
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# ContextGuard `cache_diagnostics` schema
|
|
2
|
+
|
|
3
|
+
`cache_diagnostics` is the nested diagnostic object emitted by `context-guard-audit --json` and by top-level `cache_diagnostics` in `context-guard-audit --feasibility-json`. The committed schema file, [`cache-diagnostics.schema.json`](cache-diagnostics.schema.json), describes that nested object only; it is not the full CLI response envelope.
|
|
4
|
+
|
|
5
|
+
The object is for GUI and external consumers that need stable cache-read, prefix-layout, TTL-evidence, and headroom-boundary fields without scraping prose. It is a local transcript diagnostic contract, not a billing source, not provider telemetry verification, and not a token or cost savings promise. It does not guarantee savings, does not prove provider cache hits, and does not infer live headroom.
|
|
6
|
+
|
|
7
|
+
`context-guard-audit` also emits a top-level sibling `cache_layout_advice` object. That sibling is intentionally separate from `cache_diagnostics`: diagnostics stay evidence-oriented, while advice ranks checks and experiments such as session splitting, prefix stabilization, and context-diet scans. Advice distinguishes an `observed_issue` from `hypothesized_causes`, `corroborated_causes`, and `next_checks`; without diet or structural evidence, volatile prefix positions should be presented as hypotheses to check, not confirmed root causes.
|
|
8
|
+
|
|
9
|
+
## Files
|
|
10
|
+
|
|
11
|
+
- [`cache-diagnostics.schema.json`](cache-diagnostics.schema.json) — JSON Schema 2020-12-style reference for the nested `cache_diagnostics` object.
|
|
12
|
+
- [`cache-diagnostics.example.json`](cache-diagnostics.example.json) — focused example generated from a synthetic timestamped transcript through `context-guard-audit --json`.
|
|
13
|
+
|
|
14
|
+
## Output surfaces
|
|
15
|
+
|
|
16
|
+
### `context-guard-audit --json`
|
|
17
|
+
|
|
18
|
+
The legacy audit JSON includes top-level `cache_diagnostics` beside `cache_metrics`, `cache_friendliness`, and the separate `cache_layout_advice` advice object.
|
|
19
|
+
|
|
20
|
+
### `context-guard-audit --feasibility-json`
|
|
21
|
+
|
|
22
|
+
The feasibility JSON includes top-level `cache_diagnostics` and `cache_layout_advice`, and lists both in `consumer_contract.stable_top_level_fields`. GUI consumers should prefer the top-level feasibility field when available and use `summary.cache_diagnostics` only for legacy compatibility.
|
|
23
|
+
|
|
24
|
+
## Sibling `cache_layout_advice` fields
|
|
25
|
+
|
|
26
|
+
`cache_layout_advice` is a stable top-level sibling of `cache_diagnostics`, but it is deliberately not part of `cache-diagnostics.schema.json`. It is an advice contract over local transcript heuristics.
|
|
27
|
+
|
|
28
|
+
| Field | Meaning | Consumer note |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `schema_version` | Stable version string, currently `contextguard.cache-layout-advice.v1`. | Treat unknown versions conservatively. |
|
|
31
|
+
| `status` | Advice availability: `available`, `partial`, or `missing`. | `partial` means prompt/cache evidence was capped, skipped, or incomplete. |
|
|
32
|
+
| `confidence` | Overall advice confidence: `hypothesis`, `partial`, or `unavailable`. | Never present as provider truth or billing proof. |
|
|
33
|
+
| `heuristic` | Always `true` for v1. | UI should label advice as heuristic. |
|
|
34
|
+
| `observed_issue` | Primary observed layout issue: `volatile_prefix_breaker`, `long_session_accumulation`, `low_cache_reuse`, `missing_cache_fields`, or `unknown`. | This is an observed/audited symptom, not a confirmed cause. |
|
|
35
|
+
| `priority` | Suggested priority bucket (`P0`, `P1`, or `P2`). | Use for ordering checks, not for savings claims. |
|
|
36
|
+
| `observed_summary` | Sanitized numeric summary such as cache creation/read tokens, prefix shares, breaker position, and dominant transcript share. | Contains aggregate counts/shares only, not raw prompt text. |
|
|
37
|
+
| `hypothesized_causes` | Candidate causes to investigate, each with `id`, `confidence`, `evidence`, `reason`, and `next_check`. | Keep separate from confirmed causes. |
|
|
38
|
+
| `corroborated_causes` | Causes supported by independent evidence beyond prefix-position heuristics. | Empty means no cause has been confirmed. |
|
|
39
|
+
| `next_checks` | Evidence-gathering checks with `id`, `confidence`, `command_templates`, and `evidence_required_for_corroboration`. | Templates use placeholders such as `<repo>` and must not embed observed local paths. |
|
|
40
|
+
| `recommended_experiments` | Ordered experiments with `id`, `order`, `priority`, `effort`, `action`, `expected_signal`, and `verification`. | Run in `order`; compare matched audit windows before claiming improvement. |
|
|
41
|
+
| `caveats` | User-facing boundaries for claims and evidence limits. | Preserve these in GUI summaries and reports. |
|
|
42
|
+
|
|
43
|
+
## Top-level fields
|
|
44
|
+
|
|
45
|
+
| Field | Meaning | Consumer note |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `schema_version` | Stable version string, currently `contextguard.cache-diagnostics.v1`. | Treat unknown versions as compatible only after checking docs. |
|
|
48
|
+
| `status` | Overall diagnostic availability: `available`, `partial`, or `missing`. | `partial` means skipped/capped evidence or partial prompt-layout confidence. |
|
|
49
|
+
| `confidence` | Overall confidence: `hypothesis`, `partial`, or `unavailable` for current v1 output. | Do not present `hypothesis` as observed provider truth. |
|
|
50
|
+
| `evidence` | Overall evidence class: `inferred` or `unavailable`. | Cache fields may be observed inside nested observations. |
|
|
51
|
+
| `heuristic` | Always `true` for v1. | UI should label these as local heuristics. |
|
|
52
|
+
| `observations` | Observed cache field counts and token totals. | Distinguishes missing cache fields from observed zero values. |
|
|
53
|
+
| `derived_ratios` | Inferred ratios such as cache-read share and reuse ratio. | Ratios are formulas over transcript fields. |
|
|
54
|
+
| `stable_prefix_candidates` | Redacted segment positions that appear stable across samples. | Never contains raw prompt text. |
|
|
55
|
+
| `dynamic_prefix_breakers` | Redacted segment positions that appear volatile near the prefix. | Use as prompt-layout guidance only. |
|
|
56
|
+
| `cache_miss_hypotheses` | Ordered local hypotheses for missing or weak cache reads. | Small, conservative list; not root-cause proof. |
|
|
57
|
+
| `ttl_diagnostics` | Timestamped cache telemetry interval evidence and TTL caveats. | Positive timestamped records bound local observations only. |
|
|
58
|
+
| `headroom_diagnostics` | Historical-scan headroom boundary. | Live headroom requires `live_statusline_snapshot`. |
|
|
59
|
+
| `caveats` | User-facing caveats for evidence limits. | Preserve these when presenting summaries. |
|
|
60
|
+
|
|
61
|
+
## Evidence vocabulary
|
|
62
|
+
|
|
63
|
+
- `observed`: a field was present in the local transcript scan.
|
|
64
|
+
- `inferred`: a value was derived from local transcript fields or redacted prompt segment hashes.
|
|
65
|
+
- `hypothesis`: a plausible local interpretation that still needs corroboration.
|
|
66
|
+
- `partial`: some scan evidence was skipped, capped, overlapping, or otherwise incomplete.
|
|
67
|
+
- `unavailable`: the scan does not contain enough evidence to expose the metric.
|
|
68
|
+
|
|
69
|
+
## TTL diagnostics
|
|
70
|
+
|
|
71
|
+
`ttl_diagnostics` documents timestamped cache telemetry fields:
|
|
72
|
+
|
|
73
|
+
- `timestamped_cache_record_count`: transcript records that had timestamps and cache telemetry fields.
|
|
74
|
+
- `positive_timestamped_cache_record_count`: timestamped cache telemetry records with positive cache read or cache creation token counts.
|
|
75
|
+
- `timestamped_cache_record_span_seconds`: span between the first and last positive timestamped cache telemetry records, or `null` when fewer than two positive records exist.
|
|
76
|
+
- `interval_basis`: always `positive_timestamped_cache_records` for v1.
|
|
77
|
+
- `candidate`: one of `within-5m`, `between-5m-and-1h`, `beyond-1h`, or `null`.
|
|
78
|
+
- `status`, `evidence`, and `confidence`: no stronger than `hypothesis` / `inferred` for timestamp-derived intervals.
|
|
79
|
+
|
|
80
|
+
Positive timestamped cache telemetry records are local interval evidence. They do not prove provider TTL state, provider cache hits, invoices, or token/cost savings.
|
|
81
|
+
|
|
82
|
+
## Headroom diagnostics
|
|
83
|
+
|
|
84
|
+
Historical transcript scans do not carry live context-window state. `headroom_diagnostics` therefore keeps headroom `missing`/`unavailable`, sets `historical_total_tokens_are_not_headroom: true`, and names `live_statusline_snapshot` as the required observation.
|
|
85
|
+
|
|
86
|
+
## GUI binding guidance
|
|
87
|
+
|
|
88
|
+
1. Bind to `schema_version` and tolerate future additive fields only after reviewing the schema docs.
|
|
89
|
+
2. Display `status`, `confidence`, `evidence`, and `heuristic` near any cache recommendation.
|
|
90
|
+
3. Separate observed token telemetry under `observations.cache_fields` from inferred ratios and hypotheses.
|
|
91
|
+
4. Preserve TTL/headroom caveats in UI copy.
|
|
92
|
+
5. Hide provider-cache or headroom widgets when evidence is `unavailable` instead of treating missing data as zero.
|
|
93
|
+
|
|
94
|
+
## Claim boundaries
|
|
95
|
+
|
|
96
|
+
`cache_diagnostics` and the sibling `cache_layout_advice` can help users reorganize prompts, find volatile prefix segments, and identify missing evidence or next checks. They do not guarantee savings, do not verify provider cache state, are not billing authority, do not prove provider cache hits, and do not infer live headroom from historical token totals.
|