Skip to content

Reflect.ts "learn" step is self-invoked only — no enforcement, so the reflection corpus silently stays empty #2021

Description

@garthsch

Version: Algorithm v8.17.3–v8.20.2 / LifeOS 7.28.3–7.40.4 (schema-9 Reflect.ts era, confirmed present at current upstream HEAD).

What's broken: LIFEOS/ALGORITHM/v8.20.2.md requires appending a reflection "at learn, for any run that did real work" via bun LIFEOS/TOOLS/Reflect.ts --reflection "...". Nothing calls this automatically — it depends entirely on the model remembering to self-invoke at the end of a run. No hook checks whether a real-work session produced a matching entry. hooks/WorkCompletionLearning.hook.ts looks like it might cover this (SessionEnd-triggered, writes to LEARNING/) but it only checks whether ISA claims were closed and writes an unrelated WORK→LEARNING bridge file — it never touches Reflect.ts or algorithm-reflections.jsonl. So every downstream consumer of that file (MineReflections workflow, Upgrade skill, AlgorithmUpgrade workflow) reads it expecting signal, and silently reports "0 entries" / "nothing to mine" instead of flagging that the capture step itself never ran.

Repro on a clean tree: Fresh install → run a session that edits files and/or dispatches agents (real work by any reasonable definition) → close the session without manually invoking Reflect.ts → nothing blocks close-out, no warning appears → MEMORY/LEARNING/REFLECTIONS/algorithm-reflections.jsonl gains zero entries for that session.

Negative control: Reflect.ts itself is not broken — invoked manually with a valid --reflection string, it validates and appends correctly against the schema-9 shape. The defect is purely the missing trigger/enforcement, not the writer.

Suggested fix (optional): A session-end check that detects "real work happened this session" (files touched, agents dispatched) and verifies a Reflect.ts entry exists for the session_id before treating close-out as complete — surfacing a nudge rather than silently passing. This is the same failure class #850 (closed 2026-03-02, v4.0.2) fixed via the ReflectionCapture hook and PhaseGate/ReflectionDigest (#735, #1029) — the capture mechanism changed shape since then (automatic hook → manual self-invoke), and the enforcement gap came back with it. WorkCompletionLearning.hook.ts is the natural place to extend, since it already runs on SessionEnd and already has the "did real work happen" significance test — it would just need a second check alongside the claims-closed one.

Severity (my own read, no severity label scheme exists in this repo): Medium — silent, systemic, non-crashing. No data loss, no crash, no security exposure, and the Algorithm keeps executing real work fine. But it defeats the reflection/upgrade subsystem's entire purpose by default on every install, and the failure is indistinguishable from "genuinely nothing to learn" unless someone manually interrogates the corpus.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions