Skip to content

feat(context): add bounded project bootstrap context - #1720

Open
wangchenxuya wants to merge 10 commits into
oceanbase:masterfrom
wangchenxuya:feat/project-bootstrap-context
Open

wangchenxuya wants to merge 10 commits into
oceanbase:masterfrom
wangchenxuya:feat/project-bootstrap-context

Conversation

@wangchenxuya

Copy link
Copy Markdown

Which issue or RFC does this PR close?

Closes #1429.

Rationale for this change

Agents can start, resume, clear, or compact a project session before a user query exists. This adds a host-neutral, bounded bootstrap path so explicitly curated project context can be restored without fabricating a search query, scanning transcripts, or weakening current instruction authority.

What changes are included in this PR?

  • Add the versioned powercontext.scope-bootstrap.v1 request, response, and delivery-receipt contracts, with OpenAPI and generated client bindings.
  • Add deterministic runtime selection, exact citations and digests, UTF-8 byte budgets, content-free durable receipts, lifecycle idempotency, access checks, and first-query exact-version deduplication.
  • Add opt-in SessionStart support for Codex and Claude Code, including fail-open diagnostics, bounded local receipt state, and exact Codex hook delivery limits.
  • Add the English and Chinese RFC, integration documentation, troubleshooting guidance, and capability-manifest evidence.
  • Add runtime, contract, access-control, plugin, API, and live packaged-host service-chain coverage.

Are there any user-facing changes?

Yes. Codex and Claude Code can opt in to curated bootstrap context through their documented bootstrap settings. The feature is disabled by default, all API additions are additive, and no existing recall or prompt-capture behavior is removed.

How was this change tested?

  • make check
  • make contract-test (49 passed)
  • make docs-test
  • uv run pytest -q tests/codex_plugin tests/claude_code_plugin tests/builtin/runtime/test_bootstrap_context.py tests/e2e/test_bootstrap_context.py tests/e2e/test_bootstrap_host_service_chain.py --tb=short (321 passed, 4 skipped)
  • env NO_PROXY=127.0.0.1,localhost no_proxy=127.0.0.1,localhost uv run pytest -q tests/e2e/test_codex_service_chain.py tests/e2e/test_claude_code_service_chain.py --tb=short (7 passed)
  • git diff --check

AI usage statement

OpenAI Codex was used to analyze the issue, implement the changes, review edge cases, and run the validation commands. The resulting code, generated artifacts, documentation, and tests were inspected in the local checkout.

@CLAassistant

CLAassistant commented Sep 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@PsiACE PsiACE left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please fix the bootstrap deduplication and retry issues noted inline.

Comment thread src/powercontext/builtin/persistence/bootstrap_receipts.py
Comment thread src/powercontext/builtin/runtime/application.py Outdated
Comment thread integrations/codex/plugins/powercontext/hooks/session_binding.py Outdated
…rap-context

# Conflicts:
#	docs/en/docs/integrations/codex.md
#	docs/zh/docs/integrations/codex.md
#	integrations/claude-code/plugins/powercontext/claude_code_settings.py
#	integrations/codex/plugins/powercontext/settings.py
#	src/powercontext/builtin/runtime/application.py
#	src/powercontext/builtin/runtime/models.py
#	src/powercontext/http/_generated/models.py
#	tests/test_api_contract.py
…rap-context

# Conflicts:
#	docs/en/docs/integrations/codex.md
#	docs/zh/docs/integrations/codex.md
#	integrations/capabilities.toml
#	src/powercontext/http/_generated/schema.py
…rap-context

# Conflicts:
#	docs/zh/docs/integrations/codex.md
#	integrations/codex/plugins/powercontext/.codex-plugin/plugin.json
#	integrations/codex/plugins/powercontext/hooks/recall.py
#	integrations/codex/plugins/powercontext/pyproject.toml
#	integrations/codex/plugins/powercontext/uv.lock
@PsiACE
PsiACE self-requested a review September 29, 2026 08:33
@hidb4ai

hidb4ai commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

please update & resolve conflicts

…rap-context

# Conflicts:
#	docs/zh/docs/integrations/codex.md
#	src/powercontext/builtin/runtime/__init__.py
#	src/powercontext/builtin/runtime/application.py
#	src/powercontext/builtin/runtime/composition.py
#	src/powercontext/builtin/runtime/models.py
#	src/powercontext/http/_generated/operations.py
#	src/powercontext/server/mapping.py

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

Four reproduced correctness issues remain at this commit: a cross-scope authorization bypass, two hook delivery-state failures, and candidate starvation after bootstrap deduplication. The normal packaged-hook chain also passed against real OceanBase and embedding inference, including restart persistence; that successful path does not cover these counterexamples.

Comment thread src/powercontext/builtin/runtime/application.py
Comment thread integrations/codex/plugins/powercontext/hooks/session_binding.py
Comment thread integrations/codex/plugins/powercontext/hooks/session_binding.py Outdated
Comment thread src/powercontext/builtin/runtime/application.py
@AlexStocks AlexStocks added 1.4.0 v1.4.0 release tracking and removed 1.3.0 labels Oct 11, 2026
@hidb4ai

hidb4ai commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

please update & resolve conflicts

…rap-context

# Conflicts:
#	desktop/src-tauri/src/transport/operations.json
#	desktop/ui/src/generated/operations.ts
#	docs/en/docs/operate/troubleshoot.md
#	docs/zh/docs/operate/troubleshoot.md

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.4.0 v1.4.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants