Skip to content

docs(rfc): propose scope sharing and processing - #2611

Draft
PsiACE wants to merge 2 commits into
masterfrom
rfcs/scope-sharing-and-processing
Draft

PsiACE wants to merge 2 commits into
masterfrom
rfcs/scope-sharing-and-processing

Conversation

@PsiACE

@PsiACE PsiACE commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Related to #2570. Proposes the Scope sharing and processing RFC.

Rationale for this change

Team/project memory and RAG need common Scope semantics for authorized inputs, target-owned outputs, and lifecycle control.

What changes are included in this PR?

  • Add English and Chinese RFCs for continuous sharing, cross-Scope queries and processing, and explicit archive/delete behavior.
  • Describe final expected semantics, current implementation limits, application boundaries, and unresolved decisions with ASCII examples.

Are there any user-facing changes?

Documentation-only proposal; no runtime or API changes.

How was this change tested?

  • uv run prek run -a
  • Bilingual structure, pinned source links, ASCII diagrams, and MDX rendering checked.

AI usage statement

OpenAI Codex assisted with drafting and review, using GPT-6 Astra, Luna, and Sol subagents for editing and evidence checks.

PsiACE pushed a commit to PsiACE/powercontext that referenced this pull request Nov 16, 2026
…tryable cleanup

Implements the deletion half of RFC oceanbase#2611's Scope archive, deletion and cleanup
section on top of the archive slice.

Three explicit steps, because a deletion that acts on a set the requester never
saw is not explicit:

- `preview(selection)` resolves the exact structural set from parent edges only
  and returns it with a digest over `(scope_id, parent_scope_id, version)`.
- `confirm(selection, digest, single_scope=...)` re-resolves inside the existing
  hierarchy boundary and refuses a set that changed by attachment, move or
  metadata update; `single_scope` conflicts while children exist. It then refuses
  unresolved deployment defaults and persistent bindings, cuts access, and
  records the operation, confirmed set and per-resource progress.
- `cleanup(operation_id)` runs each unfinished handler; a failure records a stable
  code and stays retryable, and the members remain non-writable so an incomplete
  cleanup never restores reads.

Access cutoff is the existing `pc_scopes.lifecycle_state`, read at one serving
boundary (`_scope_operation`) for every scoped read and write, so ordinary reads,
historical readback, search, Prepare and plugin reads stop at the same point as
writes. Archive still keeps reads available.

Cleanup is a minimal boundary, not a workflow system: one idempotent
`purge(connection, scope_id)` over the owned tables, derived from the schema
rather than restated, and never following Context References or lineage into
another Scope. An unsupported cleanup mode is refused before acceptance, so no
partial delete is presented as success and no erasure is claimed.

Tests cover the observable path end to end: a confirmed subtree delete, a
single-Scope conflict with children, attach and move invalidating a confirmation,
binding repair required first, a failed cleanup staying unavailable and
retryable, an unsupported mode refused before the cutoff, the runtime refusing
ordinary reads and writes after deletion, and a surviving Scope keeping its own
revision intact.
@AlexStocks AlexStocks added the 1.6.0 v1.6.0 release tracking label Nov 17, 2026
@AlexStocks AlexStocks added 1.6.1 v1.6.1 release tracking and removed 1.6.0 v1.6.0 release tracking labels Nov 24, 2026
@PsiACE
PsiACE marked this pull request as ready for review November 30, 2026 07:24
@PsiACE
PsiACE marked this pull request as draft November 30, 2026 07:25
@AlexStocks AlexStocks added 1.6.2 v1.6.2 release tracking and removed 1.6.1 v1.6.1 release tracking labels Nov 30, 2026
@hidb4ai hidb4ai added module:core Core: PR changes under src/ module:other Other: changes without an applicable Knowledge base, Gateway, Core, Desktop or pc-mate label and removed module:core Core: PR changes under src/ labels Dec 2, 2026
@hireview001

Copy link
Copy Markdown
Collaborator

The affected modules are Other. @hidb4ai, please coordinate follow-up. Other: @hidb4ai @PsiACE. Please coordinate the review of the affected changes.

@hidb4ai hidb4ai 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.

Reviewed 445954e. The RFC separates structural ownership from shared origins, rechecks authority at use and commit, and explicitly scopes deletion and incomplete cleanup. Existing capabilities, proposed behavior, and unresolved implementation decisions are distinguished consistently in both languages. No actionable defect found in this documentation-only change. No tables or runtime interfaces are added. Merge score: 80/100. Current Actions are cancelled/skipped; this approval does not establish implementation acceptance or replace required CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6.2 v1.6.2 release tracking module:other Other: changes without an applicable Knowledge base, Gateway, Core, Desktop or pc-mate label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants