isMagpie asked provider.Resolve, which outside a request holding the
catalog built every provider's entries again. The window's drift poll
(/api/drift, every 15s while the window is up) asks it for every
detected agent's field values, and each poll built the catalog again:
in the procmem profile (a sandbox `magpie web` on main with 17
providers, the GUI cycling its pages for 10 minutes) Drift's isMagpie
was 235 MB of the 1.37 GB allocated, ~6 MB a poll, with nothing changed.
Now isMagpie's answers are kept by value while provider.StampNow stays
the same, for a minute at most and 4096 values at most, as the gateway's
stamped lists are: a provider, account or setting saved, a plugin's
change, a catalog sync, another process rewriting providers.json or
settings.json, or a changed environment moves the stamp and they are
asked again. A value with no "/" is no catalog reference and isn't asked
at all, as before.
Tested with TestIsMagpieKeptWhileCatalogStays: two answers already given
take 1924 allocations before (fails), under 200 after; a provider saved
since is magpie's at once. go test -tags nogui ./internal/agent passes
(849s); -race on IsMagpie|Drift|GoProgram|GoMagic|Goose passes; gofmt -l
clean; GOOS=linux and GOOS=windows go vet -tags nogui ./internal/agent
pass. The full suite is run before the push of this batch.