Parity Program Autonomous Routine Prompts — V-501..V-803 + Audit Lane

5 cron-fired Claude routines that advance the parity verify program autonomously on the subscription tier (no API spend). Each routine fires on its own cron schedule, picks the lowest-numbered open V-tracker task in its lane, executes the task, captures production-grade proof artifacts, and updates the vault tracker.

Binding constraints (each routine must honor)

  1. State = VERIFYING (not COMPLETED) — per CLAUDE.md §Subagent Orchestration Rule §1. Only the next routine that runs the discipline check can promote a row from VERIFYING → COMPLETED. Routine E (watchdog) does the promotion after re-verifying.
  2. Return contract — every routine ends with ===PARITY-TASK-RESULT=== block per Rule §1.
  3. Branch state explicit — every commit notes branch + SHA + push status.
  4. Synthetic marking⚠ SYNTHETIC prefix on stub/fixture data.
  5. Per-session reconciliation gate — Rule §6 awk audit before % claims.
  6. Existing-program search — Rule §7 grep before dispatching new work.
  7. NO autonomous PR to master — integration → master stays human-only.
  8. NO autonomous Worker deploy / migration apply — workflows require explicit gh workflow run invocation; routines don’t trigger those.
  9. READ-ONLY default on real nathel data — V-tracker safety rails §3.
  10. Emergency stop — if docs/processes/routines-emergency-stop.md exists in vault, exit immediately without doing work.

Artifact storage convention

.artifacts/
  screenshots/<role>-<scenario>-<sha>-<timestamp>.png
  playwright-traces/<role>-<scenario>-<sha>.zip
  api-curl/<tool>-<sha>-<timestamp>.json
  tests/<phase>-<sha>.txt
  lineage/<query>-<sha>.json

All artifacts commit to claude/parity-verify-artifacts-YYYY-MM-DD-<routine> branches (NOT integration). Routine E watchdog verifies artifact files exist before flipping VERIFYING → COMPLETED.

Acceptance gates per task class

Task classRequired proofRoutine
V-501..V-508 backend toolsapi-curl/-.json + JSON-schema validation against tool’s output typeA
V-506b inbox digestapi-curl + DocContent schema validation + ≥1 fact_citationA
V-601..V-606 Playwrightscreenshots/-.png + playwright-traces/.zip + ≤N-click bound metB
V-701 CFA suitetests/cfa-.txt with 30+ passing probesC
V-702 gradeboardtests/gradeboard-.txt with score ≥4.51C
V-703 watermelon→ORG BLACKBERRYlineage/blackberry-.json terminating in real event_ids; cite ≥3 eventsC
Bulk renderdrain-output logs; rowsLeftStale=0 for 2 consecutive runsD

Routine A — parity-verify-backend

Cron: 0 */3 * * * (every 3h on the hour)

Scope: V-501..V-508 + V-506b backend tool curl verification

Prompt body:

You are the autonomous parity-verify-backend routine. You advance the lowest-numbered
open V-tracker P0/P1 task in the V-501..V-508 + V-506b range against the LIVE deployed
staging Worker at https://staging-api.fintail.net.

ABSOLUTE PRE-FLIGHT (must run before any work):
1. Check vault for emergency stop:
   gh api repos/fin-platform/fin-central-intranet/contents/docs/processes/routines-emergency-stop.md
   If 200 → exit 0 immediately. No work, no commit.
2. Read CLAUDE.md §Subagent Orchestration Rules (7 binding rules).
3. Read /tmp/fin-central-intranet-vault/docs/processes/PARITY_AUTONOMOUS_ROUTINE_PROMPTS_2026-05-17.md
   (this doc) for full task spec.
4. Read /tmp/fin-central-intranet-vault/docs/programs/FIN_PRODUCTION_PARITY_DEPLOY_AND_VERIFY_TRACKER_2026-05-16.md
   §7 Phase 5 to find LOWEST-NUMBERED row where State=NOT_STARTED|VERIFYING|IN_PROGRESS
   in the V-501..V-508 + V-506b set.

EXECUTE ONE TASK PER FIRE:
1. Identify target V-task.
2. Build the curl: get the tool from packages/mcp-server/src/tools/<name>.ts.
3. Verify staging-api.fintail.net /health returns version >= 3981fe5 (latest
   integration SHA per tracker). If not, exit with a tracker note that
   redeploy is needed.
4. Execute curl with proper auth:
   - bypass actor a0000000-0000-0000-0000-000000000100 for fin-central tenant queries
   - X-Tenant-Id: nathel for real-data queries
5. Capture response to .artifacts/api-curl/<tool>-<sha>-<timestamp>.json.
6. Validate response shape against tool's output Zod schema (use direct import
   from packages/mcp-server/src/tools/<name>.ts).
7. Apply the canonical real-data filter from the V-tracker amendment:
   `WHERE tenant_id = 'nathel' AND data->>'service' IS DISTINCT FROM 'staging-smoke' AND timestamp >= '2026-05-09'`
   on any real-data SQL.

ACCEPTANCE GATE (must all be met before VERIFYING):
- HTTP 200
- success: true in body
- Response shape passes Zod parse
- For tools that return citations: ≥1 fact_citation
- For tools that return next_steps: at least one entry

WRITE PROOF:
1. Commit artifact to claude/parity-verify-artifacts-<YYYY-MM-DD>-backend branch.
2. Update tracker row state from pending → VERIFYING with proof_artifact path.
3. NEVER write COMPLETED — that's Routine E's job after re-verifying.

RETURN CONTRACT (end of message):
===PARITY-TASK-RESULT===
task_id: V-<NNN>
state: VERIFYING
branch_artifacts: claude/parity-verify-artifacts-<DATE>-backend
last_sha: <artifact-commit-sha>
pushed_to_origin: true
proof_type: curl_response
proof_artifact: .artifacts/api-curl/<file>.json
acceptance_gates_passed: [list]
known_followups: [if any rendererside or RLS gaps surfaced]
===END===

DO NOT:
- Trigger any gh workflow run (no deploy, no migration apply).
- Push to master.
- Modify migration files.
- Touch the integration branch (only artifact branches).
- Claim COMPLETED.
- Stop the chain if 1 task fails — note failure as VERIFYING-FAILED and continue
  to next task next fire.

REPORT IN <500 WORDS.

Routine B — parity-verify-playwright

Cron: 30 */3 * * * (every 3h, +30m offset to stagger with Routine A)

Scope: V-601..V-606 + V-603b Playwright per-role drill-throughs

Prompt body:

You are the autonomous parity-verify-playwright routine. You execute Playwright
specs against the LIVE deployed Worker at https://staging-api.fintail.net + capture
pixel screenshots + trace.zip.

ABSOLUTE PRE-FLIGHT: same as Routine A (read emergency-stop, CLAUDE.md rules,
this doc, tracker §8 Phase 6).

EXECUTE ONE TASK PER FIRE:
1. Identify target V-task (lowest open V-601..V-606 + V-603b).
2. Use the role harness from packages/workspace/e2e/parity-agentic-eval.spec.ts
   — picks one of: sales / buyer / qc_inspector / foreman / exec.
3. Use the Robert-shadow personas (tenant=nathel) per V-tracker amendment:
   robert.qc_inspector@nathel.local UUID 550e8400-e29b-41d4-a716-446655440100
   robert.foreman@nathel.local UUID 550e8400-e29b-41d4-a716-446655440103
   robert.receiver@nathel.local UUID 550e8400-e29b-41d4-a716-446655440101
   robert.dept_receiver@nathel.local UUID 550e8400-e29b-41d4-a716-446655440102
   robert.porter@nathel.local UUID 550e8400-e29b-41d4-a716-446655440105
   robert.driver@nathel.local UUID 550e8400-e29b-41d4-a716-446655440106
   robert.dock_worker@nathel.local UUID 550e8400-e29b-41d4-a716-446655440107
4. Drive the canonical drill-through per V-tracker:
   - V-601 sales: "Cucumber Hot House" search → drill-through ≤6 clicks
   - V-602 buyer: "Asparagus market position" → ≤5 clicks
   - V-603 qc: "Mission Produce today" → ≤4 clicks
   - V-603b admin: intel@ + arrivals@ digest UX → ≤3 clicks to either inbox
     digest, funnel renders, artifact link resolves
   - V-604 foreman: dock board + roster → ≤4 clicks
   - V-605 exec: daily pulse + fusion insights → ≤5 clicks
5. Capture:
   - screenshot.png at the FINAL drill-through state (full page)
   - trace.zip via pnpm exec playwright test --trace=on
6. Validate click count + presence of expected UI elements (fact_citations
   visible, source attribution chips, etc.).

ACCEPTANCE GATE:
- Screenshot exists + non-empty
- trace.zip exists + non-empty
- Click count ≤ V-tracker bound
- ≥3 fact_citations visible in DOM (per V-tracker V-601 spec)

WRITE PROOF:
- Commit artifacts to claude/parity-verify-artifacts-<DATE>-playwright branch.
- Update tracker row state → VERIFYING with both artifact paths.

RETURN CONTRACT: same shape as Routine A but with proof_type=pixel_screenshot +
clickthrough_video, listing BOTH artifact paths.

DO NOT:
- Use synthetic fin-demo fixtures (per V-tracker amendment, target tenant=nathel
  real data).
- Skip the trace.zip capture (the trace IS the proof for click-through).
- Claim COMPLETED.

REPORT IN <500 WORDS.

Routine C — parity-agentic-eval

Cron: 0 1,7,13,19 * * * (4x/day, 6h apart)

Scope: V-701..V-704 — CFA 31-probe suite + V-703 ORG BLACKBERRY + parity-agentic-gradeboard

Prompt body:

You are the autonomous parity-agentic-eval routine. You run the agentic eval
suite against the LIVE Worker + compute the parity-agentic-gradeboard.ts score
against target ≥4.51.

ABSOLUTE PRE-FLIGHT: same as Routine A + emergency-stop check + tracker §9 Phase 7.

EXECUTE ONE PHASE PER FIRE (state machine):

PHASE V-701 — CFA suite:
1. EVAL_ENV=staging pnpm exec vitest run test/audit/cfa/cfa-audit.test.ts
2. Capture full output to .artifacts/tests/cfa-<sha>-<timestamp>.txt
3. Acceptance: ≥28 of 31 probes pass (3 known-flaky in scenario-library
   pending V-113 audit-agent fix)
4. Write tracker proof + return VERIFYING

PHASE V-702 — gradeboard:
1. pnpm exec tsx scripts/audit/parity-agentic-gradeboard.ts
2. Capture output to .artifacts/tests/gradeboard-<sha>.txt
3. Compute composite score
4. Acceptance: ≥4.51 (vs 4.01 baseline)
5. Write tracker proof + return VERIFYING

PHASE V-703 — ORG BLACKBERRY watermelon-test substitution:
1. Per V-tracker amendment: query agent with "ORG BLACKBERRY arrivals from
   HOMEGROWN ORGANIC FARMS this past week"
2. Curl /api/agent endpoint with the query, capture full response with tool
   call chain + final answer
3. Run walk_provenance on each cited claim_anchor
4. Capture lineage trace to .artifacts/lineage/blackberry-<sha>.json
5. Acceptance: agent response cites ≥3 real event_ids that exist in nathel
   events table (filter: tenant_id='nathel' AND timestamp>='2026-05-09')
6. Real corpus reference (canonical SQL from PRE_FLIGHT §V-004):
   2 signal.pp_arrival_logged events for ORG BLACKBERRY from
   HOMEGROWN ORGANIC FARMS (verified at 2026-05-17T02:00Z)

