inward-dependency lint misses qualified constant chains such as Project::Yaml::TEST_DIR_CANDIDATES, so model to adapter edges go unreported #798

Closed
opened 2026-09-28 15:52:13 +00:00 by jared · 1 comment
Owner

Problem

plugins/os-sdlc/lib/os_sdlc/lint/inward_dependencies.rb reports outward edges between role layers.
Model is layer 3 and adapter is layer 2.
Its resolve step finds no exact key for a chain like Project::Yaml::TEST_DIR_CANDIDATES.
It skips the namespace lookup because the name contains ::, and falls back to the first segment Project, which is model.
So model/project/flat_attrs.rb:37 referencing an adapter constant produces no edge.
The count stayed at 61 while an outward edge was added in #793.
The fix should try the longest known prefix before it falls back to the first segment.
It may raise the baseline count.

Reproduce

On commit 7ae416cf of ticket-793 run plugins/os-sdlc/bin/lint-inward-dependencies | grep flat_attrs.
It prints nothing although flat_attrs.rb:37 references Project::Yaml::TEST_DIR_CANDIDATES.

Origin

  • Trigger: lens challenge of the contract-auditor LENS lines on #793, 2026-09-28
  • Where: plugins/os-sdlc/lib/os_sdlc/lint/inward_dependencies.rb, method resolve
  • Session: bb36e383-017d-486e-809f-7ce25d151e61
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/bb36e383-017d-486e-809f-7ce25d151e61.jsonl

VERDICT: CREATE
REASON: resolve skips namespace lookup for any qualified constant and falls back to the first segment, so a model -> adapter edge through a constant chain is silently dropped; validation-tool accuracy bug, its own root.

## Problem `plugins/os-sdlc/lib/os_sdlc/lint/inward_dependencies.rb` reports outward edges between role layers. Model is layer 3 and adapter is layer 2. Its `resolve` step finds no exact key for a chain like `Project::Yaml::TEST_DIR_CANDIDATES`. It skips the namespace lookup because the name contains `::`, and falls back to the first segment `Project`, which is model. So `model/project/flat_attrs.rb:37` referencing an adapter constant produces no edge. The count stayed at 61 while an outward edge was added in #793. The fix should try the longest known prefix before it falls back to the first segment. It may raise the baseline count. ## Reproduce On commit 7ae416cf of ticket-793 run `plugins/os-sdlc/bin/lint-inward-dependencies | grep flat_attrs`. It prints nothing although flat_attrs.rb:37 references `Project::Yaml::TEST_DIR_CANDIDATES`. ## Origin - Trigger: lens challenge of the contract-auditor LENS lines on #793, 2026-09-28 - Where: plugins/os-sdlc/lib/os_sdlc/lint/inward_dependencies.rb, method resolve - Session: bb36e383-017d-486e-809f-7ce25d151e61 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-crc-pass-os-sdlc/bb36e383-017d-486e-809f-7ce25d151e61.jsonl VERDICT: CREATE REASON: resolve skips namespace lookup for any qualified constant and falls back to the first segment, so a model -> adapter edge through a constant chain is silently dropped; validation-tool accuracy bug, its own root.
Author
Owner

Resolution

Done: Folded into #748; the resolve longest-prefix fix is recorded there.

Evidence: resolve at plugins/os-sdlc/lib/os_sdlc/lint/inward_dependencies.rb:98-106 still falls back to const.split('::').first; bug not fixed.

Follow-ups: folded into #748

## Resolution **Done:** Folded into #748; the resolve longest-prefix fix is recorded there. **Evidence:** resolve at plugins/os-sdlc/lib/os_sdlc/lint/inward_dependencies.rb:98-106 still falls back to const.split('::').first; bug not fixed. **Follow-ups:** folded into #748
jared closed this issue 2026-10-16 16:22:27 +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#798
No description provided.