Skip to content

refactor!: prepare pipeline foundations for deterministic cleanup#2

Merged
sousekd merged 8 commits into
mainfrom
refactor/pipeline-foundations
Jun 11, 2026
Merged

refactor!: prepare pipeline foundations for deterministic cleanup#2
sousekd merged 8 commits into
mainfrom
refactor/pipeline-foundations

Conversation

@sousekd

@sousekd sousekd commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Groundwork for deterministic cleanup: rework the source providers, body
model, and configuration so non-LLM steps can be composed and validated
cleanly. Adds the first no-LLM pipeline (truncate).

Source providers

  • Add Docling (default-docling) via docling-serve /v1/convert/source.
  • Add HTTP (default-http): direct fetch for testing, no SSRF protection.
  • SOURCE_PROVIDER selects the active provider.
  • Unify provider config: output knob (markdown/html/rawHtml), plus
    stripBase64Images and parsePdf for Firecrawl.

Content-typed body (breaking)

  • Body carries a required mediaType (open vocabulary) and may be text or binary.
  • Binary payloads flow through the pipeline; text-only steps skip on
    unsupported media; terminal binary output fails with unconverted_binary.
  • Diagnostics support binary content: report length instead of chars and
    omit ratios across representation changes.

Configuration (breaking)

  • Env vars for unused components are no longer required: providers and
    renderers are built and validated only when an active pipeline references them.
  • Tri-state pipeline activation; required-ness owned by reachable built-in schemas.
  • Unset env vars without a default resolve to empty instead of throwing.
  • Add DEFAULT_PIPELINE env and --check mode (compose without listen).

Docs and scripts updated to match.

sousekd added 8 commits June 9, 2026 10:04
…rnative to Firecrawl

- New built-in SourceProvider over docling-serve POST /v1/convert/source
- Single sources+kind request shape (verified stable from 1.0.0 through latest)
- X-Api-Key header support, image_export_mode hardcoded to placeholder
- Config: baseUrl (required), apiKey, doOcr (default true), tableMode (fast/accurate)
- Registered as default-docling in the default engine descriptor bundle
- Both default-firecrawl and default-docling ship; SOURCE_PROVIDER env var selects active
- Step renamed firecrawl -> fetch (provider-agnostic name)
- Docs: CUSTOMIZATION.md, CONFIGURATION.md, ARCHITECTURE.md, ROADMAP.md updated
- Configuration validation redesign noted in ROADMAP short-term section
…nfig surface, guard non-text content

Redesign Firecrawl and Docling provider config surface:
- Replace formats/maxAge with output knob (markdown|html|rawHtml)
- Add stripBase64Images, parsePdf knobs (Firecrawl)
- Add output knob (Docling)

Introduce new HTTP source provider (default-http):
- Testing-only fallback: direct fetch, no SSRF protection, no external service
- Config knobs: userAgent, maxBytes, titleFromHtml
- Streaming body read with configurable maxBytes cap (memory-safe)
- Non-text responses are rejected with unsupported_media_type (Phase 1):
  * Content-Type allowlist (text/*, application/json|xml|xhtml+xml, +json/+xml)
  * NUL-byte sniff as fallback for missing/mislabeled headers

SourceDocument gains truncated flag; LoadSourceStep degrades on truncation

Document value semantics: reported sources carry output type in CUSTOMIZATION.md

Add REFACTORING.md with staged content-typed body plan (media type + binary)
Introduce text and binary body representations and propagate mediaType across source providers, steps, renderers, and reports.

Return binary bodies from the HTTP provider, fail terminal binary runs with unconverted_binary, and skip text-only steps on unsupported media types.

Rename representation-spanning diagnostics from chars to length and omit ratios across representation changes.
Implements the three pillars of the REFACTORING design:

- Lazy registries: providers and output renderers are built and
  validated only when an active pipeline references them (D1).
- Pipeline activation: tri-state enabled on pipelines (true/false/
  omitted=referenced) resolved in the app layer (D2-D3).
- Dumb env substitution: missing VAR with no :- default resolves
  to empty string instead of throwing, so the env layer never fails
  for unused config. Required-ness is owned by reachable built-in
  schemas (D4).

Changes by area:

Engine:
  Tighten provider/renderer create to synchronous (D5).
  Ship activation-lazy and activation-pipeline tests (D1-D3,D7).
  Add built-names tracking for skipped-leaf startup log (D7).

Config:
  yaml-config: add optional enabled field to pipeline schema.
  yaml-app-config: resolve tri-state via adapter references.
  env-substitution: remove missing_env throw; unset var -> "".
  Built-in config schemas: field-named error messages (D6).

Pipelines:
  Rename default -> clean-llm (Firecrawl + LLM).
  Add truncate pipeline (load-source + truncate, no LLM).
  Adapt YAML, compose files, and README for DEFAULT_PIPELINE.

App:
  Add --check mode (compose without listen) (D8).

Compose:
  Remove :? guards from FIRECRAWL_BASE_URL, DOCLING_BASE_URL,
  LLM_BASE_URL, LLM_MODEL. Add DEFAULT_PIPELINE forwarding.

Docs:
  Update ARCHITECTURE, CONFIGURATION, CUSTOMIZATION, ROADMAP,
  smoke-testing, README, .env.example for lazy validation,
  pipeline activation, and new defaults.
@sousekd sousekd merged commit 53781e3 into main Jun 11, 2026
2 checks passed
@sousekd sousekd deleted the refactor/pipeline-foundations branch June 11, 2026 13:13
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