config: a typo'd [services.<name>] section is silently inert (unregisteredServiceKeys unimplemented) #1402

Closed
opened 2026-10-27 13:40:15 +00:00 by sam · 0 comments
Owner

Before Services became a map, a typo such as [services.gatway] failed to decode into a
struct field, was left in toml.MetaData.Undecoded(), and surfaced through the loader's
UnknownKeys path, which the daemon logs as:

config file has unrecognised keys; check for typos

(internal/infrastructure/configuration/decode.go, loader.go:30-37, and
internal/app/archied/bootstrap.go:261).

With "type Services map[string]ServiceConnection" the map consumes any section name, so
nothing is undecoded and the typo is no longer reported. Because defaulting iterates the
registered specifications and consumers select registered names, the mistyped entry is also
inert -- so the operator gets neither the setting nor a diagnostic.

The design document already requires the diagnostic. docs/prds/service-registry.md states:

"A typo'd [services.gatway] is reported today ... A map decodes any section, so preserving
that is a requirement, not an optional extra: unregisteredServiceKeys asks the registry
which names exist. This costs nothing in extensibility, because the answer comes from
registration data rather than a fixed list."

MEASURED: grep -rn 'unregisteredServiceKeys' --include=*.go returns nothing. The requirement
is documented and unimplemented, so the behaviour regression is live on main.

WHAT IS NEEDED
Implement the unregistered-name check the PRD names -- compare the decoded Services keys
against the registered service names (config.ServiceNameGateway / config.ServiceNameState and
whatever RegisterService tracks) and feed any surplus into Document.UnknownKeys so the existing
typo warning fires again.

Close reason

Verified complete on origin/main: tests green


Imported from beads archie-core-jp4g · GitHub #936 · type bug · priority P2 · created 2026-09-18 · closed 2026-09-18

Before Services became a map, a typo such as [services.gatway] failed to decode into a struct field, was left in toml.MetaData.Undecoded(), and surfaced through the loader's UnknownKeys path, which the daemon logs as: config file has unrecognised keys; check for typos (internal/infrastructure/configuration/decode.go, loader.go:30-37, and internal/app/archied/bootstrap.go:261). With "type Services map[string]ServiceConnection" the map consumes any section name, so nothing is undecoded and the typo is no longer reported. Because defaulting iterates the registered specifications and consumers select registered names, the mistyped entry is also inert -- so the operator gets neither the setting nor a diagnostic. The design document already requires the diagnostic. docs/prds/service-registry.md states: "A typo'd [services.gatway] is reported today ... A map decodes any section, so preserving that is a requirement, not an optional extra: unregisteredServiceKeys asks the registry which names exist. This costs nothing in extensibility, because the answer comes from registration data rather than a fixed list." MEASURED: grep -rn 'unregisteredServiceKeys' --include=*.go returns nothing. The requirement is documented and unimplemented, so the behaviour regression is live on main. WHAT IS NEEDED Implement the unregistered-name check the PRD names -- compare the decoded Services keys against the registered service names (config.ServiceNameGateway / config.ServiceNameState and whatever RegisterService tracks) and feed any surplus into Document.UnknownKeys so the existing typo warning fires again. ### Close reason Verified complete on origin/main: tests green --- _Imported from beads `archie-core-jp4g` · GitHub #936 · type bug · priority P2 · created 2026-09-18 · closed 2026-09-18_
sam added the mediumbug labels 2026-10-27 13:40:15 +00:00
sam self-assigned this 2026-10-27 13:40:15 +00:00
sam closed this issue 2026-10-27 13:40:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1402