Repository navigation
Briefings: send each issue by itself when every check passes - #34
Merged
Merged
Conversation
Adds reviewMode send_if_checks_pass. Only the dashboard turns it on (set_briefing_auto_send, dashboard only, with a confirmation, paid plans); create_briefing and update_briefing refuse the mode, and an agent's change to what a briefing writes from turns it off. Delivery decides the send: it reads the briefing, plan, daily cap and check_campaign (with the claim check) again, then sends through send_campaign, or asks for approval when the newsletter asks before an agent sends. Anything that fails leaves a draft with heldReason (new: daily_cap) and the owner's note says why. After a send the owner gets a pause link.
…send-ed8ba1 # Conflicts: # docs/BRIEFINGS-DESIGN.md
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.
Phase 3 of Briefings:
reviewMode: send_if_checks_pass.Opt in
Only a signed-in person, in the dashboard (new "Sending by itself" card on the briefing page), through
set_briefing_auto_send: adashboardOnlyaction likeset_agent_approval(no REST route, MCP tool or docs entry;runActionrefuses any othervia), needsconfirm: true, refused on the Free plan, daily cap 1 to 3 (default 1).create_briefingandupdate_briefingrefuse the mode for every key,fullincluded. An API key or app that changes what a briefing writes from (brief, hosts, discovery, style guide, languages, counts, sections, min score, steps) turns it back todraft; name, schedule, test address, budget and status changes keep it. The elevation of those two actions inlib/action-scopes.jsno longer readsreviewMode, since the input is refused.When it sends
settleSendinlib/briefings-delivery.js, throughsend_campaignwithvia: "briefing"(plan limits, Free guards,getSendBlockerapply; no new send path). It sends only if: not thin, no unfinished step or missing translation (engineholdReasonnow treats a translation notdoneaspartial), all code checks and the judge pass, the run is scheduled (not manual), the briefing is still active and in send mode, the account is not Free, under the daily cap, andcheck_campaignincluding the claim check has no blocker and no warning. While links/claims are still being read, delivery answerscheckingand the deliver stage asks again every 4 s for up to 10 min, then holds aschecks.Held runs are drafts with
heldReason(review_mode,thin,checks,partial,agent_approval, newdaily_cap) and the owner's note names the cause. WithNewsletter.agentApprovalon, the send becomes an approval request (appbriefing:<id>,via: "briefing"); approving runssend_campaignonce.After a send the owner is emailed with a signed pause link (
/briefing-pause/<token>, confirmation page, 14 days, public inproxy.js).Also
Docs (
/docs/briefings,/docs/briefings-bot),docs/BRIEFINGS-DESIGN.md(new Auto-send section, status), AGENTS.md, action manifest regenerated.Tests
New
tests/briefings-auto-send.test.mjs(sent path, every held reason, approval, cap, pause link), plus engine, action and docs tests. Lint clean; 730 passed / 0 failed over 734 related tests (briefing, agent, approval, parity, scopes, docs, perf, routing). Full suite left to CI. API Worker builds at 7.63 MB (budget 8.15), briefings Worker 0.41 MB.Deploy
Not deployed. Order: API Worker (carries delivery), app, then briefings Worker. Any order is safe: an old engine sends drafts, an old delivery ignores the new fields.