Summary
Unify RunContract prompt rendering across the Pi service path and the CLI runtime path so both surfaces are driven by the same semantic contract renderer.
Parent roadmap: #114
Track: A — RunContract Harness core
Tier: 1 — actionable now
Problem
RunContract is becoming the shared harness surface, but prompt composition is still split between KapiService.buildWorkflowPrompt and the CLI runtime buildRuntimePrompt path. That creates drift between interactive Pi workflow guidance and Kapi CLI worker/runtime prompts.
Proposal
Add a shared renderer module for contract/workflow prompts and route both service and CLI prompt composition through it while preserving current public behavior.
Scope
- Introduce a shared semantic renderer for workflow/RunContract prompt content.
- Keep
KapiService.buildWorkflowPrompt as a compatibility wrapper if useful.
- Move CLI runtime prompt construction onto the same renderer path.
- Preserve current prompt intent, skill hints, evidence expectations, and mode-specific guidance.
- Add regression tests for both service and CLI prompt output.
Non-goals
- No rename of
WorkflowState, WorkflowDefinition, or existing workflow APIs.
- No durable RunContract schema or storage migration.
- No GitHub/PR/kapi-agent/Ragna semantics in core rendering.
- No broad Kapi→Ilchul identifier rename.
Acceptance criteria
Verification
- Run targeted prompt/CLI tests.
- Run
npm run verify.
- Search new core renderer code for adapter-specific terms such as
GitHub, pullRequest, kapiAgent, Ragna, and Discord.
References
Summary
Unify RunContract prompt rendering across the Pi service path and the CLI runtime path so both surfaces are driven by the same semantic contract renderer.
Parent roadmap: #114
Track: A — RunContract Harness core
Tier: 1 — actionable now
Problem
RunContract is becoming the shared harness surface, but prompt composition is still split between
KapiService.buildWorkflowPromptand the CLI runtimebuildRuntimePromptpath. That creates drift between interactive Pi workflow guidance and Kapi CLI worker/runtime prompts.Proposal
Add a shared renderer module for contract/workflow prompts and route both service and CLI prompt composition through it while preserving current public behavior.
Scope
KapiService.buildWorkflowPromptas a compatibility wrapper if useful.Non-goals
WorkflowState,WorkflowDefinition, or existing workflow APIs.Acceptance criteria
npm run verifypasses.Verification
npm run verify.GitHub,pullRequest,kapiAgent,Ragna, andDiscord.References