Skip to content

chore(deps): upgrade Context Graph Protocol to the pre-freeze normative sweep (#33) - #354

Merged
macanderson merged 1 commit into
mainfrom
chore/upgrade-cgp
Jul 23, 2026
Merged

chore(deps): upgrade Context Graph Protocol to the pre-freeze normative sweep (#33)#354
macanderson merged 1 commit into
mainfrom
chore/upgrade-cgp

Conversation

@macanderson

@macanderson macanderson commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Bumps contextgraph-types/-host/-conformance from 58a933a9fb559a — the CGP pre-freeze normative sweep (upstream #33: canonical token accounting, content-optional frames, ADR-0004 dead-capability removal). A breaking API change, migrated across every stella consumer.

The API changes and how stella tracks them

  • ContextFrame.content is now Option<String> (a reference frame carries none). Every construction site wraps its inline content in Some(...); every consumer (graph render, memory projection, conformance) handles None. Stella's frames are all Representation::Full, so the new canonical/reference/transform/fidelity fields are None — the "legacy full frame" shape the spec round-trips unchanged.
  • Capabilities lost upsert/subscribe, gained correlation/verify. Durability is now declared on DataFlow.writes (ADR 0004), which stella already sets.
  • QueryCapability lost its advertised filters (still functional, just not a declared capability).
  • DataFlow gained egress_scopes — the local plane declares none (vec!, consistent with egress: false).
  • ContextQuery gained representation_preferences — empty ⇒ the default [full].

Verification

  • Full workspace compiles; cargo test --workspace green (no failures).
  • stella-context / stella-graph / stella-cli tests pass, including the CGP conformance gate (contextgraph-conformance).
  • clippy -D warnings + fmt --check clean.

Follow-up: oxagen

The user also asked to "link up at the highest level, oxagen too." Oxagen has a separate, un-renamed ocp-* copy of the protocol (per the OCP→Context Graph Protocol rename). Bringing it onto this same contextgraph-* revision is a cross-repo change in ~/Projects/oxagen-platform, tracked separately from this stella PR.

…ve sweep (#33)

Bumps contextgraph-types/-host/-conformance from 58a933a to 9fb559a — the
CGP normative sweep. It is a breaking API change (canonical token accounting,
content-optional frames, ADR-0004 dead-capability removal), migrated across
every stella consumer:

- ContextFrame.content is now Option<String> (a `reference` frame carries
  none). Every construction wraps its inline content in Some(...); every
  consumer (graph render, memory projection, conformance) handles the None
  case. Stella's frames are all Representation::Full, so the new
  canonical/reference/transform/fidelity fields are None — the "legacy full
  frame" shape the spec round-trips unchanged.
- Capabilities lost `upsert`/`subscribe` and gained `correlation`/`verify`;
  durability is now declared on DataFlow.writes (ADR 0004). QueryCapability
  lost its advertised `filters`. DataFlow gained `egress_scopes` (the local
  plane declares none). ContextQuery gained `representation_preferences`
  (empty ⇒ the default [full]).

Full workspace compiles; stella-context/-graph/-cli tests and the CGP
conformance gate pass; clippy -D warnings clean.

Signed-off-by: macanderson <mac@oxagen.sh>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stella-cli-docs Ignored Ignored Jul 23, 2026 6:56am

@macanderson
macanderson marked this pull request as ready for review July 23, 2026 06:59
@macanderson
macanderson merged commit b0117f3 into main Jul 23, 2026
6 of 7 checks passed
@macanderson
macanderson deleted the chore/upgrade-cgp branch July 23, 2026 06:59
macanderson added a commit that referenced this pull request Jul 23, 2026
* fix(cgp): declare §B3-honest frame token_cost (budget_tokens)

The CGP pin rebase (#354) claimed to adopt "canonical token accounting" but
kept the old estimate: the store declared
`estimate_tokens(content) + estimate_tokens(title)` and the graph declared
`estimate_tokens(content).max(1)`. Under the pinned protocol, §B3 requires
`token_cost == budget_tokens(content)` — the canonical inline count
(ceil(bytes/4)), exact, no tolerance. Neither builder was honest: the store
added the title's tokens (always non-zero) and used chars not bytes; the
graph's `.max(1)` diverges on empty content.

The existing conformance gate didn't catch it: its probe query returns zero
frames from the mismatched seed, so §B3 never fired on a real frame.

Fix: both production builders now declare `budget_tokens(content)`.
`pack_to_budget` already packs against each frame's own token_cost, so the
summed-budget invariant is preserved. New `recalled_frames_declare_honest_token_cost`
drives the real `recall` builder with a query that provably surfaces a frame
and asserts `declares_honest_token_cost()` — it fails on the pre-fix code
(token_cost 18 vs canonical 15) and passes after. A matching assertion guards
the graph builder. Dead `estimate_tokens` helpers removed.

* fix(ci): clear two pre-existing clippy -D-warnings blocking CI

`main` (b0117f3) fails `cargo clippy --workspace --all-targets -- -D warnings`
— the exact CI gate — on two warnings that landed unprotected:

- `run_shared_candidates` (pipeline.rs, from #352) lacks the
  `#[allow(clippy::too_many_arguments)]` its five sibling functions in the
  same file already carry.
- `use contextgraph_types::Representation` (contextgraph.rs, from #354) is
  used only in a `#[cfg(test)]` helper, so it is unused in the bin build.
  Import removed; the one test use is fully-qualified.

Both unrelated to the token_cost fix but required for this PR's CI to be green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant