Lint lessons as YAML loaded into a Lesson object (ADR-0267, ADR-0268) #913
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#913
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
ADR-0267 decides that lint lessons are YAML files loaded into a
Lessonobject.Today a lesson is a Markdown file that
Lesson::Libraryreturns as a String.A lesson with a missing section is not caught at load.
The later-encounter reminder is a fixed constant, not lesson content.
Approach
Stage 1 of ADR-0268 builds the shared YAML file loader here, and only
Lesson::Libraryuses it.Lesson files are
plugins/os-sdlc/lint-lessons/<kebab-cop-name>.ymlwith the fieldscop,signal,sign_of,why,decision,correction,example(before,after).OsSdlc::Lessonis a concept root with data and no I/O, so it goes inmodel/lesson.rb.The loader goes in
adapter/yaml_file.rb(role: talks to a file) and its error inadapter/yaml_file/error.rb.Required work:
OsSdlc::YamlFile, which reads a YAML file and returns the parsed mapping, with nil for an empty file — check: presentclass YamlFileinplugins/os-sdlc/lib/os_sdlc/adapter/yaml_file.rbOsSdlc::YamlFile::Error < HarnessError, raised for a file that does not parse and for content that is not a mapping, with a message that names the file and the cause — check: presentHarnessErrorinplugins/os-sdlc/lib/os_sdlc/adapter/yaml_file/error.rbLessonvalue object built from the parsed data, with one reader per field, failing at load with a message that names the file and the missing field — check: presentclass Lessoninplugins/os-sdlc/lib/os_sdlc/model/lesson.rbLesson::Libraryread the.ymlfile throughYamlFileand return aLesson, or nil when no file exists — check: presentYamlFileinplugins/os-sdlc/lib/os_sdlc/adapter/lesson/library.rbLesson::Relayrender aLessonto the Markdown block and use itssignalas the later-encounter reminder — check: presentsignalinplugins/os-sdlc/lib/os_sdlc/presenter/lesson/relay.rbRelay::REMINDER— check: absentREMINDERinplugins/os-sdlc/lib/os_sdlc/presenter/lesson/relay.rbsdlc-sequel-dataset-result-compared.mdto.ymlwith the same content — check: presentsignal:inplugins/os-sdlc/lint-lessons/sdlc-sequel-dataset-result-compared.ymlsdlc-sequel-ruby-filter-after-all.mdto.ymlwith the same content — check: presentsignal:inplugins/os-sdlc/lint-lessons/sdlc-sequel-ruby-filter-after-all.ymlsdlc-sequel-inline-dataset-querylesson that #911 adds to.ymlwith the same content — check: presentsignal:inplugins/os-sdlc/lint-lessons/sdlc-sequel-inline-dataset-query.ymlsign_ofinplugins/os-sdlc/skills/mine-lints/references/implement-cop.mdOrchestrator work: delete the
.mdlesson files (no.mdmay remain inplugins/os-sdlc/lint-lessons/).Runs after #911. Ticket B (the move of the three existing readers) depends on this ticket.
Rejected: Markdown files; Markdown with YAML front matter — ADR-0267.
Acceptance criteria
signalline.lint-lessonsdirectory, when it is listed, then it holds no.mdfile.Owner sketch
Origin
Work started on branch ticket-913 through the os-sdlc pipeline.
Resolution
Done: Lint lessons are YAML loaded into OsSdlc::Lesson (model/lesson.rb). OsSdlc::YamlFile (adapter/yaml_file.rb) and YamlFile::Error are added and used by Lesson::Library. Lesson::Relay renders from the Lesson and uses its signal as the reminder. The three lessons are .yml; no .md remains. implement-cop.md describes the YAML form (ADR-0267, ADR-0268 stage 1).
Evidence: Branch ticket-913, commits
abd8e57candd9257a3a; os-sdlc implementation 18: 22 dispatches, 5 retries, one reroute after bound_exhausted at programmer-repair (the programmer role cannot delete files; the orchestrator removed the three .md files with git rm), required-work gate and full suite green, contract-auditor pass.Follow-ups: #914 moves the three existing YAML readers to YamlFile (ADR-0268 stage 2). Lens line A2 on top-level YamlFile: auditor proposal NONE, clears in #914. Workflow defect to capture: programmer role cannot delete files and the Runner commit omits staged deletions (seen in #908 and #913). History row added after merge.