Skip to content

Add trusted-source fortnightly magazine publishing - #5

Merged
Muawiya-contact merged 3 commits into
mainfrom
feat/fortnight-magazine-publishing
Nov 20, 2026
Merged

Muawiya-contact merged 3 commits into
mainfrom
feat/fortnight-magazine-publishing

Conversation

@Muawiya-contact

Copy link
Copy Markdown
Member

What changed

  • Run trusted RSS collection twice each day at 08:00 and 20:00 Pakistan time.
  • Read every valid recent item returned by the four reviewed feeds, and keep issue articles within the current issue window. New items with very short text keep the latest ingest pass incomplete rather than disappearing silently.
  • Send only trusted-source article text to Gemini. It drafts summaries, AI relevance, facts, scores, and the magazine layout. Editors still inspect sources and approve or reject every AI-related story.
  • Let Gemini place every approved story into the editable template. A score-based fallback remains available for draft viewing, but it cannot be published.
  • Compile the current TeX draft into a private PDF after each scheduled ingest attempt. Each PDF is tied to the exact TeX fingerprint to prevent an older compile from satisfying the current issue's checklist.
  • Keep the Publish button disabled for at least 14 days and until the latest full scan covers the current trusted-source list, AI/editor queues are clear, all approved stories are included and checked, the editor's note is approved, and the current PDF exists. A service-role-only database function enforces the same gate.
  • After publishing, atomically mark the stories as used and create the next issue draft.

The initial trusted-source list is Dawn, OpenAI News, arXiv cs.AI, and arXiv cs.CL. This is a reviewed feed set, not a guarantee of every AI story published on the internet. Gemini processes up to six pending stories per run, so a busy issue may need more than 14 days to clear its queue. Numeric checks catch unsupported numbers but do not prove every sentence; editors must read the source links.

Validation

  • npm run lint
  • npm run typecheck
  • npm run test:ingest (7 tests)
  • npm run test:magazine (12 tests)
  • npm run build with placeholder local Supabase values
  • Parsed both workflow YAML files
  • browser-use --doctor and local browser smoke checks for home, issues, process, and login pages

The Supabase migrations and generated LaTeX PDF were not run locally because Docker and a local database/LaTeX installation are unavailable. GitHub Actions will run the generated PDF compile after deployment.

Manual steps after merge

  1. Apply migrations 202611190002_reprocess_updated_stories.sql, 202611190003_trusted_source_allowlist.sql, and 202611190004_guarded_edition_publish.sql to the MID app Supabase project.
  2. In Vercel Production, confirm the Gemini API key and Supabase service-role key are set. In GitHub Actions secrets, confirm APP_URL is the deployed Vercel URL and CRON_SECRET exactly matches Vercel's value.
  3. Wait for the Production deployment, then run Scheduled ingest once from GitHub Actions. Check the ingest run details; after the attempt, Compile current magazine draft should create a private PDF when the draft source is ready.
  4. In /desk, rebuild the draft once if it asks for a source fingerprint. Then editors review stories and the note as they arrive. The publish button becomes available no earlier than day 14 and only after the full checklist passes.

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
machine-intelligence-app Ready Ready Preview Nov 19, 2026 5:48pm UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T17:31:39.341914Z 4ea8e1a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ea8e1a93d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/ingest/pipeline.ts
Comment on lines +178 to 182
shortItemsBySource.set(
source.name,
(shortItemsBySource.get(source.name) ?? 0) + 1,
);
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make short feed items resolvable before they block publication

If a trusted feed repeatedly includes an undated item with fewer than 100 characters, this branch skips it without storing its URL hash, so every scheduled run sees it as new and marks the ingest run unsuccessful. Because publication requires the latest ingest run to succeed, that item can block publishing indefinitely; parseFeed retains undated items, and editors have no path to dismiss them. Persist the skip for review or provide an explicit way to resolve it.

Useful? React with 👍 / 👎.

@Muawiya-contact
Muawiya-contact merged commit cbe120f into main Nov 20, 2026
4 checks 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.

1 participant