BlogTechnical

How a News URL Becomes a Feed Record

The feed does not build itself. An operator or authenticated service submits a URL, and a bounded ingestion pipeline extracts, validates, and atomically stores the record.

1. Local development command

GREENCIO_RUNTIME_PROFILE=development npm run url-news "https://example.com/article"

The explicit development profile enables the local JSON fallback when GCS is unavailable. Preview, staging, and production fail closed rather than writing local files.

2. Five-stage ingestion path

  1. 1

    Validate URL

    Reject malformed or disallowed targets before making any outbound request.

  2. 2

    Bounded fetch

    Retrieve a size-capped HTML response and parse standard metadata plus a text excerpt.

  3. 3

    Summarize & tag

    Generate a summary when a model is configured (else use source metadata), then extract entities, tags, and keyword relevance.

  4. 4

    Deduplicate

    Validate schema bounds and merge by stable identity so retries do not create duplicate entries.

  5. 5

    Atomic write

    Write feed/latest.json to GCS with object-generation preconditions; fail closed in strict environments if GCS is unreachable.

What still requires human review: Verify headline accuracy, original publication date, numeric quantities, and forward-looking attributions. Keyword relevance is not factual verification.

Inspect the public intelligence feed or read the source in the GitHub repository.