Support target-aware reference selectors
This commit is contained in:
48
docs/cli.md
48
docs/cli.md
@@ -20,7 +20,7 @@ a bearer token.
|
||||
|
||||
```text
|
||||
notarius help
|
||||
notarius run <pipeline-id> --input path/to/source.json [--config path/to/config.yml] [--only lane-a,lane-b] [--reference slot=path] [--without-reference slot]
|
||||
notarius run <pipeline-id> --input path/to/source.json [--config path/to/config.yml] [--only lane-a,lane-b] [--reference selector=path] [--without-reference selector]
|
||||
notarius config validate --config path/to/config.yml [--pipeline pipeline-id] [--only lane-a,lane-b]
|
||||
notarius pipelines list --config path/to/config.yml [--json]
|
||||
```
|
||||
@@ -46,34 +46,42 @@ Flags:
|
||||
invocation.
|
||||
- `--llm-profile id`: override every effective module binding to use one LLM
|
||||
profile.
|
||||
- `--reference slot=path`: bind a reference path to an extractor reference
|
||||
slot. Repeatable. Use `lane.slot=path` when multiple selected lanes declare
|
||||
the same slot.
|
||||
- `--without-reference slot`: remove a configured optional reference binding.
|
||||
Repeatable. Use `lane.slot` when multiple selected lanes declare the same
|
||||
slot.
|
||||
- `--reference selector=path`: bind a reference path to a chunk, extractor, or
|
||||
normalizer reference slot. Repeatable.
|
||||
- `--without-reference selector`: remove a configured optional reference binding.
|
||||
Repeatable. It accepts the same selector forms as `--reference`, without
|
||||
`=path`.
|
||||
|
||||
On success, the command prints the completed pipeline ID, approved and rejected
|
||||
artifact counts, and the output directory. If the run completes with warnings,
|
||||
the warning count is printed to stderr.
|
||||
|
||||
Reference flags are resolved against selected artifact lanes before the run
|
||||
starts. Flat slot names are accepted only when exactly one selected lane
|
||||
declares that slot. Bound reference files are read before extraction, validated
|
||||
as UTF-8 text, and passed only to the lane extractor that declares the slot.
|
||||
Notarius infers reference media types from file extensions for provenance and
|
||||
for optional slot checks. Reference content is not written to diagnostics, logs,
|
||||
errors, or manifests.
|
||||
Reference flags are resolved against selected chunk, extractor, and normalizer
|
||||
targets before the run starts. Flat slot names are accepted only when exactly
|
||||
one selected target declares that slot. Bound extractor reference files are read
|
||||
before extraction, validated as UTF-8 text, and passed only to the lane
|
||||
extractor that declares the slot. Notarius infers reference media types from
|
||||
file extensions for provenance and for optional slot checks. Reference content
|
||||
is not written to diagnostics, logs, errors, or manifests.
|
||||
|
||||
Reference binding precedence is:
|
||||
|
||||
1. pipeline-level config `references`;
|
||||
2. lane-level config `references`;
|
||||
2. target-local config references, including legacy lane-level extractor
|
||||
`references`;
|
||||
3. `--reference` run flags;
|
||||
4. `--without-reference` run flags.
|
||||
|
||||
`--reference` binds or replaces one slot for one selected lane. Use
|
||||
`slot=path` when the selected lanes declare the slot unambiguously:
|
||||
`--reference` binds or replaces one slot for one selected target. Selectors are:
|
||||
|
||||
- `slot=path`: valid when exactly one selected target declares `slot`;
|
||||
- `chunk.slot=path`: target the chunker;
|
||||
- `lane.slot=path`: valid when exactly one selected extractor or normalizer in
|
||||
that lane declares `slot`;
|
||||
- `lane.extract.slot=path`: target a lane extractor;
|
||||
- `lane.normalize.slot=path`: target a lane normalizer.
|
||||
|
||||
Use `slot=path` when the selected targets declare the slot unambiguously:
|
||||
|
||||
```sh
|
||||
go run ./cmd/notarius run dnd-session \
|
||||
@@ -82,14 +90,14 @@ go run ./cmd/notarius run dnd-session \
|
||||
--reference roster=./campaign-roster.txt
|
||||
```
|
||||
|
||||
Use `lane.slot=path` when multiple selected lanes declare the same slot or when
|
||||
you want to target a specific lane:
|
||||
Use an explicit selector when multiple selected targets declare the same slot or
|
||||
when you want to target a specific target:
|
||||
|
||||
```sh
|
||||
go run ./cmd/notarius run dnd-session \
|
||||
--config examples/dnd-spells.config.yml \
|
||||
--input examples/seriatim-minimal-transcript.json \
|
||||
--reference spells.glossary=./campaign-glossary.txt
|
||||
--reference spells.extract.glossary=./campaign-glossary.txt
|
||||
```
|
||||
|
||||
Use `--without-reference` to remove a configured optional binding for a run:
|
||||
|
||||
@@ -145,14 +145,14 @@ module keys.
|
||||
Reference bindings are validated against reference slots declared by eligible
|
||||
chunk, extract, and normalize targets during pipeline resolution. Required slots
|
||||
must be bound after config defaults, target-local references, lane-level
|
||||
compatibility bindings, and extractor run-time `--reference` or
|
||||
`--without-reference` overrides are applied. Config-relative paths are resolved
|
||||
relative to the config file; CLI reference paths are resolved relative to the
|
||||
current working directory. Materialized bound files must be UTF-8 text and are
|
||||
currently passed only to lane extractors that declare the slot. Reference media
|
||||
types are inferred from file extensions, recorded as canonical base media types,
|
||||
and checked only when a module declares `AcceptedMediaTypes`; unknown extensions
|
||||
are recorded as `application/octet-stream`. Reference content is not written to
|
||||
compatibility bindings, and run-time `--reference` or `--without-reference`
|
||||
overrides are applied. Config-relative paths are resolved relative to the config
|
||||
file; CLI reference paths are resolved relative to the current working
|
||||
directory. Materialized bound files must be UTF-8 text and are currently passed
|
||||
only to lane extractors that declare the slot. Reference media types are
|
||||
inferred from file extensions, recorded as canonical base media types, and
|
||||
checked only when a module declares `AcceptedMediaTypes`; unknown extensions are
|
||||
recorded as `application/octet-stream`. Reference content is not written to
|
||||
diagnostics, logs, errors, or manifests.
|
||||
|
||||
Pipeline-level `references` are defaults. They are valid when at least one
|
||||
|
||||
@@ -34,10 +34,11 @@ Pipeline profiles and artifact lanes may include reference binding maps keyed by
|
||||
reference slot name. During resolution, pipeline-level bindings act as defaults
|
||||
for selected chunk, extractor, and normalizer targets that declare the slot;
|
||||
target-local bindings override or add bindings for that target. Runtime
|
||||
`--reference` requests override extractor config bindings, and runtime unbinds
|
||||
remove optional extractor bindings. Flat runtime slot names are resolved only
|
||||
when exactly one selected extractor lane declares the slot; otherwise the CLI
|
||||
requires `lane.slot`. Resolution validates bindings against the declaring
|
||||
`--reference` requests override target config bindings, and runtime unbinds
|
||||
remove optional target bindings. Flat runtime slot names are resolved only when
|
||||
exactly one selected target declares the slot; otherwise the CLI requires a more
|
||||
specific selector such as `chunk.slot`, `lane.extract.slot`, or
|
||||
`lane.normalize.slot`. Resolution validates bindings against the declaring
|
||||
target specs and stores the bindings in target-aware resolved reference holders.
|
||||
It does not read reference files or include reference bytes in source digests.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user