Document intake UI for the Ambrosiana RAG library
Find a file
John A. Hoeven 16c592c971
Add index-page link discovery and simplify licence/priority fields
Adds link_discovery.py: sitemap-first, same-domain-crawl-fallback
  discovery of sub-pages from a single index URL, so a source with many
  sub-pages no longer needs each page entered by hand. Never pulls page
  titles or body text into a ticket field, only URLs, to avoid a
  prompt-injection path into tickets Claude Code later reads. Adds a
  review-and-approve screen so nothing is queued without a human
  checking the actual discovered list first.

  Replaces the free-text licence field with a required typed permission
  question, since licence itself is better researched from the source
  during actual processing rather than typed in at ticket time. Replaces
  the priority dropdown with a single urgent checkbox.

  Fixes a few real bugs found along the way: colliding ticket filenames
  when writing many tickets in one batch, a couple of layout issues
  where long labels or URLs were getting clipped instead of wrapping or
  scrolling, and dead links slipping through discovery from malformed
  relative link resolution
2026-08-07 22:23:28 +02:00
.gitignore Add Textual intake TUI, reach Beta (v0.1.0) 2026-08-02 14:03:35 +02:00
ambrosiana_intake.py Add index-page link discovery and simplify licence/priority fields 2026-08-07 22:23:28 +02:00
LICENSE Initial commit 2026-08-02 12:46:42 +02:00
link_discovery.py Add index-page link discovery and simplify licence/priority fields 2026-08-07 22:23:28 +02:00
README.md Add Textual intake TUI, reach Beta (v0.1.0) 2026-08-02 14:03:35 +02:00
requirements.txt Add index-page link discovery and simplify licence/priority fields 2026-08-07 22:23:28 +02:00
TODO.md Add Textual intake TUI, reach Beta (v0.1.0) 2026-08-02 14:03:35 +02:00

Ambrosiana Document Intake

Status: Beta (v0.1.0)

Document intake UI for the Ambrosiana RAG library.

A minimal Textual TUI that collects the metadata needed to start a document's journey into an Ambrosiana instance's RAG corpus. It does not touch the pipeline, any agent, or any model — its only job is to turn what a human knows about an incoming document into a structured ticket that Claude Code (or a human) then acts on.

Deployed per-device: each Ambrosiana instance gets its own copy, and an intake ticket always targets that device's own RAG — there is no cross-device routing field.

Requirements

  • Python 3.11+ (uses stdlib tomllib)
  • textual (see requirements.txt)
pip install -r requirements.txt

Running

python3 ambrosiana_intake.py

Configuration

The ticket output directory is read from ~/.config/ambrosiana-intake/config.toml (tickets_root key). If the config file doesn't exist yet, it's created automatically on first run with a default of ~/documents/rag-administration/ticket-queue. Edit the file directly to point at a different location.

Fields

Field Required Type Notes
Source location Yes filepath or URL
Source type Yes upstream-doc | ce-authored | ce-experience
Source tier Yes primary | secondary | forum/unmoderated
Licence Yes text
Priority Yes immediate need | add to queue
Title / description No text used for the ticket filename slug if given
Notes / context No text free-form, passed through to the ticket body

Output

Each submission writes a markdown file with YAML front matter directly into the configured tickets_root — there are no immediate//queue/ subdirectories; priority is encoded in the filename instead:

  • Priority "immediate need" → immediate_YYYYMMDD-HHMMSS_slug.md
  • Priority "add to queue" → YYYYMMDD-HHMMSS_slug.md (no tag — the absence of a tag means normal, order-of-arrival handling)

slug comes from the title if provided, otherwise the source location's basename.

On a successful save the form clears itself and a toast notification confirms the ticket path — no need to scroll to see confirmation.

The ticket is the handoff artefact: a human (or Claude Code, on request) picks it up from tickets_root and runs the actual scrape → vet → transform → commit → index pipeline against it.

Keybindings

Key Action
Ctrl+S Save ticket
Ctrl+N Clear form
Ctrl+Q Quit

Built standing on the shoulders of billions of dwarves Created by John A. Hoeven with the ethical assistance of Claude AI