Skip to content

fix(publisher): resilient publish-block extraction - #1

Merged
dougrathbone merged 1 commit into
masterfrom
dougrathbone/resilient-publish-parse-aa44
Aug 31, 2026
Merged

dougrathbone merged 1 commit into
masterfrom
dougrathbone/resilient-publish-parse-aa44

Conversation

@dougrathbone

Copy link
Copy Markdown
Owner

The FE-perf loop (and an earlier Sentrypede run) dumped entire agent transcripts into Slack because the publish-block parser was exact-match only.

Those runs opened with <!--CONDUIT:PUBLISH--> and then closed with another opener, or with <!--CONDUIT:END-->. Extraction returned null, and publishRunResult fell back to the full stdout.

What changed

  • Parse publish markers with a small regex that accepts HTML-escaped comments, extra whitespace, case, <!--CONDUIT:END-->, <!--CONDUIT:/PUBLISH-->, and a repeated opening tag as the closer.
  • Once an opener is present, never fall back to the full run. Unclosed blocks publish from the opener to EOF (the summary). Empty blocks skip publishing.
  • Agents that never emit a marker still publish their full output, as before.

Tests

src/server/publisher.test.ts covers the two Slack leak shapes plus the canonical and no-marker paths. npx vitest run src/server/publisher.test.ts and server tsc --noEmit both pass.

Prompt copy for the loop itself is intentionally left to you.

Open in Web Open in Cursor 

…loser

Agents were leaking full run narration to Slack because a missing or
wrong closer (repeated <!--CONDUIT:PUBLISH-->, <!--CONDUIT:END-->) made
extraction fail and fall back to the entire stdout. Once an opener is
present, only the block is posted; empty/unrecoverable blocks skip publish.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
@dougrathbone
dougrathbone marked this pull request as ready for review August 30, 2026 22:33
@dougrathbone
dougrathbone merged commit e8b7cc7 into master Aug 31, 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