From 6c9267c7d38bcb372d738b2057823df165ca3e8c Mon Sep 17 00:00:00 2001 From: Brad Ison Date: Tue, 11 Aug 2026 12:33:23 +0200 Subject: [PATCH] [management] State the sqlite precision caveat without the review history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A comment explaining why the truncation guard sits on the type recorded how the gap came to be noticed rather than the constraint itself, which AGENTS.md rules out. The technical point is the one worth keeping: sqlite preserves nanoseconds, so a sqlite-only suite cannot observe the truncation. The neighbouring back-compatibility comment gets the same treatment — "clients written before this existed" leans on the reader knowing what "this" was, and naming conditional requests outright says it plainly. --- .../internals/modules/agentnetwork/settings_etag_test.go | 4 ++-- .../internals/modules/agentnetwork/types/settings_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/management/internals/modules/agentnetwork/settings_etag_test.go b/management/internals/modules/agentnetwork/settings_etag_test.go index b892ee88c..8245f28be 100644 --- a/management/internals/modules/agentnetwork/settings_etag_test.go +++ b/management/internals/modules/agentnetwork/settings_etag_test.go @@ -130,8 +130,8 @@ func TestUpdateSettingsPreconditionSerializesConcurrentWriters(t *testing.T) { // TestUpdateSettingsUnconditionalIgnoresStaleness pins the back-compatibility // half: without a precondition the manager keeps last-write-wins, which is -// what the dashboard relies on and what every client written before this -// existed does. +// what the dashboard relies on and what any client that predates conditional +// requests does. func TestUpdateSettingsUnconditionalIgnoresStaleness(t *testing.T) { ctx := context.Background() f := newBootstrapFixture(t) diff --git a/management/internals/modules/agentnetwork/types/settings_test.go b/management/internals/modules/agentnetwork/types/settings_test.go index d911cee27..3ab6c2a39 100644 --- a/management/internals/modules/agentnetwork/types/settings_test.go +++ b/management/internals/modules/agentnetwork/types/settings_test.go @@ -131,9 +131,9 @@ func TestSettings_ETagExclusions(t *testing.T) { // precision, the validator a bootstrap hands out never matches again and the // documented "conditional PUT without an intervening GET" is a permanent 412. // -// Asserted here on the type rather than through a store, so it holds without -// running the suite against every engine — which is what let this through the -// first time, since sqlite preserves nanoseconds and every other test uses it. +// Asserted on the type rather than through a store, so it holds without running +// the suite against every engine. The sqlite test store preserves nanoseconds, +// so a sqlite-only suite cannot observe the truncation at all. func TestSettings_ETagSurvivesTimestampTruncation(t *testing.T) { inMemory := etagSettings() require.NotZero(t, inMemory.CreatedAt.Nanosecond(), "the fixture must carry sub-second precision to prove anything")