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

  1. npm ci if node_modules is missing.
  2. npm run engine:prep (or npm run engine:prep -- YYYY-MM-DD to set the run date). It writes runs/<date>/context.md and runs/<date>/previous.md. If it reports that a brief already exists for the window, stop: there is nothing to publish.
  3. 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.
  4. Start runs/<date>/log.md with 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

  1. npm run validate. Send errors in the brief or registries back to a brief-indexer subagent with the error list; send wording problems back to a brief-writer subagent, then re-index.
  2. 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.
  3. Up to three repair rounds. If checks still fail, don't publish: restore content/ with git checkout -- content && git clean -fd content, log the failures, run npm run engine:report -- <date> --status=failed --failure="<one line>", commit only runs/<date>/ as "Brief <date> failed", push, and stop.

7. Publish

  1. Finish the log: item and trend counts, entities added, predictions graded, repair rounds, end time.
  2. 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 writes runs/<date>/run.json.
  3. git add content runs/<date> and commit as Brief <date>.
  4. git push origin HEAD:main. If the push is rejected because main moved, git pull --rebase origin main, rerun npm 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.