Skip to content

docs(rfc): define scope-owned prompt management - #1468

Open
Teingi wants to merge 4 commits into
oceanbase:masterfrom
Teingi:codex/scope-prompt-management-rfc
Open

docs(rfc): define scope-owned prompt management#1468
Teingi wants to merge 4 commits into
oceanbase:masterfrom
Teingi:codex/scope-prompt-management-rfc

Conversation

@Teingi

@Teingi Teingi commented Sep 4, 2026

Copy link
Copy Markdown
Member

Tracks #1465.

Rationale for this change

PowerContext binds seven built-in instruction variants across six inference operation types at Runtime composition.
Customers need Scope-specific operational prompts with immutable history, rollback, and traceable runtime selection.
This proposal reuses Scope and Artifact revision/head semantics: no new database tables and no parallel Prompt CRUD API.

What changes are included in this PR?

  • Add synchronized English and Chinese RFCs for Scope-owned operational Prompt management.
  • Define family=prompt, registered prompt keys as stable Artifact IDs, and strict content containing schema_version,
    mode, instructions, and typed demonstrations (input plus expected_output).
  • Reuse Artifact CRUD and exact reads; propose exactly two new HTTP operations: generic Artifact revision listing and
    non-persisting Prompt demonstration generation. Rollback copies an old revision into a new conditional replacement.
  • Define compatible Definition upgrades, readable immutable history, explicit incompatible-head/rollback errors, and
    the v1 restriction to homogeneous deployment versions.
  • Carry verified generation provenance across Handoff prepare/finalize/commit, retaining the selected Prompt revision
    after head changes and distinguishing edited drafts from unchanged generated content.
  • Separate code-enforced schema, Scope, authority, and resource constraints from best-effort model guidance and secret
    exclusion, with explicit adversarial validation requirements.
  • Extend existing capabilities with effective per-key support and deployed built-in identity. The Dashboard bundles
    the six keys and handles empty Scopes, disabled operations, and externally managed components without a discovery API.
  • Exclude injected pipeline/generator/reranker implementations from v1 customization; reject unsupported Custom writes
    and block existing Custom heads after a component switch instead of silently ignoring them.
  • Specify authorization, tracing, configuration lineage, errors, deployment requirements, and implementation acceptance
    scenarios, including the narrow amendments to RFC 1396 and RFC 1437.

This PR contains design documentation only. It does not implement the proposed APIs or Runtime behavior.

Are there any user-facing changes?

No released behavior changes in this PR. The proposed implementation retains current behavior for Scopes without
Prompt Artifacts, including injected components. It requires no new SQL tables or content backfill.

Implementing the RFC extends existing capabilities and Handoff request/response/content models, so strict readers,
generated contracts, mappers, and clients must be updated together. Old Handoff payloads without generation metadata
remain valid but do not carry verified Prompt provenance. V1 does not support mixed Definition/compiler versions
within one deployment.

How was this change tested?

Passed:

  • git diff --check and git diff --cached --check.
  • Relative-link and Markdown fence validation for both RFCs.
  • Parsing all 14 JSON examples and validating all 6 demonstration input/output pairs against the current
    MemoryExtractionInput / MemoryExtractionOutput models in strict JSON mode.
  • Bilingual example-count/error-code checks and confirmation of exactly two new endpoint rows in each RFC.
  • All repository UV_PYTHON=3.11 uv run --locked prek run -a hooks except the existing ty-check failure below.
  • From website/, using its pinned pnpm 11.13.1: corepack pnpm install --frozen-lockfile, corepack pnpm lint, and
    corepack pnpm build.
  • Static export verification: 78 HTTP API pages and 378 Python API pages.

The root make docs-test invocation selected pnpm 11.25.0 through Corepack and failed the project's version check;
the equivalent install/lint/build commands above passed from website/. The website does not render RFC files, so
RFC examples and links were checked separately.

Repository-wide ty check still reports three existing unresolved scripts.scope_binding imports in the Codex
integration hooks (bind_tools.py, recall.py, and session_binding.py). This Markdown-only PR does not change those
files. The proposed Runtime lifecycle and adversarial tests are implementation requirements, not tests implemented
or claimed as passing by this documentation PR.

AI usage statement

OpenAI Codex assisted with repository and review inspection, drafting and revising the bilingual RFCs, and validation.

@Teingi
Teingi marked this pull request as ready for review September 5, 2026 00:37
Comment thread docs/en/rfcs/1468_scope_owned_prompt_management.md
Comment thread docs/en/rfcs/1468_scope_owned_prompt_management.md Outdated
Comment thread docs/en/rfcs/1468_scope_owned_prompt_management.md
Comment thread docs/en/rfcs/1468_scope_owned_prompt_management.md
Comment thread docs/en/rfcs/1468_scope_owned_prompt_management.md Outdated
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