Problem
Two Phase-4 services exist as substrate but are never instantiated in the runtime — they're dead code outside of unit tests:
| Service |
Migration |
Spec |
Status |
RemDiversityService |
082 |
§10.4 anti-echo-chamber |
class exists, no new …() call |
LessonContradictionGate |
080 |
§10.3 contradicts-trigger |
class exists, no new …() call |
RemAuditService (4h) and RemPromotionService (4i.2) are correctly wired in mcp-server/src/index.ts and called from tools/digest.ts. The other two were not.
Empirically:
lesson_diversity_log stays at 0 rows after REM cycles run.
swarm_lesson_contradictions stays at 0 rows even when ingesting test data with deliberate polarity flips.
The dashboard shows these as empty — correctly, because the writers don't run.
Scope
RemDiversityService — nightly REM step
- Instantiate alongside the other REM services in
index.ts.
- Add a step in
tools/digest.ts that calls the diversity check after RemPromotion runs. Order matters: diversity dampens weight, promotion increases weight; if diversity runs second it will counterbalance promotion correctly.
- The check writes one row per evaluated lesson into
lesson_diversity_log.
LessonContradictionGate — runs on inbound (and after REM)
- Instantiate as a member of
ConscienceAgent (mcp-server/src/agents/conscience-agent.ts) — the §10.3 spec puts the gate in the conscience-agent flow.
- Call the gate after every successful inbound lesson admission (when the inbound endpoint exists; until then, expose it via a digest step that scans the recently-arrived swarm_lessons window).
- Gate populates
swarm_lesson_contradictions and demotes both endpoints to Tier-B per §10.3.
Acceptance
Out of scope
- Inbound HTTP endpoint that actually admits lessons (separate issue).
- Operator UI for resolving contradicts (covered by the dashboard-action issue).
- Contradicts-resolution timer (Phase 4f — already shipped).
Problem
Two Phase-4 services exist as substrate but are never instantiated in the runtime — they're dead code outside of unit tests:
RemDiversityServicenew …()callLessonContradictionGatenew …()callRemAuditService(4h) andRemPromotionService(4i.2) are correctly wired inmcp-server/src/index.tsand called fromtools/digest.ts. The other two were not.Empirically:
lesson_diversity_logstays at 0 rows after REM cycles run.swarm_lesson_contradictionsstays at 0 rows even when ingesting test data with deliberate polarity flips.The dashboard shows these as empty — correctly, because the writers don't run.
Scope
RemDiversityService— nightly REM stepindex.ts.tools/digest.tsthat calls the diversity check afterRemPromotionruns. Order matters: diversity dampens weight, promotion increases weight; if diversity runs second it will counterbalance promotion correctly.lesson_diversity_log.LessonContradictionGate— runs on inbound (and after REM)ConscienceAgent(mcp-server/src/agents/conscience-agent.ts) — the §10.3 spec puts the gate in the conscience-agent flow.swarm_lesson_contradictionsand demotes both endpoints to Tier-B per §10.3.Acceptance
lesson_diversity_loghas rows.swarm_lesson_contradictionshas the pair, and both rows inswarm_lessonshavelesson_tier='B'.Out of scope