Repository navigation
Reference: read only SMF documents, one-pager fields, checked build ids - #40
Merged
anykolaiszyn merged 2 commits intoOct 9, 2026
Merged
Conversation
Three additive changes to the reference tools and spec. Validator scope (#36): smf.py reads a file as SMF only when one of its documents carries the smf: key or names an SMF kind. Other YAML or JSON under the path is skipped and counted, and dot-folders are not walked. A document that names an SMF kind and omits smf: is still an error. validate and test gain --format json. One-pager fields (#37): MetricContract gains optional plain_words, inclusions, not_certified_for, change_note and sign_off {by, date}; Concept gains plain_words, change_note and sign_off. The sign-off date key is "date" because YAML 1.1 parsers read a bare "on" key as true. Service Gross Margin in the example carries the values from docs/metric-contract.md. Build ids (#39): Binding gains an optional id. validate checks that a claim's execution.binding names a build record in the set, by id or as <platform>:<ref>, and that the build belongs to the claim's contract. Both examples validate with 0 errors and 0 warnings; test counts are unchanged (7/0/1 and 9/0/2); link check and strict site build pass. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01251FoFjbkpn1d7jeNZYjAZ
A YAML file that fails to parse is reported only when it has a top-level smf: line. Other tools' YAML (mkdocs.yml with Python tags, templated manifests) is skipped and counted, so pointing validate at a repository root works. Found by running validate on this repository. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01251FoFjbkpn1d7jeNZYjAZ
anykolaiszyn
marked this pull request as ready for review
October 9, 2026 16:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, for owner review. Per GOVERNANCE.md these are spec changes, so the three proposal issues should stay open for comment before this merges. Closes #36, closes #37, closes #39. It does not touch #38 (contract versions), which needs a decision first.
What changes
1. The CLI reads only SMF documents (#36)
smf:or names an SMFkind. Any other YAML or JSON under the path is skipped and counted in the summary line. Folders whose name starts with a dot are not walked.kindand omitssmf:is still an error. A junk document inside an SMF file is still an error. A file that cannot be parsed is an error only when it has a top-levelsmf:line.validateandtestaccept--format json.reference/README.mdgains "Where the files live".python reference/tools/smf.py validate . --strictnow passes at the root of this repository (78 documents, 16 files skipped). Before, it failed onmkdocs.ymland the workflow files.2. Every row of the one-pager has a field (#37)
MetricContract: optionalplain_words,inclusions,not_certified_for,change_note,sign_off {by, date}.Concept: optionalplain_words,change_note,sign_off.Ownership.steward.docs/metric-contract.md; nothing was invented.change_noteandsign_offare not used in the examples, because the docs give no values for them.3. A claim's build is checked (#39)
Binding: optionalid; a duplicate is an error.validate:ClaimTrace.execution.bindingmust name a build record in the set, byBindingid or as<platform>:<ref>. No match is a warning, and an error in strict mode. A match that belongs to a different Metric Contract than the claim'smeasurementis an error.Things to look at
date, noton. The issue proposed{by, on}. YAML 1.1 parsers, including the one this CLI uses, read a bareonkey as the booleantrue, sosign_off: { by: Controller, on: 2026-07-01 }failed validation. Issue Proposal: fields for the one-pager rows the schemas cannot store (plain words, not approved for, change note, sign-off) #37 is updated to match.FAILED:summary line, so text and JSON output have the same shape. Exit codes are unchanged.test --format jsoncovers results only. Its early exits (no documents, noTestCase, unreadable results file) still print a text error and a non-zero exit code.resolveandimport-csvare untouched.python site/build.py,_site_src/and_site/hold copies of the examples, sovalidate .at the root reports duplicates until they are removed. They are gitignored and CI validates the example folders, so nothing breaks; say so if you want them skipped by name.Checks
validate --strictpasses forreference/examples/gross-marginandreference/examples/northwind(0 errors, 0 warnings)testpasses for both examples (7 / 0 / 1 and 9 / 0 / 2, unchanged)python reference/tools/check-links.pyreports 0 problems (156 links)python site/build.py && mkdocs build --strictpassesvalidateandtesta JSON output #36, Proposal: fields for the one-pager rows the schemas cannot store (plain words, not approved for, change note, sign-off) #37, Proposal: give build records an id and check the build a claim names #39)Checked by hand, not by an automated test, since the repository has no test suite: a repository-root layout with a workflow, a configuration file, a data contract and a results file; an SMF kind with no
smf:key; a junk document beside valid ones; a claim with a misspelled build, a claim naming another contract's build, a claim using aBindingid, a duplicateBindingid; the new fields accepted and asign_offwith no date rejected; both JSON outputs parsed. Run locally on Python 3.13; CI covers 3.9 and 3.12.🤖 Generated with Claude Code
https://claude.ai/code/session_01251FoFjbkpn1d7jeNZYjAZ
Generated by Claude Code