File Routing and Recipe Orchestration

QIP establishes a deterministic, dual-pass routing and pipeline model where file layouts map directly to canonical URLs and source MIME types determine linear recipe chains. By removing complex framework configuration files, we keep the server lightweight, easily auditable, and completely predictable.


๐Ÿ“‚ 1. File Discovery & Path Rules #

We require content to be stored in clean, well-defined directory structures that map directly to the website's URL hierarchy.

Skipping Project Directories

Path Canonicalization & Safety

To protect the host filesystem and ensure cross-platform compatibility, QIP enforces strict validation criteria during file walking:


๐ŸŒ 2. Request Resolution & Pretty Routes #

QIP balances user-friendly browser URLs with raw data accessibility by generating multiple routing aliases for specific content files.

Pretty Routes vs. Raw Source Routes

Canonical Routing Table

Source FilePretty Route (Processed)Source Route (Raw)Content-Type
site/index.md//index.mdtext/html (pretty) / text/markdown (raw)
site/docs/index.md/docs/docs/index.mdtext/html (pretty) / text/markdown (raw)
site/contact.html/contact/contact.htmltext/html
site/images/logo.pngN/A/images/logo.pngimage/png
site/start.uri/start/start.uritext/uri-list (Redirect target)

Strict Conflict Resolution

duplicate route path "/about" for "site/about.html" and "site/about.md".


๐Ÿงช 3. Recipe Execution Pipeline #

Recipes are WebAssembly filters that automatically transform static source files into final webpage responses based on the file's Source MIME Type.

Numeric Order & Sorting

graph LR
    Input[site/about.md] -->|Read Raw Bytes| Stage1[10-markdown-render.wasm]
    Stage1 -->|Emits HTML Body| Stage2[20-html-wrap.wasm]
    Stage2 -->|Emits Styled Webpage| Output[Final HTTP Response]

Prefix Mismatch Prevention

To prevent non-deterministic pipeline ordering, the recipe loader enforces strict filename formats:


โšก 4. Dynamic Dev Server & Hot Reloading #

The qip dev workspace provides immediate feedback by reloading only the modified files without losing server state.


๐Ÿ“‹ 5. Decision Rubric & Troubleshooting Checklist #

Use this quick checklist to resolve routing and recipe behavior:


๐Ÿšซ When Not to Use This Model #