feat(ai-briefing): wire grok-capture Wave 0 + address publish-review findings#156
Merged
Merged
Conversation
…findings Wire the grok-capture S0 subcommand and fix five behavior findings surfaced by bot review on the ai-briefing publish PR. - Register grok-capture in the runner dispatch (thin adapter over the existing grok-capture-agent lib). init --grok-preload now probes the Grok CLI and sets config.grok_preload / grok_preload_requested (grok_degraded when unready; --require-grok hard-fails). next-handle surfaces grok_preload; S3 synthesize merges Grok captures with Chrome (Chrome URLs win on dedup). Non-blocking: skips or capture errors record S0_grok_capture: skipped so Chrome Wave 1 proceeds. Adds grok-wave0-orchestration.test.js to the scripts test script and un-defers the docs (SKILL.md #20, runner-architecture.md). - source_type is no longer hard-coded "twitter" in appendToSeenItems; honors item.source_type ?? "twitter" so non-twitter waves record their own source. - Route the S3/S4 Claude model id through a single BRIEFING_AGENT_MODEL constant. - validate.js wraps loadSlidesData in try/catch with a clear "run emit-slides-data.js first" diagnostic + non-zero exit. - buildExtractorJs escapes handle + cutoff for single-quoted JS-string context (untrusted following-list.json), via function replacers so a `$` cannot form a replacement pattern. Bumps plugin version 0.2.0 -> 0.3.0 (behavior change). Refs melodic-software/medley#1457
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_604832cf-b42b-469c-8b6e-bfe4f39c3461) |
There was a problem hiding this comment.
Risk: medium. Not approving: Cursor Bugbot completed as skipped (usage limit reached), so automated review did not finish successfully. Human review is needed before merge; no reviewers were assigned because the PR author is the sole human repository contributor.
Sent by Cursor Approval Agent: Pull Request Router and Approver
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.


Post-publish behavior fixes for the
ai-briefingplugin, surfaced by bot review on the publish PR (#122). All were pre-existing engine characteristics carried over in the migration; none block plugin load/validate.Ships
grok-capture(Wave 0 S0). RegisteredcmdGrokCapturein the runner dispatch (thin adapter overgrok-capture-agent.js).init --grok-preloadnow probes the Grok CLI and setsconfig.grok_preload/grok_preload_requested— degrades togrok_degradedon a missing/unsigned CLI, or hard-fails with--require-grok.next-handlesurfacesgrok_preload; S3synthesizemerges Grok captures with Chrome (mergeTweetLists, Chrome URLs win on dedup). Non-blocking: preload-disabled or a capture error recordsS0_grok_capture: skippedand exits 0 so Chrome Wave 1 always proceeds. Addedgrok-wave0-orchestration.test.jsto thescriptstest script and un-deferred the docs (SKILL.md standing default fix: harden telemetry data fallback in bash-lint and markdown-formatter #20,references/runner-architecture.md).source_typeno longer hard-coded"twitter"instate.jsappendToSeenItems— honorsitem.source_type ?? "twitter". This runner is the Wave-1 X (twitter) loop, so the default stays correct for its own items; the change generalizes the writer so the main-session-driven RSS/Perplexity/GitHub waves (which append to the same store per the documentedtwitter|blog|changelog|githubschema) can record their own source. No other in-plugin caller sets a non-twitter source today — the threading is the forward-compatible fix, deliberately, not a missed one.lib/models.jsBRIEFING_AGENT_MODEL;synthesize-agent.js+categorize-agent.jsroute through it (one edit to bump).output/build/validate.jswrapsloadSlidesData()in try/catch — prints "runemit-slides-data.jsfirst" and exits non-zero instead of a raw dynamic-import stack.chrome-extract.jsbuildExtractorJs:handle+cutoffIsoare escaped for single-quoted JS-string context (\then') before substitution, via function replacers so a$in the value can't form a replacement pattern.Bumps plugin
version0.2.0 → 0.3.0 (behavior change → consumers receive it on/plugin marketplace update).Verification
scriptssuite:npm test— all green incl. newgrok-wave0-orchestration.test.js(env-isolated from leakedCLAUDE_PLUGIN_DATA).output/buildsuite:node --test— 2 pass.evil'];window.__pwned=1;//handle; backslash-doubling confirmed.validate.jsdiagnostic path exercised (noslides-data.js→ clean message, exit 1).claude plugin validate plugins/ai-briefing --strict— passed.Refs melodic-software/medley#1457
Note
Medium Risk
Touches browser-injected extractor JS and optional external Grok CLI orchestration; failures are designed to degrade without blocking Chrome Wave 1, but S3 merge semantics and seen-items
source_typeaffect dedup and downstream briefing content.Overview
ai-briefing 0.3.0 wires optional Grok Wave 0 into the per-profile runner and folds in several publish-review fixes.
Grok Wave 0 registers
grok-capturein the runner.init --grok-preloadprobes the Grok CLI, setsconfig.grok_preload/grok_degraded, and supports--require-grokfor hard failure.cmdGrokCaptureis non-blocking (skip + exit 0 on disabled preload or errors). S3 synthesize merges Grok and Chrome posts viamergeTweetLists(Chrome wins on URL dedup). Docs and CLI usage drop the “not yet wired” deferral; tests addgrok-wave0-orchestration.test.js.Other behavior changes:
appendToSeenItemsusesitem.source_type ?? "twitter"for forward-compatible RSS/GitHub waves.BRIEFING_AGENT_MODELinmodels.jscentralizes the S3/S4claude -pmodel.buildExtractorJsescapes handle/cutoff for single-quoted JS literals.validate.jsfails clearly whenslides-data.jsis missing.Reviewed by Cursor Bugbot for commit c602645. Bugbot is set up for automated code reviews on this repo. Configure here.