Write the pattern catalog as Role predicates #1404
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#1404
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?
VERDICT: CREATE
Problem
The six patterns of the experiment exist only as a prose table. A detector cannot score a component against them until the catalog is data over
ClassFacts. #1412 shipped the fiveClassFactsfields (io,entry?,routes_to,holds_state?,calls) pluspure?, so the predicates can now be written.Reproduce
Output: nothing.
Approach
Write the catalog as data: HEX, LAY, P&F, CMD, REPO, TXS. Each
Patternhasid,roles(eachRolehas a name and a predicate overClassFacts),rules(allowed edges between role names, and forbidden rules each with an id and a sentence), andsource(the published reference from experiment section 1). Sources and prose role definitions:docs/system-design-format/proof/pattern-distance-experiment.mdsection 1. REPO's two predicates:docs/system-design-format/pattern-matching.mdsection 2.The docs give predicates only for REPO. This ticket fixes the rest as follows (over a
ClassFactsf;storage?meansf.io.any? { |i| i.kind == :storage },terminal?meansf.io.any? { |i| i.kind == :terminal }):f.entry? && !f.calls.empty?; UseCasef.pure? && !f.entry?; Portf.pure? && f.calls.empty?; DrivenAdapter!f.pure? && !f.entry?; CompositionRootf.entry? && f.routes_to.empty? && f.calls.size > 1.f.entry? || terminal?; Domainf.pure?; DataSourcestorage?.!f.pure? && f.calls.empty?; Filterf.pure? && !f.holds_state?; Sink!f.pure? && !f.entry?; Pipef.pure? && f.calls.size > 1.!f.routes_to.empty?; Command!f.entry? && f.routes_to.empty? && !f.calls.empty?; Receiver!f.pure? && f.calls.empty?; Clientf.entry? && f.routes_to.empty?.storage? && f.routes_to.empty? && !f.entry?; Entityf.holds_state? && !storage?; Mapperf.pure? && f.calls.empty?; Client!storage? && !f.calls.empty?.f.entry? && !f.calls.empty?; Script!f.entry? && !f.calls.empty? && !terminal?; Gateway!f.pure? && f.calls.empty? && !f.entry?.Rules per pattern are the allowed-edge list and the forbidden rules R1.. from experiment section 1, carried as data (id plus sentence); evaluating a rule against a component belongs to step 5, not here.
Required work:
Pattern,Role, andRulevalues under the system-model library — check: presentRuleinplugins/os-sdlc/lib/os_sdlc/system_model/pattern.rbCockburninplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbPOSA1inplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbHohpeinplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbFront Controllerinplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbEvansinplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbTXSinplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbCatalogthat holds the six patterns and finds one by id — check: presentCataloginplugins/os-sdlc/lib/os_sdlc/system_model/**/*.rbAcceptance criteria
ClassFactswithentry?true and a non-emptycalls, when HEX's DrivingAdapter predicate runs, then it returns true; given the same facts, when HEX's UseCase predicate runs, then it returns false.ClassFactswith emptyio, when LAY's Domain predicate runs, then it returns true; given aClassFactswith:storageio, when LAY's DataSource predicate runs, then it returns true.ClassFactswith emptyio,holds_state?false, and one entry incalls, when P&F's Filter predicate runs, then it returns true.ClassFactswith a non-emptyroutes_to, when CMD's Router predicate runs, then it returns true; given aClassFactswith emptyroutes_to, then it returns false.ClassFactswith:storageio, no routing, andentry?false, when REPO's Repository predicate runs, then it returns true; given aClassFactswithholds_state?true and no:storageio, when REPO's Entity predicate runs, then it returns true.ClassFactswithentry?false, a non-emptycalls, and no:terminalio, when TXS's Script predicate runs, then it returns true; given the same facts with:terminalio, then it returns false.system-modelrun wrote forplugins/os, when each entry is rebuilt as aClassFactsand REPO's Repository predicate runs onHandoff::Store, then it returns true.Owner sketch
Non-goals
Scoring,
Match, andOpportunitybelong to build-plan step 5. Evaluating allowed and forbidden edges against a component belongs to step 5. Updatingpattern-matching.mdsection 2 with the predicates above is done by hand after this ticket closes (the pipeline cannot check docs).Origin
80a39130)Blocked by #1412 as well: #1403 shipped ClassFacts with io only (main
47c7f64e). entry?, routes_to, holds_state?, calls, and writing the facts to the output are in #1412.Work started on branch ticket-1404 via /os-sdlc:implement (session 47f54f99). Criteria rewritten first: one per pattern; non-REPO predicates fixed in the Approach.
Resolution
Done: Pattern catalog as data: Pattern, Role, Rule, Rules values; Catalog with HEX, LAY, P&F, CMD, REPO, TXS, each with role predicates over ClassFacts, allowed edges, forbidden rules, and source; ClassFacts gains storage? and terminal?.
Evidence: Implementation 184 complete, 8 dispatches, 0 retries, suite green; behavior-verifier passed all nine criteria; test plugins/os-sdlc/tests/system_model_catalog_test.rb.
Follow-ups: 1) port the non-REPO predicates into docs/system-design-format/pattern-matching.md section 2 by hand this session (stated in ticket Non-goals); 2) worktree guard blocked the behavior-verifier's subagent-stop in every form, to be captured as its own ticket this session.