Skip to content

[PromptResolver] inline vs promptFile #7

@pyadav

Description

@pyadav

Parent

#1

What to build

First module of the prompt pipeline. Resolves the prompt input: either an inline prompt (passed through to the agent as-is) or a prompt template (file loaded from disk; substitution + expansion happen in later slices). Validates mutual exclusion and the inline-prompt-bypass contract (per ADR 0008).

Vocabulary: this module is the PromptResolver per the project's module map.

Acceptance criteria

  • PromptResolver accepts { prompt } or { promptFile } and returns a tagged result indicating which path the prompt came from (so downstream stages can decide whether to substitute/expand)
  • prompt and promptFile are mutually exclusive at the type level (already enforced in [Types] Public types, interfaces, entry-point stubs (no implementation) #3); runtime check throws if both are passed (defense in depth)
  • promptArgs combined with inline prompt throws (per CONTEXT.md and ADR 0008)
  • promptFile resolves relative paths against process.cwd() (caller's perspective, NOT the run's cwd option)
  • Missing promptFile throws an actionable error naming the resolved absolute path
  • Inline prompt path returns the string verbatim with no processing
  • Unit tests cover: inline path, file path, both passed, neither passed, promptArgs + inline, missing file
  • bun test and bun run typecheck pass

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions