Back to archive
II. Clinical AI & Health Platformssupportingleadclient anonymised

Deutsch Cookbook

A cookbook of ~26 runnable examples for "Deutsch" — a clinical reasoning engine built on Popperian epistemology (Hard-To-Vary, conjecture/refutation, IDK protocol, clinical triage, "Popper supervision"). Part of the Healthcare platform/US healthtech platform ecosystem.

Status
active
Period
2026-01-28 → 2026-02-02
AI sessions
Stack
Languages
TypeScript
Frameworks · Infra
Bun@deutsch/core (workspace)
§01

Overview

  • What it is: companion package with executable examples (bun run examples/NN-*.ts) demonstrating and testing the @deutsch/core engine. NOT the engine itself — this is a "cookbook" of its API: from internal components (HTV scoring, IDK, confidence, survivor selection) to the full service surface (session API CRUD/TTL, SSE streaming, supervision, audit, rate limiting, key rotation).
  • Type / status / role: library (examples/docs package) · active · lead — 18 of 24 commits by the user, co-author aniashev (6).
  • Activity period: intensive sprint 2026-01-28 → 2026-02-02 (5 days, ~one example per day per SAL-7xx/8xx ticket).
§02

Stack

  • Languages: TypeScript (ESM, type: module).
  • Frameworks/libraries: Bun (runtime/runner), @deutsch/core as a workspace dependency (workspace:*); @types/bun. tsconfig with path aliases pointing to the parent core.
  • Infra/deploy: none — these are locally-run scripts (bun run NN), no install.
  • Data: none of its own; operates on the engine's types/contracts (ArgMedHTVScore, Hypothesis, EngineContext, Cartridge, SnapshotRef, etc.).
  • Notable tooling: mock agent factories for integration testing of the engine.
§03

What was shipped

18 user commits — each adds an example for a specific ticket (inferred from example code):

  • Engine (epistemology): 05 HTV scoring, 06 IDK protocol, 07 confidence, 04 survivor selection, 08 full debate (Generator→Verifier→Reasoner), 09 Engine integration testing (SAL-733).
  • Mode dependency: mode-aware IDK responses (SAL-718), clinical triage metadata (SAL-719), HTVScorer class (SAL-708).
  • Session API: create/get/delete (SAL-740..742), TTL enforcement (SAL-744), cleanup worker (SAL-745).
  • Messaging: send message (SAL-746), SSE streaming (SAL-747, 751..757), attachments (SAL-748), snapshot refresh (SAL-750).
  • Ops/observability: health/probes/metrics (19), rate limiting, audit emitter (SAL-840..845), API key rotation (SAL-876).
  • Supervision (human-in-the-loop): request builder (SAL-816..820), response parser (SAL-821..827), control command handler (SAL-828..834), fallback handler (SAL-835..839).
  • Scope: 24 commits in 5 days; PR flow (Merge PR #1 from US healthtech platform/SAL-821-827). aniashev — co-author.
§04

Technical challenges

Per example code (demonstrating understanding of a complex engine; authorship — user):

  • HTV (Hard-To-Vary) scoring per Popper (05-htv-scoring, 09-engine-testing): composite hypothesis score across 4 dimensions (specificity 0.3 + falsifiability 0.3 + interdependence 0.2 + parsimony 0.2), thresholds DEFAULT_HTV_THRESHOLDS (refutation 0.3 / idk 0.4 / good 0.7 / excellent 0.85). → Application of Deutsch/Popper epistemology (good explanation = hard to vary) to clinical hypothesis assessment. Non-trivial domain.
  • IDK protocol (responsible AI) (06-idk-protocol): the engine honestly says "I don't know" when no surviving hypotheses / low HTV / conflict / insufficient data; mode-aware tone (wellness vs advocate_clinical) + triage metadata (urgency/route_to/requires_supervision) for clinical mode. → Mature pattern for uncertainty disclosure and escalation to a clinician.
  • Engine integration testing via mock agent factories (09): AgentFactory with scenario presets (happy_path / all_refuted / low_htv), mock Generator/Verifier + real Reasoner, data factories (createHTVScore, createHypothesis, createCritique) with evidence-based fields (ACC/AHA guideline_class, evidence_level). → Sound approach to testability of a complex agentic system.
  • Full service surface (examples 10–25): session lifecycle + TTL/cleanup, SSE streaming, attachments, observability endpoints, rate limiting, audit, key rotation, human supervision (request/response/control/fallback). → Demonstrates understanding of a production-grade AI service end-to-end, not just "models".
§05

AI-assisted development

  • Sessions found: 0 for this directory (the normalized key is absent; verified via full-path normalization). Work was likely done from the parent monorepo / main deutsch repo (see issue #19) — that's where sessions should be looked for.
  • What was done with AI: no data in this directory; CLAUDE.md is detailed (220 lines) — a sign of AI-assisted development in the ecosystem.
  • AI workflow patterns: detailed CLAUDE.md as an engine reference; ticket-oriented commits (SAL-xxx) — structured process.
§06

Achievements & metrics

  • ~26 executable examples covering the engine + service end-to-end; ticket coverage SAL-708..876.
  • Part of a production clinical AI system (Healthcare platform/US healthtech platform) with human-in-the-loop supervision and audit.
§07

Contributors

git shortlog · all branches

  1. Dave9318
  2. aniashev6
2 contributors24 commits total
Currently

Open to Senior / Staff engineering roles and selective freelance — production AI, platform, and full-stack work.

Get in touch