Files
the-custodian/workplans/CUST-WP-0008-consistency-engine.md
tegwick 44c19c422f feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.

MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all

Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
  CUST-WP-0006 and CUST-WP-0007 task blocks

Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00

2.3 KiB

id, type, title, domain, status, owner, topic_slug, repo_slug, created, updated, state_hub_workstream_id
id type title domain status owner topic_slug repo_slug created updated state_hub_workstream_id
CUST-WP-0008 workplan Consistency Checking Engine custodian active custodian the-custodian the-custodian 2026-03-03 2026-03-03 78891e58-2889-43d7-9c1a-d7637990dc82

CUST-WP-0008 — Consistency Checking Engine

Implements a bidirectional ADR-001 consistency checker between workplan files in registered repos and the state-hub DB. The file is always authoritative; the DB is the cache/index layer.

Checks C-01 through C-12 cover: missing workplans/, parse failures, stale references, status/title drift, unlinked workplans, orphan DB workstreams, repo mismatches, task drift, and orphan DB tasks.

The --fix flag applies auto-fixable issues (C-04, C-05, C-06, C-09, C-10, C-11).


Task T01: Implement consistency_check.py

id: CUST-WP-0008-T01
status: done
priority: critical
assignee: custodian
state_hub_task_id: "a18c2389-ee98-40e9-a392-b5ff3deab838"

Core engine + CLI at state-hub/scripts/consistency_check.py.

  • Checks C-01 through C-12
  • --repo SLUG or --all mode
  • --fix applies auto-fixable issues
  • --json machine-readable output
  • Exit codes: 0=ok, 1=fail, 2=warn-only

Task T02: Add MCP tool check_repo_consistency

id: CUST-WP-0008-T02
status: done
priority: high
assignee: custodian
state_hub_task_id: "90b626e5-3f0c-47ba-be32-e57e1132563a"

Add check_repo_consistency(repo_slug, fix=False) tool to state-hub/mcp_server/server.py following the validate_repo_adr pattern.

Task T03: Add Makefile targets

id: CUST-WP-0008-T03
status: done
priority: medium
assignee: custodian
state_hub_task_id: "151ba804-9938-4734-a49c-20bcd7c0b10b"

Add check-consistency, fix-consistency, check-consistency-all, fix-consistency-all targets to state-hub/Makefile.

Task T04: Run dry-run and apply auto-fixes

id: CUST-WP-0008-T04
status: done
priority: high
assignee: custodian
state_hub_task_id: "ad2a697e-6eb4-4ccf-8c76-82984e354571"
  1. Run check-consistency-all to verify findings match expected issues
  2. Run fix-consistency-all to apply C-09 repo remaps and C-04 status drift fix
  3. Verify activity-core-foundation and activity-core-triggers-ops repo_id updated
  4. Verify railiance-bootstrap phase-0-operational-baseline status updated