Codify OO + constructor-DI architecture rules and fail-fast / fail-closed guidance in CLAUDE.md (closes #397)#516
Merged
Merged
Conversation
… task 1/3) Replace the stale "use module-level functions" guidance with the actual architecture: all behavior lives on injected objects, module-level code is restricted to constants/value-helpers/type-defs/thin composition roots. Define composition root, show the constructor-DI pattern, move the @staticmethod rule into the new subsection with a clearer rationale.
16eff39 to
9768b7d
Compare
Documents two patterns that signal incomplete migration to constructor-DI: callable slots wired via default args (_run, _print_prompt, _fn_*) and @patch-heavy tests that override module globals instead of injecting collaborators. Both are debt markers — not errors, but invitations to finish the refactor when touching that code.
Documents five concrete rules for authoritative runner paths: no broad catch-log-continue, no synthetic success from real failures, explicit subprocess failure handling via check=True or returncode, direct key indexing instead of .get() defaults for required payload keys, and fail-closed on startup precondition failures. Includes a worked example contrasting the wrong and right approaches for subprocess error handling.
rhencke
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #397.
Codifies the OO + constructor-DI architecture as the default pattern in CLAUDE.md, replacing the stale module-level-function guidance. Adds explicit rules for migration smells (callable-slot DI, patch-heavy tests) and fail-fast / fail-closed handling in core runtime paths so reviewers have clear language to reject drift.
Work queue
Completed (3)