Invert the model-to-outer-layer edges that wave 4 unmasked #1212

Open
opened 2026-10-20 14:05:46 +00:00 by jared · 0 comments
Owner

Problem

Wave 4 gave renamed constants a layer role in the ledger. The Sdlc/Structural/InwardDependency cop keys on the ledger new_constant, so existing edges from a model or adapter to an outer layer now show as 9 offense lines in eight files. Each edge is old design. Edge 5 (MutationCheck -> ProjectShell) is tracked in #1070. A move cannot remove it. The caller must receive the collaborator, or the behavior must move outward. The run recorded each edge in docs/crc/os-sdlc/deviations.md for #1207 and #1208.

Observed

bundle exec rubocop -c .rubocop-sweep.yml --only Sdlc/Structural/InwardDependency <files>   (run in plugins/os-sdlc)
lib/os_sdlc/crc/census/source_row.rb:51:44: C: Sdlc/Structural/InwardDependency: Crc::Definitions (layer query) is referenced from layer model. Inner layers must not depend on outer layers: pass the value in, or move the behavior to the outer layer.
lib/os_sdlc/crc/ledger/check/applied_row.rb:31:31: C: Sdlc/Structural/InwardDependency: Crc::Definitions (layer query) is referenced from layer model. ...
lib/os_sdlc/crc/shares/row_annotation.rb:12:30: C: Sdlc/Structural/InwardDependency: Crc::CellMerge (layer command) is referenced from layer model. ...
lib/os_sdlc/gate/unchanged_check/measurement.rb:27:11: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer adapter. ...
lib/os_sdlc/implementation.rb:71:9: C: Sdlc/Structural/InwardDependency: MapCatalog (layer query) is referenced from layer model. ...
lib/os_sdlc/lint/green_assert.rb:13:19: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ...
lib/os_sdlc/step_outcome.rb:40:17: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ...
lib/os_sdlc/step_outcome.rb:47:7: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ...
lib/os_sdlc/step_result.rb:38:7: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ...

The same run also reports pre-existing edges in these files (Crc::Census::PublicMethods, Implementation::Dispatching, Implementation::Report, HandoffContent). This ticket does not cover them.

Reproduce

cd plugins/os-sdlc && bundle exec rubocop -c .rubocop-sweep.yml --only Sdlc/Structural/InwardDependency lib/os_sdlc/crc/census/source_row.rb lib/os_sdlc/crc/ledger/check/applied_row.rb lib/os_sdlc/crc/shares/row_annotation.rb lib/os_sdlc/gate/unchanged_check/measurement.rb lib/os_sdlc/implementation.rb lib/os_sdlc/lint/green_assert.rb lib/os_sdlc/step_outcome.rb lib/os_sdlc/step_result.rb

Approach

For each edge, the model or adapter receives the collaborator through its constructor or a method argument. The outer layer (the command or controller that builds the model) creates it. Do not move a constant to a layer where it does not belong.

Required work:

  1. Crc::Census::SourceRow receives its definitions object. Its builder passes it in. — check: absent Definitions.new in plugins/os-sdlc/lib/os_sdlc/crc/census/source_row.rb
  2. Crc::Ledger::Check::AppliedRow receives the defined names for the new path. — check: absent Crc::Definitions in plugins/os-sdlc/lib/os_sdlc/crc/ledger/check/applied_row.rb
  3. Crc::Shares::RowAnnotation receives its merge object. — check: absent CellMerge in plugins/os-sdlc/lib/os_sdlc/crc/shares/row_annotation.rb
  4. Implementation receives the map catalog where it loads a reroute map. — check: absent MapCatalog in plugins/os-sdlc/lib/os_sdlc/implementation.rb
  5. Gate::UnchangedCheck::Measurement, Lint::GreenAssert, StepOutcome, and StepResult stop calling SuiteOutput.parse. The caller passes the parsed summary, or one model owns the parse result. — check: absent SuiteOutput in plugins/os-sdlc/lib/os_sdlc/step_result.rb

Rejected: Move the outer constant down to the model layer — the ledger gave each constant its layer on purpose (R47, R49, R51).

Acceptance criteria

  1. Given the sweep config, when Sdlc/Structural/InwardDependency runs on the eight files, then none of the 9 listed offense lines remain.
  2. Given the suite, when it runs after the change, then it passes with no new failures.
  3. Given each changed class, when a test builds it with a stand-in collaborator, then it works without the outer-layer constant loaded.

Owner sketch

class OsSdlc::Crc::Census::SourceRow
  def initialize(row, definitions:)
end

Non-goals

  • The pre-existing inward edges in the same files.
  • Splitting this ticket by edge is allowed. The pipeline may take one edge group per ticket.

Origin

  • Trigger: bin/lint-sweep after CRC run 3 wave 4 batches #1207 and #1208
  • Improvised this session: none; each edge was recorded in docs/crc/os-sdlc/deviations.md
  • Chain: 9 new InwardDependency offenses ← the layer lookup keys on the ledger new_constant, so old edges show once a constant sits at its ledger name ← DESIGN (docs/crc/os-sdlc/deviations.md, R47, R49, R51)
  • Root candidate: #1070
  • Where: plugins/os-sdlc/lib/os_sdlc/crc/census/source_row.rb and the seven other files listed above
  • Session: 2e167079-f404-4139-9cfa-6c0c937ce9f0
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-os-sdlc-run-3/2e167079-f404-4139-9cfa-6c0c937ce9f0.jsonl

VERDICT: CREATE

## Problem Wave 4 gave renamed constants a layer role in the ledger. The `Sdlc/Structural/InwardDependency` cop keys on the ledger `new_constant`, so existing edges from a model or adapter to an outer layer now show as 9 offense lines in eight files. Each edge is old design. Edge 5 (MutationCheck -> ProjectShell) is tracked in #1070. A move cannot remove it. The caller must receive the collaborator, or the behavior must move outward. The run recorded each edge in `docs/crc/os-sdlc/deviations.md` for #1207 and #1208. ## Observed ``` bundle exec rubocop -c .rubocop-sweep.yml --only Sdlc/Structural/InwardDependency <files> (run in plugins/os-sdlc) ``` ``` lib/os_sdlc/crc/census/source_row.rb:51:44: C: Sdlc/Structural/InwardDependency: Crc::Definitions (layer query) is referenced from layer model. Inner layers must not depend on outer layers: pass the value in, or move the behavior to the outer layer. lib/os_sdlc/crc/ledger/check/applied_row.rb:31:31: C: Sdlc/Structural/InwardDependency: Crc::Definitions (layer query) is referenced from layer model. ... lib/os_sdlc/crc/shares/row_annotation.rb:12:30: C: Sdlc/Structural/InwardDependency: Crc::CellMerge (layer command) is referenced from layer model. ... lib/os_sdlc/gate/unchanged_check/measurement.rb:27:11: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer adapter. ... lib/os_sdlc/implementation.rb:71:9: C: Sdlc/Structural/InwardDependency: MapCatalog (layer query) is referenced from layer model. ... lib/os_sdlc/lint/green_assert.rb:13:19: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ... lib/os_sdlc/step_outcome.rb:40:17: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ... lib/os_sdlc/step_outcome.rb:47:7: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ... lib/os_sdlc/step_result.rb:38:7: C: Sdlc/Structural/InwardDependency: SuiteOutput (layer parser) is referenced from layer model. ... ``` The same run also reports pre-existing edges in these files (`Crc::Census::PublicMethods`, `Implementation::Dispatching`, `Implementation::Report`, `HandoffContent`). This ticket does not cover them. ## Reproduce ``` cd plugins/os-sdlc && bundle exec rubocop -c .rubocop-sweep.yml --only Sdlc/Structural/InwardDependency lib/os_sdlc/crc/census/source_row.rb lib/os_sdlc/crc/ledger/check/applied_row.rb lib/os_sdlc/crc/shares/row_annotation.rb lib/os_sdlc/gate/unchanged_check/measurement.rb lib/os_sdlc/implementation.rb lib/os_sdlc/lint/green_assert.rb lib/os_sdlc/step_outcome.rb lib/os_sdlc/step_result.rb ``` ## Approach For each edge, the model or adapter receives the collaborator through its constructor or a method argument. The outer layer (the command or controller that builds the model) creates it. Do not move a constant to a layer where it does not belong. Required work: 1. `Crc::Census::SourceRow` receives its definitions object. Its builder passes it in. — check: absent `Definitions.new` in `plugins/os-sdlc/lib/os_sdlc/crc/census/source_row.rb` 2. `Crc::Ledger::Check::AppliedRow` receives the defined names for the new path. — check: absent `Crc::Definitions` in `plugins/os-sdlc/lib/os_sdlc/crc/ledger/check/applied_row.rb` 3. `Crc::Shares::RowAnnotation` receives its merge object. — check: absent `CellMerge` in `plugins/os-sdlc/lib/os_sdlc/crc/shares/row_annotation.rb` 4. `Implementation` receives the map catalog where it loads a reroute map. — check: absent `MapCatalog` in `plugins/os-sdlc/lib/os_sdlc/implementation.rb` 5. `Gate::UnchangedCheck::Measurement`, `Lint::GreenAssert`, `StepOutcome`, and `StepResult` stop calling `SuiteOutput.parse`. The caller passes the parsed summary, or one model owns the parse result. — check: absent `SuiteOutput` in `plugins/os-sdlc/lib/os_sdlc/step_result.rb` Rejected: Move the outer constant down to the model layer — the ledger gave each constant its layer on purpose (R47, R49, R51). ## Acceptance criteria 1. Given the sweep config, when `Sdlc/Structural/InwardDependency` runs on the eight files, then none of the 9 listed offense lines remain. 2. Given the suite, when it runs after the change, then it passes with no new failures. 3. Given each changed class, when a test builds it with a stand-in collaborator, then it works without the outer-layer constant loaded. ## Owner sketch ```ruby class OsSdlc::Crc::Census::SourceRow def initialize(row, definitions:) end ``` ## Non-goals - The pre-existing inward edges in the same files. - Splitting this ticket by edge is allowed. The pipeline may take one edge group per ticket. ## Origin - Trigger: bin/lint-sweep after CRC run 3 wave 4 batches #1207 and #1208 - Improvised this session: none; each edge was recorded in `docs/crc/os-sdlc/deviations.md` - Chain: 9 new InwardDependency offenses ← the layer lookup keys on the ledger `new_constant`, so old edges show once a constant sits at its ledger name ← DESIGN (docs/crc/os-sdlc/deviations.md, R47, R49, R51) - Root candidate: #1070 - Where: plugins/os-sdlc/lib/os_sdlc/crc/census/source_row.rb and the seven other files listed above - Session: 2e167079-f404-4139-9cfa-6c0c937ce9f0 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-os-sdlc-run-3/2e167079-f404-4139-9cfa-6c0c937ce9f0.jsonl VERDICT: CREATE
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#1212
No description provided.