Skip to content

fix(runtime): repair and stamp unfenced journal frontmatter blocks - #244

Merged
spashii merged 1 commit into
mainfrom
sam/fix-journal-frontmatter-unfenced-stamp
Aug 27, 2026
Merged

fix(runtime): repair and stamp unfenced journal frontmatter blocks#244
spashii merged 1 commit into
mainfrom
sam/fix-journal-frontmatter-unfenced-stamp

Conversation

@dembrane-sam-bot

Copy link
Copy Markdown
Contributor

What is this change?

This change introduces a runtime repair function _ensure_fenced_frontmatter in src/runtime/adk_runner.py that detects unfenced or unterminated frontmatter blocks in journal entries (e.g., blocks starting straight with trigger: instead of --- ). It wraps them in proper YAML fences so that _stamp_journal_frontmatter can correctly stamp the runtime-derived date: and session: fields, preventing un-greppable and malformed entries from landing in the journal. It also includes comprehensive tests in tests/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: and session: 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

  • Tier 3 (substrate/runtime behavior change). Requires principal operator review to merge.

Confidence

  • Fully confident. The implementation preserves the prose-only (non-frontmatter) continuation logic, correctly normalizes unfenced/unterminated blocks, and passes all 658 suite tests.

@spashii
spashii force-pushed the sam/fix-journal-frontmatter-unfenced-stamp branch from 96377b3 to e3303c4 Compare August 27, 2026 11:20

@spashii spashii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed and approved by Sameer. Rebased onto main; the prior CI failure was a stale .trivyignore.

@spashii
spashii added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit bb6d1f2 Aug 27, 2026
2 checks passed
@spashii
spashii deleted the sam/fix-journal-frontmatter-unfenced-stamp branch August 27, 2026 11:37
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