Skip to content

feat(profile): support scoped custom prompts - #1541

Merged
Teingi merged 2 commits into
masterfrom
codex/profile-custom-prompt
Sep 10, 2026
Merged

feat(profile): support scoped custom prompts#1541
Teingi merged 2 commits into
masterfrom
codex/profile-custom-prompt

Conversation

@Zxf-xufeng

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Related to #1468, #1473, and #1536.

Rationale for this change

Scope-owned Prompt management supports Memory, Experience, Skill, and Handoff operations, but Profile generation still uses fixed server instructions. This leaves Profile as the remaining generated artifact that cannot apply scoped guidance or record the exact Prompt revision used for generation.

What changes are included in this PR?

  • Register profile.generate as a Prompt key with the existing Profile input/output contract and unchanged Auto instructions.
  • Bind the scoped Prompt selection around manual and automatic Profile flushes, including spawned family workers.
  • Pass compiled Custom instructions and demonstrations into the built-in structured generator.
  • Record the selected Custom Prompt artifact in both directly generated Profile lineage and review-required candidate lineage.
  • Keep evidence trust, person attribution, sensitive-attribute safeguards, and output shape as server-owned invariants.
  • Report injected ProfileGenerator components as unsupported for managed Prompt customization, matching the existing component capability model.
  • Update the OpenAPI-generated client models, bilingual workflow documentation, and behavior/E2E tests.

Are there any user-facing changes?

Yes. Clients can create or replace a Scope-owned Prompt artifact with prompt_key=profile.generate. The Prompt affects future Profile processing windows only; saving it does not reprocess historical Sources. This is additive and requires no data migration.

How was this change tested?

  • make check
  • make contract-test (47 passed)
  • Focused Prompt/Profile/runtime/HTTP tests (79 passed)
  • Full macOS-executable suite excluding Linux-only systemd receiver-service tests (2066 passed, 61 skipped)

AI usage statement

Implemented and reviewed with OpenAI Codex (GPT-5), including code analysis, test generation, and validation.

Comment thread src/powercontext/builtin/artifacts/profile/service.py Outdated
Comment thread src/powercontext/builtin/artifacts/prompt/builtin.py

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

LGTM

@Teingi
Teingi merged commit 4108f34 into master Sep 10, 2026
17 checks passed
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.

2 participants