Skip to content

Alias a library unit through the settings units entry - #512

Merged
thebhef merged 1 commit into
mainfrom
task149-alias-and-override
Oct 14, 2026
Merged

thebhef merged 1 commit into
mainfrom
task149-alias-and-override

Conversation

@thebhef

@thebhef thebhef commented Sep 23, 2026

Copy link
Copy Markdown
Owner

A name the unit library already spells is now free to take, where the
composition means exactly that unit and the library spells it
differently: mph = mile / hour — or mph = mile-per-hour, since one
term is a composition too — names the unit the library spells mi/h,
converts 1:1 with it, and reads mph wherever it appears. The table is
the library's whole table now, with no hand-typed display overrides in
the facade, so an alias is how a project says what its databases
actually write (owner ruling, 2026-09-22).

Two changes carry it. define reads the composition before it judges
the name, and refuses a taken name only where the composition is not
that very unit: same dimension, same size, and a spelling of its own
that differs from the name — so W = V * A stays refused, the watt
already reading W and a second identity for it buying nothing.
recognize consults the units the user composed by name directly after
the customization dict rather than after the built-in recognitions, so
a database that writes mph gets the user's unit rather than the
library's spelling of it; a name the user defined is the user speaking,
exactly as a customization is.

For the reviewer: moving the refusal after the composition is read
means a definition that is wrong in both ways now reports the
composition's fault first. Nothing else about a definition changed, and
the three things an alias must do — read as the name given it, convert
1:1, and come back from a database that spells it — are pinned by tests
beside the existing LPM ones, as is the narrowness of the exception.

The phase's other deliverable, the composed-kind override reachable
from the View signals panel, is deliberately not in this commit: that
panel carries no math rows by design, so the criterion cannot be met
without making a database-mapping surface list math signals. The
finding is written up for the owner rather than implemented as a
redesign nobody ruled on.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

thebhef commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@thebhef
thebhef force-pushed the task154-colour-selection branch from e6af8ea to 640c31d Compare September 23, 2026 15:43
@thebhef
thebhef force-pushed the task149-alias-and-override branch from 8223147 to 07db1a9 Compare September 23, 2026 15:43
@thebhef
thebhef force-pushed the task149-alias-and-override branch from 07db1a9 to 6613b02 Compare September 23, 2026 16:46
@thebhef
thebhef force-pushed the task154-colour-selection branch from 640c31d to 47a1442 Compare September 23, 2026 16:46
@thebhef
thebhef force-pushed the task149-alias-and-override branch from 6613b02 to fd43e98 Compare September 24, 2026 01:39

thebhef commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • Oct 14, 9:10 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 14, 9:20 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 14, 9:23 PM UTC: @thebhef merged this pull request with Graphite.

@thebhef
thebhef changed the base branch from task154-colour-selection to graphite-base/512 October 14, 2026 21:11
@thebhef
thebhef changed the base branch from graphite-base/512 to main October 14, 2026 21:18
A name the unit library already spells is now free to take, where the
composition means exactly that unit and the library spells it
differently: `mph = mile / hour` — or `mph = mile-per-hour`, since one
term is a composition too — names the unit the library spells `mi/h`,
converts 1:1 with it, and reads `mph` wherever it appears. The table is
the library's whole table now, with no hand-typed display overrides in
the facade, so an alias is how a project says what its databases
actually write (owner ruling, 2026-09-22).

Two changes carry it. `define` reads the composition before it judges
the name, and refuses a taken name only where the composition is not
that very unit: same dimension, same size, and a spelling of its own
that differs from the name — so `W = V * A` stays refused, the watt
already reading `W` and a second identity for it buying nothing.
`recognize` consults the units the user composed by name directly after
the customization dict rather than after the built-in recognitions, so
a database that writes `mph` gets the user's unit rather than the
library's spelling of it; a name the user defined is the user speaking,
exactly as a customization is.

For the reviewer: moving the refusal after the composition is read
means a definition that is wrong in both ways now reports the
composition's fault first. Nothing else about a definition changed, and
the three things an alias must do — read as the name given it, convert
1:1, and come back from a database that spells it — are pinned by tests
beside the existing `LPM` ones, as is the narrowness of the exception.

The phase's other deliverable, the composed-kind override reachable
from the View signals panel, is deliberately not in this commit: that
panel carries no math rows by design, so the criterion cannot be met
without making a database-mapping surface list math signals. The
finding is written up for the owner rather than implemented as a
redesign nobody ruled on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thebhef
thebhef force-pushed the task149-alias-and-override branch from 2996faa to 021f4aa Compare October 14, 2026 21:19
@thebhef
thebhef merged commit 8dc80e9 into main Oct 14, 2026
10 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