Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: honor powers review opt-outs (#3253)

[._.]/ Adam Eivyce93060d74ee
diff --git a/server/services/meatspacePost.js b/server/services/meatspacePost.js
index 94e8cfd431..61e196428d 100644
--- a/server/services/meatspacePost.js
+++ b/server/services/meatspacePost.js
@@ -537,10 +537,17 @@ export async function getPostReviewReps(now = new Date(), limit = 2) {
// capping first would let older due memory-chunk entries (which have no
// runnable rep) consume the limit slots and starve runnable multiplication/
// cognitive reps that are due later in the schedule.
- const due = await getDueReviews(now, Infinity);
+ const [due, config] = await Promise.all([
+ getDueReviews(now, Infinity),
+ getPostConfig(),
+ ]);
const reps = [];
for (const entry of due) {
if (reps.length >= limit) break;
+ // Review reps are mixed directly into Quick sessions, so enforce the same
+ // topic, module-composition, module, and per-drill gates as recommendations.
+ // A skill may have become due after the user switched that practice off.
+ if (!isRecDrillRunnable(config, recModuleForDrillType(entry.drillType, 'cognitive'), entry.drillType)) continue;
if (entry.kind === 'multiplication') {
reps.push({
skillId: entry.skillId,
diff --git a/server/services/meatspacePost.test.js b/server/services/meatspacePost.test.js
index 4dc252e10c..a2c78da2ab 100644
--- a/server/services/meatspacePost.test.js
+++ b/server/services/meatspacePost.test.js
@@ -2025,6 +2025,27 @@ describe('getSessionSkillContext', () => {
expect(drill.questions).toHaveLength(5);
expect(drill.questions.every(question => question.techniqueLevel === 1)).toBe(true);
});
+
+ it('does not return a due Powers review after Powers is disabled', async () => {
+ readJSONFile.mockImplementation((path, defaultValue) => {
+ const p = String(path);
+ if (p.includes('post-review-schedule')) return Promise.resolve({
+ skills: {
+ 'powers:L1': {
+ skillId: 'powers:L1', kind: 'powers', label: 'Powers review',
+ drillType: 'powers', level: 1,
+ nextReviewAt: '2020-01-01T00:00:00.000Z', status: 'fresh',
+ },
+ },
+ });
+ if (p.includes('post-config')) return Promise.resolve({
+ mentalMath: { drillTypes: { powers: { enabled: false } } },
+ });
+ return Promise.resolve(defaultValue);
+ });
+
+ expect(await getPostReviewReps(new Date('2026-07-31T00:00:00.000Z'))).toEqual([]);
+ });
});
describe('resolveDrillConfig — maintenance-review bypass (issue #2096)', () => {