Skip to content

docs(contextprojection): add the ContextProjection owner contract - #2151

Closed
eric8810 wants to merge 1 commit into
mainfrom
dim/2025-contextprojection
Closed

eric8810 wants to merge 1 commit into
mainfrom
dim/2025-contextprojection

Conversation

@eric8810

Copy link
Copy Markdown
Collaborator

Owner: ContextProjection
Batch: 1
Scan issue: #2025
Old PR: #2093
Contract: docs/design/plugins/ContextProjection.md
Base: origin/main 82a91e66a
Head: de61bc31c

What

Adds the ContextProjection owner contract: the branch-scoped fold, the request-local projection, the compaction in force and the recovery snapshot. The contract replaces the Session-scoped historyRenderer value and context_in.

Shared rows:

  • docs/design/contracts/runtime-owner-operations.md: ContextPreparation → contextProjection; prepare no longer takes projection?.
  • docs/design/service-faces.md: the historyRenderer row is retired.
  • docs/design/plugins/README.md and docs/zh/design/plugins/README.md: owner index row and By-scope branch part.

Dependencies

None in batch 1. ContextPreparation is a downstream caller; the shared row is ContextPreparation → contextProjection. The process-scope by-id reader depends on ADR 027's route (#2127); that requirement is recorded in the contract.

Supersedes

  • docs/design/contracts/runtime-owner-operations.md: Loop and ContextPreparation → HistoryRenderer.
  • docs/design/service-faces.md: historyRenderer.
  • docs/design/plugins/README.md / zh: owner index row.

Design decisions

  • All five operations belong to ContextPreparation's paths: renderedStream in prepare, renderedContext in the manual compaction pre-read, streamCheckpoint/snapshotFromCheckpoint in threshold compaction, snapshot after a completed compaction.
  • through is a published sequence; a cutoff above the published head is future_sequence.
  • A saved snapshot that cannot decode or whose state cannot fold under the current policy is a cache miss: the fold ignores it and replays from the chain start.
  • The caller saves snapshots through timeline.save_snapshot; a save failure skips the snapshot and leaves the committed fact standing.

Review record

  • Pre-review rounds 1-6: no open P1/P2; all P3s fixed.
  • yyhhyyyyyy-style mock review: 5 rounds plus a final delta, 无 P1/P2.
  • zerob13-style mock review: 5 rounds plus a final delta, 无 P1/P2.
  • Non-blocking P3: two ledger references (the replay_context/context test-caller list and the Loop call sites) remain as delivery notes, not contract gaps.

Ready check

  • Every operation, error and caller next step defined.
  • §7.1/§7.2 and ADR 002 rows answered.
  • Dependencies match the batch table.
  • Pre-review and both mock reviews 无 P1/P2.
  • node scripts/adr-check.mjs --base origin/main, cargo run --locked -p xtask-check, git diff --check pass.
  • No maintainer question.

Refs #2025

…ection

Replace the historyRenderer value with branch-scoped contextProjection
operations for folding a branch's facts into the context a request carries
and for recovery snapshots. The design index, the runtime owner operations
row and the service faces entry point at the contract.
@eric8810

Copy link
Copy Markdown
Collaborator Author

Closing as part of abandoning the owner-split experiment.

@eric8810 eric8810 closed this Nov 25, 2026
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