Skip to content

feat(OMN-9743): add HookActivationResolver — package-driven hook bitmask - #1536

Merged
jonahgabriel merged 2 commits into
mainfrom
jonah/omn-9743-hook-activation-resolver
May 8, 2026
Merged

jonahgabriel merged 2 commits into
mainfrom
jonah/omn-9743-hook-activation-resolver

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented May 8, 2026 •

Copy link
Copy Markdown
Collaborator

Evidence

Evidence-Source: OCC#818
Evidence-Ticket: OMN-9743

Summary

Implements HookActivationResolver in omnibase_infra/hooks/ — Track 1 Task 4 of the omniclaude restructure plan (parent epic OMN-9737).

  • Creates src/omnibase_infra/hooks/hook_activation_resolver.py — resolves a list[ModelHookActivation] from omnibase_core into a composite bitmask, setting bits only for enabled_by_default=True activations
  • Lenient rollout-safety policy: unresolvable activations log a warning and are skipped (never crash the runtime)
  • Ships 4 unit tests: mixed enabled/disabled, empty list, all enabled, all disabled

Context

Depends on ModelHookActivation (omnibase_core, already present) and ModelPackageHookActivations (omnibase_core PR: feat(OMN-9743): add ModelPackageHookActivations). This resolver is the compositing engine that turns per-package hook_activations.yaml declarations into the ONEX_HOOKS_MASK bitmask used by EnumHookBit.hook_enabled().

The broad Exception catch uses # noqa: BLE001 per plan spec: lenient rollout-safety policy means partial mask (skipping bad entries) is safer than crashing runtime on malformed activation declarations.

Test plan

  • uv run pytest tests/unit/hooks/test_hook_activation_resolver.py -v — 4 passed
  • uv run mypy src/omnibase_infra/hooks/hook_activation_resolver.py --strict — no issues
  • pre-commit run --all-files — all hooks passed
  • HookActivationResolver([ModelHookActivation(hook_bit=CI_REMINDER, enabled_by_default=True)]).compute_mask() returns mask with CI_REMINDER bit set
  • enabled_by_default=False activations do NOT set bits
  • Empty activations list returns 0

Implements HookActivationResolver in omnibase_infra/hooks/ that accepts a
list[ModelHookActivation] and computes a composite bitmask from all
enabled_by_default activations. Lenient rollout-safety policy: unresolvable
activations log a warning and are skipped rather than crashing runtime.
Track 1 Task 4 of omniclaude restructure plan (parent OMN-9737).
@coderabbitai

coderabbitai Bot commented May 8, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jonahgabriel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 793e517c-15a9-4854-91f9-b18072a2db4f

📥 Commits

Reviewing files that changed from the base of the PR and between af2124b and 277caa6.

📒 Files selected for processing (5)
  • src/omnibase_infra/hooks/__init__.py
  • src/omnibase_infra/hooks/hook_activation_resolver.py
  • tests/integration/test_hook_activation_resolver_integration.py
  • tests/unit/hooks/__init__.py
  • tests/unit/hooks/test_hook_activation_resolver.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-9743-hook-activation-resolver

Comment @coderabbitai help to get the list of available commands and usage tips.

@jonahgabriel
jonahgabriel merged commit 34c4bfe into main May 8, 2026
60 of 61 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-9743-hook-activation-resolver branch May 8, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant