Detect the edge: an Edge role exempts adapters from core I/O rules #1504

Closed
opened 2026-11-01 18:00:23 +00:00 by jared · 6 comments
Owner

Problem

The pattern detector puts edge classes in the core. UseCase, Domain and "not Repository" came from decides? alone, so ForbiddenIo flagged an adapter with one if as core with leaked I/O. On main 6759ca0c, 49 of 51 group A findings came only from HEX R1, LAY R2 and REPO R2. Jared ruled on 2026-11-01 (accepted prediction): measure the candidate edge facts over the 18 judged findings, adopt the fact that the data picks, and build the fact and the role.

Reproduce

n/a: design change; the measurement is ruby docs/system-design-format/proof/run-4/measure_edge.rb.

Approach

Built on branch worktree-agent-a4e30a34434629c5c (waits for merge). ClassFacts gains defs and Decision#sends. leaks_io? is true when a decision that its predicate does not test by I/O shares a caller with I/O. Catalog::Edge = the class does I/O and leaks_io? is false. HEX R1 has except: [:Edge]; LAY Domain and REPO Repository use Edge.

Results: 14 of 18 judged classes agree with the expert. Run 3 precision stays 8/9 per line and 10/12 per finding; recall goes from 29/39 to 28/39. Group A goes from 8 to 4 (os-me) and from 43 to 34 (os-sdlc). Proof: docs/system-design-format/proof/pattern-distance-run-4.md.

Required work: none beyond the acceptance criteria.

Acceptance criteria

  1. Given an adapter whose decisions do not steer its I/O, when system-model opportunities runs, then HEX R1, LAY R2 and REPO R2 do not flag its I/O lines.
  2. Given a class where a domain decision shares a caller with I/O, when system-model opportunities runs, then the three rules still flag its I/O lines.

Origin

  • Trigger: expert check 2026-11-01 of group A from plugins/os-sdlc/bin/system-model opportunities on os-me and os-sdlc
  • Improvised this session: none
  • Chain: noise in group A ← adapters play UseCase/Domain ← roles use decides? alone ← DESIGN (plugins/os-sdlc/lib/os_sdlc/system_model/catalog/hex.rb, layers.rb, repository.rb)
  • Root candidate: none found; searched edge, adapter, HEX R1, LAY R2, REPO R2, ForbiddenIo, leaks_io, Edge role, pattern detector, system-model
  • Where: plugins/os-sdlc/lib/os_sdlc/system_model/catalog/, class_facts.rb
  • Session: 313ee80d-b132-4de6-a01d-e1a57fbd3450
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/313ee80d-b132-4de6-a01d-e1a57fbd3450.jsonl

VERDICT: CREATE

## Problem The pattern detector puts edge classes in the core. UseCase, Domain and "not Repository" came from `decides?` alone, so `ForbiddenIo` flagged an adapter with one `if` as core with leaked I/O. On main 6759ca0c, 49 of 51 group A findings came only from HEX R1, LAY R2 and REPO R2. Jared ruled on 2026-11-01 (accepted prediction): measure the candidate edge facts over the 18 judged findings, adopt the fact that the data picks, and build the fact and the role. ## Reproduce n/a: design change; the measurement is `ruby docs/system-design-format/proof/run-4/measure_edge.rb`. ## Approach Built on branch `worktree-agent-a4e30a34434629c5c` (waits for merge). ClassFacts gains `defs` and `Decision#sends`. `leaks_io?` is true when a decision that its predicate does not test by I/O shares a caller with I/O. `Catalog::Edge` = the class does I/O and `leaks_io?` is false. HEX R1 has `except: [:Edge]`; LAY Domain and REPO Repository use Edge. Results: 14 of 18 judged classes agree with the expert. Run 3 precision stays 8/9 per line and 10/12 per finding; recall goes from 29/39 to 28/39. Group A goes from 8 to 4 (os-me) and from 43 to 34 (os-sdlc). Proof: `docs/system-design-format/proof/pattern-distance-run-4.md`. Required work: none beyond the acceptance criteria. ## Acceptance criteria 1. Given an adapter whose decisions do not steer its I/O, when `system-model opportunities` runs, then HEX R1, LAY R2 and REPO R2 do not flag its I/O lines. 2. Given a class where a domain decision shares a caller with I/O, when `system-model opportunities` runs, then the three rules still flag its I/O lines. ## Origin - Trigger: expert check 2026-11-01 of group A from `plugins/os-sdlc/bin/system-model opportunities` on os-me and os-sdlc - Improvised this session: none - Chain: noise in group A ← adapters play UseCase/Domain ← roles use `decides?` alone ← DESIGN (`plugins/os-sdlc/lib/os_sdlc/system_model/catalog/hex.rb`, `layers.rb`, `repository.rb`) - Root candidate: none found; searched edge, adapter, HEX R1, LAY R2, REPO R2, ForbiddenIo, leaks_io, Edge role, pattern detector, system-model - Where: plugins/os-sdlc/lib/os_sdlc/system_model/catalog/, class_facts.rb - Session: 313ee80d-b132-4de6-a01d-e1a57fbd3450 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/313ee80d-b132-4de6-a01d-e1a57fbd3450.jsonl VERDICT: CREATE
Author
Owner

