This specification assumes the agent has ONLY the contents of this repository.
Produce a runnable MVP that:
- Loads and validates a PDL v5.1 YAML design
- Executes intents (series of related prompts)
- Supports sequential + parallel intent chaining via
next - Exposes:
- CLI commands (run/serve/validate/models)
- Server API (runs lifecycle)
- Logs accessible by REST and streamable by WebSocket
- HTML preview UI that renders intents and can run them
- Keep files concise and executable.
- Prefer clarity over abstraction.
- Maintain backward compatibility with PDL v5.1 schema.
- After every change, run:
python scripts/validate_spec.py specs/app.mock.yamlpython scripts/smoke_test.pypython scripts/smoke_server.py(if network ports allowed)python -m unittest -q
pdl/
__init__.py
__main__.py
cli.py
server.py
core/
__init__.py
loader.py
schema.py
model_adapter.py
engine.py
run_manager.py
logging/
__init__.py
logstore.py
web/
templates/preview.html
static/{preview.js,preview.css}
schema/
pdl_v5_1.schema.yaml
specs/{app.yaml,app.mock.yaml}
docs/{supported_models.md,validation_checklist.md}
scripts/{validate_spec.py,smoke_test.py,smoke_server.py,make_zip.py}
tests/test_engine_basic.py
- JSON Schema validation via jsonschema
- Uniqueness of intent ids
nextreferences must exist
mock: deterministic, always availableollama: POST /api/generate, stream:false, GET /api/tagsopenai: POST /v1/responses (Responses API), GET /modelscustom: model.interface.{endpoint, headers, request_template, response_path}
- entry_intent defaults to intents[0].id
- Sequential:
nextstring → run next intent with updated context - Parallel:
nextlist → asyncio.gather, merge outputs - Log every intent begin/end, each prompt step, model response (truncated)
- Per-run log list (REST callable)
- Queue subscriptions (WebSocket streamable)
- Sentinel:
[RUN][DONE]ends the stream
- POST /runs → background task, returns run_id
- GET /runs/{run_id} → status/result polling
- WS /runs/{run_id}/logs/stream → live log streaming
- GET /preview → Jinja2 HTML preview
- validate / run / serve / models
- Restate the requested change as a single sentence.
- Update schema + mock spec first.
- Implement minimal code changes.
- Run: validate → smoke_test → unittest → smoke_server.
- Update docs if behavior changed.
- Confirm mock mode still works without external dependencies.