Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions prompts/cli/workflow-replay.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ identity truncation. Distinct values must remain visibly distinct. Use JSON Unic
units outside printable ASCII, including invisible and bidi characters. Escape Markdown, HTML, controls and
path separators so outer body cleaning cannot collapse different paths or damage quoted URLs.
Escape pdd-workflow: and pdd-product: as in the runner's inert summary text; they cannot become ownership markers.
The Markdown, HTML and separator escaping is for the PR body only. With option `terminal` true, as in the
runner's command output, warnings keep the JSON form, the Unicode escapes and the inert markers, and show
paths and links as plain text (`tests/add.json` and `"https://example.com/a?x=1&y=2"`, not `tests/add.json`).
Missing is distinct from a literal string or null. The default report shows all warnings. Optional
maxCharacters is a display budget for the entire replay section: retain its status, counts and trust
boundary, show the longest prefix of whole warning items that fits, then name the exact omitted count
Expand Down Expand Up @@ -348,7 +351,7 @@ counts files and checks by source: `Anchor: 3 changed scenarios (40 checks) + 18
(1,722 checks).`, `Anchor: 0 changed scenarios (0 checks) + all 18 approved on base 6b58b76 (1,722 checks;
pdd.json sets replay.base_scenarios to "all").`, or `+ 0 linked approved on base 6b58b76 (NOTE).` Base approval
never gives PASS by itself.
`formatFormalEvidence(formal, rules?)` returns the formal line specified below on its own. It is the same formatter used by the replay section and by PRs without scenario replay; it reads no files and supplies no evidence of its own.
`formatFormalEvidence(formal, rules?, {terminal}?)` returns the formal line specified below on its own. It is the same formatter used by the replay section and by PRs or status output without scenario replay; it reads no files and supplies no evidence of its own.

