Add Pandora Promotion Executor v1 (gated, dry-run-first, reversible) — REQUIRES HUMAN REVIEW#142
Conversation
…v a11y, commit roadmap - Rename six migration files to the Supabase ledger versions recorded when they were applied to the Memory project on 2026-07-15 (adaptive profile versioning columns, operator action center, runner statuses, shadow context pack lab, shadow pack preflight, promotion request board), matching the precedent set for the adaptive log RLS migration. - Add the production-checkpoint regression test: repeated distills keep exactly one active pack per (user_id, namespace, pack_type), archive (never delete) older packs, and never touch other users' packs. - Mobile Queue-dot accessibility: mark the dot decorative and announce "Queue has attention items" via a visually-hidden span (new .pd-sr-only utility), since aria-label on a plain <i> is not reliably exposed. - Add docs/roadmap.md: the committed, evidence-backed roadmap that replaces the un-committed numbered list referenced by earlier commits/PRs. Validated with typecheck, lint, test (642 passed), build, and env:policy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KuzYogRG6c6324Lq4N4aAC
Final stage of the shadow-pack promotion chain: lab -> preflight -> request board -> executor. Execution is double-gated: it refuses unless PANDORA_ENABLE_CONTEXT_PACK_PROMOTION=true (dangerous gate, defaults false), the promotion request is human-approved, a fresh plan recomputation against live preflight/shadow/master state has zero blockers (including active-master-unchanged-since-approval), and the caller passes the explicit confirmation phrase. Promotion is status-only and reversible: insert new master from the reviewed shadow candidate, archive (never delete) the previous master, mark the request promoted, record execution rows/events and an audit_logs entry. Rollback archives the promoted pack and restores the previous master the same way. The service never touches memory_events, memory_items, memory_profiles, capture or pruning candidates, never crosses namespaces, and never uses service-role clients. - migration: pandora_promotion_executions(+events) with RLS; widen pandora_promotion_requests status check with 'promoted' - service: lib/services/pandora-promotion-execution-service.ts - routes: execution dry-run / execute / list / rollback, all with server-derived identity and client user_id rejection - guard test updated: gated execution replaces the no-execution-route assertion; legacy ungated paths must still not exist - 8 unit tests: gate-off refusal, confirmation phrase, dry-run writes nothing, happy path, unapproved block, master-changed block, rollback, never-deletes - env broker: PANDORA_ENABLE_CONTEXT_PACK_PROMOTION cataloged, default false - docs: pandora-promotion-executor.md + roadmap update Migration is NOT applied; execution stays impossible until review, merge, migration, dry-run proof, and explicit gate enablement per rollout skill 07. Validated with typecheck, lint (0 errors), test (650 passed), build, and env:policy (90 keys). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KuzYogRG6c6324Lq4N4aAC
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Checklist
PANDORA_ENABLE_CONTEXT_PACK_PROMOTION(runtime flag).env-discovery-servicewith safe defaultfalse; optional, never a required provider env.env:policypasses (90 keys).What
The final, gated stage of the shadow-pack promotion chain: lab → preflight → request board → executor. Turns a human-approved promotion request into an actual master context-pack swap — and nothing else.
This PR must not be merged by its author. Per
docs/pandora-shadow-context-pack-lab.md, the promotion path requires a separate PR (this one), explicit human review, migration/policy review, dry-run proof, and production approval. The migration is intentionally not applied; nothing can execute until review + merge + migration + dry-run + gate enablement.Double gate
Execution refuses unless ALL hold:
PANDORA_ENABLE_CONTEXT_PACK_PROMOTION=true(defaults false),approvedwithreviewer_decision=approved,"PROMOTE"("ROLLBACK"for rollback).What execution does (status-only, reversible)
memory_context_packsmaster (status=active) from the reviewed shadow candidate payload.promoted; record execution row, events, and anaudit_logsentry.Rollback archives the promoted pack and restores the previous master the same way.
What it never does
No deletes anywhere; never touches
memory_events,memory_items,memory_profiles, capture or pruning candidates; never crosses namespaces; server-derived identity only, clientuser_idrejected; no service-role clients. All enforced by the updated guard test plus 8 new unit tests (gate-off refusal, confirmation phrase, dry-run writes nothing, happy path, unapproved block, master-changed block, rollback, never-deletes).Files
supabase/migrations/20260716000000_pandora_promotion_executor.sql— executions/events tables with RLS; widenspandora_promotion_requestsstatus check with'promoted'(NOT applied)lib/services/pandora-promotion-execution-service.tsapp/api/pandora/promotion-requests/[id]/execution/{route,dry-run/route}.ts,app/api/pandora/promotion-executions/{route,[id]/rollback/route}.tstests/unit/pandora-promotion-execution-service.test.ts, guard test updatedocs/pandora-promotion-executor.md, roadmap update, env catalog entryVerification
typecheck ✅ · lint ✅ (0 errors) · test 650/650 ✅ · build ✅ · env:policy ✅
Post-merge rollout (skill 07 sequence)
pandora_promotion_executor. 2. Verify production READY. 3. Dry-run route on a real approved request; review output. 4. Only then set the gatetrue. 5. One controlled execution with confirmation phrase. 6. Post-run verification of the one-active-master invariant and audit trail. 7. Optionally turn the gate back off between promotions.🤖 Generated with Claude Code
https://claude.ai/code/session_01KuzYogRG6c6324Lq4N4aAC
Generated by Claude Code