Skip to content

docs: document which components depend on stored data, at three storage levels - #569

Merged
amiddavid merged 9 commits into
mainfrom
feat/data-dependence
Oct 20, 2026
Merged

amiddavid merged 9 commits into
mainfrom
feat/data-dependence

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

This PR adds a page that says, for each component and feature, whether it needs stored customer data. It shows what each one does at three storage levels: off, metadata only and everything. It also adds a rule and a test so the page stays right.

This PR changes no behaviour. It records what the code does today.

Closes #428.

What we found

  • 13 of 24 components need no stored content. 6 keep nothing, 1 keeps only hashes, 1 keeps a speed-up cache, and 5 keep only the original for the expand tool.
  • 5 more could work on metadata only, with one "already done" flag per message.
  • 4 cannot work without content: extract_llm, summarize, cache_aware_summarizer, agentdiet. A model writes their text, and the words differ each time.
  • The proxy keeps content after the user opts out, in 7 places. The worst:
    • 2 full request bodies per thread, with no switch to turn it off;
    • the last body and the user's credential for keep-alive, with storage off.
  • declaration_text is never deleted, not even by an account purge.
  • A new hosted account starts with content capture on. The code comment says "Off by default".
  • With storage off today:
    • 8 components shorten a message once, then send it in full the next turn. That breaks the prompt cache, so storage off can cost more than no compaction.
    • coref has no spending limit.
  • "Metadata only" does not exist yet. If it is added as-is, summarize pays for a summary every turn and throws it away.

Why the proxy stores rewrites at all

The client sends its whole transcript every turn, and only adds the response to it. It never sees the rewritten request. So the proxy must make the same rewrite every turn.

  • A rewrite that depends only on the message needs no storage.
  • Storage is needed only for model-written text, and for rewrites that act only on the part of the conversation that is not cached yet.

What changed

  • docs/data-dependence.md: the page, with one row per component and per feature, all opt-out switches, the findings and open questions. Added to the site nav under Concepts.
  • CLAUDE.md: a "Metadata first" rule under "Hard boundaries".
  • .github/pull_request_template.md: a required "Data dependence" section, with the three levels.
  • components/all/datadep_test.go: fails when a registered component has no row, a row names no component, a cell is empty, or a reason is short or only a code reference.

How it was tested

On the eval box:

  • The new test passes in the default build and with -tags cg_skeleton.
  • 3 mutations each made the test fail: delete a row, rename a row to an unknown component, replace a reason with see linecap.go:134.
  • go test -race ./components/all/ ./config/ passes.

Open questions

  1. Does "off" allow in-memory metadata, such as the tracker of how much the provider cached?
  2. Are tool, MCP-server and skill names metadata?
  3. Are short unsalted content hashes metadata?
  4. Is a session id sent by the client metadata? It can hold a user id.
  5. Is the "Decided by" column right? I filled it from the PR or commit that added each component, and nobody has confirmed it.
  6. Should each finding get its own issue?

Technical notes

  • The audit read the code at commit 2a7a86f.
  • skeleton registers only with the cg_skeleton build tag. The test allows its row in a default build.

Comment thread docs/data-dependence.md Outdated
each time. These are `extract_llm`, `summarize`, `cache_aware_summarizer` and `agentdiet`.
- **2 are special cases.** `skeleton` refuses to run without storage. `extract_llm_sweep` could
repeat its removals from a flag, but its cheap question to the model needs last turn's text.
- **The proxy keeps content after the user opts out**, in 7 places. The worst are 2 full request

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The credentials are not needed after the Dispatcher change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a178909. Thank you.

The page now says Context Guru keeps only a handle, and the host's Dispatcher holds the credential, masked, until the hold ends. In the proxy binary, that is proxy.Dispatcher.

So the core no longer keeps the credential, but the proxy binary still does while a ping is armed. That part still needs storage to be on, so #595 stays open for it. I will correct its wording.

Comment thread docs/data-dependence.md Outdated
| **Metadata only** | Hashes, counts, ids, token numbers, timestamps and flags, in the Store and in memory. No content. | **No.** The "Metadata only" columns say what the code would do with a Store that refuses content. [What "metadata only" would need](#what-metadata-only-would-need) lists the changes. |
| **Everything** | Content and metadata. | Yes. This is the default. |

## Why the proxy stores rewrites at all

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cg can be used as a library (cortex). Everywhere we use "proxy", we should say "contextguru".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a178909.

The page now says "Context Guru" wherever it means the product. It says "the proxy binary" only where it means that binary. I also added a "Host" term: the program that runs Context Guru, either the proxy binary or another program that uses it as a library.

Add docs/data-dependence.md. It lists, for every registered component
and for each feature outside the pipeline, whether it keeps content or
only metadata, where, whether it needs it, what it does with storage
off, a plain-words reason, and who decided it. It also lists every
opt-out switch and what each one does not turn off.

The audit found content kept after the user opts out (the prefix-ask
body stash, keep-alive, declaration_text, in-memory copies), and
components that pay for model calls or lose their spending limit with
storage off. The page records these; it changes no behaviour.

Add a "Metadata first" rule to CLAUDE.md, a PR template with a required
"Data dependence" section, and components/all/datadep_test.go. The test
fails when a registered component has no row, when a row names no
component, or when a reason is empty, too short, or only a code
reference.

Closes #428

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Split the single "with storage off" column into three levels: off,
metadata only (does not exist yet), and everything. Add what a
metadata-only level would need, and open questions for the owner.

Correct one finding: with storage off, summarize and
cache_aware_summarizer do not start, because they cannot tell how full
the window is. They waste model calls only once the billed-token
record is kept, which is the metadata-only case.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
The client sends its own transcript every turn and only appends the
response, so it never keeps a rewrite. A rewrite that depends only on
the message needs no storage; storage is needed only for model-written
text and for gated rewrites.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Lead with a summary of the results. Define every term on first use
(Store, original, frozen decision, breaks the cache, body stash). Use
active voice and short sentences, and one word for one meaning.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Replace the switch table at the top with "Will my setup work?": one
row per preset and per cache strategy, marked works, partly or does
not work at each storage level, and what "partly" means. Move the
switch table to a technical note at the end.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
- dash.Options.CaptureContent said "Opt-OUT ... defaults on". The zero
  value and --dashboard-content are both off.
- tenant.Tenant.CaptureContent said "Off by default". Register sets it
  on for a new account; only the column DEFAULT is 0.
- dash.Options.LifecycleSignals said "Off by default". The flag
  --dashboard-lifecycle-signals defaults to on.

Comment-only change.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
A component that pays a model call or a cache write for a saving that
lasts one turn does not work; drop the "partly" mark. Every plugin
preset except conservative is now marked as not working with storage
off, and the summary says what to use instead.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Add a yellow "works, metadata" mark for every cell where a component
or feature works by keeping only hashes, counts or timestamps. Give
every cell a mark. Say why 5-min-ping needs storage and 1-hour-head
does not: a ping is a new request the proxy sends by itself, while
1-hour-head only relabels the request the client sends anyway.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Review comments from David Boaz on #569:

- Context Guru is also used as a library, so the page says "Context
  Guru" where it meant the product, and "the proxy binary" only where
  it means that binary. Add a "Host" term.
- After the Dispatcher change, the keep-alive core keeps only a handle.
  The host's Dispatcher holds the credential, masked. Say that, instead
  of "keep-alive keeps the credential".

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid
amiddavid force-pushed the feat/data-dependence branch from 34f8e51 to a178909 Compare October 19, 2026 17:17
@amiddavid
amiddavid merged commit 45f7fe3 into main Oct 20, 2026
5 of 6 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 20, 2026
amiddavid added a commit that referenced this pull request Nov 9, 2026
The cache strategy table (none, auto with the alias 5-min-ping,
1-ping, 2-ping, 1-hour-head, and Codex's 30-min-ping) now lives in
config/strategy.go. proxy.yaml gets the optional key cache.strategy;
a key set in the file wins over the name. The new subcommand
`context-guru-proxy strategies` prints the table and the preset names
as JSON. Drift tests pin the table to the Claude Code and Codex
plugins; the plugins do not change. Closes #980.

Behavior change: `context-guru-proxy strategies` used to start the
proxy, because the proxy ignored the extra word. Now it prints the
table and exits. A file without cache.strategy loads exactly as
before.
Owner's yes, 2026-11-09, in the integrator session: "yes I approve and as long as it doesnt block the release it should go in".

Data dependence: no change. The strategy rows keep "Decided by:
David Amid, #569".

Reviews: 2 offload reviews (GLM), round 2, both approve at df2c4b7.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Document which components depend on stored data, and require a check when that changes

2 participants