345 Commits

Author SHA1 Message Date
3887d89b76 Clarify release scope and remove completed ReleaseKit plans 2026-11-24 13:35:29 +00:00
f73bb83803 Record the ReleaseKit policy scope finding 2026-11-24 13:06:53 +00:00
be65c52be9 Record native release migration verification 2026-11-23 19:23:40 +00:00
d574ad77e4 Refresh installation and contributor release guidance 2026-11-23 19:21:56 +00:00
dc9f429bb8 Align release policy and maintainer workflow with ReleaseKit 2026-11-23 19:21:22 +00:00
5a3db96588 Deliver tagged releases through native ReleaseKit CI 2026-11-23 19:20:03 +00:00
dbcf9ee2b2 Remove replaced release scripts and attribute ReleaseKit 2026-11-23 19:19:35 +00:00
de4bd1c450 Add the native release profile and launcher 2026-11-23 19:19:12 +00:00
40eba90f47 Adopt ReleaseKit runtime version and register its tool 2026-11-23 19:18:48 +00:00
7e6cbd9d7a Plan the native ReleaseKit implementation 2026-11-23 18:11:36 +00:00
2a45f6d3ae Plan Linux binary releases and prepare credential storage 2026-11-23 18:03:03 +00:00
f74b58f41a Plan native ReleaseKit adoption 2026-11-23 17:50:37 +00:00
e8d3ad35af Remove completed kit upgrade plans 2026-11-23 03:58:08 +00:00
06f8fcb66f Record completed observability upgrade and final verification 2026-11-23 02:59:05 +00:00
aace4e98e9 Refresh operator guidance and selected native kit links 2026-11-23 02:52:11 +00:00
9825ee75fd Document consumer-owned execution observation and its architecture decision 2026-11-23 02:48:37 +00:00
00fc11360e Verify native provider accounting and smoke reports with local HTTP 2026-11-23 02:46:25 +00:00
63beae814b Verify native usage reporting across recovery and delivery boundaries 2026-11-23 02:43:43 +00:00
7aa4f2ec4d Use native contexts for execution observation 2026-11-23 02:38:21 +00:00
88ebdbd819 Move native debug accounting into the CLI capture lifecycle 2026-11-23 02:35:19 +00:00
051a91e397 Upgrade native kits and refresh their source notices 2026-11-23 02:33:40 +00:00
176052a244 Plan the native kit observability upgrade 2026-11-23 02:29:37 +00:00
1483e8e0d1 Plan architecture alignment for native observation 2026-11-23 02:21:58 +00:00
5d3a3b5956 Simplify observability upgrade ownership and implementation plan 2026-11-23 02:16:57 +00:00
447110a939 Adopt upstream documentation ownership guidance 2026-11-23 02:05:15 +00:00
5f03a6f469 Link upstream documentation for adopted kit features 2026-11-23 00:54:35 +00:00
6fbfee8bdf Plan native kit observability upgrades 2026-11-23 00:48:41 +00:00
7faa4a0506 Remove completed planning documents 2026-11-22 09:51:45 +00:00
f069a10c78 Assemble lane results in chunk order without sorting 2026-11-22 09:49:08 +00:00
c8250089b1 Index debug sensitivity paths once per capture 2026-11-22 09:43:22 +00:00
80148ef7e4 Share a lazy source index across cache hits 2026-11-22 09:42:06 +00:00
2429f0ae6a Index source positions during chunk plan validation 2026-11-22 09:40:42 +00:00
7ee7b997f0 Remove unused legacy LLM error definitions 2026-11-22 09:39:50 +00:00
dd25838589 Keep long fallback reasons from invalidating warnings 2026-11-22 09:38:24 +00:00
9074547e33 Keep cached scene identities aligned with the current plan 2026-11-22 09:37:16 +00:00
8ea96dc7a4 Clarify validation behavior when chains are replaced 2026-11-22 09:32:32 +00:00
581229cd1f Preserve operational timeouts when selecting run failures 2026-11-22 09:32:16 +00:00
e823baf3af Record algorithmic scaling opportunities 2026-11-22 09:28:59 +00:00
fdaf39162b Record native migration integration gaps 2026-11-22 09:00:55 +00:00
fd134e85e5 Record the native migration review findings 2026-11-22 08:15:09 +00:00
75444b8ef3 Verify the native cutover and complete the implementation roadmap 2026-11-22 07:11:50 +00:00
633ebd282f Refresh native workflow orientation and planning status 2026-11-22 06:57:27 +00:00
b76d511571 Document native kit integration contracts and ownership 2026-11-22 06:52:56 +00:00
aa4ce04683 Refresh typed module and D&D contributor recipes 2026-11-22 06:48:55 +00:00
41f6079040 Refresh pipeline execution and run state internal guides 2026-11-22 06:45:28 +00:00
5db09d0203 Refresh native configuration, CLI, and LLM internal guides 2026-11-22 06:41:22 +00:00
2c27695df9 Update native operations, consumer migration, and version checks 2026-11-22 06:32:22 +00:00
5e58327032 Rewrite configuration and CLI references for native commands 2026-11-22 06:20:54 +00:00
3cf389db78 Record native architecture decisions and align ownership policy 2026-11-22 06:11:57 +00:00
5b6854e975 Verify native recovery, fallback reuse boundaries, and operator schemas 2026-11-22 06:00:52 +00:00
854d23b91e Migrate maintained D&D examples to native configuration 2026-11-22 05:45:31 +00:00
3ef55f4668 Finish native migration cleanup and restore whole-tree compilation 2026-11-22 05:37:15 +00:00
4fa437aee8 Migrate ordered enemy event contracts to native providers 2026-11-22 05:29:48 +00:00
936fc1e72a Migrate run state and reference contracts to native execution 2026-11-22 05:24:30 +00:00
5cfcf10a8b Migrate configuration and command tests to native inspection 2026-11-22 05:16:24 +00:00
21bcb4eb3b Migrate assembled spell and catalog contracts to native correction 2026-11-22 05:07:00 +00:00
5e68b74469 Exercise production CLI contracts through native loaders and providers 2026-11-22 05:01:09 +00:00
572b267c5d Migrate combat and grounded pipeline integration tests to native execution 2026-11-22 04:54:27 +00:00
562dfad5cd Migrate ordered NPC and location handoff tests to native execution 2026-11-22 04:45:39 +00:00
0ad73ff575 Exercise spell and NPC integration through native providers and published artifacts 2026-11-22 04:39:55 +00:00
20c0975d9d Move cross-family runner contracts into module integration tests 2026-11-22 04:33:28 +00:00
93d94fdd0a Migrate framework tests to native producer and artifact contracts 2026-11-22 04:28:48 +00:00
0b46f2d37c Remove retired runtime wrappers and persistent cache machinery 2026-11-22 04:19:23 +00:00
a8d256f676 Report completed runs through native presentation and preserve failure outcomes 2026-11-22 04:05:44 +00:00
0cbc2b39cb Wire native pipeline run commands and invocation-wide overrides 2026-11-22 03:51:08 +00:00
2a9c5a6075 Add offline pipeline inspection and shared native resource preflight 2026-11-22 03:32:31 +00:00
9f66421f4f Capture native execution facts and complete scoped debug evidence 2026-11-22 03:19:43 +00:00
8680060400 Record debug evidence in one run-scoped capture session 2026-11-22 02:49:48 +00:00
584b041e57 Publish domain artifacts without reporting sidecars 2026-11-22 02:34:40 +00:00
3b1b4c9bcf Unify chunk-plan caching and remove checkpoint execution paths 2026-11-22 02:24:45 +00:00
36906cb3d1 Cache final typed producer artifacts under the initial native request hash 2026-11-22 02:10:05 +00:00
3ef55b1cf0 Add a best-effort accepted-artifact filesystem cache 2026-11-22 01:52:21 +00:00
37e0753472 Format migrated worker fields in integration fixtures 2026-11-22 01:45:48 +00:00
9a527b77c4 Unify ready pipeline jobs under one worker pool and remove the global LLM scheduler 2026-11-22 01:45:31 +00:00
b47208bd57 Make production registration asset-free and verify direct deterministic execution 2026-11-22 01:35:23 +00:00
433ed420f8 Migrate scene descriptions to native correction with invariant-preserving final fallbacks 2026-11-22 01:26:49 +00:00
3fa593362d Migrate enemy events to native correction with fixed multi-artifact grounding 2026-11-22 01:20:46 +00:00
bb3153c1ad Migrate combat turns to native correction and retain deterministic scene gating 2026-11-22 01:13:57 +00:00
1fe231b6fb Migrate item occurrences to native correction while preserving holder semantics 2026-11-22 01:08:02 +00:00
2c1d727232 Migrate NPC and location occurrences to native correction and explicit empty fallbacks 2026-11-22 01:03:06 +00:00
303d6589c5 Migrate registry extraction to native correction and explicit empty fallbacks 2026-11-22 00:50:54 +00:00
5d3696d4a0 Migrate combat semantics validation to native execution and unavailable assessments 2026-11-22 00:42:20 +00:00
52a1c96327 Migrate scene planning to native continuation and whole-source fallback 2026-11-22 00:34:33 +00:00
4f82d01534 Migrate NPC and location normalization to native correction and explicit fallback handling 2026-11-22 00:27:34 +00:00
772b8619c1 Migrate item normalization to native correction and explicit fallback handling 2026-11-22 00:17:58 +00:00
2348730820 Separate reconciliation preparation and proposal assessment from native execution 2026-11-22 00:07:05 +00:00
92c2382806 Migrate spell extraction to native execution and semantic continuation 2026-11-22 00:02:13 +00:00
923cbe594f Bind runner assessment and propagate fallback reuse eligibility 2026-11-21 23:48:51 +00:00
44e4fb92c2 Run typed producers through native continuation and assessment 2026-11-21 23:30:45 +00:00
c56c7d7ee9 Centralize candidate assessment and explicit producer fallback handling 2026-11-21 23:20:17 +00:00
797320b4da Define typed producer assessment and native execution dependencies 2026-11-21 23:12:01 +00:00
b899ee32a6 Install native PromptKit diagnostics and reusable execution overrides 2026-11-21 23:02:57 +00:00
91869ba191 Compose native application commands and shared configuration scopes 2026-11-21 22:59:46 +00:00
a1c888d2cd Share one native application configuration load and captured engine 2026-11-21 22:56:14 +00:00
a0274e154b Declare embedded prompts profiles and schemas with native kit resources 2026-11-21 22:52:46 +00:00
87d362e2d7 Validate pipeline controls in the typed validation callback 2026-11-21 22:49:53 +00:00
40fbcc61b1 Resolve producer modes turn allowances cache controls and shared workers 2026-11-21 22:49:41 +00:00
cc14a7a5cc Load native PromptKit settings through application configuration version six 2026-11-21 22:42:35 +00:00
bd30e86c0d Select native kit releases and update dependency attribution 2026-11-21 22:39:39 +00:00
c480ad68a1 Plan the native PromptKit and CommandKit migration 2026-11-21 22:24:16 +00:00
b3664d5879 Clarify roadmap consistency before native implementation 2026-11-21 21:58:06 +00:00
3f51764f1e Update native migration roadmap for reviewed upstream releases 2026-11-21 21:51:23 +00:00
5359cba98d Resolve completion reporting and publication contracts 2026-11-21 02:36:14 +00:00
058703abe5 Resolve unified cache configuration and legacy migration 2026-11-20 18:59:02 +00:00
254401e5f6 Resolve shared worker pool and native admission policy 2026-11-20 17:32:50 +00:00
1292ed8c4b Resolve mode precedence and whole-transcript fallback 2026-11-20 16:19:23 +00:00
baec913ef5 Select strict mode as the universal pipeline default 2026-11-20 16:13:27 +00:00
89a5398771 Define strict and permissive outcomes with module fallbacks 2026-11-20 16:07:55 +00:00
498f468f4f Resolve removal of generic non-LLM retries 2026-11-20 15:38:21 +00:00
e737167730 Set semantic turn defaults and delegate structural repair upstream 2026-11-20 15:34:05 +00:00
b904021138 Resolve native correction prompts and validator guidance ownership 2026-11-20 14:42:26 +00:00
2d69c26813 Consolidate migration planning into the master roadmap 2026-11-20 13:06:52 +00:00
f883316d7a Resolve native module execution and pipeline assessment design 2026-11-20 12:57:33 +00:00
0833450c71 Resolve native prompt asset and schema design 2026-11-20 12:45:00 +00:00
2eaea2b1fd Consolidate the native migration roadmap and simplified cache design 2026-11-20 03:42:51 +00:00
c03d0bb987 Simplify the planned artifact output and completion report 2026-11-20 03:28:14 +00:00
305a88e8f4 Replace checkpoint proposals with accepted-artifact caching 2026-11-20 03:10:16 +00:00
98ba7e1f55 Define empty debug directory as disabling capture 2026-11-20 01:10:58 +00:00
1601b535ff Settle debug capture inventory and depth 2026-11-20 00:56:29 +00:00
cbf3d1acc2 Clarify settled CommandKit decisions and remaining choices 2026-11-20 00:51:58 +00:00
3c73ccfad0 Record CommandKit verification and migration plan 2026-11-20 00:48:29 +00:00
d9e1d1e4a7 Prioritize convenient debug representations 2026-11-19 19:07:57 +00:00
5618adea8e Record debug bundle organization and latest symlink 2026-11-19 18:55:24 +00:00
9c4c2fc88d Select temporary debug directory default 2026-11-19 18:47:12 +00:00
d11d379bd4 Clarify debug defaults and operator data handling 2026-11-19 18:38:43 +00:00
a299869fcc Record conditional debug capture and diagnostic design 2026-11-19 18:27:51 +00:00
27081bc0af Record native reporting machine output and outcomes 2026-11-19 18:13:08 +00:00
6fa520f8f3 Record native composition loaders and preflight design 2026-11-19 18:05:41 +00:00
5cdbc5400f Record native run alias for pipeline execution 2026-11-19 17:47:40 +00:00
b038cc1a59 Record native pipeline commands and input conventions 2026-11-19 16:19:48 +00:00
93dd406459 Record CommandKit versions and standard capability scope 2026-11-19 16:04:23 +00:00
b04fe98c9e Record full CommandKit-native CLI cutover direction 2026-11-19 15:55:46 +00:00
8feece01db Start CommandKit migration discussion notepad 2026-11-19 15:51:31 +00:00
d17d261d62 Rewrite roadmap for PromptKit-native architecture 2026-11-19 15:27:08 +00:00
12eeb6369e Record simpler PromptKit-native application design 2026-11-19 15:17:38 +00:00
3fb8cb7392 Record inspection and execution bookkeeping ownership 2026-11-19 14:59:56 +00:00
3e1abc7fbb Record simpler checkpoint reuse policy 2026-11-19 14:49:36 +00:00
40cd4fe97d Record agreement to retire the global LLM scheduler 2026-11-18 20:04:48 +00:00
ae8e3ec698 Record agreement on native continuation and retry ownership 2026-11-18 19:54:55 +00:00
8fb21b7dae Record native continuation direction and retry simplifications 2026-11-18 19:48:00 +00:00
5a527c789d Record Audita PromptKit workflow review and architectural implications 2026-11-18 19:10:53 +00:00
abecb349e4 Record agreement on native prompt assembly and deferred schema decisions 2026-11-18 19:04:45 +00:00
defe123955 Outline native PromptKit asset assembly for discussion 2026-11-18 19:00:55 +00:00
69c4054eea Record the PromptKit-native architectural direction 2026-11-18 18:58:21 +00:00
af250eb72f Add PromptKit architecture discussion notepad 2026-11-18 18:52:49 +00:00
0ef079610e Defer operator diagnostics to CommandKit 2026-11-18 18:38:34 +00:00
d1d2394729 Define the offline preflight boundary 2026-11-18 15:28:38 +00:00
63e26dc203 Use PromptKit companion files and namespaced defaults 2026-11-18 15:21:56 +00:00
fe44b12073 Draft the PromptKit upgrade roadmap 2026-11-18 15:09:05 +00:00
65b8e8f0a2 Retire the completed ConfigKit upgrade plans 2026-11-18 14:31:30 +00:00
76364a7b7e Cache source directories during configuration normalization 2026-11-18 00:36:26 +00:00
1c93aa0947 Verify record inheritance through pipeline resolution 2026-11-18 00:32:13 +00:00
1febd2edfa Clarify native imported step ordering 2026-11-18 00:31:11 +00:00
5e269f9760 Distinguish mapping and record inheritance syntax 2026-11-18 00:30:57 +00:00
fb58aef8c2 Restore the accepted workload profile decision text 2026-11-18 00:30:41 +00:00
3f9727d5e8 Clarify PromptKit capture and preparation behavior 2026-11-18 00:30:24 +00:00
0663fe566a Validate explanation pointers before loading configuration 2026-11-18 00:29:56 +00:00
347ef05b41 Compose application assets in one strict group 2026-11-18 00:28:45 +00:00
068a4b1b5a Record ConfigKit source lookup scaling opportunity 2026-11-18 00:25:26 +00:00
b396581d21 Record ConfigKit inheritance integration findings 2026-11-17 23:52:27 +00:00
6f0a75e7cf Record ConfigKit upgrade review findings 2026-11-17 22:05:49 +00:00
d88a01cec0 Clarify native ConfigKit discovery in the roadmap 2026-11-17 21:59:54 +00:00
c9744ad2e6 Complete ConfigKit upgrade verification 2026-11-17 21:00:27 +00:00
74e0f454e9 Document ConfigKit integration and dependency attribution 2026-11-17 20:58:22 +00:00
244f258413 Document native configuration and toolchain requirements 2026-11-17 20:56:06 +00:00
5bab35f096 Compose the complete example from native step fragments 2026-11-17 20:54:47 +00:00
8136b4814f Verify configuration discovery and provenance 2026-11-17 20:53:07 +00:00
349ace0528 Delegate configuration discovery to ConfigKit 2026-11-17 20:51:06 +00:00
716bc62991 Update configuration fixtures for native composition 2026-11-17 20:50:07 +00:00
61ceab786c Compose pipeline steps using native identities 2026-11-17 20:48:05 +00:00
2d1fa57d9b Preserve source paths during field normalization 2026-11-17 20:44:07 +00:00
6da4d070e5 Migrate application configuration to the new ConfigKit API 2026-11-17 20:42:25 +00:00
ae0e410875 Select the ConfigKit upgrade toolchain and dependencies 2026-11-17 20:39:48 +00:00
79088a3546 Plan the ConfigKit native configuration upgrade 2026-11-17 20:35:04 +00:00
2c8b63187c Adopt native configuration search precedence in the roadmap 2026-11-17 20:27:56 +00:00
2b278c4074 Settle the ConfigKit upgrade scope and decisions 2026-11-17 20:25:26 +00:00
db32d31708 Plan adoption of current ConfigKit configuration semantics 2026-11-17 20:19:32 +00:00
b9899ea3cc Update adopted policies to the current upstream standard 2026-11-17 20:09:48 +00:00
66fa5585c1 Clarify ConfigKit configuration ownership 2026-10-04 18:58:10 +00:00
e690cae24f Record PromptKit migration review findings 2026-10-04 15:24:35 +00:00
6700ed2188 Complete PromptKit migration verification 2026-10-04 14:17:30 +00:00
4aba4f5672 Document PromptKit configuration ownership and capture 2026-10-04 14:12:11 +00:00
169a94f7ea Document PromptKit source composition and deployment 2026-10-04 14:04:32 +00:00
db8acbea43 Add resolved PromptKit profile inspection 2026-10-04 13:54:17 +00:00
79154882b8 Add scoped PromptKit configuration reports 2026-10-04 13:47:00 +00:00
c848befb53 Expose provider-neutral PromptKit inspection 2026-10-04 13:26:54 +00:00
a904e4d841 Verify PromptKit content origins and capture lifetime 2026-10-04 13:15:40 +00:00
7ea9fe12b9 Protect captured PromptKit checkpoint identity 2026-10-04 13:08:56 +00:00
deaa3560bc Capture immutable PromptKit configuration identity 2026-10-04 12:59:29 +00:00
ef504eabb2 Test native PromptKit source composition and credential policy 2026-10-04 12:46:23 +00:00
ec2ac3369b Migrate CLI and module tests to keyed PromptKit sources 2026-10-04 12:29:55 +00:00
8a8ca6d83c Migrate LLM fixtures to keyed PromptKit sources 2026-10-04 12:15:26 +00:00
30509f9d33 Use unified PromptKit sources for execution and preflight 2026-10-04 12:00:15 +00:00
28aab5e9a4 Upgrade PromptKit and assemble native configuration sources 2026-10-04 11:57:31 +00:00
ea403c8094 Migrate PromptKit definition assets to keyed format 2026-10-04 11:48:45 +00:00
f5b066beee Plan the PromptKit upgrade and configuration inspection 2026-10-04 11:38:01 +00:00
aae01a59ce Add operator-facing PromptKit inspection to the roadmap 2026-10-04 11:13:33 +00:00
71cf084e8b Adopt native PromptKit configuration capabilities in the roadmap 2026-10-04 11:11:40 +00:00
e327a5eef7 Plan the PromptKit configuration upgrade 2026-10-04 00:34:43 +00:00
af62b3bacc Include transcript input in the development command example 2026-10-04 00:24:04 +00:00
e1097cc7a5 Make inherited path tests distinguish source directories 2026-10-04 00:22:13 +00:00
3f226c91d0 Record ConfigKit inheritance review findings 2026-10-04 00:18:32 +00:00
64509947df Complete ConfigKit inheritance implementation 2026-10-03 18:17:28 +00:00
29c7c165a5 Add development pipeline inheritance example 2026-10-03 18:15:12 +00:00
4ef69314e1 Exercise inherited pipeline CLI behavior 2026-10-03 18:08:07 +00:00
1d1434b118 Retain inherited configuration inspection provenance 2026-10-03 18:03:40 +00:00
f4779fede9 Preserve inherited reference path origins 2026-10-03 17:58:48 +00:00
01c08ec8e4 Preserve inherited presence and validation 2026-10-03 17:55:58 +00:00
d7ea0fd32d Add pipeline inheritance coverage and guidance 2026-10-03 17:49:28 +00:00
ec99d48619 Upgrade ConfigKit to v0.5.0 2026-10-03 17:44:58 +00:00
9e74df0b6e Plan the ConfigKit inheritance upgrade 2026-10-03 17:33:13 +00:00
6e5e277426 Plan ConfigKit inheritance support 2026-10-03 17:16:41 +00:00
9790579b51 Prepare Notarius v0.8.1 source release 2026-09-28 03:04:04 +00:00
122f36bc68 Update ConfigKit and PromptKit to their latest patches 2026-09-28 02:31:31 +00:00
90c68dd725 Verify policy adoption and refine notice scope 2026-09-28 01:47:00 +00:00
b0085a1c3b Complete dependency notices and attribution links 2026-09-28 01:43:24 +00:00
eff69683d2 Attribute selected kits and backend catalogs 2026-09-28 01:38:01 +00:00
d4feccc456 Align architecture and source release policies 2026-09-28 01:35:01 +00:00
21c07d4ef0 Align general policies and contributor guidance 2026-09-28 01:32:50 +00:00
d9f8ff8179 Establish policy provenance and licensing notices 2026-09-28 01:31:08 +00:00
f6d7c7cef4 Plan the policy alignment work 2026-09-28 01:13:52 +00:00
ff9b05077c Update the policy alignment roadmap 2026-09-28 01:10:25 +00:00
1301c445bb Update kit dependencies and licensing references 2026-09-26 22:02:41 +00:00
7a7f12142f Plan licensing policy and attribution updates 2026-09-26 20:47:11 +00:00
658de79e96 Fix license name typos in COPYRIGHT 2026-09-26 20:38:50 +00:00
fc752b5860 Update COPYRIGHT and LICENSE contents to align with the house standard 2026-09-26 15:02:11 -05:00
44eba766d6 Prepare version 0.8.0 release 2026-09-26 01:36:32 +00:00
f1566d557c Verify retry accounting and execution summary propagation 2026-09-26 01:07:31 +00:00
1d29b321dd Record remaining kit upgrade verification work 2026-09-25 23:59:43 +00:00
7ac9d94f10 Verify ConfigKit and PromptKit upgrades 2026-09-25 22:04:55 +00:00
227c05b154 Document retry composition and preserve error summaries 2026-09-25 22:03:50 +00:00
b09ce47d4a Record execution summaries in debug artifacts 2026-09-25 22:02:56 +00:00
6b8a4408c1 Add LLM execution summaries 2026-09-25 22:01:16 +00:00
bd83255a8e Preserve LLM generation failure metadata 2026-09-25 21:59:15 +00:00
10ac29d149 Configure PromptKit transient retries 2026-09-25 21:56:29 +00:00
d29a5cecd3 Upgrade PromptKit runtime baseline 2026-09-25 21:49:44 +00:00
31b48d2d5e Rename configuration selection to overlays 2026-09-25 21:46:35 +00:00
8c0e93143f Plan the ConfigKit and PromptKit upgrade implementation 2026-09-25 21:05:02 +00:00
f0abc5d220 Plan ConfigKit and PromptKit upgrades 2026-09-25 20:56:46 +00:00
acec6dc15e Simplify source releases with one guarded publication command 2026-09-25 20:33:19 +00:00
cee254651f Align architecture documentation and testing policies with current standards 2026-09-25 20:26:34 +00:00
cc51b8470a Establish a dedicated agent policy 2026-09-25 20:25:36 +00:00
53d9284f0b Upgrade PromptKit and prepare version 0.7.1 2026-09-22 14:31:55 +00:00
4e77725b24 Prepare version 0.7.0 and retire completed configuration plans 2026-09-14 00:54:22 +00:00
c02eec74dd Update the validator example for version 5 configuration 2026-09-14 00:42:35 +00:00
6107adb140 Identify configuration source files in load errors 2026-09-14 00:41:41 +00:00
9c5e19c225 Preserve explicit worker counts when normalizing keys 2026-09-14 00:40:40 +00:00
04da64fe32 Validate explicit configuration branches before conversion 2026-09-14 00:39:47 +00:00
5f7923c758 Record configuration normalization at sequence boundaries 2026-09-14 00:38:50 +00:00
3010a918dc Finalize ConfigKit architecture documentation 2026-09-13 17:26:57 +00:00
19f1979bac Add composed development configuration example 2026-09-13 17:24:55 +00:00
339908c1e4 Remove legacy configuration machinery 2026-09-13 17:23:00 +00:00
467bbba3e1 Add configuration inspection commands 2026-09-13 17:16:06 +00:00
92a6a4985a Switch commands to ConfigKit configuration 2026-09-13 17:12:56 +00:00
d809085406 Prepare ConfigKit validation and listing commands 2026-09-13 16:51:46 +00:00
bb922f19d9 Prepare CLI loading for ConfigKit configuration 2026-09-13 16:50:40 +00:00
320de32a61 Resolve ConfigKit paths from declaration origins 2026-09-13 16:48:44 +00:00
69295d72c9 Publish redacted ConfigKit effective configuration 2026-09-13 16:43:32 +00:00
d770e19c17 Accept ConfigKit integers in module options 2026-09-13 16:41:14 +00:00
cf17dd7bd0 Convert ConfigKit documents to runtime configuration 2026-09-13 16:39:33 +00:00
9c247cf3a2 Validate ConfigKit pipeline documents 2026-09-13 16:35:46 +00:00
b1cd919605 Apply ConfigKit operational configuration defaults 2026-09-13 16:26:18 +00:00
b822e7f510 Add ConfigKit version 5 document boundary 2026-09-13 16:18:30 +00:00
c403a38b50 Update ConfigKit adoption plan for version 0.3.0 2026-09-13 15:49:26 +00:00
00972e8d48 Plan ConfigKit adoption and clarify implementation policy 2026-09-12 02:39:03 +00:00
946fa10764 Verify deployment-managed cache permissions 2026-09-11 15:06:29 +00:00
d2afa9dbd2 Document deployment-managed cache permissions 2026-09-11 15:04:54 +00:00
7498fda030 Apply deployment permissions to checkpoints 2026-09-11 15:03:39 +00:00
ea503acd42 Respect deployment permissions for chunk plans 2026-09-11 15:01:01 +00:00
153b1e4689 Add deployment-managed cache writer 2026-09-11 14:59:27 +00:00
7d9adc77ee Plan deployment-managed cache permissions 2026-09-11 14:24:51 +00:00
77ae132e56 Prepare the v0.6.0 release 2026-08-29 12:46:18 +00:00
deebc89255 Make command line references pipeline scoped 2026-08-29 12:34:31 +00:00
f208dbe954 Make combat scene validation more reliable 2026-08-29 11:39:02 +00:00
7e626753bf Clarify semantic reconciliation candidate numbers 2026-08-29 03:16:24 +00:00
917d150279 Improve D&D validation reliability 2026-08-29 01:24:45 +00:00
4da9360d74 Improve semantic reconciliation retries 2026-08-28 18:25:00 +00:00
5cab4e512e Improve item occurrence holder corrections 2026-08-28 14:37:22 +00:00
b178f1c684 Repair reversed D&D evidence ranges 2026-08-28 13:45:21 +00:00
a2610757cd Polish combat scene validation 2026-08-28 02:26:14 +00:00
3ad34956c5 Complete combat semantics validator verification 2026-08-28 00:24:35 +00:00
22e6caa2a0 Document combat semantics validator evaluation 2026-08-28 00:23:50 +00:00
9cb7462800 Test combat semantics correction flow 2026-08-28 00:22:56 +00:00
87385b7e14 Register optional combat semantics validator 2026-08-28 00:20:59 +00:00
0ae5ea7637 Implement combat semantics validator 2026-08-28 00:19:49 +00:00
6bc883dfb6 Add combat semantics validator prompt assets 2026-08-28 00:16:23 +00:00
fcfff3ad15 Extract shared D&D combat policy 2026-08-28 00:13:44 +00:00
0f2b23dce1 Plan combat scene validation 2026-08-27 23:26:59 +00:00
61436d7c18 Prepare the v0.5.0 release 2026-08-27 19:05:13 +00:00
079d5af337 Harden diagnostic handling and warning presentation 2026-08-27 18:41:59 +00:00
1025001f20 Complete diagnostic migration verification 2026-08-27 16:54:05 +00:00
da14924a02 Document diagnostic ownership and classification 2026-08-27 16:52:58 +00:00
2065a8288b Align debug summaries with diagnostics 2026-08-27 16:51:56 +00:00
af0119cc1d Add diagnostic counts to run receipts 2026-08-27 16:50:32 +00:00
54de2b816a Publish grouped warning and diagnostic files 2026-08-27 16:43:09 +00:00
4dbbf68051 Finalize structured diagnostic aggregation 2026-08-27 16:40:17 +00:00
480680b257 Classify remaining D&D producer diagnostics 2026-08-27 16:04:32 +00:00
6a1fd7bdb6 Classify registry normalization diagnostics 2026-08-27 15:57:29 +00:00
ccba2ce3f9 Classify source relatedness as data-quality advisories 2026-08-27 15:49:53 +00:00
1f1967c8d2 Persist diagnostics in reusable pipeline state 2026-08-27 15:40:45 +00:00
5175cb0722 Classify framework process diagnostics 2026-08-27 15:33:13 +00:00
ba569594a1 Transport structured diagnostics through the pipeline 2026-08-27 15:29:10 +00:00
acb04954eb Add diagnostic contract primitives 2026-08-27 15:19:56 +00:00
610dd3d7c3 Plan warning and diagnostic reform 2026-08-27 15:06:43 +00:00
e92bcfa74c Prepare the v0.4.0 release 2026-08-27 13:30:24 +00:00
e6b2ae88d2 Strengthen validation retries and checkpoint safety 2026-08-27 11:50:37 +00:00
b2e83bd6e7 Document feedback-aware validation retries 2026-08-27 01:35:23 +00:00
7f01c3e79e Add durable validation provenance 2026-08-27 01:27:25 +00:00
7b5f4ebd42 Apply validation retries to merge and normalize 2026-08-27 01:13:32 +00:00
4bb4582695 Integrate extraction validation retries 2026-08-27 01:06:17 +00:00
7d3434e5f6 Expose typed validation reports 2026-08-27 00:37:20 +00:00
29872b2e28 Integrate chunk validation retries 2026-08-27 00:35:37 +00:00
b487d93186 Add producer attempt state machine 2026-08-27 00:27:27 +00:00
8dd7a4324d Execute complete validator chains 2026-08-27 00:18:16 +00:00
04ba87e174 Enable correction-aware semantic reconciliation 2026-08-27 00:08:05 +00:00
a26d6ed042 Enable correction-aware downstream D&D extractors 2026-08-26 23:59:05 +00:00
759d32403f Enable correction-aware foundational D&D producers 2026-08-26 23:55:23 +00:00
1a7b20c766 Adapt corrections through PromptKit 2026-08-26 23:50:24 +00:00
85a5b52be7 Declare producer correction capability 2026-08-26 23:42:11 +00:00
9d0faabf61 Add validation policy configuration 2026-08-26 23:34:06 +00:00
1c3da3e869 Add feedback-aware correction contracts 2026-08-26 23:24:20 +00:00
9abd93502f Upgrade PromptKit to v0.9.0 2026-08-26 23:12:16 +00:00
c8a29a5fa2 Plan feedback-aware validation retries 2026-08-26 18:51:36 +00:00
916d9210fd Preserve structured repair settings across pipeline boundaries 2026-08-25 23:46:52 +00:00
3d3f16db4a Enable structural output repair by default 2026-08-25 20:04:56 +00:00
63c397d86a Resolve structured output repair configuration 2026-08-25 19:55:39 +00:00
9a92212632 Add structured output repair configuration 2026-08-25 19:47:42 +00:00
0ef8931697 Forward repair policy from D&D modules 2026-08-25 19:40:44 +00:00
e00cc45c6b Propagate structured repair requests 2026-08-25 19:39:04 +00:00
ab9b743df6 Add structured output repair support 2026-08-25 19:35:27 +00:00
3bd3c7ebf7 Classify PromptKit generation errors safely 2026-08-25 19:34:27 +00:00
75a3f51cee Support inherited PromptKit profiles 2026-08-25 19:31:00 +00:00
2be999ebd3 Verify PromptKit compatibility boundaries 2026-08-25 19:27:34 +00:00
32fe7c5b98 Upgrade PromptKit to v0.8.0 2026-08-25 19:25:57 +00:00
55247c47ab Plan the PromptKit 0.8 upgrade 2026-08-25 19:11:30 +00:00
5e5c69bf9d Document future validation and retry work 2026-08-25 14:29:00 +00:00
b4a81f8b09 Validate release versions before tagging 2026-08-25 02:21:46 +00:00
adfed22e1a Complete source release system verification 2026-08-25 02:05:17 +00:00
75b1e2f68b Document source release deployment 2026-08-25 02:03:11 +00:00
4473363d9f Document source release procedure 2026-08-25 02:01:52 +00:00
6eb45e0003 Add release tag validation workflow 2026-08-25 01:58:29 +00:00
0585ad76dc Add source release candidate checks 2026-08-25 01:57:10 +00:00
56145c3b7e Add build version reporting 2026-08-25 01:55:09 +00:00
a478fd86c5 Plan source-only releases 2026-08-25 01:48:16 +00:00
916532100d Add D&D consumer documentation 2026-08-09 20:57:28 +00:00
694 changed files with 41797 additions and 39836 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@ notarius
notarius-output notarius-output
workspace/ workspace/
.codebase-memory/ .codebase-memory/
/.releasekit/
# ---> Go # ---> Go
# If you prefer the allow list template instead of the deny list, see community template: # If you prefer the allow list template instead of the deny list, see community template:

55
.woodpecker/release.yml Normal file
View File

@@ -0,0 +1,55 @@
matrix:
include:
- GO_IMAGE: golang:1.27.0
when:
- event: tag
ref: refs/tags/v*
steps:
- name: deliver
image: ${GO_IMAGE}
environment:
RELEASEKIT_GITEA_TOKEN:
from_secret: releasekit_gitea_token
commands:
- |
set -eu
test -n "$${CI_COMMIT_TAG}"
test -n "$${CI_COMMIT_SHA}"
git check-ref-format "refs/tags/$${CI_COMMIT_TAG}"
git fetch origin "refs/tags/$${CI_COMMIT_TAG}:refs/tags/$${CI_COMMIT_TAG}"
tag_commit=$(git rev-parse --verify "refs/tags/$${CI_COMMIT_TAG}^{commit}")
expected_commit=$(git rev-parse --verify "$${CI_COMMIT_SHA}^{commit}")
if [ "$${tag_commit}" != "$${expected_commit}" ]; then
printf 'Tag %s resolves to commit %s; event %s resolves to commit %s\n' \
"$${CI_COMMIT_TAG}" "$${tag_commit}" "$${CI_COMMIT_SHA}" "$${expected_commit}" >&2
exit 1
fi
git checkout --detach "$${tag_commit}"
test "$(git rev-parse HEAD | tr '[:upper:]' '[:lower:]')" = "$${expected_commit}"
test -z "$(git status --porcelain --untracked-files=all)"
bootstrap_dir=$(mktemp -d "$${CI_WORKSPACE%/*}/.releasekit-bootstrap.XXXXXX")
trap 'rm -rf "$${bootstrap_dir}"' EXIT
cp go.mod "$${bootstrap_dir}/releasekit.mod"
if [ -f go.sum ]; then
cp go.sum "$${bootstrap_dir}/releasekit.sum"
else
: > "$${bootstrap_dir}/releasekit.sum"
fi
export GOWORK=off
export GOTOOLCHAIN=local
releasekit_host_os=$(go env GOHOSTOS) || exit $?
releasekit_host_arch=$(go env GOHOSTARCH) || exit $?
export GOOS="$${releasekit_host_os}" GOARCH="$${releasekit_host_arch}"
releasekit_module=go.maximumdirect.net/releasekit
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -m "$${releasekit_module}"
go mod edit -modfile="$${bootstrap_dir}/releasekit.mod" -tool="$${releasekit_module}/cmd/releasekit"
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -deps "$${releasekit_module}/cmd/releasekit" > /dev/null
go tool -modfile="$${bootstrap_dir}/releasekit.mod" "$${releasekit_module}/cmd/releasekit" ci-deliver \
--repo "$${CI_WORKSPACE}" \
--prepared \
--commit "$${expected_commit}" \
"$${CI_COMMIT_TAG}"

View File

@@ -1,2 +1,6 @@
Please review `docs/development.md` for initial orientation in this repository Start with `docs/development.md` for orientation and use its policy reading guide
and follow its task-specific reading guide. to select the policies applicable to the task. Do not read the entire suite by
default.
Read and follow `docs/policy/agents.md` before recommending, planning, or
implementing repository changes.

23
COPYRIGHT Normal file
View File

@@ -0,0 +1,23 @@
Notarius
Copyright (C) 2026 Eric Rakestraw
SPDX-License-Identifier: GPL-3.0-or-later
Notarius is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The GNU General Public License version 3 is provided in LICENSE.
Policy material copied or adapted from Standard Repository Policies remains
licensed under CC-BY-SA-4.0. See docs/oss/attribution.md for the affected
portions, upstream credit, and license links.
Notarius is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Third-party code and assets are subject to their respective license terms.

646
LICENSE
View File

@@ -1,232 +1,674 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works. The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow. The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS TERMS AND CONDITIONS
0. Definitions. 0. Definitions.
“This License” refers to version 3 of the GNU General Public License. "This License" refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. "The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program. A "covered work" means either the unmodified Program or a work based
on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code. 1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source for a work in source code form is that same work. The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions. 2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law. 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies. 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions. 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date. You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms. 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms. 7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination. 8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies. 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients. 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents. 11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom. 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License. 13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License. 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty. 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability. 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16. 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
go-application-template <one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2026 eric Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
go-application-template Copyright (C) 2026 eric <program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>. You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>. The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -8,25 +8,53 @@ and spell casts.
## Quickstart ## Quickstart
Provide an OpenRouter API key through the environment, then run the maintained Set `OPENROUTER_API_KEY` in your environment, then run the maintained
minimal example: [minimal example](examples/dnd-minimal/config.yml) with its synthetic transcript:
~~~ ~~~
OPENROUTER_API_KEY=your-api-key \
go run ./cmd/notarius run dnd-session \ go run ./cmd/notarius run dnd-session \
--config examples/dnd-minimal.config.yml \ --config examples/dnd-minimal/config.yml \
--input examples/seriatim-minimal-transcript.json --input-file examples/dnd-minimal/transcript.json
~~~ ~~~
The command publishes a JSON output bundle. Its command syntax and exit This makes model calls and publishes domain JSON artifacts. Command syntax and exit
behavior are documented in the [CLI reference](docs/cli.md); configuration, behavior are documented in the [CLI reference](docs/cli.md); configuration,
credentials, and module selection are owned by the credentials, and module selection are owned by the
[configuration reference](docs/config.md). [configuration reference](docs/config.md).
For the complete ordered D&D workflow, use For the complete ordered D&D workflow, use
[the complete configuration](examples/dnd-complete.config.yml) with [the complete configuration](examples/dnd-complete/config.yml) with
[its synthetic transcript](examples/dnd-complete-transcript.json). It [its synthetic transcript](examples/dnd-complete/transcript.json). It
demonstrates all implemented D&D lanes and the supporting campaign references. demonstrates all implemented D&D lanes, ordered generated references, native
resource customization, and optional source auxiliaries. See the
[complete workflow](docs/consumers/dnd-pipeline.md) for invocation and discovery.
## Install
For releases that include binary assets, download
`notarius-<version>-linux-amd64` and `SHA256SUMS` from the corresponding
[hosted release](https://forge.maximumdirect.net/eric/notarius/releases), verify
the binary against the checksum manifest, and install it on your `PATH`.
Replace `<version>` with the chosen stable tag (for example,
`vMAJOR.MINOR.PATCH`). Historical releases may not include binary assets.
### Build From Source
Source builds require Go at or above the consumer minimum declared in
[`go.mod`](go.mod). Go 1.27.0 is required by the selected ConfigKit
dependency.
Install a pinned source release with Go:
~~~
GOWORK=off go install \
gitea.maximumdirect.net/eric/notarius/cmd/notarius@<tag>
~~~
Replace `<tag>` with a stable release tag such as `vMAJOR.MINOR.PATCH`. The
installed command's diagnostic version is described in the [CLI
reference](docs/cli.md); maintainers preparing a release should follow the
[release runbook](docs/release.md).
## Documentation ## Documentation
@@ -35,12 +63,22 @@ demonstrates all implemented D&D lanes and the supporting campaign references.
validation, and module selection. validation, and module selection.
- [Operations](docs/operations.md) — output, state, recovery, and debug - [Operations](docs/operations.md) — output, state, recovery, and debug
handling. handling.
- [Integration contracts](docs/integrations/) — Seriatim input and published - [Integration contracts](docs/integrations/) — Seriatim input, domain artifacts,
artifact formats. and native [ConfigKit](docs/integrations/pkg-configkit.md),
[PromptKit](docs/integrations/pkg-promptkit.md), and
[CommandKit](docs/integrations/pkg-commandkit.md) boundaries.
- [Subprocess consumer guide](docs/consumers/subprocess.md) — invoke Notarius - [Subprocess consumer guide](docs/consumers/subprocess.md) — invoke Notarius
from an orchestrator and consume a published result. from an orchestrator and consume a published result.
- [Complete D&D consumer guide](docs/consumers/dnd-pipeline.md) — run the full
D&D pipeline as a subprocess and discover its structured artifacts.
- [Internal overview](docs/internal/overview.md) — implemented component map - [Internal overview](docs/internal/overview.md) — implemented component map
for maintainers. for maintainers.
- [Developer guide](docs/development.md) — contributor orientation and - [Developer guide](docs/development.md) — contributor orientation and
validation guidance. validation guidance.
- [Future work](docs/roadmap/future.md) — unimplemented ideas and priorities. - [Native migration guide](docs/consumers/native-migration.md) — move existing
configurations, invocations, and consumers to the native surface.
- [Future work](docs/roadmap/future.md) — separate backlog of ideas and priorities.
Notarius is licensed under the [GPL v3.0 or later](COPYRIGHT).
[Open Source attribution notices](docs/oss/attribution.md) are available.

View File

@@ -0,0 +1,102 @@
package assets_test
import (
"bytes"
"context"
"encoding/json"
"gitea.maximumdirect.net/eric/notarius/assets"
"io/fs"
"strings"
"testing"
"go.maximumdirect.net/promptkit"
"github.com/santhosh-tekuri/jsonschema/v6"
)
func TestCombatSemanticsPromptKeepsItsSceneLocalPolicyAndInput(t *testing.T) {
_, engine := loadNativeAssets(t)
const transcript = `{"sentinel":"combat-semantics-transcript"}`
handle, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.scene_descriptions.validate_combat", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"transcript": promptkit.Inline(transcript)},
})
if err != nil {
t.Fatal(err)
}
defer handle.Discard()
details := handle.Details()
if details.SelectedProfileID != "notarius/dnd-extraction" || details.StructuredOutput == nil {
t.Fatal("native validator defaults/output contract lost")
}
var all string
for _, message := range details.Messages {
all += message.Content
if strings.Contains(message.Content, transcript) && (message.CacheControl == nil || message.CacheControl.Type != promptkit.CacheControlEphemeral) {
t.Fatal("chunk transcript native cache hint lost")
}
}
for _, content := range []string{"substantive active combat materially organizes the", "Do not judge the scene title", transcript} {
if strings.Count(all, content) != 1 {
t.Fatalf("scene-local context not rendered once: %q", content)
}
}
if _, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{PromptID: "notarius/dnd.scene_descriptions.validate_combat", APIKey: "test-only"}); err == nil {
t.Fatal("native validator accepted missing transcript")
}
}
func TestCombatSemanticsResponseSchemaRetainsClassificationAndExplanationRules(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/scene-descriptions/validate/combat-semantics/schemas/dnd_scene_combat_semantics_llm.v1.json")
if err != nil {
t.Fatalf("loadResponseSchema() error = %v, want nil", err)
}
for _, classification := range []string{"combat", "non_combat"} {
if err := validateCombatSemanticsSchema(map[string]any{"classification": classification, "explanation": "The chunk contains sustained attack exchanges."}, schema); err != nil {
t.Fatalf("valid %q classification rejected: %v", classification, err)
}
}
for _, test := range []struct {
name string
response map[string]any
}{
{name: "missing explanation", response: map[string]any{"classification": "combat"}},
{name: "missing classification", response: map[string]any{"explanation": "The chunk contains active combat."}},
{name: "unknown property", response: map[string]any{"classification": "combat", "explanation": "The chunk contains active combat.", "confidence": 1}},
{name: "wrong classification type", response: map[string]any{"classification": 1, "explanation": "The chunk contains active combat."}},
{name: "wrong explanation type", response: map[string]any{"classification": "combat", "explanation": 1}},
{name: "unsupported classification", response: map[string]any{"classification": "uncertain", "explanation": "The classification is uncertain."}},
{name: "blank explanation", response: map[string]any{"classification": "combat", "explanation": ""}},
{name: "oversized explanation", response: map[string]any{"classification": "combat", "explanation": strings.Repeat("a", 513)}},
} {
t.Run(test.name, func(t *testing.T) {
if err := validateCombatSemanticsSchema(test.response, schema); err == nil {
t.Fatal("invalid private response accepted")
}
})
}
}
func validateCombatSemanticsSchema(instance map[string]any, schemaContent []byte) error {
instanceContent, err := json.Marshal(instance)
if err != nil {
return err
}
parsedInstance, err := jsonschema.UnmarshalJSON(bytes.NewReader(instanceContent))
if err != nil {
return err
}
parsedSchema, err := jsonschema.UnmarshalJSON(bytes.NewReader(schemaContent))
if err != nil {
return err
}
compiler := jsonschema.NewCompiler()
if err := compiler.AddResource("schema.json", parsedSchema); err != nil {
return err
}
compiled, err := compiler.Compile("schema.json")
if err != nil {
return err
}
return compiled.Validate(parsedInstance)
}

176
assets/combat_turns_test.go Normal file
View File

@@ -0,0 +1,176 @@
package assets_test
import (
"context"
"encoding/json"
"io/fs"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"go.maximumdirect.net/promptkit"
)
func TestCombatPromptPairPreservesNativeContractAndFixedGrounding(t *testing.T) {
_, engine := loadNativeAssets(t)
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.combat_turns", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{
"transcript": promptkit.Inline(`{"units":[{"text":"combat-transcript-marker"}]}`),
"npc_registry": promptkit.Inline(`{"npcs":[{"name":"combat-npc-marker"}]}`),
"party": promptkit.Inline("combat-party-marker"),
"players": promptkit.Inline(" "),
"glossary": promptkit.Inline(" "),
},
})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
correction, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.combat_turns.repair", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline("Fix the actor citation.")},
})
if err != nil {
t.Fatal(err)
}
defer correction.Discard()
first, next := initial.Details(), correction.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || first.SelectedProfileID != next.SelectedProfileID || first.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, next.OutputContract) {
t.Fatal("combat native pair lost its schema/default profile")
}
var system, all string
for _, message := range first.Messages {
all += message.Content
if message.Role == "system" {
system += message.Content
}
}
for _, principle := range []string{"Unmatched actors remain permitted.", "Exclude initiative setup without a turn", "Transcript units are the only evidence", "legendary_action", "lair_action"} {
if !strings.Contains(strings.Join(strings.Fields(system), " "), principle) {
t.Fatalf("missing enduring rule %q", principle)
}
}
for _, marker := range []string{"combat-transcript-marker", "combat-npc-marker", "combat-party-marker"} {
if strings.Count(all, marker) != 1 {
t.Fatalf("fixed input repeated: %q", marker)
}
}
if len(next.Messages) != 1 || next.Messages[0].Role != "user" || !strings.Contains(next.Messages[0].Content, "Fix the actor citation.") || strings.Contains(next.Messages[0].Content, "combat-transcript-marker") {
t.Fatal("correction did not contain only findings and a replacement assignment")
}
}
func TestCombatResponseSchemaUsesPrivateShape(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/combat-turns/schemas/dnd_combat_turns_llm.v1.json")
if err != nil {
t.Fatal(err)
}
valid := validCombatResponse()
content, err := json.Marshal(valid)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("valid combat response rejected: %v", err)
}
withSourceID := validCombatResponse()
withSourceID["combat_turns"].([]any)[0].(map[string]any)["source_refs"].([]any)[0].(map[string]any)["source_id"] = "session-alpha"
content, err = json.Marshal(withSourceID)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err == nil {
t.Fatal("response schema accepted source_id, want private source-reference shape")
}
}
func TestCombatResponseSchemaLeavesNonCategoricalSemanticsToValidators(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/combat-turns/schemas/dnd_combat_turns_llm.v1.json")
if err != nil {
t.Fatal(err)
}
semanticCandidate := validCombatResponse()
turn := semanticCandidate["combat_turns"].([]any)[0].(map[string]any)
turn["actor"] = ""
ref := turn["source_refs"].([]any)[0].(map[string]any)
ref["start_unit_id"] = 0
ref["end_unit_id"] = -1
content, err := json.Marshal(semanticCandidate)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("private schema rejected non-categorical validator-owned semantics: %v", err)
}
turn["source_refs"] = []any{}
content, err = json.Marshal(semanticCandidate)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("private schema rejected empty validator-owned collections: %v", err)
}
}
func TestCombatResponseSchemaRetainsStructuralBoundary(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/combat-turns/schemas/dnd_combat_turns_llm.v1.json")
if err != nil {
t.Fatal(err)
}
for _, test := range []struct {
name string
mutate func(map[string]any)
}{
{name: "missing actor", mutate: func(turn map[string]any) { delete(turn, "actor") }},
{name: "wrong actor type", mutate: func(turn map[string]any) { turn["actor"] = 1 }},
{name: "unknown field", mutate: func(turn map[string]any) { turn["unexpected"] = true }},
{name: "missing source refs", mutate: func(turn map[string]any) { delete(turn, "source_refs") }},
{name: "unsupported turn kind", mutate: func(turn map[string]any) { turn["turn_kind"] = "unsupported" }},
} {
t.Run(test.name, func(t *testing.T) {
candidate := validCombatResponse()
test.mutate(candidate["combat_turns"].([]any)[0].(map[string]any))
content, err := json.Marshal(candidate)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err == nil {
t.Fatal("private schema accepted structurally invalid response")
}
})
}
}
func TestCombatResponseSchemaAcceptsEverySupportedTurnKind(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/combat-turns/schemas/dnd_combat_turns_llm.v1.json")
if err != nil {
t.Fatal(err)
}
for _, kind := range []string{"turn", "reaction", "legendary_action", "lair_action", "other"} {
candidate := validCombatResponse()
candidate["combat_turns"].([]any)[0].(map[string]any)["turn_kind"] = kind
content, err := json.Marshal(candidate)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("supported turn kind %q was rejected: %v", kind, err)
}
}
}
func validCombatResponse() map[string]any {
return map[string]any{
"combat_turns": []any{
map[string]any{
"actor": "Aria",
"turn_kind": "reaction",
"source_refs": []any{map[string]any{"start_unit_id": 1, "end_unit_id": 2}},
},
},
}
}

View File

@@ -0,0 +1,7 @@
Revise the previous combat-turn list using these findings:
{{ input "guidance" }}
Return the complete replacement list using the original transcript and actor
grounding. Preserve transcript chronology and include only established combat
events. Return only JSON matching the original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.combat_turns prompts:
version: "v1" - id: dnd.combat_turns
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -19,27 +19,40 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: system
content_file: ../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../shared/prompts/common-dnd-npc-registry.md
- role: user - role: system
content_file: ./sharedassets/common-dnd-npc-registry.md
- role: user
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_combat_turns_llm.v1.json schema_path: dnd/combat-turns/schemas/dnd_combat_turns_llm.v1.json
repair_attempts: 0
- id: dnd.combat_turns.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/combat-turns/schemas/dnd_combat_turns_llm.v1.json

View File

@@ -16,7 +16,8 @@
"type": "string" "type": "string"
}, },
"turn_kind": { "turn_kind": {
"type": "string" "type": "string",
"enum": ["turn", "reaction", "legendary_action", "lair_action", "other"]
}, },
"source_refs": { "source_refs": {
"type": "array", "type": "array",

View File

@@ -0,0 +1,8 @@
Revise the previous enemy-event list using these findings:
{{ input "guidance" }}
Return the complete replacement event list using the original combat transcript
and fixed contextual grounding. Include only directly established engagements and
outcomes, retaining their source evidence and chronology. Return only JSON
matching the original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.enemy_events prompts:
version: "v1" - id: dnd.enemy_events
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -25,29 +25,42 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: system
content_file: ../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../shared/prompts/common-dnd-npc-registry.md
- role: user
content_file: ./sharedassets/common-dnd-npc-registry.md
- role: user - role: user
content_file: ./combat-grounding.md content_file: ./combat-grounding.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_enemy_events_llm.v1.json schema_path: dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json
repair_attempts: 0
- id: dnd.enemy_events.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json

View File

@@ -13,7 +13,10 @@
"required": ["name", "kind", "source_refs"], "required": ["name", "kind", "source_refs"],
"properties": { "properties": {
"name": {"type": "string"}, "name": {"type": "string"},
"kind": {"type": "string"}, "kind": {
"type": "string",
"enum": ["engaged", "killed", "fled", "captured", "incapacitated"]
},
"source_refs": { "source_refs": {
"type": "array", "type": "array",
"items": { "items": {

View File

@@ -0,0 +1,7 @@
Revise the previous item occurrence list using these findings:
{{ input "guidance" }}
Return the complete replacement list using the original transcript and registry
context. Preserve stated quantities and possession changes without inventing an
item or holder. Return only JSON matching the original response contract.

View File

@@ -18,12 +18,20 @@ when the transcript explicitly describes it being physically destroyed or
expended as a non-payment component. Use `transferred` only when possession expended as a non-payment component. Use `transferred` only when possession
moves between two distinct named party members. moves between two distinct named party members.
Return both `from` and `to` for every occurrence, using `null` when a holder does not Return both `from` and `to` for every occurrence. Use JSON `null`, not an empty
apply. For `discovered`, set both holders to `null`. For `acquired`, set `from` string, whenever a holder does not apply. Follow this holder matrix exactly:
to `null` and provide `to`; for `lost` and `consumed`, provide `from` and set
`to` to `null`; and for `transferred`, provide both holders. Use `party` only | `kind` | required `from` | required `to` |
for collective or unresolved party possession, never for either side of a | --- | --- | --- |
transfer. Do not emit a transfer for a gift, sale, or payment outside the party. | `discovered` | `null` | `null` |
| `acquired` | `null` | `party` or the named party member gaining possession |
| `lost` | `party` or the named party member losing possession | `null` |
| `consumed` | `party` or the named party member consuming the item | `null` |
| `transferred` | one named party member | a different named party member |
Use `party` only for collective or unresolved party possession, never for
either side of a transfer. Do not emit a transfer for a gift, sale, or payment
outside the party.
Ordinary non-depleting use is not an occurrence. Do not infer acquisition from a Ordinary non-depleting use is not an occurrence. Do not infer acquisition from a
discovery, or discovery from an acquisition: emit both only when each is discovery, or discovery from an acquisition: emit both only when each is

View File

@@ -1,6 +1,6 @@
id: dnd.item_occurrences prompts:
version: "v1" - id: dnd.item_occurrences
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -19,27 +19,40 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: user
content_file: ./item-registry.md content_file: ./item-registry.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_item_occurrences_llm.v1.json schema_path: dnd/item-occurrences/schemas/dnd_item_occurrences_llm.v1.json
repair_attempts: 0
- id: dnd.item_occurrences.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/item-occurrences/schemas/dnd_item_occurrences_llm.v1.json

View File

@@ -13,7 +13,10 @@
"required": ["name", "kind", "quantity", "from", "to", "source_refs"], "required": ["name", "kind", "quantity", "from", "to", "source_refs"],
"properties": { "properties": {
"name": {"type": "string"}, "name": {"type": "string"},
"kind": {"type": "string"}, "kind": {
"type": "string",
"enum": ["discovered", "acquired", "lost", "consumed", "transferred"]
},
"quantity": {"type": ["integer", "null"]}, "quantity": {"type": ["integer", "null"]},
"from": {"type": ["string", "null"]}, "from": {"type": ["string", "null"]},
"to": {"type": ["string", "null"]}, "to": {"type": ["string", "null"]},

View File

@@ -0,0 +1,7 @@
Revise the previous item registry using these findings:
{{ input "guidance" }}
Return the complete replacement registry, not only the changed records. Keep the
original transcript and reference context and return only JSON matching the
original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.item_registry prompts:
version: "v1" - id: dnd.item_registry
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -16,25 +16,38 @@ inputs:
content_type: text/plain content_type: text/plain
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_item_registry_llm.v1.json schema_path: dnd/item-registry/extract/schemas/dnd_item_registry_llm.v1.json
repair_attempts: 0
- id: dnd.item_registry.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/item-registry/extract/schemas/dnd_item_registry_llm.v1.json

View File

@@ -5,5 +5,5 @@ evidence, similar objects, or a shared owner as sufficient.
Keep currency denominations and materially different item types separate. Keep Keep currency denominations and materially different item types separate. Keep
uncertain aliases separate. Do not infer an item property or uniqueness. uncertain aliases separate. Do not infer an item property or uniqueness.
When selecting a canonical display name, choose one supplied candidate name Set `canonical_candidate_number` to the supplied candidate number whose label
that is the clearest established designation. is the clearest established designation.

View File

@@ -1,6 +1,6 @@
id: dnd.item_registry.normalize prompts:
version: "v1" - id: dnd.item_registry.normalize
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: candidates - name: candidates
required: true required: true
@@ -10,21 +10,34 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../../shared/prompts/common-dnd-system.md
- role: user - role: system
content_file: ./sharedassets/protocol.md content_file: ../../../../generic/normalize/deduplication/prompts/protocol.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/candidates.md content_file: ../../../../generic/normalize/deduplication/prompts/candidates.md
- role: user - role: user
content_file: ./sharedassets/transcript-windows.md content_file: ../../../../generic/normalize/deduplication/prompts/transcript-windows.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: semantic_reconciliation_llm.v1.json schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json
repair_attempts: 0
- id: dnd.item_registry.normalize.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ../../../../generic/normalize/deduplication/prompts/correction.md
output:
format: json
validation_mode: json_schema
schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json

View File

@@ -0,0 +1,7 @@
Revise the previous location occurrence list using these findings:
{{ input "guidance" }}
Return a complete replacement occurrence list using the original transcript and
registry context. Keep identity-grounding context separate from current-transcript
evidence, and return only JSON matching the original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.location_occurrences prompts:
version: "v1" - id: dnd.location_occurrences
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -19,27 +19,40 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: user
content_file: ./location-registry.md content_file: ./location-registry.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_location_occurrences_llm.v1.json schema_path: dnd/location-occurrences/schemas/dnd_location_occurrences_llm.v1.json
repair_attempts: 0
- id: dnd.location_occurrences.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/location-occurrences/schemas/dnd_location_occurrences_llm.v1.json

View File

@@ -0,0 +1,7 @@
Revise the previous location registry using these findings:
{{ input "guidance" }}
Return the complete replacement registry, not only the changed records. Keep the
original transcript and reference context and return only JSON matching the
original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.location_registry prompts:
version: "v1" - id: dnd.location_registry
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -16,25 +16,38 @@ inputs:
content_type: text/plain content_type: text/plain
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_location_registry_llm.v1.json schema_path: dnd/location-registry/extract/schemas/dnd_location_registry_llm.v1.json
repair_attempts: 0
- id: dnd.location_registry.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/location-registry/extract/schemas/dnd_location_registry_llm.v1.json

View File

@@ -5,4 +5,5 @@ nearby evidence, nested places, or generic labels as sufficient.
Keep parent and child places separate, as well as similarly named places and Keep parent and child places separate, as well as similarly named places and
uncertain aliases. uncertain aliases.
When selecting a canonical display name, prefer the clearest established name. Set `canonical_candidate_number` to the supplied candidate number whose label
is the clearest established name.

View File

@@ -1,6 +1,6 @@
id: dnd.location_registry.normalize prompts:
version: "v1" - id: dnd.location_registry.normalize
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: candidates - name: candidates
required: true required: true
@@ -10,21 +10,34 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../../shared/prompts/common-dnd-system.md
- role: user - role: system
content_file: ./sharedassets/protocol.md content_file: ../../../../generic/normalize/deduplication/prompts/protocol.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/candidates.md content_file: ../../../../generic/normalize/deduplication/prompts/candidates.md
- role: user - role: user
content_file: ./sharedassets/transcript-windows.md content_file: ../../../../generic/normalize/deduplication/prompts/transcript-windows.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: semantic_reconciliation_llm.v1.json schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json
repair_attempts: 0
- id: dnd.location_registry.normalize.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ../../../../generic/normalize/deduplication/prompts/correction.md
output:
format: json
validation_mode: json_schema
schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json

View File

@@ -0,0 +1,7 @@
Revise the previous NPC occurrence list using these findings:
{{ input "guidance" }}
Return a complete replacement occurrence list using the original transcript and
registry context. Keep identity-grounding context separate from current-transcript
evidence, and return only JSON matching the original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.npc_occurrences prompts:
version: "v1" - id: dnd.npc_occurrences
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -19,27 +19,40 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: system
content_file: ../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../shared/prompts/common-dnd-npc-registry.md
- role: user - role: system
content_file: ./sharedassets/common-dnd-npc-registry.md
- role: user
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_npc_occurrences_llm.v1.json schema_path: dnd/npc-occurrences/schemas/dnd_npc_occurrences_llm.v1.json
repair_attempts: 0
- id: dnd.npc_occurrences.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/npc-occurrences/schemas/dnd_npc_occurrences_llm.v1.json

View File

@@ -16,7 +16,8 @@
"type": "string" "type": "string"
}, },
"kind": { "kind": {
"type": "string" "type": "string",
"enum": ["mentioned", "noncombat_presence", "dialogue", "combat_ally", "combat_opponent", "other"]
}, },
"source_refs": { "source_refs": {
"type": "array", "type": "array",

View File

@@ -0,0 +1,7 @@
Revise the previous NPC registry using these findings:
{{ input "guidance" }}
Return the complete replacement registry, not only the changed records. Keep the
original transcript and reference context and return only JSON matching the
original response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.npc_registry prompts:
version: "v1" - id: dnd.npc_registry
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -16,25 +16,38 @@ inputs:
content_type: text/plain content_type: text/plain
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_npc_registry_llm.v1.json schema_path: dnd/npc-registry/extract/schemas/dnd_npc_registry_llm.v1.json
repair_attempts: 0
- id: dnd.npc_registry.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/npc-registry/extract/schemas/dnd_npc_registry_llm.v1.json

View File

@@ -3,7 +3,8 @@ contextual labels and cited transcript windows. Preserve distinct individuals
even when their names are similar or their contextual descriptions are even when their names are similar or their contextual descriptions are
identical. identical.
When selecting a canonical display name, prefer a complete, stable proper name Set `canonical_candidate_number` to the supplied candidate number whose label
is the preferred canonical display name. Prefer a complete, stable proper name
over an abbreviation. Prefer an unadorned proper name over that name plus a over an abbreviation. Prefer an unadorned proper name over that name plus a
contextual class, role, title, or relationship descriptor unless the transcript contextual class, role, title, or relationship descriptor unless the transcript
establishes the descriptor as part of the person's name. A longer display name establishes the descriptor as part of the person's name. A longer display name

View File

@@ -1,6 +1,6 @@
id: dnd.npc_registry.normalize prompts:
version: "v1" - id: dnd.npc_registry.normalize
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: candidates - name: candidates
required: true required: true
@@ -10,21 +10,34 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../../shared/prompts/common-dnd-system.md
- role: user - role: system
content_file: ./sharedassets/protocol.md content_file: ../../../../generic/normalize/deduplication/prompts/protocol.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/candidates.md content_file: ../../../../generic/normalize/deduplication/prompts/candidates.md
- role: user - role: user
content_file: ./sharedassets/transcript-windows.md content_file: ../../../../generic/normalize/deduplication/prompts/transcript-windows.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: semantic_reconciliation_llm.v1.json schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json
repair_attempts: 0
- id: dnd.npc_registry.normalize.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ../../../../generic/normalize/deduplication/prompts/correction.md
output:
format: json
validation_mode: json_schema
schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json

View File

@@ -1,4 +1,5 @@
id: dnd-extraction profiles:
- id: dnd-extraction
backend: openrouter backend: openrouter
model: openai/gpt-5.6-luna model: openai/gpt-5.6-luna
timeout_seconds: 240 timeout_seconds: 240

View File

@@ -0,0 +1,7 @@
Revise the previous scene description using these findings:
{{ input "guidance" }}
Return one complete replacement kind, title, and summary for the original
transcript chunk. Do not change its boundary or invent details to justify a
classification. Return only JSON matching the original response contract.

View File

@@ -5,9 +5,7 @@ into multiple scenes or use facts that are not supported by it.
Return one kind, one concise title, and one concise summary. Choose exactly one Return one kind, one concise title, and one concise summary. Choose exactly one
kind: kind:
- combat: active combat materially organizes the scene, including - combat: a scene classified as combat under the shared combat policy.
initiative-like exchanges or sustained hostile action. Planning a fight or
discussing a completed fight is not combat by itself.
- narrative: current-session in-world play that is not principally active - narrative: current-session in-world play that is not principally active
combat, a prior-session recap, or sustained out-of-character session combat, a prior-session recap, or sustained out-of-character session
discussion. This includes exploration, travel, dialogue, investigation, discussion. This includes exploration, travel, dialogue, investigation,
@@ -20,15 +18,13 @@ kind:
play. play.
Narrative is the default for actual current-session gameplay that does not meet Narrative is the default for actual current-session gameplay that does not meet
another definition. When the accepted chunk is mixed: another definition. When the accepted chunk has no substantive active combat:
1. use combat when active combat is a substantive central activity, even with 1. use recap when recounting a previous session is the chunk's
brief setup, rules clarification, or immediate aftermath;
2. otherwise use recap when recounting a previous session is the chunk's
primary table purpose; primary table purpose;
3. otherwise use meta when sustained out-of-character session discussion is 2. otherwise use meta when sustained out-of-character session discussion is
primary and in-world progression is no more than incidental; and primary and in-world progression is no more than incidental; and
4. use narrative for all remaining current-session in-world play. 3. use narrative for all remaining current-session in-world play.
Brief table talk, dice resolution, rules clarification, jokes, or Brief table talk, dice resolution, rules clarification, jokes, or
administrative comments do not make a gameplay scene meta. A short recollection administrative comments do not make a gameplay scene meta. A short recollection

View File

@@ -1,6 +1,6 @@
id: dnd.scene_descriptions prompts:
version: "v1" - id: dnd.scene_descriptions
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -16,23 +16,38 @@ inputs:
content_type: text/plain content_type: text/plain
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ../../shared/prompts/common-dnd-scene-combat-policy.md
- role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_scene_descriptions_llm.v1.json schema_path: dnd/scene-descriptions/schemas/dnd_scene_descriptions_llm.v1.json
repair_attempts: 0
- id: dnd.scene_descriptions.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/scene-descriptions/schemas/dnd_scene_descriptions_llm.v1.json

View File

@@ -6,7 +6,8 @@
"required": ["kind", "title", "summary"], "required": ["kind", "title", "summary"],
"properties": { "properties": {
"kind": { "kind": {
"type": "string" "type": "string",
"enum": ["combat", "narrative", "recap", "meta"]
}, },
"title": { "title": {
"type": "string" "type": "string"

View File

@@ -0,0 +1,8 @@
Classify only whether substantive active combat occurs in the supplied
transcript chunk under the shared combat policy. Do not judge the scene title,
summary, non-combat subtype, scene boundary, or any other aspect of a scene
description.
Return `combat` when the chunk contains substantive active combat and
`non_combat` otherwise. Give a concise, transcript-grounded explanation for
the classification.

View File

@@ -0,0 +1,22 @@
prompts:
- id: dnd.scene_descriptions.validate_combat
default_profile: notarius/dnd-extraction
inputs:
- name: transcript
required: true
content_type: application/json
messages:
- role: system
content_file: ../../../../shared/prompts/common-dnd-system.md
- role: user
content_file: ../../../../shared/prompts/common-dnd-scene-combat-policy.md
- role: user
content_file: ./instructions.md
- role: user
content_file: ../../../../shared/prompts/common-dnd-transcript-chunk.md
cache_control:
type: ephemeral
output:
format: json
validation_mode: json_schema
schema_path: dnd/scene-descriptions/validate/combat-semantics/schemas/dnd_scene_combat_semantics_llm.v1.json

View File

@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "notarius.dnd.scene_descriptions.combat_semantics.llm",
"type": "object",
"additionalProperties": false,
"required": ["classification", "explanation"],
"properties": {
"classification": {
"type": "string",
"enum": ["combat", "non_combat"]
},
"explanation": {
"type": "string",
"minLength": 1,
"maxLength": 512
}
}
}

View File

@@ -0,0 +1,8 @@
Revise the previous scene-boundary plan using these findings:
{{ input "guidance" }}
Return a complete replacement scene plan for the original full transcript, not
only the changed ranges. Keep the original source-unit IDs and cover every unit
in document order without gaps or overlaps. Return only JSON matching the original
response contract.

View File

@@ -1,6 +1,6 @@
id: dnd.scenes prompts:
version: "v1" - id: dnd.scenes
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -16,19 +16,32 @@ inputs:
content_type: text/plain content_type: text/plain
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-references.md content_file: ../../shared/prompts/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-full.md content_file: ../../shared/prompts/common-dnd-transcript-full.md
cache_control: cache_control:
type: ephemeral type: ephemeral
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_scenes_llm.v1.json schema_path: dnd/scenes/schemas/dnd_scenes_llm.v1.json
repair_attempts: 0
- id: dnd.scenes.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/scenes/schemas/dnd_scenes_llm.v1.json

View File

@@ -1,6 +1,8 @@
Transcript units are the only evidence for extracted events and factual claims. Transcript units are the only evidence for extracted events and factual claims.
Every reported factual claim must be supported by cited transcript units. Use Every reported factual claim must be supported by cited transcript units. Use
integer `start_unit_id` and `end_unit_id` values from the transcript. integer `start_unit_id` and `end_unit_id` values from the transcript.
Within each range, `start_unit_id` must identify the earlier transcript unit and
`end_unit_id` the same or a later unit according to transcript order.
When supporting evidence is non-contiguous, use multiple narrow ranges rather When supporting evidence is non-contiguous, use multiple narrow ranges rather
than a broad range that bridges unrelated conversation. than a broad range that bridges unrelated conversation.

View File

@@ -0,0 +1,13 @@
Use `combat` only when substantive active combat materially organizes the
scene. Active combat includes initiative or turn exchanges, attacks, combat
spells, damage, saves, movement, or similarly sustained hostile action.
Do not use `combat` for planning or preparing for a possible fight; threats,
hostile dialogue, or a tense confrontation; immediate aftermath, looting,
healing, or discussion of a completed fight; a recap or in-world recollection
of earlier combat; or out-of-character rules discussion without active
encounter play.
When a chunk contains substantive active combat alongside brief setup, rules
clarification, interruption, phase transition, or immediate aftermath, classify
it as `combat`.

View File

@@ -0,0 +1,5 @@
Revise the previous spell-cast list using these findings:
{{ input "guidance" }}
Return the complete replacement spell-cast list under the same output contract.

View File

@@ -1,14 +1 @@
Extract Dungeons & Dragons spell-cast artifacts from the provided transcript. Extract the spell casts established by the provided transcript chunk. Return the complete spell-cast list, or an empty list when no casting event is supported.
Include an actual casting event or an unambiguous declared casting attempt.
Exclude spell mentions, hypothetical plans, rules discussion, and catalog
matches that do not establish a casting event in the transcript.
For every extracted cast, the transcript evidence must collectively support the
in-world caster, the spell, and the fact that the cast or declared attempt
occurred.
Attribute every cast to its in-world caster. Map first-person player speech to
the associated player character, and attribute a spell narrated by the GM to
the in-world creature that casts it. If the caster cannot be resolved, use only
the most specific in-world identity supported by the transcript; do not invent
a name.

View File

@@ -0,0 +1,18 @@
Extract Dungeons & Dragons spell-cast artifacts from transcript evidence.
Include an actual casting event or an unambiguous declared casting attempt.
Exclude spell mentions, hypothetical plans, rules discussion, and catalog
matches that do not establish a casting event in the transcript.
For every extracted cast, the transcript evidence must collectively support the
in-world caster, the spell, and the fact that the cast or declared attempt
occurred.
Attribute every cast to its in-world caster. Map first-person player speech to
the associated player character, and attribute a spell narrated by the GM to
the in-world creature that casts it. If the caster cannot be resolved, use only
the most specific in-world identity supported by the transcript; do not invent
a name.
The spell catalog lists each spell's canonical_name and recognized aliases.
If the transcript uses an alias, select that entry's canonical_name. Return the
canonical spelling exactly; never return an alias as a spell name.

View File

@@ -1,6 +1,6 @@
id: dnd.spells prompts:
version: "v1" - id: dnd.spells
default_profile: dnd-extraction default_profile: notarius/dnd-extraction
inputs: inputs:
- name: transcript - name: transcript
required: true required: true
@@ -22,21 +22,23 @@ inputs:
content_type: application/json content_type: application/json
messages: messages:
- role: system - role: system
content_file: ./sharedassets/common-dnd-system.md content_file: ../../shared/prompts/common-dnd-system.md
- role: system
content_file: ../../shared/prompts/common-dnd-identity.md
- role: system
content_file: ./principles.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-identity.md content_file: ../../shared/prompts/common-dnd-references.md
- role: user
content_file: ./sharedassets/common-dnd-references.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: user - role: user
content_file: ./sharedassets/common-dnd-transcript-chunk.md content_file: ../../shared/prompts/common-dnd-transcript-chunk.md
cache_control: cache_control:
type: ephemeral type: ephemeral
- role: system
content_file: ../../shared/prompts/common-dnd-extraction-evidence.md
- role: user - role: user
content_file: ./sharedassets/common-dnd-extraction-evidence.md content_file: ../../shared/prompts/common-dnd-npc-registry.md
- role: user
content_file: ./sharedassets/common-dnd-npc-registry.md
- role: user - role: user
content_file: ./spell-catalog.md content_file: ./spell-catalog.md
- role: user - role: user
@@ -46,5 +48,18 @@ messages:
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: dnd_spells_llm.v1.json schema_path: dnd/spells/schemas/dnd_spells_llm.v1.json
repair_attempts: 0
- id: dnd.spells.repair
default_profile: notarius/dnd-extraction
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: dnd/spells/schemas/dnd_spells_llm.v1.json

View File

@@ -1,6 +1,3 @@
The spell catalog for this extraction is provided below as JSON. Each entry The spell recognition catalog for this operation:
lists a `canonical_name` and its recognized `aliases`. If the transcript uses
an alias, select that entry's `canonical_name`. Return spell names using the
canonical spelling exactly; never return an alias as a spell name.
{{ input "spell_catalog" }} {{ input "spell_catalog" }}

151
assets/enemy_events_test.go Normal file
View File

@@ -0,0 +1,151 @@
package assets_test
import (
"context"
"encoding/json"
"io/fs"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"go.maximumdirect.net/promptkit"
)
func TestEnemyResponseSchemaDefinesPrivateStructuralBoundary(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json")
if err != nil {
t.Fatal(err)
}
valid := validEnemyResponse()
content, err := json.Marshal(valid)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("valid response rejected: %v", err)
}
semantic := validEnemyResponse()
event := semantic["events"].([]any)[0].(map[string]any)
event["name"] = ""
ref := event["source_refs"].([]any)[0].(map[string]any)
ref["start_unit_id"] = 0
ref["end_unit_id"] = -1
content, err = json.Marshal(semantic)
if err != nil || validateJSONSchema(content, schema) != nil {
t.Fatalf("non-categorical validator-owned semantics were rejected: %v", err)
}
}
func TestEnemyResponseSchemaRejectsInvalidStructure(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json")
if err != nil {
t.Fatal(err)
}
for _, mutate := range []func(map[string]any){
func(event map[string]any) { delete(event, "name") },
func(event map[string]any) { event["kind"] = 1 },
func(event map[string]any) { event["kind"] = "unsupported" },
func(event map[string]any) { event["unexpected"] = true },
func(event map[string]any) { event["source_refs"].([]any)[0].(map[string]any)["source_id"] = "session" },
} {
candidate := validEnemyResponse()
mutate(candidate["events"].([]any)[0].(map[string]any))
content, err := json.Marshal(candidate)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err == nil {
t.Fatal("private schema accepted structurally invalid response")
}
}
}
func TestEnemyResponseSchemaAcceptsEverySupportedKind(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json")
if err != nil {
t.Fatal(err)
}
for _, kind := range []string{"engaged", "killed", "fled", "captured", "incapacitated"} {
candidate := validEnemyResponse()
candidate["events"].([]any)[0].(map[string]any)["kind"] = kind
content, err := json.Marshal(candidate)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("supported enemy-event kind %q was rejected: %v", kind, err)
}
}
}
func validEnemyResponse() map[string]any {
return map[string]any{"events": []any{map[string]any{
"name": "Ashfang", "kind": "engaged", "source_refs": []any{map[string]any{"start_unit_id": 1, "end_unit_id": 1}},
}}}
}
func TestEnemyPromptPairRetainsRequiredGroundingAndNativeDefaults(t *testing.T) {
_, engine := loadNativeAssets(t)
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{PromptID: "notarius/dnd.enemy_events", APIKey: "test-only", Inputs: enemyEventPromptInputs()})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
correction, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.enemy_events.repair", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline("Combine the duplicate engagement evidence.")},
})
if err != nil {
t.Fatal(err)
}
defer correction.Discard()
first, next := initial.Details(), correction.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || first.SelectedProfileID != next.SelectedProfileID || first.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, next.OutputContract) {
t.Fatal("enemy-event prompt pair lost schema/defaults")
}
var system, all string
for _, message := range first.Messages {
all += message.Content
if message.Role == "system" {
system += message.Content
}
}
for _, rule := range []string{"Emit at most one", "A hostile creature without a registry entry is allowed.", "Do not infer an engagement or outcome", "Transcript units are the only evidence"} {
if !strings.Contains(strings.Join(strings.Fields(system), " "), rule) {
t.Fatalf("missing enduring rule %q", rule)
}
}
for _, marker := range []string{"enemy-transcript", "enemy-player", "enemy-party", "enemy-glossary", "enemy-npc", "enemy-turn", "enemy-opponent"} {
if strings.Count(all, marker) != 1 {
t.Fatalf("fixed grounding repeated: %q", marker)
}
}
if len(next.Messages) != 1 || next.Messages[0].Role != "user" || !strings.Contains(next.Messages[0].Content, "Combine the duplicate engagement evidence.") || strings.Contains(next.Messages[0].Content, "enemy-transcript") {
t.Fatal("correction repeated fixed inputs or omitted findings")
}
for _, name := range []string{"npc_registry", "combat_turns", "npc_occurrences"} {
missing := enemyEventPromptInputs()
delete(missing, name)
handle, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{PromptID: "notarius/dnd.enemy_events", APIKey: "test-only", Inputs: missing})
if handle != nil {
handle.Discard()
}
if err == nil || !strings.Contains(err.Error(), name) {
t.Fatalf("missing %s input=%v", name, err)
}
}
}
func enemyEventPromptInputs() map[string]promptkit.ArtifactRef {
return map[string]promptkit.ArtifactRef{
"transcript": promptkit.Inline(`{"value":"enemy-transcript"}`),
"players": promptkit.Inline("enemy-player"),
"party": promptkit.Inline("enemy-party"),
"glossary": promptkit.Inline("enemy-glossary"),
"npc_registry": promptkit.Inline(`{"npcs":[{"name":"enemy-npc"}]}`),
"combat_turns": promptkit.Inline(`{"combat_turns":[{"actor":"enemy-turn","turn_kind":"turn"}]}`),
"npc_occurrences": promptkit.Inline(`{"npc_occurrences":[{"name":"enemy-opponent","kind":"combat_opponent"}]}`),
}
}

View File

@@ -1,3 +1,3 @@
Candidate material: Candidate material, including the exact valid candidate-number range:
{{ input "candidates" }} {{ input "candidates" }}

View File

@@ -0,0 +1,6 @@
Revise the previous duplicate-entity proposal using these findings:
{{ input "guidance" }}
Return one complete replacement proposal under the original output contract.
Do not return a patch or commentary.

View File

@@ -1,5 +1,5 @@
id: generic.semantic_reconciliation prompts:
version: "v1" - id: generic.semantic_reconciliation
inputs: inputs:
- name: candidates - name: candidates
required: true required: true
@@ -10,9 +10,9 @@ inputs:
messages: messages:
- role: system - role: system
content_file: ./system.md content_file: ./system.md
- role: user - role: system
content_file: ./protocol.md content_file: ./protocol.md
- role: user - role: system
content_file: ./instructions.md content_file: ./instructions.md
cache_control: cache_control:
type: ephemeral type: ephemeral
@@ -23,5 +23,17 @@ messages:
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: semantic_reconciliation_llm.v1.json schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json
repair_attempts: 0
- id: generic.semantic_reconciliation.repair
inputs:
- name: guidance
required: true
content_type: text/plain
messages:
- role: user
content_file: ./correction.md
output:
format: json
validation_mode: json_schema
schema_path: generic/normalize/deduplication/schemas/semantic_reconciliation_llm.v1.json

View File

@@ -1,7 +1,9 @@
Use only the positive integer `candidate_id` values supplied in the candidate material. Use only the positive integer `candidate_number` values supplied in the candidate material. Valid candidate numbers are exactly the inclusive `first` through `last` values declared in `candidate_number_range`; use the explicit number attached to each candidate.
Return a duplicate group only when the evidence supports that every selected candidate describes the same underlying entity. Each group must contain at least two distinct candidate IDs, and its `canonical_candidate_id` must be one of those IDs. A candidate may appear in at most one group. Transcript unit `id` values and evidence `start_unit_id` and `end_unit_id` values identify source positions. They are not candidate numbers and must never be used in `candidate_numbers` or `canonical_candidate_number`.
Omit uncertain matches and candidates that should remain distinct. Do not invent candidates or infer an ID from list position. An empty `duplicate_groups` array is valid. Return a duplicate group only when the evidence supports that every selected candidate describes the same underlying entity. Each group must contain at least two distinct candidate numbers, and its `canonical_candidate_number` must be one of those numbers. A candidate may appear in at most one group.
The response must conform exactly to the selected JSON schema. Return IDs only: do not copy candidate names, evidence, transcript text, source identifiers, or source ranges into the response. Omit uncertain matches and candidates that should remain distinct. Do not invent candidates or infer a number that is not explicitly supplied. An empty `duplicate_groups` array is valid.
The response must conform exactly to the selected JSON schema. Return candidate numbers only: do not copy candidate names, evidence, transcript text, source identifiers, or source ranges into the response.

View File

@@ -11,9 +11,9 @@
"items": { "items": {
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": ["candidate_ids", "canonical_candidate_id"], "required": ["candidate_numbers", "canonical_candidate_number"],
"properties": { "properties": {
"candidate_ids": { "candidate_numbers": {
"type": "array", "type": "array",
"minItems": 2, "minItems": 2,
"items": { "items": {
@@ -21,7 +21,7 @@
"minimum": 1 "minimum": 1
} }
}, },
"canonical_candidate_id": { "canonical_candidate_number": {
"type": "integer", "type": "integer",
"minimum": 1 "minimum": 1
} }

View File

@@ -0,0 +1,79 @@
package assets_test
import (
"encoding/json"
"io/fs"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
)
func TestItemOccurrenceSchemaIsStrictlyStructuralAndPrivate(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/item-occurrences/schemas/dnd_item_occurrences_llm.v1.json")
if err != nil {
t.Fatal(err)
}
valid := map[string]any{"occurrences": []any{
map[string]any{
"name": "", "kind": "transferred", "quantity": 0, "from": "party", "to": "Party",
"source_refs": []any{map[string]any{"start_unit_id": 0, "end_unit_id": -1}},
},
map[string]any{
"name": "Hidden Cache", "kind": "discovered", "quantity": nil, "from": nil, "to": nil,
"source_refs": []any{map[string]any{"start_unit_id": 1, "end_unit_id": 1}},
},
}}
content, err := json.Marshal(valid)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err != nil {
t.Fatalf("private schema rejected validator-owned values: %v", err)
}
for _, test := range []struct {
name string
value map[string]any
}{
{"missing occurrences", map[string]any{}},
{"missing occurrence name", map[string]any{"occurrences": []any{itemOccurrenceWithoutField(itemOccurrenceRecord(), "name")}}},
{"missing nullable field", map[string]any{"occurrences": []any{itemOccurrenceWithoutField(itemOccurrenceRecord(), "quantity")}}},
{"missing from", map[string]any{"occurrences": []any{itemOccurrenceWithoutField(itemOccurrenceRecord(), "from")}}},
{"missing to", map[string]any{"occurrences": []any{itemOccurrenceWithoutField(itemOccurrenceRecord(), "to")}}},
{"noninteger quantity", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "quantity", 1.5)}}},
{"unsupported kind", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "kind", "unsupported")}}},
{"opaque item identifier", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "item_id", "item:sha256:opaque")}}},
{"unknown occurrence field", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "extra", true)}}},
{"segment-named range", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "source_refs", []any{map[string]any{"start_segment": 1, "end_segment": 1}})}}},
{"opaque source identifier", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "source_refs", []any{map[string]any{"start_unit_id": 1, "end_unit_id": 1, "source_id": "session-alpha"}})}}},
{"unknown reference field", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "source_refs", []any{map[string]any{"start_unit_id": 1, "end_unit_id": 1, "extra": true}})}}},
{"noninteger range", map[string]any{"occurrences": []any{itemOccurrenceWithField(itemOccurrenceRecord(), "source_refs", []any{map[string]any{"start_unit_id": 1.5, "end_unit_id": 1}})}}},
} {
t.Run(test.name, func(t *testing.T) {
content, err := json.Marshal(test.value)
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); err == nil {
t.Fatal("private schema accepted invalid structure")
}
})
}
}
func itemOccurrenceRecord() map[string]any {
return map[string]any{
"name": "Ring", "kind": "acquired", "quantity": nil, "from": nil, "to": "party", "source_refs": []any{},
}
}
func itemOccurrenceWithoutField(value map[string]any, name string) map[string]any {
delete(value, name)
return value
}
func itemOccurrenceWithField(value map[string]any, name string, fieldValue any) map[string]any {
value[name] = fieldValue
return value
}

57
assets/notarius.yml Normal file
View File

@@ -0,0 +1,57 @@
config:
imports:
- path: dnd/combat-turns/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/enemy-events/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/item-occurrences/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/item-registry/extract/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/item-registry/normalize/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/location-occurrences/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/location-registry/extract/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/location-registry/normalize/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/npc-occurrences/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/npc-registry/extract/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/npc-registry/normalize/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/scene-descriptions/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/scene-descriptions/validate/combat-semantics/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/scenes/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/spells/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: generic/normalize/deduplication/prompts/prompt.yaml
destination: [promptkit, collections, notarius]
required: true
- path: dnd/profiles/dnd-extraction.yaml
destination: [promptkit, collections, notarius]
required: true
promptkit:
collections:
notarius:
schema_root: .

View File

@@ -0,0 +1,149 @@
package assets_test
import (
"context"
"encoding/json"
"io/fs"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"go.maximumdirect.net/promptkit"
)
func TestOccurrencePromptPairsPreserveRegistryAndTranscriptBoundaries(t *testing.T) {
_, engine := loadNativeAssets(t)
for _, test := range []struct {
family, registry string
rules []string
}{
{"item", `{"items":[{"name":"occurrence-registry-name"}]}`, []string{
"Return both `from` and `to` for every occurrence.",
"| `discovered` | `null` | `null` |",
"| `acquired` | `null` | `party` or the named party member gaining possession |",
"| `lost` | `party` or the named party member losing possession | `null` |",
"| `consumed` | `party` or the named party member consuming the item | `null` |",
"| `transferred` | one named party member | a different named party member |",
"payments are always `lost`, not `consumed`.",
}},
{"npc", `{"npcs":[{"name":"occurrence-registry-name"}]}`, []string{"Use the supplied canonical NPC", "noncombat_presence", "combat_opponent"}},
{"location", `{"locations":[{"name":"occurrence-registry-name","registry_refs":[{"start_unit_id":7,"end_unit_id":7}],"context":[{"unit_id":7,"text":"registry-context"}]}]}`,
[]string{"context supports that coreference", "must not create a registry location", "provenance must never replace current-chunk evidence", "complete ordered"}},
} {
t.Run(test.family, func(t *testing.T) {
id := "notarius/dnd." + test.family + "_occurrences"
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: id, APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{
"transcript": promptkit.Inline(`{"units":[{"sentinel":"occurrence-transcript"}]}`),
test.family + "_registry": promptkit.Inline(test.registry),
"players": promptkit.Inline("occurrence-players"), "party": promptkit.Inline("occurrence-party"), "glossary": promptkit.Inline("occurrence-glossary"),
},
})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
correction, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: id + ".repair", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline("Correct the unsupported occurrence.")},
})
if err != nil {
t.Fatal(err)
}
defer correction.Discard()
first, next := initial.Details(), correction.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || first.SelectedProfileID != next.SelectedProfileID ||
first.StructuredOutput == nil || next.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, next.OutputContract) {
t.Fatal("occurrence native pair lost schema/defaults")
}
var system, all string
for _, message := range first.Messages {
all += message.Content
if message.Role == "system" {
system += message.Content
}
}
for _, rule := range append(test.rules, "Transcript units are the only evidence") {
if !strings.Contains(strings.Join(strings.Fields(system), " "), rule) {
t.Fatalf("missing enduring rule %q", rule)
}
}
for _, content := range []string{"occurrence-registry-name", "occurrence-transcript", "occurrence-players", "occurrence-party", "occurrence-glossary"} {
if strings.Count(all, content) != 1 {
t.Fatalf("input not rendered once: %q", content)
}
}
if len(next.Messages) != 1 || next.Messages[0].Role != "user" || !strings.Contains(next.Messages[0].Content, "Correct the unsupported occurrence.") ||
strings.Contains(next.Messages[0].Content, "occurrence-registry-name") {
t.Fatal("correction repeated fixed inputs")
}
})
}
}
func TestOccurrenceSchemasRetainSupportedKindsAndPrivateSelectors(t *testing.T) {
for _, test := range []struct {
family string
kinds []string
}{
{"npc", []string{"mentioned", "noncombat_presence", "dialogue", "combat_ally", "combat_opponent", "other"}},
{"location", []string{"visited", "planned", "recalled", "mentioned"}},
} {
t.Run(test.family, func(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/"+test.family+"-occurrences/schemas/dnd_"+test.family+"_occurrences_llm.v1.json")
if err != nil {
t.Fatal(err)
}
record := func() map[string]any {
value := map[string]any{"name": "Canonical Name", "kind": test.kinds[0], "source_refs": []any{map[string]any{"start_unit_id": 1, "end_unit_id": 2}}}
if test.family == "location" {
value["registry_refs"] = []any{map[string]any{"start_unit_id": 1, "end_unit_id": 2}}
}
return value
}
check := func(value map[string]any, valid bool) {
t.Helper()
content, err := json.Marshal(map[string]any{"occurrences": []any{value}})
if err != nil {
t.Fatal(err)
}
if err := validateJSONSchema(content, schema); (err == nil) != valid {
t.Fatalf("valid=%t response=%s error=%v", valid, content, err)
}
}
for _, kind := range test.kinds {
value := record()
value["kind"] = kind
check(value, true)
}
semantic := record()
semantic["name"] = ""
semantic["source_refs"] = []any{map[string]any{"start_unit_id": 0, "end_unit_id": -1}}
check(semantic, true)
for _, mutate := range []func(map[string]any){
func(value map[string]any) { delete(value, "name") },
func(value map[string]any) { value["kind"] = 1 },
func(value map[string]any) { value["kind"] = "unsupported" },
func(value map[string]any) { value[test.family+"_id"] = "assigned-later" },
func(value map[string]any) { value["unexpected"] = true },
func(value map[string]any) {
value["source_refs"].([]any)[0].(map[string]any)["source_id"] = "assigned-later"
},
} {
value := record()
mutate(value)
check(value, false)
}
if test.family == "location" {
value := record()
delete(value, "registry_refs")
check(value, false)
value = record()
value["registry_refs"].([]any)[0].(map[string]any)["start_unit_id"] = 0
check(value, false)
}
})
}
}

View File

@@ -6,7 +6,7 @@ import (
"io/fs" "io/fs"
) )
//go:embed dnd generic //go:embed notarius.yml dnd generic
var embedded embed.FS var embedded embed.FS
// FS returns the embedded read-only asset filesystem. // FS returns the embedded read-only asset filesystem.

214
assets/package_test.go Normal file
View File

@@ -0,0 +1,214 @@
package assets_test
import (
"context"
"encoding/json"
"errors"
"fmt"
"io/fs"
"path"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"go.maximumdirect.net/configkit"
"go.maximumdirect.net/promptkit"
"go.yaml.in/yaml/v4"
)
type assetSettings struct {
PromptKit promptkit.Settings `yaml:"promptkit"`
}
type noGeneration struct{ t *testing.T }
func (client noGeneration) Generate(context.Context, promptkit.GenerateRequest) (*promptkit.GenerateResponse, error) {
client.t.Error("resource preparation unexpectedly invoked generation")
return nil, fmt.Errorf("unexpected generation")
}
func loadNativeAssets(t *testing.T) (*configkit.Result[assetSettings], *promptkit.Engine) {
t.Helper()
filesystem := configkit.NewFilesystem("Notarius assets", assets.FS())
definition := promptkit.Configure(configkit.Definition[assetSettings]{}, func(value *assetSettings) *promptkit.Settings { return &value.PromptKit })
result, err := configkit.LoadLayered(configkit.Input{Source: configkit.NoSource()}, configkit.LayeredOptions[assetSettings]{
Definition: definition,
Underlays: []configkit.Underlay{
promptkit.BundledOpenRouterUnderlay(),
{Inputs: []configkit.Input{{
Source: filesystem.File("notarius.yml"), Imports: true,
Filesystem: &configkit.FilesystemContext{FS: &filesystem, Root: "."},
}}},
},
})
if err != nil {
var loadError *configkit.LoadError
if errors.As(err, &loadError) {
for _, diagnostic := range loadError.Diagnostics() {
t.Logf("%+v", diagnostic)
}
}
t.Fatal(err)
}
engine, err := promptkit.NewFromConfig(result, promptkit.RuntimeConfig{}, promptkit.WithLLMClient(noGeneration{t}))
if err != nil {
t.Fatal(err)
}
return result, engine
}
func TestEmbeddedPromptsPrepareWithNativeContracts(t *testing.T) {
t.Parallel()
_, engine := loadNativeAssets(t)
// Discover the actual declarations as well as the composed inventory, so an
// accidentally omitted import cannot silently remove a module's coverage.
err := fs.WalkDir(assets.FS(), ".", func(file string, entry fs.DirEntry, err error) error {
if err != nil {
return err
}
if entry.IsDir() || path.Base(file) != "prompt.yaml" {
return nil
}
data, err := fs.ReadFile(assets.FS(), file)
if err != nil {
return err
}
var declared struct {
Prompts []promptkit.PromptSettings `yaml:"prompts"`
}
if err := yaml.Unmarshal(data, &declared); err != nil {
return err
}
if len(declared.Prompts) == 0 {
return fmt.Errorf("%s has no native prompts", file)
}
for _, prompt := range declared.Prompts {
t.Run(prompt.ID, func(t *testing.T) {
inputs := make(map[string]promptkit.ArtifactRef)
for _, input := range prompt.Inputs {
inputs[input.Name] = promptkit.Inline(input.Name + "-fixture")
}
request := promptkit.RunRequest{PromptID: "notarius/" + prompt.ID, Inputs: inputs, APIKey: "fixture-key"}
if prompt.DefaultProfile == nil {
request.ProfileID = "notarius/dnd-extraction"
}
prepared, err := engine.PrepareExecution(context.Background(), request)
if err != nil {
t.Fatal(err)
}
defer prepared.Discard()
details := prepared.Details()
if details.OutputContract.Format != promptkit.FormatJSON || details.OutputContract.ValidationMode != promptkit.ValidationJSONSchema || details.StructuredOutput == nil || details.StructuredOutput.JSONSchema == nil {
t.Fatalf("missing native schema contract: %#v", details.OutputContract)
}
// Preparation must load the real self-contained schema, not merely retain
// a filename or use a separate application schema registry.
schemaBytes, err := fs.ReadFile(assets.FS(), details.OutputContract.SchemaPath)
if err != nil {
t.Fatal(err)
}
var expected any
if err := json.Unmarshal(schemaBytes, &expected); err != nil {
t.Fatal(err)
}
actualBytes, err := json.Marshal(details.StructuredOutput.JSONSchema.Schema)
if err != nil {
t.Fatal(err)
}
var actual any
if err := json.Unmarshal(actualBytes, &actual); err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(actual, expected) {
t.Fatal("prepared schema differs from the owned asset")
}
first := prompt.Messages[0]
if first.ContentFile == nil {
t.Fatal("expected a source-relative initial message")
}
content, err := fs.ReadFile(assets.FS(), path.Join(path.Dir(file), *first.ContentFile))
if err != nil {
t.Fatal(err)
}
if first.Role == nil || len(details.Messages) == 0 || details.Messages[0].Role != *first.Role {
t.Fatal("declared message role was not preserved")
}
if !strings.Contains(string(content), "{{") && strings.TrimSpace(details.Messages[0].Content) != strings.TrimSpace(string(content)) {
t.Fatal("source-relative message content was not preserved")
}
})
}
return nil
})
if err != nil {
t.Fatal(err)
}
}
func TestRegistryNormalizationPromptPairsRetainTheirNativeContracts(t *testing.T) {
_, engine := loadNativeAssets(t)
for _, test := range []struct {
id string
guidance string
rules []string
}{
{"notarius/dnd.npc_registry.normalize", "Preserve distinct individuals.", []string{"same individual", "unadorned proper name"}},
{"notarius/dnd.location_registry.normalize", "Keep parent and child places separate.", []string{"same physical place", "parent and child places"}},
} {
t.Run(test.id, func(t *testing.T) {
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: test.id, APIKey: "test-only", Inputs: map[string]promptkit.ArtifactRef{
"candidates": promptkit.Inline(`{"candidate_number_range":{"first":1,"last":2},"candidates":[]}`),
"transcript": promptkit.Inline(`{"windows":[]}`),
},
})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
correction, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: test.id + ".repair", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline(test.guidance)},
})
if err != nil {
t.Fatal(err)
}
defer correction.Discard()
first, next := initial.Details(), correction.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || next.SelectedProfileID != first.SelectedProfileID ||
first.StructuredOutput == nil || next.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, next.OutputContract) {
t.Fatal("normalization pair lost its shared native defaults/output contract")
}
var system string
for _, message := range first.Messages {
if message.Role == "system" {
system += message.Content
}
}
for _, rule := range append(test.rules, "candidate_number_range", "start_unit_id", "canonical_candidate_number") {
if !strings.Contains(system, rule) {
t.Fatalf("missing enduring system principle %q", rule)
}
}
if len(next.Messages) != 1 || next.Messages[0].Role != "user" || !strings.Contains(next.Messages[0].Content, test.guidance) {
t.Fatal("correction did not supply only the findings and replacement assignment")
}
})
}
}
func TestEmbeddedProfileRetainsSelectedExecutionDefaults(t *testing.T) {
t.Parallel()
_, engine := loadNativeAssets(t)
profile, err := engine.InspectProfile(context.Background(), "notarius/dnd-extraction")
if err != nil {
t.Fatal(err)
}
if profile.Backend == nil || *profile.Backend != "openrouter" ||
profile.Model == nil || *profile.Model != "openai/gpt-5.6-luna" ||
profile.TimeoutSeconds == nil || *profile.TimeoutSeconds != 240 ||
profile.ServiceTier == nil || *profile.ServiceTier != "flex" || profile.ReasoningEffort != nil {
t.Fatalf("changed extraction defaults: %#v", profile)
}
}

View File

@@ -0,0 +1,177 @@
package assets_test
import (
"context"
"strings"
"testing"
"go.maximumdirect.net/promptkit"
)
func TestExtractionPromptComposition(t *testing.T) {
const (
transcriptSentinel = "shared-transcript-sentinel"
playersSentinel = "shared-players-sentinel"
partySentinel = "shared-party-sentinel"
glossarySentinel = "shared-glossary-sentinel"
npcSentinel = "npc-registry-sentinel"
catalogSentinel = "spell-catalog-sentinel"
evidenceSentinel = "Transcript units are the only evidence"
endpointOrderSentinel = "according to transcript order"
combatPolicySentinel = "substantive active combat materially organizes the"
)
_, engine := loadNativeAssets(t)
commonInputs := map[string]promptkit.ArtifactRef{
"transcript": promptkit.InlineWithURI("file:///session.json", `{"sentinel":"`+transcriptSentinel+`"}`),
"players": promptkit.Inline(playersSentinel),
"party": promptkit.Inline(partySentinel),
"glossary": promptkit.Inline(glossarySentinel),
}
cases := []struct {
name string
promptID string
inputs map[string]promptkit.ArtifactRef
suffixGroups [][]string
middleSentinel string
}{
{name: "npcs", promptID: "notarius/dnd.npc_registry", inputs: commonInputs, suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}}},
{name: "locations", promptID: "notarius/dnd.location_registry", inputs: commonInputs, suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}}},
{name: "item occurrences", promptID: "notarius/dnd.item_occurrences", inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{
"item_registry": promptkit.Inline(`{"items":[{"id":"item-registry-sentinel","name":"Torch"}]}`),
}), suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}, {"item-registry-sentinel"}}},
{name: "item registry", promptID: "notarius/dnd.item_registry", inputs: commonInputs, suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}}},
{name: "scene descriptions", promptID: "notarius/dnd.scene_descriptions", inputs: commonInputs, middleSentinel: combatPolicySentinel},
{
name: "combat turns",
promptID: "notarius/dnd.combat_turns",
inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{
"npc_registry": promptkit.Inline(`{"sentinel":"` + npcSentinel + `"}`),
}),
suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}, {npcSentinel}},
},
{
name: "enemy events",
promptID: "notarius/dnd.enemy_events",
inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{
"npc_registry": promptkit.Inline(`{"sentinel":"` + npcSentinel + `"}`),
"combat_turns": promptkit.Inline(`{"sentinel":"combat-turns-sentinel"}`),
"npc_occurrences": promptkit.Inline(`{"sentinel":"npc-occurrences-sentinel"}`),
}),
suffixGroups: [][]string{
{evidenceSentinel, endpointOrderSentinel},
{npcSentinel},
{"combat-turns-sentinel", "npc-occurrences-sentinel"},
},
},
{
name: "npc occurrences",
promptID: "notarius/dnd.npc_occurrences",
inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{
"npc_registry": promptkit.Inline(`{"sentinel":"` + npcSentinel + `"}`),
}),
suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}, {npcSentinel}},
},
{
name: "location occurrences",
promptID: "notarius/dnd.location_occurrences",
inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{
"location_registry": promptkit.Inline(`{"sentinel":"location-registry-sentinel"}`),
}),
suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}, {"location-registry-sentinel"}},
},
{
name: "spells",
promptID: "notarius/dnd.spells",
inputs: withPromptInputs(commonInputs, map[string]promptkit.ArtifactRef{
"npc_registry": promptkit.Inline(`{"sentinel":"` + npcSentinel + `"}`),
"spell_catalog": promptkit.Inline(`{"sentinel":"` + catalogSentinel + `"}`),
}),
suffixGroups: [][]string{{evidenceSentinel, endpointOrderSentinel}, {npcSentinel}, {catalogSentinel}},
},
}
for _, testCase := range cases {
t.Run(testCase.name, func(t *testing.T) {
handle, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: testCase.promptID,
APIKey: "test-only",
ProfileID: "notarius/dnd-extraction",
Inputs: testCase.inputs,
})
if err != nil {
t.Fatalf("PrepareExecution() error = %v", err)
}
defer handle.Discard()
prepared := handle.Details()
transcriptIndex := renderedInputMessageIndex(t, prepared.Messages, transcriptSentinel)
referenceIndex := renderedInputMessageIndex(t, prepared.Messages, playersSentinel)
if referenceIndex >= transcriptIndex {
t.Fatalf("campaign references rendered at message %d, want before transcript message %d", referenceIndex, transcriptIndex)
}
assertEphemeralCache(t, prepared.Messages, referenceIndex)
assertEphemeralCache(t, prepared.Messages, transcriptIndex)
previousIndex := transcriptIndex
for _, group := range testCase.suffixGroups {
groupIndex := -1
for _, sentinel := range group {
inputIndex := renderedInputMessageIndex(t, prepared.Messages, sentinel)
if groupIndex < 0 {
groupIndex = inputIndex
} else if inputIndex != groupIndex {
t.Fatalf("input sentinel %q rendered at message %d, want grouped at message %d", sentinel, inputIndex, groupIndex)
}
}
if groupIndex <= previousIndex {
t.Fatalf("prompt suffix group rendered at message %d, want after message %d", groupIndex, previousIndex)
}
previousIndex = groupIndex
}
instructionIndex := len(prepared.Messages) - 1
if testCase.middleSentinel != "" {
policyIndex := renderedInputMessageIndex(t, prepared.Messages, testCase.middleSentinel)
if policyIndex <= transcriptIndex || policyIndex >= instructionIndex {
t.Fatalf("combat policy rendered at message %d, want after transcript message %d and before instructions message %d", policyIndex, transcriptIndex, instructionIndex)
}
}
if instructionIndex <= previousIndex {
t.Fatalf("instructions rendered at message %d, want after lane input message %d", instructionIndex, previousIndex)
}
assertEphemeralCache(t, prepared.Messages, instructionIndex)
})
}
}
func withPromptInputs(inputs, extras map[string]promptkit.ArtifactRef) map[string]promptkit.ArtifactRef {
merged := make(map[string]promptkit.ArtifactRef, len(inputs)+len(extras))
for name, input := range inputs {
merged[name] = input
}
for name, input := range extras {
merged[name] = input
}
return merged
}
func assertEphemeralCache(t *testing.T, messages []promptkit.RenderedMessage, index int) {
t.Helper()
if cache := messages[index].CacheControl; cache == nil || cache.Type != promptkit.CacheControlEphemeral {
t.Fatalf("message %d cache control = %#v, want ephemeral", index, cache)
}
}
func renderedInputMessageIndex(t *testing.T, messages []promptkit.RenderedMessage, sentinel string) int {
t.Helper()
index := -1
occurrences := 0
for messageIndex, message := range messages {
count := strings.Count(message.Content, sentinel)
if count > 0 {
index = messageIndex
occurrences += count
}
}
if occurrences != 1 {
t.Fatalf("input sentinel %q rendered %d times, want exactly once", sentinel, occurrences)
}
return index
}

View File

@@ -0,0 +1,120 @@
package assets_test
import (
"context"
"encoding/json"
"io/fs"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"go.maximumdirect.net/promptkit"
)
func TestRegistryExtractionPromptPairsRetainDomainRulesAndContracts(t *testing.T) {
_, engine := loadNativeAssets(t)
for _, test := range []struct {
family, instruction string
rules []string
}{
{"npc", "Revise the NPC citations.", []string{"proper name or a stable, individually distinguishing", "factual third-party mention", "Exclude human players"}},
{"item", "Revise the item citations.", []string{"named unique items", "concrete reusable item types", "currency denomination", "generic weapons", "Do not use capitalization as an eligibility test"}},
{"location", "Revise the location citations.", []string{"stable proper name or unique in-world designation", "the room", "Do not use capitalization as an eligibility test"}},
} {
t.Run(test.family, func(t *testing.T) {
id := "notarius/dnd." + test.family + "_registry"
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: id, APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{
"transcript": promptkit.Inline(`{"units":[{"sentinel":"registry-transcript"}]}`),
"players": promptkit.Inline("registry-players"), "party": promptkit.Inline("registry-party"), "glossary": promptkit.Inline("registry-glossary"),
},
})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
next, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: id + ".repair", APIKey: "test-only", Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline(test.instruction)},
})
if err != nil {
t.Fatal(err)
}
defer next.Discard()
first, correction := initial.Details(), next.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || correction.SelectedProfileID != first.SelectedProfileID ||
first.StructuredOutput == nil || correction.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, correction.OutputContract) {
t.Fatal("registry prompt pair lost native schema/defaults")
}
var system, all string
for _, message := range first.Messages {
all += message.Content
if message.Role == "system" {
system += message.Content
}
if strings.Contains(message.Content, "registry-transcript") || strings.Contains(message.Content, "registry-players") {
if message.CacheControl == nil || message.CacheControl.Type != promptkit.CacheControlEphemeral {
t.Fatal("fixed input cache hint lost")
}
}
}
for _, rule := range append(test.rules, "Transcript units are the only evidence", "Use the most specific supported in-world") {
if !strings.Contains(strings.Join(strings.Fields(system), " "), rule) {
t.Fatalf("missing enduring domain rule %q", rule)
}
}
for _, input := range []string{"registry-transcript", "registry-players", "registry-party", "registry-glossary"} {
if strings.Count(all, input) != 1 {
t.Fatalf("fixed input not rendered once: %q", input)
}
}
if len(correction.Messages) != 1 || correction.Messages[0].Role != "user" || !strings.Contains(correction.Messages[0].Content, test.instruction) ||
strings.Contains(correction.Messages[0].Content, "registry-transcript") {
t.Fatal("correction repeated fixed inputs instead of supplying findings/assignment")
}
})
}
}
func TestRegistryResponseSchemasSeparateStructureFromSemanticValidity(t *testing.T) {
for _, test := range []struct{ family, field string }{
{"npc", "npcs"}, {"item", "items"}, {"location", "locations"},
} {
t.Run(test.family, func(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/"+test.family+"-registry/extract/schemas/dnd_"+test.family+"_registry_llm.v1.json")
if err != nil {
t.Fatal(err)
}
for _, value := range []struct {
name, record string
valid bool
}{
{"grounded record", `{"name":"Canonical Name","source_refs":[{"start_unit_id":1,"end_unit_id":2}]}`, true},
{"blank name and empty evidence", `{"name":"","source_refs":[]}`, true},
{"nonpositive source candidate", `{"name":"Canonical Name","source_refs":[{"start_unit_id":0,"end_unit_id":-1}]}`, true},
{"missing name", `{"source_refs":[]}`, false},
{"opaque ID", `{"name":"Canonical Name","source_refs":[],"id":"assigned-later"}`, false},
{"wrong name type", `{"name":7,"source_refs":[]}`, false},
{"noninteger source identifier", `{"name":"Canonical Name","source_refs":[{"start_unit_id":1.5,"end_unit_id":2}]}`, false},
} {
t.Run(value.name, func(t *testing.T) {
content := []byte(`{"` + test.field + `":[` + value.record + `]}`)
if err := validateJSONSchema(content, schema); (err == nil) != value.valid {
t.Fatalf("schema validity=%t, error=%v", value.valid, err)
}
})
}
for _, content := range []string{`{"` + test.field + `":[]}`, `{"` + test.field + `":null}`, `{}`} {
var value map[string]any
if err := json.Unmarshal([]byte(content), &value); err != nil {
t.Fatal(err)
}
_, isArray := value[test.field].([]any)
if err := validateJSONSchema([]byte(content), schema); (err == nil) != isArray {
t.Fatalf("collection shape %s: %v", content, err)
}
}
})
}
}

View File

@@ -0,0 +1,120 @@
package assets_test
import (
"context"
"encoding/json"
"io/fs"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"go.maximumdirect.net/promptkit"
)
func TestSceneResponseSchemaUsesStrictPrivateContract(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/scene-descriptions/schemas/dnd_scene_descriptions_llm.v1.json")
if err != nil {
t.Fatal(err)
}
valid := map[string]any{"kind": "narrative", "title": "Arrival", "summary": "The party enters the tower."}
if err := validateSceneResponse(t, valid, schema); err != nil {
t.Fatalf("valid private response rejected: %v", err)
}
for _, test := range []struct {
name string
response map[string]any
valid bool
}{
{name: "missing required field", response: map[string]any{"kind": "combat", "title": "Ambush"}},
{name: "unknown framework field", response: map[string]any{"kind": "combat", "title": "Ambush", "summary": "Bandits strike.", "id": "assigned-later"}},
{name: "unknown application field", response: map[string]any{"kind": "combat", "title": "Ambush", "summary": "Bandits strike.", "source_ref": map[string]any{}}},
{name: "collection is not allowed", response: map[string]any{"kind": "combat", "title": "Ambush", "summary": "Bandits strike.", "scenes": []any{}}},
{name: "unsupported kind", response: map[string]any{"kind": "interlude", "title": "Ambush", "summary": "Bandits strike."}},
{name: "empty title", response: map[string]any{"kind": "combat", "title": "", "summary": "Bandits strike."}, valid: true},
{name: "empty summary", response: map[string]any{"kind": "combat", "title": "Ambush", "summary": ""}, valid: true},
{name: "wrong kind type", response: map[string]any{"kind": 7, "title": "Ambush", "summary": "Bandits strike."}},
{name: "wrong title type", response: map[string]any{"kind": "combat", "title": 7, "summary": "Bandits strike."}},
{name: "wrong summary type", response: map[string]any{"kind": "combat", "title": "Ambush", "summary": 7}},
} {
t.Run(test.name, func(t *testing.T) {
err := validateSceneResponse(t, test.response, schema)
if (err == nil) != test.valid {
t.Fatalf("validateJSONSchema() error = %v, want valid=%t", err, test.valid)
}
})
}
if err := validateJSONSchema([]byte(`{"kind":`), schema); err == nil {
t.Fatal("validateJSONSchema() error = nil, want malformed JSON rejected")
}
}
func TestSceneResponseSchemaAcceptsEverySupportedKind(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/scene-descriptions/schemas/dnd_scene_descriptions_llm.v1.json")
if err != nil {
t.Fatal(err)
}
for _, kind := range []string{"combat", "narrative", "recap", "meta"} {
response := map[string]any{"kind": kind, "title": "Title", "summary": "Summary"}
if err := validateSceneResponse(t, response, schema); err != nil {
t.Fatalf("supported scene kind %q was rejected: %v", kind, err)
}
}
}
func validateSceneResponse(t *testing.T, instance map[string]any, schemaContent []byte) error {
t.Helper()
content, err := json.Marshal(instance)
if err != nil {
t.Fatal(err)
}
return validateJSONSchema(content, schemaContent)
}
func TestSceneDescriptionPromptPairRetainsPolicyAndFixedInputs(t *testing.T) {
_, engine := loadNativeAssets(t)
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.scene_descriptions", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{
"transcript": promptkit.Inline(`{"units":[{"text":"scene-description-transcript"}]}`),
"players": promptkit.Inline("scene-description-player"), "party": promptkit.Inline(" "), "glossary": promptkit.Inline(" "),
},
})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
correction, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.scene_descriptions.repair", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline("Return kind: combat for this scene.")},
})
if err != nil {
t.Fatal(err)
}
defer correction.Discard()
first, next := initial.Details(), correction.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || first.SelectedProfileID != next.SelectedProfileID || first.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, next.OutputContract) {
t.Fatal("scene pair lost schema/defaults")
}
var system, all string
for _, message := range first.Messages {
all += message.Content
if message.Role == "system" {
system += message.Content
}
}
for _, rule := range []string{"complete chunk is the evidence boundary", "substantive active combat materially organizes the", "must not invent a proper noun"} {
if !strings.Contains(strings.Join(strings.Fields(system), " "), rule) {
t.Fatalf("missing enduring rule %q", rule)
}
}
for _, material := range []string{"scene-description-transcript", "scene-description-player", "substantive active combat materially organizes the"} {
if strings.Count(all, material) != 1 {
t.Fatalf("fixed input/policy repeated: %q", material)
}
}
if len(next.Messages) != 1 || next.Messages[0].Role != "user" || !strings.Contains(next.Messages[0].Content, "Return kind: combat for this scene.") || strings.Contains(next.Messages[0].Content, "scene-description-transcript") {
t.Fatal("correction assignment lost findings or repeated source")
}
}

184
assets/scenes_test.go Normal file
View File

@@ -0,0 +1,184 @@
package assets_test
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/fs"
"reflect"
"strings"
"testing"
"gitea.maximumdirect.net/eric/notarius/assets"
"github.com/santhosh-tekuri/jsonschema/v6"
"go.maximumdirect.net/promptkit"
)
func TestScenePromptPairPreservesFullTranscriptAndContext(t *testing.T) {
_, engine := loadNativeAssets(t)
const transcript = `{"sentinel":"scene-transcript"}`
initial, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.scenes", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{
"transcript": promptkit.Inline(transcript),
"players": promptkit.Inline("scene-players"),
"party": promptkit.Inline("scene-party"),
"glossary": promptkit.Inline("scene-glossary"),
},
})
if err != nil {
t.Fatal(err)
}
defer initial.Discard()
correction, err := engine.PrepareExecution(context.Background(), promptkit.RunRequest{
PromptID: "notarius/dnd.scenes.repair", APIKey: "test-only",
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline("Keep the encounter together.")},
})
if err != nil {
t.Fatal(err)
}
defer correction.Discard()
first, next := initial.Details(), correction.Details()
if first.SelectedProfileID != "notarius/dnd-extraction" || next.SelectedProfileID != first.SelectedProfileID ||
first.StructuredOutput == nil || next.StructuredOutput == nil || !reflect.DeepEqual(first.OutputContract, next.OutputContract) {
t.Fatal("scene correction pair lost its shared native defaults/output contract")
}
var system, all string
transcriptIndex := -1
for i, message := range first.Messages {
all += message.Content
if message.Role == "system" {
system += message.Content
}
if strings.Contains(message.Content, transcript) {
transcriptIndex = i
}
if strings.Contains(message.Content, transcript) || strings.Contains(message.Content, "scene-players") {
if message.CacheControl == nil || message.CacheControl.Type != promptkit.CacheControlEphemeral {
t.Fatal("reference/full-transcript native cache hint lost")
}
}
}
if transcriptIndex != len(first.Messages)-1 || !strings.Contains(system, "no gaps or overlaps") || !strings.Contains(system, "coherent unit of play") {
t.Fatal("scene principles or complete final transcript lost")
}
for _, content := range []string{transcript, "scene-players", "scene-party", "scene-glossary"} {
if strings.Count(all, content) != 1 {
t.Fatalf("fixed context not rendered once: %q", content)
}
}
if len(next.Messages) != 1 || next.Messages[0].Role != "user" || !strings.Contains(next.Messages[0].Content, "Keep the encounter together.") ||
strings.Contains(next.Messages[0].Content, "scene-transcript") {
t.Fatal("correction should supply findings and a replacement assignment only")
}
}
func TestResponseSchemaValidatesMinimalSceneResponses(t *testing.T) {
schema, err := fs.ReadFile(assets.FS(), "dnd/scenes/schemas/dnd_scenes_llm.v1.json")
if err != nil {
t.Fatalf("loadResponseSchema() error = %v, want nil", err)
}
valid := validSceneSchemaResponse()
validJSON, err := json.Marshal(valid)
if err != nil {
t.Fatalf("Marshal(validSceneSchemaResponse()) error = %v, want nil", err)
}
if err := validateJSONSchema(validJSON, schema); err != nil {
t.Fatalf("valid scene response rejected: %v", err)
}
tests := []struct {
name string
mutate func(map[string]any)
}{
{
name: "missing scenes",
mutate: func(response map[string]any) {
delete(response, "scenes")
},
},
{
name: "empty scenes",
mutate: func(response map[string]any) {
response["scenes"] = []any{}
},
},
{
name: "non-positive start unit",
mutate: func(response map[string]any) {
response["scenes"].([]any)[0].(map[string]any)["start_unit_id"] = 0
},
},
{
name: "non-positive end unit",
mutate: func(response map[string]any) {
response["scenes"].([]any)[0].(map[string]any)["end_unit_id"] = 0
},
},
{
name: "non-integer endpoint",
mutate: func(response map[string]any) {
response["scenes"].([]any)[0].(map[string]any)["start_unit_id"] = 1.5
},
},
{
name: "unknown top-level field",
mutate: func(response map[string]any) {
response["boundary_caveats"] = []any{}
},
},
{
name: "unknown scene field",
mutate: func(response map[string]any) {
response["scenes"].([]any)[0].(map[string]any)["short_title"] = "Old contract"
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
response := validSceneSchemaResponse()
tt.mutate(response)
content, err := json.Marshal(response)
if err != nil {
t.Fatalf("Marshal() error = %v, want nil", err)
}
if err := validateJSONSchema(content, schema); err == nil {
t.Fatal("validateJSONSchema() error = nil, want rejected response")
}
})
}
}
func validSceneSchemaResponse() map[string]any {
return map[string]any{
"scenes": []any{
map[string]any{
"start_unit_id": 1,
"end_unit_id": 3,
},
},
}
}
func validateJSONSchema(instanceContent, schemaContent []byte) error {
instance, err := jsonschema.UnmarshalJSON(bytes.NewReader(instanceContent))
if err != nil {
return fmt.Errorf("parse instance: %w", err)
}
schemaDocument, err := jsonschema.UnmarshalJSON(bytes.NewReader(schemaContent))
if err != nil {
return fmt.Errorf("parse schema: %w", err)
}
compiler := jsonschema.NewCompiler()
if err := compiler.AddResource("schema.json", schemaDocument); err != nil {
return fmt.Errorf("load schema: %w", err)
}
schema, err := compiler.Compile("schema.json")
if err != nil {
return fmt.Errorf("compile schema: %w", err)
}
return schema.Validate(instance)
}

View File

@@ -1,4 +1,4 @@
package register package assets_test
import ( import (
"encoding/json" "encoding/json"
@@ -8,25 +8,18 @@ import (
"strings" "strings"
"testing" "testing"
"gitea.maximumdirect.net/eric/notarius/internal/framework/llm" "gitea.maximumdirect.net/eric/notarius/assets"
) )
func TestRegisteredResponseSchemasRequireEveryObjectProperty(t *testing.T) { func TestModelResponseSchemasRequireEveryObjectProperty(t *testing.T) {
assets := llm.NewAssetRegistry() schemaFS := assets.FS()
if err := Register(completeRegistries(), assets); err != nil {
t.Fatal(err)
}
schemaFS, err := assets.SchemaFS()
if err != nil {
t.Fatal(err)
}
count := 0 count := 0
err = fs.WalkDir(schemaFS, ".", func(path string, entry fs.DirEntry, walkErr error) error { err := fs.WalkDir(schemaFS, ".", func(path string, entry fs.DirEntry, walkErr error) error {
if walkErr != nil { if walkErr != nil {
return walkErr return walkErr
} }
if entry.IsDir() || !strings.HasSuffix(path, ".json") { if entry.IsDir() || !strings.HasSuffix(path, "_llm.v1.json") {
return nil return nil
} }
content, err := fs.ReadFile(schemaFS, path) content, err := fs.ReadFile(schemaFS, path)
@@ -46,7 +39,7 @@ func TestRegisteredResponseSchemasRequireEveryObjectProperty(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if count == 0 { if count == 0 {
t.Fatal("no registered response schemas found") t.Fatal("no model response schemas found")
} }
} }

View File

@@ -1,11 +1,21 @@
package main package main
import ( import (
"context"
"fmt"
"os" "os"
"gitea.maximumdirect.net/eric/notarius/internal/cli" "gitea.maximumdirect.net/eric/notarius/internal/cli"
"go.maximumdirect.net/commandkit"
"go.maximumdirect.net/releasekit/buildinfo"
) )
func main() { func main() {
os.Exit(cli.Run(os.Args[1:], os.Stdout, os.Stderr)) app, err := cli.NewApplication(buildinfo.Version(), cli.Options{})
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
outcome := app.Execute(context.Background(), os.Args[1:], commandkit.Streams{Out: os.Stdout, Err: os.Stderr})
os.Exit(outcome.Status)
} }

View File

@@ -1,6 +1,10 @@
# ADR-0004: Package modules by domain, not by stage # ADR-0004: Package modules by domain, not by stage
**Status:** Accepted — its asset-co-location rule is superseded by [ADR-0011](0011-centralize-llm-assets.md); its domain-first module packaging decision remains accepted. **Status:** Accepted in part. Asset co-location is superseded by
[ADR-0011](0011-centralize-llm-assets.md), and prompt/schema registration by
[ADR-0021](0021-compose-native-kits-and-prompt-declared-resources.md).
Domain-first packaging, typed domain ownership, and registrar dependency direction
remain accepted.
**Date:** 2026-07-13 **Date:** 2026-07-13
## Context ## Context

View File

@@ -1,6 +1,9 @@
# ADR-0005: Cache one canonical chunk plan per source # ADR-0005: Cache one canonical chunk plan per source
**Status:** Accepted **Status:** Superseded by
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md). Source-addressed plan
semantics and deterministic materialization remain; source-only canonical reuse
and its separate store do not.
**Date:** 2026-07-17 **Date:** 2026-07-17
## Context ## Context

View File

@@ -1,6 +1,12 @@
# ADR-0006: Separate output, cache, and debug state # ADR-0006: Separate output, cache, and debug state
**Status:** Superseded by [ADR-0007](0007-separate-checkpoint-recording-from-reuse.md) **Status:** Accepted in part. The checkpoint invocation policy was superseded by
[ADR-0007](0007-separate-checkpoint-recording-from-reuse.md); the two-cache model
is now superseded by [ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md),
and required output records and the debug summary/trace split by
[ADR-0024](0024-publish-artifacts-with-native-reports-and-debug-evidence.md).
Independent output/cache/debug surfaces, explicit debug selection, and
operator-owned retention remain accepted.
**Date:** 2026-07-17 **Date:** 2026-07-17
## Context ## Context

View File

@@ -1,6 +1,8 @@
# ADR-0007: Separate checkpoint recording from reuse # ADR-0007: Separate checkpoint recording from reuse
**Status:** Accepted **Status:** Superseded by
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md), which replaces
checkpoint recording/resume with unified accepted-result reuse.
**Date:** 2026-07-19 **Date:** 2026-07-19
## Context ## Context

View File

@@ -1,6 +1,13 @@
# ADR-0010: Use workload-oriented LLM profile defaults # ADR-0010: Use workload-oriented LLM profile defaults
**Status:** Accepted **Status:** Accepted in part. Profile source replacement was superseded by
[ADR-0019](0019-adopt-native-promptkit-configuration.md), whose native source
boundary is now superseded by
[ADR-0021](0021-compose-native-kits-and-prompt-declared-resources.md).
Checkpoint identity is superseded by
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md).
Workload-oriented defaults, D&D-owned profile policy, binding exceptions, and
run-wide profile precedence remain accepted.
**Date:** 2026-08-03 **Date:** 2026-08-03
## Context ## Context

View File

@@ -1,6 +1,11 @@
# ADR-0011: Centralize LLM-facing assets in a content-only package # ADR-0011: Centralize LLM-facing assets in a content-only package
**Status:** Accepted **Status:** Accepted in part. Asset manifests, module schema registration, and
scoped source assembly are superseded by
[ADR-0021](0021-compose-native-kits-and-prompt-declared-resources.md);
checkpoint fingerprints are superseded by
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md).
The content-only root assets leaf and domain semantic ownership remain accepted.
**Date:** 2026-08-05 **Date:** 2026-08-05
## Context ## Context

View File

@@ -1,6 +1,9 @@
# ADR-0013: Use request-local candidate handles for semantic reconciliation # ADR-0013: Use request-local candidate handles for semantic reconciliation
**Status:** Accepted **Status:** Accepted; only the checkpoint-fingerprint requirement is superseded by
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md).
Request-local handles, fixed mapping, domain ownership, and safe typed application
remain accepted.
**Date:** 2026-08-09 **Date:** 2026-08-09
## Context ## Context
@@ -83,9 +86,7 @@ entity identity, checkpoint contracts, or cross-request correlation. Changes
to shared protocol and policy assets must participate in the normal prompt, to shared protocol and policy assets must participate in the normal prompt,
schema, and checkpoint fingerprint mechanisms. schema, and checkpoint fingerprint mechanisms.
Acceptance of this decision does not imply that the shared mechanism or its The shared mechanism and its initial D&D registry consumers are now
consumer migrations are implemented. The implemented. Current behavior is documented in
[feature roadmap](../roadmap/semantic-reconciliation.md) owns target behavior [Module Internals](../internal/modules.md#semantic-reconciliation) and
and status, and the [D&D Module Internals](../internal/dnd.md#semantic-registry-reconciliation).
[implementation plan](../roadmap/implementation.md) owns delivery sequence
until the work is complete.

View File

@@ -0,0 +1,63 @@
# ADR-0014: Use feedback-aware validation retries
**Status:** Superseded by
[ADR-0022](0022-use-native-continuation-and-application-assessment.md) for execution,
assessment, and disposition, and
[ADR-0024](0024-publish-artifacts-with-native-reports-and-debug-evidence.md) for
diagnostic persistence. Guidance remains separate from operator diagnostics.
**Date:** 2026-08-26
## Context
Validation can identify a candidate defect after a producer has returned an
otherwise well-formed result. Retrying without the validator's deterministic,
bounded feedback wastes the useful diagnosis, while treating validator
execution failures as defects would ask a producer to repair conditions it
cannot control. The mechanism must preserve typed producer ownership,
checkpoint safety, and the repository's sensitive-data boundaries.
## Decision
The implementation will keep three independent budgets: the producer binding's
outer `retries` budget, PromptKit's structured-output repair budget, and each
validator's execution-retry budget. Validators will run sequentially in their
configured order and aggregate both rejections and execution failures before a
candidate disposition is selected.
A correction-capable producer will provide the exact single LLM response that
controlled its candidate using the `single_response_v1` protocol. A correction
attempt will reconstruct the ordinary request and append exactly two fresh
messages: that latest response as `assistant`, followed by one deterministic
aggregate correction request as `user`. Earlier turns will not accumulate.
Validator failures will not recurse into correction. Pipeline policy owns
terminal disposition, with field-by-field producer overrides over pipeline
defaults: structural failure and semantic rejection default to `fail_run`, and
validator execution failure defaults to `warn_continue`. Validators can report
facts and bounded corrective guidance, but never decide disposition.
Rejected and structurally invalid candidates will not advance. A candidate
allowed through after a validator execution failure will retain explicit
incomplete-validation provenance and will not be checkpointed. Exact response
and correction text remain attempt-local: they are excluded from ordinary
errors, warnings, manifests, receipts, caches, checkpoints, and default debug
summaries.
## Alternatives considered
- Retry every producer after any validation outcome. This conflates producer
defects with validator operational failures and wastes retry budget.
- Let validators decide whether to continue. This would distribute pipeline
disposition policy across validators and undermine consistent defaults.
- Reuse the full prior conversation. Accumulated turns introduce unbounded
prompt growth and make correction behavior depend on incidental history.
- Persist raw responses to simplify diagnosis. Raw model output and correction
guidance may be sensitive and do not belong in durable pipeline records.
## Consequences
The framework gains transport-neutral correction and candidate contracts,
producer capability checks, policy resolution, aggregated validation outcomes,
and conservative checkpoint handling. Prompt construction remains inside the
LLM adapter, while modules remain responsible for accurately exposing the
single response that directly controlled a candidate.

View File

@@ -0,0 +1,71 @@
# ADR-0015: Separate process warnings from quality diagnostics
**Status:** Accepted in part. Durable warning/diagnostic files and receipt
presentation are superseded by
[ADR-0024](0024-publish-artifacts-with-native-reports-and-debug-evidence.md).
Process-warning classification, module-owned meaning, and bounded origin-aware
aggregation remain accepted.
**Date:** 2026-08-27
## Context
Notarius currently represents process degradation, incomplete validation,
extraction-quality doubt, and routine normalization with one flat warning
record. That makes ordinary successful runs noisy, loses the framework context
needed to explain a finding, and gives `warning_count` no stable operational
meaning. It also permits output encoders to add a warning after the durable
warning file has already been written.
The application needs one bounded diagnostic model that preserves exact
occurrence counts while retaining only safe, representative samples. Fresh and
resumed logical runs must present the same groups. The model must not alter
validation decisions, retry budgets, rejected-output behavior, or process exit
policy.
## Decision
Warnings are reserved for a completed run that advanced under an allowed
process-level degradation or incomplete-work policy. Extraction-quality signals
are advisories, and routine accepted transformations are observations. A
non-degraded successful run therefore has zero actionable warnings.
Modules and validators own a diagnostic's disposition, category, reason code,
scope, and safe message. The framework adds pipeline origin, including stage,
step, lane, module, validator, and chunk context where applicable. It then
aggregates deterministically by disposition, category, reason code, and full
origin. Chunk context remains on representative samples so equivalent findings
across chunks aggregate together.
Diagnostics carry exact occurrence counts, at most three distinct samples, and
numeric omitted-sample metadata. Producers and validators are bounded to 64
local groups. Final actionable warning groups are bounded without truncation;
the non-warning collection may truncate represented groups while preserving an
exact total occurrence count and explicit truncation metadata.
The public contracts will be versioned: grouped actionable warnings use
`notarius.warnings.v2`, grouped advisories and observations use
`notarius.diagnostics.v1`, and the run receipt uses
`notarius.run-result.v2`. Successful output encoders return logical files or
an error; they do not add post-encoding warnings.
## Alternatives considered
- Keep one warning list and filter only CLI output. This would leave durable
consumers with the same semantically mixed, unbounded contract.
- Map reason codes to severity in a central framework registry. This would
split module-owned meaning between synchronized policy tables and make new
diagnostic meaning implicit.
- Preserve local omission warning records. They inflate visible group counts
and lose exact occurrence semantics.
- Keep output-encoder warnings. A one-pass encoder cannot include those
records consistently in files it has already serialized; a two-phase encoder
protocol is deferred until a demonstrated need exists.
## Consequences
The framework gains validated diagnostic primitives, local collection,
origin-aware aggregation, and versioned durable presentation. Existing warning
transport remains temporarily while producers migrate. Current architecture,
operator, integration, and internal documentation will describe the behavior
only as each implementation step lands; this accepted decision does not claim
that the migration is complete.

View File

@@ -0,0 +1,80 @@
# ADR-0016: Use feedback-aware module-requested retries
**Status:** Superseded by
[ADR-0022](0022-use-native-continuation-and-application-assessment.md) for execution,
assessment, and fallback, and
[ADR-0024](0024-publish-artifacts-with-native-reports-and-debug-evidence.md) for
diagnostic persistence. Module-authored guidance remains distinct from diagnostics.
**Date:** 2026-08-28
## Context
An LLM-backed module can discover that a structurally valid model response is
unsafe while translating it into a typed candidate, before the ordinary
validator chain runs. Semantic registry reconciliation is the first such case:
the shared core can identify invalid duplicate-group proposals, and typed
application can reject a domain-incompatible group while preserving a safe
partial result. Repeating the original request without the rejected response or
corrective explanation gives the model no information with which to improve.
The existing feedback-aware validation mechanism already establishes the safe
correction protocol, but module-owned retry directives also carry internal
reason codes, operator messages, and fallback diagnostics. Those values are not
model instructions. Some module retry conditions, including exhausted
structured-output repair, also have no valid exact response to append.
## Decision
An LLM-backed normalizer may attach optional, bounded model-facing correction
guidance to a module-requested retry. Guidance is a separate contract field; the
framework never derives it from a reason code, operator message, diagnostic, or
error. A feedback-capable directive must include the exact model candidate that
controlled the safe fallback and must use `single_response_v1`.
The artifact-neutral producer-attempt state machine constructs the correction
from that exact latest response and the supplied guidance. The producer rebuilds
its complete ordinary request and appends the response as one assistant message
and the guidance as one user message. Earlier attempts do not accumulate, and
the attempt consumes the same configured stage retry budget as operational,
structural, validation, and feedback-free module retries.
A module retry without guidance remains valid and starts a fresh attempt. This
is the required behavior when no valid model candidate exists, including after
structured-output repair is exhausted. If feedback is supplied without a valid
supported candidate, the framework fails the module contract rather than
retrying blindly or inventing guidance.
After retry exhaustion, the normalizer's safe fallback continues through its
validator chain. Safe semantic groups may remain applied, unsafe groups remain
separate, and bounded fallback diagnostics may explain the process degradation.
Exact responses and correction text remain attempt-local and are excluded from
ordinary errors, warnings, manifests, receipts, caches, and checkpoints.
This decision extends, rather than supersedes,
[ADR-0014](0014-feedback-aware-validation-retries.md): both correction sources
use the same transport-neutral payload, replacement-request semantics, outer
retry budget, and sensitive-data boundary.
## Alternatives considered
- Continue blind module retries. This preserves a smaller contract but wastes
the module's deterministic diagnosis and commonly repeats the same defect.
- Convert module safety checks into validators. Typed reconciliation must apply
only safe proposal groups and retain a fallback before validation; moving
artifact-owned translation and application policy into validators would blur
stage ownership.
- Copy the retry reason or operator message into the model request. Those values
are written for provenance and humans, can contain opaque internal labels,
and do not reliably describe a correct replacement.
- Require feedback for every module retry. Structural failures may have no
valid exact candidate, so this would either prevent useful fresh retries or
fabricate prior-response material.
## Consequences
The normalize retry contract and generic producer-attempt directive gain an
optional correction-guidance field and candidate-pairing validation. Modules
that use it must provide semantically meaningful bounded prose and an exact
candidate. Registry reconciliation maintains separate operator and model
renderers, and policy fingerprints change so checkpoints created under blind
retry behavior are not reused.

View File

@@ -0,0 +1,59 @@
# ADR-0017: Defer cache access policy to the deployment
**Status:** Accepted
**Date:** 2026-09-11
## Context
Canonical chunk plans and invocation checkpoints are reconstructible cache
state. They may include source-derived content, so access and retention matter,
but Notarius cannot determine whether a deployment needs a private cache or a
cache shared by a trusted group. The current application-enforced `0700` and
`0600` modes prevent ordinary Unix provisioning from making that choice.
[ADR-0005](0005-cache-canonical-chunk-plans-by-source.md) governs canonical
chunk-plan reuse, while [ADR-0006](0006-separate-output-cache-and-debug-state.md)
established the output, cache, and debug separation refined by
[ADR-0007](0007-separate-checkpoint-recording-from-reuse.md). None of those
decisions requires Notarius to own exact cache access modes.
## Decision
Deployments own cache access policy through provisioned directories, process
umask, setgid inheritance, and default ACLs. Notarius requests conventional
maximum creation modes for cache entries and leaves the kernel to select their
effective permissions.
Notarius continues to own confined paths, symlink rejection, validation,
atomic publication, cleanup, and recovery. Those correctness boundaries are
independent from deciding which accounts may access cache state.
Source-derived cache contents can be sensitive. Operators own their access and
retention policy, while API credentials remain outside cache payloads under the
existing secret boundary. Existing cache inode modes are not migrated
automatically.
This decision does not supersede ADR-0005, ADR-0006, or ADR-0007.
## Alternatives considered
- Continue enforcing private `0700` directory and `0600` file modes. This
makes one deployment choice for every operator and prevents trusted-group
provisioning.
- Add configurable Notarius permission modes or a private/group cache setting.
This preserves application ownership of a deployment concern and expands the
public configuration surface without a durable policy reason.
- Recursively converge existing cache ownership, modes, or ACLs. This would
make upgrades mutate operator-managed state and cannot safely infer an
intended policy.
## Consequences
Operators can use a restrictive umask for private cache state or provision a
setgid/default-ACL cache root for trusted-group access. They must deliberately
recreate or administratively migrate pre-existing cache trees when their
existing modes do not match the desired deployment policy.
Notarius does not add user or group management, ACL mutation, permission
configuration, or recursive cache migration. Output and debug permission
contracts remain separate from this decision.

View File

@@ -0,0 +1,57 @@
# ADR-0018: Adopt ConfigKit for configuration loading
**Status:** Accepted in part. The version 5 and dependency API selection is
superseded by [ADR-0021](0021-compose-native-kits-and-prompt-declared-resources.md).
ConfigKit adoption, application semantic ownership, and discovery-only environment
selection remain, as clarified by
[ADR-0020](0020-delegate-configuration-mechanics-to-configkit.md).
**Date:** 2026-09-13
## Context
Notarius's former configuration boundary owned strict YAML parsing, input
presence bookkeeping, defaults, normalization, environment overlays, and
configuration inspection. Those general-purpose responsibilities had grown
alongside application-specific pipeline and module semantics.
ConfigKit v0.3.0 provides strict typed YAML loading, imports, configuration
profiles, explicit CLI overrides, recorded defaults and normalization, safe
inspection rendering, and released source-origin APIs. The application needs
those source records to resolve filesystem paths according to the file that
supplied a surviving declaration.
## Decision
Notarius will adopt the root public `gitea.maximumdirect.net/eric/ConfigKit`
package at v0.3.0 for its version 5 configuration contract. ConfigKit owns
source composition, strict decoding, input presence, metadata, and safe
effective/explanation rendering. Notarius retains its typed document schema,
field semantics, runtime conversion, catalog-dependent pipeline resolution,
PromptKit profile handling, and physical run preparation.
Version 5 is a deliberate breaking file-contract change. It uses canonical
object module bindings and reference sources, and enables ConfigKit imports
and configuration profiles. The selected configuration file's canonical
directory is the base for its declared application paths; ConfigKit's released
`Resolution.InputInfo` and `Resolution.Source` APIs provide their origins.
`NOTARIUS_CONFIG` remains file discovery, while field-level operational
environment overlays are retired. Explicit configuration-valued CLI flags are
represented as ConfigKit overrides; invocation actions remain outside that
boundary.
## Alternatives considered
- Continue extending the custom YAML loader. This preserves duplicated
general-purpose parsing, presence, composition, and inspection machinery.
- Retain version 4 alongside version 5. This would leave a supported dual
configuration boundary and delay removal of the machinery being replaced.
- Wrap ConfigKit in a compatibility pre-parser. This weakens ConfigKit's
strict contract and recreates the application-owned parser complexity.
## Consequences
The released application has one ConfigKit-backed loader and one version 5
contract. Operator documentation and maintained examples move with the cutover.
ConfigKit metadata is retained only at the configuration publication boundary;
its types do not become module or runtime pipeline interfaces.

View File

@@ -0,0 +1,96 @@
# ADR-0019: Adopt native PromptKit configuration sources
**Status:** Superseded by
[ADR-0021](0021-compose-native-kits-and-prompt-declared-resources.md) for native
composition, resource ownership, and execution types, and
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md) for cache identity.
ConfigKit-owned mechanics and captured source contexts remain in force.
**Date:** 2026-10-04
## Context
PromptKit v0.12 replaces its former source options with ConfigKit-backed
configuration sources, keyed documents, recursive overlays, and native
inheritance. Notarius must choose how application-owned prompt and fallback
assets, operator configuration, and the optional local backend reach PromptKit
without recreating source parsing or inheritance in the adapter. Runtime,
preflight, and operator inspection must agree about the effective definitions.
Notarius also captures checkpoint identity for the PromptKit configuration
used by an execution engine. That identity must follow the engine's captured
definition state rather than re-reading mutable source files, and must not
publish credentials, prompt bodies, provider parameters, or source paths.
## Decision
Use PromptKit's public v0.12 native source APIs as the only PromptKit
configuration boundary. Assemble PromptKit catalogs, registered application
prompt and fallback inputs, the optional operator file or recursively selected
directory, and the optional Notarius local backend registration in that order.
Use native ConfigKit imports and PromptKit/ConfigKit composition behavior;
retain each filesystem input's resource context. Inputs within a group compose
strictly, and later groups recursively overlay earlier ones. PromptKit owns
definition parsing, exact-key `extends` inheritance, and final effective-value
validation. Notarius does not provide a legacy parser, compatibility alias,
filename-priority merger, whole-profile replacement shim, or alternate
inheritance engine.
Execution, explicit-profile preflight, and configuration inspection use the
same source construction. Each constructed engine captures its effective
definitions. Edits to source files take effect for a newly constructed engine,
not an existing one. Derive the private versioned
`promptkit_configuration` checkpoint identity from public captured inspection
and definition APIs, including effective configuration, profile targets and
credential-policy metadata, captured prompt hashes, and the PromptKit and
selected catalog identities. Retain only the digest as checkpoint metadata;
keep all digest inputs private. Exclude local-backend concurrency settings
because they affect scheduling rather than execution semantics.
Keep PromptKit types and source assembly inside the LLM integration boundary.
The CLI may project copied profile fields into a Notarius-owned neutral JSON
contract. PromptKit's effective and explanation reports remain upstream
redacted configuration and source-history views. Neither inspection path reads
credential values or contacts a provider.
## Compatibility
The migration to v0.12 keyed configuration is an intentional external file
format change. Operators must migrate `id`/`version` embedded fields and
`base_profile` to native keyed documents and `extends`. Notarius does not
silently accept the former option-based API or file format. Notarius's own
version 5 configuration contract and loader decision in
[ADR-0018](0018-adopt-configkit.md) remain in force; this decision concerns
PromptKit definitions and source composition.
The workload-oriented profile identity and D&D fallback ownership in
[ADR-0010](0010-workload-oriented-llm-profile-defaults.md) remain in force.
Only that ADR's former claim that a matching operator profile completely
replaces the fallback has been superseded: native recursive overlays retain
unspecified inherited fields.
## Alternatives considered
- Keep the removed PromptKit option-based configuration API or add a
compatibility parser. This would fork the supported upstream contract and
preserve legacy format machinery.
- Merge profile documents inside Notarius or restore whole-profile
replacement. This would duplicate upstream composition behavior and make
inspection, preflight, and runtime easier to diverge.
- Re-read and hash source files for checkpoint identity. This could describe
mutable files rather than the definitions captured by the engine and would
duplicate upstream discovery and composition.
- Expose upstream inspection structs directly as CLI output. This would bind
the public Notarius contract to dependency-owned Go types.
## Consequences
PromptKit remains the owner of its native configuration semantics, while
Notarius owns which registered and operator sources are assembled and when an
engine is reconstructed. A valid later overlay can supersede an earlier
definition; validation applies to the final effective definitions rather than
as a separate audit of every superseded value. Configuration reports can
contain ordinary prompt and provider parameters, so operators own the
destination and retention of explicitly requested reports even though
credential-shaped fields are redacted. PromptKit upgrades require review of
the source adapter, captured identity, reports, and the pinned upstream
contracts.

View File

@@ -0,0 +1,49 @@
# ADR-0020: Delegate configuration mechanics to ConfigKit
**Status:** Accepted
**Date:** 2026-10-04
## Context
[ADR-0018](0018-adopt-configkit.md) establishes ConfigKit as Notarius's
configuration loader. This decision clarifies the continuing ownership boundary
as ConfigKit's capabilities evolve.
## Decision
ConfigKit owns configuration mechanics: source loading, parsing, imports,
composition, overlays, inheritance, presence tracking, provenance, and
inspection. Notarius adopts those semantics through ConfigKit's public APIs.
Notarius owns application meaning: its configuration schema, version, defaults,
field normalization, validity checks, and pipeline/module compatibility. It
supplies application-specific defaults, normalization, and validation through
ConfigKit's supported extension points. Source-origin metadata supports
application rules such as declaration-relative filesystem paths.
Notarius selects configuration inputs and options through the public API.
ConfigKit resolves those inputs and delivers the final application document
with source composition and application-field normalization complete. Notarius
converts that document into its runtime configuration and performs
catalog-dependent pipeline resolution and runtime preparation afterward.
Operator-requested effective configuration and setting explanations use
ConfigKit's inspection APIs. Application validation evaluates the resolved
configuration. Changes to general configuration mechanics are pursued upstream
in ConfigKit and adopted through its supported API.
## Alternatives considered
- Application-owned configuration loading provides direct control over source
semantics and assigns parsing, composition, and provenance maintenance to
Notarius.
- Shared ownership of configuration mechanics allows local adaptations and
requires maintaining coordinated semantics across ConfigKit and Notarius.
## Consequences
ConfigKit provides a coherent configuration-resolution and inspection contract.
Notarius's configuration work concentrates on application semantics and operator
integration. Upstream upgrades are evaluated against this ownership boundary
and the application's deliberately selected requirements. This decision
clarifies ADR-0018 while retaining its adoption and application-format decisions.

View File

@@ -0,0 +1,75 @@
# ADR-0021: Compose native kits and prompt-declared resources
**Status:** Accepted
**Date:** 2026-11-22
## Context
Notarius duplicated configuration assembly, resource registration, completion
types, inspection, CLI parsing, and provider scheduling that the adopted kits
now supply. Keeping those wrappers would preserve competing ownership rather
than protect the application's typed artifact boundary.
## Decision
Use ConfigKit, PromptKit, CommandKit, ckconfig, and ckprompt directly at their
respective application boundaries. The composition root owns one application
load per selected configuration and constructs one shared native engine for
all selected model roles from that original result. Runtime and whole-app or
focused inspection share captured sources and native provenance, not a settings
reserialization or a second loader. ConfigKit retains ownership of composition
mechanics under [ADR-0020](0020-delegate-configuration-mechanics-to-configkit.md).
Version 6 replaces version 5 without a compatibility parser.
Assemble bundled provider resources, embedded application resources, and optional
operator companions beside the selected main source through native contexts and
precedence. Native declarations own qualified resources, inheritance, default
output contracts, and schema selections. PromptKit prepares schemas and owns
structural validation and repair. Application modules retain prompt meaning,
interpretation, and static resource-ID dependencies, not manifests, response-schema
registries, asset fingerprints, virtual mounts, or fallback-profile registration.
The root assets package remains an ordinary content-only embedded leaf.
Model-executing code uses native requests, results, exchanges, errors, and
observations. Pure domain models, codecs, source resolution, and deterministic
helpers remain independent. CommandKit and its integrations own standard command
declarations, parsing, inspection, and presentation; Notarius supplies loaders,
pipeline commands, request inputs, and report content. Shared loaders and offline
preflight do not allocate run storage or perform implicit provider probes.
One ready-job worker pool bounds extraction and merge/normalize continuations
together. Prerequisite waits occupy no worker; nested validation and correction
stay inside the current job. Native engine/backend admission is independent.
Inject no backend concurrency/queue defaults, cross-backend ceiling, extra queue,
or application capacity retries. Preserve stable scope ordering and cancellation
draining. A completed turn releases admission before nested assessment.
This supersedes [ADR-0019](0019-adopt-native-promptkit-configuration.md)'s old
source adapter and private-type boundary; its fingerprint policy is replaced by
[ADR-0023](0023-unify-accepted-artifact-and-plan-caching.md). It replaces the asset
registration portions of [ADR-0004](0004-package-modules-by-domain.md) and
[ADR-0011](0011-centralize-llm-assets.md), retaining domain-first packaging,
semantic ownership, and the content-only leaf. It replaces ADR-0018's version 5
selection, not [ConfigKit adoption](0018-adopt-configkit.md) or ADR-0020's ownership.
[ADR-0010](0010-workload-oriented-llm-profile-defaults.md)'s workload-oriented
profile intent remains; native qualified resources replace its older source form.
## Alternatives considered
- Keep private completion, loader, and inspection adapters. This duplicates kit
behavior and obscures the actual execution contract.
- Adopt only PromptKit and defer CommandKit. Temporary command/report wrappers
would need another cutover and could select different configuration.
- Retain a global LLM scheduler above native admission. This adds a second queue
and couples independent backends without a selected product requirement.
## Consequences
The kits are deliberate dependencies at execution and composition boundaries;
typed application assessment and durable domain artifacts remain distinct.
Upstream changes require review of the public APIs actually consumed, rather
than preservation of old wrappers. Workers do not promise a global provider-call
ceiling or backend saturation. CLI and configuration compatibility is intentionally
broken; artifact schemas are not redesigned. Exact public syntax and dependency
integration details belong in the canonical configuration, CLI, and integration
references, not copied library manuals here.

View File

@@ -0,0 +1,82 @@
# ADR-0022: Use native continuation and application assessment
**Status:** Accepted
**Date:** 2026-11-22
## Context
Private retry machinery conflated transient failures, structural repair,
semantic defects, and validator availability. Latest-response replacement also
discarded conversation history while requiring an application replay protocol.
Native execution can own those mechanics without owning domain acceptance.
## Decision
One small typed producer helper connects native execution to module functions
for fixed input preparation, interpretation, correction requests, and supported
fallback construction. The pipeline supplies the operation's typed assessor.
PromptKit owns transient retries, structural repair, growing conversation history,
and semantic turn iteration. Notarius selects the semantic-turn allowance but
does not pin omitted native repair/retry counts or extend exhausted native work
with an outer retry loop. Deterministic operations have no generic retry budget.
Each correctable producer has initial and correction prompts using the same
response schema and bundled default profile. Preserve explicit request selections
and run overrides. Enduring principles and source/reference material are supplied
initially; the correction template adds current findings and a new assignment.
Native coordination carries the exchange, without manual assistant replay or
rerendering original inputs. Each response is a complete replacement, not a patch.
Normalization applies each proposal afresh to fixed originals and candidate
handles; never union groups across turns.
Check native errors and structural validation status before interpretation,
including failed validation returned with nil Go error. A usable typed candidate
receives the complete applicable validator chain once, in configured order.
Earlier rejection does not suppress later guidance. Revisions, unchanged
candidates, and the final permitted response receive the whole chain; there is
no duplicate assessment after the helper returns.
The detecting validator or module authors actionable guidance separately from
reason codes and operator messages. Unavailable assessment is not a semantic
defect; provider failures do not become instructions. LLM validators execute
once per assessment, without their own semantic continuation loop. Native
success, stopped, and exhausted statuses do not imply application acceptance.
Strict is the application default. Explicit permissive mode may construct a
module-supported fallback after terminal nonacceptance. A fallback satisfies
intrinsic artifact and downstream invariants without ordinary semantic approval
or rerunning the normal validator chain. Failure to construct it fails normally.
Caller cancellation and undelivered responses never initiate fallback. A
result-less failed continuation cannot recover an earlier candidate. Reuse
exclusions and disclosure follow ADRs 0023 and 0024. Exact configuration precedence
and defaults belong in [Configuration](../config.md).
This supersedes [ADR-0014](0014-feedback-aware-validation-retries.md) and
[ADR-0016](0016-feedback-aware-module-requested-retries.md)'s budgets, private
candidate transport, latest-only replay, and terminal policies. It retains their
useful separation of actionable guidance from diagnostic prose and of execution
failure from detected defects. Diagnostic persistence is governed by
[ADR-0024](0024-publish-artifacts-with-native-reports-and-debug-evidence.md).
Contextual identity and request-local reconciliation safety under ADRs
[0012](0012-resolve-opaque-entity-identifiers-deterministically.md) and
[0013](0013-use-request-local-candidate-handles-for-semantic-reconciliation.md)
remain in force.
## Alternatives considered
- Retain blanket producer/validator retries. These can extend native budgets
and repeat deterministic work without information capable of fixing it.
- Keep latest-only manual replay. This duplicates conversation mechanics and
discards earlier application-visible turns.
- Let validators decide terminal disposition or revalidate every fallback.
That distributes acceptance policy and confuses qualified recovery with
ordinary validation.
## Consequences
Native execution and application acceptance are separate facts. Accumulated
history uses more context, bounded by the selected allowance. Not every failure
has a supported fallback: an empty scene description, for example, cannot meet
its required artifact shape. Permissive output is explicitly qualified and
reuse-ineligible rather than silently accepted. Paid-model quality and exact
provider-attempt parity with the retired loops are not promised.

View File

@@ -0,0 +1,82 @@
# ADR-0023: Unify accepted artifact and plan caching
**Status:** Accepted
**Date:** 2026-11-22
## Context
Source-keyed plans and fingerprinted checkpoints imposed two recovery models
and substantial identity/provenance machinery. The selected need is narrower:
reuse successful model-backed predecessors after downstream failure without
repeating their complete production and assessment.
## Decision
Use one best-effort filesystem cache for final accepted typed artifacts and
LLM-generated chunk plans. Prepare the initial native request once and use its
opaque MessageContentHash unchanged, with no additional identity dimensions.
Execute that same prepared handle on a miss and discard it on a hit. Corrections
do not change the key. Store the final accepted codec artifact, including applied
normalization, rather than a native response, exchange, or reconciliation proposal.
Message roles, exact text, boundaries, and order select reuse. Model/settings,
session, schema metadata, policy, library versions, and implementation changes
add no key dimensions. Text rendered into the messages participates as content.
Changed policy may therefore reuse old acceptance; operators deliberately choose
bypass or refresh when they want re-execution.
Hits receive ordinary codec and current-source usability checks, not renewed
semantic assessment, replayed exchanges, fabricated execution, or historical
usage. Cached plans are rematerialized against the current source. Unusable
entries miss. Deterministic operations remain uncached without synthetic requests.
Store only final ordinary acceptance. Failed, rejected, incomplete, canceled,
and fallback results cannot be stored. Fallback and actually affected dependent
work skip lookup as well as storage; unrelated accepted predecessors remain
reusable. Eligibility is a small handoff fact, not a dependency fingerprint graph.
Auto reads and stores acceptance; bypass does neither; refresh skips lookup and
replaces only after new acceptance. Failed refresh preserves earlier accepted
bytes. Cache I/O failures produce diagnostics without failing otherwise successful
work or repeating model calls. Records are plain accepted JSON, not envelopes,
manifests, acceptance ledgers, or copied source/execution histories. Exact root,
layout, and control precedence belong in configuration and operations references.
Ignore legacy checkpoint and source-plan records without importing, rewriting,
or deleting them. Remove explicit resume, recomputation barriers, and the separate
canonical-partition guarantee. Matching initial messages may reuse a plan; changed
prompt/reference/input content may select another partition. Retain plan range,
annotation, source-order, and deterministic materialization correctness.
This supersedes [ADR-0005](0005-cache-canonical-chunk-plans-by-source.md) and
[ADR-0007](0007-separate-checkpoint-recording-from-reuse.md), and the two-cache
model in [ADR-0006](0006-separate-output-cache-and-debug-state.md). It replaces
checkpoint/fingerprint clauses in ADRs
[0010](0010-workload-oriented-llm-profile-defaults.md),
[0011](0011-centralize-llm-assets.md),
[0013](0013-use-request-local-candidate-handles-for-semantic-reconciliation.md), and
[0019](0019-adopt-native-promptkit-configuration.md), not their retained domain,
content, or identity boundaries.
Apply [ADR-0017](0017-defer-cache-access-policy-to-deployment.md)'s permission
ownership to this unified cache: deployment umask, setgid, and default ACLs govern
effective access. Retain confined paths, symlink rejection, validation, atomic
publication, and recovery without permission convergence or automatic migration.
Output and debug retain independent roots and lifecycles.
## Alternatives considered
- Keep one canonical partition per source. This ignores changed initial task
content and retains a second lookup/publication mechanism.
- Use comprehensive execution or policy fingerprints. That changes the selected
reuse semantics and restores the removed compatibility bookkeeping.
- Cache native responses or restore conversations. Neither is the accepted typed
application result, and each requires replay or renewed interpretation.
## Consequences
Ordinary reruns recover reusable accepted predecessors without a resume request.
Acceptance under changed model or validation policy is not implied by a hit.
Cache is reconstructible and best effort, not an execution history or a storage
durability guarantee. Legacy data stays available for operator-managed cleanup;
no automatic conversion, expiry service, or garbage collector is introduced.

View File

@@ -0,0 +1,92 @@
# ADR-0024: Publish artifacts with native reports and debug evidence
**Status:** Accepted; the requirement for one native invocation ExecutionGroup is
partially superseded by [ADR-0025](0025-use-consumer-owned-execution-observation.md).
All other decisions remain accepted.
**Date:** 2026-11-22
## Context
Required manifests, receipts, indexes, reporting sidecars, and copied execution
ledgers made consumers depend on accounting rather than the domain artifacts.
Split sanitized-summary/detailed-trace machinery also duplicated native evidence
and conflated useful inspection with a stable reporting protocol.
## Decision
Domain artifacts are the primary deliverables, including supported qualified
fallbacks. Preserve intrinsic schemas and existing run-specific logical paths,
including selected chunk-map/evidence auxiliaries. Consumers need no index,
manifest, persisted receipt, warnings/diagnostics sidecars, or execution ledger.
Publish artifacts, finalize requested capture, then submit one small native
completion value and human template through CommandKit. Native formats render
that same value; no separate encoder or universal envelope is introduced.
The completion report identifies the pipeline, deliverable count, publication
directory, available debug directory, and positive fallback count. Count each
operation that emits fallback once, not its affected artifacts or attempts.
Disclose fallback independently of diagnostic verbosity. Standard commands keep
their native values. [CLI Reference](../cli.md) owns exact report fields,
stdout/stderr behavior, and outcome codes.
Preserve native operation causes separately from rendering and delivery failures.
Post-publication capture/report failure returns nonzero with available locations
while retaining valid artifacts and evidence. Failed stdout can be partial;
consumers check status before decoding a successful report. Do not rerun model
work, rewrite history, or remove published files to compensate for delivery failure.
Use one native invocation ExecutionGroup, enrolling actual initial, continuation,
and nested validator executions once. Preserve native IDs, terminal coverage,
and unknown usage without parallel totals, synthetic IDs, or a profile ledger.
Cache hits contribute no execution or historical usage.
Explicit debug selection and a nonempty effective destination enable one run
recorder. A directory alone does not enable it; explicit empty disables capture.
Allocate after configuration/run identity but before engine construction/preflight.
Update the relative latest link at start, never completion. Persist convenient
run/operation evidence incrementally and finalize once before successful reporting.
Requested allocation, recording, or finalization failures fail the invocation,
retaining primary causes and whatever evidence/publication is available.
Capture fixed inputs, configuration/composition, prepared contracts, native events,
available results and full application-visible exchanges, typed candidates,
findings/guidance, correction/normalization material, fallbacks, deterministic
results, and cache decisions. Reuse prepared evidence without another preparation
or provider call. Label undelivered responses unassessed and result-less failures
with available evidence; do not fabricate missing provider bodies. Exact filenames
and serialization remain private diagnostic choices, not a public format.
Use ConfigKit secret-aware inspection and native credential omissions. Do not
directly serialize marked secrets or collect unrelated environment/filesystem
content. Do not heuristically scrub or rewrite selected source, prompts, responses,
or arbitrary strings. A debug bundle may retain sensitive application data; it
is not promised sanitized. Operators own access and retention. Do not automatically
delete output or requested bundles. Output, cache, and debug remain independent.
This replaces [ADR-0006](0006-separate-output-cache-and-debug-state.md)'s required
output records and summary/trace split while retaining its three surfaces and
explicit debug selection. It supersedes durable reporting in
[ADR-0015](0015-separate-process-warnings-from-quality-diagnostics.md), retaining
module-owned diagnostic classification and bounded framework aggregation. It
also replaces the private attempt-record restrictions of ADRs
[0014](0014-feedback-aware-validation-retries.md) and
[0016](0016-feedback-aware-module-requested-retries.md) without moving conversation
state into ordinary artifacts or cache entries.
## Alternatives considered
- Rebuild manifests and receipts with native execution data. This preserves an
unnecessary consumer dependency and another reporting model.
- Retain sanitized summaries beside sensitive traces. Heuristic content rewriting
can alter evidence without establishing a selected sanitized-bundle guarantee.
- Treat capture failures as harmless warnings or retry model work. Requested
capture is required work, but its failure cannot repair model output.
## Consequences
Consumers use configured lane/auxiliary paths and optional native reports rather
than receipt traversal. Diagnostic files can change independently of artifacts.
Debug may duplicate evidence for convenient inspection without a complete provider
transcript guarantee. Quiet presentation does not erase fallback qualification
from the report value or turn delivery failure into success. No new access policy,
automatic retention service, release gate, or release authorization is created.

View File

@@ -0,0 +1,49 @@
# ADR-0025: Use consumer-owned execution observation
**Status:** Accepted
**Date:** 2026-11-22
## Context
Native contextual observation now reaches initial, prepared, coordinated, nested,
and concurrent execution without application request-option forwarding.
ckprompt supplies optional invocation reporting; requested debug capture needs
its own native snapshot. The runner is not a consumer of invocation accounting.
## Decision
Each interested consumer attaches native observation through its execution
context. ckprompt owns optional reporting. The CLI owns a debug group only when
capture is enabled, writes its snapshot before capture finalization after joined
work, and preserves publication-aware capture failures. Other callers own their
observers and inspect them when their work finishes.
The runner propagates the supplied context without a group input, unconditional
group allocation, or general observer forwarding through execution options.
Per-request capture observers and preparation hooks retain operation evidence
independently of invocation accounting.
Independent native groups may observe the same work. Do not add their overlapping
totals or introduce shared-group discovery or an application accounting service.
Preserve native IDs, terminal coverage, and unknown-versus-zero facts; cache hits
contribute no historical executions or usage.
This supersedes only [ADR-0024](0024-publish-artifacts-with-native-reports-and-debug-evidence.md)'s
requirement for one invocation ExecutionGroup. Its artifact, report, capture,
failure, sensitive-data, and remaining native-accounting decisions remain in force.
There is no required count of consumers or groups.
## Alternatives considered
- Keep runner-owned accounting and forward observers through requests. Native
context already supplies the mechanism; the runner does not use the totals.
- Discover and share one group between consumers. This adds ownership machinery
without a demonstrated need; independent native groups are sufficient.
## Consequences
Optional reporting and requested debug evidence coexist without a second
application ledger. No-flag execution needs no application accounting group.
CLI publication/finalization and primary causes remain application-owned.
No configuration version, prompt/model choice, artifact, cache, assessment,
worker/admission, budget, or completion-report contract changes.

View File

@@ -1,175 +1,376 @@
# CLI Reference # CLI Reference
This is the canonical reference for the implemented Notarius command-line This is the canonical reference for Notarius invocation, command inputs, reports,
interface. For the shortest successful run, see the [README](../README.md). and outcome codes. [Configuration](config.md) owns fields, defaults, resource
Configuration fields, discovery rules, and selectable module keys are defined selection, and module keys; [Operations](operations.md) owns runtime state;
in [Configuration](config.md); runtime state and recovery procedures are integration contracts own domain payloads.
defined in [Operations](operations.md).
Notarius imports native [CommandKit, ckconfig, and ckprompt](integrations/pkg-commandkit.md)
interfaces. The [upstream CLI reference][native-cli] owns their general parser, report, inspection,
and smoke semantics. The examples below show Notarius-specific selections.
Use help for every installed command's current options.
For retired command/configuration mappings and receipt-consumer changes, see
[native migration guidance](consumers/native-migration.md).
## Command Summary ## Command Summary
~~~ ~~~text
notarius help notarius --help
notarius run <pipeline-id> --input path/to/source.json [--json] [flags] notarius help pipeline run
notarius config validate [--config path/to/config.yml] [--pipeline pipeline-id] [--only lane-a,lane-b] notarius version
notarius pipelines list [--config path/to/config.yml] [--json] notarius completion bash
notarius pipeline list
notarius pipeline show PIPELINE_ID
notarius pipeline validate PIPELINE_ID
notarius pipeline run PIPELINE_ID --input-file PATH
notarius run PIPELINE_ID --input-file PATH
notarius config scopes
notarius config validate
notarius config show
notarius config sources
notarius config explain
notarius config diff
notarius promptkit list prompts
notarius promptkit show profile PROFILE_ID
notarius promptkit requirements show PROMPT_ID
notarius promptkit requirements validate PROMPT_ID
notarius promptkit show prepared PROMPT_ID
notarius promptkit test KIND
~~~ ~~~
Running Notarius without arguments, or with **help**, **--help**, or **-h**, Bare invocation, `help`, `--help`, and `-h` display native help. Help also works
writes the command summary to standard output and exits with status 0. on subcommands without their execution-only required inputs. Help, version, and
Bash/Zsh/Fish completion need no configuration, credentials, or run storage.
## run `version` reports the application identity; `version --scope commandkit` selects
the library identity. Source-tagged installation and release-linked build identity
remain available; an unversioned checkout reports `dev`. Version output
uses native report formats, not a custom root flag.
~~~ ## Syntax And Supplied Values
notarius run <pipeline-id> --input path/to/source.json [--json] [flags]
Put flags after the **complete command path**, optionally interspersed with its
operands. Value flags accept `--name value` or `--name=value`. Boolean flags
accept presence and explicit values such as `--debug=false`. `--` ends option
parsing; later tokens are operands.
Singleton flags may repeat; the last successfully parsed occurrence supplies
the value. Every occurrence is parsed, so a malformed earlier value remains an
error. Repeatable flags retain occurrence order and do not split commas.
Omission differs from supplied empty, false, and zero. Semantic validity still
depends on the selected command and native request. See
[registered syntax][syntax] for the shared rules.
## Configuration Selection
`--config PATH` fixes the main source; explicit empty fails instead of discovering
another file. Omission uses [configuration discovery](config.md#configuration-discovery-and-precedence).
Commands that support `--overlay NAME` select the native application overlay.
Configuration and pipeline commands also expose repeated `--set POINTER=JSON`:
~~~sh
notarius config show --config examples/dnd-minimal/config.yml \
--set /concurrency/workers=1 --path /concurrency/workers --format json
~~~ ~~~
The **run** command executes the named pipeline for one input file. The The value is JSON, so strings require JSON quoting. Preserve shell quoting:
pipeline ID and **--input** are required.
| Flag | Meaning | ~~~sh
notarius pipeline validate dnd-session \
--config examples/dnd-minimal/config.yml \
--set '/pipelines/dnd-session/mode="permissive"' \
--set /pipelines/dnd-session/max_additional_turns=0
~~~
Assignments use non-root mapping paths, not sequence indexes. To change a record
inside a steps/resource list, use an appropriate source/overlay or replace the
complete list. Duplicate or overlapping assignments fail. Version and inheritance
controls are not assignment targets. Overrides follow native loading and recorded
resolution; they are not an alternate YAML parser. PromptKit commands expose
their own native selection/request flags; use help rather than assuming every
configuration flag applies to them.
## Pipeline Commands
`pipeline list` lists configured IDs in sorted order without module resolution
or engine construction. `pipeline show PIPELINE_ID` resolves modules, controls,
validator chains, static prompt dependencies, steps/lanes, and reference bindings,
without expanding every LLM profile or reading input/reference content.
`pipeline validate PIPELINE_ID` performs offline domain resolution and known
prompt/profile dependency checks using the shared load and engine when needed.
It requires no input transcript, reference file bytes, credential values,
provider call, or output/cache/debug directories. Partial profiles remain valid.
This is distinct from native configuration validation: request preparation and
dynamic selections are checked when used.
Show and validate accept configuration selection and native report controls.
They inspect the complete configured pipeline; lane selection belongs to run:
~~~sh
notarius pipeline list --config examples/dnd-complete/config.yml --format json
notarius pipeline show dnd-session --config examples/dnd-complete/config.yml
notarius pipeline validate dnd-session --config examples/dnd-complete/config.yml
~~~
### Run
~~~text
notarius run PIPELINE_ID --input-file PATH [flags]
notarius pipeline run PIPELINE_ID --input-file PATH [flags]
~~~
`run` is a native alias for `pipeline run`: both resolve to the same declaration
and handler. One pipeline ID and a nonempty `--input-file` are required.
| Run flag | Meaning |
| --- | --- | | --- | --- |
| **--config path** | Use this configuration file. When omitted, configuration discovery applies; see [Configuration](config.md). | | `--config PATH`, `--overlay NAME`, `--set POINTER=JSON` | Configuration selection above. |
| **--input path** | Source input file to process. Required. | | `--input-file PATH` | Required source input file. |
| **--output-dir path** | Override the configured output root for this run. | | `--lane ID` | Repeat to select literal artifact lane IDs; commas are part of an ID, not separators. |
| **--json** | Write the successful run-result receipt as JSON to standard output. | | `--output-dir PATH` | Nonempty invocation-relative override of the output root. |
| **--chunk_cache auto\|bypass\|refresh** | Override chunk-plan cache handling for this run. | | `--cache auto\|bypass\|refresh` | Invocation-wide selection over binding and pipeline cache controls. |
| **--resume** | Reuse compatible recorded checkpoints when checkpoint recording is enabled. | | `--reference SELECTOR=PATH` | Repeatable external reference bind. |
| **--recompute-step step-id** | With **--resume**, recompute the selected ordered step and its dependent lanes. It cannot be combined with **--only**. | | `--without-reference SELECTOR` | Repeatable external reference unbind. |
| **--debug** | Retain a debug bundle for this run. | | `--debug[=true\|false]` | Native debug verbosity and independent run capture selection. |
| **--debug-dir path** | Override the debug-bundle root. Requires **--debug**. | | `--debug-dir PATH` | Capture destination override; explicit empty disables capture. |
| **--only lane-a,lane-b** | Run only the selected comma-separated artifact lanes when that selection is valid for the configured pipeline. | | `--llm-profile ID`, `--llm-session-id ID` | Native resource/session selections below. |
| **--llm-profile id** | Highest-precedence configured profile for selected LLM-backed bindings and validators; it replaces binding and [pipeline](config.md#pipelines) defaults. | | `--llm-*` execution controls | Run-wide request overrides below. |
| **--session-id id** | Override the generated prompt session identifier with a non-empty value for LLM-backed module calls. | | `--format`, `--quiet`, `--verbose`, `--progress` | Native presentation controls below. |
| **--reasoning-effort value** | Replace the selected PromptKit profile's reasoning effort for every LLM-backed call in this run. The value must be non-empty and the flag may be specified only once. |
| **--clear-reasoning-effort** | Clear reasoning effort inherited from the selected PromptKit profile for every LLM-backed call in this run. |
| **--reference selector=path** | Add or replace a file reference binding. Repeatable. |
| **--without-reference selector** | Remove a configured optional reference binding. Repeatable. |
**--chunk_cache** accepts only **auto**, **bypass**, or **refresh**. A directory alone does not enable capture. A nonempty debug-directory override
**--debug-dir**, **--output-dir**, **--session-id**, and can re-enable capture over an empty configured root, but still needs debug
**--reasoning-effort**, and **--recompute-step** reject explicit empty values. selection. `--debug --quiet` captures while suppressing stdout; `--quiet --debug`
**--reasoning-effort** and **--clear-reasoning-effort** are mutually exclusive. selects debug visibility and capture. `--debug=false` disables capture. Debug
When neither is present, reasoning effort comes from the selected PromptKit on inspection commands changes native visibility without allocating a pipeline
profile. These controls apply to the shared run client, including retries and bundle. [Configuration](config.md#concurrency-output-cache-and-debug) defines
LLM-backed validators, and do not modify configuration or profile files. directory defaults; [Operations](operations.md) owns capture lifecycle.
Persistent reasoning settings remain a PromptKit profile concern.
**--recompute-step** requires **--resume**; checkpoint requirements and reuse
behavior are documented in [Operations](operations.md).
Every run uses one effective prompt session. Without **--session-id**, Notarius Example using the maintained minimal configuration and input:
generates a stable `notarius:v1:` identifier from the trimmed resolved input
module key and the input file's exact raw bytes. The same module and bytes
therefore produce the same identifier, regardless of pipeline, references,
profile, retries, or run settings. An explicit non-empty value replaces that
default. Session identifiers are visible to providers; they are non-secret
correlation identifiers, not credential storage. See
[Operations](operations.md#operational-limits) for privacy and workflow
guidance.
### Reference selectors ~~~sh
notarius run dnd-session --config examples/dnd-minimal/config.yml \
--input-file examples/dnd-minimal/transcript.json --format json --show-tokens
~~~
Use **--reference** only for a reference slot declared by the selected This run uses a configured provider and needs its credentials when required.
configured target. The accepted selector forms are: Offline validation does not. ckprompt supplies opt-in [usage diagnostics][usage];
these do not change the Notarius completion value or domain artifacts.
Accepted-artifact hits perform no current model work; see
[reuse and recovery](operations.md#accepted-result-cache-and-recovery).
| Form | Target | ### Run-wide LLM Overrides
These canonical ckprompt flags reach initial producers, semantic corrections,
and LLM validators on the shared native engine without mutating configuration:
| Flag | Value |
| --- | --- | | --- | --- |
| slot=path | The unique selected target that declares slot. | | `--llm-profile` | Exact profile ID; qualified for collection resources. |
| chunk.slot=path | The chunker. | | `--llm-session-id` | Session selection. |
| merge.slot=path | The unique selected merger that declares slot. | | `--llm-endpoint` | Native endpoint override. |
| lane.slot=path | The unique extractor, merger, or normalizer in lane that declares slot. | | `--llm-model` | Model override. |
| lane.extract.slot=path | The extractor in lane. | | `--llm-temperature` | Numeric temperature. |
| lane.merge.slot=path | The merger in lane. | | `--llm-max-tokens` | Integer token limit. |
| lane.normalize.slot=path | The normalizer in lane. | | `--llm-top-p` | Numeric top-p. |
| `--llm-timeout-seconds` | Integer native request timeout. |
| `--llm-service-tier` | Service tier selection. |
| `--llm-reasoning-effort` | Reasoning selection; explicit empty suppresses inherited reasoning. |
| `--llm-api-key-env` | Credential environment-variable name, not its value. |
| `--llm-transient-retries` | Integer native transient-failure retry selection; explicit zero disables these retries. |
| `--llm-extra-params` | JSON provider-parameter object, preserving false/zero/null values. |
**--without-reference** uses the same selector forms without =path. Slot Omitted values remain unspecified, not the display defaults in help.
names, requiredness, and configured bindings are part of the `--llm-temperature=0` and `--llm-reasoning-effort=` retain their supplied meaning.
[configuration contract](config.md). Native target validation and provider-map rules apply; this interface does not
add a repair-model selection, structural-repair count, or generic stage retry.
Use application configuration for semantic turns and native prompt configuration
for structural contracts.
### Run output Omitted profile selection preserves binding/pipeline/prompt precedence.
Explicit `--llm-profile=` clears the application profile selection so native
prompt default selection applies. Without an explicit session flag, Notarius
generates a stable `notarius:v1:` session from the trimmed resolved input module
key and exact raw input bytes, independent of references and pipeline/profile
settings. An explicit value replaces it; explicit empty clears that generated
selection and leaves native prompt/session behavior in control. Sessions are
provider-visible correlation identifiers, not secret storage.
Without **--json**, standard output contains the completed pipeline ID, counts PromptKit convenience spellings are scoped to `promptkit` commands; run uses
of normalized and rejected outputs, and the output directory. A debug-enabled the canonical `--llm-*` names above. [Native request validation][requests]
run also prints its debug-bundle path to standard output. A successful run with documents execution controls in detail.
warnings reports the warning count to standard error. The published JSON bundle
is defined by the [JSON output contract](integrations/json-output.md).
With **--json**, successful standard output is exactly one ### Reference Selectors
`notarius.run-result.v1` JSON document followed by a newline, with no
human-oriented status or debug-path line. Its fields and compatibility policy
are defined by the [run-result contract](integrations/run-result.md). A caller
must check for exit status 0 before decoding this output; a failed write can
leave incomplete standard-output bytes that are not a result document.
Example: Bind declared slots using `--reference SELECTOR=PATH`:
~~~ | Selector | Target |
OPENROUTER_API_KEY=your-api-key \ | --- | --- |
go run ./cmd/notarius run dnd-session \ | `slot` | Every selected compatible target declaring the slot. |
--config examples/dnd-minimal.config.yml \ | `chunk.slot` | Chunker. |
--input examples/seriatim-minimal-transcript.json | `lane.slot` | Compatible extract/merge/normalize bindings in that lane. |
| `lane.extract.slot` | That lane's extractor. |
| `lane.merge.slot` | That lane's merger. |
| `lane.normalize.slot` | That lane's normalizer. |
Pipeline/lane selectors may match several targets and fail if they match none.
A binding-specific selector requires its selected target to declare the slot.
There is no stage-wide merger shorthand. CLI paths override configured external
paths; narrower selectors beat broader ones, with last occurrence winning at
equal scope. Binding and unbinding the same concrete target at equal scope fails;
narrower actions can make intentional exceptions to broader actions.
`--without-reference` uses the selector without `=PATH`. It removes external
bindings only. Neither action replaces/removes generated handoffs; collisions
fail resolution and required slots must remain bound. CLI paths use the invocation
working directory. Configuration defines slot compatibility and path origins in
[References And Ordered Handoffs](config.md#references-and-ordered-handoffs).
For a complete D&D workflow, pipeline-level references are first-class inputs:
~~~sh
notarius run dnd-session --config examples/dnd-complete/config.yml \
--input-file examples/dnd-complete/transcript.json \
--reference party=/data/references/party.txt \
--reference glossary=/data/references/glossary.txt \
--output-dir /data/results --format json
~~~ ~~~
## config validate ### Completion Report
~~~ Successful runs publish domain files and finalize requested capture before
notarius config validate [--config path/to/config.yml] [--pipeline pipeline-id] [--only lane-a,lane-b] reporting one small value:
| Field | Meaning |
| --- | --- |
| `pipeline` | Selected pipeline ID. |
| `artifact_count` | Published deliverable files, including reused artifacts and enabled auxiliaries; excludes intermediates/cache/debug. |
| `output_directory` | Absolute run-specific publication directory, not the configured root. |
| `debug_directory` | Optional absolute run capture directory; omitted when disabled. |
| `fallback_count` | Producer operations that emitted fallback, present only when positive. |
Text summarizes pipeline, count, and path, appending capture location when
available. Fallback success is explicitly qualified, even when warnings are
hidden. Affected downstream artifacts, attempts, and validators are not extra
fallbacks. JSON/YAML serialize the same value; report format does not change
domain artifact encoding. There is no persisted receipt, execution ledger,
universal envelope, or automatic duplicate report file.
Consumers check status, optionally decode the report, and read configured
lane/auxiliary paths. A failed stdout write may leave partial bytes. A failure
after publication can leave valid artifacts; the failure explanation identifies
available paths. [JSON output](integrations/json-output.md) owns logical artifact
paths and payload contracts, not this report.
## Configuration Commands
The native scopes are `app` (default) and `promptkit`. Both inspect the same
application-owned load; the latter focuses native PromptKit settings. Use
`config scopes` for supported operations. No inspection command implicitly runs
a pipeline or provider.
~~~sh
notarius config validate --config examples/dnd-minimal/config.yml
notarius config show --scope app --config examples/dnd-minimal/config.yml
notarius config sources --config examples/dnd-complete/config.yml
notarius config explain --config examples/dnd-minimal/config.yml \
--path /concurrency/workers --format json
notarius config show --scope promptkit --config examples/dnd-minimal/config.yml
notarius config diff --config examples/dnd-minimal/config.yml \
--against-config examples/dnd-complete/config.yml --check
~~~ ~~~
This command loads and validates a configuration. With **--pipeline**, it also Show supports `--path`; explain supports `--list`, `--path`, and native history/
resolves that pipeline against the production module catalog. **--only** selects filter options. Focused PromptKit paths retain the `/promptkit` prefix, for
lanes during that resolution and requires **--pipeline**. example `/promptkit/collections/notarius/profiles`. Diff accepts separate
right-side configuration, overlay, and assignment inputs; differences with
`--check` yield status 3. These commands
report native values and secret-aware source evidence, not copied Notarius
inspection objects. Consult [native configuration commands][configuration]
for complete report and comparison semantics. Use `pipeline validate`, not
configuration validation, for production module/reference/resource preflight.
Success is written to standard output as either config "<path>" is valid or ## PromptKit Commands
config "<path>" is valid for pipeline "<pipeline-id>".
Examples: The installed native suite includes:
~~~ - listings of prompts, profiles, backends, namespaces, and collections;
go run ./cmd/notarius config validate \ - inspection of a named prompt, profile, or backend;
--config examples/dnd-minimal.config.yml \ - requirements discovery, concrete request validation, and prepared preview;
--pipeline dnd-session - explicit smoke tests: `reachability`, `authentication`, `text_inference`,
`structured_output`, or `all`.
OPENROUTER_API_KEY=validation-placeholder \ ~~~sh
go run ./cmd/notarius config validate \ notarius promptkit list prompts --config examples/dnd-minimal/config.yml \
--config examples/dnd-complete.config.yml \ --namespace notarius
--pipeline dnd-session notarius promptkit show profile notarius/dnd-extraction \
--config examples/dnd-minimal/config.yml --format json
notarius promptkit requirements show notarius/dnd.spells \
--config examples/dnd-minimal/config.yml
~~~ ~~~
The placeholder in the second command is sufficient only for offline Resource/requirements inspection needs no transcript, credential values, or
validation; it cannot run a provider-backed pipeline. provider call. Profile reports describe the stored profile before backend
completion and request overrides; partial profiles are valid. Request validation
and `show prepared` actually prepare native requests and may read supplied
resources or require credentials according to the target, but do not call a
model. Prepared reports can contain rendered application data.
## pipelines list Use `--llm-var KEY=VALUE`, `--llm-input-text NAME=TEXT`, or
`--llm-input-file NAME=PATH` for concrete prompt inputs. These are not the
pipeline's source input. Namespace flags choose namespaces for short IDs;
already-qualified IDs remain unchanged. Native convenience aliases are installed
only on their applicable PromptKit commands; use help to see them.
~~~ Smoke tests are explicit and may contact providers or perform inference.
notarius pipelines list [--config path/to/config.yml] [--json] The [native smoke contract][smoke] owns their target selection, observations,
~~~ and default presentation; choose `--format json` or `--format yaml` when parsing
their reports. Neither debug nor inspection silently launches a smoke test.
This command lists configured pipeline IDs in sorted order. By default, it Full native mechanics are documented under
writes one ID per line to standard output. **--json** writes an object shaped as [inspection][inspection], [preview][preview], [requirements][requirements],
{"pipelines":[...]} instead. [resource listings][catalogs], and [smoke tests][smoke].
~~~
go run ./cmd/notarius pipelines list \
--config examples/dnd-minimal.config.yml
~~~
## Output Streams And Exit Statuses ## Output Streams And Exit Statuses
Successful commands write their primary result to standard output. Warnings and Results go to stdout; failures, native diagnostics, and progress go to stderr.
errors are written to standard error. `--format text|json|yaml` selects report presentation. Default run presentation
uses its human template; native command defaults belong in the
[upstream reference][native-cli].
`--format` does not reformat help, completion scripts, diagnostics, or domain
payloads.
For **run --json**, warnings remain on standard error and standard output is a Only one visibility mode is active; the last enabled `--quiet`, `--verbose`,
machine-readable success result only. Syntax and runtime diagnostics remain on or `--debug` wins. Ordinary mode hides optional warning/info/debug messages;
standard error. Parse the result only after the process exits with status 0. verbose shows warning/info; debug adds debug and default progress. Explicit
`--progress=false` disables progress, and quiet suppresses it. Quiet suppresses
stdout but retains failure explanations; formatting errors can still fail a
quiet command. Run capture selection remains independent of that final mode.
`--format json --verbose` keeps successful stdout report-only JSON while useful
diagnostics go to stderr. No application-wide structured error envelope is
introduced; failed stdout is not a success document.
| Status | Meaning | | Status | Meaning |
| --- | --- | | --- | --- |
| 0 | The command completed successfully, including root help. | | `0` | Command completed, including supported permissive fallback with report qualification. |
| 1 | Command syntax was valid but configuration loading or validation, pipeline resolution or execution, provider use, output, or requested debug handling failed. | | `1` | Operational failure, cancellation, publication/capture/presentation failure, or an unclassified/mixed failure. |
| 2 | The command or flag syntax was invalid, including unknown commands, missing required arguments, invalid flag values, or invalid flag combinations. | | `2` | Invalid invocation or identifiable invalid configuration. |
| `3` | Native configuration differences with diff check mode. |
The root help spellings are the supported help path. Invoking **--help** on Native causes and classification remain intact. Not every resource/preflight
**run**, **config validate**, or **pipelines list** is handled by the flag failure is identifiable invalid configuration. Rendering or diagnostic delivery
parser as a usage error: it writes an error to standard error and exits with failure can change an otherwise successful result to failure; callers check the
status 2. actual process status. See [native outcomes][outcomes] for library conventions.
[native-cli]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md
[syntax]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#registered-command-syntax
[configuration]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#configuration-scopes
[requests]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#concrete-request-validation
[inspection]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-definition-inspection
[preview]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-prepared-request-preview
[requirements]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-requirements
[catalogs]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-catalogs
[smoke]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-smoke-testing
[usage]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-usage-reporting
[outcomes]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#outcome-status

View File

@@ -1,341 +1,394 @@
# Configuration # Configuration
This is the canonical reference for Notarius configuration. Configuration files This is the canonical reference for Notarius configuration fields, defaults,
are YAML and must declare version 4. They select pipelines and their modules; source selection, and selectable modules. The sole application version is
the [CLI reference](cli.md) owns invocation syntax, and `6` (also accepted as `"6"`). [CLI Reference](cli.md) owns invocation syntax;
[Operations](operations.md) owns run-state procedures. [Operations](operations.md) owns physical state and recovery; integration
contracts own artifact payloads.
Upgrading an older deployment or caller? Use the
[native migration guide](consumers/native-migration.md).
## Configuration Discovery And Precedence ## Configuration Discovery And Precedence
Commands that load configuration choose a file in this order: Configuration-consuming commands select one main file:
1. a non-empty **--config** CLI value; 1. Explicit `--config`, which must not be empty.
2. a non-empty **NOTARIUS_CONFIG** environment value; 2. Nonblank `NOTARIUS_CONFIG`.
3. the installed default file at **/usr/local/etc/notarius/config.yml**, when 3. `notarius.yml`, then `notarius.yaml`, in the working directory.
it exists. 4. Go's user configuration directory: first its `notarius/` subdirectory,
trying `notarius.yml`, `notarius.yaml`, `config.yml`, `config.yaml`,
`main.yml`, `main.yaml`; then the two `notarius.*` names directly beneath it.
5. `/usr/local/etc/notarius/`, then `/etc/notarius/`, with those six names;
finally `/etc/notarius.yml` and `/etc/notarius.yaml`.
The command fails if none of these paths provides a configuration file. Generic working-directory filenames and home-directory searches are not enabled.
Missing discovery candidates advance the search; a selected missing, unreadable,
or invalid explicit source fails without fallback. Exhausted discovery fails.
Discovery selects a main file rather than layering every candidate.
Use explicit selection for services and subprocesses.
For configuration values, precedence is: One ConfigKit result contains the application and native PromptKit settings.
Its source layers, from lower to higher priority, are:
1. built-in defaults; 1. The bundled OpenRouter resource underlay.
2. the selected YAML file; 2. Embedded Notarius prompts/profiles and their filesystem-backed schema root.
3. supported operational environment variables; and 3. Optional operator companions beside the **actual selected main file**:
4. the CLI run overrides that apply to a command. `prompts.yml` and recursively selected `*.yml`/`*.yaml` files in `prompts/`.
These form one strict peer group: filenames do not confer priority and
conflicting contributions fail.
4. The selected application main source and its native import graph.
5. The selected ConfigKit overlay.
Environment variables do not provide a second configuration schema. They only Companions are wrapperless native PromptKit settings mounted at `/promptkit`.
override the fields listed below. They are optional only when absent; malformed or unreadable selected content
fails. The loader does not search the invocation directory for substitute
companions. A companion's imports and content-file paths retain its native
source context. Main imports use their declared destinations; main-file native
settings belong beneath `promptkit`.
Source assembly, inheritance, typed defaults/decoding, explicit configuration
overrides, application normalization, and validation use ConfigKit's native
processing order. Overrides cannot repair earlier parse, composition, version,
inheritance, or decoding errors. The same captured result serves inspection and
engine construction, not a separate profile loader.
The overlay selector is a name: `development` selects
`overlays/development.yml` under the selected main source's configuration root.
Empty and exact lowercase `default` select the base. A missing selected overlay
fails; there is no overlay stack or extension fallback. Application overlays are
distinct from PromptKit profiles. See [ConfigKit's selected-overlay contract][overlays].
Only `NOTARIUS_CONFIG` participates in application environment selection.
Credential environment names are native PromptKit settings, not field-level
application environment overlays.
## Maintained Examples ## Maintained Examples
- [Minimal D&D configuration](../examples/dnd-minimal.config.yml) is a - [Minimal](../examples/dnd-minimal/config.yml): embedded resources only, Seriatim
single-lane Seriatim-to-spell pipeline. input, generic chunking, and one spell lane.
- [Complete D&D configuration](../examples/dnd-complete.config.yml) uses - [Complete](../examples/dnd-complete/config.yml): ordered steps and all D&D
ordered steps, all implemented D&D lanes, generated references, state families, generated references, independent state roots, workers, cache/mode/
settings, bounded LLM concurrency, and the maintained turn controls, and selected domain auxiliaries. Its
[operator profile](../examples/profiles/dnd-extraction.yml). [companion](../examples/dnd-complete/prompts.yml) demonstrates native profile
and backend inheritance without replacing native queue defaults.
- The complete [pipeline fragment](../examples/dnd-complete/pipelines/dnd-session.yml)
and [first-step fragment](../examples/dnd-complete/pipelines/dnd-session.describe-session.yml)
retain declaration-relative imports and references. Its development pipeline
selects a derived profile and zero semantic correction turns. The
[development overlay](../examples/dnd-complete/overlays/development.yml)
demonstrates serial workers and cache bypass.
Use these complete files as starting points rather than combining the The examples use separate directories so complete-example companions do not
illustrative fragments in this reference. alter minimal-example selection. Use these full files as starting points;
the fragments below illustrate individual settings.
## File Shape And Defaults ## File Shape And Defaults
Unknown fields, duplicate mapping keys, empty identifiers, and identifiers that Application fields are strict. Unknown application fields, duplicate mapping
become duplicates after trimming whitespace are rejected. Every top-level field keys, blank identifiers, and identifiers duplicated after trimming are rejected.
other than **version** is optional. PromptKit-owned resource records use the [native format][formats], including its
extension-field and strict nested-object rules; arbitrary extension fields are
not automatically secret.
| Field | Type | Default | Rules | | Root field | Type | Default / meaning |
| --- | --- | --- | --- | | --- | --- | --- |
| **version** | integer | none | Required; must be 4. | | `version` | integer or quoted string | Required; `6` only, without translation of older versions. |
| **promptkit** | object | none | Profile source and optional local-backend configuration. | | `promptkit` | native settings | Embedded and bundled resources, overlaid by selected sources. |
| **pipelines** | map | empty | Maps pipeline IDs to pipeline definitions. | | `pipelines` | map | Empty; maps IDs to pipeline definitions. |
| **concurrency** | object | see below | Global LLM and extraction limits. | | `concurrency.workers` | positive integer | `64`; one shared ready-job pool. |
| **output** | object | see below | Published output settings. | | `output.directory` | nonempty path | `./notarius-output`. |
| **cache** | object | see below | Chunk-plan and checkpoint settings. | | `cache_directory` | path | Omitted or empty selects `os.UserCacheDir()/notarius`. |
| **debug** | object | see below | Debug-bundle root only; it does not enable capture. | | `debug.directory` | path | Omitted selects `/tmp/notarius-debug`; explicit empty disables capture. |
Built-in defaults are: Nonempty relative application destinations and reference paths resolve from the
file contributing the surviving declaration, including imported, overlaid, or
inherited values. A child replacement keeps the child's origin. Built-in relative
destinations use the selected main file's directory; invocation path overrides
use the working directory. Absolute paths remain absolute.
| Field | Default | An empty output directory is invalid. Empty cache selection deliberately chooses
| --- | --- | the per-user default; on Linux this normally follows `XDG_CACHE_HOME` or
| **concurrency.total_llm** | 16 | `~/.cache`. Null is not a universal substitute for omission or empty: effective
| **concurrency.stage_workers.extract** | Effective **total_llm** | types and application validation still apply. Directory selection does not
| **output.directory** | **./notarius-output** | configure filesystem access policy or enable debug. See
| **cache.chunk_plans.mode** | **auto** | [Operations](operations.md) for lifecycle, permissions, and provisioning.
| **cache.chunk_plans.directory** | Empty, selecting the per-user chunk-plan root |
| **cache.checkpoints.enabled** | false |
| **cache.checkpoints.directory** | Empty, selecting the per-user checkpoint root |
| **debug.directory** | **./notarius-debug** |
An empty cache directory in YAML deliberately selects the corresponding ## Imports And Sibling Inheritance
per-user root. An explicit empty output or debug directory is invalid.
Root `config` contains native controls such as imports and sequence declarations.
For example:
~~~yaml
config:
imports:
- path: pipelines/dnd-session.yml
required: true
~~~
Imports are optional by default. Paths, directory selection, destinations,
sequence-item placement, source containment, and dependency-ready assembly order
follow [ConfigKit's import contract][imports]. Imported fragments need not repeat
the application version. A nested application field named `config` is ordinary
data, not another source-control block.
Mapping inheritance names a sibling, such as `extends: production` inside
`pipelines`. Identified-list inheritance uses an identity mapping such as
`extends: {id: parent}`. Parents must survive in the same sibling collection;
these are not paths or cross-namespace references.
Child mappings recursively overlay parents. Scalars and null replace inherited
values; an empty mapping does not clear existing fields. Lists follow their
native registered/declared composition policy. Pipeline steps are identified by
`id`: native upsert replaces a matching **whole record** in place and appends
new IDs. It does not patch fields of a matching step. Unidentified lists replace
as whole values across layers. Explicit replace with `[]` clears a list; empty
append/upsert does not. Validator lists are not automatically identified.
An identified record's `extends` can retain a distinct sibling's fields before
applying child changes. All surviving records remain real validated records,
not template-only definitions. Every final pipeline step executes and lane IDs
must be unique across the pipeline; inheriting a step's lanes does not remove
them. Pipeline-level inheritance with step upsert is suitable for full variants.
Omitted fields inherit; explicit zero, false, and empty collections retain their
presence. Null can clear an inherited value but remains subject to that field's
type and fallback semantics. Omitting `extends` retains a lower relationship;
`extends: null` cancels that relationship rather than independently deleting
other composed fields. `extends` is a reserved native configuration key, not
ordinary module-option data. See [native inheritance][inheritance] and
[sequence composition][sequences] for full rules.
Explicit configuration assignments use native mapping paths. They cannot walk
sequence indexes, assign the version, or introduce inheritance controls. Mapping
values overlay; list values replace the whole decoded list. Inheritance/defaulting
does not run again afterward. [CLI Reference](cli.md#configuration-selection)
owns assignment syntax.
## PromptKit Profiles ## PromptKit Profiles
The optional **promptkit** object selects one source of profile definitions and Native `promptkit` settings contain identified `backends`, `profiles`, and
may register one conventional local OpenAI-compatible backend: `prompts` lists, plus a `collections` mapping. Notarius embeds its resources
in `collections.notarius`. Runtime IDs are qualified, for example
`notarius/dnd-extraction` and `notarius/dnd.spells`; the bundled root backend
is `openrouter`. Resource IDs are literal, not resource-version paths.
A collection's local record ID omits its namespace; references to resources in
that collection use the qualified runtime ID.
A wrapperless companion can add a profile variant:
~~~yaml ~~~yaml
version: 4 collections:
notarius:
promptkit: profiles:
profile_dir: ./profiles - id: campaign
# profile_file: ./profiles.yml extends: {id: dnd-extraction}
local_backend:
endpoint: http://localhost:8000/v1
concurrency_limit: 2
~~~
| Field | Type | Rules |
| --- | --- | --- |
| **profile_dir** | string | Non-empty directory containing profile files. |
| **profile_file** | string | Non-empty profile file. |
| **local_backend** | object | Optional registration for the conventional PromptKit backend ID **local**. |
| **local_backend.endpoint** | string | Required when **local_backend** is present; absolute HTTP or HTTPS URL with a host. |
| **local_backend.concurrency_limit** | integer | Optional non-negative limit; defaults to 0. |
Set at most one of **profile_dir** and **profile_file**. Relative values use
the process working directory, not the configuration file's directory. The
complete example's `./examples/profiles/dnd-extraction.yml` value is therefore
valid when Notarius is launched from the repository root; use an absolute path
for services and containers.
An operator source is optional. For a requested ID, PromptKit checks the
configured operator source first, then Notarius's embedded fallback profiles,
then its own built-in catalog. A matching profile is complete: it replaces a
lower-precedence definition rather than merging with it. The maintained
[`dnd-extraction` operator profile](../examples/profiles/dnd-extraction.yml)
is a secret-free deployment artifact; production, development, and local
deployments can each provide a complete definition with that same workload ID.
Use workload-oriented IDs for new profiles instead of model names.
[Operations](operations.md#promptkit-profile-deployment) owns the deployment
workflow and credential-handling guidance.
When **local_backend** is present, its endpoint is trimmed and must use HTTP or
HTTPS case-insensitively, be absolute, and have a non-empty host. URL paths are
allowed. User information, queries, and fragments are rejected. A zero
**concurrency_limit** leaves the local backend unrestricted inside PromptKit;
a positive value limits simultaneous local generations. The application-wide
**concurrency.total_llm** limit still applies in both cases. Neither local
backend field has an environment override. Omitting **local_backend** registers
nothing and preserves existing built-in and endpoint-only profile behavior.
A file-backed PromptKit profile selects the registration by its case-sensitive
backend ID:
~~~yaml
id: local-summary
backend: local
model: example-model model: example-model
~~~ ~~~
Keep credentials out of the local-backend object. A PromptKit profile may name The pipeline can then select `llm_profile: notarius/campaign`. In the main
its credential environment variable through `api_key_env`; set that variable application file, place that same mapping beneath `promptkit`. The parent
only in the run environment. PromptKit owns the reference is local to the same profile list; profile/backend references otherwise
[pinned profile-file format](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.5.0/docs/formats.md). name their intended exact ID. The [complete companion](../examples/dnd-complete/prompts.yml)
The [PromptKit upstream boundary](integrations/pkg-promptkit.md) identifies the shows a runnable inherited backend/profile combination.
supported package API, and [Operations](operations.md#operational-limits)
describes the effective concurrency layers.
`notarius config validate --pipeline <id>` resolves the selected pipeline and Later same-ID resources replace complete lower records, not selected fields.
inspects every explicit effective profile without contacting a provider or Use a distinct inherited sibling to retain a parent's fields; replacing a record
requiring credential values. It rejects absent, malformed, or incompatible with only one changed field does not implicitly keep the old definition.
profiles before a run prepares modules. Credential availability is checked only Native `extends`, explicit null, list policy, and source contexts apply to
when a generation is prepared. resources just as to other configuration. See [resource inheritance][resource-inheritance].
## Migrating Version 3 Configuration The embedded D&D profile selects `openrouter`, model `openai/gpt-5.6-luna`,
a `240` second timeout, and `flex` service tier, leaving reasoning unset.
Initial/correction pairs share their bundled default profile. Explicit application
profile selections and run overrides reach producers, validators, and correction
requests; validators can otherwise select their own profile.
Version 3 files are not decoded or rewritten. Change **version: 3** to The complete example's `limited-openrouter` inherits the bundled OpenRouter
**version: 4** and rename the top-level **scriptorium:** section to provider selection. Changing an inherited endpoint to another provider also
**promptkit:**. Version 4 decoding is strict, so a remaining **scriptorium** requires a deliberate provider override. The [native backend definitions][backends]
field is rejected as unknown. own provider, `zero_cost`, and authentication semantics; Notarius adds no cost
default or automatic probe. Partial profiles remain valid, with concrete readiness
checked at preparation rather than inferred from resource inspection.
## Operational Environment Variables Notarius injects **no backend concurrency or queue defaults**. Native admission
is shared by backend ID within the engine, independently of workers; distinct
IDs do not automatically share capacity even if their endpoints match. An
endpoint-only profile has no backend identity. Configure native backend limits
when desired; the [upstream backend contract][backends] owns defaults and queue
semantics.
These variables are applied after YAML values: Profile omission, explicit values, and null differ. For example, native null
`endpoint` or `api_key_env` permits backend fallback, while an explicitly empty
string clears those sources; zero sampling values remain intentional. Blank/null
reasoning suppresses the outbound control. Changing backend/model does not
automatically clear unrelated explicit inherited settings. Use the
[native defaults table][profile-defaults], not inferred old-wrapper behavior.
| Variable | Overrides | Rules | Only credential environment **names** belong in files, never values. Native
| --- | --- | --- | secret-aware inspection preserves marked secret omissions; arbitrary prompt,
| **NOTARIUS_TOTAL_LLM_CONCURRENCY** | **concurrency.total_llm** | Integer. | source, or extension data is not promised safe to disclose.
| **NOTARIUS_STAGE_WORKERS_EXTRACT** | **concurrency.stage_workers.extract** | Integer. |
| **NOTARIUS_OUTPUT_DIR** | **output.directory** | Non-empty path. |
| **NOTARIUS_CACHE_CHUNK_PLANS_MODE** | **cache.chunk_plans.mode** | **auto**, **bypass**, or **refresh**. |
| **NOTARIUS_CACHE_CHUNK_PLANS_DIR** | **cache.chunk_plans.directory** | Non-empty path. |
| **NOTARIUS_CACHE_CHECKPOINTS_DIR** | **cache.checkpoints.directory** | Non-empty path. |
| **NOTARIUS_DEBUG_DIR** | **debug.directory** | Non-empty path. |
Integer values are trimmed then parsed as base-10 integers. Directory and ### Prompt Output Contracts And Schemas
output values reject NUL characters. **NOTARIUS_CONFIG** participates only in
configuration discovery. Prompt declarations select response format, validation mode, and schema. Bundled
initial, correction, and validator prompts omit structural-repair counts:
Notarius inherits the upstream default, not an independent application-pinned
count. Native prompt customization can explicitly change that budget. Transient
provider retries are also native, distinct from application semantic turns.
See [native output contracts][output-contract].
Schemas may be inline, `schema_file` relative to its contributing source, or
`schema_path` within an explicit applicable `schema_root`. Exactly one schema
selection is used for JSON Schema mode. Null clears an alternative; switching
forms can require clearing the inherited selection. Native preparation reads
and compiles schemas; configuration/preflight does not read them.
Embedded Notarius prompts use their collection's filesystem-rooted schemas.
A nonnull collection root takes precedence over the root `promptkit.schema_root`;
absent/null collection roots fall back to that application root. A nonnull blank
root is invalid. Replacing `collections.notarius.schema_root` selects the new
context for its remaining path-based schemas. A missing file does not fall back
to embedded or working-directory roots. Other collections are unaffected.
Schema resources must be self-contained; native schema rules are in
[PromptKit's schema reference][schemas].
## Concurrency, Output, Cache, And Debug ## Concurrency, Output, Cache, And Debug
~~~yaml `concurrency.workers` bounds active ready extraction and lane-completion jobs
concurrency: together, including their validation/correction. It must be positive, has no
total_llm: 2 application maximum, and is independent of CPU count and native backend limits.
stage_workers: Explicit `1` gives serial jobs. Waiting for prerequisites occupies no worker;
extract: 2 nested validators do not request another worker. It is not a cross-backend
output: provider-call ceiling.
directory: ./notarius-output
cache:
chunk_plans:
mode: auto
directory: ./notarius-cache/chunk-plans
checkpoints:
enabled: true
directory: ./notarius-cache/checkpoints
debug:
directory: ./notarius-debug
~~~
**concurrency.total_llm** must be greater than zero. The only supported `output.directory`, `cache_directory`, and `debug.directory` select independent
**concurrency.stage_workers** key is **extract**; its value must be from 1 roots. `/var/cache/notarius` is the convention for an explicitly provisioned
through **total_llm**. When omitted, it is recalculated from the effective system-wide cache, not the per-user default. No directory setting creates a
**total_llm** after YAML and environment precedence. permission policy or retention service.
**cache.chunk_plans.mode** accepts **auto**, **bypass**, or **refresh**. A configured debug destination alone does not enable capture. Explicit empty
**cache.checkpoints.enabled** is a boolean. The CLI can override the output disables it; a nonempty invocation override can re-enable it. Native debug
directory and chunk-plan mode for one run; see [CLI reference](cli.md#run). selection and presentation modes are independent. See [CLI Reference](cli.md#run)
for invocation controls and [Operations](operations.md) for state handling.
## Pipelines ## Pipelines
Each **pipelines** entry has a unique, non-empty ID and the following shape: Each nonblank `pipelines` key defines a configured pipeline.
~~~yaml | Field | Type | Default / rules |
pipelines: | --- | --- | --- |
dnd-session: | `llm_profile` | string | Optional qualified profile selection; explicit blank/null is invalid. |
llm_profile: dnd-extraction | `mode` | `strict\|permissive` | Producer terminal mode; see below. |
input: seriatim | `max_additional_turns` | nonnegative integer | Semantic correction allowance excluding the initial response. |
chunk: generic | `cache` | `auto\|bypass\|refresh` | Eligible model-result reuse policy. |
output: json | `input` | binding | Required. |
artifacts: | `chunk` | binding | Defaults to `generic`. |
spells: | `output` | binding | Defaults to `json`. |
extract: dnd/spells | `artifacts` | lane map | Compact single-step form, mutually exclusive with `steps`. |
merge: appendorder | `steps` | ordered list | Nonempty when selected; each record has a unique nonblank `id`, `artifacts`, and optional `references`. |
normalize: dnd/spells | `references` | map | External reference defaults for compatible targets. |
~~~
| Field | Type | Default | Rules | A lane ID is unique across all steps. Each lane requires `extract`, defaults
| --- | --- | --- | --- | `merge` to `appendorder`, and defaults `normalize` to `noop`. References and
| **llm_profile** | string | none | Optional non-empty default PromptKit profile ID for selected LLM-backed bindings and validators. An explicitly present blank value is invalid. | validator overrides belong on eligible bindings, not lane-wide fields.
| **input** | module binding | none | Required. | Ordered steps finish before their generated artifacts feed later steps.
| **chunk** | module binding | **generic** | Optional. |
| **output** | module binding | **json** | Optional. |
| **artifacts** | map | none | Compact single-step lane map. |
| **steps** | list | none | Ordered lane definitions. Mutually exclusive with **artifacts**. |
| **references** | map | none | External reference defaults for eligible targets. |
Use either **artifacts** or **steps**. The compact **artifacts** form is an For each selected LLM role, profile precedence is explicit invocation override,
implicit single step. An explicit **steps** list must be non-empty; every step binding `llm_profile`, pipeline `llm_profile`, then native prompt default.
needs a unique non-empty **id**, an **artifacts** map, and may have Deterministic roles do not receive LLM defaults/overrides and reject explicit
**references**. A lane ID must not appear more than once in a pipeline, profile assignments. A supplied empty invocation profile clears the application
including across explicit steps. selection and lets the prompt default apply; configured blank profiles are invalid.
For each selected LLM-backed binding or validator, profile selection occurs ### Producer Controls
after module, validator, and `--only` lane selection. It uses the
run-level **--llm-profile** value first, then the binding's **llm_profile**,
then the pipeline's **llm_profile**, and finally the PromptKit default.
Deterministic bindings do not receive these defaults or run overrides.
A lane has these fields: Chunk, extract, merge, and normalize bindings resolve controls before execution:
| Field | Type | Default | Rules | | Control | Precedence, highest first | Default |
| --- | --- | --- | --- | | --- | --- | --- |
| **extract** | module binding | none | Required. | | `mode` | Binding, pipeline, application | `strict` |
| **merge** | module binding | **appendorder** | Optional. | | `max_additional_turns` | Binding, pipeline, application | `2` |
| **normalize** | module binding | **noop** | Optional. | | `cache` | Explicit invocation cache, binding, pipeline, application | `auto` |
| **references** | map | none | Supported compatibility alias for **extract.references**. |
| **validators** | list | none | Non-empty lane-level lists are rejected. Set validator overrides on a binding instead. |
The lane-level **references** alias remains accepted. When the alias and Omission inherits. Zero turns disables semantic correction; a positive allowance
**extract.references** bind the same slot, **extract.references** wins. Use is not a requirement to use every turn. The complete applicable validator chain
the binding-local form in new configurations. assesses each usable initial/revised candidate, including the final permitted
response. Native coordination owns conversation/iteration; the allowance does
not count transport retries or structural repair. Deterministic work does not
acquire conversations or generic retries.
Strict requires an accepted result. Permissive explicitly permits only the
module's supported fallback, with intrinsic shape/source/downstream checks,
without claiming ordinary semantic approval or rerunning the normal chain.
A whole-source D&D scene plan, empty extraction collection where valid, or safe
final normalization groups/merged input are supported directions. Scene
descriptions cannot use an invalid empty collection or fabricated description.
Unsupported fallback construction fails; cancellation stops without fallback.
Eligible cacheable work uses `auto` to read/store accepted results, `bypass`
for neither, and `refresh` to skip reads and replace only after new acceptance.
Failures preserve earlier acceptance. Fallback and actually affected dependent
work skip both lookup and storage; unrelated predecessors remain reusable.
Settings/policy changes may still reuse old accepted content; select bypass/
refresh when deliberately applying changed policy. Best-effort cache I/O does
not fail otherwise successful work. [Operations](operations.md) owns recovery
and physical storage, not a checkpoint/resume contract.
## Module Bindings And Validators ## Module Bindings And Validators
Use a module key directly when no other binding fields are needed: Every module binding is an object containing `module`, even without options.
~~~yaml | Binding field | Meaning |
input: seriatim | --- | --- |
~~~ | `module` | Registered compatible key; required. |
| `llm_profile` | Optional nonblank qualified profile for an LLM-backed role. |
| `mode`, `max_additional_turns`, `cache` | Resolved producer controls above. |
| `options` | Selected module's strict option object. |
| `references` | Declared slots on chunk/extract/merge/normalize bindings. |
| `validators` | Ordered replacement chain on those producer bindings. |
Use an object for fields: Omitted validators use the production default. `validators: []` replaces it
with an empty chain; a nonempty list replaces it in listed order. Null is not an
empty list. Validator bindings accept only `module`, optional LLM-backed
`llm_profile`, and `options`; they have no separate producer mode, semantic-turn
allowance, references, or nested validators. Each validator executes once per
candidate assessment. Intrinsic codec/schema checks remain with an empty chain,
as do source parsing, plan materialization, and necessary module/fallback/cache
construction checks. Ordinary artifact citation existence/containment checks
are supplied by configured validators and can be omitted by chain replacement.
See [default chains](#production-validator-keys-and-default-chains).
~~~yaml The `json` output options are:
extract:
module: dnd/spells
llm_profile: dnd-extraction
retries: 2
references:
spell_catalog: ./dnd-spell-catalog.json
~~~
| Binding field | Type | Default | Rules | | Option | Default / rules |
| --- | --- | --- | --- | | --- | --- |
| **module** | string | none | Required for an object binding. Must be a registered compatible key. | | `include_chunk_map` | Boolean, default false; publish when enabled and available. |
| **llm_profile** | string | none | Optional non-empty PromptKit profile ID for an LLM-backed binding. It overrides the pipeline default unless the run supplies **--llm-profile**. | | `evidence_context` | Omitted disables publication; otherwise a strict object. |
| **retries** | integer | 0 | Non-negative additional attempts for chunk, extract, merge, and normalize bindings. | | `evidence_context.enabled` | Required boolean; false permits no other evidence fields. |
| **options** | object | none | Must satisfy the selected module. | | `evidence_context.lanes` | When enabled, required nonempty list of unique trimmed configured lane IDs. |
| **references** | map | none | Valid only on chunk, extract, merge, and normalize bindings. | | `evidence_context.window_units` | When enabled, nonnegative integer, default `3`; zero keeps only directly cited units. |
| **validators** | list | production chain | Valid only on chunk, extract, merge, and normalize bindings. |
Omitting **validators** uses the registered chain. **validators: []** selects Filtered-out configured lanes contribute no evidence. Unknown or incompatible
an empty chain; a non-empty list replaces the chain in the listed order. options fail. Evidence is opt-in because it can persist source text and metadata.
Validator bindings accept only **module**, **llm_profile**, and **options**. Logical formats belong to [chunk-map](integrations/chunk-map.md) and
They reject **references**, **retries**, and nested **validators**. Deterministic [evidence-context](integrations/evidence-context.md) contracts.
validators reject an explicit **llm_profile**. Deterministic module bindings
also reject an explicit **llm_profile**.
The **json** output module accepts optional **include_chunk_map** and
**evidence_context** settings:
~~~yaml
output:
module: json
options:
include_chunk_map: true
evidence_context:
enabled: true
window_units: 3
lanes:
- npc-registry
- spells
~~~
**include_chunk_map** is a boolean and defaults to false. It adds the accepted
chunk map when one exists; its wire format is defined in the
[chunk-map contract](integrations/chunk-map.md).
Omitting **evidence_context** disables evidence publication. When present, it
is an object with these strict fields:
| Field | Type | Rules |
| --- | --- | --- |
| **enabled** | boolean | Required. `false` permits no other evidence fields. |
| **lanes** | array of strings | Required and non-empty when enabled. Each value is trimmed and must be unique; every value must name a configured pipeline lane. |
| **window_units** | non-negative integer | Optional when enabled; defaults to 3. Zero retains only directly cited units. |
Unknown outer or nested option fields are rejected, as are incompatible YAML
types. The allowlist remains valid when a run uses lane filtering: a configured
lane that is not active for that invocation simply contributes no evidence.
Evidence publication is opt-in because it can persist source text and metadata.
When enabled, it publishes the selected source-unit excerpt defined by the
[Published Evidence Context contract](integrations/evidence-context.md).
## References And Ordered Handoffs ## References And Ordered Handoffs
Reference maps bind named slots that the selected target declares. A scalar is Reference maps bind named slots that the selected target declares. An external
an external path. Pipeline-level maps accept only external paths; step-local reference is an object with `path`. Pipeline-level maps accept only external
and binding-local maps may also select a normalized artifact from an earlier paths; step-local and binding-local maps may also select a normalized artifact
step: from an earlier step:
~~~yaml ~~~yaml
steps: steps:
- id: describe-session - id: describe-session
artifacts: artifacts:
npc-registry: npc-registry:
extract: dnd/npc-registry extract:
normalize: dnd/npc-registry module: dnd/npc-registry
normalize:
module: dnd/npc-registry
- id: extract-events - id: extract-events
references: references:
npc_registry: npc_registry:
@@ -344,20 +397,28 @@ steps:
lane: npc-registry lane: npc-registry
artifacts: artifacts:
spells: spells:
extract: dnd/spells extract:
normalize: dnd/spells module: dnd/spells
normalize:
module: dnd/spells
~~~ ~~~
An artifact selector contains only **step** and **lane**. The producer must be An artifact selector contains only **step** and **lane**. The producer must be
an earlier step and the selected artifact must be compatible with the consumer an earlier step and the selected artifact must be compatible with the consumer
slot. A generated binding supplies one accepted normalized artifact; it does slot. A generated binding supplies one normalized artifact in memory, including a
not name a file. A configured generated dependency remains required even when supported qualified fallback; it does not name a file. A configured generated
that consumer slot is otherwise optional. dependency remains required even when that consumer slot is otherwise optional.
Pipeline references are defaults. A matching step-local or binding-local Pipeline references are configuration defaults. A matching step-local or
external path overrides a pipeline default. Required slots must be bound after binding-local external path overrides a pipeline default. CLI reference
these configuration values and any CLI reference overrides are applied. bindings are then operational overrides of configured external paths; their
Reference paths in YAML are resolved relative to the configuration file. pipeline, lane, and binding scopes and precedence are defined by the
[CLI reference](cli.md#reference-selectors). A CLI file reference cannot
replace a configured generated artifact handoff. Required slots must be bound
after configuration and CLI reference actions are applied. A YAML reference
path resolves from the file that supplies its surviving declaration, including
an imported fragment or selected overlay. CLI reference paths resolve relative
to the process working directory.
### D&D Reference Slots ### D&D Reference Slots
@@ -401,7 +462,7 @@ normalized combat-turn module may use optional **npc_registry**. Location occurr
require **location_registry** for extraction and normalization. Item occurrences require require **location_registry** for extraction and normalization. Item occurrences require
**item_registry** for extraction and normalization. Enemy-event extraction requires all **item_registry** for extraction and normalization. Enemy-event extraction requires all
four of its JSON artifact slots; its normalizer requires **npc_registry**. four of its JSON artifact slots; its normalizer requires **npc_registry**.
The [complete example](../examples/dnd-complete.config.yml) shows the ordered The [complete example](../examples/dnd-complete/config.yml) shows the ordered
generated bindings. generated bindings.
## Production Module Keys ## Production Module Keys
@@ -447,11 +508,32 @@ Available validator keys are:
| Item occurrences | **extract/dnd/item-occurrences/shape**, **extract/dnd/item-occurrences/registry**, **extract/dnd/item-occurrences/source_refs**, **extract/dnd/item-occurrences/source_relatedness**, **normalize/dnd/item-occurrences/invariants** | | Item occurrences | **extract/dnd/item-occurrences/shape**, **extract/dnd/item-occurrences/registry**, **extract/dnd/item-occurrences/source_refs**, **extract/dnd/item-occurrences/source_relatedness**, **normalize/dnd/item-occurrences/invariants** |
| Item registry | **extract/dnd/item-registry/shape**, **extract/dnd/item-registry/source_refs**, **extract/dnd/item-registry/source_relatedness**, **normalize/dnd/item-registry/identity** | | Item registry | **extract/dnd/item-registry/shape**, **extract/dnd/item-registry/source_refs**, **extract/dnd/item-registry/source_relatedness**, **normalize/dnd/item-registry/identity** |
| NPC occurrences | **extract/dnd/npc-occurrences/shape**, **extract/dnd/npc-occurrences/registry**, **extract/dnd/npc-occurrences/source_refs**, **extract/dnd/npc-occurrences/source_relatedness**, **normalize/dnd/npc-occurrences/invariants** | | NPC occurrences | **extract/dnd/npc-occurrences/shape**, **extract/dnd/npc-occurrences/registry**, **extract/dnd/npc-occurrences/source_refs**, **extract/dnd/npc-occurrences/source_relatedness**, **normalize/dnd/npc-occurrences/invariants** |
| Scene descriptions | **extract/dnd/scene-descriptions/shape**, **extract/dnd/scene-descriptions/source_refs**, **extract/dnd/scene-descriptions/source_relatedness**, **normalize/dnd/scene-descriptions/invariants** | | Scene descriptions | **extract/dnd/scene-descriptions/shape**, **extract/dnd/scene-descriptions/source_refs**, **extract/dnd/scene-descriptions/source_relatedness**, **extract/dnd/scene-descriptions/combat_semantics** (LLM-backed, opt-in), **normalize/dnd/scene-descriptions/invariants** |
| Enemy events | **extract/dnd/enemy-events/shape**, **extract/dnd/enemy-events/engagements**, **extract/dnd/enemy-events/source_refs**, **extract/dnd/enemy-events/source_relatedness**, **normalize/dnd/enemy-events/invariants** | | Enemy events | **extract/dnd/enemy-events/shape**, **extract/dnd/enemy-events/engagements**, **extract/dnd/enemy-events/source_refs**, **extract/dnd/enemy-events/source_relatedness**, **normalize/dnd/enemy-events/invariants** |
| Location registry | **extract/dnd/location-registry/shape**, **extract/dnd/location-registry/source_refs**, **extract/dnd/location-registry/source_relatedness**, **normalize/dnd/location-registry/identity** | | Location registry | **extract/dnd/location-registry/shape**, **extract/dnd/location-registry/source_refs**, **extract/dnd/location-registry/source_relatedness**, **normalize/dnd/location-registry/identity** |
| Location occurrences | **extract/dnd/location-occurrences/shape**, **extract/dnd/location-occurrences/registry**, **extract/dnd/location-occurrences/source_refs**, **extract/dnd/location-occurrences/source_relatedness**, **normalize/dnd/location-occurrences/invariants** | | Location occurrences | **extract/dnd/location-occurrences/shape**, **extract/dnd/location-occurrences/registry**, **extract/dnd/location-occurrences/source_refs**, **extract/dnd/location-occurrences/source_relatedness**, **normalize/dnd/location-occurrences/invariants** |
`extract/dnd/scene-descriptions/combat_semantics` is not in a production default chain. To opt in, replace the scene extractor validator chain with the current ordered chain plus the semantic validator last, and retain a positive semantic-turn allowance if a rejection should request a corrected scene:
~~~yaml
extract:
module: dnd/scene-descriptions
max_additional_turns: 1
validators:
- module: generic/valid_json
- module: extract/dnd/scene-descriptions/shape
- module: extract/dnd/scene-descriptions/source_refs
- module: generic/valid_json_schema
- module: extract/dnd/scene-descriptions/source_relatedness
- module: extract/dnd/scene-descriptions/combat_semantics
~~~
An override replaces, rather than extends, the default chain. See [Module Bindings And Validators](#module-bindings-and-validators) for binding and profile rules, and [producer controls](#producer-controls) for semantic correction and terminal mode.
The validator runs once per candidate assessment. Native transient retries and
structural repair remain internal to that execution; there is no separate
validator semantic-turn allowance.
When no override is configured, production D&D bindings use the following When no override is configured, production D&D bindings use the following
ordered chains. Each row lists extract then normalize; spell chains are the ordered chains. Each row lists extract then normalize; spell chains are the
same at both stages. same at both stages.
@@ -473,18 +555,29 @@ Chains are only registered for the D&D extract and normalize modules shown
above; select an explicit override when a different compatible chain is above; select an explicit override when a different compatible chain is
required. required.
## Validation ## Validation And Inspection
Validate a file and one pipeline before running it: Configuration validation checks the selected native application document.
Pipeline validation additionally resolves production modules/options, validator
targets, references, generated handoffs, and statically known prompt/profile
dependencies. It needs no transcript, reference bytes, credential values,
provider calls, or state directories. Partial profiles pass; request-time data
and dynamic selections remain runtime checks. [CLI Reference](cli.md#pipeline-commands)
owns commands for both boundaries.
~~~sh Native whole-app and focused PromptKit inspection use the same selected result
go run ./cmd/notarius config validate \ and secret-aware provenance. Profile inspection describes stored fields, not a
--config examples/dnd-minimal.config.yml \ prediction of a completed request; prepared preview is the native request boundary.
--pipeline dnd-session See [configuration commands](cli.md#configuration-commands) and
~~~ [PromptKit commands](cli.md#promptkit-commands).
Configuration validation rejects invalid YAML, unsupported fields, invalid [formats]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md
defaults or environment overrides, incompatible module keys, unknown options, [backends]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md#backend-definitions
invalid reference bindings, missing required reference slots, invalid validator [profile-defaults]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md#defaults-and-overrides
overrides, and incompatible generated artifact handoffs. Use [resource-inheritance]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md#resource-inheritance
[pipelines list](cli.md#pipelines-list) to inspect configured IDs. [output-contract]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md#output-contract
[schemas]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md#schemas
[imports]: https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md#explicit-imports
[overlays]: https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md#selected-overlays
[inheritance]: https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md#sibling-inheritance
[sequences]: https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md#strict-document-composition

View File

@@ -0,0 +1,145 @@
# Consuming The Complete D&D Pipeline
This guide applies the [subprocess workflow](subprocess.md) to the maintained
complete D&D configuration. [CLI Reference](../cli.md) owns invocation and the
native report; [Configuration](../config.md) owns composition;
[Published JSON Output](../integrations/json-output.md) owns logical paths.
[Migration guidance](native-migration.md) covers older orchestrators.
## Prepare The Deployment
Start from [examples/dnd-complete/config.yml](../../examples/dnd-complete/config.yml).
Preserve its imported pipeline fragments, native companion, and reference files,
or update the paths deliberately. It uses every implemented D&D family, ordered
generated handoffs, and selected chunk-map/evidence output.
Native embedded defaults and the maintained companion already provide profile/
backend definitions. A deployment can supply variants rather than being required
to recreate them. YAML paths retain the contributing declaration's origin;
CLI reference paths use the process working directory. Absolute caller paths
are useful for services. Keep credentials in the intended environment, not
files, arguments, sessions, or logs.
Preflight without credentials or inference:
~~~sh
notarius config validate --config /absolute/path/to/notarius.yml
notarius pipeline validate dnd-session --config /absolute/path/to/notarius.yml
~~~
## Supply The Transcript And References
Use the [Seriatim JSON contract](../integrations/seriatim.md). Preserve segment
IDs because artifact citations use those source-unit ranges. If the caller
maintains a final trimmed transcript tier, select that same session content
consistently for later consumers.
Run with explicit input/output and pipeline-level references:
~~~sh
notarius run dnd-session \
--config /absolute/path/to/notarius.yml \
--input-file /absolute/path/to/transcripts/final.trimmed.json \
--output-dir /absolute/path/to/notarius-output \
--reference party=/absolute/path/to/references/party.txt \
--reference players=/absolute/path/to/references/players.txt \
--reference glossary=/absolute/path/to/references/glossary.txt \
--reference spell_catalog=/absolute/path/to/references/spells.json \
--format json
~~~
Only supply optional references the deployment maintains. Unqualified selectors
reach every selected target declaring the slot; narrower overrides follow the
[selector contract](../cli.md#reference-selectors). Generated registry, scene,
combat, and NPC-occurrence handoffs stay in pipeline configuration, not CLI file
bindings.
The ordinary input-based session is suitable without an override. Use
`--llm-session-id` only to intentionally change its native selection.
Sessions correlate provider routing; they are not credential or output identities.
Capture stdout/stderr separately, propagate cancellation, impose an appropriate
caller deadline, and wait for completion. Parse a successful report only after
status zero; failed writes can leave partial stdout. Nonzero status after
publication can still leave valid artifacts for deliberate recovery.
## Locate And Read Artifacts
Use the report's absolute `output_directory`, not a newest-directory scan.
The report's exact fields and fallback qualification belong in
[CLI Reference](../cli.md#completion-report). There is no receipt schema,
index/manifest traversal, or descriptor inventory to load.
The complete configuration uses safe literal lane IDs: each table entry below
is at `lanes/<lane-id>.json` beneath that run directory. Decode the configured
domain contract directly. All ten lane artifacts plus the two enabled/available
auxiliaries give twelve deliverables; a count is not a substitute for checking
the files required by the caller.
## Complete Artifact Inventory
| Lane ID | Purpose | Canonical contract |
| --- | --- | --- |
| `item-registry` | Canonical registry of encountered items and currency. | [Item registry](../integrations/dnd-item-registry-artifacts.md) |
| `npc-registry` | Canonical registry of named NPCs. | [NPC registry](../integrations/dnd-npc-registry-artifacts.md) |
| `location-registry` | Canonical registry of named locations. | [Location registry](../integrations/dnd-location-registry-artifacts.md) |
| `scene-descriptions` | Classification, title, and summary for each scene. | [Scene descriptions](../integrations/dnd-scene-description-artifacts.md) |
| `item-occurrences` | Source-grounded item discovery, acquisition, use, transfer, and loss events. | [Item occurrences](../integrations/dnd-item-occurrence-artifacts.md) |
| `spells` | Source-grounded spell casts and casters. | [Spell casts](../integrations/dnd-spell-artifacts.md) |
| `combat-turns` | Source-grounded combat turn participation. | [Combat turns](../integrations/dnd-combat-turn-artifacts.md) |
| `npc-occurrences` | Source-grounded NPC interaction occurrences. | [NPC occurrences](../integrations/dnd-npc-occurrence-artifacts.md) |
| `location-occurrences` | Source-grounded location occurrences. | [Location occurrences](../integrations/dnd-location-occurrence-artifacts.md) |
| `enemy-events` | Source-grounded enemy combat events. | [Enemy events](../integrations/dnd-enemy-event-artifacts.md) |
The complete configuration also selects two pipeline-wide files:
- [`chunk-map.json`](../integrations/chunk-map.md), the materialized plan/chunks.
- [`evidence-context.json`](../integrations/evidence-context.md), the union of
selected cited units and their configured surrounding window.
They are not lanes and need no discovery descriptor. Their intrinsic payload
schemas are unchanged. Evidence is reading context, not authoritative lane
attribution; surrounding units do not widen citations in lane artifacts.
No index, manifest, rejection/warning/diagnostic sidecars are required.
## Decide Consumer Acceptance
Process completion does not establish the caller's required artifact set,
semantic quality, or fresh validation under changed policy. A complete-workflow
caller should check all ten required lane files against their contracts. A
subset consumer can choose a narrower set deliberately. Empty valid domain
collections remain distinguishable from missing/incompatible files.
Explicit permissive execution can complete with qualified fallback. Decide
whether to accept that and inspect positive `fallback_count` when relevant.
The count identifies emitting operations, not individual affected lanes.
Fallbacks satisfy intrinsic/downstream invariants but not ordinary semantic
approval; valid downstream results affected by them also avoid cache reuse.
Default cache reuse does not repeat semantic assessment. For a deliberate model/
policy experiment requiring fresh inference, select bypass/refresh under
[configuration controls](../config.md#producer-controls). Do not look for retired
validation ledgers or treat optional debug serialization as an API.
[Native usage diagnostics](https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-usage-reporting)
are optional and separate from the completion report and artifact retrieval;
accepted-result hits add no current model work.
Retain useful domain files and caller-owned invocation/report evidence. Capture
failure after publication does not invalidate completed artifact writes, but
requires deliberate caller recovery rather than parsing partial success output.
A failed publication can leave an incomplete directory. Transcript-derived
artifacts, evidence, cache, debug, and streams can contain private campaign data;
apply the caller's sharing and retention choices.
## Consumer Checklist
- Validate application configuration and the selected pipeline offline.
- Preserve Seriatim source-unit IDs.
- Pass source, output root, and optional campaign references as first-class inputs.
- Keep generated handoffs configured; avoid external/generated collisions.
- Separate streams, propagate cancellation, and check status before parsing.
- Use the native report directory and configured domain/auxiliary paths.
- Decode supported payload contracts and check the caller's explicit required set.
- Decide whether qualified fallback and cached acceptance meet caller needs.
- Retain only the artifact/report/evidence records useful to the caller.
- Treat source-derived data as sensitive; do not rely on a sanitized debug bundle.

View File

@@ -0,0 +1,143 @@
# Migrating To Native Configuration And Commands
This guide maps retired Notarius interfaces to the implemented native workflow.
It is migration material: the old spellings below are not accepted aliases.
[Configuration](../config.md), [CLI Reference](../cli.md), and
[Operations](../operations.md) own the current contracts. Domain artifact schemas
and lane filename mapping are unchanged.
## Update Caller Arguments
| Former interface | Current equivalent / intent |
| --- | --- |
| `notarius --version` | `notarius version`. |
| `pipelines list` | `pipeline list`. |
| `config validate --pipeline ID` | `pipeline validate ID`; native `config validate` checks the application document. |
| `config effective` | `config show`; scopes are `app` and `promptkit`. |
| Positional `config explain POINTER` | `config explain --path POINTER`; use native list/history options for discovery. |
| `config profile ID` | `promptkit show profile QUALIFIED_ID`; this reports stored fields, not a copied completed target. |
| `--config-overlay NAME` | `--overlay NAME`. |
| Run `--input PATH` | `--input-file PATH`. |
| `--only a,b` | Repeat literal `--lane a --lane b`; commas are no longer separators. |
| `--json` | `--format json`; YAML/text are also native report formats. |
| `--session-id ID` | `--llm-session-id ID`. |
| `--reasoning-effort VALUE` | `--llm-reasoning-effort VALUE`. |
| `--clear-reasoning-effort` | Explicit `--llm-reasoning-effort=`; omission retains native inheritance. |
| `--resume`, `--recompute-step`, separate `--chunk_cache`/`--chunk-cache` | Ordinary accepted-result reuse, with invocation-wide `--cache auto\|bypass\|refresh`. No explicit resume or selective checkpoint barrier. |
`run` and `pipeline run` are two native routes to the same command. Put flags
after the complete command path. Singleton occurrences are all parsed, with the
last successfully parsed value retained. False/zero/empty supplied values are not
omission. Canonical `--llm-*` execution overrides reach producers, correction,
and validators; shorter ckprompt aliases apply only to their installed PromptKit
commands. Help works offline on subcommands.
## Migrate Configuration And Resources
Version 6 is the sole application version; bumping the header alone does not
translate old fields. Use the maintained
[minimal](../../examples/dnd-minimal/config.yml) or
[complete](../../examples/dnd-complete/config.yml) configuration as a starting point.
- Replace `promptkit.profile_file`, `profile_dir`, and `local_backend` wrappers
with native settings beneath the main file's `promptkit`, or wrapperless
`prompts.yml` / recursive `prompts/` companions beside that selected main file.
Companion files form strict peers, not filename-priority layers.
- Use identified `backends`, `profiles`, and `prompts` lists with literal `id`
values and collections. The embedded profile is
`notarius/dnd-extraction`; initial/correction prompt IDs are also qualified,
for example `notarius/dnd.spells` and `notarius/dnd.spells.repair`.
- The root bundled backend is `openrouter`. Retired external provider catalogs
are not loaded as parallel sources; declare needed backends/profiles through
native resources. Do not infer backend identity from an endpoint or model.
- Use native root `config` imports and preserve declaration-relative paths.
Remove old per-prompt resource-version wrappers such as `v1`; resource IDs no
longer select those versions.
- A later same-ID resource replaces the whole earlier record. Use a distinct
sibling with `extends: {id: parent}` to retain fields, not a partial same-ID
replacement or self-inheritance. Profile/backend references to collection
resources use qualified IDs; sibling inheritance is local to its list.
- Preserve deliberate null/empty/zero choices under native semantics. Null
endpoint/key-environment values can allow backend fallback; empty strings can
clear those sources. Inspect native effective values/history rather than
assuming old wrapper null behavior.
- Keep prompt-declared schemas. Inline schemas, source-relative `schema_file`,
and explicit-root `schema_path` are native alternatives. Replacing a collection
schema root does not retain missing-file fallback to embedded resources.
Review [native resource and schema rules](../config.md#promptkit-profiles) before
reusing an old profile file. The complete example's
[companion](../../examples/dnd-complete/prompts.yml) demonstrates current inheritance.
## Separate Retry Intent, Mode, And Capacity
Producer `retries` intended for semantic correction becomes
`max_additional_turns`, excluding the initial response. Binding overrides pipeline;
omission inherits and explicit zero disables semantic correction. Native growing
continuation replaces latest-only manual replay, and each revised candidate gets
the full applicable assessment chain, including its final permitted turn.
Remove validator `retries`, generic deterministic retries,
`structured_output_repair_attempts`, and the application `promptkit.transient_retries`
wrapper. PromptKit owns transient failures and structural repair. Run-wide
transient customization uses `--llm-transient-retries`; structural customization
belongs in native prompt output contracts. Bundled prompts leave repair counts
unspecified. Former total provider-attempt parity is not promised.
Replace failure-category `validation_policy` and its `fail_run`, `reject_output`,
and `warn_continue` choices with producer `mode: strict|permissive`. Strict is
the default, including normalization. Permissive explicitly requests a supported
module fallback, not incomplete ordinary acceptance. Cancellation does not fall
back; unsupported fallback construction fails. Completion discloses actual
fallback emitters independently of warning visibility.
Replace `concurrency.total_llm` and `concurrency.stage_workers.extract` with
`concurrency.workers`, covering ready extraction and lane completion together.
Choose native backend capacity independently. There is no cross-backend global
LLM ceiling, inferred per-backend translation, or extra capacity queue/retry.
The [configuration reference](../config.md#concurrency-output-cache-and-debug)
owns current defaults and controls.
## Replace Both Legacy Caches
Replace nested `cache.chunk_plans` / `cache.checkpoints` directories and recording
switches with root `cache_directory` and pipeline/binding `cache`. An explicit
invocation `--cache` overrides every binding. Auto reads/stores acceptance;
bypass does neither; refresh skips reads and replaces only after new acceptance.
The initial prepared native message-content hash selects final accepted artifacts
and LLM plans. A hit is decoded/usability-checked, not semantically revalidated.
Model/settings/policy changes can still hit; use refresh/bypass for experiments
requiring fresh work. Source identity alone no longer fixes chunk boundaries.
Fallback and actually affected consumers skip reuse; unaffected predecessors
remain reusable after downstream failure. Failed refresh preserves old acceptance.
Do not copy, convert, or delete legacy records as an upgrade prerequisite. They
remain ignored and untouched, and the new cache populates through ordinary work.
[Operations](../operations.md#accepted-result-cache-and-recovery) owns recovery
and deployment-permission guidance.
## Replace Receipt And Sidecar Traversal
Stop expecting `notarius.run-result.v2`, `index_file`, validation histories,
warning counts, `index.json`, `manifest.json`, or reporting-only rejection/
warning/diagnostic files. Check process status, optionally decode the
[native completion report](../cli.md#completion-report), then read configured
lane/auxiliary [domain paths](../integrations/json-output.md).
Use the report's absolute run directory, not a guessed run ID or newest-folder
scan. Count actual deliverables rather than old normalized-output totals.
The report does not establish fresh validation or model quality; decide whether
positive fallback qualification is acceptable. Failed stdout can be partial,
and post-publication failure can leave valid artifacts with a nonzero status.
Debug remains explicitly selected and independent of native visibility modes.
Directory-only configuration does not enable it; explicit empty disables it.
The relative `latest` link updates at start, not completion. Full selected
evidence replaces the old summary/trace hierarchy; filenames/JSON shapes remain
private and arbitrary application content is not heuristically sanitized.
Do not replace receipt traversal with a debug-layout dependency or a new manifest.
Update callers using the [subprocess guide](subprocess.md) or
[complete D&D workflow](dnd-pipeline.md). These changes do not publish a new release
or rewrite historical release notes.

View File

@@ -1,77 +1,98 @@
# Using Notarius As A Subprocess # Using Notarius As A Subprocess
Use this workflow when an orchestrator runs Notarius and consumes its published Use this workflow to run Notarius and consume domain files. [CLI Reference](../cli.md)
artifacts. The [CLI reference](../cli.md) owns invocation syntax and exit owns commands, reports, and statuses; [Published JSON Output](../integrations/json-output.md)
statuses, while the [run-result receipt](../integrations/run-result.md) and owns logical paths and payload links; [Operations](../operations.md) owns state
[Published JSON Output contract](../integrations/json-output.md) own the and recovery. See the [complete D&D workflow](dnd-pipeline.md) for its inventory
durable result formats. or [migration guidance](native-migration.md) for older callers.
## Run And Check The Process ## Prepare And Run
Optionally preflight a selected configuration and pipeline before work starts: Use an argument vector with explicit paths appropriate to the deployment.
Absolute paths avoid dependence on a service's working directory. Keep stdout
and stderr separate, and choose caller cancellation/deadline behavior.
```sh Validate the application and pipeline offline:
notarius config validate --config /path/to/notarius.yml --pipeline pipeline-id
```
Invoke the run with explicit paths and machine-readable output. Capture ~~~sh
standard output and standard error separately; do not combine them before notarius config validate --config /absolute/path/to/notarius.yml
processing the result. notarius pipeline validate pipeline-id \
--config /absolute/path/to/notarius.yml --overlay production
~~~
```sh Omit the overlay for the composed base. Pipeline validation needs no transcript,
reference bytes, credentials, provider call, or state directory.
Then run with first-class source and output inputs:
~~~sh
notarius run pipeline-id \ notarius run pipeline-id \
--config /path/to/notarius.yml \ --config /absolute/path/to/notarius.yml --overlay production \
--input /path/to/source.json \ --input-file /absolute/path/to/source.json \
--output-dir /path/to/output-root \ --output-dir /absolute/path/to/output-root --format json
--json ~~~
```
Use absolute paths for supplied input, configuration, output-root, and Pass external references as separate arguments, for example
reference files. Notarius generates a stable prompt session for the resolved `--reference party=/absolute/path/to/party.txt`. Unqualified selectors reach
input module and exact input bytes. Pass **--session-id** only when intentionally compatible selected targets; narrower selectors are exceptional overrides.
grouping different invocations under a different session. Supply credentials Generated same-run handoffs stay configured, not CLI files. The
through Notarius's documented configuration and environment mechanisms, never [reference selector contract](../cli.md#reference-selectors) owns matching and
as command-line arguments or generated secret-bearing configuration. In precedence.
particular, a session identifier is provider-visible and is not a credential
mechanism.
Wait for the process before interpreting standard output. Only an exit status Supply credentials through the intended process environment, not arguments,
of 0 permits decoding the receipt. On a nonzero exit, retain standard error for session IDs, generated files, or logs. Omitted session selection uses the
diagnosis and ignore all standard-output bytes: a failed receipt write may have input-based default; use the [native override](../cli.md#run-wide-llm-overrides)
left a partial document. only when intentionally changing it.
## Discover Required Artifacts ## Check Completion Before Parsing
Decode the successful receipt and accept the schema versions supported by the Wait for completion. Only successful status permits interpreting stdout as a
caller. Use its `output_directory` as the bundle root. For the production JSON successful native report. Optional [native usage diagnostics](https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-usage-reporting)
output, resolve `index_file` under that root with a confinement check and reject do not change this stdout/artifact contract and are not a durable usage API.
an absolute path or a result that escapes the root. Failed delivery can leave partial bytes; retain stderr
and available locations rather than parsing a structured error envelope.
Read the resulting `index.json` and locate each artifact by `lane_id`, not by a Optionally decode the [small completion report](../cli.md#completion-report).
guessed filename. Before decoding a selected payload, verify its descriptor's Its `output_directory` is the exact run root; do not scan for the newest folder
media type and schema identity against the relevant published artifact or guess a run ID. The report is not a persisted receipt, schema-version envelope,
contract. The JSON bundle contract links to the available lane contracts. index, or validation/execution ledger.
If `index.json` has an `evidence_context` descriptor, treat it as a A completed run may contain supported fallback. The caller decides whether that
pipeline-wide artifact rather than a lane entry. Verify its six descriptor is acceptable; inspect positive `fallback_count` when relevant. It counts
fields before decoding the linked file according to the [Published Evidence emitting operations, not affected files. Reuse performs ordinary usability checks,
Context contract](../integrations/evidence-context.md). Decode its top-level not fresh semantic assessment. Callers needing new inference/assessment after
source-unit array as a reading excerpt. Obtain authoritative citations and lane policy changes deliberately select bypass/refresh under the
provenance from the normalized lane artifacts; the excerpt has neither and its [cache controls](../config.md#producer-controls).
nearby units do not widen a lane artifact's cited source reference.
A zero exit status may still report rejected outputs, warnings, or absent ## Read Required Domain Files
lanes. The caller decides which lane IDs are required for its own work and
which are optional; it should make that decision explicitly rather than infer
failure from the receipt counts alone.
## Preserve Provenance And Handle Data Carefully Define required/optional lanes from the selected pipeline. Read their
[documented paths](../integrations/json-output.md#bundle-layout) beneath the
report directory and decode using the configured artifact contracts. For custom
lane IDs, apply the unchanged filename mapping; collisions are command failures.
No receipt/index traversal, manifest descriptors, or reporting sidecars are needed.
Keep the receipt with the published `manifest.json`, and retain Optional chunk-map/evidence files use their documented paths when enabled and
`rejected.json` and `warnings.json` when review or later provenance requires available. Decode supported payload schemas. Evidence is a reading excerpt, not
them. Treat the input, output bundle, cache, debug bundle, and captured process authoritative lane attribution or a widened citation; normalized lane payloads
logs as potentially sensitive data. Apply the caller's access controls and retain those contracts.
retention policy, and avoid copying secrets into arguments, logs, or
provenance records. An evidence-context artifact contains source-unit text and Process completion, required artifact availability/compatibility, and caller
metadata and can cover most of an input; preserve and share it only when that acceptance requirements are separate checks. A count alone cannot identify
source content is authorized for the recipient. which files were produced.
## Preserve Useful Evidence
Keep domain files and caller-owned invocation/report records useful for provenance.
Reports can be explicitly redirected; Notarius does not automatically persist a
second report or require a metadata bundle. Debug is optional private evidence,
not a consumer protocol.
Post-publication capture/report failure can return nonzero while leaving valid
artifacts. Preserve available files for deliberate recovery, but do not promote
partial stdout or incomplete publication to ordinary consumer success.
[Operations](../operations.md#output-bundles) explains those boundaries.
Inputs, artifacts, evidence, cache, debug, and streams may contain sensitive data.
Apply intended access, sharing, and retention controls. Evidence can cover the
whole source and is not inherently less sensitive.

View File

@@ -4,28 +4,52 @@ This is the first-read landing page for people and LLM coding agents working on
Notarius. It provides a concise repository orientation and routes each kind of Notarius. It provides a concise repository orientation and routes each kind of
change to its canonical documentation. change to its canonical documentation.
Notarius is a Go CLI for configured structured extraction workflows. Start with Notarius is a Go CLI for configured structured extraction workflows. The
the [README](../README.md) for product context, [Architecture](policy/architecture.md) [README](../README.md) provides product context; [Architecture](policy/architecture.md)
for system boundaries, and [Internal Overview](internal/overview.md) for the describes system boundaries, and [Internal Overview](internal/overview.md) maps
implemented component map. implemented components. Read the documents applicable to your task.
Read [Agent Policy](policy/agents.md) before recommending, planning, or
implementing changes. It owns implementation discipline and local commit rules.
## Policy Reading Guide
| Policy | Read before… |
| --- | --- |
| [Policy set provenance](policy/meta.md) | Adopting policies, checking upstream revisions, or updating the adopted policy set. |
| [Agents](policy/agents.md) | Recommending, planning, or implementing repository changes. |
| [Architecture](policy/architecture.md) | Planning or changing application code or its structure. |
| [Testing](policy/testing.md) | Selecting validation for code changes, or adding, changing, removing, or evaluating tests. |
| [Documentation](policy/documentation.md) | Writing, revising, or reorganizing documentation. |
| [OSS](policy/oss.md) | Adding or updating dependencies or incorporated third-party material, or changing licensing or attribution. |
| [Release](policy/release.md) | Preparing or publishing a release, changing release procedures, or making versioning and compatibility decisions. |
- Read applicable policies before making decisions they govern; multiple policies
may apply.
- Select policies using the task triggers above. Follow cross-references to
relevant sections when needed to resolve a concrete question.
- Reuse policies already available in context; reread when changed or no longer
available.
- Expand reading when the task's scope expands.
- When revising a policy itself, read that policy and any provisions elsewhere
affected by the revision.
## What To Read ## What To Read
| When working on | Read | Why | | When working on | Read | Why |
| --- | --- | --- | | --- | --- | --- |
| Finding the package or component that owns current behavior | [Internal Overview](internal/overview.md) | It is the implemented component inventory and routes to focused internals. | | Finding the package or component that owns current behavior | [Internal Overview](internal/overview.md) | It is the implemented component inventory and routes to focused internals. |
| Application shape, package boundaries, contracts, dependency direction, runtime guarantees, or safety properties | [Architecture](policy/architecture.md) and relevant [ADRs](adr/) | Architecture defines the intended system and its invariants; ADRs preserve significant decision rationale. |
| Any documentation addition or revision | [Documentation Policy](policy/documentation.md) | It defines canonical homes, audiences, current-behavior rules, and maintenance requirements. |
| Adding, changing, reviewing, or deleting tests | [Testing Policy](policy/testing.md) | It defines risk-based sufficiency, durable test boundaries, test-double guidance, and criteria for retaining tests. |
| CLI composition or command behavior | [CLI Internals](internal/cli.md) and [CLI Reference](cli.md) | The internal guide owns composition and command flow; the reference owns public syntax. | | CLI composition or command behavior | [CLI Internals](internal/cli.md) and [CLI Reference](cli.md) | The internal guide owns composition and command flow; the reference owns public syntax. |
| Building a subprocess caller or changing its result protocol | [Subprocess Consumer Guide](consumers/subprocess.md), [Run Result Receipt](integrations/run-result.md), and [CLI Internals](internal/cli.md) | These separate caller workflow, durable receipt contract, and CLI implementation behavior. | | Building a subprocess caller or changing its result protocol | [Subprocess Consumer Guide](consumers/subprocess.md), [Complete D&D Consumer Guide](consumers/dnd-pipeline.md), [Native Completion Report](cli.md#completion-report), and [CLI Internals](internal/cli.md) | These separate generic caller workflow, the complete D&D workflow, the native completion report, and CLI implementation behavior. |
| Configuration loading, resolution, or user-visible configuration behavior | [Configuration Internals](internal/configuration.md) and [Configuration](config.md) | The internal guide owns loading and resolution mechanics; the reference owns the configuration contract. | | Configuration loading, resolution, or user-visible configuration behavior | [Configuration Internals](internal/configuration.md) and [Configuration](config.md) | The internal guide owns loading and resolution mechanics; the reference owns the configuration contract. |
| Pipeline resolution or execution | [Pipeline Internals](internal/pipeline.md) | It documents profiles, references, validation, retries, checkpoints, and runner behavior. | | Pipeline resolution or execution | [Pipeline Internals](internal/pipeline.md) | It documents typed preparation, complete assessment, native continuation, workers, and handoff eligibility. |
| Production modules or validators | [Module Internals](internal/modules.md), [D&D Module Internals](internal/dnd.md), and [D&D integration contracts](integrations/) | The generic guide owns extension mechanics, the D&D guide owns shared family conventions, and the contracts own durable output shapes. | | Production modules or validators | [Module Internals](internal/modules.md), [D&D Module Internals](internal/dnd.md), and [D&D integration contracts](integrations/) | The generic guide owns extension mechanics, the D&D guide owns shared family conventions, and the contracts own durable output shapes. |
| LLM clients, prompts, schemas, profiles, or scheduling | [LLM Runtime](internal/llm.md) | It documents the transport boundary and PromptKit integration. | | Native execution, prompts, schemas, profiles, or admission | [LLM Integration](internal/llm.md) | It locates shared engine construction, native request/continuation calls, and evidence hooks. |
| Output, cache, resume, or debug artifacts | [Run State Internals](internal/state.md), [Operations](operations.md), and [Configuration](config.md) | These separate implementation details, operator behavior, and configuration contracts. | | Kit API, source handoff, or standard-suite integration | [ConfigKit](integrations/pkg-configkit.md), [PromptKit](integrations/pkg-promptkit.md), and [CommandKit](integrations/pkg-commandkit.md) | These define the selected upstream integration boundaries and link pinned native contracts. |
| Output, accepted-result reuse, or debug artifacts | [Run State Internals](internal/state.md), [Operations](operations.md), and [Configuration](config.md) | These separate implementation details, operator behavior, and configuration contracts. |
| External input formats, artifact schemas, or durable output files | [Integration Contracts](integrations/) | Integration documents define external and durable data contracts. | | External input formats, artifact schemas, or durable output files | [Integration Contracts](integrations/) | Integration documents define external and durable data contracts. |
| Proposed or unimplemented behavior | [Roadmap](roadmap/) | Future work belongs only in roadmap documentation until implemented. | | Repository-specific release commands or diagnostics | [Releases](release.md) | The runbook supplies publication, delivery, and recovery procedures. |
| Future scope and planning | [Future work](roadmap/future.md) | The backlog records proposed work; active feature and implementation plans live alongside it when present. Implemented behavior belongs in canonical documentation. |
For an existing subsystem, also inspect its focused tests and the package-local For an existing subsystem, also inspect its focused tests and the package-local
types and contracts before changing behavior. types and contracts before changing behavior.

View File

@@ -1,9 +1,9 @@
# Accepted Chunk Map # Accepted Chunk Map
This document defines the optional durable `chunk-map.json` artifact in a This document defines the optional durable `chunk-map.json` artifact in a
[published JSON bundle](json-output.md). It describes the accepted, [published JSON bundle](json-output.md). It describes the materialized chunk
materialized chunk plan used by one run. It is not a lane payload and is never plan used by one run, including a supported qualified fallback. It is not a lane
an input to a later pipeline step. payload and is never an input to a later pipeline step.
## Contract Identity ## Contract Identity
@@ -16,8 +16,8 @@ an input to a later pipeline step.
| Schema name | `notarius_source_chunk_map_v1` | | Schema name | `notarius_source_chunk_map_v1` |
| Schema version | `v1` | | Schema version | `v1` |
The optional `chunk_map` descriptor in `index.json` identifies this artifact. Read this logical path directly when enabled and available; no discovery
Export is controlled by the JSON output binding described in descriptor is required. Export is controlled by the JSON output binding in
[Configuration](../config.md#module-bindings-and-validators). [Configuration](../config.md#module-bindings-and-validators).
## Wire Shape ## Wire Shape
@@ -30,7 +30,7 @@ Every payload has these required fields:
| `source_digest` | Lower-case `sha256:` digest of that source document. | | `source_digest` | Lower-case `sha256:` digest of that source document. |
| `plan_digest` | Lower-case `sha256:` digest of the logical chunk plan. | | `plan_digest` | Lower-case `sha256:` digest of the logical chunk plan. |
| `requested_chunker` | Chunk module selected by the resolved pipeline. | | `requested_chunker` | Chunk module selected by the resolved pipeline. |
| `producer` | Original accepted-plan producer. `input_module` and `chunk_module` are required; `llm_profile` is optional. | | `producer` | Current run's plan component selections. `input_module` and `chunk_module` are required; `llm_profile` is optional and applies only to an LLM-backed chunker. Not historical cache execution provenance. |
| `plan_annotations` | Plan-level annotation namespace map; `{}` when none are present. | | `plan_annotations` | Plan-level annotation namespace map; `{}` when none are present. |
| `chunks` | Non-empty execution-order chunk collection. | | `chunks` | Non-empty execution-order chunk collection. |
@@ -47,9 +47,11 @@ valid JSON and are retained without interpreting a module-specific namespace.
`chunks` are in execution order. Their indexes are contiguous, start at zero, `chunks` are in execution order. Their indexes are contiguous, start at zero,
and equal their array positions; chunk IDs are unique. The emitted map is built and equal their array positions; chunk IDs are unique. The emitted map is built
only after the selected plan has been accepted and materialized against the after the selected plan has been materialized against the source document,
source document, so its ranges, unit counts, annotations, and digests describe so its ranges, unit counts, annotations, and digests describe that exact plan.
that exact plan. Supported fallback still satisfies those invariants without asserting ordinary
semantic approval; run-level qualification belongs to the
[CLI report](../cli.md#completion-report).
The codec rejects malformed JSON, trailing content, unknown fixed-object The codec rejects malformed JSON, trailing content, unknown fixed-object
fields, invalid identities or digests, invalid annotations, duplicate chunk fields, invalid identities or digests, invalid annotations, duplicate chunk
@@ -67,12 +69,13 @@ annotations, producer identity, and ordered chunks.
## Publication And Compatibility ## Publication And Compatibility
The map is present only when a chunk plan was accepted and its export is The map is published when export is enabled, a materialized plan is available,
enabled. It remains publishable if a later lane is rejected, but is absent when and the run reaches publication. Payload fields and schema are unchanged.
chunk-plan validation rejects the plan. `requested_chunker` identifies the `requested_chunker` and `producer` describe the current composition; unified
current pipeline selection, while `producer` identifies the component that cache entries retain the logical plan, not an earlier run's producer/profile
originally produced the accepted plan; they may differ when an accepted plan is ledger. Reuse rematerializes against the current source without semantic
reused. reassessment or claims of historical model execution. A strict failure does not
publish a successful bundle merely to expose this auxiliary.
The map contains structure rather than source content: it excludes transcript The map contains structure rather than source content: it excludes transcript
bytes, source-unit metadata, chunk text, private model output, reference bytes, source-unit metadata, chunk text, private model output, reference

View File

@@ -65,7 +65,7 @@ are unchanged: discovered has no holder; acquired requires `to`; lost and
consumed require `from`; transferred requires distinct non-`party` holders. consumed require `from`; transferred requires distinct non-`party` holders.
The only current downstream compatibility requirement is its registry handoff; The only current downstream compatibility requirement is its registry handoff;
the normalized occurrence list is otherwise published for callers. See the normalized occurrence list is otherwise published for callers. See
[Configuration](../config.md#d-d-reference-slots) for the binding and [Configuration](../config.md#dd-reference-slots) for the binding and
[JSON output](json-output.md) for publication. [JSON output](json-output.md) for publication.
See [item registry](dnd-item-registry-artifacts.md) for the grounding artifact See [item registry](dnd-item-registry-artifacts.md) for the grounding artifact

View File

@@ -90,6 +90,6 @@ into the unchanged exact durable ID/name pair. The registry’s source reference
are never occurrence evidence. Unknown or ambiguous selections are rejected by are never occurrence evidence. Unknown or ambiguous selections are rejected by
the occurrence contract. See the the occurrence contract. See the
[item-occurrence artifact](dnd-item-occurrence-artifacts.md) for that strict [item-occurrence artifact](dnd-item-occurrence-artifacts.md) for that strict
wire contract, [Configuration](../config.md#d-d-reference-slots) for binding wire contract, [Configuration](../config.md#dd-reference-slots) for binding
rules and validator selection, and the [JSON output contract](json-output.md) rules and validator selection, and the [JSON output contract](json-output.md)
for publication. for publication.

View File

@@ -80,7 +80,7 @@ are rejected rather than guessed or reassigned. The current transcript is the
only evidence source for an occurrence; registry evidence and provenance never only evidence source for an occurrence; registry evidence and provenance never
become occurrence evidence. become occurrence evidence.
See [Configuration](../config.md#d-d-reference-slots) for the selectable slot See [Configuration](../config.md#dd-reference-slots) for the selectable slot
and generated-handoff compatibility, [D&D module internals](../internal/dnd.md) and generated-handoff compatibility, [D&D module internals](../internal/dnd.md)
for implementation behavior, and the [JSON output contract](json-output.md) for implementation behavior, and the [JSON output contract](json-output.md)
for publication. for publication.

View File

@@ -86,7 +86,7 @@ Occurrence consumers receive names-only grounding; Notarius resolves the
selected canonical name and writes the unchanged exact durable ID/name pair. selected canonical name and writes the unchanged exact durable ID/name pair.
Spells, combat turns, and the [enemy-event artifact](dnd-enemy-event-artifacts.md) Spells, combat turns, and the [enemy-event artifact](dnd-enemy-event-artifacts.md)
also receive names-only grounding for actor or subject display. None of these also receive names-only grounding for actor or subject display. None of these
projections supply later-artifact evidence. [Configuration](../config.md#d-d-reference-slots) projections supply later-artifact evidence. [Configuration](../config.md#dd-reference-slots)
owns the `npc_registry` binding rules. owns the `npc_registry` binding rules.
The [JSON output contract](json-output.md) defines publication, and The [JSON output contract](json-output.md) defines publication, and
[D&D module internals](../internal/dnd.md) owns pipeline mechanics. [D&D module internals](../internal/dnd.md) owns pipeline mechanics.

View File

@@ -17,7 +17,7 @@ in [Configuration](../config.md#references-and-ordered-handoffs).
| Base catalog | Embedded D&D 5e 2014 SRD catalog | | Base catalog | Embedded D&D 5e 2014 SRD catalog |
At most one overlay document may be bound. The maintained example is At most one overlay document may be bound. The maintained example is
[dnd-spell-catalog.json](../../examples/dnd-spell-catalog.json). [spell-catalog.json](../../examples/dnd-complete/spell-catalog.json).
## Wire Shape ## Wire Shape

Some files were not shown because too many files have changed in this diff Show More