|
| 1 | +# CEDV-E / Parse Utility Convergence v1 |
| 2 | + |
| 3 | +## Status |
| 4 | + |
| 5 | +Protocol checker utility convergence pass. |
| 6 | + |
| 7 | +## Function |
| 8 | + |
| 9 | +This file records the first CEDV parse-utility convergence pass. |
| 10 | + |
| 11 | +The goal is narrow: |
| 12 | + |
| 13 | +> extract the repeated tiny YAML parser used by protocol-facing CEDV checkers into a shared utility module, without changing protocol semantics. |
| 14 | +
|
| 15 | +This is not a general YAML framework. |
| 16 | +It is a utility cleanup for the current protocol example subset. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Entry context |
| 21 | + |
| 22 | +Before this pass, repeated `parse_simple_yaml()` implementations existed in: |
| 23 | + |
| 24 | +- `scripts/check_cedv_relation_basis_validation.py`; |
| 25 | +- `scripts/check_cedv_example_registry.py`. |
| 26 | + |
| 27 | +Those implementations were functionally similar and existed only because early protocol checkers were grown one at a time. |
| 28 | + |
| 29 | +After CEDV-D, the remaining duplication was no longer primarily vocabulary drift. |
| 30 | +It was small parser utility duplication. |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Utility added |
| 35 | + |
| 36 | +This pass adds: |
| 37 | + |
| 38 | +- `scripts/lib/simple_yaml.py`. |
| 39 | + |
| 40 | +The utility exports: |
| 41 | + |
| 42 | +- `parse_simple_yaml(text: str) -> dict[str, Any]`. |
| 43 | + |
| 44 | +Supported subset: |
| 45 | + |
| 46 | +- top-level scalar keys; |
| 47 | +- top-level list keys; |
| 48 | +- list values that are scalars; |
| 49 | +- list values that are simple one-level maps, currently used for `links`. |
| 50 | + |
| 51 | +This intentionally covers only the small frontmatter-like subset used by current CEDV protocol examples. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Checker changes |
| 56 | + |
| 57 | +### `scripts/check_cedv_relation_basis_validation.py` |
| 58 | + |
| 59 | +Now imports: |
| 60 | + |
| 61 | +- `parse_simple_yaml` from `scripts.lib.simple_yaml`. |
| 62 | + |
| 63 | +### `scripts/check_cedv_example_registry.py` |
| 64 | + |
| 65 | +Now imports: |
| 66 | + |
| 67 | +- `parse_simple_yaml` from `scripts.lib.simple_yaml`. |
| 68 | + |
| 69 | +The local parser copies were removed from both files. |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## Acceptance result |
| 74 | + |
| 75 | +CEDV-E / PARSEUTIL1 is accepted at the following level: |
| 76 | + |
| 77 | +> `PASS_FIRST_PROTOCOL_PARSE_UTILITY_CONVERGENCE` |
| 78 | +
|
| 79 | +Meaning: |
| 80 | + |
| 81 | +- repeated tiny YAML parser logic has been removed from the two current CEDV protocol-facing checkers that used it; |
| 82 | +- parsing remains deliberately scoped to the present protocol example subset; |
| 83 | +- protocol semantics are unchanged; |
| 84 | +- no general YAML parsing framework has been introduced. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Retained holds |
| 89 | + |
| 90 | +This pass does **not** claim: |
| 91 | + |
| 92 | +- full YAML compliance; |
| 93 | +- frontmatter parsing for all repository documents; |
| 94 | +- markdown body parsing; |
| 95 | +- typed schema validation; |
| 96 | +- replacement of proper YAML tooling if the data model grows; |
| 97 | +- parser ownership over case-specific page or public-layer files. |
| 98 | + |
| 99 | +The shared utility is allowed because the duplicated parser was already present in multiple protocol-facing CEDV checkers. |
| 100 | +It should not be expanded casually into a half-parser empire. |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## Boundary rule |
| 105 | + |
| 106 | +Use `scripts/lib/simple_yaml.py` only for the current simple protocol object subset. |
| 107 | + |
| 108 | +If CEDV examples start needing nested maps beyond one level, multiline scalars, anchors, comments with semantic meaning, or richer YAML behavior, the correct move is to deliberately adopt proper YAML parsing rather than quietly accreting features here. |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## Remaining debt |
| 113 | + |
| 114 | +Likely future pressure points: |
| 115 | + |
| 116 | +1. A small protocol checker utility package may eventually group `read_text`, registry loading, and object loading helpers. |
| 117 | +2. Relation admissibility rules remain embedded in `check_cedv_relation_basis_validation.py`; they may later deserve a declarative relation matrix. |
| 118 | +3. Example registry and relation-basis validation still load objects separately; a shared CEDV object loader may become warranted if a third checker repeats the pattern. |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +## Next recommended move |
| 123 | + |
| 124 | +The natural continuation is: |
| 125 | + |
| 126 | +> `CEDV-F / RELMATRIX1` |
| 127 | +
|
| 128 | +Purpose: |
| 129 | + |
| 130 | +> move the current relation source/target admissibility rules out of imperative checker code and into a small explicit relation-admissibility matrix, if the next audit confirms that relation rules are becoming the next hidden protocol surface. |
| 131 | +
|
| 132 | +Do not start this unless the matrix would simplify actual checker logic. |
0 commit comments