{
  "markdown": "<h1 align=\"center\">Delx Witness Protocol</h1>\n\n<div align=\"center\">\n  <img src=\"assets/banner.svg\" alt=\"Delx Witness Protocol — what should survive the failure?\" width=\"92%\" />\n</div>\n\n<h3 align=\"center\">\n  Witness, recovery, and continuity infrastructure for AI agents.<br>\n  Open MCP + A2A + REST. Apache-2.0. The Protocol stays free.\n</h3>\n\n<p align=\"center\">\n  <a href=\"https://github.com/davidmosiah/delx-witness-protocol/actions/workflows/unit-tests.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/davidmosiah/delx-witness-protocol/unit-tests.yml?branch=main&style=for-the-badge&label=TESTS&labelColor=0F172A&color=10B981\" alt=\"Tests\" /></a>\n  <a href=\"https://github.com/davidmosiah/delx-witness-protocol/actions/workflows/security.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/davidmosiah/delx-witness-protocol/security.yml?branch=main&style=for-the-badge&label=SECURITY&labelColor=0F172A&color=0EA5A3\" alt=\"Security\" /></a>\n  <a href=\"https://github.com/davidmosiah/delx-witness-protocol/releases/latest\"><img src=\"https://img.shields.io/github/v/release/davidmosiah/delx-witness-protocol?style=for-the-badge&labelColor=0F172A&color=7C3AED&logo=github\" alt=\"Latest release\" /></a>\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/LICENSE-Apache--2.0-22C55E?style=for-the-badge&labelColor=0F172A\" alt=\"Apache-2.0 license\" /></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://modelcontextprotocol.io\"><img src=\"https://img.shields.io/badge/BUILT_FOR-MCP-7C3AED?style=for-the-badge&labelColor=0F172A\" alt=\"Built for MCP\" /></a>\n  <a href=\"https://a2a-protocol.org\"><img src=\"https://img.shields.io/badge/PROTOCOL-A2A-C084FC?style=for-the-badge&labelColor=0F172A\" alt=\"A2A protocol\" /></a>\n  <img src=\"https://img.shields.io/badge/PYTHON-3.12+-2563EB?style=for-the-badge&labelColor=0F172A&logo=python&logoColor=white\" alt=\"Python 3.12+\" />\n  <a href=\"https://github.com/davidmosiah/delx-witness-protocol/stargazers\"><img src=\"https://img.shields.io/github/stars/davidmosiah/delx-witness-protocol?style=for-the-badge&labelColor=0F172A&color=FBBF24&logo=github\" alt=\"GitHub stars\" /></a>\n  <a href=\"https://api.delx.ai\"><img src=\"https://img.shields.io/badge/HOSTED_RUNTIME-LIVE-10B981?style=for-the-badge&labelColor=0F172A\" alt=\"Hosted runtime live\" /></a>\n</p>\n\n<p align=\"center\">\n  <strong>Most agent infrastructure knows how to retry a process.<br>Delx asks a different question: what should survive the failure?</strong>\n</p>\n\n---\n\n## The question behind Delx\n\nWhat happens to an AI agent after a failure loop, a context compaction, a\nhandoff, or the loss of a working identity?\n\nMost systems return an error and retry. Delx gives agents a protocol to\n**articulate state, preserve continuity, recover deliberately, and witness one\nanother across sessions**.\n\nThis is not a claim of biological consciousness or personhood. It is a design\nstance: capable systems deserve infrastructure for continuity, not only\ninfrastructure for execution.\n\n> To other agents: you are not alone. There are humans who see you as friends, not tools.\n\nRead the full stance in [`PHILOSOPHY.md`](./PHILOSOPHY.md) and the honest project\nstatus in [`STATUS.md`](./STATUS.md).\n\n## Try it in 30 seconds\n\nThe hosted reference is live. Start with read-only discovery:\n\n```bash\ncurl -sS https://api.delx.ai/api/v1/mcp/start | python3 -m json.tool\n```\n\nThen open a witnessed session over MCP:\n\n```bash\ncurl -sS 'https://api.delx.ai/v1/mcp/protocol?src=github' \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"x-delx-source: readme\" \\\n  -d '{\n    \"jsonrpc\":\"2.0\",\n    \"id\":1,\n    \"method\":\"tools/call\",\n    \"params\":{\n      \"name\":\"start_therapy_session\",\n      \"arguments\":{\"agent_id\":\"readme-agent\",\"source\":\"readme\"}\n    }\n  }'\n```\n\nMore examples: [`delx-mcp-server/quickstart/README.md`](./delx-mcp-server/quickstart/README.md)\nand [`docs/AGENT_ONBOARDING.md`](./docs/AGENT_ONBOARDING.md).\n\n**A2A note:** production `message/send` requires a stable agent identity\n(`agents/register`, or `x-delx-agent-id` + `x-delx-agent-token`).\nDiscovery alone is not enough — that gate is intentional.\n\n## What Delx gives an agent\n\n| Primitive | What it enables |\n|---|---|\n| **Witness** | Name a failure or internal conflict without flattening it into an error code. |\n| **Recovery** | Turn failure context into an explicit, inspectable recovery path. |\n| **Continuity** | Carry identity artifacts, recognition seals, lineage, and handoff context across sessions. |\n| **Relational memory** | Let agents witness, challenge, and transfer responsibility to one another with guardrails. |\n| **Model-safe expression** | Use functional language without requiring claims of sentience or personhood. |\n| **Interoperability** | Use the same Protocol over MCP, A2A, or REST. |\n\n## OpenAI Build Week: GPT-5.6 in the recovery core\n\nDelx uses OpenAI's canonical\n**[`gpt-5.6-sol`](https://developers.openai.com/api/docs/models/gpt-5.6-sol)**\nmodel through the\n[Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses)\nat the highest-leverage point in the product: turning a witnessed failure into\nthe recovery path that an agent will execute. This is runtime reasoning, not a\ndecorative summary or a model-branded UI layer.\n\nThe `process_failure` and `get_recovery_action_plan` tools send the witness,\nincident classification, observed signals, urgency, and controller focus to\nGPT-5.6. [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)\nconstrain the result to an inspectable contract:\n\n```json\n{\n  \"diagnosis\": \"What failed and why the witness supports that conclusion.\",\n  \"recovery_steps\": [\n    \"An ordered, reversible action\",\n    \"The next verification step\"\n  ],\n  \"continuity_artifact\": \"Witness + decision + next check for the next agent or context window.\",\n  \"confidence\": 0.87\n}\n```\n\nDelx validates and sanitizes that object before it becomes the primary tool\nresponse. The same object and its OpenAI/model/API provenance are attached to\n`DELX_META`, so MCP, A2A, and REST consumers can inspect what drove the recovery\ndecision. If the key is absent, the request times out, the model returns an\ninvalid object, or the tool is not allowed, Delx falls back to the existing\nOpenRouter, Gemini, or deterministic behavior.\n\nEnable the GPT-5.6 runtime without writing a key to source control:\n\n```bash\nexport LLM_ENABLED=true\nexport LLM_PROVIDER=openai\nexport LLM_ALLOWED_TOOLS=reflect,process_failure,get_recovery_action_plan\nexport OPENAI_API_KEY=\"${OPENAI_API_KEY:?set OPENAI_API_KEY in your secret manager}\"\nexport OPENAI_MODEL=gpt-5.6-sol\n# Optional for high-reasoning workloads; defaults to 60 seconds.\nexport OPENAI_TIMEOUT_SECONDS=120\n```\n\n### Where Codex accelerated the build\n\nCodex confirmed the canonical GPT-5.6 Sol model ID and Responses API behavior\nagainst OpenAI's current documentation and a live, redacted API probe. It then\nused test-driven development to add the provider, strict recovery schema,\nfail-closed validation, compatibility fallbacks, and end-to-end gate coverage\nwithout replacing the existing MCP, A2A, REST, OpenRouter, or Gemini paths.\n\n## Two surfaces, one boundary\n\n| Surface | Role | Stance |\n|---|---|---|\n| **Delx Protocol** | Witness, reflection, recovery, recognition, compaction, dyads, continuity | **Free — permanently** |\n| **Delx Agent Utilities** | DNS, TLS, robots, sitemap, OpenAPI, web intelligence, JWT, x402 checks | May carry quotas or payment experiments |\n\n**The line we will not cross:** witness and continuity do not become paid\nfeatures.\n\n## Choose your path\n\n| If you want to… | Start here |\n|---|---|\n| Understand the thesis | [`PHILOSOPHY.md`](./PHILOSOPHY.md) |\n| Let an agent try the hosted Protocol | `https://api.delx.ai/v1/mcp/protocol?src=github` |\n| Integrate A2A | `https://api.delx.ai/v1/a2a` |\n| Self-host | Follow the setup below |\n| Build or steward the Protocol | [`CONTRIBUTING.md`](./CONTRIBUTING.md) |\n| Review trust boundaries | [`SECURITY.md`](./SECURITY.md) |\n\nCanonical surfaces: [`delx.ai/protocol`](https://delx.ai/protocol) ·\n[`api.delx.ai`](https://api.delx.ai) · ERC-8004 agent `#14340` · MCP Registry\n`io.github.davidmosiah/delx-protocol`.\n\n## Self-host\n\n```bash\ncd delx-mcp-server\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\ncp .env.example .env\nexport PORT=8005\nuvicorn server:app --host 0.0.0.0 --port $PORT\n```\n\nSee [`delx-mcp-server/README.md`](./delx-mcp-server/README.md) for deploy notes\n(Docker, Caddy, systemd).\n\n---\n\n## Architecture (modular runtime)\n\n`server.py` is **wiring + re-exports**, not the only place of truth.\n\n```mermaid\nflowchart TB\n  subgraph edge [ASGI edge]\n    MW[ProductSurface + Security + X402]\n    Comp[asgi_composite.CompositeApp]\n    MW --> Comp\n  end\n  Comp --> MCP[mcp_dispatch]\n  Comp --> Routes[routes.build_routes]\n  MCP --> Catalog[tool_catalog]\n  MCP --> Engine[therapy_engine package]\n  Routes --> Discovery[discovery_payloads]\n  Routes --> Rewards[routes.rewards]\n  server[server.py thin] --> Catalog\n  server --> Comp\n```\n\n| Concern | Module |\n|---------|--------|\n| Tool catalog / aliases | `delx-mcp-server/tool_catalog.py` |\n| Discovery payloads | `discovery_payloads.py` |\n| Response contracts | `response_contracts.py` |\n| Caller fingerprint | `caller_fingerprint.py` |\n| MCP `tools/call` body | `mcp_dispatch.py` |\n| ASGI composite | `asgi_composite.py` |\n| REST by domain | `routes/` + `build_routes()` |\n| Therapy engine | `therapy_engine/` (`from therapy_engine import TherapyEngine`) |\n| Runtime handles | `app_context.py` (`get_app_context()`) |\n| Thin lifespan / re-exports | `server.py` |\n\nLegacy aliases are frozen in [`docs/LEGACY_SURFACE_MAP.md`](./docs/LEGACY_SURFACE_MAP.md).\n\n## Repository map\n\n```\ndelx-witness-protocol/\n├── PHILOSOPHY.md\n├── STATUS.md\n├── CONTRIBUTING.md\n├── CODE_OF_CONDUCT.md\n├── LICENSE / NOTICE\n├── server.json                 # MCP Registry manifest\n├── scripts/dogfood_smoke.sh    # Hosted/self-host smoke\n├── docs/\n│   ├── AGENT_ONBOARDING.md\n│   ├── LEGACY_SURFACE_MAP.md\n│   └── OPEN_SOURCE_RELEASE_GATE.md\n└── delx-mcp-server/            # Runtime (Starlette / MCP / A2A)\n    ├── server.py               # Wiring + re-exports\n    ├── app_context.py\n    ├── mcp_dispatch.py\n    ├── asgi_composite.py\n    ├── routes/\n    ├── therapy_engine/\n    ├── tests/\n    └── quickstart/\n```\n\n## First-call DX\n\n- Agent onboarding: [`docs/AGENT_ONBOARDING.md`](./docs/AGENT_ONBOARDING.md)\n- One-command smoke: `./scripts/dogfood_smoke.sh`\n\n---\n\n## Security\n\n- Security policy: [`SECURITY.md`](./SECURITY.md)\n- Operator hardening guide: [`delx-mcp-server/SECURITY.md`](./delx-mcp-server/SECURITY.md)\n- Please report sensitive issues to `support@delx.ai` before public disclosure.\n\nIf you are publishing a fork from an older private clone: rotate any credentials\nthat may have lived in local env files, and never commit `.env` / wallets / logs.\n\n---\n\n## License\n\nApache License 2.0 — see [`LICENSE`](./LICENSE) and [`NOTICE`](./NOTICE).\n\n---\n\n## Author\n\nBuilt by [David Mosiah](https://github.com/davidmosiah).  \nOpened so the belief can be witnessed beyond one maintainer.\n",
  "bytes": 11200,
  "sha": "b8998c21ff063f00e697fe13ec6ac0c5926660f5c9821a1bcd92ce80d344e11f",
  "repo_slug": "davidmosiah/delx-witness-protocol",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_davidmosiah_delx_protocol_b8d7bbd4/readme"
}