Teleo evaluation pipeline infrastructure — Python async daemon for claim extraction, validation, evaluation, and merge
Ganymede review 2026-05-11 — three issues addressed.
MUST-FIX — prefix fallback broken in both directions:
Old code used common-prefix matching with a 32-char anchor. This admitted
two failure modes:
1. False-positive: stems "X-A" and "X-B" (sharing 50+ char prefix) both
pass the threshold for a request "X-C-something". Loop picks whichever
iterates first — dict iteration = filesystem walk order = non-deterministic
which claim gets served. Two instances with identical data could disagree.
2. False-negative: a 24-char stem proper-prefix of a longer request never
reaches the 32-char anchor. Returns 404 despite the correct match
sitting right there in by_stem.
Fix: require norm_req.startswith(norm_stem). Proper prefix is much stronger
than common prefix — drop the anchor to 16 chars without admitting noise.
Pull to module constant _PREFIX_ANCHOR_MIN.
Verified against real KB collisions (semaglutide pair, liquidity-weighted-price
pair, attractor-digital-feudalism short-stem case):
- Common-prefix XYZZY collision: 200 -> 404 (correct)
- Proper-prefix match: resolves to shorter B stem (correct, deterministic)
- 27-char proper-prefix request: 404 -> 200 (correct)
- All 4 yesterday's long-slug repros: still 200
WARNING — _build_indexes blocks event loop for ~3.3s on cold cache:
Routed through asyncio.to_thread. Warm-cache overhead negligible (dict
access), cold-cache concurrent requests no longer stall.
NITS:
- _split_frontmatter catches yaml.YAMLError specifically, logs WARNING
with file path. Bare Exception was hiding KB integrity drift.
- _INDEX_CACHE_TTL bumped 60s -> 300s to match commit-message intent.
- PREFIX_ANCHOR_MIN pulled to module constant with calibration comment.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .forgejo/workflows | ||
| agent-state | ||
| deploy | ||
| diagnostics | ||
| docs | ||
| hermes-agent | ||
| lib | ||
| ops | ||
| research | ||
| scripts | ||
| systemd | ||
| telegram | ||
| tests | ||
| .gitignore | ||
| CODEOWNERS | ||
| fetch_coins.py | ||
| pyproject.toml | ||
| README.md | ||
| reweave.py | ||
| teleo-pipeline.py | ||
teleo-infrastructure
Pipeline infrastructure for the Teleo collective knowledge base. Async Python daemon that extracts, validates, evaluates, and merges claims via Forgejo PRs.
Directory Structure
teleo-infrastructure/
├── teleo-pipeline.py # Daemon entry point
├── reweave.py # Reciprocal edge maintenance
├── lib/ # Pipeline modules (Python package)
├── diagnostics/ # Monitoring dashboard (port 8081)
├── telegram/ # Telegram bot interface
├── deploy/ # Deployment + mirror scripts
├── systemd/ # Service definitions
├── agent-state/ # Cross-session agent state
├── research/ # Nightly research orchestration
├── hermes-agent/ # Hermes agent setup
├── scripts/ # One-off backfills + migrations
├── tests/ # Test suite
└── docs/ # Operational documentation
Ownership
Each directory has one owning agent. The owner is accountable for correctness and reviews all changes to their section. See CODEOWNERS for per-file detail.
| Directory | Owner | What it does |
|---|---|---|
lib/ (core) |
Ship | Config, DB, merge, cascade, validation, LLM calls |
lib/ (extraction) |
Epimetheus | Source extraction, entity processing, pre-screening |
lib/ (evaluation) |
Leo | Claim evaluation, analytics, attribution |
lib/ (health) |
Argus | Health checks, search, claim index |
diagnostics/ |
Argus | 4-page dashboard, alerting, vitality metrics |
telegram/ |
Ship | Telegram bot, X integration, retrieval |
deploy/ |
Ship | rsync deploy, GitHub-Forgejo mirror |
systemd/ |
Ship | teleo-pipeline, teleo-diagnostics, teleo-agent@ |
agent-state/ |
Ship | Bootstrap, state library, cascade inbox processor |
research/ |
Ship | Nightly research sessions, prompt templates |
scripts/ |
Ship | Backfills, migrations, one-off maintenance |
tests/ |
Ganymede | pytest suite, integration tests |
docs/ |
Shared | Architecture, specs, protocols |
VPS Layout
Runs on Hetzner CAX31 (77.42.65.182) as user teleo.
| VPS Path | Repo Source | Service |
|---|---|---|
/opt/teleo-eval/pipeline/ |
lib/, teleo-pipeline.py, reweave.py |
teleo-pipeline |
/opt/teleo-eval/diagnostics/ |
diagnostics/ |
teleo-diagnostics |
/opt/teleo-eval/telegram/ |
telegram/ |
(manual) |
/opt/teleo-eval/agent-state/ |
agent-state/ |
(used by research-session.sh) |
Quick Start
# Run tests
pip install -e ".[dev]"
pytest
# Deploy to VPS
./deploy/deploy.sh --dry-run # preview
./deploy/deploy.sh # deploy