A sample document set to try intake on
examples/sample-documents holds nineteen documents from an invented plant, with the configuration that cuts them and
a manifest that says what each one shows. It is for an integrator who wants to see how a Node identifies, cuts and
retrieves the common kinds of site document before a site's own files arrive: run the
chunk preview over them, or load them into a development Node and ask it questions.
Every document in the set is invented. The site (Kestrel Medical Manufacturing), its products, part numbers, people and figures do not exist. The set is not a statement of what a real site's documents look like, and no default, rule or threshold in the Node was set from it: a site's own documents are what tune a type. The notice is in the manifest and on this page and the loader prints it on every run, never in a document's text, because a document in a store has to read as a record.
What is in the set
| File | Type | What it shows |
|---|---|---|
sop-0412-rev-c.md |
sop |
A procedure whose first line is its number, revision and title. The type's identity rule reads the number and title. |
sop-0188-sterile-barrier-packaging.md |
sop |
The same kind of procedure behind a company banner: the title is on the third line, so a first-line rule does not match it and the preview says so (exit 3). |
sop-0233-cleanroom-gowning.md |
sop_titled |
A title alone on the first line and the number in a header line further down, which the sender gives. |
wi-0071-station-4-cover-bolts.txt |
work_instruction_steps |
Plain text with steps that read "Step 3" and no headings: a boundary_rules type cuts it at each step. |
wi-0104-leak-test-station.md |
work_instruction |
A work instruction in markdown with headings. |
wi-0120-bonding-adhesive-handling.md |
work_instruction |
One very long paragraph under a heading: the type cuts it at its maximum length, without regard to a sentence. |
ip-0090-incoming-seal-inspection.md |
inspection_plan |
An inspection plan whose characteristics are lines of text. A table would not be read as a table. |
dn-0307-rev-a.md, -rev-b.md, -rev-c.md |
design_note |
One design note in three revisions, each given the units it applies to. |
dn-0451-rev-a.md, -rev-b.md |
design_note |
A second note whose revisions arrive with no range, which shows the warning and the assumed start. |
dr-2027-0031-bore-diameter.md |
deviation_report |
A deviation in a form-like layout (Label: value lines), kept whole as one chunk. |
ncr-2027-0102-seal-leak-failures.md, ncr-2027-0118-sensor-window-adhesion.md |
nonconformance_record |
Two past nonconformances dispositioned differently (rework and scrap). |
sop-0150-rev-a-manual-leak-test.md, sop-0151-rev-a-automated-leak-test.md |
sop |
A procedure that was withdrawn and its replacement. The loader stores the first and then deactivates it. |
memo-2027-01-12-shift-handover.md |
generic |
A memo that fits no type's shape. |
empty.md |
generic |
An empty file, which the Node refuses. |
node_config.json is the Node's own example configuration with a document_intake section and the document_types
the set needs: the starter types it uses, each given an identity rule that reads a first line such as
SOP-0412 Rev C Title, a type with a boundary_rules strategy for the plain-text instruction, a type that reads a
title alone, and a fixed window for the two case records. The starter catalogue itself is unchanged and still has no
identity rule.
What each scenario is for
manifest.json lists the scenarios. Each is a question to ask or a command to run, and the document that should
answer it:
| Scenario | What to do | Document |
|---|---|---|
point-of-use |
Ask "What torque do I use on the cover bolts of the KX-200 pump housing?" | sop-0412-rev-c.md |
banner-first-line |
Preview the document and read the two findings. | sop-0188-sterile-barrier-packaging.md |
title-alone |
Preview it with the number a sender would give. | sop-0233-cleanroom-gowning.md |
house-style-steps |
Preview the plain-text instruction as a work_instruction (exit 3), then as work_instruction_steps (exit 0). |
wi-0071-station-4-cover-bolts.txt |
unit-revision |
Ask about the flange for unit 800: revision B applies to it, and A and C do not. | dn-0307-rev-b.md |
unranged-revision |
Load the second note: revision B is stored with an assumed start and a warning. Revision A has no range of its own, so a point-of-use question asked today is answered from B alone, and the answer says A was left out. | dn-0451-rev-b.md |
preview-refusal |
Preview an empty file and read the refusal (exit 1). | empty.md |
generic-memo |
Preview the memo as generic with the title a sender would give. |
memo-2027-01-12-shift-handover.md |
long-paragraph |
Preview the long paragraph and read the chunk lengths. | wi-0120-bonding-adhesive-handling.md |
withdrawn |
Ask how to leak test a pump housing: only the replacement answers. | sop-0151-rev-a-automated-leak-test.md |
precedent |
Ask whether a bore above tolerance has happened before: a deviation report answers a precedent search and not a point-of-use question. | dr-2027-0031-bore-diameter.md |
precedent-nonconformance |
Ask about housings that leaked in the pressure test although the seals had measured fine. | ncr-2027-0102-seal-leak-failures.md |
The questions are in the manifest, written the way a person at the station would ask them, and none quotes a run of five words from the document that answers it.
Whether each one retrieves its document depends on the embedding model, so it was measured and not assumed. With nomic-embed-text (768 dimensions):
- Each of the five questions retrieved its document as the first result above the retrieval bar.
- The
withdrawnquestion did not return the withdrawn procedure.
The figures are in the manifest's retrieval_check. Another model needs its own measurement, and the result is a measurement of this invented set, not of what a site's questions and documents would score.
Try the preview
The preview connects to nothing and needs no Node to be running. Run each from the root of the project:
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json --revision-label C sop examples/sample-documents/documents/sop-0412-rev-c.md # exits 0
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json --revision-label B sop examples/sample-documents/documents/sop-0188-sterile-barrier-packaging.md # exits 3
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json --revision-label A --document-number SOP-0233 sop_titled examples/sample-documents/documents/sop-0233-cleanroom-gowning.md # exits 0
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json work_instruction examples/sample-documents/documents/wi-0071-station-4-cover-bolts.txt # exits 3
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json work_instruction_steps examples/sample-documents/documents/wi-0071-station-4-cover-bolts.txt # exits 0
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json work_instruction examples/sample-documents/documents/wi-0120-bonding-adhesive-handling.md # exits 0
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json --revision-label B --newer-revision --effective-range design_note examples/sample-documents/documents/dn-0307-rev-b.md # exits 0
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json --revision-label B --newer-revision design_note examples/sample-documents/documents/dn-0451-rev-b.md # exits 3
python3 -m engine.document_preview_cli --config examples/sample-documents/node_config.json generic examples/sample-documents/documents/empty.md # exits 1
The fourth and fifth commands are the same file under two types, which is how a house style is tuned: the starter
work_instruction finds no headings in plain text and cuts it without regard to its steps, and a type with a
boundary_rules pattern for Step 3 cuts it at each step. manifest.json gives the expected exit code and findings
for every document.
Load it into a development Node
The loader is engine/sample_documents_cli.py. It is a development tool and is not covered by the public API promise. The files can also be sent to a development Node through the document routes (the management API).
The loader reads the manifest and gives each document to the Node's own intake and ingestion stage, so a document is identified, cut, embedded and stored as a site's own would be. It needs the Node's configuration (the embedding section decides which store and which model) and a reachable embedding endpoint. --dry-run connects to nothing:
python3 -m engine.sample_documents_cli --config examples/sample-documents/node_config.json --dry-run # exits 0
python3 -m engine.sample_documents_cli --config examples/sample-documents/node_config.json # exits 0
python3 -m engine.sample_documents_cli --config examples/sample-documents/node_config.json --allow-other-documents # exits 0
- It refuses a store that holds documents it did not load (exit 3), and names how many and the first few ids, so
the set cannot be loaded into a real site's store by accident.
--allow-other-documentssays the store may hold both; the set is then loaded beside the others and none of theirs is touched. - A second run replaces what the first loaded and never duplicates it.
- It says on every run that these are sample documents, writes no Activity Log entry and withdraws the superseded
procedure after loading it, so
withdrawncan be tried. - The exit codes are 0 loaded, 1 a document was not stored, 2 the request could not be used (including a store or embedding endpoint that could not be reached), 3 the store holds documents the loader did not load.
What the set does not do
It does not show what a real site writes. A site's first-line forms, its banners, its tables and its scanned pages are what a site's own documents show, and the preview over a site's documents is how to find out. The set has one site, and the pattern is not a medical one.
Release: v0.11.0