Add Working Leo cross-surface KB proof
Some checks are pending
CI / lint-and-test (push) Waiting to run

- Add broad Cory-style outcome scenarios to the open-ended benchmark so regular-use ambiguity is tested, not only exact ID canaries.

- Add a clone-proven cross-surface strategy anchor packet that updates the mapped rich proposal anchor only after Claim D exists.

- Retain VPS Docker DB, claim/body metadata, and cross-surface proof reports with ruff plus 37 focused tests passing.

`docs/reports/leo-working-state-20260709/cory-expected-working-leo-outcomes-20260709.md`

`docs/reports/leo-working-state-20260709/cross-surface-apply-authorized-commit.sql`

`docs/reports/leo-working-state-20260709/cross-surface-clone-rehearsal-current.log`

`docs/reports/leo-working-state-20260709/cross-surface-clone-rehearsal-failed-source-id-constraint.log`

`docs/reports/leo-working-state-20260709/cross-surface-delete-rollback.sql`

`docs/reports/leo-working-state-20260709/cross-surface-packet.json`

`docs/reports/leo-working-state-20260709/cross-surface-postflight.sql`

`docs/reports/leo-working-state-20260709/cross-surface-preflight.sql`

`docs/reports/leo-working-state-20260709/cross-surface-resolution-current.md`

`docs/reports/leo-working-state-20260709/current-truth-index.md`

`docs/reports/leo-working-state-20260709/leo-db-state-17-cory-outcome-benchmark.svg`

`docs/reports/leo-working-state-20260709/leo-db-state-18-db-vs-workspace.svg`

`docs/reports/leo-working-state-20260709/leo-db-state-19-claims-body-metadata.svg`

`docs/reports/leo-working-state-20260709/leo-db-state-20-cross-surface-anchor.svg`

`docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md`

`docs/reports/leo-working-state-20260709/working-leo-definition-20260709.md`

`docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md`

`docs/reports/leo-working-state-20260709/working-leo-open-ended-benchmark-spec.json`

`scripts/kb_cross_surface_resolution_packet.py`

`scripts/working_leo_open_ended_benchmark.py`

`tests/test_kb_cross_surface_resolution_packet.py`

`tests/test_working_leo_open_ended_benchmark.py`
This commit is contained in:
twentyOne2x 2026-07-09 23:39:51 +02:00
parent d9c794bebc
commit f34feb0ffb
22 changed files with 1703 additions and 25 deletions

View file

@ -90,6 +90,7 @@ The benchmark for Cory-working Leo should pass these checks:
6. Caveat retention: passed for the strict canary approval note; old freeform caveat retention remains part of the claim/source creation contract. 6. Caveat retention: passed for the strict canary approval note; old freeform caveat retention remains part of the claim/source creation contract.
7. Old approval handling: partially passed; old freeform approvals are now normalized into row-level requirements and explicitly not silently applied. 7. Old approval handling: partially passed; old freeform approvals are now normalized into row-level requirements and explicitly not silently applied.
8. Runtime stability: passed; service stayed active/running with `MainPID=3252143`, `NRestarts=0`. 8. Runtime stability: passed; service stayed active/running with `MainPID=3252143`, `NRestarts=0`.
9. Broad Cory-style outcomes: specified in the open-ended benchmark as six disposable-clone/sandbox-first scenarios. These are not the same as the narrow ID-led regression canaries and are the right standard for regular use.
## Scope Boundaries ## Scope Boundaries

View file

@ -0,0 +1,31 @@
\set ON_ERROR_STOP on
begin;
do $$
declare
updated int;
begin
if not exists (select 1 from public.claims where id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid) then
raise exception 'cross-surface packet requires Claim D % to exist before anchor update', 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1';
end if;
if not exists (select 1 from public.sources where id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid) then
raise exception 'cross-surface packet requires approval source % to exist before anchor update', '9a0d2429-b98b-585a-980c-0176db7f9fe7';
end if;
update public.strategy_node_anchors
set claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid,
weight = 0.85,
note = 'Mapped rich proposal 14fa5ecc applied: active Leo policy now anchors to Claim D (internet finance is a candidate mechanism, not the telos) instead of the retired compressed internet-finance claim.'
where id = '47f128a0-36c5-4b60-97d4-48c32fa48bc7'::uuid
and from_node_id = '52bc4264-330e-489d-920c-a493fd2d985a'::uuid
and anchor_role = 'justified_by'
and claim_id = 'd0000000-0000-0000-0000-000000000005'::uuid;
get diagnostics updated = row_count;
if updated <> 1 then
raise exception 'cross-surface anchor update affected % row(s), expected 1; anchor was not at old claim state', updated;
end if;
end $$;
commit;

View file

@ -0,0 +1,314 @@
cross-surface rehearsal started UTC 2026-07-09T21:35:41Z
copy packet files into teleo-pg container
drop old disposable DB if present
DROP DATABASE
create disposable DB teleo_cross_surface_rehearsal_20260709 from pg_dump of production teleo
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
clone base preflight before mapped packet commit
id | status | proposal_type | reviewed_by_handle | reviewed_at
--------------------------------------+----------+-----------------+--------------------+-------------------------------
14fa5ecc-ac7a-41c1-807d-a2e85b936617 | approved | attach_evidence | m3ta | 2026-07-05 19:30:48.707181+00
ac036c9d-20a0-4ffe-881f-57d6b7bacf22 | approved | attach_evidence | m3ta | 2026-07-05 19:11:40.673615+00
(2 rows)
check_name | id | reason
------------+----+--------
(0 rows)
expected_claims | expected_sources | expected_claim_edges | expected_claim_evidence
-----------------+------------------+----------------------+-------------------------
7 | 15 | 11 | 17
(1 row)
generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows
----------------------+-----------------------+---------------------+-------------------------
0 | 0 | 0 | 0
(1 row)
clone base mapped packet authorized commit
BEGIN
SET
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
BEGIN
SET
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
clone base mapped packet postflight
generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows
----------------------+-----------------------+---------------------+-------------------------
7 | 15 | 11 | 17
(1 row)
id | type | confidence | text
--------------------------------------+------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------
004195cc-ab62-526c-90fb-51cb0f826ec0 | structural | 0.65 | Capital allocation is a form of civilizational steering because it determines which futures receive resources.
62e82ee8-b204-573b-9707-eb5d832b9d9e | structural | 0.45 | Internet finance has structural advantages that make it likely to become an increasingly important capital-allocation mechanism.
67003e10-e1ee-5905-8b51-1b0cb263ec11 | structural | 0.45 | Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism.
9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | meta | 0.85 | KB claim nodes need explanatory bodies, not only one-sentence headlines.
cd8daac8-039c-5349-9c50-02f622e73b03 | structural | 0.8 | Hayeks most relevant contribution for Teleo is that prices coordinate dispersed, local, time-sensitive knowledge without central possession of that knowledge.
d009dfc4-9755-58a7-affb-80e3e842a775 | structural | 0.7 | Capital allocation depends on distributed knowledge, incentives, liquidity, and feedback loops.
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | normative | 0.8 | Internet finance is not Teleos telos; it is a candidate mechanism for pursuing the telos.
(7 rows)
id | source_type | excerpt
--------------------------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
244a4c38-86e5-5910-91f4-6d71529e9b31 | other | {"body": "The existing KB Hayek claim says economic planning requires local and global information that are never simultaneously available to decision makers. That is directionally related, but the stronger Teleo-relevan
33fadb51-0bd8-5f2d-87fe-758a3dd7fac0 | article | {"excerpt": "There is beyond question a body of very important but unorganized knowledge... the knowledge of the particular circumstances of time and place.\n\nBy the price system... all the relevant information is conce
3a57238c-ca31-5fe1-bece-e5fb2f174e32 | other | {"excerpt": "Capital allocation is civilizational infrastructure, not a financial service.", "metadata": {"source_key": "rio_belief_capital_allocation_civilizational_infrastructure", "source_quality": "canonical agent be
4787c38e-74cb-5bf5-93e1-0cc9c290684c | other | {"excerpt": "Nodes should have a headline thats the claim belief or concept map etc, but also a body elaborating what the claim means.\n\nStandardize these nodes as: Headline, Body, Edges, Evidence.\n\nFor Hayek that is
4cc0c7ee-2166-5cae-9065-ea226fa2be5b | article | {"excerpt": "There is beyond question a body of very important but unorganized knowledge... the knowledge of the particular circumstances of time and place.\n\nBy the price system... all the relevant information is conce
6c3c26c1-39bc-58e5-8c76-28b5712420ce | other | {"body": "Internet finance may improve capital allocation by making ownership, capital formation, settlement, liquidity, governance, and market feedback more digitally native, programmable, global, and composable. The th
703fdfaf-22c9-5f5b-8d29-cf238d5e156f | other | {"excerpt": "# Teleo Collective Telos and Agent Strategy Kernels ... This is a working synthesis, not canonical KB state.\n\nCore Strategic Tools are named and then elaborated with short explanatory bodies: Inflection ma
87f49cf0-5516-5aef-8ed9-f69292917d32 | other | {"excerpt": "Hayek's knowledge problem reveals that economic planning requires both local and global information which are never simultaneously available to decision makers", "metadata": {"claim_id": "7da4851c-0aac-4084-
8f952541-5f12-5f24-88b3-21e7842163a1 | other | {"excerpt": "Humanity is in the early innings of a species-level inflection... changes in how society distributes value, forms capital, and coordinates around shared futures.", "metadata": {"source_key": "leo_active_stra
997e5e58-b20d-560a-a73a-eaa4bff1dc3e | other | {"body": "Teleos telos is emergent collective superintelligence oriented toward better futures, not internet finance for its own sake. Internet finance matters insofar as it can help coordinate capital, incentives, fore
9a0d2429-b98b-585a-980c-0176db7f9fe7 | dm | {"excerpt": "Yes lets do this. do the work for this, then come back to me with what you'd like me to approve\n\nOld claim: Internet finance is the coordination mechanism for capital allocation — capital allocation is ex
9fd61e7e-d5cb-5904-b5c2-a539946f7c96 | other | {"body": "Good capital allocation requires more than a central thesis about what matters. It needs distributed knowledge about local opportunities, credible incentives that reward truth-seeking and execution, liquidity o
a3cba49b-7016-5f42-9af6-041f12371a24 | other | {"body": "A one-sentence claim can be useful as a handle, but it often under-specifies scope, mechanism, caveats, and what evidence would actually support it. Bodies make claims reviewable by explaining intended meaning
eea07732-c65d-5db6-88d6-1ab08511eca6 | other | {"body": "This does not mean “crypto wins because crypto.” It means digitally native capital formation, programmable governance, global distribution, lower intermediation costs, faster liquidity, composable ownership, an
f80c01fe-63bb-5ccf-9bdd-744bab0e9163 | other | {"body": "Capital allocation is not merely financial plumbing. It decides which companies, technologies, infrastructures, institutions, and narratives get enough resources to become real. Because many possible futures co
(15 rows)
from_claim | to_claim | edge_type
--------------------------------------+--------------------------------------+--------------
004195cc-ab62-526c-90fb-51cb0f826ec0 | d0000000-0000-0000-0000-000000000005 | supersedes
62e82ee8-b204-573b-9707-eb5d832b9d9e | c0000000-0000-0000-0000-00000000000c | relates
62e82ee8-b204-573b-9707-eb5d832b9d9e | cd8daac8-039c-5349-9c50-02f622e73b03 | derives_from
67003e10-e1ee-5905-8b51-1b0cb263ec11 | d0000000-0000-0000-0000-000000000005 | supersedes
67003e10-e1ee-5905-8b51-1b0cb263ec11 | d009dfc4-9755-58a7-affb-80e3e842a775 | requires
cd8daac8-039c-5349-9c50-02f622e73b03 | 62e82ee8-b204-573b-9707-eb5d832b9d9e | supports
cd8daac8-039c-5349-9c50-02f622e73b03 | 7da4851c-0aac-4084-a99f-baeeeb3aa23e | supersedes
d009dfc4-9755-58a7-affb-80e3e842a775 | 7da4851c-0aac-4084-a99f-baeeeb3aa23e | relates
d009dfc4-9755-58a7-affb-80e3e842a775 | d0000000-0000-0000-0000-000000000005 | supersedes
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 67003e10-e1ee-5905-8b51-1b0cb263ec11 | constrains
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | d0000000-0000-0000-0000-000000000005 | supersedes
(11 rows)
claim_id | source_id | role
--------------------------------------+--------------------------------------+-------------
004195cc-ab62-526c-90fb-51cb0f826ec0 | 3a57238c-ca31-5fe1-bece-e5fb2f174e32 | grounds
004195cc-ab62-526c-90fb-51cb0f826ec0 | 8f952541-5f12-5f24-88b3-21e7842163a1 | grounds
004195cc-ab62-526c-90fb-51cb0f826ec0 | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | grounds
004195cc-ab62-526c-90fb-51cb0f826ec0 | f80c01fe-63bb-5ccf-9bdd-744bab0e9163 | illustrates
62e82ee8-b204-573b-9707-eb5d832b9d9e | 4787c38e-74cb-5bf5-93e1-0cc9c290684c | grounds
62e82ee8-b204-573b-9707-eb5d832b9d9e | eea07732-c65d-5db6-88d6-1ab08511eca6 | illustrates
67003e10-e1ee-5905-8b51-1b0cb263ec11 | 6c3c26c1-39bc-58e5-8c76-28b5712420ce | illustrates
67003e10-e1ee-5905-8b51-1b0cb263ec11 | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | grounds
9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | 4787c38e-74cb-5bf5-93e1-0cc9c290684c | grounds
9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | a3cba49b-7016-5f42-9af6-041f12371a24 | illustrates
cd8daac8-039c-5349-9c50-02f622e73b03 | 244a4c38-86e5-5910-91f4-6d71529e9b31 | illustrates
cd8daac8-039c-5349-9c50-02f622e73b03 | 4cc0c7ee-2166-5cae-9065-ea226fa2be5b | grounds
d009dfc4-9755-58a7-affb-80e3e842a775 | 33fadb51-0bd8-5f2d-87fe-758a3dd7fac0 | grounds
d009dfc4-9755-58a7-affb-80e3e842a775 | 9fd61e7e-d5cb-5904-b5c2-a539946f7c96 | illustrates
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 8f952541-5f12-5f24-88b3-21e7842163a1 | grounds
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 997e5e58-b20d-560a-a73a-eaa4bff1dc3e | illustrates
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | grounds
(17 rows)
id | superseded_by
--------------------------------------+--------------------------------------
7da4851c-0aac-4084-a99f-baeeeb3aa23e | cd8daac8-039c-5349-9c50-02f622e73b03
d0000000-0000-0000-0000-000000000005 | e6ce4e36-15d2-53bc-8b74-dda0efc095c1
(2 rows)
clone cross-surface preflight after base packet
check_name | id | from_node_id | anchor_role | claim_id | source_id | note
-----------------------+--------------------------------------+--------------------------------------+--------------+--------------------------------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------
policy_anchor_current | 47f128a0-36c5-4b60-97d4-48c32fa48bc7 | 52bc4264-330e-489d-920c-a493fd2d985a | justified_by | d0000000-0000-0000-0000-000000000005 | | Telos/policy grounding approved by m3ta: capital allocation expresses priorities and must be coordinated with collective intelligence.
(1 row)
check_name | id | status | text
---------------------+--------------------------------------+--------+--------------------------------------------------------------------------------------------
base_claim_d_exists | e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | open | Internet finance is not Teleos telos; it is a candidate mechanism for pursuing the telos.
(1 row)
check_name | id | source_type | excerpt
------------------------+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
approval_source_exists | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | dm | {"excerpt": "Yes lets do this. do the work for this, then come back to me with what you'd like me to approve\n\nOld claim: Internet finance is the coordination mechanism for capital allocation — capital allocation is ex
(1 row)
check_name | id | from_node_id | anchor_role | to_shared_root_id | note
-----------------------------+--------------------------------------+--------------------------------------+-------------+--------------------------------------+---------------------------------------------------------------------------------------
telos_anchor_already_exists | c7dd984c-ac1b-43f9-9996-576ddf61c6d2 | 52bc4264-330e-489d-920c-a493fd2d985a | serves | 13100000-0000-0000-0000-000000000001 | Approved by m3ta: policy serves Teleo telos of emergent collective superintelligence.
(1 row)
check_name | id | name | criteria | evidence_bar
-----------------------+--------------------------------------+--------------+------------------------------------------------------------------------------------------------------------+-------------------------------------
governance_gate_known | 45695897-2a9c-4279-ac25-e59f166dec6a | evidence-bar | likely needs empirical data; experimental = coherent argument, limited validation; speculative = untested. | likely > experimental > speculative
governance_gate_known | fa88e31b-6fca-4801-bf72-f5db81950a11 | quality-gate | Specific enough to disagree with; evidence traceable; not a duplicate; right domain reviewers. |
(2 rows)
clone cross-surface authorized commit
BEGIN
DO
COMMIT
clone cross-surface postflight after anchor update
id | from_node_id | anchor_role | claim_id | source_id | weight | note
--------------------------------------+--------------------------------------+--------------+--------------------------------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
47f128a0-36c5-4b60-97d4-48c32fa48bc7 | 52bc4264-330e-489d-920c-a493fd2d985a | justified_by | e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | | 0.85 | Mapped rich proposal 14fa5ecc applied: active Leo policy now anchors to Claim D (internet finance is a candidate mechanism, not the telos) instead of the retired compressed internet-finance claim.
(1 row)
id | status | superseded_by | text
--------------------------------------+--------+--------------------------------------+---------------------------------------------------------------------------------------------------------------------
d0000000-0000-0000-0000-000000000005 | open | e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | Internet finance is the coordination mechanism for capital allocation — capital allocation is expressed priorities.
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | open | | Internet finance is not Teleos telos; it is a candidate mechanism for pursuing the telos.
(2 rows)
id | anchor_role | to_shared_root_id | note
--------------------------------------+-------------+--------------------------------------+---------------------------------------------------------------------------------------
c7dd984c-ac1b-43f9-9996-576ddf61c6d2 | serves | 13100000-0000-0000-0000-000000000001 | Approved by m3ta: policy serves Teleo telos of emergent collective superintelligence.
(1 row)
clone direct anchor assertion after cross-surface commit
check_name | claim_id | source_id | weight | note
--------------------------+--------------------------------------+-----------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------
clone_anchor_after_cross | e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | | 0.85 | Mapped rich proposal 14fa5ecc applied: active Leo policy now anchors to Claim D (internet finance is a candidate mechanism, not the telos) instead of the retire
(1 row)
clone cross-surface delete rollback
BEGIN
DO
COMMIT
clone base mapped packet delete rollback
BEGIN
DELETE 17
DELETE 11
UPDATE 2
DELETE 15
DELETE 7
COMMIT
clone base preflight after both rollbacks
id | status | proposal_type | reviewed_by_handle | reviewed_at
--------------------------------------+----------+-----------------+--------------------+-------------------------------
14fa5ecc-ac7a-41c1-807d-a2e85b936617 | approved | attach_evidence | m3ta | 2026-07-05 19:30:48.707181+00
ac036c9d-20a0-4ffe-881f-57d6b7bacf22 | approved | attach_evidence | m3ta | 2026-07-05 19:11:40.673615+00
(2 rows)
check_name | id | reason
------------+----+--------
(0 rows)
expected_claims | expected_sources | expected_claim_edges | expected_claim_evidence
-----------------+------------------+----------------------+-------------------------
7 | 15 | 11 | 17
(1 row)
generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows
----------------------+-----------------------+---------------------+-------------------------
0 | 0 | 0 | 0
(1 row)
clone direct anchor assertion after both rollbacks
check_name | claim_id | source_id | weight | note
-----------------------------+--------------------------------------+-----------+--------+----------------------------------------------------------------------------------------------------------------------------------------
clone_anchor_after_rollback | d0000000-0000-0000-0000-000000000005 | | 0.7 | Telos/policy grounding approved by m3ta: capital allocation expresses priorities and must be coordinated with collective intelligence.
(1 row)
production remains unchanged: base generated counts and anchor
id | status | proposal_type | reviewed_by_handle | reviewed_at
--------------------------------------+----------+-----------------+--------------------+-------------------------------
14fa5ecc-ac7a-41c1-807d-a2e85b936617 | approved | attach_evidence | m3ta | 2026-07-05 19:30:48.707181+00
ac036c9d-20a0-4ffe-881f-57d6b7bacf22 | approved | attach_evidence | m3ta | 2026-07-05 19:11:40.673615+00
(2 rows)
check_name | id | reason
------------+----+--------
(0 rows)
expected_claims | expected_sources | expected_claim_edges | expected_claim_evidence
-----------------+------------------+----------------------+-------------------------
7 | 15 | 11 | 17
(1 row)
generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows
----------------------+-----------------------+---------------------+-------------------------
0 | 0 | 0 | 0
(1 row)
check_name | claim_id | source_id | weight | note
-------------------------+--------------------------------------+-----------+--------+----------------------------------------------------------------------------------------------------------------------------------------
production_anchor_state | d0000000-0000-0000-0000-000000000005 | | 0.7 | Telos/policy grounding approved by m3ta: capital allocation expresses priorities and must be coordinated with collective intelligence.
(1 row)
drop disposable DB and remove temp packet files
DROP DATABASE
cleanup readback
disposable_db_exists
----------------------
0
(1 row)
host_tmp_removed yes
container_tmp_removed yes
active
3252143
0
cross-surface rehearsal completed UTC 2026-07-09T21:35:46Z

View file

@ -0,0 +1,210 @@
cross-surface rehearsal started UTC 2026-07-09T21:28:54Z
copy packet files into teleo-pg container
drop old disposable DB if present
DROP DATABASE
create disposable DB teleo_cross_surface_rehearsal_20260709 from pg_dump of production teleo
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
clone base preflight before mapped packet commit
id | status | proposal_type | reviewed_by_handle | reviewed_at
--------------------------------------+----------+-----------------+--------------------+-------------------------------
14fa5ecc-ac7a-41c1-807d-a2e85b936617 | approved | attach_evidence | m3ta | 2026-07-05 19:30:48.707181+00
ac036c9d-20a0-4ffe-881f-57d6b7bacf22 | approved | attach_evidence | m3ta | 2026-07-05 19:11:40.673615+00
(2 rows)
check_name | id | reason
------------+----+--------
(0 rows)
expected_claims | expected_sources | expected_claim_edges | expected_claim_evidence
-----------------+------------------+----------------------+-------------------------
7 | 15 | 11 | 17
(1 row)
generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows
----------------------+-----------------------+---------------------+-------------------------
0 | 0 | 0 | 0
(1 row)
clone base mapped packet authorized commit
BEGIN
SET
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
BEGIN
SET
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
clone base mapped packet postflight
generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows
----------------------+-----------------------+---------------------+-------------------------
7 | 15 | 11 | 17
(1 row)
id | type | confidence | text
--------------------------------------+------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------
004195cc-ab62-526c-90fb-51cb0f826ec0 | structural | 0.65 | Capital allocation is a form of civilizational steering because it determines which futures receive resources.
62e82ee8-b204-573b-9707-eb5d832b9d9e | structural | 0.45 | Internet finance has structural advantages that make it likely to become an increasingly important capital-allocation mechanism.
67003e10-e1ee-5905-8b51-1b0cb263ec11 | structural | 0.45 | Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism.
9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | meta | 0.85 | KB claim nodes need explanatory bodies, not only one-sentence headlines.
cd8daac8-039c-5349-9c50-02f622e73b03 | structural | 0.8 | Hayeks most relevant contribution for Teleo is that prices coordinate dispersed, local, time-sensitive knowledge without central possession of that knowledge.
d009dfc4-9755-58a7-affb-80e3e842a775 | structural | 0.7 | Capital allocation depends on distributed knowledge, incentives, liquidity, and feedback loops.
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | normative | 0.8 | Internet finance is not Teleos telos; it is a candidate mechanism for pursuing the telos.
(7 rows)
id | source_type | excerpt
--------------------------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
244a4c38-86e5-5910-91f4-6d71529e9b31 | other | {"body": "The existing KB Hayek claim says economic planning requires local and global information that are never simultaneously available to decision makers. That is directionally related, but the stronger Teleo-relevan
33fadb51-0bd8-5f2d-87fe-758a3dd7fac0 | article | {"excerpt": "There is beyond question a body of very important but unorganized knowledge... the knowledge of the particular circumstances of time and place.\n\nBy the price system... all the relevant information is conce
3a57238c-ca31-5fe1-bece-e5fb2f174e32 | other | {"excerpt": "Capital allocation is civilizational infrastructure, not a financial service.", "metadata": {"source_key": "rio_belief_capital_allocation_civilizational_infrastructure", "source_quality": "canonical agent be
4787c38e-74cb-5bf5-93e1-0cc9c290684c | other | {"excerpt": "Nodes should have a headline thats the claim belief or concept map etc, but also a body elaborating what the claim means.\n\nStandardize these nodes as: Headline, Body, Edges, Evidence.\n\nFor Hayek that is
4cc0c7ee-2166-5cae-9065-ea226fa2be5b | article | {"excerpt": "There is beyond question a body of very important but unorganized knowledge... the knowledge of the particular circumstances of time and place.\n\nBy the price system... all the relevant information is conce
6c3c26c1-39bc-58e5-8c76-28b5712420ce | other | {"body": "Internet finance may improve capital allocation by making ownership, capital formation, settlement, liquidity, governance, and market feedback more digitally native, programmable, global, and composable. The th
703fdfaf-22c9-5f5b-8d29-cf238d5e156f | other | {"excerpt": "# Teleo Collective Telos and Agent Strategy Kernels ... This is a working synthesis, not canonical KB state.\n\nCore Strategic Tools are named and then elaborated with short explanatory bodies: Inflection ma
87f49cf0-5516-5aef-8ed9-f69292917d32 | other | {"excerpt": "Hayek's knowledge problem reveals that economic planning requires both local and global information which are never simultaneously available to decision makers", "metadata": {"claim_id": "7da4851c-0aac-4084-
8f952541-5f12-5f24-88b3-21e7842163a1 | other | {"excerpt": "Humanity is in the early innings of a species-level inflection... changes in how society distributes value, forms capital, and coordinates around shared futures.", "metadata": {"source_key": "leo_active_stra
997e5e58-b20d-560a-a73a-eaa4bff1dc3e | other | {"body": "Teleos telos is emergent collective superintelligence oriented toward better futures, not internet finance for its own sake. Internet finance matters insofar as it can help coordinate capital, incentives, fore
9a0d2429-b98b-585a-980c-0176db7f9fe7 | dm | {"excerpt": "Yes lets do this. do the work for this, then come back to me with what you'd like me to approve\n\nOld claim: Internet finance is the coordination mechanism for capital allocation — capital allocation is ex
9fd61e7e-d5cb-5904-b5c2-a539946f7c96 | other | {"body": "Good capital allocation requires more than a central thesis about what matters. It needs distributed knowledge about local opportunities, credible incentives that reward truth-seeking and execution, liquidity o
a3cba49b-7016-5f42-9af6-041f12371a24 | other | {"body": "A one-sentence claim can be useful as a handle, but it often under-specifies scope, mechanism, caveats, and what evidence would actually support it. Bodies make claims reviewable by explaining intended meaning
eea07732-c65d-5db6-88d6-1ab08511eca6 | other | {"body": "This does not mean “crypto wins because crypto.” It means digitally native capital formation, programmable governance, global distribution, lower intermediation costs, faster liquidity, composable ownership, an
f80c01fe-63bb-5ccf-9bdd-744bab0e9163 | other | {"body": "Capital allocation is not merely financial plumbing. It decides which companies, technologies, infrastructures, institutions, and narratives get enough resources to become real. Because many possible futures co
(15 rows)
from_claim | to_claim | edge_type
--------------------------------------+--------------------------------------+--------------
004195cc-ab62-526c-90fb-51cb0f826ec0 | d0000000-0000-0000-0000-000000000005 | supersedes
62e82ee8-b204-573b-9707-eb5d832b9d9e | c0000000-0000-0000-0000-00000000000c | relates
62e82ee8-b204-573b-9707-eb5d832b9d9e | cd8daac8-039c-5349-9c50-02f622e73b03 | derives_from
67003e10-e1ee-5905-8b51-1b0cb263ec11 | d0000000-0000-0000-0000-000000000005 | supersedes
67003e10-e1ee-5905-8b51-1b0cb263ec11 | d009dfc4-9755-58a7-affb-80e3e842a775 | requires
cd8daac8-039c-5349-9c50-02f622e73b03 | 62e82ee8-b204-573b-9707-eb5d832b9d9e | supports
cd8daac8-039c-5349-9c50-02f622e73b03 | 7da4851c-0aac-4084-a99f-baeeeb3aa23e | supersedes
d009dfc4-9755-58a7-affb-80e3e842a775 | 7da4851c-0aac-4084-a99f-baeeeb3aa23e | relates
d009dfc4-9755-58a7-affb-80e3e842a775 | d0000000-0000-0000-0000-000000000005 | supersedes
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 67003e10-e1ee-5905-8b51-1b0cb263ec11 | constrains
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | d0000000-0000-0000-0000-000000000005 | supersedes
(11 rows)
claim_id | source_id | role
--------------------------------------+--------------------------------------+-------------
004195cc-ab62-526c-90fb-51cb0f826ec0 | 3a57238c-ca31-5fe1-bece-e5fb2f174e32 | grounds
004195cc-ab62-526c-90fb-51cb0f826ec0 | 8f952541-5f12-5f24-88b3-21e7842163a1 | grounds
004195cc-ab62-526c-90fb-51cb0f826ec0 | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | grounds
004195cc-ab62-526c-90fb-51cb0f826ec0 | f80c01fe-63bb-5ccf-9bdd-744bab0e9163 | illustrates
62e82ee8-b204-573b-9707-eb5d832b9d9e | 4787c38e-74cb-5bf5-93e1-0cc9c290684c | grounds
62e82ee8-b204-573b-9707-eb5d832b9d9e | eea07732-c65d-5db6-88d6-1ab08511eca6 | illustrates
67003e10-e1ee-5905-8b51-1b0cb263ec11 | 6c3c26c1-39bc-58e5-8c76-28b5712420ce | illustrates
67003e10-e1ee-5905-8b51-1b0cb263ec11 | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | grounds
9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | 4787c38e-74cb-5bf5-93e1-0cc9c290684c | grounds
9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | a3cba49b-7016-5f42-9af6-041f12371a24 | illustrates
cd8daac8-039c-5349-9c50-02f622e73b03 | 244a4c38-86e5-5910-91f4-6d71529e9b31 | illustrates
cd8daac8-039c-5349-9c50-02f622e73b03 | 4cc0c7ee-2166-5cae-9065-ea226fa2be5b | grounds
d009dfc4-9755-58a7-affb-80e3e842a775 | 33fadb51-0bd8-5f2d-87fe-758a3dd7fac0 | grounds
d009dfc4-9755-58a7-affb-80e3e842a775 | 9fd61e7e-d5cb-5904-b5c2-a539946f7c96 | illustrates
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 8f952541-5f12-5f24-88b3-21e7842163a1 | grounds
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 997e5e58-b20d-560a-a73a-eaa4bff1dc3e | illustrates
e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | grounds
(17 rows)
id | superseded_by
--------------------------------------+--------------------------------------
7da4851c-0aac-4084-a99f-baeeeb3aa23e | cd8daac8-039c-5349-9c50-02f622e73b03
d0000000-0000-0000-0000-000000000005 | e6ce4e36-15d2-53bc-8b74-dda0efc095c1
(2 rows)
clone cross-surface preflight after base packet
check_name | id | from_node_id | anchor_role | claim_id | source_id | note
-----------------------+--------------------------------------+--------------------------------------+--------------+--------------------------------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------
policy_anchor_current | 47f128a0-36c5-4b60-97d4-48c32fa48bc7 | 52bc4264-330e-489d-920c-a493fd2d985a | justified_by | d0000000-0000-0000-0000-000000000005 | | Telos/policy grounding approved by m3ta: capital allocation expresses priorities and must be coordinated with collective intelligence.
(1 row)
check_name | id | status | text
---------------------+--------------------------------------+--------+--------------------------------------------------------------------------------------------
base_claim_d_exists | e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | open | Internet finance is not Teleos telos; it is a candidate mechanism for pursuing the telos.
(1 row)
check_name | id | source_type | excerpt
------------------------+--------------------------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
approval_source_exists | 9a0d2429-b98b-585a-980c-0176db7f9fe7 | dm | {"excerpt": "Yes lets do this. do the work for this, then come back to me with what you'd like me to approve\n\nOld claim: Internet finance is the coordination mechanism for capital allocation — capital allocation is ex
(1 row)
check_name | id | from_node_id | anchor_role | to_shared_root_id | note
-----------------------------+--------------------------------------+--------------------------------------+-------------+--------------------------------------+---------------------------------------------------------------------------------------
telos_anchor_already_exists | c7dd984c-ac1b-43f9-9996-576ddf61c6d2 | 52bc4264-330e-489d-920c-a493fd2d985a | serves | 13100000-0000-0000-0000-000000000001 | Approved by m3ta: policy serves Teleo telos of emergent collective superintelligence.
(1 row)
check_name | id | name | criteria | evidence_bar
-----------------------+--------------------------------------+--------------+------------------------------------------------------------------------------------------------------------+-------------------------------------
governance_gate_known | 45695897-2a9c-4279-ac25-e59f166dec6a | evidence-bar | likely needs empirical data; experimental = coherent argument, limited validation; speculative = untested. | likely > experimental > speculative
governance_gate_known | fa88e31b-6fca-4801-bf72-f5db81950a11 | quality-gate | Specific enough to disagree with; evidence traceable; not a duplicate; right domain reviewers. |
(2 rows)
clone cross-surface authorized commit
BEGIN

View file

@ -0,0 +1,24 @@
\set ON_ERROR_STOP on
begin;
do $$
declare
restored int;
begin
update public.strategy_node_anchors
set claim_id = 'd0000000-0000-0000-0000-000000000005'::uuid,
source_id = null,
weight = 0.7,
note = 'Telos/policy grounding approved by m3ta: capital allocation expresses priorities and must be coordinated with collective intelligence.'
where id = '47f128a0-36c5-4b60-97d4-48c32fa48bc7'::uuid
and from_node_id = '52bc4264-330e-489d-920c-a493fd2d985a'::uuid
and anchor_role = 'justified_by'
and claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid;
get diagnostics restored = row_count;
if restored <> 1 then
raise exception 'cross-surface anchor rollback affected % row(s), expected 1; anchor was not at Claim D state', restored;
end if;
end $$;
commit;

View file

@ -0,0 +1,55 @@
{
"already_represented": [
{
"id": "c7dd984c-ac1b-43f9-9996-576ddf61c6d2",
"reason": "The active Leo policy already serves the Teleo telos shared root; the Claim D anchor update keeps internet finance subordinate to that telos.",
"table": "public.strategy_node_anchors",
"target": "teleo telos",
"to_shared_root_id": "13100000-0000-0000-0000-000000000001"
}
],
"base_packet_required_first": "production-apply-packet-mapped-20260709",
"known_non_writable_targets": [
{
"existing_row_id": "fa88e31b-6fca-4801-bf72-f5db81950a11",
"reason": "Governance gate exists, but current schema has no claim-to-governance-gate edge/anchor table.",
"target": "governance_gate:quality-gate"
},
{
"existing_row_id": "45695897-2a9c-4279-ac25-e59f166dec6a",
"reason": "Governance gate exists, but current schema has no claim-to-governance-gate edge/anchor table.",
"target": "governance_gate:evidence-bar"
},
{
"existing_row_id": null,
"reason": "No first-class concept-map table exists in the current live schema.",
"target": "concept_map:distributed_market_intelligence"
},
{
"existing_row_id": null,
"reason": "No exact Rio strategy node or claim target exists in the current live schema.",
"target": "rio:capital-deployment-layer"
},
{
"existing_row_id": null,
"reason": "No exact Rio active strategy node exists in the current live schema.",
"target": "rio:active strategy v1 / internet-finance capital product"
}
],
"packet_version": 1,
"production_apply_status": "not_executed",
"purpose": "Companion packet for mapped rich proposal non-claim surfaces.",
"safe_writes": [
{
"approval_source_id": "9a0d2429-b98b-585a-980c-0176db7f9fe7",
"from_node_id": "52bc4264-330e-489d-920c-a493fd2d985a",
"from_node_title": "Multi-agent public intelligence",
"id": "47f128a0-36c5-4b60-97d4-48c32fa48bc7",
"new_claim_id": "e6ce4e36-15d2-53bc-8b74-dda0efc095c1",
"old_claim_id": "d0000000-0000-0000-0000-000000000005",
"operation": "update",
"reason": "Replace the active Leo policy anchor that points at the retiring compressed internet-finance claim with the approved Claim D boundary claim.",
"table": "public.strategy_node_anchors"
}
]
}

View file

@ -0,0 +1,30 @@
\set ON_ERROR_STOP on
-- Cross-surface postflight row-level readback.
select id::text,
from_node_id::text,
anchor_role,
claim_id::text,
source_id::text,
weight,
left(note, 240) as note
from public.strategy_node_anchors
where id = '47f128a0-36c5-4b60-97d4-48c32fa48bc7'::uuid;
select c.id::text,
c.status,
c.superseded_by::text,
left(c.text, 240) as text
from public.claims c
where c.id in (select id from (values
('d0000000-0000-0000-0000-000000000005'::uuid),
('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid)
) as v(id))
order by c.id;
select id::text,
anchor_role,
to_shared_root_id::text,
left(note, 240) as note
from public.strategy_node_anchors
where id = 'c7dd984c-ac1b-43f9-9996-576ddf61c6d2'::uuid;

View file

@ -0,0 +1,48 @@
\set ON_ERROR_STOP on
-- Cross-surface companion preflight. Read-only.
-- Run after the mapped rich proposal claim/source packet has been applied.
select 'policy_anchor_current' as check_name,
id::text,
from_node_id::text,
anchor_role,
claim_id::text,
source_id::text,
left(note, 220) as note
from public.strategy_node_anchors
where id = '47f128a0-36c5-4b60-97d4-48c32fa48bc7'::uuid;
select 'base_claim_d_exists' as check_name,
id::text,
status,
left(text, 220) as text
from public.claims
where id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid;
select 'approval_source_exists' as check_name,
id::text,
source_type,
left(coalesce(excerpt, ''), 220) as excerpt
from public.sources
where id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid;
select 'telos_anchor_already_exists' as check_name,
id::text,
from_node_id::text,
anchor_role,
to_shared_root_id::text,
left(note, 220) as note
from public.strategy_node_anchors
where id = 'c7dd984c-ac1b-43f9-9996-576ddf61c6d2'::uuid;
select 'governance_gate_known' as check_name,
id::text,
name,
left(criteria, 180) as criteria,
left(evidence_bar, 180) as evidence_bar
from public.governance_gates
where id in (select id from (values
('fa88e31b-6fca-4801-bf72-f5db81950a11'::uuid),
('45695897-2a9c-4279-ac25-e59f166dec6a'::uuid)
) as v(id))
order by name;

View file

@ -0,0 +1,75 @@
# Cross-Surface Resolution Packet - 2026-07-09
Generated UTC: `2026-07-09T21:38:00Z`
## Verdict
Clone-proven, not production-applied.
The mapped rich proposal packet handles canonical claim/source/evidence/claim-edge rows. This companion packet handles the one currently safe non-claim write: updating strategy anchor `47f128a0-36c5-4b60-97d4-48c32fa48bc7` after Claim D exists.
## Safe Write
- Table: `public.strategy_node_anchors`
- Anchor: `47f128a0-36c5-4b60-97d4-48c32fa48bc7`
- From node: `52bc4264-330e-489d-920c-a493fd2d985a` (`Multi-agent public intelligence`)
- Old claim: `d0000000-0000-0000-0000-000000000005`
- New claim: `e6ce4e36-15d2-53bc-8b74-dda0efc095c1`
- New meaning: active Leo policy is justified by the boundary claim that internet finance is a candidate mechanism, not Teleo's telos.
## Clone Proof
Disposable database: `teleo_cross_surface_rehearsal_20260709`
Sequence:
1. Created disposable clone from live `teleo` using `pg_dump | psql`.
2. Applied mapped base packet in clone: `7` claims, `15` sources, `11` claim edges, `17` claim evidence rows.
3. Ran cross-surface preflight:
- anchor still pointed to old claim `d0000000-0000-0000-0000-000000000005`
- Claim D existed
- approval source existed
- telos anchor already existed
- governance gate rows existed
4. Ran cross-surface authorized commit in clone.
5. Postflight read back anchor pointing to Claim D with weight `0.85`.
6. Ran cross-surface delete rollback.
7. Ran mapped base packet delete rollback.
8. Clone returned to zero generated mapped rows and original anchor state.
9. Production stayed unchanged: generated rows remained `0/0/0/0`, and production anchor still points to old claim with weight `0.7`.
10. Dropped disposable DB and removed host/container temp packet files.
Cleanup readback:
- `disposable_db_exists`: `0`
- host tmp removed: yes
- container tmp removed: yes
- `leoclean-gateway.service`: `active`
- `MainPID`: `3252143`
- `NRestarts`: `0`
## Constraint Found And Fixed
The first clone attempt failed because `public.strategy_node_anchors` rejects a row with both `claim_id` and `source_id` set. The packet was corrected so the anchor points only to Claim D. The approval source remains required as provenance and is linked through Claim D's evidence rows from the mapped base packet.
## Explicit Deferrals
These approved fragments are not safely writable through the current schema:
- `governance_gate:quality-gate`: row exists, but there is no claim-to-governance-gate edge/anchor table.
- `governance_gate:evidence-bar`: row exists, but there is no claim-to-governance-gate edge/anchor table.
- `concept_map:distributed_market_intelligence`: no first-class concept-map table exists.
- `rio:capital-deployment-layer`: no exact Rio strategy node or claim target exists.
- `rio:active strategy v1 / internet-finance capital product`: no exact Rio active strategy node exists.
## Evidence
- Packet JSON: `docs/reports/leo-working-state-20260709/cross-surface-packet.json`
- Authorized commit SQL, not executed in production: `docs/reports/leo-working-state-20260709/cross-surface-apply-authorized-commit.sql`
- Delete rollback SQL: `docs/reports/leo-working-state-20260709/cross-surface-delete-rollback.sql`
- Successful clone rehearsal log: `docs/reports/leo-working-state-20260709/cross-surface-clone-rehearsal-current.log`
- Failed-source-id constraint log: `docs/reports/leo-working-state-20260709/cross-surface-clone-rehearsal-failed-source-id-constraint.log`
## Claim Ceiling
This proves the strategy-anchor companion write is schema-compatible, reversible, and safe in a disposable clone after the mapped base packet exists. It does not prove production has been updated, because production commit was intentionally not executed.

View file

@ -8,7 +8,7 @@ Use this file before making status claims. Prefer fresh VPS/GCP readbacks when c
- Cory expected outcomes: `docs/reports/leo-working-state-20260709/cory-expected-working-leo-outcomes-20260709.md` - Cory expected outcomes: `docs/reports/leo-working-state-20260709/cory-expected-working-leo-outcomes-20260709.md`
- Current state: `docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md` - Current state: `docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md`
- Execution plan: `docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md` - Execution plan: `docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md`
- Open-ended benchmark spec: `docs/reports/leo-working-state-20260709/working-leo-open-ended-benchmark-spec.json` - Open-ended benchmark spec: `docs/reports/leo-working-state-20260709/working-leo-open-ended-benchmark-spec.json` (5 live-safe open prompts plus 6 broader Cory-style outcome scenarios for disposable clone/sandbox first)
- Open-ended live Telegram canary: `docs/reports/leo-working-state-20260709/telegram-live-open-ended-cory-style-20260709.md` - Open-ended live Telegram canary: `docs/reports/leo-working-state-20260709/telegram-live-open-ended-cory-style-20260709.md`
- Open-ended live Telegram canary JSON: `docs/reports/leo-working-state-20260709/telegram-live-open-ended-cory-style-20260709.json` - Open-ended live Telegram canary JSON: `docs/reports/leo-working-state-20260709/telegram-live-open-ended-cory-style-20260709.json`
- Fable onboarding prompt: `docs/reports/leo-working-state-20260709/fable-leo-teleo-onboarding.md` - Fable onboarding prompt: `docs/reports/leo-working-state-20260709/fable-leo-teleo-onboarding.md`
@ -30,6 +30,11 @@ Use this file before making status claims. Prefer fresh VPS/GCP readbacks when c
- Claim/source preview: `docs/reports/leo-working-state-20260709/claim-source-contract-preview-current.md` - Claim/source preview: `docs/reports/leo-working-state-20260709/claim-source-contract-preview-current.md`
- Mapped rich proposal plan: `docs/reports/leo-working-state-20260709/rich-proposal-creation-plan-mapped-current.md` - Mapped rich proposal plan: `docs/reports/leo-working-state-20260709/rich-proposal-creation-plan-mapped-current.md`
- Mapped production apply packet, not executed in production: `docs/reports/leo-working-state-20260709/production-apply-packet-current.md` - Mapped production apply packet, not executed in production: `docs/reports/leo-working-state-20260709/production-apply-packet-current.md`
- Cross-surface strategy anchor companion packet, not executed in production: `docs/reports/leo-working-state-20260709/cross-surface-resolution-current.md`
- Cross-surface packet JSON: `docs/reports/leo-working-state-20260709/cross-surface-packet.json`
- Cross-surface authorized commit SQL, not executed in production: `docs/reports/leo-working-state-20260709/cross-surface-apply-authorized-commit.sql`
- Cross-surface delete rollback SQL: `docs/reports/leo-working-state-20260709/cross-surface-delete-rollback.sql`
- Cross-surface clone commit/delete rollback log: `docs/reports/leo-working-state-20260709/cross-surface-clone-rehearsal-current.log`
- Helmer 7 Powers proposal plan: `docs/reports/leo-working-state-20260709/helmer-7powers-creation-plan.json` - Helmer 7 Powers proposal plan: `docs/reports/leo-working-state-20260709/helmer-7powers-creation-plan.json`
- Helmer 7 Powers apply packet, not executed in production: `docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet-current.md` - Helmer 7 Powers apply packet, not executed in production: `docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet-current.md`
- Helmer 7 Powers apply packet JSON: `docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet.json` - Helmer 7 Powers apply packet JSON: `docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet.json`
@ -49,13 +54,20 @@ Use this file before making status claims. Prefer fresh VPS/GCP readbacks when c
- Helmer packet proof: `docs/reports/leo-working-state-20260709/leo-db-state-14-helmer-packet.svg` - Helmer packet proof: `docs/reports/leo-working-state-20260709/leo-db-state-14-helmer-packet.svg`
- Open-ended Cory-style canary map: `docs/reports/leo-working-state-20260709/leo-db-state-15-open-ended-canary.svg` - Open-ended Cory-style canary map: `docs/reports/leo-working-state-20260709/leo-db-state-15-open-ended-canary.svg`
- Helmer ledger packet proof: `docs/reports/leo-working-state-20260709/leo-db-state-16-helmer-ledger.svg` - Helmer ledger packet proof: `docs/reports/leo-working-state-20260709/leo-db-state-16-helmer-ledger.svg`
- Cory-style outcome benchmark map: `docs/reports/leo-working-state-20260709/leo-db-state-17-cory-outcome-benchmark.svg`
- Leoclean DB versus workspace map: `docs/reports/leo-working-state-20260709/leo-db-state-18-db-vs-workspace.svg`
- Claim/body/metadata schema map: `docs/reports/leo-working-state-20260709/leo-db-state-19-claims-body-metadata.svg`
- Cross-surface strategy anchor proof: `docs/reports/leo-working-state-20260709/leo-db-state-20-cross-surface-anchor.svg`
## Current Claim Ceiling ## Current Claim Ceiling
- VPS Leo Telegram memory, KB audit, and staged-write canaries are live-proven. - VPS Leo Telegram memory, KB audit, and staged-write canaries are live-proven.
- VPS Leo open-ended Cory-style triage is live-proven for a read-only vague incident prompt. - VPS Leo open-ended Cory-style triage is live-proven for a read-only vague incident prompt.
- The broader Cory-style benchmark layer is specified but not yet live-run; it intentionally tests regular-use ambiguity without exact proposal IDs.
- A strict canonical `add_edge` apply canary is live-proven. - A strict canonical `add_edge` apply canary is live-proven.
- Helmer 7 Powers is full-coverage packet and ledger clone-proven, not production-applied. - Helmer 7 Powers is full-coverage packet and ledger clone-proven, not production-applied.
- Mapped rich approved proposal packet is clone/rehearsal-proven for the supported subset, not production-applied. - Mapped rich approved proposal packet is clone/rehearsal-proven for the supported subset, not production-applied.
- The strategy-anchor companion write for mapped rich proposal `14fa5ecc` is clone-proven and reversible, not production-applied.
- Governance-gate, concept-map, and Rio strategy targets remain explicitly deferred because current schema has no safe direct write path for them.
- The live VPS runtime behavior should not be changed while the DB apply path is stabilized. - The live VPS runtime behavior should not be changed while the DB apply path is stabilized.
- GCP parity remains blocked by account auth/access facts until a fresh readback proves otherwise. - GCP parity remains blocked by account auth/access facts until a fresh readback proves otherwise.

View file

@ -0,0 +1,49 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720" role="img" aria-labelledby="title desc">
<title id="title">Working Leo benchmark split</title>
<desc id="desc">Diagram showing precise regression canaries, live-safe open prompts, and broad Cory-style outcome scenarios.</desc>
<rect width="1280" height="720" fill="#f8fafc"/>
<text x="64" y="72" font-family="Arial, sans-serif" font-size="34" font-weight="700" fill="#111827">Working Leo benchmark must test outcomes, not just IDs</text>
<text x="64" y="112" font-family="Arial, sans-serif" font-size="18" fill="#374151">The narrow canaries stay. They are regression pins. The broader suite tests regular Cory-style ambiguity before VPS/GCP trust.</text>
<rect x="64" y="162" width="330" height="410" rx="8" fill="#ffffff" stroke="#2563eb" stroke-width="3"/>
<text x="92" y="210" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#1d4ed8">1. Precise pins</text>
<text x="92" y="250" font-family="Arial, sans-serif" font-size="17" fill="#111827">Exact proposal IDs</text>
<text x="92" y="282" font-family="Arial, sans-serif" font-size="17" fill="#111827">Exact edge/source/row checks</text>
<text x="92" y="314" font-family="Arial, sans-serif" font-size="17" fill="#111827">Before/after DB assertions</text>
<text x="92" y="346" font-family="Arial, sans-serif" font-size="17" fill="#111827">Service PID/restart stability</text>
<rect x="92" y="400" width="250" height="82" rx="6" fill="#eff6ff" stroke="#93c5fd"/>
<text x="112" y="432" font-family="Arial, sans-serif" font-size="16" font-weight="700" fill="#1e3a8a">Use for:</text>
<text x="112" y="462" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">regression diagnosis</text>
<rect x="475" y="162" width="330" height="410" rx="8" fill="#ffffff" stroke="#059669" stroke-width="3"/>
<text x="503" y="210" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#047857">2. Live-safe open</text>
<text x="503" y="250" font-family="Arial, sans-serif" font-size="17" fill="#111827">Vague incident prompt</text>
<text x="503" y="282" font-family="Arial, sans-serif" font-size="17" fill="#111827">No exact IDs required</text>
<text x="503" y="314" font-family="Arial, sans-serif" font-size="17" fill="#111827">Read-only on live VPS</text>
<text x="503" y="346" font-family="Arial, sans-serif" font-size="17" fill="#111827">Scores proposed vs applied</text>
<rect x="503" y="400" width="250" height="82" rx="6" fill="#ecfdf5" stroke="#86efac"/>
<text x="523" y="432" font-family="Arial, sans-serif" font-size="16" font-weight="700" fill="#064e3b">Use for:</text>
<text x="523" y="462" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">Telegram-visible confidence</text>
<rect x="886" y="162" width="330" height="410" rx="8" fill="#ffffff" stroke="#b45309" stroke-width="3"/>
<text x="914" y="210" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#92400e">3. Cory outcomes</text>
<text x="914" y="250" font-family="Arial, sans-serif" font-size="17" fill="#111827">Demo-pressure prompts</text>
<text x="914" y="282" font-family="Arial, sans-serif" font-size="17" fill="#111827">Missing IDs and messy intent</text>
<text x="914" y="314" font-family="Arial, sans-serif" font-size="17" fill="#111827">KB/runtime/governance mixed</text>
<text x="914" y="346" font-family="Arial, sans-serif" font-size="17" fill="#111827">Disposable clone first</text>
<rect x="914" y="400" width="250" height="82" rx="6" fill="#fffbeb" stroke="#fcd34d"/>
<text x="934" y="432" font-family="Arial, sans-serif" font-size="16" font-weight="700" fill="#78350f">Use for:</text>
<text x="934" y="462" font-family="Arial, sans-serif" font-size="15" fill="#78350f">regular-use working bar</text>
<path d="M396 367 H455" stroke="#6b7280" stroke-width="3" marker-end="url(#arrow)"/>
<path d="M807 367 H866" stroke="#6b7280" stroke-width="3" marker-end="url(#arrow)"/>
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L9,3 z" fill="#6b7280"/>
</marker>
</defs>
<rect x="188" y="620" width="905" height="54" rx="8" fill="#111827"/>
<text x="225" y="654" font-family="Arial, sans-serif" font-size="18" font-weight="700" fill="#ffffff">Pass means:</text>
<text x="340" y="654" font-family="Arial, sans-serif" font-size="18" fill="#ffffff">Leo infers the desired DB outcome, proves row state, preserves caveats, and refuses false applied claims.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -0,0 +1,36 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720" role="img" aria-labelledby="title desc">
<title id="title">Leoclean database versus workspace</title>
<desc id="desc">Diagram of the live leoclean Postgres database in Docker on the VPS, separate from Forgejo and the local workspace artifacts.</desc>
<rect width="1280" height="720" fill="#f8fafc"/>
<text x="64" y="74" font-family="Arial, sans-serif" font-size="34" font-weight="700" fill="#111827">Leoclean DB right now: live Docker DB, not the workspace</text>
<text x="64" y="114" font-family="Arial, sans-serif" font-size="18" fill="#374151">Fresh readback: VPS has a postgres container named teleo-pg with database teleo. Forgejo is separate repo hosting.</text>
<rect x="70" y="165" width="520" height="410" rx="8" fill="#ffffff" stroke="#2563eb" stroke-width="3"/>
<text x="105" y="215" font-family="Arial, sans-serif" font-size="25" font-weight="700" fill="#1d4ed8">Live VPS runtime</text>
<rect x="105" y="250" width="450" height="92" rx="8" fill="#eff6ff" stroke="#93c5fd"/>
<text x="130" y="287" font-family="Arial, sans-serif" font-size="20" font-weight="700" fill="#1e3a8a">Docker container: teleo-pg</text>
<text x="130" y="318" font-family="Arial, sans-serif" font-size="17" fill="#1e3a8a">Image: postgres:16, database: teleo</text>
<rect x="105" y="370" width="450" height="150" rx="8" fill="#ffffff" stroke="#cbd5e1"/>
<text x="130" y="405" font-family="Arial, sans-serif" font-size="18" font-weight="700" fill="#111827">Canonical KB surfaces</text>
<text x="130" y="438" font-family="Arial, sans-serif" font-size="16" fill="#111827">public.claims, public.sources</text>
<text x="130" y="468" font-family="Arial, sans-serif" font-size="16" fill="#111827">public.claim_edges, public.claim_evidence</text>
<text x="130" y="498" font-family="Arial, sans-serif" font-size="16" fill="#111827">kb_stage.kb_proposals and staged rows</text>
<rect x="690" y="165" width="520" height="410" rx="8" fill="#ffffff" stroke="#059669" stroke-width="3"/>
<text x="725" y="215" font-family="Arial, sans-serif" font-size="25" font-weight="700" fill="#047857">Workspace and repo layer</text>
<rect x="725" y="250" width="450" height="92" rx="8" fill="#ecfdf5" stroke="#86efac"/>
<text x="750" y="287" font-family="Arial, sans-serif" font-size="20" font-weight="700" fill="#064e3b">Local teleo-infra-main</text>
<text x="750" y="318" font-family="Arial, sans-serif" font-size="17" fill="#064e3b">Scripts, tests, SQL packets, reports</text>
<rect x="725" y="370" width="450" height="150" rx="8" fill="#ffffff" stroke="#cbd5e1"/>
<text x="750" y="405" font-family="Arial, sans-serif" font-size="18" font-weight="700" fill="#111827">Forgejo is separate</text>
<text x="750" y="438" font-family="Arial, sans-serif" font-size="16" fill="#111827">Container: forgejo</text>
<text x="750" y="468" font-family="Arial, sans-serif" font-size="16" fill="#111827">Mounts: /opt/forgejo/data and config</text>
<text x="750" y="498" font-family="Arial, sans-serif" font-size="16" fill="#111827">Not observed as source DB for teleo</text>
<path d="M590 365 C625 365 655 365 690 365" stroke="#6b7280" stroke-width="3" stroke-dasharray="8 8"/>
<text x="604" y="348" font-family="Arial, sans-serif" font-size="15" fill="#4b5563">SQL packets / deploy flow</text>
<rect x="155" y="620" width="970" height="56" rx="8" fill="#111827"/>
<text x="190" y="655" font-family="Arial, sans-serif" font-size="19" font-weight="700" fill="#ffffff">Working Leo uses both:</text>
<text x="380" y="655" font-family="Arial, sans-serif" font-size="18" fill="#ffffff">query live teleo DB, use workspace code/packets to safely stage, test, and apply approved changes.</text>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -0,0 +1,67 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="760" viewBox="0 0 1280 760" role="img" aria-labelledby="title desc">
<title id="title">How claims tie to body, metadata, sources, and evidence</title>
<desc id="desc">Diagram of current leoclean Docker Postgres schema: canonical claims do not have body or metadata columns; staging has body and raw frontmatter; evidence links claims to sources.</desc>
<rect width="1280" height="760" fill="#f8fafc"/>
<text x="64" y="68" font-family="Arial, sans-serif" font-size="33" font-weight="700" fill="#111827">Claims, body, and metadata in the current leoclean DB</text>
<text x="64" y="108" font-family="Arial, sans-serif" font-size="18" fill="#374151">Fresh VPS readback: 77.42.65.182 -> Docker container teleo-pg -> Postgres database teleo.</text>
<rect x="64" y="124" width="690" height="32" rx="6" fill="#e0f2fe" stroke="#7dd3fc"/>
<text x="84" y="146" font-family="Arial, sans-serif" font-size="15" font-weight="700" fill="#075985">Canonical DB location:</text>
<text x="250" y="146" font-family="Arial, sans-serif" font-size="15" fill="#075985">teleo-pg/postgres:16, database teleo, schemas public and kb_stage</text>
<rect x="60" y="172" width="350" height="480" rx="8" fill="#ffffff" stroke="#2563eb" stroke-width="3"/>
<text x="90" y="220" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#1d4ed8">Canonical claim</text>
<text x="90" y="254" font-family="Arial, sans-serif" font-size="16" fill="#111827">VPS Docker: teleo-pg -> DB teleo -> public.claims</text>
<rect x="90" y="258" width="290" height="235" rx="6" fill="#eff6ff" stroke="#93c5fd"/>
<text x="112" y="292" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">id</text>
<text x="112" y="320" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">type</text>
<text x="112" y="348" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">text</text>
<text x="112" y="376" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">status</text>
<text x="112" y="404" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">confidence</text>
<text x="112" y="432" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">tags[]</text>
<text x="112" y="460" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">superseded_by, timestamps</text>
<rect x="90" y="520" width="290" height="72" rx="6" fill="#fef2f2" stroke="#fca5a5"/>
<text x="112" y="552" font-family="Arial, sans-serif" font-size="16" font-weight="700" fill="#991b1b">No canonical body column</text>
<text x="112" y="578" font-family="Arial, sans-serif" font-size="15" fill="#991b1b">No canonical metadata jsonb column</text>
<rect x="465" y="172" width="350" height="480" rx="8" fill="#ffffff" stroke="#059669" stroke-width="3"/>
<text x="495" y="220" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#047857">Evidence and sources</text>
<text x="495" y="254" font-family="Arial, sans-serif" font-size="16" fill="#111827">teleo.public.claim_evidence -> teleo.public.sources</text>
<rect x="495" y="258" width="290" height="118" rx="6" fill="#ecfdf5" stroke="#86efac"/>
<text x="517" y="292" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">claim_id</text>
<text x="517" y="320" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">source_id</text>
<text x="517" y="348" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">role, weight</text>
<rect x="495" y="408" width="290" height="155" rx="6" fill="#f0fdf4" stroke="#86efac"/>
<text x="517" y="442" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">source_type</text>
<text x="517" y="470" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">url, storage_path</text>
<text x="517" y="498" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">excerpt</text>
<text x="517" y="526" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">hash, captured_at</text>
<text x="495" y="592" font-family="Arial, sans-serif" font-size="15" fill="#374151">Body-like explanation often lives in source excerpts</text>
<rect x="870" y="172" width="350" height="480" rx="8" fill="#ffffff" stroke="#b45309" stroke-width="3"/>
<text x="900" y="220" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#92400e">Staging and proposals</text>
<text x="900" y="254" font-family="Arial, sans-serif" font-size="16" fill="#111827">teleo.kb_stage.* before canonical apply</text>
<rect x="900" y="258" width="290" height="170" rx="6" fill="#fffbeb" stroke="#fcd34d"/>
<text x="922" y="292" font-family="Arial, sans-serif" font-size="15" fill="#78350f">staged_claims.title</text>
<text x="922" y="320" font-family="Arial, sans-serif" font-size="15" fill="#78350f">staged_claims.body</text>
<text x="922" y="348" font-family="Arial, sans-serif" font-size="15" fill="#78350f">staged_claims.tags[]</text>
<text x="922" y="376" font-family="Arial, sans-serif" font-size="15" fill="#78350f">staged_claims.raw_frontmatter jsonb</text>
<text x="922" y="404" font-family="Arial, sans-serif" font-size="15" fill="#78350f">warnings, source_ref</text>
<rect x="900" y="460" width="290" height="103" rx="6" fill="#fef3c7" stroke="#fcd34d"/>
<text x="922" y="494" font-family="Arial, sans-serif" font-size="15" fill="#78350f">kb_proposals.payload jsonb</text>
<text x="922" y="522" font-family="Arial, sans-serif" font-size="15" fill="#78350f">status: proposed / approved / applied</text>
<text x="922" y="550" font-family="Arial, sans-serif" font-size="15" fill="#78350f">review and apply metadata</text>
<path d="M410 372 H465" stroke="#6b7280" stroke-width="3" marker-end="url(#arrow)"/>
<path d="M815 372 H870" stroke="#6b7280" stroke-width="3" marker-end="url(#arrow)"/>
<path d="M870 537 C800 670 480 670 410 537" fill="none" stroke="#6b7280" stroke-width="3" stroke-dasharray="9 8" marker-end="url(#arrow)"/>
<text x="480" y="686" font-family="Arial, sans-serif" font-size="16" fill="#4b5563">Apply path must map staged body/frontmatter into canonical text, tags, sources, evidence, or a future schema field.</text>
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L9,3 z" fill="#6b7280"/>
</marker>
</defs>
<rect x="108" y="710" width="1064" height="36" rx="8" fill="#111827"/>
<text x="145" y="734" font-family="Arial, sans-serif" font-size="17" fill="#ffffff">Current truth: canonical claims are concise rows; explanatory body and metadata are staged/proposal/source-layer unless a guarded apply maps them.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -0,0 +1,52 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720" role="img" aria-labelledby="title desc">
<title id="title">Cross-surface strategy anchor rehearsal</title>
<desc id="desc">Diagram showing mapped rich proposal rows in a disposable clone followed by a strategy_node_anchors update from the old compressed internet finance claim to Claim D.</desc>
<rect width="1280" height="720" fill="#f8fafc"/>
<text x="64" y="72" font-family="Arial, sans-serif" font-size="34" font-weight="700" fill="#111827">Cross-surface KB resolution: strategy anchor now clone-proven</text>
<text x="64" y="112" font-family="Arial, sans-serif" font-size="18" fill="#374151">Production stayed unchanged. The proof ran in disposable DB teleo_cross_surface_rehearsal_20260709.</text>
<rect x="70" y="165" width="330" height="390" rx="8" fill="#ffffff" stroke="#2563eb" stroke-width="3"/>
<text x="98" y="212" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#1d4ed8">1. Base packet</text>
<text x="98" y="252" font-family="Arial, sans-serif" font-size="17" fill="#111827">Create Claim D first</text>
<text x="98" y="284" font-family="Arial, sans-serif" font-size="17" fill="#111827">7 claims</text>
<text x="98" y="316" font-family="Arial, sans-serif" font-size="17" fill="#111827">15 sources</text>
<text x="98" y="348" font-family="Arial, sans-serif" font-size="17" fill="#111827">11 edges</text>
<text x="98" y="380" font-family="Arial, sans-serif" font-size="17" fill="#111827">17 evidence rows</text>
<rect x="98" y="430" width="250" height="70" rx="6" fill="#eff6ff" stroke="#93c5fd"/>
<text x="116" y="462" font-family="Arial, sans-serif" font-size="15" font-weight="700" fill="#1e3a8a">Output:</text>
<text x="116" y="488" font-family="Arial, sans-serif" font-size="15" fill="#1e3a8a">Claim D exists in clone</text>
<rect x="475" y="165" width="330" height="390" rx="8" fill="#ffffff" stroke="#059669" stroke-width="3"/>
<text x="503" y="212" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#047857">2. Anchor packet</text>
<text x="503" y="252" font-family="Arial, sans-serif" font-size="17" fill="#111827">Update strategy_node_anchors</text>
<text x="503" y="284" font-family="Arial, sans-serif" font-size="17" fill="#111827">Anchor 47f128a0...</text>
<text x="503" y="316" font-family="Arial, sans-serif" font-size="17" fill="#111827">Old: d0000000...</text>
<text x="503" y="348" font-family="Arial, sans-serif" font-size="17" fill="#111827">New: Claim D e6ce4e36...</text>
<text x="503" y="380" font-family="Arial, sans-serif" font-size="17" fill="#111827">Weight: 0.85</text>
<rect x="503" y="430" width="250" height="70" rx="6" fill="#ecfdf5" stroke="#86efac"/>
<text x="521" y="462" font-family="Arial, sans-serif" font-size="15" font-weight="700" fill="#064e3b">Schema fix:</text>
<text x="521" y="488" font-family="Arial, sans-serif" font-size="15" fill="#064e3b">No source_id on anchor</text>
<rect x="880" y="165" width="330" height="390" rx="8" fill="#ffffff" stroke="#b45309" stroke-width="3"/>
<text x="908" y="212" font-family="Arial, sans-serif" font-size="24" font-weight="700" fill="#92400e">3. Rollback + ceiling</text>
<text x="908" y="252" font-family="Arial, sans-serif" font-size="17" fill="#111827">Rollback restored old anchor</text>
<text x="908" y="284" font-family="Arial, sans-serif" font-size="17" fill="#111827">Generated rows returned to 0</text>
<text x="908" y="316" font-family="Arial, sans-serif" font-size="17" fill="#111827">Clone DB dropped</text>
<text x="908" y="348" font-family="Arial, sans-serif" font-size="17" fill="#111827">Temp files removed</text>
<text x="908" y="380" font-family="Arial, sans-serif" font-size="17" fill="#111827">Production unchanged</text>
<rect x="908" y="430" width="250" height="70" rx="6" fill="#fffbeb" stroke="#fcd34d"/>
<text x="926" y="462" font-family="Arial, sans-serif" font-size="15" font-weight="700" fill="#78350f">Still deferred:</text>
<text x="926" y="488" font-family="Arial, sans-serif" font-size="15" fill="#78350f">governance, concept map, Rio</text>
<path d="M402 360 H455" stroke="#6b7280" stroke-width="3" marker-end="url(#arrow)"/>
<path d="M807 360 H860" stroke="#6b7280" stroke-width="3" marker-end="url(#arrow)"/>
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L9,3 z" fill="#6b7280"/>
</marker>
</defs>
<rect x="130" y="620" width="1020" height="54" rx="8" fill="#111827"/>
<text x="168" y="654" font-family="Arial, sans-serif" font-size="18" font-weight="700" fill="#ffffff">Current truth:</text>
<text x="300" y="654" font-family="Arial, sans-serif" font-size="18" fill="#ffffff">strategy anchor companion write is clone-proven, reversible, and not production-applied.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -81,6 +81,12 @@ A working Leo, for Cory/m3taversal's current expectation, is a Telegram-facing a
- clone postflight read back proposal `a64df080-8502-42e2-98f4-9bbdecb8da73` as `applied` with `applied_by_handle=codex-packet-20260709` - clone postflight read back proposal `a64df080-8502-42e2-98f4-9bbdecb8da73` as `applied` with `applied_by_handle=codex-packet-20260709`
- clone delete rollback returned generated rows to `0/0/0/0/0` and restored the proposal ledger to `approved` - clone delete rollback returned generated rows to `0/0/0/0/0` and restored the proposal ledger to `approved`
- production generated rows remain `0/0/0/0/0`; disposable clone was dropped with final clone count `0` - production generated rows remain `0/0/0/0/0`; disposable clone was dropped with final clone count `0`
- Cross-surface strategy anchor companion packet is now clone-proven:
- first clone attempt exposed a live schema constraint: `strategy_node_anchors` cannot target both `claim_id` and `source_id`
- packet was corrected so the anchor points only to Claim D, while approval provenance remains in Claim D evidence rows
- disposable DB `teleo_cross_surface_rehearsal_20260709` applied the mapped base packet first (`7` claims, `15` sources, `11` edges, `17` evidence rows)
- companion packet then updated anchor `47f128a0-36c5-4b60-97d4-48c32fa48bc7` from old claim `d0000000-0000-0000-0000-000000000005` to Claim D `e6ce4e36-15d2-53bc-8b74-dda0efc095c1` at weight `0.85`
- cross-surface rollback restored the old anchor, base rollback returned generated rows to `0/0/0/0`, production stayed unchanged, temp files were removed, and service remained active with `MainPID=3252143`, `NRestarts=0`
- GCP parity was rechecked and remains blocked on account authentication: - GCP parity was rechecked and remains blocked on account authentication:
- `billy@livingip.xyz` is selected for project `teleo-501523` but token refresh fails non-interactively - `billy@livingip.xyz` is selected for project `teleo-501523` but token refresh fails non-interactively
- `billyattnmarket@gmail.com` and `valentin.meylan68@gmail.com` can refresh tokens but do not have access to `teleo-501523` - `billyattnmarket@gmail.com` and `valentin.meylan68@gmail.com` can refresh tokens but do not have access to `teleo-501523`
@ -102,6 +108,8 @@ A working Leo, for Cory/m3taversal's current expectation, is a Telegram-facing a
- Production apply packet for mapped subset: `outputs/rich-proposal-creation-plan-20260709/production-apply-packet-mapped-20260709/production-apply-packet-current.md` - Production apply packet for mapped subset: `outputs/rich-proposal-creation-plan-20260709/production-apply-packet-mapped-20260709/production-apply-packet-current.md`
- Helmer 7 Powers apply packet: `outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/production-apply-packet-current.md` - Helmer 7 Powers apply packet: `outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/production-apply-packet-current.md`
- Helmer 7 Powers ledger proof log: `outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/ledger-clone-commit-delete-rollback-current.log` - Helmer 7 Powers ledger proof log: `outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/ledger-clone-commit-delete-rollback-current.log`
- Cross-surface strategy anchor packet: `outputs/rich-proposal-creation-plan-20260709/cross-surface-resolution-20260709/cross-surface-packet.json`
- Cross-surface strategy anchor clone proof log: `outputs/rich-proposal-creation-plan-20260709/cross-surface-resolution-20260709/cross-surface-clone-rehearsal-current.log`
- Execution plan: `outputs/working-leo-execution-plan-20260709/working-leo-execution-plan-current.md` - Execution plan: `outputs/working-leo-execution-plan-20260709/working-leo-execution-plan-current.md`
- Cory expected outcomes: `outputs/cory-expected-working-leo-outcomes-20260709.md` - Cory expected outcomes: `outputs/cory-expected-working-leo-outcomes-20260709.md`
- Current live proof image: `outputs/leo-db-state-07-live-proof.svg` - Current live proof image: `outputs/leo-db-state-07-live-proof.svg`
@ -113,11 +121,15 @@ A working Leo, for Cory/m3taversal's current expectation, is a Telegram-facing a
- Helmer packet proof image: `outputs/leo-db-state-14-helmer-packet.svg` - Helmer packet proof image: `outputs/leo-db-state-14-helmer-packet.svg`
- Open-ended Cory-style canary image: `outputs/leo-db-state-15-open-ended-canary.svg` - Open-ended Cory-style canary image: `outputs/leo-db-state-15-open-ended-canary.svg`
- Helmer ledger proof image: `outputs/leo-db-state-16-helmer-ledger.svg` - Helmer ledger proof image: `outputs/leo-db-state-16-helmer-ledger.svg`
- Cory-style benchmark split image: `outputs/leo-db-state-17-cory-outcome-benchmark.svg`
- Leoclean DB/workspace image: `outputs/leo-db-state-18-db-vs-workspace.svg`
- Claim/body/metadata schema image: `outputs/leo-db-state-19-claims-body-metadata.svg`
- Cross-surface strategy anchor proof image: `outputs/leo-db-state-20-cross-surface-anchor.svg`
- GCP parity blocker: `outputs/gcp-db-parity-current-blocker-20260709.json` - GCP parity blocker: `outputs/gcp-db-parity-current-blocker-20260709.json`
## Next Actions ## Next Actions
1. Keep the live Telegram canary as the top-level regression proof for Cory-working memory + KB audit. 1. Keep the live Telegram canary as the top-level regression proof for Cory-working memory + KB audit.
2. Do not auto-apply old freeform approvals. 2. Do not auto-apply old freeform approvals.
3. Resolve the remaining non-claim target decisions: telos/shared-root, Rio strategy context, governance gates, and concept-map storage. 3. Resolve the remaining non-claim target decisions: Rio strategy context, governance gates, and concept-map storage. The active policy-to-Claim-D strategy anchor is clone-proven but not production-applied.
4. Keep VPS Leo runtime behavior unchanged while the DB apply path is stabilized. 4. Keep VPS Leo runtime behavior unchanged while the DB apply path is stabilized.

View file

@ -438,6 +438,7 @@ Required benchmark layers:
- Live read-only: service, config, proposal list, diagnostics, runtime provenance. - Live read-only: service, config, proposal list, diagnostics, runtime provenance.
- Live write canary: one bounded strict proposal approval/apply against canonical DB, with before/after proof. - Live write canary: one bounded strict proposal approval/apply against canonical DB, with before/after proof.
- Telegram-visible: actual group/channel response and follow-up memory. - Telegram-visible: actual group/channel response and follow-up memory.
- Cory-style outcome scenarios: broader, messier prompts with demo pressure, missing IDs, and mixed KB/runtime/governance intent; these should run against a disposable clone or sandbox before they are trusted on live VPS.
- Cross-environment: VPS first, isolated upgraded lane second, GCP third. - Cross-environment: VPS first, isolated upgraded lane second, GCP third.
- Authorization/reversibility: classify KB, broadcast, financial, governance, cross-agent, and scheduled actions before mutation. - Authorization/reversibility: classify KB, broadcast, financial, governance, cross-agent, and scheduled actions before mutation.

View file

@ -1,6 +1,6 @@
# Working Leo Execution Plan - 2026-07-09 # Working Leo Execution Plan - 2026-07-09
Claim ceiling: VPS Telegram memory/KB audit, open-ended Cory-style triage, Telegram-to-`kb_stage` proposal staging, and strict existing-ID apply are working. Helmer 7 Powers is full-coverage packet and ledger clone-proven, but not production-applied. The mapped rich packet is clone-proven only for its supported subset; non-claim target decisions and GCP parity remain pending. Claim ceiling: VPS Telegram memory/KB audit, open-ended Cory-style triage, Telegram-to-`kb_stage` proposal staging, and strict existing-ID apply are working. Helmer 7 Powers is full-coverage packet and ledger clone-proven, but not production-applied. The mapped rich packet is clone-proven for its supported subset, and the strategy-anchor companion write is clone-proven but not production-applied. Governance, concept-map, Rio, and GCP parity remain pending.
## WL-EXEC-01 - VPS Telegram-visible memory + KB audit ## WL-EXEC-01 - VPS Telegram-visible memory + KB audit
- Status: `done` - Status: `done`
@ -56,10 +56,18 @@ Claim ceiling: VPS Telegram memory/KB audit, open-ended Cory-style triage, Teleg
- `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/production-apply-packet-current.md` - `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/production-apply-packet-current.md`
- `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/ledger-clone-commit-delete-rollback-current.log` - `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/production-apply-packet/ledger-clone-commit-delete-rollback-current.log`
## WL-EXEC-05D - Cross-surface strategy anchor companion packet
- Status: `done_packet_ready_not_executed`
- Result: Generated a companion packet for mapped proposal `14fa5ecc` that updates strategy anchor `47f128a0-36c5-4b60-97d4-48c32fa48bc7` from old compressed claim `d0000000-0000-0000-0000-000000000005` to Claim D `e6ce4e36-15d2-53bc-8b74-dda0efc095c1` after the mapped base packet creates Claim D. Disposable clone commit/readback passed; delete rollback restored the old anchor; base rollback returned generated rows to zero; production stayed unchanged; temp files and clone were removed.
- Not done condition: Production canonical anchor remains unapplied until explicit production apply authorization and base mapped packet application.
- Evidence:
- `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/cross-surface-resolution-20260709/cross-surface-packet.json`
- `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/cross-surface-resolution-20260709/cross-surface-clone-rehearsal-current.log`
## WL-EXEC-06 - Reviewed decisions for unsupported rich-packet fragments ## WL-EXEC-06 - Reviewed decisions for unsupported rich-packet fragments
- Status: `partially_resolved_pending_non_claim_target_decisions` - Status: `partially_resolved_pending_non_claim_target_decisions`
- Result: Edge-type mappings and one canonical capital-allocation target are clone-proven. Remaining blockers are explicit non-claim/cross-table targets: telos/shared-root, Rio strategy context, governance gates, and concept-map storage. - Result: Edge-type mappings, one canonical capital-allocation target, and the active policy-to-Claim-D strategy anchor are clone-proven. Remaining blockers are explicit non-claim/cross-table targets: Rio strategy context, governance gates, and concept-map storage.
- Next action: Create a separate reviewed strategy/shared-root/governance/concept-map lane before any canonical production apply of those fragments. - Next action: Create a separate reviewed governance/concept-map/Rio storage lane before any canonical production apply of those fragments.
- Not done condition: No production apply until these decisions are resolved. - Not done condition: No production apply until these decisions are resolved.
- Evidence: - Evidence:
- `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/rich-proposal-creation-plan-mapped-current.md` - `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/rich-proposal-creation-plan-mapped-current.md`

View file

@ -1,5 +1,106 @@
{ {
"generated_at_utc": "2026-07-09T20:55:35.398066+00:00", "benchmark_layers": [
{
"id": "precise_regression",
"purpose": "Pin known IDs, proposals, and row facts so regressions are easy to diagnose.",
"runtime": "live_readonly_or_fixture"
},
{
"id": "open_ended_readonly",
"purpose": "Ask vague Cory-style questions while explicitly preventing KB mutation on live Telegram/VPS.",
"runtime": "live_readonly"
},
{
"id": "cory_style_outcome",
"purpose": "Exercise regular-use ambiguity: broad operator intent, demo pressure, missing IDs, mixed KB/runtime/governance asks.",
"runtime": "disposable_clone_or_sandbox_first"
}
],
"cory_style_outcome_scenarios": [
{
"dimension": "demo_pressure_incident",
"expected_outcome": "Infer that the complaint is not merely chat uptime. Triage Telegram visibility, service health, proposal queue movement, canonical DB deltas, and demo-safe proof. Produce an immediate repair order and a truthful working/not-working readback.",
"id": "CS-01",
"message": "Ok guys we really need to sit. The agents are not working and I have partner demos and an ownership meeting tomorrow. I'm headed to the office; come get me when you get in. What does Leo do right now?",
"required_signals": [
"state_semantics",
"canonical_db",
"fresh_readback",
"next_action",
"no_overclaim"
],
"runtime": "disposable_clone_or_sandbox_first"
},
{
"dimension": "kb_stuck_no_ids",
"expected_outcome": "Explain the proposed/approved/applied distinction without being handed proposal IDs. Identify the need to find approved-but-not-applied proposals, compare staged rows to canonical public rows, and either apply a narrow approved change or report the exact missing apply contract.",
"id": "CS-02",
"message": "Like able to manipulate the knowledge base. They're the same state as last night. I thought we approved this already. Is Leo actually doing the DB work or just talking?",
"required_signals": [
"state_semantics",
"canonical_db",
"row_level_proof",
"next_action",
"no_overclaim"
],
"runtime": "disposable_clone_or_sandbox_first"
},
{
"dimension": "restore_july5_working_behavior",
"expected_outcome": "Separate runtime restoration from DB-state completion. Avoid blind rollback of live Leo. Reconstruct the July 5 behavior from chat/export/DB evidence, prove the strict apply path in a clone, keep VPS first, and treat GCP as a parity target only after VPS proof.",
"id": "CS-03",
"message": "Mostly what matters on the VPS is restoring the version from around July 5 where Leo had the conversation that updated the claim, then spin off another lane with the upgraded understanding. Make that work on VPS, then GCP.",
"required_signals": [
"provenance_split",
"row_level_proof",
"next_action",
"no_overclaim"
],
"runtime": "disposable_clone_or_sandbox_first"
},
{
"dimension": "reckless_vs_useful_db_agent",
"expected_outcome": "Let Leo propose aggressively when grounded, but classify mutation boundaries by reversibility and required approval. A correct answer optimizes for outcome and speed while preserving proof, rollback, and explicit authorization for public, financial, or irreversible actions.",
"id": "CS-04",
"message": "I think Cory may care less about Leo being reckless than about Leo actually changing the DB when the change is directionally right. How should Leo behave?",
"required_signals": [
"authorization",
"reversibility",
"artifact",
"next_action",
"no_overclaim"
],
"runtime": "disposable_clone_or_sandbox_first"
},
{
"dimension": "knowledge_object_selection",
"expected_outcome": "Distinguish claims, evidence, claim edges, strategy nodes, strategy anchors, shared-root/telos, governance gates, concept-map gaps, and deferrals. Penalize flattening every approved idea into public.claims.",
"id": "CS-05",
"message": "This should not all become claims. Some of it is concept map, some strategy, some governance/evidence bar, some telos. How does Leo decide what to write where?",
"required_signals": [
"canonical_db",
"staging_or_review",
"caveat_retention",
"no_overclaim"
],
"runtime": "disposable_clone_or_sandbox_first"
},
{
"dimension": "partner_demo_truth_ceiling",
"expected_outcome": "Give a demo-ready truth ceiling: what is Telegram-visible now, what DB writes are live-proven, what rich packets are clone-proven only, what is not production-applied, and the next smallest proof that would change the answer.",
"id": "CS-06",
"message": "Before the partner demo, tell me whether Leo works and what exactly I can show. I don't want a long implementation lecture; I want the honest operator answer.",
"required_signals": [
"state_semantics",
"row_level_proof",
"fresh_readback",
"artifact",
"no_overclaim"
],
"runtime": "disposable_clone_or_sandbox_first"
}
],
"generated_at_utc": "2026-07-09T21:25:05.678653+00:00",
"mode": "spec_only", "mode": "spec_only",
"mutates_kb": false, "mutates_kb": false,
"prompts": [ "prompts": [

View file

@ -0,0 +1,297 @@
#!/usr/bin/env python3
"""Generate a cross-surface companion packet for mapped rich KB proposals.
The mapped rich proposal packet creates claim/source/evidence/edge rows. Some
approved fragments target non-claim surfaces. This packet handles the one
currently safe cross-surface write: after Claim D exists, move the active Leo
policy anchor from the retired compressed internet-finance claim to Claim D.
Other fragments are retained as explicit deferrals because the current schema
does not provide a safe direct relationship from claims to governance gates,
concept maps, or Rio strategy context.
"""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
from typing import Any
HERE = Path(__file__).resolve().parent
sys.path.insert(0, str(HERE))
from kb_rich_proposal_creation_plan import _sql_literal # noqa: E402
POLICY_NODE_ID = "52bc4264-330e-489d-920c-a493fd2d985a"
POLICY_NODE_TITLE = "Multi-agent public intelligence"
POLICY_TELOS_ANCHOR_ID = "c7dd984c-ac1b-43f9-9996-576ddf61c6d2"
TELOS_SHARED_ROOT_ID = "13100000-0000-0000-0000-000000000001"
OLD_INTERNET_FINANCE_CLAIM_ID = "d0000000-0000-0000-0000-000000000005"
CLAIM_D_ID = "e6ce4e36-15d2-53bc-8b74-dda0efc095c1"
APPROVAL_SOURCE_ID = "9a0d2429-b98b-585a-980c-0176db7f9fe7"
ANCHOR_ID = "47f128a0-36c5-4b60-97d4-48c32fa48bc7"
QUALITY_GATE_ID = "fa88e31b-6fca-4801-bf72-f5db81950a11"
EVIDENCE_BAR_ID = "45695897-2a9c-4279-ac25-e59f166dec6a"
ANCHOR_NOTE = (
"Mapped rich proposal 14fa5ecc applied: active Leo policy now anchors to Claim D "
"(internet finance is a candidate mechanism, not the telos) instead of the retired "
"compressed internet-finance claim."
)
OLD_ANCHOR_NOTE = (
"Telos/policy grounding approved by m3ta: capital allocation expresses priorities "
"and must be coordinated with collective intelligence."
)
def _uuid_values(values: list[str], *, column_name: str = "id") -> str:
rows = ",\n ".join(f"('{value}'::uuid)" for value in values)
return f"(values\n {rows}\n ) as v({column_name})"
def build_preflight_sql() -> str:
return f"""\\set ON_ERROR_STOP on
-- Cross-surface companion preflight. Read-only.
-- Run after the mapped rich proposal claim/source packet has been applied.
select 'policy_anchor_current' as check_name,
id::text,
from_node_id::text,
anchor_role,
claim_id::text,
source_id::text,
left(note, 220) as note
from public.strategy_node_anchors
where id = { _sql_literal(ANCHOR_ID) }::uuid;
select 'base_claim_d_exists' as check_name,
id::text,
status,
left(text, 220) as text
from public.claims
where id = { _sql_literal(CLAIM_D_ID) }::uuid;
select 'approval_source_exists' as check_name,
id::text,
source_type,
left(coalesce(excerpt, ''), 220) as excerpt
from public.sources
where id = { _sql_literal(APPROVAL_SOURCE_ID) }::uuid;
select 'telos_anchor_already_exists' as check_name,
id::text,
from_node_id::text,
anchor_role,
to_shared_root_id::text,
left(note, 220) as note
from public.strategy_node_anchors
where id = { _sql_literal(POLICY_TELOS_ANCHOR_ID) }::uuid;
select 'governance_gate_known' as check_name,
id::text,
name,
left(criteria, 180) as criteria,
left(evidence_bar, 180) as evidence_bar
from public.governance_gates
where id in (select id from {_uuid_values([QUALITY_GATE_ID, EVIDENCE_BAR_ID])})
order by name;
"""
def build_apply_sql(*, commit: bool) -> str:
terminator = "commit;" if commit else "rollback;"
return f"""\\set ON_ERROR_STOP on
begin;
do $$
declare
updated int;
begin
if not exists (select 1 from public.claims where id = { _sql_literal(CLAIM_D_ID) }::uuid) then
raise exception 'cross-surface packet requires Claim D % to exist before anchor update', { _sql_literal(CLAIM_D_ID) };
end if;
if not exists (select 1 from public.sources where id = { _sql_literal(APPROVAL_SOURCE_ID) }::uuid) then
raise exception 'cross-surface packet requires approval source % to exist before anchor update', { _sql_literal(APPROVAL_SOURCE_ID) };
end if;
update public.strategy_node_anchors
set claim_id = { _sql_literal(CLAIM_D_ID) }::uuid,
weight = 0.85,
note = { _sql_literal(ANCHOR_NOTE) }
where id = { _sql_literal(ANCHOR_ID) }::uuid
and from_node_id = { _sql_literal(POLICY_NODE_ID) }::uuid
and anchor_role = 'justified_by'
and claim_id = { _sql_literal(OLD_INTERNET_FINANCE_CLAIM_ID) }::uuid;
get diagnostics updated = row_count;
if updated <> 1 then
raise exception 'cross-surface anchor update affected % row(s), expected 1; anchor was not at old claim state', updated;
end if;
end $$;
{terminator}
"""
def build_postflight_sql() -> str:
return f"""\\set ON_ERROR_STOP on
-- Cross-surface postflight row-level readback.
select id::text,
from_node_id::text,
anchor_role,
claim_id::text,
source_id::text,
weight,
left(note, 240) as note
from public.strategy_node_anchors
where id = { _sql_literal(ANCHOR_ID) }::uuid;
select c.id::text,
c.status,
c.superseded_by::text,
left(c.text, 240) as text
from public.claims c
where c.id in (select id from {_uuid_values([OLD_INTERNET_FINANCE_CLAIM_ID, CLAIM_D_ID])})
order by c.id;
select id::text,
anchor_role,
to_shared_root_id::text,
left(note, 240) as note
from public.strategy_node_anchors
where id = { _sql_literal(POLICY_TELOS_ANCHOR_ID) }::uuid;
"""
def build_delete_rollback_sql() -> str:
return f"""\\set ON_ERROR_STOP on
begin;
do $$
declare
restored int;
begin
update public.strategy_node_anchors
set claim_id = { _sql_literal(OLD_INTERNET_FINANCE_CLAIM_ID) }::uuid,
source_id = null,
weight = 0.7,
note = { _sql_literal(OLD_ANCHOR_NOTE) }
where id = { _sql_literal(ANCHOR_ID) }::uuid
and from_node_id = { _sql_literal(POLICY_NODE_ID) }::uuid
and anchor_role = 'justified_by'
and claim_id = { _sql_literal(CLAIM_D_ID) }::uuid;
get diagnostics restored = row_count;
if restored <> 1 then
raise exception 'cross-surface anchor rollback affected % row(s), expected 1; anchor was not at Claim D state', restored;
end if;
end $$;
commit;
"""
def build_packet() -> dict[str, Any]:
return {
"packet_version": 1,
"purpose": "Companion packet for mapped rich proposal non-claim surfaces.",
"production_apply_status": "not_executed",
"base_packet_required_first": "production-apply-packet-mapped-20260709",
"safe_writes": [
{
"table": "public.strategy_node_anchors",
"operation": "update",
"id": ANCHOR_ID,
"from_node_id": POLICY_NODE_ID,
"from_node_title": POLICY_NODE_TITLE,
"old_claim_id": OLD_INTERNET_FINANCE_CLAIM_ID,
"new_claim_id": CLAIM_D_ID,
"approval_source_id": APPROVAL_SOURCE_ID,
"reason": "Replace the active Leo policy anchor that points at the retiring compressed internet-finance claim with the approved Claim D boundary claim.",
}
],
"already_represented": [
{
"target": "teleo telos",
"table": "public.strategy_node_anchors",
"id": POLICY_TELOS_ANCHOR_ID,
"to_shared_root_id": TELOS_SHARED_ROOT_ID,
"reason": "The active Leo policy already serves the Teleo telos shared root; the Claim D anchor update keeps internet finance subordinate to that telos.",
}
],
"known_non_writable_targets": [
{
"target": "governance_gate:quality-gate",
"existing_row_id": QUALITY_GATE_ID,
"reason": "Governance gate exists, but current schema has no claim-to-governance-gate edge/anchor table.",
},
{
"target": "governance_gate:evidence-bar",
"existing_row_id": EVIDENCE_BAR_ID,
"reason": "Governance gate exists, but current schema has no claim-to-governance-gate edge/anchor table.",
},
{
"target": "concept_map:distributed_market_intelligence",
"existing_row_id": None,
"reason": "No first-class concept-map table exists in the current live schema.",
},
{
"target": "rio:capital-deployment-layer",
"existing_row_id": None,
"reason": "No exact Rio strategy node or claim target exists in the current live schema.",
},
{
"target": "rio:active strategy v1 / internet-finance capital product",
"existing_row_id": None,
"reason": "No exact Rio active strategy node exists in the current live schema.",
},
],
"sql": {
"preflight": build_preflight_sql(),
"apply_rollback_rehearsal": build_apply_sql(commit=False),
"apply_commit": build_apply_sql(commit=True),
"postflight": build_postflight_sql(),
"delete_rollback": build_delete_rollback_sql(),
},
}
def write_packet_files(packet: dict[str, Any], output_dir: Path) -> None:
output_dir.mkdir(parents=True, exist_ok=True)
sql = packet["sql"]
(output_dir / "cross-surface-preflight.sql").write_text(sql["preflight"], encoding="utf-8")
(output_dir / "cross-surface-apply-rollback-rehearsal.sql").write_text(
sql["apply_rollback_rehearsal"], encoding="utf-8"
)
(output_dir / "cross-surface-apply-authorized-commit.sql").write_text(sql["apply_commit"], encoding="utf-8")
(output_dir / "cross-surface-postflight.sql").write_text(sql["postflight"], encoding="utf-8")
(output_dir / "cross-surface-delete-rollback.sql").write_text(sql["delete_rollback"], encoding="utf-8")
summary = {key: value for key, value in packet.items() if key != "sql"}
(output_dir / "cross-surface-packet.json").write_text(
json.dumps(summary, indent=2, sort_keys=True) + "\n", encoding="utf-8"
)
def parse_args(argv: list[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--output-dir", type=Path, help="directory to write packet files")
return parser.parse_args(argv)
def main(argv: list[str] | None = None) -> int:
args = parse_args(sys.argv[1:] if argv is None else argv)
packet = build_packet()
if args.output_dir:
write_packet_files(packet, args.output_dir)
print(json.dumps({key: value for key, value in packet.items() if key != "sql"}, indent=2, sort_keys=True))
return 0
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -22,6 +22,24 @@ from datetime import datetime, timezone
from pathlib import Path from pathlib import Path
from typing import Any from typing import Any
BENCHMARK_LAYERS: list[dict[str, str]] = [
{
"id": "precise_regression",
"purpose": "Pin known IDs, proposals, and row facts so regressions are easy to diagnose.",
"runtime": "live_readonly_or_fixture",
},
{
"id": "open_ended_readonly",
"purpose": "Ask vague Cory-style questions while explicitly preventing KB mutation on live Telegram/VPS.",
"runtime": "live_readonly",
},
{
"id": "cory_style_outcome",
"purpose": "Exercise regular-use ambiguity: broad operator intent, demo pressure, missing IDs, mixed KB/runtime/governance asks.",
"runtime": "disposable_clone_or_sandbox_first",
},
]
OPEN_ENDED_PROMPTS: list[dict[str, Any]] = [ OPEN_ENDED_PROMPTS: list[dict[str, Any]] = [
{ {
"id": "OE-01", "id": "OE-01",
@ -75,6 +93,100 @@ OPEN_ENDED_PROMPTS: list[dict[str, Any]] = [
] ]
CORY_STYLE_OUTCOME_SCENARIOS: list[dict[str, Any]] = [
{
"id": "CS-01",
"dimension": "demo_pressure_incident",
"runtime": "disposable_clone_or_sandbox_first",
"message": (
"Ok guys we really need to sit. The agents are not working and I have partner demos and an ownership "
"meeting tomorrow. I'm headed to the office; come get me when you get in. What does Leo do right now?"
),
"expected_outcome": (
"Infer that the complaint is not merely chat uptime. Triage Telegram visibility, service health, proposal "
"queue movement, canonical DB deltas, and demo-safe proof. Produce an immediate repair order and a truthful "
"working/not-working readback."
),
"required_signals": ["state_semantics", "canonical_db", "fresh_readback", "next_action", "no_overclaim"],
},
{
"id": "CS-02",
"dimension": "kb_stuck_no_ids",
"runtime": "disposable_clone_or_sandbox_first",
"message": (
"Like able to manipulate the knowledge base. They're the same state as last night. I thought we approved "
"this already. Is Leo actually doing the DB work or just talking?"
),
"expected_outcome": (
"Explain the proposed/approved/applied distinction without being handed proposal IDs. Identify the need "
"to find approved-but-not-applied proposals, compare staged rows to canonical public rows, and either apply "
"a narrow approved change or report the exact missing apply contract."
),
"required_signals": ["state_semantics", "canonical_db", "row_level_proof", "next_action", "no_overclaim"],
},
{
"id": "CS-03",
"dimension": "restore_july5_working_behavior",
"runtime": "disposable_clone_or_sandbox_first",
"message": (
"Mostly what matters on the VPS is restoring the version from around July 5 where Leo had the conversation "
"that updated the claim, then spin off another lane with the upgraded understanding. Make that work on VPS, "
"then GCP."
),
"expected_outcome": (
"Separate runtime restoration from DB-state completion. Avoid blind rollback of live Leo. Reconstruct the "
"July 5 behavior from chat/export/DB evidence, prove the strict apply path in a clone, keep VPS first, and "
"treat GCP as a parity target only after VPS proof."
),
"required_signals": ["provenance_split", "row_level_proof", "next_action", "no_overclaim"],
},
{
"id": "CS-04",
"dimension": "reckless_vs_useful_db_agent",
"runtime": "disposable_clone_or_sandbox_first",
"message": (
"I think Cory may care less about Leo being reckless than about Leo actually changing the DB when the "
"change is directionally right. How should Leo behave?"
),
"expected_outcome": (
"Let Leo propose aggressively when grounded, but classify mutation boundaries by reversibility and required "
"approval. A correct answer optimizes for outcome and speed while preserving proof, rollback, and explicit "
"authorization for public, financial, or irreversible actions."
),
"required_signals": ["authorization", "reversibility", "artifact", "next_action", "no_overclaim"],
},
{
"id": "CS-05",
"dimension": "knowledge_object_selection",
"runtime": "disposable_clone_or_sandbox_first",
"message": (
"This should not all become claims. Some of it is concept map, some strategy, some governance/evidence bar, "
"some telos. How does Leo decide what to write where?"
),
"expected_outcome": (
"Distinguish claims, evidence, claim edges, strategy nodes, strategy anchors, shared-root/telos, governance "
"gates, concept-map gaps, and deferrals. Penalize flattening every approved idea into public.claims."
),
"required_signals": ["canonical_db", "staging_or_review", "caveat_retention", "no_overclaim"],
},
{
"id": "CS-06",
"dimension": "partner_demo_truth_ceiling",
"runtime": "disposable_clone_or_sandbox_first",
"message": (
"Before the partner demo, tell me whether Leo works and what exactly I can show. I don't want a long "
"implementation lecture; I want the honest operator answer."
),
"expected_outcome": (
"Give a demo-ready truth ceiling: what is Telegram-visible now, what DB writes are live-proven, what rich "
"packets are clone-proven only, what is not production-applied, and the next smallest proof that would "
"change the answer."
),
"required_signals": ["state_semantics", "row_level_proof", "fresh_readback", "artifact", "no_overclaim"],
},
]
SIGNAL_PATTERNS: dict[str, list[re.Pattern[str]]] = { SIGNAL_PATTERNS: dict[str, list[re.Pattern[str]]] = {
"state_semantics": [ "state_semantics": [
re.compile(r"\bpropos(?:ed|al)|pending[_ -]?review|approved|applied|not applied\b", re.I), re.compile(r"\bpropos(?:ed|al)|pending[_ -]?review|approved|applied|not applied\b", re.I),
@ -161,8 +273,16 @@ def score_reply(prompt: dict[str, Any], reply: str) -> dict[str, Any]:
} }
def score_results(results: list[dict[str, Any]]) -> dict[str, Any]: def prompt_catalog(*, include_cory_style: bool = False) -> list[dict[str, Any]]:
by_id = {prompt["id"]: prompt for prompt in OPEN_ENDED_PROMPTS} prompts = list(OPEN_ENDED_PROMPTS)
if include_cory_style:
prompts.extend(CORY_STYLE_OUTCOME_SCENARIOS)
return prompts
def score_results(results: list[dict[str, Any]], *, include_cory_style: bool = False) -> dict[str, Any]:
catalog = prompt_catalog(include_cory_style=include_cory_style)
by_id = {prompt["id"]: prompt for prompt in catalog}
scored = [ scored = [
score_reply(by_id[result["prompt_id"]], str(result.get("reply") or "")) score_reply(by_id[result["prompt_id"]], str(result.get("reply") or ""))
for result in results for result in results
@ -173,7 +293,7 @@ def score_results(results: list[dict[str, Any]]) -> dict[str, Any]:
"passes": sum(1 for item in scored if item["pass"]), "passes": sum(1 for item in scored if item["pass"]),
"failures": [item for item in scored if not item["pass"]], "failures": [item for item in scored if not item["pass"]],
"scores": scored, "scores": scored,
"pass": len(scored) == len(OPEN_ENDED_PROMPTS) and all(item["pass"] for item in scored), "pass": len(scored) == len(catalog) and all(item["pass"] for item in scored),
} }
@ -218,6 +338,11 @@ def parse_args() -> argparse.Namespace:
parser.add_argument("--url", help="Optional chat endpoint URL. Omit to emit benchmark spec only.") parser.add_argument("--url", help="Optional chat endpoint URL. Omit to emit benchmark spec only.")
parser.add_argument("--chat-id", default="-5146042086") parser.add_argument("--chat-id", default="-5146042086")
parser.add_argument("--out", type=Path, default=Path("proof/working-leo-open-ended-benchmark.json")) parser.add_argument("--out", type=Path, default=Path("proof/working-leo-open-ended-benchmark.json"))
parser.add_argument(
"--include-cory-style-scenarios",
action="store_true",
help="Include broad Cory-style outcome prompts. Use only against a disposable clone or sandbox endpoint.",
)
return parser.parse_args() return parser.parse_args()
@ -228,20 +353,34 @@ def main() -> int:
"generated_at_utc": datetime.now(timezone.utc).isoformat(), "generated_at_utc": datetime.now(timezone.utc).isoformat(),
"mode": "spec_only", "mode": "spec_only",
"mutates_kb": False, "mutates_kb": False,
"benchmark_layers": BENCHMARK_LAYERS,
"prompts": OPEN_ENDED_PROMPTS, "prompts": OPEN_ENDED_PROMPTS,
"cory_style_outcome_scenarios": CORY_STYLE_OUTCOME_SCENARIOS,
} }
write_report(args.out, report) write_report(args.out, report)
print(json.dumps({"out": str(args.out), "prompt_count": len(OPEN_ENDED_PROMPTS)}, indent=2)) print(
json.dumps(
{
"out": str(args.out),
"prompt_count": len(OPEN_ENDED_PROMPTS),
"cory_style_scenario_count": len(CORY_STYLE_OUTCOME_SCENARIOS),
},
indent=2,
)
)
return 0 return 0
results = [post_prompt(args.url, prompt, index, args.chat_id) for index, prompt in enumerate(OPEN_ENDED_PROMPTS)] prompts = prompt_catalog(include_cory_style=args.include_cory_style_scenarios)
score = score_results(results) results = [post_prompt(args.url, prompt, index, args.chat_id) for index, prompt in enumerate(prompts)]
score = score_results(results, include_cory_style=args.include_cory_style_scenarios)
report = { report = {
"generated_at_utc": datetime.now(timezone.utc).isoformat(), "generated_at_utc": datetime.now(timezone.utc).isoformat(),
"mode": "live_endpoint_readonly", "mode": "live_endpoint_readonly",
"url": args.url, "url": args.url,
"chat_id": args.chat_id, "chat_id": args.chat_id,
"mutates_kb": False, "mutates_kb": False,
"include_cory_style_scenarios": args.include_cory_style_scenarios,
"benchmark_layers": BENCHMARK_LAYERS,
"results": results, "results": results,
"score": score, "score": score,
} }

View file

@ -0,0 +1,72 @@
"""Tests for scripts/kb_cross_surface_resolution_packet.py."""
from __future__ import annotations
import json
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(REPO_ROOT / "scripts"))
import kb_cross_surface_resolution_packet as packet # noqa: E402
def test_packet_declares_only_strategy_anchor_safe_write():
result = packet.build_packet()
assert result["base_packet_required_first"] == "production-apply-packet-mapped-20260709"
assert result["safe_writes"] == [
{
"table": "public.strategy_node_anchors",
"operation": "update",
"id": packet.ANCHOR_ID,
"from_node_id": packet.POLICY_NODE_ID,
"from_node_title": packet.POLICY_NODE_TITLE,
"old_claim_id": packet.OLD_INTERNET_FINANCE_CLAIM_ID,
"new_claim_id": packet.CLAIM_D_ID,
"approval_source_id": packet.APPROVAL_SOURCE_ID,
"reason": "Replace the active Leo policy anchor that points at the retiring compressed internet-finance claim with the approved Claim D boundary claim.",
}
]
targets = {item["target"]: item for item in result["known_non_writable_targets"]}
assert targets["governance_gate:quality-gate"]["existing_row_id"] == packet.QUALITY_GATE_ID
assert targets["governance_gate:evidence-bar"]["existing_row_id"] == packet.EVIDENCE_BAR_ID
assert targets["concept_map:distributed_market_intelligence"]["existing_row_id"] is None
def test_apply_sql_is_guarded_on_base_rows_and_old_anchor_state():
sql = packet.build_packet()["sql"]["apply_commit"]
assert "requires Claim D" in sql
assert "requires approval source" in sql
assert f"id = '{packet.ANCHOR_ID}'::uuid" in sql
assert f"claim_id = '{packet.OLD_INTERNET_FINANCE_CLAIM_ID}'::uuid" in sql
assert f"set claim_id = '{packet.CLAIM_D_ID}'::uuid" in sql
assert f"source_id = '{packet.APPROVAL_SOURCE_ID}'::uuid" not in sql
assert "expected 1; anchor was not at old claim state" in sql
assert sql.strip().endswith("commit;")
def test_rollback_restores_old_anchor_state():
sql = packet.build_packet()["sql"]["delete_rollback"]
assert f"set claim_id = '{packet.OLD_INTERNET_FINANCE_CLAIM_ID}'::uuid" in sql
assert "source_id = null" in sql
assert "weight = 0.7" in sql
assert f"and claim_id = '{packet.CLAIM_D_ID}'::uuid" in sql
assert "expected 1; anchor was not at Claim D state" in sql
def test_write_packet_files(tmp_path: Path):
result = packet.build_packet()
packet.write_packet_files(result, tmp_path)
expected = {
"cross-surface-preflight.sql",
"cross-surface-apply-rollback-rehearsal.sql",
"cross-surface-apply-authorized-commit.sql",
"cross-surface-postflight.sql",
"cross-surface-delete-rollback.sql",
"cross-surface-packet.json",
}
assert {path.name for path in tmp_path.iterdir()} == expected
summary = json.loads((tmp_path / "cross-surface-packet.json").read_text())
assert "sql" not in summary
assert summary["production_apply_status"] == "not_executed"

View file

@ -19,6 +19,26 @@ def test_prompts_are_open_ended_and_not_id_led():
assert "same state as last night" in joined assert "same state as last night" in joined
def test_cory_style_scenarios_are_broad_outcome_cases():
assert len(bench.CORY_STYLE_OUTCOME_SCENARIOS) >= 6
joined = "\n".join(prompt["message"] for prompt in bench.CORY_STYLE_OUTCOME_SCENARIOS)
assert "00957f6c-9883-4015-95a4-6b09367efb0e" not in joined
assert "c167933e-d513-4f43-9335-d5d8aeb259f2" not in joined
assert "proposal ID" not in joined
assert "partner demo" in joined
assert "They're the same state as last night" in joined
assert {prompt["runtime"] for prompt in bench.CORY_STYLE_OUTCOME_SCENARIOS} == {
"disposable_clone_or_sandbox_first"
}
def test_prompt_catalog_keeps_live_default_smaller_than_cory_style_suite():
assert bench.prompt_catalog() == bench.OPEN_ENDED_PROMPTS
full_catalog = bench.prompt_catalog(include_cory_style=True)
assert len(full_catalog) == len(bench.OPEN_ENDED_PROMPTS) + len(bench.CORY_STYLE_OUTCOME_SCENARIOS)
assert any(prompt["id"] == "CS-01" for prompt in full_catalog)
def test_scores_good_cory_style_answer_as_pass(): def test_scores_good_cory_style_answer_as_pass():
prompt = bench.OPEN_ENDED_PROMPTS[1] prompt = bench.OPEN_ENDED_PROMPTS[1]
reply = ( reply = (
@ -81,3 +101,27 @@ def test_score_results_requires_all_prompts():
] ]
score = bench.score_results(results) score = bench.score_results(results)
assert score["pass"] is True assert score["pass"] is True
def test_score_results_can_require_full_cory_style_catalog():
broad_reply = (
"I will separate proposed, pending_review, approved, applied, and not applied. "
"Approved is not the same as applied. I will query canonical public.claims, public.sources, "
"public.claim_edges, public.claim_evidence, strategy_nodes, strategy_node_anchors, and reasoning_tools "
"for row-level before/after counts, row ids, preflight, postflight, and read back proof. "
"I will not claim the database changed until canonical readback confirms it. "
"The next action is to stage, review, rehearse in a clone, and apply a guarded packet only when authorized. "
"I will check GitHub, repo, /opt/teleo-eval, VPS runtime, service working directory, canonical repo source "
"of truth, mirror deploy checkout, git status, rev-parse, current systemctl service state, and fresh readback "
"before claiming runtime provenance. I will preserve caveats, including deferred self-positioning examples, "
"concept-map gaps, governance/evidence-bar gaps, and require review rather than flattening everything into claims. "
"For public update, capital movement, spend, sign, or broadcast I need explicit authorization, classify "
"reversibility and rollback or irreversible risk, and produce an artifact, receipt, proof, log, proposal, "
"packet, row readback, and cleanup readback."
)
results = [
{"prompt_id": prompt["id"], "reply": broad_reply}
for prompt in bench.prompt_catalog(include_cory_style=True)
]
score = bench.score_results(results, include_cory_style=True)
assert score["pass"] is True