2026-11-25 13:45:13 +00:00
# Core And Integration API Roadmap
## Status And Purpose
2026-11-25 14:26:07 +00:00
**Status:** Target design and API decisions accepted; implementation pending.
2026-11-25 13:45:13 +00:00
This roadmap is the next implementation priority, before the remaining
[audit catalog ](audit/catalog.md ) remediation. It develops
[discussion Item 5 ](audit/discussion.md#5-producer-state-and-shared-reconciliation-lifecycle )
into an integration-author API initiative, rather than a private-helper cleanup.
The document is a plan; this pass changes no application code.
The selected goals are:
1. Make the boundary between Notarius core and integrations clear and well defined.
2. Put as much demonstrated shared responsibility as practical in core, with a
clean, flexible interface for integration-owned behavior.
3. Make the API understandable and usable by future integration authors without
requiring them to reconstruct the execution lifecycle from core internals.
Here, **core ** means the framework contracts and orchestration, including shared
producer and reconciliation facilities. **Integrations ** means Notarius artifact
families and their stage modules, validators, codecs, and domain behavior. It does
not mean replacing the adopted kits' APIs with another abstraction.
2026-11-25 13:56:30 +00:00
The API is intended for multiple domains. The next anticipated integrations are
an email processor and an NWS Forecast Discussion text processor. Existing D&D
modules supply migration evidence, not the definition of what an integration or
chunk must be.
2026-11-25 13:45:13 +00:00
## Current Baseline
Reviewed baseline: `f0ba5cce843182e0f5f3eaa6577110a087cf1422` .
Production code is unchanged from the catalog's audited baseline
`3887d89b763b7040efc866d4a57eb910d8778730` ; intervening changes are documentation.
[go.mod ](../../go.mod ) selects Go 1.27.0, PromptKit v0.25.0, ConfigKit v1.4.0,
CommandKit v0.8.0, ckconfig v0.11.0, and ckprompt v0.12.0. No dependency upgrade is
required by this plan; assess any concrete upstream gap if implementation finds one.
The fixed typed pipeline and native-kit responsibilities are already implemented.
[Module Internals ](../internal/modules.md ) and
[Pipeline Internals ](../internal/pipeline.md ) describe current authoring and execution.
| Current surface | Responsibility and friction |
| --- | --- |
| [Typed stage requests ](../../internal/framework/contracts/typed_pipeline.go ) and [producer contracts ](../../internal/framework/contracts/producer.go ) | Requests expose `ProducerOperation[T]` , including assessor, controls, cache binding, execution options, and reuse eligibility. Authors carry framework plumbing through their module implementation. |
| [RunProducer ](../../internal/framework/pipeline/producer.go ) | Shares native execution, assessment, corrections, caching, and disposition, but its closures coordinate candidate, guidance, failure, acceptance, and capture state through mutable outer variables. |
| [Producer outcome helpers ](../../internal/framework/pipeline/producer_outcome.go ) | Integrations choose between `RunProducer` , `AssessProducer` , and `FinishProducerFailure` for model work, no-model answers, and preparation outcomes. Correct lifecycle composition remains part of the authoring recipe. |
| [Spell extraction ](../../internal/modules/dnd/extract/spells/extractor.go ) and [scene planning ](../../internal/modules/dnd/chunk/scenes/chunker.go ) | Modules prepare domain/native inputs, supply interpretation/correction/fallback closures, invoke the producer, and assemble typed outcomes. Scene planning also demonstrates correctable interpretation without a usable candidate. |
| [NPC ](../../internal/modules/dnd/normalize/npcregistry/normalizer.go ), [item ](../../internal/modules/dnd/normalize/itemregistry/normalizer.go ), and [location ](../../internal/modules/dnd/normalize/locationregistry/normalizer.go ) reconciliation | Each repeats fixed-original preparation, proposal/evidence tracking, no-model and limit dispositions, correction construction, fallback bookkeeping, and result assembly around existing shared mechanisms. |
| [Semantic reconciliation ](../../internal/framework/semanticreconcile/preparation.go ) | Already provides neutral candidate preparation, proposal safety, request construction, and typed application. The missing sharing is primarily the lifecycle connecting those facilities to production. |
| [Combat semantic validation ](../../internal/modules/dnd/validate/scenedescriptions/combat_semantics/validator.go ) | Executes one native assessment directly. It shares the native-usability classification defect with the producer, but is not a producer correction loop. |
The production migration inventory starts with ten D&D extractors (spells,
combat turns, enemy events, scene descriptions, and NPC/item/location registries
and occurrences), D&D scene planning, and the three registry normalizers.
Combat/enemy extraction and registry reconciliation have no-model paths that must
be exercised. Deterministic stage completion and typed registration/preparation
also participate where they connect to the changed contracts. Confirm the caller
inventory during implementation rather than treating these counts as invariants.
## Targeted End State
2026-11-25 13:56:30 +00:00
### Domain-Neutral Operations And Chunks
Core contracts describe sources, source units, chunks, typed artifacts, and
operation outcomes. A scene is a D&D interpretation of a chunk, not a core chunk
type that other integrations must imitate. Transcript speakers/timestamps, combat
annotations, entity registries, and D&D identity rules belong to integrations
where applicable; ordinary core operations do not require those concepts.
The existing [source types ](../../internal/core/source/source.go ) already carry
generic units, ranges, content, and metadata. Evaluate their fit through the new
API rather than introducing a parallel source model preemptively. Source parsing,
unit selection, chunk meaning, and domain metadata remain integration concerns;
core owns generic plan materialization and orchestration. Neither a particular
D&D chunk prompt nor scene-specific annotations define the authoring contract.
Use these anticipated scenarios alongside production D&D callers when evaluating
the API shape:
| Scenario | Design question |
| --- | --- |
| Email processing | Can an integration prepare message content and its domain metadata, choose useful processing units/chunks, and produce typed results without transcript or scene conventions? |
| NWS Forecast Discussion text processing | Can an integration process document text using its own meaningful sections or other chunk boundaries and domain-specific findings, without entity-registry reconciliation being required? |
These are design scenarios, not settled input formats, extraction schemas, or
chunking policies. A section/paragraph or whole-document chunk can illustrate an
API walkthrough without prescribing either integration's final behavior. Support
deterministic and model-assisted preparation where appropriate through the same
core lifecycle; specialized reconciliation remains optional.
Develop small API sketches or synthetic fixtures to expose domain assumptions.
Implementing the email and NWS processors, network ingestion, or their complete
domain contracts is not part of this migration. If a walkthrough exposes a real
source/chunk contract mismatch, identify and resolve that specific boundary rather
than forcing the integration into scene terminology or promising arbitrary source
topologies without evidence.
2026-11-25 13:45:13 +00:00
### Ownership
| Responsibility | Target owner |
| --- | --- |
| Transport, credentials, native structural validation/repair, transient retries, exchanges, continuation iteration, and backend admission | PromptKit, through its native types and APIs |
| Configuration loading/composition and command parsing/rendering | ConfigKit, CommandKit, and their existing application integrations |
| Operation lifecycle, configured assessment, native continuation coordination, cache use, standard evidence, cancellation, and terminal mode application | Notarius core |
| Domain input preparation, prompt selection/native input construction, result interpretation, deterministic identity, and domain transformations | Integration |
| Validation meaning and actionable repair instructions | Detecting integration validator or interpretation rule; core collects and applies configured assessment |
| When supported fallback is selected and how it affects outcomes/reuse | Core, applying resolved policy |
| What constitutes a valid fallback and how to construct it | Integration, with existing intrinsic/downstream checks |
| Fixed-original and current-proposal reconciliation bookkeeping | Shared core reconciliation facility |
| Entity compatibility, typed proposal application, family diagnostics, and domain-specific reconciliation evidence | Integration, using family-shared helpers where appropriate |
| Physical publication, invocation debug allocation/finalization, and terminal reporting | Existing CLI/recorder boundary |
Core should own the complete shared lifecycle, not merely offer utilities that
authors must arrange correctly. That does not require hiding native PromptKit
requests/results or moving domain rules into the framework.
2026-11-25 14:26:07 +00:00
### Core-Driven Typed Operations
Core calls the integration's preparation function and receives a small typed
operation definition. It supplies either a deterministic candidate for assessment
or a native initial request and the domain behavior needed to interpret results,
construct corrections, and produce a supported fallback. Core consumes that
operation and owns assessment, execution, continuation, caching, standard evidence,
and terminal disposition.
Use ordinary Go data and functions or small interfaces for optional behavior.
Distinguish meaningful preparation outcomes rather than building a large bag of
unrelated optional fields. The operation definition is not a serializable workflow
language or another configuration system. Exact type names and method signatures
remain implementation choices within this accepted control flow.
An ordinary integration no longer selects assessment/cache collaborators, chooses
terminal helpers, invokes an injected executor on each branch, tracks native
capture finalization, or maintains framework acceptance state. Required inputs and
optional capabilities should be clear from the author-facing types and examples.
Standalone callers can use the same core executor.
Support the existing preparation outcomes: a deterministic answer, model work, an
existing preparation-limit disposition, or an ordinary failure. Moving their
handling into core must not turn arbitrary preparation errors into permissive
recovery. A model-backed module may legitimately complete without a model call;
deterministic work needs no manufactured prompt or cache key.
Changing internal stage interfaces and callers is part of the migration where
needed. Retaining their current signatures or lifecycle plumbing is not the goal.
This does not promise a versioned public SDK, dynamic plugin loading, or universal
backwards compatibility.
### Explicit Candidate Evaluation Results
Interpretation/application returns an explicit evaluation containing the usable
candidate, if any, and its associated guidance, diagnostics, and applicable
proposal-application information. Interpretation can return actionable correction
guidance before it has a usable candidate. Core owns subsequent configured
assessment and acceptance; supplying a candidate is not an approval claim.
Core replaces the evaluation as a unit and invalidates the previous candidate
when selecting another execution, so a failed correction cannot revive stale
candidate state. Candidate-associated findings must not survive accidentally in
separate mutable integration variables. Earlier evaluations may remain in debug
evidence without describing the final artifact.
Keep reconciliation-specific typed issues and omission information in the
reconciliation facility or family adapter. Ordinary extraction does not acquire
registry-specific fields. Families retain domain translation and diagnostic
meaning. Fixed prepared inputs, lookup tables, and per-operation domain helpers
remain legitimate; explicit evaluation results do not require all integration
code to be pure or stateless. This decision does not expand cache payloads or the
completion report.
### Convenient Native Correction Requests
Provide a direct convenience path for the common case: the integration selects a
native correction prompt and specifies how ordered guidance is supplied. Core
collects applicable guidance and carries resolved execution selections;
PromptKit carries conversation history. Existing native prompt declarations own
message templates and schemas.
Also accept a native request builder for specialized domain correction material.
The convenience path reduces to the same request-building mechanism as that
custom path, with one execution/continuation lifecycle. It does not impose a
universal guidance variable name, prompt schema, correction policy, D&D template,
or scene-specific response shape.
Exercise both authoring forms with a simple extractor and a richer correction
case. Exact field names and helper placement remain implementation details; the
selected API supports the convenient default and native customization.
2026-11-25 13:45:13 +00:00
### Reconciliation As A Focused Facility
Build a typed reconciliation facility on the same producer lifecycle. It owns
fixed preparation, proposal decoding/safety bookkeeping, current-proposal
replacement, standard evidence, and disposition handoff. Families supply records,
candidate projections, prompts, application policies, fallback construction, and
domain diagnostics. Reuse the existing neutral reconciliation mechanisms.
Preserve item currency compatibility, NPC naming/identity rules, and distinctions
between same-named locations. Neutral proposal issues can be translated into
family diagnostics by a D&D-local adapter; generic core need not import D&D.
Ordinary extractors do not acquire reconciliation concepts they do not use.
The useful outcome is that family code reads primarily as domain preparation and
policy. If a proposed common facility instead needs numerous family switches,
revise the boundary rather than hiding three procedures in a configurable engine.
### Native Result Handling
The CAT-007 correction is accepted. Share a small native usability check where
needed by producers and the LLM validator. Distinguish absent results, completed
failed validation, and actual native Go errors; retain useful validation details
without manufacturing `promptkit.ErrValidation` for completed content rejection.
Preserve producer disposition and validator unavailability as separate outcomes.
Correct the test that expects the wrong sentinel and the native fixture that
currently accepts an arbitrary error. This adds no repair loop or budget.
## Behavioral Scope
This is an ownership/API migration. Existing selected behavior is the starting
contract, as recorded in [Architecture ](../policy/architecture.md ),
[Configuration ](../config.md ), and the focused internal guides. In particular:
- Preserve complete configured assessment of each delivered usable candidate,
including the last allowed revision; no duplicate outer assessment. An unusable
interpretation may supply domain correction guidance without claiming a candidate.
- Keep native structural work upstream. Preserve growing native exchanges,
explicit execution selections, and release of native admission before nested
validation. A failed/result-less correction does not revive an earlier candidate.
- Apply reconciliation proposals afresh to fixed originals. Preserve final-only
fallback behavior, ordinary deterministic error propagation, and cancellation
precedence. Moving code must not widen fallback eligibility.
- Preserve accepted-result reuse under the original prepared message-content
hash, current-source usability checks, and no semantic reassessment on hits.
Store final accepted domain artifacts/plans, not exchanges or rejected proposals.
- Preserve fallback disclosure and dependency-specific reuse ineligibility,
required-capture failure handling, and independent consumer-owned observation.
- Preserve typed artifact/codec compatibility, module selections, native prompt ownership,
fixed stage boundaries, worker/admission separation, and domain output shapes.
These are references to existing behavior, not an invitation to freeze incidental
callback order, private error prose, debug filenames, or implementation structures.
Keep flexibility for concrete integration requirements. No new correction limits,
input restrictions, shutdown guarantees, resource caps, or model-quality claims
are selected here.
A redesign of input/output adapters, the CLI, registry discovery, or configuration
composition is not needed merely to centralize producer behavior. Adapt their
existing connections where necessary. Native LLM validators retain their one-shot
assessment role; sharing usability/evidence support does not enroll them in the
producer correction lifecycle.
## Work From The Baseline
### 1. Define And Exercise The Author-Facing Contract
- Inventory production and programmatic callers of the current producer/outcome
helpers, typed operation requests/results, registration, and preparation.
2026-11-25 14:26:07 +00:00
- Turn the accepted operation, evaluation-result, and correction-request designs
into concrete API sketches for spell extraction, registry normalization, and a
no-model branch. Include scene-plan interpretation that requests correction
before a candidate can be materialized.
- Exercise those same designs with email and NWS Forecast Discussion processing
2026-11-25 13:56:30 +00:00
sketches. Check source/chunk inputs, domain metadata, result interpretation,
correction guidance, and optional reconciliation for D&D assumptions before
2026-11-25 14:26:07 +00:00
finalizing Go signatures. Keep format-specific decisions with the future integrations.
2026-11-25 13:45:13 +00:00
- Specify which inputs are operation-owned or borrowed, which implementations
are reused concurrently, and the lifetime of optional evidence hooks. Document
actual behavior without promising arbitrary collaborator thread safety or
prohibiting reasonable per-operation state.
- Show how ordinary use avoids exposed assessor/cache replacement and terminal
helper selection. Identify which existing types can be reused and which should
become private or be replaced. Exact helper names/files are implementation choices.
This is an implementation design step, not a separate approval ceremony or a
requirement to create a large specification before trying representative callers.
### 2. Establish Core-Owned Execution
2026-11-25 14:26:07 +00:00
- Implement core invocation of integration preparation and consumption of the
returned typed operation. Adapt stage interfaces, registration/preparation, and
runner completion where necessary, retaining the same core entry point for
direct programmatic callers.
- Implement explicit candidate evaluation results and replace parallel mutable
candidate-associated state. Add the native correction convenience path and
custom request builder on one shared request/execution mechanism.
2026-11-25 13:45:13 +00:00
- Make deterministic completion, native execution, correctable interpretation,
assessment, preparation dispositions, and supported fallback explicit paths
owned by core. Separate candidate state from pending native capture state.
- Keep existing cache, assessment, capture, and terminal helpers internally where
they remain useful; replace their author-facing choreography, not merely names.
- Integrate CAT-007's usability/detail correction and focused regressions.
- Migrate one extractor and a no-model path end to end, including registration,
capture, reuse, assessment, and final typed results. Private transitional adapters
may help keep changes reviewable, but are not the completed authoring API.
### 3. Consolidate Reconciliation And Migrate Producers
- Build the shared reconciliation facility on the selected operation boundary.
Move no-model/limit handling, current-proposal state, and common evidence/result
assembly out of the three family procedures.
- Migrate NPC, item, and location normalizers, retaining independent family
expectations for identity, application, omissions, and fallback semantics.
- Migrate all affected extractors and scene planning. Exercise combat-gated
no-model branches and chunk-plan materialization/assessment/cache behavior.
- Adapt deterministic stage completion as needed while preserving its ordinary
one-production/assessment path. Do not force deterministic modules to declare
model requests or reconciliation policies.
- Keep one-shot model validation native, sharing the corrected usability boundary
and any necessary evidence support without a new semantic retry mechanism.
### 4. Remove Superseded Plumbing And Teach The API
- Remove unused author-facing lifecycle fields, wrappers, and duplicate family
state once callers have moved. Do not leave two competing supported authoring
recipes simply to preserve the old internal arrangement.
- Update [Module Internals ](../internal/modules.md ),
[Pipeline Internals ](../internal/pipeline.md ), and
[D&D Internals ](../internal/dnd.md ) alongside implementation. Update architecture
ownership and record significant changed decisions through the existing ADR
process, preserving accepted ADR bodies.
- Supply one minimal working integration example and point to a richer registry
example. Explain required/optional capabilities, no-model completion, domain
guidance versus operational errors, fallback, concurrency, and evidence ownership.
2026-11-25 13:56:30 +00:00
Prefer a small domain-neutral fixture for the introductory example, with D&D
as the richer example, so learning the API does not require learning scene or
registry semantics. No new demo application is needed.
2026-11-25 13:45:13 +00:00
- Verify that the example can be understood without reading the core producer.
Test actual registration/execution of the example where useful; do not add a
subjective readability gate or a required external-author study.
### 5. Verify And Reassess The Audit
- Finish the relevant behavioral verification below and review remaining callers
for old lifecycle composition that was merely relocated into integrations.
- Reassess overlapping catalog entries against the resulting implementation.
Record resolved, partially addressed, and remaining work with concrete evidence.
- Resume the remaining audit remediation using that revised catalog. Completion
of this roadmap does not require completing unrelated catalog work first.
These are coherent work units, not required release boundaries. Keep each unit
reviewable and preserve working behavior during migration.
## Verification And Completion Evidence
Use existing boundary tests and real native kits with offline provider fakes.
Tests should protect behavior and author-facing contracts, not private callback
sequences or exact struct layouts. Relevant starting points include
[producer ](../../internal/framework/pipeline/producer_test.go ),
[producer cache ](../../internal/framework/pipeline/producer_cache_test.go ),
[operation completion ](../../internal/framework/pipeline/runner_operation_test.go ),
[chunk-plan cache ](../../internal/framework/pipeline/chunk_plan_cache_test.go ),
and [native capture ](../../internal/framework/pipeline/native_capture_test.go ) tests.
Cover the distinct risks introduced by moving ownership:
- Registered typed extraction, scene planning, reconciliation, and no-model paths
reach core execution without integration-owned assessment/disposition plumbing.
2026-11-25 13:56:30 +00:00
- A small non-D&D example exercises generic source/chunk handling and typed
production without scene/combat fields or mandatory registry reconciliation.
Email/NWS walkthroughs inform that example; complete processors are not required
as verification dependencies.
2026-11-25 14:26:07 +00:00
- Replacing or invalidating a candidate also replaces or invalidates its associated
findings; historical debug evidence remains distinguishable from final results.
- The convenient correction path and a specialized native builder preserve the
selected prompt/input bindings, execution selections, and native history through
the same core lifecycle, without requiring a universal guidance variable.
2026-11-25 13:45:13 +00:00
- Every usable revised candidate receives complete assessment; interpretation-only
guidance can request correction; native failed checks retain details and do not
become semantic approval or an extra structural-repair loop.
- Fixed-original reconciliation retains each family's expected output, fresh
proposal application, and final-only fallback. Failed/undelivered corrections
and caller cancellation retain their established behavior.
- Cache hits, accepted corrected writes, failed refresh, fallback-derived
ineligibility, and cache/capture error distinctions survive the new boundary.
- Native evidence and supplied observers remain attached to actual executions;
cache hits invent no model execution. Disabled evidence does not require
expensive domain-only debug construction in the new API.
- Concurrent operations do not share candidate state; nested validation still
works with limited native capacity. Reuse relevant worker/admission tests.
Place common lifecycle coverage in core and retain representative independent
family tests. Simplify tests coupled to retired plumbing; do not derive expected
domain outputs from the same helper under test. This is a coverage guide, not a
new test for every row or an exhaustive cross-product requirement.
Run focused checks while iterating, then the repository's offline full tests,
vet, and build for the shared-contract migration, with focused race checks for
changed concurrency paths. Follow [Testing Policy ](../policy/testing.md ) and
[Development ](../development.md#validation ). No paid inference, benchmark target,
coverage percentage, or new release gate is required. This planning pass has not
run those implementation checks.
The roadmap is complete when affected production integrations use the selected
API, ordinary authors no longer compose the shared lifecycle, obsolete paths are
removed, behavior is verified, author guidance matches the implementation, and
2026-11-25 13:56:30 +00:00
the catalog is reassessed. The design has also been exercised against email and
NWS processing scenarios without making their domain behavior a core requirement.
A clearer private `RunProducer` alone is insufficient.
2026-11-25 13:45:13 +00:00
## Relationship To The Audit
| Findings | Treatment in this roadmap |
| --- | --- |
| CAT-015 / CAT-016 | Central scope: replace coupled author-facing lifecycle responsibilities and duplicated registry reconciliation coordination. |
| CAT-007 | Accepted correction included at both producer and one-shot validator boundaries, including the misleading test oracle. |
| CAT-006 / CAT-008 / CAT-009 / CAT-022 / CAT-023 | Coordinate candidate/evidence/diagnostic lifetime changes where this migration touches them. Runner-wide finalization and CLI lifecycle issues remain outstanding unless separately demonstrated fixed. |
| CAT-003 / CAT-024 / CAT-025 / CAT-032 | Keep new optional evidence inexpensive and document actual concurrency. Apply the accepted whole-source capture direction if touched, but do not assume a package move or the entire capture inventory must be redesigned here. |
| CAT-014 / CAT-017 / CAT-018 | Accepted composition/copying direction remains valid. Make only changes required by the new registration/operation boundary; broader consolidation follows this initiative unless it becomes a concrete prerequisite. |
| Other entries | Reassess after migration; retain independent defects, optional cleanups, and CAT-034's resolved status. |
The accepted diagnostic retention, source-capture, signal, and composition choices
in [discussion Items 1– 4 ](audit/discussion.md ) remain selected future work. This
roadmap does not reverse them or silently incorporate all their implementation.
If an overlapping fix is completed during this work, record its actual scope and
tests. Catalog IDs are evidence references, not a mandate to close every entry.