Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[Enhancement] WorkCompletionLearning: Insights section is static placeholder, never populated

Open rikitikitavi2012-debug opened this issue 9 months ago • 1 comments

Summary

WorkCompletionLearning.hook.ts creates session learning files under MEMORY/LEARNING/, but the Insights section always contains static template text — it is never populated with actual session-specific analysis. Every learning file looks identical regardless of what happened in the session.

Current Behavior

The generated files contain:

## Insights

**What worked well:**
- [Auto-generated from session analysis]

**Challenges encountered:**
- [Auto-generated from session analysis]

**Improvements for next time:**
- [Auto-generated from session analysis]

These [Auto-generated from session analysis] placeholders are the actual file content — not the result of generation. The hook writes static template text and the analysis never happens.

Additionally, the ISC section shows:

## ISC State (Criteria Tracking)

**Not specified**

This is because rework cycles in AlgorithmTracker archive criteria to reworkHistory[] before SessionEnd fires, leaving criteria: [] in the state JSON.

Impact

  • The learning loop is structurally in place but produces no actionable output
  • Session learning files are useless for retrospective analysis
  • ISC state is always "Not specified" — the most valuable part of a session's work is invisible
  • The MEMORY/LEARNING/ directory grows with files that contain no signal

Proposed Fix

1. Populate Insights via AI inference (Haiku)

Instead of writing placeholder text, run a quick inference call using the session metadata:

// Use Inference.ts to generate real insights
const insights = await inference({
  systemPrompt: 'You are analyzing an AI work session to extract learning insights...',
  userPrompt: `Session: ${sessionData.task}\nWork done: ${sessionData.summary}\nGenerate: what worked, challenges, improvements`,
  level: 'fast',  // Haiku — cheap and fast
});

2. Resolve ISC from rework history

When criteria: [] but reworkHistory is non-empty, use the most recent rework cycle's criteria:

const activeCriteria = state.criteria.length > 0
  ? state.criteria
  : state.reworkHistory?.at(-1)?.criteria ?? [];

3. Alternative: Mark as "not analyzed" rather than fake placeholder

At minimum, replace [Auto-generated from session analysis] with (not analyzed) or omit the section entirely when no analysis is available. This distinguishes "not yet analyzed" from "analysis failed" from "genuinely empty".

Context

The hook correctly identifies significant sessions (file changes, task count, manual triggers) and creates well-structured files. The infrastructure is solid — the gap is only in the inference step and ISC resolution.

  • Hook path: hooks/WorkCompletionLearning.hook.ts
  • Output path: MEMORY/LEARNING/{ALGORITHM|SYSTEM}/{YYYY-MM}/
  • Depends on: Tools/Inference.ts (already available in the codebase)

rikitikitavi2012-debug avatar Feb 22 '26 21:02 rikitikitavi2012-debug

Reclassifying as enhancement. The current Insights section uses reflective prompts (not fake analysis output as originally reported). Adding inference-powered analysis at session end would be a feature addition — tracking for future consideration. Thanks for the idea!

kaimagnus avatar Mar 01 '26 02:03 kaimagnus