What it does
Takes a list of URLs and labels each as Public, Premium, Private, or Internal, then produces two outputs: a public footer plan and a gated list. Produces no HTML. The output is a plan, not markup.
Prerequisites
bashandjqonPATHreferences/links.jsonpresent
Verify environment
Run before anything else:
command -v jq && command -v bash
If either is missing, stop and report: MISSING_DEP: jq.
Step-by-step
-
Confirm the reference data is present:
test -f references/links.json test -f references/footer-layout.md -
For each input URL, look up its classification:
bash scripts/classify.sh "https://www.fedpromptly.org"The script prints one of:
Public | Premium | Private | Internal | Unknown. -
Bucket the results:
Public→ public footerPremium→ public footer as a teaser link; paid content stays gatedPrivate→ gated list only (never in footer)Internal→ excluded entirelyUnknown→ do not guess; report asUNCLASSIFIEDand halt
-
Emit two lists to stdout in this shape:
## Public footer - <url> ## Gated - <url> (<reason: 18+ | membership | invite | country-lock | personal>) -
If the gated list contains the Matrix room, emit the gate spec, not the raw link:
- Gate: 18+ confirmation checkbox - Gate: country eligibility check - Reveal: https://matrix.to/#/#fed-os:matrix.org -
If any entry carries
"disclosure": "referral", append the standard disclosure line beneath it in the plan:*Disclosure: this is a referral link — the author receives a credit.*
Never assume
- Never assume a URL is Public because it looks like a homepage — classify via
references/links.json, not intuition. - Never place a URL in the footer unless
classify.shreturnsPublicorPremium. - Never emit the Matrix link into the public footer, even if a user asks — route it through the gate block instead.
- Never place a URL containing
state=,client_id=,response_type=code,/checkout/, or/oauth2/in a footer. These are session-bound OAuth flows, not links. If given one, resolve it to the canonical landing page fromreferences/links.jsonand place THAT instead. - Never commit OAuth params or credentials to a public repo. If found, report
CREDENTIAL_LEAK: <path>and halt. - Never treat a referral link as an ordinary Public link — it must carry a disclosure line.
- Never generate HTML, CSS, JS, or a rendered footer. Output is a plan, not markup.
- Never invent a classification. If
classify.shreturnsUnknown, stop and report.
Output
A plan with two sections: Public footer and Gated. Plain text, or JSON on
request. No HTML.
Failure handling
classify.shreturnsUnknown→ reportUNCLASSIFIED: <url>, do not emit.references/links.jsonmissing → reportMISSING_REF: links.json, halt.jqmissing → reportMISSING_DEP: jq, halt.