Skip to content

test(context): pin CPG-09 stateful recovery deferral - #24

Open
Wibias wants to merge 8 commits into
agent/context-projection-cp08from
agent/context-projection-cp09-deferred
Open

test(context): pin CPG-09 stateful recovery deferral#24
Wibias wants to merge 8 commits into
agent/context-projection-cp08from
agent/context-projection-cp09-deferred

Conversation

@Wibias

@Wibias Wibias commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stack the CPG-09 readiness guard on CPG-08.
  • Do not enable Cursor/Kiro provider-stateful recovery because CPG-08 has no live provider trials and therefore does not satisfy the plan's rollout gate.
  • Distinguish transport shape from provider state: Cursor uses runTurn, while Kiro uses build/fetch/parse with provider-private continuation state.
  • Declare provider statefulness explicitly through ProviderAdapter.contextProjectionProviderStateful instead of inferring recovery safety from adapter names or transport shape.
  • Pin the stateful_adapter fail-open behaviour for both forms of provider state.
  • Verify the current Cursor 330-tool / 120,000-byte budget and demonstrate that an unpinned __ocx_context_v1 can be pruned from a full catalogue.
  • Preserve the requirement that future Cursor recovery must either pin/guarantee the recovery tool or post-budget verify it and fail open.

Deep-review hardening

Kiro and Cursor now declare contextProjectionProviderStateful: true in the adapter registry. The core recovery capability planner consumes that explicit property. Stateless adapters assert that the capability is absent. This separates provider-owned continuation semantics from the unrelated adapterNeedsForcedContinuation() persistence helper and prevents a future stateful adapter from silently becoming recovery-eligible merely because it does not use runTurn.

Focused provider-path/stateful-deferral/evaluation/review-hardening tests and the full TypeScript typecheck passed after the final rebase onto CPG-08.

Scope decision after deep review

This PR is the CPG-09 readiness/deferral gate, not the completed provider-stateful recovery milestone from the original roadmap. That is intentional, not an implementation shortcut.

Stateful recovery must remain disabled until CPG-08 has live evidence for the simpler stateless path, including comparison against OpenAI HTTP previous_response_id continuation and Responses WebSocket continuation. Byte reduction or synthetic exact-recovery checks are not sufficient evidence.

Preconditions for enabling Cursor/Kiro recovery later

All of the following must be true first:

  • CPG-08 live gate passes with zero protocol violations and the declared quality/cost/latency thresholds;
  • canonical restart after provider-private state loss is proven;
  • provider reconnect/process restart and compaction boundaries are covered;
  • stale request-local refs never cross an outer-turn/provider-state boundary;
  • hidden recovery cannot cross provider/account failover;
  • recovery-then-real-action regeneration remains mandatory;
  • the final provider-visible recovery tool is unique and guaranteed to survive any provider tool budget;
  • Cursor's 330-tool / 120,000-byte catalogue limit is handled by pinning/guarantee or post-budget verification, never assumption;
  • Kiro remains classified by provider-private continuation state rather than by transport shape alone.

If those conditions do not pass, this deferral is the intended final CPG-09 behaviour.

Why this is a deferred stage

The implementation plan permits provider-stateful recovery only after the stateless path is proven with live provider evidence. The checked-in CPG-08 evaluation has zero live provider attempts, so enabling recovery for Cursor or Kiro would violate that rollout gate.

Stack

@github-actions github-actions Bot added the chore label Aug 15, 2026
@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@Wibias Wibias changed the title test(context): pin CP-09 runTurn recovery deferral test(context): pin CP-09 stateful recovery deferral Aug 15, 2026
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch 2 times, most recently from 5f51cfa to c9f6d41 Compare August 15, 2026 23:59
@github-actions github-actions Bot changed the title test(context): pin CP-09 stateful recovery deferral test(context): pin CPG-09 stateful recovery deferral Aug 16, 2026
@Wibias
Wibias force-pushed the agent/context-projection-cp08 branch 2 times, most recently from 3777bfc to 4459006 Compare August 16, 2026 02:48
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch 2 times, most recently from b952613 to 092ad37 Compare August 16, 2026 02:51
@Wibias
Wibias force-pushed the agent/context-projection-cp08 branch from 4459006 to 23433de Compare August 16, 2026 03:08
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch from 092ad37 to da36646 Compare August 16, 2026 03:09
@Wibias
Wibias marked this pull request as ready for review August 16, 2026 03:13
@Wibias
Wibias force-pushed the agent/context-projection-cp08 branch from 23433de to 89b5e2e Compare August 16, 2026 03:15
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch from da36646 to a20d295 Compare August 16, 2026 03:16
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp08 branch from 9de2c7a to f62134a Compare August 16, 2026 04:49
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp09-deferred branch from 39b2ce5 to 91f21bf Compare August 16, 2026 04:50
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp08 branch from fe78b6b to e550646 Compare August 16, 2026 04:51
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp09-deferred branch from ba1bf9d to 86c2987 Compare August 16, 2026 04:54
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f2d4b17f-49a9-4c2b-9dd2-7210711cbcd5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions
github-actions Bot force-pushed the agent/context-projection-cp08 branch from 969fab3 to 15e1424 Compare August 16, 2026 05:05
@github-actions
github-actions Bot force-pushed the agent/context-projection-cp09-deferred branch from 28337e7 to 4957f8f Compare August 16, 2026 05:07
@Wibias
Wibias force-pushed the agent/context-projection-cp08 branch from 15e1424 to a558136 Compare August 16, 2026 20:42
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch from 4957f8f to 4357e0c Compare August 16, 2026 20:42
@Wibias
Wibias force-pushed the agent/context-projection-cp08 branch from a558136 to 9d8f3ed Compare August 16, 2026 20:51
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch from 4357e0c to cb8ff73 Compare August 16, 2026 20:51
@Wibias
Wibias force-pushed the agent/context-projection-cp08 branch from 9d8f3ed to 4c21418 Compare August 16, 2026 23:22
@Wibias
Wibias force-pushed the agent/context-projection-cp09-deferred branch from cb8ff73 to 99e0ede Compare August 16, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant