Repository navigation
fix: ship the record table shape in the templates and the declared gate commands - #6
Merged
Merged
Conversation
The documented first step for an operator is to copy a schema template to the record name its gate expects and then append rows. Three of the four record templates ended at a bare "## Rows" / "## Lease rows" heading with no table under it, so the copied record was rejected by its own gate with "no table parsed" (exit 2) and no role had a table to append a row to. The in-flight template now also carries the explicit empty-state row its gate skips, so a fresh in-flight record is checkable before any claim exists. The README's Use section now shows the copy step and the four record gates as runnable commands, and its gate table names the same fixture and roster arguments as protean-ingredient.json for the rotation gate, which the previous row could not satisfy after installation because tests/ is not part of the payload. Verified: python3 -m unittest discover -s tests passes (144 tests, up from 137); the new tests.test_gates.TestShippedTemplates cases fail against the previous templates and pass after the change; every gate declared in protean-ingredient.json exits 0 from a fresh clone and from an installed target.
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.
Closes #5.
Problem
The documented first step for a new user of this ingredient does not work, and it
does not heal when the roles do their part.
The same for
records/INFLIGHT.md(no '## Lease rows' table parsed) andrecords/LEARNINGS.md(no '## Rows' table parsed). Appending a fully formed row tothe copied record still fails, because the gates'
parse_section_tableconsumes thefirst pipe-delimited line as the table header, so with only a data row present the
record can never become parseable.
Cause:
records/ROTATION-STATE.md.tmpl,records/LEARNINGS.md.tmpl, andrecords/INFLIGHT.md.tmplended at a bare## Rows/## Lease rowsheading. Eachshipped its columns as a definition table under
## Columns (fixed), but not therecord's own table header, which is the part the gate parses.
records/CONTRIB-STATE.md.tmplalready ships that shape and is the model for thischange.
The same path also declared the rotation gate two different ways: the README named
tests/fixtures/valid/ROTATION-STATE.md, which cannot work after installation becausetests/is not in the payload, whileprotean-ingredient.jsonnamesrecords/examples/valid/ROTATION-STATE.md --roster records/examples/valid/ROSTER.txt.The README's Use block was six
<records>placeholder lines with no expansion rule,and five of the six failed when run as shown.
What changed
records/ROTATION-STATE.md.tmpl: carries the 9-column table header its gate reads,in the gate's column order.
records/LEARNINGS.md.tmpl: carries the 9-column table header its gate reads.records/INFLIGHT.md.tmpl: carries the 11-column table header and the explicit(empty state)row its gate skips, so a fresh in-flight record is checkable beforeany claim exists.
README.md: the Use block is now the copy step plus the four record gates asrunnable commands, with the exit-2 semantics of a record that has no row yet stated
plainly; the gate table's rotation row is the descriptor's command; the paragraph
below the table now names
protean-ingredient.jsonas authoritative and says why nodeclared command may point into
tests/.tests/test_gates.py:TestShippedTemplatespins each shipped template to itsgate's column set and pins the copy path, so a template that loses its table turns
the suite red.
CHANGELOG.md: the entry for this change, in the repository's existing format.No gate, payload, install target, gate name, or descriptor changed; the change is a
compatible addition per
CONTRIBUTING.md.Verification
python3 -m unittest discover -s tests -p 'test_gates.py'fails onthe four new template cases against the previous templates
(
test_rotation_template_carries_the_gate_columns,test_learnings_template_carries_the_gate_columns,test_inflight_template_carries_the_gate_columns,test_copied_inflight_template_is_checkable), and passes after the change.python3 -m unittest discover -s tests: 144 tests, OK (137 before).protean-ingredient.jsonexits 0 from a fresh clone and froman installed target.
contribution-state copies pass immediately (
scanned=0); the rotation and learningscopies report missing input (exit 2) until one row is appended, and pass with one
appended row (
scanned=1, violations=0, exit 0).Gatessection's internal-name row and all other declared rows are unchanged.Risk
Documentation and record templates only. No gate logic, no descriptor, no payload
contents. The three changed templates are copied verbatim by
install.sh, so anexisting target that re-installs gains the table header and an in-flight empty-state
row; a target that already copied a template keeps its own record file.
Exclusions, reported in the issue rather than fixed here
check-contrib-state.pyexits 0 withscanned=0for an absent record when nowrite query is passed.
records/examples/andtests/fixtures/have drifted apart in two files.repositories' published tags; that is not fixable in this repository and is filed
against the composer.