claude-dev-env 8.46.28 → 8.46.30

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.
@@ -42,7 +42,7 @@ Run the named pytest node or command with the described input. A breach produces
42
42
  - check_inline_tuple_string_magic: an inline tuple of two snake-case labels; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_inline_tuple_string_magic.py::test_should_flag_inline_snake_case_tuple_pair_inside_function` reports a named violation.
43
43
  - check_join_separator_string_magic: a literal delimiter passed to join in a function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_join_separator_magic.py::test_should_flag_literal_delimiter_join_separator_in_function_body` reports a named violation.
44
44
  - check_string_literal_magic: an environment-variable name literal in a function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_string_magic.py::test_should_flag_env_var_name_string_in_function_body` reports a named violation.
45
- - check_whitespace_indentation_magic: a repeated literal indentation string in a function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_whitespace_indentation_magic.py` reports a named violation.
45
+ - check_whitespace_indentation_magic: a twelve-space indentation literal returned from a function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_whitespace_indentation_magic.py::test_flags_twelve_space_indent_constant` reports a line-numbered violation.
46
46
 
47
47
  ## Gotchas
48
48
 
@@ -26,7 +26,7 @@ A member loop catches a declared ItemBlocked type inside the loop, records the m
26
26
 
27
27
  Run the named pytest node or command with the described input. A breach produces a rule finding; advisory checks write to stderr.
28
28
 
29
- - check_function_length: a function exceeding the length threshold; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_function_length.py` reports a stderr advisory.
29
+ - check_function_length: a function at the blocking length threshold; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_function_length.py::test_should_block_at_sixty_lines` reports a blocking violation naming the function.
30
30
  - check_blast_radius_declared: a raise inside a loop body with no declared handler; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_blast_radius.py::test_should_report_a_loop_raise_with_pending_blast_radius_declaration` reports an advisory. A RunFatal raise or an ItemBlocked raise inside a loop passes.
31
31
  - check_duplicate_function_body_across_files: one function body copied into a sibling module; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_duplicate_body.py::test_should_flag_function_copied_from_sibling` reports a named violation.
32
32
  - check_unused_optional_parameters: an optional parameter with one fixed value at every call site; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_split_optional_params.py::test_should_flag_optional_param_never_varied_in_file` reports a named violation.
@@ -20,7 +20,7 @@ Lint reports patterns; prompt context carries judgment about SRP, right-sized de
20
20
 
21
21
  Run the named pytest node or command with the described input. A breach produces a rule finding; advisory checks write to stderr.
22
22
 
23
- - check_unanchored_command_dispatch: a command regex that matches a verb inside another command; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_dispatch_wiring.py` reports a named violation.
23
+ - check_unanchored_command_dispatch: a command regex that matches a verb inside another command; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_command_dispatch.py::test_flags_unanchored_multi_word_command_pattern` reports a named violation.
24
24
  - check_same_file_inline_duplicate_body: a helper body copied inline into a caller; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_same_file_inline_duplicate.py::test_should_flag_helper_whose_body_is_inlined_in_another_function` reports a named violation.
25
25
  - check_zero_payload_function_alias: a pass-through alias forwarding the same arguments; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_zero_payload_alias.py::test_should_flag_pass_through_alias_forwarding_same_parameters` reports a named violation.
26
26
 
@@ -38,13 +38,13 @@ Run the named pytest node or command with the described input. A breach produces
38
38
 
39
39
  - check_class_docstring_names_public_methods: a class summary omitting its public methods; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_class_docstring_methods.py::test_should_flag_single_line_docstring_omitting_two_public_methods` reports a named violation.
40
40
  - check_docstring_args_match_signature: an Args entry absent from the signature; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_args_signature.py::test_should_flag_documented_arg_not_in_signature` reports a named violation.
41
- - check_docstring_documents_unreferenced_parameter: a documented parameter unused in the body; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_unreferenced_param.py` reports a named violation.
41
+ - check_docstring_documents_unreferenced_parameter: a documented parameter unused in the body; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_unreferenced_param.py::test_should_flag_documented_parameter_never_referenced` reports a named violation.
42
42
  - check_docstring_format: a public function with parameters and no Args section; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_format.py::test_should_flag_public_function_with_params_missing_args_section` reports a named violation.
43
43
  - check_docstring_names_undefined_constant: a docstring naming an undefined constant; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_undefined_constant.py::test_flags_docstring_naming_constant_the_module_never_defines` reports a named violation.
44
44
  - check_docstring_prose_wall_without_illustration: a prose-wall docstring with no example; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_prose_wall_illustration.py::test_should_flag_prose_wall_with_no_illustration` reports a named violation.
45
45
  - check_docstring_runon_sentence: a long run-on docstring sentence; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_docstring_runon_sentence.py::test_should_flag_run_lifecycle_module_docstring_wall` reports a named violation.
46
46
  - check_module_docstring_names_public_checks: a module summary omitting a public check; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_module_docstring_roster.py::test_should_flag_module_docstring_omitting_a_public_check` reports a named violation.
47
- - check_module_docstring_scope_omits_data_schema_constants: a module summary listing schema constants as behavior; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_module_docstring_data_schema_scope.py` reports a named violation.
47
+ - check_module_docstring_scope_omits_data_schema_constants: a module summary listing schema constants as behavior; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_module_docstring_data_schema_scope.py::test_flags_user_facing_summary_over_data_schema_constants` reports a named violation.
48
48
  - check_imports_at_top: an ordinary import inside a function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_type_checking_scope.py::test_should_flag_runtime_import_inside_function_even_if_file_uses_type_checking` reports a named violation.
49
49
  - check_js_bare_flag_return_directive: a JavaScript return directive with an unexplained bare flag; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_js_bare_flag_return_directive.py::test_flags_bare_down_directive_when_the_workflow_states_the_contract` reports a named violation.
50
50
  - check_js_resume_task_enumeration_coverage: a resume task branch missing an enumerated state; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_js_resume_task_enumeration.py::should_flag_resume_branch_absent_from_spawn_enumeration` reports a named violation.
@@ -39,13 +39,13 @@ Run the named pytest node or command with the described input. A breach produces
39
39
  - check_parameter_annotations: a public parameter without an annotation; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_annotations.py::test_should_flag_parameter_without_annotation` reports a named violation.
40
40
  - check_return_annotations: a function without a return annotation; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_annotations.py::test_should_flag_function_without_return_annotation` reports a named violation.
41
41
  - check_unused_known_pytest_fixture_parameters: a test declaring tmp_path and never reading it; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_annotations.py::test_should_flag_unused_known_fixture_parameter_in_test_file` reports a named violation.
42
- - check_banned_identifiers: a changed ctx binding; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_banned_identifier.py` reports a named violation.
43
- - check_banned_noun_word_boundary: a public function binding a banned noun; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_banned_noun_word.py` reports a named violation.
42
+ - check_banned_identifiers: a local binding named result; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_banned_identifier.py::test_should_flag_result_assignment` reports a named violation.
43
+ - check_banned_noun_word_boundary: a public function name holding a banned noun; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_banned_noun_word.py::test_should_flag_function_definition_with_data_word_in_name` reports a named violation.
44
44
  - check_banned_prefixes: a function named handle_event; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_banned_prefixes.py::test_should_flag_handle_prefixed_function` reports a named violation.
45
45
  - check_boolean_naming: a boolean assignment named enabled; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_naming_pattern.py::test_should_flag_boolean_assignment_without_is_prefix` reports a named violation.
46
- - check_js_banned_identifiers: a JavaScript declaration named ctx; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_naming_pattern.py` reports a named violation.
47
- - check_js_boolean_naming: a boolean JavaScript declaration named enabled; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_naming_pattern.py` reports a named violation.
48
- - check_collection_prefix: a list parameter named users; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_collection_prefix.py` reports a named violation.
46
+ - check_js_banned_identifiers: a JavaScript declaration named data; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_js_conventions.py::test_flags_banned_identifier_declaration` reports a named violation.
47
+ - check_js_boolean_naming: a boolean JavaScript declaration named hardeningPrOpened; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_js_conventions.py::test_flags_unprefixed_boolean_let_declaration` reports a named violation.
48
+ - check_collection_prefix: a set parameter named numbers; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_collection_prefix.py::test_should_flag_bare_set_parameter_without_all_prefix` reports a named violation.
49
49
  - check_loop_variable_naming: a loop variable named user; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_split_naming.py::test_check_loop_variable_naming_flags_missing_each_prefix` reports a named violation.
50
50
  - check_polarity_name_contradiction: an is_allowed binding assigned from is_forbidden; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_polarity_name_contradiction.py::test_should_flag_allowed_target_assigned_from_forbidden_callee` reports a named violation.
51
51
  - check_referenced_underscore_loop_variable: a loop variable named _user that its body reads; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_referenced_underscore_loop.py::test_should_flag_referenced_underscore_loop_variable_in_conftest` reports a named violation.
@@ -29,7 +29,7 @@ The TDD loop is the default for bug fixes and new behavior. A prototype may prec
29
29
 
30
30
  Run the named pytest node or command with the described input. A breach produces a rule finding; advisory checks write to stderr.
31
31
 
32
- - check_e2e_test_naming: an end-to-end test with an unmarked name; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_dot_test_pattern.py` reports a named violation.
32
+ - check_e2e_test_naming: a spec test name containing online; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_e2e_test_naming.py::test_should_flag_online_word_in_spec_test_name` reports a line-numbered violation.
33
33
  - check_public_function_missing_paired_test: a new public function absent from its established suite; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_paired_test.py::test_flags_public_function_absent_from_established_suite` reports a named violation.
34
34
  - check_test_file_omits_module_public_function: an established test module omitting a public function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_paired_test.py::test_flags_module_public_function_when_test_suite_omits_it` reports a named violation.
35
35
  - check_constant_equality_tests: a test asserting a constant equals its literal; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_constant_equality.py::test_should_flag_test_asserting_constant_equals_literal` reports a named violation.
@@ -38,9 +38,9 @@ Run the named pytest node or command with the described input. A breach produces
38
38
  - check_skip_decorators_in_tests: a skipped pytest test function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_skip_decorators.py::test_should_flag_pytest_mark_skip_on_test_function` reports a named violation.
39
39
  - check_stale_test_name_target: a test name still naming a removed function; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_stale_test_name.py::test_flags_renamed_away_target_in_test_name` reports a named violation.
40
40
  - check_vacuous_cleanup_assertion_tests: a cleanup test with no created temporary file; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_vacuous_cleanup_assertion.py::test_should_flag_glob_emptiness_cleanup_test_without_temp_creation` reports a named violation.
41
- - check_tests_use_isolated_filesystem_paths: a test writing to a shared user-home path; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_tests_isolate_home_temp.py` reports a named violation.
42
- - check_dead_test_module_constant: an unused private constant in a test module; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_test_layout.py` reports a named violation.
43
- - check_unused_test_helper_parameter: a test helper parameter its body never reads; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_test_layout.py` reports a named violation.
41
+ - check_tests_use_isolated_filesystem_paths: a test writing to a shared user-home path; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_tests_isolate_home_temp.py::test_should_flag_path_home_in_test_without_fixture` reports a named violation.
42
+ - check_dead_test_module_constant: an unused private constant in a test module; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_test_layout.py::test_should_flag_dead_private_constant_in_test_file` reports a named violation.
43
+ - check_unused_test_helper_parameter: a test helper parameter its body never reads; `python -m pytest packages/claude-dev-env/hooks/blocking/test_code_rules_enforcer_test_layout.py::test_should_flag_unused_private_helper_parameter` reports a named violation.
44
44
 
45
45
  ## Gotchas
46
46
 
@@ -0,0 +1,24 @@
1
+ """Tests for check_e2e_test_naming."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from code_rules_enforcer import check_e2e_test_naming
6
+
7
+ SPEC_FILE_PATH = "tests/e2e/checkout.spec.ts"
8
+ COMPONENT_TEST_FILE_PATH = "src/checkout.test.ts"
9
+ ONLINE_TEST_SOURCE = "test('submits the order when online', async () => {});\n"
10
+
11
+
12
+ def test_should_flag_online_word_in_spec_test_name() -> None:
13
+ assert check_e2e_test_naming(ONLINE_TEST_SOURCE, SPEC_FILE_PATH) == [
14
+ "Line 1: Test name contains online/offline - file scope defines this"
15
+ ]
16
+
17
+
18
+ def test_should_allow_spec_test_name_without_network_state() -> None:
19
+ source = "test('submits the order', async () => {});\n"
20
+ assert check_e2e_test_naming(source, SPEC_FILE_PATH) == []
21
+
22
+
23
+ def test_should_skip_file_that_is_not_a_spec() -> None:
24
+ assert check_e2e_test_naming(ONLINE_TEST_SOURCE, COMPONENT_TEST_FILE_PATH) == []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "8.46.28",
3
+ "version": "8.46.30",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,9 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import importlib.util
5
+ import importlib.machinery
6
6
  import os
7
7
  import subprocess
8
+ import types
8
9
  from dataclasses import dataclass, field
9
10
  from datetime import datetime, timedelta, timezone
10
11
  from enum import Enum
@@ -63,11 +64,12 @@ def codex_usage_limit_signatures() -> tuple[str, ...]:
63
64
  ImportError: The marker module cannot be loaded.
64
65
  """
65
66
  constants_path = Path(__file__).resolve().parents[2] / "_shared" / "pr-loop" / "scripts" / "codex_review_scripts_constants" / "classifier_constants.py"
66
- specification = importlib.util.spec_from_file_location("account_broker_codex_classifier_constants", constants_path)
67
- if specification is None or specification.loader is None:
68
- raise ImportError(f"cannot load usage markers from {constants_path}")
69
- module = importlib.util.module_from_spec(specification)
70
- specification.loader.exec_module(module)
67
+ loader = importlib.machinery.SourceFileLoader("account_broker_codex_classifier_constants", str(constants_path))
68
+ module = types.ModuleType(loader.name)
69
+ try:
70
+ loader.exec_module(module)
71
+ except OSError as error:
72
+ raise ImportError(f"cannot load usage markers from {constants_path}") from error
71
73
  return module.ALL_USAGE_LIMIT_MARKERS
72
74
 
73
75
 
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import dataclasses
6
6
  from datetime import datetime, timedelta, timezone
7
+ from pathlib import Path
7
8
 
8
9
  import pytest
9
10
 
@@ -58,6 +59,18 @@ def test_codex_usage_limit_signatures_loads_classifier_markers() -> None:
58
59
  assert "http 429" in signatures
59
60
 
60
61
 
62
+ def test_codex_usage_limit_signatures_raises_import_error_when_markers_are_missing(
63
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
64
+ ) -> None:
65
+ monkeypatch.setattr(broker_constants, "__file__", str(tmp_path / "scripts" / "constants" / "module.py"))
66
+
67
+ with pytest.raises(ImportError, match="cannot load usage markers from") as raised:
68
+ broker_constants.codex_usage_limit_signatures()
69
+
70
+ assert str(tmp_path) in str(raised.value)
71
+ assert isinstance(raised.value.__cause__, FileNotFoundError)
72
+
73
+
61
74
  def test_utc_time_text_converts_an_offset_timestamp() -> None:
62
75
  moment = datetime(2026, 10, 3, 7, 30, tzinfo=timezone(timedelta(hours=-4)))
63
76
 
@@ -107,15 +107,15 @@ def _assert_proof_target_resolves(proof_label: str, proof_target: str) -> None:
107
107
  module_text, _, test_name = proof_target.partition("::")
108
108
  module_path = _REPOSITORY_ROOT / module_text
109
109
  assert module_path.is_file(), proof_label
110
- if test_name:
111
- assert re.search(
112
- rf"^def {re.escape(test_name)}\(",
113
- module_path.read_text(encoding="utf-8"),
114
- re.MULTILINE,
115
- ), proof_label
110
+ assert test_name, proof_label
111
+ assert re.search(
112
+ rf"^def {re.escape(test_name)}\(",
113
+ module_path.read_text(encoding="utf-8"),
114
+ re.MULTILINE,
115
+ ), proof_label
116
116
 
117
117
 
118
- def test_should_name_a_test_module_in_each_proof_command() -> None:
118
+ def test_should_name_a_pytest_node_in_each_proof_command() -> None:
119
119
  for each_family_path in _FAMILY_DIRECTORY.glob("*.md"):
120
120
  family_text = each_family_path.read_text(encoding="utf-8")
121
121
  all_proofs = re.findall(