Skip to content

feat(grammar): conventions registry, template conditions and a separatrix-distance base - #38

Merged
Simon-McIntosh merged 173 commits into
iterorganization:mainfrom
Simon-McIntosh:main
Oct 18, 2026
Merged

Simon-McIntosh merged 173 commits into
iterorganization:mainfrom
Simon-McIntosh:main

Conversation

@Simon-McIntosh

Copy link
Copy Markdown
Collaborator

Summary

This brings the fork's main up to date: 173 commits since v0.9.3, ahead of the next release. Most of them are planning and review records under docs/. The product changes add a conventions registry and extend the grammar vocabulary.

Conventions registry

  • Registry, loaders and accessor. vocabularies/conventions/ holds concepts.yml, notation.yml and templates.yml, with token-validating loaders and the parse-selecting select_conventions accessor in grammar/terms.py.
  • Entries for the WEST roster. The roster resolves to these entries. The plasma boundary is the last closed magnetic flux surface. The midplanes sit at the data's midplane height. Internal inductance is li(3).
  • Binary-operator templates. Ratio, difference and product names open with their operator phrase. Convention selection keys indexed derivatives and ratio names by their registry tokens.
  • Template conditions and notes. A template may require or exclude tokens and carry a note. A conditioned entry wins over its unconditioned sibling.
  • Rendered separating sentences. template_sentences renders the sentences that keep near-duplicate names apart, each exactly once on the names it describes:
    • cold or hot neutral temperature;
    • unqualified triangularity;
    • total electron density.

Grammar vocabulary

  • Token definitions. Population, zone and aggregation tokens carry definitions that render.
  • New base. separatrix_distance is a new physical base: the distance of a position from the magnetic separatrix, positive outside it. radial_separatrix_distance_at_outboard_midplane now decomposes as component radial, base separatrix_distance, position outboard_midplane. Before, it parsed as a distance in the separatrix zone.
  • Locus definitions. They now state what the concept registry states, and name no data-dictionary field, IDS path or option value. outboard_midplane_separatrix is defined as the separatrix crossing of the midplane height on the low-field side.

Tests

  • Every behaviour above has a test.
  • Each change's evidence record shows its new test failing against the unchanged code.
  • The grammar suite passes at the fork's head.

Plans and evidence: concept and notation registry plan.

The plan declared a sprint that is already done, which made it invisible to the
advancing horizon while it sits on the critical path with both decisions locked.
It is now unscheduled like the other open plan here, so it appears as ready
rather than as an error-level wiring finding.
…nblocked

The thirteen commits this plan describes are contained in the published tag, the
catalog now declares and locks that version, and the downstream name it was
written to unblock is accepted on both axes with the locus the release added.
The plan is left open rather than marked shipped because closing it wants a
cumulative evidence record, and authoring one here would document a release this
session did not cut.
The imas-codex consistency census of 2026-10-12 found shared concepts defined
several ways across accepted names: the flux-surface average in five
notations, one of them wrong, and the plasma boundary glossed as the
separatrix. The lead ruled that one definition per concept lives in ISN,
keyed by grammar tokens and released before the WEST re-cut.

The plan covers the registry files, model, loader and accessor; the entries
the WEST batch needs, with three rulings already fixed; and the release and
consumer pin. imas-codex:sn-house-style consumes it.
Commit the project roster immediately so this roster change cannot ride an unrelated later change.
…egistry): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…egistry): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
…plicate

The design review found that per-token definitions, alternate
spellings, the writer's rubric and the governed-term accessor already
have owners in the grammar package. The registry now carries a
definition only where a token's entry has none, refuses a forbidden
spelling that equals a registered alias, references the section order
and sign-convention form in specification.yml rather than restating
them, and puts its loaders in vocab_loaders.py and its accessor in
terms.py instead of a new module.
…egistry): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…egistry): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
…control

The content review found that templates.yml is keyed by patterns, so
the unknown-token refusal applies only to the two token-keyed files
while templates are checked against the grammar's segments. The entry
section gains the missing-entry control the house-style plan already
states, and records that it lands the coordinator's authoring there
rather than being built separately.
…type

The content review found that a name's parse does not yield its COCOS
transformation type, so the registry accessor could not select a sign
rule keyed by it. Templates now hold only the per-pattern openings,
and the consumer decides whether a sign paragraph is required where
the entry is known.
…egistry): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…egistry): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…kspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Add three data files under grammar/vocabularies/conventions/ holding one
canonical equation per shared concept, one symbol per quantity and one
description/documentation opening per name pattern. They are keyed by grammar
tokens, so the loader in grammar/vocab_loaders.py refuses, by name, a key that
is not a real token, an entry that is malformed, a concept that restates a
definition its vocabulary entry already holds, and a forbidden spelling equal
to the same token's registered alias or abbreviation. The select_conventions
accessor in grammar/terms.py parses a name and returns exactly the entries that
apply, selected from the parse, resolving a concept's definition from the
vocabulary entry that owns it when the concept carries none.

The template pattern is written in grammar segments (a base plus the segment
kinds a name fills); the section order and the generic sign-convention form
stay in specification.yml and are referenced, not restated.

Tests cover loading, every refusal, and the accessor over the seed name; a
scratch-copy mutation that removes a concept entry makes the accessor test fail.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…e outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Lands the concept, notation and template registry under
vocabularies/conventions with token-validating loaders and the
parse-selecting accessor, from the registry-loader node.
The registry loader node landed its files, loaders and accessor; the
plan's landing record carries its gate figures and review score, and
section 2 stays open for the follow-up that narrows the templates to
openings and reuses the existing YAML reader.
A template supplied a sign_convention field, but whether a documentation body carries a sign-convention paragraph depends on the entry COCOS transformation type, which a name parse does not yield. The consumer decides that where the entry is known, so the field is unused surface that contradicts the registry rule and is removed from the template model, templates.yml and the accessor output.

Fold the duplicate _load_conventions_yaml body into _load_yaml, which now takes an optional directory, and give the two template refusal tests their own asserted messages so a malformed entry and an unknown segment kind are distinguishable.
The registry, its loaders and accessor landed and were narrowed to
openings-only templates read through the existing YAML owner. The
section's landing record carries both nodes' gates and review scores.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
… outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Removes the template sign field the plan moved out of the registry,
reads the conventions files through _load_yaml, and sharpens the
refusal tests, from the template-scope node.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…d workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
… workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Fills the conventions registry for every base, subject, component and
coordinate the 220 names of the frozen WEST roster use. notation.yml gives
79 canonical symbols; a forbidden spelling is listed only where it can name
nothing but the wrong symbol, so density no longer forbids \rho, which is
also the toroidal flux label. templates.yml gives 88 openings: one per base
and a modifier-led variant where the defining phrase differs, each a
defining noun phrase shared by the description and the documentation, with
no pattern metacharacters in its literal text. concepts.yml gives 42 entries
for the tokens a canonical equation defines: the operators, the coordinate
axes, the flux labels, the loci the field defines, and the shape and
equilibrium quantities. Hardware objects and named locations with no
defining equation keep their vocabulary definition and get no entry.

Two accessor gaps remain and are not authoring gaps: an indexed derivative
is selected by its full indexed string rather than its operator key, and a
binary-operator name's base parses as placeholder, which no entry can key.
…egistry): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…egistry): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Commit the disposition or answer written to a committed review record so it travels with the tree rather than sitting as a modified file.
Commit the disposition or answer written to a committed review record so it travels with the tree rather than sitting as a modified file.
The locus whose meaning is the separatrix point of zero radial gradient keeps
that definition and loses only its data-dictionary path, and the wording ban
applies to the midplane loci alone.
…egistry): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…egistry): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Commit the disposition or answer written to a committed review record so it travels with the tree rather than sitting as a modified file.
…point locus

The gradient-point locus carries an IDS path, the midplane identifier field and
an option value; all three go, and its geometric definition stays.
…egistry): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…egistry): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Commit the disposition or answer written to a committed review record so it travels with the tree rather than sitting as a modified file.
A position's distance from the magnetic separatrix, positive outside it. This
lets a name such as radial_separatrix_distance_at_outboard_midplane decompose
as component radial, base separatrix_distance and position outboard_midplane,
instead of reading separatrix as a zone over base distance and so saying only
where the quantity sits, not what it is measured from. No parser change is
needed: the residue is matched against the closed base set before any zone or
qualifier split, so the longer base wins.

Adds a test that pins the decomposition and round trip of the target name and
that the separatrix zone and separatrix locus names keep their parse.
Ruff format requires a newline at end of file; no behaviour changes.
Describe midplanes by the selected height and magnetic-axis side, and remove data-dictionary field and option wording from locus definitions. Keep the derivative-selected point distinct from the midplane intersections and add tests that reject schema references and incomplete midplane relations.
Adds the landing fragment for the separatrix_distance base: the base entry,
the parse of the target name before and after, the parser reasoning, the
fixture parse comparison with its positive control, the red control, and the
base and head grammar gate counts.
List every changed locus definition before and after, show the old-text and planted red controls, and record the grammar gate at base and committed head with zero added failures.
The first gate arms ran without docs/ in their scratch copies, so four
documented-example checks failed in both arms as scaffolding. Repeating both
arms in full copies of the tree leaves the base arm at 2 failed (the node own
red tests) and the head arm at 0 failed, 1279 passed.
…ot-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…ecord workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…space outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Adds the separatrix_distance physical base, the distance of a position from the magnetic separatrix, positive outside it. The radial separatrix distance at the outboard midplane now decomposes as what it measures rather than as a distance in the separatrix zone, and names using separatrix as a zone or locus keep their parse.
Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…d workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
Every locus definition that named a data-dictionary field, IDS path or option value now states what the concept registry states. The outboard-midplane separatrix point is defined from the midplane height, and the gradient-point locus keeps its geometric definition without data-dictionary references.
…cs): not-run

Record the landing: append the run to the project ledger and its plan comment in one commit, so a promotion leaves the checkout without uncommitted state at the paths it wrote.
…cs): record workspace outcome

Record the worktree and process release receipt after promotion without rewriting a commit another session may have published.
The separatrix-distance base and the physics-only locus definitions are on
main with their reviews; the registry release now carries the near-duplicate
sentences and both of these.
@Simon-McIntosh
Simon-McIntosh merged commit 579216b into iterorganization:main Oct 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant