78: exam_questions.command_word + preamble (analyse contract v2, WS-2)
Some checks failed
supabase-ci / validate (push) Has been cancelled
Some checks failed
supabase-ci / validate (push) Has been cancelled
Additive/idempotent columns carrying the two fields analyse.py v2 now emits but v1 dropped: command_word (primary command verb per part) and preamble (stem prose jsonb sidecar). Applied to dev .94. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GruxHXxfdp4kZCgAMVFgvV
This commit is contained in:
parent
c4ca0ae29f
commit
40c8f7962d
20
volumes/db/cc/78-exam-marker-command-preamble.sql
Normal file
20
volumes/db/cc/78-exam-marker-command-preamble.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
--==========================================================================================
|
||||||
|
-- 78. exam_questions.command_word + preamble — richer recognition carried by the analyse contract v2 (WS-2)
|
||||||
|
--==========================================================================================
|
||||||
|
-- The extraction service (docling-exam-spike analyse.py v2, scripts/ANALYSE-CONTRACT.md) now carries two
|
||||||
|
-- fields the thin v1 bridge dropped:
|
||||||
|
-- * command_word — the primary command verb per part (calculate / explain / suggest / describe …), from
|
||||||
|
-- structure.command_words / part_info.primary. Drives the question-tree command pill + future filtering.
|
||||||
|
-- * preamble — the stem prose that introduces a question/part (structure.preamble_by_label), as a
|
||||||
|
-- jsonb sidecar {n, text:[…lines], nontext:[{kind,cls,page}], bands:[{page,y0,y1}]}. Kept as jsonb (not
|
||||||
|
-- a column per line) so the tree/doc view can show the stem and the canvas can locate its band. The
|
||||||
|
-- preamble band is ALSO emitted as a drawable context region (context_type='preamble'); this column is
|
||||||
|
-- the authoritative text for the outline view.
|
||||||
|
-- Both nullable; containers/parts without a detected command/preamble stay null. Additive + idempotent.
|
||||||
|
alter table public.exam_questions add column if not exists command_word text;
|
||||||
|
alter table public.exam_questions add column if not exists preamble jsonb;
|
||||||
|
|
||||||
|
comment on column public.exam_questions.command_word is
|
||||||
|
'Primary command verb for a leaf part (calculate/explain/suggest/describe/…), from the analyse contract v2 (structure command_words / part_info). Null for container questions or when none detected.';
|
||||||
|
comment on column public.exam_questions.preamble is
|
||||||
|
'Stem prose introducing this question/part, from the analyse contract v2 (structure.preamble_by_label): {n, text:[lines], nontext:[{kind,cls,page}], bands:[{page,y0,y1}]}. Authoritative text for the outline view; the band is also drawn as a context_type=preamble region.';
|
||||||
Loading…
x
Reference in New Issue
Block a user