Skip to content

Phase 18 W3: RL queue-policy shadow suggestion (officer export queue) - #52

Merged
munisp merged 1 commit into
mainfrom
phase18/w3-queue-policy-shadow
Sep 10, 2026
Merged

Phase 18 W3: RL queue-policy shadow suggestion (officer export queue)#52
munisp merged 1 commit into
mainfrom
phase18/w3-queue-policy-shadow

Conversation

@munisp

@munisp munisp commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Phase 18 W3 (singlewindow half): RL queue-policy SHADOW suggestion surface.

  • server/rl/queuePolicy.ts: config-gated ml-stack client (ML_STACK_HTTP_URL + RL_QUEUE_POLICY_SHADOW_ENABLED=true; env-only ML_STACK_SERVICE_TOKEN bearer). Typed fail-closed errors; shadow mode enforced; suggested_order validated against the candidate set; OPE pass-through; /health status probe.
  • queuePolicy tRPC router: officer suggestion returns the policy's suggested order alongside the authoritative FIFO/AEO order (never modified); recordDecision append-only officer accept/override log.
  • Migration 0070 queue_policy_decisions (hand-written delta + journal entry, 0069 precedent).
  • UI: AdminAeoFastLane export-queue tab — "Suggested order (shadow policy vX)" toggle, per-row suggested-position badges, Accept/Override buttons, honest untrained/not-configured states. Never auto-applied.
  • REST GET /v1/rl/queue-policy/status (reports:read) for the ministry RL-insights card.
  • Hygiene: env.ts registrations (PRA-068 sweep green), Permify gate exemption (aeoFastLane precedent), regenerated stale pnpm-lock.yaml (phase17 B1 follow-up).

Tests: full vitest suite 5276 passed / 0 failed (baseline 5258 with 2 pre-existing failures, both now green). DB-gated suites skip cleanly without PostgreSQL.

… queue

- server/rl/queuePolicy.ts: config-gated (ML_STACK_HTTP_URL +
  RL_QUEUE_POLICY_SHADOW_ENABLED=true) ml-stack client for POST
  /score/queue-policy; fail-closed typed errors (config/untrained/
  unavailable/invalid); shadow-mode enforced; candidate-set validation;
  OPE score pass-through; /health registry status probe.
- queuePolicy tRPC router: officer-facing suggestion (authoritative
  FIFO/AEO order returned unchanged alongside the suggestion — RL only
  annotates) + append-only recordDecision log for future reward joins.
- Migration 0070 queue_policy_decisions (hand-written delta + journal
  entry, 0069 precedent; no history rewritten).
- AdminAeoFastLane queue tab: 'Suggested order (shadow policy vX)' toggle
  with per-row suggested-position badges, Accept/Override logging, and
  honest untrained / not-configured states. Never auto-applied.
- REST GET /v1/rl/queue-policy/status for the ministry RL-insights card
  (reports:read API key; 503 down, trained/untrained honest payload).
- Registered ML_STACK_SERVICE_TOKEN + CSP_*_EXTRA in env.ts (PRA-068
  sweep now green), queuePolicy exempted in the Permify coverage gate
  (in-router officer role enforcement, aeoFastLane precedent).
- Regenerated pnpm-lock.yaml (main's lockfile was stale vs package.json
  since Phase 17 B1 — flagged in phase17/b1 RESULT.md).
Tests: server/rl/queuePolicy.test.ts (16), phase18.queuePolicy.db.test.ts
(6, DB-gated), executiveApi route registration. Full suite: 5276 passed,
0 failed (baseline 5258 with 2 pre-existing failures).
@munisp
munisp merged commit 06d1985 into main Sep 10, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant