PromptRunner.Verifier.Doc (PromptRunnerSDK v0.9.0)

Copy Markdown View Source

The doc: verify clause: an artifact-quality gate for written deliverables.

files_exist is satisfied by a three-line stub, so a prompt whose deliverable is a document has no deterministic way to assert the document was actually written. doc: asserts substance instead of presence:

verify:
  doc:
    - path: "docs/report.md"
      min_lines: 100
      requires_sections: ["## Method", "## Verdict"]
      forbids_markers: ["TODO", "TBD", "FIXME"]
  • min_lines counts non-blank lines and defaults to 1, so a bare doc: ["docs/report.md"] still rejects an empty file.
  • requires_sections matches verbatim substrings, so heading level and wording are both asserted.
  • forbids_markers defaults to ["TODO", "TBD", "FIXME", "XXX"]. An explicit empty list disables the check; a custom list replaces the default rather than extending it.

Entries are repo-scoped exactly like every other clause, either with a repo: key or through the prompt's default repository.

Summary

Functions

Returns the default forbidden marker set applied when forbids_markers is omitted.

Returns the effective non-blank line floor for an entry.

Builds the verifier report item for one doc: entry.

Functions

default_markers()

@spec default_markers() :: [String.t()]

Returns the default forbidden marker set applied when forbids_markers is omitted.

min_lines(entry)

@spec min_lines(term()) :: non_neg_integer()

Returns the effective non-blank line floor for an entry.

report(resolved, entry)

@spec report(map(), term()) :: map()

Builds the verifier report item for one doc: entry.

resolved is the repo-scoped %{repo:, path:, resolved_path:} map produced by the verifier's shared entry resolution.