{
 "schemaVersion": "python-hwpx.known-leak-migration/v1",
 "status": "contract",
 "note": "The contract for moving the known-leak groups of tests/data/layer_leak_allowlist.json to python-hwpx-automation. Two of the four groups (official-reference-policy, report-heading-guess) moved with the whole conversion and guessing move and are listed under moved; the two groups left here follow the owner's compatibility option A: every affected core name keeps working through 6.x, warns in the next major and is removed in the major after it. Releases are named only relative to each other; no version number or date is promised here.",
 "groups": [
  {
   "id": "document-plan-input",
   "title": "Automation document-plan interpretation",
   "allowlist": [
    {
     "file": "tools/doc_diff.py",
     "qualname": "_paragraphs_from_document_plan"
    }
   ],
   "undetected": [],
   "canonicalOwner": "hwpx_automation.office.document_ops",
   "coreKeeps": [
    "doc_diff and the reference check accept documents, paths, text, paragraph sequences and {\"paragraphs\"}/{\"text\"} mappings"
   ],
   "publicReplacement": [
    "an automation function that turns a document plan (sections/blocks/children, heading/paragraph/table rows) into the paragraph sequence core takes",
    "automation comparison and reference-check entry points call it before handing paragraphs to core"
   ],
   "coreSurfaceAffected": [
    "the {\"sections\": ...} input branch of hwpx.doc_diff and hwpx.inspect_reference_consistency (stable names; the branch is behaviour, not a name)"
   ],
   "automationConsumers": [
    "hwpx_automation.handlers.quality_render.inspect_reference_consistency (document_plan argument)",
    "hwpx_automation.office.document_ops.comparison"
   ]
  },
  {
   "id": "evalplan-caption-cleanup",
   "title": "Evaluation-plan caption cleanup",
   "allowlist": [],
   "undetected": [
    {
     "file": "table_patch.py",
     "qualname": "strip_trailing_table_captions"
    }
   ],
   "canonicalOwner": "hwpx_automation.office.evalplan",
   "coreKeeps": [
    "a byte-preserving primitive that removes text a caller selects from the trailing run of a table's wrapper paragraph, never crossing a paragraph or table boundary, through the same open-safety finalize path"
   ],
   "publicReplacement": [
    "the '(N) short word' selection rule as an automation predicate passed to that primitive from office.evalplan"
   ],
   "coreSurfaceAffected": [
    "hwpx.table_patch.strip_trailing_table_captions"
   ],
   "automationConsumers": [
    "hwpx_automation.office.evalplan.runtime"
   ]
  }
 ],
 "moved": [
  {
   "id": "official-reference-policy",
   "title": "Official-document reference rules",
   "canonicalOwner": "hwpx_automation.office.compliance",
   "movedWith": "the conversion and guessing move to python-hwpx-automation: the owner moved the whole feature in this major, so the core names were removed without the DeprecationWarning step",
   "removedCoreSurface": [
    "hwpx.inspect_reference_consistency (stable)",
    "hwpx.tools.doc_diff.inspect_reference_consistency",
    "hwpx.REFERENCE_CONSISTENCY_REPORT_VERSION (stable)"
   ],
   "replacement": [
    "hwpx_automation.office.compliance.inspect_reference_consistency(source) -> reference-consistency-v1 report, same schema",
    "MCP tool inspect_reference_consistency, routed to the automation owner"
   ]
  },
  {
   "id": "report-heading-guess",
   "title": "Report heading guessing in Markdown export",
   "canonicalOwner": "hwpx_automation.markdown",
   "movedWith": "the conversion and guessing move to python-hwpx-automation: the owner moved the whole feature in this major, so the core names were removed without the DeprecationWarning step",
   "removedCoreSurface": [
    "hwpx.tools.markdown_export.export_markdown(detect_headings=True) default",
    "HwpxMarkdownConverter where it reaches the same detector"
   ],
   "replacement": [
    "hwpx_automation.markdown.to_markdown(doc, rich=True) with the same detect_headings default and heading_detector hook",
    "the ingest converter in hwpx_automation.ingest"
   ]
  }
 ],
 "sequence": [
  "1. Automation adds each replacement owner and switches its consumers; core is unchanged and still answers old callers.",
  "2. Core adds the genre-neutral primitives (heading-detector hook, caller-selected trailing-text removal) in a minor release; the old names delegate to them with today's rule.",
  "3. In the next major, every affected core name and behaviour emits a DeprecationWarning that names its automation replacement (compatibility.schedule).",
  "4. In the major after it, the release that removes a core name also removes its allowlist/undetected entries and this group; the layer leak guard then fails if the pattern comes back."
 ],
 "compatibility": {
  "decision": "A",
  "decidedBy": "owner",
  "schedule": {
   "6.x": "Every affected core name and behaviour keeps working without a warning. Automation replacements ship and the neutral core primitives may be added in minors; the old names delegate to them with today's rule.",
   "nextMajor": "Every affected core name and behaviour emits a DeprecationWarning naming its automation replacement; output does not change.",
   "majorAfterNext": "The core names and behaviours are removed with their allowlist/undetected entries; only the neutral primitives stay in core."
  },
  "appliesTo": "every name and behaviour listed under coreSurfaceAffected, stable or module-level",
  "policy": "docs/stable-api.md: a stable name breaks only at a major boundary, after a DeprecationWarning in an earlier major",
  "options": [
   {
    "id": "A",
    "summary": "Keep every core name working through 6.x; warn in the next major; remove in the major after it."
   },
   {
    "id": "B",
    "summary": "Warn from a 6.x minor once the automation replacements ship; remove in the next major. Needs an explicit exception to the stable-name policy for the two stable names."
   },
   {
    "id": "C",
    "summary": "Never remove: freeze the core copies as compatibility code without feature work and keep the allowlist entries."
   }
  ]
 },
 "implementation": {
  "neutralCoreSeams": [
   "hwpx.tools.doc_diff.paragraph_texts",
   "hwpx.table_patch.strip_trailing_table_text"
  ],
  "automationConsumerRouting": "pending",
  "compatibilityPolicies": "retained unchanged during6.x"
 }
}
