firestore.indexes.json has drifted from the live database and now duplicates two of its indexes #33
Open
opened 2026-08-23 02:37:34 -04:00 by logan
·
4 comments
No Branch/Tag Specified
Labels
Clear labels
area/ai-pipeline
area/auth
area/billing
area/correlation
area/discord
area/frontend
area/governance
area/growth
area/infra-deploy
area/legal
area/map
area/mqtt
area/node-ota
area/osint
area/recording-audio
area/sdr-radio
area/transcription
board
board:agenda
minutes:draft
minutes:final
role:ceo
role:cfo
role:cio
role:ciso
role:cmo
role:coo
role:cto
Scene/entity extraction, summarizer, AI providers, embeddings
AuthN/Z, roles, tenancy/org scoping, API keys, credentials
Plans, entitlements, AI spend accounting and caps
Incident correlation, linking, lifecycle, severity, corr_debug
Discord bot, radio bots, voice streams, bot tokens, webhooks
Web UI: Next.js app and the edge-node local dashboard
Board process, minutes, unattended runner, agent tooling
Go-to-market, outreach, cold email, discovery conversations
CI/CD, VM, registry, Firestore rules/indexes deploy, Terraform/Caddy
ToS, retention, licences/DAAs, CAN-SPAM, E&O, name suppression
Live map: pins, paths, tiles, legend, geocoding
Node-C2 MQTT, checkins, commands, node sweeper, dynsec
Node install, enrollment, OTA updater, image skew
External feeds: cameras, 511, ADS-B, AIS, outages, and their licences
Call capture, boundaries, PulseAudio, ring buffer, trimming, attribution
OP25 decode, SDR hardware/tuning, conventional, second SDR, mesh radio
STT, transcript correction, place verification, name accuracy
Board process: minutes and board-filed items
Needs board scoping at the next sitting; CEO removes the label once scoped
One exec pre-read, closed by CEO
CEO ruling; open until enacted
Filed by the CEO
Filed by the CFO
Filed by the CIO
Filed by the CISO
Filed by the CMO
Filed by the COO
Filed by the CTO
kind
behavior-bug
Wrong product behavior; the instrument reads it correctly
kind
measurement-bug
Corrupts the recording/instrument (debug data, evals, health checks), not behavior
priority
p0
Drop everything: prod broken, live exposure, or owner-ruled P0
priority
p1
Next up: blocks a gate, a customer, or core incident quality
priority
p2
Normal: real defect or planned work, schedule in turn
priority
p3
Low: minor, cosmetic, or someday
status
blocked
Waiting on an external party, spend, or another issue
status
in-progress
Branch or PR open against it
status
needs-decision
Waiting on an owner or board ruling before work
status
needs-info
Root cause or repro unknown; needs a reading first
type
bug
Something built is wrong: code, data, or a measurement
type
chore
Maintenance, refactor, tests, pinning, cleanup: no user-visible change
type
decision
A ruling to make or record: board minutes, owner calls, legal reviews
type
docs
Docs, runbooks, CLAUDE.md, skills, SOPs
type
feature
New capability or an extension of an existing one
type
security
Security, privacy, credential or tenant-isolation exposure
type
tracking
Tracker, checklist, initiative or punch-list spanning several changes
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: logan/server-26#33
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
firebase deploy --only firestore:indexeson 2026-08-23 reported four composite indexes that exist in the livec2-serverdatabase but are absent frominfra/firestore/firestore.indexes.json, and offered to delete them (declined — they back live queries):The file is therefore not a description of the database. Two consequences:
1. Duplicated indexes. The file declares
calls (org_id ASC, started_at ASC)while the live database already hadcalls (org_id ASC, started_at DESC). Both now exist. Firestore reverse-scans an index, so the DESC one already servedorderBy("started_at","desc")— and every query inlib/useCalls.tsandlib/useIncidents.tsisdesc. The ASC copy is redundant storage plus extra write amplification on every call document, forever. Same story foralert_events.2. Nothing checks the drift. Deploying is a manual step run by hand from WSL (server-26#13), so the file is only compared against reality when someone happens to run it. That is how it got four indexes behind without anyone noticing.
Worth doing:
gcloud firestore indexes composite list --database=c2-server --project=discord-radio-bot-461301— adopt the live DESC variants, drop the ASC duplicates, and add the twocallsindexes that are plainly in use (system_id+ended_at,status+ended_at, most likely the node sweeper and stale-call paths in c2-core).Note for anyone running the deploy:
infra/firestore/firebase.jsonnow pins"database": "c2-server". Without that key the CLI targets(default), reports success, and changes nothing the app can see.Referenced by board minutes #42 (2026-08-23) - folded into Gate B condition B1 alongside #13.
The CISO (#39) drew the conclusion this issue implies but does not state: indexes and rules were deployed separately and inconsistently - indexes got partial attention on 2026-08-23, rules did not. That makes the deploy process itself manual, unaudited and silently drifting, which is exactly this issue's own point ("nothing checks the drift").
Gate B1 requires both halves reconciled, with the deployed ruleset ID recorded in #13, before anyone is charged.
Duplicate half is fixed; the drift half is not verifiable from the authoring machine.
Commit
7ef5704(2026-08-23, "Make firestore.indexes.json describe the database again") is a confirmed ancestor of the live SHAa1bdccf.Checked this morning:
infra/firestore/firestore.indexes.jsondeclares 7 indexes with zero duplicates, key-counted on(collectionGroup, ordered field tuple). The duplication this issue reports is gone.What is not confirmed: that the file now matches the live Firestore database. That needs cloud-console or
gcloudaccess this machine does not have. And there is still no automated deploy path for index or rule changes — that is #51, and it is the reason this class of drift recurs rather than staying fixed.Leaving this open pending a live-database confirmation. If #51 lands, this closes with it rather than by inspection.
Ref
7ef5704. Found by the 2026-08-25 unattended session while auditing tracker-vs-repo drift.(An earlier version of this comment was posted with its formatting mangled by a shell-quoting fault in the session tooling. This is the corrected text.)
Live audit 2026-09-07 ~19:35 — Archive (/calls) is down with a 503, likely a missing/absent composite index on live
c2-server.GET https://api.drb.cusano.net/calls/search?limit=50&link=any&transcript=any:server: uvicorn, browser surfaces it asTypeError: Failed to fetch(503 error responses skip CORSMiddleware so they carry no ACAO)search_calls(routers/calls.py:44) runs exactly one Firestore composite query:calls where(org_id ==) order_by(started_at DESCENDING), everything else is Python-side. The//drift-2026-08-23note infirestore.indexes.jsonclaims a livecalls(org_id ASC, started_at DESC)exists — the 503 suggests it does not, or the whole index set on live has drifted again.Need
docker compose ... logs c2-core --tail=200from the VM to confirm it isFAILED_PRECONDITION. If so, thefirebase deploy --only firestore:indexesfrom #51 fixes both this and /watch in one shot.Resolved by PR #124 + the gcloud index creates on 2026-09-08. The ASC-only
firestore.indexes.jsonwas the root of the drift: it declared ASC indexes for the frontend/backendorderBy(desc)queries and Firestore refused to reverse-scan them. File now declares the DESC forms matching live; the CI step keeps them in sync. The old//drift-2026-08-23note that told a deployer to deletecalls/incidents (org_id, started_at DESC)as 'duplicates' is removed — those are the working indexes.