teleo-infrastructure/docs/reports/leo-working-state-20260709/governance-concept-postflight.sql
twentyOne2x 394a14660d
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add governance concept schema packet
- Create guarded schema and links for governance gates and concept maps
- Prove clone apply and rollback while production schema stays unchanged
- Retain packet docs, state image, and focused tests for apply review

`docs/reports/leo-working-state-20260709/current-truth-index.md`
`docs/reports/leo-working-state-20260709/governance-concept-apply-authorized-commit.sql`
`docs/reports/leo-working-state-20260709/governance-concept-apply-rollback-rehearsal.sql`
`docs/reports/leo-working-state-20260709/governance-concept-clone-rehearsal-current.log`
`docs/reports/leo-working-state-20260709/governance-concept-current.md`
`docs/reports/leo-working-state-20260709/governance-concept-delete-rollback.sql`
`docs/reports/leo-working-state-20260709/governance-concept-packet.json`
`docs/reports/leo-working-state-20260709/governance-concept-postflight.sql`
`docs/reports/leo-working-state-20260709/governance-concept-preflight.sql`
`docs/reports/leo-working-state-20260709/leo-db-state-24-governance-concept-schema.svg`
`docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md`
`scripts/kb_governance_concept_packet.py`
`tests/test_kb_governance_concept_packet.py`
2026-07-10 00:17:38 +02:00

39 lines
1.4 KiB
SQL

\set ON_ERROR_STOP on
-- Governance/concept companion postflight row-level readback.
select
(select count(*) from public.concept_maps where id = 'f013126c-0937-5bc8-b021-9697e59057d0'::uuid) as generated_concept_map_rows,
(select count(*) from public.claim_concept_map_links where id = 'af4ce1b9-db03-5bde-a21b-0e16ca0f48b8'::uuid) as generated_concept_link_rows,
(select count(*) from public.claim_governance_gate_links where id in (select id from (values
('1f81e105-af5e-5db8-a7be-08cc6cc4e13a'::uuid),
('af04a87e-c1da-57e9-b11c-60d79daa5648'::uuid)
) as v(id))) as generated_governance_link_rows;
select id::text, key, title, status, source_ref, metadata::text
from public.concept_maps
where id = 'f013126c-0937-5bc8-b021-9697e59057d0'::uuid;
select id::text,
claim_id::text,
concept_map_id::text,
relation,
weight,
left(rationale, 220) as rationale,
source_ref
from public.claim_concept_map_links
where id = 'af4ce1b9-db03-5bde-a21b-0e16ca0f48b8'::uuid;
select id::text,
claim_id::text,
governance_gate_id::text,
relation,
weight,
left(rationale, 220) as rationale,
source_ref
from public.claim_governance_gate_links
where id in (select id from (values
('1f81e105-af5e-5db8-a7be-08cc6cc4e13a'::uuid),
('af04a87e-c1da-57e9-b11c-60d79daa5648'::uuid)
) as v(id))
order by governance_gate_id;