Feature description
Add a Scope-owned Prompt Artifact family so each PowerContext Scope can customize the operational prompts used by Memory, Experience, Skill, and Handoff generation while retaining immutable revision history.
The initial registered prompt keys are:
memory.extract
memory.rerank
experience.incubate
experience.generate
skill.generate
handoff.generate
Each Prompt revision contains a mode, instructions, and typed demonstrations. A demonstration uses the formal fields input and expected_output; dashboard groupings such as positive and negative examples are presentation concerns rather than separate storage fields.
Problem and proposed solution
The built-in Runtime currently binds versioned instructions when it is composed. Different Agents or users can be bound to different Scopes, but the Scope itself cannot select a custom prompt, inspect its history, or reproduce which revision controlled an operation.
Use the existing Scope and Artifact revision model instead of introducing prompt-specific persistence:
- add
prompt as an Artifact family;
- use each registered prompt key as the stable
artifact_id;
- reuse the existing create, current read, replace with
If-Match, and exact revision read operations;
- add
GET /v1/scopes/{scope_id}/artifacts/{family}/{artifact_id}/revisions for generic revision history;
- add
POST /v1/scopes/{scope_id}/prompts/{prompt_key}/demonstrations to generate structured demonstration suggestions without saving them;
- implement rollback by reading an old immutable revision and replacing the current head with that content, producing a new monotonically increasing revision;
- resolve and freeze one exact Prompt revision at the start of each inference operation;
- preserve Server-owned safety rules, output schemas, credentials, tool authority, and model configuration outside editable Prompt content.
No Prompt revision in a Scope means the current built-in behavior remains unchanged. There is no implicit parent-Scope inheritance or Agent/User-specific storage in the core contract.
Alternatives considered
- Dedicated Prompt, Prompt Version, and Prompt Binding tables duplicate ownership, revision, and head semantics already supplied by Artifact storage.
- Prompt-specific CRUD endpoints duplicate the generic Artifact API and make the surface harder to extend.
- Agent- or user-keyed Prompt configuration conflicts with Scope isolation; Agent and user integrations should resolve their existing Scope binding before calling the core API.
- Raw prompt replacement per inference request is difficult to authorize, audit, reproduce, and cache.
- Informal positive/negative example fields couple the persistence contract to one dashboard layout and do not express the typed model input/output contract.
Additional context
The design will be submitted as a bilingual RFC before implementation. The RFC will define the exact content schema, HTTP contract, Runtime resolution rules, security boundaries, compatibility behavior, failure semantics, version history, and validation requirements.
Are you willing to contribute to this feature?
Feature description
Add a Scope-owned Prompt Artifact family so each PowerContext Scope can customize the operational prompts used by Memory, Experience, Skill, and Handoff generation while retaining immutable revision history.
The initial registered prompt keys are:
memory.extractmemory.rerankexperience.incubateexperience.generateskill.generatehandoff.generateEach Prompt revision contains a mode, instructions, and typed demonstrations. A demonstration uses the formal fields
inputandexpected_output; dashboard groupings such as positive and negative examples are presentation concerns rather than separate storage fields.Problem and proposed solution
The built-in Runtime currently binds versioned instructions when it is composed. Different Agents or users can be bound to different Scopes, but the Scope itself cannot select a custom prompt, inspect its history, or reproduce which revision controlled an operation.
Use the existing Scope and Artifact revision model instead of introducing prompt-specific persistence:
promptas an Artifact family;artifact_id;If-Match, and exact revision read operations;GET /v1/scopes/{scope_id}/artifacts/{family}/{artifact_id}/revisionsfor generic revision history;POST /v1/scopes/{scope_id}/prompts/{prompt_key}/demonstrationsto generate structured demonstration suggestions without saving them;No Prompt revision in a Scope means the current built-in behavior remains unchanged. There is no implicit parent-Scope inheritance or Agent/User-specific storage in the core contract.
Alternatives considered
Additional context
The design will be submitted as a bilingual RFC before implementation. The RFC will define the exact content schema, HTTP contract, Runtime resolution rules, security boundaries, compatibility behavior, failure semantics, version history, and validation requirements.
Are you willing to contribute to this feature?