{
  "phase_id": "phase-02",
  "category_id": "architecture_engineering_core",
  "doc_id": "ncs",
  "source_path": "/home/yeff/public_html/devon/panel/data/ncs.md",
  "documentation_branch_status": "CUSTOM_BRANCH",
  "bucket_statuses_from_docs_index": {
    "Prerequisites": "ACTIVE",
    "Installation": "ACTIVE",
    "Configuration": "ACTIVE",
    "Validation": "ACTIVE",
    "Observable Evidence": "ACTIVE",
    "Failure Modes & Recovery": "ACTIVE",
    "Completion & Promotion": "ACTIVE"
  },
  "exported_at": "2026-04-28T05:56:48.644291+00:00",
  "export_rule": "docs/json export generated from real panel/data source plus docs/index.php branch evidence; no authored content invented by export patch",
  "source_payload": {
    "source_format": "markdown",
    "raw_markdown": "# NCS — NAMING & CONTRACT SPEC\nversion: v1.0\nstatus: ACTIVE\nparent: master_architecture_index.md\nphase: 02\nphase_name: Architecture & Engineering Canon\ndocument_role: naming_and_contract_standard_for_phase_02\n\n---\n\n## 1. OBJECTIVE\n\nDefine canonical naming rules for Devon architecture, documentation, runtime artifacts, panel data, phases, contracts and operational identifiers.\n\nThis document standardizes:\n- file names\n- document siglas\n- canonical IDs\n- phase labels\n- card IDs\n- section IDs\n- path conventions\n- contract naming patterns\n\n---\n\n## 2. NAMING PRINCIPLE\n\nEvery canonical artifact must be:\n- explicit\n- stable\n- singular in responsibility\n- machine-readable\n- human-readable\n- traceable to phase and role\n\nNo decorative naming allowed.\nNo vague naming allowed.\nNo duplicate purpose naming allowed.\n\n---\n\n## 3. FILE NAMING RULES\n\n### 3.1 Canonical Data Files\nCanonical structured files must use:\n\n`snake_case.json`\n\nExamples:\n- project_scope_canonical.json\n- deployment_order_canonical.json\n- panel_canonical_tree.json\n- server_registry_canonical.json\n\n### 3.2 Canonical Markdown Files\nCanonical textual governance/spec files must use:\n\n`lowercase_sigla.md`\n\nExamples:\n- cgs.md\n- ncs.md\n- acs.md\n- cas.md\n- ris.md\n\n### 3.3 Forbidden Patterns\nForbidden:\n- spaces in file names\n- camelCase file names\n- mixed separators\n- decorative suffixes\n- vague names like:\n  - final_doc.md\n  - new_version.md\n  - temp_file.md\n  - architecture_notes.md\n\n---\n\n## 4. DOCUMENT SIGLA RULES\n\nEvery canonical spec must have:\n- a unique sigla\n- one sigla = one responsibility\n- no sigla reuse\n\nExamples:\n- CGS = Canonical Governance Spec\n- NCS = Naming & Contract Spec\n- ACS = Artifact Canon Spec\n- CAS = Cognitive Architecture Spec\n- RIS = Role Isolation Spec\n- STS = State & Transition Spec\n- OFMS = Operational Flow Master Spec\n- CDMS = Containerization & Deployment Master Spec\n- CSS = Contract & Schema Spec\n- BRPS = Build, Release & Promotion Spec\n\n---\n\n## 5. PATH RULES\n\n### 5.1 Canonical Root\nCanonical architecture reference root:\n\n`/home/yeff/public_html/devon/panel/data/`\n\n### 5.2 Master Reference\nPrimary consultation file:\n\n`/home/yeff/public_html/devon/panel/data/master_architecture_index.md`\n\n### 5.3 Rule\nCanonical docs that govern panel, architecture or execution must live under:\n- panel/data\n\nUnless a higher canon explicitly defines another root.\n\n---\n\n## 6. PHASE NAMING RULES\n\nOfficial phase names:\n\n- Phase 01 — Overview & Scope\n- Phase 02 — Architecture & Engineering Canon\n- Phase 03 — Foundations Security\n- Phase 04 — Performance, Observability & Quality\n- Phase 05 — Architecture\n- Phase 06 — Contracts\n- Phase 07 — Runtime & Infrastructure\n- Phase 08 — Memory & Learning\n- Phase 09 — Operational Flows\n\n### 6.1 Phase ID Format\nUse:\n- `phase: 02`\n- `phase_name: Architecture & Engineering Canon`\n\n### 6.2 Forbidden\nDo not use:\n- informal aliases as authority\n- multiple names for same phase\n- reordered numbering without canon update\n\n---\n\n## 7. DOCUMENT HEADER CONTRACT\n\nEvery canonical md spec must declare:\n\n- title\n- version\n- status\n- parent\n- phase\n- phase_name\n- document_role\n\nExample:\n\n```text\n# CGS — CANONICAL GOVERNANCE SPEC\nversion: v1.0\nstatus: ACTIVE\nparent: master_architecture_index.md\nphase: 02\nphase_name: Architecture & Engineering Canon\ndocument_role: governance_root_for_phase_02\n"
  },
  "transition_status": "ACTIVE_DH_MIRROR",
  "hardening_status": "HARDENING_PARTIAL",
  "engine_grade_final": false,
  "validation_mode": "schema_backed_transition",
  "parser_readiness": "medium",
  "hardening_priority": "extract_structural_fields_from_dh_text",
  "structural_contract": {
    "hardening_status": "HARDENING_PARTIAL",
    "engine_grade_final": false,
    "transition_status": "ACTIVE_DH_MIRROR",
    "doc_id": "ncs",
    "category_id": "architecture_engineering_core",
    "phase_id": "phase-02",
    "hardening_lane": "dh_text_to_structural_contract",
    "patch_type": "extract_structural_fields",
    "created_at": "2026-04-28T15:40:28.147584+00:00",
    "authority": {
      "authority_owner": "ncs.md",
      "canonical_role": "naming authority",
      "authority_scope": "prevents naming drift across documents, contracts, runtime rows, categories, cards and future panel consumers by defining the canonical naming boundary before downstream implementation relies on identifiers",
      "naming_decision_domain": [
        "identifier consistency",
        "category/doc id stability",
        "label/id separation",
        "naming drift prevention",
        "consumer-safe naming"
      ],
      "not_authority_for": [
        "state legality owned by sts.md",
        "schema field law owned by css.md",
        "governance ownership owned by cgs.md"
      ]
    },
    "required_before": [
      "runtime status handling",
      "operator counters",
      "dependency logic",
      "future panel identifier resolution"
    ],
    "hard_dependencies": [
      "css.md",
      "cgs.md"
    ],
    "feeds_operational_ui": [
      "status_badges",
      "state_rendering",
      "evidence_status_reconciliation",
      "future_panel_identifier_reader"
    ],
    "bucket_contracts": {
      "Prerequisites": {
        "contract_role": "prove ncs.md is materially present, phase-bound and dependency-bound before downstream consumers use it",
        "required_structural_fields": [
          "authority_owner",
          "canonical_role",
          "required_before",
          "hard_dependencies",
          "naming_decision_domain"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      },
      "Installation": {
        "contract_role": "make ncs available as a Documentation Hub mirror with fixed technical identity and branch binding",
        "required_structural_fields": [
          "doc_id",
          "category_id",
          "phase_id",
          "documentation_branch_status",
          "source_path",
          "expected_bindings"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      },
      "Configuration": {
        "contract_role": "bind ncs authority scope, dependency boundaries and forbidden ownership classes into parseable structure",
        "required_structural_fields": [
          "authority_scope",
          "not_authority_for",
          "naming_decision_domain",
          "boundary_rules"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      },
      "Validation": {
        "contract_role": "convert ncs into deterministic PASS, FAIL and MISSING checks for identity, binding, source and authority boundary",
        "required_structural_fields": [
          "validation_checks",
          "pass_criteria",
          "fail_criteria",
          "missing_criteria"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      },
      "Observable Evidence": {
        "contract_role": "expose file paths, DH branch binding, source payload shape and mirror path proving ncs is observable",
        "required_structural_fields": [
          "evidence_paths",
          "expected_bindings",
          "observable_checks"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      },
      "Failure Modes & Recovery": {
        "contract_role": "recover missing source, wrong binding, dependency break, authority overreach and false promotion for ncs",
        "required_structural_fields": [
          "failure_modes",
          "recovery_actions",
          "rollback_or_safe_state"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      },
      "Completion & Promotion": {
        "contract_role": "promote ncs only as hardened DH mirror input, not as final engine-grade contract",
        "required_structural_fields": [
          "done_when",
          "not_done_when",
          "promotion_gate",
          "canonization_gate"
        ],
        "validation_mode": "schema_backed_transition",
        "parser_readiness": "medium"
      }
    },
    "validation_checks": [
      {
        "check_id": "ncs_doc_identity",
        "type": "exact_value",
        "path": "$.doc_id",
        "expected": "ncs",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_category_binding",
        "type": "exact_value",
        "path": "$.category_id",
        "expected": "architecture_engineering_core",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_phase_binding",
        "type": "exact_value",
        "path": "$.phase_id",
        "expected": "phase-02",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_branch_status",
        "type": "exact_value",
        "path": "$.documentation_branch_status",
        "expected": "CUSTOM_BRANCH",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_authority_owner_declared",
        "type": "exact_value",
        "path": "$.structural_contract.authority.authority_owner",
        "expected": "ncs.md",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_not_engine_final",
        "type": "exact_value",
        "path": "$.engine_grade_final",
        "expected": false,
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_source_markdown_present",
        "type": "non_empty_string",
        "path": "$.source_payload.raw_markdown",
        "on_missing": "MISSING",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_depends_on_css_md",
        "type": "array_contains",
        "path": "$.structural_contract.hard_dependencies",
        "expected": "css.md",
        "on_fail": "FAIL"
      },
      {
        "check_id": "ncs_depends_on_cgs_md",
        "type": "array_contains",
        "path": "$.structural_contract.hard_dependencies",
        "expected": "cgs.md",
        "on_fail": "FAIL"
      }
    ],
    "evidence_paths": [
      "/home/yeff/public_html/devon/panel/data/ncs.md",
      "/home/yeff/public_html/devon/docs/index.php",
      "/home/yeff/public_html/devon/panel/data/hub_index.json",
      "/home/yeff/public_html/devon/panel/data/master_architecture_index.md",
      "/home/yeff/public_html/devon/docs/json/phase-02/ncs.json",
      "/home/yeff/public_html/devon/docs/json/phase-02/_phase02_hardening_queue.json"
    ],
    "expected_bindings": [
      {
        "binding": "docs_index_custom_branch",
        "expected": "if (doc.id === \"ncs\" && state.categoryId === \"architecture_engineering_core\")"
      },
      {
        "binding": "hub_index_phase",
        "expected_phase_id": "phase-02"
      },
      {
        "binding": "hub_index_category",
        "expected_category_id": "architecture_engineering_core"
      }
    ],
    "failure_modes": [
      {
        "failure_id": "ncs_source_missing",
        "status": "MISSING",
        "meaning": "ncs source cannot be read from declared source path",
        "recovery_action": "restore /home/yeff/public_html/devon/panel/data/ncs.md or the declared mirror source before hardening can continue"
      },
      {
        "failure_id": "ncs_unbound_from_phase02",
        "status": "FAIL",
        "meaning": "ncs is present but not bound to phase-02 / architecture_engineering_core",
        "recovery_action": "restore hub_index and docs/index binding to the canonical Phase 02 category"
      },
      {
        "failure_id": "ncs_dependency_missing",
        "status": "MISSING",
        "meaning": "ncs cannot prove declared hard dependencies",
        "recovery_action": "restore declared dependencies or block promotion until dependency validation passes"
      },
      {
        "failure_id": "ncs_authority_overreach",
        "status": "FAIL",
        "meaning": "ncs claims authority outside its declared scope",
        "recovery_action": "revoke overreaching authority and route the claim to the owning document or contract"
      },
      {
        "failure_id": "ncs_false_engine_promotion",
        "status": "FAIL",
        "meaning": "ncs is promoted as engine-grade final while still in DH mirror transition",
        "recovery_action": "restore ACTIVE_DH_MIRROR / HARDENING_PARTIAL and require deterministic schema validation before final promotion"
      }
    ],
    "promotion_gates": {
      "done_when": [
        "ncs source exists materially",
        "ncs is registered under Phase 02",
        "ncs has a custom Documentation Hub branch",
        "ncs JSON mirror contains structural_contract",
        "ncs exposes authority, dependencies, evidence paths, validation checks and promotion gates as parseable fields"
      ],
      "not_done_when": [
        "source payload is missing",
        "category binding is wrong",
        "declared dependency is absent",
        "authority scope is overreached",
        "engine_grade_final is set true before deterministic schema validation exists"
      ],
      "promotion_gate": "ncs may move to HARDENING_PARTIAL after structural_contract exists and verifies, but must not become engine_grade_final until all decisive checks are schema-backed and deterministic.",
      "canonization_gate": "ncs remains an ACTIVE_DH_MIRROR until authority, dependency, evidence, failure and promotion checks can be consumed without semantic prose interpretation."
    },
    "parser_readiness_after_patch": "medium",
    "blocked_until_engine_grade_final": [
      "all validation checks resolve from JSON key paths",
      "all required dependencies are machine-checkable",
      "all authority boundaries produce deterministic FAIL when violated",
      "future operational panel can consume the contract without reading source prose"
    ],
    "mirror_type": "markdown_mirror",
    "schema_binding": {
      "required_keys": [
        "source_payload",
        "structural_contract"
      ],
      "source_payload_key_paths": [
        "$.source_payload",
        "$.structural_contract",
        "$.bucket_statuses_from_docs_index"
      ],
      "expected_values": {
        "$.phase_id": "phase-02",
        "$.category_id": "architecture_engineering_core",
        "$.doc_id": "ncs",
        "$.engine_grade_final": false,
        "$.transition_status": "ACTIVE_DH_MIRROR"
      },
      "allowed_statuses": [
        "PASS",
        "FAIL",
        "MISSING",
        "ACTIVE_DH_MIRROR",
        "HARDENING_PARTIAL"
      ],
      "deterministic_fail_modes": [
        "wrong_doc_id",
        "wrong_category_id",
        "wrong_phase_id",
        "missing_source_payload",
        "authority_overreach",
        "false_engine_promotion"
      ],
      "missing_criteria": [
        "source payload absent",
        "declared source file absent",
        "hard dependency absent where required"
      ],
      "schema_backed_validation": true
    },
    "boundary_rules": [
      {
        "rule_id": "id_not_label",
        "meaning": "technical ids must not be replaced by visible labels",
        "fail_state": "FAIL when visible label is used as canonical id"
      },
      {
        "rule_id": "doc_id_stable",
        "meaning": "doc_id must remain stable across DH, JSON mirrors and panel consumers",
        "fail_state": "FAIL when doc_id drift is detected"
      },
      {
        "rule_id": "category_id_stable",
        "meaning": "category_id must remain the technical category binding",
        "fail_state": "FAIL when phase/category lookup uses human label as id"
      }
    ],
    "naming_boundary_rules": [
      {
        "rule_id": "id_not_label",
        "meaning": "technical ids must not be replaced by visible labels",
        "fail_state": "FAIL when visible label is used as canonical id"
      },
      {
        "rule_id": "doc_id_stable",
        "meaning": "doc_id must remain stable across DH, JSON mirrors and panel consumers",
        "fail_state": "FAIL when doc_id drift is detected"
      },
      {
        "rule_id": "category_id_stable",
        "meaning": "category_id must remain the technical category binding",
        "fail_state": "FAIL when phase/category lookup uses human label as id"
      }
    ],
    "source_signal_audit": {
      "raw_markdown_contains_role_terms": true,
      "matched_role_lines_sample": [
        "# NCS — NAMING & CONTRACT SPEC",
        "document_role: naming_and_contract_standard_for_phase_02",
        "Define canonical naming rules for Devon architecture, documentation, runtime artifacts, panel data, phases, contracts and operational identifiers.",
        "- canonical IDs",
        "- contract naming patterns",
        "Every canonical artifact must be:",
        "- traceable to phase and role",
        "### 3.1 Canonical Data Files",
        "Canonical structured files must use:",
        "- project_scope_canonical.json",
        "- deployment_order_canonical.json",
        "- panel_canonical_tree.json",
        "- server_registry_canonical.json",
        "### 3.2 Canonical Markdown Files",
        "Canonical textual governance/spec files must use:",
        "Every canonical spec must have:",
        "- CGS = Canonical Governance Spec",
        "- NCS = Naming & Contract Spec",
        "- RIS = Role Isolation Spec",
        "- STS = State & Transition Spec"
      ],
      "audit_note": "source_signal_audit is evidence support only; structural_contract remains governed by Phase 02 queue, hub binding and canonical master registration"
    }
  }
}
