Skip to content

Quest: Preserve planned XMD programs for explicit execution #725

Description

@taras

Quest outcome

Make an approved XMD program a portable source artifact that planning never
executes implicitly. Authors and command-line users decide explicitly whether,
where, and how often that program runs.

Plan produces a program.
Evaluate evaluates a program in the current XMD execution.
Run executes a program from the host/CLI.
Composition decides whether and when a planned program runs.

Common paths

Compose planning and evaluation directly in one document:

<Evaluate>
  <Plan>Prepare the release program and ask me to approve it.</Plan>
</Evaluate>

Preserve the approved source and evaluate it later:

<Plan as="plan">Prepare the release program and ask me to approve it.</Plan>

<Evaluate program={plan} />

Compose command-line planning with an ordinary run:

xmd plan "Prepare the release program." | xmd run -

Or save the artifact and execute the file independently:

xmd plan "Prepare the release program." --output release.md && xmd run release.md

In every path, approval completes the artifact. A later evaluation failure does
not invalidate or rewrite it.

Product boundaries

  • <Plan> emits or captures exact approved source and never evaluates it.
  • <Evaluate> has explicit complete-program forms while preserving Evaluate Agent-generated XMD through a constrained allowlist #369's
    restricted generated-fragment form unchanged.
  • xmd plan produces source only and has no execution option.
  • xmd run - reads and executes one complete stdin program through the ordinary
    run profile.
  • Source names requested behavior but grants no authority. Evaluation receives
    only authority installed at its explicit site.
  • Planning retention and program-evaluation retention are separate events with
    separate replay, failure, and cancellation histories.
  • No <Run> component is introduced.

Planning instructions and review minimize residual autonomy while faithfully
representing the user's intent:

static value
-> deterministic operation
-> control flow
-> bounded human decision
-> bounded Agent judgment
-> autonomous Agent

Blocking stories and delivery order

  1. Run <Plan> with <TestAgent> in Markdown tests #728 — run <Plan> with a deterministic <TestAgent> in Markdown
    tests.
  2. Make <Plan> emit or capture approved XMD source #722 — make <Plan> a byte-exact text-producing component and prove its
    author-visible behavior through that Markdown test boundary.
  3. Then, in parallel:
  4. Make xmd plan produce approved XMD source only #724 — remove implicit CLI execution after the Plan and stdin
    composition are available.

The Quest completes only when all five stories are delivered. #676 adds
planning-specific progress and post-failure trace afterward and does not block
this public source/execution separation. #679 evaluates planning quality and the
minimum-residual-autonomy rule against reference workflows.

Acceptance map

Each end-to-end case has one owner:

The child stories name the discriminating negative control and focused evidence
for every case. Together they update architecture, specifications, component
syntax, CLI help, the homepage, npm and compiled distribution, and affected
tests without treating delivery CI as a prerequisite for an implementation-
feedback commit.

Delivered foundations and superseded work

Completion

The Quest is complete when:

  • approved source is byte-identical whether emitted, captured, piped, or saved;
  • no planning surface executes that source implicitly;
  • current-execution evaluation supports paired and deferred complete programs,
    text and value roots, explicit props, current-site authority, durable replay,
    stale-input refusal, and independent repeated occurrences;
  • restricted source evaluation remains exactly closed;
  • stdin is a preflighted root with stable source identity and cwd-relative
    imports;
  • removed CLI execution syntax gives a working migration rather than an alias;
    and
  • all five blocking stories and their focused/distribution evidence are
    delivered.

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestCoordinating story with dependency-ordered sub-issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions