Commit graph

351 commits

Author SHA1 Message Date
twentyOne2x
ae00beeb3b Document Working Leo DB identity provenance
Some checks are pending
CI / lint-and-test (push) Waiting to run
- Map VPS Hermes, Forgejo, SOUL rendering, and document-artifact boundaries.

- Expand Cory-style benchmark for identity render, decision matrix, and source refs.

- Retain live-readback diagrams/reports and focused test coverage.

`docs/reports/leo-working-state-20260709/current-truth-index.md`
`docs/reports/leo-working-state-20260709/leo-db-loading-diagram-20260709T214741Z.mmd`
`docs/reports/leo-working-state-20260709/leo-db-loading-diagram-20260709T214741Z.svg`
`docs/reports/leo-working-state-20260709/leo-db-provenance-report-20260709T214741Z.md`
`docs/reports/leo-working-state-20260709/leo-db-state-21-forgejo-load-agent-loop.svg`
`docs/reports/leo-working-state-20260709/leo-db-state-22-identity-render-matrix-artifacts.svg`
`docs/reports/leo-working-state-20260709/vps-hermes-db-mapping-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-open-ended-benchmark-spec.json`
`scripts/working_leo_open_ended_benchmark.py`
`tests/test_working_leo_open_ended_benchmark.py`
2026-07-09 23:59:42 +02:00
twentyOne2x
1826206053 Fix Working Leo skill manifest paths
Some checks are pending
CI / lint-and-test (push) Waiting to run
- Align the skill-pack manifest with the committed .agents/skills layout so worker onboarding points at the real files.

- Preserve the existing skill pack and evidence references without changing runtime behavior or production DB state.

- Verify the Hermes leoclean skill surface test passes after the path correction.

`docs/reports/leo-working-state-20260709/skill-pack-manifest.json`
2026-07-09 23:43:11 +02:00
twentyOne2x
f34feb0ffb Add Working Leo cross-surface KB proof
Some checks are pending
CI / lint-and-test (push) Waiting to run
- Add broad Cory-style outcome scenarios to the open-ended benchmark so regular-use ambiguity is tested, not only exact ID canaries.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

`scripts/kb_cross_surface_resolution_packet.py`

`scripts/working_leo_open_ended_benchmark.py`

`tests/test_kb_cross_surface_resolution_packet.py`

`tests/test_working_leo_open_ended_benchmark.py`
2026-07-09 23:39:51 +02:00
twentyOne2x
d9c794bebc Add Helmer ledger apply rehearsal
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 23:17:28 +02:00
twentyOne2x
9dde83c602 Add open-ended Working Leo canary proof
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 23:09:44 +02:00
twentyOne2x
2759397a12 Retain Helmer 7 Powers packet proof
Some checks are pending
CI / lint-and-test (push) Waiting to run
- Record clone-proven Helmer 7 Powers packet evidence for team handoff.
- Update Working Leo state and execution plan with the current non-production claim ceiling.
- Add live rollback and clone rollback logs so reviewers can inspect the row-level proof.

`docs/reports/leo-working-state-20260709/current-truth-index.md`
`docs/reports/leo-working-state-20260709/helmer-7powers-clone-commit-delete-rollback-current.log`
`docs/reports/leo-working-state-20260709/helmer-7powers-live-preflight-rollback-current.log`
`docs/reports/leo-working-state-20260709/helmer-7powers-production-apply-packet-current.md`
`docs/reports/leo-working-state-20260709/leo-db-state-14-helmer-packet.svg`
`docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md`
2026-07-09 23:01:06 +02:00
twentyOne2x
699a9e7917 Add Working Leo operator skill pack
Some checks are pending
CI / lint-and-test (push) Waiting to run
- Add reusable Teleo/Leo skills for VPS, GCP, Telegram, KB changes, provenance, and handoff onboarding.
- Add guarded KB proposal tooling for approved rich proposals, apply packets, and rollback proof.
- Add Cory-style open-ended benchmark prompts and tests alongside the precise regression canaries.

`.agents/skills/leo-telegram-canary-ops/SKILL.md`
`.agents/skills/teleo-gcp-parity-ops/SKILL.md`
`.agents/skills/teleo-infra-provenance/SKILL.md`
`.agents/skills/teleo-kb-db-change-workflow/SKILL.md`
`.agents/skills/teleo-leo-onboarding/SKILL.md`
`.agents/skills/teleo-proof-handoff/SKILL.md`
`.agents/skills/teleo-vps-runtime-ops/SKILL.md`
`.agents/skills/working-leo-cory-outcomes/SKILL.md`
`docs/reports/leo-working-state-20260709/claim-source-contract-preview-current.md`
`docs/reports/leo-working-state-20260709/cory-expected-working-leo-outcomes-20260709.md`
`docs/reports/leo-working-state-20260709/current-truth-index.md`
`docs/reports/leo-working-state-20260709/fable-leo-teleo-onboarding.md`
`docs/reports/leo-working-state-20260709/gcp-db-parity-current-blocker-20260709.json`
`docs/reports/leo-working-state-20260709/helmer-7powers-creation-plan.json`
`docs/reports/leo-working-state-20260709/kb-apply-canary-execute-current.md`
`docs/reports/leo-working-state-20260709/kb-apply-canary-plan-current.md`
`docs/reports/leo-working-state-20260709/leo-db-state-13-skill-pack.svg`
`docs/reports/leo-working-state-20260709/operator-surface-map.md`
`docs/reports/leo-working-state-20260709/production-apply-packet-current.md`
`docs/reports/leo-working-state-20260709/rich-proposal-creation-plan-mapped-current.md`
`docs/reports/leo-working-state-20260709/skill-pack-manifest.json`
`docs/reports/leo-working-state-20260709/skill-pack-readme.md`
`docs/reports/leo-working-state-20260709/telegram-gateway-handler-canary-current.json`
`docs/reports/leo-working-state-20260709/telegram-gateway-handler-canary-current.md`
`docs/reports/leo-working-state-20260709/telegram-live-canary-current.json`
`docs/reports/leo-working-state-20260709/telegram-live-canary-current.md`
`docs/reports/leo-working-state-20260709/telegram-live-db-write-canary-20260709.json`
`docs/reports/leo-working-state-20260709/telegram-live-db-write-canary-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-current-state-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-definition-20260709.md`
`docs/reports/leo-working-state-20260709/working-leo-execution-plan-current.md`
`docs/reports/leo-working-state-20260709/working-leo-open-ended-benchmark-spec.json`
`scripts/approve_proposal.py`
`scripts/kb_claim_source_contract_preview.py`
`scripts/kb_rich_proposal_apply_packet.py`
`scripts/kb_rich_proposal_creation_plan.py`
`scripts/working_leo_open_ended_benchmark.py`
`tests/test_approve_proposal.py`
`tests/test_kb_claim_source_contract_preview.py`
`tests/test_kb_rich_proposal_apply_packet.py`
`tests/test_kb_rich_proposal_creation_plan.py`
`tests/test_working_leo_open_ended_benchmark.py`
2026-07-09 22:56:48 +02:00
twentyOne2x
2e2dcff4d3
Stage linked KB edge proposals from leoclean (#71)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 09:52:47 +02:00
twentyOne2x
a1814671e1
Point leoclean claim links at Leo host
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 09:41:00 +02:00
twentyOne2x
1e0d747ae4
Add KB proposal apply preview
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 09:11:07 +02:00
twentyOne2x
5e1d7a5b8c
Render KB claim links in leoclean replies (#68)
Some checks are pending
CI / lint-and-test (push) Waiting to run
Render KB claim links in leoclean replies.

Local evidence:
- 13 focused tests passed.
- py_compile passed for Telegram bot, both leoclean KB bridges, and KB claim routes.
- ruff F,E9 passed for touched files.

GitHub checks were queued at merge time, not failing.
2026-07-09 08:58:02 +02:00
twentyOne2x
4a035d8727
Teach leoclean external doctrine framing (#67)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 08:43:01 +02:00
twentyOne2x
93c480ea3c
Add GCP leoclean skill sync helper (#66)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 08:21:02 +02:00
twentyOne2x
3e6ac9b8e0
Merge pull request #65 from living-ip/codex/sync-leoclean-skills-20260709
Some checks are pending
CI / lint-and-test (push) Waiting to run
Sync leoclean skills during deploy
2026-07-09 08:02:51 +02:00
twentyOne2x
a7152b0a67 Sync leoclean skills during deploy 2026-07-09 08:01:43 +02:00
twentyOne2x
59525bf0bc
Merge pull request #64 from living-ip/codex/claim-links-telegram-rendering-20260709
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add canonical KB claim links
2026-07-09 07:57:05 +02:00
twentyOne2x
817d2a4592 Add canonical KB claim links 2026-07-09 07:55:47 +02:00
twentyOne2x
f2a0c0b02f
Merge pull request #63 from living-ip/codex/kb-proposal-normalization-preview-20260709
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add KB proposal normalization preview
2026-07-09 03:03:12 +02:00
twentyOne2x
c34096f605 Add KB proposal normalization preview 2026-07-09 03:01:40 +02:00
twentyOne2x
2bcf01fc8e
Merge pull request #62 from living-ip/codex/fix-kb-proposal-dashboard-runtime-import-20260709
Some checks are pending
CI / lint-and-test (push) Waiting to run
Fix KB proposal dashboard runtime import path
2026-07-09 02:51:39 +02:00
twentyOne2x
dfcc10e304 Fix KB proposal dashboard runtime import path 2026-07-09 02:50:25 +02:00
twentyOne2x
0e812a74d7
Merge pull request #61 from living-ip/codex/kb-proposal-admin-review-page-20260709
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add KB proposal review dashboard
2026-07-09 02:47:36 +02:00
twentyOne2x
5ec375cd6e Add KB proposal review dashboard 2026-07-09 02:46:14 +02:00
twentyOne2x
1703232f24
Add leoclean KB proposal review packets (#60)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 02:24:07 +02:00
twentyOne2x
8e3d1877c6
Source-control leoclean KB bridge (#59)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 01:09:53 +02:00
twentyOne2x
4f00f1335d
Avoid scanning backups during auto deploy chmod (#58)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-09 00:19:49 +02:00
twentyOne2x
b9acc4855c
Make GCP artifact publish idempotent (#57)
Some checks failed
CI / lint-and-test (push) Has been cancelled
2026-07-07 14:40:23 +02:00
twentyOne2x
464d1b3fd9
Add GCP infra execute canary runner (#56)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 14:34:11 +02:00
twentyOne2x
8a935b4625
Add portable restore canary capsule (#55)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 14:22:03 +02:00
twentyOne2x
fc451ec94f
Harden GCP readiness checker commands (#54)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 14:10:50 +02:00
twentyOne2x
50a744656f
Use dedicated GCP readiness service account (#53)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 13:58:37 +02:00
twentyOne2x
dba08ad63f
Add GCP service communication contract (#52)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 13:51:24 +02:00
twentyOne2x
c8bb649f95
Add GCP runtime baseline apply runner
Some checks are pending
CI / lint-and-test (push) Waiting to run
Adds a dry-run-by-default GCP runtime baseline runner, readiness contract coverage, docs, and tests for the resources required by GCP readiness.
2026-07-07 13:38:42 +02:00
twentyOne2x
c9a2573e86
Harden GCP artifact and readiness receipts
Some checks are pending
CI / lint-and-test (push) Waiting to run
Retains immutable Artifact Registry image digests and makes GCP readiness workflows fail after uploading evidence when readiness checks fail.
2026-07-07 13:24:14 +02:00
twentyOne2x
38ca357f81
Add Cloud SQL restore readback verifier (#49)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 13:16:24 +02:00
twentyOne2x
607baefc52
Add idempotent GCP IAM apply runner
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 13:05:08 +02:00
twentyOne2x
8f96b44539
Add GCP IAM split plan
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 12:54:53 +02:00
twentyOne2x
04e586c23e
Retain GCP readiness workflow artifacts
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 12:47:29 +02:00
twentyOne2x
0c9dde3f36
Add GitHub WIF GCP readiness probe (#45)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 12:41:09 +02:00
twentyOne2x
6dd7f9fe8c
Add GCP Cloud SQL restore drill (#44)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 12:34:21 +02:00
twentyOne2x
2b4423e3d1
Add SQLite to Postgres restore canary (#43)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 12:21:54 +02:00
twentyOne2x
ce261a8ee6
Add VPS SQLite KB backup canary (#42)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 12:05:46 +02:00
twentyOne2x
de2bfc150d
Add GCP Cloud SQL standby readiness (#41)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 11:52:08 +02:00
twentyOne2x
d878a61d8d
Check GCP communication posture (#40)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 11:27:03 +02:00
twentyOne2x
d89ee7565a
Add GitHub Artifact Registry publishing (#39)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 11:20:09 +02:00
twentyOne2x
630a1f6ea7
Harden GCP Docker build and infra readiness (#38)
Some checks are pending
CI / lint-and-test (push) Waiting to run
2026-07-07 11:13:41 +02:00
twentyOne2x
d1512d13a5
Merge pull request #37 from living-ip/codex/gcp-staging-container-20260706
Some checks are pending
CI / lint-and-test (push) Waiting to run
Add GCP staging container smoke
2026-07-06 20:38:58 +02:00
twentyOne2x
90f232fb8f Add GCP staging container smoke 2026-07-06 20:35:56 +02:00
Fawaz
4de98b29fd
feat(kb): apply-worker — auto-land approved proposals (stage 2 automation) (#36)
Some checks are pending
CI / lint-and-test (push) Waiting to run
* feat(kb): apply-worker to auto-land approved proposals (stage 2 automation)

Event-driven worker that turns a HUMAN-approved kb_stage proposal into canonical
state, so an approval in Telegram surfaces in Leo's identity without Leo applying
its own work.

- Fires only on status='approved' (never pending_review) -> proposer != applier
  holds; the human approval stays the trigger. No auto-approve anywhere.
- Reuses scripts/apply_proposal.py verbatim as the sole apply path (same txn,
  rowcount=1 guard, FK stamp). Connects as the narrow kb_apply role, never
  superuser, never inside the hermes harness.
- Render hook (--render-cmd / KB_APPLY_RENDER_CMD) is inert until the SOUL
  renderer (PR2) is deployed; applying still works, rendered SOUL just lags.
- Ships INERT: report-only unless --enable / KB_APPLY_WORKER_ENABLED=1. systemd
  oneshot service + 5min timer, both shipped disabled.
- 10 unit tests; candidate query validated read-only vs prod (0 applyable today).

* fix(kb): apply-worker --max-per-tick cap + poison-pill retry ceiling

Fixer draft-exit items:
- --max-per-tick=1 (default): an enabled worker lands applies one-at-a-time
  and observably instead of draining the whole approved queue in one tick.
- --max-attempts=3 ceiling with a persisted failure-count state file: a
  deterministically-failing approved proposal is treated as a poison pill and
  skipped after N consecutive failures, instead of retrying every tick forever.
  State persists on disk because the worker runs oneshot per timer tick.

Both are inert until the worker is enabled; it still ships disabled.
2026-07-05 18:23:56 -04:00
Fawaz
7bb6fc417b
feat(kb): apply_proposal engine (stage 2 of KB apply pipeline) (#35)
Some checks are pending
CI / lint-and-test (push) Waiting to run
* feat(kb): apply_proposal engine to land approved proposals into canonical

Stage 2 of the KB apply pipeline (approve -> APPLY -> render -> surface).
Turns an approved kb_stage.kb_proposals row into canonical public.* rows and
flips the ledger to 'applied' in one verified transaction.

- Connects as the narrow kb_apply role (never superuser): writes only
  strategies, strategy_nodes, claim_evidence, claim_edges + kb_proposals ledger.
  Enforces "agents propose, do not self-apply" at the DB boundary.
- Per-type handlers: revise_strategy (versioned strategy + node replace),
  add_edge, attach_evidence (requires existing source_id; source minting is
  intentionally out of scope for kb_apply's grants).
- Strict apply_payload contract (v1); freeform eval packets are normalized
  upstream, not applied directly.
- --dry-run prints exact SQL; idempotent (refuses non-approved / already-applied);
  transactional with an in-txn DO-block invariant check that rolls back on failure.
- Unit tests cover SQL builders, validation, dispatch, and status guards.

* fix(kb): rowcount=1 apply guard + real applied_by FK stamp

Closes the three draft-exit review items on the apply engine:

- Ledger flip now runs in a DO block asserting exactly one 'approved'
  row moved to 'applied' (GET DIAGNOSTICS row_count). Closes the
  concurrent double-apply race — load_proposal (read) and the flip
  (write) are separate statements, so a row lock cannot span them; only
  one concurrent apply can match status='approved', so rowcount=1 is the
  authoritative guard. A loser RAISEs and the whole txn rolls back.
- applied_by_agent_id is stamped as a real FK resolved from public.agents
  by handle, defaulting to the kb-apply service agent — no more NULL FK,
  no backfill needed.
- scripts/kb_apply_prereqs.sql: one-time superuser bootstrap — inserts the
  kb-apply service-agent row (kb_apply never gets INSERT on agents), grants
  kb_apply SELECT on public.agents, and ensures the one-active-strategy
  unique index (idempotent; already present on prod).

18/18 unit tests pass.

* fix(kb): hard-resolve applied_by handle, RAISE on NULL FK

Resolve applied_by into a variable and assert NOT NULL before the ledger
flip, instead of an inline subselect that silently stamps a NULL
applied_by_agent_id on an unresolved handle. Since the FK is ON DELETE SET
NULL, a bad handle (typo/unseeded agent) was a legal silent NULL -- the
perpetually-NULL FK we eliminated. Unresolved handle now hard-fails ->
rollback. Non-default --applied-by (operator, future drafters) is the path
that goes through the lookup and could strand NULL.
2026-07-04 19:57:49 -04:00