← 1.0.0 backlogs ISS-13

Declaring a collection is not recorded against anybody

Type
Bug — a hole in the change log
Found while
SAPE-19
Triage
Defer
Status
Open
Severity
Medium — narrow today, and it widens the moment SAPE-14 lands

Description

Every entry in the change log has carried an Attribution since there was a log: a write names the operation that made it and the actor it ran for, and even a read through the shell names "explore" and the operator. 44b8298 closed the last gap for operations:

// internal/store/ops.go:391 — DeclareOperation
if _, err := s.record(Change{
	Kind:      ChangeOperation,
	Operation: &operation,
	By:        Attribution{Operation: "declare", Actor: caller.Actor},
}); err != nil {

Declaring a collection was not part of that change:

// internal/store/store.go:168 — Store.Declare(spec), a new collection
s.record(Change{Kind: ChangeDeclare, Collection: spec.Name, Spec: &spec})

No By. Store.Declare takes no Caller at all, so there is nothing it could write.

Evidence

Triage

Does it lose data, break a promise on a public surface, or stop somebody installing and running? No. The change log still records that the collection was declared, with its full spec and its LSN — only the who is missing. No wire shape depends on it, and nothing is blocked.

Defer, on the same reasoning that made the operation version tolerable before the Declare frame existed: the one identity available on this path is the account the command was pointed at, which is a label rather than a proof, because anybody holding the exclusive lock could have written the bytes by hand. A label is still better than no claim at all — that is exactly the argument 44b8298 made for apply — but the gap between "no claim" and "weak claim" is smaller than the gap the operation path had, where the actor can now be a remote host.

If deferred, what it costs to wait