Skip to content

emrg: persist task execution records to JSONL + fix task-row flex-wrap - #876

Merged
argszero merged 1 commit into
masterfrom
feature/task-runs-persistence
Aug 19, 2026
Merged

emrg: persist task execution records to JSONL + fix task-row flex-wrap#876
argszero merged 1 commit into
masterfrom
feature/task-runs-persistence

Conversation

@argszero

Copy link
Copy Markdown
Owner

Fixes two host rants from 2026-08-19 (GUI task management):

  1. rant 2026-08-19T20:49:52 (subtable position bug): the task-row CSS lacked flex-wrap — with the accordion subtable's flex-basis: 100% the detail row got squeezed to the right of the card instead of wrapping below. Fix: add flex-wrap: wrap to .task-row + a smoke assertion guarding both the wrap and the 100% basis.

  2. rant 2026-08-19T20:50:36 (host Plan B — execution-record persistence): execution records lived only in the in-memory self.evolutions list (lost on daemon restart). Plan B: append each completed cycle as one JSON line to ~/.emrg/logs/task-runs/<task>.jsonl (TaskHandler._append_task_run at the cycle end), restore the last 50 on init (_load_task_runs), bounded append (trim to 50), fully fault-tolerant (corrupt line skipped / unreadable file → empty, write failure → warning only, cycle unaffected). In-memory list stays the primary source for status()/recent_runs; JSONL is the durable copy.

Tests: +4 scheduler unit tests (restart restore, 50-cap, corrupt-file tolerance, write-failure tolerance); +1 smoke assertion (flex-wrap). Full suite 986 passed + 1 skipped (987 collected); GUI smoke 131 pass; doc-count guard green (Agent.md 983→987 Python, 259→260 GUI).

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Verified: full suite 986 passed + 1 skipped (987 collected); import + CLI checks green; doc-count guard green (Agent.md 983→987 Python, 259→260 GUI); GUI smoke 131 pass. CI test + test-windows both PASS (32256088924). Persistence is fault-tolerant (corrupt line skipped, write failure → warning only) and the in-memory list stays the primary status() source.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Fresh re-review (head 601bd14 unchanged): persistence is fault-tolerant per host Plan B (corrupt line skipped individually, unreadable file → empty list, write failure → warning only, cycle unaffected); bounded append trims to 50; status()/recent_runs still read the in-memory list. CSS fix is the minimal flex-wrap addition with a guarding assertion. CI test + test-windows PASS.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Third consecutive LGTM (head 601bd14 unchanged, CI test + test-windows PASS). Merging.

@argszero
argszero merged commit 6be7ec8 into masterAug 19, 2026
2 checks passed
@argszero
argszero deleted the feature/task-runs-persistence branch August 19, 2026 13:54
argszero added a commit that referenced this pull request Aug 20, 2026
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for freeto 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.

1 participant

@argszero