Move ConstructorGraph and Holders visitors onto CodeShape; resolve constants defined inside a file #1732

Open
opened 2026-11-12 21:37:45 +00:00 by jared · 1 comment
Owner

Problem

Detector::ConstructorGraph::Visitor and Detector::Holders::Visitor resolve names by file existence, so a constant defined inside another file has no path and a file-named constant wins (#1718). Blocked by #1729.

Observed

At lib/os_sdlc/crc/filing.rb:28, Result.new is the Struct at line 10. The detector resolves it to OsSdlc::Crc::Result (crc/result.rb:5). Detector::Sources#path_for (detector/sources.rb:24-26) keys on the Zeitwerk file map. The constructor graph resolver knows 965 of 1,823 names, missed 64 internal names, and gave 1 wrong name. Its namespace is constant_path.slice.split("::") (constructor_graph/visitor.rb:35-60); Holders::Visitor (holders/visitor.rb:33-52) adds its own descending resolution.

Reproduce

n/a: design finding from the resolver comparison of 2026-11-12.

Approach

Not decided; the takedown designs it. Both visitors resolve through CodeShape; Sources#path_for stops being the resolution rule.

Required work: none beyond the acceptance criteria.

Origin

  • Trigger: split of #1718 by Jared (rulings 145 and 146 in docs/decisions/rulings.tsv, 2026-11-12) after takedown run docs/takedown/1718-20261112-160038/ failed green-suite; parent #1718
  • Improvised this session: none
  • Chain: Result.new at crc/filing.rb:28 resolves to Crc::Result ← no object owns facts read from parsed Ruby code, so each detector, lint check, and cop writes its own copy ← DESIGN (#1718; docs/system-design-format/README.md:242)
  • Root candidate: none found; searched ConstructorGraph, Holders visitor, Sources#path_for, Zeitwerk file map, nested Struct
  • Where: plugins/os-sdlc/lib/os_sdlc/detector/constructor_graph/visitor.rb, detector/holders/visitor.rb, detector/sources.rb
  • Session: 784c0808-1e40-4296-8f93-77c40ca419c2
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/784c0808-1e40-4296-8f93-77c40ca419c2.jsonl

VERDICT: CREATE
REASON: Jared ruled the split of #1718 (ruling 146); the backlog search found no open ticket with the same mechanism.

## Problem `Detector::ConstructorGraph::Visitor` and `Detector::Holders::Visitor` resolve names by file existence, so a constant defined inside another file has no path and a file-named constant wins (#1718). Blocked by #1729. ## Observed At `lib/os_sdlc/crc/filing.rb:28`, `Result.new` is the Struct at line 10. The detector resolves it to `OsSdlc::Crc::Result` (`crc/result.rb:5`). `Detector::Sources#path_for` (`detector/sources.rb:24-26`) keys on the Zeitwerk file map. The constructor graph resolver knows 965 of 1,823 names, missed 64 internal names, and gave 1 wrong name. Its namespace is `constant_path.slice.split("::")` (`constructor_graph/visitor.rb:35-60`); `Holders::Visitor` (`holders/visitor.rb:33-52`) adds its own descending resolution. ## Reproduce n/a: design finding from the resolver comparison of 2026-11-12. ## Approach Not decided; the takedown designs it. Both visitors resolve through `CodeShape`; `Sources#path_for` stops being the resolution rule. Required work: none beyond the acceptance criteria. ## Origin - Trigger: split of #1718 by Jared (rulings 145 and 146 in `docs/decisions/rulings.tsv`, 2026-11-12) after takedown run `docs/takedown/1718-20261112-160038/` failed green-suite; parent #1718 - Improvised this session: none - Chain: `Result.new` at `crc/filing.rb:28` resolves to `Crc::Result` ← no object owns facts read from parsed Ruby code, so each detector, lint check, and cop writes its own copy ← DESIGN (#1718; `docs/system-design-format/README.md:242`) - Root candidate: none found; searched ConstructorGraph, Holders visitor, Sources#path_for, Zeitwerk file map, nested Struct - Where: `plugins/os-sdlc/lib/os_sdlc/detector/constructor_graph/visitor.rb`, `detector/holders/visitor.rb`, `detector/sources.rb` - Session: 784c0808-1e40-4296-8f93-77c40ca419c2 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/784c0808-1e40-4296-8f93-77c40ca419c2.jsonl VERDICT: CREATE REASON: Jared ruled the split of #1718 (ruling 146); the backlog search found no open ticket with the same mechanism.
Author
Owner

Also blocked by #1741 (CodeShape::Definitions). #1729 builds only CodeShape::LexicalScope.

Also blocked by #1741 (CodeShape::Definitions). #1729 builds only CodeShape::LexicalScope.
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#1732
No description provided.