@cratis/screenplay-language 4.124.1 → 4.126.0
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.
- package/dist/bundles/compiler/Authoring/QuickFixes.js +2 -2
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConditionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js +1 -1
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DescriptionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/FeatureBody.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/IdentityParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ImplementationParser.js +2 -2
- package/dist/bundles/compiler/Parsing/InputUses.js +1 -1
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PurposeParser.js +1 -1
- package/dist/bundles/compiler/Parsing/QueryParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SliceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js +1 -1
- package/dist/bundles/compiler/index.js +1 -1
- package/dist/bundles/completion-items.js +1 -1
- package/dist/bundles/completion-items.js.map +1 -1
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/keyword-docs.js +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/validation.js +1 -1
- package/dist/bundles/validation.js.map +1 -1
- package/dist/diagnostic-codes.d.ts +1 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","names":["startColumn","length","severity","line","text","token","message","code","issues","types","knownTypeNames","symbols","primitiveTypes","application","property","properties","propertyTypeReference","candidate","bare","owner","diagnosticCodes","type","event","query","command","identifiers","extra","lines","declared","declaration","fences","fenceMap","scanned","scanDocument","context","mergeSymbols","input","symbolsForBuffer","analysis","responseAnalysis","source","routeLines","route","production","events","knownEventNames","policies","policy","optionalCodes","DiagnosticCodes","policyCodes","consistencyCodes","timelineCodes","dependencyCodes","authoringCodes","complianceCodes","compilerUnknownEventLines","diagnostic","identityType","detail","identityDuplicate","existing","legacyOptionalTypeLength","name","authorizeIndent","index","trimmed","leading","indentOf","fileImportIssue","slice","sliceTypes","concept","authorize","reactsOn","produces","next","uniqueEvent","uniqueProperty","path","member","knownIdentity","identityProperties","segments","contextRoots","causedByProperties","validateInlineEvents","fenceLines","last","eventAnalysisSource","fileImportOn","indent","enclosingChain","isFileImportLine","mappingTarget","members","match","written","resolveEventContextPath","resolution","column","has","target"],"sources":["../../validation.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes, legacyOptionalTypeLength } from '@cratis/screenplay-compiler';\nimport { AnalysisDiagnostic, responseAnalysis } from './response-analysis';\nimport { validateInlineEvents } from './inline-event-validation';\nimport { causedByProperties, contextRoots, identityProperties, primitiveTypes, sliceTypes } from './language';\nimport { DiagnosticCode, diagnosticCodes } from './diagnostic-codes';\nimport { enclosingChain, fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { resolveEventContextPath } from './event-context';\nimport {\n DocumentSymbols,\n PropertySymbol,\n propertyTypeReference,\n knownEventNames,\n knownTypeNames,\n mergeSymbols,\n scanDocument,\n symbolsForBuffer,\n} from './symbols';\nimport { fileImportOn, isFileImportLine } from './file-imports';\n\nexport type ValidationSeverity = 'error' | 'warning' | 'information';\n\nexport interface ValidationIssue {\n line: number;\n startColumn: number;\n endColumn: number;\n message: string;\n severity: ValidationSeverity;\n\n // The compiler code for this condition, absent on the structural checks the editor makes and the\n // compiler does not. See ./diagnostic-codes.ts.\n code?: DiagnosticCode;\n}\n\n// What a document is validated against beyond itself.\nexport interface ValidationContext {\n // What the rest of the application declares - the other .play files of a folder, or the files an import\n // brings in - so a name declared in another file is not reported unknown. Merge the scanned symbols of\n // those files with mergeSymbols. The document's own declarations are always known.\n application?: DocumentSymbols;\n placement?: readonly string[];\n path?: string;\n compilerDiagnostics?: readonly AnalysisDiagnostic[];\n}\n\nfunction issue(\n severity: ValidationSeverity,\n line: number,\n startColumn: number,\n length: number,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n return { severity, message, line, startColumn, endColumn: startColumn + length, code };\n}\n\nfunction tokenIssue(\n severity: ValidationSeverity,\n line: number,\n text: string,\n token: string,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n const column = text.indexOf(token) + 1;\n return issue(severity, line, column, token.length, message, code);\n}\n\n// Reports every property whose type reference names nothing the document declares, and\n// every command that marks more than one property as its identifier.\nfunction validateDeclarations(lines: string[], symbols: DocumentSymbols, application: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const types = new Set([...knownTypeNames(symbols, primitiveTypes), ...knownTypeNames(application, [])]);\n\n const checkProperties = (properties: PropertySymbol[], owner: string) => {\n for (const property of properties.filter(\n (candidate) => !types.has(propertyTypeReference(candidate).name),\n )) {\n const bare = propertyTypeReference(property).name;\n issues.push(\n issue(\n 'warning',\n property.line,\n property.sourceType!.startColumn,\n property.sourceType!.text.length,\n bare === 'optional'\n ? `Unknown type 'optional' on '${property.name}' of ${owner} — did you forget the type before 'optional'?`\n : `Unknown type '${bare}' on '${property.name}' of ${owner} — declare it with 'concept ${bare} : <Primitive>' or 'type ${bare}'.`,\n diagnosticCodes.unknownType,\n ),\n );\n }\n };\n\n for (const type of symbols.types) checkProperties(type.properties, `type '${type.name}'`);\n for (const event of symbols.events) checkProperties(event.properties, `event '${event.name}'`);\n for (const query of symbols.queries) checkProperties(query.parameters, `query '${query.name}'`);\n for (const command of symbols.commands) {\n checkProperties(command.properties, `command '${command.name}'`);\n const identifiers = command.properties.filter((property) => property.isIdentifier);\n for (const extra of identifiers.slice(1)) {\n issues.push(\n tokenIssue(\n 'error',\n extra.line,\n lines[extra.line],\n 'identifier',\n `Command '${command.name}' already marks '${identifiers[0].name}' as identifier — only one property can be the identifier.`,\n diagnosticCodes.duplicateCommandIdentifier,\n ),\n );\n }\n }\n\n const declared = new Map<string, number>();\n for (const declaration of [...symbols.concepts, ...symbols.types]) {\n const first = declared.get(declaration.name);\n if (first === undefined) {\n declared.set(declaration.name, declaration.line);\n continue;\n }\n issues.push(\n tokenIssue(\n 'error',\n declaration.line,\n lines[declaration.line],\n declaration.name,\n `Duplicate declaration of '${declaration.name}' — concept and type names must be unique.`,\n diagnosticCodes.duplicateDeclaration,\n ),\n );\n }\n\n return issues;\n}\n\n// Validates a Screenplay document without any editor dependency — both the Monaco\n// service and the VSCode extension adapt these issues to their marker/diagnostic APIs.\n//\n// The checks read the document line by line, never as a whole document's top level, so a file an import\n// places in a module or feature - holding slices or features at its top level - validates as it is written.\n// Where it is placed, and whether its imports resolve, is the compiler's to say.\nexport function validateLines(lines: string[], context: ValidationContext = {}): ValidationIssue[] {\n const fences = fenceMap(lines);\n const scanned = scanDocument(lines);\n const application = context.application ?? mergeSymbols();\n const input = symbolsForBuffer(lines, { ...application, authoringPath: context.path ?? application.authoringPath, authoringPlacement: context.placement ?? application.authoringPlacement });\n const analysis = responseAnalysis(lines, input.authoringDocuments ?? input.authoringSources?.filter(source => source !== lines.join('\\n')), input.authoringPlacement, input.authoringPath, input.authoringPlacementResolved);\n const routeLines = new Set(analysis.eventSources.routes.map(route => route.location.line - 1));\n const symbols = { ...scanned, commands: scanned.commands.map(command => ({ ...command,\n properties: command.properties.filter(property => !routeLines.has(property.line)),\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line)),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })) };\n const events = new Set([...knownEventNames(symbols), ...knownEventNames(application)]);\n const policies = new Set([...symbols.policies, ...application.policies].map((policy) => policy.name));\n const issues: ValidationIssue[] = validateDeclarations(lines, symbols, application);\n issues.push(...validateProductionDestinations(lines, symbols));\n // One parser pass covers committed types, including query results and trigger data, without\n // speculative property scans mistaking tags, paths, strings or code for optionality.\n const optionalCodes = new Set<string>([DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.InvalidOptionalModifierOrder, DiagnosticCodes.OptionalReadsNotSupported]);\n const policyCodes = new Set<string>([DiagnosticCodes.UnexpectedTokenInPolicyCondition, DiagnosticCodes.ExpectedPolicyCondition, DiagnosticCodes.UnclosedPolicyConditionGroup, DiagnosticCodes.ExpectedRoleName, DiagnosticCodes.ExpectedClaimName, DiagnosticCodes.ExpectedClaimMatches, DiagnosticCodes.ExpectedClaimMatchTarget]);\n const consistencyCodes = new Set<string>([DiagnosticCodes.UnknownEvent, DiagnosticCodes.UnknownReadModelProperty, DiagnosticCodes.PiiNotSupportedOnIdentifier]);\n const timelineCodes = new Set<string>([DiagnosticCodes.EventFromLaterSlice, DiagnosticCodes.TimelineCycleGroup]);\n const dependencyCodes = new Set<string>([DiagnosticCodes.UndeclaredDependency, DiagnosticCodes.UnusedDependencyDeclaration, DiagnosticCodes.InvalidDependencyTarget, DiagnosticCodes.RepeatedDependencyDeclaration, DiagnosticCodes.MutualDependencyDeclarations, DiagnosticCodes.AmbiguousReference]);\n // These parser diagnostics must reach the marker adapter. C#-only completeness and reference\n // checks are not synthesized here, but are preserved when a caller supplies compiler diagnostics.\n const authoringCodes = new Set<string>([DiagnosticCodes.InvalidEventDeclaration, DiagnosticCodes.InvalidImportDeclaration, DiagnosticCodes.InvalidSliceDeclaration, DiagnosticCodes.InvalidDescription, DiagnosticCodes.DuplicateDescription, DiagnosticCodes.EmptyDescription,DiagnosticCodes.DuplicateEventSubject, DiagnosticCodes.InvalidSubjectType, DiagnosticCodes.ProtectedSubjectType, DiagnosticCodes.InvalidSubjectOwner, DiagnosticCodes.ReadModelSubjectNotSupported, DiagnosticCodes.InvalidSubjectModifierOrder, DiagnosticCodes.UnsupportedInteractionAlternatives, DiagnosticCodes.MixedInteractionAlternatives, DiagnosticCodes.InteractionAlternativeWithoutActions, DiagnosticCodes.InlineInteractionAlternative, DiagnosticCodes.LegacyInteractionWhere, DiagnosticCodes.InvalidSpecificationParameter, DiagnosticCodes.InvalidSpecificationCase, DiagnosticCodes.DuplicateSpecificationParameter, DiagnosticCodes.DuplicateSpecificationCase, DiagnosticCodes.IncompleteSpecificationTable, DiagnosticCodes.InvalidSpecificationCaseAssignment, DiagnosticCodes.InvalidSpecificationCaseValue, DiagnosticCodes.InvalidSpecificationCaseReference, DiagnosticCodes.OptionalSpecificationParameterTarget, DiagnosticCodes.SpecificationCaseNameCollision, DiagnosticCodes.IncompatibleSpecificationParameterType, DiagnosticCodes.UnusedSpecificationParameter, DiagnosticCodes.SingularSpecificationTableExpansion, DiagnosticCodes.InvalidSpecificationCallerPersona, DiagnosticCodes.UnsynthesizablePersonaCaller, DiagnosticCodes.PersonaWithoutGate, DiagnosticCodes.GateWithoutPersona, DiagnosticCodes.AmbiguousPersonaCaller, DiagnosticCodes.InvalidDocumentation, DiagnosticCodes.ConflictingDocumentationAcrossFiles, DiagnosticCodes.InvalidAbsentReadModelStep, DiagnosticCodes.UnknownConstraintProperty, DiagnosticCodes.OmittedProductionDestination, DiagnosticCodes.InvalidSpecificationExample, DiagnosticCodes.DuplicateSpecificationAssignment]);\n const complianceCodes = new Set<string>([DiagnosticCodes.InvalidPurposeDeclaration, DiagnosticCodes.InvalidPurposeVocabulary, DiagnosticCodes.DuplicatePurposeField, DiagnosticCodes.DuplicatePurposeDeclaration, DiagnosticCodes.UnknownPurpose, DiagnosticCodes.PurposeInterestMismatch, DiagnosticCodes.PersonalDataWithoutPurpose, DiagnosticCodes.SpecialDataWithoutCondition, DiagnosticCodes.CriminalDataWithoutAuthorization, DiagnosticCodes.PurposeWithoutBasis, DiagnosticCodes.UnusedPurpose, DiagnosticCodes.UnknownConceptDirective, DiagnosticCodes.AttributeReasonWithoutAttribute, DiagnosticCodes.DuplicateAttributeReason, DiagnosticCodes.LegacyComplianceMarker, DiagnosticCodes.UnknownComplianceMarker, DiagnosticCodes.InvalidSecretScope, DiagnosticCodes.DuplicateSecretScope, DiagnosticCodes.SecretScopeIgnoredForPii, DiagnosticCodes.InvalidPersonalDataQualifier, DiagnosticCodes.DuplicateSpecialCategory]);\n const compilerUnknownEventLines = new Set<number>();\n for (const diagnostic of context.compilerDiagnostics ?? analysis.diagnostics) {\n const identityType = diagnostic.code === DiagnosticCodes.UnknownType && (analysis.identityDetails ?? []).some(detail => detail.line === diagnostic.location.line - 1);\n const identityDuplicate = diagnostic.code === DiagnosticCodes.RepeatedSingularDeclarationAcrossFiles && diagnostic.message.includes('identity block');\n if (!identityType && !identityDuplicate && !complianceCodes.has(diagnostic.code) && !optionalCodes.has(diagnostic.code) && !policyCodes.has(diagnostic.code) && !consistencyCodes.has(diagnostic.code) && !timelineCodes.has(diagnostic.code) && !dependencyCodes.has(diagnostic.code) && !authoringCodes.has(diagnostic.code) && diagnostic.code !== DiagnosticCodes.InvalidSpecificationExampleBody && diagnostic.code !== DiagnosticCodes.UnknownRuleImplementationDirective && diagnostic.code !== DiagnosticCodes.InvalidValidationRule && diagnostic.code !== DiagnosticCodes.RepeatedDeclarationAcrossFiles && !/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY063[3-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$/.test(diagnostic.code)) continue;\n const line = diagnostic.location.line - 1;\n if (diagnostic.code === DiagnosticCodes.OmittedProductionDestination && issues.some(existing => existing.code === diagnostic.code && existing.line === line)) continue;\n if (diagnostic.code === DiagnosticCodes.UnknownEvent) {\n if (compilerUnknownEventLines.has(line)) continue;\n compilerUnknownEventLines.add(line);\n }\n const length = legacyOptionalTypeLength(lines[line], diagnostic) || lines[line].length - diagnostic.location.column + 1;\n issues.push(issue(diagnostic.severity, line, diagnostic.location.column, length, diagnostic.message, diagnostic.code as DiagnosticCode));\n }\n\n const checkEvent = (line: number, text: string, name: string) => {\n if (!events.has(name) && !compilerUnknownEventLines.has(line)) {\n issues.push(\n tokenIssue(\n 'warning',\n line,\n text,\n name,\n `Unknown event type '${name}' — declare it in a slice or import it.`,\n diagnosticCodes.unknownEvent,\n ),\n );\n }\n };\n\n let authorizeIndent = -1;\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n const trimmed = line.trim();\n\n if (fences[index] || trimmed.length === 0) continue;\n\n const leading = line.match(/^[ ]*(\\t+)/);\n if (leading) {\n issues.push(\n issue(\n 'warning',\n index,\n leading[0].length - leading[1].length + 1,\n leading[1].length,\n 'Screenplay is indentation-based — use spaces, not tabs.',\n diagnosticCodes.tabIndentation,\n ),\n );\n }\n\n // Policy references continue on indented lines below an authorize clause.\n if (authorizeIndent >= 0) {\n if (\n indentOf(line) > authorizeIndent &&\n /^(?:or\\s+)?[A-Z]\\w*(?:\\s+or\\s+[A-Z]\\w*)*$/.test(trimmed)\n ) {\n for (const name of trimmed.split(/\\s+/).filter((token) => token !== 'or')) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n continue;\n }\n authorizeIndent = -1;\n }\n\n const fileImportIssue = validateImport(lines, fences, index);\n if (fileImportIssue) issues.push(fileImportIssue);\n\n const slice = trimmed.match(/^slice\\s+(\\w+)/);\n if (slice && !sliceTypes.includes(slice[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n slice[1],\n `Unknown slice type '${slice[1]}' — expected ${sliceTypes.join(', ')}.`,\n diagnosticCodes.unknownSliceType,\n ),\n );\n }\n\n const concept = trimmed.match(/^concept\\s+\\w+\\s*:\\s*(\\w+)/);\n if (concept && concept[1] !== 'Enum' && !primitiveTypes.includes(concept[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n concept[1],\n `Unknown primitive type '${concept[1]}' — expected ${primitiveTypes.join(', ')} or Enum.`,\n diagnosticCodes.unknownPrimitiveType,\n ),\n );\n }\n\n const authorize = trimmed.match(/^authorize\\s+(.*)$/);\n if (authorize) {\n authorizeIndent = indentOf(line);\n for (const name of authorize[1].split(/\\s+/).filter((token) => token !== 'or' && token.length > 0)) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n }\n\n const reactsOn = trimmed.match(/^on\\s+([A-Z]\\w*)\\s*$/);\n if (reactsOn) checkEvent(index, line, reactsOn[1]);\n\n const produces = trimmed.match(/^produces\\s+([A-Z]\\w*)\\s*$/);\n if (produces && !analysis.operationProductionLines?.has(index)) checkEvent(index, line, produces[1]);\n\n if (/^produces\\s+when\\b/.test(trimmed) && !analysis.operationProductionLines?.has(index)) {\n for (let next = index + 1; next < lines.length; next++) {\n const candidate = lines[next];\n if (fences[next] || candidate.trim().length === 0) continue;\n if (indentOf(candidate) > indentOf(line)) {\n const name = candidate.trim().match(/^([A-Z]\\w*)\\s*$/);\n if (name) checkEvent(next, candidate, name[1]);\n }\n break;\n }\n }\n\n const uniqueEvent = trimmed.match(/^unique\\s+event\\s+([A-Z]\\w*)/);\n if (uniqueEvent) checkEvent(index, line, uniqueEvent[1]);\n\n const uniqueProperty = trimmed.match(/^unique\\s+[a-z_]\\w*\\s+on\\s+([A-Z]\\w*)/);\n if (uniqueProperty) checkEvent(index, line, uniqueProperty[1]);\n\n // Every $identity. path must name a member of the caller; anything after 'claims.' is a claim name.\n // A bare $identity is left to the compilers, which see it only where an expression is expected.\n for (const path of line.match(/\\$identity\\.[\\w.]+/g) ?? []) {\n const member = path.substring('$identity.'.length).split('.')[0];\n const knownIdentity = [...identityProperties, ...(analysis.identityDetails ?? []).map(detail => detail.name)];\n if (!knownIdentity.includes(member)) {\n issues.push(tokenIssue('warning', index, line, path,\n `Unknown $identity property '${member}' — expected ${knownIdentity.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty));\n }\n }\n\n // Every $context. path must name something CommandContext or QueryContext carries.\n for (const path of line.match(/\\$context\\.[\\w.]+/g) ?? []) {\n const segments = path.substring('$context.'.length).split('.');\n if (!contextRoots.includes(segments[0])) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context path '${segments.join('.')}' — expected one of ${contextRoots.join(', ')}.`,\n diagnosticCodes.unknownContextPath,\n ),\n );\n } else if (\n segments[0] === 'causedBy' &&\n segments.length > 1 &&\n !causedByProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.causedBy property '${segments[1]}' — expected ${causedByProperties.join(', ')}.`,\n diagnosticCodes.unknownContextCausedByProperty,\n ),\n );\n } else if (\n segments[0] === 'identity' &&\n segments.length > 1 &&\n !identityProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.identity property '${segments[1]}' — expected ${identityProperties.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty,\n ),\n );\n }\n }\n }\n\n issues.push(...validateEventContextPaths(lines, fences));\n issues.push(...validateInlineEvents(lines, symbols, application, analysis.operationProductionLines));\n\n const fenceLines = lines\n .map((line, index) => ({ line, index }))\n .filter(({ line }) => /^\\s*```(?:[a-z]+)?\\s*$/.test(line));\n if (fenceLines.length % 2 === 1) {\n const last = fenceLines[fenceLines.length - 1];\n issues.push(\n issue(\n 'error',\n last.index,\n 1,\n last.line.length + 1,\n 'Unclosed inline code block — expected a closing ``` line.',\n diagnosticCodes.unclosedCodeBlock,\n ),\n );\n }\n\n return issues;\n}\n\n// This is advice, not a semantic default: accepting the typed workspace repair changes routing.\nfunction validateProductionDestinations(lines: string[], symbols: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n lines = eventAnalysisSource(lines);\n for (const command of symbols.commands) {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n if (identifiers.length !== 1) continue;\n for (const production of command.produces ?? []) {\n if (production.inline || production.conditional || production.target !== undefined) continue;\n const line = production.line;\n issues.push(issue('information', line, indentOf(lines[line]) + 1, lines[line].trim().length,\n `Plain 'produces ${production.name}' omits its destination — use 'for ${identifiers[0].name}' to explicitly select the command's identifier.`,\n diagnosticCodes.omittedProductionDestination));\n }\n }\n return issues;\n}\n\n// Inside a module or feature an import names files, and a quoted import anywhere has the compiler's shape.\nfunction validateImport(lines: string[], fences: boolean[], index: number): ValidationIssue | undefined {\n const line = lines[index];\n const trimmed = line.trim().replace(/\\s*\\/\\/.*$/, '');\n if (!/^import\\b/.test(trimmed) || fileImportOn(line, index)) return undefined;\n const indent = indentOf(line);\n const inBody = indent > 0 && ['module', 'feature'].includes(enclosingChain(lines, fences, index, indent)[0]);\n if (!inBody && !isFileImportLine(line)) return undefined;\n return issue(\n 'error',\n index,\n indent + 1,\n trimmed.length,\n `Invalid import '${trimmed}' — inside a module or feature, import names files: 'import \"<path or glob>\"'.`,\n diagnosticCodes.invalidFileImport,\n );\n}\n\n// A mapping target: the first word of a mapping line, after the keyword that opens it if there is one.\nconst mappingTarget = /^(?:(?:increment|decrement|count|clear|add|subtract|set)\\s+)?@?([$\\w.]+)(?=\\s|=|$)/;\n\n// Every $eventContext.<path> - in an expression or as the dynamic key of a mapping target - checked against the\n// event-context catalog the way the compiler checks it (Parsing/EventContextPathValidator.cs).\nexport function validateEventContextPaths(lines: string[], fences: boolean[]): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const names = (members: readonly { name: string }[]) => members.map((member) => member.name).join(', ');\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n if (fences[index]) continue;\n\n for (const match of line.matchAll(/(\\.)?\\$eventContext((?:\\.(?:\\w+(?:\\(\\))?)?)*)/g)) {\n const token = match[0].substring(match[1]?.length ?? 0);\n const written = match[2];\n if (written.length === 0) {\n // A bare $eventContext names nothing only as a dynamic key; in an expression the compiler rejects it as invalid.\n if (match[1]) {\n issues.push(issue('error', index, (match.index ?? 0) + 2, token.length, `'$eventContext' names no member - expected one of ${names(resolveEventContextPath('').expected)}.`, diagnosticCodes.missingEventContextPath));\n }\n continue;\n }\n\n const path = written.substring(1);\n const resolution = resolveEventContextPath(path);\n const column = (match.index ?? 0) + (match[1]?.length ?? 0) + 1;\n switch (resolution.status) {\n case 'missing':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' names no member - expected one of ${names(resolution.expected)}.`, diagnosticCodes.missingEventContextPath));\n break;\n case 'unknownMember':\n issues.push(issue('warning', index, column, token.length, `Unknown event context member '${resolution.segment}' in '$eventContext.${path}' - expected one of ${names(resolution.expected)}.`, diagnosticCodes.unknownEventContextMember));\n break;\n case 'unknownSubPath': {\n const has = resolution.expected.length === 0 ? 'no members to address' : `members ${names(resolution.expected)}`;\n issues.push(issue('warning', index, column, token.length, `Unknown event context path '$eventContext.${path}' - '${resolution.member?.name}' (${resolution.member?.type}) has ${has}.`, diagnosticCodes.unknownEventContextPath));\n break;\n }\n case 'belowCollection':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' cannot resolve - '${resolution.member?.name}' is a collection (${resolution.member?.type}) and cannot be addressed below.`, diagnosticCodes.eventContextPathBelowCollection));\n break;\n }\n }\n\n // Only $eventContext resolves in a dynamic key; any other $ source is kept as the literal key text.\n const target = line.trim().match(mappingTarget)?.[1];\n const source = target?.match(/\\.\\$(\\w+)/)?.[1];\n if (target && source && source !== 'eventContext') {\n issues.push(tokenIssue('warning', index, line, target, `Dynamic dictionary key '$${source}' in '${target}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${source}' becomes the key.`, diagnosticCodes.unresolvedDynamicKeySource));\n }\n }\n\n return issues;\n}\n"],"mappings":"88BAgDA,SAAS,MACL,EACA,EACA,EACA,EACA,EACA,EACe,CACf,MAAO,CAAE,WAAU,UAAS,OAAM,cAAa,UAAWA,EAAcC,EAAQ,MAAK,CACzF,CAEA,SAAS,WACL,EACA,EACA,EACA,EACA,EACA,EACe,CAEf,OAAO,MAAMC,EAAUC,EADRC,EAAK,QAAQC,CAAK,EAAI,EACAA,EAAM,OAAQC,EAASC,CAAI,CACpE,CAIA,SAAS,qBAAqB,EAAiB,EAA0B,EAAiD,CACtH,IAAMC,EAA4B,CAAC,EAC7BC,kBAAQ,IAAI,IAAI,CAAC,GAAGC,EAAeC,EAASC,CAAc,EAAG,GAAGF,EAAeG,EAAa,CAAC,CAAC,CAAC,CAAC,EAEhG,iBAAmB,EAA8B,IAAkB,CACrE,IAAK,IAAMC,KAAYC,EAAW,OAC7B,GAAc,CAACN,EAAM,IAAIO,EAAsBC,CAAS,CAAC,CAAC,IAAI,CACnE,EAAG,CACC,IAAMC,EAAOF,EAAsBF,CAAQ,CAAC,CAAC,KAC7CN,EAAO,KACH,MACI,UACAM,EAAS,KACTA,EAAS,WAAY,YACrBA,EAAS,WAAY,KAAK,OAC1BI,IAAS,WACH,+BAA+BJ,EAAS,KAAK,OAAOK,EAAM,+CAC1D,iBAAiBD,EAAK,QAAQJ,EAAS,KAAK,OAAOK,EAAM,8BAA8BD,EAAK,2BAA2BA,EAAK,IAClIE,EAAgB,WACpB,CACJ,CACJ,CACJ,EAEA,IAAK,IAAMC,KAAQV,EAAQ,MAAO,gBAAgBU,EAAK,WAAY,SAASA,EAAK,KAAK,EAAE,EACxF,IAAK,IAAMC,KAASX,EAAQ,OAAQ,gBAAgBW,EAAM,WAAY,UAAUA,EAAM,KAAK,EAAE,EAC7F,IAAK,IAAMC,KAASZ,EAAQ,QAAS,gBAAgBY,EAAM,WAAY,UAAUA,EA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AO,oBAAqBpB,EAAgB,0BAA0B,CAAC,CAEtQ,CAEA,OAAOZ,CACX"}
|
|
1
|
+
{"version":3,"file":"validation.js","names":["startColumn","length","severity","line","text","token","message","code","issues","types","knownTypeNames","symbols","primitiveTypes","application","property","properties","propertyTypeReference","candidate","bare","owner","diagnosticCodes","type","event","query","command","identifiers","extra","lines","declared","declaration","fences","fenceMap","scanned","scanDocument","context","mergeSymbols","input","symbolsForBuffer","analysis","responseAnalysis","source","routeLines","route","production","events","knownEventNames","policies","policy","optionalCodes","DiagnosticCodes","policyCodes","consistencyCodes","timelineCodes","dependencyCodes","authoringCodes","complianceCodes","compilerUnknownEventLines","diagnostic","identityType","detail","identityDuplicate","existing","legacyOptionalTypeLength","name","authorizeIndent","index","trimmed","leading","indentOf","fileImportIssue","slice","sliceTypes","concept","authorize","reactsOn","produces","next","uniqueEvent","uniqueProperty","path","member","knownIdentity","identityProperties","segments","contextRoots","causedByProperties","validateInlineEvents","fenceLines","last","eventAnalysisSource","fileImportOn","indent","enclosingChain","isFileImportLine","mappingTarget","members","match","written","resolveEventContextPath","resolution","column","has","target"],"sources":["../../validation.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes, legacyOptionalTypeLength } from '@cratis/screenplay-compiler';\nimport { AnalysisDiagnostic, responseAnalysis } from './response-analysis';\nimport { validateInlineEvents } from './inline-event-validation';\nimport { causedByProperties, contextRoots, identityProperties, primitiveTypes, sliceTypes } from './language';\nimport { DiagnosticCode, diagnosticCodes } from './diagnostic-codes';\nimport { enclosingChain, fenceMap, indentOf } from './document-context';\nimport { eventAnalysisSource } from './event-analysis-source';\nimport { resolveEventContextPath } from './event-context';\nimport {\n DocumentSymbols,\n PropertySymbol,\n propertyTypeReference,\n knownEventNames,\n knownTypeNames,\n mergeSymbols,\n scanDocument,\n symbolsForBuffer,\n} from './symbols';\nimport { fileImportOn, isFileImportLine } from './file-imports';\n\nexport type ValidationSeverity = 'error' | 'warning' | 'information';\n\nexport interface ValidationIssue {\n line: number;\n startColumn: number;\n endColumn: number;\n message: string;\n severity: ValidationSeverity;\n\n // The compiler code for this condition, absent on the structural checks the editor makes and the\n // compiler does not. See ./diagnostic-codes.ts.\n code?: DiagnosticCode;\n}\n\n// What a document is validated against beyond itself.\nexport interface ValidationContext {\n // What the rest of the application declares - the other .play files of a folder, or the files an import\n // brings in - so a name declared in another file is not reported unknown. Merge the scanned symbols of\n // those files with mergeSymbols. The document's own declarations are always known.\n application?: DocumentSymbols;\n placement?: readonly string[];\n path?: string;\n compilerDiagnostics?: readonly AnalysisDiagnostic[];\n}\n\nfunction issue(\n severity: ValidationSeverity,\n line: number,\n startColumn: number,\n length: number,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n return { severity, message, line, startColumn, endColumn: startColumn + length, code };\n}\n\nfunction tokenIssue(\n severity: ValidationSeverity,\n line: number,\n text: string,\n token: string,\n message: string,\n code: DiagnosticCode,\n): ValidationIssue {\n const column = text.indexOf(token) + 1;\n return issue(severity, line, column, token.length, message, code);\n}\n\n// Reports every property whose type reference names nothing the document declares, and\n// every command that marks more than one property as its identifier.\nfunction validateDeclarations(lines: string[], symbols: DocumentSymbols, application: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const types = new Set([...knownTypeNames(symbols, primitiveTypes), ...knownTypeNames(application, [])]);\n\n const checkProperties = (properties: PropertySymbol[], owner: string) => {\n for (const property of properties.filter(\n (candidate) => !types.has(propertyTypeReference(candidate).name),\n )) {\n const bare = propertyTypeReference(property).name;\n issues.push(\n issue(\n 'warning',\n property.line,\n property.sourceType!.startColumn,\n property.sourceType!.text.length,\n bare === 'optional'\n ? `Unknown type 'optional' on '${property.name}' of ${owner} — did you forget the type before 'optional'?`\n : `Unknown type '${bare}' on '${property.name}' of ${owner} — declare it with 'concept ${bare} : <Primitive>' or 'type ${bare}'.`,\n diagnosticCodes.unknownType,\n ),\n );\n }\n };\n\n for (const type of symbols.types) checkProperties(type.properties, `type '${type.name}'`);\n for (const event of symbols.events) checkProperties(event.properties, `event '${event.name}'`);\n for (const query of symbols.queries) checkProperties(query.parameters, `query '${query.name}'`);\n for (const command of symbols.commands) {\n checkProperties(command.properties, `command '${command.name}'`);\n const identifiers = command.properties.filter((property) => property.isIdentifier);\n for (const extra of identifiers.slice(1)) {\n issues.push(\n tokenIssue(\n 'error',\n extra.line,\n lines[extra.line],\n 'identifier',\n `Command '${command.name}' already marks '${identifiers[0].name}' as identifier — only one property can be the identifier.`,\n diagnosticCodes.duplicateCommandIdentifier,\n ),\n );\n }\n }\n\n const declared = new Map<string, number>();\n for (const declaration of [...symbols.concepts, ...symbols.types]) {\n const first = declared.get(declaration.name);\n if (first === undefined) {\n declared.set(declaration.name, declaration.line);\n continue;\n }\n issues.push(\n tokenIssue(\n 'error',\n declaration.line,\n lines[declaration.line],\n declaration.name,\n `Duplicate declaration of '${declaration.name}' — concept and type names must be unique.`,\n diagnosticCodes.duplicateDeclaration,\n ),\n );\n }\n\n return issues;\n}\n\n// Validates a Screenplay document without any editor dependency — both the Monaco\n// service and the VSCode extension adapt these issues to their marker/diagnostic APIs.\n//\n// The checks read the document line by line, never as a whole document's top level, so a file an import\n// places in a module or feature - holding slices or features at its top level - validates as it is written.\n// Where it is placed, and whether its imports resolve, is the compiler's to say.\nexport function validateLines(lines: string[], context: ValidationContext = {}): ValidationIssue[] {\n const fences = fenceMap(lines);\n const scanned = scanDocument(lines);\n const application = context.application ?? mergeSymbols();\n const input = symbolsForBuffer(lines, { ...application, authoringPath: context.path ?? application.authoringPath, authoringPlacement: context.placement ?? application.authoringPlacement });\n const analysis = responseAnalysis(lines, input.authoringDocuments ?? input.authoringSources?.filter(source => source !== lines.join('\\n')), input.authoringPlacement, input.authoringPath, input.authoringPlacementResolved);\n const routeLines = new Set(analysis.eventSources.routes.map(route => route.location.line - 1));\n const symbols = { ...scanned, commands: scanned.commands.map(command => ({ ...command,\n properties: command.properties.filter(property => !routeLines.has(property.line)),\n produces: command.produces?.filter(production => !analysis.operationProductionLines?.has(production.line)),\n productionHeaders: command.productionHeaders?.filter(line => !analysis.operationProductionLines?.has(line)),\n })) };\n const events = new Set([...knownEventNames(symbols), ...knownEventNames(application)]);\n const policies = new Set([...symbols.policies, ...application.policies].map((policy) => policy.name));\n const issues: ValidationIssue[] = validateDeclarations(lines, symbols, application);\n issues.push(...validateProductionDestinations(lines, symbols));\n // One parser pass covers committed types, including query results and trigger data, without\n // speculative property scans mistaking tags, paths, strings or code for optionality.\n const optionalCodes = new Set<string>([DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.InvalidOptionalModifierOrder, DiagnosticCodes.OptionalReadsNotSupported]);\n const policyCodes = new Set<string>([DiagnosticCodes.UnexpectedTokenInPolicyCondition, DiagnosticCodes.ExpectedPolicyCondition, DiagnosticCodes.UnclosedPolicyConditionGroup, DiagnosticCodes.ExpectedRoleName, DiagnosticCodes.ExpectedClaimName, DiagnosticCodes.ExpectedClaimMatches, DiagnosticCodes.ExpectedClaimMatchTarget]);\n const consistencyCodes = new Set<string>([DiagnosticCodes.UnknownEvent, DiagnosticCodes.UnknownReadModelProperty, DiagnosticCodes.PiiNotSupportedOnIdentifier]);\n const timelineCodes = new Set<string>([DiagnosticCodes.EventFromLaterSlice, DiagnosticCodes.TimelineCycleGroup]);\n const dependencyCodes = new Set<string>([DiagnosticCodes.UndeclaredDependency, DiagnosticCodes.UnusedDependencyDeclaration, DiagnosticCodes.InvalidDependencyTarget, DiagnosticCodes.RepeatedDependencyDeclaration, DiagnosticCodes.MutualDependencyDeclarations, DiagnosticCodes.AmbiguousReference]);\n // These parser diagnostics must reach the marker adapter. C#-only completeness and reference\n // checks are not synthesized here, but are preserved when a caller supplies compiler diagnostics.\n const authoringCodes = new Set<string>([DiagnosticCodes.InvalidEventDeclaration, DiagnosticCodes.InvalidImportDeclaration, DiagnosticCodes.InvalidSliceDeclaration, DiagnosticCodes.InvalidDescription, DiagnosticCodes.DuplicateDescription, DiagnosticCodes.EmptyDescription,DiagnosticCodes.DuplicateEventSubject, DiagnosticCodes.InvalidSubjectType, DiagnosticCodes.ProtectedSubjectType, DiagnosticCodes.InvalidSubjectOwner, DiagnosticCodes.ReadModelSubjectNotSupported, DiagnosticCodes.InvalidSubjectModifierOrder, DiagnosticCodes.UnsupportedInteractionAlternatives, DiagnosticCodes.MixedInteractionAlternatives, DiagnosticCodes.InteractionAlternativeWithoutActions, DiagnosticCodes.InlineInteractionAlternative, DiagnosticCodes.LegacyInteractionWhere, DiagnosticCodes.InvalidSpecificationParameter, DiagnosticCodes.InvalidSpecificationCase, DiagnosticCodes.DuplicateSpecificationParameter, DiagnosticCodes.DuplicateSpecificationCase, DiagnosticCodes.IncompleteSpecificationTable, DiagnosticCodes.InvalidSpecificationCaseAssignment, DiagnosticCodes.InvalidSpecificationCaseValue, DiagnosticCodes.InvalidSpecificationCaseReference, DiagnosticCodes.OptionalSpecificationParameterTarget, DiagnosticCodes.SpecificationCaseNameCollision, DiagnosticCodes.IncompatibleSpecificationParameterType, DiagnosticCodes.UnusedSpecificationParameter, DiagnosticCodes.SingularSpecificationTableExpansion, DiagnosticCodes.InvalidSpecificationCallerPersona, DiagnosticCodes.UnsynthesizablePersonaCaller, DiagnosticCodes.PersonaWithoutGate, DiagnosticCodes.GateWithoutPersona, DiagnosticCodes.AmbiguousPersonaCaller, DiagnosticCodes.InvalidDocumentation, DiagnosticCodes.ConflictingDocumentationAcrossFiles, DiagnosticCodes.InvalidAbsentReadModelStep, DiagnosticCodes.UnknownConstraintProperty, DiagnosticCodes.OmittedProductionDestination, DiagnosticCodes.InvalidSpecificationExample, DiagnosticCodes.DuplicateSpecificationAssignment]);\n const complianceCodes = new Set<string>([DiagnosticCodes.InvalidPurposeDeclaration, DiagnosticCodes.InvalidPurposeVocabulary, DiagnosticCodes.DuplicatePurposeField, DiagnosticCodes.DuplicatePurposeDeclaration, DiagnosticCodes.UnknownPurpose, DiagnosticCodes.PurposeInterestMismatch, DiagnosticCodes.PersonalDataWithoutPurpose, DiagnosticCodes.SpecialDataWithoutCondition, DiagnosticCodes.CriminalDataWithoutAuthorization, DiagnosticCodes.PurposeWithoutBasis, DiagnosticCodes.UnusedPurpose, DiagnosticCodes.UnknownConceptDirective, DiagnosticCodes.AttributeReasonWithoutAttribute, DiagnosticCodes.DuplicateAttributeReason, DiagnosticCodes.LegacyComplianceMarker, DiagnosticCodes.DuplicateComplianceMarker, DiagnosticCodes.UnknownComplianceMarker, DiagnosticCodes.InvalidSecretScope, DiagnosticCodes.DuplicateSecretScope, DiagnosticCodes.SecretScopeIgnoredForPii, DiagnosticCodes.InvalidPersonalDataQualifier, DiagnosticCodes.DuplicateSpecialCategory]);\n const compilerUnknownEventLines = new Set<number>();\n for (const diagnostic of context.compilerDiagnostics ?? analysis.diagnostics) {\n const identityType = diagnostic.code === DiagnosticCodes.UnknownType && (analysis.identityDetails ?? []).some(detail => detail.line === diagnostic.location.line - 1);\n const identityDuplicate = diagnostic.code === DiagnosticCodes.RepeatedSingularDeclarationAcrossFiles && diagnostic.message.includes('identity block');\n if (!identityType && !identityDuplicate && !complianceCodes.has(diagnostic.code) && !optionalCodes.has(diagnostic.code) && !policyCodes.has(diagnostic.code) && !consistencyCodes.has(diagnostic.code) && !timelineCodes.has(diagnostic.code) && !dependencyCodes.has(diagnostic.code) && !authoringCodes.has(diagnostic.code) && diagnostic.code !== DiagnosticCodes.InvalidSpecificationExampleBody && diagnostic.code !== DiagnosticCodes.UnknownRuleImplementationDirective && diagnostic.code !== DiagnosticCodes.InvalidValidationRule && diagnostic.code !== DiagnosticCodes.RepeatedDeclarationAcrossFiles && !/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY063[3-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$/.test(diagnostic.code)) continue;\n const line = diagnostic.location.line - 1;\n if (diagnostic.code === DiagnosticCodes.OmittedProductionDestination && issues.some(existing => existing.code === diagnostic.code && existing.line === line)) continue;\n if (diagnostic.code === DiagnosticCodes.UnknownEvent) {\n if (compilerUnknownEventLines.has(line)) continue;\n compilerUnknownEventLines.add(line);\n }\n const length = legacyOptionalTypeLength(lines[line], diagnostic) || lines[line].length - diagnostic.location.column + 1;\n issues.push(issue(diagnostic.severity, line, diagnostic.location.column, length, diagnostic.message, diagnostic.code as DiagnosticCode));\n }\n\n const checkEvent = (line: number, text: string, name: string) => {\n if (!events.has(name) && !compilerUnknownEventLines.has(line)) {\n issues.push(\n tokenIssue(\n 'warning',\n line,\n text,\n name,\n `Unknown event type '${name}' — declare it in a slice or import it.`,\n diagnosticCodes.unknownEvent,\n ),\n );\n }\n };\n\n let authorizeIndent = -1;\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n const trimmed = line.trim();\n\n if (fences[index] || trimmed.length === 0) continue;\n\n const leading = line.match(/^[ ]*(\\t+)/);\n if (leading) {\n issues.push(\n issue(\n 'warning',\n index,\n leading[0].length - leading[1].length + 1,\n leading[1].length,\n 'Screenplay is indentation-based — use spaces, not tabs.',\n diagnosticCodes.tabIndentation,\n ),\n );\n }\n\n // Policy references continue on indented lines below an authorize clause.\n if (authorizeIndent >= 0) {\n if (\n indentOf(line) > authorizeIndent &&\n /^(?:or\\s+)?[A-Z]\\w*(?:\\s+or\\s+[A-Z]\\w*)*$/.test(trimmed)\n ) {\n for (const name of trimmed.split(/\\s+/).filter((token) => token !== 'or')) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n continue;\n }\n authorizeIndent = -1;\n }\n\n const fileImportIssue = validateImport(lines, fences, index);\n if (fileImportIssue) issues.push(fileImportIssue);\n\n const slice = trimmed.match(/^slice\\s+(\\w+)/);\n if (slice && !sliceTypes.includes(slice[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n slice[1],\n `Unknown slice type '${slice[1]}' — expected ${sliceTypes.join(', ')}.`,\n diagnosticCodes.unknownSliceType,\n ),\n );\n }\n\n const concept = trimmed.match(/^concept\\s+\\w+\\s*:\\s*(\\w+)/);\n if (concept && concept[1] !== 'Enum' && !primitiveTypes.includes(concept[1])) {\n issues.push(\n tokenIssue(\n 'error',\n index,\n line,\n concept[1],\n `Unknown primitive type '${concept[1]}' — expected ${primitiveTypes.join(', ')} or Enum.`,\n diagnosticCodes.unknownPrimitiveType,\n ),\n );\n }\n\n const authorize = trimmed.match(/^authorize\\s+(.*)$/);\n if (authorize) {\n authorizeIndent = indentOf(line);\n for (const name of authorize[1].split(/\\s+/).filter((token) => token !== 'or' && token.length > 0)) {\n if (!policies.has(name)) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n name,\n `Unknown policy '${name}' — declare it with 'policy ${name}'.`,\n diagnosticCodes.unknownPolicy,\n ),\n );\n }\n }\n }\n\n const reactsOn = trimmed.match(/^on\\s+([A-Z]\\w*)\\s*$/);\n if (reactsOn) checkEvent(index, line, reactsOn[1]);\n\n const produces = trimmed.match(/^produces\\s+([A-Z]\\w*)\\s*$/);\n if (produces && !analysis.operationProductionLines?.has(index)) checkEvent(index, line, produces[1]);\n\n if (/^produces\\s+when\\b/.test(trimmed) && !analysis.operationProductionLines?.has(index)) {\n for (let next = index + 1; next < lines.length; next++) {\n const candidate = lines[next];\n if (fences[next] || candidate.trim().length === 0) continue;\n if (indentOf(candidate) > indentOf(line)) {\n const name = candidate.trim().match(/^([A-Z]\\w*)\\s*$/);\n if (name) checkEvent(next, candidate, name[1]);\n }\n break;\n }\n }\n\n const uniqueEvent = trimmed.match(/^unique\\s+event\\s+([A-Z]\\w*)/);\n if (uniqueEvent) checkEvent(index, line, uniqueEvent[1]);\n\n const uniqueProperty = trimmed.match(/^unique\\s+[a-z_]\\w*\\s+on\\s+([A-Z]\\w*)/);\n if (uniqueProperty) checkEvent(index, line, uniqueProperty[1]);\n\n // Every $identity. path must name a member of the caller; anything after 'claims.' is a claim name.\n // A bare $identity is left to the compilers, which see it only where an expression is expected.\n for (const path of line.match(/\\$identity\\.[\\w.]+/g) ?? []) {\n const member = path.substring('$identity.'.length).split('.')[0];\n const knownIdentity = [...identityProperties, ...(analysis.identityDetails ?? []).map(detail => detail.name)];\n if (!knownIdentity.includes(member)) {\n issues.push(tokenIssue('warning', index, line, path,\n `Unknown $identity property '${member}' — expected ${knownIdentity.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty));\n }\n }\n\n // Every $context. path must name something CommandContext or QueryContext carries.\n for (const path of line.match(/\\$context\\.[\\w.]+/g) ?? []) {\n const segments = path.substring('$context.'.length).split('.');\n if (!contextRoots.includes(segments[0])) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context path '${segments.join('.')}' — expected one of ${contextRoots.join(', ')}.`,\n diagnosticCodes.unknownContextPath,\n ),\n );\n } else if (\n segments[0] === 'causedBy' &&\n segments.length > 1 &&\n !causedByProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.causedBy property '${segments[1]}' — expected ${causedByProperties.join(', ')}.`,\n diagnosticCodes.unknownContextCausedByProperty,\n ),\n );\n } else if (\n segments[0] === 'identity' &&\n segments.length > 1 &&\n !identityProperties.includes(segments[1])\n ) {\n issues.push(\n tokenIssue(\n 'warning',\n index,\n line,\n path,\n `Unknown $context.identity property '${segments[1]}' — expected ${identityProperties.join(', ')}.`,\n diagnosticCodes.unknownContextIdentityProperty,\n ),\n );\n }\n }\n }\n\n issues.push(...validateEventContextPaths(lines, fences));\n issues.push(...validateInlineEvents(lines, symbols, application, analysis.operationProductionLines));\n\n const fenceLines = lines\n .map((line, index) => ({ line, index }))\n .filter(({ line }) => /^\\s*```(?:[a-z]+)?\\s*$/.test(line));\n if (fenceLines.length % 2 === 1) {\n const last = fenceLines[fenceLines.length - 1];\n issues.push(\n issue(\n 'error',\n last.index,\n 1,\n last.line.length + 1,\n 'Unclosed inline code block — expected a closing ``` line.',\n diagnosticCodes.unclosedCodeBlock,\n ),\n );\n }\n\n return issues;\n}\n\n// This is advice, not a semantic default: accepting the typed workspace repair changes routing.\nfunction validateProductionDestinations(lines: string[], symbols: DocumentSymbols): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n lines = eventAnalysisSource(lines);\n for (const command of symbols.commands) {\n const identifiers = command.properties.filter(property => property.isIdentifier && !propertyTypeReference(property).isOptional && !propertyTypeReference(property).isCollection);\n if (identifiers.length !== 1) continue;\n for (const production of command.produces ?? []) {\n if (production.inline || production.conditional || production.target !== undefined) continue;\n const line = production.line;\n issues.push(issue('information', line, indentOf(lines[line]) + 1, lines[line].trim().length,\n `Plain 'produces ${production.name}' omits its destination — use 'for ${identifiers[0].name}' to explicitly select the command's identifier.`,\n diagnosticCodes.omittedProductionDestination));\n }\n }\n return issues;\n}\n\n// Inside a module or feature an import names files, and a quoted import anywhere has the compiler's shape.\nfunction validateImport(lines: string[], fences: boolean[], index: number): ValidationIssue | undefined {\n const line = lines[index];\n const trimmed = line.trim().replace(/\\s*\\/\\/.*$/, '');\n if (!/^import\\b/.test(trimmed) || fileImportOn(line, index)) return undefined;\n const indent = indentOf(line);\n const inBody = indent > 0 && ['module', 'feature'].includes(enclosingChain(lines, fences, index, indent)[0]);\n if (!inBody && !isFileImportLine(line)) return undefined;\n return issue(\n 'error',\n index,\n indent + 1,\n trimmed.length,\n `Invalid import '${trimmed}' — inside a module or feature, import names files: 'import \"<path or glob>\"'.`,\n diagnosticCodes.invalidFileImport,\n );\n}\n\n// A mapping target: the first word of a mapping line, after the keyword that opens it if there is one.\nconst mappingTarget = /^(?:(?:increment|decrement|count|clear|add|subtract|set)\\s+)?@?([$\\w.]+)(?=\\s|=|$)/;\n\n// Every $eventContext.<path> - in an expression or as the dynamic key of a mapping target - checked against the\n// event-context catalog the way the compiler checks it (Parsing/EventContextPathValidator.cs).\nexport function validateEventContextPaths(lines: string[], fences: boolean[]): ValidationIssue[] {\n const issues: ValidationIssue[] = [];\n const names = (members: readonly { name: string }[]) => members.map((member) => member.name).join(', ');\n\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index];\n if (fences[index]) continue;\n\n for (const match of line.matchAll(/(\\.)?\\$eventContext((?:\\.(?:\\w+(?:\\(\\))?)?)*)/g)) {\n const token = match[0].substring(match[1]?.length ?? 0);\n const written = match[2];\n if (written.length === 0) {\n // A bare $eventContext names nothing only as a dynamic key; in an expression the compiler rejects it as invalid.\n if (match[1]) {\n issues.push(issue('error', index, (match.index ?? 0) + 2, token.length, `'$eventContext' names no member - expected one of ${names(resolveEventContextPath('').expected)}.`, diagnosticCodes.missingEventContextPath));\n }\n continue;\n }\n\n const path = written.substring(1);\n const resolution = resolveEventContextPath(path);\n const column = (match.index ?? 0) + (match[1]?.length ?? 0) + 1;\n switch (resolution.status) {\n case 'missing':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' names no member - expected one of ${names(resolution.expected)}.`, diagnosticCodes.missingEventContextPath));\n break;\n case 'unknownMember':\n issues.push(issue('warning', index, column, token.length, `Unknown event context member '${resolution.segment}' in '$eventContext.${path}' - expected one of ${names(resolution.expected)}.`, diagnosticCodes.unknownEventContextMember));\n break;\n case 'unknownSubPath': {\n const has = resolution.expected.length === 0 ? 'no members to address' : `members ${names(resolution.expected)}`;\n issues.push(issue('warning', index, column, token.length, `Unknown event context path '$eventContext.${path}' - '${resolution.member?.name}' (${resolution.member?.type}) has ${has}.`, diagnosticCodes.unknownEventContextPath));\n break;\n }\n case 'belowCollection':\n issues.push(issue('error', index, column, token.length, `'$eventContext.${path}' cannot resolve - '${resolution.member?.name}' is a collection (${resolution.member?.type}) and cannot be addressed below.`, diagnosticCodes.eventContextPathBelowCollection));\n break;\n }\n }\n\n // Only $eventContext resolves in a dynamic key; any other $ source is kept as the literal key text.\n const target = line.trim().match(mappingTarget)?.[1];\n const source = target?.match(/\\.\\$(\\w+)/)?.[1];\n if (target && source && source !== 'eventContext') {\n issues.push(tokenIssue('warning', index, line, target, `Dynamic dictionary key '$${source}' in '${target}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${source}' becomes the key.`, diagnosticCodes.unresolvedDynamicKeySource));\n }\n }\n\n return issues;\n}\n"],"mappings":"88BAgDA,SAAS,MACL,EACA,EACA,EACA,EACA,EACA,EACe,CACf,MAAO,CAAE,WAAU,UAAS,OAAM,cAAa,UAAWA,EAAcC,EAAQ,MAAK,CACzF,CAEA,SAAS,WACL,EACA,EACA,EACA,EACA,EACA,EACe,CAEf,OAAO,MAAMC,EAAUC,EADRC,EAAK,QAAQC,CAAK,EAAI,EACAA,EAAM,OAAQC,EAASC,CAAI,CACpE,CAIA,SAAS,qBAAqB,EAAiB,EAA0B,EAAiD,CACtH,IAAMC,EAA4B,CAAC,EAC7BC,kBAAQ,IAAI,IAAI,CAAC,GAAGC,EAAeC,EAASC,CAAc,EAAG,GAAGF,EAAeG,EAAa,CAAC,CAAC,CAAC,CAAC,EAEhG,iBAAmB,EAA8B,IAAkB,CACrE,IAAK,IAAMC,KAAYC,EAAW,OAC7B,GAAc,CAACN,EAAM,IAAIO,EAAsBC,CAAS,CAAC,CAAC,IAAI,CACnE,EAAG,CACC,IAAMC,EAAOF,EAAsBF,CAAQ,CAAC,CAAC,KAC7CN,EAAO,KACH,MACI,UACAM,EAAS,KACTA,EAAS,WAAY,YACrBA,EAAS,WAAY,KAAK,OAC1BI,IAAS,WACH,+BAA+BJ,EAAS,KAAK,OAAOK,EAAM,+CAC1D,iBAAiBD,EAAK,QAAQJ,EAAS,KAAK,OAAOK,EAAM,8BAA8BD,EAAK,2BAA2BA,EAAK,IAClIE,EAAgB,WACpB,CACJ,CACJ,CACJ,EAEA,IAAK,IAAMC,KA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ASnG,EAAK,KAAK,CAAC,CAAC,MAAM2F,CAAa,CAAC,GAAG,GAC5CtD,EAAS8D,GAAQ,MAAM,WAAW,CAAC,GAAG,GACxCA,GAAU9D,GAAUA,IAAW,gBAC/BhC,EAAO,KAAK,WAAW,UAAWyD,EAAO9D,EAAMmG,EAAQ,4BAA4B9D,EAAO,QAAQ8D,EAAO,8EAA8E9D,EAAO,oBAAqBpB,EAAgB,0BAA0B,CAAC,CAEtQ,CAEA,OAAOZ,CACX"}
|
|
@@ -40,6 +40,7 @@ export declare const diagnosticCodes: {
|
|
|
40
40
|
readonly unknownConceptDirective: "PLAY0010";
|
|
41
41
|
readonly attributeReasonWithoutAttribute: "PLAY0012";
|
|
42
42
|
readonly duplicateAttributeReason: "PLAY0013";
|
|
43
|
+
readonly duplicateComplianceMarker: "PLAY0653";
|
|
43
44
|
readonly legacyComplianceMarker: "PLAY0565";
|
|
44
45
|
readonly unknownComplianceMarker: "PLAY0566";
|
|
45
46
|
readonly invalidSecretScope: "PLAY0567";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-codes.d.ts","sourceRoot":"","sources":["../diagnostic-codes.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"diagnostic-codes.d.ts","sourceRoot":"","sources":["../diagnostic-codes.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+LlB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
package/package.json
CHANGED