Add a forbidden-edge rule evaluator that returns misfits for a pattern #1483
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1483
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
No code evaluates a pattern's allowed and forbidden edge rules.
Pattern::RuleisData.define(:id, :text)andPattern#forbidden_ruleonly looks a rule up by id. Runs 1 and 2 had no script: an agent read the code and counted each misfit by hand. The pattern-opportunity detector (#1430) needs misfits to score a Match (pattern-matching.md section 2).Reproduce
n/a: capability does not exist. See
plugins/os-sdlc/lib/os_sdlc/system_model/pattern/rule.rb.Approach
Add a rule evaluator. It checks a Pattern's allowed and forbidden edge rules against a component's classes and returns misfits
[{rule:, path:, line:}], themisfitsfield of the Match type in pattern-matching.md section 2. Pattern rule data stays data: no pattern ID in evaluator code. This ticket blocks #1430. README section 6 step 10 names it as a precondition.Required work:
Pattern::Rulea checkable form for edge rules — check: presentforbiddeninplugins/os-sdlc/lib/os_sdlc/system_model/pattern/rule.rbmisfitsinplugins/os-sdlc/lib/os_sdlc/system_model/pattern/*.rbAcceptance criteria
proof/pattern-distance-experiment.md.proof/pattern-distance-run-2.md.Non-goals
The opportunity detector itself (#1430).
Origin
1b4ea2d5)VERDICT: CREATE
Work started on worktree branch worktree-agent-a13870096ee8af21e (agent worktree). TDD: rule evaluator returning misfits [{rule:, path:, line:}].
Resolution
Done: Forgejo-free evaluator: Pattern#match(component) returns a Match with assignment, misfits [{rule:, path:, line:}] and distance; rules are data (ForbiddenEdge, ForbiddenIo, MixedRoles, Unmeasured); no pattern ID in evaluator code; a stub 7th pattern test passes unchanged. Hand counts reproduced for handoff HEX R1 and B7 HEX; the other hand flags need facts ClassFacts lacks (decides?, holds_state? scope, io_signature, warn/exit terminal io, call line numbers).
Evidence: commit
fd0ffb18, merged to main at496c2184and pushed; ruby plugins/os-sdlc/tests/all.rb: 2928 runs, 0 failures, 35.1s; tests system_model_pattern_match_test.rb and system_model_pattern_match_hand_counts_test.rbFollow-ups: Missing facts, Match listing unmeasured rules, and per-(rule, class) distance are absorbed into #1482 part A (in progress); no new tickets