{
  "schema": 1,
  "name": "phewsh-adapter-contract",
  "projectTruth": {
    "id": "intent",
    "label": "Project truth",
    "owner": "project",
    "path": ".intent/",
    "create": "phewsh init",
    "inspect": "phewsh status",
    "remove": "manual only; Phewsh never auto-removes project truth",
    "authority": "Project · Next · Work · Record"
  },
  "layers": [
    {
      "id": "intent-skill",
      "label": "Intent skill",
      "kind": "skill",
      "state": "available",
      "scope": "user-level",
      "targets": ["claude-code", "codex"],
      "apply": "phewsh ambient on",
      "inspect": "phewsh ambient status",
      "remove": "phewsh ambient off",
      "writes": ["~/.agents/skills/intent/SKILL.md", "~/.claude/skills/intent/SKILL.md"],
      "ownership": "Phewsh removes only unchanged receipt-owned copies; project-local overrides are user-owned.",
      "authority": "Workflow instructions only; .intent/ remains project truth.",
      "boundary": "Does not carry native transcripts or private model reasoning."
    },
    {
      "id": "session-hooks",
      "label": "Session hooks",
      "kind": "hook",
      "state": "available",
      "scope": "user-level",
      "targets": ["claude-code"],
      "apply": "phewsh ambient on",
      "inspect": "phewsh ambient status",
      "remove": "phewsh ambient off",
      "writes": ["~/.claude/settings.json", "~/.phewsh/ambient-sessions.jsonl"],
      "ownership": "Marked hook entries are removable; breadcrumb history remains user-owned.",
      "authority": "Injects a bounded project brief at SessionStart; records time, project, and cwd metadata at SessionEnd.",
      "boundary": "Never records transcript content; hooks fail open."
    },
    {
      "id": "native-projections",
      "label": "Native projections",
      "kind": "projection",
      "state": "available",
      "scope": "project",
      "targets": ["claude-code", "codex", "gemini", "cursor"],
      "apply": "phewsh ambient on",
      "refresh": "phewsh seq --write",
      "inspect": "phewsh truth",
      "remove": "phewsh ambient off",
      "writes": ["CLAUDE.md", "AGENTS.md", "GEMINI.md", ".cursorrules"],
      "ownership": "Only Phewsh-marked context blocks are refreshed or removed; human content is preserved.",
      "authority": "Derived views of .intent/ for supported native project files.",
      "boundary": "Does not project transcripts, private model reasoning, or editor buffers."
    },
    {
      "id": "safety-receipt-hooks",
      "label": "Safety and receipt hooks",
      "kind": "hook",
      "state": "opt-in",
      "scope": "user-level",
      "targets": ["claude-code", "codex"],
      "apply": "phewsh gate enforce on",
      "inspect": "phewsh gate enforce status",
      "remove": "phewsh gate enforce off",
      "writes": ["~/.claude/settings.json", "~/.codex/hooks.json", "~/.phewsh/ambient-sessions.jsonl"],
      "ownership": "Phewsh removes only its matching hook entries; unrelated settings are preserved.",
      "authority": "Narrow pre-tool decision policy plus a redacted post-tool receipt.",
      "boundary": "Local and deterministic; not a sandbox. Receipt captures tool and target, never arguments or content."
    },
    {
      "id": "mcp",
      "label": "MCP adapter",
      "kind": "capability-adapter",
      "state": "optional",
      "scope": "user-level",
      "targets": ["configured MCP clients"],
      "apply": "phewsh mcp setup",
      "inspect": "phewsh mcp status",
      "remove": "remove the printed phewsh entry from the client config",
      "writes": ["~/.phewsh/projects.json"],
      "ownership": "Setup prints a manual client-config snippet; it does not write agent config.",
      "authority": "Bounded context and task capability transport.",
      "boundary": "Not project truth and no independent remote-execution authority."
    },
    {
      "id": "ion-worker",
      "label": "Ion worker",
      "kind": "team-adapter",
      "state": "optional",
      "scope": "machine",
      "targets": ["ion"],
      "apply": "phewsh project add && phewsh serve",
      "inspect": "phewsh ion doctor",
      "remove": "phewsh project remove <project>",
      "writes": ["~/.phewsh/projects.json"],
      "ownership": "Only deliberately registered local projects are exposed by the worker.",
      "authority": "Same-machine, project-bound execution after a human explicitly claims work.",
      "boundary": "Teammates cannot reach another machine's localhost; no cross-machine or VPS authority."
    },
    {
      "id": "slack-discord",
      "label": "Slack and Discord connectors",
      "kind": "connector",
      "state": "planned",
      "scope": "team",
      "targets": ["slack", "discord"],
      "apply": null,
      "inspect": "phewsh ion connectors",
      "remove": null,
      "writes": [],
      "ownership": "No connector files or bot authority exist yet.",
      "authority": "Planned request and notification transport around Ion.",
      "boundary": "Not shipped; no bot auto-execution. Ion remains the canonical room."
    }
  ]
}
