{
  "$id": "https://discern.sh/schema/v1/discern-conventions.json",
  "format": 1,
  "x-discern-compatibility-policy": "conventions-append-only",
  "environment_variables": {
    "DISCERN_REPO": true,
    "DISCERN_VERSION": true,
    "DISCERN_BIN_DIR": true,
    "DISCERN_TRUNK": true,
    "DISCERN_NO_ATTRIBUTION": true,
    "DISCERN_PROJECT_SLUG": true,
    "DISCERN_WORKTREE_BRANCH_PREFIX": true,
    "DISCERN_WORKTREE_ID": true,
    "DISCERN_ROOT": true,
    "DISCERN_TOML": true,
    "DISCERN_SCRIPTS_DIR": true,
    "DISCERN_CHECKPOINT_INPUT": true,
    "DISCERN_WORKTREE_PORT": true,
    "DISCERN_WORKTREE": true,
    "DISCERN_RESOURCE_<NAME>": true,
    "DISCERN_EXPERIMENTAL_MCP_PRELOAD": true,
    "DISCERN_EXPERIMENTAL_AWAIT_CALL_SECONDS": true
  },
  "bundled_skills": {
    "discern-await-the-fleet": true,
    "discern-clear-the-decks": true,
    "discern-cure-a-bug": true,
    "discern-delegate-work": true,
    "discern-place-a-checkpoint": true,
    "discern-set-the-standard": true,
    "discern-teach-the-project": true,
    "discern-write-adr": true,
    "discern-write-it-once": true
  },
  "exit_statuses": {
    "success": 0,
    "controlled-failure": 1,
    "usage": 2,
    "internal-error": 70,
    "await-timeout": 124,
    "executable-not-found": 127,
    "sighup": 129,
    "sigint": 130,
    "sigterm": 143,
    "child-passthrough": "class",
    "signal-passthrough": "class"
  },
  "script_protocols": {
    "metric": {
      "line_prefix": "DISCERN_METRIC",
      "line_grammar": "DISCERN_METRIC <name> <number>"
    },
    "checkpoint_when": {
      "input_environment_variable": "DISCERN_CHECKPOINT_INPUT",
      "input_version": 1,
      "input_fields": [
        "version",
        "checkpoint",
        "policy_commit",
        "changed_files",
        "history"
      ],
      "match_line_prefix": "DISCERN_MATCH",
      "fire_exit_status": 0,
      "pass_exit_status": 10
    }
  },
  "checkpoints": {
    "map-focus": "map.focus",
    "instruction-economy": "instructions.economy",
    "skills-playbook": "skills.executable",
    "gotchas-playbook": "setup.failure-memory",
    "deletion-heavy-change": "change.deletion-safety",
    "parallel-implementation": "change.parallel-implementation",
    "new-binary-asset": "change.binary-asset",
    "effort-sprawl": "change.effort-scope",
    "map-drift": "map.current",
    "commit-story": "change.commit-story"
  },
  "questions": {
    "gate.fast-feedback": true,
    "gate.test-depth": true,
    "gate.structured-diagnostics": true,
    "setup.failure-memory": true,
    "instructions.project-specific": true,
    "instructions.economy": true,
    "map.current": true,
    "map.adrs": true,
    "map.navigation": true,
    "map.focus": true,
    "worktrees.resources": true,
    "standards.opportunity": true,
    "standards.normalize": true,
    "checkpoints.opportunity": true,
    "skills.opportunity": true,
    "skills.executable": true,
    "change.binary-asset": true,
    "change.deletion-safety": true,
    "change.parallel-implementation": true,
    "change.effort-scope": true,
    "change.commit-story": true
  },
  "identity": {
    "stored_fields": {
      "id": true,
      "site": true,
      "branch": true,
      "port": true,
      "db": true,
      "seed": true
    },
    "selectable_fields": {
      "id": true,
      "site": true,
      "branch": true,
      "port": true,
      "db": true,
      "seed": true,
      "worktree": true
    },
    "derivation": {
      "checksum": "posix-cksum",
      "port_base": 17290,
      "port_span": 2000,
      "dns_label_limit": 63,
      "database_inputs": [
        "project-slug",
        "worktree-id"
      ],
      "branch_inputs": [
        "branch-prefix",
        "worktree-id"
      ],
      "seed_input": "full-branch",
      "slug_collision_prefix": "wt-"
    }
  },
  "providers": {
    "claude_code": {
      "instruction_file": "CLAUDE.md",
      "skills_directory": ".claude/skills",
      "mcp_file": ".mcp.json",
      "hooks_file": ".claude/settings.json",
      "hook_events": {
        "SessionStart": "session-start",
        "WorktreeCreate": "worktree-create",
        "WorktreeRemove": "worktree-remove"
      },
      "local_state_files": {
        ".claude/settings.local.json": true
      }
    },
    "codex": {
      "instruction_file": "AGENTS.md",
      "skills_directory": ".agents/skills",
      "mcp_file": ".codex/config.toml",
      "hooks_file": ".codex/hooks.json",
      "hook_events": {
        "SessionStart": "session-start"
      },
      "worktree_app_file": ".codex/environments/environment.toml",
      "project_rules_file": ".codex/rules/discern.rules",
      "local_state_files": {}
    },
    "gemini": {
      "instruction_file": "GEMINI.md",
      "skills_directory": ".agents/skills",
      "mcp_file": ".gemini/settings.json",
      "hooks_file": ".gemini/settings.json",
      "hook_events": {
        "SessionStart": "session-start"
      },
      "local_state_files": {}
    },
    "cursor": {
      "instruction_file": "AGENTS.md",
      "skills_directory": ".agents/skills",
      "mcp_file": ".cursor/mcp.json",
      "hooks_file": ".cursor/hooks.json",
      "hook_events": {
        "sessionStart": "session-start"
      },
      "local_state_files": {}
    },
    "copilot": {
      "instruction_file": "AGENTS.md",
      "skills_directory": ".agents/skills",
      "mcp_file": ".mcp.json",
      "hooks_file": ".github/hooks/discern.json",
      "hook_events": {
        "sessionStart": "session-start"
      },
      "local_state_files": {}
    }
  },
  "git": {
    "refs": {
      "proof_notes": "refs/notes/discern",
      "proof_notes_transport_reservation": "refs/notes/discern*",
      "proof_notes_short": "discern",
      "proof_notes_tracking_prefix": "refs/discern/remotes",
      "proof_notes_tracking_reservation": "refs/discern/remotes/<remote>/notes*",
      "drop_recovery_prefix": "refs/discern/recovery",
      "acceptance_transaction_prefix": "refs/worktree/discern/acceptance-transactions"
    },
    "refspec_templates": {
      "proof_notes_fetch": "+refs/notes/discern*:refs/discern/remotes/<remote>/notes*"
    },
    "reflog_templates": {
      "acceptance": "discern accept: <fast-forward|rollback> <branch>",
      "acceptance_transaction": "discern accept transaction <id>: <fast-forward|rollback> <branch>",
      "authored_commit": "discern authored commit/<uuid>"
    },
    "config_keys": {
      "proof_notes_fetch_remote": "discern.proofNotesFetchRemote",
      "remote_fetch": "remote.<remote>.fetch",
      "worktree_config_extension": "extensions.worktreeConfig",
      "generated_merge_driver": "merge.discern-generated.driver"
    },
    "branches": {
      "worktree_prefix_default": "agent/",
      "setup": "discern-setup",
      "integration_namespace": "integration/",
      "detached_fallback": "<branch>-<8-character-commit>"
    },
    "worktree_root": {
      "default_suffix": ".worktrees",
      "default_template": "<repo>.worktrees/<name>"
    },
    "managed_block": {
      "begin": "# --- discern ---",
      "end": "# --- /discern ---"
    },
    "generated_marker_prefix": "# Generated automatically ",
    "attributes": {
      "generated_merge_driver": "discern-generated",
      "generated_merge_assignment": "merge=discern-generated",
      "markdown_diff_driver": "markdown",
      "markdown_diff_assignment": "diff=markdown",
      "linguist_generated": "linguist-generated"
    },
    "machine": {
      "name": "discern",
      "email": "done@discern.sh",
      "trailer": "Co-authored-by: discern <done@discern.sh>"
    }
  }
}
