teleo-infrastructure/docs/reports/leo-working-state-20260709/rio-strategy-postflight.sql
twentyOne2x b508a1106b
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add Rio strategy context packet
- Create guarded Rio strategy nodes and anchors after the mapped base packet
- Prove clone apply and rollback while production rows and Leo runtime stay unchanged
- Retain packet docs, state image, and focused tests for future apply review

`docs/reports/leo-working-state-20260709/current-truth-index.md`
`docs/reports/leo-working-state-20260709/leo-db-state-23-rio-strategy-context.svg`
`docs/reports/leo-working-state-20260709/rio-strategy-apply-authorized-commit.sql`
`docs/reports/leo-working-state-20260709/rio-strategy-apply-rollback-rehearsal.sql`
`docs/reports/leo-working-state-20260709/rio-strategy-clone-rehearsal-current.log`
`docs/reports/leo-working-state-20260709/rio-strategy-context-current.md`
`docs/reports/leo-working-state-20260709/rio-strategy-delete-rollback.sql`
`docs/reports/leo-working-state-20260709/rio-strategy-packet.json`
`docs/reports/leo-working-state-20260709/rio-strategy-postflight.sql`
`docs/reports/leo-working-state-20260709/rio-strategy-preflight.sql`
`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_rio_strategy_context_packet.py`
`tests/test_kb_rio_strategy_context_packet.py`
2026-07-10 00:11:23 +02:00

62 lines
2 KiB
SQL

\set ON_ERROR_STOP on
-- Rio strategy-context companion postflight row-level readback.
select
(select count(*) from public.strategy_nodes where id in (select id from (values
('4f3e3d77-50fa-520a-8c8b-5a4269d94a9b'::uuid),
('063528a6-a07c-5c14-abdf-dc12a0b10fcf'::uuid)
) as v(id))) as generated_strategy_node_rows,
(select count(*) from public.strategy_node_anchors where id in (select id from (values
('3a0e2228-a74f-5971-b467-fb527ccdfb37'::uuid),
('3f7a9f84-eb2e-5d94-9ca4-afc3bad47f96'::uuid),
('d18eaa71-d458-53cc-baac-e5306a1779e2'::uuid),
('33d9eb08-c9c2-5e2d-a9a7-3d7f1b5f0f0c'::uuid),
('3b2a8908-120d-59a5-bbd5-d2711a123aa3'::uuid)
) as v(id))) as generated_strategy_anchor_rows;
select id::text,
agent_id::text,
node_type,
title,
rank,
status,
source_ref,
metadata::text
from public.strategy_nodes
where id in (select id from (values
('4f3e3d77-50fa-520a-8c8b-5a4269d94a9b'::uuid),
('063528a6-a07c-5c14-abdf-dc12a0b10fcf'::uuid)
) as v(id))
order by rank, title;
select id::text,
from_node_id::text,
anchor_role,
to_node_id::text,
to_shared_root_id::text,
claim_id::text,
weight,
left(note, 260) as note
from public.strategy_node_anchors
where id in (select id from (values
('3a0e2228-a74f-5971-b467-fb527ccdfb37'::uuid),
('3f7a9f84-eb2e-5d94-9ca4-afc3bad47f96'::uuid),
('d18eaa71-d458-53cc-baac-e5306a1779e2'::uuid),
('33d9eb08-c9c2-5e2d-a9a7-3d7f1b5f0f0c'::uuid),
('3b2a8908-120d-59a5-bbd5-d2711a123aa3'::uuid)
) as v(id))
order by from_node_id, anchor_role, id;
select id::text, status, left(text, 220) as text
from public.claims
where id in (select id from (values
('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid),
('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid),
('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid)
) as v(id))
order by id;
select id::text, title, left(body, 220) as body
from public.shared_root
where id = '6248818e-fe16-4d3b-8008-ef9752b80632'::uuid;