os-sdlc: adopt Zeitwerk autoloading for tests/ (clears RequireRelativeDensity) #286

Closed
opened 2026-08-06 15:39:24 +00:00 by jared · 4 comments
Owner

Context

The 2026-08-06 test-file lint pass (commit cdf1596) left one non-exclusion offense: Sdlc/Structural/RequireRelativeDensity on plugins/os-sdlc/tests/test_helper.rb, whose remedy is replacing the manual require_relative list with Zeitwerk autoloading. This is an architecture-level loading change — record it via /os-adr:create when worked, not as a drive-by lint fix.

## Context The 2026-08-06 test-file lint pass (commit cdf1596) left one non-exclusion offense: Sdlc/Structural/RequireRelativeDensity on plugins/os-sdlc/tests/test_helper.rb, whose remedy is replacing the manual require_relative list with Zeitwerk autoloading. This is an architecture-level loading change — record it via /os-adr:create when worked, not as a drive-by lint fix.
Author
Owner

Decomposition (2026-08-06):

  1. HUMAN — ADR: adopt Zeitwerk for tests/ loading (mirror lib/os_sdlc.rb's loader, rooted at tests/support/). Must decide naming-reconciliation strategy: rename files vs rename constants vs inflector overrides; whether tests/support gets a namespace. Blocking: 5 support files break Zeitwerk inflection (workspace_scenario.rb→FakeIssueSource, brief_assembler_fixtures.rb→BriefAssemblerCase, cli_test_helpers.rb→CliSharedHelpers; project_attr_assertions.rb and lint_worklist_fixtures.rb nest under module OsSdlc, colliding with the app namespace).
  2. AGENT (after 1) — reconcile the 5 support files per the ADR choice, update call sites.
  3. AGENT (after 2) — wire Zeitwerk loader into test_helper.rb, delete the 12 require_relative lines; keep require "os_sdlc" + stdlib requires.
  4. AGENT — verify green tests + zero RequireRelativeDensity, close referencing the ADR.
Decomposition (2026-08-06): 1. HUMAN — ADR: adopt Zeitwerk for tests/ loading (mirror lib/os_sdlc.rb's loader, rooted at tests/support/). Must decide naming-reconciliation strategy: rename files vs rename constants vs inflector overrides; whether tests/support gets a namespace. Blocking: 5 support files break Zeitwerk inflection (workspace_scenario.rb→FakeIssueSource, brief_assembler_fixtures.rb→BriefAssemblerCase, cli_test_helpers.rb→CliSharedHelpers; project_attr_assertions.rb and lint_worklist_fixtures.rb nest under module OsSdlc, colliding with the app namespace). 2. AGENT (after 1) — reconcile the 5 support files per the ADR choice, update call sites. 3. AGENT (after 2) — wire Zeitwerk loader into test_helper.rb, delete the 12 require_relative lines; keep require "os_sdlc" + stdlib requires. 4. AGENT — verify green tests + zero RequireRelativeDensity, close referencing the ADR.
Author
Owner

Work started on main (no feature branch). Decision recorded as ADR-0101 (docs/adr/0101-adopt-zeitwerk-autoloading-for-os-sdlc-tests-support-files.md): Zeitwerk loader in test_helper.rb, files renamed to match constants, OsSdlc-nested support files un-nested.

Work started on main (no feature branch). Decision recorded as ADR-0101 (docs/adr/0101-adopt-zeitwerk-autoloading-for-os-sdlc-tests-support-files.md): Zeitwerk loader in test_helper.rb, files renamed to match constants, OsSdlc-nested support files un-nested.
Author
Owner

Implemented on main: commit 9cf726c (code) + e979bb5 (ADR-0101). Support files renamed to match constants (brief_assembler_fixtures->brief_assembler_case, cli_test_helpers->cli_shared_helpers, workspace_scenario->fake_issue_source), OsSdlc-nested helpers un-nested, test_helper.rb now uses a Zeitwerk loader (cli_fixtures.rb kept as an explicit require — multi-constant fixture file, same exception pattern as lib/os_sdlc.rb). Verified: 731 runs / 1978 assertions green; rubocop tests/ clean, zero RequireRelativeDensity. No PR gate — open for human sign-off.

Implemented on main: commit 9cf726c (code) + e979bb5 (ADR-0101). Support files renamed to match constants (brief_assembler_fixtures->brief_assembler_case, cli_test_helpers->cli_shared_helpers, workspace_scenario->fake_issue_source), OsSdlc-nested helpers un-nested, test_helper.rb now uses a Zeitwerk loader (cli_fixtures.rb kept as an explicit require — multi-constant fixture file, same exception pattern as lib/os_sdlc.rb). Verified: 731 runs / 1978 assertions green; rubocop tests/ clean, zero RequireRelativeDensity. No PR gate — open for human sign-off.
Author
Owner

Resolution

Done: Zeitwerk autoloading adopted for os-sdlc tests/ support files; files renamed to match constants, two helpers un-nested from module OsSdlc

Evidence: commits 9cf726c + e979bb5 (ADR-0101); 731 tests green; rubocop tests/ clean with zero RequireRelativeDensity; user signed off 2026-08-06

Follow-ups: none

## Resolution **Done:** Zeitwerk autoloading adopted for os-sdlc tests/ support files; files renamed to match constants, two helpers un-nested from module OsSdlc **Evidence:** commits 9cf726c + e979bb5 (ADR-0101); 731 tests green; rubocop tests/ clean with zero RequireRelativeDensity; user signed off 2026-08-06 **Follow-ups:** none
jared closed this issue 2026-08-06 17:15:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#286
No description provided.