Repository navigation
Description
Split from #4633.
The issue names stage_change, stage_split, stage_tools_research and alternatives as prompts that get project values through the new Jinja context, but it names no fact for them, and they hold no {{ }} marker today. This follow-up adds the project fact of each prompt and passes it as context, so the prompt takes the fact instead of a Python copy. Why deferred: the loader, the implement step tables and the prompt version can ship without them, and the fact of each prompt is a product decision with no source in the repository. Acceptance criteria: each of the four prompts SHALL take its project fact through a {{ }} context; a test SHALL render each with its real context and raise no UndefinedError; stage_plan_record.prompt_version SHALL cover the new context values.
Proposed design
Problem statement
The prompts stage_change, stage_split, stage_tools_research and alternatives keep project facts in Python copies. They hold no Jinja marker for a project fact. This change gives each prompt the project profile through a {{ project_profile }} context value. The stage plan record prompt version then covers the new context value.
Acceptance criteria
Requirement: Prompt project profile marker
Each of the four prompt templates SHALL hold a {{ project_profile }} marker.
Scenario: Template marker
- WHEN a test reads the template of
stage_change,stage_split,stage_tools_researchandalternatives. - THEN each template text holds
{{ project_profile }}.
Requirement: Real context render
Each of the four prompts SHALL render with its real context and raise no jinja2.UndefinedError.
Scenario: Real context render
- WHEN a test calls
load_task_promptforstage_change,stage_split,stage_tools_researchandalternativeswith the project profile context. - THEN each call returns text and raises no
jinja2.UndefinedError.
Requirement: Context passes the project profile
The stage and alternatives jobs SHALL pass the project profile from the repository into the prompt context.
Scenario: Build the prompt context
- WHEN a test builds the prompt context for each of the four prompts from a project profile that holds a known value.
- THEN each context holds that known value under
project_profile.
Requirement: Prompt version covers the project profile
The stage plan record prompt version SHALL include the project_profile context value.
Scenario: Change the project profile
- WHEN a test computes
stage_plan_record.prompt_versionwith two differentproject_profilevalues. - THEN the two version strings differ.
Existing Tool Considered
No alternatives check has run. The repository already uses Jinja2 in src/devops_cli/ai/task_loader.py. Jinja2 is open, maintained, and covers {{ }} rendering and UndefinedError. Jinja2 lacks the project facts, so the change supplies them from the project profile as project_profile.
Key questions
- Which project fact SHALL
stage_change,stage_split,stage_tools_researchandalternativestake from the Jinja context?: Use one context value,project_profile, that holds the project profile as a JSON string. Each of the four prompts gets a{{ project_profile }}marker. The prompt reads the fields it needs. (best practice) [sources: CONTEXT.md, src/devops_cli/ai/task_loader.py, openspec/specs/ai-task-prompts/spec.md]- Chosen: Shared
project_profilecontext value. The project profile is the repository record of project facts, and one value gives each prompt the same source without a Python copy. - Rejected: One context value for each prompt. It needs four product decisions with no source in the repository and multiplies context keys.
- Rejected: Keep the Python copy. It keeps the duplication that the issue removes and cannot raise
UndefinedErrorfor a missing fact.
- Chosen: Shared
- How does the loader behave when a prompt names a context value that the caller does not supply?:
load_task_promptraisesjinja2.UndefinedError. [sources: src/devops_cli/ai/task_loader.py, openspec/specs/ai-task-prompts/spec.md:31] - How SHALL
stage_plan_record.prompt_versioncover the new context values?: Hash the four prompt names and theproject_profilevalue intostage_plan_record.prompt_version. (best practice) [sources: src/devops_cli/roadmap/stage/stage_plan_record.py, src/devops_cli/ai/task_loader.py]- Chosen: Include the context value in the version hash. The issue requires the version to cover the new context values, and a hash detects a changed profile.
- Rejected: Bump a manual version number. A manual bump does not cover the actual context value and can be forgotten.
- Rejected: Hash the prompt text only. The prompt text does not change when the project profile changes.
- Where does the project profile come from?: The project profile merges field defaults, the type template in
src/devops_cli/templates/profiles/, detection in the repository files, and.devops/project.toml. Each value records its source. [sources: CONTEXT.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 14, 2026
The body states the work is deferred and depends on a product decision with no source in the repository.Both work on Jinja project values in prompts; #4633 builds the loader, the candidate adds project facts to four named prompts.feat(ai): Render the task prompts through Jinja2 with a context (#6162)
devops-cli-service commentedon Nov 20, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.