console: the scan pass skips apps/ prefixes that are not accounts
A legacy unqualified release prefix (apps/woodstar-indexer/releases/ on the flagship, from 2026-08-02) listed as an account, objstore.Get refused the name, and since 81db4870 that per-app error marks the Virus scan job Failed on every hourly tick. The economics pass already guards the same listing with release.ValidAccount; this does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prompt
What this? [Virus scan failed: scan pass: woodstar-indexer/releases: objstore: invalid account "woodstar-indexer"] ... Yes and yes
From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.
Summary
Skip apps/<x>/ prefixes whose segment fails release.ValidAccount in scanPass; test reproduces the flagship error.
Agent notes
The stale flagship objects under apps/woodstar-indexer/ were deleted by hand with Paul's approval, so the job clears before this ships.
internal/console/scanpass.go+7 −0internal/console/scanpass_test.go+37 −0
CI passed — run details
Intent
Attributed to this commit: 27.9 g CO₂e (2,601,451 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on scanpass-skip-non-accounts, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/console/scanpass.go b/internal/console/scanpass.go| index 0638639d5..a606fba31 100644 |
| --- a/internal/console/scanpass.go |
| +++ b/internal/console/scanpass.go |
| @@ -159,6 +159,13 @@ func (s *Server) scanPass(ctx context.Context) error { |
| for _, acctPrefix := range acctPrefixes { |
| acct := strings.TrimSuffix(strings.TrimPrefix(acctPrefix, "apps/"), "/") |
| + // A legacy unqualified release prefix (apps/<app>/releases/, from |
| + // before accounts) lists here as an "account" named for an app. |
| + // It cannot hold a store, so skip it rather than fail the run on |
| + // every tick — economicspass.go applies the same guard. |
| + if !release.ValidAccount(acct) { |
| + continue |
| + } |
| appPrefixes, err := s.cfg.Releases.ListDirs(ctx, acctPrefix) |
| if err != nil { |
| return err |
diff --git a/internal/console/scanpass_test.go b/internal/console/scanpass_test.go| index a6e651bf9..be2f5fbea 100644 |
| --- a/internal/console/scanpass_test.go |
| +++ b/internal/console/scanpass_test.go |
| @@ -229,6 +229,43 @@ func TestScanPassContinuesPastOneAppsFailure(t *testing.T) { |
| } |
| } |
| +// A legacy unqualified release prefix (apps/<app>/releases/, from before |
| +// accounts) lists as an "account" whose name release.ValidAccount refuses. |
| +// It holds no store, so the pass skips it: it must neither fail the run on |
| +// the background-jobs page nor stop the real stores being swept. |
| +func TestScanPassSkipsLegacyUnqualifiedPrefix(t *testing.T) { |
| + ctx := context.Background() |
| + fx := newConsoleFixture(t) |
| + fx.srv.cfg.StoreScanner = objstore.NewMemScanner() |
| + |
| + if release.ValidAccount("legacy-app") { |
| + t.Fatal("test fixture assumption broken: \"legacy-app\" passes release.ValidAccount") |
| + } |
| + if _, err := fx.rel.Put(ctx, "apps/legacy-app/releases/dfe406a/manifest.json", []byte("{}"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + enableStore(t, fx, fixtureAcct, fixtureApp, true) |
| + withLister(fx, &countingLister{keys: []string{"a.txt"}}) |
| + |
| + if err := fx.srv.jobs.Run(ctx, "StartScanPass", fx.srv.scanPass); err != nil { |
| + t.Fatal(err) |
| + } |
| + st, ok := jobStatusOf(fx.srv, "StartScanPass") |
| + if !ok { |
| + t.Fatal("the run was not recorded") |
| + } |
| + if st.State != JobOK { |
| + t.Fatalf("a legacy prefix failed the run: %v %q", st.State, st.Err) |
| + } |
| + side, _, err := objstore.GetSidecar(ctx, fx.rel, fixtureAcct, fixtureApp) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if side == nil || side.LastComplete == nil { |
| + t.Fatal("the real store was not swept") |
| + } |
| +} |
| + |
| // A sweep still in flight ignores the interval entirely. This is the only way |
| // a bucket larger than one budget ever finishes: if a part-done sweep waited |
| // out the re-sweep floor, a big store would advance one page a day. |