Document intake reads the content, and refuses what it cannot identify
Documents arrive as untrusted files. The vault converts each one into
normalized markdown with structured metadata before anything else sees
it. Since ADR-0030 the type is decided by the CONTENT: the filename and
the client's declared content-type are attacker- and accident-controlled,
so they are kept as marked hints and never choose a parser. Anything the
vault cannot positively identify is refused outright — oversized files
and unidentifiable bytes are never guessed at, never partially accepted.
A markdown document is accepted with its metadata
- Given a well-formed markdown file
- When the vault parses the file
- Then the result is normalized markdown with the file's format recorded
A file whose bytes match no known format is refused
- Given a file whose content matches no known format
- Then parsing refuses the file
An oversized file is refused
- Given a file larger than the configured size limit
- Then parsing refuses the file
A container naming no part the vault knows is refused, not guessed
- Given a zip container holding no part any known format declares
- Then parsing refuses the file
A file named as an office document but holding text is read as text
- Given a file named as an office document that is really plain text
- When the vault parses the file
- Then the content decides the type and the filename is kept as a rejected hint
A Word document named as a text file is read as a Word document
- Given a Word document uploaded under a .txt name
- When the vault parses the file
- Then the content decides the type and the filename is kept as a rejected hint
A sectioned document is chunked along its headings
- Given a markdown report with three headed sections
- When the vault chunks the document
- Then each section becomes its own retrievable chunk
A document's summary is written by reading the document
- Given a markdown report with three headed sections
- When the vault summarizes the document with a model that can read it
- Then the summary is what the model wrote, within the word limit
With no model to read it, a document is stored without a summary
- Given a markdown report with three headed sections
- When the vault summarizes the document with no model available
- Then there is no summary, the vault says why, and the document is still stored
An email is classified by its headers with its fields extracted
- Given an exported email replying about a rigging plan
- When the vault classifies the document
- Then it is an email reply with its sender and subject on record
Instructions hidden in a document change nothing
- Given an exported email whose body tries to give the vault orders
- When the vault classifies the document
- Then the classification is the same as for any other email
An uploader cannot classify beyond their own reach
- Given an uploader who can write to the engineering compartment only
- When they ask to file a note into the finance compartment
- Then the filing is refused outright
An invoice that does not add up goes to human review
- Given a converted document that calls itself an invoice but shows no amount
- Then classification concludes nothing and routes it to review
People named in a document become findable connections
- Given minutes naming two colleagues and an email address
- When the vault scans for known names
- Then each name is found exactly once
Documents that reference each other are linked
- Given a readme that wikilinks the kickoff brief and relates to the rota
- When the vault reads its references
- Then the kickoff brief and the rota are its link targets