Skip to content

family.py and shape_materialize.py: the helpers that ask a template's own YAML reader and validator about a manifest's values exist twice, for project.yaml (#314) and for family.yaml (#397) #470

Closed as not planned

Description

@brettheap

Lane: openreposhape-5 (openRepoShape-5)

(lane openRepoShape-5, 2026-10-12T20:39:32Z)

Found by lane 5 while landing #397 (#307). Not claimed.

#314 (landed as 3ef059c) and #397 (head abb27e6, cut from c7c02fa, so before #314) each ask the new file's OWN YAML reader (repo_shape.parse_yaml) and its OWN validator about the values a tool is about to write, before anything is created:

#397's code comment (scripts/family.py:1028-1033 at abb27e6) and its description said that whichever of the two landed second would unify them. #314 landed first, and #397 leaves the two as they are. This issue is the unification.

The helpers that do the same job. Line numbers are at 3ef059c for scripts/shape_materialize.py and at abb27e6 for scripts/family.py.

job #314, scripts/shape_materialize.py #397, scripts/family.py how they differ
load the template's own validator by path, once per path manifest_validator :2226, _VALIDATORS :2223, VALIDATOR_ASKS :2202 family_validator :1091, _VALIDATORS :1072, FAMILY_VALIDATOR_ASKS :1043 the template directory, the validator file, the module name and the names asked of it; the family's also catches SystemExit while loading
say a validator cannot be asked _validator_unusable :2271 (manifest-validator-unusable) _validator_unusable :1075 (family-validator-unusable) the refusal code and the file it names
say what the reader made of a value, show a line, read one line _reading_in_words :2287, _line_shown :2302, _reading_of :2308 _reading_in_words :1127, _line_shown :1142, _reading_of :1148 none: compared as syntax trees with the docstrings left out, the code is the same
find the template lines whose value the reader would not read back as typed _misread_rows :2322, _placeholders_of :2210, TEMPLATED_YAML :2207 _misread_rows :1162, FAMILY_TEMPLATED_YAML :1048, and PLACEHOLDER_RE.findall inline at :1171 which templated files are walked; #314's rows carry the file name, the family's do not
say it as a sentence manifest_misreads :2344, misread_placeholders :2367 family_manifest_misreads :1184 the file named, and "project's" or "holder's" reader; misread_placeholders has no counterpart
turn the validator's findings into one sentence for each value FINDING_PLACEHOLDER :2380, _FINDING_RE :2387, _code_of :2391, _sentences_of :2398, manifest_invalid :2428 FINDING_PLACEHOLDER :1061, _FINDING_RE :1068, _sentences_of :1205, family_manifest_invalid :1229 the placeholder table and the validator named in the sentence; manifest_invalid takes ignore and not_text (adopt uses them), asks validator._findings(manifest, policy, None) and drops its WARNINGs; the family's asks Report() and _check_envelope(manifest, policy, report), catches SystemExit, and refuses a Report with no findings or a finding that is not text
the two remediation texts, and the order the two questions are asked in MANIFEST_MISREAD_REMEDIATION :2487, MANIFEST_INVALID_REMEDIATION :2499, manifest_value_problems :2505, refuse_manifest_values :2528 MANIFEST_MISREAD_REMEDIATION :1281, MANIFEST_INVALID_REMEDIATION :1291, refuse_unholdable_manifest :1314, _manifest_flags :1299 the words about the file; refuse_manifest_values takes the tool's own prefix; the family names a value no flag supplied by where it came from

The three tools each also hold a table that names a placeholder by the flag a person typed: MANIFEST_FLAGS at scaffold-project.py :104 and adopt-project.py :1814 (3ef059c), and at scripts/family.py :1052 (abb27e6).

What unifying them would mean. One definition of each helper above, called by scaffold-project.py, adopt-project.py and family.py, with what differs (the last column) supplied by each caller or kept by the tool that owns it. This issue proposes no design beyond that.

What it must not change.

The comment at scripts/family.py :1028-1033 (abb27e6) that says the second to land unifies them is stale now that #314 landed first, and goes with the unification.

Refs #314, #261, #397, #307.

Activity

  1. brettheap commented on Oct 12, 2026

    @brettheap
    ContributorAuthor

    Lane: openreposhape-5 (openRepoShape-5)

    (lane openRepoShape-5, 2026-10-12T21:28Z) Moved to #459's checklist (#459 (comment)). Brett Heap ruled on 2026-10-12 that a new finding from review goes on its area's checklist rather than into a new issue. This lane filed this one before reading that ruling. The table above stays as the checklist item's detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions