# Eritrea 2042: zero-cost monitoring hub

The [Source feed quickstart](../../QUICKSTART.md) covers workbook-based X ingestion, manual full sweeps and the feed-only Pages option.

The hard budget is **$0.00 per month for additional services**. The supplied
collectors make no paid API requests, call no external LLM endpoint and use no
login cookie. The public pages use static HTML, CSS and vanilla JavaScript. A same-origin Worker and D1 store analytics and moderated discussions on the main site.
Public articles are read in memory for topic matching; complete source articles
and tactical map datasets are not copied into the public feed.

The current `chatgpt.site` address uses its supported publishing workflow and
linked update task, within the existing ChatGPT account allowance. That is not
an unlimited compute entitlement or a separate API subscription. The GitHub
workflows are portable alternatives: they only execute after import to GitHub.
A YAML file on the Sites source host is not a running GitHub Action.

## What is supplied

| File or directory | Role |
| --- | --- |
| `fetch_updates.py` | Standalone entrypoint containing the escalation keyword matrix and policy-reference mappings. |
| `monitor.py` | Broader official policy source watch. |
| `monitoring/engine.py` | Full RSS/HTML collector, article extraction, robots/size/request checks, source fairness, deduplication, revisions and logs. |
| `.github/workflows/track_escalation.yml` | Complete 12-hour collection, commit, build and optional deployment workflow. |
| `.github/workflows/check.yml` | Daily broader policy collection workflow. |
| `monitoring/config.json` | Public sources, exact HTTPS hosts, local topics, zero-dollar constraint and optional X RSS bindings. |
| `monitoring/x-accounts.json` | Original 37 X handles plus the requested OSINT and official-account candidates, without inferred affiliation. |
| `monitoring/export-context.mjs` | Verify both approved PDFs and export their current chapter map and study summaries. |
| `monitoring/policy-context.json` | Local governing provisions, PDF checksums, modules and U.S. study summaries. |
| `escalation_feed.json`, `policy_feed.json` | Canonical current feed records; browser copies are written under `public/data/`. |
| `monitoring/state-*.json` | ETags, article fingerprints, source backoff and reviewed-input receipts. Commit these files. |
| `monitoring/history/` | Immutable published revisions, not copied full articles. |
| `election_hooks.py` | Certification/ledger review flags; it does not rewrite law or a PDF automatically. |
| `public/data/policy-review-flags.json` | Review queue for sanctions, AGOA, ITAR and EO 14046 legal-status analysis. |
| `scripts/watch-pages.mjs` | Complete semantic HTML components, publisher columns, record pages, archives, scope statement and image placement. |
| `public/watch/watch.css` | Responsive native-CSS design matching the existing website. |
| `monitoring/tests/`, `monitoring/verify.mjs` | Behavior tests, source isolation, link checks, private-material exclusion and zero-budget assertions. |
| `changelog.md` | Dated summary of every published source addition/correction. |
| `docs/monitoring/CODE_REFERENCE.md` | Unabridged code blocks generated from the actual working files. |

The complete ZIP includes the existing site, its data, current PDFs and build
files. No layout code needs to be written by the owner. Static mirrors serve public content and use the main site for live discussions; owner tools and the collection API require the main deployment.

## GitHub Pages: one-time setup without writing code

1. Create a **new public** GitHub repository named
   `YOUR-GITHUB-USERNAME.github.io`. Use a separate account or host if that root
   repository already contains another site; do not overwrite an existing
   website. Root-level hosting is required by the existing `/downloads/...`
   paths. A project URL such as `/my-repository/` requires a base-path migration.
2. Upload the unzipped source to the repository root, including `.github`,
   `.npmrc`, `pnpm-workspace.yaml` and `pnpm-lock.yaml`. On macOS,
   Command–Shift–. displays dotfiles. `fetch_updates.py`, `package.json`,
   `public/` and `src/` must be at the root rather than inside another folder.
3. Keep paid usage disabled, or set an **enforced $0 Actions budget with stopping
   at the limit**. The supplied jobs use standard `ubuntu-latest` runners and
   refuse to run in private repositories. Do not enable paid runners,
   auto-recharge or paid hosting. Artifact retention is one day; account-wide
   free storage and usage limits still apply. Reaching a limit must stop work.
4. Under Settings → Actions → General, allow the bundled actions and grant
   workflows **Read and write** permissions in this new repository. The bot
   needs to commit generated feed/state files to its default branch. If an
   existing branch protection rule blocks direct commits, use a dedicated
   repository or a reviewed change process; do not bypass that protection.
5. Under Settings → Pages, select **GitHub Actions** as the source. Under
   Settings → Secrets and variables → Actions → Variables, create
   `DEPLOY_GITHUB_PAGES` with value `true`. No external secret is required.
6. Open Actions → **Zero-cost escalation source watch** → Run workflow.
   The job installs fixed Python packages, checks the approved PDFs, collects
   sources, evaluates review hooks, runs tests, builds `dist/client/` for the static mirror, commits records
   and explicitly deploys the artifact. The deployment URL is shown in the
   Pages job. Check `/watch/`, `/updates/` and `/watch/sources/`.
7. Run **Zero-cost policy source watch** once as well. It then runs daily at
   **08:43 UTC**. The escalation job runs at **00:37 and 12:37 UTC**. Both use
   the same concurrency group to avoid simultaneous writes. GitHub cron is
   best effort and may be delayed; inactive public-repository schedules may
   be disabled after 60 days. Check Actions after a long outage.

A commit made with `GITHUB_TOKEN` does not trigger another Actions workflow.
That is why each supplied workflow contains its own explicit deployment job.
A failed push or failed check stops before deployment; never force-push over
another source update.

