Finalize two-persona Sift DBRE product for submission#107
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary — product flow
Finalizes the two-persona Sift DBRE product for hackathon submission.
Users (Dev Trivedi, Aakash Singh) run guided read-only MongoDB workload queries from the Workload Console. Each query is captured to
query_logwith its shape, live explain evidence, an evidence-based slow-signal, and user attribution. The DBRE operator sees the evidence-ranked slow-query queue (blocking sort / over-scan ratio / keys — not wall-clock), selects a real captured query, and Diagnoses it. Diagnosis runs 3 Vertex Agent Engine roles over 4 read-only tools; deterministic Python selects the ESR winner, computes the evidence hash, enforces the hash-bound approval gate, and performs the backend-only index apply + verification. Sift Memory (Voyage) adds read-only DBRE retrieval context only.Safety boundaries preserved
controller/schemas.pyandcontracts/evidence_pack.schema.jsonare byte-identical to main (git blob hashes verified).explain_slow_query,compare_candidate_indexes,diagnose_candidate,rationalize_recommendation(only gained aquery_jsonparameter so they diagnose the real captured query instead of a hardcoded fixture).agents/gating.pyblocks create/drop-index outside VERIFY;PackStatus.VERIFIEDis set solely by the controller.pack_evidence_hash, the approval gate, backend-onlyapply_and_verify, and verification.evidence_hash(route guard +issue_approval_ticket+_assert_ticket_allows_apply+ schema validators).VOYAGE_API_KEY/RUN_API_TOKEN/SESSION_SECRET/ Mongo URI never appear in client source or bundle; noNEXT_PUBLIC_VOYAGE./packs/{run_id}/memoryis DBRE-gated — 401 no-auth · 403 user · 200 DBRE.3 Agent Engine roles / 4 tools (confirmed in Run Review trace — "AGENT ENGINE: 4 tool events")
explain_slow_query(DETECT),diagnose_candidate(DIAGNOSE)compare_candidate_indexes(CANDIDATE)rationalize_recommendation(RATIONALE)Sift Memory / Voyage — read-only, out-of-band
api/memory.pyVoyageMemoryService: server-side embed + rerank; never part of EvidencePack v1;mutation_authority = Falsealways.unconfigured/ok/empty/fallback(Voyage failure → labeled local guidance).MemoryResponseserver-side and passes only display fields to the client.Test outputs — branch
feat/sift-two-persona-submission@94efb0aBrowser QA (Puppeteer — desktop 1440×1100 + mobile 390×1000)
/packs/{id}/memory401 / 403 / 200; no Voyage key in client source or built bundle.Deployment prerequisites (NOT applied — do not deploy without explicit "deploy")
Cloud Run config verified read-only (no secret values printed):
gcrah-read-api:RUN_API_TOKEN,SESSION_SECRET(gcrah-session-secret),MONGO_SECRET_NAME, and the 3 Agent Engine resource IDs (Diagnose/Candidate/Rationale) — all present as refs.gcrah-dashboard:API_URL/NEXT_PUBLIC_API_URL,RUN_API_TOKEN,SESSION_SECRET— present; no Voyage key (correct).VOYAGE_API_KEYis ABSENT on the read API → Sift Memory shows "Not configured" in prod until set. To enable: create Secret Manager secretvoyage-api-key, grant the read-API service accountsecretAccessor, then redeploy the read API with--update-secrets VOYAGE_API_KEY=voyage-api-key:latest --update-env-vars VOYAGE_EMBED_MODEL=voyage-4-lite,VOYAGE_RERANK_MODEL=rerank-2.5-lite. The dashboard gets no Voyage key.Known remaining risks
VOYAGE_API_KEYnot yet in prod → memory degrades to "Not configured" (safe; documented above).agents/mcp_backend.py(apply/drop-index) physically lives underagents/but is the controller's Backend-Protocol implementation — not reachable by any deployed agent role; the read-only boundary holds (directory-placement caveat only).Explicit statement
No change to EvidencePack v1 or
contracts/evidence_pack.schema.json. No MVP tool renamed. No secret exposed to the browser. Agents have no apply / drop / verify / approve authority — deterministic Python remains the sole decision maker and human approval remains hash-bound.