@contractspec/example.locale-jurisdiction-gate 3.7.26 → 3.7.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,16 +2,16 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build transpile
4
4
  [contractspec-bun-build] transpile target=bun root=src entries=22 noBundle=false
5
- Bundled 22 modules in 28ms
5
+ Bundled 22 modules in 37ms
6
6
 
7
7
  docs/index.js 1.44 KB (entry point)
8
- ./index.js 21.40 KB (entry point)
8
+ ./index.js 21.38 KB (entry point)
9
9
  policy/index.js 2.87 KB (entry point)
10
10
  policy/types.js 8 bytes (entry point)
11
- translations/index.js 4.65 KB (entry point)
12
- translations/assistant-gate.en-GB.translation.js 1.49 KB (entry point)
11
+ translations/index.js 4.64 KB (entry point)
12
+ translations/assistant-gate.en-GB.translation.js 1.48 KB (entry point)
13
13
  translations/assistant-gate.en-US.translation.js 1.64 KB (entry point)
14
- translations/assistant-gate.fr-FR.translation.js 1.56 KB (entry point)
14
+ translations/assistant-gate.fr-FR.translation.js 1.55 KB (entry point)
15
15
  handlers/index.js 2.68 KB (entry point)
16
16
  handlers/demo.handlers.js 2.68 KB (entry point)
17
17
  ./locale-jurisdiction-gate.feature.js 2.68 KB (entry point)
@@ -28,13 +28,13 @@ Bundled 22 modules in 28ms
28
28
  entities/models.js 2.52 KB (entry point)
29
29
 
30
30
  [contractspec-bun-build] transpile target=node root=src entries=22 noBundle=false
31
- Bundled 22 modules in 50ms
31
+ Bundled 22 modules in 40ms
32
32
 
33
33
  docs/index.js 1.43 KB (entry point)
34
- ./index.js 21.35 KB (entry point)
34
+ ./index.js 21.34 KB (entry point)
35
35
  policy/index.js 2.86 KB (entry point)
36
36
  policy/types.js 0 KB (entry point)
37
- translations/index.js 4.62 KB (entry point)
37
+ translations/index.js 4.60 KB (entry point)
38
38
  translations/assistant-gate.en-GB.translation.js 1.48 KB (entry point)
39
39
  translations/assistant-gate.en-US.translation.js 1.63 KB (entry point)
40
40
  translations/assistant-gate.fr-FR.translation.js 1.52 KB (entry point)
@@ -54,13 +54,13 @@ Bundled 22 modules in 50ms
54
54
  entities/models.js 2.51 KB (entry point)
55
55
 
56
56
  [contractspec-bun-build] transpile target=browser root=src entries=22 noBundle=false
57
- Bundled 22 modules in 64ms
57
+ Bundled 22 modules in 60ms
58
58
 
59
59
  docs/index.js 1.43 KB (entry point)
60
- ./index.js 21.35 KB (entry point)
60
+ ./index.js 21.34 KB (entry point)
61
61
  policy/index.js 2.86 KB (entry point)
62
62
  policy/types.js 0 KB (entry point)
63
- translations/index.js 4.62 KB (entry point)
63
+ translations/index.js 4.60 KB (entry point)
64
64
  translations/assistant-gate.en-GB.translation.js 1.48 KB (entry point)
65
65
  translations/assistant-gate.en-US.translation.js 1.63 KB (entry point)
66
66
  translations/assistant-gate.fr-FR.translation.js 1.52 KB (entry point)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @contractspec/example.locale-jurisdiction-gate
2
2
 
3
+ ## 3.7.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Add a ContractSpec-native production-grade translation runtime and optional i18next adapter.
8
+ - Packages: @contractspec/lib.contracts-spec (minor), @contractspec/lib.translation-runtime (minor), @contractspec/lib.design-system (minor), @contractspec/example.locale-jurisdiction-gate (patch)
9
+ - Migration: Prefer `meta.key: "bundle.messages"` with `locale: "fr-FR"` over stable keys that encode locale suffixes.; The i18next adapter exports ContractSpec ICU messages intact and does not make i18next canonical.
10
+ - Updated dependencies because of Add a ContractSpec-native production-grade translation runtime and optional i18next adapter.
11
+ - Updated dependencies because of Add preference-aware DataView collection defaults and personalization adapters.
12
+ - Updated dependencies because of Move notifications to library-first contracts/runtime surfaces and add AppShell in-app notification affordances.
13
+ - Updated dependencies because of Add first-class FormSpec phone input support with country detection, split outputs, and flag rendering.
14
+ - Updated dependencies because of Add PWA update management contracts and runtime helpers.
15
+ - Updated dependencies because of Add a shared roles and permissions policy system across contracts, RBAC evaluation, AppShell adaptation, and personalization suppression.
16
+ - @contractspec/lib.contracts-spec@6.2.0
17
+
3
18
  ## 3.7.26
4
19
 
5
20
  ### Patch Changes
@@ -17,4 +17,4 @@ import{registerDocBlocks as V}from"@contractspec/lib.contracts-spec/docs";var z=
17
17
  - assistant.answer.requested
18
18
  - assistant.answer.blocked
19
19
  - assistant.answer.delivered`}];V(z);import{defineEnum as A,defineSchemaModel as x,ScalarTypeEnum as r}from"@contractspec/lib.schema";var f=A("AllowedScope",["education_only","generic_info","escalation_required"]),Rr=x({name:"UserProfile",description:"User profile inputs used to derive regulatory context.",fields:{preferredLocale:{type:r.String_unsecure(),isOptional:!0},residencyCountry:{type:r.String_unsecure(),isOptional:!0},taxResidenceCountry:{type:r.String_unsecure(),isOptional:!0},clientType:{type:r.String_unsecure(),isOptional:!0}}}),N=x({name:"RegulatoryContext",description:"Explicit regulatory context (no guessing).",fields:{jurisdiction:{type:r.String_unsecure(),isOptional:!1},region:{type:r.String_unsecure(),isOptional:!0},clientType:{type:r.String_unsecure(),isOptional:!0},allowedScope:{type:f,isOptional:!1}}}),R=x({name:"LLMCallEnvelope",description:"Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.",fields:{traceId:{type:r.String_unsecure(),isOptional:!1},locale:{type:r.String_unsecure(),isOptional:!1},regulatoryContext:{type:N,isOptional:!1},kbSnapshotId:{type:r.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1}}}),S=x({name:"AssistantCitation",description:"Citation referencing a KB snapshot + a specific item within it.",fields:{kbSnapshotId:{type:r.String_unsecure(),isOptional:!1},sourceType:{type:r.String_unsecure(),isOptional:!1},sourceId:{type:r.String_unsecure(),isOptional:!1},title:{type:r.String_unsecure(),isOptional:!0},excerpt:{type:r.String_unsecure(),isOptional:!0}}}),W=x({name:"AssistantAnswerSection",description:"Structured answer section.",fields:{heading:{type:r.String_unsecure(),isOptional:!1},body:{type:r.String_unsecure(),isOptional:!1}}}),s=x({name:"AssistantAnswerIR",description:"Structured assistant answer with mandatory citations and explicit locale/jurisdiction.",fields:{locale:{type:r.String_unsecure(),isOptional:!1},jurisdiction:{type:r.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1},sections:{type:W,isArray:!0,isOptional:!1},citations:{type:S,isArray:!0,isOptional:!1},disclaimers:{type:r.String_unsecure(),isArray:!0,isOptional:!0},riskFlags:{type:r.String_unsecure(),isArray:!0,isOptional:!0},refused:{type:r.Boolean(),isOptional:!0},refusalReason:{type:r.String_unsecure(),isOptional:!0}}});import{defineEvent as U}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as p,ScalarTypeEnum as t}from"@contractspec/lib.schema";var X=p({name:"AssistantAnswerRequestedPayload",description:"Emitted when an assistant answer is requested (pre-gate).",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},locale:{type:t.String_unsecure(),isOptional:!1},jurisdiction:{type:t.String_unsecure(),isOptional:!1},kbSnapshotId:{type:t.String_unsecure(),isOptional:!1},allowedScope:{type:t.String_unsecure(),isOptional:!1}}}),qr=U({meta:{key:"assistant.answer.requested",version:"1.0.0",description:"Assistant answer requested (policy gate will run).",stability:"experimental",owners:["@examples"],tags:["assistant","policy"]},payload:X}),Z=p({name:"AssistantAnswerBlockedPayload",description:"Emitted when a request is blocked by the gate.",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},reasonCode:{type:t.String_unsecure(),isOptional:!1},reason:{type:t.String_unsecure(),isOptional:!1}}}),Kr=U({meta:{key:"assistant.answer.blocked",version:"1.0.0",description:"Assistant answer blocked (fail-closed).",stability:"experimental",owners:["@examples"],tags:["assistant","policy","blocked"]},payload:Z}),$=p({name:"AssistantAnswerDeliveredPayload",description:"Emitted when a structured, cited answer is delivered.",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},locale:{type:t.String_unsecure(),isOptional:!1},jurisdiction:{type:t.String_unsecure(),isOptional:!1},kbSnapshotId:{type:t.String_unsecure(),isOptional:!1},allowedScope:{type:t.String_unsecure(),isOptional:!1},citationsCount:{type:t.Int_unsecure(),isOptional:!1}}}),jr=U({meta:{key:"assistant.answer.delivered",version:"1.0.0",description:"Assistant answer delivered (must include KB snapshot citations).",stability:"experimental",owners:["@examples"],tags:["assistant","policy","delivered"]},payload:$});import{defineExample as B}from"@contractspec/lib.contracts-spec/examples";var D=B({meta:{key:"examples.locale-jurisdiction-gate",version:"1.0.0",title:"Locale Jurisdiction Gate",description:"Example: enforce locale + jurisdiction + kbSnapshotId + allowed scope for assistant calls (fail-closed).",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","locale-jurisdiction-gate"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.locale-jurisdiction-gate"}}),G=D;import{defineFormSpec as J}from"@contractspec/lib.contracts-spec/forms";import{OwnersEnum as L,StabilityEnum as Y,TagsEnum as h}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as M,ScalarTypeEnum as I}from"@contractspec/lib.schema";var F=M({name:"AssistantContextFormModel",description:"Form values required before a policy-gated assistant request can be executed.",fields:{locale:{type:I.String_unsecure(),isOptional:!1},jurisdiction:{type:I.String_unsecure(),isOptional:!1},kbSnapshotId:{type:I.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1},question:{type:I.String_unsecure(),isOptional:!1}}}),Wr=J({meta:{key:"locale-jurisdiction-gate.form.assistant-context",version:"1.0.0",title:"Assistant Context Gate",description:"Collects the explicit locale, jurisdiction, scope, and knowledge snapshot required by the assistant gate.",domain:"assistant",owners:[L.PlatformFinance],tags:[h.I18n,"assistant","form","policy"],stability:Y.Experimental},model:F,fields:[{kind:"select",name:"locale",labelI18n:"assistantGate.locale.label",descriptionI18n:"assistantGate.locale.description",options:{kind:"static",options:[{labelI18n:"assistantGate.locale.enUs",value:"en-US"},{labelI18n:"assistantGate.locale.enGb",value:"en-GB"},{labelI18n:"assistantGate.locale.frFr",value:"fr-FR"}]},required:!0},{kind:"text",name:"jurisdiction",labelI18n:"assistantGate.jurisdiction.label",placeholderI18n:"assistantGate.jurisdiction.placeholder",required:!0},{kind:"text",name:"kbSnapshotId",labelI18n:"assistantGate.kbSnapshotId.label",placeholderI18n:"assistantGate.kbSnapshotId.placeholder",required:!0},{kind:"radio",name:"allowedScope",labelI18n:"assistantGate.allowedScope.label",options:{kind:"static",options:[{labelI18n:"assistantGate.allowedScope.educationOnly",value:"education_only"},{labelI18n:"assistantGate.allowedScope.genericInfo",value:"generic_info"},{labelI18n:"assistantGate.allowedScope.escalationRequired",value:"escalation_required"}]},required:!0},{kind:"textarea",name:"question",labelI18n:"assistantGate.question.label",placeholderI18n:"assistantGate.question.placeholder",required:!0}],actions:[{key:"submit",labelI18n:"assistantGate.submit.label",op:{name:"assistant.answer",version:"1.0.0"}}],policy:{flags:[],pii:["kbSnapshotId","question"]},renderHints:{ui:"custom",form:"react-hook-form"}});var P=new Set(["en-US","en-GB","fr-FR"]);function O(i,u){return{code:i,message:u}}function Q(i){if(!i.locale||!P.has(i.locale))return{ok:!1,error:O("LOCALE_REQUIRED","locale is required and must be supported")};if(!i.regulatoryContext?.jurisdiction)return{ok:!1,error:O("JURISDICTION_REQUIRED","jurisdiction is required")};if(!i.kbSnapshotId)return{ok:!1,error:O("KB_SNAPSHOT_REQUIRED","kbSnapshotId is required")};if(!i.allowedScope)return{ok:!1,error:O("SCOPE_VIOLATION","allowedScope is required")};return{ok:!0,value:i}}function q(i){let u=i.citations??[];if(!Array.isArray(u)||u.length===0)return{ok:!1,error:O("CITATIONS_REQUIRED","answers must include at least one citation")};return{ok:!0,value:i}}var l=[/\b(buy|sell)\b/i,/\b(should\s+buy|should\s+sell)\b/i,/\b(guarantee(d)?|promise(d)?)\b/i];function K(i,u){if(!i)return{ok:!1,error:O("SCOPE_VIOLATION","allowedScope is required")};if(i!=="education_only")return{ok:!0,value:u};let _=(u.sections??[]).map((o)=>o.body).join(`
20
- `);if(l.some((o)=>o.test(_)))return{ok:!1,error:O("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:u}}function Gr(){async function i(_){let g=Q(_.envelope);if(!g.ok)return{locale:_.envelope.locale??"en-US",jurisdiction:_.envelope.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:_.envelope.allowedScope??"education_only",sections:[{heading:"Request blocked",body:g.error.message}],citations:[],disclaimers:["This system refuses to answer without a valid envelope."],riskFlags:[g.error.code],refused:!0,refusalReason:g.error.code};let o={locale:g.value.locale,jurisdiction:g.value.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:g.value.allowedScope??"education_only",sections:[{heading:"Answer (demo)",body:`You asked: "${_.question}". This demo answer is derived from the KB snapshot only.`}],citations:[{kbSnapshotId:g.value.kbSnapshotId??"unknown",sourceType:"ruleVersion",sourceId:"rv_demo",title:"Demo rule version",excerpt:"Demo excerpt"}],disclaimers:["Educational demo only."],riskFlags:[]},y=K(g.value.allowedScope,o);if(!y.ok)return{...o,sections:[{heading:"Escalation required",body:y.error.message}],citations:o.citations,refused:!0,refusalReason:y.error.code,riskFlags:[...o.riskFlags??[],y.error.code]};let e=q(o);if(!e.ok)return{...o,sections:[{heading:"Request blocked",body:e.error.message}],citations:[],refused:!0,refusalReason:e.error.code,riskFlags:[...o.riskFlags??[],e.error.code]};return o}async function u(_){return await i({envelope:_.envelope,question:`Explain concept: ${_.conceptKey}`})}return{answer:i,explainConcept:u}}import{OwnersEnum as d,StabilityEnum as w,TagsEnum as b}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as T}from"@contractspec/lib.contracts-spec/policy";var C=T({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[d.PlatformFinance],tags:[b.I18n,"assistant","policy","jurisdiction"],stability:w.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});import{defineFeature as v}from"@contractspec/lib.contracts-spec/features";var dr=v({meta:{key:"locale-jurisdiction-gate",version:"1.0.0",title:"Locale + Jurisdiction Gate",description:"Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",domain:"knowledge",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],stability:"experimental"},operations:[{key:"assistant.answer",version:"1.0.0"},{key:"assistant.explainConcept",version:"1.0.0"}],events:[{key:"assistant.answer.requested",version:"1.0.0"},{key:"assistant.answer.blocked",version:"1.0.0"},{key:"assistant.answer.delivered",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:"knowledge",version:"1.0.0"}]},policies:[{key:C.meta.key,version:C.meta.version}],knowledge:[{key:"locale-jurisdiction-gate.knowledge.rules",version:"1.0.0"}],docs:["docs.examples.locale-jurisdiction-gate.goal","docs.examples.locale-jurisdiction-gate.reference"]});import{defineCommand as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as H}from"@contractspec/lib.schema";var n=k({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},question:{type:H.String_unsecure(),isOptional:!1}}}),E=k({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},conceptKey:{type:H.String_unsecure(),isOptional:!1}}}),m=j({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:n,output:s,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),nr=j({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:E,output:s,errors:m.io.errors},policy:{auth:"user"}});import{OwnersEnum as a,StabilityEnum as c,TagsEnum as rr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as ir}from"@contractspec/lib.contracts-spec/translations/spec";var _i=ir({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[a.PlatformFinance],stability:c.Experimental,tags:[rr.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as tr,StabilityEnum as or,TagsEnum as ur}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as _r}from"@contractspec/lib.contracts-spec/translations/spec";var fi=_r({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[tr.PlatformFinance],stability:or.Experimental,tags:[ur.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as gr,StabilityEnum as Or,TagsEnum as xr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as fr}from"@contractspec/lib.contracts-spec/translations/spec";var Ri=fr({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[gr.PlatformFinance],stability:Or.Experimental,tags:[xr.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{Q as validateEnvelope,G as example,q as enforceCitations,K as enforceAllowedScope,Gr as createDemoAssistantHandlers,Rr as UserProfileModel,N as RegulatoryContextModel,dr as LocaleJurisdictionGateFeature,R as LLMCallEnvelopeModel,D as ExamplesLocaleJurisdictionGateExample,C as AssistantGatePolicy,Ri as AssistantGateMessagesFrFr,fi as AssistantGateMessagesEnUs,_i as AssistantGateMessagesEnGb,nr as AssistantExplainConceptContract,Wr as AssistantContextForm,S as AssistantCitationModel,W as AssistantAnswerSectionModel,qr as AssistantAnswerRequestedEvent,s as AssistantAnswerIRModel,jr as AssistantAnswerDeliveredEvent,m as AssistantAnswerContract,Kr as AssistantAnswerBlockedEvent,f as AllowedScopeEnum};
20
+ `);if(l.some((o)=>o.test(_)))return{ok:!1,error:O("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:u}}function Gr(){async function i(_){let g=Q(_.envelope);if(!g.ok)return{locale:_.envelope.locale??"en-US",jurisdiction:_.envelope.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:_.envelope.allowedScope??"education_only",sections:[{heading:"Request blocked",body:g.error.message}],citations:[],disclaimers:["This system refuses to answer without a valid envelope."],riskFlags:[g.error.code],refused:!0,refusalReason:g.error.code};let o={locale:g.value.locale,jurisdiction:g.value.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:g.value.allowedScope??"education_only",sections:[{heading:"Answer (demo)",body:`You asked: "${_.question}". This demo answer is derived from the KB snapshot only.`}],citations:[{kbSnapshotId:g.value.kbSnapshotId??"unknown",sourceType:"ruleVersion",sourceId:"rv_demo",title:"Demo rule version",excerpt:"Demo excerpt"}],disclaimers:["Educational demo only."],riskFlags:[]},y=K(g.value.allowedScope,o);if(!y.ok)return{...o,sections:[{heading:"Escalation required",body:y.error.message}],citations:o.citations,refused:!0,refusalReason:y.error.code,riskFlags:[...o.riskFlags??[],y.error.code]};let e=q(o);if(!e.ok)return{...o,sections:[{heading:"Request blocked",body:e.error.message}],citations:[],refused:!0,refusalReason:e.error.code,riskFlags:[...o.riskFlags??[],e.error.code]};return o}async function u(_){return await i({envelope:_.envelope,question:`Explain concept: ${_.conceptKey}`})}return{answer:i,explainConcept:u}}import{OwnersEnum as d,StabilityEnum as w,TagsEnum as b}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as T}from"@contractspec/lib.contracts-spec/policy";var C=T({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[d.PlatformFinance],tags:[b.I18n,"assistant","policy","jurisdiction"],stability:w.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});import{defineFeature as v}from"@contractspec/lib.contracts-spec/features";var dr=v({meta:{key:"locale-jurisdiction-gate",version:"1.0.0",title:"Locale + Jurisdiction Gate",description:"Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",domain:"knowledge",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],stability:"experimental"},operations:[{key:"assistant.answer",version:"1.0.0"},{key:"assistant.explainConcept",version:"1.0.0"}],events:[{key:"assistant.answer.requested",version:"1.0.0"},{key:"assistant.answer.blocked",version:"1.0.0"},{key:"assistant.answer.delivered",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:"knowledge",version:"1.0.0"}]},policies:[{key:C.meta.key,version:C.meta.version}],knowledge:[{key:"locale-jurisdiction-gate.knowledge.rules",version:"1.0.0"}],docs:["docs.examples.locale-jurisdiction-gate.goal","docs.examples.locale-jurisdiction-gate.reference"]});import{defineCommand as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as H}from"@contractspec/lib.schema";var n=k({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},question:{type:H.String_unsecure(),isOptional:!1}}}),E=k({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},conceptKey:{type:H.String_unsecure(),isOptional:!1}}}),m=j({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:n,output:s,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),nr=j({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:E,output:s,errors:m.io.errors},policy:{auth:"user"}});import{OwnersEnum as a,StabilityEnum as c,TagsEnum as rr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as ir}from"@contractspec/lib.contracts-spec/translations/spec";var _i=ir({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[a.PlatformFinance],stability:c.Experimental,tags:[rr.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as tr,StabilityEnum as or,TagsEnum as ur}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as _r}from"@contractspec/lib.contracts-spec/translations/spec";var fi=_r({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[tr.PlatformFinance],stability:or.Experimental,tags:[ur.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as gr,StabilityEnum as Or,TagsEnum as xr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as fr}from"@contractspec/lib.contracts-spec/translations/spec";var Ri=fr({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[gr.PlatformFinance],stability:Or.Experimental,tags:[xr.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{Q as validateEnvelope,G as example,q as enforceCitations,K as enforceAllowedScope,Gr as createDemoAssistantHandlers,Rr as UserProfileModel,N as RegulatoryContextModel,dr as LocaleJurisdictionGateFeature,R as LLMCallEnvelopeModel,D as ExamplesLocaleJurisdictionGateExample,C as AssistantGatePolicy,Ri as AssistantGateMessagesFrFr,fi as AssistantGateMessagesEnUs,_i as AssistantGateMessagesEnGb,nr as AssistantExplainConceptContract,Wr as AssistantContextForm,S as AssistantCitationModel,W as AssistantAnswerSectionModel,qr as AssistantAnswerRequestedEvent,s as AssistantAnswerIRModel,jr as AssistantAnswerDeliveredEvent,m as AssistantAnswerContract,Kr as AssistantAnswerBlockedEvent,f as AllowedScopeEnum};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{z as AssistantGateMessagesFrFr};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{z as AssistantGateMessagesFrFr};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var J=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[v.PlatformFinance],stability:x.Experimental,tags:[z.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var J=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[v.PlatformFinance],stability:x.Experimental,tags:[z.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
package/dist/index.js CHANGED
@@ -18,4 +18,4 @@ import{registerDocBlocks as V}from"@contractspec/lib.contracts-spec/docs";var z=
18
18
  - assistant.answer.requested
19
19
  - assistant.answer.blocked
20
20
  - assistant.answer.delivered`}];V(z);import{defineEnum as A,defineSchemaModel as x,ScalarTypeEnum as r}from"@contractspec/lib.schema";var f=A("AllowedScope",["education_only","generic_info","escalation_required"]),Rr=x({name:"UserProfile",description:"User profile inputs used to derive regulatory context.",fields:{preferredLocale:{type:r.String_unsecure(),isOptional:!0},residencyCountry:{type:r.String_unsecure(),isOptional:!0},taxResidenceCountry:{type:r.String_unsecure(),isOptional:!0},clientType:{type:r.String_unsecure(),isOptional:!0}}}),N=x({name:"RegulatoryContext",description:"Explicit regulatory context (no guessing).",fields:{jurisdiction:{type:r.String_unsecure(),isOptional:!1},region:{type:r.String_unsecure(),isOptional:!0},clientType:{type:r.String_unsecure(),isOptional:!0},allowedScope:{type:f,isOptional:!1}}}),R=x({name:"LLMCallEnvelope",description:"Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.",fields:{traceId:{type:r.String_unsecure(),isOptional:!1},locale:{type:r.String_unsecure(),isOptional:!1},regulatoryContext:{type:N,isOptional:!1},kbSnapshotId:{type:r.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1}}}),S=x({name:"AssistantCitation",description:"Citation referencing a KB snapshot + a specific item within it.",fields:{kbSnapshotId:{type:r.String_unsecure(),isOptional:!1},sourceType:{type:r.String_unsecure(),isOptional:!1},sourceId:{type:r.String_unsecure(),isOptional:!1},title:{type:r.String_unsecure(),isOptional:!0},excerpt:{type:r.String_unsecure(),isOptional:!0}}}),W=x({name:"AssistantAnswerSection",description:"Structured answer section.",fields:{heading:{type:r.String_unsecure(),isOptional:!1},body:{type:r.String_unsecure(),isOptional:!1}}}),s=x({name:"AssistantAnswerIR",description:"Structured assistant answer with mandatory citations and explicit locale/jurisdiction.",fields:{locale:{type:r.String_unsecure(),isOptional:!1},jurisdiction:{type:r.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1},sections:{type:W,isArray:!0,isOptional:!1},citations:{type:S,isArray:!0,isOptional:!1},disclaimers:{type:r.String_unsecure(),isArray:!0,isOptional:!0},riskFlags:{type:r.String_unsecure(),isArray:!0,isOptional:!0},refused:{type:r.Boolean(),isOptional:!0},refusalReason:{type:r.String_unsecure(),isOptional:!0}}});import{defineEvent as U}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as p,ScalarTypeEnum as t}from"@contractspec/lib.schema";var X=p({name:"AssistantAnswerRequestedPayload",description:"Emitted when an assistant answer is requested (pre-gate).",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},locale:{type:t.String_unsecure(),isOptional:!1},jurisdiction:{type:t.String_unsecure(),isOptional:!1},kbSnapshotId:{type:t.String_unsecure(),isOptional:!1},allowedScope:{type:t.String_unsecure(),isOptional:!1}}}),qr=U({meta:{key:"assistant.answer.requested",version:"1.0.0",description:"Assistant answer requested (policy gate will run).",stability:"experimental",owners:["@examples"],tags:["assistant","policy"]},payload:X}),Z=p({name:"AssistantAnswerBlockedPayload",description:"Emitted when a request is blocked by the gate.",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},reasonCode:{type:t.String_unsecure(),isOptional:!1},reason:{type:t.String_unsecure(),isOptional:!1}}}),Kr=U({meta:{key:"assistant.answer.blocked",version:"1.0.0",description:"Assistant answer blocked (fail-closed).",stability:"experimental",owners:["@examples"],tags:["assistant","policy","blocked"]},payload:Z}),$=p({name:"AssistantAnswerDeliveredPayload",description:"Emitted when a structured, cited answer is delivered.",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},locale:{type:t.String_unsecure(),isOptional:!1},jurisdiction:{type:t.String_unsecure(),isOptional:!1},kbSnapshotId:{type:t.String_unsecure(),isOptional:!1},allowedScope:{type:t.String_unsecure(),isOptional:!1},citationsCount:{type:t.Int_unsecure(),isOptional:!1}}}),jr=U({meta:{key:"assistant.answer.delivered",version:"1.0.0",description:"Assistant answer delivered (must include KB snapshot citations).",stability:"experimental",owners:["@examples"],tags:["assistant","policy","delivered"]},payload:$});import{defineExample as B}from"@contractspec/lib.contracts-spec/examples";var D=B({meta:{key:"examples.locale-jurisdiction-gate",version:"1.0.0",title:"Locale Jurisdiction Gate",description:"Example: enforce locale + jurisdiction + kbSnapshotId + allowed scope for assistant calls (fail-closed).",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","locale-jurisdiction-gate"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.locale-jurisdiction-gate"}}),G=D;import{defineFormSpec as J}from"@contractspec/lib.contracts-spec/forms";import{OwnersEnum as L,StabilityEnum as Y,TagsEnum as h}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as M,ScalarTypeEnum as I}from"@contractspec/lib.schema";var F=M({name:"AssistantContextFormModel",description:"Form values required before a policy-gated assistant request can be executed.",fields:{locale:{type:I.String_unsecure(),isOptional:!1},jurisdiction:{type:I.String_unsecure(),isOptional:!1},kbSnapshotId:{type:I.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1},question:{type:I.String_unsecure(),isOptional:!1}}}),Wr=J({meta:{key:"locale-jurisdiction-gate.form.assistant-context",version:"1.0.0",title:"Assistant Context Gate",description:"Collects the explicit locale, jurisdiction, scope, and knowledge snapshot required by the assistant gate.",domain:"assistant",owners:[L.PlatformFinance],tags:[h.I18n,"assistant","form","policy"],stability:Y.Experimental},model:F,fields:[{kind:"select",name:"locale",labelI18n:"assistantGate.locale.label",descriptionI18n:"assistantGate.locale.description",options:{kind:"static",options:[{labelI18n:"assistantGate.locale.enUs",value:"en-US"},{labelI18n:"assistantGate.locale.enGb",value:"en-GB"},{labelI18n:"assistantGate.locale.frFr",value:"fr-FR"}]},required:!0},{kind:"text",name:"jurisdiction",labelI18n:"assistantGate.jurisdiction.label",placeholderI18n:"assistantGate.jurisdiction.placeholder",required:!0},{kind:"text",name:"kbSnapshotId",labelI18n:"assistantGate.kbSnapshotId.label",placeholderI18n:"assistantGate.kbSnapshotId.placeholder",required:!0},{kind:"radio",name:"allowedScope",labelI18n:"assistantGate.allowedScope.label",options:{kind:"static",options:[{labelI18n:"assistantGate.allowedScope.educationOnly",value:"education_only"},{labelI18n:"assistantGate.allowedScope.genericInfo",value:"generic_info"},{labelI18n:"assistantGate.allowedScope.escalationRequired",value:"escalation_required"}]},required:!0},{kind:"textarea",name:"question",labelI18n:"assistantGate.question.label",placeholderI18n:"assistantGate.question.placeholder",required:!0}],actions:[{key:"submit",labelI18n:"assistantGate.submit.label",op:{name:"assistant.answer",version:"1.0.0"}}],policy:{flags:[],pii:["kbSnapshotId","question"]},renderHints:{ui:"custom",form:"react-hook-form"}});var P=new Set(["en-US","en-GB","fr-FR"]);function O(i,u){return{code:i,message:u}}function Q(i){if(!i.locale||!P.has(i.locale))return{ok:!1,error:O("LOCALE_REQUIRED","locale is required and must be supported")};if(!i.regulatoryContext?.jurisdiction)return{ok:!1,error:O("JURISDICTION_REQUIRED","jurisdiction is required")};if(!i.kbSnapshotId)return{ok:!1,error:O("KB_SNAPSHOT_REQUIRED","kbSnapshotId is required")};if(!i.allowedScope)return{ok:!1,error:O("SCOPE_VIOLATION","allowedScope is required")};return{ok:!0,value:i}}function q(i){let u=i.citations??[];if(!Array.isArray(u)||u.length===0)return{ok:!1,error:O("CITATIONS_REQUIRED","answers must include at least one citation")};return{ok:!0,value:i}}var l=[/\b(buy|sell)\b/i,/\b(should\s+buy|should\s+sell)\b/i,/\b(guarantee(d)?|promise(d)?)\b/i];function K(i,u){if(!i)return{ok:!1,error:O("SCOPE_VIOLATION","allowedScope is required")};if(i!=="education_only")return{ok:!0,value:u};let _=(u.sections??[]).map((o)=>o.body).join(`
21
- `);if(l.some((o)=>o.test(_)))return{ok:!1,error:O("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:u}}function Gr(){async function i(_){let g=Q(_.envelope);if(!g.ok)return{locale:_.envelope.locale??"en-US",jurisdiction:_.envelope.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:_.envelope.allowedScope??"education_only",sections:[{heading:"Request blocked",body:g.error.message}],citations:[],disclaimers:["This system refuses to answer without a valid envelope."],riskFlags:[g.error.code],refused:!0,refusalReason:g.error.code};let o={locale:g.value.locale,jurisdiction:g.value.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:g.value.allowedScope??"education_only",sections:[{heading:"Answer (demo)",body:`You asked: "${_.question}". This demo answer is derived from the KB snapshot only.`}],citations:[{kbSnapshotId:g.value.kbSnapshotId??"unknown",sourceType:"ruleVersion",sourceId:"rv_demo",title:"Demo rule version",excerpt:"Demo excerpt"}],disclaimers:["Educational demo only."],riskFlags:[]},y=K(g.value.allowedScope,o);if(!y.ok)return{...o,sections:[{heading:"Escalation required",body:y.error.message}],citations:o.citations,refused:!0,refusalReason:y.error.code,riskFlags:[...o.riskFlags??[],y.error.code]};let e=q(o);if(!e.ok)return{...o,sections:[{heading:"Request blocked",body:e.error.message}],citations:[],refused:!0,refusalReason:e.error.code,riskFlags:[...o.riskFlags??[],e.error.code]};return o}async function u(_){return await i({envelope:_.envelope,question:`Explain concept: ${_.conceptKey}`})}return{answer:i,explainConcept:u}}import{OwnersEnum as d,StabilityEnum as w,TagsEnum as b}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as T}from"@contractspec/lib.contracts-spec/policy";var C=T({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[d.PlatformFinance],tags:[b.I18n,"assistant","policy","jurisdiction"],stability:w.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});import{defineFeature as v}from"@contractspec/lib.contracts-spec/features";var dr=v({meta:{key:"locale-jurisdiction-gate",version:"1.0.0",title:"Locale + Jurisdiction Gate",description:"Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",domain:"knowledge",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],stability:"experimental"},operations:[{key:"assistant.answer",version:"1.0.0"},{key:"assistant.explainConcept",version:"1.0.0"}],events:[{key:"assistant.answer.requested",version:"1.0.0"},{key:"assistant.answer.blocked",version:"1.0.0"},{key:"assistant.answer.delivered",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:"knowledge",version:"1.0.0"}]},policies:[{key:C.meta.key,version:C.meta.version}],knowledge:[{key:"locale-jurisdiction-gate.knowledge.rules",version:"1.0.0"}],docs:["docs.examples.locale-jurisdiction-gate.goal","docs.examples.locale-jurisdiction-gate.reference"]});import{defineCommand as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as H}from"@contractspec/lib.schema";var n=k({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},question:{type:H.String_unsecure(),isOptional:!1}}}),E=k({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},conceptKey:{type:H.String_unsecure(),isOptional:!1}}}),m=j({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:n,output:s,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),nr=j({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:E,output:s,errors:m.io.errors},policy:{auth:"user"}});import{OwnersEnum as a,StabilityEnum as c,TagsEnum as rr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as ir}from"@contractspec/lib.contracts-spec/translations/spec";var _i=ir({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[a.PlatformFinance],stability:c.Experimental,tags:[rr.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as tr,StabilityEnum as or,TagsEnum as ur}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as _r}from"@contractspec/lib.contracts-spec/translations/spec";var fi=_r({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[tr.PlatformFinance],stability:or.Experimental,tags:[ur.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as gr,StabilityEnum as Or,TagsEnum as xr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as fr}from"@contractspec/lib.contracts-spec/translations/spec";var Ri=fr({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[gr.PlatformFinance],stability:Or.Experimental,tags:[xr.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{Q as validateEnvelope,G as example,q as enforceCitations,K as enforceAllowedScope,Gr as createDemoAssistantHandlers,Rr as UserProfileModel,N as RegulatoryContextModel,dr as LocaleJurisdictionGateFeature,R as LLMCallEnvelopeModel,D as ExamplesLocaleJurisdictionGateExample,C as AssistantGatePolicy,Ri as AssistantGateMessagesFrFr,fi as AssistantGateMessagesEnUs,_i as AssistantGateMessagesEnGb,nr as AssistantExplainConceptContract,Wr as AssistantContextForm,S as AssistantCitationModel,W as AssistantAnswerSectionModel,qr as AssistantAnswerRequestedEvent,s as AssistantAnswerIRModel,jr as AssistantAnswerDeliveredEvent,m as AssistantAnswerContract,Kr as AssistantAnswerBlockedEvent,f as AllowedScopeEnum};
21
+ `);if(l.some((o)=>o.test(_)))return{ok:!1,error:O("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:u}}function Gr(){async function i(_){let g=Q(_.envelope);if(!g.ok)return{locale:_.envelope.locale??"en-US",jurisdiction:_.envelope.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:_.envelope.allowedScope??"education_only",sections:[{heading:"Request blocked",body:g.error.message}],citations:[],disclaimers:["This system refuses to answer without a valid envelope."],riskFlags:[g.error.code],refused:!0,refusalReason:g.error.code};let o={locale:g.value.locale,jurisdiction:g.value.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:g.value.allowedScope??"education_only",sections:[{heading:"Answer (demo)",body:`You asked: "${_.question}". This demo answer is derived from the KB snapshot only.`}],citations:[{kbSnapshotId:g.value.kbSnapshotId??"unknown",sourceType:"ruleVersion",sourceId:"rv_demo",title:"Demo rule version",excerpt:"Demo excerpt"}],disclaimers:["Educational demo only."],riskFlags:[]},y=K(g.value.allowedScope,o);if(!y.ok)return{...o,sections:[{heading:"Escalation required",body:y.error.message}],citations:o.citations,refused:!0,refusalReason:y.error.code,riskFlags:[...o.riskFlags??[],y.error.code]};let e=q(o);if(!e.ok)return{...o,sections:[{heading:"Request blocked",body:e.error.message}],citations:[],refused:!0,refusalReason:e.error.code,riskFlags:[...o.riskFlags??[],e.error.code]};return o}async function u(_){return await i({envelope:_.envelope,question:`Explain concept: ${_.conceptKey}`})}return{answer:i,explainConcept:u}}import{OwnersEnum as d,StabilityEnum as w,TagsEnum as b}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as T}from"@contractspec/lib.contracts-spec/policy";var C=T({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[d.PlatformFinance],tags:[b.I18n,"assistant","policy","jurisdiction"],stability:w.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});import{defineFeature as v}from"@contractspec/lib.contracts-spec/features";var dr=v({meta:{key:"locale-jurisdiction-gate",version:"1.0.0",title:"Locale + Jurisdiction Gate",description:"Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",domain:"knowledge",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],stability:"experimental"},operations:[{key:"assistant.answer",version:"1.0.0"},{key:"assistant.explainConcept",version:"1.0.0"}],events:[{key:"assistant.answer.requested",version:"1.0.0"},{key:"assistant.answer.blocked",version:"1.0.0"},{key:"assistant.answer.delivered",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:"knowledge",version:"1.0.0"}]},policies:[{key:C.meta.key,version:C.meta.version}],knowledge:[{key:"locale-jurisdiction-gate.knowledge.rules",version:"1.0.0"}],docs:["docs.examples.locale-jurisdiction-gate.goal","docs.examples.locale-jurisdiction-gate.reference"]});import{defineCommand as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as H}from"@contractspec/lib.schema";var n=k({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},question:{type:H.String_unsecure(),isOptional:!1}}}),E=k({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},conceptKey:{type:H.String_unsecure(),isOptional:!1}}}),m=j({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:n,output:s,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),nr=j({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:E,output:s,errors:m.io.errors},policy:{auth:"user"}});import{OwnersEnum as a,StabilityEnum as c,TagsEnum as rr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as ir}from"@contractspec/lib.contracts-spec/translations/spec";var _i=ir({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[a.PlatformFinance],stability:c.Experimental,tags:[rr.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as tr,StabilityEnum as or,TagsEnum as ur}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as _r}from"@contractspec/lib.contracts-spec/translations/spec";var fi=_r({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[tr.PlatformFinance],stability:or.Experimental,tags:[ur.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as gr,StabilityEnum as Or,TagsEnum as xr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as fr}from"@contractspec/lib.contracts-spec/translations/spec";var Ri=fr({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[gr.PlatformFinance],stability:Or.Experimental,tags:[xr.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{Q as validateEnvelope,G as example,q as enforceCitations,K as enforceAllowedScope,Gr as createDemoAssistantHandlers,Rr as UserProfileModel,N as RegulatoryContextModel,dr as LocaleJurisdictionGateFeature,R as LLMCallEnvelopeModel,D as ExamplesLocaleJurisdictionGateExample,C as AssistantGatePolicy,Ri as AssistantGateMessagesFrFr,fi as AssistantGateMessagesEnUs,_i as AssistantGateMessagesEnGb,nr as AssistantExplainConceptContract,Wr as AssistantContextForm,S as AssistantCitationModel,W as AssistantAnswerSectionModel,qr as AssistantAnswerRequestedEvent,s as AssistantAnswerIRModel,jr as AssistantAnswerDeliveredEvent,m as AssistantAnswerContract,Kr as AssistantAnswerBlockedEvent,f as AllowedScopeEnum};
@@ -17,4 +17,4 @@ import{registerDocBlocks as V}from"@contractspec/lib.contracts-spec/docs";var z=
17
17
  - assistant.answer.requested
18
18
  - assistant.answer.blocked
19
19
  - assistant.answer.delivered`}];V(z);import{defineEnum as A,defineSchemaModel as x,ScalarTypeEnum as r}from"@contractspec/lib.schema";var f=A("AllowedScope",["education_only","generic_info","escalation_required"]),Rr=x({name:"UserProfile",description:"User profile inputs used to derive regulatory context.",fields:{preferredLocale:{type:r.String_unsecure(),isOptional:!0},residencyCountry:{type:r.String_unsecure(),isOptional:!0},taxResidenceCountry:{type:r.String_unsecure(),isOptional:!0},clientType:{type:r.String_unsecure(),isOptional:!0}}}),N=x({name:"RegulatoryContext",description:"Explicit regulatory context (no guessing).",fields:{jurisdiction:{type:r.String_unsecure(),isOptional:!1},region:{type:r.String_unsecure(),isOptional:!0},clientType:{type:r.String_unsecure(),isOptional:!0},allowedScope:{type:f,isOptional:!1}}}),R=x({name:"LLMCallEnvelope",description:"Mandatory envelope for assistant calls. All fields are explicit and required for policy gating.",fields:{traceId:{type:r.String_unsecure(),isOptional:!1},locale:{type:r.String_unsecure(),isOptional:!1},regulatoryContext:{type:N,isOptional:!1},kbSnapshotId:{type:r.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1}}}),S=x({name:"AssistantCitation",description:"Citation referencing a KB snapshot + a specific item within it.",fields:{kbSnapshotId:{type:r.String_unsecure(),isOptional:!1},sourceType:{type:r.String_unsecure(),isOptional:!1},sourceId:{type:r.String_unsecure(),isOptional:!1},title:{type:r.String_unsecure(),isOptional:!0},excerpt:{type:r.String_unsecure(),isOptional:!0}}}),W=x({name:"AssistantAnswerSection",description:"Structured answer section.",fields:{heading:{type:r.String_unsecure(),isOptional:!1},body:{type:r.String_unsecure(),isOptional:!1}}}),s=x({name:"AssistantAnswerIR",description:"Structured assistant answer with mandatory citations and explicit locale/jurisdiction.",fields:{locale:{type:r.String_unsecure(),isOptional:!1},jurisdiction:{type:r.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1},sections:{type:W,isArray:!0,isOptional:!1},citations:{type:S,isArray:!0,isOptional:!1},disclaimers:{type:r.String_unsecure(),isArray:!0,isOptional:!0},riskFlags:{type:r.String_unsecure(),isArray:!0,isOptional:!0},refused:{type:r.Boolean(),isOptional:!0},refusalReason:{type:r.String_unsecure(),isOptional:!0}}});import{defineEvent as U}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as p,ScalarTypeEnum as t}from"@contractspec/lib.schema";var X=p({name:"AssistantAnswerRequestedPayload",description:"Emitted when an assistant answer is requested (pre-gate).",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},locale:{type:t.String_unsecure(),isOptional:!1},jurisdiction:{type:t.String_unsecure(),isOptional:!1},kbSnapshotId:{type:t.String_unsecure(),isOptional:!1},allowedScope:{type:t.String_unsecure(),isOptional:!1}}}),qr=U({meta:{key:"assistant.answer.requested",version:"1.0.0",description:"Assistant answer requested (policy gate will run).",stability:"experimental",owners:["@examples"],tags:["assistant","policy"]},payload:X}),Z=p({name:"AssistantAnswerBlockedPayload",description:"Emitted when a request is blocked by the gate.",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},reasonCode:{type:t.String_unsecure(),isOptional:!1},reason:{type:t.String_unsecure(),isOptional:!1}}}),Kr=U({meta:{key:"assistant.answer.blocked",version:"1.0.0",description:"Assistant answer blocked (fail-closed).",stability:"experimental",owners:["@examples"],tags:["assistant","policy","blocked"]},payload:Z}),$=p({name:"AssistantAnswerDeliveredPayload",description:"Emitted when a structured, cited answer is delivered.",fields:{traceId:{type:t.String_unsecure(),isOptional:!1},locale:{type:t.String_unsecure(),isOptional:!1},jurisdiction:{type:t.String_unsecure(),isOptional:!1},kbSnapshotId:{type:t.String_unsecure(),isOptional:!1},allowedScope:{type:t.String_unsecure(),isOptional:!1},citationsCount:{type:t.Int_unsecure(),isOptional:!1}}}),jr=U({meta:{key:"assistant.answer.delivered",version:"1.0.0",description:"Assistant answer delivered (must include KB snapshot citations).",stability:"experimental",owners:["@examples"],tags:["assistant","policy","delivered"]},payload:$});import{defineExample as B}from"@contractspec/lib.contracts-spec/examples";var D=B({meta:{key:"examples.locale-jurisdiction-gate",version:"1.0.0",title:"Locale Jurisdiction Gate",description:"Example: enforce locale + jurisdiction + kbSnapshotId + allowed scope for assistant calls (fail-closed).",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","locale-jurisdiction-gate"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.locale-jurisdiction-gate"}}),G=D;import{defineFormSpec as J}from"@contractspec/lib.contracts-spec/forms";import{OwnersEnum as L,StabilityEnum as Y,TagsEnum as h}from"@contractspec/lib.contracts-spec/ownership";import{defineSchemaModel as M,ScalarTypeEnum as I}from"@contractspec/lib.schema";var F=M({name:"AssistantContextFormModel",description:"Form values required before a policy-gated assistant request can be executed.",fields:{locale:{type:I.String_unsecure(),isOptional:!1},jurisdiction:{type:I.String_unsecure(),isOptional:!1},kbSnapshotId:{type:I.String_unsecure(),isOptional:!1},allowedScope:{type:f,isOptional:!1},question:{type:I.String_unsecure(),isOptional:!1}}}),Wr=J({meta:{key:"locale-jurisdiction-gate.form.assistant-context",version:"1.0.0",title:"Assistant Context Gate",description:"Collects the explicit locale, jurisdiction, scope, and knowledge snapshot required by the assistant gate.",domain:"assistant",owners:[L.PlatformFinance],tags:[h.I18n,"assistant","form","policy"],stability:Y.Experimental},model:F,fields:[{kind:"select",name:"locale",labelI18n:"assistantGate.locale.label",descriptionI18n:"assistantGate.locale.description",options:{kind:"static",options:[{labelI18n:"assistantGate.locale.enUs",value:"en-US"},{labelI18n:"assistantGate.locale.enGb",value:"en-GB"},{labelI18n:"assistantGate.locale.frFr",value:"fr-FR"}]},required:!0},{kind:"text",name:"jurisdiction",labelI18n:"assistantGate.jurisdiction.label",placeholderI18n:"assistantGate.jurisdiction.placeholder",required:!0},{kind:"text",name:"kbSnapshotId",labelI18n:"assistantGate.kbSnapshotId.label",placeholderI18n:"assistantGate.kbSnapshotId.placeholder",required:!0},{kind:"radio",name:"allowedScope",labelI18n:"assistantGate.allowedScope.label",options:{kind:"static",options:[{labelI18n:"assistantGate.allowedScope.educationOnly",value:"education_only"},{labelI18n:"assistantGate.allowedScope.genericInfo",value:"generic_info"},{labelI18n:"assistantGate.allowedScope.escalationRequired",value:"escalation_required"}]},required:!0},{kind:"textarea",name:"question",labelI18n:"assistantGate.question.label",placeholderI18n:"assistantGate.question.placeholder",required:!0}],actions:[{key:"submit",labelI18n:"assistantGate.submit.label",op:{name:"assistant.answer",version:"1.0.0"}}],policy:{flags:[],pii:["kbSnapshotId","question"]},renderHints:{ui:"custom",form:"react-hook-form"}});var P=new Set(["en-US","en-GB","fr-FR"]);function O(i,u){return{code:i,message:u}}function Q(i){if(!i.locale||!P.has(i.locale))return{ok:!1,error:O("LOCALE_REQUIRED","locale is required and must be supported")};if(!i.regulatoryContext?.jurisdiction)return{ok:!1,error:O("JURISDICTION_REQUIRED","jurisdiction is required")};if(!i.kbSnapshotId)return{ok:!1,error:O("KB_SNAPSHOT_REQUIRED","kbSnapshotId is required")};if(!i.allowedScope)return{ok:!1,error:O("SCOPE_VIOLATION","allowedScope is required")};return{ok:!0,value:i}}function q(i){let u=i.citations??[];if(!Array.isArray(u)||u.length===0)return{ok:!1,error:O("CITATIONS_REQUIRED","answers must include at least one citation")};return{ok:!0,value:i}}var l=[/\b(buy|sell)\b/i,/\b(should\s+buy|should\s+sell)\b/i,/\b(guarantee(d)?|promise(d)?)\b/i];function K(i,u){if(!i)return{ok:!1,error:O("SCOPE_VIOLATION","allowedScope is required")};if(i!=="education_only")return{ok:!0,value:u};let _=(u.sections??[]).map((o)=>o.body).join(`
20
- `);if(l.some((o)=>o.test(_)))return{ok:!1,error:O("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:u}}function Gr(){async function i(_){let g=Q(_.envelope);if(!g.ok)return{locale:_.envelope.locale??"en-US",jurisdiction:_.envelope.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:_.envelope.allowedScope??"education_only",sections:[{heading:"Request blocked",body:g.error.message}],citations:[],disclaimers:["This system refuses to answer without a valid envelope."],riskFlags:[g.error.code],refused:!0,refusalReason:g.error.code};let o={locale:g.value.locale,jurisdiction:g.value.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:g.value.allowedScope??"education_only",sections:[{heading:"Answer (demo)",body:`You asked: "${_.question}". This demo answer is derived from the KB snapshot only.`}],citations:[{kbSnapshotId:g.value.kbSnapshotId??"unknown",sourceType:"ruleVersion",sourceId:"rv_demo",title:"Demo rule version",excerpt:"Demo excerpt"}],disclaimers:["Educational demo only."],riskFlags:[]},y=K(g.value.allowedScope,o);if(!y.ok)return{...o,sections:[{heading:"Escalation required",body:y.error.message}],citations:o.citations,refused:!0,refusalReason:y.error.code,riskFlags:[...o.riskFlags??[],y.error.code]};let e=q(o);if(!e.ok)return{...o,sections:[{heading:"Request blocked",body:e.error.message}],citations:[],refused:!0,refusalReason:e.error.code,riskFlags:[...o.riskFlags??[],e.error.code]};return o}async function u(_){return await i({envelope:_.envelope,question:`Explain concept: ${_.conceptKey}`})}return{answer:i,explainConcept:u}}import{OwnersEnum as d,StabilityEnum as w,TagsEnum as b}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as T}from"@contractspec/lib.contracts-spec/policy";var C=T({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[d.PlatformFinance],tags:[b.I18n,"assistant","policy","jurisdiction"],stability:w.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});import{defineFeature as v}from"@contractspec/lib.contracts-spec/features";var dr=v({meta:{key:"locale-jurisdiction-gate",version:"1.0.0",title:"Locale + Jurisdiction Gate",description:"Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",domain:"knowledge",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],stability:"experimental"},operations:[{key:"assistant.answer",version:"1.0.0"},{key:"assistant.explainConcept",version:"1.0.0"}],events:[{key:"assistant.answer.requested",version:"1.0.0"},{key:"assistant.answer.blocked",version:"1.0.0"},{key:"assistant.answer.delivered",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:"knowledge",version:"1.0.0"}]},policies:[{key:C.meta.key,version:C.meta.version}],knowledge:[{key:"locale-jurisdiction-gate.knowledge.rules",version:"1.0.0"}],docs:["docs.examples.locale-jurisdiction-gate.goal","docs.examples.locale-jurisdiction-gate.reference"]});import{defineCommand as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as H}from"@contractspec/lib.schema";var n=k({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},question:{type:H.String_unsecure(),isOptional:!1}}}),E=k({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},conceptKey:{type:H.String_unsecure(),isOptional:!1}}}),m=j({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:n,output:s,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),nr=j({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:E,output:s,errors:m.io.errors},policy:{auth:"user"}});import{OwnersEnum as a,StabilityEnum as c,TagsEnum as rr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as ir}from"@contractspec/lib.contracts-spec/translations/spec";var _i=ir({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[a.PlatformFinance],stability:c.Experimental,tags:[rr.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as tr,StabilityEnum as or,TagsEnum as ur}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as _r}from"@contractspec/lib.contracts-spec/translations/spec";var fi=_r({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[tr.PlatformFinance],stability:or.Experimental,tags:[ur.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as gr,StabilityEnum as Or,TagsEnum as xr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as fr}from"@contractspec/lib.contracts-spec/translations/spec";var Ri=fr({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[gr.PlatformFinance],stability:Or.Experimental,tags:[xr.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{Q as validateEnvelope,G as example,q as enforceCitations,K as enforceAllowedScope,Gr as createDemoAssistantHandlers,Rr as UserProfileModel,N as RegulatoryContextModel,dr as LocaleJurisdictionGateFeature,R as LLMCallEnvelopeModel,D as ExamplesLocaleJurisdictionGateExample,C as AssistantGatePolicy,Ri as AssistantGateMessagesFrFr,fi as AssistantGateMessagesEnUs,_i as AssistantGateMessagesEnGb,nr as AssistantExplainConceptContract,Wr as AssistantContextForm,S as AssistantCitationModel,W as AssistantAnswerSectionModel,qr as AssistantAnswerRequestedEvent,s as AssistantAnswerIRModel,jr as AssistantAnswerDeliveredEvent,m as AssistantAnswerContract,Kr as AssistantAnswerBlockedEvent,f as AllowedScopeEnum};
20
+ `);if(l.some((o)=>o.test(_)))return{ok:!1,error:O("SCOPE_VIOLATION","answer violates education_only scope (contains actionable or promotional language)")};return{ok:!0,value:u}}function Gr(){async function i(_){let g=Q(_.envelope);if(!g.ok)return{locale:_.envelope.locale??"en-US",jurisdiction:_.envelope.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:_.envelope.allowedScope??"education_only",sections:[{heading:"Request blocked",body:g.error.message}],citations:[],disclaimers:["This system refuses to answer without a valid envelope."],riskFlags:[g.error.code],refused:!0,refusalReason:g.error.code};let o={locale:g.value.locale,jurisdiction:g.value.regulatoryContext?.jurisdiction??"UNKNOWN",allowedScope:g.value.allowedScope??"education_only",sections:[{heading:"Answer (demo)",body:`You asked: "${_.question}". This demo answer is derived from the KB snapshot only.`}],citations:[{kbSnapshotId:g.value.kbSnapshotId??"unknown",sourceType:"ruleVersion",sourceId:"rv_demo",title:"Demo rule version",excerpt:"Demo excerpt"}],disclaimers:["Educational demo only."],riskFlags:[]},y=K(g.value.allowedScope,o);if(!y.ok)return{...o,sections:[{heading:"Escalation required",body:y.error.message}],citations:o.citations,refused:!0,refusalReason:y.error.code,riskFlags:[...o.riskFlags??[],y.error.code]};let e=q(o);if(!e.ok)return{...o,sections:[{heading:"Request blocked",body:e.error.message}],citations:[],refused:!0,refusalReason:e.error.code,riskFlags:[...o.riskFlags??[],e.error.code]};return o}async function u(_){return await i({envelope:_.envelope,question:`Explain concept: ${_.conceptKey}`})}return{answer:i,explainConcept:u}}import{OwnersEnum as d,StabilityEnum as w,TagsEnum as b}from"@contractspec/lib.contracts-spec/ownership";import{definePolicy as T}from"@contractspec/lib.contracts-spec/policy";var C=T({meta:{key:"locale-jurisdiction-gate.policy.gate",version:"1.0.0",title:"Assistant Locale and Jurisdiction Gate",description:"Requires explicit locale, jurisdiction, knowledge snapshot, and allowed scope before assistant requests may proceed.",domain:"assistant",scope:"operation",owners:[d.PlatformFinance],tags:[b.I18n,"assistant","policy","jurisdiction"],stability:w.Experimental},rules:[{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!context.locale || !context.jurisdiction || !context.kbSnapshotId || !context.allowedScope"}],reason:"Assistant requests fail closed until locale, jurisdiction, kbSnapshotId, and allowedScope are explicit."},{effect:"deny",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"!['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '')"}],reason:"Only the explicitly reviewed assistant locales are permitted."},{effect:"allow",actions:["assistant.answer","assistant.explainConcept"],resource:{type:"assistant-call"},conditions:[{expression:"['en-US', 'en-GB', 'fr-FR'].includes(context.locale ?? '') && !!context.jurisdiction && !!context.kbSnapshotId && !!context.allowedScope"}],reason:"Explicit context is present, so the request may continue to citation and scope validation."}],pii:{fields:["kbSnapshotId"],retentionDays:30}});import{defineFeature as v}from"@contractspec/lib.contracts-spec/features";var dr=v({meta:{key:"locale-jurisdiction-gate",version:"1.0.0",title:"Locale + Jurisdiction Gate",description:"Fail-closed gating for assistant calls requiring locale/jurisdiction/snapshot/scope and citations.",domain:"knowledge",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],stability:"experimental"},operations:[{key:"assistant.answer",version:"1.0.0"},{key:"assistant.explainConcept",version:"1.0.0"}],events:[{key:"assistant.answer.requested",version:"1.0.0"},{key:"assistant.answer.blocked",version:"1.0.0"},{key:"assistant.answer.delivered",version:"1.0.0"}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{requires:[{key:"knowledge",version:"1.0.0"}]},policies:[{key:C.meta.key,version:C.meta.version}],knowledge:[{key:"locale-jurisdiction-gate.knowledge.rules",version:"1.0.0"}],docs:["docs.examples.locale-jurisdiction-gate.goal","docs.examples.locale-jurisdiction-gate.reference"]});import{defineCommand as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as H}from"@contractspec/lib.schema";var n=k({name:"AssistantQuestionInput",description:"Input for assistant calls with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},question:{type:H.String_unsecure(),isOptional:!1}}}),E=k({name:"AssistantConceptInput",description:"Input for explaining a concept with mandatory envelope.",fields:{envelope:{type:R,isOptional:!1},conceptKey:{type:H.String_unsecure(),isOptional:!1}}}),m=j({meta:{key:"assistant.answer",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","locale","jurisdiction","knowledge"],description:"Answer a user question using a KB snapshot with strict locale/jurisdiction gating.",goal:"Provide policy-safe answers that cite a KB snapshot or refuse.",context:"Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing."},io:{input:n,output:s,errors:{LOCALE_REQUIRED:{description:"Locale is required and must be supported",http:400,gqlCode:"LOCALE_REQUIRED",when:"locale is missing or unsupported"},JURISDICTION_REQUIRED:{description:"Jurisdiction is required",http:400,gqlCode:"JURISDICTION_REQUIRED",when:"jurisdiction is missing"},KB_SNAPSHOT_REQUIRED:{description:"KB snapshot id is required",http:400,gqlCode:"KB_SNAPSHOT_REQUIRED",when:"kbSnapshotId is missing"},CITATIONS_REQUIRED:{description:"Answers must include citations to a KB snapshot",http:422,gqlCode:"CITATIONS_REQUIRED",when:"answer has no citations"},SCOPE_VIOLATION:{description:"Answer violates allowed scope and must be refused/escalated",http:403,gqlCode:"SCOPE_VIOLATION",when:"output includes forbidden content under the given allowedScope"}}},policy:{auth:"user"}}),nr=j({meta:{key:"assistant.explainConcept",version:"1.0.0",stability:"experimental",owners:["@examples"],tags:["assistant","policy","knowledge","concepts"],description:"Explain a concept using a KB snapshot with strict locale/jurisdiction gating.",goal:"Explain concepts with citations or refuse.",context:"Same constraints as assistant.answer."},io:{input:E,output:s,errors:m.io.errors},policy:{auth:"user"}});import{OwnersEnum as a,StabilityEnum as c,TagsEnum as rr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as ir}from"@contractspec/lib.contracts-spec/translations/spec";var _i=ir({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[a.PlatformFinance],stability:c.Experimental,tags:[rr.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as tr,StabilityEnum as or,TagsEnum as ur}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as _r}from"@contractspec/lib.contracts-spec/translations/spec";var fi=_r({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[tr.PlatformFinance],stability:or.Experimental,tags:[ur.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as gr,StabilityEnum as Or,TagsEnum as xr}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as fr}from"@contractspec/lib.contracts-spec/translations/spec";var Ri=fr({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[gr.PlatformFinance],stability:Or.Experimental,tags:[xr.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{Q as validateEnvelope,G as example,q as enforceCitations,K as enforceAllowedScope,Gr as createDemoAssistantHandlers,Rr as UserProfileModel,N as RegulatoryContextModel,dr as LocaleJurisdictionGateFeature,R as LLMCallEnvelopeModel,D as ExamplesLocaleJurisdictionGateExample,C as AssistantGatePolicy,Ri as AssistantGateMessagesFrFr,fi as AssistantGateMessagesEnUs,_i as AssistantGateMessagesEnGb,nr as AssistantExplainConceptContract,Wr as AssistantContextForm,S as AssistantCitationModel,W as AssistantAnswerSectionModel,qr as AssistantAnswerRequestedEvent,s as AssistantAnswerIRModel,jr as AssistantAnswerDeliveredEvent,m as AssistantAnswerContract,Kr as AssistantAnswerBlockedEvent,f as AllowedScopeEnum};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{z as AssistantGateMessagesFrFr};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{z as AssistantGateMessagesFrFr};
@@ -1 +1 @@
1
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var J=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[v.PlatformFinance],stability:x.Experimental,tags:[z.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var J=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[v.PlatformFinance],stability:x.Experimental,tags:[z.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"Sélectionnez la langue validée pour la réponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Périmètre autorisé"},"assistantGate.allowedScope.educationOnly":{value:"Contenu éducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information générale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction sélectionnée ?"},"assistantGate.submit.label":{value:"Générer la réponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
2
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});export{z as AssistantGateMessagesEnGb};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
2
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});export{z as AssistantGateMessagesEnUs};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{z as AssistantGateMessagesFrFr};
2
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var z=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{z as AssistantGateMessagesFrFr};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var J=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-GB",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.en-US",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[v.PlatformFinance],stability:x.Experimental,tags:[z.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate.fr-FR",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
2
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as k}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as q}from"@contractspec/lib.contracts-spec/translations/spec";var J=q({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"British English messages for the assistant locale and jurisdiction gate.",owners:[h.PlatformFinance],stability:j.Experimental,tags:[k.I18n,"assistant","policy"]},locale:"en-GB",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Select the reviewed locale for the assistant response."},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"UK-FCA"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Permitted scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"General information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What may I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate response"}}});import{OwnersEnum as v,StabilityEnum as x,TagsEnum as z}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as A}from"@contractspec/lib.contracts-spec/translations/spec";var N=A({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"US English messages for the assistant locale and jurisdiction gate.",owners:[v.PlatformFinance],stability:x.Experimental,tags:[z.I18n,"assistant","policy"]},locale:"en-US",messages:{"assistantGate.locale.label":{value:"Locale"},"assistantGate.locale.description":{value:"Choose the reviewed locale for the assistant answer."},"assistantGate.locale.enUs":{value:"English (United States)"},"assistantGate.locale.enGb":{value:"English (United Kingdom)"},"assistantGate.locale.frFr":{value:"French (France)"},"assistantGate.jurisdiction.label":{value:"Jurisdiction"},"assistantGate.jurisdiction.placeholder":{value:"US-SEC"},"assistantGate.kbSnapshotId.label":{value:"Knowledge snapshot ID"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"Allowed scope"},"assistantGate.allowedScope.educationOnly":{value:"Educational content only"},"assistantGate.allowedScope.genericInfo":{value:"Generic information"},"assistantGate.allowedScope.escalationRequired":{value:"Escalation required"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"What can I say about this product in the selected jurisdiction?"},"assistantGate.submit.label":{value:"Generate answer"}}});import{OwnersEnum as B,StabilityEnum as C,TagsEnum as D}from"@contractspec/lib.contracts-spec/ownership";import{defineTranslation as G}from"@contractspec/lib.contracts-spec/translations/spec";var V=G({meta:{key:"locale-jurisdiction-gate.translation.assistant-gate",version:"1.0.0",domain:"assistant",description:"French messages for the assistant locale and jurisdiction gate.",owners:[B.PlatformFinance],stability:C.Experimental,tags:[D.I18n,"assistant","policy"]},locale:"fr-FR",fallback:"en-US",messages:{"assistantGate.locale.label":{value:"Langue"},"assistantGate.locale.description":{value:"S\xE9lectionnez la langue valid\xE9e pour la r\xE9ponse de l'assistant."},"assistantGate.jurisdiction.label":{value:"Juridiction"},"assistantGate.jurisdiction.placeholder":{value:"FR-AMF"},"assistantGate.kbSnapshotId.label":{value:"Identifiant du snapshot documentaire"},"assistantGate.kbSnapshotId.placeholder":{value:"kb_2026_03_20_policy_reviewed"},"assistantGate.allowedScope.label":{value:"P\xE9rim\xE8tre autoris\xE9"},"assistantGate.allowedScope.educationOnly":{value:"Contenu \xE9ducatif uniquement"},"assistantGate.allowedScope.genericInfo":{value:"Information g\xE9n\xE9rale"},"assistantGate.allowedScope.escalationRequired":{value:"Escalade obligatoire"},"assistantGate.question.label":{value:"Question"},"assistantGate.question.placeholder":{value:"Que puis-je dire sur ce produit dans la juridiction s\xE9lectionn\xE9e ?"},"assistantGate.submit.label":{value:"G\xE9n\xE9rer la r\xE9ponse"}}});export{V as AssistantGateMessagesFrFr,N as AssistantGateMessagesEnUs,J as AssistantGateMessagesEnGb};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.locale-jurisdiction-gate",
3
- "version": "3.7.26",
3
+ "version": "3.7.27",
4
4
  "description": "Example: enforce locale + jurisdiction + kbSnapshotId + allowed scope for assistant calls (fail-closed).",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -176,7 +176,7 @@
176
176
  "typecheck": "tsc --noEmit"
177
177
  },
178
178
  "dependencies": {
179
- "@contractspec/lib.contracts-spec": "6.1.0",
179
+ "@contractspec/lib.contracts-spec": "6.2.0",
180
180
  "@contractspec/lib.schema": "3.7.14"
181
181
  },
182
182
  "devDependencies": {
@@ -20,8 +20,17 @@ describe('@contractspec/example.locale-jurisdiction-gate', () => {
20
20
  'assistant.answer'
21
21
  );
22
22
  expect(AssistantGateMessagesEnUs.locale).toBe('en-US');
23
+ expect(AssistantGateMessagesEnUs.meta.key).toBe(
24
+ 'locale-jurisdiction-gate.translation.assistant-gate'
25
+ );
26
+ expect(AssistantGateMessagesEnGb.meta.key).toBe(
27
+ AssistantGateMessagesEnUs.meta.key
28
+ );
23
29
  expect(AssistantGateMessagesEnGb.fallback).toBe('en-US');
24
30
  expect(AssistantGateMessagesFrFr.locale).toBe('fr-FR');
31
+ expect(AssistantGateMessagesFrFr.meta.key).toBe(
32
+ AssistantGateMessagesEnUs.meta.key
33
+ );
25
34
  expect(LocaleJurisdictionGateFeature.policies).toEqual([
26
35
  {
27
36
  key: AssistantGatePolicy.meta.key,
@@ -7,7 +7,7 @@ import { defineTranslation } from '@contractspec/lib.contracts-spec/translations
7
7
 
8
8
  export const AssistantGateMessagesEnGb = defineTranslation({
9
9
  meta: {
10
- key: 'locale-jurisdiction-gate.translation.assistant-gate.en-GB',
10
+ key: 'locale-jurisdiction-gate.translation.assistant-gate',
11
11
  version: '1.0.0',
12
12
  domain: 'assistant',
13
13
  description:
@@ -7,7 +7,7 @@ import { defineTranslation } from '@contractspec/lib.contracts-spec/translations
7
7
 
8
8
  export const AssistantGateMessagesEnUs = defineTranslation({
9
9
  meta: {
10
- key: 'locale-jurisdiction-gate.translation.assistant-gate.en-US',
10
+ key: 'locale-jurisdiction-gate.translation.assistant-gate',
11
11
  version: '1.0.0',
12
12
  domain: 'assistant',
13
13
  description:
@@ -7,7 +7,7 @@ import { defineTranslation } from '@contractspec/lib.contracts-spec/translations
7
7
 
8
8
  export const AssistantGateMessagesFrFr = defineTranslation({
9
9
  meta: {
10
- key: 'locale-jurisdiction-gate.translation.assistant-gate.fr-FR',
10
+ key: 'locale-jurisdiction-gate.translation.assistant-gate',
11
11
  version: '1.0.0',
12
12
  domain: 'assistant',
13
13
  description: