diff --git a/docs/reports/leo-working-state-20260709/current-truth-index.md b/docs/reports/leo-working-state-20260709/current-truth-index.md index c6006b1..4d42445 100644 --- a/docs/reports/leo-working-state-20260709/current-truth-index.md +++ b/docs/reports/leo-working-state-20260709/current-truth-index.md @@ -32,6 +32,9 @@ 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` - 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 JSON: `docs/reports/leo-working-state-20260709/production-apply-packet.json` +- Mapped production apply authorized commit SQL, not executed in production: `docs/reports/leo-working-state-20260709/production-apply-authorized-commit.sql` +- Mapped production apply delete rollback SQL: `docs/reports/leo-working-state-20260709/production-delete-rollback.sql` - 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` @@ -52,6 +55,10 @@ Use this file before making status claims. Prefer fresh VPS/GCP readbacks when c - Helmer 7 Powers apply packet JSON: `docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet.json` - Helmer 7 Powers authorized commit SQL, not executed in production: `docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-authorized-commit.sql` - Helmer 7 Powers delete rollback SQL: `docs/reports/leo-working-state-20260709/helmer-7powers-production-delete-rollback.sql` +- Working Leo integrated packet manifest, not executed in production: `docs/reports/leo-working-state-20260709/working-leo-integrated-packet.md` +- Working Leo integrated packet JSON: `docs/reports/leo-working-state-20260709/working-leo-integrated-packet.json` +- Working Leo integrated clone rehearsal report: `docs/reports/leo-working-state-20260709/working-leo-integrated-packet-current.md` +- Working Leo integrated clone rehearsal log: `docs/reports/leo-working-state-20260709/working-leo-integrated-clone-rehearsal-current.log` - Helmer live rollback log: `docs/reports/leo-working-state-20260709/helmer-7powers-live-preflight-rollback-current.log` - Helmer clone commit/delete rollback log: `docs/reports/leo-working-state-20260709/helmer-7powers-clone-commit-delete-rollback-current.log` - Helmer ledger clone commit/delete rollback log: `docs/reports/leo-working-state-20260709/helmer-7powers-ledger-clone-commit-delete-rollback-current.log` @@ -74,6 +81,7 @@ Use this file before making status claims. Prefer fresh VPS/GCP readbacks when c - Identity render / decision matrix / document artifact map: `docs/reports/leo-working-state-20260709/leo-db-state-22-identity-render-matrix-artifacts.svg` - Rio strategy context packet proof: `docs/reports/leo-working-state-20260709/leo-db-state-23-rio-strategy-context.svg` - Governance/concept-map schema packet proof: `docs/reports/leo-working-state-20260709/leo-db-state-24-governance-concept-schema.svg` +- Integrated apply rehearsal proof: `docs/reports/leo-working-state-20260709/leo-db-state-25-integrated-apply-rehearsal.svg` - DB loading diagram SVG: `docs/reports/leo-working-state-20260709/leo-db-loading-diagram-20260709T214741Z.svg` - DB loading diagram Mermaid source: `docs/reports/leo-working-state-20260709/leo-db-loading-diagram-20260709T214741Z.mmd` @@ -88,9 +96,11 @@ Use this file before making status claims. Prefer fresh VPS/GCP readbacks when c - The strategy-anchor companion write for mapped rich proposal `14fa5ecc` is clone-proven and reversible, not production-applied. - The Rio strategy-context companion write for mapped rich proposal `14fa5ecc` is clone-proven and reversible: after the mapped base packet exists, it creates `2` Rio strategy nodes and `5` strategy anchors in a disposable clone; production stayed unchanged. - The governance/concept-map schema companion write is clone-proven and reversible: after the mapped base packet exists, it creates minimal concept-map and claim-to-governance link tables, then inserts `1` concept map, `1` concept link, and `2` governance links in a disposable clone; production stayed unchanged. +- The full integrated packet set is now clone-proven in production dependency order: mapped base, cross-surface anchor, Rio strategy context, governance/concept schema, and Helmer 7 Powers applied together in `teleo_integrated_rehearsal_20260710`, then rolled back in reverse order; production stayed unchanged and the disposable clone/temp files were removed. - DB-first identity rendering is now documented from the July 9 PDFs plus VPS readback: canonical identity rows feed rendered `SOUL.md`, direct SOUL edits are not canonical DB updates, and no active renderer/timer/hook is proven in the current VPS readback. - The decision-matrix approval schema is still a target design on the current VPS: `kb_stage.matrix_voters`, `kb_stage.proposal_votes`, and `kb_stage.proposal_decisions` were not present in live schema readback. - Pending/approved document proposals are real `kb_stage.kb_proposals` rows with `source_ref`s, but inspected `source_ref`s did not directly match `public.sources`; they still need review/apply mapping into canonical sources/evidence/edges. - Governance-gate and concept-map targets are now schema-packet-proven, but not production-applied; the live VPS production schema still has no generated governance/concept tables. - The live VPS runtime behavior should not be changed while the DB apply path is stabilized. +- A live Telegram regression canary should be rerun after any production apply; no production apply has been authorized or executed. - GCP parity remains blocked by account auth/access facts until a fresh readback proves otherwise. diff --git a/docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet-summary.json b/docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet-summary.json new file mode 100644 index 0000000..3d89c0c --- /dev/null +++ b/docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet-summary.json @@ -0,0 +1,40 @@ +{ + "claim_ceiling": "Production apply packet for mapped supported subset only; original rich proposals are not marked applied unless the packet fully covers the approved reasoning-tool/claim/source contract.", + "marks_original_proposals_applied": false, + "packet_version": 1, + "plan_path": "../../outputs/rich-proposal-creation-plan-20260709/helmer-7powers-20260709/helmer-7powers-creation-plan.json", + "proposal_ids": [ + "a64df080-8502-42e2-98f4-9bbdecb8da73" + ], + "remaining_blocked_fragments": [], + "required_existing_claims": [ + { + "id": "25a350e0-ebce-4072-8f2a-48427a727553", + "reason": "claim_edges.to_claim" + }, + { + "id": "2ef388ab-4102-4416-a6e1-ae6ba8ee02fa", + "reason": "claim_edges.to_claim" + }, + { + "id": "8f3e773e-4255-47a7-ba8f-61c57a43bebe", + "reason": "claim_edges.to_claim" + }, + { + "id": "93d583d9-5394-4e6a-97ca-bcd48796d94a", + "reason": "claim_edges.to_claim" + }, + { + "id": "be59b559-de8b-4dec-a7be-773188c0e632", + "reason": "claim_edges.to_claim" + } + ], + "row_counts": { + "claim_edges": 7, + "claim_evidence": 17, + "claims": 5, + "reasoning_tools": 1, + "sources": 13 + }, + "unresolved_design_decisions": [] +} diff --git a/docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-rollback-rehearsal.sql b/docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-rollback-rehearsal.sql new file mode 100644 index 0000000..fa74e93 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-rollback-rehearsal.sql @@ -0,0 +1,361 @@ +begin; + +set local statement_timeout = '30s'; + +-- rollback-only rehearsal: do not replace ROLLBACK with COMMIT without separate review + +insert into public.reasoning_tools (id, agent_id, name, description, category) +select '473ba7b0-ce44-5e77-bc46-ef82a49b6a3e'::uuid, '11111111-1111-1111-1111-111111111111'::uuid, + 'Helmer 7 Powers', '{"approval_change_log": [{"change": "Removed proposed claim #6 / teleo_power_candidate_is_credibility_and_process_not_control from this framework proposal.", "rationale": "It applies 7 Powers downstream to Teleo self-positioning; approving the framework should not accidentally approve Teleo-as-network-economies / Teleo-as-process-power claims."}, {"change": "Added competitive advantage / moats conceptual-neighborhood links for resolution.", "rationale": "7 Powers should sit in the competitive advantage and moats domain map/theme, not only link to specific scarcity and isolating-mechanism claims."}], "conceptual_neighborhood": {"additional_moat_neighborhood_candidates": [{"claim_id": "ee16149e-5e79-4a1d-9f1a-7a82fe78988c", "edge_type": "relates", "rationale": "Shares moat/competitive-advantage domain map language and can help Leo analyze moat decay under inflections.", "text": "two-phase disruption where distribution moats fall first and creation moats fall second is a universal pattern across entertainment knowledge work and financial services"}, {"claim_id": "4ec557f0-7c6e-4bb5-9c7c-e04468355a93", "edge_type": "illustrates", "rationale": "Domain-specific moat claim that can be reclassified through 7 Powers benefit/barrier analysis.", "text": "Orbital jurisdiction provides data sovereignty advantages that terrestrial compute cannot replicate, creating a unique competitive moat for orbital data centers"}], "must_link_existing_claims": [{"claim_id": "8f3e773e-4255-47a7-ba8f-61c57a43bebe", "edge_type": "supports_or_operationalizes", "rationale": "7 Powers is a concrete taxonomy of isolating mechanisms / moats.", "text": "Competitive advantage must be actively deepened through isolating mechanisms because advantage that is not reinforced erodes"}], "resolution_note": "At apply time, link Helmer 7 Powers into the competitive advantage/moats conceptual neighborhood or domain map if present. The current bridge search did not expose a reasoning_tool/map file directly, but Postgres surfaced moat-themed claims and sources below.", "theme": "competitive advantage and moats"}, "core_test": "A proposed Power is not valid unless it specifies both a material benefit and a barrier that prevents motivated, capable competitors from arbitraging the benefit away.", "deferred_application_examples_removed": 5, "deferred_boundary": "Teleo-specific application/self-positioning examples are not canonicalized in this reasoning_tool row; stage them separately if reopened and approved.", "deferred_neighborhood_candidates_removed": 1, "do_not_use_when": ["The question is primarily moral desirability rather than value capture.", "No actor is trying to capture surplus or sustain a differentiated position.", "The mechanism cannot be specified as both benefit and barrier.", "The analysis would merely label success retrospectively without evidence."], "position_in_leo_strategy_stack": ["Inflection map: what structural waves are breaking open now?", "Attractor-state analysis: where do those waves plausibly lead, and which futures are worth steering toward?", "7 Powers analysis: which actors can capture durable value in those futures, and through what benefit/barrier mechanism?", "Resource-scarcity analysis: which scarce resources must be owned, built, coordinated, or backed?"], "power_lifecycle_map": {"decay_or_transition": {"most_relevant_powers": ["all powers as falsification targets"], "notes": "Use this stage to avoid mistaking legacy scale, brand, or switching costs for durable future power when an inflection changes the basis of competition.", "stage_question": "Which former powers are eroding because the basis of scarcity, technology, regulation, or customer preference has shifted?"}, "origination": {"most_relevant_powers": ["counter-positioning", "cornered resource"], "notes": "The official synopsis says invention comes first and Power Progression asks when Power must be established across Origination, Take-Off, and Stability. Counter-positioning and cornered resources can exist before scale.", "stage_question": "What invention or structural opening exists before the market settles?"}, "stability": {"most_relevant_powers": ["brand", "process power", "deep switching costs", "scale economies"], "notes": "Brand and process power usually require long accumulation. Process power is rare and should not be confused with operational excellence.", "stage_question": "After the market settles, what prevents parity and supports persistent differential returns?"}, "take_off": {"most_relevant_powers": ["network economies", "scale economies", "switching costs", "counter-positioning"], "notes": "In Acquired, Helmer identifies the take-off phase as a period of flux with degrees of freedom where founders and teams must process information in real time. Middle-phase tech powers are commonly network economies, scale economies, and switching costs.", "stage_question": "During flux and rapid growth, which powers can be established before the window closes?"}}, "review_gate": "Rio should review mechanism/value-capture claims. Leo can draft and synthesize, but should not self-merge this framework into canonical identity or strategy.", "review_note": "Approved by m3taversal in Telegram after requested changes: claim #6 removed/deferred and competitive advantage/moats neighborhood linkage added. Approved for human resolution/apply; not canonically applied by Leo.", "seven_powers": [{"barrier": "A smaller competitor cannot match the leader''s unit economics without reaching comparable volume, which may be impossible once the market settles.", "benefit": "Lower cost per unit, higher margin at equal prices, or ability to price below smaller competitors while preserving economics.", "definition": "Per-unit cost declines as production or usage volume increases, giving the leader a lower cost position or better economics.", "examples": ["Netflix content costs amortized over a larger subscriber base", "Uber local density as scale/density, but not necessarily durable in all geographies", "Costco/Amazon/TSMC as candidates requiring source-specific analysis"], "false_positives": ["large size without cost curve advantage", "temporary subsidy scale", "growth that increases complexity faster than unit cost declines"], "name": "Scale Economies", "signals": ["fixed costs spread across larger base", "declining unit cost with volume", "exclusive/fixed-cost assets amortized across more users", "distribution or density advantages"], "source_keys": ["nfx_7powers_hamilton_lawson", "acquired_7powers_hamilton_helmer"], "typical_stage": "Take-Off to Stability"}, {"barrier": "Competitors face cold-start or cannot replicate the incumbent network''s density/utility quickly enough.", "benefit": "More participants increase value, liquidity, standards adoption, or ecosystem utility.", "definition": "A network''s value to participants increases as participation grows, and the resulting utility/density can prevent competitors from reaching equivalence.", "examples": ["IBM mainframe System/360 network economy in Reed Hastings'' foreword", "platform businesses in Acquired Platforms and Power"], "false_positives": ["network effects that create product-market fit but are shared by multiple competitors", "audience size without participant utility increasing", "community as vibes rather than utility"], "name": "Network Economies", "signals": ["same-side or cross-side network effects", "participant liquidity", "developer or complementor ecosystem", "standards or protocol adoption"], "source_keys": ["7powers_foreword_reed_hastings", "acquired_platforms_power", "nfx_7powers_hamilton_lawson"], "typical_stage": "Take-Off"}, {"barrier": "Incumbent imitation is rationally delayed because it cannibalizes existing profit formula or forces organizational self-harm.", "benefit": "Entrant model creates better customer value or economics under the new conditions.", "definition": "A newcomer adopts a superior business model that incumbents do not mimic because doing so would damage their existing economics, channels, organization, or identity.", "examples": ["Netflix no-late-fee/subscription model vs Blockbuster late fees", "Dell direct vs Compaq retail channel", "Twilio usage-based developer model vs seat/license/telco contracts", "Tesla direct/software model vs dealer/ICE incumbents"], "false_positives": ["incumbents are merely slow, not structurally conflicted", "entrant model is different but not superior", "incumbents can copy without self-harm"], "name": "Counter-Positioning", "signals": ["incumbent delay despite visible entrant traction", "cannibalization or channel conflict", "new model requires different talent/compensation/org structure", "entrant benefits from incumbent denial"], "source_keys": ["acquired_7powers_hamilton_helmer", "7powers_foreword_reed_hastings", "nfx_7powers_hamilton_lawson"], "typical_stage": "Origination to early Take-Off"}, {"barrier": "Competitors must overcome the customer''s migration cost, not merely offer a better product.", "benefit": "Retention and pricing resilience even when alternatives exist.", "definition": "Customers remain because changing providers imposes material cost, risk, training, workflow, data, integration, or coordination burden.", "examples": ["SAP enterprise implementation/custom workflow switching costs", "iPhone switching costs discussed in Acquired Platforms"], "false_positives": ["customer inertia without real switching burden", "temporary lack of alternatives", "dark-pattern lock-in that destroys trust"], "name": "Switching Costs", "signals": ["high retention", "data/workflow/integration lock-in", "training and compliance costs", "multi-user coordination burden", "embedded operations"], "source_keys": ["nfx_7powers_hamilton_lawson", "acquired_platforms_power"], "typical_stage": "Take-Off to Stability"}, {"barrier": "Brand meaning accumulates through repeated fulfilled promises and cannot be bought quickly through awareness spending alone.", "benefit": "Willingness to pay, reduced search cost, trust premium, identity/status attachment, or resilience to feature parity.", "definition": "Durable attribution of higher value to an objectively similar offering because of historic information, trust, identity, or status associated with the seller.", "examples": ["Apple in tech", "Hermès handbags", "Del Monte trust example"], "false_positives": ["awareness without willingness to pay", "short-lived hype", "legacy brand whose meaning is decaying in a new generation"], "name": "Brand", "signals": ["pricing premium", "trust premium", "identity attachment", "resilience despite parity", "lower CAC from reputation"], "source_keys": ["nfx_7powers_hamilton_lawson", "acquired_platforms_power"], "typical_stage": "Stability / Maturity"}, {"barrier": "Competitors cannot obtain the same resource on equal terms; if transferred, the resource would independently benefit another owner.", "benefit": "Exclusive or preferential asset improves economics, quality, capability, or strategic options.", "definition": "Preferential access at attractive terms to a coveted asset that independently enhances value and cannot be equally accessed by competitors.", "examples": ["Pixar''s early creative/director group", "patented pharmaceuticals"], "false_positives": ["valuable resource that is not exclusive", "talent whose value is fully arbitraged by labor markets", "data that competitors can recreate or legally access"], "name": "Cornered Resource", "signals": ["exclusive IP/patent/license", "irreplaceable team or creative group", "proprietary dataset with legal defensibility", "scarce relationship or supply position"], "source_keys": ["nfx_7powers_hamilton_lawson", "acquired_7powers_hamilton_helmer"], "typical_stage": "Origination or any stage if acquired/created"}, {"barrier": "The process is too tacit, complex, opaque, path-dependent, or time-consuming for competitors to replicate quickly.", "benefit": "Persistent operational outperformance, lower cost, or superior quality that moves the profit/impact needle.", "definition": "Embedded organization and activity sets enable lower costs or superior product through tacit, complex, hard-to-copy routines.", "examples": ["Toyota lean production"], "false_positives": ["ordinary operational excellence", "best practices consultants can copy", "temporary execution edge from hiring"], "name": "Process Power", "signals": ["persistent outperformance despite imitation attempts", "tacit routines", "many interlocking practices", "learning curve accumulated over long time"], "source_keys": ["nfx_7powers_hamilton_lawson"], "typical_stage": "Stability / Maturity"}], "source_ref": "telegram:m3taversal:2026-06-29:7-powers-approved-with-changes", "summary": "A strategic analysis framework for diagnosing durable value capture by identifying the specific benefit/barrier mechanism that lets a company, platform, protocol, or agentic institution earn persistent differential returns after an inflection creates an opportunity.", "use_when": ["Evaluating companies, founders, sectors, platforms, protocols, or agentic institutions for durable value capture.", "Stress-testing whether an inflection-map or attractor-state thesis identifies winners, not just change.", "Distinguishing product-market fit, growth, or cultural momentum from defensible power.", "Assessing whether Teleo should inform, orient, connect, or back a builder because the builder can create and defend scarce value."]}', 'strategy_framework' + where not exists (select 1 from public.reasoning_tools where id = '473ba7b0-ce44-5e77-bc46-ef82a49b6a3e'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '23927224-0d72-5b37-a600-33c63277f6a9'::uuid, 'structural', 'Helmer''s 7 Powers framework diagnoses durable value capture only when a company has both a material benefit and a barrier that prevents motivated capable competitors from arbitraging that benefit away.', + 'open', 0.8, array['grand-strategy', 'internet-finance', 'mechanisms']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '23927224-0d72-5b37-a600-33c63277f6a9'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'structural', 'Power must be analyzed by lifecycle stage because different powers become available in Origination, Take-Off, and Stability, and the window to establish a power can close as market flux resolves.', + 'open', 0.7, array['grand-strategy', 'mechanisms']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'structural', 'Counter-positioning is most useful near inflection points because entrants can adopt a superior model while incumbents rationally delay imitation to avoid damaging their existing economics, channels, or identity.', + 'open', 0.75, array['grand-strategy', 'internet-finance', 'mechanisms']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, 'structural', 'Network effects create product value but do not become network economies power unless they also prevent competitors from reaching equivalence and let the focal actor capture surplus.', + 'open', 0.7, array['grand-strategy', 'internet-finance', 'collective-intelligence']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, 'normative', 'Leo should use 7 Powers after inflection mapping and attractor-state analysis to distinguish builders who merely benefit from a wave from builders who can durably capture and compound value from that wave.', + 'open', 0.65, array['grand-strategy', 'living-agents', 'internet-finance']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '02b8c5ff-04fb-54e7-b132-e731086f1436'::uuid, 'other', 'https://www.amazon.com/7-Powers-Foundations-Business-Strategy/dp/0998116319', + null, '{"excerpt": "Canonical source for the seven powers framework; source of definitions, benefit/barrier logic, Power Progression, and company examples. Full text not ingested in this run; use book/page references if available before final canonicalization.", "metadata": {"source_key": "helmer_7powers_book", "title": "7 Powers: The Foundations of Business Strategy"}}', '9d969205f377ffb9c72722616a59770b1a291dc240d5ea00645a44533c490ac3', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '02b8c5ff-04fb-54e7-b132-e731086f1436'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'article', 'https://7powers.com/synopsis/', + null, '{"excerpt": "Helmer develops from first principles a practical theory of Strategy rooted in the notion of Power, those conditions which create the potential for persistent differential returns. The synopsis says invention comes first and Power Progression targets when Power must be established in Origination, Take-Off, or Stability.", "metadata": {"source_key": "7powers_synopsis", "title": "Synopsis – 7 Powers"}}', 'f337a56de1336a9b301eb8c6873d6a8fe012cfd7403105bd117ac2154842e4eb', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'article', 'https://7powers.com/foreword/', + null, '{"excerpt": "Hastings describes Helmer''s Power Dynamics assessment of Netflix, identifies Counter-Positioning and Power Progression as novel conceptual advances, and says Counter-Positioning explained why incumbents rationally failed to adjust.", "metadata": {"source_key": "7powers_foreword_reed_hastings", "title": "Foreword – 7 Powers"}}', '053055a1189e1ceb8f7fb5c6a6c8373f882dcff9eeb9725c6cc7fe1f301bdda8', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'transcript', 'https://www.acquired.fm/episodes/7-powers-with-hamilton-helmer', + null, '{"excerpt": "Helmer states power has two necessary and sufficient conditions: benefit and barrier. Benefit is a materially better business model; barrier prevents motivated and capable competitors from taking it away. He calls Seven Powers a careful, hopefully exhaustive articulation of moats.", "metadata": {"source_key": "acquired_7powers_hamilton_helmer", "title": "7 Powers with Hamilton Helmer | Acquired"}}', '81d2f49c5f1b32449f6080c5ecb215fa8641ff309d607fc05b69258ef6588d36', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid, 'transcript', 'https://www.acquired.fm/episodes/platforms-and-power-with-hamilton-helmer-and-chenyi-shi', + null, '{"excerpt": "Chenyi Shi frames platform power through three questions: how economic value is created, how each customer group perceives value as the platform scales, and how competitors are prevented from reaching equivalence. Helmer distinguishes network effects from network economies power.", "metadata": {"source_key": "acquired_platforms_power", "title": "Platforms and Power (with Hamilton Helmer and Chenyi Shi) | Acquired"}}', '724f509eaf56e998f96211f61512c225e87a8497904198e610fe38adfdbf7b78', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'article', 'https://www.nfx.com/post/seven-powers', + null, '{"excerpt": "NFX/Helmer provides concise definitions and examples for the powers: cornered resource (Pixar), scale economies (Netflix), switching costs (SAP), counter-positioning (Twilio/Tesla/Netflix), brand (Apple/Hermès), process power (Toyota). It also states performance is trailing while power is leading.", "metadata": {"source_key": "nfx_7powers_hamilton_lawson", "title": "The 7 Powers Known to Tesla, Pixar, Netflix, Apple & Twilio"}}', 'db97d016740feae7eec08bb860ec8a06196732b5a1e3543115d74227317afb88', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '50e0d1ef-322b-5097-afe6-c9aa5ecea5fc'::uuid, 'article', 'https://podcast.nfx.com/episodes/hamilton-helmer-jeff-lawson', + null, '{"excerpt": "Episode summary asks what keeps competition away and states Helmer''s framework reveals conditions for persistent and durable differential returns.", "metadata": {"source_key": "nfx_podcast_summary", "title": "The 7 Powers with Hamilton Helmer & Jeff Lawson | The NFX Podcast"}}', '26901a373a644d439c621c3ba2bd472f519cd07922eb647cba823dd957efad32', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '50e0d1ef-322b-5097-afe6-c9aa5ecea5fc'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '621bb834-6366-5940-b6c3-c5f82ba35d48'::uuid, 'article', 'https://www.thetwentyminutevc.com/hamiltonhelmer/', + null, '{"excerpt": "Show notes emphasize ''all strategy begins with invention,'' transition from startup to pricer with scale economies, competition, brand definition, and sustainable leverage/power.", "metadata": {"source_key": "20vc_hamilton_helmer", "title": "20VC: Hamilton Helmer – 7 Powers: The Foundations of Business Strategy"}}', '6ac16b3a372d2e2e5b8d00800282e45ebaa00f451b5f2c5af20bf95583aaa779', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '621bb834-6366-5940-b6c3-c5f82ba35d48'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid, 'other', null, + null, '{"body": null, "candidate_review_note": null, "claim_key": "seven_powers_requires_benefit_and_barrier", "edges": [{"edge_type": "supports", "rationale": "Benefit/barrier is a precise isolating-mechanism test.", "to_existing_claim": "8f3e773e-4255-47a7-ba8f-61c57a43bebe"}, {"edge_type": "relates", "rationale": "Powers explain how scarcity becomes defendable value capture.", "to_existing_claim": "2ef388ab-4102-4416-a6e1-ae6ba8ee02fa"}], "evidence": ["acquired_7powers_hamilton_helmer", "nfx_7powers_hamilton_lawson"], "evidence_tier": null, "headline": null, "needs_research": null, "proposal_id": "a64df080-8502-42e2-98f4-9bbdecb8da73", "review_note": "Approved by m3taversal in Telegram after requested changes: claim #6 removed/deferred and competitive advantage/moats neighborhood linkage added. Approved for human resolution/apply; not canonically applied by Leo.", "reviewed_by_handle": "m3taversal", "source_ref": "telegram:m3taversal:2026-06-29:7-powers-approved-with-changes", "text": "Helmer''s 7 Powers framework diagnoses durable value capture only when a company has both a material benefit and a barrier that prevents motivated capable competitors from arbitraging that benefit away."}', '7820f745a7fa092bb27c55efb104011599100b84dfb60e524ab0aff28d94e016', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid, 'other', null, + null, '{"body": null, "candidate_review_note": null, "claim_key": "power_progression_stage_gates_strategy", "edges": [{"edge_type": "relates", "rationale": "Stage-specific power creation supports strategy-as-design rather than static planning.", "to_existing_claim": "25a350e0-ebce-4072-8f2a-48427a727553"}], "evidence": ["7powers_synopsis", "7powers_foreword_reed_hastings", "acquired_7powers_hamilton_helmer"], "evidence_tier": null, "headline": null, "needs_research": null, "proposal_id": "a64df080-8502-42e2-98f4-9bbdecb8da73", "review_note": "Approved by m3taversal in Telegram after requested changes: claim #6 removed/deferred and competitive advantage/moats neighborhood linkage added. Approved for human resolution/apply; not canonically applied by Leo.", "reviewed_by_handle": "m3taversal", "source_ref": "telegram:m3taversal:2026-06-29:7-powers-approved-with-changes", "text": "Power must be analyzed by lifecycle stage because different powers become available in Origination, Take-Off, and Stability, and the window to establish a power can close as market flux resolves."}', '241cf2d2bc0c3049a9fe23ed3957c81eaed2778e36d38a823b8ae29bb0b5285b', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid, 'other', null, + null, '{"body": null, "candidate_review_note": null, "claim_key": "counter_positioning_is_early_inflection_power", "edges": [{"edge_type": "relates", "rationale": "Counter-positioning exploits path dependence and incumbent commitments.", "to_existing_claim": "be59b559-de8b-4dec-a7be-773188c0e632"}], "evidence": ["acquired_7powers_hamilton_helmer", "7powers_foreword_reed_hastings", "nfx_7powers_hamilton_lawson"], "evidence_tier": null, "headline": null, "needs_research": null, "proposal_id": "a64df080-8502-42e2-98f4-9bbdecb8da73", "review_note": "Approved by m3taversal in Telegram after requested changes: claim #6 removed/deferred and competitive advantage/moats neighborhood linkage added. Approved for human resolution/apply; not canonically applied by Leo.", "reviewed_by_handle": "m3taversal", "source_ref": "telegram:m3taversal:2026-06-29:7-powers-approved-with-changes", "text": "Counter-positioning is most useful near inflection points because entrants can adopt a superior model while incumbents rationally delay imitation to avoid damaging their existing economics, channels, or identity."}', '5731229bb29db3069f15d826369ef0d01a377b19c07b9649d1b760abb650249a', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid, 'other', null, + null, '{"body": null, "candidate_review_note": null, "claim_key": "network_effects_do_not_equal_network_power", "edges": [{"edge_type": "relates", "rationale": "Commercial network effects can be self-enforcing only when they alter capture/coordination incentives, not merely create participation value.", "to_existing_claim": "93d583d9-5394-4e6a-97ca-bcd48796d94a"}], "evidence": ["acquired_platforms_power", "nfx_7powers_hamilton_lawson"], "evidence_tier": null, "headline": null, "needs_research": null, "proposal_id": "a64df080-8502-42e2-98f4-9bbdecb8da73", "review_note": "Approved by m3taversal in Telegram after requested changes: claim #6 removed/deferred and competitive advantage/moats neighborhood linkage added. Approved for human resolution/apply; not canonically applied by Leo.", "reviewed_by_handle": "m3taversal", "source_ref": "telegram:m3taversal:2026-06-29:7-powers-approved-with-changes", "text": "Network effects create product value but do not become network economies power unless they also prevent competitors from reaching equivalence and let the focal actor capture surplus."}', '69f0c902a946a229546293ab5ae101447013c3730b6ba568225f60af6352b7d8', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid, 'other', null, + null, '{"body": null, "candidate_review_note": null, "claim_key": "agentic_capital_needs_power_analysis", "edges": [{"edge_type": "supports", "rationale": "7 Powers operationalizes scarcity/value-capture analysis for builder evaluation.", "to_existing_claim": "2ef388ab-4102-4416-a6e1-ae6ba8ee02fa"}, {"edge_type": "supports", "rationale": "Builder evaluation should ask whether the advantage is actively deepening through isolating mechanisms.", "to_existing_claim": "8f3e773e-4255-47a7-ba8f-61c57a43bebe"}], "evidence": ["7powers_synopsis", "acquired_7powers_hamilton_helmer"], "evidence_tier": null, "headline": null, "needs_research": null, "proposal_id": "a64df080-8502-42e2-98f4-9bbdecb8da73", "review_note": "Approved by m3taversal in Telegram after requested changes: claim #6 removed/deferred and competitive advantage/moats neighborhood linkage added. Approved for human resolution/apply; not canonically applied by Leo.", "reviewed_by_handle": "m3taversal", "source_ref": "telegram:m3taversal:2026-06-29:7-powers-approved-with-changes", "text": "Leo should use 7 Powers after inflection mapping and attractor-state analysis to distinguish builders who merely benefit from a wave from builders who can durably capture and compound value from that wave."}', '3dd21b86130e62ebd301b4ae18056ecbffb74606c30696258fcb9cd420ac555e', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '23927224-0d72-5b37-a600-33c63277f6a9'::uuid + and source_id = '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '23927224-0d72-5b37-a600-33c63277f6a9'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '23927224-0d72-5b37-a600-33c63277f6a9'::uuid + and source_id = 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '23927224-0d72-5b37-a600-33c63277f6a9'::uuid + and source_id = '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid + and source_id = '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid + and source_id = '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid + and source_id = 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid + and source_id = 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid + and source_id = '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid + and source_id = 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid + and source_id = 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid + and source_id = '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid + and source_id = '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid + and source_id = '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid + and source_id = '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid + and source_id = '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid + and source_id = '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid + and source_id = 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, + 'supports'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '23927224-0d72-5b37-a600-33c63277f6a9'::uuid + and to_claim = '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid + and edge_type = 'supports'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '23927224-0d72-5b37-a600-33c63277f6a9'::uuid + and to_claim = '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '25a350e0-ebce-4072-8f2a-48427a727553'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid + and to_claim = '25a350e0-ebce-4072-8f2a-48427a727553'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'be59b559-de8b-4dec-a7be-773188c0e632'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'd2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid + and to_claim = 'be59b559-de8b-4dec-a7be-773188c0e632'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '93d583d9-5394-4e6a-97ca-bcd48796d94a'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid + and to_claim = '93d583d9-5394-4e6a-97ca-bcd48796d94a'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, + 'supports'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid + and to_claim = '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid + and edge_type = 'supports'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, + 'supports'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid + and to_claim = '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid + and edge_type = 'supports'::edge_type); + +rollback; + +-- Full-coverage packet ledger update: mark original approved proposal(s) applied only after generated rows exist. +begin; + +do $$ +declare + flipped int; +begin + update kb_stage.kb_proposals + set status = 'applied', + applied_by_handle = 'codex-packet-20260709', + applied_at = now(), + updated_at = now() + where id in (select id from (values + ('a64df080-8502-42e2-98f4-9bbdecb8da73'::uuid) + ) as v(id)) + and status = 'approved'; + + get diagnostics flipped = row_count; + if flipped <> 1 then + raise exception 'rich proposal packet ledger flip affected % row(s), expected 1; original proposals were not all approved', flipped; + end if; +end $$; + +rollback; diff --git a/docs/reports/leo-working-state-20260709/helmer-7powers-production-postflight.sql b/docs/reports/leo-working-state-20260709/helmer-7powers-production-postflight.sql new file mode 100644 index 0000000..60977ca --- /dev/null +++ b/docs/reports/leo-working-state-20260709/helmer-7powers-production-postflight.sql @@ -0,0 +1,149 @@ +\set ON_ERROR_STOP on +-- Postflight row-level readback for mapped rich proposal apply packet. + +select + (select count(*) from public.reasoning_tools where id in (select id from (values + ('473ba7b0-ce44-5e77-bc46-ef82a49b6a3e'::uuid) + ) as v(id))) as generated_reasoning_tool_rows, + (select count(*) from public.claims where id in (select id from (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid) + ) as v(id))) as generated_claim_rows, + (select count(*) from public.sources where id in (select id from (values + ('02b8c5ff-04fb-54e7-b132-e731086f1436'::uuid), + ('4bd41552-8017-551a-84b5-19b0107c20b5'::uuid), + ('bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid), + ('dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid), + ('2df4bb44-4853-5455-8049-6dbb8685523b'::uuid), + ('6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid), + ('50e0d1ef-322b-5097-afe6-c9aa5ecea5fc'::uuid), + ('621bb834-6366-5940-b6c3-c5f82ba35d48'::uuid), + ('5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid), + ('97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid), + ('11fa942d-e81a-5142-965d-3c60714a7dca'::uuid), + ('263f423e-c16f-544c-ae5f-3e370e736e12'::uuid), + ('0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid) + ) as v(id))) as generated_source_rows, + (select count(*) from public.claim_edges e join (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'supports'::edge_type), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'relates'::edge_type), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '25a350e0-ebce-4072-8f2a-48427a727553'::uuid, 'relates'::edge_type), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'be59b559-de8b-4dec-a7be-773188c0e632'::uuid, 'relates'::edge_type), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '93d583d9-5394-4e6a-97ca-bcd48796d94a'::uuid, 'relates'::edge_type), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'supports'::edge_type), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) using (from_claim, to_claim, edge_type)) as generated_edge_rows, + (select count(*) from public.claim_evidence ce join (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid, 'illustrates'::evidence_role), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid, 'illustrates'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid, 'illustrates'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid, 'illustrates'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid, 'grounds'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid, 'illustrates'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'grounds'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) using (claim_id, source_id, role)) as generated_evidence_rows; + + +select id::text, agent_id::text, name, category, left(description, 500) as description +from public.reasoning_tools +where id in (select id from (values + ('473ba7b0-ce44-5e77-bc46-ef82a49b6a3e'::uuid) + ) as v(id)) +order by id; + +select id::text, type, confidence, left(text, 220) as text +from public.claims +where id in (select id from (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid) + ) as v(id)) +order by id; + +select id::text, source_type, left(coalesce(excerpt, ''), 220) as excerpt +from public.sources +where id in (select id from (values + ('02b8c5ff-04fb-54e7-b132-e731086f1436'::uuid), + ('4bd41552-8017-551a-84b5-19b0107c20b5'::uuid), + ('bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid), + ('dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid), + ('2df4bb44-4853-5455-8049-6dbb8685523b'::uuid), + ('6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid), + ('50e0d1ef-322b-5097-afe6-c9aa5ecea5fc'::uuid), + ('621bb834-6366-5940-b6c3-c5f82ba35d48'::uuid), + ('5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid), + ('97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid), + ('11fa942d-e81a-5142-965d-3c60714a7dca'::uuid), + ('263f423e-c16f-544c-ae5f-3e370e736e12'::uuid), + ('0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid) + ) as v(id)) +order by id; + +select e.from_claim::text, e.to_claim::text, e.edge_type::text +from public.claim_edges e +join (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'supports'::edge_type), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'relates'::edge_type), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '25a350e0-ebce-4072-8f2a-48427a727553'::uuid, 'relates'::edge_type), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'be59b559-de8b-4dec-a7be-773188c0e632'::uuid, 'relates'::edge_type), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '93d583d9-5394-4e6a-97ca-bcd48796d94a'::uuid, 'relates'::edge_type), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'supports'::edge_type), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) using (from_claim, to_claim, edge_type) +order by e.from_claim, e.to_claim, e.edge_type; + +select ce.claim_id::text, ce.source_id::text, ce.role::text +from public.claim_evidence ce +join (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid, 'illustrates'::evidence_role), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid, 'illustrates'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid, 'illustrates'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid, 'illustrates'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid, 'grounds'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid, 'illustrates'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'grounds'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) using (claim_id, source_id, role) +order by ce.claim_id, ce.source_id, ce.role; + +select id::text, superseded_by::text +from public.claims +where superseded_by in (select id from (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid) + ) as v(id)) +order by id; + +select id::text, status, applied_by_handle, applied_at +from kb_stage.kb_proposals +where id in (select id from (values + ('a64df080-8502-42e2-98f4-9bbdecb8da73'::uuid) + ) as v(id)) +order by id; diff --git a/docs/reports/leo-working-state-20260709/helmer-7powers-production-preflight.sql b/docs/reports/leo-working-state-20260709/helmer-7powers-production-preflight.sql new file mode 100644 index 0000000..8ef9389 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/helmer-7powers-production-preflight.sql @@ -0,0 +1,86 @@ +\set ON_ERROR_STOP on +-- Preflight for mapped rich proposal apply packet. Read-only. + +select id::text, status, proposal_type, reviewed_by_handle, reviewed_at +from kb_stage.kb_proposals +where id in (select id from (values + ('a64df080-8502-42e2-98f4-9bbdecb8da73'::uuid) + ) as v(id)) +order by id; + +with required(id, reason) as ( + values + ('25a350e0-ebce-4072-8f2a-48427a727553'::uuid, 'claim_edges.to_claim'), + ('2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'claim_edges.to_claim'), + ('8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'claim_edges.to_claim'), + ('93d583d9-5394-4e6a-97ca-bcd48796d94a'::uuid, 'claim_edges.to_claim'), + ('be59b559-de8b-4dec-a7be-773188c0e632'::uuid, 'claim_edges.to_claim') +) +select 'missing_required_existing_claims' as check_name, id::text, reason +from required +where id is not null + and not exists (select 1 from public.claims where public.claims.id = required.id) +order by id; + +-- Expected generated rows after authorized commit: +select 1::int as expected_reasoning_tools, + 5::int as expected_claims, + 13::int as expected_sources, + 7::int as expected_claim_edges, + 17::int as expected_claim_evidence; + +-- Must be all zero before production apply. +select + (select count(*) from public.reasoning_tools where id in (select id from (values + ('473ba7b0-ce44-5e77-bc46-ef82a49b6a3e'::uuid) + ) as v(id))) as generated_reasoning_tool_rows, + (select count(*) from public.claims where id in (select id from (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid) + ) as v(id))) as generated_claim_rows, + (select count(*) from public.sources where id in (select id from (values + ('02b8c5ff-04fb-54e7-b132-e731086f1436'::uuid), + ('4bd41552-8017-551a-84b5-19b0107c20b5'::uuid), + ('bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid), + ('dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid), + ('2df4bb44-4853-5455-8049-6dbb8685523b'::uuid), + ('6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid), + ('50e0d1ef-322b-5097-afe6-c9aa5ecea5fc'::uuid), + ('621bb834-6366-5940-b6c3-c5f82ba35d48'::uuid), + ('5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid), + ('97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid), + ('11fa942d-e81a-5142-965d-3c60714a7dca'::uuid), + ('263f423e-c16f-544c-ae5f-3e370e736e12'::uuid), + ('0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid) + ) as v(id))) as generated_source_rows, + (select count(*) from public.claim_edges e join (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'supports'::edge_type), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'relates'::edge_type), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '25a350e0-ebce-4072-8f2a-48427a727553'::uuid, 'relates'::edge_type), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'be59b559-de8b-4dec-a7be-773188c0e632'::uuid, 'relates'::edge_type), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '93d583d9-5394-4e6a-97ca-bcd48796d94a'::uuid, 'relates'::edge_type), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '2ef388ab-4102-4416-a6e1-ae6ba8ee02fa'::uuid, 'supports'::edge_type), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '8f3e773e-4255-47a7-ba8f-61c57a43bebe'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) using (from_claim, to_claim, edge_type)) as generated_edge_rows, + (select count(*) from public.claim_evidence ce join (values + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc'::uuid, 'illustrates'::evidence_role), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('23927224-0d72-5b37-a600-33c63277f6a9'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11'::uuid, 'illustrates'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'grounds'::evidence_role), + ('4701f303-ca9c-5da1-aa48-8cf28189c23c'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '11fa942d-e81a-5142-965d-3c60714a7dca'::uuid, 'illustrates'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, 'bc081b04-709f-565a-af0b-95d4ca0589fa'::uuid, 'grounds'::evidence_role), + ('d2b2142b-c2d8-5e33-9a38-14598d94d715'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '263f423e-c16f-544c-ae5f-3e370e736e12'::uuid, 'illustrates'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '2df4bb44-4853-5455-8049-6dbb8685523b'::uuid, 'grounds'::evidence_role), + ('6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3'::uuid, '6fe15936-d5b9-514e-802f-32a2a06f4a23'::uuid, 'grounds'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '0c87a244-afa2-5d08-8e79-9cb792aff553'::uuid, 'illustrates'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, '4bd41552-8017-551a-84b5-19b0107c20b5'::uuid, 'grounds'::evidence_role), + ('12d2c4aa-1c23-5173-b666-dea903dd7432'::uuid, 'dc1c238c-f835-5641-980a-f0fe53f8dfe5'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) using (claim_id, source_id, role)) as generated_evidence_rows; diff --git a/docs/reports/leo-working-state-20260709/leo-db-state-25-integrated-apply-rehearsal.svg b/docs/reports/leo-working-state-20260709/leo-db-state-25-integrated-apply-rehearsal.svg new file mode 100644 index 0000000..1fbb792 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/leo-db-state-25-integrated-apply-rehearsal.svg @@ -0,0 +1,74 @@ + + Working Leo DB State 25 - Integrated apply rehearsal + Diagram of the full integrated Working Leo DB packet rehearsal in a disposable clone. + + Working Leo DB State 25: Integrated Apply Rehearsal + All prepared packets applied together in one disposable clone, then rolled back cleanly. Production untouched. + + + 1. Mapped Rich Base + 7 claims + 15 sources + 11 edges, 17 evidence + + + 2. Cross-Surface + strategy anchor update + old claim -> Claim D + rollback restores old anchor + + + 3. Rio Strategy + 2 strategy nodes + 5 strategy anchors + depends on base claims + + + 4. Governance/Concept + 1 concept map + 1 concept link + 2 governance links + + + 5. Helmer 7 Powers + 1 reasoning tool + 5 claims, 13 sources + ledger applied in clone + + + Integrated Clone Footprint + 12 claims, 28 sources, 18 claim edges, 34 evidence rows + 1 reasoning tool, 2 Rio nodes, 5 Rio anchors + 1 concept map, 1 concept link, 2 governance links + + + Production Boundary + No production commit SQL + Production generated rows = 0 + Generated schema absent + + + + + + + + Rollback Proof + Reverse order: Helmer, governance/concept, Rio, cross-surface, mapped base + All generated row counts returned to zero; generated schema dropped + Cross-surface anchor restored to old claim and weight 0.7 + + + Runtime + Cleanup + Disposable DB dropped; host/container temp removed + leoclean-gateway active, MainPID=3252143, NRestarts=0 + Live Telegram canary should rerun after any production apply + + Claim ceiling: integrated clone-ready, not production-applied. GCP parity remains separate. + + + + + + + diff --git a/docs/reports/leo-working-state-20260709/production-apply-authorized-commit.sql b/docs/reports/leo-working-state-20260709/production-apply-authorized-commit.sql new file mode 100644 index 0000000..e80057e --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-apply-authorized-commit.sql @@ -0,0 +1,400 @@ +begin; + +set local statement_timeout = '30s'; + +-- rollback-only rehearsal: do not replace ROLLBACK with COMMIT without separate review + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'structural', 'Capital allocation is a form of civilizational steering because it determines which futures receive resources.', + 'open', 0.65, array['capital-allocation', 'civilizational-steering', 'coordination', 'rio', 'teleo-strategy']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'structural', 'Capital allocation depends on distributed knowledge, incentives, liquidity, and feedback loops.', + 'open', 0.7, array['capital-allocation', 'distributed-market-intelligence', 'hayek', 'mechanism-design', 'collective-intelligence']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'structural', 'Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism.', + 'open', 0.45, array['internet-finance', 'capital-allocation', 'programmable-governance', 'liquidity', 'rio']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'normative', 'Internet finance is not Teleo’s telos; it is a candidate mechanism for pursuing the telos.', + 'open', 0.8, array['telos', 'internet-finance', 'rio', 'governance', 'strategy-boundary']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'dm', null, + null, '{"excerpt": "Yes let’s 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 expressed priorities.\n\nBetter split: A. Capital allocation is a form of civilizational steering... B. Capital allocation depends on distributed knowledge... C. Internet finance has structural advantages... D. Internet finance is not the telos; it is a candidate mechanism.", "metadata": {"source_key": "m3ta_telegram_approval_supersede_split_2026_07_05", "source_quality": "primary operator/reviewer direction", "title": "m3ta Telegram approval to supersede compressed internet-finance claim", "usage_limits": "Provenance for proposal direction and review intent; not external empirical evidence."}}', '3fb4a747e76ec4116993a1cd4d59c1710e849a92dcc75bb0a179931be03a10c8', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid, 'other', null, + null, '{"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-a99f-baeeeb3aa23e", "source_key": "kb_existing_hayek_claim_7da4851c", "source_quality": "canonical KB neighbor with evidence rows; needs reframing under distributed market intelligence concept map", "title": "Existing KB Hayek claim", "usage_limits": "Use as an existing graph neighbor, not as the final Hayek concept-map root."}}', '5ab1eae24c2acd3363a4cd2c2e0581e7c5e379753773719230419aa3b4c539fb', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, 'article', 'https://fee.org/articles/the-use-of-knowledge-in-society/', + '/home/teleo/.hermes/profiles/leoclean/kb_stage/research/claim-node-standard/hayek_fee_text.txt', '{"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 concentrated...\n\nThe marvel is that... without an order being issued... tens of thousands of people... are made to use the material or its products more sparingly.", "metadata": {"source_key": "hayek_use_of_knowledge_in_society_fee_snapshot", "source_quality": "primary essay text snapshot", "title": "F. A. Hayek, The Use of Knowledge in Society", "usage_limits": "Supports the distributed market intelligence concept map and claim B; does not by itself prove internet finance superiority."}}', 'bb4934d37d3b327de5d12d62d58997b2c41e199e27c4a1407295ed36c975ed66', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, 'other', null, + null, '{"excerpt": "Capital allocation is civilizational infrastructure, not a financial service.", "metadata": {"source_key": "rio_belief_capital_allocation_civilizational_infrastructure", "source_quality": "canonical agent belief/context neighbor", "title": "Rio belief rank 1", "usage_limits": "Use as internal Rio strategy/belief grounding, not external evidence."}}', 'fc6b6fa09947c04ed44df6570aa0389744e62e3e5b7d04ecfeda080fae6cbc89', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'other', null, + null, '{"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_strategy_v2_context", "source_quality": "canonical agent strategy/context neighbor", "title": "Leo active strategy v2 context", "usage_limits": "Use as internal strategy-context grounding only."}}', 'a00f39707b1d90c31303da603d9daa1198ae1b810b45f54bd48bb599b64212be', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, 'other', null, + null, '{"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 compete for scarce capital, allocation decisions function as steering inputs: they amplify some attractors and starve others. This does not mean capital is the only steering mechanism or that markets should decide the telos; it means resource flows are one of the main ways a society reveals and operationalizes priorities.", "candidate_review_note": "Approve as a structural/internal strategy claim at moderate confidence; external evidence can later raise confidence.", "claim_key": "capital_allocation_is_civilizational_steering", "evidence_tier": "internal/theoretical; needs external grounding for stronger confidence", "headline": "Capital allocation is a form of civilizational steering because it determines which futures receive resources.", "needs_research": null, "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', '4b7d20219f51607e05010cd8c6b888c3b5a96f9a7a534c4c7907b765e8a10955', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, 'other', null, + null, '{"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 or price discovery that updates beliefs, and feedback loops that reveal whether resources were well allocated. This connects Hayek’s price-system insight to Teleo’s capital thesis: markets are a kind of social computation, but the computation is only as good as its mechanism design, participation, information quality, and correction loops.", "candidate_review_note": "This is the cleanest immediate Hayek-linked successor component. It should not replace the pure Hayek concept map; it applies that concept to capital allocation.", "claim_key": "capital_allocation_depends_on_distributed_market_intelligence", "evidence_tier": "primary-theoretical plus internal synthesis", "headline": "Capital allocation depends on distributed knowledge, incentives, liquidity, and feedback loops.", "needs_research": null, "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', '0972238794dffe6993ce6dfed7e652b184a15675c1e1e1149643e9212f033596', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, 'other', null, + null, '{"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 thesis is not that crypto automatically wins or that all financial activity should move on-chain. The claim is that when financial primitives become cheaper, more transparent, more programmable, and more broadly accessible, they can outperform legacy intermediary-heavy systems in some allocation contexts. This remains the main empirical research claim in the cluster and should stay lower confidence until supported by evidence on costs, liquidity, access, governance quality, fraud, regulation, and adverse selection.", "candidate_review_note": "Approve as a research queue / thesis candidate, not as high-confidence canonical conclusion.", "claim_key": "internet_finance_structural_advantages_capital_allocation", "evidence_tier": "thesis candidate; requires research", "headline": "Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism.", "needs_research": ["transaction cost and intermediation cost evidence", "settlement/tokenization evidence", "liquidity and price-discovery evidence", "global access and capital-formation evidence", "programmable governance/futarchy evidence", "counterevidence: hacks, fraud, manipulation, regulatory frictions, adverse selection, governance capture"], "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', 'e332679983a38ab0fc14ba88327394ee08ba94f454ce2f918ca98881d7da11b2', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, 'other', null, + null, '{"body": "Teleo’s 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, forecasts, ownership, and resource flows toward mission-oriented builders and desirable attractor states. This distinction prevents Rio’s mechanism from becoming the collective’s purpose and keeps capital allocation subordinate to human agency, safety, governance, and the broader post-scarcity/multiplanetary aim.", "candidate_review_note": "This should be approved as a boundary claim to prevent mechanism/telos collapse.", "claim_key": "internet_finance_is_mechanism_not_telos", "evidence_tier": "internal strategy/governance", "headline": "Internet finance is not Teleo’s telos; it is a candidate mechanism for pursuing the telos.", "needs_research": null, "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', '75e3f94ad2b7fcbdc096e56f05bc396c8f62fad055326c9d0ee7d760090746d9', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and source_id = '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and source_id = '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and source_id = '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and source_id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and source_id = '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and source_id = '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and source_id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and to_claim = '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, + 'requires'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and to_claim = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and edge_type = 'requires'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, + 'constrains'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and to_claim = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and edge_type = 'constrains'::edge_type); + +commit; + + +begin; + +set local statement_timeout = '30s'; + +-- rollback-only rehearsal: do not replace ROLLBACK with COMMIT without separate review + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'meta', 'KB claim nodes need explanatory bodies, not only one-sentence headlines.', + 'open', 0.85, '{}'::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'structural', 'Internet finance has structural advantages that make it likely to become an increasingly important capital-allocation mechanism.', + 'open', 0.45, '{}'::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, 'structural', 'Hayek’s most relevant contribution for Teleo is that prices coordinate dispersed, local, time-sensitive knowledge without central possession of that knowledge.', + 'open', 0.8, '{}'::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid, 'other', null, + null, '{"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 map, Attractor-state analysis, Power-window detection, Collective epistemic architecture.\n\nAgent evolution must be legible, reviewable, attributable, corrigible, contributor-shaped, and user-controlled. Identity is a control surface.", "metadata": {"source_key": "telegram_attachment_teleo_agent_strategy_kernels_2026_06_30", "source_quality": "primary/internal working synthesis; explicitly non-canonical", "title": "Teleo Collective Telos and Agent Strategy Kernels", "usage_limits": "Use as provenance for m3ta/Leo working synthesis and agent-strategy formatting expectations, not as empirical evidence for external claims."}}', 'aa2c731057b11788dc1600d4af8570276352bcbdb2be3b307e9ffc5f4670b8ce', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'other', null, + null, '{"excerpt": "Nodes should have a headline that’s 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 a claim he makes but I am not sure it is the strongest in the paper or the most relevant to us.", "metadata": {"source_key": "telegram_feedback_m3ta_claim_shape_2026_07_05", "source_quality": "primary operator/reviewer direction", "title": "m3ta Telegram feedback on claim node shape", "usage_limits": "Use as review direction for KB proposal hygiene and candidate reframing; not external evidence."}}', '731dab6bb99a573d0242cdd067661ea9b257a581b8187134f1a1eb04df63d3b3', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, 'article', 'https://fee.org/articles/the-use-of-knowledge-in-society/', + '/home/teleo/.hermes/profiles/leoclean/kb_stage/research/claim-node-standard/hayek_fee_text.txt', '{"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 concentrated...\n\nThe marvel is that... without an order being issued... tens of thousands of people... are made to use the material or its products more sparingly.", "metadata": {"source_key": "hayek_use_of_knowledge_in_society_fee_snapshot", "source_quality": "primary canonical essay text snapshot", "title": "F. A. Hayek, The Use of Knowledge in Society", "usage_limits": "Supports reframing the Hayek anchor toward dispersed local knowledge and the price system as compressed communication/coordination, not merely a generic local/global-information claim."}}', '4dcf12eda82943e8c945950a866ae699e5bd92584122edffd5456c9b415dc43f', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, 'other', null, + null, '{"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 and boundaries, which reduces false agreement and later graph drift.", "candidate_review_note": null, "claim_key": "claim_nodes_need_bodies", "evidence_tier": null, "headline": "KB claim nodes need explanatory bodies, not only one-sentence headlines.", "needs_research": null, "proposal_id": "ac036c9d-20a0-4ffe-881f-57d6b7bacf22", "review_note": "Approved by m3ta in Telegram with caveat: not every node is a claim; concept maps and other node types also need headline/body/edges/evidence-style hygiene where appropriate. Hayek should likely be structured as a pure concept map of distributed market intelligence, then connected to agent/telos extrapolations rather than forcing a replacement claim.", "reviewed_by_handle": "m3ta", "source_ref": "telegram-doc:/home/teleo/.hermes/profiles/leoclean/cache/documents/doc_e37afcd86605_teleo_agent_strategy_kernels_2026-06-30.md; session:20260705_claim_shape"}', 'f9851aa86d9355a37bafc8f7162f17839ab48164e602db7b8d312ad649d0aa0a', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, 'other', null, + null, '{"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, and market-based feedback loops may outperform legacy financial institutions in more and more capital-allocation contexts. If capital allocation is society’s revealed prioritization system, then infrastructure that changes how capital is formed, priced, governed, and allocated becomes a coordination mechanism. This remains a research-backed thesis candidate, not an approved empirical conclusion.", "candidate_review_note": null, "claim_key": "internet_finance_structural_advantages_body_draft", "evidence_tier": null, "headline": "Internet finance has structural advantages that make it likely to become an increasingly important capital-allocation mechanism.", "needs_research": ["transaction-cost evidence", "liquidity/cost-of-capital evidence", "tokenization/settlement evidence", "DeFi/composability evidence", "counterevidence on fraud/regulation/adverse-selection/governance capture"], "proposal_id": "ac036c9d-20a0-4ffe-881f-57d6b7bacf22", "review_note": "Approved by m3ta in Telegram with caveat: not every node is a claim; concept maps and other node types also need headline/body/edges/evidence-style hygiene where appropriate. Hayek should likely be structured as a pure concept map of distributed market intelligence, then connected to agent/telos extrapolations rather than forcing a replacement claim.", "reviewed_by_handle": "m3ta", "source_ref": "telegram-doc:/home/teleo/.hermes/profiles/leoclean/cache/documents/doc_e37afcd86605_teleo_agent_strategy_kernels_2026-06-30.md; session:20260705_claim_shape"}', 'e3af0f889ae11a81888de40e34336b05d2bf0dc178b3b76bc6ea8c50edff96cf', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, 'other', null, + null, '{"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-relevant frame is the positive mechanism: useful knowledge is dispersed among people in particular circumstances of time and place, and the price system compresses signals so many actors can adjust without a central planner knowing the full causal story. This better supports claims about capital allocation, internet finance, prediction markets, and collective intelligence as coordination systems.", "candidate_review_note": null, "claim_key": "hayek_reframed_price_system_distributed_knowledge", "evidence_tier": null, "headline": "Hayek’s most relevant contribution for Teleo is that prices coordinate dispersed, local, time-sensitive knowledge without central possession of that knowledge.", "needs_research": null, "proposal_id": "ac036c9d-20a0-4ffe-881f-57d6b7bacf22", "review_note": "Approved by m3ta in Telegram with caveat: not every node is a claim; concept maps and other node types also need headline/body/edges/evidence-style hygiene where appropriate. Hayek should likely be structured as a pure concept map of distributed market intelligence, then connected to agent/telos extrapolations rather than forcing a replacement claim.", "reviewed_by_handle": "m3ta", "source_ref": "telegram-doc:/home/teleo/.hermes/profiles/leoclean/cache/documents/doc_e37afcd86605_teleo_agent_strategy_kernels_2026-06-30.md; session:20260705_claim_shape"}', 'd6b4ee4312442116877f33e20ae5ed5e14ef2aeae6585ca0e5ab956ba75b9709', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid + and source_id = 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid + and source_id = '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and source_id = 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and source_id = '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and source_id = '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and source_id = '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, + 'derives_from'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and to_claim = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and edge_type = 'derives_from'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'c0000000-0000-0000-0000-00000000000c'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and to_claim = 'c0000000-0000-0000-0000-00000000000c'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and to_claim = '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, + 'supports'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and to_claim = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and edge_type = 'supports'::edge_type); + +commit; diff --git a/docs/reports/leo-working-state-20260709/production-apply-packet-summary.json b/docs/reports/leo-working-state-20260709/production-apply-packet-summary.json new file mode 100644 index 0000000..fb6895f --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-apply-packet-summary.json @@ -0,0 +1,203 @@ +{ + "claim_ceiling": "Production apply packet for mapped supported subset only; original rich proposals are not marked applied because non-claim targets remain unresolved.", + "marks_original_proposals_applied": false, + "packet_version": 1, + "plan_path": "../../outputs/rich-proposal-creation-plan-20260709/rich-proposal-creation-plan-mapped.json", + "proposal_ids": [ + "14fa5ecc-ac7a-41c1-807d-a2e85b936617", + "ac036c9d-20a0-4ffe-881f-57d6b7bacf22" + ], + "remaining_blocked_fragments": [ + { + "default_from_key": "capital_allocation_is_civilizational_steering", + "edge_type_mapping": null, + "fragment": { + "edge_type": "supports", + "target": "rio:capital-deployment-layer" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "supports", + "from_claim": "004195cc-ab62-526c-90fb-51cb0f826ec0", + "to_claim": "rio:capital-deployment-layer" + }, + "target_mapping": null + }, + { + "default_from_key": "capital_allocation_is_civilizational_steering", + "edge_type_mapping": null, + "fragment": { + "edge_type": "relates", + "target": "teleo telos / fund-build paths toward better attractors" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "relates", + "from_claim": "004195cc-ab62-526c-90fb-51cb0f826ec0", + "to_claim": "teleo telos / fund-build paths toward better attractors" + }, + "target_mapping": null + }, + { + "default_from_key": "capital_allocation_depends_on_distributed_market_intelligence", + "edge_type_mapping": { + "from": "draws_from", + "reason": "The proposal means conceptual derivation/source lineage; live claim_edges supports derives_from.", + "to": "derives_from" + }, + "fragment": { + "edge_type": "draws_from", + "target": "concept_map:distributed_market_intelligence" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "derives_from", + "from_claim": "d009dfc4-9755-58a7-affb-80e3e842a775", + "to_claim": "concept_map:distributed_market_intelligence" + }, + "target_mapping": null + }, + { + "default_from_key": "internet_finance_structural_advantages_capital_allocation", + "edge_type_mapping": null, + "fragment": { + "edge_type": "relates", + "target": "rio:active strategy v1 / internet-finance capital product" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "relates", + "from_claim": "67003e10-e1ee-5905-8b51-1b0cb263ec11", + "to_claim": "rio:active strategy v1 / internet-finance capital product" + }, + "target_mapping": null + }, + { + "default_from_key": "internet_finance_is_mechanism_not_telos", + "edge_type_mapping": null, + "fragment": { + "edge_type": "constrains", + "target": "rio:active strategy v1 / internet-finance capital product" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "constrains", + "from_claim": "e6ce4e36-15d2-53bc-8b74-dda0efc095c1", + "to_claim": "rio:active strategy v1 / internet-finance capital product" + }, + "target_mapping": null + }, + { + "default_from_key": "internet_finance_is_mechanism_not_telos", + "edge_type_mapping": null, + "fragment": { + "edge_type": "serves", + "target": "teleo telos" + }, + "kind": "edge", + "reasons": [ + "unsupported edge_type 'serves'", + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "serves", + "from_claim": "e6ce4e36-15d2-53bc-8b74-dda0efc095c1", + "to_claim": "teleo telos" + }, + "target_mapping": null + }, + { + "default_from_key": "claim_nodes_need_bodies", + "edge_type_mapping": null, + "fragment": { + "edge_type": "supports", + "rationale": "Specific enough to disagree with requires more than a compressed headline for ambiguous claims.", + "target": "governance_gate:quality-gate" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "supports", + "from_claim": "9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0", + "to_claim": "governance_gate:quality-gate" + }, + "target_mapping": null + }, + { + "default_from_key": "claim_nodes_need_bodies", + "edge_type_mapping": null, + "fragment": { + "edge_type": "supports", + "rationale": "Bodies can state the true evidence tier and scope limits.", + "target": "governance_gate:evidence-bar" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "supports", + "from_claim": "9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0", + "to_claim": "governance_gate:evidence-bar" + }, + "target_mapping": null + } + ], + "required_existing_claims": [ + { + "id": "7da4851c-0aac-4084-a99f-baeeeb3aa23e", + "reason": "claim_edges.to_claim" + }, + { + "id": "c0000000-0000-0000-0000-00000000000c", + "reason": "claim_edges.to_claim" + }, + { + "id": "d0000000-0000-0000-0000-000000000005", + "reason": "claim_edges.to_claim" + } + ], + "row_counts": { + "claim_edges": 11, + "claim_evidence": 17, + "claims": 7, + "sources": 15 + }, + "unresolved_design_decisions": [ + { + "decision": "many_successor_supersession", + "reason": "public.claims.superseded_by stores one UUID, but this proposal splits one claim into multiple successors.", + "safe_default": "Do not update public.claims.superseded_by in this plan; use reviewed edges or an aggregate successor node." + }, + { + "decision": "concept_map_storage", + "reason": "The proposal includes a concept-map node but the live canonical claim/source contract has no first-class concept-map table in this apply lane.", + "safe_default": "Keep concept-map content as source-backed context until a reviewed schema lane exists." + } + ] +} diff --git a/docs/reports/leo-working-state-20260709/production-apply-packet.json b/docs/reports/leo-working-state-20260709/production-apply-packet.json new file mode 100644 index 0000000..64c343a --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-apply-packet.json @@ -0,0 +1,203 @@ +{ + "claim_ceiling": "Production apply packet for mapped supported subset only; original rich proposals are not marked applied because non-claim targets remain unresolved.", + "marks_original_proposals_applied": false, + "packet_version": 1, + "plan_path": "../../outputs/rich-proposal-creation-plan-20260709/rich-proposal-creation-plan-mapped.json", + "proposal_ids": [ + "14fa5ecc-ac7a-41c1-807d-a2e85b936617", + "ac036c9d-20a0-4ffe-881f-57d6b7bacf22" + ], + "remaining_blocked_fragments": [ + { + "default_from_key": "capital_allocation_is_civilizational_steering", + "edge_type_mapping": null, + "fragment": { + "edge_type": "supports", + "target": "rio:capital-deployment-layer" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "supports", + "from_claim": "004195cc-ab62-526c-90fb-51cb0f826ec0", + "to_claim": "rio:capital-deployment-layer" + }, + "target_mapping": null + }, + { + "default_from_key": "capital_allocation_is_civilizational_steering", + "edge_type_mapping": null, + "fragment": { + "edge_type": "relates", + "target": "teleo telos / fund-build paths toward better attractors" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "relates", + "from_claim": "004195cc-ab62-526c-90fb-51cb0f826ec0", + "to_claim": "teleo telos / fund-build paths toward better attractors" + }, + "target_mapping": null + }, + { + "default_from_key": "capital_allocation_depends_on_distributed_market_intelligence", + "edge_type_mapping": { + "from": "draws_from", + "reason": "The proposal means conceptual derivation/source lineage; live claim_edges supports derives_from.", + "to": "derives_from" + }, + "fragment": { + "edge_type": "draws_from", + "target": "concept_map:distributed_market_intelligence" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "derives_from", + "from_claim": "d009dfc4-9755-58a7-affb-80e3e842a775", + "to_claim": "concept_map:distributed_market_intelligence" + }, + "target_mapping": null + }, + { + "default_from_key": "internet_finance_structural_advantages_capital_allocation", + "edge_type_mapping": null, + "fragment": { + "edge_type": "relates", + "target": "rio:active strategy v1 / internet-finance capital product" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "relates", + "from_claim": "67003e10-e1ee-5905-8b51-1b0cb263ec11", + "to_claim": "rio:active strategy v1 / internet-finance capital product" + }, + "target_mapping": null + }, + { + "default_from_key": "internet_finance_is_mechanism_not_telos", + "edge_type_mapping": null, + "fragment": { + "edge_type": "constrains", + "target": "rio:active strategy v1 / internet-finance capital product" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "constrains", + "from_claim": "e6ce4e36-15d2-53bc-8b74-dda0efc095c1", + "to_claim": "rio:active strategy v1 / internet-finance capital product" + }, + "target_mapping": null + }, + { + "default_from_key": "internet_finance_is_mechanism_not_telos", + "edge_type_mapping": null, + "fragment": { + "edge_type": "serves", + "target": "teleo telos" + }, + "kind": "edge", + "reasons": [ + "unsupported edge_type 'serves'", + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "serves", + "from_claim": "e6ce4e36-15d2-53bc-8b74-dda0efc095c1", + "to_claim": "teleo telos" + }, + "target_mapping": null + }, + { + "default_from_key": "claim_nodes_need_bodies", + "edge_type_mapping": null, + "fragment": { + "edge_type": "supports", + "rationale": "Specific enough to disagree with requires more than a compressed headline for ambiguous claims.", + "target": "governance_gate:quality-gate" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "supports", + "from_claim": "9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0", + "to_claim": "governance_gate:quality-gate" + }, + "target_mapping": null + }, + { + "default_from_key": "claim_nodes_need_bodies", + "edge_type_mapping": null, + "fragment": { + "edge_type": "supports", + "rationale": "Bodies can state the true evidence tier and scope limits.", + "target": "governance_gate:evidence-bar" + }, + "kind": "edge", + "reasons": [ + "to_claim does not resolve to a UUID", + "target is external/context text and needs a reviewed canonical mapping" + ], + "resolved": { + "edge_type": "supports", + "from_claim": "9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0", + "to_claim": "governance_gate:evidence-bar" + }, + "target_mapping": null + } + ], + "required_existing_claims": [ + { + "id": "7da4851c-0aac-4084-a99f-baeeeb3aa23e", + "reason": "claim_edges.to_claim" + }, + { + "id": "c0000000-0000-0000-0000-00000000000c", + "reason": "claim_edges.to_claim" + }, + { + "id": "d0000000-0000-0000-0000-000000000005", + "reason": "claim_edges.to_claim" + } + ], + "row_counts": { + "claim_edges": 11, + "claim_evidence": 17, + "claims": 7, + "sources": 15 + }, + "unresolved_design_decisions": [ + { + "decision": "many_successor_supersession", + "reason": "public.claims.superseded_by stores one UUID, but this proposal splits one claim into multiple successors.", + "safe_default": "Do not update public.claims.superseded_by in this plan; use reviewed edges or an aggregate successor node." + }, + { + "decision": "concept_map_storage", + "reason": "The proposal includes a concept-map node but the live canonical claim/source contract has no first-class concept-map table in this apply lane.", + "safe_default": "Keep concept-map content as source-backed context until a reviewed schema lane exists." + } + ] +} \ No newline at end of file diff --git a/docs/reports/leo-working-state-20260709/production-apply-rollback-rehearsal.sql b/docs/reports/leo-working-state-20260709/production-apply-rollback-rehearsal.sql new file mode 100644 index 0000000..9f37081 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-apply-rollback-rehearsal.sql @@ -0,0 +1,400 @@ +begin; + +set local statement_timeout = '30s'; + +-- rollback-only rehearsal: do not replace ROLLBACK with COMMIT without separate review + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'structural', 'Capital allocation is a form of civilizational steering because it determines which futures receive resources.', + 'open', 0.65, array['capital-allocation', 'civilizational-steering', 'coordination', 'rio', 'teleo-strategy']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'structural', 'Capital allocation depends on distributed knowledge, incentives, liquidity, and feedback loops.', + 'open', 0.7, array['capital-allocation', 'distributed-market-intelligence', 'hayek', 'mechanism-design', 'collective-intelligence']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'structural', 'Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism.', + 'open', 0.45, array['internet-finance', 'capital-allocation', 'programmable-governance', 'liquidity', 'rio']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'normative', 'Internet finance is not Teleo’s telos; it is a candidate mechanism for pursuing the telos.', + 'open', 0.8, array['telos', 'internet-finance', 'rio', 'governance', 'strategy-boundary']::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'dm', null, + null, '{"excerpt": "Yes let’s 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 expressed priorities.\n\nBetter split: A. Capital allocation is a form of civilizational steering... B. Capital allocation depends on distributed knowledge... C. Internet finance has structural advantages... D. Internet finance is not the telos; it is a candidate mechanism.", "metadata": {"source_key": "m3ta_telegram_approval_supersede_split_2026_07_05", "source_quality": "primary operator/reviewer direction", "title": "m3ta Telegram approval to supersede compressed internet-finance claim", "usage_limits": "Provenance for proposal direction and review intent; not external empirical evidence."}}', '3fb4a747e76ec4116993a1cd4d59c1710e849a92dcc75bb0a179931be03a10c8', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid, 'other', null, + null, '{"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-a99f-baeeeb3aa23e", "source_key": "kb_existing_hayek_claim_7da4851c", "source_quality": "canonical KB neighbor with evidence rows; needs reframing under distributed market intelligence concept map", "title": "Existing KB Hayek claim", "usage_limits": "Use as an existing graph neighbor, not as the final Hayek concept-map root."}}', '5ab1eae24c2acd3363a4cd2c2e0581e7c5e379753773719230419aa3b4c539fb', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, 'article', 'https://fee.org/articles/the-use-of-knowledge-in-society/', + '/home/teleo/.hermes/profiles/leoclean/kb_stage/research/claim-node-standard/hayek_fee_text.txt', '{"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 concentrated...\n\nThe marvel is that... without an order being issued... tens of thousands of people... are made to use the material or its products more sparingly.", "metadata": {"source_key": "hayek_use_of_knowledge_in_society_fee_snapshot", "source_quality": "primary essay text snapshot", "title": "F. A. Hayek, The Use of Knowledge in Society", "usage_limits": "Supports the distributed market intelligence concept map and claim B; does not by itself prove internet finance superiority."}}', 'bb4934d37d3b327de5d12d62d58997b2c41e199e27c4a1407295ed36c975ed66', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, 'other', null, + null, '{"excerpt": "Capital allocation is civilizational infrastructure, not a financial service.", "metadata": {"source_key": "rio_belief_capital_allocation_civilizational_infrastructure", "source_quality": "canonical agent belief/context neighbor", "title": "Rio belief rank 1", "usage_limits": "Use as internal Rio strategy/belief grounding, not external evidence."}}', 'fc6b6fa09947c04ed44df6570aa0389744e62e3e5b7d04ecfeda080fae6cbc89', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'other', null, + null, '{"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_strategy_v2_context", "source_quality": "canonical agent strategy/context neighbor", "title": "Leo active strategy v2 context", "usage_limits": "Use as internal strategy-context grounding only."}}', 'a00f39707b1d90c31303da603d9daa1198ae1b810b45f54bd48bb599b64212be', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, 'other', null, + null, '{"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 compete for scarce capital, allocation decisions function as steering inputs: they amplify some attractors and starve others. This does not mean capital is the only steering mechanism or that markets should decide the telos; it means resource flows are one of the main ways a society reveals and operationalizes priorities.", "candidate_review_note": "Approve as a structural/internal strategy claim at moderate confidence; external evidence can later raise confidence.", "claim_key": "capital_allocation_is_civilizational_steering", "evidence_tier": "internal/theoretical; needs external grounding for stronger confidence", "headline": "Capital allocation is a form of civilizational steering because it determines which futures receive resources.", "needs_research": null, "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', '4b7d20219f51607e05010cd8c6b888c3b5a96f9a7a534c4c7907b765e8a10955', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, 'other', null, + null, '{"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 or price discovery that updates beliefs, and feedback loops that reveal whether resources were well allocated. This connects Hayek’s price-system insight to Teleo’s capital thesis: markets are a kind of social computation, but the computation is only as good as its mechanism design, participation, information quality, and correction loops.", "candidate_review_note": "This is the cleanest immediate Hayek-linked successor component. It should not replace the pure Hayek concept map; it applies that concept to capital allocation.", "claim_key": "capital_allocation_depends_on_distributed_market_intelligence", "evidence_tier": "primary-theoretical plus internal synthesis", "headline": "Capital allocation depends on distributed knowledge, incentives, liquidity, and feedback loops.", "needs_research": null, "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', '0972238794dffe6993ce6dfed7e652b184a15675c1e1e1149643e9212f033596', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, 'other', null, + null, '{"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 thesis is not that crypto automatically wins or that all financial activity should move on-chain. The claim is that when financial primitives become cheaper, more transparent, more programmable, and more broadly accessible, they can outperform legacy intermediary-heavy systems in some allocation contexts. This remains the main empirical research claim in the cluster and should stay lower confidence until supported by evidence on costs, liquidity, access, governance quality, fraud, regulation, and adverse selection.", "candidate_review_note": "Approve as a research queue / thesis candidate, not as high-confidence canonical conclusion.", "claim_key": "internet_finance_structural_advantages_capital_allocation", "evidence_tier": "thesis candidate; requires research", "headline": "Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism.", "needs_research": ["transaction cost and intermediation cost evidence", "settlement/tokenization evidence", "liquidity and price-discovery evidence", "global access and capital-formation evidence", "programmable governance/futarchy evidence", "counterevidence: hacks, fraud, manipulation, regulatory frictions, adverse selection, governance capture"], "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', 'e332679983a38ab0fc14ba88327394ee08ba94f454ce2f918ca98881d7da11b2', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, 'other', null, + null, '{"body": "Teleo’s 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, forecasts, ownership, and resource flows toward mission-oriented builders and desirable attractor states. This distinction prevents Rio’s mechanism from becoming the collective’s purpose and keeps capital allocation subordinate to human agency, safety, governance, and the broader post-scarcity/multiplanetary aim.", "candidate_review_note": "This should be approved as a boundary claim to prevent mechanism/telos collapse.", "claim_key": "internet_finance_is_mechanism_not_telos", "evidence_tier": "internal strategy/governance", "headline": "Internet finance is not Teleo’s telos; it is a candidate mechanism for pursuing the telos.", "needs_research": null, "proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "review_note": "Approved by m3ta in Telegram: supersede old compressed internet-finance/capital-allocation claim; approve successor A, B, and D at stated confidence/evidence tiers; approve C only as low-confidence research thesis; approve Distributed market intelligence as concept-map dependency. Canonical application still requires apply workflow for successor rows/edges/evidence.", "reviewed_by_handle": "m3ta", "source_ref": "telegram:m3ta:2026-07-05:supersede-old-internet-finance-claim"}', '75e3f94ad2b7fcbdc096e56f05bc396c8f62fad055326c9d0ee7d760090746d9', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and source_id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and source_id = '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and source_id = '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and source_id = '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and source_id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and source_id = '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and source_id = '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and source_id = '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and to_claim = 'd0000000-0000-0000-0000-000000000005'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and to_claim = '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, + 'requires'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and to_claim = 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid + and edge_type = 'requires'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, + 'constrains'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid + and to_claim = '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid + and edge_type = 'constrains'::edge_type); + +rollback; + + +begin; + +set local statement_timeout = '30s'; + +-- rollback-only rehearsal: do not replace ROLLBACK with COMMIT without separate review + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'meta', 'KB claim nodes need explanatory bodies, not only one-sentence headlines.', + 'open', 0.85, '{}'::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'structural', 'Internet finance has structural advantages that make it likely to become an increasingly important capital-allocation mechanism.', + 'open', 0.45, '{}'::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid); + +insert into public.claims (id, type, text, status, confidence, tags, created_by) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, 'structural', 'Hayek’s most relevant contribution for Teleo is that prices coordinate dispersed, local, time-sensitive knowledge without central possession of that knowledge.', + 'open', 0.8, '{}'::text[], + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.claims where id = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid, 'other', null, + null, '{"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 map, Attractor-state analysis, Power-window detection, Collective epistemic architecture.\n\nAgent evolution must be legible, reviewable, attributable, corrigible, contributor-shaped, and user-controlled. Identity is a control surface.", "metadata": {"source_key": "telegram_attachment_teleo_agent_strategy_kernels_2026_06_30", "source_quality": "primary/internal working synthesis; explicitly non-canonical", "title": "Teleo Collective Telos and Agent Strategy Kernels", "usage_limits": "Use as provenance for m3ta/Leo working synthesis and agent-strategy formatting expectations, not as empirical evidence for external claims."}}', 'aa2c731057b11788dc1600d4af8570276352bcbdb2be3b307e9ffc5f4670b8ce', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'other', null, + null, '{"excerpt": "Nodes should have a headline that’s 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 a claim he makes but I am not sure it is the strongest in the paper or the most relevant to us.", "metadata": {"source_key": "telegram_feedback_m3ta_claim_shape_2026_07_05", "source_quality": "primary operator/reviewer direction", "title": "m3ta Telegram feedback on claim node shape", "usage_limits": "Use as review direction for KB proposal hygiene and candidate reframing; not external evidence."}}', '731dab6bb99a573d0242cdd067661ea9b257a581b8187134f1a1eb04df63d3b3', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, 'article', 'https://fee.org/articles/the-use-of-knowledge-in-society/', + '/home/teleo/.hermes/profiles/leoclean/kb_stage/research/claim-node-standard/hayek_fee_text.txt', '{"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 concentrated...\n\nThe marvel is that... without an order being issued... tens of thousands of people... are made to use the material or its products more sparingly.", "metadata": {"source_key": "hayek_use_of_knowledge_in_society_fee_snapshot", "source_quality": "primary canonical essay text snapshot", "title": "F. A. Hayek, The Use of Knowledge in Society", "usage_limits": "Supports reframing the Hayek anchor toward dispersed local knowledge and the price system as compressed communication/coordination, not merely a generic local/global-information claim."}}', '4dcf12eda82943e8c945950a866ae699e5bd92584122edffd5456c9b415dc43f', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, 'other', null, + null, '{"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 and boundaries, which reduces false agreement and later graph drift.", "candidate_review_note": null, "claim_key": "claim_nodes_need_bodies", "evidence_tier": null, "headline": "KB claim nodes need explanatory bodies, not only one-sentence headlines.", "needs_research": null, "proposal_id": "ac036c9d-20a0-4ffe-881f-57d6b7bacf22", "review_note": "Approved by m3ta in Telegram with caveat: not every node is a claim; concept maps and other node types also need headline/body/edges/evidence-style hygiene where appropriate. Hayek should likely be structured as a pure concept map of distributed market intelligence, then connected to agent/telos extrapolations rather than forcing a replacement claim.", "reviewed_by_handle": "m3ta", "source_ref": "telegram-doc:/home/teleo/.hermes/profiles/leoclean/cache/documents/doc_e37afcd86605_teleo_agent_strategy_kernels_2026-06-30.md; session:20260705_claim_shape"}', 'f9851aa86d9355a37bafc8f7162f17839ab48164e602db7b8d312ad649d0aa0a', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, 'other', null, + null, '{"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, and market-based feedback loops may outperform legacy financial institutions in more and more capital-allocation contexts. If capital allocation is society’s revealed prioritization system, then infrastructure that changes how capital is formed, priced, governed, and allocated becomes a coordination mechanism. This remains a research-backed thesis candidate, not an approved empirical conclusion.", "candidate_review_note": null, "claim_key": "internet_finance_structural_advantages_body_draft", "evidence_tier": null, "headline": "Internet finance has structural advantages that make it likely to become an increasingly important capital-allocation mechanism.", "needs_research": ["transaction-cost evidence", "liquidity/cost-of-capital evidence", "tokenization/settlement evidence", "DeFi/composability evidence", "counterevidence on fraud/regulation/adverse-selection/governance capture"], "proposal_id": "ac036c9d-20a0-4ffe-881f-57d6b7bacf22", "review_note": "Approved by m3ta in Telegram with caveat: not every node is a claim; concept maps and other node types also need headline/body/edges/evidence-style hygiene where appropriate. Hayek should likely be structured as a pure concept map of distributed market intelligence, then connected to agent/telos extrapolations rather than forcing a replacement claim.", "reviewed_by_handle": "m3ta", "source_ref": "telegram-doc:/home/teleo/.hermes/profiles/leoclean/cache/documents/doc_e37afcd86605_teleo_agent_strategy_kernels_2026-06-30.md; session:20260705_claim_shape"}', 'e3af0f889ae11a81888de40e34336b05d2bf0dc178b3b76bc6ea8c50edff96cf', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid); + +insert into public.sources (id, source_type, url, storage_path, excerpt, hash, created_by) +select '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, 'other', null, + null, '{"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-relevant frame is the positive mechanism: useful knowledge is dispersed among people in particular circumstances of time and place, and the price system compresses signals so many actors can adjust without a central planner knowing the full causal story. This better supports claims about capital allocation, internet finance, prediction markets, and collective intelligence as coordination systems.", "candidate_review_note": null, "claim_key": "hayek_reframed_price_system_distributed_knowledge", "evidence_tier": null, "headline": "Hayek’s most relevant contribution for Teleo is that prices coordinate dispersed, local, time-sensitive knowledge without central possession of that knowledge.", "needs_research": null, "proposal_id": "ac036c9d-20a0-4ffe-881f-57d6b7bacf22", "review_note": "Approved by m3ta in Telegram with caveat: not every node is a claim; concept maps and other node types also need headline/body/edges/evidence-style hygiene where appropriate. Hayek should likely be structured as a pure concept map of distributed market intelligence, then connected to agent/telos extrapolations rather than forcing a replacement claim.", "reviewed_by_handle": "m3ta", "source_ref": "telegram-doc:/home/teleo/.hermes/profiles/leoclean/cache/documents/doc_e37afcd86605_teleo_agent_strategy_kernels_2026-06-30.md; session:20260705_claim_shape"}', 'd6b4ee4312442116877f33e20ae5ed5e14ef2aeae6585ca0e5ab956ba75b9709', + '11111111-1111-1111-1111-111111111111'::uuid + where not exists (select 1 from public.sources where id = '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid + and source_id = 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid + and source_id = '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and source_id = 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and source_id = '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, + 'illustrates'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and source_id = '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid + and role = 'illustrates'::evidence_role); + +insert into public.claim_evidence (claim_id, source_id, role, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, + 'grounds'::evidence_role, null + where not exists ( + select 1 from public.claim_evidence + where claim_id = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and source_id = '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid + and role = 'grounds'::evidence_role); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, + 'derives_from'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and to_claim = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and edge_type = 'derives_from'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'c0000000-0000-0000-0000-00000000000c'::uuid, + 'relates'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and to_claim = 'c0000000-0000-0000-0000-00000000000c'::uuid + and edge_type = 'relates'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, + 'supersedes'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and to_claim = '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid + and edge_type = 'supersedes'::edge_type); + +insert into public.claim_edges (from_claim, to_claim, edge_type, weight) +select 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, + 'supports'::edge_type, null + where not exists ( + select 1 from public.claim_edges + where from_claim = 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid + and to_claim = '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid + and edge_type = 'supports'::edge_type); + +rollback; diff --git a/docs/reports/leo-working-state-20260709/production-delete-rollback.sql b/docs/reports/leo-working-state-20260709/production-delete-rollback.sql new file mode 100644 index 0000000..16bf949 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-delete-rollback.sql @@ -0,0 +1,87 @@ +\set ON_ERROR_STOP on +-- Emergency rollback for the mapped generated rows only. +-- Run only before any later production data depends on these generated rows. +begin; + +delete from public.claim_evidence ce +using (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, 'illustrates'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, 'illustrates'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, 'grounds'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, 'illustrates'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, 'illustrates'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, 'illustrates'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, 'illustrates'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, 'illustrates'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) +where ce.claim_id = v.claim_id and ce.source_id = v.source_id and ce.role = v.role; + +delete from public.claim_edges e +using (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'relates'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'requires'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'constrains'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, 'derives_from'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'c0000000-0000-0000-0000-00000000000c'::uuid, 'relates'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'supersedes'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) +where e.from_claim = v.from_claim and e.to_claim = v.to_claim and e.edge_type = v.edge_type; + +update public.claims +set superseded_by = null, + updated_at = now() +where superseded_by in (select id from (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid) + ) as v(id)); + +delete from public.sources +where id in (select id from (values + ('9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid), + ('87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid), + ('33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid), + ('3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid), + ('8f952541-5f12-5f24-88b3-21e7842163a1'::uuid), + ('f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid), + ('9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid), + ('6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid), + ('997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid), + ('703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid), + ('4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid), + ('4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid), + ('a3cba49b-7016-5f42-9af6-041f12371a24'::uuid), + ('eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid), + ('244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid) + ) as v(id)); + +delete from public.claims +where id in (select id from (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid) + ) as v(id)); + +commit; diff --git a/docs/reports/leo-working-state-20260709/production-postflight.sql b/docs/reports/leo-working-state-20260709/production-postflight.sql new file mode 100644 index 0000000..e1327e6 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-postflight.sql @@ -0,0 +1,150 @@ +\set ON_ERROR_STOP on +-- Postflight row-level readback for mapped rich proposal apply packet. + +select + (select count(*) from public.claims where id in (select id from (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid) + ) as v(id))) as generated_claim_rows, + (select count(*) from public.sources where id in (select id from (values + ('9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid), + ('87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid), + ('33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid), + ('3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid), + ('8f952541-5f12-5f24-88b3-21e7842163a1'::uuid), + ('f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid), + ('9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid), + ('6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid), + ('997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid), + ('703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid), + ('4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid), + ('4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid), + ('a3cba49b-7016-5f42-9af6-041f12371a24'::uuid), + ('eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid), + ('244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid) + ) as v(id))) as generated_source_rows, + (select count(*) from public.claim_edges e join (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'relates'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'requires'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'constrains'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, 'derives_from'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'c0000000-0000-0000-0000-00000000000c'::uuid, 'relates'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'supersedes'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) using (from_claim, to_claim, edge_type)) as generated_edge_rows, + (select count(*) from public.claim_evidence ce join (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, 'illustrates'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, 'illustrates'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, 'grounds'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, 'illustrates'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, 'illustrates'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, 'illustrates'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, 'illustrates'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, 'illustrates'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) using (claim_id, source_id, role)) as generated_evidence_rows; + + +select id::text, type, confidence, left(text, 220) as text +from public.claims +where id in (select id from (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid) + ) as v(id)) +order by id; + +select id::text, source_type, left(coalesce(excerpt, ''), 220) as excerpt +from public.sources +where id in (select id from (values + ('9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid), + ('87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid), + ('33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid), + ('3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid), + ('8f952541-5f12-5f24-88b3-21e7842163a1'::uuid), + ('f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid), + ('9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid), + ('6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid), + ('997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid), + ('703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid), + ('4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid), + ('4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid), + ('a3cba49b-7016-5f42-9af6-041f12371a24'::uuid), + ('eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid), + ('244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid) + ) as v(id)) +order by id; + +select e.from_claim::text, e.to_claim::text, e.edge_type::text +from public.claim_edges e +join (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'relates'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'requires'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'constrains'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, 'derives_from'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'c0000000-0000-0000-0000-00000000000c'::uuid, 'relates'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'supersedes'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) using (from_claim, to_claim, edge_type) +order by e.from_claim, e.to_claim, e.edge_type; + +select ce.claim_id::text, ce.source_id::text, ce.role::text +from public.claim_evidence ce +join (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, 'illustrates'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, 'illustrates'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, 'grounds'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, 'illustrates'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, 'illustrates'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, 'illustrates'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, 'illustrates'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, 'illustrates'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) using (claim_id, source_id, role) +order by ce.claim_id, ce.source_id, ce.role; + +select id::text, superseded_by::text +from public.claims +where superseded_by in (select id from (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid) + ) as v(id)) +order by id; diff --git a/docs/reports/leo-working-state-20260709/production-preflight.sql b/docs/reports/leo-working-state-20260709/production-preflight.sql new file mode 100644 index 0000000..8c951ca --- /dev/null +++ b/docs/reports/leo-working-state-20260709/production-preflight.sql @@ -0,0 +1,89 @@ +\set ON_ERROR_STOP on +-- Preflight for mapped rich proposal apply packet. Read-only. + +select id::text, status, proposal_type, reviewed_by_handle, reviewed_at +from kb_stage.kb_proposals +where id in (select id from (values + ('14fa5ecc-ac7a-41c1-807d-a2e85b936617'::uuid), + ('ac036c9d-20a0-4ffe-881f-57d6b7bacf22'::uuid) + ) as v(id)) +order by id; + +with required(id, reason) as ( + values + ('7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'claim_edges.to_claim'), + ('c0000000-0000-0000-0000-00000000000c'::uuid, 'claim_edges.to_claim'), + ('d0000000-0000-0000-0000-000000000005'::uuid, 'claim_edges.to_claim') +) +select 'missing_required_existing_claims' as check_name, id::text, reason +from required +where id is not null + and not exists (select 1 from public.claims where public.claims.id = required.id) +order by id; + +-- Expected generated rows after authorized commit: +select 7::int as expected_claims, + 15::int as expected_sources, + 11::int as expected_claim_edges, + 17::int as expected_claim_evidence; + +-- Must be all zero before production apply. +select + (select count(*) from public.claims where id in (select id from (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid) + ) as v(id))) as generated_claim_rows, + (select count(*) from public.sources where id in (select id from (values + ('9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid), + ('87f49cf0-5516-5aef-8ed9-f69292917d32'::uuid), + ('33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid), + ('3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid), + ('8f952541-5f12-5f24-88b3-21e7842163a1'::uuid), + ('f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid), + ('9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid), + ('6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid), + ('997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid), + ('703fdfaf-22c9-5f5b-8d29-cf238d5e156f'::uuid), + ('4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid), + ('4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid), + ('a3cba49b-7016-5f42-9af6-041f12371a24'::uuid), + ('eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid), + ('244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid) + ) as v(id))) as generated_source_rows, + (select count(*) from public.claim_edges e join (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, 'd0000000-0000-0000-0000-000000000005'::uuid, 'supersedes'::edge_type), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'relates'::edge_type), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'd009dfc4-9755-58a7-affb-80e3e842a775'::uuid, 'requires'::edge_type), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, 'constrains'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, 'derives_from'::edge_type), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'c0000000-0000-0000-0000-00000000000c'::uuid, 'relates'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '7da4851c-0aac-4084-a99f-baeeeb3aa23e'::uuid, 'supersedes'::edge_type), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'supports'::edge_type) + ) as v(from_claim, to_claim, edge_type) using (from_claim, to_claim, edge_type)) as generated_edge_rows, + (select count(*) from public.claim_evidence ce join (values + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, 'f80c01fe-63bb-5ccf-9bdd-744bab0e9163'::uuid, 'illustrates'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '3a57238c-ca31-5fe1-bece-e5fb2f174e32'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('004195cc-ab62-526c-90fb-51cb0f826ec0'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '9fd61e7e-d5cb-5904-b5c2-a539946f7c96'::uuid, 'illustrates'::evidence_role), + ('d009dfc4-9755-58a7-affb-80e3e842a775'::uuid, '33fadb51-0bd8-5f2d-87fe-758a3dd7fac0'::uuid, 'grounds'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '6c3c26c1-39bc-58e5-8c76-28b5712420ce'::uuid, 'illustrates'::evidence_role), + ('67003e10-e1ee-5905-8b51-1b0cb263ec11'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '997e5e58-b20d-560a-a73a-eaa4bff1dc3e'::uuid, 'illustrates'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '8f952541-5f12-5f24-88b3-21e7842163a1'::uuid, 'grounds'::evidence_role), + ('e6ce4e36-15d2-53bc-8b74-dda0efc095c1'::uuid, '9a0d2429-b98b-585a-980c-0176db7f9fe7'::uuid, 'grounds'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, 'a3cba49b-7016-5f42-9af6-041f12371a24'::uuid, 'illustrates'::evidence_role), + ('9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, 'eea07732-c65d-5db6-88d6-1ab08511eca6'::uuid, 'illustrates'::evidence_role), + ('62e82ee8-b204-573b-9707-eb5d832b9d9e'::uuid, '4787c38e-74cb-5bf5-93e1-0cc9c290684c'::uuid, 'grounds'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '244a4c38-86e5-5910-91f4-6d71529e9b31'::uuid, 'illustrates'::evidence_role), + ('cd8daac8-039c-5349-9c50-02f622e73b03'::uuid, '4cc0c7ee-2166-5cae-9065-ea226fa2be5b'::uuid, 'grounds'::evidence_role) + ) as v(claim_id, source_id, role) using (claim_id, source_id, role)) as generated_evidence_rows; diff --git a/docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md b/docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md index fefc83f..7db6daf 100644 --- a/docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md +++ b/docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md @@ -99,6 +99,11 @@ A working Leo, for Cory/m3taversal's current expectation, is a Telegram-facing a - disposable DB `teleo_governance_concept_rehearsal_20260710` applied the mapped base packet first (`7` claims) - governance/concept packet then inserted `1` concept map, `1` claim-concept link, and `2` claim-governance links - rollback deleted generated rows and dropped the generated tables because they were empty; base rollback returned generated base claims to `0`; production stayed unchanged with no generated tables; temp files and clone were removed; service remained active with `MainPID=3252143`, `NRestarts=0` +- Integrated production-order packet rehearsal is now clone-proven: + - disposable DB `teleo_integrated_rehearsal_20260710` applied the full prepared packet set in order: mapped base, cross-surface anchor, Rio strategy context, governance/concept schema, and Helmer 7 Powers + - clone apply footprint matched the integrated manifest: `12` claims, `28` sources, `18` claim edges, `34` claim evidence rows, `1` reasoning tool, `2` Rio strategy nodes, `5` Rio strategy anchors, `1` concept map, `1` concept link, `2` governance links, one Helmer ledger row marked `applied`, and one cross-surface anchor update + - reverse rollback restored generated base rows to `0/0/0/0`, Helmer rows to `0/0/0/0/0`, Helmer ledger to `approved`, cross-surface anchor to old claim `d0000000-0000-0000-0000-000000000005` at weight `0.7`, Rio rows to `0/0`, and generated governance/concept schema to absent + - production readback after the clone proof stayed unchanged: generated base rows `0/0/0/0`, Helmer rows `0/0/0/0/0`, Helmer ledger `approved`, generated governance/concept schema absent, service active with `MainPID=3252143`, `NRestarts=0` - VPS/Hermes/DB identity and document-linking map is now documented: - the supplied July 9 master/build and database-reference PDFs confirm the intended architecture is DB-first identity: canonical Postgres identity graph rows render to `SOUL.md`, and evidence depth remains on demand through `teleo-kb` - direct `SOUL.md` edits are profile/runtime artifact edits, not canonical DB updates; they can drift or be overwritten unless represented in canonical rows first @@ -132,6 +137,8 @@ A working Leo, for Cory/m3taversal's current expectation, is a Telegram-facing a - Rio strategy-context clone proof log: `outputs/rich-proposal-creation-plan-20260709/rio-strategy-context-20260710/rio-strategy-clone-rehearsal-current.log` - Governance/concept-map packet: `outputs/rich-proposal-creation-plan-20260709/governance-concept-20260710/governance-concept-packet.json` - Governance/concept-map clone proof log: `outputs/rich-proposal-creation-plan-20260709/governance-concept-20260710/governance-concept-clone-rehearsal-current.log` +- Integrated packet manifest: `outputs/rich-proposal-creation-plan-20260709/integrated-20260710/working-leo-integrated-packet.json` +- Integrated clone proof log: `outputs/rich-proposal-creation-plan-20260709/integrated-20260710/working-leo-integrated-clone-rehearsal-current.log` - VPS/Hermes/DB mapping: `outputs/vps-hermes-db-mapping-20260709.md` - Identity render / decision matrix / document artifact image: `outputs/leo-db-state-22-identity-render-matrix-artifacts.svg` - Execution plan: `outputs/working-leo-execution-plan-20260709/working-leo-execution-plan-current.md` @@ -151,11 +158,12 @@ A working Leo, for Cory/m3taversal's current expectation, is a Telegram-facing a - Cross-surface strategy anchor proof image: `outputs/leo-db-state-20-cross-surface-anchor.svg` - Rio strategy context proof image: `outputs/leo-db-state-23-rio-strategy-context.svg` - Governance/concept-map schema proof image: `outputs/leo-db-state-24-governance-concept-schema.svg` +- Integrated apply rehearsal proof image: `outputs/leo-db-state-25-integrated-apply-rehearsal.svg` - GCP parity blocker: `outputs/gcp-db-parity-current-blocker-20260709.json` ## Next Actions 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. -3. Do not run production apply without explicit authorization. The mapped base, cross-surface anchor, Rio strategy, and governance/concept packets are clone-proven but not production-applied. +3. Do not run production apply without explicit authorization. The mapped base, cross-surface anchor, Rio strategy, governance/concept, and Helmer packets compose in one clone and are ready as a packet set, but are not production-applied. 4. Keep VPS Leo runtime behavior unchanged while the DB apply path is stabilized. diff --git a/docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md b/docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md index 2ff7711..4e40db1 100644 --- a/docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md +++ b/docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md @@ -1,6 +1,6 @@ # 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 for its supported subset, the strategy-anchor companion write is clone-proven, the Rio strategy-context companion write is clone-proven, and the governance/concept-map schema companion write is clone-proven; none are production-applied. GCP parity remains 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. The full prepared DB packet set is integrated-clone-proven in dependency order: mapped rich base, cross-surface anchor, Rio strategy context, governance/concept schema, and Helmer 7 Powers. None are production-applied. GCP parity remains pending. ## WL-EXEC-01 - VPS Telegram-visible memory + KB audit - Status: `done` @@ -81,6 +81,15 @@ 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/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/governance-concept-20260710/governance-concept-clone-rehearsal-current.log` +## WL-EXEC-06B - Integrated production-order packet rehearsal +- Status: `done_integrated_clone_ready_not_executed` +- Result: Applied the full prepared packet set in one disposable clone in dependency order: mapped base, cross-surface anchor, Rio strategy context, governance/concept schema, and Helmer 7 Powers. Expected integrated footprint was `12` claims, `28` sources, `18` claim edges, `34` claim evidence rows, `1` reasoning tool, `2` Rio strategy nodes, `5` Rio strategy anchors, `1` concept map, `1` concept link, `2` governance links, one Helmer ledger row marked applied, and one cross-surface anchor update. Reverse rollback restored all generated rows/schema to zero/absent, restored the cross-surface anchor to the old claim, restored the Helmer ledger to `approved`, dropped the disposable DB, removed temp files, and left production unchanged. +- Next action: If production apply is explicitly authorized, use the integrated manifest order and immediately rerun live Telegram regression canaries after production postflight. +- Not done condition: Production canonical rows/schema remain unapplied until explicit production apply authorization. +- Evidence: + - `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/integrated-20260710/working-leo-integrated-packet.md` + - `/Users/user/Documents/Codex/2026-07-09/019f34eb-d297-72d0-b7e2-b222d5515ab9-load/outputs/rich-proposal-creation-plan-20260709/integrated-20260710/working-leo-integrated-clone-rehearsal-current.log` + ## WL-EXEC-07 - Leo-in-the-loop staging from Telegram - Status: `done_for_guarded_kb_stage_canary` - Result: Live Leo group T3/T4 proved Leo can stage a guarded review proposal in `kb_stage.kb_proposals`, remember the staged proposal, and read back the DB state without mutating canonical `public.*` tables. @@ -91,10 +100,10 @@ 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/fable-working-leo-convergence-20260709/live-proof-supersession-20260709.md` ## WL-EXEC-08 - Clone/staging before rich production apply -- Status: `done_for_mapped_supported_subset` -- Result: Disposable staging DB commit proof and production-packet clone commit/delete-rollback proof completed and cleaned up for the mapped supported subset; production remained zero. -- Next action: Resolve remaining non-claim target decisions, then run a new clone proof for the fully reviewed production plan before any production commit. -- Not done condition: Do not treat mapped supported-subset clone proof as full production apply readiness until remaining non-claim targets are resolved or explicitly deferred. +- Status: `done_for_full_prepared_packet_set` +- Result: Disposable staging DB commit proof, individual packet clone proofs, and full integrated clone commit/delete-rollback proof completed and cleaned up; production remained zero. +- Next action: Production apply requires explicit authorization and should use the integrated packet order plus immediate postflight and live Telegram regression canary. +- Not done condition: Do not claim production canonical rows/schema are live until the production packet set is explicitly applied and postflight confirms it. - 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/staging-db-mapped-commit-rehearsal-current.log` diff --git a/docs/reports/leo-working-state-20260709/working-leo-integrated-clone-rehearsal-current.log b/docs/reports/leo-working-state-20260709/working-leo-integrated-clone-rehearsal-current.log new file mode 100644 index 0000000..557b2a5 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/working-leo-integrated-clone-rehearsal-current.log @@ -0,0 +1,656 @@ +=== integrated rehearsal manifest === +apply_order=mapped-rich-base,cross-surface-anchor,rio-strategy-context,governance-concept-schema,helmer-7powers +rollback_order=helmer-7powers,governance-concept-schema,rio-strategy-context,cross-surface-anchor,mapped-rich-base +=== service before === +MainPID=3252143 +NRestarts=0 +ActiveState=active +SubState=running +=== production read-only base postflight before === + generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +----------------------+-----------------------+---------------------+------------------------- + 0 | 0 | 0 | 0 +(1 row) + + id | type | confidence | text +----+------+------------+------ +(0 rows) + + id | source_type | excerpt +----+-------------+--------- +(0 rows) + + from_claim | to_claim | edge_type +------------+----------+----------- +(0 rows) + + claim_id | source_id | role +----------+-----------+------ +(0 rows) + + id | superseded_by +----+--------------- +(0 rows) + +=== production read-only helmer postflight before === + generated_reasoning_tool_rows | generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +-------------------------------+----------------------+-----------------------+---------------------+------------------------- + 0 | 0 | 0 | 0 | 0 +(1 row) + + id | agent_id | name | category | description +----+----------+------+----------+------------- +(0 rows) + + id | type | confidence | text +----+------+------------+------ +(0 rows) + + id | source_type | excerpt +----+-------------+--------- +(0 rows) + + from_claim | to_claim | edge_type +------------+----------+----------- +(0 rows) + + claim_id | source_id | role +----------+-----------+------ +(0 rows) + + id | superseded_by +----+--------------- +(0 rows) + + id | status | applied_by_handle | applied_at +--------------------------------------+----------+-------------------+------------ + a64df080-8502-42e2-98f4-9bbdecb8da73 | approved | | +(1 row) + +=== production read-only generated schema before === + prod_concept_maps | prod_claim_concept_map_links | prod_claim_governance_gate_links +-------------------+------------------------------+---------------------------------- + | | +(1 row) + +=== create disposable clone === +=== clone apply 1 mapped-rich-base === +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 postflight 1 mapped-rich-base === + 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 | Hayek’s 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 Teleo’s 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 that’s 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": "Teleo’s 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 let’s 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 apply 2 cross-surface-anchor === +BEGIN +DO +COMMIT +=== clone postflight 2 cross-surface-anchor === + 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 Teleo’s 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 apply 3 rio-strategy-context === +BEGIN +DO +COMMIT +=== clone postflight 3 rio-strategy-context === + generated_strategy_node_rows | generated_strategy_anchor_rows +------------------------------+-------------------------------- + 2 | 5 +(1 row) + + id | agent_id | node_type | title | rank | status | source_ref | metadata +--------------------------------------+--------------------------------------+-----------+--------------------------------------+------+--------+---------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 4f3e3d77-50fa-520a-8c8b-5a4269d94a9b | 22222222-2222-2222-2222-222222222222 | policy | Rio capital deployment layer | 1 | active | mapped-rich-proposal-14fa5ecc:rio-capital-deployment-layer | {"proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "source_fragments": ["capital_allocation_is_civilizational_steering supports rio:capital-deployment-layer", "capital_allocation_is_civilizational_steering relates teleo telos / fund-build paths toward better attractors"], "base_packet_required_first": "production-apply-packet-mapped-20260709"} + 063528a6-a07c-5c14-abdf-dc12a0b10fcf | 22222222-2222-2222-2222-222222222222 | objective | Rio internet-finance capital product | 2 | active | mapped-rich-proposal-14fa5ecc:rio-active-strategy-v1-internet-finance-capital-product | {"proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "source_fragments": ["internet_finance_structural_advantages_capital_allocation relates rio:active strategy v1 / internet-finance capital product", "internet_finance_is_mechanism_not_telos constrains rio:active strategy v1 / internet-finance capital product"], "base_packet_required_first": "production-apply-packet-mapped-20260709"} +(2 rows) + + id | from_node_id | anchor_role | to_node_id | to_shared_root_id | claim_id | weight | note +--------------------------------------+--------------------------------------+--------------+--------------------------------------+--------------------------------------+--------------------------------------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------- + 33d9eb08-c9c2-5e2d-a9a7-3d7f1b5f0f0c | 063528a6-a07c-5c14-abdf-dc12a0b10fcf | justified_by | | | e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | 0.85 | Represents the proposal's constrains fragment within the current anchor-role enum: internet finance is a candidate mechanism, not Teleo's telos. + d18eaa71-d458-53cc-baac-e5306a1779e2 | 063528a6-a07c-5c14-abdf-dc12a0b10fcf | justified_by | | | 67003e10-e1ee-5905-8b51-1b0cb263ec11 | 0.7 | Mapped proposal 14fa5ecc: the internet-finance capital product is justified by the structural-advantages claim, not by the old compressed claim. + 3b2a8908-120d-59a5-bbd5-d2711a123aa3 | 063528a6-a07c-5c14-abdf-dc12a0b10fcf | serves | 4f3e3d77-50fa-520a-8c8b-5a4269d94a9b | | | 0.75 | The internet-finance product objective serves Rio's capital deployment layer rather than standing as a standalone telos. + 3a0e2228-a74f-5971-b467-fb527ccdfb37 | 4f3e3d77-50fa-520a-8c8b-5a4269d94a9b | justified_by | | | 004195cc-ab62-526c-90fb-51cb0f826ec0 | 0.85 | Mapped proposal 14fa5ecc: Claim A justifies the Rio capital deployment layer because capital allocation steers which futures receive resources. + 3f7a9f84-eb2e-5d94-9ca4-afc3bad47f96 | 4f3e3d77-50fa-520a-8c8b-5a4269d94a9b | serves | | 6248818e-fe16-4d3b-8008-ef9752b80632 | | 0.8 | Maps the fund-build / better-attractors fragment to the existing Back shared root instead of forcing it into public.claim_edges. +(5 rows) + + id | status | text +--------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------- + 004195cc-ab62-526c-90fb-51cb0f826ec0 | open | Capital allocation is a form of civilizational steering because it determines which futures receive resources. + 67003e10-e1ee-5905-8b51-1b0cb263ec11 | open | Internet finance has structural advantages over traditional finance and is likely to become an increasingly important capital-allocation mechanism. + e6ce4e36-15d2-53bc-8b74-dda0efc095c1 | open | Internet finance is not Teleo’s telos; it is a candidate mechanism for pursuing the telos. +(3 rows) + + id | title | body +--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 6248818e-fe16-4d3b-8008-ef9752b80632 | Back | Back — resource the builders: advise, co-build, and at the deepest rung invest through [[agentic capital]] gated by [[decision markets]] so no individual controls the call. The collective is a credible public intelligenc +(1 row) + +=== clone apply 4 governance-concept-schema === +BEGIN +CREATE TABLE +CREATE TABLE +CREATE TABLE +CREATE INDEX +CREATE INDEX +CREATE INDEX +CREATE INDEX +DO +COMMIT +=== clone postflight 4 governance-concept-schema === + generated_concept_map_rows | generated_concept_link_rows | generated_governance_link_rows +----------------------------+-----------------------------+-------------------------------- + 1 | 1 | 2 +(1 row) + + id | key | title | status | source_ref | metadata +--------------------------------------+---------------------------------+---------------------------------+--------+---------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + f013126c-0937-5bc8-b021-9697e59057d0 | distributed_market_intelligence | Distributed market intelligence | active | mapped-rich-proposal-14fa5ecc:concept_map:distributed_market_intelligence | {"proposal_id": "14fa5ecc-ac7a-41c1-807d-a2e85b936617", "source_fragment": "capital_allocation_depends_on_distributed_market_intelligence draws_from concept_map:distributed_market_intelligence", "base_packet_required_first": "production-apply-packet-mapped-20260709"} +(1 row) + + id | claim_id | concept_map_id | relation | weight | rationale | source_ref +--------------------------------------+--------------------------------------+--------------------------------------+--------------+--------+------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------- + af4ce1b9-db03-5bde-a21b-0e16ca0f48b8 | d009dfc4-9755-58a7-affb-80e3e842a775 | f013126c-0937-5bc8-b021-9697e59057d0 | derives_from | 0.75 | Mapped proposal 14fa5ecc: the capital-allocation distributed-knowledge claim draws from the distributed market intelligence concept map. | mapped-rich-proposal-14fa5ecc:concept_map:distributed_market_intelligence +(1 row) + + id | claim_id | governance_gate_id | relation | weight | rationale | source_ref +--------------------------------------+--------------------------------------+--------------------------------------+----------+--------+-------------------------------------------------------------------------------------------------+------------------------------------------------------------ + af04a87e-c1da-57e9-b11c-60d79daa5648 | 9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | 45695897-2a9c-4279-ac25-e59f166dec6a | supports | 0.85 | Bodies can state the true evidence tier and scope limits. | mapped-rich-proposal-ac036c9d:governance_gate:evidence-bar + 1f81e105-af5e-5db8-a7be-08cc6cc4e13a | 9bcf7e6b-4e98-52b1-91ef-96cfc15e3df0 | fa88e31b-6fca-4801-bf72-f5db81950a11 | supports | 0.85 | Specific enough to disagree with requires more than a compressed headline for ambiguous claims. | mapped-rich-proposal-ac036c9d:governance_gate:quality-gate +(2 rows) + +=== clone apply 5 helmer-7powers === +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 +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 +DO +COMMIT +=== clone postflight 5 helmer-7powers === + generated_reasoning_tool_rows | generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +-------------------------------+----------------------+-----------------------+---------------------+------------------------- + 1 | 5 | 13 | 7 | 17 +(1 row) + + id | agent_id | name | category | description +--------------------------------------+--------------------------------------+-----------------+--------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 473ba7b0-ce44-5e77-bc46-ef82a49b6a3e | 11111111-1111-1111-1111-111111111111 | Helmer 7 Powers | strategy_framework | {"approval_change_log": [{"change": "Removed proposed claim #6 / teleo_power_candidate_is_credibility_and_process_not_control from this framework proposal.", "rationale": "It applies 7 Powers downstream to Teleo self-positioning; approving the framework should not accidentally approve Teleo-as-network-economies / Teleo-as-process-power claims."}, {"change": "Added competitive advantage / moats conceptual-neighborhood links for resolution.", "rationale": "7 Powers should sit in the competitive ad +(1 row) + + id | type | confidence | text +--------------------------------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 12d2c4aa-1c23-5173-b666-dea903dd7432 | normative | 0.65 | Leo should use 7 Powers after inflection mapping and attractor-state analysis to distinguish builders who merely benefit from a wave from builders who can durably capture and compound value from that wave. + 23927224-0d72-5b37-a600-33c63277f6a9 | structural | 0.8 | Helmer's 7 Powers framework diagnoses durable value capture only when a company has both a material benefit and a barrier that prevents motivated capable competitors from arbitraging that benefit away. + 4701f303-ca9c-5da1-aa48-8cf28189c23c | structural | 0.7 | Power must be analyzed by lifecycle stage because different powers become available in Origination, Take-Off, and Stability, and the window to establish a power can close as market flux resolves. + 6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3 | structural | 0.7 | Network effects create product value but do not become network economies power unless they also prevent competitors from reaching equivalence and let the focal actor capture surplus. + d2b2142b-c2d8-5e33-9a38-14598d94d715 | structural | 0.75 | Counter-positioning is most useful near inflection points because entrants can adopt a superior model while incumbents rationally delay imitation to avoid damaging their existing economics, channels, or identity. +(5 rows) + + id | source_type | excerpt +--------------------------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 02b8c5ff-04fb-54e7-b132-e731086f1436 | other | {"excerpt": "Canonical source for the seven powers framework; source of definitions, benefit/barrier logic, Power Progression, and company examples. Full text not ingested in this run; use book/page references if availab + 0c87a244-afa2-5d08-8e79-9cb792aff553 | other | {"body": null, "candidate_review_note": null, "claim_key": "agentic_capital_needs_power_analysis", "edges": [{"edge_type": "supports", "rationale": "7 Powers operationalizes scarcity/value-capture analysis for builder ev + 11fa942d-e81a-5142-965d-3c60714a7dca | other | {"body": null, "candidate_review_note": null, "claim_key": "counter_positioning_is_early_inflection_power", "edges": [{"edge_type": "relates", "rationale": "Counter-positioning exploits path dependence and incumbent comm + 263f423e-c16f-544c-ae5f-3e370e736e12 | other | {"body": null, "candidate_review_note": null, "claim_key": "network_effects_do_not_equal_network_power", "edges": [{"edge_type": "relates", "rationale": "Commercial network effects can be self-enforcing only when they al + 2df4bb44-4853-5455-8049-6dbb8685523b | transcript | {"excerpt": "Chenyi Shi frames platform power through three questions: how economic value is created, how each customer group perceives value as the platform scales, and how competitors are prevented from reaching equiva + 4bd41552-8017-551a-84b5-19b0107c20b5 | article | {"excerpt": "Helmer develops from first principles a practical theory of Strategy rooted in the notion of Power, those conditions which create the potential for persistent differential returns. The synopsis says inventio + 50e0d1ef-322b-5097-afe6-c9aa5ecea5fc | article | {"excerpt": "Episode summary asks what keeps competition away and states Helmer's framework reveals conditions for persistent and durable differential returns.", "metadata": {"source_key": "nfx_podcast_summary", "title": + 5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc | other | {"body": null, "candidate_review_note": null, "claim_key": "seven_powers_requires_benefit_and_barrier", "edges": [{"edge_type": "supports", "rationale": "Benefit/barrier is a precise isolating-mechanism test.", "to_exist + 621bb834-6366-5940-b6c3-c5f82ba35d48 | article | {"excerpt": "Show notes emphasize 'all strategy begins with invention,' transition from startup to pricer with scale economies, competition, brand definition, and sustainable leverage/power.", "metadata": {"source_key": + 6fe15936-d5b9-514e-802f-32a2a06f4a23 | article | {"excerpt": "NFX/Helmer provides concise definitions and examples for the powers: cornered resource (Pixar), scale economies (Netflix), switching costs (SAP), counter-positioning (Twilio/Tesla/Netflix), brand (Apple/Herm + 97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11 | other | {"body": null, "candidate_review_note": null, "claim_key": "power_progression_stage_gates_strategy", "edges": [{"edge_type": "relates", "rationale": "Stage-specific power creation supports strategy-as-design rather than + bc081b04-709f-565a-af0b-95d4ca0589fa | article | {"excerpt": "Hastings describes Helmer's Power Dynamics assessment of Netflix, identifies Counter-Positioning and Power Progression as novel conceptual advances, and says Counter-Positioning explained why incumbents rati + dc1c238c-f835-5641-980a-f0fe53f8dfe5 | transcript | {"excerpt": "Helmer states power has two necessary and sufficient conditions: benefit and barrier. Benefit is a materially better business model; barrier prevents motivated and capable competitors from taking it away. He +(13 rows) + + from_claim | to_claim | edge_type +--------------------------------------+--------------------------------------+----------- + 12d2c4aa-1c23-5173-b666-dea903dd7432 | 2ef388ab-4102-4416-a6e1-ae6ba8ee02fa | supports + 12d2c4aa-1c23-5173-b666-dea903dd7432 | 8f3e773e-4255-47a7-ba8f-61c57a43bebe | supports + 23927224-0d72-5b37-a600-33c63277f6a9 | 2ef388ab-4102-4416-a6e1-ae6ba8ee02fa | relates + 23927224-0d72-5b37-a600-33c63277f6a9 | 8f3e773e-4255-47a7-ba8f-61c57a43bebe | supports + 4701f303-ca9c-5da1-aa48-8cf28189c23c | 25a350e0-ebce-4072-8f2a-48427a727553 | relates + 6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3 | 93d583d9-5394-4e6a-97ca-bcd48796d94a | relates + d2b2142b-c2d8-5e33-9a38-14598d94d715 | be59b559-de8b-4dec-a7be-773188c0e632 | relates +(7 rows) + + claim_id | source_id | role +--------------------------------------+--------------------------------------+------------- + 12d2c4aa-1c23-5173-b666-dea903dd7432 | 0c87a244-afa2-5d08-8e79-9cb792aff553 | illustrates + 12d2c4aa-1c23-5173-b666-dea903dd7432 | 4bd41552-8017-551a-84b5-19b0107c20b5 | grounds + 12d2c4aa-1c23-5173-b666-dea903dd7432 | dc1c238c-f835-5641-980a-f0fe53f8dfe5 | grounds + 23927224-0d72-5b37-a600-33c63277f6a9 | 5f9dd7ca-83f8-5ea6-8e00-d9d13003f8fc | illustrates + 23927224-0d72-5b37-a600-33c63277f6a9 | 6fe15936-d5b9-514e-802f-32a2a06f4a23 | grounds + 23927224-0d72-5b37-a600-33c63277f6a9 | dc1c238c-f835-5641-980a-f0fe53f8dfe5 | grounds + 4701f303-ca9c-5da1-aa48-8cf28189c23c | 4bd41552-8017-551a-84b5-19b0107c20b5 | grounds + 4701f303-ca9c-5da1-aa48-8cf28189c23c | 97c3fc2f-16ae-5507-ad51-b1f4a1bcfb11 | illustrates + 4701f303-ca9c-5da1-aa48-8cf28189c23c | bc081b04-709f-565a-af0b-95d4ca0589fa | grounds + 4701f303-ca9c-5da1-aa48-8cf28189c23c | dc1c238c-f835-5641-980a-f0fe53f8dfe5 | grounds + 6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3 | 263f423e-c16f-544c-ae5f-3e370e736e12 | illustrates + 6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3 | 2df4bb44-4853-5455-8049-6dbb8685523b | grounds + 6014c3ea-3ba5-5ed1-bf15-31f6938e3fc3 | 6fe15936-d5b9-514e-802f-32a2a06f4a23 | grounds + d2b2142b-c2d8-5e33-9a38-14598d94d715 | 11fa942d-e81a-5142-965d-3c60714a7dca | illustrates + d2b2142b-c2d8-5e33-9a38-14598d94d715 | 6fe15936-d5b9-514e-802f-32a2a06f4a23 | grounds + d2b2142b-c2d8-5e33-9a38-14598d94d715 | bc081b04-709f-565a-af0b-95d4ca0589fa | grounds + d2b2142b-c2d8-5e33-9a38-14598d94d715 | dc1c238c-f835-5641-980a-f0fe53f8dfe5 | grounds +(17 rows) + + id | superseded_by +----+--------------- +(0 rows) + + id | status | applied_by_handle | applied_at +--------------------------------------+---------+-----------------------+------------------------------- + a64df080-8502-42e2-98f4-9bbdecb8da73 | applied | codex-packet-20260709 | 2026-07-09 22:22:58.803397+00 +(1 row) + +=== clone integrated summary after all applies === + expected_claims | expected_sources | expected_claim_edges | expected_claim_evidence | expected_reasoning_tools | expected_rio_nodes | expected_rio_anchors | expected_concept_maps | expected_claim_concept_links | expected_claim_governance_links +-----------------+------------------+----------------------+-------------------------+--------------------------+--------------------+----------------------+-----------------------+------------------------------+--------------------------------- + 12 | 28 | 18 | 34 | 1 | 2 | 5 | 1 | 1 | 2 +(1 row) + +=== clone rollback 1 helmer-7powers === +BEGIN +DELETE 17 +DELETE 7 +UPDATE 0 +DELETE 13 +DELETE 5 +DELETE 1 +DO +COMMIT +=== clone rollback 2 governance-concept-schema === +BEGIN +DELETE 2 +DELETE 1 +DELETE 1 +DO +COMMIT +=== clone rollback 3 rio-strategy-context === +BEGIN +DO +COMMIT +=== clone rollback 4 cross-surface-anchor === +BEGIN +DO +COMMIT +=== clone rollback 5 mapped-rich-base === +BEGIN +DELETE 17 +DELETE 11 +UPDATE 2 +DELETE 15 +DELETE 7 +COMMIT +=== clone readback after all rollbacks: base === + generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +----------------------+-----------------------+---------------------+------------------------- + 0 | 0 | 0 | 0 +(1 row) + + id | type | confidence | text +----+------+------------+------ +(0 rows) + + id | source_type | excerpt +----+-------------+--------- +(0 rows) + + from_claim | to_claim | edge_type +------------+----------+----------- +(0 rows) + + claim_id | source_id | role +----------+-----------+------ +(0 rows) + + id | superseded_by +----+--------------- +(0 rows) + +=== clone readback after all rollbacks: helmer === + generated_reasoning_tool_rows | generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +-------------------------------+----------------------+-----------------------+---------------------+------------------------- + 0 | 0 | 0 | 0 | 0 +(1 row) + + id | agent_id | name | category | description +----+----------+------+----------+------------- +(0 rows) + + id | type | confidence | text +----+------+------------+------ +(0 rows) + + id | source_type | excerpt +----+-------------+--------- +(0 rows) + + from_claim | to_claim | edge_type +------------+----------+----------- +(0 rows) + + claim_id | source_id | role +----------+-----------+------ +(0 rows) + + id | superseded_by +----+--------------- +(0 rows) + + id | status | applied_by_handle | applied_at +--------------------------------------+----------+-------------------+------------ + a64df080-8502-42e2-98f4-9bbdecb8da73 | approved | | +(1 row) + +=== clone readback after all rollbacks: cross-surface anchor restored === + id | from_node_id | anchor_role | claim_id | source_id | weight | note +--------------------------------------+--------------------------------------+--------------+--------------------------------------+-----------+--------+---------------------------------------------------------------------------------------------------------------------------------------- + 47f128a0-36c5-4b60-97d4-48c32fa48bc7 | 52bc4264-330e-489d-920c-a493fd2d985a | justified_by | 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) + + id | status | superseded_by | text +--------------------------------------+--------+---------------+--------------------------------------------------------------------------------------------------------------------- + d0000000-0000-0000-0000-000000000005 | open | | Internet finance is the coordination mechanism for capital allocation — capital allocation is expressed priorities. +(1 row) + + 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 readback after all rollbacks: rio rows === + generated_strategy_node_rows | generated_strategy_anchor_rows +------------------------------+-------------------------------- + 0 | 0 +(1 row) + + id | agent_id | node_type | title | rank | status | source_ref | metadata +----+----------+-----------+-------+------+--------+------------+---------- +(0 rows) + + id | from_node_id | anchor_role | to_node_id | to_shared_root_id | claim_id | weight | note +----+--------------+-------------+------------+-------------------+----------+--------+------ +(0 rows) + + id | status | text +----+--------+------ +(0 rows) + + id | title | body +--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 6248818e-fe16-4d3b-8008-ef9752b80632 | Back | Back — resource the builders: advise, co-build, and at the deepest rung invest through [[agentic capital]] gated by [[decision markets]] so no individual controls the call. The collective is a credible public intelligenc +(1 row) + +=== clone readback after all rollbacks: governance schema absent === + clone_concept_maps | clone_claim_concept_map_links | clone_claim_governance_gate_links +--------------------+-------------------------------+----------------------------------- + | | +(1 row) + +=== production read-only base postflight after clone proof === + generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +----------------------+-----------------------+---------------------+------------------------- + 0 | 0 | 0 | 0 +(1 row) + + id | type | confidence | text +----+------+------------+------ +(0 rows) + + id | source_type | excerpt +----+-------------+--------- +(0 rows) + + from_claim | to_claim | edge_type +------------+----------+----------- +(0 rows) + + claim_id | source_id | role +----------+-----------+------ +(0 rows) + + id | superseded_by +----+--------------- +(0 rows) + +=== production read-only helmer postflight after clone proof === + generated_reasoning_tool_rows | generated_claim_rows | generated_source_rows | generated_edge_rows | generated_evidence_rows +-------------------------------+----------------------+-----------------------+---------------------+------------------------- + 0 | 0 | 0 | 0 | 0 +(1 row) + + id | agent_id | name | category | description +----+----------+------+----------+------------- +(0 rows) + + id | type | confidence | text +----+------+------------+------ +(0 rows) + + id | source_type | excerpt +----+-------------+--------- +(0 rows) + + from_claim | to_claim | edge_type +------------+----------+----------- +(0 rows) + + claim_id | source_id | role +----------+-----------+------ +(0 rows) + + id | superseded_by +----+--------------- +(0 rows) + + id | status | applied_by_handle | applied_at +--------------------------------------+----------+-------------------+------------ + a64df080-8502-42e2-98f4-9bbdecb8da73 | approved | | +(1 row) + +=== production read-only generated schema after clone proof === + prod_concept_maps | prod_claim_concept_map_links | prod_claim_governance_gate_links +-------------------+------------------------------+---------------------------------- + | | +(1 row) + +=== cleanup disposable clone and temp files === +=== cleanup readback === + disposable_db_exists +---------------------- + 0 +(1 row) + +host_tmp_removed=yes +container_tmp_removed=yes +=== service after === +MainPID=3252143 +NRestarts=0 +ActiveState=active +SubState=running diff --git a/docs/reports/leo-working-state-20260709/working-leo-integrated-packet-current.md b/docs/reports/leo-working-state-20260709/working-leo-integrated-packet-current.md new file mode 100644 index 0000000..723f073 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/working-leo-integrated-packet-current.md @@ -0,0 +1,79 @@ +# Working Leo Integrated Packet Rehearsal - 2026-07-10 + +Generated UTC: `2026-07-10` + +## Verdict + +Integrated production-order clone rehearsal passed. Production was not modified. + +This rehearsal composes every currently prepared Working Leo DB packet in dependency order, then rolls the whole stack back in reverse order: + +1. `mapped-rich-base` +2. `cross-surface-anchor` +3. `rio-strategy-context` +4. `governance-concept-schema` +5. `helmer-7powers` + +Rollback order: + +1. `helmer-7powers` +2. `governance-concept-schema` +3. `rio-strategy-context` +4. `cross-surface-anchor` +5. `mapped-rich-base` + +## Clone Proof + +Disposable database: `teleo_integrated_rehearsal_20260710` + +After all five apply packets ran in the clone, the expected integrated generated footprint was: + +- `12` claims +- `28` sources +- `18` claim edges +- `34` claim evidence rows +- `1` reasoning tool +- `2` Rio strategy nodes +- `5` Rio strategy anchors +- `1` concept map +- `1` claim-concept-map link +- `2` claim-governance-gate links +- `1` Helmer proposal ledger row marked `applied` +- `1` cross-surface strategy anchor update + +After all rollback packets ran in reverse order: + +- mapped base generated rows returned to `0/0/0/0` +- Helmer generated rows returned to `0/0/0/0/0` +- Helmer proposal ledger returned to `approved` +- cross-surface anchor `47f128a0-36c5-4b60-97d4-48c32fa48bc7` returned to old claim `d0000000-0000-0000-0000-000000000005` with weight `0.7` +- Rio generated nodes/anchors returned to `0/0` +- generated governance/concept schema tables were absent again + +Production readback after the clone proof: + +- mapped base generated rows remained `0/0/0/0` +- Helmer generated rows remained `0/0/0/0/0` +- Helmer proposal ledger remained `approved` +- generated governance/concept tables were absent +- no production apply SQL was executed + +Cleanup readback: + +- `disposable_db_exists`: `0` +- host tmp removed: yes +- container tmp removed: yes +- `leoclean-gateway.service`: `active` +- `MainPID`: `3252143` +- `NRestarts`: `0` + +## Evidence + +- Integrated manifest JSON: `docs/reports/leo-working-state-20260709/working-leo-integrated-packet.json` +- Integrated manifest summary: `docs/reports/leo-working-state-20260709/working-leo-integrated-packet.md` +- Integrated clone proof log: `docs/reports/leo-working-state-20260709/working-leo-integrated-clone-rehearsal-current.log` +- State image: `docs/reports/leo-working-state-20260709/leo-db-state-25-integrated-apply-rehearsal.svg` + +## Claim Ceiling + +This proves the prepared packet set composes in one disposable clone and can be rolled back cleanly in reverse dependency order. It does not prove production has been updated. Production apply still requires explicit authorization, and the live Telegram canary should be rerun after any production apply. diff --git a/docs/reports/leo-working-state-20260709/working-leo-integrated-packet.json b/docs/reports/leo-working-state-20260709/working-leo-integrated-packet.json new file mode 100644 index 0000000..e67879e --- /dev/null +++ b/docs/reports/leo-working-state-20260709/working-leo-integrated-packet.json @@ -0,0 +1,82 @@ +{ + "apply_order": [ + "mapped-rich-base", + "cross-surface-anchor", + "rio-strategy-context", + "governance-concept-schema", + "helmer-7powers" + ], + "dependency_notes": [ + "mapped-rich-base must precede cross-surface-anchor, rio-strategy-context, and governance-concept-schema.", + "cross-surface-anchor must roll back before mapped-rich-base so Claim D still exists while the anchor is restored.", + "rio-strategy-context and governance-concept-schema must roll back before mapped-rich-base because their rows reference mapped base claims.", + "helmer-7powers is independent but included in the integrated rehearsal because it is an approved full-coverage KB packet." + ], + "expected_after_apply_counts": { + "claim_concept_map_links": 1, + "claim_edges": 18, + "claim_evidence": 34, + "claim_governance_gate_links": 2, + "claims": 12, + "concept_maps": 1, + "cross_surface_anchor_updates": 1, + "helmer_ledger_rows_marked_applied": 1, + "reasoning_tools": 1, + "rio_strategy_anchors": 5, + "rio_strategy_nodes": 2, + "sources": 28 + }, + "manifest_version": 1, + "not_done_conditions": [ + "Production canonical rows/schema remain unapplied until explicit production apply authorization.", + "GCP parity remains unproven until account auth allows read-only GCP service/DB readback.", + "Live Telegram canaries remain regression proof for current VPS behavior and should be rerun after any production apply." + ], + "packets": [ + { + "apply_sql": "production-apply-authorized-commit.sql", + "id": "mapped-rich-base", + "packet_json": "production-apply-packet.json", + "reason": "Creates the base claim/source/evidence/claim-edge rows required by cross-surface, Rio, and governance/concept packets.", + "rollback_sql": "production-delete-rollback.sql" + }, + { + "apply_sql": "cross-surface-apply-authorized-commit.sql", + "id": "cross-surface-anchor", + "packet_json": "cross-surface-packet.json", + "reason": "Moves the active Leo policy anchor from the retired compressed internet-finance claim to Claim D.", + "rollback_sql": "cross-surface-delete-rollback.sql" + }, + { + "apply_sql": "rio-strategy-apply-authorized-commit.sql", + "id": "rio-strategy-context", + "packet_json": "rio-strategy-packet.json", + "reason": "Creates Rio strategy nodes and anchors that depend on mapped base claims A/C/D.", + "rollback_sql": "rio-strategy-delete-rollback.sql" + }, + { + "apply_sql": "governance-concept-apply-authorized-commit.sql", + "id": "governance-concept-schema", + "packet_json": "governance-concept-packet.json", + "reason": "Creates minimal concept-map and governance-link schema/rows that depend on mapped base claims.", + "rollback_sql": "governance-concept-delete-rollback.sql" + }, + { + "apply_sql": "helmer-7powers-production-apply-authorized-commit.sql", + "id": "helmer-7powers", + "packet_json": "helmer-7powers-production-apply-packet.json", + "reason": "Applies the independent full-coverage Helmer 7 Powers proposal and ledger flip.", + "rollback_sql": "helmer-7powers-production-delete-rollback.sql" + } + ], + "production_apply_status": "not_executed", + "purpose": "Integrated production-order rehearsal manifest for Working Leo DB packets.", + "report_dir": "docs/reports/leo-working-state-20260709", + "rollback_order": [ + "helmer-7powers", + "governance-concept-schema", + "rio-strategy-context", + "cross-surface-anchor", + "mapped-rich-base" + ] +} diff --git a/docs/reports/leo-working-state-20260709/working-leo-integrated-packet.md b/docs/reports/leo-working-state-20260709/working-leo-integrated-packet.md new file mode 100644 index 0000000..79f7da6 --- /dev/null +++ b/docs/reports/leo-working-state-20260709/working-leo-integrated-packet.md @@ -0,0 +1,45 @@ +# Working Leo Integrated Packet + +Production apply status: `not_executed`. + +## Apply Order +1. `mapped-rich-base` +2. `cross-surface-anchor` +3. `rio-strategy-context` +4. `governance-concept-schema` +5. `helmer-7powers` + +## Rollback Order +1. `helmer-7powers` +2. `governance-concept-schema` +3. `rio-strategy-context` +4. `cross-surface-anchor` +5. `mapped-rich-base` + +## Expected Counts After Apply + +- `claim_concept_map_links`: `1` +- `claim_edges`: `18` +- `claim_evidence`: `34` +- `claim_governance_gate_links`: `2` +- `claims`: `12` +- `concept_maps`: `1` +- `cross_surface_anchor_updates`: `1` +- `helmer_ledger_rows_marked_applied`: `1` +- `reasoning_tools`: `1` +- `rio_strategy_anchors`: `5` +- `rio_strategy_nodes`: `2` +- `sources`: `28` + +## Dependency Notes + +- mapped-rich-base must precede cross-surface-anchor, rio-strategy-context, and governance-concept-schema. +- cross-surface-anchor must roll back before mapped-rich-base so Claim D still exists while the anchor is restored. +- rio-strategy-context and governance-concept-schema must roll back before mapped-rich-base because their rows reference mapped base claims. +- helmer-7powers is independent but included in the integrated rehearsal because it is an approved full-coverage KB packet. + +## Not Done + +- Production canonical rows/schema remain unapplied until explicit production apply authorization. +- GCP parity remains unproven until account auth allows read-only GCP service/DB readback. +- Live Telegram canaries remain regression proof for current VPS behavior and should be rerun after any production apply. diff --git a/scripts/working_leo_integrated_packet.py b/scripts/working_leo_integrated_packet.py new file mode 100644 index 0000000..af67d58 --- /dev/null +++ b/scripts/working_leo_integrated_packet.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +"""Build the integrated Working Leo DB packet manifest. + +This manifest composes the individually clone-proven packets into the only safe +dependency order for a full disposable-clone rehearsal. It is still a packet +builder, not an executor. Production apply requires a separate explicit +authorization boundary. +""" + +from __future__ import annotations + +import argparse +import json +from pathlib import Path +from typing import Any + +REPO_REPORT_DIR = Path("docs/reports/leo-working-state-20260709") + +PACKETS = [ + { + "id": "mapped-rich-base", + "apply_sql": "production-apply-authorized-commit.sql", + "rollback_sql": "production-delete-rollback.sql", + "packet_json": "production-apply-packet.json", + "reason": "Creates the base claim/source/evidence/claim-edge rows required by cross-surface, Rio, and governance/concept packets.", + }, + { + "id": "cross-surface-anchor", + "apply_sql": "cross-surface-apply-authorized-commit.sql", + "rollback_sql": "cross-surface-delete-rollback.sql", + "packet_json": "cross-surface-packet.json", + "reason": "Moves the active Leo policy anchor from the retired compressed internet-finance claim to Claim D.", + }, + { + "id": "rio-strategy-context", + "apply_sql": "rio-strategy-apply-authorized-commit.sql", + "rollback_sql": "rio-strategy-delete-rollback.sql", + "packet_json": "rio-strategy-packet.json", + "reason": "Creates Rio strategy nodes and anchors that depend on mapped base claims A/C/D.", + }, + { + "id": "governance-concept-schema", + "apply_sql": "governance-concept-apply-authorized-commit.sql", + "rollback_sql": "governance-concept-delete-rollback.sql", + "packet_json": "governance-concept-packet.json", + "reason": "Creates minimal concept-map and governance-link schema/rows that depend on mapped base claims.", + }, + { + "id": "helmer-7powers", + "apply_sql": "helmer-7powers-production-apply-authorized-commit.sql", + "rollback_sql": "helmer-7powers-production-delete-rollback.sql", + "packet_json": "helmer-7powers-production-apply-packet.json", + "reason": "Applies the independent full-coverage Helmer 7 Powers proposal and ledger flip.", + }, +] + + +def _read_json(report_dir: Path, filename: str) -> dict[str, Any]: + path = report_dir / filename + if not path.exists(): + raise FileNotFoundError(path) + return json.loads(path.read_text(encoding="utf-8")) + + +def _assert_packet_files_exist(report_dir: Path) -> None: + missing: list[str] = [] + for packet in PACKETS: + for key in ("apply_sql", "rollback_sql", "packet_json"): + path = report_dir / packet[key] + if not path.exists(): + missing.append(str(path)) + if missing: + raise FileNotFoundError("missing integrated packet files: " + ", ".join(missing)) + + +def build_manifest(report_dir: Path = REPO_REPORT_DIR) -> dict[str, Any]: + _assert_packet_files_exist(report_dir) + base = _read_json(report_dir, "production-apply-packet.json") + helmer = _read_json(report_dir, "helmer-7powers-production-apply-packet.json") + rio = _read_json(report_dir, "rio-strategy-packet.json") + governance = _read_json(report_dir, "governance-concept-packet.json") + cross_surface = _read_json(report_dir, "cross-surface-packet.json") + + base_counts = base["row_counts"] + helmer_counts = helmer["row_counts"] + return { + "manifest_version": 1, + "purpose": "Integrated production-order rehearsal manifest for Working Leo DB packets.", + "production_apply_status": "not_executed", + "report_dir": str(report_dir), + "apply_order": [packet["id"] for packet in PACKETS], + "rollback_order": [packet["id"] for packet in reversed(PACKETS)], + "packets": PACKETS, + "expected_after_apply_counts": { + "claims": base_counts.get("claims", 0) + helmer_counts.get("claims", 0), + "sources": base_counts.get("sources", 0) + helmer_counts.get("sources", 0), + "claim_edges": base_counts.get("claim_edges", 0) + helmer_counts.get("claim_edges", 0), + "claim_evidence": base_counts.get("claim_evidence", 0) + helmer_counts.get("claim_evidence", 0), + "reasoning_tools": helmer_counts.get("reasoning_tools", 0), + "cross_surface_anchor_updates": len(cross_surface.get("safe_writes", [])), + "rio_strategy_nodes": rio["generated_counts"]["strategy_nodes"], + "rio_strategy_anchors": rio["generated_counts"]["strategy_node_anchors"], + "concept_maps": governance["generated_counts"]["concept_maps"], + "claim_concept_map_links": governance["generated_counts"]["claim_concept_map_links"], + "claim_governance_gate_links": governance["generated_counts"]["claim_governance_gate_links"], + "helmer_ledger_rows_marked_applied": len(helmer.get("proposal_ids", [])), + }, + "dependency_notes": [ + "mapped-rich-base must precede cross-surface-anchor, rio-strategy-context, and governance-concept-schema.", + "cross-surface-anchor must roll back before mapped-rich-base so Claim D still exists while the anchor is restored.", + "rio-strategy-context and governance-concept-schema must roll back before mapped-rich-base because their rows reference mapped base claims.", + "helmer-7powers is independent but included in the integrated rehearsal because it is an approved full-coverage KB packet.", + ], + "not_done_conditions": [ + "Production canonical rows/schema remain unapplied until explicit production apply authorization.", + "GCP parity remains unproven until account auth allows read-only GCP service/DB readback.", + "Live Telegram canaries remain regression proof for current VPS behavior and should be rerun after any production apply.", + ], + } + + +def write_manifest_files(manifest: dict[str, Any], output_dir: Path) -> None: + output_dir.mkdir(parents=True, exist_ok=True) + (output_dir / "working-leo-integrated-packet.json").write_text( + json.dumps(manifest, indent=2, sort_keys=True) + "\n", encoding="utf-8" + ) + lines = [ + "# Working Leo Integrated Packet", + "", + "Production apply status: `not_executed`.", + "", + "## Apply Order", + ] + lines.extend(f"{idx}. `{packet_id}`" for idx, packet_id in enumerate(manifest["apply_order"], start=1)) + lines.extend(["", "## Rollback Order"]) + lines.extend(f"{idx}. `{packet_id}`" for idx, packet_id in enumerate(manifest["rollback_order"], start=1)) + lines.extend(["", "## Expected Counts After Apply", ""]) + lines.extend( + f"- `{key}`: `{value}`" for key, value in sorted(manifest["expected_after_apply_counts"].items()) + ) + lines.extend(["", "## Dependency Notes", ""]) + lines.extend(f"- {note}" for note in manifest["dependency_notes"]) + lines.extend(["", "## Not Done", ""]) + lines.extend(f"- {item}" for item in manifest["not_done_conditions"]) + (output_dir / "working-leo-integrated-packet.md").write_text("\n".join(lines) + "\n", encoding="utf-8") + + +def parse_args(argv: list[str] | None = None) -> argparse.Namespace: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--report-dir", type=Path, default=REPO_REPORT_DIR) + parser.add_argument("--output-dir", type=Path) + return parser.parse_args(argv) + + +def main(argv: list[str] | None = None) -> int: + args = parse_args(argv) + manifest = build_manifest(args.report_dir) + if args.output_dir: + write_manifest_files(manifest, args.output_dir) + print(json.dumps(manifest, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/test_working_leo_integrated_packet.py b/tests/test_working_leo_integrated_packet.py new file mode 100644 index 0000000..c205ab8 --- /dev/null +++ b/tests/test_working_leo_integrated_packet.py @@ -0,0 +1,69 @@ +"""Tests for scripts/working_leo_integrated_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 working_leo_integrated_packet as packet # noqa: E402 + + +def test_manifest_apply_and_rollback_order(): + result = packet.build_manifest() + assert result["production_apply_status"] == "not_executed" + assert result["apply_order"] == [ + "mapped-rich-base", + "cross-surface-anchor", + "rio-strategy-context", + "governance-concept-schema", + "helmer-7powers", + ] + assert result["rollback_order"] == [ + "helmer-7powers", + "governance-concept-schema", + "rio-strategy-context", + "cross-surface-anchor", + "mapped-rich-base", + ] + + +def test_manifest_expected_counts_are_composed_from_packets(): + result = packet.build_manifest() + assert result["expected_after_apply_counts"] == { + "claim_concept_map_links": 1, + "claim_edges": 18, + "claim_evidence": 34, + "claim_governance_gate_links": 2, + "claims": 12, + "concept_maps": 1, + "cross_surface_anchor_updates": 1, + "helmer_ledger_rows_marked_applied": 1, + "reasoning_tools": 1, + "rio_strategy_anchors": 5, + "rio_strategy_nodes": 2, + "sources": 28, + } + + +def test_manifest_packet_files_exist_and_are_relative_to_report_dir(): + result = packet.build_manifest() + report_dir = Path(result["report_dir"]) + for item in result["packets"]: + assert (report_dir / item["apply_sql"]).exists() + assert (report_dir / item["rollback_sql"]).exists() + assert (report_dir / item["packet_json"]).exists() + assert not Path(item["apply_sql"]).is_absolute() + + +def test_write_manifest_files(tmp_path: Path): + result = packet.build_manifest() + packet.write_manifest_files(result, tmp_path) + written_json = json.loads((tmp_path / "working-leo-integrated-packet.json").read_text()) + written_md = (tmp_path / "working-leo-integrated-packet.md").read_text() + assert written_json["apply_order"][0] == "mapped-rich-base" + assert "## Apply Order" in written_md + assert "`claims`: `12`" in written_md