Skip to content

PIR spawn prompt renders blank artifact filenames: {{artifact_name}} is not on TemplateContext and no spawn path supplies it #1293

Description

@waleedkadous

Problem

codev-skeleton/protocols/pir/builder-prompt.md:33-35 consumes {{artifact_name}} in the phase list:

  • plan phase: "write codev/plans/{{artifact_name}}.md"
  • review phase: "write codev/reviews/{{artifact_name}}.md"

But artifact_name is not a field of TemplateContext (spawn-roles.ts:25-48) and no spawn path in spawn.ts supplies it. renderTemplate renders a missing key as an empty string, so every PIR builder's spawn prompt tells it to write codev/plans/.md and codev/reviews/.md. Verified 2026-07-29 against both files.

Only porch supplies artifact_name, for per-phase prompts — the spawn-time template never gets it.

Surfaced by the aspir-1273 builder during its phase-5 CMAP (correctly kept out of that project's scope: its contract is to match what spawn delivers, not to change another protocol's spawn behaviour).

Severity

Low-ish in practice: the blank renders in the spawn prompt's protocol overview, and porch's per-phase prompts later deliver the correct artifact name — so a PIR builder is misinformed at spawn but corrected per-phase. Still a real defect: the spawn prompt is the builder's first orientation, and "write codev/plans/.md" reads as broken.

Fix options (either is acceptable; second is recommended)

  1. Supply it: add artifact_name?: string to TemplateContext and populate it in the issue-driven spawn path using the same derivation porch uses (issue number + slug). Keeps the concrete filename in the spawn prompt, at the cost of duplicating the derivation or extracting it to be shared.
  2. Drop the placeholder (recommended): reword the two lines to defer to porch — e.g. "write the plan to codev/plans/ under the artifact name porch's phase prompt gives you." Zero code change, no derivation duplication, and consistent with the existing division of labour (porch owns per-phase artifact naming).

Whichever fix: mirror across codev/ and codev-skeleton/ if a local copy of the PIR protocol exists (currently skeleton-only), and grep both trees for other templates consuming {{artifact_name}} outside porch's per-phase delivery before claiming fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/protocolsArea: Protocol definitions — distinct from area/porch (orchestration)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions