feat(frontmatter): --frontmatter KEY=VALUE stamps a key on every concept of a run
K3-19 b. `okf build --frontmatter KEY=VALUE`, repeatable, split on the FIRST '=' (`cli.frontmatter_from_flags`) because a publisher's address carries '=' itself. The value is written verbatim on ONE line: the block form of a `sources` list is invisible to this package's line-oriented readers, so the flow form is the only one that survives them. Also reachable as `build(frontmatter=...)`, `measure(concept_frontmatter_values=...)`, `process_inbox(concept_frontmatter_values=...)` and `render_inbox_concept(concept_frontmatter_values=...)`, keyword-only with defaults, so every existing call site is source-compatible. Precedence: a stated value beats what the document declares, which beats the file name. A run may ADD any key and REPLACE only `sources` and `description` -- the two with a derived layer below the flag. Every other key the door writes is refused by `inbox.validate_concept_frontmatter` before a proposal is written (`run_frontmatter_invalid`): measured from the bytes, owned by another argument, the ownership stamp a later run reads back (including Door A's `ingest_manifest`, which would make that door claim a Door B file), or a derived facet whose `derived` marker would go on naming a replaced value. A value that would not read back as stated -- empty, multi-line, or padded, since `parse_frontmatter` strips -- is refused too. SPEC SS 4.1 "Extensions" lets a producer add any key and SS 11 forbids a consumer to reject one. Without the flag nothing moves: a test holds the flagged tree to the plain one minus exactly the stated line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
72617acc7a
commit
912b85026b
5 changed files with 171 additions and 2 deletions
|
|
@ -283,6 +283,7 @@ def measure(
|
|||
pdf_headings: bool = False,
|
||||
heading_reserve: Callable[[str], bool] | None = None,
|
||||
ocr: bool = False,
|
||||
concept_frontmatter_values: Mapping[str, str] | None = None,
|
||||
) -> CorpusReport:
|
||||
"""Run the corpus through the door and count what happened.
|
||||
|
||||
|
|
@ -307,6 +308,7 @@ def measure(
|
|||
pdf_headings=pdf_headings,
|
||||
heading_reserve=heading_reserve,
|
||||
ocr=ocr,
|
||||
concept_frontmatter_values=concept_frontmatter_values,
|
||||
)
|
||||
elapsed = time.monotonic() - started
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue