Skip to content

Add startup input prompting for prose run#72

Open
rawwerks wants to merge 2 commits into
mainfrom
feat/cli-startup-input-prompting
Open

Add startup input prompting for prose run#72
rawwerks wants to merge 2 commits into
mainfrom
feat/cli-startup-input-prompting

Conversation

@rawwerks
Copy link
Copy Markdown
Contributor

@rawwerks rawwerks commented May 6, 2026

Deterministic startup input prompting for prose run

Why

prose run <local-file.prose.md> could previously reach a service with missing ### Requires values and leave the problem to the agent harness. The harness might print a natural-language ask, but the CLI did not have a deterministic way to collect the answer and forward a completed command.

This made the startup path hard to trust:

  • interactive users could get an ask without a real CLI input-binding loop
  • CI/non-TTY runs could depend on harness behavior or hang
  • tests could not prove caller input collection without involving an agent

What changed

  • Added a CLI-side startup input resolver for local *.prose.md runs.
  • The resolver reads the file-level ### Requires section and extracts backtick-wrapped caller input names.
  • Existing --name value and --name=value arguments satisfy matching caller inputs.
  • Missing inputs prompt only when stdin is a TTY.
  • Missing inputs fail before harness invocation in non-interactive mode or when --no-prompt is used.
  • Prompted values are forwarded as ordinary caller input flags in the canonical command.
  • The CLI still does not write OpenProse run state.

Design boundaries

This is intentionally startup-only deterministic input binding.

In scope:

  • local prose run <file.prose.md>
  • top-level file ### Requires
  • --name value and --name=value
  • TTY one-line prompts
  • non-TTY fail-fast behavior
  • compatibility for --harness, literal args after --, and non-local package handles

Out of scope:

  • mid-run human gates
  • run resume
  • CLI writes to bindings/caller
  • Forme graph or nested service requirement inference
  • multiline input
  • secret prompting
  • VM root selection behavior, including .prose/runs vs runs

How to test

Automated:

cd tools/cli
npm test
npm run typecheck
npm run build

Current local results:

  • npm test: 175 passed
  • npm run typecheck: passed
  • npm run build: passed

Manual TTY proof:

prose run tests/open-prose/smoke/02-caller-input.prose.md
topic: monkeys

Expected behavior:

  • CLI prompts for topic before the VM banner.
  • VM receives a completed command containing --topic monkeys.
  • Run output contains both monkeys and caller-input-smoke-pass.

Non-interactive proof:

prose run tests/open-prose/smoke/02-caller-input.prose.md < /dev/null

Expected behavior:

Missing required caller inputs: topic.
Provide them with --topic, or run in an interactive terminal.

Explicit-input proof:

prose run tests/open-prose/smoke/02-caller-input.prose.md --topic monkeys

Expected behavior:

  • no startup prompt
  • harness receives the same completed command shape

Reviewer notes

The main review target is the new startup input resolver. It deliberately sits before harness invocation and after existing command validation, so invalid commands still fail before skill preflight or prompting.

The resolver returns updated argv tokens instead of manipulating the canonical prompt string. canonicalPrompt remains the validation and shell-quoting boundary.

Follow-ups

  • Decide whether VM root selection should consistently prefer runs/ over legacy .prose/runs/ for native repo runs.
  • Design mid-run human gate transport separately, using deterministic state/resume semantics rather than extending startup prompting.

rawwerks added 2 commits May 6, 2026 09:39
Read local Contract Markdown caller inputs before forwarding run commands so interactive terminals can supply missing values deterministically.

Preserve explicit CLI arguments and non-local targets, fail fast in non-TTY mode, and document/test the startup prompting behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant