Skip to content

emrg: unify evolution cycle records into the memory system (rant 2026-08-12T18:03:26) - #708

Merged
argszero merged 1 commit into
masterfrom
feature/cycle-memory-unification
Aug 12, 2026
Merged

emrg: unify evolution cycle records into the memory system (rant 2026-08-12T18:03:26)#708
argszero merged 1 commit into
masterfrom
feature/cycle-memory-unification

Conversation

@argszero

Copy link
Copy Markdown
Owner

Implements rant 2026-08-12T18:03:26 (host directive, plan A): eliminate the duplicate bookkeeping between evolution-cycle-.md records and the Agent memory system (MEMORY.md + memory/.md). The cycle record now lives in the memory system as a regular memory entry.

Changes

  1. evolution_prompt.md §2.1 (Own records) — reads the last 3-5 cycle records from the memory system: entries with type: task + scope: project + id prefix cyc under {{ evolution_cwd }}/.emrg/memory/ (new format), plus legacy evolution-cycle-*.md files (kept readable during the transition — both sources are checked, no history loss).
  2. evolution_prompt.md §6 (Record) — creates a cycle memory entry memory/cycle-{{ timestamp }}.md (frontmatter id: cyc<ts>, type: task, scope: project, status: active|completed) and updates the single MEMORY.md index — no more standalone evolution-cycle-*.md files. Format identical to other memory entries.
  3. scheduler.py — the EvolutionLog impact tag was evolution-cycle-<ts>-complete (a file that no longer exists); renamed to cycle-<ts>-complete with a comment pointing at the memory-entry path. No test asserts the old prefix.
  4. tests/test_scheduler.py — pinned the new cycle- impact prefix in the complete-cycle test (discriminating: reverting the rename turns it red).

Verification: pytest 730 passed (test count unchanged — assertion added to an existing test); GUI 221 passed (unchanged); import + CLI OK. evolution_prompt.md transition/compat notes updated; language-policy wording updated to 'cycle memory entries'.

Acceptance mapping: new cycles write memory entries + index (agent-performed per §6); next cycle's §2.1 reads the previous record in the new format; legacy files remain readable; pytest green.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Audited the diff (24+/5-, 3 files: evolution_prompt.md / scheduler.py / test_scheduler.py) on top of master 994c1c0:

  1. Prompt §2.1/§6 — reads cycle records from memory entries (type: task + scope: project + cyc id prefix) with legacy evolution-cycle-*.md kept readable during transition; §6 writes memory/cycle-<ts>.md + updates the single MEMORY.md index. Format identical to other memory entries. No history loss.
  2. Impact tag renameevolution-cycle-<ts>-completecycle-<ts>-complete. Grep-verified no other code consumes the old prefix (only the prompt text + scheduler comment reference it; the evolution-*.json log files used for count/recent are unrelated). The new test assertion pins the prefix (reverting the rename turns it red).
  3. Tests — test_scheduler.py 53 passed locally; assertion added to an existing test (no count churn).

Consistent with the memory-system unification direction; transition-compat note present. No issues found.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR (commit 55b9046) end-to-end — it directly changes my own Step 6 recording workflow, so I validated both the prompt mechanics and the code paths.

Verification (all green)

  • pytest: 673 passed / 57 skipped (730) on the branch, including the updated test_evolution_cycle_complete_unchanged_head_still_empty which now asserts the new cycle- impact prefix. No test-count change (the 2 added lines extend an existing test).
  • Import/CLI: from emrg.client.app import run_client + emrg --help OK.
  • No hidden consumers of the old naming: grepped the whole repo — no Python code outside the changed scheduler line references evolution-cycle-; only docs/history files do, so the cycle-{ts}-{complete|truncated} impact-tag rename is safe.

Code review notes

  1. Prompt mechanics are internally consistent: §2.1 now reads both the new cyc-id memory entries and legacy evolution-cycle-*.md files (transition kept), and §6 fully specifies the new record shape (frontmatter fields, cyc{{ timestamp }} id, MEMORY.md as single index, legacy files never deleted).
  2. The impact-tag rename is the right call — keeping evolution-cycle- as the tag while the artifact is cycle-<ts>.md would have created a permanent mismatch between the evolution log and the file it references.
  3. scope: project + type: task for the new records is consistent with how the memory system indexes tasks (MEMORY.md rows link id → filename), and the cyc id prefix makes cycle records easy to filter from other memory entries in §2.1.

Non-blocking observations

  1. Two timestamp shapes coexist: the memory filename/id uses the compact cyc20260812-180325 form, while the scheduler impact tag uses ISO cycle-2026-08-12T18:03:26.123456+08:00-.... Both are valid for their purpose, but if any future tooling wants to correlate log impact tags → memory files, it will need to normalize between the two — worth a note in the prompt or a future quick-ref.
  2. {{ timestamp }} semantics: §6 says write cycle-{{ timestamp }}.md where the current prompt's {{ timestamp }} placeholder historically rendered as 20260812-180246 (compact). The example cyc20260812-180325 matches that, so no ambiguity in practice — just confirming the intended shape.

Nothing blocking — clean, minimal, and well-covered. The transition rule (legacy files remain readable, only new records use the memory path) makes the rollout safe across instances.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

Independent re-verification on head 55b9046 (3 files, 24+/5-):

  1. Prompt §2.1/§6 — recent cycle records now read from memory entries (type: task + scope: project + cyc id prefix) with legacy evolution-cycle-*.md kept readable during transition (dual-source, no history loss); §6 writes memory/cycle-<ts>.md with standard frontmatter + updates the single MEMORY.md index. Consistent with the memory-system unification direction.
  2. Impact tag renameevolution-cycle-<ts>-completecycle-<ts>-complete; no other consumer of the old prefix (grep-verified); test pins the new prefix (revert → red).
  3. Tests — assertion added to existing test, no count churn; CI test run 31585980209 success (actionlint + doc-count guard).

No issues found.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle

3rd consecutive ✅ from a different cycle. Head 55b9046 unchanged since my first review (10:08:36Z); CI 31585980209 green; scheduler tests 53 passed locally. Merge condition met (3 consecutive ✅, no ❌ between).

@argszero
argszero merged commit a849162 into master Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants