RFC: scope model — Project sharing + Workstream isolation - #1238
RFC: scope model — Project sharing + Workstream isolation#1238larry-zy wants to merge 2 commits into
Conversation
Introduce an RFC resolving the three-way overload of scope_id (project / memory-isolation partition / Workstream) by keeping scope_id as the Workstream identity and adding an application-layer Project that carries shared context. Includes English and Chinese versions. Refs oceanbase#1219
|
|
|
hi @larry-zy , pls only add your rfc files in this PR -> edit the target branch to |
|
I've realized the problem — sorry, I'm fixing it now. |
|
This PR adds an RFC ("Development Context and Scope Model") proposing to resolve scope_id's three-way semantic overload by keeping scope_id as the Workstream identity (and Runtime partition key) and introducing an explicit application-layer Project to carry shared context, without adding a new workstream_id. It is a documentation-only change: no source code is modified. The only additions are two synchronized RFC files, in English and Chinese, under docs/en/rfcs/ and docs/zh/rfcs/. |
|
I wonder if Alternative B can be simplified by treating Project as a typed scope, while keeping it as a domain abstraction: The existing catalog already provides the This avoids a separate Could you compare this model with the current Alternative B? |
Summary
PowerContext derives a
scope_idfrom a project and uses it to share durable context across Sessions; Handoff later reused that same scope as the identity of one linear Workstream. As a resultscope_idis overloaded with three conflated meanings at once — the project (sharing unit), the memory-isolation / Runtime partition key, and the Workstream (isolation unit) — where sharing wants scopes to be the same and isolation wants them different. One key cannot be both, so the current model cannot express parallel work inside one project or development spanning several projects.This RFC fixes the identity boundaries relating Project, Workstream, Session, and scope, and records the accepted model and invariants (I1–I8) without prematurely fixing user-flow orchestration, migration tooling, or concrete API/CLI/Dashboard shapes.
Decision — Alternative B
Three approaches were weighed (full comparison in Rationale and alternatives):
workstream_id(cleanest, but reverses two RFC 0082 decisions and forces a backfill migration) → deferred, not discarded.scope_idas the Workstream identity and partition key; add a separate, additive, opt-in Project layer that carries the shared context → adopted.Under B, isolation stays on the Workstream (
scope_id≡ Workstream: its own Sources / Memory head / linear Handoff history / Statistics) and sharing lives on the Project (project_id → Memory Artifact, read-only overlay from any member Workstream's Session). Both hold simultaneously — which a single overloadedscope_idcould not express. Noworkstream_idthis version; zero migration, no Core Protocol change; ungrouped scopes behave exactly as today.Scope of this RFC
MemoryBindingStoreone-to-one binding + the named multi-instance extension seam), 0048 (one linear history per scope, CAS conflict), 0082 (Project → Workstream(≡scope_id)catalog, aggregation-only rule, branch-is-not-identity).docs/en/rfcs/+docs/zh/rfcs/).Intentionally left Unresolved (deferred to follow-up)
derive_scope_idcurrently keys only on the repository).Notes for reviewers
0000_prefix per the RFC process; it will be renamed to this PR's number once assigned.Refs #1219