feat(continual-learning): activate negative-feedback loop (RSI steps 1-2)
Step 1 — policy.ts shouldIntervene: suppress on a prior dismissal alone. The former `&& !priorOutcome.wasRealCollision` term was dead code (outcomes record wasRealCollision hardcoded true), so the 85 real dismissals in Atlas were never used. Now a prior accepted===false suppresses the next identical nudge. Spec: continual-learning/policy.md:41, spec.md:163. Step 2 — podman.ts handle: only escalate severity to 'critical' (the spoken alert trigger) when the recalled prior was an accepted *real* collision, instead of blanket-escalating every recall. Surfaces learned routing in preferredAction; stops dismissed/false priors over-escalating to voice. Spec: continual-learning/policy.md:62-63, plan.md:66. Documentation-first: adds PLAN.md section 8 "P0.5 - RSI negative-feedback activation" with both rungs + follow-ups. No schema change. backend typecheck passes. Independent of the MongoDB-cleanup handoff (Codex). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -100,7 +100,14 @@ export class PodMan {
|
||||
if (this.activeConflicts.has(key)) return; // single-shot: already voiced, still unresolved
|
||||
|
||||
const prior = await recallSimilar(collision); // Loop A: exact/vector recall raises confidence
|
||||
if (prior) collision.severity = 'critical';
|
||||
// Only escalate to critical (which triggers the spoken alert) when the
|
||||
// recalled prior was an *accepted real* collision. Blanket-escalating every
|
||||
// recall — including dismissed/false-positive priors — masked the learned
|
||||
// routing in preferredAction and made recalled noise scream "CRITICAL".
|
||||
// (RSI Step 2 — continual-learning/policy.md:62-63, plan.md:66)
|
||||
if (prior?.priorOutcome?.accepted && prior?.priorOutcome?.wasRealCollision) {
|
||||
collision.severity = 'critical';
|
||||
}
|
||||
if (!shouldIntervene(collision, prior)) return; // Loop B: policy gate
|
||||
|
||||
this.activeConflicts.add(key); // claim now we're alerting; re-armed in onScreenFrame on resolution
|
||||
|
||||
@@ -12,7 +12,12 @@ export function shouldIntervene(collision: Collision, prior: RecalledCollision |
|
||||
if (collision.severity === 'info') return false;
|
||||
|
||||
const priorOutcome = prior?.priorOutcome;
|
||||
if (priorOutcome && !priorOutcome.accepted && !priorOutcome.wasRealCollision) return false;
|
||||
// Suppress when the identical prior was dismissed (accepted === false). The
|
||||
// former `&& !priorOutcome.wasRealCollision` term was dead code: outcomes are
|
||||
// recorded with wasRealCollision hardcoded true, so the gate never fired and
|
||||
// the 85 real dismissals in Atlas were ignored. Dismissals are the negative
|
||||
// signal per continual-learning/policy.md:41 + spec.md:163. (RSI Step 1)
|
||||
if (priorOutcome && !priorOutcome.accepted) return false;
|
||||
|
||||
const cooldown = cooldownMs();
|
||||
const last = lastNudgeByPod.get(collision.podId) ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user