docs(adr): settle ADR 007's eleven open questions and state the decisions (improvise-cq1q.1)

The decisions are written into the clauses as plain design, tagged
[Amendment]: a measure formula's id is the measure's id; formulas may refer
to any id-bearing thing; ids always win, with the display as a preview;
user interfaces accept display names and scripts use ids and display_for;
slugify replaces every non-alphanumeric character with _, collapses _,
trims _ at both ends and prefixes n before a digit; a hand-written id obeys
the generated syntax; a leading _ is reserved for virtual ids, which are
lower case and never written to .improv; records-mode positions are values;
groups have a display and ordinary ids.

All eleven questions are deleted. Five new ones are open: the -<n> suffix
in hand-written ids, ASCII "alphanumeric", how a file records the virtual
categories, the dimension formula line and [_measure] tag, and which
headless entry points are scripts. core.md section 20's note follows the
new slug rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
Claude (adr007-steward)
2026-10-09 09:01:10 -07:00
committed by Edward Langley
parent 1190c80efe
commit 6e46787887
2 changed files with 247 additions and 307 deletions
+8 -7
View File
@@ -1715,11 +1715,12 @@ to `east_`. Only *leading* underscores are removed (step 4).
**ADR 007's proposed amendment changes these rules, and this code predates it.**
The amendment (PR #326) is not yet approved. Its clause 4:
- each whitespace character becomes `_`, not only U+0020;
- runs of `_` collapse after the strip, so `a_ b` and `a__b` both slug to `a_b`
and `Time \u{200B} Period` to `time_period`;
- leading and trailing `_` and `-` are removed, so `East ` → `east`, `-East-` →
`east`, and `-` alone takes `<kind>-<n>`.
- every non-alphanumeric character becomes `_` (not only U+0020, and `-` too),
so `Q1-2024` slugs to `q1_2024` and `Region(code)` to `region_code`;
- runs of `_` collapse, so `a_ b` and `a__b` both slug to `a_b`;
- leading and trailing `_` are removed, so `East ` → `east` and `-East-` → `east`;
- `n` is prepended to a slug that starts with a digit, so `2024` → `n2024`;
- a hand-written id must obey every syntax rule of a generated one.
This section, `slugify`, and the tests
`slugify_collapses_a_run_of_spaces_to_one_underscore` (its `east_` case) and
@@ -1750,8 +1751,8 @@ the alphabet (non-empty, `a`–`z`, `0`–`9`, `-`, `_`), the reserved leading
`_` (only `_index`, `_dim` and `_measure` may carry one, per clause 1, and
the match is exact: `_indexer` and `_measure-1` are Reserved, since "no other
id may start with `_`"), and
duplicates. It accepts `-`, `-x` and `x-`. ADR 007's open question 11 asks
whether a hand-written id like that must be refused. It never renames.
duplicates. It accepts `-`, `-x`, `x-` and `2024`, all of which the amendment
refuses (a hand-written id obeys the syntax of a generated one). It never renames.
Refusing is the loader's job, and the loader
must name both lines of a duplicate; `ClaimError` carries only the id, so the
loader keeps the line numbers. The virtual views `_records` and `_drill` are