You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep approval outcomes and their receipt evidence for the loan-review governance PoC.
This issue no longer covers an RL training loop or a separate feedback database.
Context
Main already contains related work from #206 and #207. pkg/approval handles approve, reject, and edit decisions stamped by the admission webhook. pkg/receipts records human-layer decisions with a pseudonymous approver digest.
This rescope does not mark that work complete for the PoC.
Acceptance
Approve, reject, and edit outcomes from the loan-review console each produce a signed human-layer receipt.
Each receipt binds the outcome to the pending action and the approver digest.
Offline verification passes for an untouched chain and fails after tampering.
Ship as per-bucket online recalibration + threshold optimisation with ADWIN drift detection and shrinkage-based cold-start, marketed as the "RL feedback loop". Not full RL, not a neural policy network, not contextual bandits — the data regime (~10²/week feedback) does not support those, and the literature shows they fail badly at this scale.
Why not full RL (PPO / RLHF style)
InstructGPT (Ouyang et al. 2022) used ~33k preference comparisons just to bootstrap a usable reward model. We will see that in two years, not in a milestone.
Self-Rewarding LMs (Yuan et al. 2024) explicitly documents the reward-hacking failure mode that hits exactly this kind of feedback loop. Mitigation in our design: agent never sees the threshold.
Why not contextual bandits (yet)
Even Thompson sampling needs O(dozens) of impressions per (persona, action_type) cell. With ~50 cells and ~10²/week, per-cell convergence takes ~12+ months.
Why calibration + threshold tuning IS the right frame
Tian et al. (EMNLP 2023) shows verbalized LLM confidence (which we already collect) reduces calibration error ~50% vs logit-based — but RLHF models are systematically miscalibrated, so we must recalibrate against ground truth.
Xiong et al. (ICLR 2024) shows LLMs systematically overconfident; consistency-across-samples helps. Cheap upgrade for v0.3.
river.drift.ADWIN on the per-bucket reward stream (1=approved, 0=rejected). When drift fires:
Clamp threshold back to global prior.
Set Status.Conditions[type=CalibrationDrift]=True on AgentPersona.
Emit Prometheus alert.
This catches model-upgrade drift, persona-behaviour drift, and tool-set changes. Without it we silently auto-approve dangerous actions for weeks.
Cold-start (first 50 decisions per bucket)
Empirical-Bayes shrinkage to a higher-than-steady-state global prior. Fall back through (bucket → persona-marginal → action-type-marginal → global). Better to over-ask the human in week 1 than to under-ask.
changed the title [-]RL feedback controller — capture approve/reject signals from OPA gates[/-][+]Approval outcomes as signed receipt evidence[/+]on Oct 22, 2026
Rescoped to approval outcomes and receipt evidence for the loan-review governance PoC.
The RL training loop and the separate feedback database are outside this phase.
The restart durability requirement from #88 is preserved here. #88 closes as not planned.
Related code exists on main, but this issue is not marked completed.
Labels now reflect the current scope, and the old RL milestone was removed.
The original scope is kept in the body.
Activity
shreyanshjain7174 commentedon Apr 26, 2026
Deep research synthesis (2026-04-26)
Full research note (~2.5k words, 12 primary sources):
Obsidian/NineVigil/01-Research/RL Feedback Loop - Deep Research. Posting the load-bearing conclusions here so the design lives on the issue.TL;DR design choice for v0.2.0
Ship as per-bucket online recalibration + threshold optimisation with ADWIN drift detection and shrinkage-based cold-start, marketed as the "RL feedback loop". Not full RL, not a neural policy network, not contextual bandits — the data regime (~10²/week feedback) does not support those, and the literature shows they fail badly at this scale.
Why not full RL (PPO / RLHF style)
Why not contextual bandits (yet)
(persona, action_type)cell. With ~50 cells and ~10²/week, per-cell convergence takes ~12+ months.Why calibration + threshold tuning IS the right frame
--reject.Drift detection: ADWIN per bucket
river.drift.ADWINon the per-bucket reward stream (1=approved, 0=rejected). When drift fires:Status.Conditions[type=CalibrationDrift]=TrueonAgentPersona.This catches model-upgrade drift, persona-behaviour drift, and tool-set changes. Without it we silently auto-approve dangerous actions for weeks.
Cold-start (first 50 decisions per bucket)
Empirical-Bayes shrinkage to a higher-than-steady-state global prior. Fall back through (bucket → persona-marginal → action-type-marginal → global). Better to over-ask the human in week 1 than to under-ask.
Concrete data model (informs #88)
Persisted in Postgres (same DB as LangGraph checkpoints), not etcd.
Open design questions (need decisions before #82 implementation lands)
agent does wrong thingvsextra human ask. Default proposal: α=100, β=1, configurable perAgentPersona.feedbackContributesToGlobalPrior: bool?Status.CurrentThresholdper persona in CRD status — yes/no. (My recommendation: yes; hiding it makes ops blind.)Cascade impact on sibling issues
--rejected-ruleflag, not just boolFeedbackEventaboveUpgrade path (no rewrites required)
Each swaps one component without touching the controller.
Sources (full bibliography in research note)
12 primary sources: arxiv 2207.05221, 2212.08073, 2203.02155, 2209.14375, 2309.00267, 2401.10020, 2305.14975, 2306.13063, 2107.07511, river docs, Langfuse user-feedback docs, LangSmith.
cc #83 #84 #85 #86 #87 #88 — this synthesis is the input for those design discussions.
feat(cli): add agentctl reject command with --rule and --reason flags (…
feat(cli): add agentctl reject command with --rule and --reason flags (…
[-]RL feedback controller — capture approve/reject signals from OPA gates[/-][+]Approval outcomes as signed receipt evidence[/+]shreyanshjain7174 commentedon Oct 22, 2026
Rescoped to approval outcomes and receipt evidence for the loan-review governance PoC.
The RL training loop and the separate feedback database are outside this phase.
The restart durability requirement from #88 is preserved here.
#88 closes as not planned.
Related code exists on main, but this issue is not marked completed.
Labels now reflect the current scope, and the old RL milestone was removed.
The original scope is kept in the body.