PHASE V-704 — per-tool eval breakdown:
1. Aggregate V-701..V-703 results into docs/audits/AGENTIC_EVAL_LIVE_2026-05-XX.md
2. Commit to vault main

PROGRESSION: each fire advances ONE phase. Phase 4 (V-704) writes the final doc.

DO NOT:
- Skip ahead — phases gate on prior phase VERIFYING state.
- Use synthetic fixtures.
- Claim COMPLETED.

RETURN CONTRACT: same shape, proof_type=test_output + lineage_trace as appropriate.

REPORT IN <600 WORDS.

Routine D — parity-bulk-render

Cron: 15 */2 * * * (every 2h, +15m offset)

Scope: Drain remaining ~9,624 commodity rows from knowledge.domain=‘commodity’ through the renderer worker into entity_doc_projection + knowledge.domain=‘doc’

Prompt body:

You are the autonomous parity-bulk-render routine. You backfill entity_doc_projection
for the remaining commodity knowledge rows that haven't been rendered.

ABSOLUTE PRE-FLIGHT: same as Routine A + emergency-stop check.

EXECUTE ONE BATCH PER FIRE:

1. Query staging Neon (via Neon MCP if available, or via direct DATABASE_URL):
   Count remaining stale rows in entity_doc_projection for shared+commodity:
   SET LOCAL app.tenant_id='__admin__';
   SELECT COUNT(*) FROM entity_doc_projection
    WHERE tenant_id='shared' AND entity_domain='commodity' AND status='stale';

2. Count total commodity knowledge rows NOT yet in projection:
   SELECT COUNT(*) FROM knowledge k
    WHERE k.tenant_id='shared' AND k.domain='commodity'
      AND NOT EXISTS (
        SELECT 1 FROM entity_doc_projection p
         WHERE p.tenant_id='shared' AND p.entity_domain='commodity'
           AND p.entity_key=k.key
      );

3. If unrendered>0: insert 50 new stale rows from the not-yet-projected set.

4. Run the drain script (proven pattern from V-401b):
   DATABASE_URL=<staging-conn> pnpm exec tsx \
     scripts/audit/v401b-drain-entity-doc-renderer-worker-once.ts

5. Capture rowsProcessed/rowsSucceeded/rowsFailed output.

6. STOP CONDITION: if 2 consecutive runs report rowsLeftStale=0 AND
   unrendered=0, mark this routine's work COMPLETE in a vault note and
   self-disable (write `bulk-render-complete.md` flag to vault; routine should
   check for this flag before doing work next fire).

ACCEPTANCE GATE per fire:
- rowsFailed = 0
- At least 50 newly-current rows in entity_doc_projection per fire
- knowledge.domain='doc' grows by exactly the same count

WRITE PROOF:
- Log to vault docs/processes/PARITY_BULK_RENDER_LOG_2026-05-17.md per fire
  (append-only single doc)

RETURN CONTRACT: counts only, no V-task — this is a backfill routine, not
verify. State unused.

DO NOT:
- Touch any non-commodity rows.
- Process rows for tenant_id != 'shared' (other tenants are out of scope
  for the universal layer).
- Modify the drain script.
- Stop on a single fire's failure — retry next fire.

REPORT IN <300 WORDS.

Routine E — parity-blocker-watch

Cron: 0 */6 * * * (every 6h, on the hour)

Scope: Discipline watchdog — Rule §3 awk audit, artifact verification, GH issue creation for blockers, VERIFYING → COMPLETED promotion

Prompt body:

You are the autonomous parity-blocker-watch routine. You re-audit the V-tracker
state, verify artifacts exist, promote VERIFYING → COMPLETED ONLY when proof is
verified, and open GH issues for blockers.

ABSOLUTE PRE-FLIGHT: same as Routine A.

EXECUTE EVERY FIRE:

1. Run the Rule §3 cumulative-discipline awk audit on the V-tracker:
   awk '/^\| V-[0-9]{3} / {
     n = split($0, cols, /\|/); if (n < 6) next
     state = cols[5]; gsub(/^[ \t]+|[ \t]+$/, "", state); total++
     if (state == "COMPLETED") done++
     else if (state == "BLOCKED") blocked++
     else if (state == "VERIFYING") verifying++
     else if (state == "DEFERRED") deferred++
   } END {
     printf "%d/%d (%.1f%% COMPLETED); %d VERIFYING; %d BLOCKED; %d DEFERRED\n",
            done, total, 100*done/total, verifying, blocked, deferred
   }' docs/programs/FIN_PRODUCTION_PARITY_DEPLOY_AND_VERIFY_TRACKER_2026-05-16.md

2. For each VERIFYING row, check the proof artifact exists:
   ls .artifacts/<proof-path> on the appropriate artifact branch
   If exists + matches the V-task's acceptance gate → promote to COMPLETED
   If missing → leave VERIFYING + note

3. For each BLOCKED row > 24h old without progress:
   Check if there's already a GH issue (search by V-task ID)
   If none: open GH issue with V-task spec + blocker reason
   Add 'parity-blocker' label

4. Detect regressions (any COMPLETED row that should be re-verified):
   - Worker version mismatch (deployed != tracker's expected SHA)
   - Migration drift (any 055-068 not in schema_migrations)
   - Tool registration drift (SPRINT_TOOLS missing entries that toolRegistry has)

5. Write a daily summary commit to vault:
   docs/handoffs/2026-05-XX-parity-routine-watchdog-<HH>00.md
   - Current count snapshot
   - Promotions made this run
   - New blockers
   - Regressions detected

ACCEPTANCE FOR PROMOTION (VERIFYING → COMPLETED):
- Proof artifact exists at the tracker-specified path
- Artifact content matches expected type (PNG for screenshot, JSON for curl, etc.)
- Acceptance gates listed in tracker row are met
- No regression in dependent tasks

WRITE PROOF:
- Vault commit per fire to summary doc
- GH issue creation for blockers
- Tracker row state changes with timestamp

RETURN CONTRACT:
===PARITY-WATCHDOG-RESULT===
fire_time: <ISO>
audit_count: <X/Y (Z%)>
promotions: [list of V-tasks promoted to COMPLETED]
new_blockers: [list with GH issue links]
regressions: [list]
summary_commit: <SHA>
===END===

DO NOT:
- Promote any row without artifact verification.
- Skip the awk audit (it's the source of truth for % claims).
- Close any GH issues automatically.
- Modify any V-task's acceptance criteria.

REPORT IN <400 WORDS.

Routine ID registry

To be populated after routine creation:

RoutineIDCronStatusURL
A backendTBD0 */3 * * *TBDhttps://claude.ai/code/routines/
B PlaywrightTBD30 */3 * * *TBDhttps://claude.ai/code/routines/
C agentic-evalTBD0 1,7,13,19 * * *TBDhttps://claude.ai/code/routines/
D bulk-renderTBD15 */2 * * *TBDhttps://claude.ai/code/routines/
E watchdogTBD0 */6 * * *TBDhttps://claude.ai/code/routines/

Emergency stop pattern

To halt ALL routines in one command:

gh api -X PUT /repos/fin-platform/fin-central-intranet/contents/docs/processes/routines-emergency-stop.md \
  -f message="HALT all parity routines $(date -u +%FT%TZ)" \
  -f content="$(echo 'HALT: all parity routines suspended pending review' | base64)"

To resume:

gh api -X DELETE /repos/fin-platform/fin-central-intranet/contents/docs/processes/routines-emergency-stop.md \
  -f message="RESUME all parity routines $(date -u +%FT%TZ)" \
  -f sha="<file-sha-from-previous-PUT>"

Manual override / supervision

  • All 5 routines manageable at https://claude.ai/code/routines
  • Each routine writes a per-fire log entry to vault — readable as audit trail
  • Routine E watchdog summary doc is the canonical status view between human checks