The provider directory, the agent processor, the URL segment and the SDK service disagree about what a domain is called. Four naming systems, diverging in four different ways.
The divergences
| provider directory |
agent processor |
URL segment |
SDK service |
node/apt |
package |
package |
package |
node/mem |
— |
memory |
memory |
container/docker |
docker |
container |
docker |
scheduled/cron |
schedule |
schedule |
cron |
node/host |
— |
hostname, os, uptime |
hostname, os, uptime |
network/netinfo, network/netplan, network/ping |
network, interface, route |
network |
dns, interface, route, ping |
Four kinds of mismatch, which is why there is no mechanical fix:
- abbreviation —
mem against memory
- tool against concept —
apt against package, docker against container, cron against schedule
- one provider, several URLs —
host becomes hostname, os and uptime
- several providers, one URL —
netinfo, netplan and ping all become network
Reproduce:
# URL segments
grep -ho '^ /api/node/{hostname}/[a-z0-9/{}_-]*' internal/controller/api/gen/api.yaml \
| sed 's|.*{hostname}/||' | cut -d/ -f1 | sort -u
# provider directories
find internal/provider -mindepth 2 -maxdepth 2 -type d -not -name mocks | sort
# agent processors
ls internal/agent/processor_*.go | sed 's|.*processor_||;s|\.go||' | grep -v _public_test
Why it is worth fixing rather than living with
Adding a domain means touching all of these layers. add-a-domain tells a contributor to pick a reference domain and search for its name across the repository to check nothing was missed. That check does not work when the name changes between layers, and it is the only check there is for cross-layer completeness.
It also makes the API harder to reason about from the outside: /api/node/{hostname}/container is served by a provider called docker and an SDK service called docker, so a reader following either direction lands somewhere differently named.
Why now
v0.1.0 was cut today and nothing is on v1. A URL change is breaking, and it will never be cheaper than it is at v0.x. Doing it after v1.0.0 means a major version for a rename.
Not proposing a scheme here
The scheme is the decision. Two defensible directions:
- the URL wins, because it is the public contract, and providers are renamed to match
- the concept wins, with both renamed where they currently name a tool, so
docker stays the implementation of a container domain
The one-provider-to-several-URLs case needs its own answer either way, since host genuinely serves three resources and splitting it is not obviously right.
Settling it in components/osapi/domains.md first means new domains inherit the rule rather than copying whichever neighbour they happened to read. Related: #565, which has the same shape for error prefixes.
Blocked on this
Per-domain pages in the design repo. Naming pages after a scheme that is about to change moves the problem rather than solving it.
The provider directory, the agent processor, the URL segment and the SDK service disagree about what a domain is called. Four naming systems, diverging in four different ways.
The divergences
node/aptpackagepackagepackagenode/memmemorymemorycontainer/dockerdockercontainerdockerscheduled/cronscheduleschedulecronnode/hosthostname,os,uptimehostname,os,uptimenetwork/netinfo,network/netplan,network/pingnetwork,interface,routenetworkdns,interface,route,pingFour kinds of mismatch, which is why there is no mechanical fix:
memagainstmemoryaptagainstpackage,dockeragainstcontainer,cronagainstschedulehostbecomeshostname,osanduptimenetinfo,netplanandpingall becomenetworkReproduce:
Why it is worth fixing rather than living with
Adding a domain means touching all of these layers.
add-a-domaintells a contributor to pick a reference domain and search for its name across the repository to check nothing was missed. That check does not work when the name changes between layers, and it is the only check there is for cross-layer completeness.It also makes the API harder to reason about from the outside:
/api/node/{hostname}/containeris served by a provider calleddockerand an SDK service calleddocker, so a reader following either direction lands somewhere differently named.Why now
v0.1.0was cut today and nothing is onv1. A URL change is breaking, and it will never be cheaper than it is atv0.x. Doing it afterv1.0.0means a major version for a rename.Not proposing a scheme here
The scheme is the decision. Two defensible directions:
dockerstays the implementation of acontainerdomainThe one-provider-to-several-URLs case needs its own answer either way, since
hostgenuinely serves three resources and splitting it is not obviously right.Settling it in
components/osapi/domains.mdfirst means new domains inherit the rule rather than copying whichever neighbour they happened to read. Related: #565, which has the same shape for error prefixes.Blocked on this
Per-domain pages in the design repo. Naming pages after a scheme that is about to change moves the problem rather than solving it.