flowchart LR
subgraph repo["Repo / Forgejo / Git workflow"]
A["Forgejo / Git remotes
code + legacy file-KB PR flow"]
B["deploy/auto-deploy.sh
fetch main, syntax-check, rsync runtime dirs"]
C["VPS runtime dirs
/opt/teleo-eval, /home/teleo profile"]
A --> B --> C
end
subgraph pg["Docker Postgres on VPS 77.42.65.182"]
D["teleo-pg container
database teleo"]
E["canonical public.*
claims, sources, claim_evidence, claim_edges
strategies, strategy_nodes, anchors"]
F["staging kb_stage.*
kb_proposals, pending proposals,
staged/import tables"]
D --> E
D --> F
end
subgraph load["KB loading and apply"]
G["Leo / user / operator request"]
H["teleo-kb bridge or proposal generator"]
I["kb_stage.kb_proposals
pending_review"]
J["reviewer/operator approval
approved"]
K["strict apply_payload or reviewed packet"]
L["guarded apply
kb_apply/operator"]
M["ledger stamped applied
canonical readback"]
G --> H --> I --> J --> K --> L --> E --> M
I -. "not canonical yet" .-> F
end
subgraph self["Agent self-update loop"]
N["Leo reads canonical context
Postgres first, not runtime memory"]
O["Leo proposes self/strategy change
revise_strategy"]
P["apply updates strategies/nodes"]
Q["renderer/context refresh
Leo reads new self"]
E --> N --> O --> I
L --> P --> Q --> N
end
C --> H
C --> D
A -. "confirmed code/file workflow provenance
direct live DB bootstrap unknown" .-> D