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: align executive drill validation and labels (#4445)

[._.]/ Adam Eivyfacf7eb8cbd5
diff --git a/client/src/components/meatspace/post/PostCognitiveDrillRunner.jsx b/client/src/components/meatspace/post/PostCognitiveDrillRunner.jsx
index 8ddcfdb069..b4e1ff4344 100644
--- a/client/src/components/meatspace/post/PostCognitiveDrillRunner.jsx
+++ b/client/src/components/meatspace/post/PostCognitiveDrillRunner.jsx
@@ -1572,7 +1572,7 @@ function BinaryChoiceRunner({ type, drill, drillIndex, drillCount, onComplete, i
{phase === 'cue' && <div className="text-gray-500">Get ready…</div>}
{phase === 'stimulus' && type === 'task-switching' && trial && (
<div
- aria-label={`${trial.stimulus.color} ${trial.stimulus.fill} ${trial.stimulus.shape}`}
+ aria-label={[trial.stimulus.color, trial.stimulus.fill, trial.stimulus.shape].filter(Boolean).join(' ')}
className="text-8xl leading-none motion-reduce:transition-none"
style={{ color: trial.stimulus.color === 'blue' ? '#3b82f6' : '#f97316' }}
>
diff --git a/client/src/components/meatspace/post/PostCognitiveDrillRunner.test.jsx b/client/src/components/meatspace/post/PostCognitiveDrillRunner.test.jsx
index 6e882249de..57a247b54f 100644
--- a/client/src/components/meatspace/post/PostCognitiveDrillRunner.test.jsx
+++ b/client/src/components/meatspace/post/PostCognitiveDrillRunner.test.jsx
@@ -685,7 +685,7 @@ describe('executive-control runners', () => {
type: 'task-switching',
config: { cueStimulusIntervalMs: 100, responseDeadlineMs: 1000 },
rules: [{ id: 'color', values: ['blue', 'orange'] }, { id: 'shape', values: ['circle', 'triangle'] }],
- trials: [{ rule: 'color', stimulus: { color: 'blue', shape: 'triangle', fill: 'solid' }, switched: false, incongruent: true }],
+ trials: [{ rule: 'color', stimulus: { color: 'blue', shape: 'triangle' }, switched: false, incongruent: true }],
}}
drillIndex={0}
drillCount={1}
@@ -695,6 +695,7 @@ describe('executive-control runners', () => {
expect(screen.getByText(/cued rule/i)).toBeInTheDocument();
expect(screen.getAllByRole('status').length).toBeGreaterThan(0);
act(() => vi.advanceTimersByTime(100));
+ expect(screen.getByLabelText('blue triangle')).toBeInTheDocument();
fireEvent.keyDown(window, { key: 'ArrowLeft' });
act(() => vi.advanceTimersByTime(250));
expect(onComplete).toHaveBeenCalledTimes(1);
diff --git a/server/lib/postValidation.js b/server/lib/postValidation.js
index c96a796a13..ee83ab81a1 100644
--- a/server/lib/postValidation.js
+++ b/server/lib/postValidation.js
@@ -127,7 +127,9 @@ const drillTypeConfigSchema = z.object({
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(),
+ // Executive-control generators support up to 60 trials. This shared config
+ // schema must accept every generated config on the scored-session round-trip.
+ count: z.number().int().min(1).max(60).optional(),
maxDigits: z.number().int().min(1).max(4).optional(),
// Progressive multiplication ladder (server/lib/postMultiplicationLadder.js).
// `progressive` is the config toggle; `level`/`factors` are server-computed
@@ -155,13 +157,15 @@ const drillTypeConfigSchema = z.object({
// keeps a conservative fixed floor of 6 and lets the generator clamp up.
// (timeLimitSec above is validated but NOT enforced for these drill types —
// they're self-paced/stimulus-driven; see PostCognitiveDrillRunner.jsx.)
- // stimulusMs (n-back) / showMs (digit-span) are the presentation-speed knobs.
+ // stimulusMs (n-back / Go-No-Go) and showMs (digit-span) are the
+ // presentation-speed knobs. The lower bound covers Go/No-Go's brief signals;
+ // each generator still applies its drill-specific clamp.
// The progressive ladder (default ON) drives them per rung; manual mode
// (progressive off) exposes them in the config UI (issue #2095), so they must
- // survive validation. Bounds mirror the generator clamps in
- // meatspacePostCognitive.js (generateNBack / generateDigitSpan).
+ // survive validation. Bounds span the generator clamps in
+ // meatspacePostCognitive.js (generateNBack / generateGoNoGo).
n: z.number().int().min(1).max(3).optional(),
- stimulusMs: z.number().int().min(1000).max(5000).optional(),
+ stimulusMs: z.number().int().min(100).max(5000).optional(),
showMs: z.number().int().min(400).max(4000).optional(),
length: z.number().int().min(6).max(60).optional(),
direction: z.enum(['forward', 'backward']).optional(),
diff --git a/server/lib/postValidation.test.js b/server/lib/postValidation.test.js
index caf26b6ad6..fa2f76db8e 100644
--- a/server/lib/postValidation.test.js
+++ b/server/lib/postValidation.test.js
@@ -571,6 +571,19 @@ describe('drillTypeConfigSchema numeric bounds', () => {
expect(parsed.config).toMatchObject({ seed: 'example-seed', ruleCount: 3, switchRatePct: 65, lureSimilarity: 'high', flankerStrength: 3 });
});
+ it('accepts the full Go/No-Go and Flanker generator ranges', () => {
+ const goNoGo = postDrillRequestSchema.parse({
+ type: 'go-no-go',
+ config: { count: 60, stimulusMs: 100, responseDeadlineMs: 500 },
+ });
+ const flanker = postDrillRequestSchema.parse({
+ type: 'flanker',
+ config: { count: 60, responseDeadlineMs: 500 },
+ });
+ expect(goNoGo.config).toMatchObject({ count: 60, stimulusMs: 100 });
+ expect(flanker.config.count).toBe(60);
+ });
+
it('rejects out-of-range executive-control knobs', () => {
expect(() => postDrillRequestSchema.parse({ type: 'task-switching', config: { ruleCount: 4 } })).toThrow();
expect(() => postDrillRequestSchema.parse({ type: 'go-no-go', config: { noGoPct: 0 } })).toThrow();