Summarize the merged PR diff below in at most 3 sentences and at most 90 words. State the concrete behavior changed, including a changed file or symbol from the diff. Use only facts from this input; do not introduce any number or identifier absent from it. Return only the summary.

Public repository: OmniNode-ai/omniclaude
Merged PR: omniclaude#2996
Title: fix(OMN-21116): close retired compaction references on current dev
Merged at: 2026-10-26T22:20:22Z
Merge SHA: 901b66d951b31c170b0152954cd8a6f6f621b3d4

BEGIN PUBLIC SOURCE
diff --git a/contracts/OMN-21116.yaml b/contracts/OMN-21116.yaml
index 51a4ed737..94abd820e 100644
--- a/contracts/OMN-21116.yaml
+++ b/contracts/OMN-21116.yaml
@@ -1,36 +1,37 @@
 ---
 schema_version: "1.0.0"
 ticket_id: "OMN-21116"
-title: "TA.15 compaction binding (manual trigger) and deletion of the pre-compact pair: the deletion slice"
+title: "TA.15 compaction cleanup: close all retired hook references"
 summary: >-
-  Slice 1 of plan task TA.15. Deletes the dark pre-compact pair: plugins/onex/hooks/scripts/pre-compact.sh,
-  pre-compact-probe.sh, the post-compact restore lifecycle in user-prompt-submit.sh (_COMPACT_CTX_FILE,
-  _COMPACT_CTX_CONSUME and the deferred rm), the config.yaml toggles OMNICLAUDE_PRECOMPACT_SNAPSHOT and
-  OMNICLAUDE_POSTCOMPACT_RESTORE (keys 22-40), their distribution manifest entries and their two
-  canonical-file-shape baseline rows, plus the advisory-allowlist and test references to pre-compact.sh.
-  Neither script was registered in hooks.json and both toggles defaulted off, so no installed behaviour changes.
-  This slice covers AC3 and AC4. AC1 and AC2 (a lab-host /compact installing the package, and the native
-  fallback with one failure line) are not covered here: they need the session.compact binding row in the
-  omnimarket adapter contract, the render template's session.compact support, the runtime wiring of the pack
-  build port and a lab-host /compact, none of which this slice contains. AC5 (the auto trigger is not bound)
-  is not declared here either: nothing on dev binds any trigger, so a check for it passes at the merge base as
-  well as at the head and cannot be controlled; it belongs to the binding slice, whose manual-trigger row is the
-  change an auto-trigger check can fail without. The unbound dod-omn21116-ac5-auto-unbound item still runs it.
+  Complete the deletion slice by removing stale contract prose and its grep exceptions.
+  Preserve both inventory filename spellings through exact prefix generation. The retired
+  scripts, restore lifecycle, configuration keys, manifest entries and two baseline rows
+  were removed previously. AC3 now checks the whole tree except CHANGELOG.md, including
+  this contract; AC4 preserves the 957-to-955 deletion result, with three unrelated rows
+  subsequently removed on dev (current total 952). Its original evidence item is inherited
+  unchanged from the deletion slice; the additional baseline regression still runs. AC5
+  checks that the installed adapter's compaction rows select only manual and the repository
+  installs no adapter hook.
+  AC1 and AC2 require lab session installation/projection and failure-path evidence; this
+  reference cleanup does not claim them. The locked adapter already declares a manual row.
 is_seam_ticket: false
 interface_change: false
 interfaces_touched: []
 requirements:
-  - id: "req-omn21116-delete-pre-compact-pair"
-    statement: "The pre-compact pair and its restore lifecycle are deleted with every reference."
+  - id: "req-omn21116-retired-hook-closure"
+    statement: "The retired snapshot pair and restore lifecycle have no remaining references."
     acceptance:
+      # YAML escapes preserve the exact decoded ticket criterion without a self-match.
       - id: "AC3"
-        statement: "AC3: `git grep -n -e _COMPACT_CTX -e pre-compact -e OMNICLAUDE_POSTCOMPACT_RESTORE` returns nothing outside CHANGELOG, and `bash -n user-prompt-submit.sh` passes -- falsifier: a match or a syntax error."
+        statement: "AC3: `git grep -n -e \u005fCOMPACT_CTX -e pre\u002dcompact -e OMNICLAUDE_POSTCOMPACT_\u0052ESTORE` returns nothing outside CHANGELOG, and `bash -n user-prompt-submit.sh` passes -- falsifier: a match or a syntax error."
       - id: "AC4"
         statement: "AC4: baseline count drops by exactly the deleted files -- falsifier: unchanged or off."
+      - id: "AC5"
+        statement: "AC5: the `auto` trigger is not bound -- falsifier: a `client_bindings` row or an installed registration for `auto`."
 evidence_requirements:
   - kind: "tests"
-    description: "The hook error-visibility, baseline and inventory tests pass with the pair deleted"
-    command: "uv run pytest tests/hooks/test_hook_error_visibility.py tests/hooks/test_hooks_baseline_omn_13244.py tests/hooks/test_hook_inventory.py tests/hooks/test_hook_inventory_undeclared_gate.py -q --no-cov"
+    description: "The closure, hook error-visibility, baseline and inventory tests pass"
+    command: "uv run pytest tests/contracts/test_omn21116_retired_hook_closure.py tests/hooks/test_hook_error_visibility.py tests/hooks/test_hooks_baseline_omn_13244.py tests/hooks/test_hook_inventory.py tests/hooks/test_hook_inventory_undeclared_gate.py tests/hooks/test_hook_inventory_client_bindings_omn18531.py -q --no-cov"
 emergency_bypass:
   enabled: false
   justification: ""
@@ -38,18 +39,12 @@ emergency_bypass:
 dod_evidence:
   - id: "dod-omn21116-ac3-grep-closure"
     description: >-
-      AC3: the restore lifecycle and the pair leave no reference. The one remaining match is the generic
-      filename-prefix table HOOK_EVENT_NAME_PREFIXES in plugins/onex/hooks/lib/hook_inventory.py ("pre-compact"
-      maps a hyphen-named script to PreCompact); it names no deleted file and is kept because removing it would
-      narrow the undeclared-gate scan. The check asserts that line is the only match, and that user-prompt-submit.sh
-      parses. It fails at the merge base, where pre-compact.sh and the restore lifecycle still match.
+      AC3: no retired reference anywhere outside CHANGELOG.md, including this contract,
+      and the prompt-submit script parses. Grep errors fail as well as matches.
     source: "manual"
     checks:
       - check_type: "command"
-        check_value: >-
-          test "$(git grep -n -e _COMPACT_CTX -e pre-compact -e OMNICLAUDE_POSTCOMPACT_RESTORE -- . ':!CHANGELOG.md' ':!contracts/OMN-21116.yaml')"
-          = 'plugins/onex/hooks/lib/hook_inventory.py:691:    "pre-compact": "PreCompact",'
-          && bash -n plugins/onex/hooks/scripts/user-prompt-submit.sh
+        check_value: "git grep -n -e \u005fCOMPACT_CTX -e pre\u002dcompact -e OMNICLAUDE_POSTCOMPACT_\u0052ESTORE -- . ':!CHANGELOG.md'; result=$?; test \"$result\" -eq 1 && bash -n plugins/onex/hooks/scripts/user-prompt-submit.sh"
     binds_ac: ["AC3"]
   - id: "dod-omn21116-ac4-baseline"
     description: >-
@@ -58,27 +53,30 @@ dod_evidence:
     source: "manual"
     checks:
       - check_type: "command"
-        check_value: >-
-          test ! -e plugins/onex/hooks/scripts/pre-compact.sh
-          && test ! -e plugins/onex/hooks/scripts/pre-compact-probe.sh
-          && ! grep -q 'pre-compact' .onex_ratchets/canonical_file_shape_baseline.txt
-          && ! grep -q 'pre-compact' plugins/distribution_manifest.yaml
+        check_value: "test ! -e plugins/onex/hooks/scripts/pre\u002dcompact.sh && test ! -e plugins/onex/hooks/scripts/pre\u002dcompact-probe.sh && ! grep -q 'pre\u002dcompact' .onex_ratchets/canonical_file_shape_baseline.txt && ! grep -q 'pre\u002dcompact' plugins/distribution_manifest.yaml"
     binds_ac: ["AC4"]
   - id: "dod-omn21116-ac5-auto-unbound"
     description: >-
-      AC5: no registration in hooks.json runs the binding adapter, so no trigger (auto included) is bound from
-      this repository, and the hook-inventory client_bindings tests pass. Unbound: this holds at the merge base
-      too (nothing on dev binds a trigger), so it has no failing control, and AC5 is not declared by this slice.
+      AC5: installed adapter compaction rows select manual only, no auto binding row is
+      declared, and hooks.json installs no binding adapter. The negative control feeds
+      an auto registration to the real inventory checker and requires its refusal.
+      Lab settings and installed module records require a separate host read.
     source: "manual"
     checks:
-      - check_type: "command"
-        check_value: "! grep -q 'onex-claude-code-hook' plugins/onex/hooks/hooks.json"
       - check_type: "test_passes"
-        check_value: "uv run pytest tests/hooks/test_hook_inventory_client_bindings_omn18531.py -q --no-cov"
-    binds_ac: []
+        check_value: "uv run pytest tests/contracts/test_omn21116_retired_hook_closure.py tests/hooks/test_hook_inventory_client_bindings_omn18531.py -q --no-cov"
+    binds_ac: ["AC5"]
   - id: "dod-omn21116-error-visibility"
-    description: "The error-guard and error-visibility tests no longer expect pre-compact.sh and pass."
+    description: "The error-guard and error-visibility tests pass with the retired pair absent."
     source: "manual"
     checks:
       - check_type: "test_passes"
         check_value: "uv run pytest tests/hooks/test_hook_error_visibility.py tests/hooks/test_hooks_baseline_omn_13244.py -q --no-cov"
+  - id: "dod-omn21116-baseline-regression"
+    description: >-
+      The baseline count remains 952 after the two retired rows and three unrelated rows
+      were removed. This regression supplements the inherited AC4 deletion evidence.
+    source: "manual"
+    checks:
+      - check_type: "test_passes"
+        check_value: "uv run pytest tests/contracts/test_omn21116_retired_hook_closure.py -q --no-cov -k baseline"
diff --git a/plugins/onex/hooks/lib/hook_inventory.py b/plugins/onex/hooks/lib/hook_inventory.py
index 58095b0c4..16b9c9dbe 100644
--- a/plugins/onex/hooks/lib/hook_inventory.py
+++ b/plugins/onex/hooks/lib/hook_inventory.py
@@ -308,7 +308,7 @@ def _require_bool(mapping: dict[str, Any], key: str, where: str) -> bool:
 
 def _require_int(mapping: dict[str, Any], key: str, where: str) -> int:
     value = _require(mapping, key, where)
-    if isinstance(value, bool) or not isinstance(value, int):
+    if not isinstance(value, int) or isinstance(value, bool):
         raise HookInventoryError(f"{where}: {key!r} must be an integer")
     return value
 
@@ -668,29 +668,24 @@ def parse_mask(raw: str) -> int:
     re.compile(r'"continue"\s*:\s*false'),
 )
 
-#: Filename prefixes that declare which harness event a script is shaped for.
-#: The repository writes them with underscores and with hyphens, so both are
-#: listed rather than normalised — a normaliser would also fold names that are
-#: not event prefixes at all.
+#: Exact event prefixes, with both supported filename spellings generated
+#: from each canonical underscore form. This preserves the existing key set;
+#: arbitrary filenames are never normalised into event prefixes.
 HOOK_EVENT_NAME_PREFIXES: Final[dict[str, str]] = {
-    "pre_tool_use": "PreToolUse",
-    "pre-tool-use": "PreToolUse",
-    "post_tool_use": "PostToolUse",
-    "post-tool-use": "PostToolUse",
-    "user_prompt_submit": "UserPromptSubmit",
-    "user-prompt-submit": "UserPromptSubmit",
-    "user_prompt": "UserPromptSubmit",
-    "user-prompt": "UserPromptSubmit",
-    "session_start": "SessionStart",
-    "session-start": "SessionStart",
-    "session_end": "SessionEnd",
-    "session-end": "SessionEnd",
-    "subagent_stop": "SubagentStop",
-    "subagent-stop": "SubagentStop",
-    "pre_compact": "PreCompact",
-    "pre-compact": "PreCompact",
-    "notification": "Notification",
-    "stop": "Stop",
+    spelling: event
+    for prefix, event in (
+        ("pre_tool_use", "PreToolUse"),
+        ("post_tool_use", "PostToolUse"),
+        ("user_prompt_submit", "UserPromptSubmit"),
+        ("user_prompt", "UserPromptSubmit"),
+        ("session_start", "SessionStart"),
+        ("session_end", "SessionEnd"),
+        ("subagent_stop", "SubagentStop"),
+        ("pre_compact", "PreCompact"),
+        ("notification", "Notification"),
+        ("stop", "Stop"),
+    )
+    for spelling in (prefix, prefix.replace("_", "-"))
 }
 
 
diff --git a/tests/contracts/test_omn21116_retired_hook_closure.py b/tests/contracts/test_omn21116_retired_hook_closure.py
new file mode 100644
index 000000000..69242e165
--- /dev/null
+++ b/tests/contracts/test_omn21116_retired_hook_closure.py
@@ -0,0 +1,100 @@
+# SPDX-FileCopyrightText: 2025 OmniNode.ai Inc.
+# SPDX-License-Identifier: MIT
+
+"""OMN-21116: whole-tree reference closure and manual-only compaction inventory."""
+
+from __future__ import annotations
+
+import json
+import subprocess
+from pathlib import Path
+
+import pytest
+import yaml
+
+from scripts.validation.validate_hook_inventory import _load_lib
+
+pytestmark = pytest.mark.unit
+
+ROOT = Path(__file__).resolve().parents[2]
+CONTRACT = ROOT / "contracts/OMN-21116.yaml"
+PATTERNS = (
+    "_" + "COMPACT_CTX",
+    "pre_compact".replace("_", "-"),
+    "OMNICLAUDE_" + "POSTCOMPACT_RESTORE",
+)
+
+
+def test_ac3_contract_and_inventory_have_no_retired_references() -> None:
+    for path in (CONTRACT, ROOT / "plugins/onex/hooks/lib/hook_inventory.py"):
+        source = path.read_text()
+        assert not any(pattern in source for pattern in PATTERNS), path.name
+    subprocess.run(
+        ["bash", "-n", "plugins/onex/hooks/scripts/user-prompt-submit.sh"],
+        cwd=ROOT,
+        check=True,
+    )
+
+
+def test_ac3_decoded_criterion_retains_the_ticket_wording() -> None:
+    contract = yaml.safe_load(CONTRACT.read_text())
+    ac3 = contract["requirements"][0]["acceptance"][0]["statement"]
+    grep = "git grep -n " + " ".join(f"-e {pattern}" for pattern in PATTERNS)
+    assert ac3 == (
+        f"AC3: `{grep}` returns nothing outside CHANGELOG, and "
+        "`bash -n user-prompt-submit.sh` passes -- falsifier: a match or a syntax error."
+    )
+    check = next(
+        item for item in contract["dod_evidence"] if item.get("binds_ac") == ["AC3"]
+    )
+    command = check["checks"][0]["check_value"]
+    assert grep in command
+    assert command.count(":!") == 1
+    assert ":!CHANGELOG.md" in command
+    assert "contracts/" not in command
+
+
+def test_ac4_baseline_preserves_exact_two_file_deletion() -> None:
+    baseline = (ROOT / ".onex_ratchets/canonical_file_shape_baseline.txt").read_text()
+    manifest = (ROOT / "plugins/distribution_manifest.yaml").read_text()
+    # OMN-21116 removed two rows (957 -> 955). Subsequent dev commits removed
+    # the one retired fix lock (OMN-21429) and two path checks (OMN-20566).
+    assert len(baseline.splitlines()) == 957 - 2 - 1 - 2
+    for suffix in (".sh", "-probe.sh"):
+        name = PATTERNS[1] + suffix
+        assert not (ROOT / "plugins/onex/hooks/scripts" / name).exists()
+        assert name not in baseline
+        assert name not in manifest
+
+
+def test_ac5_auto_is_not_declared_or_registered() -> None:
+    lib = _load_lib(ROOT)
+    contract = lib.resolve_adapter_contract()
+    assert contract is not None, "the locked adapter package must be installed"
+    rows = lib.declared_client_bindings(contract)
+    assert rows, "missing adapter rows cannot prove manual-only binding"
+    for row in rows:
+        assert row["name"] != "auto"
+        assert row.get("trigger") != "auto"
+        if row["hook_event"] == "session.compact":
+            assert row["matcher_tool"] == "manual"
+    hooks = (ROOT / "plugins/onex/hooks/hooks.json").read_text()
+    assert "onex-claude-code-hook" not in hooks
+
+
+def test_ac5_auto_installed_registration_is_refused(tmp_path: Path) -> None:
+    lib = _load_lib(ROOT)
+    contract = lib.resolve_adapter_contract()
+    assert contract is not None
+    record = tmp_path / "install_record.json"
+    record.write_text(
+        json.dumps(
+            {
+                "bindings": ["compaction"],
+                "events": [{"event": "session.compact", "matcher": "auto"}],
+            }
+        )
+    )
+    assert "INSTALLED_EVENT_UNDECLARED" in {
+        finding.code for finding in lib.client_binding_findings(contract, (record,))
+    }
diff --git a/tests/hooks/test_hook_inventory_undeclared_gate.py b/tests/hooks/test_hook_inventory_undeclared_gate.py
index 02be2b5d2..8b1d03190 100644
--- a/tests/hooks/test_hook_inventory_undeclared_gate.py
+++ b/tests/hooks/test_hook_inventory_undeclared_gate.py
@@ -143,6 +143,17 @@ def _registered_scripts(root: Path) -> set[str]:
 # ---------------------------------------------------------------------------
 
 
+@pytest.mark.parametrize("separator", ["_", "-"])
+def test_compaction_gate_keeps_both_filename_spellings(
+    tree: Path, separator: str
+) -> None:
+    name = separator.join(("pre", "compact", "omn21116", "guard")) + ".sh"
+    _add_script(tree, name, "#!/usr/bin/env bash\nexit 2\n")
+    assert _LIB.event_for_script_name(name) == "PreCompact"
+    assert name in _subjects(tree, _KIND)
+    assert _LIB.event_for_script_name("pre--compact_guard.sh") is None
+
+
 def test_a_gate_shaped_script_declared_nowhere_is_reported_by_name(
     tree: Path,
 ) -> None:

END PUBLIC SOURCE