formatReplayEvidence emits a compact PR section with prominent Code replay PASS/FAIL/BLOCKED/NOT REPLAYED,
exact counts, source and manifest hashes, current vector hashes labeled "Current vector", public execution totals, semantic control and typed
Expand All @@ -365,8 +368,10 @@ formal result. The formal line uses formalStatusText:
the not-recorded line. So one PR never says "not needed" while its code replay is blocked for the formal block.
Include: `Agents execute the tests and supply this record. pdd validates structure and identity;
it does not independently prove execution or prompt/code equivalence.` Keep details bounded and sanitize
control characters, private local paths and Try capabilities. Escape HTML and Markdown in displayed metadata
so JSON errors, vector paths, scopes or reasons cannot open comments/details or hide the report/trust boundary.
control characters, private local paths and Try capabilities, keeping `pdd-workflow:` and `pdd-product:` inert.
Escape HTML and Markdown in displayed metadata for PR bodies (default `terminal: false`)
so JSON errors, vector paths, adoption provenance, anchor notes, scopes or reasons cannot open comments/details or hide the report/trust boundary;
with `terminal` true in `formatReplayEvidence` and `formatFormalEvidence`, render sanitized metadata as plain text without Markdown backslash or HTML entity escaping.
Escape only when rendering, retaining the original structured values without double escaping.
Full evidence stays in the run folder. Never
let an agent's free-form PASS summary replace this status.
Expand All @@ -384,7 +389,7 @@ A present base `pdd.json` must be a regular readable blob within the 10 MiB read
```json
{
"status": "approved",
"prose_sha256": "1e33b05732de6ee39ded88d14250981f25af96387498a72f0d73550d05aee9ed",
"prose_sha256": "e5e2bb5b5be451831ea1125f608714a383059878f25c02120c83fcf3e78f0baf",
"entries": [
{
"operation": "adoptReplayCorpus",
Expand Down
6 changes: 3 additions & 3 deletions prompts/cli/workflow-runner.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ read or JSON parse names the exact repo-relative file and the cleaned parser/rea
For opted-in code steps, read and save the structured result as run.replayEvidence and on the step record;
show its status separately from free-form summaries. The result always holds the formal status, read on its own
(#3029); pass the run's `rulesToCheck` (readable facts below) as formatReplayEvidence option `rules` in the PR body
and in the `done` and publication output, so the formal line says "not needed" only when pdd read the run's Stories, none has Rules to check and no scenario vectors need the block. Revalidate after automatic commits immediately before
and in the `done` and publication output (with `terminal: true` in command output so saved-value warnings, current vector paths, anchor/adoption notes, and formal metadata render plain text and links while PR bodies retain separator and Markdown/HTML escaping), so the formal line says "not needed" only when pdd read the run's Stories, none has Rules to check and no scenario vectors need the block. Revalidate after automatic commits immediately before
publication, including retries and updates of an existing code PR. The canonical report goes above every
Prompt tests, prose PASS claim or verify.md and retains assertion/formal failure lines. Missing, stale or
malformed reports publish as BLOCKED/NOT REPLAYED, never PASS. Real assertion failures remain publishable;
Expand Down Expand Up @@ -1456,7 +1456,7 @@ same two records into `readable.facts.records.checklist` and `.formal`.
Auto-compact oversized checklist quote and evidence/exclusion cells via `checklistLimit` so the readable top and Details protected evidence both fit within the 60,000-character PR budget while keeping every checklist item and full request intact. If even maximally compacted quote/evidence cells leave less than 4,000 characters for evidence (for example, untouchable request text itself exceeds the budget), refuse publication with `workflow_pr_body_too_large` before pushing or writing a PR; never omit requests.
Status JSON includes `smallChange` from the last published readable facts, else
the latest step snapshot. Text status reports its checklist status and the same
formal result. Both detail and list status preserve this evidence. PR body,
formal result (formatted with `terminal: true` so scopes and reasons render without Markdown/HTML escaping). Both detail and list status preserve this evidence. PR body,
Proof, Summary and saved status must never infer an exemption from scope.md,
formal.md or a completed step. The formal block's not_applicable result, scope
and reason are the one exemption authority. This does not opt into scenario
Expand Down Expand Up @@ -1711,7 +1711,7 @@ Export recoverAutomaticRunOwner({ref,cwd,coordinatorId,machine},ports), with the
<details><summary>Runtime interface</summary>

```json
{"kind":"partial","status":"approved","prose_sha256":"2eaad06b3550fc907c13e36a6dd71d9c8ea2b17004588e3201f2f0409f18b97f","entries":[{"operation":"changeRun","input_schema":{"type":"object","properties":{"ref":{"type":"string"},"text":{"type":"string"},"cwd":{"type":"string"}},"required":["ref","text","cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exitCode":{"type":"integer"},"message":{"type":"string"}},"required":["exitCode","message"],"additionalProperties":false},"errors":[]},{"operation":"acknowledgeRequest","input_schema":{"type":"object","properties":{"requestId":{"type":"string"},"summary":{"type":"string"},"cwd":{"type":"string"}},"required":["requestId","summary","cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exitCode":{"type":"integer"},"message":{"type":"string"}},"required":["exitCode","message"],"additionalProperties":false},"errors":[]},{"operation":"storyCount","input_schema":{"type":"object","properties":{"root":{"type":"string"},"runtimeHistory":{"type":"array","items":{"type":"object","properties":{"summary":{"type":"string"},"at":{"type":"integer"},"source":{"type":"object","properties":{"kind":{"type":"string"},"sha256":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}}},"required":["kind","sha256"],"additionalProperties":false}},"required":["summary","at"],"additionalProperties":false}},"done":{"type":"object","properties":{},"required":[],"additionalProperties":false},"evidence":{"type":"array","items":{"type":"object","properties":{"summary":{"type":"string"},"at":{"type":"integer"},"source":{"type":"object","properties":{"kind":{"type":"string"},"sha256":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}}},"required":["kind","sha256"],"additionalProperties":false}},"required":["summary","at"],"additionalProperties":false}}},"required":["root","runtimeHistory","done","evidence"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"pass":{"type":"integer"},"total":{"type":"integer"},"failing":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}},"evidence":{"type":"string"}},"required":["pass","total","failing"],"additionalProperties":false},"errors":[]},{"operation":"runStatus","input_schema":{"type":"object","properties":{"ref":{"type":"string"},"cwd":{"type":"string"},"json":{"type":"boolean"},"all":{"type":"boolean"},"cancelled":{"type":"boolean"}},"required":["cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exitCode":{"type":"integer"},"message":{"type":"string"}},"required":["exitCode","message"],"additionalProperties":false},"errors":[]}],"calls":[],"resources":[{"name":"source","kind":"port","access":"read","operations":[{"name":"fingerprint","access":"read","arguments_schema":{"type":"object","properties":{"root":{"type":"string"}},"required":["root"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"value":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["value"],"additionalProperties":false}},{"name":"capture","access":"read","arguments_schema":{"type":"object","properties":{"root":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}},"appMap":{"type":"null"}},"required":["root","tests","appMap"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"sha256":{"type":"string"},"error":{"type":"string"}},"required":["sha256","error"],"additionalProperties":false}}]},{"name":"runs","kind":"port","access":"read","operations":[{"name":"resolveRun","access":"read","arguments_schema":{"type":"object","properties":{"ref":{"type":"string"},"cwd":{"type":"string"}},"required":["cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"json":{"type":"string"}},"required":["json"],"additionalProperties":false}}]},{"name":"files","kind":"port","access":"read","operations":[{"name":"readFileSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"content":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["content"],"additionalProperties":false}},{"name":"readdirSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"entries":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["entries"],"additionalProperties":false}},{"name":"realpathSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"path":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["path"],"additionalProperties":false}},{"name":"lstatSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"stat":{"oneOf":[{"type":"object","properties":{"isFile":{"type":"boolean"},"isDirectory":{"type":"boolean"},"size":{"type":"integer"}},"required":["isFile","isDirectory","size"],"additionalProperties":false},{"type":"null"}]}},"required":["stat"],"additionalProperties":false}},{"name":"existsSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exists":{"type":"boolean"}},"required":["exists"],"additionalProperties":false}}]},{"name":"program","kind":"port","access":"read","operations":[{"name":"execFile","access":"read","arguments_schema":{"type":"object","properties":{"file":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"cwd":{"type":"string"}},"required":["file","args","cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"stdout":{"type":"string"},"code":{"type":"integer"}},"required":["stdout","code"],"additionalProperties":false}}]},{"name":"results","kind":"port","access":"read","operations":[{"name":"readRunResults","access":"read","arguments_schema":{"type":"object","properties":{"root":{"type":"string"},"runDir":{"oneOf":[{"type":"string"},{"type":"null"}]},"runId":{"oneOf":[{"type":"string"},{"type":"null"}]},"since":{"type":"integer"},"baseBranch":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["root"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"json":{"type":"string"}},"required":["json"],"additionalProperties":false}}]}],"limits":{"max_steps":12,"max_model_calls":6},"conventions":[]}
{"kind":"partial","status":"approved","prose_sha256":"39fc288df1a4e3d6bd9801f08c9f2c49409877b77267098b8eee78a6e670f8b7","entries":[{"operation":"changeRun","input_schema":{"type":"object","properties":{"ref":{"type":"string"},"text":{"type":"string"},"cwd":{"type":"string"}},"required":["ref","text","cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exitCode":{"type":"integer"},"message":{"type":"string"}},"required":["exitCode","message"],"additionalProperties":false},"errors":[]},{"operation":"acknowledgeRequest","input_schema":{"type":"object","properties":{"requestId":{"type":"string"},"summary":{"type":"string"},"cwd":{"type":"string"}},"required":["requestId","summary","cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exitCode":{"type":"integer"},"message":{"type":"string"}},"required":["exitCode","message"],"additionalProperties":false},"errors":[]},{"operation":"storyCount","input_schema":{"type":"object","properties":{"root":{"type":"string"},"runtimeHistory":{"type":"array","items":{"type":"object","properties":{"summary":{"type":"string"},"at":{"type":"integer"},"source":{"type":"object","properties":{"kind":{"type":"string"},"sha256":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}}},"required":["kind","sha256"],"additionalProperties":false}},"required":["summary","at"],"additionalProperties":false}},"done":{"type":"object","properties":{},"required":[],"additionalProperties":false},"evidence":{"type":"array","items":{"type":"object","properties":{"summary":{"type":"string"},"at":{"type":"integer"},"source":{"type":"object","properties":{"kind":{"type":"string"},"sha256":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}}},"required":["kind","sha256"],"additionalProperties":false}},"required":["summary","at"],"additionalProperties":false}}},"required":["root","runtimeHistory","done","evidence"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"pass":{"type":"integer"},"total":{"type":"integer"},"failing":{"type":"array","items":{"type":"string"}},"unknown":{"type":"array","items":{"type":"string"}},"evidence":{"type":"string"}},"required":["pass","total","failing"],"additionalProperties":false},"errors":[]},{"operation":"runStatus","input_schema":{"type":"object","properties":{"ref":{"type":"string"},"cwd":{"type":"string"},"json":{"type":"boolean"},"all":{"type":"boolean"},"cancelled":{"type":"boolean"}},"required":["cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exitCode":{"type":"integer"},"message":{"type":"string"}},"required":["exitCode","message"],"additionalProperties":false},"errors":[]}],"calls":[],"resources":[{"name":"source","kind":"port","access":"read","operations":[{"name":"fingerprint","access":"read","arguments_schema":{"type":"object","properties":{"root":{"type":"string"}},"required":["root"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"value":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["value"],"additionalProperties":false}},{"name":"capture","access":"read","arguments_schema":{"type":"object","properties":{"root":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}},"appMap":{"type":"null"}},"required":["root","tests","appMap"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"sha256":{"type":"string"},"error":{"type":"string"}},"required":["sha256","error"],"additionalProperties":false}}]},{"name":"runs","kind":"port","access":"read","operations":[{"name":"resolveRun","access":"read","arguments_schema":{"type":"object","properties":{"ref":{"type":"string"},"cwd":{"type":"string"}},"required":["cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"json":{"type":"string"}},"required":["json"],"additionalProperties":false}}]},{"name":"files","kind":"port","access":"read","operations":[{"name":"readFileSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"content":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["content"],"additionalProperties":false}},{"name":"readdirSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"entries":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["entries"],"additionalProperties":false}},{"name":"realpathSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"path":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["path"],"additionalProperties":false}},{"name":"lstatSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"stat":{"oneOf":[{"type":"object","properties":{"isFile":{"type":"boolean"},"isDirectory":{"type":"boolean"},"size":{"type":"integer"}},"required":["isFile","isDirectory","size"],"additionalProperties":false},{"type":"null"}]}},"required":["stat"],"additionalProperties":false}},{"name":"existsSync","access":"read","arguments_schema":{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"exists":{"type":"boolean"}},"required":["exists"],"additionalProperties":false}}]},{"name":"program","kind":"port","access":"read","operations":[{"name":"execFile","access":"read","arguments_schema":{"type":"object","properties":{"file":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"cwd":{"type":"string"}},"required":["file","args","cwd"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"stdout":{"type":"string"},"code":{"type":"integer"}},"required":["stdout","code"],"additionalProperties":false}}]},{"name":"results","kind":"port","access":"read","operations":[{"name":"readRunResults","access":"read","arguments_schema":{"type":"object","properties":{"root":{"type":"string"},"runDir":{"oneOf":[{"type":"string"},{"type":"null"}]},"runId":{"oneOf":[{"type":"string"},{"type":"null"}]},"since":{"type":"integer"},"baseBranch":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["root"],"additionalProperties":false},"result_schema":{"type":"object","properties":{"json":{"type":"string"}},"required":["json"],"additionalProperties":false}}]}],"limits":{"max_steps":12,"max_model_calls":6},"conventions":[]}
```
</details>

Expand Down
Loading
Loading