AirfieldpathOrlando Sanford International

5.5 · The Interchange · Documents

Document rules

How the Collector reads a document and what each kind becomes.

No picture for this component.

Document · The Interchange · Documents

Document rules

How the Collector reads a document and what each kind becomes.

  1. Sources
  2. Interchange
  3. Twin
  4. Screens
  5. Plan
Kind
Document
Status
not linked
Airport layer
not linked
Airport area
not linked
System
not linked
Sensor type
not linked

Open the detail

Level 2 of 3 This component, complete on its own. Its files, sources and tests are the detail below. Open the detail

Rules from documents: design

State: designed, not built. A policy, an SOP or a maker's manual arrives today as a document event. The file is stored under its sha256, its text is extracted where it has a text layer, and a ticket asks a person to review the rules it states. Nothing reads the rules out of the text yet.

What is built

  • The PDF drop: POST /collect with x-source: file-drop, then doc.file.received, then a document record with text.state (extracted, no_text_layer or not_extracted) and rules.state: designed.
  • The policy-document path: a checklist action (review-document-rules) and a review ticket.
  • The maintenance_policy load template, which is where confirmed rules land.

The design

  1. Read. Claude Code reads the stored text and proposes the rules it states. Each proposal is a row in the maintenance_policy template: asset class, task, interval, source document, page and clause.
  2. Prompts in files. The prompt lives in a file beside the other house prompts, never in code.
  3. Confirm, one by one. A person sees each proposed rule beside the page it came from and confirms, edits or rejects it. Nothing is loaded without that confirmation.
  4. Load. Confirmed rows go through the same template check as a sheet. Each record names the document's sha256 and the clause, with provenance "read".
  5. Link. A confirmed rule links its document to the paths and triggers it governs. A path's policy changes from to_link to linked.
  6. Fail visibly. If Claude Code is not reachable, the document stays at "rules not read", with the error. No default rules are written in its place.

Not covered yet

  • Scans. A scanned page has no text layer, so it needs OCR first. That is not built.
  • Revisions. A second edition of a policy is a new document. Comparing it with the first is a later step.

Source file

FileSizesha256
docs/document-rules.md2 KBbf5b5a72cc28a84b740394e191f398e2e6c71f546714f6e014be2039b2b4090b