yau-plant-assistant/db
Claude dcfb411c3b Store the document title and authorising role at ingest
ProcedureIdentity requires a title and an authorising role, and neither was
stored anywhere. The answer writer was asked for both, read them off whatever
chunk retrieval happened to return, and returned "" whenever the header chunk
was not among them.

They belong in the row for the same reason doc_number and revision do: they
are facts about the controlled document, established once when a human
confirms the header, not something to re-derive per question from whatever
text was retrieved. Denormalised onto every chunk exactly as the existing
header fields are - ingest replaces every chunk of a source_file in one
transaction, so they cannot drift within a document.

complete() deliberately still requires only doc_number, revision and
effective_date. A missing title makes an answer less useful; a wrong revision
sends somebody to the wrong document. --assume-yes must keep refusing on the
second and tolerate the first.

controlled_copy_location is NOT in the schema. It is a site fact, identical on
every row, and the one field where an invented value sends a person to a place
that does not exist. It is CONTROLLED_COPY_LOCATION in api.env, defaulting to
a string that names who to ask.

The authorising-role pattern requires the colon: without it the lazy gap
swallowed the field name and captured "role: Station Maintenance Supervisor"
as the value, which the first run caught.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 10:54:01 +10:00
..
seed Scaffold the WRPS plant operations assistant repository 2026-08-20 13:56:32 +10:00
001_schema.sql Scaffold the WRPS plant operations assistant repository 2026-08-20 13:56:32 +10:00
002_fixtures.sql Close two Phase 1 gate failures found on lin001 2026-08-20 15:02:51 +10:00
003_roles.sql Give ingestion a role that can write 2026-08-21 13:45:20 +10:00
004_doc_uploads.sql Give ingestion a role that can write 2026-08-21 13:45:20 +10:00
005_doc_actions.sql Stop a bulk re-ingest resurrecting withdrawn documents 2026-08-21 13:50:34 +10:00
006_doc_pool.sql Design Phase 9 - operator document management 2026-08-21 13:17:38 +10:00
007_doc_identity.sql Store the document title and authorising role at ingest 2026-08-28 10:54:01 +10:00