Built on branch worktree-agent-a4e30a34434629c5c: 1814bfef (fact, role, tests), 657eaca1 (run 4 proof, docs, regenerated facts). Gate green: 3072 runs, 0 failures, 40.8s. Waits for merge; close after merge.

Built on branch worktree-agent-a4e30a34434629c5c: 1814bfef (fact, role, tests), 657eaca1 (run 4 proof, docs, regenerated facts). Gate green: 3072 runs, 0 failures, 40.8s. Waits for merge; close after merge.
Author
Owner

Skeptic DROP (depth-1, parent AI-created): block_given? counts as a decision (P2). Reason: precision gap already recorded as a known residual in pattern-distance-run-4.md (TranscriptReader); not filed.

Skeptic DROP (depth-1, parent AI-created): block_given? counts as a decision (P2). Reason: precision gap already recorded as a known residual in pattern-distance-run-4.md (TranscriptReader); not filed.
Author
Owner

Skeptic DROP (dead code, depth-1): Pattern#forbidden_rule at plugins/os-sdlc/lib/os_sdlc/system_model/pattern.rb:12 raises NameError (Rule does not resolve) and has no callers. Delete it in a later pass over pattern.rb; not filed.

Skeptic DROP (dead code, depth-1): Pattern#forbidden_rule at plugins/os-sdlc/lib/os_sdlc/system_model/pattern.rb:12 raises NameError (Rule does not resolve) and has no callers. Delete it in a later pass over pattern.rb; not filed.
Author
Owner

Skeptic DROP (depth-1): entry test that reaches past bin/ (P2). Runners and presenters are most of the remaining os-sdlc group A noise (run 4 top ten); not filed.

Skeptic DROP (depth-1): entry test that reaches past bin/ (P2). Runners and presenters are most of the remaining os-sdlc group A noise (run 4 top ten); not filed.
Author
Owner

Resolution

Done: Edge role (!pure? && !leaks_io?) exempts adapters from HEX R1, LAY Domain, REPO Repository; leaks_io? = a decision that does not test I/O but sits on a path that reaches I/O

Evidence: commits 1814bfef, 657eaca1 on main (pushed); suite 3072 runs green in a clean worktree of main; run 4 proof docs/system-design-format/proof/pattern-distance-run-4.md: 14/18 judged classes agree, run 3 holdout precision unchanged (8/9 line, 10/12 finding), recall 29→28 (W4, no verdict); group A os-me 8→4 (4/4 plausible), os-sdlc 43→34

Follow-ups: #1495 (nested Data.define credit, P1 requested); block_given?, entry-test-past-bin/, Pattern#forbidden_rule dropped by skeptic, noted as comments on #1504

## Resolution **Done:** Edge role (!pure? && !leaks_io?) exempts adapters from HEX R1, LAY Domain, REPO Repository; leaks_io? = a decision that does not test I/O but sits on a path that reaches I/O **Evidence:** commits 1814bfef, 657eaca1 on main (pushed); suite 3072 runs green in a clean worktree of main; run 4 proof docs/system-design-format/proof/pattern-distance-run-4.md: 14/18 judged classes agree, run 3 holdout precision unchanged (8/9 line, 10/12 finding), recall 29→28 (W4, no verdict); group A os-me 8→4 (4/4 plausible), os-sdlc 43→34 **Follow-ups:** #1495 (nested Data.define credit, P1 requested); block_given?, entry-test-past-bin/, Pattern#forbidden_rule dropped by skeptic, noted as comments on #1504
jared closed this issue 2026-11-01 18:03:16 +00:00
Author
Owner

Capture dropped by ticket-skeptic (2026-11-01): a 'decision beside I/O vs decision feeding I/O' leak-rule ticket names no hand-labelled false finding; the run 4 addendum lists #6, #11, #15 as true leaks. Re-file only after one of the 13 same-shape os-sdlc group A findings is hand-labelled noise.

Capture dropped by ticket-skeptic (2026-11-01): a 'decision beside I/O vs decision feeding I/O' leak-rule ticket names no hand-labelled false finding; the run 4 addendum lists #6, #11, #15 as true leaks. Re-file only after one of the 13 same-shape os-sdlc group A findings is hand-labelled noise.
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#1504
No description provided.