Skip to content

feat: implement scope organization runtime for RFC #1345 - #1401

Open
PsiACE wants to merge 31 commits into
masterfrom
codex/scope-organization-runtime
Open

feat: implement scope organization runtime for RFC #1345#1401
PsiACE wants to merge 31 commits into
masterfrom
codex/scope-organization-runtime

Conversation

@PsiACE

@PsiACE PsiACE commented Aug 30, 2026

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Implements the runtime design in #1345.

Rationale for this change

Scope is the durable boundary for memory ownership, isolation, sharing, and reporting. The runtime and Agent integrations need to use the same server-owned Scope model instead of Project, Workstream, or client-generated Scope identifiers.

What changes are included in this PR?

  • Adds durable Scope hierarchy, metadata, default selection, and session or workspace bindings.
  • Adds direct Context References and exact cross-Scope Artifact References with provenance.
  • Uses Scope selection for context reads, statistics, Handoff Reports, and artifact publication.
  • Removes the Project and Workstream report model and its compatibility paths.
  • Updates bundled Agent integrations to resolve, reuse, and derive server-owned Scopes.
  • Updates HTTP, MCP, generated clients, configuration, documentation, and acceptance coverage.
  • Makes the E2E harness provision real Scopes before running Agent workflows.

Are there any user-facing changes?

Yes. This is a breaking change:

  • Scope replaces Project and Workstream as the organization and reporting boundary.
  • Scope IDs are generated by the service; integrations must resolve or create a Scope before writing.
  • Context and report queries select all visible Scopes, one exact Scope, or a Scope subtree.
  • No compatibility or migration period is included.

How was this change tested?

  • make check
  • make test
  • make contract-test
  • make docs-test
  • make harness-check
  • GitHub Actions on Python 3.11, 3.12, 3.13, and 3.14
  • SQLite and OceanBase acceptance scenarios

AI usage statement

OpenAI Codex was used for code analysis, implementation, tests, and documentation editing.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

license-eye has checked 978 files.

Valid Invalid Ignored Fixed
704 21 253 0
Click to see the invalid file list
  • integrations/codex/plugins/powercontext/hooks/bind_tools.py
  • integrations/codex/plugins/powercontext/hooks/session_binding.py
  • integrations/codex/plugins/powercontext/scripts/scope_binding.py
  • src/powercontext/builtin/handoff_report/init.py
  • src/powercontext/builtin/handoff_report/adapters.py
  • src/powercontext/builtin/handoff_report/canonical.py
  • src/powercontext/builtin/handoff_report/errors.py
  • src/powercontext/builtin/handoff_report/protocols.py
  • src/powercontext/builtin/handoff_report/rendering.py
  • src/powercontext/builtin/scope/init.py
  • src/powercontext/builtin/scope/application.py
  • src/powercontext/builtin/scope/errors.py
  • src/powercontext/builtin/scope/models.py
  • src/powercontext/builtin/scope/repository.py
  • src/powercontext/server/static/handoff-report.js
  • src/powercontext/server/static/scope-selection.js
  • src/powercontext/server/templates/pages/handoff_report.html
  • tests/builtin/test_scope_application.py
  • tests/codex_plugin/test_scope_binding.py
  • tests/test_handoff_report.py
  • tests/test_scope_api.py
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

@PsiACE PsiACE changed the title draft: evaluate scope organization runtime for RFC #1345 feat: implement scope organization runtime for RFC #1345 Sep 1, 2026
@PsiACE
PsiACE marked this pull request as ready for review September 1, 2026 08:22

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

license-eye has checked 993 files.

Valid Invalid Ignored Fixed
725 1 267 0
Click to see the invalid file list
  • integrations/dsh/plugins/powercontext/pnpm-lock.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

# See the License for the specific language governing permissions and
# limitations under the License.

lockfileVersion: '9.0'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
lockfileVersion: '9.0'
# Copyright (c) 2026 OceanBase.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
lockfileVersion: '9.0'

# See the License for the specific language governing permissions and
# limitations under the License.

lockfileVersion: '9.0'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
lockfileVersion: '9.0'
# Copyright (c) 2026 OceanBase.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
lockfileVersion: '9.0'

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