{
  "scope": [
    "S:\\mcp-servers\\AGENTS.md",
    "S:\\mcp-servers\\shared-agent-rules\\",
    "S:\\mcp-servers\\.codex\\",
    "S:\\mcp-servers\\.agents\\ (excluding skills/*/SKILL.md contents)",
    "S:\\mcp-servers\\scripts\\hooks\\",
    "S:\\mcp-servers\\scripts\\build-routing-catalog.mjs",
    "S:\\mcp-servers\\scripts\\generate-codex-hooks.js"
  ],
  "files": [
    {
      "path": "S:\\mcp-servers\\AGENTS.md",
      "kind": "source",
      "generator": null,
      "purpose": "Root governance-minima file: priorities, essential skill routing pointers, compatibility guardrails, hotword/subagent policy (section 5)."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\AGENTS.md",
      "kind": "source",
      "generator": null,
      "purpose": "Portable bootstrap distributed to external projects: mandates reading effective GLOBAL.md/SUBAGENTS.md and prefers projectfs-mcp-server for read-only fs ops."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md",
      "kind": "source",
      "generator": null,
      "purpose": "Main shared operating rules: coding standards, MCP tool priority/routing map, skill map, memory discipline, work loop, version control, token/file discipline."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md",
      "kind": "source",
      "generator": null,
      "purpose": "Sub-agent delegation policy: hotword contract (!agents), role list (explorer/implementer/technical_analyst/code_reviewer/test_writer), delegation constraints."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\TOKEN_DISCIPLINE.md",
      "kind": "source",
      "generator": null,
      "purpose": "Dedicated output/token-minimization ruleset (terse mode, tool-output discipline, sub-agent output contract)."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\COLDFUSION.md",
      "kind": "source",
      "generator": null,
      "purpose": "CFML technology appendix: skill routing to mcp-coldfusion-developer, coding conventions, cf_bridge.evaluate guardrail."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\Yii.md",
      "kind": "source",
      "generator": null,
      "purpose": "Sophia Framework 2 / Yii 1.1 technology appendix: skill routing to mcp-sophia-yii-developer, layering and config-load-order conventions."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\manifest.json",
      "kind": "source",
      "generator": null,
      "purpose": "Metadata of historical Google Drive origin plus policy stating the repo copy is authoritative and Drive can be decommissioned."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\README.md",
      "kind": "source",
      "generator": null,
      "purpose": "Explains shared-agent-rules directory contents and maintenance flow (edit here, then distribute via copy-agent-rules.bat)."
    },
    {
      "path": "S:\\mcp-servers\\shared-agent-rules\\legacy-sync\\task-windows-copy-docs.example.xml",
      "kind": "source",
      "generator": null,
      "purpose": "Sanitized Windows Task Scheduler template to automate distribution of the Markdown rule files to local workspaces."
    },
    {
      "path": "S:\\mcp-servers\\.codex\\agents\\README.md",
      "kind": "source",
      "generator": null,
      "purpose": "Documents that .codex/agents/*.toml are derived runtime files; declares docs/agents/canonical-subagents.yaml as the canonical schema and scripts/sync-portable-agents.js as the regenerator."
    },
    {
      "path": "S:\\mcp-servers\\.codex\\agents\\explorer.toml",
      "kind": "generated",
      "generator": "S:\\mcp-servers\\scripts\\sync-portable-agents.js (from S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml)",
      "purpose": "Codex runtime definition for the explorer sub-agent role (read-only discovery/audit)."
    },
    {
      "path": "S:\\mcp-servers\\.codex\\agents\\implementer.toml",
      "kind": "generated",
      "generator": "S:\\mcp-servers\\scripts\\sync-portable-agents.js (from S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml)",
      "purpose": "Codex runtime definition for the implementer sub-agent role (workspace-write, narrow validated patches)."
    },
    {
      "path": "S:\\mcp-servers\\.codex\\agents\\code_reviewer.toml",
      "kind": "generated",
      "generator": "S:\\mcp-servers\\scripts\\sync-portable-agents.js (from S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml)",
      "purpose": "Codex runtime definition for the code_reviewer sub-agent role (read-only review)."
    },
    {
      "path": "S:\\mcp-servers\\.codex\\agents\\technical_analyst.toml",
      "kind": "generated",
      "generator": "S:\\mcp-servers\\scripts\\sync-portable-agents.js (from S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml)",
      "purpose": "Codex runtime definition for the technical_analyst sub-agent role (structured cross-source analysis)."
    },
    {
      "path": "S:\\mcp-servers\\.codex\\agents\\test_writer.toml",
      "kind": "generated",
      "generator": "S:\\mcp-servers\\scripts\\sync-portable-agents.js (from S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml)",
      "purpose": "Codex runtime definition for the test_writer sub-agent role (read-only manual test checklist writer)."
    },
    {
      "path": "S:\\mcp-servers\\.agents\\skills\\mcp-runtime-integrator\\",
      "kind": "source",
      "generator": null,
      "purpose": "Contains only SKILL.md, references/*.md and evals/evals.json for this skill; no separate config/hook/routing-rule files found under .agents/ beyond skill content (excluded from this audit's scope)."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "UserPromptSubmit hook entrypoint: heuristic routing engine emitting up to 2 hints plus routing-control hints (contextMode/subagentMode)."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\routing-engine.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Pure routing semantics module: intent matching, anti-pattern matching, lock/suppression resolution, final skill ranking (no I/O)."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\routing-catalog-schema.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Schema v2 validator/classifier for the routing catalog (skills/composites/intents structure, required intent priorities)."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\prompt-routing-options.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Parses leading hotwords (!quick, !agents) from the raw prompt and detects repository-task / explicit-subagent-request patterns to compute contextMode/subagentMode."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\routing-catalog.json",
      "kind": "generated",
      "generator": "S:\\mcp-servers\\scripts\\build-routing-catalog.mjs",
      "purpose": "Compiled runtime catalog (skills/composites/intents) extracted from skills/<name>/SKILL.md, consumed by sophia-user-prompt-submit.mjs; gitignored (see .gitignore line 39) and rebuilt via npm run test:routing:catalog."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-session-start.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "SessionStart hook: locates and dumps the nearest AGENTS.md plus a docs/memory taxonomy-bootstrap instruction into session context."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-sql.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "PreToolUse hook: emits a read-only/parameterize/explain-plan reminder when the tool call looks SQL-related."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-coldfusion.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "PreToolUse hook: emits a passive-inspection-only reminder for cf_bridge.evaluate-style ColdFusion tool calls."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-memory.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "PreToolUse hook: emits a memory-write discipline reminder before memory_add/memory_invalidate-style calls."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-projectfs.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "PreToolUse hook: classifies literal read-only shell commands (Get-Content/cat/ls/grep -F/stat, etc.) and recommends the matching projectfs-mcp-server tool."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-antigravity-adapter.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Adapter that re-shapes Antigravity's hook payload/response contract to drive the same sophia-*.mjs hook scripts."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-cursor-adapter.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Adapter that re-shapes Cursor's hook payload/response contract (beforeSubmitPrompt/beforeMCPExecution/etc.) to drive the same sophia-*.mjs hook scripts."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\analytics-hook-log-utils.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Shared best-effort analytics logging helper used by all sophia-*.mjs hooks; not a routing/policy source."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks\\analytics-log.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "CLI invoked by analytics-hook-log-utils.mjs to append hook events to a local JSONL log; not a routing/policy source."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\build-routing-catalog.mjs",
      "kind": "source",
      "generator": null,
      "purpose": "Generator: reads every skills/<name>/SKILL.md and produces scripts/hooks/routing-catalog.json (keywords, anti-patterns, composites, intents)."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\generate-codex-hooks.js",
      "kind": "source",
      "generator": null,
      "purpose": "Generator: builds a Codex hooks.json fragment/report from the HOOKS array in scripts/hooks-generator-lib.js; read-only w.r.t. the user's actual ~/.codex/config.toml (manual merge step required)."
    },
    {
      "path": "S:\\mcp-servers\\scripts\\hooks-generator-lib.js",
      "kind": "source",
      "generator": null,
      "purpose": "Not in the literal scope list but load-bearing dependency of generate-codex-hooks.js: defines the canonical HOOKS array (event, matcher, script, timeout) wiring every sophia-*.mjs hook, plus per-target command builders for Codex/Claude/Cursor/Antigravity."
    }
  ],
  "rules": [
    {
      "rule": "Hotword contract: leading !quick strips heavy context (contextMode=light) unless a repository task overrides it; leading !agents is binding orchestration (subagentMode=required), mandating the main agent delegate at least one bounded subtask; natural-language delegation requests remain discretionary (subagentMode=requested).",
      "owner_level": "global rules (prose) + hook (executable)",
      "defined_in": [
        { "path": "S:\\mcp-servers\\AGENTS.md", "lines": "55-61" },
        { "path": "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md", "lines": "11-14" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\prompt-routing-options.mjs", "lines": "1,28-77" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "832-850" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\AGENTS.md:55-61",
        "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md:11-14"
      ]
    },
    {
      "rule": "ProjectFS-first: prefer projectfs-mcp-server (read_file/read_many/list_dir/grep_files/stat) over direct shell for supported read-only filesystem operations, inside and outside the workspace; fall back to shell only when unsupported, and state the limitation.",
      "owner_level": "global rules (prose, 3 files) + hook guardrail (2 independent code paths)",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\AGENTS.md", "lines": "3,7" },
        { "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md", "lines": "24-25" },
        { "path": "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md", "lines": "3" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-projectfs.mjs", "lines": "91-124,146-150" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "282-285,314-338,821-824" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\shared-agent-rules\\AGENTS.md:3,7",
        "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:24-25",
        "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md:3"
      ]
    },
    {
      "rule": "Git MCP preference: use git-mcp-server tools (git_query/git_diff) before raw git shell commands for status/diff/log/blame/show; shell only for unsupported operations.",
      "owner_level": "global rules (prose) + hook (4 hardcoded hint variants)",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md", "lines": "28" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "309-313,786-805" }
      ],
      "duplicated_in": []
    },
    {
      "rule": "SQL MCP guardrail: schema-inspection first, no SELECT *, parameterize/bind, explain plans for complex queries, read-only unless explicit write-capable intent.",
      "owner_level": "global rules (prose) + PreToolUse hook message",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md", "lines": "12,30" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-sql.mjs", "lines": "61-66" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:12,30"
      ]
    },
    {
      "rule": "ColdFusion cf_bridge.evaluate is for passive, small runtime probes only — no cfhttp, file writes, DB mutations, or broad execution.",
      "owner_level": "technology appendix (prose) + PreToolUse hook message (near-verbatim)",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\COLDFUSION.md", "lines": "19-21" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-coldfusion.mjs", "lines": "61-66" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\shared-agent-rules\\COLDFUSION.md:19-21"
      ]
    },
    {
      "rule": "Memory write discipline: search before writing, include source_type/source_ref, never persist secrets/large payloads, persist only reusable high-value facts; memory is context not authority.",
      "owner_level": "global rules (dedicated section) + PreToolUse hook message",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md", "lines": "57-70" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-memory.mjs", "lines": "61-66" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:57-70"
      ]
    },
    {
      "rule": "Skill routing map: which MCP skill owns which domain (mcp-technical-analyst, mcp-master-orchestrator, mcp-coldfusion-developer, mcp-sophia-yii-developer, mcp-docs-navigator, mcp-memory-operator, mcp-database-expert, mcp-office-expert, mcp-git-mantis-workflow, mcp-mantis-ticket-writer, svg, etc.).",
      "owner_level": "global rules (prose, 2 files) + generated catalog + hand-curated hook keyword/hint tables",
      "defined_in": [
        { "path": "S:\\mcp-servers\\AGENTS.md", "lines": "26-29" },
        { "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md", "lines": "36-55" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\routing-catalog.json", "lines": "whole file (skills[].triggers, composites, intents)" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "249-267 (DOMAIN_KEYWORDS), 289-306 (SKILL_HINTS)" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\AGENTS.md:26-29",
        "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:36-55"
      ]
    },
    {
      "rule": "Token/output discipline: terse technical mode, cause->fix->verify default shape, no large log/JSON/diff dumps, prefer paths/artifacts.",
      "owner_level": "dedicated global-rules file + overlapping section in another global-rules file + hook guardrail keyword trigger",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\TOKEN_DISCIPLINE.md", "lines": "1-64" },
        { "path": "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md", "lines": "103-115" },
        { "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "270-275" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\shared-agent-rules\\TOKEN_DISCIPLINE.md:1-64",
        "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:103-115"
      ]
    },
    {
      "rule": "Sub-agent role catalog (explorer/implementer/technical_analyst/code_reviewer/test_writer): one-line role + output-contract descriptions vs full runtime mission/prioritize/avoid/output/escalate specs.",
      "owner_level": "delegation-policy prose (1 line per role) + canonical YAML + generated per-client runtime specs",
      "defined_in": [
        { "path": "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md", "lines": "16-21" },
        { "path": "S:\\mcp-servers\\.codex\\agents\\explorer.toml", "lines": "1-37" },
        { "path": "S:\\mcp-servers\\.codex\\agents\\implementer.toml", "lines": "1-33" },
        { "path": "S:\\mcp-servers\\.codex\\agents\\code_reviewer.toml", "lines": "1-34" },
        { "path": "S:\\mcp-servers\\.codex\\agents\\technical_analyst.toml", "lines": "1-34" },
        { "path": "S:\\mcp-servers\\.codex\\agents\\test_writer.toml", "lines": "1-38" }
      ],
      "duplicated_in": [
        "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md:16-21 (role names + terse output contract vs the fuller generated mission/output/escalate text in each .toml)"
      ]
    }
  ],
  "routing_flow_master": {
    "entrypoint": "UserPromptSubmit hook: scripts/hooks/sophia-user-prompt-submit.mjs, registered in the HOOKS array of S:\\mcp-servers\\scripts\\hooks-generator-lib.js (event 'UserPromptSubmit', script 'sophia-user-prompt-submit.mjs') and wired into a per-client command by commandFor()/generate-codex-hooks.js (S:\\mcp-servers\\scripts\\generate-codex-hooks.js:87-105) for Codex, with adapter variants for Antigravity (sophia-antigravity-adapter.mjs) and Cursor (sophia-cursor-adapter.mjs).",
    "steps": [
      { "step": "Read stdin JSON payload and extract prompt text from known fields (prompt/userPrompt/input/message/content/text/messages).", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "60-70 (readStdin), 74-92 (collectStrings), 952-966 (main)" },
      { "step": "Parse leading hotwords (!quick/!agents) and detect repository-task / explicit-subagent-request signals to compute contextMode and subagentMode; strip hotwords from routing text.", "path": "S:\\mcp-servers\\scripts\\hooks\\prompt-routing-options.mjs", "lines": "16-77" },
      { "step": "Load and validate the compiled routing catalog (skills/composites/intents) from routing-catalog.json, falling back to an empty catalog on missing/invalid JSON or schema.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "38-56" },
      { "step": "Detect repo context (activeRoot) from payload fields or absolute paths mentioned in the prompt, then scan for ColdFusion/Yii filesystem markers.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "94-239, 979-990" },
      { "step": "Score candidate skills: curated DOMAIN_KEYWORDS (+3), catalog-extracted keywords (+1) and promptPatterns (+5), repo-context file boosts (+4), implicit docs/memory signal boosts (+2), then apply anti-pattern suppression/deprioritization.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "620-703 (scoreSkills), 583-606 (applyAntiPatterns)" },
      { "step": "Detect composite multi-step workflow matches and non-skill guardrail categories (token/subagents/projectfs) from the catalog and keyword lists.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "709-734 (matchComposite), 269-286,739-753 (matchGuardrails)" },
      { "step": "Rank skills via catalog intents (priority-ordered, e.g. cfml-cross-version=300, legacy-modernization-end-to-end=200, legacy-analysis-only=100): apply intent boosts/locks, skill-level and intent-level suppressions, anti-pattern exclusions, then filter by score >= threshold(3) and sort.", "path": "S:\\mcp-servers\\scripts\\hooks\\routing-engine.mjs", "lines": "168-240 (routePrompt)" },
      { "step": "Build up to 2 hint strings from the ranked skills (contextual docs/memory hint builders, curated SKILL_HINTS, or a generic fallback hint), then append composite/guardrail hints to fill remaining slots.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "867-948 (buildHints)" },
      { "step": "Finalize hint order/content: reserve a slot for Git MCP guidance when git/commit is mentioned, reserve a slot for ProjectFS guidance on a high-confidence filesystem signal, or override both when a locally linked SKILL.md is referenced in the prompt.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "786-824 (finalizeGitHints, finalizeHints)" },
      { "step": "Build separate routing-control hints reflecting contextMode/subagentMode (light context / required or requested subagent delegation), merge with the top routing hints (max 2 total), log a best-effort analytics event, and emit the final hookSpecificOutput.additionalContext JSON to stdout.", "path": "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs", "lines": "832-850 (buildRoutingControlHints), 992-1011 (main output)" }
    ]
  },
  "duplications": [
    {
      "topic": "Hotword contract (!quick/!agents)",
      "locations": ["S:\\mcp-servers\\AGENTS.md:55-61", "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md:11-14"]
    },
    {
      "topic": "ProjectFS-first rule",
      "locations": ["S:\\mcp-servers\\shared-agent-rules\\AGENTS.md:3,7", "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:24-25", "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md:3"]
    },
    {
      "topic": "SQL guardrail (no SELECT *, parameterize, read-only)",
      "locations": ["S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:12,30", "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-sql.mjs:61-66"]
    },
    {
      "topic": "cf_bridge.evaluate passive-only guardrail",
      "locations": ["S:\\mcp-servers\\shared-agent-rules\\COLDFUSION.md:19-21", "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-coldfusion.mjs:61-66"]
    },
    {
      "topic": "Memory write discipline",
      "locations": ["S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:57-70", "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-memory.mjs:61-66"]
    },
    {
      "topic": "Skill routing map (domain -> skill)",
      "locations": ["S:\\mcp-servers\\AGENTS.md:26-29", "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:36-55", "S:\\mcp-servers\\scripts\\hooks\\routing-catalog.json", "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs:249-267,289-306"]
    },
    {
      "topic": "Token/output discipline",
      "locations": ["S:\\mcp-servers\\shared-agent-rules\\TOKEN_DISCIPLINE.md:1-64", "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md:103-115"]
    },
    {
      "topic": "Sub-agent role definitions (name/description/behavior)",
      "locations": ["S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md:16-21", "S:\\mcp-servers\\.codex\\agents\\*.toml", "S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml (referenced, not read in this audit)"]
    }
  ],
  "multi_owner_policies": [
    {
      "policy": "Hotword/subagent orchestration semantics",
      "owners": [
        "S:\\mcp-servers\\AGENTS.md (governance prose, root repo)",
        "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md (governance prose, portable)",
        "S:\\mcp-servers\\scripts\\hooks\\prompt-routing-options.mjs (executable parser)",
        "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs (executable hint emission)"
      ],
      "note": "Prose in two AGENTS/SUBAGENTS files describes the same contract independently of the code that actually enforces/reflects it at runtime; no cross-reference from the code comments back to AGENTS.md/SUBAGENTS.md line numbers was found."
    },
    {
      "policy": "ProjectFS-first guardrail wording",
      "owners": [
        "S:\\mcp-servers\\shared-agent-rules\\AGENTS.md",
        "S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md",
        "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md",
        "S:\\mcp-servers\\scripts\\hooks\\sophia-pretool-projectfs.mjs (own hint text)",
        "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs (separate PROJECTFS_HINT constant, different wording)"
      ],
      "note": "Two independent hook-level hint strings exist for the same rule (pretool classifier vs prompt-submit guardrail), worded differently from each other and from the three markdown sources."
    },
    {
      "policy": "Skill-to-domain routing keywords/triggers",
      "owners": [
        "S:\\mcp-servers\\AGENTS.md / S:\\mcp-servers\\shared-agent-rules\\GLOBAL.md (prose skill maps)",
        "skills/<name>/SKILL.md frontmatter (upstream source for the generated catalog; outside this audit's scope path)",
        "S:\\mcp-servers\\scripts\\hooks\\routing-catalog.json (generated from SKILL.md)",
        "S:\\mcp-servers\\scripts\\hooks\\sophia-user-prompt-submit.mjs DOMAIN_KEYWORDS/SKILL_HINTS (hand-curated overlay, independently maintained)"
      ],
      "note": "Four layers can each drift from one another: prose maps, SKILL.md frontmatter, the generated catalog, and the hand-curated keyword/hint tables in the hook script."
    },
    {
      "policy": "Sub-agent role specification (name, description, behavior)",
      "owners": [
        "S:\\mcp-servers\\shared-agent-rules\\SUBAGENTS.md (short role list)",
        "S:\\mcp-servers\\docs\\agents\\canonical-subagents.yaml (declared canonical source, not read in this audit)",
        "S:\\mcp-servers\\.codex\\agents\\*.toml (generated, checked into git despite being derived)"
      ],
      "note": ".codex/agents/*.toml are tracked in git (not gitignored) even though S:\\mcp-servers\\.codex\\agents\\README.md:13,51-52 states they are derived and should not be hand-edited; SUBAGENTS.md's shorter role text is a separate, manually maintained restatement of the same roles."
    }
  ],
  "uncertainties": [
    "docs/agents/canonical-subagents.yaml (declared canonical source for .codex/agents/*.toml per .codex/agents/README.md:5-9) was not read in this audit; its content relative to shared-agent-rules/SUBAGENTS.md was not diff-checked.",
    "routing-catalog.json has generatedAt=2026-07-16T09:33:51.797Z while several scripts/hooks/*.mjs files show a lug 19 (Jul 19) modification date; whether the catalog is current relative to skills/*/SKILL.md content at HEAD was not verified (would require running npm run test:routing:catalog and diffing).",
    "Whether S:\\mcp-servers\\codex-hooks.generated.json (or the per-user ~/.codex/hooks.json it feeds) is actually the live wiring consulted by an installed Codex client was not verified; generate-codex-hooks.js is explicitly read-only/manual-merge by design (scripts/generate-codex-hooks.js:82-83,108-109), so live activation state is outside this repo's filesystem.",
    "shared-agent-rules/legacy-sync/README.md was not read in full; only the .xml template's header was inspected.",
    "No config/hook/rule files (beyond SKILL.md, references/*.md, evals.json) were found anywhere under .agents/ other than .agents/skills/mcp-runtime-integrator/; unclear whether additional .agents subfolders are expected elsewhere in the intended architecture."
  ],
  "recommended_followups": [
    "Diff scripts/hooks/routing-catalog.json against a freshly regenerated catalog (npm run test:routing:catalog) to confirm no drift from current skills/*/SKILL.md.",
    "Reconcile wording between shared-agent-rules/*.md guardrail prose (SQL, ColdFusion, Memory, ProjectFS) and the corresponding hardcoded hint/message strings in scripts/hooks/sophia-pretool-*.mjs and sophia-user-prompt-submit.mjs so a future edit to one side does not silently diverge from the other.",
    "Clarify single ownership for skill-routing keyword/trigger data: decide whether DOMAIN_KEYWORDS/SKILL_HINTS in sophia-user-prompt-submit.mjs should be sourced from routing-catalog.json (or SKILL.md frontmatter) instead of being maintained as a separate hand-curated table.",
    "Confirm docs/agents/canonical-subagents.yaml is the single source of truth for both .codex/agents/*.toml and the role summaries in shared-agent-rules/SUBAGENTS.md, or document why SUBAGENTS.md intentionally keeps an independent, shorter restatement."
  ]
}
