claude-dev-env 8.46.24 → 8.46.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/CODE_RULES.md
CHANGED
|
@@ -96,6 +96,8 @@ Open [details](code-rules/design-and-structure.md) when renaming symbols.
|
|
|
96
96
|
|
|
97
97
|
Never swallow a failure into a default unless the caller explicitly opted in at the boundary. Name the specific exception (`except KeyError:`) and propagate the rest. Collapsing every error class to `None` masks programming errors and makes debugging impossible.
|
|
98
98
|
|
|
99
|
+
A member loop catches its declared `*ItemBlocked` type inside the loop and lets a `*RunFatal` pass through, and an `except Exception` in that loop triggers this rule.
|
|
100
|
+
|
|
99
101
|
Open [details](code-rules/design-and-structure.md) when handling batch failures.
|
|
100
102
|
|
|
101
103
|
## 9.8 REMOVE CODE YOU ORPHAN (Dead Code Elimination)
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
"""Floors
|
|
1
|
+
"""Floors, outcome shape, and time helpers for the account broker."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import dataclasses
|
|
6
|
+
from datetime import datetime, timedelta, timezone
|
|
6
7
|
|
|
7
8
|
import pytest
|
|
8
9
|
|
|
10
|
+
from dev_env_scripts_constants import account_broker_constants as broker_constants
|
|
9
11
|
from dev_env_scripts_constants.account_broker_constants import (
|
|
10
12
|
ALL_CLAUDE_FLOORS,
|
|
11
13
|
ALL_CODEX_FLOORS,
|
|
@@ -47,3 +49,29 @@ def test_should_freeze_job_outcome() -> None:
|
|
|
47
49
|
outcome = JobOutcome(0, "", "", None, (), "served", None, None)
|
|
48
50
|
with pytest.raises(dataclasses.FrozenInstanceError):
|
|
49
51
|
outcome.status = "wait"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_codex_usage_limit_signatures_loads_classifier_markers() -> None:
|
|
55
|
+
signatures = broker_constants.codex_usage_limit_signatures()
|
|
56
|
+
|
|
57
|
+
assert "rate limit" in signatures
|
|
58
|
+
assert "http 429" in signatures
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_utc_time_text_converts_an_offset_timestamp() -> None:
|
|
62
|
+
moment = datetime(2026, 10, 3, 7, 30, tzinfo=timezone(timedelta(hours=-4)))
|
|
63
|
+
|
|
64
|
+
assert broker_constants.utc_time_text(moment) == "2026-10-03T11:30:00+00:00"
|
|
65
|
+
assert broker_constants.utc_time_text(None) is None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@pytest.mark.parametrize("timestamp", (None, 123, "not a timestamp", "2026-10-03T11:30:00"))
|
|
69
|
+
def test_parse_utc_time_rejects_values_without_a_timezone(timestamp: object) -> None:
|
|
70
|
+
assert broker_constants.parse_utc_time(timestamp) is None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def test_parse_utc_time_converts_an_offset_timestamp() -> None:
|
|
74
|
+
parsed = broker_constants.parse_utc_time("2026-10-03T07:30:00-04:00")
|
|
75
|
+
|
|
76
|
+
assert parsed is not None
|
|
77
|
+
assert parsed.isoformat() == "2026-10-03T11:30:00+00:00"
|