Skip to content

Commit f458495

Browse files
committed
design: the key form checked against the data, and ns:name rejected with its reason
W2 asserted where the namespace goes; it now measures. 1635 version-database targets and 546 workspace entries on the development host, and not one key contains a colon. Two reasons ns:name cannot be the key, and neither is convention. A workspace key is looked up by the name a program is invoked as, and nothing is invoked as xim:picolibc-riscv, so the key would be read by nobody. And the namespace qualifies where a version came from rather than what the tool is: mcpp itself holds eight versions under one target, some scoped xim: and some not, which moving the namespace onto the key would split into two tools with one name. A colon in a key is therefore a hard error naming the correct form, not a second accepted spelling. The section 3 example is corrected in the same pass: the invented "*" becomes latest.
1 parent 161aec2 commit f458495

1 file changed

Lines changed: 42 additions & 14 deletions

File tree

.agents/docs/2026-09-03-xlings-workspace-as-the-one-table.md

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ is written under.
8181

8282
```toml
8383
[xlings.workspace]
84-
cmake = "3.28"
85-
qemu-riscv = "9.2.4-1"
86-
"xim:picolibc-riscv" = "1.8.12"
87-
make = "*"
88-
gcc = { linux = "15.1.0" }
89-
llvm = { macos = "20", default = "22" }
84+
cmake = "3.28"
85+
qemu-riscv = "9.2.4-1"
86+
picolibc-riscv = "xim:1.8.12"
87+
make = "latest"
88+
gcc = { linux = "15.1.0" }
89+
llvm = { macos = "20", default = "22" }
9090
```
9191

9292
Three decisions the table needs, listed for review.
@@ -102,20 +102,48 @@ manifest therefore accepts a version, a prefix, or `latest`, and "must exist,
102102
version unconstrained" is spelled `latest`. Measured on three real subos files
103103
on the development host: every stored value is concrete.
104104

105-
**W2. The namespace goes on the version, and that needs no new rule.**
106-
`.xlings.json` already spells a namespaced entry as `target = "<ns>:<version>"`:
107-
`parse_ns_version` splits on the first colon and `make_ns_version` builds it
108-
(`src/core/xvm/db.cpp:10-20`), and a real subos on the development host holds
109-
`"mcpp": {"active": "xim:2026.8.30.2", …}`. So the form is
105+
**W2. The namespace goes on the version, not on the key — and the key form was
106+
checked rather than assumed.** Measured on the development host: 1635 targets
107+
in the version database and 546 workspace entries in the default SubOS, and
108+
**not one key contains a colon**. The colon appears on the other side:
109+
`"mcpp": {"active": "xim:2026.8.30.2", …}`.
110+
111+
`ns:name` as a key was considered and does not work, for a reason stronger than
112+
convention. A workspace key is looked up by the name a program is **invoked
113+
as** (`get_active_version(workspace, program_name)`,
114+
`src/core/xvm/shim.cpp:409-412`); nothing is ever invoked as
115+
`xim:picolibc-riscv`, so such a key would be read by nobody — the shape §6
116+
refuses for `deps`.
117+
118+
And the namespace is not a property of the tool. It qualifies **where a version
119+
came from**, which is why one target legitimately carries both scoped and
120+
unscoped versions at once. Measured, on this machine, for `mcpp` itself:
121+
122+
```
123+
"mcpp": { "active": "xim:2026.8.30.2",
124+
"installed": ["2026.8.21.1", …, "xim:2026.8.28.2", "xim:2026.8.30.1"] }
125+
```
126+
127+
Eight versions of one target, some from the xim index and some not. Moving the
128+
namespace onto the key would split that into two targets, and `mcpp` on `PATH`
129+
would resolve to whichever half won — which is the same defect in the small
130+
that `ar` from two providers would be in the large.
131+
132+
So the form is:
110133

111134
```toml
112135
[xlings.workspace]
113136
picolibc-riscv = "xim:1.8.12"
114137
```
115138

116-
with the key being the xvm target and the namespace riding the value, exactly
117-
as the file writes it. mcpp accepts what xlings already accepts, and the
118-
target's C library that mcpp injects (§4) is expressible in the same shape.
139+
the key being the xvm target and the namespace riding the value, exactly as the
140+
file writes it. mcpp reconstructs the install address `xim:picolibc-riscv@1.8.12`
141+
from the pair when it provisions, so nothing is lost, and the C library mcpp
142+
injects (§4) is expressible in the same shape.
143+
144+
A key containing a colon is a **hard error naming the correct form**, rather
145+
than a second accepted spelling: one fact, one way to write it, is the whole
146+
argument of this document applied to itself.
119147

120148
**W3. The per-platform value form is unchanged.** It is already accepted on
121149
both keys (2026.9.2.1) and it survives the merge unmodified.

0 commit comments

Comments
 (0)