goal-evidence-ledger
Maintain the append-only evidence ledger: `.flow/runs/<run-id>/evidence/*.evidence.yaml` sidecars plus matching `.txt` raw captures, written only via `bin/flow-record-evidence.sh`. Use when goal-evalu
Files1
View on GitHubSKILL.mdplugins/flow/skills/goal-evidence-ledger/SKILL.md
GitHubGoal Evidence Ledger
Contract
Iron law: no AC transitions to pass without a FlowEvidence sidecar whose proves: [<AC.id>] names it, and every non-trivial sidecar declares what it does NOT prove. Invoked by goal-evaluator (Step 2, once per verification command), by /flow:address (verification-evidence sidecars on the FlowRun), and by /flow:goal evaluate for judge reports. Inputs: evidence id, type, proves list, and optional command, exit code, raw-output path, limitations, negative cases. Returns the sidecar path, which the caller sets as the AC's evidence_ref. Permitted skips: limitations on holdout_validation and verdict types; the raw .txt when nothing was captured. The helper is never skipped.
Inputs
- Evidence id —
evidence-<AC.id>-<descriptor>-<turn>; lowercase, digits,_-. - Evidence type — one of
evidence.schema.json's enum: command_result, test_result, lint_result, typecheck_result, runtime_smoke_result, visual_result, git_diff, holdout_validation, verdict, human_approval, review_comment_snapshot, ci_status, llm_judge_report, artifact_check, path_boundary_check. - Proves — AC ids this evidence supports.
- Optional:
command,exit_code, raw output path,limitations,negative_cases.
Outputs
<runtime dir>/runs/<run-id>/evidence/<evidence-id>.evidence.yaml(<runtime dir>: whatbin/flow-runtime-dir.shprints) (schemaplugins/flow/schemas/v1/evidence.schema.json).<runtime dir>/runs/<run-id>/evidence/<evidence-id>.txt— raw stdout/stderr when captured, beside the sidecar. Both files are named from the id lower-cased, with any character other than a-z, 0-9,_and-made-; an id is at most 200 characters.- An
evidence-capturedjournal artifact. - One line appended to
<runtime dir>/runs/<run-id>/events.jsonl.
Workflow
Step 1: Compose
apiVersion: flow.synapti.ai/v1
kind: FlowEvidence
metadata:
id: <evidence-id>
goal: <goal-id>
run_id: <run-id>
activity_id: <activity-id, if any>
created_at: <ISO-8601 UTC>
evidence:
type: <enum-value>
command: <bash command, if applicable>
exit_code: <captured, if command type>
# output_ref: leave it out; with --raw-output, flow-record-evidence.sh sets it to the copy's name, relative to this sidecar's directory (evidence-ac1-test.txt for the id evidence-ac1-test)
proves:
- <AC.id>
limitations:
- <what this evidence does NOT prove>
negative_cases:
- <adversarial or boundary cases exercised>
Step 2: Negative space
| Evidence type | Required |
|---|---|
command_result, test_result, lint_result, visual_result, llm_judge_report |
limitations |
runtime_smoke_result |
limitations + negative_cases |
holdout_validation, verdict |
none — the verdict format owns its negative space |
The schema rejects a command_result without limitations at write time.
Step 3: Write
bin/flow-record-evidence.sh --run-id <run-id> --evidence-file <composed.yaml> [--raw-output <stdout-capture>]
The helper writes atomically and copies the raw output beside the sidecar; it refuses symlinked targets, a sidecar whose output_ref names another file, and an id already recorded (a correction is a new id). What it guarantees: references/goal-evidence-ledger.md. Surface any non-zero exit with its stderr: exit 1 is the arguments or the evidence (fix them and record again), exit 2 the repository, the run, an existing record or the system (too many open files, an I/O error).
Step 4: Journal
bin/journal-record.sh --issue {N} --type evidence-captured --metadata evidence_id=<id> --metadata goal_id=<goal-id> --metadata proves=<comma-list of AC ids>
With no linked issue, pass --session in place of --issue {N}.
Step 5: Link
The caller updates the AC in <runtime dir>/goals/<id>.goal.yaml: status: evidence_collected, evidence_ref: <runtime dir>/runs/<run-id>/evidence/<evidence-id>.evidence.yaml, last_evaluated_at: <now>.
Rules
- Evidence is append-only: a correction is a new sidecar (
evidence-AC1-retest-turn2) and the AC'sevidence_refmoves to it; the old sidecar stays as audit trail. - One run proving two ACs is one sidecar with
proves: [AC1, AC2]. - Capture evidence before the verdict; never after the goal is
achieved. - Never write a sidecar with
echo >; the helper is the only writer.