Add group D to the catalog with Active Record and Data Mapper #1550
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#1550
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
docs/system-design-format/pattern-landscape.mdmarks Active Record and Data Mapper asexpressible now, andcatalog/holds no group D pattern. The detector cannot present a data-mapping shape.Group D has no threshold.
OpportunityScan#groupscalls@thresholds.fetch(group)for every group ofCatalog.patterns, strict or loose. One group D pattern without a threshold therefore raisesKeyError, and pattern-matching.md section 5 says "A group with no threshold is an error".Section 9 of the same document says to measure precision "whenever a scale group is added". No run has measured group D.
Reproduce
n/a: this ticket adds catalog data; no defect exists to reproduce.
Approach
Threshold. Add
D: 1toCatalog.thresholds. This is the one open point of this ticket. Predicted value: 1. Reasons:How the new patterns enter convergence. Both patterns set
strict?: false, under the entry rule fromcatalog-group-a.Convergence#flagsdrops the matches of a loose pattern, soranked(:D)is empty. Group D has no calibrated threshold to protect, but it also has no precision figure, so loose is the safe entry. Convergence counts one group only (Convergence#linesgroups bypattern.group), so group D cannot change a group A or group C count in either case.The scratch run with both patterns strict gave these group D rows: os-backlog 0, os-me 1, os-sdlc 16. No review has read them, so they stay out of the ranking until a calibration run measures them.
opportunitiesprints a headergroup D (convergence >= 1)with no rows.Shape::UnclearRole#groupsselects strict patterns only, so theunclear-roledetail staysconvergence A:3 C:0and does not gainD:0.Effect on
present. The new patterns are loose, so their rows go to theloose_presentsection that #1548 adds. The scratch run gave these rows: os-backlog 29, os-me 8, os-sdlc 47. Nobody reviewed them. The rows of the current patterns stay the same.Order. Ship this ticket after
catalog-group-a, which replaces the test that says TXS is the one loose pattern.Pattern roles and rules. Each item quotes the
Revealing signalstext of the landscape row.AR): "A class holds state and domain behavior and does its own storage I/O; orSequel::Model/ActiveRecord::Basesuperclass (F1 sharpens)." RolesRecord,Client. Rule R1 reads "does its own storage I/O": a class that calls a record does no I/O of the same kind (Rule::BypassedIo, as in GATE R1). The role does not use the superclass, because the landscape names the first signal as the core signal. A first draft of R1 usedForbiddenIoonClient. It flagged every storage line of a calling class (24 lines in os-backlog). Do not use that form.DM): "A mapper does storage I/O, builds domain objects (Domain.new(row)), and reads their attributes to write; domain classes are pure." RolesMapper,Domain,Edge. Rule R1 reads "domain classes are pure": aDomainclass does no I/O, except onEdge. Rule R2 forbidsDomaintoMapper, because a domain class that calls its mapper reaches storage. No fact shows "reads their attributes to write", so a predicate cannot measure it.Required work:
id: "AR"inplugins/os-sdlc/lib/os_sdlc/system_model/catalog/active_record.rbid: "DM"inplugins/os-sdlc/lib/os_sdlc/system_model/catalog/data_mapper.rbstrict?: falseinplugins/os-sdlc/lib/os_sdlc/system_model/catalog/data_mapper.rbD: 1inplugins/os-sdlc/lib/os_sdlc/system_model/catalog.rbCatalog.patterns— check: presentDataMapperinplugins/os-sdlc/lib/os_sdlc/system_model/catalog.rbIDSin the catalog test — check: presentAR DMinplugins/os-sdlc/tests/system_model_catalog_test.rbgroup D thresholdindocs/system-design-format/pattern-matching.mdOrchestrator work: add one History row to
docs/implementation-status/os-sdlc-system-model.md.Rejected: strict patterns at threshold 1 — section 9 requires a precision measurement for a new scale group, and none exists. Threshold 2 — two patterns reach 2 only when both flag one file, and the scratch run found no such file. Skip a group with no threshold in
OpportunityScan#groups— section 5 calls that case an error.Acceptance criteria
Catalog.thresholdsis read, then it holds{ A: 3, C: 1, D: 1 }.opportunitiesruns over os-backlog, then the command exits 0 and printsgroup D (convergence >= 1).strict?, then each value is false.OpportunityScan#ranked(:D)runs, then the result is empty.opportunities --jsonoutput for os-backlog, os-me and os-sdlc before this ticket, when the command runs after this ticket, then theAandCentries ofgroupsare the same.opportunitiesoutput before this ticket, when the command runs after this ticket, then thepresentrows of strict patterns are the same, and each row of a new pattern is in theloose_presentsection.shapesruns after this ticket, then the detail is stillconvergence A:3 C:0.ARRecordrole tests it, then it fits.ARRecordrole tests it, then it does not fit.Recordclass and does storage I/O, whenARmatches the component, then R1 flags the I/O line of the caller.DMMapperrole tests it, then it fits.Domainwhen its I/O is removed and that is notEdge, whenDMmatches the component, then R1 flags the I/O line.Domainclass that calls aMapperclass, whenDMmatches the component, then R2 flags the line of that call.Owner sketch
Non-goals
Do not set a group D pattern to strict. Do not change the group A or group C threshold, the 0.05 threshold, or
Match#present?. Do not add a schema fact. Do not add a rule class.Retired tests
plugins/os-sdlc/tests/system_model_opportunity_scan_test.rb#test_thresholds_are_three_for_the_architectural_group_and_one_for_the_class_group
Origin
docs/system-design-format/pattern-landscape.mdmarks two group D rowsexpressible now, andCatalog.thresholdshas no group D entry.OpportunityScan#groupsneeds one. DESIGN:docs/system-design-format/pattern-matching.mdsection 5.plugins/os-sdlc/lib/os_sdlc/system_model/catalog.rbVERDICT: CREATE
Work started on branch ticket-1550.
Resolution
Done: Group D loose patterns Active Record and Data Mapper in the catalog; thresholds gain D: 1 with an amendment in pattern-matching.md.
Evidence: Implementation 234 complete; commit
d27dd847; suite gate passed; contract audit passed.Follow-ups: none