GitHub documents free standard runners for public repositories and Pages on
public repositories under GitHub Free:

- https://docs.github.com/en/billing/concepts/product-billing/github-actions
- https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages
- https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule

## Optional Vercel hosting

GitHub Pages is the fully bundled default. To use Vercel instead, confirm the
site is eligible for the free Hobby plan and keep paid usage disabled or
enforce a $0 limit. Do not upgrade if a free limit is reached.

1. Import the new public GitHub repository into Vercel.
2. Use the **Other** framework preset, Node 22, install command
   `npm install --global pnpm@11.25.0 && pnpm install --frozen-lockfile --ignore-scripts`,
   build command `npm run build` and output directory `dist/client`. Set `SITE_STATIC_MIRROR=1` in the Vercel build environment.
3. In the Vercel project’s Git settings, create a deploy hook for the default
   branch. Store its exact URL in GitHub Actions as the secret
   `VERCEL_DEPLOY_HOOK`. Do not put it in site JavaScript or commit it.
4. Set the repository variable `DEPLOY_VERCEL=true`. Leave
   `DEPLOY_GITHUB_PAGES` unset if only Vercel should host the copy.
5. Run a workflow and inspect Vercel for the final deployment result. The hook
   request is not itself proof that a deployment succeeded. No paid fallback
   exists in the code.

The current `chatgpt.site` address is separate from either copy and continues
to use its linked updater. Do not configure two independent writers against
the same repository state.

## X and OSINT: what $0 actually supplies

The requested handles are registered and linked, alongside the original 37.
An account’s inclusion does not establish its identity, official role or
accuracy. Source reporting is not automatically a verified military event.

The code supports **explicit public RSS-Bridge or Nitter RSS bindings** in
`monitoring/config.json` under `x_rss_feeds`. Each binding supplies a registered
`handle` and an actual permitted public feed `url`; the exact feed hostname
must also be added to `allowed_hosts`. Only a feed you have verified as public,
free and usable should be configured. A binding reads the text supplied by
that feed; it does not log into X. No cookie, bearer token, random-instance
probing or paid fallback is used.

There is no dependable universal free X endpoint bundled here. Default
bindings are empty, and that incomplete coverage is visible on the site.
Open-source packages such as ntscraper still depend on working upstream
instances; adding the package does not guarantee access. The linked source
review task can add accessible, actually read public posts to the local inbox
without calling a metered API. Blocked, deleted and unindexed posts can remain
absent. Never represent a registered watchlist as complete live timelines.

## Independent publisher boundaries

Adulis News and Adulis Review occupy their own columns. Every entry has an
original-publisher link and the prominent label:

> Independent Regional Perspective – Published by Adulis News / Adulis Review
> (No formal ties to Eritrea 2042)

Their articles, findings, case codes and map judgments remain their own.
Eritrea 2042 does not claim ownership, organizational alignment or independent
verification merely by showing a source. The map record is linked and
fingerprinted; tactical coordinates and interactive map datasets are not
replicated. Source timestamps and retrieval times are shown separately.

## Local relevance, corrections and failures

`fetch_updates.py` holds the full local matrix. A record must match regional
geography and enough military-posturing, statecraft, border or bilateral flags.
The result includes `relevant`, `category`, `summary`, `suggested_action`,
matched flags, a score and governing provision IDs. This is auditable string
matching, not LLM semantic verification. No model or embedding bill exists.

An irrelevant item is skipped; the entire batch does not exit at the first
irrelevant article. An unchanged item is not republished. Corrected content
creates a revision and a change-log entry. Source rotation prevents a busy
publisher from starving other publishers’ older records or map logs.

HTTP errors, robots restrictions, invalid feeds and request caps preserve the
last successful publication and leave visible coverage gaps. Retry times are
persisted; no paid service is substituted. Source bodies are parsed as data,
never executed. Only configured public HTTPS hosts can be fetched.

## Election and legal review hooks

The existing daily election-watch task remains the authoritative research
process for AP reporting and official state/county records. `election_hooks.py`
reads its current `public/data/us-election-record.json` ledger and creates
review flags when that ledger changes.

Separately read, verified government certifications can be added under
`monitoring/election-certifications/` with a real government source URL,
jurisdiction, certification date, `status: certified` and
`verified_primary_record: true`. The hook does not infer certification from an
AP race call or a word appearing in an article. The supplied example unit
tests use fictitious fixtures, not published election data.

Flags request review of congressional sanctions, AGOA eligibility, ITAR/export
controls and EO 14046’s current legal status. An election result does not
itself change a statute, executive order, eligibility rule or financial
institution decision. The source review checks the controlling legal record
before revising the PDF and its website edition. The collectors cannot edit
the governing vision or the study PDF by themselves.

## Exact local commands

```bash
python -m venv .venv
. .venv/bin/activate
python -m pip install -r monitoring/requirements.txt
npm install --global --ignore-scripts --no-audit --no-fund pnpm@11.25.0
pnpm install --frozen-lockfile --ignore-scripts
node monitoring/export-context.mjs
python fetch_updates.py
python monitor.py
python election_hooks.py
python -m unittest discover -s monitoring/tests -v
npm run check
npm run build
node monitoring/verify.mjs
```

On Windows, activate `.venv\Scripts\activate` instead of the Unix activation
command. No keys or paid accounts are required for the collector or Pages
workflow. Shared commenting is deferred at the owner’s request.

For the existing Site, follow `docs/monitoring/RUNBOOK.md` and its supported
source/save/deploy workflow. Every rebuild regenerates the complete source
ZIP so it contains the current approved PDF editions rather than stale copies.
