PtcRunner.ReplFrontend (PtcRunner v0.14.0)

Copy Markdown View Source

Starts a direct workflow PTC-Lisp REPL or a fixed code-owned analysis profile.

ptc repl
ptc repl -e "(+ 1 2)" -e "(+ *1 3)"
ptc repl -l setup.clj
ptc repl script.clj
ptc repl -
ptc repl --manifest ptc.json
ptc repl --manifest ptc.json --host-config ptc-host.json
ptc repl --project ptc-project.json --mission review
ptc repl --manifest ptc.json --host-config ptc-host.json --mission review
ptc repl --manifest ptc.json --trace trace.jsonl
ptc repl --profile run-analysis-v1 --resource traces=tmp/traces
ptc repl --profile private-run-analysis-v1       --resource traces=tmp/traces       --resource inspection=tmp/inspection       --private-terminal
ptc repl --profile private-run-analysis-v1       --resource traces=tmp/traces       --resource inspection=tmp/inspection       --private-unattended --format jsonl -e '(analysis/runs {})'
ptc repl --describe-profile run-analysis-v1

Options:

  • -e, --eval — evaluate an expression; repeat to preserve definitions and *1/*2/*3 history;
  • -l, --load — evaluate a setup file before expressions or interaction;
  • -m, --manifest — reuse a strict Kernel manifest's workflow bundle, capabilities, limits, input, labels, and event policy;
  • --mission — evaluate one manifest mission directly, with only its components, data, direct capabilities, and provider dependency closure;
  • --host-config — manifest-only trusted provider installation document;
  • -t, --trace — append this session's canonical events to a JSONL file;
  • --profile — select a code-owned mission session profile;
  • --resource NAME=VALUE — supply a required profile resource; repeatable;
  • --session-trace-dir — existing output directory for a profile session's separate canonical trace;
  • --output / --private-output — atomically publish the value of exactly one non-interactive public/private profile evaluation;
  • --private-terminal — explicitly authorize an attached terminal as the private output sink required by private-run-analysis-v1;
  • --private-unattended — explicitly authorize this command's own streams as that sink instead, admitting -e/--load/script/stdin and --format jsonl. Mutually exclusive with --private-terminal;
  • --format clojure|jsonl — choose human output or non-interactive profile-mode JSON Lines;
  • --preview-chars COUNT — set the structural preview character ceiling for direct, manifest, and profile human output (64–65536; default 2048);
  • --continue-on-error — evaluate later repeated --eval forms after a recoverable profile evaluation error, then exit unsuccessfully;
  • --describe-profile — print a safe static profile contract;
  • -h, --help — print this help without loading files or providers.

A positional file runs as one script. - reads one script from standard input. With no script or --eval, the task starts an interactive multi-line REPL; :quit exits it. That line loop receives the same dedicated bounded session profile whether input is attached or piped. A lone --load is setup for the loop; repeated --eval, scripts, explicit - stdin, and loads that precede those inputs retain ordinary effective limits.

Direct interactive sessions widen only their session lifetime and retained normal-event capacity. Interactive manifest and mission sessions default omitted session-lifetime and retained-event limits to installed host ceilings while preserving explicit narrower values. Every session keeps one finite absolute deadline, including time spent at the prompt; its owner closes provider resources at expiry without waiting for another form.

An interactive workflow REPL attached to a terminal runs under the Erlang line editor, so emacs key bindings, arrow-key history, and reverse search work, Ctrl+D deletes forward rather than exiting, and Ctrl+C opens the BEAM break menu. A direct session persists its history under the user cache directory; a manifest session, which can carry a private event policy, keeps history in memory. Profile sessions and every non-terminal input path keep the plain reader, where Ctrl+D still ends input.

Direct sessions and manifest sessions without --mission evaluate the workflow environment. A manifest mission session evaluates a fresh serialized mission continuation and exposes no workflow or model route. Profile mode evaluates one serialized mission continuation over the exact resources declared by its closed profile. Its analysis trace is atomically published outside captured private resources; without --session-trace-dir, the task creates and reports a private temporary output directory.

JSONL mode is non-interactive and conditionally emits schema-version-1 session-started, evaluation, and successfully persisted session-closed records for lifecycle stages that are reached. An unsuccessful command ends with command-error; validation failures can therefore emit that record alone. Evaluation records contain the existing bounded public mission result projection and never add a raw source field. A failing command raises a closed frontend error; this shared module never halts the VM.

Summary

Functions

run(arguments, runtime)