@qontinui/shared-types 0.2.4 → 0.3.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/README.md +128 -128
- package/dist/{Region.d-BbpFAWF4.d.cts → Region.d-DtT3UphX.d.cts} +81 -81
- package/dist/{Region.d-BbpFAWF4.d.ts → Region.d-DtT3UphX.d.ts} +81 -81
- package/dist/{TaskRunFindingActionType.d-B4VmmbB6.d.cts → TaskRunFindingActionType.d-CNIWogcU.d.cts} +53 -53
- package/dist/{TaskRunFindingActionType.d-B4VmmbB6.d.ts → TaskRunFindingActionType.d-CNIWogcU.d.ts} +53 -53
- package/dist/accessibility.cjs.map +1 -1
- package/dist/accessibility.d.cts +379 -379
- package/dist/accessibility.d.ts +379 -379
- package/dist/chat.cjs.map +1 -1
- package/dist/{chunk-ZK5MJEGT.js → chunk-CTBDIP7K.js} +1 -1
- package/dist/chunk-CTBDIP7K.js.map +1 -0
- package/dist/{chunk-YXD4WCYQ.js → chunk-ZUZ3OLOH.js} +1 -1
- package/dist/chunk-ZUZ3OLOH.js.map +1 -0
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +105 -105
- package/dist/config.d.ts +105 -105
- package/dist/constraints.cjs.map +1 -1
- package/dist/constraints.d.cts +372 -372
- package/dist/constraints.d.ts +372 -372
- package/dist/execution.cjs.map +1 -1
- package/dist/execution.d.cts +869 -869
- package/dist/execution.d.ts +869 -869
- package/dist/execution.js +1 -1
- package/dist/geometry.cjs.map +1 -1
- package/dist/geometry.d.cts +81 -81
- package/dist/geometry.d.ts +81 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +632 -590
- package/dist/index.d.ts +632 -590
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/library.cjs.map +1 -1
- package/dist/rag.cjs.map +1 -1
- package/dist/rag.d.cts +579 -579
- package/dist/rag.d.ts +579 -579
- package/dist/runner.cjs.map +1 -1
- package/dist/runner.d.cts +147 -147
- package/dist/runner.d.ts +147 -147
- package/dist/scheduler.cjs.map +1 -1
- package/dist/scheduler.d.cts +692 -692
- package/dist/scheduler.d.ts +692 -692
- package/dist/state-machine.cjs.map +1 -1
- package/dist/state-machine.d.cts +1128 -1128
- package/dist/state-machine.d.ts +1128 -1128
- package/dist/targets.cjs.map +1 -1
- package/dist/targets.d.cts +270 -270
- package/dist/targets.d.ts +270 -270
- package/dist/task-run.cjs.map +1 -1
- package/dist/task-run.d.cts +1431 -1431
- package/dist/task-run.d.ts +1431 -1431
- package/dist/tauri-events.cjs.map +1 -1
- package/dist/tauri-events.d.cts +310 -310
- package/dist/tauri-events.d.ts +310 -310
- package/dist/tree-events.cjs.map +1 -1
- package/dist/tree-events.d.cts +483 -483
- package/dist/tree-events.d.ts +483 -483
- package/dist/ui-bridge-ir.cjs +30 -33
- package/dist/ui-bridge-ir.cjs.map +1 -1
- package/dist/ui-bridge-ir.d.cts +98 -84
- package/dist/ui-bridge-ir.d.ts +98 -84
- package/dist/ui-bridge-ir.js +30 -33
- package/dist/ui-bridge-ir.js.map +1 -1
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +1634 -1634
- package/dist/workflow.d.ts +1634 -1634
- package/dist/workflow.js +1 -1
- package/package.json +141 -141
- package/src/accessibility/_api.ts +17 -17
- package/src/accessibility/index.ts +1 -1
- package/src/canvas/index.ts +319 -319
- package/src/chat/_api.ts +23 -23
- package/src/chat/index.ts +1 -1
- package/src/config/_api.ts +13 -13
- package/src/config/index.ts +1 -1
- package/src/constraints/_api.ts +17 -17
- package/src/constraints/index.ts +1 -1
- package/src/discovery.ts +188 -188
- package/src/execution/_api.ts +483 -483
- package/src/execution/index.ts +1 -1
- package/src/generated/A11yAction.d.ts +11 -11
- package/src/generated/AccessibilityBackend.d.ts +12 -12
- package/src/generated/AccessibilityBounds.d.ts +17 -17
- package/src/generated/AccessibilityNode.d.ts +73 -73
- package/src/generated/AccessibilityRole.d.ts +93 -93
- package/src/generated/AccessibilityRoleCriterion.d.ts +13 -13
- package/src/generated/AccessibilitySelector.d.ts +76 -76
- package/src/generated/AccessibilitySnapshot.d.ts +43 -43
- package/src/generated/AccessibilityState.d.ts +67 -67
- package/src/generated/ActionExecutionBatch.d.ts +23 -23
- package/src/generated/ActionExecutionBatchResponse.d.ts +24 -24
- package/src/generated/ActionExecutionCreate.d.ts +124 -124
- package/src/generated/ActionExecutionListResponse.d.ts +20 -20
- package/src/generated/ActionExecutionResponse.d.ts +24 -24
- package/src/generated/ActionReliabilityStats.d.ts +54 -54
- package/src/generated/ActionResponse.d.ts +45 -45
- package/src/generated/ActionStatus.d.ts +11 -11
- package/src/generated/ActionType.d.ts +41 -41
- package/src/generated/ActiveStatesResult.d.ts +32 -32
- package/src/generated/AgenticPhaseOutput.d.ts +50 -50
- package/src/generated/AgenticStatus.d.ts +11 -11
- package/src/generated/AiWorkflow.d.ts +76 -76
- package/src/generated/ApiAssertion.d.ts +35 -35
- package/src/generated/ApiAssertionOperator.d.ts +11 -11
- package/src/generated/ApiAssertionType.d.ts +11 -11
- package/src/generated/ApiContentType.d.ts +11 -11
- package/src/generated/ApiVariableExtraction.d.ts +24 -24
- package/src/generated/AssertionMiss.d.ts +22 -0
- package/src/generated/AssertionOutcome.d.ts +30 -0
- package/src/generated/AssertionResult.d.ts +38 -0
- package/src/generated/AssertionScope.d.ts +37 -0
- package/src/generated/AssertionSeverityCounts.d.ts +28 -0
- package/src/generated/AvailableTransitionsResult.d.ts +34 -34
- package/src/generated/BaseStepFields.d.ts +72 -72
- package/src/generated/BatchComputeEmbeddingRequest.d.ts +27 -27
- package/src/generated/BatchComputeEmbeddingResponse.d.ts +23 -23
- package/src/generated/BatchEmbeddingResult.d.ts +23 -23
- package/src/generated/BetweenIterations.d.ts +35 -35
- package/src/generated/BoundingBox.d.ts +18 -18
- package/src/generated/BridgeFingerprint.d.ts +40 -0
- package/src/generated/BuildPhaseConfig.d.ts +24 -24
- package/src/generated/BuiltinOverrideProposal.d.ts +27 -27
- package/src/generated/CandidateMiss.d.ts +39 -0
- package/src/generated/CanonicalStep.d.ts +60 -60
- package/src/generated/CatchUpPolicy.d.ts +12 -12
- package/src/generated/Category.d.ts +24 -24
- package/src/generated/CheckIssueDetail.d.ts +40 -40
- package/src/generated/CheckType.d.ts +21 -21
- package/src/generated/CodeExecutionStep.d.ts +88 -88
- package/src/generated/CommandMode.d.ts +11 -11
- package/src/generated/CommandStep.d.ts +183 -183
- package/src/generated/CommandStepPhase.d.ts +11 -11
- package/src/generated/ComponentActionInfo.d.ts +24 -24
- package/src/generated/ComponentActionRequest.d.ts +22 -22
- package/src/generated/ComputeEmbeddingRequest.d.ts +24 -24
- package/src/generated/ComputeEmbeddingResponse.d.ts +38 -38
- package/src/generated/ComputeTextEmbeddingRequest.d.ts +20 -20
- package/src/generated/ComputeTextEmbeddingResponse.d.ts +32 -32
- package/src/generated/ConditionScheduleConfig.d.ts +17 -17
- package/src/generated/ConditionStatus.d.ts +29 -29
- package/src/generated/Confidence.d.ts +11 -11
- package/src/generated/ConfidenceLevel.d.ts +11 -11
- package/src/generated/ConjunctEvaluation.d.ts +24 -0
- package/src/generated/ConjunctRule.d.ts +55 -0
- package/src/generated/Constraint.d.ts +33 -33
- package/src/generated/ConstraintCheck.d.ts +64 -64
- package/src/generated/ConstraintProposal.d.ts +37 -37
- package/src/generated/ConstraintResult.d.ts +32 -32
- package/src/generated/ConstraintSeverity.d.ts +16 -16
- package/src/generated/ConstraintViolation.d.ts +24 -24
- package/src/generated/Context.d.ts +50 -50
- package/src/generated/ContextAutoInclude.d.ts +34 -34
- package/src/generated/CoordinateSystem.d.ts +12 -12
- package/src/generated/Coordinates.d.ts +33 -33
- package/src/generated/CostTrendDataPoint.d.ts +36 -36
- package/src/generated/CostTrendResponse.d.ts +41 -41
- package/src/generated/CoverageData.d.ts +52 -52
- package/src/generated/CreateMcpCallInput.d.ts +59 -59
- package/src/generated/CreateMcpServerInput.d.ts +48 -48
- package/src/generated/CreateOlConfigRequest.d.ts +27 -27
- package/src/generated/CreateScheduledTaskRequest.d.ts +63 -63
- package/src/generated/CreateTaskRunRequest.d.ts +51 -51
- package/src/generated/CriterionOverride.d.ts +39 -39
- package/src/generated/CriterionType.d.ts +11 -11
- package/src/generated/DagApprovalStep.d.ts +80 -80
- package/src/generated/DagCancelStep.d.ts +76 -76
- package/src/generated/DagLoopStep.d.ts +80 -80
- package/src/generated/DecomposerConfig.d.ts +31 -31
- package/src/generated/DiagnosePhaseConfig.d.ts +34 -34
- package/src/generated/DiagnosticResult.d.ts +40 -40
- package/src/generated/DiscoveredElement.d.ts +48 -48
- package/src/generated/DiscoveredState.d.ts +49 -49
- package/src/generated/DiscoveredStateImage.d.ts +56 -56
- package/src/generated/DiscoveredTransition.d.ts +44 -44
- package/src/generated/DiscoveryBoundingBox.d.ts +32 -32
- package/src/generated/DiscoveryRequest.d.ts +40 -40
- package/src/generated/DiscoveryResponse.d.ts +32 -32
- package/src/generated/DiscoverySourceType.d.ts +14 -14
- package/src/generated/DiscoveryStrategy.d.ts +13 -13
- package/src/generated/DiscoveryTransitionTrigger.d.ts +38 -38
- package/src/generated/DisplayNode.d.ts +45 -45
- package/src/generated/DomainAssignment.d.ts +50 -50
- package/src/generated/DomainKnowledge.d.ts +29 -29
- package/src/generated/DomainVerificationResult.d.ts +36 -36
- package/src/generated/ElementActionRequest.d.ts +28 -28
- package/src/generated/ElementBbox.d.ts +36 -36
- package/src/generated/ElementIdentifier.d.ts +40 -40
- package/src/generated/ElementRect.d.ts +48 -48
- package/src/generated/ElementState.d.ts +47 -47
- package/src/generated/ElementType.d.ts +45 -45
- package/src/generated/EmbeddedElement.d.ts +36 -36
- package/src/generated/EmbeddingItem.d.ts +49 -49
- package/src/generated/EmbeddingListResponse.d.ts +22 -22
- package/src/generated/EmbeddingResultItem.d.ts +29 -29
- package/src/generated/EmbeddingResultsRequest.d.ts +19 -19
- package/src/generated/EmbeddingResultsResponse.d.ts +17 -17
- package/src/generated/ErrorType.d.ts +18 -18
- package/src/generated/ExecutePlaybookStep.d.ts +84 -84
- package/src/generated/ExecutionActionType.d.ts +40 -40
- package/src/generated/ExecutionIssueBatch.d.ts +19 -19
- package/src/generated/ExecutionIssueBatchResponse.d.ts +24 -24
- package/src/generated/ExecutionIssueCreate.d.ts +57 -57
- package/src/generated/ExecutionIssueDetail.d.ts +89 -89
- package/src/generated/ExecutionIssueListResponse.d.ts +26 -26
- package/src/generated/ExecutionIssueResponse.d.ts +24 -24
- package/src/generated/ExecutionIssueUpdate.d.ts +31 -31
- package/src/generated/ExecutionMatchLocation.d.ts +31 -31
- package/src/generated/ExecutionRunComplete.d.ts +34 -34
- package/src/generated/ExecutionRunCompleteResponse.d.ts +38 -38
- package/src/generated/ExecutionRunCreate.d.ts +40 -40
- package/src/generated/ExecutionRunDetail.d.ts +76 -76
- package/src/generated/ExecutionRunListResponse.d.ts +22 -22
- package/src/generated/ExecutionRunResponse.d.ts +41 -41
- package/src/generated/ExecutionScreenshotCreate.d.ts +59 -59
- package/src/generated/ExecutionScreenshotResponse.d.ts +36 -36
- package/src/generated/ExecutionStats.d.ts +56 -56
- package/src/generated/ExecutionStep.d.ts +78 -78
- package/src/generated/ExecutionTreeResponse.d.ts +42 -42
- package/src/generated/ExecutionTrendDataPoint.d.ts +36 -36
- package/src/generated/ExecutionTrendResponse.d.ts +46 -46
- package/src/generated/ExitCheckResult.d.ts +20 -20
- package/src/generated/ExitStrategy.d.ts +27 -27
- package/src/generated/ExportResult.d.ts +30 -30
- package/src/generated/ExtendIterationsRequest.d.ts +20 -20
- package/src/generated/FieldDiff.d.ts +33 -0
- package/src/generated/FileChange.d.ts +20 -20
- package/src/generated/Finding.d.ts +40 -40
- package/src/generated/FindingActionType.d.ts +13 -13
- package/src/generated/FindingBatchCreate.d.ts +27 -27
- package/src/generated/FindingCategory.d.ts +25 -25
- package/src/generated/FindingCodeContext.d.ts +31 -31
- package/src/generated/FindingCreate.d.ts +52 -52
- package/src/generated/FindingDetail.d.ts +78 -78
- package/src/generated/FindingListResponse.d.ts +40 -40
- package/src/generated/FindingOutput.d.ts +36 -36
- package/src/generated/FindingSeverity.d.ts +14 -14
- package/src/generated/FindingStatus.d.ts +15 -15
- package/src/generated/FindingSummary.d.ts +53 -53
- package/src/generated/FindingUpdate.d.ts +33 -33
- package/src/generated/FindingUserInput.d.ts +27 -27
- package/src/generated/FindingsSummary.d.ts +47 -47
- package/src/generated/FullRunnerStep.d.ts +144 -144
- package/src/generated/GUIElementChunk.d.ts +151 -151
- package/src/generated/GateEvaluationResult.d.ts +36 -36
- package/src/generated/HealthCheckUrl.d.ts +35 -35
- package/src/generated/HistoricalActionQuery.d.ts +42 -42
- package/src/generated/HistoricalActionResult.d.ts +57 -57
- package/src/generated/HttpConfig.d.ts +27 -27
- package/src/generated/HttpMethod.d.ts +13 -13
- package/src/generated/IdleCondition.d.ts +17 -17
- package/src/generated/ImplementFixesConfig.d.ts +25 -25
- package/src/generated/IndividualCheckResult.d.ts +50 -50
- package/src/generated/InitialStateRef.d.ts +23 -23
- package/src/generated/InitialStatesSource.d.ts +18 -18
- package/src/generated/IrAssertion.d.ts +26 -0
- package/src/generated/IrAssertionTarget.d.ts +28 -0
- package/src/generated/IrCrossRef.d.ts +16 -0
- package/src/generated/IrElementCriteria.d.ts +29 -0
- package/src/generated/IrGroup.d.ts +33 -0
- package/src/generated/IrMetadata.d.ts +15 -0
- package/src/generated/IrPageSpec.d.ts +51 -0
- package/src/generated/IrProvenance.d.ts +28 -0
- package/src/generated/IrState.d.ts +36 -0
- package/src/generated/IrStateCondition.d.ts +19 -0
- package/src/generated/IrTransition.d.ts +34 -0
- package/src/generated/IrTransitionAction.d.ts +17 -0
- package/src/generated/IrWaitSpec.d.ts +22 -0
- package/src/generated/IssueSeverity.d.ts +11 -11
- package/src/generated/IssueSource.d.ts +11 -11
- package/src/generated/IssueStatus.d.ts +11 -11
- package/src/generated/IssueType.d.ts +21 -21
- package/src/generated/IterationResult.d.ts +65 -65
- package/src/generated/IterationVerificationResults.d.ts +53 -53
- package/src/generated/JobItem.d.ts +31 -31
- package/src/generated/JobListResponse.d.ts +20 -20
- package/src/generated/JobStatus.d.ts +11 -11
- package/src/generated/JobSummary.d.ts +30 -30
- package/src/generated/LLMCostSummary.d.ts +38 -38
- package/src/generated/LLMMetrics.d.ts +42 -42
- package/src/generated/LegacyAssertion.d.ts +22 -0
- package/src/generated/LegacyAssertionTarget.d.ts +23 -0
- package/src/generated/LegacyGroup.d.ts +19 -0
- package/src/generated/LegacyProcessStep.d.ts +16 -0
- package/src/generated/LegacySpec.d.ts +30 -0
- package/src/generated/LegacyStateMachine.d.ts +17 -0
- package/src/generated/LegacyStateMachineState.d.ts +21 -0
- package/src/generated/LegacyTransition.d.ts +20 -0
- package/src/generated/LogSourceSelection.d.ts +25 -25
- package/src/generated/LoopInstanceStatus.d.ts +28 -28
- package/src/generated/LoopPhase.d.ts +26 -26
- package/src/generated/MatchAdjustment.d.ts +23 -23
- package/src/generated/MatchLocation.d.ts +22 -22
- package/src/generated/MatchMethod.d.ts +11 -11
- package/src/generated/MatchOutcome.d.ts +11 -0
- package/src/generated/MatchedElement.d.ts +28 -0
- package/src/generated/McpCallRecord.d.ts +35 -35
- package/src/generated/McpCallsResult.d.ts +44 -44
- package/src/generated/McpConnectionRef.d.ts +25 -25
- package/src/generated/McpServerConfig.d.ts +77 -77
- package/src/generated/McpServerStatus.d.ts +42 -42
- package/src/generated/McpToolCallResult.d.ts +38 -38
- package/src/generated/McpToolInfo.d.ts +23 -23
- package/src/generated/McpToolInputSchema.d.ts +34 -34
- package/src/generated/McpTransport.d.ts +15 -15
- package/src/generated/MissReason.d.ts +20 -0
- package/src/generated/ModelCostBreakdown.d.ts +36 -36
- package/src/generated/ModelOverrideConfig.d.ts +47 -47
- package/src/generated/Monitor.d.ts +48 -48
- package/src/generated/MonitorPosition.d.ts +13 -13
- package/src/generated/MouseButton.d.ts +13 -13
- package/src/generated/MultiLoopConfig.d.ts +32 -32
- package/src/generated/MultiLoopEntry.d.ts +32 -32
- package/src/generated/MultiLoopStatus.d.ts +37 -37
- package/src/generated/NativeAccessibilityStep.d.ts +121 -121
- package/src/generated/NavigationResult.d.ts +40 -40
- package/src/generated/NewConstraintProposal.d.ts +20 -20
- package/src/generated/NextTaskInfo.d.ts +24 -24
- package/src/generated/NodeMetadata.d.ts +47 -47
- package/src/generated/NodeStatus.d.ts +11 -11
- package/src/generated/NodeType.d.ts +11 -11
- package/src/generated/OcrEngine.d.ts +11 -11
- package/src/generated/OlConfig.d.ts +48 -48
- package/src/generated/OrchestrationLoopConfig.d.ts +87 -87
- package/src/generated/OrchestrationLoopStatus.d.ts +59 -59
- package/src/generated/Outcome.d.ts +15 -15
- package/src/generated/OutputLine.d.ts +23 -23
- package/src/generated/OutputStream.d.ts +11 -11
- package/src/generated/OverrideCollection.d.ts +18 -18
- package/src/generated/Pagination.d.ts +28 -28
- package/src/generated/ParserType.d.ts +17 -17
- package/src/generated/PathElement.d.ts +17 -17
- package/src/generated/PathfindingRequest.d.ts +24 -24
- package/src/generated/PathfindingResult.d.ts +30 -30
- package/src/generated/PathfindingStep.d.ts +36 -36
- package/src/generated/PatternOptions.d.ts +32 -32
- package/src/generated/PipelineConfig.d.ts +31 -31
- package/src/generated/PlaybackFrameRequest.d.ts +21 -21
- package/src/generated/PlaywrightExecutionMode.d.ts +11 -11
- package/src/generated/Point.d.ts +20 -20
- package/src/generated/PolicyConjunct.d.ts +22 -0
- package/src/generated/PolicyEvaluation.d.ts +22 -0
- package/src/generated/PolicyStatus.d.ts +11 -0
- package/src/generated/PollingConfig.d.ts +14 -14
- package/src/generated/ProcessConfig.d.ts +96 -96
- package/src/generated/ProcessState.d.ts +15 -15
- package/src/generated/ProcessStatus.d.ts +41 -41
- package/src/generated/PromptStep.d.ts +92 -92
- package/src/generated/PromptStepPhase.d.ts +13 -13
- package/src/generated/ProposalStatus.d.ts +13 -0
- package/src/generated/RAGDashboardStats.d.ts +26 -26
- package/src/generated/RagCompletionEvent.d.ts +25 -25
- package/src/generated/RagProcessingStatus.d.ts +11 -11
- package/src/generated/RagProgressEvent.d.ts +27 -27
- package/src/generated/ReadConfigResponse.d.ts +20 -20
- package/src/generated/RecommendedState.d.ts +23 -0
- package/src/generated/ReflectionFixOutput.d.ts +20 -20
- package/src/generated/Region.d.ts +39 -39
- package/src/generated/RepositoryInactiveCondition.d.ts +24 -24
- package/src/generated/RepositoryWatch.d.ts +20 -20
- package/src/generated/ResolvedInitialStates.d.ts +29 -29
- package/src/generated/ResolvedInitialStatesResult.d.ts +40 -40
- package/src/generated/ResourceLimits.d.ts +33 -33
- package/src/generated/RestartProcessStep.d.ts +88 -88
- package/src/generated/RetryPolicy.d.ts +24 -24
- package/src/generated/RetrySpec.d.ts +24 -24
- package/src/generated/RoleCriterion.d.ts +14 -14
- package/src/generated/RootCauseCategory.d.ts +18 -18
- package/src/generated/RoutingRule.d.ts +38 -38
- package/src/generated/RunPromptRequest.d.ts +56 -56
- package/src/generated/RunPromptResponse.d.ts +50 -50
- package/src/generated/RunPromptResponseData.d.ts +20 -20
- package/src/generated/RunStatus.d.ts +11 -11
- package/src/generated/RunType.d.ts +11 -11
- package/src/generated/Runner.d.ts +81 -81
- package/src/generated/RunnerCrash.d.ts +32 -32
- package/src/generated/RunnerFinding.d.ts +48 -48
- package/src/generated/RunnerFindingCodeContext.d.ts +20 -20
- package/src/generated/RunnerFindingUserInput.d.ts +19 -19
- package/src/generated/RunnerMetadata.d.ts +42 -42
- package/src/generated/RunnerStatus.d.ts +12 -12
- package/src/generated/RunnerUiError.d.ts +28 -28
- package/src/generated/RuntimeData.d.ts +40 -40
- package/src/generated/SaveWorkflowArtifactStep.d.ts +80 -80
- package/src/generated/ScheduleConditions.d.ts +29 -29
- package/src/generated/ScheduleExpression.d.ts +39 -39
- package/src/generated/ScheduledTask.d.ts +104 -104
- package/src/generated/ScheduledTaskStatus.d.ts +19 -19
- package/src/generated/ScheduledTaskType.d.ts +126 -126
- package/src/generated/SchedulerSettings.d.ts +28 -28
- package/src/generated/SchedulerStatus.d.ts +31 -31
- package/src/generated/ScreenshotAnnotation.d.ts +39 -39
- package/src/generated/ScreenshotAnnotationShape.d.ts +11 -11
- package/src/generated/ScreenshotType.d.ts +11 -11
- package/src/generated/ScrollDirection.d.ts +13 -13
- package/src/generated/SearchOptions.d.ts +33 -33
- package/src/generated/SearchResultItem.d.ts +19 -19
- package/src/generated/SearchStrategy.d.ts +14 -14
- package/src/generated/SemanticSearchRequest.d.ts +26 -26
- package/src/generated/SemanticSearchResponse.d.ts +21 -21
- package/src/generated/SpecCheckConfidence.d.ts +15 -0
- package/src/generated/SpecCheckPolicy.d.ts +23 -0
- package/src/generated/SpecCheckResult.d.ts +66 -0
- package/src/generated/SpecCheckStepConfig.d.ts +38 -0
- package/src/generated/SpecCheckSummary.d.ts +28 -0
- package/src/generated/SpecValidation.d.ts +27 -0
- package/src/generated/StageCondition.d.ts +37 -37
- package/src/generated/StageInput.d.ts +27 -27
- package/src/generated/StageOutput.d.ts +20 -20
- package/src/generated/StageTransition.d.ts +30 -30
- package/src/generated/StallDetectorConfig.d.ts +31 -31
- package/src/generated/StandardActionType.d.ts +40 -40
- package/src/generated/StateContext.d.ts +17 -17
- package/src/generated/StateDiscoveryResult.d.ts +104 -104
- package/src/generated/StateDiscoveryResultCreate.d.ts +65 -65
- package/src/generated/StateDiscoveryResultListResponse.d.ts +23 -23
- package/src/generated/StateDiscoveryResultSummary.d.ts +57 -57
- package/src/generated/StateDiscoveryResultUpdate.d.ts +47 -47
- package/src/generated/StateFilterItem.d.ts +18 -18
- package/src/generated/StateMachineConfig.d.ts +45 -45
- package/src/generated/StateMachineConfigCreate.d.ts +20 -20
- package/src/generated/StateMachineConfigFull.d.ts +67 -67
- package/src/generated/StateMachineConfigUpdate.d.ts +20 -20
- package/src/generated/StateMachineExport.d.ts +64 -64
- package/src/generated/StateMachineExportFormat.d.ts +39 -39
- package/src/generated/StateMachineImport.d.ts +25 -25
- package/src/generated/StateMachineState.d.ts +71 -71
- package/src/generated/StateMachineStateCreate.d.ts +52 -52
- package/src/generated/StateMachineStateUpdate.d.ts +48 -48
- package/src/generated/StateMachineTransition.d.ts +75 -75
- package/src/generated/StateMachineTransitionCreate.d.ts +53 -53
- package/src/generated/StateMachineTransitionUpdate.d.ts +53 -53
- package/src/generated/StateMatchResult.d.ts +36 -0
- package/src/generated/StateNodeData.d.ts +71 -71
- package/src/generated/StatesResponse.d.ts +19 -19
- package/src/generated/StdioConfig.d.ts +34 -34
- package/src/generated/StepExecutionConfig.d.ts +37 -37
- package/src/generated/StructuredFinding.d.ts +32 -32
- package/src/generated/StructuredOverride.d.ts +24 -24
- package/src/generated/StructuredSignal.d.ts +20 -20
- package/src/generated/SuccessCriterion.d.ts +57 -57
- package/src/generated/SummarizationConfig.d.ts +35 -35
- package/src/generated/TargetConfig.d.ts +108 -108
- package/src/generated/TaskCompletionResult.d.ts +90 -90
- package/src/generated/TaskExecutionRecord.d.ts +61 -61
- package/src/generated/TaskRun.d.ts +88 -88
- package/src/generated/TaskRunBackend.d.ts +86 -86
- package/src/generated/TaskRunBackendDetail.d.ts +99 -99
- package/src/generated/TaskRunCreate.d.ts +62 -62
- package/src/generated/TaskRunFilters.d.ts +38 -38
- package/src/generated/TaskRunFinding.d.ts +100 -100
- package/src/generated/TaskRunFindingActionType.d.ts +11 -11
- package/src/generated/TaskRunFindingCategory.d.ts +24 -24
- package/src/generated/TaskRunFindingCreate.d.ts +79 -79
- package/src/generated/TaskRunFindingFilters.d.ts +28 -28
- package/src/generated/TaskRunFindingSeverity.d.ts +11 -11
- package/src/generated/TaskRunFindingStatus.d.ts +11 -11
- package/src/generated/TaskRunFindingSummary.d.ts +34 -34
- package/src/generated/TaskRunFindingUpdate.d.ts +34 -34
- package/src/generated/TaskRunFindingsListResponse.d.ts +24 -24
- package/src/generated/TaskRunListResponse.d.ts +21 -21
- package/src/generated/TaskRunSession.d.ts +40 -40
- package/src/generated/TaskRunStatus.d.ts +11 -11
- package/src/generated/TaskRunUpdate.d.ts +47 -47
- package/src/generated/TaskType.d.ts +11 -11
- package/src/generated/TerminalExitEvent.d.ts +26 -26
- package/src/generated/TerminalInfo.d.ts +69 -69
- package/src/generated/TerminalOutputEvent.d.ts +29 -29
- package/src/generated/TestType.d.ts +11 -11
- package/src/generated/TextMatchType.d.ts +11 -11
- package/src/generated/TextSearchOptions.d.ts +30 -30
- package/src/generated/Ticket.d.ts +53 -53
- package/src/generated/TicketComment.d.ts +28 -28
- package/src/generated/TicketProviderConfig.d.ts +55 -55
- package/src/generated/TicketSource.d.ts +17 -17
- package/src/generated/TicketState.d.ts +15 -15
- package/src/generated/TimingInfo.d.ts +23 -23
- package/src/generated/TopMatch.d.ts +17 -17
- package/src/generated/TransitionAction.d.ts +93 -93
- package/src/generated/TransitionActionValue.d.ts +14 -14
- package/src/generated/TransitionEdgeData.d.ts +46 -46
- package/src/generated/TransitionExecutionResult.d.ts +30 -30
- package/src/generated/TransitionInfo.d.ts +29 -29
- package/src/generated/TransitionTriggerType.d.ts +13 -13
- package/src/generated/TreeEvent.d.ts +47 -47
- package/src/generated/TreeEventCreate.d.ts +30 -30
- package/src/generated/TreeEventListResponse.d.ts +30 -30
- package/src/generated/TreeEventResponse.d.ts +47 -47
- package/src/generated/TreeEventType.d.ts +20 -20
- package/src/generated/TreeNode.d.ts +54 -54
- package/src/generated/UIBridgeCapturedToast.d.ts +22 -22
- package/src/generated/UIBridgeComponent.d.ts +45 -45
- package/src/generated/UIBridgeElement.d.ts +90 -62
- package/src/generated/UIBridgeModalInfo.d.ts +40 -40
- package/src/generated/UIBridgeModalStack.d.ts +19 -19
- package/src/generated/UIBridgeSnapshot.d.ts +67 -67
- package/src/generated/UIBridgeToastContext.d.ts +17 -17
- package/src/generated/UIBridgeUndoContext.d.ts +19 -19
- package/src/generated/UiBridgeAction.d.ts +18 -18
- package/src/generated/UiBridgeAssertType.d.ts +11 -11
- package/src/generated/UiBridgeComparisonMode.d.ts +11 -11
- package/src/generated/UiBridgeDesignAuditStep.d.ts +76 -76
- package/src/generated/UiBridgeRequestEnvelope.d.ts +45 -45
- package/src/generated/UiBridgeResponseEnvelope.d.ts +66 -66
- package/src/generated/UiBridgeSeverity.d.ts +11 -11
- package/src/generated/UiBridgeStep.d.ts +127 -127
- package/src/generated/UiBridgeStepPhase.d.ts +14 -14
- package/src/generated/UiBridgeVisualAssertionStep.d.ts +97 -97
- package/src/generated/UnifiedStep.d.ts +57 -57
- package/src/generated/UnifiedWorkflow.d.ts +411 -411
- package/src/generated/UpdateMcpServerInput.d.ts +28 -28
- package/src/generated/UpdateOlConfigRequest.d.ts +32 -32
- package/src/generated/UpdateScheduledTaskRequest.d.ts +71 -71
- package/src/generated/ValidateConfigRequest.d.ts +16 -16
- package/src/generated/ValidateConfigResponse.d.ts +28 -28
- package/src/generated/VectorSearchResult.d.ts +48 -48
- package/src/generated/VerificationAgentContext.d.ts +25 -25
- package/src/generated/VerificationCategoryKind.d.ts +19 -19
- package/src/generated/VerificationMethod.d.ts +20 -20
- package/src/generated/VerificationPhaseResult.d.ts +63 -63
- package/src/generated/VerificationPlan.d.ts +43 -43
- package/src/generated/VerificationResult.d.ts +44 -44
- package/src/generated/VerificationResultResponse.d.ts +65 -65
- package/src/generated/VerificationResultsListResponse.d.ts +41 -41
- package/src/generated/VerificationStepDetails.d.ts +55 -55
- package/src/generated/VerificationStepResult.d.ts +68 -68
- package/src/generated/VgaAction.d.ts +61 -61
- package/src/generated/VgaActionKind.d.ts +14 -14
- package/src/generated/VgaAutomateStep.d.ts +110 -110
- package/src/generated/VirtualDesktop.d.ts +23 -23
- package/src/generated/VisualAssertionType.d.ts +11 -11
- package/src/generated/VisualComparisonResult.d.ts +40 -40
- package/src/generated/WaitOptions.d.ts +35 -35
- package/src/generated/WorkerCoordinationMessage.d.ts +93 -93
- package/src/generated/WorkerDomain.d.ts +29 -29
- package/src/generated/WorkerInstance.d.ts +62 -62
- package/src/generated/WorkerOutput.d.ts +53 -53
- package/src/generated/WorkerSignal.d.ts +48 -48
- package/src/generated/WorkerStatus.d.ts +11 -11
- package/src/generated/WorkflowArchitecture.d.ts +16 -16
- package/src/generated/WorkflowFixupMode.d.ts +11 -11
- package/src/generated/WorkflowFixupStep.d.ts +85 -85
- package/src/generated/WorkflowInfo.d.ts +28 -28
- package/src/generated/WorkflowMetadata.d.ts +44 -44
- package/src/generated/WorkflowRefStep.d.ts +94 -94
- package/src/generated/WorkflowStage.d.ts +126 -126
- package/src/generated/WorkflowStep.d.ts +80 -80
- package/src/generated/WorkflowStepPhase.d.ts +11 -11
- package/src/generated/WriteConfigRequest.d.ts +20 -20
- package/src/generated/WriteConfigResponse.d.ts +24 -24
- package/src/generated/index.ts +478 -432
- package/src/geometry/_api.ts +16 -16
- package/src/geometry/index.ts +1 -1
- package/src/index.ts +78 -73
- package/src/known-issues/index.ts +179 -179
- package/src/library/_api.ts +326 -326
- package/src/library/index.ts +1 -1
- package/src/rag/_api.ts +47 -47
- package/src/rag/index.ts +1 -1
- package/src/render-log.ts +371 -371
- package/src/runner/_api.ts +14 -14
- package/src/runner/index.ts +1 -1
- package/src/scheduler/_api.ts +21 -21
- package/src/scheduler/index.ts +1 -1
- package/src/state-machine/_api.ts +145 -145
- package/src/state-machine/index.ts +1 -1
- package/src/targets/_api.ts +47 -47
- package/src/targets/index.ts +1 -1
- package/src/task-run/_api.ts +108 -108
- package/src/task-run/index.ts +1 -1
- package/src/tauri-events/_api.ts +90 -90
- package/src/tauri-events/index.ts +1 -1
- package/src/tree-events/_api.ts +42 -42
- package/src/tree-events/index.ts +1 -1
- package/src/ui-bridge-ir/__tests__/projection.test.ts +1121 -1029
- package/src/ui-bridge-ir/adapter.ts +226 -220
- package/src/ui-bridge-ir/document.ts +114 -114
- package/src/ui-bridge-ir/element-criteria.ts +48 -48
- package/src/ui-bridge-ir/group.ts +84 -84
- package/src/ui-bridge-ir/index.ts +24 -24
- package/src/ui-bridge-ir/ir.schema.json +297 -293
- package/src/ui-bridge-ir/primitives.ts +110 -102
- package/src/ui-bridge-ir/projection.ts +898 -921
- package/src/ui-bridge-ir/state.ts +97 -90
- package/src/ui-bridge-ir/transition.ts +92 -92
- package/src/workflow/_api.ts +474 -474
- package/src/workflow/action-plan.ts +208 -208
- package/src/workflow/index.ts +1 -1
- package/src/workflow/skill.ts +152 -152
- package/dist/chunk-YXD4WCYQ.js.map +0 -1
- package/dist/chunk-ZK5MJEGT.js.map +0 -1
|
@@ -1,1029 +1,1121 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for `projectIRToBundledPage`.
|
|
3
|
-
*
|
|
4
|
-
* Covers:
|
|
5
|
-
* - Determinism (byte-identical output across two calls)
|
|
6
|
-
* - Round-trip-against-active.spec (key-field shape match)
|
|
7
|
-
* - Notes injection (descriptive paragraph append)
|
|
8
|
-
* - Empty cases (zero states, zero requiredElements, zero actions)
|
|
9
|
-
* - Criteria conversion (text -> textContent, ariaLabel -> accessibleName,
|
|
10
|
-
* attributes -> dataAttributes)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { describe, expect, it } from "vitest";
|
|
14
|
-
|
|
15
|
-
import type { IRDocument } from "../document";
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
name:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
expect(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
expect(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
it("
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
expect(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
expect(out.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
expect(
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
expect(
|
|
479
|
-
expect(
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
//
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
// ---------------------------------------------------------------------------
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
],
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
});
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
)
|
|
932
|
-
expect(
|
|
933
|
-
expect(
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
it("
|
|
967
|
-
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
);
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
expect(
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
});
|
|
1029
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tests for `projectIRToBundledPage`.
|
|
3
|
+
*
|
|
4
|
+
* Covers:
|
|
5
|
+
* - Determinism (byte-identical output across two calls)
|
|
6
|
+
* - Round-trip-against-active.spec (key-field shape match)
|
|
7
|
+
* - Notes injection (descriptive paragraph append)
|
|
8
|
+
* - Empty cases (zero states, zero requiredElements, zero actions)
|
|
9
|
+
* - Criteria conversion (text -> textContent, ariaLabel -> accessibleName,
|
|
10
|
+
* attributes -> dataAttributes)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { describe, expect, it } from "vitest";
|
|
14
|
+
|
|
15
|
+
import type { IRDocument } from "../document";
|
|
16
|
+
import type { IRElementCriteria } from "../element-criteria";
|
|
17
|
+
import type { IRAssertion } from "../group";
|
|
18
|
+
import {
|
|
19
|
+
projectIRToBundledPage,
|
|
20
|
+
projectLegacyToIR,
|
|
21
|
+
projectionVersion,
|
|
22
|
+
type LegacySpec,
|
|
23
|
+
} from "../projection";
|
|
24
|
+
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Fixtures
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Convert IR-shaped element criteria into the legacy criteria record stored on
|
|
31
|
+
* `IRAssertion.target.criteria`. Mirrors `projection.ts:convertCriteria`'s
|
|
32
|
+
* rename map (text -> textContent, ariaLabel -> accessibleName when no
|
|
33
|
+
* accessibleName is set, attributes -> dataAttributes). The forward projection
|
|
34
|
+
* passes `target.criteria` through verbatim into the legacy group output, so
|
|
35
|
+
* fixtures store criteria in their legacy on-disk shape.
|
|
36
|
+
*/
|
|
37
|
+
function toLegacyCriteria(c: IRElementCriteria): Record<string, unknown> {
|
|
38
|
+
const out: Record<string, unknown> = {};
|
|
39
|
+
if (c.role !== undefined) out.role = c.role;
|
|
40
|
+
if (c.tagName !== undefined) out.tagName = c.tagName;
|
|
41
|
+
if (c.text !== undefined) out.textContent = c.text;
|
|
42
|
+
if (c.textContains !== undefined) out.textContains = c.textContains;
|
|
43
|
+
if (c.accessibleName !== undefined) {
|
|
44
|
+
out.accessibleName = c.accessibleName;
|
|
45
|
+
} else if (c.ariaLabel !== undefined) {
|
|
46
|
+
out.accessibleName = c.ariaLabel;
|
|
47
|
+
}
|
|
48
|
+
if (c.id !== undefined) out.id = c.id;
|
|
49
|
+
if (c.attributes !== undefined) out.dataAttributes = c.attributes;
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Build the canonical IR-side assertion list for a state from a flat array of
|
|
55
|
+
* IR element criteria. Mirrors the shape the projection emits for state-derived
|
|
56
|
+
* groups so the fixtures stay terse — one criteria per assertion, with all the
|
|
57
|
+
* legacy required fields (id/category/severity/...) defaulted the same way the
|
|
58
|
+
* forward projection used to defaulted them when synthesizing assertions from
|
|
59
|
+
* `requiredElements`. Criteria are stored in legacy on-disk form (`textContent`,
|
|
60
|
+
* `accessibleName`, `dataAttributes`) because `IRAssertion.target.criteria` is
|
|
61
|
+
* already the legacy criteria record — the forward projection passes it through
|
|
62
|
+
* verbatim into `group.assertions[].target.criteria`.
|
|
63
|
+
*/
|
|
64
|
+
function assertionsFromCriteria(
|
|
65
|
+
stateId: string,
|
|
66
|
+
stateName: string,
|
|
67
|
+
criteria: IRElementCriteria[],
|
|
68
|
+
): IRAssertion[] {
|
|
69
|
+
return criteria.map((c, index) => ({
|
|
70
|
+
id: `${stateId}-elem-${index}`,
|
|
71
|
+
description: `Required element ${index} for state ${stateName}`,
|
|
72
|
+
category: "element-presence",
|
|
73
|
+
severity: "critical",
|
|
74
|
+
assertionType: "exists",
|
|
75
|
+
target: {
|
|
76
|
+
type: "search",
|
|
77
|
+
criteria: toLegacyCriteria(c),
|
|
78
|
+
label: `Required element for ${stateName}`,
|
|
79
|
+
},
|
|
80
|
+
source: "ai-generated",
|
|
81
|
+
reviewed: false,
|
|
82
|
+
enabled: true,
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Pluck the legacy-criteria record off an assertion produced by the inverse
|
|
88
|
+
* projection. The IR side stores criteria in IR form post-inversion (the
|
|
89
|
+
* projection's `invertCriteria` renames `textContent -> text`,
|
|
90
|
+
* `dataAttributes -> attributes`), so the returned object is shaped like
|
|
91
|
+
* `IRElementCriteria`.
|
|
92
|
+
*/
|
|
93
|
+
function criteriaOf(assertion: IRAssertion): IRElementCriteria {
|
|
94
|
+
return assertion.target.criteria as unknown as IRElementCriteria;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Slice of `qontinui-runner/src/specs/active.spec.uibridge.json` mapped back
|
|
99
|
+
* to IR. Three to four states, transitions between them, a few criteria
|
|
100
|
+
* shapes (role, textContent/text, accessibleName/ariaLabel, dataAttributes).
|
|
101
|
+
*/
|
|
102
|
+
const ACTIVE_PAGE_FIXTURE: IRDocument = {
|
|
103
|
+
version: "1.0",
|
|
104
|
+
id: "active",
|
|
105
|
+
name: "Active Dashboard",
|
|
106
|
+
description:
|
|
107
|
+
"Active Dashboard page -- the real-time monitoring hub for running workflows.",
|
|
108
|
+
metadata: {
|
|
109
|
+
tags: ["active-dashboard", "monitoring", "real-time", "tier-1"],
|
|
110
|
+
},
|
|
111
|
+
initialState: "idle",
|
|
112
|
+
states: [
|
|
113
|
+
{
|
|
114
|
+
id: "idle",
|
|
115
|
+
name: "Idle",
|
|
116
|
+
description: "No workflow is running.",
|
|
117
|
+
assertions: assertionsFromCriteria("idle", "Idle", [
|
|
118
|
+
{ text: "No Active Workflow" },
|
|
119
|
+
]),
|
|
120
|
+
isInitial: true,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "running",
|
|
124
|
+
name: "Running",
|
|
125
|
+
description: "A workflow is actively executing.",
|
|
126
|
+
assertions: assertionsFromCriteria("running", "Running", [
|
|
127
|
+
{ role: "button", text: "Stop" },
|
|
128
|
+
]),
|
|
129
|
+
isInitial: false,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "paused",
|
|
133
|
+
name: "Paused",
|
|
134
|
+
description: "The workflow is temporarily paused.",
|
|
135
|
+
assertions: assertionsFromCriteria("paused", "Paused", [
|
|
136
|
+
{ role: "button", ariaLabel: "Play" },
|
|
137
|
+
]),
|
|
138
|
+
isInitial: false,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "breakpoint-paused",
|
|
142
|
+
name: "Breakpoint Paused",
|
|
143
|
+
description:
|
|
144
|
+
"A workflow step with breakpoint: true has completed; execution is suspended.",
|
|
145
|
+
assertions: assertionsFromCriteria("breakpoint-paused", "Breakpoint Paused", [
|
|
146
|
+
{ text: "Breakpoint" },
|
|
147
|
+
{ attributes: { "content-label": "breakpoint step" } },
|
|
148
|
+
]),
|
|
149
|
+
isInitial: false,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
transitions: [
|
|
153
|
+
{
|
|
154
|
+
id: "idle-to-running",
|
|
155
|
+
name: "Start a workflow",
|
|
156
|
+
fromStates: ["idle"],
|
|
157
|
+
activateStates: ["running"],
|
|
158
|
+
exitStates: ["idle"],
|
|
159
|
+
actions: [
|
|
160
|
+
{
|
|
161
|
+
type: "click",
|
|
162
|
+
target: { text: "Run Last Workflow" },
|
|
163
|
+
waitAfter: { type: "idle", timeout: 5000 },
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "running-to-paused",
|
|
169
|
+
name: "Pause via play/pause button",
|
|
170
|
+
fromStates: ["running"],
|
|
171
|
+
activateStates: ["paused"],
|
|
172
|
+
exitStates: ["running"],
|
|
173
|
+
actions: [
|
|
174
|
+
{
|
|
175
|
+
type: "click",
|
|
176
|
+
target: { role: "button", ariaLabel: "Pause" },
|
|
177
|
+
waitAfter: { type: "idle", timeout: 2000 },
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: "paused-to-running",
|
|
183
|
+
name: "Resume via play button",
|
|
184
|
+
fromStates: ["paused"],
|
|
185
|
+
activateStates: ["running"],
|
|
186
|
+
exitStates: ["paused"],
|
|
187
|
+
actions: [
|
|
188
|
+
{
|
|
189
|
+
type: "click",
|
|
190
|
+
target: { role: "button", ariaLabel: "Play" },
|
|
191
|
+
waitAfter: { type: "idle", timeout: 2000 },
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Determinism
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
|
|
202
|
+
describe("projectIRToBundledPage — determinism", () => {
|
|
203
|
+
it("produces byte-identical JSON across two calls with the same input", () => {
|
|
204
|
+
const a = JSON.stringify(projectIRToBundledPage(ACTIVE_PAGE_FIXTURE));
|
|
205
|
+
const b = JSON.stringify(projectIRToBundledPage(ACTIVE_PAGE_FIXTURE));
|
|
206
|
+
expect(a).toBe(b);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("produces byte-identical JSON regardless of insertion order of object keys in input", () => {
|
|
210
|
+
// Two structurally identical IR docs with different in-memory key order.
|
|
211
|
+
const reordered: IRDocument = {
|
|
212
|
+
// Keys deliberately reordered.
|
|
213
|
+
transitions: ACTIVE_PAGE_FIXTURE.transitions,
|
|
214
|
+
states: ACTIVE_PAGE_FIXTURE.states,
|
|
215
|
+
initialState: ACTIVE_PAGE_FIXTURE.initialState,
|
|
216
|
+
metadata: ACTIVE_PAGE_FIXTURE.metadata,
|
|
217
|
+
description: ACTIVE_PAGE_FIXTURE.description,
|
|
218
|
+
name: ACTIVE_PAGE_FIXTURE.name,
|
|
219
|
+
id: ACTIVE_PAGE_FIXTURE.id,
|
|
220
|
+
version: ACTIVE_PAGE_FIXTURE.version,
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const a = JSON.stringify(projectIRToBundledPage(ACTIVE_PAGE_FIXTURE));
|
|
224
|
+
const b = JSON.stringify(projectIRToBundledPage(reordered));
|
|
225
|
+
expect(a).toBe(b);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it("sorts keys lexicographically at the top level", () => {
|
|
229
|
+
const out = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
230
|
+
const keys = Object.keys(out);
|
|
231
|
+
expect(keys).toEqual([...keys].sort());
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// ---------------------------------------------------------------------------
|
|
236
|
+
// Round-trip against active.spec
|
|
237
|
+
// ---------------------------------------------------------------------------
|
|
238
|
+
|
|
239
|
+
describe("projectIRToBundledPage — round-trip against active.spec", () => {
|
|
240
|
+
const out = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
241
|
+
|
|
242
|
+
it("produces top-level shape with version, description, groups, stateMachine, metadata", () => {
|
|
243
|
+
expect(out.version).toBe("1.0.0");
|
|
244
|
+
expect(typeof out.description).toBe("string");
|
|
245
|
+
expect(Array.isArray(out.groups)).toBe(true);
|
|
246
|
+
expect(out.stateMachine).toBeDefined();
|
|
247
|
+
expect(Array.isArray(out.stateMachine.states)).toBe(true);
|
|
248
|
+
expect(out.metadata).toBeDefined();
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it("produces one group per IR state, in input order", () => {
|
|
252
|
+
expect(out.groups).toHaveLength(ACTIVE_PAGE_FIXTURE.states.length);
|
|
253
|
+
expect(out.groups.map((g) => g.id)).toEqual(
|
|
254
|
+
ACTIVE_PAGE_FIXTURE.states.map((s) => s.id),
|
|
255
|
+
);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("produces one assertion per requiredElement on each group", () => {
|
|
259
|
+
const breakpointGroup = out.groups.find((g) => g.id === "breakpoint-paused");
|
|
260
|
+
expect(breakpointGroup).toBeDefined();
|
|
261
|
+
// breakpoint-paused has two requiredElements -> two assertions.
|
|
262
|
+
expect(breakpointGroup!.assertions).toHaveLength(2);
|
|
263
|
+
expect(breakpointGroup!.assertions[0]!.id).toBe("breakpoint-paused-elem-0");
|
|
264
|
+
expect(breakpointGroup!.assertions[1]!.id).toBe("breakpoint-paused-elem-1");
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("converts text -> textContent in assertion targets", () => {
|
|
268
|
+
const idleGroup = out.groups.find((g) => g.id === "idle")!;
|
|
269
|
+
const assertion = idleGroup.assertions[0]!;
|
|
270
|
+
expect(assertion.target.criteria).toEqual({ textContent: "No Active Workflow" });
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it("converts ariaLabel -> accessibleName in assertion targets", () => {
|
|
274
|
+
const pausedGroup = out.groups.find((g) => g.id === "paused")!;
|
|
275
|
+
const assertion = pausedGroup.assertions[0]!;
|
|
276
|
+
expect(assertion.target.criteria).toEqual({
|
|
277
|
+
role: "button",
|
|
278
|
+
accessibleName: "Play",
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("converts attributes -> dataAttributes in assertion targets", () => {
|
|
283
|
+
const bpGroup = out.groups.find((g) => g.id === "breakpoint-paused")!;
|
|
284
|
+
// Second requiredElement uses attributes.
|
|
285
|
+
const assertion = bpGroup.assertions[1]!;
|
|
286
|
+
expect(assertion.target.criteria).toEqual({
|
|
287
|
+
dataAttributes: { "content-label": "breakpoint step" },
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("emits assertions with required legacy fields", () => {
|
|
292
|
+
for (const group of out.groups) {
|
|
293
|
+
for (const assertion of group.assertions) {
|
|
294
|
+
expect(assertion.id).toBeTruthy();
|
|
295
|
+
expect(assertion.description).toBeTruthy();
|
|
296
|
+
expect(assertion.category).toBe("element-presence");
|
|
297
|
+
expect(assertion.severity).toBe("critical");
|
|
298
|
+
expect(assertion.assertionType).toBe("exists");
|
|
299
|
+
expect(assertion.source).toBe("ai-generated");
|
|
300
|
+
expect(assertion.reviewed).toBe(false);
|
|
301
|
+
expect(assertion.enabled).toBe(true);
|
|
302
|
+
expect(assertion.target.type).toBe("search");
|
|
303
|
+
expect(assertion.target.label).toContain(
|
|
304
|
+
// each target.label includes the state name
|
|
305
|
+
group.name,
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
it("places transitions under each fromState in stateMachine.states", () => {
|
|
312
|
+
const idleSm = out.stateMachine.states.find((s) => s.id === "idle")!;
|
|
313
|
+
expect(idleSm.transitions.map((t) => t.id)).toEqual(["idle-to-running"]);
|
|
314
|
+
|
|
315
|
+
const runningSm = out.stateMachine.states.find((s) => s.id === "running")!;
|
|
316
|
+
expect(runningSm.transitions.map((t) => t.id)).toEqual(["running-to-paused"]);
|
|
317
|
+
|
|
318
|
+
const pausedSm = out.stateMachine.states.find((s) => s.id === "paused")!;
|
|
319
|
+
expect(pausedSm.transitions.map((t) => t.id)).toEqual(["paused-to-running"]);
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("derives staysVisible from exitStates length (false when exitStates non-empty)", () => {
|
|
323
|
+
const idleSm = out.stateMachine.states.find((s) => s.id === "idle")!;
|
|
324
|
+
const t = idleSm.transitions[0]!;
|
|
325
|
+
expect(t.deactivateStates).toEqual(["idle"]);
|
|
326
|
+
expect(t.staysVisible).toBe(false);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it("renames action.type -> process[].action and converts target criteria", () => {
|
|
330
|
+
const idleSm = out.stateMachine.states.find((s) => s.id === "idle")!;
|
|
331
|
+
const proc = idleSm.transitions[0]!.process[0]!;
|
|
332
|
+
expect(proc.action).toBe("click");
|
|
333
|
+
expect(proc.target).toEqual({ textContent: "Run Last Workflow" });
|
|
334
|
+
expect(proc.waitAfter).toEqual({ type: "idle", timeout: 5000 });
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it("uses initialState fallback when state.isInitial is undefined", () => {
|
|
338
|
+
const noExplicit: IRDocument = {
|
|
339
|
+
version: "1.0",
|
|
340
|
+
id: "x",
|
|
341
|
+
name: "X",
|
|
342
|
+
initialState: "first",
|
|
343
|
+
states: [
|
|
344
|
+
{
|
|
345
|
+
id: "first",
|
|
346
|
+
name: "First",
|
|
347
|
+
assertions: assertionsFromCriteria("first", "First", [{ role: "heading" }]),
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
id: "second",
|
|
351
|
+
name: "Second",
|
|
352
|
+
assertions: assertionsFromCriteria("second", "Second", [{ role: "button" }]),
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
transitions: [],
|
|
356
|
+
};
|
|
357
|
+
const result = projectIRToBundledPage(noExplicit);
|
|
358
|
+
expect(result.stateMachine.states.find((s) => s.id === "first")!.isInitial).toBe(
|
|
359
|
+
true,
|
|
360
|
+
);
|
|
361
|
+
expect(
|
|
362
|
+
result.stateMachine.states.find((s) => s.id === "second")!.isInitial,
|
|
363
|
+
).toBe(false);
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it("propagates document tags into metadata.tags", () => {
|
|
367
|
+
expect(out.metadata.tags).toEqual([
|
|
368
|
+
"active-dashboard",
|
|
369
|
+
"monitoring",
|
|
370
|
+
"real-time",
|
|
371
|
+
"tier-1",
|
|
372
|
+
]);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it("uses doc.id as metadata.component when no purpose is set", () => {
|
|
376
|
+
expect(out.metadata.component).toBe("active");
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
it("uses metadata.purpose as metadata.component when present", () => {
|
|
380
|
+
const withPurpose: IRDocument = {
|
|
381
|
+
...ACTIVE_PAGE_FIXTURE,
|
|
382
|
+
metadata: { ...ACTIVE_PAGE_FIXTURE.metadata, purpose: "ActiveDashboardPage" },
|
|
383
|
+
};
|
|
384
|
+
const result = projectIRToBundledPage(withPurpose);
|
|
385
|
+
expect(result.metadata.component).toBe("ActiveDashboardPage");
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
it("uses doc.description as the top-level description", () => {
|
|
389
|
+
expect(out.description).toBe(ACTIVE_PAGE_FIXTURE.description);
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
// ---------------------------------------------------------------------------
|
|
394
|
+
// Notes injection
|
|
395
|
+
// ---------------------------------------------------------------------------
|
|
396
|
+
|
|
397
|
+
describe("projectIRToBundledPage — notes injection", () => {
|
|
398
|
+
it("appends notes as a separate paragraph (two-newline separator)", () => {
|
|
399
|
+
const out = projectIRToBundledPage(
|
|
400
|
+
ACTIVE_PAGE_FIXTURE,
|
|
401
|
+
"Reviewed by Joshua on 2026-04-28.",
|
|
402
|
+
);
|
|
403
|
+
expect(out.description).toBe(
|
|
404
|
+
`${ACTIVE_PAGE_FIXTURE.description}\n\nReviewed by Joshua on 2026-04-28.`,
|
|
405
|
+
);
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
it("treats undefined notes as no-op (no trailing newlines)", () => {
|
|
409
|
+
const out = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
410
|
+
expect(out.description).toBe(ACTIVE_PAGE_FIXTURE.description);
|
|
411
|
+
expect(out.description.endsWith("\n")).toBe(false);
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
it("treats empty-string notes as no-op", () => {
|
|
415
|
+
const out = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE, "");
|
|
416
|
+
expect(out.description).toBe(ACTIVE_PAGE_FIXTURE.description);
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
it("falls back to doc.name when doc.description is missing", () => {
|
|
420
|
+
const noDesc: IRDocument = {
|
|
421
|
+
version: "1.0",
|
|
422
|
+
id: "p",
|
|
423
|
+
name: "Page",
|
|
424
|
+
states: [],
|
|
425
|
+
transitions: [],
|
|
426
|
+
};
|
|
427
|
+
const out = projectIRToBundledPage(noDesc, "added later");
|
|
428
|
+
expect(out.description).toBe("Page\n\nadded later");
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
// ---------------------------------------------------------------------------
|
|
433
|
+
// Empty cases
|
|
434
|
+
// ---------------------------------------------------------------------------
|
|
435
|
+
|
|
436
|
+
describe("projectIRToBundledPage — empty cases", () => {
|
|
437
|
+
it("handles a document with zero states", () => {
|
|
438
|
+
const empty: IRDocument = {
|
|
439
|
+
version: "1.0",
|
|
440
|
+
id: "empty",
|
|
441
|
+
name: "Empty",
|
|
442
|
+
states: [],
|
|
443
|
+
transitions: [],
|
|
444
|
+
};
|
|
445
|
+
const out = projectIRToBundledPage(empty);
|
|
446
|
+
expect(out.groups).toEqual([]);
|
|
447
|
+
expect(out.stateMachine.states).toEqual([]);
|
|
448
|
+
expect(out.version).toBe("1.0.0");
|
|
449
|
+
expect(out.metadata.component).toBe("empty");
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
it("projects a state with zero requiredElements to a group with empty assertions[]", () => {
|
|
453
|
+
// Legacy specs ship architecture-only / documentation-only groups with
|
|
454
|
+
// empty `assertions[]` (e.g. `graphql-resolver-inventory` in the runner's
|
|
455
|
+
// `graphql-infrastructure.spec.uibridge.json`). The forward projection
|
|
456
|
+
// must preserve that emptiness so the legacy<->IR round-trip is identity
|
|
457
|
+
// for assertion counts; emitting a placeholder here silently inflates the
|
|
458
|
+
// count and trips `check-spec-pairing` with an `assertionCount` mismatch.
|
|
459
|
+
const doc: IRDocument = {
|
|
460
|
+
version: "1.0",
|
|
461
|
+
id: "p",
|
|
462
|
+
name: "P",
|
|
463
|
+
states: [
|
|
464
|
+
{
|
|
465
|
+
id: "no-req",
|
|
466
|
+
name: "No Required Elements",
|
|
467
|
+
assertions: [],
|
|
468
|
+
},
|
|
469
|
+
],
|
|
470
|
+
transitions: [],
|
|
471
|
+
};
|
|
472
|
+
const out = projectIRToBundledPage(doc);
|
|
473
|
+
expect(out.groups).toHaveLength(1);
|
|
474
|
+
const group = out.groups[0]!;
|
|
475
|
+
expect(group.assertions).toEqual([]);
|
|
476
|
+
// The state still appears in the state-machine block — emptiness is local
|
|
477
|
+
// to `groups[].assertions[]`, not state existence.
|
|
478
|
+
expect(out.stateMachine.states).toHaveLength(1);
|
|
479
|
+
expect(out.stateMachine.states[0]!.id).toBe("no-req");
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
it("preserves empty groups across a legacy -> IR -> legacy round-trip (regression: graphql-infrastructure)", () => {
|
|
483
|
+
// Reproduces the on-disk shape of the four runner specs that previously
|
|
484
|
+
// produced an `assertionCount` mismatch in `check-spec-pairing`: a group
|
|
485
|
+
// with empty `assertions[]` and a matching state-machine state with
|
|
486
|
+
// empty `elements[]`. Round-trip identity proves the placeholder
|
|
487
|
+
// re-emission bug stays fixed.
|
|
488
|
+
const legacy = {
|
|
489
|
+
version: "1.0.0",
|
|
490
|
+
description: "Architecture-only spec with empty groups",
|
|
491
|
+
metadata: { component: "regression" },
|
|
492
|
+
groups: [
|
|
493
|
+
{
|
|
494
|
+
id: "non-empty",
|
|
495
|
+
name: "Has assertions",
|
|
496
|
+
description: "",
|
|
497
|
+
category: "element-presence",
|
|
498
|
+
assertions: [
|
|
499
|
+
{
|
|
500
|
+
id: "a1",
|
|
501
|
+
description: "First assertion",
|
|
502
|
+
category: "element-presence",
|
|
503
|
+
severity: "critical",
|
|
504
|
+
assertionType: "exists",
|
|
505
|
+
target: {
|
|
506
|
+
type: "search",
|
|
507
|
+
criteria: { textContent: "Run" },
|
|
508
|
+
label: "Run button",
|
|
509
|
+
},
|
|
510
|
+
source: "ai-generated",
|
|
511
|
+
reviewed: false,
|
|
512
|
+
enabled: true,
|
|
513
|
+
},
|
|
514
|
+
],
|
|
515
|
+
source: "ai-generated",
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
id: "empty",
|
|
519
|
+
name: "Empty architecture group",
|
|
520
|
+
description: "",
|
|
521
|
+
category: "element-presence",
|
|
522
|
+
assertions: [],
|
|
523
|
+
source: "ai-generated",
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
stateMachine: {
|
|
527
|
+
states: [
|
|
528
|
+
{
|
|
529
|
+
id: "non-empty",
|
|
530
|
+
name: "Has assertions",
|
|
531
|
+
description: "",
|
|
532
|
+
elements: [{ textContent: "Run" }],
|
|
533
|
+
isInitial: true,
|
|
534
|
+
transitions: [],
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
id: "empty",
|
|
538
|
+
name: "Empty architecture group",
|
|
539
|
+
description: "",
|
|
540
|
+
elements: [],
|
|
541
|
+
isInitial: false,
|
|
542
|
+
transitions: [],
|
|
543
|
+
},
|
|
544
|
+
],
|
|
545
|
+
},
|
|
546
|
+
} as unknown as Parameters<typeof projectLegacyToIR>[0];
|
|
547
|
+
|
|
548
|
+
const ir = projectLegacyToIR(legacy, { docId: "regression" });
|
|
549
|
+
const projected = projectIRToBundledPage(ir);
|
|
550
|
+
|
|
551
|
+
expect(projected.groups).toHaveLength(2);
|
|
552
|
+
expect(projected.groups[0]!.id).toBe("non-empty");
|
|
553
|
+
expect(projected.groups[0]!.assertions).toHaveLength(1);
|
|
554
|
+
expect(projected.groups[1]!.id).toBe("empty");
|
|
555
|
+
expect(projected.groups[1]!.assertions).toEqual([]);
|
|
556
|
+
|
|
557
|
+
// Total assertion count is identity across the round-trip.
|
|
558
|
+
const legacyTotal = legacy.groups.reduce(
|
|
559
|
+
(s: number, g: { assertions: unknown[] }) => s + g.assertions.length,
|
|
560
|
+
0,
|
|
561
|
+
);
|
|
562
|
+
const projectedTotal = projected.groups.reduce(
|
|
563
|
+
(s, g) => s + g.assertions.length,
|
|
564
|
+
0,
|
|
565
|
+
);
|
|
566
|
+
expect(projectedTotal).toBe(legacyTotal);
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
it("handles a state with empty-string text criteria (still emits an assertion)", () => {
|
|
570
|
+
const doc: IRDocument = {
|
|
571
|
+
version: "1.0",
|
|
572
|
+
id: "p",
|
|
573
|
+
name: "P",
|
|
574
|
+
states: [
|
|
575
|
+
{
|
|
576
|
+
id: "empty-text",
|
|
577
|
+
name: "Empty Text",
|
|
578
|
+
assertions: assertionsFromCriteria("empty-text", "Empty Text", [{ text: "" }]),
|
|
579
|
+
},
|
|
580
|
+
],
|
|
581
|
+
transitions: [],
|
|
582
|
+
};
|
|
583
|
+
const out = projectIRToBundledPage(doc);
|
|
584
|
+
expect(out.groups[0]!.assertions).toHaveLength(1);
|
|
585
|
+
expect(out.groups[0]!.assertions[0]!.target.criteria).toEqual({ textContent: "" });
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
it("handles a transition with no actions (process: [])", () => {
|
|
589
|
+
const doc: IRDocument = {
|
|
590
|
+
version: "1.0",
|
|
591
|
+
id: "p",
|
|
592
|
+
name: "P",
|
|
593
|
+
states: [
|
|
594
|
+
{
|
|
595
|
+
id: "a",
|
|
596
|
+
name: "A",
|
|
597
|
+
assertions: assertionsFromCriteria("a", "A", [{ role: "heading" }]),
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
id: "b",
|
|
601
|
+
name: "B",
|
|
602
|
+
assertions: assertionsFromCriteria("b", "B", [{ role: "heading" }]),
|
|
603
|
+
},
|
|
604
|
+
],
|
|
605
|
+
transitions: [
|
|
606
|
+
{
|
|
607
|
+
id: "auto",
|
|
608
|
+
name: "Auto transition",
|
|
609
|
+
fromStates: ["a"],
|
|
610
|
+
activateStates: ["b"],
|
|
611
|
+
exitStates: ["a"],
|
|
612
|
+
actions: [],
|
|
613
|
+
},
|
|
614
|
+
],
|
|
615
|
+
};
|
|
616
|
+
const out = projectIRToBundledPage(doc);
|
|
617
|
+
const aSm = out.stateMachine.states.find((s) => s.id === "a")!;
|
|
618
|
+
expect(aSm.transitions[0]!.process).toEqual([]);
|
|
619
|
+
expect(aSm.transitions[0]!.staysVisible).toBe(false);
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
it("derives staysVisible=true for a transition with no exitStates (modal-style)", () => {
|
|
623
|
+
const doc: IRDocument = {
|
|
624
|
+
version: "1.0",
|
|
625
|
+
id: "p",
|
|
626
|
+
name: "P",
|
|
627
|
+
states: [
|
|
628
|
+
{
|
|
629
|
+
id: "base",
|
|
630
|
+
name: "Base",
|
|
631
|
+
assertions: assertionsFromCriteria("base", "Base", [{ role: "heading" }]),
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
id: "modal",
|
|
635
|
+
name: "Modal",
|
|
636
|
+
assertions: assertionsFromCriteria("modal", "Modal", [{ role: "dialog" }]),
|
|
637
|
+
},
|
|
638
|
+
],
|
|
639
|
+
transitions: [
|
|
640
|
+
{
|
|
641
|
+
id: "open-modal",
|
|
642
|
+
name: "Open modal",
|
|
643
|
+
fromStates: ["base"],
|
|
644
|
+
activateStates: ["modal"],
|
|
645
|
+
// No exitStates -> modal-style; base stays visible underneath.
|
|
646
|
+
actions: [{ type: "click", target: { role: "button" } }],
|
|
647
|
+
},
|
|
648
|
+
],
|
|
649
|
+
};
|
|
650
|
+
const out = projectIRToBundledPage(doc);
|
|
651
|
+
const baseSm = out.stateMachine.states.find((s) => s.id === "base")!;
|
|
652
|
+
expect(baseSm.transitions[0]!.deactivateStates).toEqual([]);
|
|
653
|
+
expect(baseSm.transitions[0]!.staysVisible).toBe(true);
|
|
654
|
+
});
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
// ---------------------------------------------------------------------------
|
|
658
|
+
// Provenance + state-level fields
|
|
659
|
+
// ---------------------------------------------------------------------------
|
|
660
|
+
|
|
661
|
+
describe("projectIRToBundledPage — provenance + state metadata", () => {
|
|
662
|
+
it("uses state.provenance.source for group.source when present", () => {
|
|
663
|
+
const doc: IRDocument = {
|
|
664
|
+
version: "1.0",
|
|
665
|
+
id: "p",
|
|
666
|
+
name: "P",
|
|
667
|
+
states: [
|
|
668
|
+
{
|
|
669
|
+
id: "s",
|
|
670
|
+
name: "S",
|
|
671
|
+
assertions: assertionsFromCriteria("s", "S", [{ role: "heading" }]),
|
|
672
|
+
provenance: { source: "hand-authored", file: "p.tsx" },
|
|
673
|
+
},
|
|
674
|
+
],
|
|
675
|
+
transitions: [],
|
|
676
|
+
};
|
|
677
|
+
const out = projectIRToBundledPage(doc);
|
|
678
|
+
expect(out.groups[0]!.source).toBe("hand-authored");
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
it("defaults group.source to ai-generated when provenance is missing", () => {
|
|
682
|
+
const doc: IRDocument = {
|
|
683
|
+
version: "1.0",
|
|
684
|
+
id: "p",
|
|
685
|
+
name: "P",
|
|
686
|
+
states: [
|
|
687
|
+
{
|
|
688
|
+
id: "s",
|
|
689
|
+
name: "S",
|
|
690
|
+
assertions: assertionsFromCriteria("s", "S", [{ role: "heading" }]),
|
|
691
|
+
},
|
|
692
|
+
],
|
|
693
|
+
transitions: [],
|
|
694
|
+
};
|
|
695
|
+
const out = projectIRToBundledPage(doc);
|
|
696
|
+
expect(out.groups[0]!.source).toBe("ai-generated");
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
it("uses state.metadata.description as group.description when state.description is missing", () => {
|
|
700
|
+
const doc: IRDocument = {
|
|
701
|
+
version: "1.0",
|
|
702
|
+
id: "p",
|
|
703
|
+
name: "P",
|
|
704
|
+
states: [
|
|
705
|
+
{
|
|
706
|
+
id: "s",
|
|
707
|
+
name: "S",
|
|
708
|
+
assertions: assertionsFromCriteria("s", "S", [{ role: "heading" }]),
|
|
709
|
+
metadata: { description: "From metadata" },
|
|
710
|
+
},
|
|
711
|
+
],
|
|
712
|
+
transitions: [],
|
|
713
|
+
};
|
|
714
|
+
const out = projectIRToBundledPage(doc);
|
|
715
|
+
expect(out.groups[0]!.description).toBe("From metadata");
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
it("falls through to empty string when neither state.description nor state.metadata.description set", () => {
|
|
719
|
+
const doc: IRDocument = {
|
|
720
|
+
version: "1.0",
|
|
721
|
+
id: "p",
|
|
722
|
+
name: "P",
|
|
723
|
+
states: [
|
|
724
|
+
{
|
|
725
|
+
id: "s",
|
|
726
|
+
name: "S",
|
|
727
|
+
assertions: assertionsFromCriteria("s", "S", [{ role: "heading" }]),
|
|
728
|
+
},
|
|
729
|
+
],
|
|
730
|
+
transitions: [],
|
|
731
|
+
};
|
|
732
|
+
const out = projectIRToBundledPage(doc);
|
|
733
|
+
expect(out.groups[0]!.description).toBe("");
|
|
734
|
+
});
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
// ---------------------------------------------------------------------------
|
|
738
|
+
// Type / version export
|
|
739
|
+
// ---------------------------------------------------------------------------
|
|
740
|
+
|
|
741
|
+
describe("projectionVersion", () => {
|
|
742
|
+
it('exports "1.0"', () => {
|
|
743
|
+
expect(projectionVersion).toBe("1.0");
|
|
744
|
+
});
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
// ---------------------------------------------------------------------------
|
|
748
|
+
// Type witness — confirms LegacySpec is a structural shape with the legacy fields
|
|
749
|
+
// ---------------------------------------------------------------------------
|
|
750
|
+
|
|
751
|
+
describe("LegacySpec — structural witness", () => {
|
|
752
|
+
it("matches the legacy shape on a minimal projection", () => {
|
|
753
|
+
const minimal: IRDocument = {
|
|
754
|
+
version: "1.0",
|
|
755
|
+
id: "m",
|
|
756
|
+
name: "M",
|
|
757
|
+
states: [],
|
|
758
|
+
transitions: [],
|
|
759
|
+
};
|
|
760
|
+
const out: LegacySpec = projectIRToBundledPage(minimal);
|
|
761
|
+
expect(out).toMatchObject({
|
|
762
|
+
version: "1.0.0",
|
|
763
|
+
description: "M",
|
|
764
|
+
groups: [],
|
|
765
|
+
stateMachine: { states: [] },
|
|
766
|
+
metadata: { component: "m" },
|
|
767
|
+
});
|
|
768
|
+
});
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
// ---------------------------------------------------------------------------
|
|
772
|
+
// Inverse projection: legacy -> IR (Phase A2)
|
|
773
|
+
// ---------------------------------------------------------------------------
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Hand-authored minimal legacy fixture for the inverse direction. Mirrors a
|
|
777
|
+
* trimmed `settings-general.spec.uibridge.json`-style shape with two groups,
|
|
778
|
+
* a state-machine block, transitions with action sequences, and a
|
|
779
|
+
* precondition on one assertion.
|
|
780
|
+
*/
|
|
781
|
+
const LEGACY_FIXTURE: LegacySpec = {
|
|
782
|
+
version: "1.0.0",
|
|
783
|
+
description: "Hand-authored test fixture for inverse projection.",
|
|
784
|
+
groups: [
|
|
785
|
+
{
|
|
786
|
+
id: "alpha",
|
|
787
|
+
name: "Alpha Group",
|
|
788
|
+
description: "First group for the round-trip test.",
|
|
789
|
+
category: "element-presence",
|
|
790
|
+
assertions: [
|
|
791
|
+
{
|
|
792
|
+
id: "alpha-elem-0",
|
|
793
|
+
description: "Heading exists",
|
|
794
|
+
category: "element-presence",
|
|
795
|
+
severity: "critical",
|
|
796
|
+
assertionType: "exists",
|
|
797
|
+
target: {
|
|
798
|
+
type: "search",
|
|
799
|
+
criteria: { role: "heading", textContent: "Alpha" },
|
|
800
|
+
label: "Alpha heading",
|
|
801
|
+
},
|
|
802
|
+
source: "manual",
|
|
803
|
+
reviewed: true,
|
|
804
|
+
enabled: true,
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
id: "alpha-elem-1",
|
|
808
|
+
description: "Subtitle exists",
|
|
809
|
+
category: "element-presence",
|
|
810
|
+
severity: "warning",
|
|
811
|
+
assertionType: "exists",
|
|
812
|
+
target: {
|
|
813
|
+
type: "search",
|
|
814
|
+
criteria: { textContent: "Welcome" },
|
|
815
|
+
label: "Subtitle",
|
|
816
|
+
},
|
|
817
|
+
source: "manual",
|
|
818
|
+
reviewed: true,
|
|
819
|
+
enabled: true,
|
|
820
|
+
precondition: "Page is loaded.",
|
|
821
|
+
},
|
|
822
|
+
],
|
|
823
|
+
source: "manual",
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
id: "beta",
|
|
827
|
+
name: "Beta Group",
|
|
828
|
+
description: "Second group, modal-style.",
|
|
829
|
+
category: "element-presence",
|
|
830
|
+
assertions: [
|
|
831
|
+
{
|
|
832
|
+
id: "beta-elem-0",
|
|
833
|
+
description: "Dialog exists",
|
|
834
|
+
category: "element-presence",
|
|
835
|
+
severity: "critical",
|
|
836
|
+
assertionType: "exists",
|
|
837
|
+
target: {
|
|
838
|
+
type: "search",
|
|
839
|
+
criteria: { role: "dialog", accessibleName: "Confirm" },
|
|
840
|
+
label: "Confirm dialog",
|
|
841
|
+
},
|
|
842
|
+
source: "manual",
|
|
843
|
+
reviewed: true,
|
|
844
|
+
enabled: true,
|
|
845
|
+
},
|
|
846
|
+
],
|
|
847
|
+
source: "manual",
|
|
848
|
+
},
|
|
849
|
+
],
|
|
850
|
+
stateMachine: {
|
|
851
|
+
states: [
|
|
852
|
+
{
|
|
853
|
+
id: "alpha",
|
|
854
|
+
name: "Alpha Group",
|
|
855
|
+
description: "First group for the round-trip test.",
|
|
856
|
+
elements: [
|
|
857
|
+
{ role: "heading", textContent: "Alpha" },
|
|
858
|
+
{ textContent: "Welcome" },
|
|
859
|
+
],
|
|
860
|
+
isInitial: true,
|
|
861
|
+
transitions: [
|
|
862
|
+
{
|
|
863
|
+
id: "alpha-to-beta",
|
|
864
|
+
name: "Open Beta",
|
|
865
|
+
activateStates: ["beta"],
|
|
866
|
+
deactivateStates: [],
|
|
867
|
+
staysVisible: true,
|
|
868
|
+
process: [
|
|
869
|
+
{
|
|
870
|
+
action: "click",
|
|
871
|
+
target: { role: "button", textContent: "Open" },
|
|
872
|
+
waitAfter: { type: "idle", timeout: 1000 },
|
|
873
|
+
},
|
|
874
|
+
],
|
|
875
|
+
},
|
|
876
|
+
],
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
id: "beta",
|
|
880
|
+
name: "Beta Group",
|
|
881
|
+
description: "Second group, modal-style.",
|
|
882
|
+
elements: [{ role: "dialog", accessibleName: "Confirm" }],
|
|
883
|
+
isInitial: false,
|
|
884
|
+
transitions: [
|
|
885
|
+
{
|
|
886
|
+
id: "beta-to-alpha",
|
|
887
|
+
name: "Close Beta",
|
|
888
|
+
activateStates: ["alpha"],
|
|
889
|
+
deactivateStates: ["beta"],
|
|
890
|
+
staysVisible: false,
|
|
891
|
+
process: [
|
|
892
|
+
{
|
|
893
|
+
action: "click",
|
|
894
|
+
target: { textContent: "Cancel" },
|
|
895
|
+
},
|
|
896
|
+
],
|
|
897
|
+
},
|
|
898
|
+
],
|
|
899
|
+
},
|
|
900
|
+
],
|
|
901
|
+
},
|
|
902
|
+
metadata: {
|
|
903
|
+
component: "fixture-page",
|
|
904
|
+
tags: ["fixture", "round-trip"],
|
|
905
|
+
},
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
describe("projectLegacyToIR — basic shape", () => {
|
|
909
|
+
it("converts metadata.component to ir.id and propagates tags", () => {
|
|
910
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
911
|
+
expect(ir.id).toBe("fixture-page");
|
|
912
|
+
expect(ir.metadata?.tags).toEqual(["fixture", "round-trip"]);
|
|
913
|
+
});
|
|
914
|
+
|
|
915
|
+
it("uses opts.docId override when supplied", () => {
|
|
916
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE, { docId: "override" });
|
|
917
|
+
expect(ir.id).toBe("override");
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
it("emits one IR state per legacy group, preserving id + name + description", () => {
|
|
921
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
922
|
+
expect(ir.states).toHaveLength(2);
|
|
923
|
+
expect(ir.states.map((s) => s.id)).toEqual(["alpha", "beta"]);
|
|
924
|
+
const alpha = ir.states.find((s) => s.id === "alpha")!;
|
|
925
|
+
expect(alpha.name).toBe("Alpha Group");
|
|
926
|
+
expect(alpha.description).toBe("First group for the round-trip test.");
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
it("sources state.assertions[].target.criteria from group.assertions[].target.criteria (inverted)", () => {
|
|
930
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
931
|
+
const alpha = ir.states.find((s) => s.id === "alpha")!;
|
|
932
|
+
expect(alpha.assertions).toHaveLength(2);
|
|
933
|
+
expect(criteriaOf(alpha.assertions[0]!)).toEqual({
|
|
934
|
+
role: "heading",
|
|
935
|
+
text: "Alpha",
|
|
936
|
+
});
|
|
937
|
+
expect(criteriaOf(alpha.assertions[1]!)).toEqual({ text: "Welcome" });
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
it("inverts dataAttributes -> attributes and accessibleName passthrough", () => {
|
|
941
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
942
|
+
const beta = ir.states.find((s) => s.id === "beta")!;
|
|
943
|
+
expect(criteriaOf(beta.assertions[0]!)).toEqual({
|
|
944
|
+
role: "dialog",
|
|
945
|
+
accessibleName: "Confirm",
|
|
946
|
+
});
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
it("lifts the first-found assertion.precondition to state.precondition", () => {
|
|
950
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
951
|
+
const alpha = ir.states.find((s) => s.id === "alpha")!;
|
|
952
|
+
expect(alpha.precondition).toBe("Page is loaded.");
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
it("derives initialState from the first SM state with isInitial:true", () => {
|
|
956
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
957
|
+
expect(ir.initialState).toBe("alpha");
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
it("sets state.isInitial from the SM state", () => {
|
|
961
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
962
|
+
expect(ir.states.find((s) => s.id === "alpha")!.isInitial).toBe(true);
|
|
963
|
+
expect(ir.states.find((s) => s.id === "beta")!.isInitial).toBe(false);
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
it("tags every state and transition with provenance.source = 'migrated'", () => {
|
|
967
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
968
|
+
for (const s of ir.states) {
|
|
969
|
+
expect(s.provenance?.source).toBe("migrated");
|
|
970
|
+
}
|
|
971
|
+
for (const t of ir.transitions) {
|
|
972
|
+
expect(t.provenance?.source).toBe("migrated");
|
|
973
|
+
}
|
|
974
|
+
expect(ir.provenance?.source).toBe("migrated");
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
it("collapses transitions in stateMachine.states[].transitions[] into one IRTransition", () => {
|
|
978
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
979
|
+
expect(ir.transitions).toHaveLength(2);
|
|
980
|
+
const ids = ir.transitions.map((t) => t.id).sort();
|
|
981
|
+
expect(ids).toEqual(["alpha-to-beta", "beta-to-alpha"]);
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
it("inverts process[] back into transition.actions with type/target/waitAfter", () => {
|
|
985
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
986
|
+
const t = ir.transitions.find((tt) => tt.id === "alpha-to-beta")!;
|
|
987
|
+
expect(t.actions).toHaveLength(1);
|
|
988
|
+
expect(t.actions[0]!.type).toBe("click");
|
|
989
|
+
expect(t.actions[0]!.target).toEqual({ role: "button", text: "Open" });
|
|
990
|
+
expect(t.actions[0]!.waitAfter).toEqual({ type: "idle", timeout: 1000 });
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
it("preserves modal-style empty deactivateStates as exitStates: []", () => {
|
|
994
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
995
|
+
const t = ir.transitions.find((tt) => tt.id === "alpha-to-beta")!;
|
|
996
|
+
expect(t.exitStates).toEqual([]);
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
it("handles a legacy spec with no stateMachine block (synthesizes states from groups only)", () => {
|
|
1000
|
+
const noSM = {
|
|
1001
|
+
...LEGACY_FIXTURE,
|
|
1002
|
+
stateMachine: { states: [] },
|
|
1003
|
+
} as LegacySpec;
|
|
1004
|
+
const ir = projectLegacyToIR(noSM);
|
|
1005
|
+
expect(ir.transitions).toEqual([]);
|
|
1006
|
+
expect(ir.states).toHaveLength(2);
|
|
1007
|
+
// No isInitial set when SM block is empty.
|
|
1008
|
+
expect(ir.initialState).toBeUndefined();
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
// ---------------------------------------------------------------------------
|
|
1013
|
+
// Round-trip tests
|
|
1014
|
+
// ---------------------------------------------------------------------------
|
|
1015
|
+
|
|
1016
|
+
describe("round-trip — IR -> legacy -> IR (forward then inverse)", () => {
|
|
1017
|
+
it("preserves the active-page IR fixture's group/state/transition counts", () => {
|
|
1018
|
+
const legacy = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
1019
|
+
const ir = projectLegacyToIR(legacy);
|
|
1020
|
+
expect(ir.states.length).toBe(ACTIVE_PAGE_FIXTURE.states.length);
|
|
1021
|
+
expect(ir.states.map((s) => s.id).sort()).toEqual(
|
|
1022
|
+
ACTIVE_PAGE_FIXTURE.states.map((s) => s.id).sort(),
|
|
1023
|
+
);
|
|
1024
|
+
expect(ir.transitions.length).toBe(ACTIVE_PAGE_FIXTURE.transitions.length);
|
|
1025
|
+
expect(ir.transitions.map((t) => t.id).sort()).toEqual(
|
|
1026
|
+
ACTIVE_PAGE_FIXTURE.transitions.map((t) => t.id).sort(),
|
|
1027
|
+
);
|
|
1028
|
+
});
|
|
1029
|
+
|
|
1030
|
+
it("preserves the active-page IR fixture's initialState", () => {
|
|
1031
|
+
const legacy = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
1032
|
+
const ir = projectLegacyToIR(legacy);
|
|
1033
|
+
expect(ir.initialState).toBe("idle");
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
it("preserves the active-page IR's tags", () => {
|
|
1037
|
+
const legacy = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
1038
|
+
const ir = projectLegacyToIR(legacy);
|
|
1039
|
+
expect(ir.metadata?.tags).toEqual(ACTIVE_PAGE_FIXTURE.metadata?.tags);
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
it("preserves transition fromStates merging when the same transition is emitted under multiple SM states", () => {
|
|
1043
|
+
// Forward emits one copy of each transition under each fromState. The
|
|
1044
|
+
// active-page fixture only has one fromState per transition, but check
|
|
1045
|
+
// the dedup logic doesn't drop transitions when fromStates is single.
|
|
1046
|
+
const legacy = projectIRToBundledPage(ACTIVE_PAGE_FIXTURE);
|
|
1047
|
+
const ir = projectLegacyToIR(legacy);
|
|
1048
|
+
const orig = ACTIVE_PAGE_FIXTURE.transitions.find(
|
|
1049
|
+
(t) => t.id === "idle-to-running",
|
|
1050
|
+
)!;
|
|
1051
|
+
const round = ir.transitions.find((t) => t.id === "idle-to-running")!;
|
|
1052
|
+
expect(round.fromStates).toEqual(orig.fromStates);
|
|
1053
|
+
expect(round.activateStates).toEqual(orig.activateStates);
|
|
1054
|
+
});
|
|
1055
|
+
});
|
|
1056
|
+
|
|
1057
|
+
describe("round-trip — legacy -> IR -> legacy (inverse then forward)", () => {
|
|
1058
|
+
it("preserves group count and group ids from a hand-authored legacy fixture", () => {
|
|
1059
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
1060
|
+
const back = projectIRToBundledPage(ir);
|
|
1061
|
+
expect(back.groups.length).toBe(LEGACY_FIXTURE.groups.length);
|
|
1062
|
+
expect(back.groups.map((g) => g.id)).toEqual(
|
|
1063
|
+
LEGACY_FIXTURE.groups.map((g) => g.id),
|
|
1064
|
+
);
|
|
1065
|
+
});
|
|
1066
|
+
|
|
1067
|
+
it("preserves total assertion count", () => {
|
|
1068
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
1069
|
+
const back = projectIRToBundledPage(ir);
|
|
1070
|
+
const orig = LEGACY_FIXTURE.groups.reduce(
|
|
1071
|
+
(n, g) => n + g.assertions.length,
|
|
1072
|
+
0,
|
|
1073
|
+
);
|
|
1074
|
+
const round = back.groups.reduce((n, g) => n + g.assertions.length, 0);
|
|
1075
|
+
expect(round).toBe(orig);
|
|
1076
|
+
});
|
|
1077
|
+
|
|
1078
|
+
it("preserves transition ids in the SM block", () => {
|
|
1079
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
1080
|
+
const back = projectIRToBundledPage(ir);
|
|
1081
|
+
const allTids: string[] = [];
|
|
1082
|
+
for (const s of back.stateMachine.states) {
|
|
1083
|
+
for (const t of s.transitions) {
|
|
1084
|
+
if (!allTids.includes(t.id)) allTids.push(t.id);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
const origTids: string[] = [];
|
|
1088
|
+
for (const s of LEGACY_FIXTURE.stateMachine.states) {
|
|
1089
|
+
for (const t of s.transitions) {
|
|
1090
|
+
if (!origTids.includes(t.id)) origTids.push(t.id);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
expect(allTids.sort()).toEqual(origTids.sort());
|
|
1094
|
+
});
|
|
1095
|
+
|
|
1096
|
+
it("preserves transition action types", () => {
|
|
1097
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
1098
|
+
const back = projectIRToBundledPage(ir);
|
|
1099
|
+
const alphaSm = back.stateMachine.states.find((s) => s.id === "alpha")!;
|
|
1100
|
+
const t = alphaSm.transitions.find((tt) => tt.id === "alpha-to-beta")!;
|
|
1101
|
+
expect(t.process).toHaveLength(1);
|
|
1102
|
+
expect(t.process[0]!.action).toBe("click");
|
|
1103
|
+
expect(t.process[0]!.target).toEqual({ role: "button", textContent: "Open" });
|
|
1104
|
+
});
|
|
1105
|
+
|
|
1106
|
+
it("preserves staysVisible on modal-style transitions (empty deactivateStates)", () => {
|
|
1107
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
1108
|
+
const back = projectIRToBundledPage(ir);
|
|
1109
|
+
const alphaSm = back.stateMachine.states.find((s) => s.id === "alpha")!;
|
|
1110
|
+
const t = alphaSm.transitions.find((tt) => tt.id === "alpha-to-beta")!;
|
|
1111
|
+
expect(t.staysVisible).toBe(true);
|
|
1112
|
+
expect(t.deactivateStates).toEqual([]);
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1115
|
+
it("preserves component + tags in metadata", () => {
|
|
1116
|
+
const ir = projectLegacyToIR(LEGACY_FIXTURE);
|
|
1117
|
+
const back = projectIRToBundledPage(ir);
|
|
1118
|
+
expect(back.metadata.component).toBe("fixture-page");
|
|
1119
|
+
expect(back.metadata.tags).toEqual(["fixture", "round-trip"]);
|
|
1120
|
+
});
|
|
1121
|
+
});
|