Skip to content

feat(olympus): add durable non-interrupting Telegram routing - #17

Draft
chadsm-sys wants to merge 28 commits into
mainfrom
codex-mini/M-20260713-olympus-telegram-router
Draft

feat(olympus): add durable non-interrupting Telegram routing#17
chadsm-sys wants to merge 28 commits into
mainfrom
codex-mini/M-20260713-olympus-telegram-router

Conversation

@chadsm-sys

@chadsm-sys chadsm-sys commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Durable non-interrupting Telegram routing on the canonical authority chain

Composes PR #16 exactly and adds durable Telegram intake/subscription/effect handling. Duplicate delivery is idempotent; altered reuse of the same immutable delivery identity is rejected; notifier effects fail closed and preserve cursor/recovery state without external sends in certification.

Exact certification

  • Head: b21c993c06b3cd1956e34b86b8583f3729583018
  • Branch: codex-mini/M-20260713-olympus-telegram-router
  • Contains PR feat(olympus): bind mission authority to Hermes Kanban #16 head: b22d915850534a95b90b6e8771aea1efdc939679
  • Local focused/integration: 596 passed, 0 failed, 1 intentional skip
  • Hosted: 28 passed, 0 failed, 4 conditional skips across 32 checks
  • Full test shards: run 29318373022 passed
  • Docs: run 29318372971 passed
  • Lint/type/supply-chain/history/OSV and lock checks passed at this exact head
  • Gate B non-production demo: PASS; mission M-20260714-gate-b-demo reached COMPLETED; three Hermes tasks reached done
  • Six duplicate Telegram attempts produced one task, one delivery, and one subscription; altered duplicate rejected; selection survived restart; external_send=false
  • Review/release chain: review-release-authority-chain:cc4ed9edeea7276ce0ae295d3a1081034d645faa0f74a0d78f99d707b23b8c14
  • Receipt SHA-256: 3b33dd495b64d0fd5e1b47c1960a9f35264c8112227783f105584bcdf708bd35
  • Release-proof SHA-256: af935cd58d93bcd2f651c33ea0fc5bdeb66f72e16128aba1f79491ac4bd55496

Boundaries

Draft review only. The demonstration used isolated databases, no live Hermes home, no credentials, no gateway, and no external Telegram send. No merge, production deployment, credential change, live migration, gateway restart, or routing activation is authorized.

chadsm-sys and others added 18 commits July 5, 2026 19:16
…ntrol

Seven-document constitution for the Chief of Staff layer:
MISSION, PHILOSOPHY, DECISION_ENGINE, BOTTLENECK_ENGINE,
COMPOUND_ENGINE, EXECUTIVE_COACH, HUMAN_FIRST.

Defines the North Star, Better Chad + Better AI, the Morning Plan /
Evening Report rituals, asset-first and opportunity philosophy,
evidence-first decision making, human judgment boundaries, and the
CONTINUE / PAUSE / NEEDS_CHAD escalation philosophy — aligned with the
interface contracts in chief_of_staff/.

Documentation only. No runtime changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Chad's own words, verbatim, as the paragraph the rest of the
constitution is commentary on.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(Memory Graph v2)

Transforms Hermes memory from searchable notes into a governed knowledge
graph, shipped as a bundled MemoryProvider plugin with zero core changes —
all existing memory behavior (built-in MEMORY.md/USER.md, MemoryManager,
other providers) is preserved; the provider is inert unless
memory.provider: memorygraph is configured.

Implemented (architecture stable):
- Typed entities (person, project, goal, skill, business, organization,
  place, tool, concept) with alias resolution
- Typed, time-aware relationships (valid_from/valid_to windows)
- Claims (entity.attribute = value) with confidence, temporal validity,
  supersession chains, and evidence links (session, built-in memory,
  tool, URL) — plus an append-only governance audit log
- Duplicate detection: re-assertion reinforces instead of duplicating
  (exact-key for exclusive attributes, fuzzy for free-form)
- Contradiction detection: conflicting exclusive values are superseded
  time-aware when clearly newer, otherwise flagged for review with a
  resolve flow
- Confidence tracking: reinforcement/feedback/contradiction deltas,
  clamped [0, 1]
- Knowledge aging: half-life confidence decay since last reinforcement,
  with demotion of decayed tiers
- Knowledge promotion: candidate → established → core gated on
  confidence, evidence count, reinforcements and age
- One graph_memory tool (13 actions), prefetch recall, built-in memory
  write mirroring via on_memory_write, session-end governance sweep

Design only (see plugins/memory/memorygraph/DESIGN.md): semantic
dedupe via optional embedder, automatic turn extraction, cross-provider
federation, promotion into MEMORY.md, multi-hop reasoning.

Local-only: stdlib sqlite3, no network, no credentials; DB is
profile-scoped at $HERMES_HOME/memory_graph.db.

Tests: 78 new tests across store, governance, and provider layers;
existing memory suites pass unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…t for clean ty check

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mps, teardown-safe sweep, valid_from validation

- _coerce_bool for tool args (bool("false") is True — string forms now
  coerce correctly for 'exclusive' and 'helpful')
- clamp half_life_days > 0 and duplicate_similarity to [0, 1] at config
  load (negative half-life would invert the decay curve)
- hold provider lock during session-end sweep so shutdown() cannot close
  the store mid-sweep
- validate caller-supplied valid_from at write boundaries (lexicographic
  ordering relies on the fixed timestamp format); named constant for
  relationship reinforcement delta; sweep complexity notes
- 3 new regression tests (81 total)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ory provider (memorygraph)

Memory Graph v2: governed knowledge graph memory provider (memorygraph)
Local-first plugin for capturing, scoring, deduplicating, and validating
income/business opportunities across their full lifecycle.

- Ingestion: dict / JSON file / inbox directory (offline only, no
  external APIs, no scraping — all evidence is human-entered)
- Duplicate detection: exact title fingerprint + fuzzy
  SequenceMatcher/Jaccard blend (threshold 0.82)
- Scoring: deterministic 0-100 composite from expected ROI (Chad time
  priced at $205/hr), strategic-goal alignment, AI-vs-human leverage,
  confidence, and weekly-capacity fit — full breakdown persisted
- Market validation pipeline: six ordered evidence-based stages
  (problem, demand, willingness-to-pay, competition, regulatory,
  capacity fit) with pass/fail/skip rules
- Confidence tracking: source-type priors, bounded audited updates
  driven by validation outcomes, clamped to [0.02, 0.98]
- Lifecycle: explicit transition map with guards
  (captured→triaged→scored→validating→validated→active→realized,
  plus parked/rejected/expired), every transition logged with a reason
- Persistence: atomic, thread-safe JSON store (teams_pipeline pattern)
- CLI: add / inbox / list / show / score / validate / advance / report
- Architecture doc: docs/design/opportunity-scout-engine.md
- 83 tests, all passing; ruff clean

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
docs(chief-of-staff): foundational philosophy for Hermes + Mission Control
…ted head 20f5410)

feat(opportunity-scout): long-term Opportunity Scout engine
…racts

Counterpart to mission-control-v0 PR #20 (m21-executive-operating-loop).
Records the Mission Control <-> Hermes seams as contracts only:

* Morning/Evening Packet consumer mapping onto the chief_of_staff
  MorningBrief/EveningReport contracts (schema major 1; all M21 fields
  additive at 1.1; all-or-nothing parsing preserved).
* Escalation <-> Executive State Machine mapping (CONTINUE/PAUSE/
  NEEDS_CHAD -> events; SafetyRisk >= HIGH -> ESCALATE; safety is never
  waved through; UNKNOWN semantics aligned with degraded/contradicted).
* Opportunity Scout as the reserved MC inbox feed (existing
  EXTENSION_POINTS slot; deterministic both sides; no reranking;
  expert-witness rejection; engine never fetches).
* Memory Graph as a reserved evidence feed via MC's governed recorder
  (source hermes-agent already allowlisted; knowledge-growth stays
  UNKNOWN until wired).
* Executive Coach consumption through the LEARNING intent.
* Invariants: evidence or silence; determinism; mutation boundaries
  (each side writes only its own store); attention economy; never chase
  autonomously; expert-witness isolation.

No runtime coupling, no code changes, no packaging change, no new
dependencies — this document is the entire diff.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ontracts

docs(executive-loop): M21 Executive Operating Loop — Hermes-side contracts
feat(briefing): add deterministic Morning Brief v1
Mission: M-20260713-olympus-hermes-bind

Agent: codex-mini
Mission: M-20260713-olympus-telegram-router

Agent: codex-mini
Mission: M-20260713-olympus-telegram-router

Agent: codex-mini
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

🔎 Lint report: codex-mini/M-20260713-olympus-telegram-router vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10838 on HEAD, 10614 on base (🆕 +224)

🆕 New issues (56):

Rule Count
unresolved-attribute 24
invalid-argument-type 20
invalid-assignment 3
unresolved-import 3
unsupported-operator 2
not-subscriptable 2
no-matching-overload 1
unknown-argument 1
First entries
hermes_cli/kanban_db.py:7620: [invalid-argument-type] invalid-argument-type: Argument to function `olympus_worker_runtime_snapshot` is incorrect: Expected `int`, found `Any | None`
hermes_cli/kanban_db.py:7259: [invalid-assignment] invalid-assignment: Cannot assign to a subscript on an object of type `None`
tests/hermes_cli/test_kanban_olympus_authority.py:1800: [invalid-argument-type] invalid-argument-type: Argument to function `create_olympus_task` is incorrect: Expected `int`, found `str | None | int | list[Unknown] | list[str]`
tests/hermes_cli/test_kanban_olympus_authority.py:2760: [invalid-assignment] invalid-assignment: Cannot assign to a subscript on an object of type `str`
hermes_cli/kanban_db.py:14183: [invalid-argument-type] invalid-argument-type: Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `int | None`
gateway/slash_commands.py:891: [invalid-argument-type] invalid-argument-type: Argument to function `olympus_service_auth` is incorrect: Expected `(dict[str, Any], /) -> dict[str, Any]`, found `Any | None`
gateway/kanban_watchers.py:1137: [unresolved-attribute] unresolved-attribute: Object of type `Self@_kanban_dispatcher_watcher` has no attribute `_kanban_dispatcher_instance_id`
tests/hermes_cli/test_kanban_olympus_authority.py:3105: [invalid-argument-type] invalid-argument-type: Argument is incorrect: Expected `str`, found `str | None`
hermes_cli/kanban_db.py:1921: [unsupported-operator] unsupported-operator: Operator `<=` is not supported between objects of type `str | dict[str, Any] | int | None | Any` and `int | float`
tests/hermes_cli/test_kanban_olympus_authority.py:3450: [unresolved-attribute] unresolved-attribute: Attribute `status` is not defined on `None` in union `Task | None`
tests/hermes_cli/test_kanban_olympus_authority.py:2760: [invalid-assignment] invalid-assignment: Cannot assign to a subscript on an object of type `int`
tests/hermes_cli/test_kanban_olympus_authority.py:3067: [invalid-argument-type] invalid-argument-type: Argument to function `mark_worker_starting` is incorrect: Expected `str`, found `str | None`
tests/hermes_cli/test_kanban_olympus_authority.py:3097: [invalid-argument-type] invalid-argument-type: Argument to function `olympus_worker_runtime_snapshot` is incorrect: Expected `str`, found `str | None`
gateway/slash_commands.py:569: [unresolved-attribute] unresolved-attribute: Object of type `Self@_route_olympus_telegram_intake` has no attribute `session_store`
tests/gateway/test_olympus_telegram_router.py:14: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/hermes_cli/test_kanban_olympus_authority.py:1800: [invalid-argument-type] invalid-argument-type: Argument to function `create_olympus_task` is incorrect: Expected `str | None`, found `str | None | int | list[Unknown] | list[str]`
tests/hermes_cli/test_kanban_olympus_authority.py:1800: [invalid-argument-type] invalid-argument-type: Argument to function `create_olympus_task` is incorrect: Expected `int | None`, found `str | None | int | list[Unknown] | list[str]`
gateway/slash_commands.py:882: [invalid-argument-type] invalid-argument-type: Argument to function `olympus_telegram_auth` is incorrect: Expected `(dict[str, Any], /) -> dict[str, Any]`, found `Any | None`
tests/hermes_cli/test_kanban_olympus_authority.py:1800: [invalid-argument-type] invalid-argument-type: Argument to function `create_olympus_task` is incorrect: Expected `Iterable[str]`, found `str | None | int | list[Unknown] | list[str]`
hermes_cli/kanban_db.py:5251: [unresolved-attribute] unresolved-attribute: Attribute `get` is not defined on `None` in union `Any | None`
hermes_cli/kanban_db.py:6757: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_olympus_external_txn` on type `_KanbanConnection`
tests/hermes_cli/test_kanban_db_init.py:7: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/hermes_cli/test_kanban_olympus_authority.py:1800: [invalid-argument-type] invalid-argument-type: Argument to function `create_olympus_task` is incorrect: Expected `Iterable[str] | None`, found `str | None | int | list[Unknown] | list[str]`
tests/hermes_cli/test_kanban_olympus_authority.py:1800: [invalid-argument-type] invalid-argument-type: Argument to function `create_olympus_task` is incorrect: Expected `bool`, found `str | None | int | list[Unknown] | list[str]`
gateway/slash_commands.py:531: [unresolved-attribute] unresolved-attribute: Object of type `Self@_olympus_selection_for_event` has no attribute `_session_key_for_source`
... and 31 more

✅ Fixed issues (7):

Rule Count
invalid-argument-type 2
unresolved-attribute 2
unsupported-operator 2
not-subscriptable 1
First entries
hermes_cli/kanban_db.py:5618: [invalid-argument-type] invalid-argument-type: Argument to function `_record_task_failure` is incorrect: Expected `int`, found `Literal[1] | None`
tests/hermes_cli/test_kanban_decompose_db.py:228: [not-subscriptable] not-subscriptable: Cannot subscript object of type `None` with no `__getitem__` method
hermes_cli/kanban_db.py:5632: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_last_rate_limited` on type `def detect_crashed_workers(conn: Connection) -> list[str]`
hermes_cli/kanban_db.py:5629: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_last_auto_blocked` on type `def detect_crashed_workers(conn: Connection) -> list[str]`
hermes_cli/kanban.py:1996: [invalid-argument-type] invalid-argument-type: Argument to function `add_comment` is incorrect: Expected `str`, found `str | None`
tests/hermes_cli/test_kanban_promote.py:143: [unsupported-operator] unsupported-operator: Operator `in` is not supported between objects of type `Literal["promote only applies"]` and `str | None`
tests/hermes_cli/test_kanban_promote.py:143: [unsupported-operator] unsupported-operator: Operator `in` is not supported between objects of type `Literal["'ready'"]` and `str | None`

Unchanged: 5554 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Mission: M-20260713-olympus-hermes-bind

Agent: codex-mini
Mission: M-20260713-olympus-telegram-router
Agent: codex-mini
Preserve the M09-M11 and G05 remediation implementation pending recertification of the invalidated Hermes authority predecessor. This commit is not certified and must not be published or merged.

Mission: M-20260713-olympus-telegram-router

Agent: codex-mini

Dependency-WIP: d79745a
Mission: M-20260713-olympus-hermes-bind

Agent: codex-mini
Mission: M-20260713-olympus-telegram-router

Agent: codex-mini
# Conflicts:
#	hermes_cli/kanban_db.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant