Date: 2026-07-23
Branch: codex/data-rule-execution-m3a-m5
Lifecycle boundary: Task 6 consumes only plans already marked published.
It does not add, relax, or emulate the Task 7 publication gate.
Task 6 now provides a production-wired path from a signed Runner task to one
server-attested rule_runs record, optional durable violation evidence, and a
closed artifact-only handoff to the next node.
The implementation includes:
PostgresRuleEvidenceWriter with canonical deployment, component, rule
version, plan hash, DataFlow, workflow version, node, and correlation
attestation;running to success, failed, unknown, or cancelled
finalization with row counts, timings, commit outcome, and bounded public
result;pending to verified MinIO upload to ready sample state machine with
digest, schema hash, reference, expiry, and bounded TTL cleanup;input_artifact and multi-predecessor named
input_artifacts expressions, with governed rule nodes receiving no
unrelated workflow parameters;output_artifact field matching the Kestra expression
contract while retaining the full bounded result object.Migration 20260723_160 extends the existing evidence tables without changing
historical migrations 110, 140, or 150.
rule_runs gains:
evidence_key with a unique constraint;commit_outcome;public_result;failure_code and updated_at.rule_violation_samples gains:
legacy, pending, ready, and failed handoff states;Downgrade is deliberately rejected because deleting execution evidence would break audit and replay guarantees.
The local Docker PostgreSQL was upgraded through the formal
20260723_150 -> 20260723_160 Alembic path. The existing isolated old-140
migration acceptance also passes through current head.
The initial fail-first slice produced five expected failures:
RulePlanExecutor did not accept
an evidence writer;A second fail-first assertion proved that the Polars adapter did not expose a bounded violation sample before the worker implementation was added.
Final verification:
27 passed;586 passed, 26 skipped, 59 subtests passed;All checks passed!;git diff --check: passed;The production-path integration uses:
PostgresRulePlanRepository;PostgresArtifactResolver;PostgresRuleEvidenceWriter;RulePlanExecutor;It proves:
output_artifact reference and publishes a distinct output;failed/not_committed;unknown/unknown;Task 6 deliberately does not decide whether a compiled plan may become published. Task 7 must require trusted generation, test, and preflight evidence before changing plan lifecycle state. The evidence added here is the immutable input to that gate, not a bypass around it.