Adapters and the Application Layer

Adapters and the Application Layer An architecture diagram generated by Archify. Click Commands · cli/*_cmd.py · frontend adapters · parse · render · exit Click Commands cli/*_cmd.py parse · render · exit MCP Tools · mcp/tools/ · frontend adapters · wire projection MCP Tools mcp/tools/ wire projection REST Routes · server/routes/ · /v1 · frontend adapters · bearer + Host guard REST Routes server/routes/ · /v1 bearer + Host guard CLI Projection · render events · outcomes · frontend adapters · adapter-owned words CLI Projection render events · outcomes adapter-owned words Adapter Envelopes · CLI · MCP · HTTP · frontend adapters Adapter Envelopes CLI · MCP · HTTP Neutral Contracts · 11 kinds · 4 commit states · _app/ · imports no click, rich, fastmcp or fastapi Neutral Contracts 11 kinds · 4 commit states Feature Cores · requests · events · outcomes · _app/ · imports no click, rich, fastmcp or fastapi · transport-neutral Feature Cores requests · events · outcomes transport-neutral errors.classify · AuthError → authentication · _app/ · imports no click, rich, fastmcp or fastapi · single category source errors.classify AuthError → authentication single category source Client Namespaces · client.notebooks · .sources · Architecture component Client Namespaces client.notebooks · .sources Selected Runtime · Shared + Web / Android · Architecture component Selected Runtime Shared + Web / Android parse + render typed request tool args request model typed outcome client call selected backend raises category frontend adapters _app/ · imports no click, rich, fastmcp or fastapi Legend Frontend Backend

Adapter responsibilities

  • • CLI owns Click options, progress text, tables, JSON, and exit codes
  • • MCP owns tool envelopes and confirmation previews; REST owns HTTP models and status

Neutral core

  • • 11 frozen variants share domain validation; MCP + REST use the option-table builder
  • • CLI maps Click inputs directly; typed wait/outcome semantics exclude presentation

Settled batch evidence

  • • Every input keeps an ordered confirmed, rejected, unknown, or not_sent state
  • • Typed outcomes drive continuation; inputs and titles are redacted before projection