Ship owner Z.ai peak-hour blackout policy (Mon–Fri 14:00–18:00 SGT) #67

Merged
adrian.tkacz merged 2 commits from feature/zai-peak-hours-blackout-policy into develop 2026-09-12 10:20:01 +00:00
Member

Closes #66.

What

Ships the owner's Z.ai peak-hour avoidance schedule as checked-in selector-policy configuration, using the existing D-026 weekly blackout mechanism. No product/code changes — the mechanism (WeeklyBlackoutRule, evaluate_blackouts) was already complete and tested.

  • examples/selector-policy.json — a SelectorPolicy identical to the documented neutral policy plus one blackout rule:
    • target {"provider": "zai"} (provider-only, exact identity → covers GLM-5.3 and GLM-5.3-Flash)
    • Asia/Singapore (fixed UTC+8), weekdays mon–fri, half-open [14:00, 18:00)
    • reason_code: preserve_zai_offpeak
  • README "Provider Availability Policy" section — CLI usage (--selector-policy examples/selector-policy.json) and the inline REST/MCP selector_policy object path.
  • tests/test_selection_app.py — new SelectorPolicyExampleTests (6 tests): document shape through load_selector_policy, half-open boundary semantics in SGT (13:59 free / 14:00 blocked / 17:59 blocked / 18:00 free), weekend non-blocking, UTC↔SGT conversion, end-to-end select exclusion to an openai fallback during the window, restored Z.ai ranking outside the window and on weekends, and explain output naming the rule.

Why configuration, not a default

Consistent with docs/selection-policy.md ("the user's desired schedule therefore belongs in configuration") and neutral_selector_policy(): omitting selector_policy keeps the neutral policy. The file is opt-in; no vendor peak schedule is hard-coded in the product.

Validation

  • uv sync --only-dev ✓
  • make check — 920 tests OK ✓
  • uv run basedpyright — 0 errors, 0 warnings, 0 notes ✓
  • git diff --check clean ✓
  • origin/develop..HEAD contains exactly one commit scoped to the three files above; no merge commits.
Closes #66. ## What Ships the owner's Z.ai peak-hour avoidance schedule as checked-in selector-policy configuration, using the existing D-026 weekly blackout mechanism. **No product/code changes** — the mechanism (`WeeklyBlackoutRule`, `evaluate_blackouts`) was already complete and tested. - `examples/selector-policy.json` — a `SelectorPolicy` identical to the documented neutral policy plus one blackout rule: - target `{"provider": "zai"}` (provider-only, exact identity → covers GLM-5.3 and GLM-5.3-Flash) - `Asia/Singapore` (fixed UTC+8), weekdays `mon`–`fri`, half-open `[14:00, 18:00)` - `reason_code: preserve_zai_offpeak` - README "Provider Availability Policy" section — CLI usage (`--selector-policy examples/selector-policy.json`) and the inline REST/MCP `selector_policy` object path. - `tests/test_selection_app.py` — new `SelectorPolicyExampleTests` (6 tests): document shape through `load_selector_policy`, half-open boundary semantics in SGT (13:59 free / 14:00 blocked / 17:59 blocked / 18:00 free), weekend non-blocking, UTC↔SGT conversion, end-to-end `select` exclusion to an openai fallback during the window, restored Z.ai ranking outside the window and on weekends, and explain output naming the rule. ## Why configuration, not a default Consistent with `docs/selection-policy.md` ("the user's desired schedule therefore belongs in configuration") and `neutral_selector_policy()`: omitting `selector_policy` keeps the neutral policy. The file is opt-in; no vendor peak schedule is hard-coded in the product. ## Validation - `uv sync --only-dev` ✓ - `make check` — 920 tests OK ✓ - `uv run basedpyright` — 0 errors, 0 warnings, 0 notes ✓ - `git diff --check` clean ✓ - `origin/develop..HEAD` contains exactly one commit scoped to the three files above; no merge commits.
adrian.tkacz deleted branch feature/zai-peak-hours-blackout-policy 2026-09-12 10:20:01 +00:00
Sign in to join this conversation.
No description provided.