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: address round 2 review — schema gaps, error handling

Adam Eivy3e0ff465fca2
diff --git a/client/src/components/meatspace/post/PostHistory.jsx b/client/src/components/meatspace/post/PostHistory.jsx
index eddc5882c3..0aca626dbc 100644
--- a/client/src/components/meatspace/post/PostHistory.jsx
+++ b/client/src/components/meatspace/post/PostHistory.jsx
@@ -33,8 +33,8 @@ export default function PostHistory({ onBack }) {
? new Date(Date.now() - range * 86400000).toISOString().split('T')[0]
: undefined;
const [s, st] = await Promise.all([
- getPostSessions(from),
- getPostStats(range)
+ getPostSessions(from).catch(() => []),
+ getPostStats(range).catch(() => null)
]);
setSessions((s || []).slice().reverse());
setStats(st);
diff --git a/client/src/components/meatspace/tabs/PostTab.jsx b/client/src/components/meatspace/tabs/PostTab.jsx
index d1854bc3fe..8ba9a73df5 100644
--- a/client/src/components/meatspace/tabs/PostTab.jsx
+++ b/client/src/components/meatspace/tabs/PostTab.jsx
@@ -20,11 +20,11 @@ export default function PostTab() {
async function loadData() {
const [cfg, sessions] = await Promise.all([
- getPostConfig(),
- getPostSessions()
+ getPostConfig().catch(() => null),
+ getPostSessions().catch(() => [])
]);
setConfig(cfg);
- setRecentSessions(sessions);
+ setRecentSessions(sessions || []);
}
async function handleStart(drillConfigs, tags) {
diff --git a/server/lib/postValidation.js b/server/lib/postValidation.js
index 927c5b3d33..65779b8ab0 100644
--- a/server/lib/postValidation.js
+++ b/server/lib/postValidation.js
@@ -37,10 +37,13 @@ export const postSessionSubmitSchema = z.object({
});
// Drill type configuration
+const DRILL_TYPES = ['doubling-chain', 'serial-subtraction', 'multiplication', 'powers', 'estimation'];
+
const drillTypeConfigSchema = z.object({
enabled: z.boolean().optional(),
steps: z.number().int().min(1).max(50).optional(),
subtrahend: z.number().int().min(1).max(100).optional(),
+ startValue: z.number().int().min(1).optional(),
startRange: z.array(z.number()).length(2).optional(),
timeLimitSec: z.number().int().min(10).max(600).optional(),
count: z.number().int().min(1).max(50).optional(),
@@ -54,7 +57,7 @@ const drillTypeConfigSchema = z.object({
export const postConfigUpdateSchema = z.object({
mentalMath: z.object({
enabled: z.boolean().optional(),
- drillTypes: z.record(drillTypeConfigSchema).optional()
+ drillTypes: z.record(z.enum(DRILL_TYPES), drillTypeConfigSchema).optional()
}).optional(),
sessionModules: z.array(z.string()).optional(),
scoring: z.object({