Skip to content

chore(pre-commit): add yamlfmt hook [OMN-4862] - #39

Merged
jonahgabriel merged 1 commit into
mainfrom
jonahgabriel/omn-4862-t6-e-add-yamlfmt-hook
Mar 13, 2026
Merged

jonahgabriel merged 1 commit into
mainfrom
jonahgabriel/omn-4862-t6-e-add-yamlfmt-hook

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add yamlfmt pre-commit hook (v0.21.0) with ecosystem-standard .yamlfmt config
  • Auto-formatted existing YAML files (contracts/, drift/) to match canonical style
  • Excludes .github/ and templates/ directories from yamlfmt

Test plan

  • pre-commit run yamlfmt --all-files exits 0
  • pre-commit run --all-files exits 0

Part of Epic 6: Pre-commit Hook Parity (OMN-4833)

Summary by CodeRabbit

  • Chores
    • Enabled automated YAML formatting to ensure consistency across configuration files
    • Standardized contract documentation with structured metadata fields
    • Updated drift tracking documentation with consistent formatting standards

Add yamlfmt pre-commit hook (v0.21.0) with ecosystem-standard .yamlfmt
config. Auto-formatted existing YAML files (contracts/, drift/) to match
the canonical style. Excludes .github/ and templates/ directories.
@jonahgabriel
jonahgabriel enabled auto-merge (squash) March 13, 2026 01:10
@coderabbitai

coderabbitai Bot commented Mar 13, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 06b178c2-8a02-489f-bcf5-f55d4fb2d734

📥 Commits

Reviewing files that changed from the base of the PR and between d0604f5 and 2ac9f28.

📒 Files selected for processing (14)
  • .pre-commit-config.yaml
  • .yamlfmt
  • contracts/OMN-3940.yaml
  • contracts/OMN-3943.yaml
  • contracts/OMN-3944.yaml
  • contracts/OMN-3946.yaml
  • contracts/OMN-3947.yaml
  • drift/day_close/2025-12-19.yaml
  • drift/day_close/2025-12-20.yaml
  • drift/day_close/2025-12-21.yaml
  • drift/day_close/2025-12-22.yaml
  • drift/day_close/2025-12-23.yaml
  • drift/day_close/2025-12-24.yaml
  • drift/day_close/2025-12-25.yaml

📝 Walkthrough

Walkthrough

The pull request introduces yamlfmt configuration for YAML formatting, adds schema_version and ticket_id metadata to contract files, appends schema_version and date headers to drift tracking files, and applies line-wrapping formatting adjustments across multiple YAML documents for consistency.

Changes

Cohort / File(s) Summary
Configuration & Tooling
.pre-commit-config.yaml, .yamlfmt
Added yamlfmt pre-commit hook with configuration for YAML formatting (max line length 100, indent 2, document start marker enabled). Minor formatting adjustments to existing hooks.
Contract Metadata Updates
contracts/OMN-3940.yaml, contracts/OMN-3943.yaml
Added schema_version and ticket_id metadata fields. OMN-3940 updated interfaces_touched section and added emergency_bypass follow_up_ticket_id. OMN-3943 added evidence_requirements for unit test suite. Both include line-wrapping formatting adjustments.
Contract Formatting
contracts/OMN-3944.yaml, contracts/OMN-3946.yaml, contracts/OMN-3947.yaml
Line-wrapping and indentation adjustments to multi-line YAML strings in evidence_requirements and command fields. No semantic content changes.
Drift Tracking Headers
drift/day_close/2025-12-19.yaml, drift/day_close/2025-12-20.yaml, drift/day_close/2025-12-21.yaml, drift/day_close/2025-12-22.yaml, drift/day_close/2025-12-23.yaml, drift/day_close/2025-12-24.yaml
Added YAML document start markers and schema_version/date metadata headers. 2025-12-20 and later include full header blocks. 2025-12-19 applies line-wrapping formatting only.
Drift Tracking Formatting
drift/day_close/2025-12-25.yaml
Line-wrapping adjustments to multi-line notes strings in actual_by_repo entries. No semantic content changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 With whiskers twitching, I format with care,
Yamlfmt configs fill the air!
Metadata headers, line-breaks so neat,
Schema versions make the YAML complete. ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jonahgabriel/omn-4862-t6-e-add-yamlfmt-hook
📝 Coding Plan
  • Generate coding plan for human review comments

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

@jonahgabriel
jonahgabriel merged commit 5cf8742 into main Mar 13, 2026
6 of 7 checks passed
@jonahgabriel
jonahgabriel deleted the jonahgabriel/omn-4862-t6-e-add-yamlfmt-hook branch April 4, 2026 02:17
jonahgabriel added a commit that referenced this pull request Apr 11, 2026
Module 'onex_change_control.overseer' was imported with both 'import X as pkg'
and 'from X import Y' in two separate test methods of TestCRFinding6. Consolidate
both methods to use 'import onex_change_control.overseer as pkg' so CodeQL alert
#39 (py/mixed-import-style) is resolved.
jonahgabriel added a commit that referenced this pull request Apr 11, 2026
…r wire types from omnibase_compat (#157)

* feat(OMN-8431): add onex_change_control/overseer — migrate 28 files from omnibase_compat

Moves the entire overseer wire-type module (14 enums + 12 models + __init__)
from omnibase_compat to its canonical home in onex_change_control. All internal
imports rewritten from omnibase_compat.overseer.* to onex_change_control.overseer.*.

Additive only — no consumer imports changed yet (PR2/omnimarket follows).
968 existing tests pass; 14 new overseer module-presence tests added TDD-first.

* fix(OMN-8431): restore runtime imports in overseer models — fix Pydantic forward-ref errors

Ruff TC003/TC001 auto-fixes incorrectly moved datetime and ModelDispatchItem
into TYPE_CHECKING blocks. Pydantic cannot resolve forward references at
runtime without these imports at module level. Reverted with noqa suppressions.

Also relaxes omnibase-core==0.36.0 pin to >=0.36.0 to allow omnimarket
(which requires 0.39.0) to resolve the dep tree successfully.

* test(OMN-8431): reproduce CR findings #1-#7 from PR #157

12 failing tests covering:
- CR#1 (Critical): ModelTaskDeltaEnvelope Pydantic runtime failure (TYPE_CHECKING)
- CR#2 (Critical): ModelVerifierOutput Pydantic schema failure (TYPE_CHECKING)
- CR#3 (Major): ModelOvernightContract halt threshold hardcoded to 5.0
- CR#4 (Major): ModelSessionContract phases accepts empty tuple
- CR#5 (Major): ModelTaskStateEnvelope task_id auto-generated
- CR#6 (Minor): ModelContextBundle missing from overseer __init__ exports
- CR#7 (Minor): load_worker_contract rejects Mapping subclasses

* fix(OMN-8431): address CR findings #1-#7 from PR #157

CR#1 (Critical): move Mapping+EnumTaskStatus out of TYPE_CHECKING in
model_task_delta_envelope — Pydantic cannot resolve TYPE_CHECKING-only
imports at runtime with `from __future__ import annotations`.

CR#2 (Critical): move EnumFailureClass out of TYPE_CHECKING in
model_verifier_output — same Pydantic get_type_hints() failure pattern
affecting ModelVerifierCheckResult and ModelVerifierOutput.

CR#3 (Major): derive default halt_conditions cost threshold from
max_cost_usd via model_validator in ModelOvernightContract instead of
hardcoding 5.0.

CR#4 (Major): make phases required with Field(..., min_length=1) in
ModelSessionContract — matches documented invariant "No default".

CR#5 (Major): remove uuid4 default_factory from task_id in
ModelTaskStateEnvelope — callers must supply explicit task identity
to prevent orphan envelopes.

CR#6 (Minor): add ModelContextBundle to overseer/__init__.py import
and __all__ — the union type alias was defined but not re-exported.

CR#7 (Minor): change load_worker_contract to accept Mapping[str, Any]
and isinstance(data, Mapping) — dict-only check rejected valid
read-only mappings.

* fix(OMN-8431): add type: ignore to intentional missing-arg test calls

mypy pre-push hook flags the two test calls that intentionally omit
required fields (phases and task_id) to verify Pydantic raises
ValidationError. These are correct test patterns — suppress mypy with
type: ignore[call-arg].

* fix(overseer): deduplicate import pattern to satisfy CodeQL (OMN-8431)

Module 'onex_change_control.overseer' was imported with both 'import X as pkg'
and 'from X import Y' in two separate test methods of TestCRFinding6. Consolidate
both methods to use 'import onex_change_control.overseer as pkg' so CodeQL alert
#39 (py/mixed-import-style) is resolved.

* ci(auto-merge): fix workflow — add --repo flag to gh pr merge (OMN-8431)

The Enable Auto-Merge workflow ran without a checkout step, causing
'gh pr merge --auto --squash' to fail with 'not a git repository'. Adding
--repo to the gh pr merge call allows the command to run without a local
git context.

* fix(overseer): enforce conditional field invariants in ModelOvernightHaltCondition (OMN-8431)

CR#8 (Major): ModelOvernightHaltCondition documented field dependencies
(skill/pr/threshold_minutes/outcome) were unenforced. Add model_validator
to raise ValueError when on_halt='dispatch_skill' without skill, or
check_type='pr_blocked_too_long' without pr+threshold_minutes, or
check_type='required_outcome_missing' without outcome. Add regression tests
in TestCRFinding8MajorOvernightHaltConditionConditionalFields.
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