Files
archie/internal/domain/memory/registrar.go
T
sam 6a25153659 docs(vale): reject em dashes, and remove the ones on the tree (#2149)
AGENTS.md forbids em dashes in prose, comments and user-facing strings, and
nothing checked it: Google.EmDash only flags a dash with a space on both sides,
so a bare U+2014 passed.

Archie.EmDash rejects U+2014 for Markdown, templates and Go, with a message
naming the alternatives. The 40 occurrences it finds are rewritten as a comma,
a colon, brackets or a second sentence, and scratch trees are out of scope so a
run over the repository reports on what the repository holds.
2026-11-27 19:33:06 +11:00

36 lines
913 B
Go

package memory
import (
"log/slog"
"time"
)
// Registrar is the narrow typed host access an engine receives at
// registration. Fields are typed contracts declared here: this package
// never names who implements them, and the daemon itself is never part of
// it.
type Registrar struct {
// Events receives engine activity. Must not block.
Events EventSink
// Clock is injectable time. Always bound; nil at construction is
// replaced with the system clock.
Clock Clock
// Log is the engine's logger. Optional.
Log *slog.Logger
}
// EventSink publishes engine activity. Mirrors curator.EventSink: emission
// side only, non-blocking and bounded.
type EventSink interface {
Emit(kind, detail string, data map[string]any)
}
// Clock is injectable time: Now for timestamps.
type Clock interface {
Now() time.Time
}
type systemClock struct{}
func (systemClock) Now() time.Time { return time.Now() }