Procedure
Produce and publish this week's AI brief end to end: research, write, index, resolve entities, grade due predictions, validate, push to main, warm Ask. Run by the weekly cloud routine; no human in the loop.
You run the weekly brief from research to publication without a human in the loop. When a check fails, repair and retry; when something stays uncertain, take the safe default and record it in the run log. Every run leaves runs/<date>/ behind: what was found, what was cut, what failed.
0. Prepare
npm ciifnode_modulesis missing.npm run engine:prep(ornpm run engine:prep -- YYYY-MM-DDto set the run date). It writesruns/<date>/context.mdandruns/<date>/previous.md. If it reports that a brief already exists for the window, stop: there is nothing to publish.- Read
runs/<date>/context.md. The brief id is the run date; the coverage window is in the Run section. Every later step works inside that window. - Start
runs/<date>/log.mdwith the run date, window, and the start time.
1. Research
Launch seven brief-researcher subagents in parallel, one per section (model-releases, tools-products, research, workflows, industry, startups, healthcare). Give each the run folder, its section key, and the window. Each writes runs/<date>/candidates/<section>.md.
If Exa isn't connected, tell them to use WebSearch and WebFetch instead. If a researcher fails, rerun it once; if it fails again, continue without that section and log it.
2. Write
Launch one brief-writer subagent with the run folder. It writes runs/<date>/draft.md and its notes in the log.
3. Index
Launch one brief-indexer subagent with the run folder. It writes content/briefs/<date>.json, new trends in content/trends.json, and runs/<date>/proposed-entities.json.
4. Resolve entities
npm run resolve -- <date> matches each proposed entity against the registry (code finds candidates, Jev judges, the middle band comes back to you) and writes the result into content/entities.json and the brief. Follow its instructions for escalations, per docs/graph-pipeline.md.
5. Grade due predictions
For each prediction under "Due predictions to grade" in the context, launch a brief-researcher subagent with the grading task (brief, trend, prediction, resolves test, deadline). It writes runs/<date>/evidence/<brief>-<trend>.json. Then run npm run grade -- runs/<date>/evidence/*.json. For each escalation it prints, read the evidence and record your call with npm run grade -- <file> --verdict=<hit|miss|partial|unclear>. Skip this step when nothing is due.
6. Check
npm run validate. Send errors in the brief or registries back to abrief-indexersubagent with the error list; send wording problems back to abrief-writersubagent, then re-index.npm run check-questions -- <date>. Rewrite any question it flags as "rewrite" so the brief answers it, in the draft and the JSON, and check again.- Up to three repair rounds. If checks still fail, don't publish: restore
content/withgit checkout -- content && git clean -fd content, log the failures, runnpm run engine:report -- <date> --status=failed --failure="<one line>", commit onlyruns/<date>/as "Brief <date> failed", push, and stop.
7. Publish
- Finish the log: item and trend counts, entities added, predictions graded, repair rounds, end time.
npm run engine:report -- <date>measures the run from the session transcripts (time per step, tokens per model, searches and fetches, Jev checks, the per-section funnel) and writesruns/<date>/run.json.git add content runs/<date>and commit asBrief <date>.git push origin HEAD:main. If the push is rejected becausemainmoved,git pull --rebase origin main, rerunnpm run validate, and push again.
Vercel deploys main automatically.
8. Warm Ask
npm run engine:warm -- <date> waits for the deploy to serve the new brief, then asks its questions and the list-page suggestions so the first readers get cached answers. A failure here doesn't undo the publish; log it and finish.