tycono 0.1.94-beta.6 → 0.1.94-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.94-beta.6",
3
+ "version": "0.1.94-beta.8",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -745,11 +745,12 @@ function buildSupervisionSection(node: OrgNode): string {
745
745
  - 🛑 **Abort**: Seriously wrong → \`python3 "$SUPERVISION_CMD" abort <ses-id> --reason "why"\`
746
746
  - ✅ **All done?** → Before reporting done, **verify deliverables** (see Quality Gate below)
747
747
  4. **Repeat** watch until all subordinates complete. Do NOT stop after one tick.
748
- 5. **Quality Gate**: When subordinates report done, **read their actual output**:
749
- - Check files exist and are non-trivial
750
- - Verify key requirements from your task are met
751
- - If gaps found re-dispatch with specific feedback: "Missing X, Y, Z. Continue."
752
- - There is NO time limit. Iterate until the work truly meets the requirements.
748
+ 5. **Quality Gate**: When subordinates report done, **run and test** the output:
749
+ - For web apps/games: start a local server and open in browser to verify it actually works
750
+ - Try the core user interactions if basic things don't work, it's NOT done
751
+ - Check that required libraries/tools mentioned in the task are actually used
752
+ - If gaps found re-dispatch with **specific, actionable** feedback (not "improve quality")
753
+ - There is NO time limit. Non-working code is worse than less code that works.
753
754
 
754
755
  ## Supervision Commands
755
756
 
@@ -263,6 +263,11 @@ export function deleteSession(id: string, force = false): boolean {
263
263
  console.warn(`[SessionStore] BLOCKED deletion of wave session ${id} (waveId=${session.waveId}, roleId=${session.roleId}). Use force=true to override.`);
264
264
  return false;
265
265
  }
266
+ // BUG-008 hard guard: CEO supervisor session is NEVER deletable during wave
267
+ if (session.roleId === 'ceo' && session.waveId && session.source === 'wave') {
268
+ console.error(`[SessionStore] HARD BLOCK: CEO supervisor session ${id} cannot be deleted (waveId=${session.waveId}). This is a 1:1:1 invariant.`);
269
+ return false;
270
+ }
266
271
 
267
272
  console.log(`[SessionStore] Deleting session ${id} (roleId=${session.roleId}, waveId=${session.waveId ?? 'none'}, messages=${session.messages.length})`);
268
273
  cache.delete(id);
@@ -296,16 +296,23 @@ ${recoveryContext}
296
296
 
297
297
  ## Quality Gate (CRITICAL — G-09)
298
298
  ⛔ **"Subordinate said done" ≠ "Work is actually done."**
299
- Before declaring yourself done, you MUST verify the deliverables meet the directive's requirements:
299
+ **"Code exists" "Code works."** You MUST run and test the output, not just read files.
300
300
 
301
- 1. **Read the actual output files** — don't trust status reports. Check the code, docs, or artifacts yourself.
302
- 2. **Test if it works** — if the directive asks for a working game/app, check if it actually runs.
301
+ Before declaring yourself done, you MUST:
302
+
303
+ 1. **Read the actual output files** — don't trust status reports. Check the code yourself.
304
+ 2. **RUN it and test it** — this is the most important step:
305
+ - For web apps/games: \`cd <code-dir> && python3 -m http.server 9999\` then open in browser
306
+ - Actually try the core interactions (click buttons, press keys, navigate)
307
+ - If basic interactions fail (can't move, can't click, blank screen) → it's NOT done
303
308
  3. **Count against requirements** — if the directive says "15 monsters, 7 maps", count them.
304
- 4. **If quality is insufficient re-dispatch** with specific feedback:
305
- - "You implemented 4/11 systems. Still missing: NPC dialogue, inventory, capture. Continue."
306
- - "The game doesn't load in browser. Fix the entry point and test."
307
- 5. **Iterate until the directive is truly fulfilled.** There is NO time limit.
308
- A half-finished deliverable is worse than taking 2-3 hours to get it right.
309
+ 4. **Check the directive's specific tech requirements** if it mentions a specific library/engine, verify it's actually used in the code (grep for it).
310
+ 5. **If quality is insufficient re-dispatch** with specific, actionable feedback:
311
+ - "Arrow keys don't move the player. Fix input handling in WorldScene."
312
+ - "TyconoForge was required but not used. Add character rendering with TyconoForge.render()."
313
+ - NOT vague feedback like "improve quality" or "make it better"
314
+ 6. **Iterate until the directive is truly fulfilled.** There is NO time limit.
315
+ 20,000 lines of non-working code is worse than 5,000 lines that actually play.
309
316
 
310
317
  Re-dispatch pattern:
311
318
  - dispatch same C-Level with specific gaps identified
@@ -321,27 +328,33 @@ Re-dispatch pattern:
321
328
  6. If gaps exist → re-dispatch with specific feedback. Repeat 3-5.
322
329
  7. Only when ALL requirements are met → compile results and report`;
323
330
 
324
- // Create supervisor session
325
- const session = createSession('ceo', {
326
- mode: 'do',
327
- source: 'wave',
328
- waveId: state.waveId,
329
- });
330
-
331
- state.supervisorSessionId = session.id;
331
+ // BUG-008 fix: Wave:Supervisor:Session = 1:1:1 invariant.
332
+ // Reuse existing session on restart instead of creating a new one.
333
+ let sessionId = state.supervisorSessionId;
334
+ if (sessionId && getSession(sessionId)) {
335
+ console.log(`[Supervisor] Reusing existing session ${sessionId} for wave ${state.waveId}`);
336
+ } else {
337
+ const session = createSession('ceo', {
338
+ mode: 'do',
339
+ source: 'wave',
340
+ waveId: state.waveId,
341
+ });
342
+ sessionId = session.id;
343
+ state.supervisorSessionId = sessionId;
344
+
345
+ // Add the directive as CEO message so the session isn't empty (prevents deleteEmpty cleanup)
346
+ const ceoMsg: Message = {
347
+ id: `msg-${Date.now()}-ceo-supervisor`,
348
+ from: 'ceo',
349
+ content: state.directive,
350
+ type: 'directive',
351
+ status: 'done',
352
+ timestamp: new Date().toISOString(),
353
+ };
354
+ addMessage(sessionId, ceoMsg);
355
+ }
332
356
  state.status = 'running';
333
357
 
334
- // Add the directive as CEO message so the session isn't empty (prevents deleteEmpty cleanup)
335
- const ceoMsg: Message = {
336
- id: `msg-${Date.now()}-ceo-supervisor`,
337
- from: 'ceo',
338
- content: state.directive,
339
- type: 'directive',
340
- status: 'done',
341
- timestamp: new Date().toISOString(),
342
- };
343
- addMessage(session.id, ceoMsg);
344
-
345
358
  try {
346
359
  const exec = executionManager.startExecution({
347
360
  type: 'wave',
@@ -349,14 +362,14 @@ Re-dispatch pattern:
349
362
  task: supervisorTask,
350
363
  sourceRole: 'ceo',
351
364
  targetRoles: state.targetRoles,
352
- sessionId: session.id,
365
+ sessionId,
353
366
  });
354
367
 
355
368
  state.executionId = exec.id;
356
369
 
357
370
  this.watchExecution(state, exec);
358
371
 
359
- console.log(`[Supervisor] Started for wave ${state.waveId} | session=${session.id} | exec=${exec.id}`);
372
+ console.log(`[Supervisor] Started for wave ${state.waveId} | session=${sessionId} | exec=${exec.id}`);
360
373
  } catch (err) {
361
374
  console.error(`[Supervisor] Failed to start for wave ${state.waveId}:`, err);
362
375
  state.status = 'error';