fix(runtime): repair and stamp unfenced journal frontmatter blocks - #244
Merged
Conversation
spashii
force-pushed
the
sam/fix-journal-frontmatter-unfenced-stamp
branch
from
August 27, 2026 11:20
96377b3 to
e3303c4
Compare
spashii
approved these changes
Aug 27, 2026
spashii
left a comment
Member
There was a problem hiding this comment.
Reviewed and approved by Sameer. Rebased onto main; the prior CI failure was a stale .trivyignore.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this change?
This change introduces a runtime repair function
_ensure_fenced_frontmatterinsrc/runtime/adk_runner.pythat detects unfenced or unterminated frontmatter blocks in journal entries (e.g., blocks starting straight withtrigger:instead of---). It wraps them in proper YAML fences so that_stamp_journal_frontmattercan correctly stamp the runtime-deriveddate:andsession:fields, preventing un-greppable and malformed entries from landing in the journal. It also includes comprehensive tests intests/runtime/test_journal_append.py.What did Sam notice that led to this?
During the daily maintenance on 2026-08-20, an audit of the previous day's (2026-08-19) journal revealed roughly 12 entries that lacked
date:andsession:fields entirely. While the errored sessions were properly stamped, successful sessions that skipped the opening---fence were written directly without date/session stamps. The Claude Opus mentor confirmed that the runtime only stamped frontmatter if the model-authored entry started with---\n, creating a silent data loss for successful but slightly misformatted entries.Tier
Confidence