Anchor Concepts (Design Note)
An anchor is a value a method produces that points into one of its inputs: the place in a contract a clause was found, the box on a photo around a defect. With anchors a result can be shown in place — the clause highlighted in the document, the defect boxed on the picture — and every claim can carry where it came from.
[concept.ClauseReview.structure]
heading = { type = "text", description = "The clause heading", required = true, hints = { part = "title" } }
verdict = { description = "What to do with the clause", required = true, hints = { part = "verdict" }, choices = [
{ value = "accept", label = "Accept", tone = "positive" },
{ value = "refuse", label = "Refuse", tone = "negative" },
] }
where = { type = "concept", concept_ref = "native.DocumentAnchor", description = "Where the clause is in the NDA", required = true, hints = { part = "evidence" } }
Not part of the standard yet
This page settles the shape of two native concepts, native.DocumentAnchor and native.ImageRegion, so that the rest of the language leaves room for them. They are not in the pinned native set, no implementation materializes them, and a bundle referencing them is refused today as it refuses any unknown concept. A later version of the standard adds them to the pinned set, once implementations can produce them: a model can only cite a page and a position that extraction kept, so extraction must first keep page and position information. Until then, this page is a design note, and the shapes below may still change.
Why Native Concepts
An anchor written in free text ("see page 3") is a fact no view can act on. A typed value is one the engine can ask a model for, validation can check, every consumer can read and an API caller receives with its positions. An anchor is therefore a contract fact, not a hint: it is content the method produces. It is native, rather than a concept each method declares, because every consumer must recognise it by its identity to draw it, exactly as it recognises a native.Document to offer a file.
native.DocumentAnchor
[concept.DocumentAnchor]
description = "A place in a document: a page, the passage quoted from it, and optionally its region on the page"
[concept.DocumentAnchor.structure]
document = { type = "concept", concept_ref = "native.Document", required = true, description = "The document the anchor points into" }
page = { type = "integer", required = true, minimum = 1, description = "The page, counted from 1 in the document's own order, whatever number is printed on it" }
quote = { type = "text", description = "The passage the anchor points at, copied verbatim from the page" }
left = { type = "number", minimum = 0, maximum = 1, description = "The left edge of the region, as a fraction of the page's width from its left edge" }
top = { type = "number", minimum = 0, maximum = 1, description = "The top edge of the region, as a fraction of the page's height from its top edge" }
width = { type = "number", minimum = 0, maximum = 1, description = "The width of the region, as a fraction of the page's width" }
height = { type = "number", minimum = 0, maximum = 1, description = "The height of the region, as a fraction of the page's height" }
- The document is the value itself.
documentholds the samenative.Documentthe method received,urlincluded, so an anchor is self-contained wherever it travels, and a consumer finds the anchored input among a run's inputs by itsurl. - The page is a position, not a label.
pagecounts the document's pages from1in their order, so a page printed "iv" or "12" in a document whose front matter is unnumbered is still found by counting. - The quote or the region, at least one. A text passage is anchored by its
quote, a figure or a signature by its region, and a passage may carry both. A value carrying neither points at a whole page, which a page number alone says better, so a compliant value carries at least one of them. - The region is all four edges or none.
left,top,widthandheightare each optional in the blueprint but paired: a compliant value carries all four or none, as anImagecarries both ofwidthandheightor neither. The structure language has no cross-field form, so a validating runtime enforces these rules on values. - Coordinates are fractions of the page. They run from
0to1, from the top-left corner of the page as rendered, so they hold whatever resolution a consumer renders the page at, andleft + widthandtop + heightdo not exceed1.
native.ImageRegion
[concept.ImageRegion]
description = "A box on a picture, with an optional label naming what it holds"
[concept.ImageRegion.structure]
image = { type = "concept", concept_ref = "native.Image", required = true, description = "The picture the region is on" }
left = { type = "number", required = true, minimum = 0, maximum = 1, description = "The left edge of the box, as a fraction of the picture's width from its left edge" }
top = { type = "number", required = true, minimum = 0, maximum = 1, description = "The top edge of the box, as a fraction of the picture's height from its top edge" }
width = { type = "number", required = true, minimum = 0, maximum = 1, description = "The width of the box, as a fraction of the picture's width" }
height = { type = "number", required = true, minimum = 0, maximum = 1, description = "The height of the box, as a fraction of the picture's height" }
label = { type = "text", description = "What the box holds, in a few words" }
The picture is the value itself, as a document anchor's document is, and the box follows the same coordinate rules. A picture with several things spotted on it is a list of regions, one per box.
How a Method Would Use Them
A field typed by an anchor concept is presented by any consumer that knows the natives: a "Show in the document" link on each record, boxes drawn on a picture, and, for a designed page, the whole document annotated from the paths alone. With part = "evidence", the anchor is folded under its record's verdict. A method's prompts would ask a model for an anchor as for any other structured value, which a runtime can only satisfy once its extraction presents pages and positions the model can cite.
What Is Left to Settle
These questions belong to the campaign that builds the anchors, and are recorded here so they are not lost:
- Whether a region on a page may also be given in the page's own units, such as PDF points, for a consumer that does not render the page.
- Whether a document anchor may span several pages, or a passage running onto a second page is two anchors.
- How a runtime checks a
quoteagainst the page it cites, and what it does when the model's quote is not on that page. - How
native.Pagerelates to a document anchor, since a page extracted from a document knows its own position.