@praxisui/visual-builder 10.0.0-rc.43 → 10.0.0-rc.45
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/ai/component-registry.json +249 -14
- package/fesm2022/praxisui-visual-builder.mjs +2969 -22
- package/package.json +5 -5
- package/types/praxisui-visual-builder.d.ts +207 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Inject, ChangeDetectionStrategy, Component, EventEmitter, ViewChild, Output, Input, Optional, inject, ChangeDetectorRef, forwardRef, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Inject, ChangeDetectionStrategy, Component, EventEmitter, ViewChild, Output, Input, Optional, inject, ChangeDetectorRef, forwardRef, ENVIRONMENT_INITIALIZER, input, output, computed, signal, effect, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as i12$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@angular/forms';
|
|
@@ -28,7 +28,7 @@ import * as i9 from '@angular/material/tooltip';
|
|
|
28
28
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
29
29
|
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, interval, Observable, of, throwError, combineLatest } from 'rxjs';
|
|
30
30
|
import * as i1$2 from '@praxisui/core';
|
|
31
|
-
import { RULE_PROPERTY_SCHEMA, PraxisIconButtonComponent, providePraxisI18n, PraxisI18nService, ComponentMetadataRegistry, PraxisIconDirective } from '@praxisui/core';
|
|
31
|
+
import { RULE_PROPERTY_SCHEMA, PraxisIconButtonComponent, providePraxisI18n, PraxisI18nService, ComponentMetadataRegistry, PraxisIconDirective, translateDecisionInspector, CANONICAL_DECISION_STAGES, SURFACE_DRAWER_CONTENT_DATA, PraxisDecisionInspectorService, CANONICAL_DECISION_INSPECTOR_LENSES, isDecisionInspectorLensId, DECISION_INSPECTOR_I18N_CONFIG, PRAXIS_I18N_CONFIG, PRAXIS_DECISION_INSPECTOR_SURFACE, PRAXIS_DECISION_INSPECTOR_CONFIG } from '@praxisui/core';
|
|
32
32
|
import * as i3 from '@praxisui/ai';
|
|
33
33
|
import { AiRuleWizardDialogComponent } from '@praxisui/ai';
|
|
34
34
|
import { map, takeUntil, debounceTime, distinctUntilChanged, switchMap, catchError, startWith } from 'rxjs/operators';
|
|
@@ -381,6 +381,174 @@ class FieldSchemaService {
|
|
|
381
381
|
});
|
|
382
382
|
return schemas;
|
|
383
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Materializa `FieldSchema`s categorizados pelas 5 raízes ontológicas canônicas
|
|
386
|
+
* (`draft`, `current`, `<conceito>` 1-hop, `neighborhood`, `context`) diretamente a partir
|
|
387
|
+
* do catálogo semântico `/schemas/domain`.
|
|
388
|
+
*/
|
|
389
|
+
createFromSemanticDomainCatalog(catalog, options = {}) {
|
|
390
|
+
const schemas = {};
|
|
391
|
+
const nodes = catalog?.nodes ?? [];
|
|
392
|
+
if (!nodes.length) {
|
|
393
|
+
return schemas;
|
|
394
|
+
}
|
|
395
|
+
const targetResourceKey = String(options.resourceKey || catalog?.resourceKey || '').trim();
|
|
396
|
+
const includeDraft = options.includeDraft !== false;
|
|
397
|
+
const includeCurrent = options.includeCurrent !== false;
|
|
398
|
+
const includeReferencedFactPaths = options.includeReferencedFactPaths !== false;
|
|
399
|
+
const conceptNode = nodes.find(node => node.nodeType === 'concept' &&
|
|
400
|
+
(!targetResourceKey || node.nodeKey === targetResourceKey));
|
|
401
|
+
const conceptMeta = (conceptNode?.metadata ?? {});
|
|
402
|
+
const conceptFactRootMap = conceptMeta['conceptFactRootMap'] ?? {};
|
|
403
|
+
const fieldNodes = nodes.filter(node => node.nodeType === 'field' &&
|
|
404
|
+
node.metadata?.['fieldName'] &&
|
|
405
|
+
(!targetResourceKey ||
|
|
406
|
+
!node.metadata?.['resourceKey'] ||
|
|
407
|
+
node.metadata?.['resourceKey'] === targetResourceKey));
|
|
408
|
+
for (const node of fieldNodes) {
|
|
409
|
+
const meta = (node.metadata ?? {});
|
|
410
|
+
const fieldName = String(meta['fieldName']);
|
|
411
|
+
const baseSchema = this.convertJsonSchemaProperty(fieldName, {
|
|
412
|
+
title: node.label || fieldName,
|
|
413
|
+
type: meta['type'] ? String(meta['type']) : 'string',
|
|
414
|
+
format: meta['format'] ? String(meta['format']) : undefined,
|
|
415
|
+
description: node.description ?? undefined,
|
|
416
|
+
enum: Array.isArray(meta['enum']) ? meta['enum'] : undefined,
|
|
417
|
+
minimum: typeof meta['minimum'] === 'number' ? meta['minimum'] : undefined,
|
|
418
|
+
maximum: typeof meta['maximum'] === 'number' ? meta['maximum'] : undefined,
|
|
419
|
+
minLength: typeof meta['minLength'] === 'number' ? meta['minLength'] : undefined,
|
|
420
|
+
maxLength: typeof meta['maxLength'] === 'number' ? meta['maxLength'] : undefined,
|
|
421
|
+
pattern: typeof meta['pattern'] === 'string' ? meta['pattern'] : undefined,
|
|
422
|
+
}, Boolean(meta['required']));
|
|
423
|
+
if (includeDraft) {
|
|
424
|
+
const draftPath = `draft.${fieldName}`;
|
|
425
|
+
schemas[draftPath] = {
|
|
426
|
+
...baseSchema,
|
|
427
|
+
name: draftPath,
|
|
428
|
+
label: `${baseSchema.label} (draft)`,
|
|
429
|
+
origin: 'field',
|
|
430
|
+
uiConfig: {
|
|
431
|
+
category: 'draft',
|
|
432
|
+
priority: 100,
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
if (includeCurrent) {
|
|
437
|
+
const currentPath = `current.${fieldName}`;
|
|
438
|
+
schemas[currentPath] = {
|
|
439
|
+
...baseSchema,
|
|
440
|
+
name: currentPath,
|
|
441
|
+
label: `${baseSchema.label} (current)`,
|
|
442
|
+
origin: 'field',
|
|
443
|
+
required: false,
|
|
444
|
+
uiConfig: {
|
|
445
|
+
category: 'current',
|
|
446
|
+
priority: 80,
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (includeReferencedFactPaths) {
|
|
452
|
+
const factPaths = new Set();
|
|
453
|
+
const conceptFactPathsByRoot = conceptMeta['factPathsByRoot'] ?? {};
|
|
454
|
+
for (const paths of Object.values(conceptFactPathsByRoot)) {
|
|
455
|
+
if (Array.isArray(paths)) {
|
|
456
|
+
paths.forEach(path => factPaths.add(path));
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
const policyNodes = nodes.filter(node => node.nodeType === 'policy_hint' &&
|
|
460
|
+
node.metadata?.['policyKind'] === 'domain_rule_set' &&
|
|
461
|
+
(!targetResourceKey ||
|
|
462
|
+
!node.metadata?.['resourceKey'] ||
|
|
463
|
+
node.metadata?.['resourceKey'] === targetResourceKey));
|
|
464
|
+
for (const policy of policyNodes) {
|
|
465
|
+
const policyMeta = (policy.metadata ?? {});
|
|
466
|
+
const referenced = policyMeta['referencedFactPaths'];
|
|
467
|
+
if (Array.isArray(referenced)) {
|
|
468
|
+
referenced.forEach(path => factPaths.add(path));
|
|
469
|
+
}
|
|
470
|
+
const byRoot = policyMeta['factPathsByRoot'];
|
|
471
|
+
if (byRoot && typeof byRoot === 'object') {
|
|
472
|
+
for (const paths of Object.values(byRoot)) {
|
|
473
|
+
if (Array.isArray(paths)) {
|
|
474
|
+
paths.forEach(path => factPaths.add(path));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
for (const factPath of factPaths) {
|
|
480
|
+
if (!factPath || !factPath.includes('.') || schemas[factPath]) {
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
const dotIndex = factPath.indexOf('.');
|
|
484
|
+
const root = factPath.slice(0, dotIndex);
|
|
485
|
+
const attr = factPath.slice(dotIndex + 1);
|
|
486
|
+
if ((root === 'draft' && !includeDraft) || (root === 'current' && !includeCurrent)) {
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
const referencedConceptKey = conceptFactRootMap[root];
|
|
490
|
+
const description = referencedConceptKey
|
|
491
|
+
? `Fato ontológico da raiz 1-hop '${root}' (${referencedConceptKey}).`
|
|
492
|
+
: `Fato ontológico da raiz '${root}'.`;
|
|
493
|
+
schemas[factPath] = {
|
|
494
|
+
name: factPath,
|
|
495
|
+
label: `${attr} (${root})`,
|
|
496
|
+
origin: 'field',
|
|
497
|
+
type: this.inferOntologicalFactType(attr),
|
|
498
|
+
description,
|
|
499
|
+
uiConfig: {
|
|
500
|
+
category: root,
|
|
501
|
+
priority: root === 'neighborhood' ? 60 : root === 'context' ? 40 : 70,
|
|
502
|
+
},
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return schemas;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Converte o catálogo semântico `/schemas/domain` em `ContextVariable[]` prontos para o
|
|
510
|
+
* `FieldSchemaContext` do Visual Builder.
|
|
511
|
+
*/
|
|
512
|
+
createContextVariablesFromSemanticDomainCatalog(catalog, options = {}) {
|
|
513
|
+
const schemas = this.createFromSemanticDomainCatalog(catalog, options);
|
|
514
|
+
return Object.values(schemas).map(schema => ({
|
|
515
|
+
name: schema.name,
|
|
516
|
+
label: schema.label,
|
|
517
|
+
type: schema.type || FieldType.STRING,
|
|
518
|
+
description: schema.description,
|
|
519
|
+
}));
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Extrai as raízes ontológicas permitidas (`ontologicalFactRoots`) do conceito ou dos
|
|
523
|
+
* `policy_hint`s publicados no catálogo `/schemas/domain`.
|
|
524
|
+
*/
|
|
525
|
+
extractAllowedOntologicalRoots(catalog, resourceKey) {
|
|
526
|
+
const nodes = catalog?.nodes ?? [];
|
|
527
|
+
if (!nodes.length) {
|
|
528
|
+
return [];
|
|
529
|
+
}
|
|
530
|
+
const targetResourceKey = String(resourceKey || catalog?.resourceKey || '').trim();
|
|
531
|
+
const conceptNode = nodes.find(node => node.nodeType === 'concept' &&
|
|
532
|
+
(!targetResourceKey || node.nodeKey === targetResourceKey));
|
|
533
|
+
const conceptRoots = conceptNode?.metadata?.['ontologicalFactRoots'];
|
|
534
|
+
if (Array.isArray(conceptRoots) && conceptRoots.length > 0) {
|
|
535
|
+
return conceptRoots.map(String).filter(Boolean);
|
|
536
|
+
}
|
|
537
|
+
const roots = new Set();
|
|
538
|
+
for (const node of nodes) {
|
|
539
|
+
if (node.nodeType === 'policy_hint' &&
|
|
540
|
+
node.metadata?.['policyKind'] === 'domain_rule_set' &&
|
|
541
|
+
(!targetResourceKey ||
|
|
542
|
+
!node.metadata?.['resourceKey'] ||
|
|
543
|
+
node.metadata?.['resourceKey'] === targetResourceKey)) {
|
|
544
|
+
const available = node.metadata?.['availableRoots'];
|
|
545
|
+
if (Array.isArray(available)) {
|
|
546
|
+
available.forEach(r => roots.add(String(r)));
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return [...roots];
|
|
551
|
+
}
|
|
384
552
|
/**
|
|
385
553
|
* Get context variables
|
|
386
554
|
*/
|
|
@@ -557,6 +725,22 @@ class FieldSchemaService {
|
|
|
557
725
|
format.pattern = field.pattern;
|
|
558
726
|
return Object.keys(format).length > 0 ? format : undefined;
|
|
559
727
|
}
|
|
728
|
+
inferOntologicalFactType(attributePath) {
|
|
729
|
+
const leaf = attributePath.split('.').pop() || attributePath;
|
|
730
|
+
if (/^(is|has|can|allow|enabled|active)[A-Z_]/.test(leaf)) {
|
|
731
|
+
return FieldType.BOOLEAN;
|
|
732
|
+
}
|
|
733
|
+
if (/(Count|Days|Months|Years|Age|Limit|Qty|Quantidade|Ano|Mes|Id|Codigo)$/i.test(leaf)) {
|
|
734
|
+
return FieldType.INTEGER;
|
|
735
|
+
}
|
|
736
|
+
if (/(Value|Amount|Rate|Percent|Valor|Salario|Total|Saldo)$/i.test(leaf)) {
|
|
737
|
+
return FieldType.NUMBER;
|
|
738
|
+
}
|
|
739
|
+
if (/^(dt|data)[A-Z_]|Date$/i.test(leaf)) {
|
|
740
|
+
return FieldType.DATE;
|
|
741
|
+
}
|
|
742
|
+
return FieldType.STRING;
|
|
743
|
+
}
|
|
560
744
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FieldSchemaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
561
745
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FieldSchemaService, providedIn: 'root' });
|
|
562
746
|
}
|
|
@@ -1011,6 +1195,16 @@ class RuleBuilderService {
|
|
|
1011
1195
|
// Salva estado inicial para habilitar undo/redo desde a primeira ação
|
|
1012
1196
|
this.saveSnapshot('Estado inicial');
|
|
1013
1197
|
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Update the rule builder configuration without resetting the rule graph
|
|
1200
|
+
*/
|
|
1201
|
+
updateConfig(config) {
|
|
1202
|
+
this.config = {
|
|
1203
|
+
...(this.config || {}),
|
|
1204
|
+
...config,
|
|
1205
|
+
};
|
|
1206
|
+
this.validateRules();
|
|
1207
|
+
}
|
|
1014
1208
|
/**
|
|
1015
1209
|
* Get current state
|
|
1016
1210
|
*/
|
|
@@ -2449,6 +2643,9 @@ class RuleBuilderService {
|
|
|
2449
2643
|
if (!fieldName || typeof fieldName !== 'string') {
|
|
2450
2644
|
this.addValidationError(errors, `field-condition:field:${node.id}`, 'Escolha o campo da condicao.', 'error', node.id);
|
|
2451
2645
|
}
|
|
2646
|
+
else {
|
|
2647
|
+
this.validateOntologicalFieldPath(fieldName, node.id, `field-condition:ontological-root:${node.id}:fieldName`, errors);
|
|
2648
|
+
}
|
|
2452
2649
|
if (!operator) {
|
|
2453
2650
|
this.addValidationError(errors, `field-condition:operator:${node.id}`, 'Escolha um operador valido para a condicao.', 'error', node.id);
|
|
2454
2651
|
}
|
|
@@ -2457,6 +2654,9 @@ class RuleBuilderService {
|
|
|
2457
2654
|
this.addValidationError(errors, `field-condition:compare-field:${node.id}`, 'Escolha o campo usado na comparacao.', 'error', node.id);
|
|
2458
2655
|
return;
|
|
2459
2656
|
}
|
|
2657
|
+
if (cfg.valueType === 'field' && typeof cfg.compareToField === 'string') {
|
|
2658
|
+
this.validateOntologicalFieldPath(cfg.compareToField, node.id, `field-condition:ontological-root:${node.id}:compareToField`, errors);
|
|
2659
|
+
}
|
|
2460
2660
|
if (cfg.valueType === 'context') {
|
|
2461
2661
|
this.addValidationError(errors, `field-condition:context:${node.id}`, 'Comparação com variável de contexto ainda não possui serialização JSON Logic canônica.', 'error', node.id);
|
|
2462
2662
|
return;
|
|
@@ -2520,6 +2720,59 @@ class RuleBuilderService {
|
|
|
2520
2720
|
if (cfg.conditionNodeId && !this.getCurrentState().nodes[cfg.conditionNodeId]) {
|
|
2521
2721
|
this.addValidationError(errors, `property-rule:condition:${node.id}`, `Condicao "${cfg.conditionNodeId}" nao existe no grafo.`, 'error', node.id);
|
|
2522
2722
|
}
|
|
2723
|
+
if (cfg.condition && typeof cfg.condition === 'object') {
|
|
2724
|
+
const varPaths = this.extractConditionVarPaths(cfg.condition);
|
|
2725
|
+
varPaths.forEach((varPath, index) => {
|
|
2726
|
+
this.validateOntologicalFieldPath(varPath, node.id, `property-rule:ontological-root:${node.id}:${index}`, errors);
|
|
2727
|
+
});
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
validateOntologicalFieldPath(rawPath, nodeId, errorId, errors) {
|
|
2731
|
+
const allowedRoots = this.config?.allowedOntologicalRoots;
|
|
2732
|
+
if (!allowedRoots || allowedRoots.length === 0) {
|
|
2733
|
+
return;
|
|
2734
|
+
}
|
|
2735
|
+
const path = rawPath.trim();
|
|
2736
|
+
if (!path) {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
if (path === 'facts' || path.startsWith('facts.')) {
|
|
2740
|
+
this.addValidationError(errors, errorId, `Raiz legada "facts.*" não é permitida em "${path}". Utilize uma raiz ontológica permitida: ${allowedRoots.join(', ')}.`, 'error', nodeId);
|
|
2741
|
+
return;
|
|
2742
|
+
}
|
|
2743
|
+
const dotIndex = path.indexOf('.');
|
|
2744
|
+
if (dotIndex <= 0) {
|
|
2745
|
+
this.addValidationError(errors, errorId, `O caminho "${path}" não especifica raiz ontológica. Utilize uma raiz permitida: ${allowedRoots.join(', ')}.`, 'error', nodeId);
|
|
2746
|
+
return;
|
|
2747
|
+
}
|
|
2748
|
+
const root = path.slice(0, dotIndex);
|
|
2749
|
+
if (!allowedRoots.includes(root)) {
|
|
2750
|
+
this.addValidationError(errors, errorId, `Raiz ontológica "${root}" em "${path}" não está entre as raízes permitidas (${allowedRoots.join(', ')}).`, 'error', nodeId);
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
extractConditionVarPaths(expr) {
|
|
2754
|
+
const paths = [];
|
|
2755
|
+
const visit = (item) => {
|
|
2756
|
+
if (!item || typeof item !== 'object') {
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
if (Array.isArray(item)) {
|
|
2760
|
+
item.forEach(visit);
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
const record = item;
|
|
2764
|
+
if ('var' in record) {
|
|
2765
|
+
const varVal = record['var'];
|
|
2766
|
+
const varPath = Array.isArray(varVal) ? varVal[0] : varVal;
|
|
2767
|
+
if (typeof varPath === 'string' && varPath.trim()) {
|
|
2768
|
+
paths.push(varPath.trim());
|
|
2769
|
+
}
|
|
2770
|
+
return;
|
|
2771
|
+
}
|
|
2772
|
+
Object.values(record).forEach(visit);
|
|
2773
|
+
};
|
|
2774
|
+
visit(expr);
|
|
2775
|
+
return paths;
|
|
2523
2776
|
}
|
|
2524
2777
|
validateExpressionNode(node, errors) {
|
|
2525
2778
|
const expression = (node.config || {}).expression;
|
|
@@ -13880,9 +14133,16 @@ class RuleEditorComponent {
|
|
|
13880
14133
|
}
|
|
13881
14134
|
ngOnInit() {
|
|
13882
14135
|
this.setupSubscriptions();
|
|
14136
|
+
const resolvedFieldSchemas = this.resolveConfigFieldSchemas();
|
|
14137
|
+
if (Object.keys(resolvedFieldSchemas).length > 0 ||
|
|
14138
|
+
this.config?.fieldSchemas ||
|
|
14139
|
+
this.config?.domainCatalog) {
|
|
14140
|
+
this.fieldSchemaService.setFieldSchemas(resolvedFieldSchemas);
|
|
14141
|
+
}
|
|
13883
14142
|
this.ruleBuilderService.initialize({
|
|
13884
|
-
fieldSchemas:
|
|
14143
|
+
fieldSchemas: resolvedFieldSchemas,
|
|
13885
14144
|
targetSchemas: this.config?.targetSchemas,
|
|
14145
|
+
allowedOntologicalRoots: this.resolveAllowedOntologicalRoots(),
|
|
13886
14146
|
});
|
|
13887
14147
|
const imported = this.loadInitialRulesIfNeeded();
|
|
13888
14148
|
if (this.mode === 'condition') {
|
|
@@ -13895,13 +14155,21 @@ class RuleEditorComponent {
|
|
|
13895
14155
|
}
|
|
13896
14156
|
ngOnChanges(changes) {
|
|
13897
14157
|
if (changes['config'] && this.config) {
|
|
13898
|
-
|
|
13899
|
-
|
|
14158
|
+
const resolvedFieldSchemas = this.resolveConfigFieldSchemas();
|
|
14159
|
+
if (Object.keys(resolvedFieldSchemas).length > 0 || this.config.fieldSchemas || this.config.domainCatalog) {
|
|
14160
|
+
this.fieldSchemaService.setFieldSchemas(resolvedFieldSchemas);
|
|
13900
14161
|
}
|
|
13901
14162
|
this.targetSchemas = this.config.targetSchemas;
|
|
13902
14163
|
const schemaFromConfig = this.config.targetPropertySchemas ||
|
|
13903
14164
|
this.config.propertySchema;
|
|
13904
14165
|
this.propertySchemaMap = schemaFromConfig || RULE_PROPERTY_SCHEMA;
|
|
14166
|
+
if (this.initialized) {
|
|
14167
|
+
this.ruleBuilderService.updateConfig({
|
|
14168
|
+
fieldSchemas: resolvedFieldSchemas,
|
|
14169
|
+
targetSchemas: this.config.targetSchemas,
|
|
14170
|
+
allowedOntologicalRoots: this.resolveAllowedOntologicalRoots(),
|
|
14171
|
+
});
|
|
14172
|
+
}
|
|
13905
14173
|
}
|
|
13906
14174
|
if (this.initialized && changes['initialRules']) {
|
|
13907
14175
|
this.synchronizingInput = true;
|
|
@@ -13951,6 +14219,7 @@ class RuleEditorComponent {
|
|
|
13951
14219
|
fieldSchemas: this.fieldSchemas,
|
|
13952
14220
|
targetSchemas: this.targetSchemas,
|
|
13953
14221
|
propertySchema: this.propertySchemaMap,
|
|
14222
|
+
allowedOntologicalRoots: this.resolveAllowedOntologicalRoots(),
|
|
13954
14223
|
},
|
|
13955
14224
|
});
|
|
13956
14225
|
dialogRef.afterClosed().subscribe((result) => {
|
|
@@ -14228,8 +14497,33 @@ class RuleEditorComponent {
|
|
|
14228
14497
|
fieldSchemas: this.fieldSchemas,
|
|
14229
14498
|
targetSchemas: this.targetSchemas,
|
|
14230
14499
|
propertySchema: this.propertySchemaMap,
|
|
14500
|
+
allowedOntologicalRoots: this.resolveAllowedOntologicalRoots(),
|
|
14231
14501
|
});
|
|
14232
14502
|
}
|
|
14503
|
+
resolveConfigFieldSchemas() {
|
|
14504
|
+
const domainSchemas = this.config?.domainCatalog
|
|
14505
|
+
? this.fieldSchemaService.createFromSemanticDomainCatalog(this.config.domainCatalog, this.config.domainCatalogOptions)
|
|
14506
|
+
: {};
|
|
14507
|
+
if (this.config?.domainCatalog) {
|
|
14508
|
+
const contextVariables = this.fieldSchemaService.createContextVariablesFromSemanticDomainCatalog(this.config.domainCatalog, this.config.domainCatalogOptions);
|
|
14509
|
+
this.fieldSchemaService.setContext({ contextVariables });
|
|
14510
|
+
}
|
|
14511
|
+
const explicitSchemas = this.config?.fieldSchemas || {};
|
|
14512
|
+
return {
|
|
14513
|
+
...domainSchemas,
|
|
14514
|
+
...explicitSchemas,
|
|
14515
|
+
};
|
|
14516
|
+
}
|
|
14517
|
+
resolveAllowedOntologicalRoots() {
|
|
14518
|
+
if (this.config?.allowedOntologicalRoots?.length) {
|
|
14519
|
+
return this.config.allowedOntologicalRoots;
|
|
14520
|
+
}
|
|
14521
|
+
if (!this.config?.domainCatalog) {
|
|
14522
|
+
return undefined;
|
|
14523
|
+
}
|
|
14524
|
+
const roots = this.fieldSchemaService.extractAllowedOntologicalRoots(this.config.domainCatalog, this.config.domainCatalogOptions?.resourceKey);
|
|
14525
|
+
return roots.length > 0 ? roots : undefined;
|
|
14526
|
+
}
|
|
14233
14527
|
buildPropertyRuleLabel(config) {
|
|
14234
14528
|
const normalized = this.normalizeRuleConfig(config);
|
|
14235
14529
|
const targets = normalized.targets || [];
|
|
@@ -14904,6 +15198,32 @@ function providePraxisVisualBuilderMetadata() {
|
|
|
14904
15198
|
};
|
|
14905
15199
|
}
|
|
14906
15200
|
|
|
15201
|
+
const visualRuleNodeResolutionSpec = {
|
|
15202
|
+
strategy: 'array-match',
|
|
15203
|
+
paths: ['RuleBuilderState.nodes', 'nodes'],
|
|
15204
|
+
matchFields: ['id', 'nodeId'],
|
|
15205
|
+
inputMatchFields: ['nodeId', 'id'],
|
|
15206
|
+
allowIndex: false,
|
|
15207
|
+
};
|
|
15208
|
+
const visualRuleEdgeResolutionSpec = {
|
|
15209
|
+
strategy: 'array-match',
|
|
15210
|
+
paths: ['RuleBuilderState.nodes', 'nodes'],
|
|
15211
|
+
matchFields: ['id', 'nodeId'],
|
|
15212
|
+
inputMatchFields: ['sourceNodeId', 'targetNodeId'],
|
|
15213
|
+
allowIndex: false,
|
|
15214
|
+
};
|
|
15215
|
+
const visualContextVariableResolutionSpec = {
|
|
15216
|
+
strategy: 'array-match',
|
|
15217
|
+
paths: ['RuleBuilderConfig.contextVariables', 'config.contextVariables', 'contextVariables'],
|
|
15218
|
+
matchFields: ['name', 'scope'],
|
|
15219
|
+
inputMatchFields: ['name', 'scope'],
|
|
15220
|
+
allowIndex: false,
|
|
15221
|
+
};
|
|
15222
|
+
const visualDslDocumentResolutionSpec = {
|
|
15223
|
+
strategy: 'root-path',
|
|
15224
|
+
paths: ['RuleBuilderState.currentJSON', 'currentJSON', ''],
|
|
15225
|
+
allowIndex: false,
|
|
15226
|
+
};
|
|
14907
15227
|
const nodeAddSchema = {
|
|
14908
15228
|
type: 'object',
|
|
14909
15229
|
required: ['nodeId', 'nodeType'],
|
|
@@ -15047,12 +15367,12 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15047
15367
|
{ name: 'importRequested', type: 'ImportOptions', description: 'Emitted import request for JSON or form-config payloads.' },
|
|
15048
15368
|
],
|
|
15049
15369
|
editableTargets: [
|
|
15050
|
-
{ kind: 'node', resolver: 'rule-node-by-id', description: 'Visual rule graph node keyed by stable RuleNode.id.' },
|
|
15051
|
-
{ kind: 'edge', resolver: 'rule-node-edge-by-source-target', description: 'Parent-child or semantic graph edge between existing rule nodes.' },
|
|
15052
|
-
{ kind: 'variable', resolver: 'context-variable-by-name-scope', description: 'Context variable governed by ContextManagementService for contextual/template flows; visual field-condition references are not authorable until a canonical JSON Logic shape exists.' },
|
|
15053
|
-
{ kind: 'condition', resolver: 'json-logic-condition-by-node', description: 'JSON Logic condition attached to a node or represented by condition nodes.' },
|
|
15054
|
-
{ kind: 'effect', resolver: 'property-effect-by-node', description: 'Targeted property effect persisted as propertyRule/FormLayoutRule semantics.' },
|
|
15055
|
-
{ kind: 'dslDocument', resolver: 'rule-builder-json-logic-document', description: 'Serialized JSON Logic/form-config document produced from the visual model.' },
|
|
15370
|
+
{ kind: 'node', resolver: 'rule-node-by-id', resolutionSpec: visualRuleNodeResolutionSpec, description: 'Visual rule graph node keyed by stable RuleNode.id.' },
|
|
15371
|
+
{ kind: 'edge', resolver: 'rule-node-edge-by-source-target', resolutionSpec: visualRuleEdgeResolutionSpec, description: 'Parent-child or semantic graph edge between existing rule nodes.' },
|
|
15372
|
+
{ kind: 'variable', resolver: 'context-variable-by-name-scope', resolutionSpec: visualContextVariableResolutionSpec, description: 'Context variable governed by ContextManagementService for contextual/template flows; visual field-condition references are not authorable until a canonical JSON Logic shape exists.' },
|
|
15373
|
+
{ kind: 'condition', resolver: 'json-logic-condition-by-node', resolutionSpec: visualRuleNodeResolutionSpec, description: 'JSON Logic condition attached to a node or represented by condition nodes.' },
|
|
15374
|
+
{ kind: 'effect', resolver: 'property-effect-by-node', resolutionSpec: visualRuleNodeResolutionSpec, description: 'Targeted property effect persisted as propertyRule/FormLayoutRule semantics.' },
|
|
15375
|
+
{ kind: 'dslDocument', resolver: 'rule-builder-json-logic-document', resolutionSpec: visualDslDocumentResolutionSpec, description: 'Serialized JSON Logic/form-config document produced from the visual model.' },
|
|
15056
15376
|
],
|
|
15057
15377
|
operations: [
|
|
15058
15378
|
{
|
|
@@ -15060,7 +15380,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15060
15380
|
title: 'Add visual rule node',
|
|
15061
15381
|
scope: 'rules',
|
|
15062
15382
|
targetKind: 'node',
|
|
15063
|
-
target: { kind: 'node', resolver: 'rule-node-by-id', ambiguityPolicy: 'fail', required: true },
|
|
15383
|
+
target: { kind: 'node', resolver: 'rule-node-by-id', resolutionSpec: visualRuleNodeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15064
15384
|
inputSchema: nodeAddSchema,
|
|
15065
15385
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-node-add', handlerContract: {
|
|
15066
15386
|
reads: ['RuleBuilderState.nodes', 'RuleBuilderState.rootNodes', 'RuleNodeRegistryService', 'RuleBuilderService.addNode'],
|
|
@@ -15082,7 +15402,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15082
15402
|
title: 'Remove visual rule node',
|
|
15083
15403
|
scope: 'rules',
|
|
15084
15404
|
targetKind: 'node',
|
|
15085
|
-
target: { kind: 'node', resolver: 'rule-node-by-id', ambiguityPolicy: 'fail', required: true },
|
|
15405
|
+
target: { kind: 'node', resolver: 'rule-node-by-id', resolutionSpec: visualRuleNodeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15086
15406
|
inputSchema: nodeRemoveSchema,
|
|
15087
15407
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-node-remove', handlerContract: {
|
|
15088
15408
|
reads: ['RuleBuilderState.nodes', 'RuleBuilderState.rootNodes', 'RuleNodeRegistryService', 'RuleBuilderService.removeNode'],
|
|
@@ -15104,7 +15424,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15104
15424
|
title: 'Configure visual rule node',
|
|
15105
15425
|
scope: 'rules',
|
|
15106
15426
|
targetKind: 'node',
|
|
15107
|
-
target: { kind: 'node', resolver: 'rule-node-by-id', ambiguityPolicy: 'fail', required: true },
|
|
15427
|
+
target: { kind: 'node', resolver: 'rule-node-by-id', resolutionSpec: visualRuleNodeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15108
15428
|
inputSchema: nodeConfigureSchema,
|
|
15109
15429
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-node-configure', handlerContract: {
|
|
15110
15430
|
reads: ['RuleBuilderState.nodes', 'RuleBuilderService.updateNode', 'RuleNodeRegistryService'],
|
|
@@ -15126,7 +15446,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15126
15446
|
title: 'Connect visual graph edge',
|
|
15127
15447
|
scope: 'interaction',
|
|
15128
15448
|
targetKind: 'edge',
|
|
15129
|
-
target: { kind: 'edge', resolver: 'rule-node-edge-by-source-target', ambiguityPolicy: 'fail', required: true },
|
|
15449
|
+
target: { kind: 'edge', resolver: 'rule-node-edge-by-source-target', resolutionSpec: visualRuleEdgeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15130
15450
|
inputSchema: edgeConnectSchema,
|
|
15131
15451
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-edge-connect', handlerContract: {
|
|
15132
15452
|
reads: ['RuleBuilderState.nodes', 'RuleNodeRegistryService.validateIntegrity'],
|
|
@@ -15148,7 +15468,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15148
15468
|
title: 'Remove visual graph edge',
|
|
15149
15469
|
scope: 'interaction',
|
|
15150
15470
|
targetKind: 'edge',
|
|
15151
|
-
target: { kind: 'edge', resolver: 'rule-node-edge-by-source-target', ambiguityPolicy: 'fail', required: true },
|
|
15471
|
+
target: { kind: 'edge', resolver: 'rule-node-edge-by-source-target', resolutionSpec: visualRuleEdgeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15152
15472
|
inputSchema: edgeRemoveSchema,
|
|
15153
15473
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-edge-remove', handlerContract: {
|
|
15154
15474
|
reads: ['RuleBuilderState.nodes', 'RuleNodeRegistryService.validateIntegrity'],
|
|
@@ -15170,7 +15490,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15170
15490
|
title: 'Add context variable',
|
|
15171
15491
|
scope: 'dataBinding',
|
|
15172
15492
|
targetKind: 'variable',
|
|
15173
|
-
target: { kind: 'variable', resolver: 'context-variable-by-name-scope', ambiguityPolicy: 'fail', required: true },
|
|
15493
|
+
target: { kind: 'variable', resolver: 'context-variable-by-name-scope', resolutionSpec: visualContextVariableResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15174
15494
|
inputSchema: variableAddSchema,
|
|
15175
15495
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-variable-add', handlerContract: {
|
|
15176
15496
|
reads: ['RuleBuilderConfig.contextVariables', 'ContextManagementService'],
|
|
@@ -15192,7 +15512,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15192
15512
|
title: 'Set JSON Logic condition',
|
|
15193
15513
|
scope: 'rules',
|
|
15194
15514
|
targetKind: 'condition',
|
|
15195
|
-
target: { kind: 'condition', resolver: 'json-logic-condition-by-node', ambiguityPolicy: 'fail', required: true },
|
|
15515
|
+
target: { kind: 'condition', resolver: 'json-logic-condition-by-node', resolutionSpec: visualRuleNodeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15196
15516
|
inputSchema: conditionSetSchema,
|
|
15197
15517
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-condition-set', handlerContract: {
|
|
15198
15518
|
reads: ['RuleBuilderState.nodes', 'RuleBuilderService.loadFromConditionExpression', 'RuleBuilderService.buildConditionExpressionFromGraph'],
|
|
@@ -15202,7 +15522,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15202
15522
|
failureModes: ['node-not-found', 'json-logic-invalid', 'unsupported-operator', 'visual-parse-failed', 'dsl-round-trip-failed'],
|
|
15203
15523
|
description: 'Sets a canonical JSON Logic condition within the runtime-supported visual subset and proves it can parse back into the visual graph.',
|
|
15204
15524
|
} }],
|
|
15205
|
-
validators: ['json-logic-valid', 'condition-operators-supported', 'condition-fields-known', 'dsl-round-trip-stable'],
|
|
15525
|
+
validators: ['json-logic-valid', 'condition-operators-supported', 'condition-fields-known', 'condition-ontological-roots-valid', 'dsl-round-trip-stable'],
|
|
15206
15526
|
affectedPaths: ['RuleBuilderState.nodes[].config.condition', 'RuleBuilderState.currentJSON'],
|
|
15207
15527
|
submissionImpact: 'config-only',
|
|
15208
15528
|
preconditions: ['rule-builder-state-loaded'],
|
|
@@ -15214,7 +15534,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15214
15534
|
title: 'Set visual property effect',
|
|
15215
15535
|
scope: 'rules',
|
|
15216
15536
|
targetKind: 'effect',
|
|
15217
|
-
target: { kind: 'effect', resolver: 'property-effect-by-node', ambiguityPolicy: 'fail', required: true },
|
|
15537
|
+
target: { kind: 'effect', resolver: 'property-effect-by-node', resolutionSpec: visualRuleNodeResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
15218
15538
|
inputSchema: effectSetSchema,
|
|
15219
15539
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-effect-set', handlerContract: {
|
|
15220
15540
|
reads: ['RuleBuilderState.nodes', 'RuleBuilderConfig.targetPropertySchemas', 'RULE_PROPERTY_SCHEMA', 'RuleBuilderService.export'],
|
|
@@ -15236,7 +15556,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15236
15556
|
title: 'Validate visual and DSL round trip',
|
|
15237
15557
|
scope: 'runtimeCoverage',
|
|
15238
15558
|
targetKind: 'dslDocument',
|
|
15239
|
-
target: { kind: 'dslDocument', resolver: 'rule-builder-json-logic-document', ambiguityPolicy: 'fail', required: false },
|
|
15559
|
+
target: { kind: 'dslDocument', resolver: 'rule-builder-json-logic-document', resolutionSpec: visualDslDocumentResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
15240
15560
|
inputSchema: dslRoundTripValidateSchema,
|
|
15241
15561
|
effects: [{ kind: 'compile-domain-patch', handler: 'visual-builder-dsl-round-trip-validate', handlerContract: {
|
|
15242
15562
|
reads: ['RuleBuilderState', 'RuleBuilderService.export', 'RuleBuilderService.import', 'RuleBuilderService.buildConditionExpressionFromGraph', 'RuleNodeRegistryService.validateIntegrity'],
|
|
@@ -15271,6 +15591,7 @@ const PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST = {
|
|
|
15271
15591
|
{ validatorId: 'json-logic-valid', level: 'error', code: 'VISUAL_BUILDER_JSON_LOGIC_VALID', description: 'Conditions must be valid JSON Logic objects, not JavaScript or legacy textual DSL.' },
|
|
15272
15592
|
{ validatorId: 'condition-operators-supported', level: 'error', code: 'VISUAL_BUILDER_CONDITION_OPERATORS_SUPPORTED', description: 'Condition operators must be supported by visual parsing and export.' },
|
|
15273
15593
|
{ validatorId: 'condition-fields-known', level: 'error', code: 'VISUAL_BUILDER_CONDITION_FIELDS_KNOWN', description: 'Condition field references must resolve to configured field schemas; field-to-field comparisons use JSON Logic var operands.' },
|
|
15594
|
+
{ validatorId: 'condition-ontological-roots-valid', level: 'error', code: 'VISUAL_BUILDER_ONTOLOGICAL_ROOTS_VALID', description: 'When ontologicalFactTree.availableRoots is configured, condition var paths must start with an allowed ontological root (draft, current, <concept>, neighborhood, context) and never use legacy facts.*.' },
|
|
15274
15595
|
{ validatorId: 'effect-targets-exist', level: 'error', code: 'VISUAL_BUILDER_EFFECT_TARGETS_EXIST', description: 'Effect targets must exist in configured target schemas.' },
|
|
15275
15596
|
{ validatorId: 'effect-properties-governed', level: 'error', code: 'VISUAL_BUILDER_EFFECT_PROPERTIES_GOVERNED', description: 'Effect properties must be allowed for the target type.' },
|
|
15276
15597
|
{ validatorId: 'effect-values-valid', level: 'error', code: 'VISUAL_BUILDER_EFFECT_VALUES_VALID', description: 'Effect property values must satisfy target property schema types.' },
|
|
@@ -16465,6 +16786,7 @@ class RuleValidationService {
|
|
|
16465
16786
|
issues.push(...this.validateDependencies(rootNode, context));
|
|
16466
16787
|
issues.push(...this.validateBusinessLogic(rootNode, context));
|
|
16467
16788
|
issues.push(...this.validatePerformance(rootNode, context));
|
|
16789
|
+
issues.push(...this.validateOntologicalSemantics(allNodes, context));
|
|
16468
16790
|
// Run custom validation rules
|
|
16469
16791
|
if (validationConfig.customRules) {
|
|
16470
16792
|
for (const rule of validationConfig.customRules) {
|
|
@@ -16718,6 +17040,74 @@ class RuleValidationService {
|
|
|
16718
17040
|
}
|
|
16719
17041
|
return issues;
|
|
16720
17042
|
}
|
|
17043
|
+
validateOntologicalSemantics(allNodes, context) {
|
|
17044
|
+
const allowedRoots = Array.isArray(context.config.allowedOntologicalRoots)
|
|
17045
|
+
? context.config.allowedOntologicalRoots.filter(Boolean)
|
|
17046
|
+
: [];
|
|
17047
|
+
if (allowedRoots.length === 0) {
|
|
17048
|
+
return [];
|
|
17049
|
+
}
|
|
17050
|
+
const issues = [];
|
|
17051
|
+
for (const node of allNodes.values()) {
|
|
17052
|
+
const config = (node.config ?? {});
|
|
17053
|
+
const candidatePaths = [];
|
|
17054
|
+
if (typeof config['fieldName'] === 'string' && config['fieldName'].trim()) {
|
|
17055
|
+
candidatePaths.push(config['fieldName'].trim());
|
|
17056
|
+
}
|
|
17057
|
+
if (typeof config['sourceField'] === 'string' && config['sourceField'].trim()) {
|
|
17058
|
+
candidatePaths.push(config['sourceField'].trim());
|
|
17059
|
+
}
|
|
17060
|
+
if (typeof config['targetField'] === 'string' && config['targetField'].trim()) {
|
|
17061
|
+
candidatePaths.push(config['targetField'].trim());
|
|
17062
|
+
}
|
|
17063
|
+
if (config['valueType'] === 'field' &&
|
|
17064
|
+
typeof config['compareToField'] === 'string' &&
|
|
17065
|
+
config['compareToField'].trim()) {
|
|
17066
|
+
candidatePaths.push(config['compareToField'].trim());
|
|
17067
|
+
}
|
|
17068
|
+
if (config['valueType'] === 'field' &&
|
|
17069
|
+
typeof config['value'] === 'string' &&
|
|
17070
|
+
config['value'].trim()) {
|
|
17071
|
+
candidatePaths.push(config['value'].trim());
|
|
17072
|
+
}
|
|
17073
|
+
if (config['condition'] && typeof config['condition'] === 'object') {
|
|
17074
|
+
const extractConditionVars = (item) => {
|
|
17075
|
+
if (!item || typeof item !== 'object')
|
|
17076
|
+
return;
|
|
17077
|
+
if (Array.isArray(item)) {
|
|
17078
|
+
item.forEach(extractConditionVars);
|
|
17079
|
+
return;
|
|
17080
|
+
}
|
|
17081
|
+
const rec = item;
|
|
17082
|
+
if ('var' in rec) {
|
|
17083
|
+
const rawVar = rec['var'];
|
|
17084
|
+
const varPath = Array.isArray(rawVar) ? rawVar[0] : rawVar;
|
|
17085
|
+
if (typeof varPath === 'string' && varPath.trim()) {
|
|
17086
|
+
candidatePaths.push(varPath.trim());
|
|
17087
|
+
}
|
|
17088
|
+
return;
|
|
17089
|
+
}
|
|
17090
|
+
Object.values(rec).forEach(extractConditionVars);
|
|
17091
|
+
};
|
|
17092
|
+
extractConditionVars(config['condition']);
|
|
17093
|
+
}
|
|
17094
|
+
for (const path of new Set(candidatePaths)) {
|
|
17095
|
+
const root = path.split('.')[0];
|
|
17096
|
+
if (path === 'facts' || path.startsWith('facts.') || !path.includes('.') || !allowedRoots.includes(root)) {
|
|
17097
|
+
issues.push({
|
|
17098
|
+
id: `invalid-ontological-root-${node.id}-${path}`,
|
|
17099
|
+
severity: ValidationSeverity.ERROR,
|
|
17100
|
+
category: ValidationCategory.SEMANTIC,
|
|
17101
|
+
message: `Raiz ontológica inválida '${root}' em '${path}' (permitidas: ${allowedRoots.join(', ')})`,
|
|
17102
|
+
nodeId: node.id,
|
|
17103
|
+
suggestion: `Use um caminho prefixado por uma raiz ontológica permitida (${allowedRoots.map(r => r + '.*').join(', ')})`,
|
|
17104
|
+
context: { fieldPath: path, allowedOntologicalRoots: allowedRoots },
|
|
17105
|
+
});
|
|
17106
|
+
}
|
|
17107
|
+
}
|
|
17108
|
+
}
|
|
17109
|
+
return issues;
|
|
17110
|
+
}
|
|
16721
17111
|
validateBooleanGroup(node, context) {
|
|
16722
17112
|
const issues = [];
|
|
16723
17113
|
const config = node.config;
|
|
@@ -22529,6 +22919,2563 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
22529
22919
|
type: Output
|
|
22530
22920
|
}] } });
|
|
22531
22921
|
|
|
22922
|
+
class PraxisRuleDecisionDagComponent {
|
|
22923
|
+
i18n = inject(PraxisI18nService, { optional: true });
|
|
22924
|
+
slots = input([], ...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
|
|
22925
|
+
bindings = input([], ...(ngDevMode ? [{ debugName: "bindings" }] : /* istanbul ignore next */ []));
|
|
22926
|
+
selectedSlotKey = input(null, ...(ngDevMode ? [{ debugName: "selectedSlotKey" }] : /* istanbul ignore next */ []));
|
|
22927
|
+
violatedSlotKeys = input([], ...(ngDevMode ? [{ debugName: "violatedSlotKeys" }] : /* istanbul ignore next */ []));
|
|
22928
|
+
slotSelected = output();
|
|
22929
|
+
dagAriaLabel = computed(() => translateDecisionInspector(this.i18n, 'dag.ariaLabel'), ...(ngDevMode ? [{ debugName: "dagAriaLabel" }] : /* istanbul ignore next */ []));
|
|
22930
|
+
emptyStageLabel = computed(() => translateDecisionInspector(this.i18n, 'dag.emptyStage'), ...(ngDevMode ? [{ debugName: "emptyStageLabel" }] : /* istanbul ignore next */ []));
|
|
22931
|
+
violatedBadgeLabel = computed(() => translateDecisionInspector(this.i18n, 'dag.violatedBadge'), ...(ngDevMode ? [{ debugName: "violatedBadgeLabel" }] : /* istanbul ignore next */ []));
|
|
22932
|
+
stageColumns = computed(() => {
|
|
22933
|
+
const slotList = this.slots() ?? [];
|
|
22934
|
+
const bindingList = this.bindings() ?? [];
|
|
22935
|
+
const selected = this.selectedSlotKey();
|
|
22936
|
+
const violatedSet = new Set((this.violatedSlotKeys() ?? []).map((key) => String(key || '').trim()).filter(Boolean));
|
|
22937
|
+
const bindingsCountBySlot = new Map();
|
|
22938
|
+
for (const binding of bindingList) {
|
|
22939
|
+
if (binding.enabled === false) {
|
|
22940
|
+
continue;
|
|
22941
|
+
}
|
|
22942
|
+
const key = String(binding.slotKey || '').trim();
|
|
22943
|
+
if (key) {
|
|
22944
|
+
bindingsCountBySlot.set(key, (bindingsCountBySlot.get(key) ?? 0) + 1);
|
|
22945
|
+
}
|
|
22946
|
+
}
|
|
22947
|
+
return CANONICAL_DECISION_STAGES.map((stage) => {
|
|
22948
|
+
const stageSlots = slotList
|
|
22949
|
+
.filter((slot) => String(slot.stage || 'DOMAIN_DECISION').trim() === stage.id)
|
|
22950
|
+
.map((slot) => {
|
|
22951
|
+
const policyRaw = String(slot.overridePolicy || 'FORBIDDEN').trim().toUpperCase();
|
|
22952
|
+
const isViolated = violatedSet.has(slot.slotKey);
|
|
22953
|
+
return {
|
|
22954
|
+
slot,
|
|
22955
|
+
bindingsCount: bindingsCountBySlot.get(slot.slotKey) ?? 0,
|
|
22956
|
+
isViolated,
|
|
22957
|
+
isSelected: selected === slot.slotKey,
|
|
22958
|
+
policyLabel: translateDecisionInspector(this.i18n, `policy.${policyRaw}`),
|
|
22959
|
+
policyTone: this.resolvePolicyTone(policyRaw),
|
|
22960
|
+
};
|
|
22961
|
+
});
|
|
22962
|
+
return {
|
|
22963
|
+
stage,
|
|
22964
|
+
title: translateDecisionInspector(this.i18n, stage.titleKey),
|
|
22965
|
+
subtitle: translateDecisionInspector(this.i18n, stage.subtitleKey),
|
|
22966
|
+
slots: stageSlots,
|
|
22967
|
+
hasViolation: stageSlots.some((entry) => entry.isViolated),
|
|
22968
|
+
};
|
|
22969
|
+
});
|
|
22970
|
+
}, ...(ngDevMode ? [{ debugName: "stageColumns" }] : /* istanbul ignore next */ []));
|
|
22971
|
+
formatBindingsCount(count) {
|
|
22972
|
+
if (count === 1) {
|
|
22973
|
+
return translateDecisionInspector(this.i18n, 'dag.singleBinding');
|
|
22974
|
+
}
|
|
22975
|
+
return translateDecisionInspector(this.i18n, 'dag.bindingsCount', { count });
|
|
22976
|
+
}
|
|
22977
|
+
resolvePolicyTone(policy) {
|
|
22978
|
+
switch (policy) {
|
|
22979
|
+
case 'PARAMETERIZABLE':
|
|
22980
|
+
return 'parameterizable';
|
|
22981
|
+
case 'RESTRICT_ONLY':
|
|
22982
|
+
case 'EXTENSIBLE':
|
|
22983
|
+
return 'extensible';
|
|
22984
|
+
case 'REPLACEABLE':
|
|
22985
|
+
return 'replaceable';
|
|
22986
|
+
case 'FORBIDDEN':
|
|
22987
|
+
case 'LOCKED':
|
|
22988
|
+
default:
|
|
22989
|
+
return 'locked';
|
|
22990
|
+
}
|
|
22991
|
+
}
|
|
22992
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisRuleDecisionDagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22993
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisRuleDecisionDagComponent, isStandalone: true, selector: "praxis-rule-decision-dag", inputs: { slots: { classPropertyName: "slots", publicName: "slots", isSignal: true, isRequired: false, transformFunction: null }, bindings: { classPropertyName: "bindings", publicName: "bindings", isSignal: true, isRequired: false, transformFunction: null }, selectedSlotKey: { classPropertyName: "selectedSlotKey", publicName: "selectedSlotKey", isSignal: true, isRequired: false, transformFunction: null }, violatedSlotKeys: { classPropertyName: "violatedSlotKeys", publicName: "violatedSlotKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { slotSelected: "slotSelected" }, ngImport: i0, template: `
|
|
22994
|
+
<div
|
|
22995
|
+
class="praxis-decision-dag"
|
|
22996
|
+
role="region"
|
|
22997
|
+
[attr.aria-label]="dagAriaLabel()"
|
|
22998
|
+
data-testid="praxis-rule-decision-dag"
|
|
22999
|
+
>
|
|
23000
|
+
<div class="praxis-decision-dag__spine" aria-hidden="true"></div>
|
|
23001
|
+
<div class="praxis-decision-dag__grid">
|
|
23002
|
+
@for (column of stageColumns(); track column.stage.id) {
|
|
23003
|
+
<section
|
|
23004
|
+
class="praxis-decision-dag__stage"
|
|
23005
|
+
[class.is-violated]="column.hasViolation"
|
|
23006
|
+
[class.is-populated]="column.slots.length > 0"
|
|
23007
|
+
[attr.data-stage-id]="column.stage.id"
|
|
23008
|
+
>
|
|
23009
|
+
<header class="praxis-decision-dag__stage-header">
|
|
23010
|
+
<div class="praxis-decision-dag__stage-topline">
|
|
23011
|
+
<span class="praxis-decision-dag__stage-code">
|
|
23012
|
+
{{ column.stage.order }} · {{ column.stage.shortCode }}
|
|
23013
|
+
</span>
|
|
23014
|
+
<span class="praxis-decision-dag__stage-count">
|
|
23015
|
+
{{ column.slots.length }}
|
|
23016
|
+
</span>
|
|
23017
|
+
</div>
|
|
23018
|
+
<h4 class="praxis-decision-dag__stage-title">{{ column.title }}</h4>
|
|
23019
|
+
<p class="praxis-decision-dag__stage-subtitle">{{ column.subtitle }}</p>
|
|
23020
|
+
</header>
|
|
23021
|
+
|
|
23022
|
+
<div class="praxis-decision-dag__slots">
|
|
23023
|
+
@if (column.slots.length === 0) {
|
|
23024
|
+
<div class="praxis-decision-dag__empty">
|
|
23025
|
+
{{ emptyStageLabel() }}
|
|
23026
|
+
</div>
|
|
23027
|
+
} @else {
|
|
23028
|
+
@for (item of column.slots; track item.slot.slotKey) {
|
|
23029
|
+
<button
|
|
23030
|
+
type="button"
|
|
23031
|
+
class="praxis-decision-dag__slot-card"
|
|
23032
|
+
[class.is-selected]="item.isSelected"
|
|
23033
|
+
[class.is-violated]="item.isViolated"
|
|
23034
|
+
[attr.aria-pressed]="item.isSelected"
|
|
23035
|
+
[attr.data-slot-key]="item.slot.slotKey"
|
|
23036
|
+
(click)="slotSelected.emit(item.slot.slotKey)"
|
|
23037
|
+
>
|
|
23038
|
+
<div class="praxis-decision-dag__slot-top">
|
|
23039
|
+
<span
|
|
23040
|
+
class="praxis-decision-dag__policy-pill"
|
|
23041
|
+
[attr.data-policy]="item.policyTone"
|
|
23042
|
+
>
|
|
23043
|
+
{{ item.policyLabel }}
|
|
23044
|
+
</span>
|
|
23045
|
+
@if (item.isViolated) {
|
|
23046
|
+
<span class="praxis-decision-dag__violated-pill">
|
|
23047
|
+
{{ violatedBadgeLabel() }}
|
|
23048
|
+
</span>
|
|
23049
|
+
}
|
|
23050
|
+
</div>
|
|
23051
|
+
<span class="praxis-decision-dag__slot-key">
|
|
23052
|
+
{{ item.slot.slotKey }}
|
|
23053
|
+
</span>
|
|
23054
|
+
<span class="praxis-decision-dag__slot-meta">
|
|
23055
|
+
{{ formatBindingsCount(item.bindingsCount) }}
|
|
23056
|
+
</span>
|
|
23057
|
+
</button>
|
|
23058
|
+
}
|
|
23059
|
+
}
|
|
23060
|
+
</div>
|
|
23061
|
+
</section>
|
|
23062
|
+
}
|
|
23063
|
+
</div>
|
|
23064
|
+
</div>
|
|
23065
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.praxis-decision-dag{position:relative;width:100%;overflow-x:auto;padding-bottom:4px}.praxis-decision-dag__spine{position:absolute;top:26px;left:24px;right:24px;height:2px;background:linear-gradient(90deg,color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 45%,transparent),color-mix(in srgb,var(--md-sys-color-tertiary, #0891b2) 38%,transparent));pointer-events:none;z-index:0}.praxis-decision-dag__grid{position:relative;z-index:1;display:grid;grid-template-columns:repeat(5,minmax(168px,1fr));gap:10px;min-width:880px}.praxis-decision-dag__stage{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:12px;background:color-mix(in srgb,var(--md-sys-color-surface-container-low, #1e293b) 82%,transparent);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #475569) 62%,transparent);transition:border-color .16s ease,background-color .16s ease}.praxis-decision-dag__stage.is-populated{background:var(--md-sys-color-surface-container, rgba(30, 41, 59, .06));border-color:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 28%,var(--md-sys-color-outline-variant, #475569))}.praxis-decision-dag__stage.is-violated{border-color:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 62%,transparent);background:color-mix(in srgb,var(--md-sys-color-error-container, rgba(220, 38, 38, .14)) 32%,var(--md-sys-color-surface-container, transparent))}.praxis-decision-dag__stage-header{display:flex;flex-direction:column;gap:3px}.praxis-decision-dag__stage-topline{display:flex;align-items:center;justify-content:space-between;gap:6px}.praxis-decision-dag__stage-code{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-dag__stage-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--md-sys-color-on-surface-variant, #64748b);background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 8%,transparent)}.praxis-decision-dag__stage-title{margin:0;font-size:12.5px;font-weight:600;line-height:1.3;color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-dag__stage-subtitle{margin:0;font-size:11px;line-height:1.35;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-dag__slots{display:flex;flex-direction:column;gap:8px;flex:1 1 auto}.praxis-decision-dag__empty{display:flex;align-items:center;justify-content:center;min-height:54px;padding:8px;border-radius:8px;border:1px dashed color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent);font-size:11px;text-align:center;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-dag__slot-card{appearance:none;width:100%;text-align:left;display:flex;flex-direction:column;gap:5px;padding:9px 10px;border-radius:10px;cursor:pointer;font-family:inherit;background:var(--md-sys-color-surface-container-high, rgba(148, 163, 184, .1));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 68%,transparent);color:var(--md-sys-color-on-surface, inherit);transition:transform .12s ease,border-color .14s ease,background-color .14s ease}.praxis-decision-dag__slot-card:hover{border-color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-dag__slot-card:focus-visible{outline:2px solid var(--md-sys-color-primary, #4f46e5);outline-offset:2px}.praxis-decision-dag__slot-card.is-selected{border-color:var(--md-sys-color-primary, #4f46e5);background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 13%,var(--md-sys-color-surface-container-high, transparent))}.praxis-decision-dag__slot-card.is-violated{border-color:var(--md-sys-color-error, #dc2626);background:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 12%,var(--md-sys-color-surface-container-high, transparent))}.praxis-decision-dag__slot-top{display:flex;align-items:center;justify-content:space-between;gap:4px;flex-wrap:wrap}.praxis-decision-dag__policy-pill{display:inline-flex;align-items:center;padding:2px 6px;border-radius:999px;font-size:9.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;background:color-mix(in srgb,var(--md-sys-color-secondary, #475569) 16%,transparent);color:var(--md-sys-color-on-surface-variant, inherit)}.praxis-decision-dag__policy-pill[data-policy=parameterizable]{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 16%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-dag__policy-pill[data-policy=extensible],.praxis-decision-dag__policy-pill[data-policy=replaceable]{background:color-mix(in srgb,var(--md-sys-color-tertiary, #0891b2) 18%,transparent);color:var(--md-sys-color-tertiary, #0891b2)}.praxis-decision-dag__violated-pill{display:inline-flex;align-items:center;padding:2px 6px;border-radius:999px;font-size:9.5px;font-weight:700;text-transform:uppercase;background:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 18%,transparent);color:var(--md-sys-color-error, #dc2626)}.praxis-decision-dag__slot-key{font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:11.5px;font-weight:600;word-break:break-word;line-height:1.3}.praxis-decision-dag__slot-meta{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
23066
|
+
}
|
|
23067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisRuleDecisionDagComponent, decorators: [{
|
|
23068
|
+
type: Component,
|
|
23069
|
+
args: [{ selector: 'praxis-rule-decision-dag', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
23070
|
+
<div
|
|
23071
|
+
class="praxis-decision-dag"
|
|
23072
|
+
role="region"
|
|
23073
|
+
[attr.aria-label]="dagAriaLabel()"
|
|
23074
|
+
data-testid="praxis-rule-decision-dag"
|
|
23075
|
+
>
|
|
23076
|
+
<div class="praxis-decision-dag__spine" aria-hidden="true"></div>
|
|
23077
|
+
<div class="praxis-decision-dag__grid">
|
|
23078
|
+
@for (column of stageColumns(); track column.stage.id) {
|
|
23079
|
+
<section
|
|
23080
|
+
class="praxis-decision-dag__stage"
|
|
23081
|
+
[class.is-violated]="column.hasViolation"
|
|
23082
|
+
[class.is-populated]="column.slots.length > 0"
|
|
23083
|
+
[attr.data-stage-id]="column.stage.id"
|
|
23084
|
+
>
|
|
23085
|
+
<header class="praxis-decision-dag__stage-header">
|
|
23086
|
+
<div class="praxis-decision-dag__stage-topline">
|
|
23087
|
+
<span class="praxis-decision-dag__stage-code">
|
|
23088
|
+
{{ column.stage.order }} · {{ column.stage.shortCode }}
|
|
23089
|
+
</span>
|
|
23090
|
+
<span class="praxis-decision-dag__stage-count">
|
|
23091
|
+
{{ column.slots.length }}
|
|
23092
|
+
</span>
|
|
23093
|
+
</div>
|
|
23094
|
+
<h4 class="praxis-decision-dag__stage-title">{{ column.title }}</h4>
|
|
23095
|
+
<p class="praxis-decision-dag__stage-subtitle">{{ column.subtitle }}</p>
|
|
23096
|
+
</header>
|
|
23097
|
+
|
|
23098
|
+
<div class="praxis-decision-dag__slots">
|
|
23099
|
+
@if (column.slots.length === 0) {
|
|
23100
|
+
<div class="praxis-decision-dag__empty">
|
|
23101
|
+
{{ emptyStageLabel() }}
|
|
23102
|
+
</div>
|
|
23103
|
+
} @else {
|
|
23104
|
+
@for (item of column.slots; track item.slot.slotKey) {
|
|
23105
|
+
<button
|
|
23106
|
+
type="button"
|
|
23107
|
+
class="praxis-decision-dag__slot-card"
|
|
23108
|
+
[class.is-selected]="item.isSelected"
|
|
23109
|
+
[class.is-violated]="item.isViolated"
|
|
23110
|
+
[attr.aria-pressed]="item.isSelected"
|
|
23111
|
+
[attr.data-slot-key]="item.slot.slotKey"
|
|
23112
|
+
(click)="slotSelected.emit(item.slot.slotKey)"
|
|
23113
|
+
>
|
|
23114
|
+
<div class="praxis-decision-dag__slot-top">
|
|
23115
|
+
<span
|
|
23116
|
+
class="praxis-decision-dag__policy-pill"
|
|
23117
|
+
[attr.data-policy]="item.policyTone"
|
|
23118
|
+
>
|
|
23119
|
+
{{ item.policyLabel }}
|
|
23120
|
+
</span>
|
|
23121
|
+
@if (item.isViolated) {
|
|
23122
|
+
<span class="praxis-decision-dag__violated-pill">
|
|
23123
|
+
{{ violatedBadgeLabel() }}
|
|
23124
|
+
</span>
|
|
23125
|
+
}
|
|
23126
|
+
</div>
|
|
23127
|
+
<span class="praxis-decision-dag__slot-key">
|
|
23128
|
+
{{ item.slot.slotKey }}
|
|
23129
|
+
</span>
|
|
23130
|
+
<span class="praxis-decision-dag__slot-meta">
|
|
23131
|
+
{{ formatBindingsCount(item.bindingsCount) }}
|
|
23132
|
+
</span>
|
|
23133
|
+
</button>
|
|
23134
|
+
}
|
|
23135
|
+
}
|
|
23136
|
+
</div>
|
|
23137
|
+
</section>
|
|
23138
|
+
}
|
|
23139
|
+
</div>
|
|
23140
|
+
</div>
|
|
23141
|
+
`, styles: [":host{display:block;width:100%}.praxis-decision-dag{position:relative;width:100%;overflow-x:auto;padding-bottom:4px}.praxis-decision-dag__spine{position:absolute;top:26px;left:24px;right:24px;height:2px;background:linear-gradient(90deg,color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 45%,transparent),color-mix(in srgb,var(--md-sys-color-tertiary, #0891b2) 38%,transparent));pointer-events:none;z-index:0}.praxis-decision-dag__grid{position:relative;z-index:1;display:grid;grid-template-columns:repeat(5,minmax(168px,1fr));gap:10px;min-width:880px}.praxis-decision-dag__stage{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:12px;background:color-mix(in srgb,var(--md-sys-color-surface-container-low, #1e293b) 82%,transparent);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #475569) 62%,transparent);transition:border-color .16s ease,background-color .16s ease}.praxis-decision-dag__stage.is-populated{background:var(--md-sys-color-surface-container, rgba(30, 41, 59, .06));border-color:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 28%,var(--md-sys-color-outline-variant, #475569))}.praxis-decision-dag__stage.is-violated{border-color:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 62%,transparent);background:color-mix(in srgb,var(--md-sys-color-error-container, rgba(220, 38, 38, .14)) 32%,var(--md-sys-color-surface-container, transparent))}.praxis-decision-dag__stage-header{display:flex;flex-direction:column;gap:3px}.praxis-decision-dag__stage-topline{display:flex;align-items:center;justify-content:space-between;gap:6px}.praxis-decision-dag__stage-code{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-dag__stage-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--md-sys-color-on-surface-variant, #64748b);background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 8%,transparent)}.praxis-decision-dag__stage-title{margin:0;font-size:12.5px;font-weight:600;line-height:1.3;color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-dag__stage-subtitle{margin:0;font-size:11px;line-height:1.35;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-dag__slots{display:flex;flex-direction:column;gap:8px;flex:1 1 auto}.praxis-decision-dag__empty{display:flex;align-items:center;justify-content:center;min-height:54px;padding:8px;border-radius:8px;border:1px dashed color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent);font-size:11px;text-align:center;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-dag__slot-card{appearance:none;width:100%;text-align:left;display:flex;flex-direction:column;gap:5px;padding:9px 10px;border-radius:10px;cursor:pointer;font-family:inherit;background:var(--md-sys-color-surface-container-high, rgba(148, 163, 184, .1));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 68%,transparent);color:var(--md-sys-color-on-surface, inherit);transition:transform .12s ease,border-color .14s ease,background-color .14s ease}.praxis-decision-dag__slot-card:hover{border-color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-dag__slot-card:focus-visible{outline:2px solid var(--md-sys-color-primary, #4f46e5);outline-offset:2px}.praxis-decision-dag__slot-card.is-selected{border-color:var(--md-sys-color-primary, #4f46e5);background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 13%,var(--md-sys-color-surface-container-high, transparent))}.praxis-decision-dag__slot-card.is-violated{border-color:var(--md-sys-color-error, #dc2626);background:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 12%,var(--md-sys-color-surface-container-high, transparent))}.praxis-decision-dag__slot-top{display:flex;align-items:center;justify-content:space-between;gap:4px;flex-wrap:wrap}.praxis-decision-dag__policy-pill{display:inline-flex;align-items:center;padding:2px 6px;border-radius:999px;font-size:9.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;background:color-mix(in srgb,var(--md-sys-color-secondary, #475569) 16%,transparent);color:var(--md-sys-color-on-surface-variant, inherit)}.praxis-decision-dag__policy-pill[data-policy=parameterizable]{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 16%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-dag__policy-pill[data-policy=extensible],.praxis-decision-dag__policy-pill[data-policy=replaceable]{background:color-mix(in srgb,var(--md-sys-color-tertiary, #0891b2) 18%,transparent);color:var(--md-sys-color-tertiary, #0891b2)}.praxis-decision-dag__violated-pill{display:inline-flex;align-items:center;padding:2px 6px;border-radius:999px;font-size:9.5px;font-weight:700;text-transform:uppercase;background:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 18%,transparent);color:var(--md-sys-color-error, #dc2626)}.praxis-decision-dag__slot-key{font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:11.5px;font-weight:600;word-break:break-word;line-height:1.3}.praxis-decision-dag__slot-meta{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}\n"] }]
|
|
23142
|
+
}], propDecorators: { slots: [{ type: i0.Input, args: [{ isSignal: true, alias: "slots", required: false }] }], bindings: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindings", required: false }] }], selectedSlotKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedSlotKey", required: false }] }], violatedSlotKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "violatedSlotKeys", required: false }] }], slotSelected: [{ type: i0.Output, args: ["slotSelected"] }] } });
|
|
23143
|
+
|
|
23144
|
+
const DISPLAY_CANONICAL_OP_ORDER = [
|
|
23145
|
+
'create',
|
|
23146
|
+
'byId',
|
|
23147
|
+
'view',
|
|
23148
|
+
'update',
|
|
23149
|
+
'edit',
|
|
23150
|
+
'delete',
|
|
23151
|
+
'filter',
|
|
23152
|
+
'cursor',
|
|
23153
|
+
'export',
|
|
23154
|
+
'duplicate-draft',
|
|
23155
|
+
'statsGroupBy',
|
|
23156
|
+
'statsTimeSeries',
|
|
23157
|
+
'statsDistribution',
|
|
23158
|
+
'statsComparison',
|
|
23159
|
+
'bulk',
|
|
23160
|
+
];
|
|
23161
|
+
const SENSITIVE_CLASSIFICATIONS = new Set([
|
|
23162
|
+
'CONFIDENTIAL',
|
|
23163
|
+
'RESTRICTED',
|
|
23164
|
+
'SENSITIVE',
|
|
23165
|
+
'SENSITIVE_PERSONAL',
|
|
23166
|
+
'SECRET',
|
|
23167
|
+
]);
|
|
23168
|
+
const SENSITIVE_CATEGORIES = new Set([
|
|
23169
|
+
'CREDENTIAL',
|
|
23170
|
+
'PERSONAL',
|
|
23171
|
+
'SENSITIVE_PERSONAL',
|
|
23172
|
+
'FINANCIAL',
|
|
23173
|
+
'SECURITY',
|
|
23174
|
+
'HEALTH',
|
|
23175
|
+
'HEALTH_MEDICAL',
|
|
23176
|
+
]);
|
|
23177
|
+
class PraxisDecisionInspectorSurfaceComponent {
|
|
23178
|
+
drawerData = inject(SURFACE_DRAWER_CONTENT_DATA, {
|
|
23179
|
+
optional: true,
|
|
23180
|
+
});
|
|
23181
|
+
inspectorService = inject(PraxisDecisionInspectorService, {
|
|
23182
|
+
optional: true,
|
|
23183
|
+
});
|
|
23184
|
+
i18n = inject(PraxisI18nService, { optional: true });
|
|
23185
|
+
resourceKey = input(null, ...(ngDevMode ? [{ debugName: "resourceKey" }] : /* istanbul ignore next */ []));
|
|
23186
|
+
resourcePath = input(null, ...(ngDevMode ? [{ debugName: "resourcePath" }] : /* istanbul ignore next */ []));
|
|
23187
|
+
resourceId = input(null, ...(ngDevMode ? [{ debugName: "resourceId" }] : /* istanbul ignore next */ []));
|
|
23188
|
+
resourceTitle = input(null, ...(ngDevMode ? [{ debugName: "resourceTitle" }] : /* istanbul ignore next */ []));
|
|
23189
|
+
initialLens = input(null, ...(ngDevMode ? [{ debugName: "initialLens" }] : /* istanbul ignore next */ []));
|
|
23190
|
+
initialOperationKey = input(null, ...(ngDevMode ? [{ debugName: "initialOperationKey" }] : /* istanbul ignore next */ []));
|
|
23191
|
+
initialRuleSetKey = input(null, ...(ngDevMode ? [{ debugName: "initialRuleSetKey" }] : /* istanbul ignore next */ []));
|
|
23192
|
+
initialSlotKey = input(null, ...(ngDevMode ? [{ debugName: "initialSlotKey" }] : /* istanbul ignore next */ []));
|
|
23193
|
+
initialBindingKey = input(null, ...(ngDevMode ? [{ debugName: "initialBindingKey" }] : /* istanbul ignore next */ []));
|
|
23194
|
+
violations = input(undefined, ...(ngDevMode ? [{ debugName: "violations" }] : /* istanbul ignore next */ []));
|
|
23195
|
+
preloadedCatalog = input(undefined, ...(ngDevMode ? [{ debugName: "preloadedCatalog" }] : /* istanbul ignore next */ []));
|
|
23196
|
+
preloadedCapabilities = input(undefined, ...(ngDevMode ? [{ debugName: "preloadedCapabilities" }] : /* istanbul ignore next */ []));
|
|
23197
|
+
studioUrl = input(undefined, ...(ngDevMode ? [{ debugName: "studioUrl" }] : /* istanbul ignore next */ []));
|
|
23198
|
+
endpointKey = input(undefined, ...(ngDevMode ? [{ debugName: "endpointKey" }] : /* istanbul ignore next */ []));
|
|
23199
|
+
apiUrlEntry = input(undefined, ...(ngDevMode ? [{ debugName: "apiUrlEntry" }] : /* istanbul ignore next */ []));
|
|
23200
|
+
loadState = signal('idle', ...(ngDevMode ? [{ debugName: "loadState" }] : /* istanbul ignore next */ []));
|
|
23201
|
+
activeLens = signal('business', ...(ngDevMode ? [{ debugName: "activeLens" }] : /* istanbul ignore next */ []));
|
|
23202
|
+
userSelectedLens = false;
|
|
23203
|
+
catalog = signal(null, ...(ngDevMode ? [{ debugName: "catalog" }] : /* istanbul ignore next */ []));
|
|
23204
|
+
capabilitiesContext = signal(null, ...(ngDevMode ? [{ debugName: "capabilitiesContext" }] : /* istanbul ignore next */ []));
|
|
23205
|
+
selectedRuleSetNodeKey = signal(null, ...(ngDevMode ? [{ debugName: "selectedRuleSetNodeKey" }] : /* istanbul ignore next */ []));
|
|
23206
|
+
selectedSlotKey = signal(null, ...(ngDevMode ? [{ debugName: "selectedSlotKey" }] : /* istanbul ignore next */ []));
|
|
23207
|
+
effectiveViolations = computed(() => {
|
|
23208
|
+
const direct = this.violations();
|
|
23209
|
+
if (Array.isArray(direct) && direct.length > 0) {
|
|
23210
|
+
return direct;
|
|
23211
|
+
}
|
|
23212
|
+
const fromDrawer = this.drawerData?.violations;
|
|
23213
|
+
return Array.isArray(fromDrawer) ? fromDrawer : [];
|
|
23214
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveViolations" }] : /* istanbul ignore next */ []));
|
|
23215
|
+
violatedSlotKeys = computed(() => this.effectiveViolations()
|
|
23216
|
+
.map((item) => item.slotKey?.trim())
|
|
23217
|
+
.filter((key) => Boolean(key)), ...(ngDevMode ? [{ debugName: "violatedSlotKeys" }] : /* istanbul ignore next */ []));
|
|
23218
|
+
ruleSets = computed(() => this.catalog()?.ruleSets ?? [], ...(ngDevMode ? [{ debugName: "ruleSets" }] : /* istanbul ignore next */ []));
|
|
23219
|
+
resourceFacts = computed(() => this.catalog()?.facts ?? [], ...(ngDevMode ? [{ debugName: "resourceFacts" }] : /* istanbul ignore next */ []));
|
|
23220
|
+
governanceItems = computed(() => this.catalog()?.governance ?? [], ...(ngDevMode ? [{ debugName: "governanceItems" }] : /* istanbul ignore next */ []));
|
|
23221
|
+
sortedGovernanceItems = computed(() => {
|
|
23222
|
+
const items = [...this.governanceItems()];
|
|
23223
|
+
return items.sort((a, b) => {
|
|
23224
|
+
if (a.targetKind !== b.targetKind) {
|
|
23225
|
+
if (a.targetKind === 'resource')
|
|
23226
|
+
return -1;
|
|
23227
|
+
if (b.targetKind === 'resource')
|
|
23228
|
+
return 1;
|
|
23229
|
+
}
|
|
23230
|
+
const aScore = this.governanceSeverityScore(a);
|
|
23231
|
+
const bScore = this.governanceSeverityScore(b);
|
|
23232
|
+
if (aScore !== bScore) {
|
|
23233
|
+
return bScore - aScore;
|
|
23234
|
+
}
|
|
23235
|
+
return a.label.localeCompare(b.label);
|
|
23236
|
+
});
|
|
23237
|
+
}, ...(ngDevMode ? [{ debugName: "sortedGovernanceItems" }] : /* istanbul ignore next */ []));
|
|
23238
|
+
sensitiveGovernanceCount = computed(() => this.governanceItems().filter((item) => (item.classification &&
|
|
23239
|
+
SENSITIVE_CLASSIFICATIONS.has(item.classification.trim().toUpperCase())) ||
|
|
23240
|
+
(item.dataCategory &&
|
|
23241
|
+
SENSITIVE_CATEGORIES.has(item.dataCategory.trim().toUpperCase())) ||
|
|
23242
|
+
item.fieldAccessEvaluation?.visible === false).length, ...(ngDevMode ? [{ debugName: "sensitiveGovernanceCount" }] : /* istanbul ignore next */ []));
|
|
23243
|
+
nonExportableGovernanceCount = computed(() => this.governanceItems().filter((item) => item.exportable === false).length, ...(ngDevMode ? [{ debugName: "nonExportableGovernanceCount" }] : /* istanbul ignore next */ []));
|
|
23244
|
+
aiRestrictedGovernanceCount = computed(() => this.governanceItems().filter((item) => item.aiRestrictions.length > 0 ||
|
|
23245
|
+
(item.aiVisibility &&
|
|
23246
|
+
item.aiVisibility.toUpperCase() !== 'ALLOWED' &&
|
|
23247
|
+
item.aiVisibility.toUpperCase() !== 'PUBLIC')).length, ...(ngDevMode ? [{ debugName: "aiRestrictedGovernanceCount" }] : /* istanbul ignore next */ []));
|
|
23248
|
+
workflowActions = computed(() => {
|
|
23249
|
+
const actions = this.capabilitiesContext()?.snapshot?.actions;
|
|
23250
|
+
if (!Array.isArray(actions)) {
|
|
23251
|
+
return [];
|
|
23252
|
+
}
|
|
23253
|
+
return [...actions].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
23254
|
+
}, ...(ngDevMode ? [{ debugName: "workflowActions" }] : /* istanbul ignore next */ []));
|
|
23255
|
+
semanticSurfaces = computed(() => {
|
|
23256
|
+
const surfaces = this.capabilitiesContext()?.snapshot?.surfaces;
|
|
23257
|
+
if (!Array.isArray(surfaces)) {
|
|
23258
|
+
return [];
|
|
23259
|
+
}
|
|
23260
|
+
return [...surfaces].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
23261
|
+
}, ...(ngDevMode ? [{ debugName: "semanticSurfaces" }] : /* istanbul ignore next */ []));
|
|
23262
|
+
canonicalOperationChips = computed(() => {
|
|
23263
|
+
const snap = this.capabilitiesContext()?.snapshot;
|
|
23264
|
+
if (!snap) {
|
|
23265
|
+
return [];
|
|
23266
|
+
}
|
|
23267
|
+
const canonical = snap.canonicalOperations ?? {};
|
|
23268
|
+
const detailed = snap.operations ?? {};
|
|
23269
|
+
const seen = new Set();
|
|
23270
|
+
const chips = [];
|
|
23271
|
+
for (const opKey of DISPLAY_CANONICAL_OP_ORDER) {
|
|
23272
|
+
if (opKey === 'view' && seen.has('byId'))
|
|
23273
|
+
continue;
|
|
23274
|
+
if (opKey === 'edit' && seen.has('update'))
|
|
23275
|
+
continue;
|
|
23276
|
+
const detail = detailed[opKey];
|
|
23277
|
+
const hasCanonicalFlag = Object.prototype.hasOwnProperty.call(canonical, opKey);
|
|
23278
|
+
if (!detail && !hasCanonicalFlag) {
|
|
23279
|
+
continue;
|
|
23280
|
+
}
|
|
23281
|
+
const supported = detail !== undefined
|
|
23282
|
+
? Boolean(detail.supported || detail.bulk?.mode)
|
|
23283
|
+
: Boolean(canonical[opKey]);
|
|
23284
|
+
const allowed = detail?.availability
|
|
23285
|
+
? Boolean(detail.availability.allowed)
|
|
23286
|
+
: typeof detail?.allowed === 'boolean'
|
|
23287
|
+
? Boolean(detail.allowed)
|
|
23288
|
+
: true;
|
|
23289
|
+
seen.add(opKey);
|
|
23290
|
+
chips.push({
|
|
23291
|
+
key: opKey,
|
|
23292
|
+
label: this.formatCapabilityOpLabel(opKey),
|
|
23293
|
+
supported,
|
|
23294
|
+
allowed,
|
|
23295
|
+
reason: detail?.availability?.reason ??
|
|
23296
|
+
detail?.reason ??
|
|
23297
|
+
null,
|
|
23298
|
+
});
|
|
23299
|
+
}
|
|
23300
|
+
return chips;
|
|
23301
|
+
}, ...(ngDevMode ? [{ debugName: "canonicalOperationChips" }] : /* istanbul ignore next */ []));
|
|
23302
|
+
totalCapabilitiesCount = computed(() => {
|
|
23303
|
+
const supportedOps = this.canonicalOperationChips().filter((chip) => chip.supported && chip.allowed).length;
|
|
23304
|
+
return (supportedOps +
|
|
23305
|
+
this.workflowActions().length +
|
|
23306
|
+
this.semanticSurfaces().length);
|
|
23307
|
+
}, ...(ngDevMode ? [{ debugName: "totalCapabilitiesCount" }] : /* istanbul ignore next */ []));
|
|
23308
|
+
lensDescriptors = computed(() => [
|
|
23309
|
+
{
|
|
23310
|
+
id: 'business',
|
|
23311
|
+
icon: 'gavel',
|
|
23312
|
+
label: this.tx('lens.business'),
|
|
23313
|
+
count: this.ruleSets().length,
|
|
23314
|
+
},
|
|
23315
|
+
{
|
|
23316
|
+
id: 'capabilities',
|
|
23317
|
+
icon: 'bolt',
|
|
23318
|
+
label: this.tx('lens.capabilities'),
|
|
23319
|
+
count: this.totalCapabilitiesCount(),
|
|
23320
|
+
},
|
|
23321
|
+
{
|
|
23322
|
+
id: 'governance',
|
|
23323
|
+
icon: 'verified_user',
|
|
23324
|
+
label: this.tx('lens.governance'),
|
|
23325
|
+
count: this.governanceItems().length,
|
|
23326
|
+
},
|
|
23327
|
+
], ...(ngDevMode ? [{ debugName: "lensDescriptors" }] : /* istanbul ignore next */ []));
|
|
23328
|
+
selectedRuleSet = computed(() => {
|
|
23329
|
+
const list = this.ruleSets();
|
|
23330
|
+
if (!list.length) {
|
|
23331
|
+
return null;
|
|
23332
|
+
}
|
|
23333
|
+
const activeNodeKey = this.selectedRuleSetNodeKey();
|
|
23334
|
+
return list.find((entry) => entry.nodeKey === activeNodeKey) ?? list[0];
|
|
23335
|
+
}, ...(ngDevMode ? [{ debugName: "selectedRuleSet" }] : /* istanbul ignore next */ []));
|
|
23336
|
+
selectedSlot = computed(() => {
|
|
23337
|
+
const ruleSet = this.selectedRuleSet();
|
|
23338
|
+
if (!ruleSet?.slots.length) {
|
|
23339
|
+
return null;
|
|
23340
|
+
}
|
|
23341
|
+
const key = this.selectedSlotKey();
|
|
23342
|
+
return ruleSet.slots.find((slot) => slot.slotKey === key) ?? ruleSet.slots[0];
|
|
23343
|
+
}, ...(ngDevMode ? [{ debugName: "selectedSlot" }] : /* istanbul ignore next */ []));
|
|
23344
|
+
selectedSlotBindings = computed(() => {
|
|
23345
|
+
const ruleSet = this.selectedRuleSet();
|
|
23346
|
+
const slot = this.selectedSlot();
|
|
23347
|
+
if (!ruleSet || !slot) {
|
|
23348
|
+
return [];
|
|
23349
|
+
}
|
|
23350
|
+
return ruleSet.bindings.filter((binding) => binding.enabled !== false && binding.slotKey === slot.slotKey);
|
|
23351
|
+
}, ...(ngDevMode ? [{ debugName: "selectedSlotBindings" }] : /* istanbul ignore next */ []));
|
|
23352
|
+
activeRoots = computed(() => {
|
|
23353
|
+
const ruleSet = this.selectedRuleSet();
|
|
23354
|
+
if (!ruleSet) {
|
|
23355
|
+
return [];
|
|
23356
|
+
}
|
|
23357
|
+
const rootSet = new Set([
|
|
23358
|
+
...ruleSet.availableRoots,
|
|
23359
|
+
...Object.keys(ruleSet.factPathsByRoot),
|
|
23360
|
+
]);
|
|
23361
|
+
return [...rootSet].map((rootKey) => ({
|
|
23362
|
+
rootKey,
|
|
23363
|
+
paths: ruleSet.factPathsByRoot[rootKey] ?? [],
|
|
23364
|
+
}));
|
|
23365
|
+
}, ...(ngDevMode ? [{ debugName: "activeRoots" }] : /* istanbul ignore next */ []));
|
|
23366
|
+
effectiveStudioUrl = computed(() => {
|
|
23367
|
+
const activeRuleSet = this.selectedRuleSet();
|
|
23368
|
+
const activeSlot = this.selectedSlot();
|
|
23369
|
+
const resolvedResourceKey = activeRuleSet?.resourceKey ??
|
|
23370
|
+
this.catalog()?.resourceKey ??
|
|
23371
|
+
this.capabilitiesContext()?.resourceKey ??
|
|
23372
|
+
this.effectiveResourceKey();
|
|
23373
|
+
if (this.inspectorService) {
|
|
23374
|
+
const dynamicUrl = this.inspectorService.resolveRulesStudioUrl({
|
|
23375
|
+
resourceKey: resolvedResourceKey,
|
|
23376
|
+
ruleSetKey: activeRuleSet?.ruleSetKey ?? this.effectiveInitialRuleSetKey(),
|
|
23377
|
+
operationKey: activeRuleSet?.operationKey ?? this.effectiveInitialOperationKey(),
|
|
23378
|
+
slotKey: activeSlot?.slotKey ?? this.effectiveInitialSlotKey(),
|
|
23379
|
+
});
|
|
23380
|
+
if (dynamicUrl) {
|
|
23381
|
+
return dynamicUrl;
|
|
23382
|
+
}
|
|
23383
|
+
}
|
|
23384
|
+
return this.studioUrl() ?? this.drawerData?.studioUrl ?? null;
|
|
23385
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveStudioUrl" }] : /* istanbul ignore next */ []));
|
|
23386
|
+
constructor() {
|
|
23387
|
+
effect(() => {
|
|
23388
|
+
const preloadedCat = this.preloadedCatalog() ?? this.drawerData?.preloadedCatalog;
|
|
23389
|
+
const preloadedCap = this.preloadedCapabilities() ?? this.drawerData?.preloadedCapabilities;
|
|
23390
|
+
if (preloadedCap) {
|
|
23391
|
+
this.capabilitiesContext.set(this.normalizeCapabilitiesInput(preloadedCap));
|
|
23392
|
+
}
|
|
23393
|
+
if (preloadedCat) {
|
|
23394
|
+
this.applyCatalog(preloadedCat);
|
|
23395
|
+
}
|
|
23396
|
+
if (preloadedCat || preloadedCap) {
|
|
23397
|
+
this.syncPreferredInitialLens();
|
|
23398
|
+
}
|
|
23399
|
+
}, { allowSignalWrites: true });
|
|
23400
|
+
}
|
|
23401
|
+
ngOnInit() {
|
|
23402
|
+
const explicitLens = this.effectiveInitialLens();
|
|
23403
|
+
if (explicitLens) {
|
|
23404
|
+
this.activeLens.set(explicitLens);
|
|
23405
|
+
}
|
|
23406
|
+
const preloadedCat = this.preloadedCatalog() ?? this.drawerData?.preloadedCatalog;
|
|
23407
|
+
const preloadedCap = this.preloadedCapabilities() ?? this.drawerData?.preloadedCapabilities;
|
|
23408
|
+
if (preloadedCap) {
|
|
23409
|
+
this.capabilitiesContext.set(this.normalizeCapabilitiesInput(preloadedCap));
|
|
23410
|
+
}
|
|
23411
|
+
if (preloadedCat) {
|
|
23412
|
+
this.applyCatalog(preloadedCat);
|
|
23413
|
+
this.syncPreferredInitialLens();
|
|
23414
|
+
if (!preloadedCap && this.inspectorService) {
|
|
23415
|
+
void this.loadCapabilitiesSilently(false);
|
|
23416
|
+
}
|
|
23417
|
+
return;
|
|
23418
|
+
}
|
|
23419
|
+
void this.reload(false);
|
|
23420
|
+
}
|
|
23421
|
+
async reload(forceRefresh = false) {
|
|
23422
|
+
const reqResourceKey = this.effectiveResourceKey();
|
|
23423
|
+
const reqResourcePath = this.effectiveResourcePath();
|
|
23424
|
+
if (!reqResourceKey && !reqResourcePath) {
|
|
23425
|
+
this.loadState.set('empty');
|
|
23426
|
+
return;
|
|
23427
|
+
}
|
|
23428
|
+
if (!this.inspectorService) {
|
|
23429
|
+
this.loadState.set('empty');
|
|
23430
|
+
return;
|
|
23431
|
+
}
|
|
23432
|
+
this.loadState.set('loading');
|
|
23433
|
+
const requestOptions = {
|
|
23434
|
+
resourceKey: reqResourceKey,
|
|
23435
|
+
resourcePath: reqResourcePath,
|
|
23436
|
+
forceRefresh,
|
|
23437
|
+
endpointKey: this.endpointKey() ?? this.drawerData?.endpointKey,
|
|
23438
|
+
apiUrlEntry: this.apiUrlEntry() ?? this.drawerData?.apiUrlEntry,
|
|
23439
|
+
};
|
|
23440
|
+
const [catalogOutcome, capabilitiesOutcome] = await Promise.allSettled([
|
|
23441
|
+
this.inspectorService.loadResourceRuleCatalog({
|
|
23442
|
+
...requestOptions,
|
|
23443
|
+
includeFieldSchemas: true,
|
|
23444
|
+
}),
|
|
23445
|
+
this.inspectorService.loadResourceCapabilities({
|
|
23446
|
+
...requestOptions,
|
|
23447
|
+
resourceId: this.effectiveResourceId(),
|
|
23448
|
+
}),
|
|
23449
|
+
]);
|
|
23450
|
+
if (capabilitiesOutcome.status === 'fulfilled' && capabilitiesOutcome.value) {
|
|
23451
|
+
this.capabilitiesContext.set(capabilitiesOutcome.value);
|
|
23452
|
+
}
|
|
23453
|
+
if (catalogOutcome.status === 'rejected' && !this.capabilitiesContext()) {
|
|
23454
|
+
this.loadState.set('error');
|
|
23455
|
+
return;
|
|
23456
|
+
}
|
|
23457
|
+
const loadedCatalog = catalogOutcome.status === 'fulfilled' ? catalogOutcome.value : null;
|
|
23458
|
+
if (loadedCatalog) {
|
|
23459
|
+
this.applyCatalog(loadedCatalog);
|
|
23460
|
+
}
|
|
23461
|
+
else {
|
|
23462
|
+
this.catalog.set(null);
|
|
23463
|
+
this.loadState.set(this.capabilitiesContext() ? 'ready' : 'empty');
|
|
23464
|
+
}
|
|
23465
|
+
this.syncPreferredInitialLens();
|
|
23466
|
+
}
|
|
23467
|
+
selectLens(lens) {
|
|
23468
|
+
this.userSelectedLens = true;
|
|
23469
|
+
this.activeLens.set(lens);
|
|
23470
|
+
}
|
|
23471
|
+
onLensTabKeydown(event, currentIndex) {
|
|
23472
|
+
const lenses = CANONICAL_DECISION_INSPECTOR_LENSES;
|
|
23473
|
+
let nextIndex = -1;
|
|
23474
|
+
if (event.key === 'ArrowRight') {
|
|
23475
|
+
nextIndex = (currentIndex + 1) % lenses.length;
|
|
23476
|
+
}
|
|
23477
|
+
else if (event.key === 'ArrowLeft') {
|
|
23478
|
+
nextIndex = (currentIndex - 1 + lenses.length) % lenses.length;
|
|
23479
|
+
}
|
|
23480
|
+
else if (event.key === 'Home') {
|
|
23481
|
+
nextIndex = 0;
|
|
23482
|
+
}
|
|
23483
|
+
else if (event.key === 'End') {
|
|
23484
|
+
nextIndex = lenses.length - 1;
|
|
23485
|
+
}
|
|
23486
|
+
if (nextIndex < 0) {
|
|
23487
|
+
return;
|
|
23488
|
+
}
|
|
23489
|
+
event.preventDefault();
|
|
23490
|
+
const targetLens = lenses[nextIndex];
|
|
23491
|
+
this.selectLens(targetLens);
|
|
23492
|
+
const targetButton = event.currentTarget
|
|
23493
|
+
?.parentElement?.querySelector(`#decision-inspector-lens-tab-${targetLens}`);
|
|
23494
|
+
targetButton?.focus();
|
|
23495
|
+
}
|
|
23496
|
+
selectRuleSet(ruleSet) {
|
|
23497
|
+
this.selectedRuleSetNodeKey.set(ruleSet.nodeKey);
|
|
23498
|
+
const preferredSlot = this.pickPreferredSlotKey(ruleSet);
|
|
23499
|
+
this.selectedSlotKey.set(preferredSlot);
|
|
23500
|
+
}
|
|
23501
|
+
selectSlot(slotKey) {
|
|
23502
|
+
this.selectedSlotKey.set(slotKey);
|
|
23503
|
+
}
|
|
23504
|
+
focusViolation(violation) {
|
|
23505
|
+
if (!violation.slotKey) {
|
|
23506
|
+
return;
|
|
23507
|
+
}
|
|
23508
|
+
this.activeLens.set('business');
|
|
23509
|
+
const matchingRuleSet = this.ruleSets().find((rs) => rs.slots.some((slot) => slot.slotKey === violation.slotKey));
|
|
23510
|
+
if (matchingRuleSet) {
|
|
23511
|
+
this.selectedRuleSetNodeKey.set(matchingRuleSet.nodeKey);
|
|
23512
|
+
}
|
|
23513
|
+
this.selectedSlotKey.set(violation.slotKey);
|
|
23514
|
+
}
|
|
23515
|
+
onViolationKeydownSpace(event, violation) {
|
|
23516
|
+
if (!violation.slotKey) {
|
|
23517
|
+
return;
|
|
23518
|
+
}
|
|
23519
|
+
event.preventDefault();
|
|
23520
|
+
this.focusViolation(violation);
|
|
23521
|
+
}
|
|
23522
|
+
onRuleSetTabKeydown(event, currentIndex) {
|
|
23523
|
+
const items = this.ruleSets();
|
|
23524
|
+
if (items.length <= 1) {
|
|
23525
|
+
return;
|
|
23526
|
+
}
|
|
23527
|
+
let nextIndex = -1;
|
|
23528
|
+
if (event.key === 'ArrowRight') {
|
|
23529
|
+
nextIndex = (currentIndex + 1) % items.length;
|
|
23530
|
+
}
|
|
23531
|
+
else if (event.key === 'ArrowLeft') {
|
|
23532
|
+
nextIndex = (currentIndex - 1 + items.length) % items.length;
|
|
23533
|
+
}
|
|
23534
|
+
else if (event.key === 'Home') {
|
|
23535
|
+
nextIndex = 0;
|
|
23536
|
+
}
|
|
23537
|
+
else if (event.key === 'End') {
|
|
23538
|
+
nextIndex = items.length - 1;
|
|
23539
|
+
}
|
|
23540
|
+
if (nextIndex < 0) {
|
|
23541
|
+
return;
|
|
23542
|
+
}
|
|
23543
|
+
event.preventDefault();
|
|
23544
|
+
this.selectRuleSet(items[nextIndex]);
|
|
23545
|
+
const targetButton = event.currentTarget
|
|
23546
|
+
?.parentElement?.querySelector(`#decision-inspector-tab-${nextIndex}`);
|
|
23547
|
+
targetButton?.focus();
|
|
23548
|
+
}
|
|
23549
|
+
isBindingViolated(binding) {
|
|
23550
|
+
return this.effectiveViolations().some((violation) => (violation.bindingKey && violation.bindingKey === binding.bindingKey) ||
|
|
23551
|
+
(violation.code && binding.reasonCode && violation.code === binding.reasonCode));
|
|
23552
|
+
}
|
|
23553
|
+
hasActionExecutionBadges(action) {
|
|
23554
|
+
return Boolean(action.execution?.preconditions?.resourceVersion === 'REQUIRED' ||
|
|
23555
|
+
action.execution?.preconditions?.idempotencyKey === 'REQUIRED' ||
|
|
23556
|
+
action.execution?.interaction?.confirmationRequired ||
|
|
23557
|
+
action.execution?.bulk?.mode);
|
|
23558
|
+
}
|
|
23559
|
+
isSensitiveClassification(classification) {
|
|
23560
|
+
return SENSITIVE_CLASSIFICATIONS.has(classification.trim().toUpperCase());
|
|
23561
|
+
}
|
|
23562
|
+
tx(key, params) {
|
|
23563
|
+
return translateDecisionInspector(this.i18n, key, params);
|
|
23564
|
+
}
|
|
23565
|
+
formatStageLabel(stage) {
|
|
23566
|
+
return translateDecisionInspector(this.i18n, `stage.${stage.trim()}.title`);
|
|
23567
|
+
}
|
|
23568
|
+
formatPolicyLabel(policy) {
|
|
23569
|
+
return translateDecisionInspector(this.i18n, `policy.${policy.trim().toUpperCase()}`);
|
|
23570
|
+
}
|
|
23571
|
+
formatSourceLabel(source) {
|
|
23572
|
+
return translateDecisionInspector(this.i18n, `source.${source.trim().toUpperCase()}`);
|
|
23573
|
+
}
|
|
23574
|
+
formatCapabilityOpLabel(opKey) {
|
|
23575
|
+
const i18nKey = `capabilities.op.${opKey}`;
|
|
23576
|
+
const translated = translateDecisionInspector(this.i18n, i18nKey);
|
|
23577
|
+
return translated === i18nKey ? opKey : translated;
|
|
23578
|
+
}
|
|
23579
|
+
formatRiskLabel(risk) {
|
|
23580
|
+
const i18nKey = `capabilities.risk.${risk.trim().toUpperCase()}`;
|
|
23581
|
+
const translated = translateDecisionInspector(this.i18n, i18nKey);
|
|
23582
|
+
return translated === i18nKey ? risk : translated;
|
|
23583
|
+
}
|
|
23584
|
+
formatSurfaceKindLabel(kind) {
|
|
23585
|
+
const i18nKey = `capabilities.surfaceKind.${kind.trim().toUpperCase()}`;
|
|
23586
|
+
const translated = translateDecisionInspector(this.i18n, i18nKey);
|
|
23587
|
+
return translated === i18nKey ? kind : translated;
|
|
23588
|
+
}
|
|
23589
|
+
formatGovernanceTargetKind(kind) {
|
|
23590
|
+
if (kind === 'resource')
|
|
23591
|
+
return this.tx('governance.targetResource');
|
|
23592
|
+
if (kind === 'field')
|
|
23593
|
+
return this.tx('governance.targetField');
|
|
23594
|
+
return this.tx('governance.targetConcept');
|
|
23595
|
+
}
|
|
23596
|
+
formatClassificationLabel(classification) {
|
|
23597
|
+
const clean = classification.trim().toUpperCase();
|
|
23598
|
+
const i18nKey = `governance.classification.${clean}`;
|
|
23599
|
+
const translated = translateDecisionInspector(this.i18n, i18nKey);
|
|
23600
|
+
return translated === i18nKey ? classification : translated;
|
|
23601
|
+
}
|
|
23602
|
+
formatDataCategoryLabel(category) {
|
|
23603
|
+
const clean = category.trim().toUpperCase();
|
|
23604
|
+
const i18nKey = `governance.category.${clean}`;
|
|
23605
|
+
const translated = translateDecisionInspector(this.i18n, i18nKey);
|
|
23606
|
+
return translated === i18nKey ? category : translated;
|
|
23607
|
+
}
|
|
23608
|
+
applyCatalog(catalog) {
|
|
23609
|
+
this.catalog.set(catalog);
|
|
23610
|
+
if (!catalog.ruleSets.length) {
|
|
23611
|
+
const hasOtherLenses = (catalog.governance?.length ?? 0) > 0 || Boolean(this.capabilitiesContext());
|
|
23612
|
+
this.loadState.set(hasOtherLenses ? 'ready' : 'empty');
|
|
23613
|
+
return;
|
|
23614
|
+
}
|
|
23615
|
+
const preferredRuleSet = this.pickPreferredRuleSet(catalog.ruleSets);
|
|
23616
|
+
this.selectedRuleSetNodeKey.set(preferredRuleSet.nodeKey);
|
|
23617
|
+
this.selectedSlotKey.set(this.pickPreferredSlotKey(preferredRuleSet));
|
|
23618
|
+
this.loadState.set('ready');
|
|
23619
|
+
}
|
|
23620
|
+
async loadCapabilitiesSilently(forceRefresh) {
|
|
23621
|
+
if (!this.inspectorService) {
|
|
23622
|
+
return;
|
|
23623
|
+
}
|
|
23624
|
+
try {
|
|
23625
|
+
const loaded = await this.inspectorService.loadResourceCapabilities({
|
|
23626
|
+
resourceKey: this.effectiveResourceKey() ?? this.catalog()?.resourceKey ?? null,
|
|
23627
|
+
resourcePath: this.effectiveResourcePath(),
|
|
23628
|
+
resourceId: this.effectiveResourceId(),
|
|
23629
|
+
forceRefresh,
|
|
23630
|
+
endpointKey: this.endpointKey() ?? this.drawerData?.endpointKey,
|
|
23631
|
+
apiUrlEntry: this.apiUrlEntry() ?? this.drawerData?.apiUrlEntry,
|
|
23632
|
+
});
|
|
23633
|
+
if (loaded) {
|
|
23634
|
+
this.capabilitiesContext.set(loaded);
|
|
23635
|
+
if (this.loadState() === 'empty') {
|
|
23636
|
+
this.loadState.set('ready');
|
|
23637
|
+
}
|
|
23638
|
+
this.syncPreferredInitialLens();
|
|
23639
|
+
}
|
|
23640
|
+
}
|
|
23641
|
+
catch {
|
|
23642
|
+
// Non-blocking enrichment
|
|
23643
|
+
}
|
|
23644
|
+
}
|
|
23645
|
+
syncPreferredInitialLens() {
|
|
23646
|
+
if (this.userSelectedLens) {
|
|
23647
|
+
return;
|
|
23648
|
+
}
|
|
23649
|
+
const explicit = this.effectiveInitialLens();
|
|
23650
|
+
if (explicit) {
|
|
23651
|
+
this.activeLens.set(explicit);
|
|
23652
|
+
return;
|
|
23653
|
+
}
|
|
23654
|
+
if (this.effectiveViolations().length > 0 || this.ruleSets().length > 0) {
|
|
23655
|
+
this.activeLens.set('business');
|
|
23656
|
+
return;
|
|
23657
|
+
}
|
|
23658
|
+
if (this.totalCapabilitiesCount() > 0 || this.capabilitiesContext()) {
|
|
23659
|
+
this.activeLens.set('capabilities');
|
|
23660
|
+
return;
|
|
23661
|
+
}
|
|
23662
|
+
if (this.governanceItems().length > 0) {
|
|
23663
|
+
this.activeLens.set('governance');
|
|
23664
|
+
return;
|
|
23665
|
+
}
|
|
23666
|
+
this.activeLens.set('business');
|
|
23667
|
+
}
|
|
23668
|
+
normalizeCapabilitiesInput(value) {
|
|
23669
|
+
if ('snapshot' in value && value.snapshot) {
|
|
23670
|
+
return value;
|
|
23671
|
+
}
|
|
23672
|
+
const snapshot = value;
|
|
23673
|
+
const hasId = snapshot.resourceId !== undefined &&
|
|
23674
|
+
snapshot.resourceId !== null &&
|
|
23675
|
+
String(snapshot.resourceId).trim() !== '';
|
|
23676
|
+
return {
|
|
23677
|
+
scope: hasId ? 'ITEM' : 'COLLECTION',
|
|
23678
|
+
resourceKey: snapshot.resourceKey ?? '',
|
|
23679
|
+
resourcePath: snapshot.resourcePath ?? '',
|
|
23680
|
+
resourceId: hasId ? snapshot.resourceId : null,
|
|
23681
|
+
snapshot,
|
|
23682
|
+
};
|
|
23683
|
+
}
|
|
23684
|
+
governanceSeverityScore(item) {
|
|
23685
|
+
let score = 0;
|
|
23686
|
+
if (item.exportable === false)
|
|
23687
|
+
score += 4;
|
|
23688
|
+
if (item.classification &&
|
|
23689
|
+
SENSITIVE_CLASSIFICATIONS.has(item.classification.toUpperCase())) {
|
|
23690
|
+
score += 3;
|
|
23691
|
+
}
|
|
23692
|
+
if (item.fieldAccessEvaluation?.evaluated && !item.fieldAccessEvaluation.visible) {
|
|
23693
|
+
score += 3;
|
|
23694
|
+
}
|
|
23695
|
+
if (item.aiRestrictions.length > 0)
|
|
23696
|
+
score += 2;
|
|
23697
|
+
if (item.fieldAccess)
|
|
23698
|
+
score += 1;
|
|
23699
|
+
return score;
|
|
23700
|
+
}
|
|
23701
|
+
pickPreferredRuleSet(ruleSets) {
|
|
23702
|
+
const requestedRuleSetKey = this.effectiveInitialRuleSetKey();
|
|
23703
|
+
if (requestedRuleSetKey) {
|
|
23704
|
+
const exact = ruleSets.find((rs) => rs.ruleSetKey === requestedRuleSetKey);
|
|
23705
|
+
if (exact) {
|
|
23706
|
+
return exact;
|
|
23707
|
+
}
|
|
23708
|
+
}
|
|
23709
|
+
const requestedOperationKey = this.effectiveInitialOperationKey();
|
|
23710
|
+
if (requestedOperationKey) {
|
|
23711
|
+
const byOp = ruleSets.find((rs) => rs.operationKey?.toUpperCase() === requestedOperationKey.toUpperCase());
|
|
23712
|
+
if (byOp) {
|
|
23713
|
+
return byOp;
|
|
23714
|
+
}
|
|
23715
|
+
}
|
|
23716
|
+
const violatedSlot = this.effectiveInitialSlotKey();
|
|
23717
|
+
if (violatedSlot) {
|
|
23718
|
+
const byViolatedSlot = ruleSets.find((rs) => rs.slots.some((slot) => slot.slotKey === violatedSlot));
|
|
23719
|
+
if (byViolatedSlot) {
|
|
23720
|
+
return byViolatedSlot;
|
|
23721
|
+
}
|
|
23722
|
+
}
|
|
23723
|
+
return ruleSets[0];
|
|
23724
|
+
}
|
|
23725
|
+
pickPreferredSlotKey(ruleSet) {
|
|
23726
|
+
const requestedSlot = this.effectiveInitialSlotKey();
|
|
23727
|
+
if (requestedSlot &&
|
|
23728
|
+
ruleSet.slots.some((slot) => slot.slotKey === requestedSlot)) {
|
|
23729
|
+
return requestedSlot;
|
|
23730
|
+
}
|
|
23731
|
+
const violatedKeys = new Set(this.violatedSlotKeys());
|
|
23732
|
+
const violatedMatch = ruleSet.slots.find((slot) => violatedKeys.has(slot.slotKey));
|
|
23733
|
+
if (violatedMatch) {
|
|
23734
|
+
return violatedMatch.slotKey;
|
|
23735
|
+
}
|
|
23736
|
+
return ruleSet.slots[0]?.slotKey ?? null;
|
|
23737
|
+
}
|
|
23738
|
+
effectiveResourceKey() {
|
|
23739
|
+
return this.resourceKey() ?? this.drawerData?.resourceKey ?? null;
|
|
23740
|
+
}
|
|
23741
|
+
effectiveResourcePath() {
|
|
23742
|
+
return this.resourcePath() ?? this.drawerData?.resourcePath ?? null;
|
|
23743
|
+
}
|
|
23744
|
+
effectiveResourceId() {
|
|
23745
|
+
return this.resourceId() ?? this.drawerData?.resourceId ?? null;
|
|
23746
|
+
}
|
|
23747
|
+
effectiveInitialLens() {
|
|
23748
|
+
const candidate = this.initialLens() ?? this.drawerData?.initialLens ?? null;
|
|
23749
|
+
return isDecisionInspectorLensId(candidate) ? candidate : null;
|
|
23750
|
+
}
|
|
23751
|
+
effectiveInitialRuleSetKey() {
|
|
23752
|
+
return this.initialRuleSetKey() ?? this.drawerData?.initialRuleSetKey ?? null;
|
|
23753
|
+
}
|
|
23754
|
+
effectiveInitialOperationKey() {
|
|
23755
|
+
return this.initialOperationKey() ?? this.drawerData?.initialOperationKey ?? null;
|
|
23756
|
+
}
|
|
23757
|
+
effectiveInitialSlotKey() {
|
|
23758
|
+
return (this.initialSlotKey() ??
|
|
23759
|
+
this.drawerData?.initialSlotKey ??
|
|
23760
|
+
this.effectiveViolations()[0]?.slotKey ??
|
|
23761
|
+
null);
|
|
23762
|
+
}
|
|
23763
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisDecisionInspectorSurfaceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
23764
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisDecisionInspectorSurfaceComponent, isStandalone: true, selector: "praxis-decision-inspector-surface", inputs: { resourceKey: { classPropertyName: "resourceKey", publicName: "resourceKey", isSignal: true, isRequired: false, transformFunction: null }, resourcePath: { classPropertyName: "resourcePath", publicName: "resourcePath", isSignal: true, isRequired: false, transformFunction: null }, resourceId: { classPropertyName: "resourceId", publicName: "resourceId", isSignal: true, isRequired: false, transformFunction: null }, resourceTitle: { classPropertyName: "resourceTitle", publicName: "resourceTitle", isSignal: true, isRequired: false, transformFunction: null }, initialLens: { classPropertyName: "initialLens", publicName: "initialLens", isSignal: true, isRequired: false, transformFunction: null }, initialOperationKey: { classPropertyName: "initialOperationKey", publicName: "initialOperationKey", isSignal: true, isRequired: false, transformFunction: null }, initialRuleSetKey: { classPropertyName: "initialRuleSetKey", publicName: "initialRuleSetKey", isSignal: true, isRequired: false, transformFunction: null }, initialSlotKey: { classPropertyName: "initialSlotKey", publicName: "initialSlotKey", isSignal: true, isRequired: false, transformFunction: null }, initialBindingKey: { classPropertyName: "initialBindingKey", publicName: "initialBindingKey", isSignal: true, isRequired: false, transformFunction: null }, violations: { classPropertyName: "violations", publicName: "violations", isSignal: true, isRequired: false, transformFunction: null }, preloadedCatalog: { classPropertyName: "preloadedCatalog", publicName: "preloadedCatalog", isSignal: true, isRequired: false, transformFunction: null }, preloadedCapabilities: { classPropertyName: "preloadedCapabilities", publicName: "preloadedCapabilities", isSignal: true, isRequired: false, transformFunction: null }, studioUrl: { classPropertyName: "studioUrl", publicName: "studioUrl", isSignal: true, isRequired: false, transformFunction: null }, endpointKey: { classPropertyName: "endpointKey", publicName: "endpointKey", isSignal: true, isRequired: false, transformFunction: null }, apiUrlEntry: { classPropertyName: "apiUrlEntry", publicName: "apiUrlEntry", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
23765
|
+
<div class="praxis-decision-inspector" data-testid="praxis-decision-inspector-surface">
|
|
23766
|
+
<!-- 1. Explainable X-Ray Callout when 422/409 Rule Violations are present -->
|
|
23767
|
+
@if (effectiveViolations().length > 0) {
|
|
23768
|
+
<section
|
|
23769
|
+
class="praxis-decision-inspector__xray"
|
|
23770
|
+
role="region"
|
|
23771
|
+
[attr.aria-label]="tx('violation.bannerTitle')"
|
|
23772
|
+
data-testid="decision-inspector-xray-banner"
|
|
23773
|
+
>
|
|
23774
|
+
<div class="praxis-decision-inspector__xray-header">
|
|
23775
|
+
<span class="material-symbols-outlined praxis-decision-inspector__xray-icon" aria-hidden="true">
|
|
23776
|
+
policy
|
|
23777
|
+
</span>
|
|
23778
|
+
<strong class="praxis-decision-inspector__xray-title">
|
|
23779
|
+
{{ tx('violation.bannerTitle') }}
|
|
23780
|
+
</strong>
|
|
23781
|
+
</div>
|
|
23782
|
+
|
|
23783
|
+
<div class="praxis-decision-inspector__xray-list">
|
|
23784
|
+
@for (violation of effectiveViolations(); track $index) {
|
|
23785
|
+
<div
|
|
23786
|
+
class="praxis-decision-inspector__xray-item"
|
|
23787
|
+
[class.is-clickable]="!!violation.slotKey"
|
|
23788
|
+
[attr.role]="violation.slotKey ? 'button' : null"
|
|
23789
|
+
[attr.tabindex]="violation.slotKey ? 0 : null"
|
|
23790
|
+
(click)="focusViolation(violation)"
|
|
23791
|
+
(keydown.enter)="focusViolation(violation)"
|
|
23792
|
+
(keydown.space)="onViolationKeydownSpace($event, violation)"
|
|
23793
|
+
>
|
|
23794
|
+
<div class="praxis-decision-inspector__xray-badges">
|
|
23795
|
+
@if (violation.code) {
|
|
23796
|
+
<span class="praxis-decision-inspector__chip is-error">
|
|
23797
|
+
{{ violation.code }}
|
|
23798
|
+
</span>
|
|
23799
|
+
}
|
|
23800
|
+
@if (violation.stage) {
|
|
23801
|
+
<span class="praxis-decision-inspector__chip">
|
|
23802
|
+
{{ tx('violation.stage') }}: {{ formatStageLabel(violation.stage) }}
|
|
23803
|
+
</span>
|
|
23804
|
+
}
|
|
23805
|
+
@if (violation.source) {
|
|
23806
|
+
<span class="praxis-decision-inspector__chip">
|
|
23807
|
+
{{ tx('violation.source') }}: {{ formatSourceLabel(violation.source) }}
|
|
23808
|
+
</span>
|
|
23809
|
+
}
|
|
23810
|
+
@if (violation.slotKey) {
|
|
23811
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
23812
|
+
{{ violation.slotKey }}
|
|
23813
|
+
</span>
|
|
23814
|
+
}
|
|
23815
|
+
@if (violation.targetField) {
|
|
23816
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
23817
|
+
{{ tx('violation.targetField') }}: {{ violation.targetField }}
|
|
23818
|
+
</span>
|
|
23819
|
+
}
|
|
23820
|
+
@if (violation.lineage) {
|
|
23821
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
23822
|
+
{{ tx('violation.lineage') }}: {{ violation.lineage }}
|
|
23823
|
+
</span>
|
|
23824
|
+
}
|
|
23825
|
+
</div>
|
|
23826
|
+
<p class="praxis-decision-inspector__xray-message">
|
|
23827
|
+
{{ violation.message }}
|
|
23828
|
+
</p>
|
|
23829
|
+
</div>
|
|
23830
|
+
}
|
|
23831
|
+
</div>
|
|
23832
|
+
</section>
|
|
23833
|
+
}
|
|
23834
|
+
|
|
23835
|
+
<!-- 2. Catalog Loading / Error / Unified 3-Lens Ready Surface -->
|
|
23836
|
+
@switch (loadState()) {
|
|
23837
|
+
@case ('loading') {
|
|
23838
|
+
<div class="praxis-decision-inspector__status" role="status" aria-live="polite">
|
|
23839
|
+
<span class="material-symbols-outlined praxis-decision-inspector__spinner" aria-hidden="true">
|
|
23840
|
+
progress_activity
|
|
23841
|
+
</span>
|
|
23842
|
+
<span>{{ tx('state.loading') }}</span>
|
|
23843
|
+
</div>
|
|
23844
|
+
}
|
|
23845
|
+
@case ('error') {
|
|
23846
|
+
<div class="praxis-decision-inspector__status is-error" role="alert">
|
|
23847
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
23848
|
+
<strong>{{ tx('state.errorTitle') }}</strong>
|
|
23849
|
+
<p>{{ tx('state.errorDescription') }}</p>
|
|
23850
|
+
</div>
|
|
23851
|
+
<button
|
|
23852
|
+
type="button"
|
|
23853
|
+
class="praxis-decision-inspector__action-btn"
|
|
23854
|
+
(click)="reload(true)"
|
|
23855
|
+
>
|
|
23856
|
+
{{ tx('state.retry') }}
|
|
23857
|
+
</button>
|
|
23858
|
+
</div>
|
|
23859
|
+
}
|
|
23860
|
+
@default {
|
|
23861
|
+
<!-- Unified 3-Lens Segmented Tab Bar -->
|
|
23862
|
+
<div
|
|
23863
|
+
class="praxis-decision-inspector__lens-bar"
|
|
23864
|
+
role="tablist"
|
|
23865
|
+
[attr.aria-label]="tx('lens.ariaLabel')"
|
|
23866
|
+
data-testid="decision-inspector-lens-tabs"
|
|
23867
|
+
>
|
|
23868
|
+
@for (lens of lensDescriptors(); track lens.id; let lensIdx = $index) {
|
|
23869
|
+
<button
|
|
23870
|
+
type="button"
|
|
23871
|
+
role="tab"
|
|
23872
|
+
[id]="'decision-inspector-lens-tab-' + lens.id"
|
|
23873
|
+
class="praxis-decision-inspector__lens-tab"
|
|
23874
|
+
[class.is-active]="activeLens() === lens.id"
|
|
23875
|
+
[attr.aria-selected]="activeLens() === lens.id"
|
|
23876
|
+
[attr.aria-controls]="'decision-inspector-lens-panel-' + lens.id"
|
|
23877
|
+
[attr.tabindex]="activeLens() === lens.id ? 0 : -1"
|
|
23878
|
+
[attr.data-testid]="'decision-inspector-lens-' + lens.id"
|
|
23879
|
+
(click)="selectLens(lens.id)"
|
|
23880
|
+
(keydown)="onLensTabKeydown($event, lensIdx)"
|
|
23881
|
+
>
|
|
23882
|
+
<span class="material-symbols-outlined praxis-decision-inspector__lens-icon" aria-hidden="true">
|
|
23883
|
+
{{ lens.icon }}
|
|
23884
|
+
</span>
|
|
23885
|
+
<span class="praxis-decision-inspector__lens-label">{{ lens.label }}</span>
|
|
23886
|
+
<span class="praxis-decision-inspector__lens-count">{{ lens.count }}</span>
|
|
23887
|
+
</button>
|
|
23888
|
+
}
|
|
23889
|
+
</div>
|
|
23890
|
+
|
|
23891
|
+
<!-- LENS 1: BUSINESS RULES (5-Stage DAG, Slots, Bindings, Ontological Facts) -->
|
|
23892
|
+
@if (activeLens() === 'business') {
|
|
23893
|
+
<div
|
|
23894
|
+
id="decision-inspector-lens-panel-business"
|
|
23895
|
+
role="tabpanel"
|
|
23896
|
+
aria-labelledby="decision-inspector-lens-tab-business"
|
|
23897
|
+
class="praxis-decision-inspector__lens-panel"
|
|
23898
|
+
data-testid="decision-inspector-panel-business"
|
|
23899
|
+
>
|
|
23900
|
+
@if (selectedRuleSet(); as activeRuleSet) {
|
|
23901
|
+
<!-- Operation / RuleSet Selector -->
|
|
23902
|
+
<section class="praxis-decision-inspector__section">
|
|
23903
|
+
<div class="praxis-decision-inspector__section-top">
|
|
23904
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
23905
|
+
{{ tx('operations.label') }}
|
|
23906
|
+
</span>
|
|
23907
|
+
@if (activeRuleSet.failPolicy) {
|
|
23908
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
23909
|
+
{{ activeRuleSet.failPolicy }}
|
|
23910
|
+
</span>
|
|
23911
|
+
}
|
|
23912
|
+
</div>
|
|
23913
|
+
|
|
23914
|
+
<div
|
|
23915
|
+
class="praxis-decision-inspector__ruleset-pills"
|
|
23916
|
+
role="tablist"
|
|
23917
|
+
[attr.aria-label]="tx('operations.label')"
|
|
23918
|
+
>
|
|
23919
|
+
@for (ruleSet of ruleSets(); track ruleSet.nodeKey; let idx = $index) {
|
|
23920
|
+
<button
|
|
23921
|
+
type="button"
|
|
23922
|
+
role="tab"
|
|
23923
|
+
[id]="'decision-inspector-tab-' + idx"
|
|
23924
|
+
class="praxis-decision-inspector__ruleset-pill"
|
|
23925
|
+
[class.is-active]="ruleSet.nodeKey === activeRuleSet.nodeKey"
|
|
23926
|
+
[attr.aria-selected]="ruleSet.nodeKey === activeRuleSet.nodeKey"
|
|
23927
|
+
[attr.aria-controls]="'decision-inspector-tabpanel'"
|
|
23928
|
+
[attr.tabindex]="ruleSet.nodeKey === activeRuleSet.nodeKey ? 0 : -1"
|
|
23929
|
+
[attr.data-ruleset-key]="ruleSet.ruleSetKey"
|
|
23930
|
+
(click)="selectRuleSet(ruleSet)"
|
|
23931
|
+
(keydown)="onRuleSetTabKeydown($event, idx)"
|
|
23932
|
+
>
|
|
23933
|
+
<span class="praxis-decision-inspector__ruleset-op">
|
|
23934
|
+
{{ ruleSet.operationKey || tx('operations.defaultOperation') }}
|
|
23935
|
+
</span>
|
|
23936
|
+
<span class="praxis-decision-inspector__ruleset-label">
|
|
23937
|
+
{{ ruleSet.label }}
|
|
23938
|
+
</span>
|
|
23939
|
+
</button>
|
|
23940
|
+
}
|
|
23941
|
+
</div>
|
|
23942
|
+
|
|
23943
|
+
@if (activeRuleSet.description) {
|
|
23944
|
+
<p class="praxis-decision-inspector__description">
|
|
23945
|
+
{{ activeRuleSet.description }}
|
|
23946
|
+
</p>
|
|
23947
|
+
}
|
|
23948
|
+
</section>
|
|
23949
|
+
|
|
23950
|
+
<!-- 5-Stage Canonical Decision DAG -->
|
|
23951
|
+
<div id="decision-inspector-tabpanel" role="tabpanel" class="praxis-decision-inspector__lens-panel">
|
|
23952
|
+
<section class="praxis-decision-inspector__section praxis-decision-inspector__section--divider">
|
|
23953
|
+
<praxis-rule-decision-dag
|
|
23954
|
+
[slots]="activeRuleSet.slots"
|
|
23955
|
+
[bindings]="activeRuleSet.bindings"
|
|
23956
|
+
[selectedSlotKey]="selectedSlotKey()"
|
|
23957
|
+
[violatedSlotKeys]="violatedSlotKeys()"
|
|
23958
|
+
(slotSelected)="selectSlot($event)"
|
|
23959
|
+
/>
|
|
23960
|
+
</section>
|
|
23961
|
+
|
|
23962
|
+
<!-- Selected Slot & Active Bindings Detail -->
|
|
23963
|
+
@if (selectedSlot(); as activeSlot) {
|
|
23964
|
+
<section
|
|
23965
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
23966
|
+
data-testid="decision-inspector-slot-detail"
|
|
23967
|
+
>
|
|
23968
|
+
<div class="praxis-decision-inspector__section-top">
|
|
23969
|
+
<div>
|
|
23970
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
23971
|
+
{{ tx('slotDetail.heading') }}
|
|
23972
|
+
</span>
|
|
23973
|
+
<h3 class="praxis-decision-inspector__slot-heading">
|
|
23974
|
+
{{ activeSlot.slotKey }}
|
|
23975
|
+
</h3>
|
|
23976
|
+
</div>
|
|
23977
|
+
<div class="praxis-decision-inspector__slot-badges">
|
|
23978
|
+
@if (activeSlot.overridePolicy) {
|
|
23979
|
+
<span class="praxis-decision-inspector__chip">
|
|
23980
|
+
{{ tx('slotDetail.overridePolicy') }}:
|
|
23981
|
+
{{ formatPolicyLabel(activeSlot.overridePolicy) }}
|
|
23982
|
+
</span>
|
|
23983
|
+
}
|
|
23984
|
+
@if (activeSlot.aggregationPolicy) {
|
|
23985
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
23986
|
+
{{ tx('slotDetail.aggregation') }}: {{ activeSlot.aggregationPolicy }}
|
|
23987
|
+
</span>
|
|
23988
|
+
}
|
|
23989
|
+
@if (activeSlot.templateKey) {
|
|
23990
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
23991
|
+
{{ tx('slotDetail.templateKey') }}: {{ activeSlot.templateKey }}
|
|
23992
|
+
</span>
|
|
23993
|
+
}
|
|
23994
|
+
</div>
|
|
23995
|
+
</div>
|
|
23996
|
+
|
|
23997
|
+
@if (selectedSlotBindings().length === 0) {
|
|
23998
|
+
<p class="praxis-decision-inspector__muted">
|
|
23999
|
+
{{ tx('slotDetail.noBindings') }}
|
|
24000
|
+
</p>
|
|
24001
|
+
} @else {
|
|
24002
|
+
<div class="praxis-decision-inspector__bindings">
|
|
24003
|
+
@for (binding of selectedSlotBindings(); track binding.bindingKey) {
|
|
24004
|
+
<article
|
|
24005
|
+
class="praxis-decision-inspector__binding"
|
|
24006
|
+
[class.is-violated]="isBindingViolated(binding)"
|
|
24007
|
+
[attr.data-binding-key]="binding.bindingKey"
|
|
24008
|
+
>
|
|
24009
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
24010
|
+
<span class="praxis-decision-inspector__binding-key">
|
|
24011
|
+
{{ binding.bindingKey }}
|
|
24012
|
+
</span>
|
|
24013
|
+
<div class="praxis-decision-inspector__binding-chips">
|
|
24014
|
+
@if (binding.reasonCode) {
|
|
24015
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
24016
|
+
{{ binding.reasonCode }}
|
|
24017
|
+
</span>
|
|
24018
|
+
}
|
|
24019
|
+
@if (binding.source) {
|
|
24020
|
+
<span class="praxis-decision-inspector__chip">
|
|
24021
|
+
{{ formatSourceLabel(binding.source) }}
|
|
24022
|
+
</span>
|
|
24023
|
+
}
|
|
24024
|
+
@if (binding.falseDecision) {
|
|
24025
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24026
|
+
{{ binding.falseDecision }}
|
|
24027
|
+
</span>
|
|
24028
|
+
}
|
|
24029
|
+
</div>
|
|
24030
|
+
</div>
|
|
24031
|
+
|
|
24032
|
+
@if (binding.message) {
|
|
24033
|
+
<p class="praxis-decision-inspector__binding-message">
|
|
24034
|
+
{{ binding.message }}
|
|
24035
|
+
</p>
|
|
24036
|
+
}
|
|
24037
|
+
|
|
24038
|
+
<div class="praxis-decision-inspector__binding-meta">
|
|
24039
|
+
@if (binding.targetField) {
|
|
24040
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24041
|
+
<strong>{{ tx('binding.targetField') }}:</strong>
|
|
24042
|
+
<code>{{ binding.targetField }}</code>
|
|
24043
|
+
</span>
|
|
24044
|
+
}
|
|
24045
|
+
@if (binding.lineage) {
|
|
24046
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24047
|
+
<strong>{{ tx('binding.lineage') }}:</strong>
|
|
24048
|
+
<code>{{ binding.lineage }}</code>
|
|
24049
|
+
</span>
|
|
24050
|
+
}
|
|
24051
|
+
</div>
|
|
24052
|
+
|
|
24053
|
+
@if (binding.referencedFactPaths?.length) {
|
|
24054
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24055
|
+
<span class="praxis-decision-inspector__fact-label">
|
|
24056
|
+
{{ tx('binding.factPaths') }}:
|
|
24057
|
+
</span>
|
|
24058
|
+
@for (factPath of binding.referencedFactPaths; track factPath) {
|
|
24059
|
+
<code class="praxis-decision-inspector__fact-chip">{{ factPath }}</code>
|
|
24060
|
+
}
|
|
24061
|
+
</div>
|
|
24062
|
+
}
|
|
24063
|
+
</article>
|
|
24064
|
+
}
|
|
24065
|
+
</div>
|
|
24066
|
+
}
|
|
24067
|
+
</section>
|
|
24068
|
+
}
|
|
24069
|
+
|
|
24070
|
+
<!-- Ontological Roots & Deterministic Resource Facts -->
|
|
24071
|
+
<section class="praxis-decision-inspector__section praxis-decision-inspector__section--divider">
|
|
24072
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24073
|
+
{{ tx('roots.heading') }}
|
|
24074
|
+
</span>
|
|
24075
|
+
<div class="praxis-decision-inspector__roots">
|
|
24076
|
+
@for (root of activeRoots(); track root.rootKey) {
|
|
24077
|
+
<div class="praxis-decision-inspector__root-group">
|
|
24078
|
+
<span class="praxis-decision-inspector__root-pill">{{ root.rootKey }}</span>
|
|
24079
|
+
@if (root.paths.length > 0) {
|
|
24080
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24081
|
+
@for (path of root.paths; track path) {
|
|
24082
|
+
<code class="praxis-decision-inspector__fact-chip">{{ path }}</code>
|
|
24083
|
+
}
|
|
24084
|
+
</div>
|
|
24085
|
+
}
|
|
24086
|
+
</div>
|
|
24087
|
+
} @empty {
|
|
24088
|
+
<p class="praxis-decision-inspector__muted">{{ tx('roots.empty') }}</p>
|
|
24089
|
+
}
|
|
24090
|
+
</div>
|
|
24091
|
+
|
|
24092
|
+
@if (resourceFacts().length > 0) {
|
|
24093
|
+
<div class="praxis-decision-inspector__facts-block">
|
|
24094
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24095
|
+
{{ tx('facts.heading') }}
|
|
24096
|
+
</span>
|
|
24097
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24098
|
+
@for (fact of resourceFacts(); track fact.key) {
|
|
24099
|
+
<span class="praxis-decision-inspector__chip">
|
|
24100
|
+
{{ fact.label }}
|
|
24101
|
+
@if (fact.factPath) {
|
|
24102
|
+
<code>({{ fact.factPath }})</code>
|
|
24103
|
+
}
|
|
24104
|
+
</span>
|
|
24105
|
+
}
|
|
24106
|
+
</div>
|
|
24107
|
+
</div>
|
|
24108
|
+
}
|
|
24109
|
+
</section>
|
|
24110
|
+
</div>
|
|
24111
|
+
} @else {
|
|
24112
|
+
<div class="praxis-decision-inspector__status" role="status">
|
|
24113
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
24114
|
+
<strong>{{ tx('state.emptyTitle') }}</strong>
|
|
24115
|
+
<p>{{ tx('state.emptyDescription') }}</p>
|
|
24116
|
+
</div>
|
|
24117
|
+
</div>
|
|
24118
|
+
}
|
|
24119
|
+
</div>
|
|
24120
|
+
}
|
|
24121
|
+
|
|
24122
|
+
<!-- LENS 2: LIFECYCLE & CAPABILITIES (/capabilities, @WorkflowAction, @UiSurface) -->
|
|
24123
|
+
@if (activeLens() === 'capabilities') {
|
|
24124
|
+
<div
|
|
24125
|
+
id="decision-inspector-lens-panel-capabilities"
|
|
24126
|
+
role="tabpanel"
|
|
24127
|
+
aria-labelledby="decision-inspector-lens-tab-capabilities"
|
|
24128
|
+
class="praxis-decision-inspector__lens-panel"
|
|
24129
|
+
data-testid="decision-inspector-panel-capabilities"
|
|
24130
|
+
>
|
|
24131
|
+
@if (capabilitiesContext(); as capCtx) {
|
|
24132
|
+
<!-- Scope & Canonical Operations -->
|
|
24133
|
+
<section class="praxis-decision-inspector__section">
|
|
24134
|
+
<div class="praxis-decision-inspector__section-top">
|
|
24135
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24136
|
+
{{ tx('capabilities.operationsHeading') }}
|
|
24137
|
+
</span>
|
|
24138
|
+
<div class="praxis-decision-inspector__slot-badges">
|
|
24139
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
24140
|
+
{{
|
|
24141
|
+
capCtx.scope === 'ITEM' && capCtx.resourceId !== null && capCtx.resourceId !== undefined
|
|
24142
|
+
? tx('capabilities.scopeItem', { id: capCtx.resourceId })
|
|
24143
|
+
: tx('capabilities.scopeCollection')
|
|
24144
|
+
}}
|
|
24145
|
+
</span>
|
|
24146
|
+
@if (capCtx.resourcePath) {
|
|
24147
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24148
|
+
{{ capCtx.resourcePath }}
|
|
24149
|
+
</span>
|
|
24150
|
+
}
|
|
24151
|
+
</div>
|
|
24152
|
+
</div>
|
|
24153
|
+
|
|
24154
|
+
@if (canonicalOperationChips().length > 0) {
|
|
24155
|
+
<div
|
|
24156
|
+
class="praxis-decision-inspector__ops-grid"
|
|
24157
|
+
data-testid="decision-inspector-canonical-ops"
|
|
24158
|
+
>
|
|
24159
|
+
@for (op of canonicalOperationChips(); track op.key) {
|
|
24160
|
+
<div
|
|
24161
|
+
class="praxis-decision-inspector__op-pill"
|
|
24162
|
+
[class.is-supported]="op.supported && op.allowed"
|
|
24163
|
+
[class.is-blocked]="!op.supported || !op.allowed"
|
|
24164
|
+
[attr.data-op-key]="op.key"
|
|
24165
|
+
>
|
|
24166
|
+
<div class="praxis-decision-inspector__op-main">
|
|
24167
|
+
<span class="material-symbols-outlined praxis-decision-inspector__op-icon" aria-hidden="true">
|
|
24168
|
+
{{ op.supported && op.allowed ? 'check_circle' : 'block' }}
|
|
24169
|
+
</span>
|
|
24170
|
+
<span class="praxis-decision-inspector__op-label">{{ op.label }}</span>
|
|
24171
|
+
</div>
|
|
24172
|
+
@if (op.reason) {
|
|
24173
|
+
<span class="praxis-decision-inspector__op-reason">{{ op.reason }}</span>
|
|
24174
|
+
}
|
|
24175
|
+
</div>
|
|
24176
|
+
}
|
|
24177
|
+
</div>
|
|
24178
|
+
}
|
|
24179
|
+
</section>
|
|
24180
|
+
|
|
24181
|
+
<!-- Workflow Actions (@WorkflowAction) -->
|
|
24182
|
+
<section
|
|
24183
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
24184
|
+
data-testid="decision-inspector-workflow-actions"
|
|
24185
|
+
>
|
|
24186
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24187
|
+
{{ tx('capabilities.actionsHeading') }}
|
|
24188
|
+
</span>
|
|
24189
|
+
|
|
24190
|
+
@if (workflowActions().length === 0) {
|
|
24191
|
+
<p class="praxis-decision-inspector__muted">
|
|
24192
|
+
{{ tx('capabilities.noActions') }}
|
|
24193
|
+
</p>
|
|
24194
|
+
} @else {
|
|
24195
|
+
<div class="praxis-decision-inspector__bindings">
|
|
24196
|
+
@for (action of workflowActions(); track action.id) {
|
|
24197
|
+
<article
|
|
24198
|
+
class="praxis-decision-inspector__binding"
|
|
24199
|
+
[class.is-blocked-card]="!action.availability.allowed"
|
|
24200
|
+
[attr.data-action-id]="action.id"
|
|
24201
|
+
>
|
|
24202
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
24203
|
+
<div class="praxis-decision-inspector__item-title-group">
|
|
24204
|
+
<strong class="praxis-decision-inspector__item-title">
|
|
24205
|
+
{{ action.title || action.id }}
|
|
24206
|
+
</strong>
|
|
24207
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
24208
|
+
{{ action.method }} · {{ action.scope }}
|
|
24209
|
+
</code>
|
|
24210
|
+
</div>
|
|
24211
|
+
|
|
24212
|
+
<div class="praxis-decision-inspector__binding-chips">
|
|
24213
|
+
<span
|
|
24214
|
+
class="praxis-decision-inspector__chip"
|
|
24215
|
+
[class.is-success]="action.availability.allowed"
|
|
24216
|
+
[class.is-warning]="!action.availability.allowed"
|
|
24217
|
+
>
|
|
24218
|
+
{{
|
|
24219
|
+
action.availability.allowed
|
|
24220
|
+
? tx('capabilities.allowed')
|
|
24221
|
+
: tx('capabilities.blocked')
|
|
24222
|
+
}}
|
|
24223
|
+
</span>
|
|
24224
|
+
@if (action.execution?.interaction?.riskLevel; as risk) {
|
|
24225
|
+
<span
|
|
24226
|
+
class="praxis-decision-inspector__chip"
|
|
24227
|
+
[class.is-error]="risk === 'HIGH' || risk === 'CRITICAL'"
|
|
24228
|
+
>
|
|
24229
|
+
{{ formatRiskLabel(risk) }}
|
|
24230
|
+
</span>
|
|
24231
|
+
}
|
|
24232
|
+
</div>
|
|
24233
|
+
</div>
|
|
24234
|
+
|
|
24235
|
+
@if (action.description) {
|
|
24236
|
+
<p class="praxis-decision-inspector__binding-message">
|
|
24237
|
+
{{ action.description }}
|
|
24238
|
+
</p>
|
|
24239
|
+
}
|
|
24240
|
+
|
|
24241
|
+
@if (action.availability.reason) {
|
|
24242
|
+
<p class="praxis-decision-inspector__reason-callout">
|
|
24243
|
+
<strong>{{ tx('capabilities.blockedReasonLabel') }}:</strong>
|
|
24244
|
+
{{ action.availability.reason }}
|
|
24245
|
+
</p>
|
|
24246
|
+
}
|
|
24247
|
+
|
|
24248
|
+
@if (hasActionExecutionBadges(action)) {
|
|
24249
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24250
|
+
@if (action.execution?.preconditions?.resourceVersion === 'REQUIRED') {
|
|
24251
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24252
|
+
{{ tx('capabilities.preconditionIfMatch') }}
|
|
24253
|
+
</span>
|
|
24254
|
+
}
|
|
24255
|
+
@if (action.execution?.preconditions?.idempotencyKey === 'REQUIRED') {
|
|
24256
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24257
|
+
{{ tx('capabilities.preconditionIdempotency') }}
|
|
24258
|
+
</span>
|
|
24259
|
+
}
|
|
24260
|
+
@if (action.execution?.interaction?.confirmationRequired) {
|
|
24261
|
+
<span class="praxis-decision-inspector__chip">
|
|
24262
|
+
{{ tx('capabilities.preconditionConfirmation') }}
|
|
24263
|
+
</span>
|
|
24264
|
+
}
|
|
24265
|
+
@if (action.execution?.bulk; as bulkContract) {
|
|
24266
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
24267
|
+
{{
|
|
24268
|
+
tx('capabilities.bulkEnabled', {
|
|
24269
|
+
mode: bulkContract.mode || 'DOMAIN_COMMAND',
|
|
24270
|
+
})
|
|
24271
|
+
}}
|
|
24272
|
+
</span>
|
|
24273
|
+
}
|
|
24274
|
+
</div>
|
|
24275
|
+
}
|
|
24276
|
+
</article>
|
|
24277
|
+
}
|
|
24278
|
+
</div>
|
|
24279
|
+
}
|
|
24280
|
+
</section>
|
|
24281
|
+
|
|
24282
|
+
<!-- Semantic Surfaces (@UiSurface) -->
|
|
24283
|
+
<section
|
|
24284
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
24285
|
+
data-testid="decision-inspector-surfaces"
|
|
24286
|
+
>
|
|
24287
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24288
|
+
{{ tx('capabilities.surfacesHeading') }}
|
|
24289
|
+
</span>
|
|
24290
|
+
|
|
24291
|
+
@if (semanticSurfaces().length === 0) {
|
|
24292
|
+
<p class="praxis-decision-inspector__muted">
|
|
24293
|
+
{{ tx('capabilities.noSurfaces') }}
|
|
24294
|
+
</p>
|
|
24295
|
+
} @else {
|
|
24296
|
+
<div class="praxis-decision-inspector__bindings">
|
|
24297
|
+
@for (surface of semanticSurfaces(); track surface.id) {
|
|
24298
|
+
<article
|
|
24299
|
+
class="praxis-decision-inspector__binding"
|
|
24300
|
+
[class.is-blocked-card]="!surface.availability.allowed"
|
|
24301
|
+
[attr.data-surface-id]="surface.id"
|
|
24302
|
+
>
|
|
24303
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
24304
|
+
<div class="praxis-decision-inspector__item-title-group">
|
|
24305
|
+
<strong class="praxis-decision-inspector__item-title">
|
|
24306
|
+
{{ surface.title || surface.id }}
|
|
24307
|
+
</strong>
|
|
24308
|
+
<span class="praxis-decision-inspector__chip">
|
|
24309
|
+
{{ formatSurfaceKindLabel(surface.kind) }}
|
|
24310
|
+
</span>
|
|
24311
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
24312
|
+
{{ surface.scope }}
|
|
24313
|
+
</code>
|
|
24314
|
+
</div>
|
|
24315
|
+
|
|
24316
|
+
<span
|
|
24317
|
+
class="praxis-decision-inspector__chip"
|
|
24318
|
+
[class.is-success]="surface.availability.allowed"
|
|
24319
|
+
[class.is-warning]="!surface.availability.allowed"
|
|
24320
|
+
>
|
|
24321
|
+
{{
|
|
24322
|
+
surface.availability.allowed
|
|
24323
|
+
? tx('capabilities.allowed')
|
|
24324
|
+
: tx('capabilities.blocked')
|
|
24325
|
+
}}
|
|
24326
|
+
</span>
|
|
24327
|
+
</div>
|
|
24328
|
+
|
|
24329
|
+
@if (surface.description) {
|
|
24330
|
+
<p class="praxis-decision-inspector__binding-message">
|
|
24331
|
+
{{ surface.description }}
|
|
24332
|
+
</p>
|
|
24333
|
+
}
|
|
24334
|
+
|
|
24335
|
+
@if (surface.availability.reason) {
|
|
24336
|
+
<p class="praxis-decision-inspector__reason-callout">
|
|
24337
|
+
<strong>{{ tx('capabilities.blockedReasonLabel') }}:</strong>
|
|
24338
|
+
{{ surface.availability.reason }}
|
|
24339
|
+
</p>
|
|
24340
|
+
}
|
|
24341
|
+
|
|
24342
|
+
@if (surface.relatedResource?.childResourceKey; as childKey) {
|
|
24343
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24344
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
24345
|
+
1:N → {{ childKey }}
|
|
24346
|
+
</code>
|
|
24347
|
+
</div>
|
|
24348
|
+
}
|
|
24349
|
+
</article>
|
|
24350
|
+
}
|
|
24351
|
+
</div>
|
|
24352
|
+
}
|
|
24353
|
+
</section>
|
|
24354
|
+
} @else {
|
|
24355
|
+
<div class="praxis-decision-inspector__status" role="status">
|
|
24356
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
24357
|
+
<strong>{{ tx('capabilities.emptyTitle') }}</strong>
|
|
24358
|
+
<p>{{ tx('capabilities.emptyDescription') }}</p>
|
|
24359
|
+
</div>
|
|
24360
|
+
</div>
|
|
24361
|
+
}
|
|
24362
|
+
</div>
|
|
24363
|
+
}
|
|
24364
|
+
|
|
24365
|
+
<!-- LENS 3: GOVERNANCE & PRIVACY (@DomainGovernance & x-ui.fieldAccess) -->
|
|
24366
|
+
@if (activeLens() === 'governance') {
|
|
24367
|
+
<div
|
|
24368
|
+
id="decision-inspector-lens-panel-governance"
|
|
24369
|
+
role="tabpanel"
|
|
24370
|
+
aria-labelledby="decision-inspector-lens-tab-governance"
|
|
24371
|
+
class="praxis-decision-inspector__lens-panel"
|
|
24372
|
+
data-testid="decision-inspector-panel-governance"
|
|
24373
|
+
>
|
|
24374
|
+
@if (governanceItems().length > 0) {
|
|
24375
|
+
<!-- Executive Governance Summary Strip -->
|
|
24376
|
+
<section class="praxis-decision-inspector__section">
|
|
24377
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24378
|
+
{{ tx('governance.summaryHeading') }}
|
|
24379
|
+
</span>
|
|
24380
|
+
|
|
24381
|
+
<div
|
|
24382
|
+
class="praxis-decision-inspector__kpi-strip"
|
|
24383
|
+
data-testid="decision-inspector-governance-kpis"
|
|
24384
|
+
>
|
|
24385
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
24386
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
24387
|
+
{{ governanceItems().length }}
|
|
24388
|
+
</strong>
|
|
24389
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
24390
|
+
{{ tx('governance.kpiTotal') }}
|
|
24391
|
+
</span>
|
|
24392
|
+
</div>
|
|
24393
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
24394
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
24395
|
+
{{ sensitiveGovernanceCount() }}
|
|
24396
|
+
</strong>
|
|
24397
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
24398
|
+
{{ tx('governance.kpiSensitive') }}
|
|
24399
|
+
</span>
|
|
24400
|
+
</div>
|
|
24401
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
24402
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
24403
|
+
{{ nonExportableGovernanceCount() }}
|
|
24404
|
+
</strong>
|
|
24405
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
24406
|
+
{{ tx('governance.kpiNonExportable') }}
|
|
24407
|
+
</span>
|
|
24408
|
+
</div>
|
|
24409
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
24410
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
24411
|
+
{{ aiRestrictedGovernanceCount() }}
|
|
24412
|
+
</strong>
|
|
24413
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
24414
|
+
{{ tx('governance.kpiAiRestricted') }}
|
|
24415
|
+
</span>
|
|
24416
|
+
</div>
|
|
24417
|
+
</div>
|
|
24418
|
+
</section>
|
|
24419
|
+
|
|
24420
|
+
<!-- Governed Fields & Policies -->
|
|
24421
|
+
<section
|
|
24422
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
24423
|
+
data-testid="decision-inspector-governance-list"
|
|
24424
|
+
>
|
|
24425
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24426
|
+
{{ tx('governance.fieldsHeading') }}
|
|
24427
|
+
</span>
|
|
24428
|
+
|
|
24429
|
+
<div class="praxis-decision-inspector__bindings">
|
|
24430
|
+
@for (gov of sortedGovernanceItems(); track gov.governanceKey) {
|
|
24431
|
+
<article
|
|
24432
|
+
class="praxis-decision-inspector__binding"
|
|
24433
|
+
[attr.data-governance-node]="gov.nodeKey"
|
|
24434
|
+
>
|
|
24435
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
24436
|
+
<div class="praxis-decision-inspector__item-title-group">
|
|
24437
|
+
<strong class="praxis-decision-inspector__item-title">
|
|
24438
|
+
{{ gov.label }}
|
|
24439
|
+
</strong>
|
|
24440
|
+
@if (gov.fieldName && gov.fieldName !== gov.label) {
|
|
24441
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
24442
|
+
{{ gov.fieldName }}
|
|
24443
|
+
</code>
|
|
24444
|
+
}
|
|
24445
|
+
<span class="praxis-decision-inspector__chip">
|
|
24446
|
+
{{ formatGovernanceTargetKind(gov.targetKind) }}
|
|
24447
|
+
</span>
|
|
24448
|
+
</div>
|
|
24449
|
+
|
|
24450
|
+
<div class="praxis-decision-inspector__binding-chips">
|
|
24451
|
+
@if (gov.classification) {
|
|
24452
|
+
<span
|
|
24453
|
+
class="praxis-decision-inspector__chip"
|
|
24454
|
+
[class.is-warning]="isSensitiveClassification(gov.classification)"
|
|
24455
|
+
>
|
|
24456
|
+
{{ formatClassificationLabel(gov.classification) }}
|
|
24457
|
+
</span>
|
|
24458
|
+
}
|
|
24459
|
+
@if (gov.dataCategory) {
|
|
24460
|
+
<span class="praxis-decision-inspector__chip">
|
|
24461
|
+
{{ formatDataCategoryLabel(gov.dataCategory) }}
|
|
24462
|
+
</span>
|
|
24463
|
+
}
|
|
24464
|
+
@if (gov.exportable === false) {
|
|
24465
|
+
<span class="praxis-decision-inspector__chip is-error">
|
|
24466
|
+
{{ tx('governance.exportBlocked') }}
|
|
24467
|
+
</span>
|
|
24468
|
+
} @else if (gov.exportable === true) {
|
|
24469
|
+
<span class="praxis-decision-inspector__chip is-success">
|
|
24470
|
+
{{ tx('governance.exportAllowed') }}
|
|
24471
|
+
</span>
|
|
24472
|
+
}
|
|
24473
|
+
</div>
|
|
24474
|
+
</div>
|
|
24475
|
+
|
|
24476
|
+
@if (gov.fieldAccess) {
|
|
24477
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24478
|
+
@if (gov.fieldAccessEvaluation?.evaluated) {
|
|
24479
|
+
<span
|
|
24480
|
+
class="praxis-decision-inspector__chip"
|
|
24481
|
+
[class.is-success]="gov.fieldAccessEvaluation?.visible"
|
|
24482
|
+
[class.is-error]="!gov.fieldAccessEvaluation?.visible"
|
|
24483
|
+
>
|
|
24484
|
+
{{
|
|
24485
|
+
gov.fieldAccessEvaluation?.visible
|
|
24486
|
+
? tx('governance.fieldAccessVisible')
|
|
24487
|
+
: tx('governance.fieldAccessHidden')
|
|
24488
|
+
}}
|
|
24489
|
+
</span>
|
|
24490
|
+
@if (gov.fieldAccessEvaluation?.visible) {
|
|
24491
|
+
<span
|
|
24492
|
+
class="praxis-decision-inspector__chip"
|
|
24493
|
+
[class.is-warning]="!gov.fieldAccessEvaluation?.editable"
|
|
24494
|
+
>
|
|
24495
|
+
{{
|
|
24496
|
+
gov.fieldAccessEvaluation?.editable
|
|
24497
|
+
? tx('governance.fieldAccessEditable')
|
|
24498
|
+
: tx('governance.fieldAccessReadOnly')
|
|
24499
|
+
}}
|
|
24500
|
+
</span>
|
|
24501
|
+
}
|
|
24502
|
+
} @else {
|
|
24503
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
24504
|
+
{{ tx('governance.fieldAccessDeclared') }}
|
|
24505
|
+
</span>
|
|
24506
|
+
}
|
|
24507
|
+
</div>
|
|
24508
|
+
|
|
24509
|
+
@if (gov.fieldAccess.reason) {
|
|
24510
|
+
<p class="praxis-decision-inspector__reason-callout">
|
|
24511
|
+
{{ gov.fieldAccess.reason }}
|
|
24512
|
+
</p>
|
|
24513
|
+
}
|
|
24514
|
+
}
|
|
24515
|
+
|
|
24516
|
+
@if (gov.complianceTags.length > 0 || gov.aiVisibility || gov.aiRestrictions.length > 0) {
|
|
24517
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24518
|
+
@for (tag of gov.complianceTags; track tag) {
|
|
24519
|
+
<code class="praxis-decision-inspector__fact-chip">{{ tag }}</code>
|
|
24520
|
+
}
|
|
24521
|
+
@if (gov.aiVisibility) {
|
|
24522
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24523
|
+
{{ tx('governance.aiPolicyLabel') }}: {{ gov.aiVisibility }}
|
|
24524
|
+
</span>
|
|
24525
|
+
}
|
|
24526
|
+
@for (restriction of gov.aiRestrictions; track restriction) {
|
|
24527
|
+
<span class="praxis-decision-inspector__chip is-warning">
|
|
24528
|
+
{{ restriction }}
|
|
24529
|
+
</span>
|
|
24530
|
+
}
|
|
24531
|
+
</div>
|
|
24532
|
+
}
|
|
24533
|
+
|
|
24534
|
+
@if (gov.retentionPolicy || gov.owner || gov.steward) {
|
|
24535
|
+
<div class="praxis-decision-inspector__binding-meta">
|
|
24536
|
+
@if (gov.retentionPolicy) {
|
|
24537
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24538
|
+
<strong>{{ tx('governance.retentionLabel') }}:</strong>
|
|
24539
|
+
<code>{{ gov.retentionPolicy }}</code>
|
|
24540
|
+
</span>
|
|
24541
|
+
}
|
|
24542
|
+
@if (gov.owner) {
|
|
24543
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24544
|
+
<strong>{{ tx('governance.ownerLabel') }}:</strong>
|
|
24545
|
+
<span>{{ gov.owner }}</span>
|
|
24546
|
+
</span>
|
|
24547
|
+
}
|
|
24548
|
+
@if (gov.steward) {
|
|
24549
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24550
|
+
<strong>{{ tx('governance.stewardLabel') }}:</strong>
|
|
24551
|
+
<span>{{ gov.steward }}</span>
|
|
24552
|
+
</span>
|
|
24553
|
+
}
|
|
24554
|
+
</div>
|
|
24555
|
+
}
|
|
24556
|
+
</article>
|
|
24557
|
+
}
|
|
24558
|
+
</div>
|
|
24559
|
+
</section>
|
|
24560
|
+
} @else {
|
|
24561
|
+
<div class="praxis-decision-inspector__status" role="status">
|
|
24562
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
24563
|
+
<strong>{{ tx('governance.emptyTitle') }}</strong>
|
|
24564
|
+
<p>{{ tx('governance.emptyDescription') }}</p>
|
|
24565
|
+
</div>
|
|
24566
|
+
</div>
|
|
24567
|
+
}
|
|
24568
|
+
|
|
24569
|
+
<!-- Anti-Oracle Security Guarantee Notice (CC07) -->
|
|
24570
|
+
<div
|
|
24571
|
+
class="praxis-decision-inspector__privacy-note"
|
|
24572
|
+
data-testid="decision-inspector-anti-oracle-note"
|
|
24573
|
+
>
|
|
24574
|
+
<span class="material-symbols-outlined praxis-decision-inspector__privacy-icon" aria-hidden="true">
|
|
24575
|
+
shield_lock
|
|
24576
|
+
</span>
|
|
24577
|
+
<span>{{ tx('governance.antiOracleNotice') }}</span>
|
|
24578
|
+
</div>
|
|
24579
|
+
</div>
|
|
24580
|
+
}
|
|
24581
|
+
}
|
|
24582
|
+
}
|
|
24583
|
+
|
|
24584
|
+
<!-- 3. Governed External Handoff to Praxis Rules Studio -->
|
|
24585
|
+
@if (effectiveStudioUrl(); as studioHref) {
|
|
24586
|
+
<footer
|
|
24587
|
+
class="praxis-decision-inspector__footer"
|
|
24588
|
+
data-testid="decision-inspector-studio-handoff"
|
|
24589
|
+
>
|
|
24590
|
+
<p class="praxis-decision-inspector__footer-hint">
|
|
24591
|
+
{{ tx('studio.handoffHint') }}
|
|
24592
|
+
</p>
|
|
24593
|
+
<a
|
|
24594
|
+
class="praxis-decision-inspector__studio-link"
|
|
24595
|
+
[href]="studioHref"
|
|
24596
|
+
target="_blank"
|
|
24597
|
+
rel="noopener noreferrer"
|
|
24598
|
+
data-testid="decision-inspector-open-studio-link"
|
|
24599
|
+
>
|
|
24600
|
+
<span class="material-symbols-outlined" aria-hidden="true">open_in_new</span>
|
|
24601
|
+
<span>{{ tx('studio.openAction') }}</span>
|
|
24602
|
+
</a>
|
|
24603
|
+
</footer>
|
|
24604
|
+
}
|
|
24605
|
+
</div>
|
|
24606
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.praxis-decision-inspector{display:flex;flex-direction:column;gap:18px;padding:4px 2px 16px;color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-inspector__lens-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px;border-radius:12px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .1));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}@media(max-width:560px){.praxis-decision-inspector__lens-bar{grid-template-columns:1fr}}.praxis-decision-inspector__lens-tab{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:6px 10px;border-radius:9px;border:1px solid transparent;background:transparent;color:var(--md-sys-color-on-surface-variant, #64748b);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .14s ease,color .14s ease,border-color .14s ease}.praxis-decision-inspector__lens-tab:hover{color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-inspector__lens-tab.is-active{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,var(--md-sys-color-surface-container-high, transparent));border-color:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 42%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__lens-icon{font-size:16px;flex-shrink:0}.praxis-decision-inspector__lens-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.praxis-decision-inspector__lens-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;font-size:10.5px;font-weight:700;background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 10%,transparent)}.praxis-decision-inspector__lens-tab.is-active .praxis-decision-inspector__lens-count{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 22%,transparent)}.praxis-decision-inspector__lens-panel{display:flex;flex-direction:column;gap:18px}.praxis-decision-inspector__section{display:flex;flex-direction:column;gap:10px}.praxis-decision-inspector__section--divider{padding-top:16px;border-top:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__section-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap}.praxis-decision-inspector__eyebrow{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__description,.praxis-decision-inspector__muted{margin:0;font-size:13px;line-height:1.45;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__xray{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--md-sys-color-error-container, rgba(220, 38, 38, .14)) 42%,var(--md-sys-color-surface-container, transparent));border:1px solid color-mix(in srgb,var(--md-sys-color-error, #dc2626) 45%,transparent)}.praxis-decision-inspector__xray-header{display:flex;align-items:center;gap:8px;color:var(--md-sys-color-error, #dc2626)}.praxis-decision-inspector__xray-icon{font-size:18px}.praxis-decision-inspector__xray-title{font-size:13px;font-weight:700}.praxis-decision-inspector__xray-list{display:flex;flex-direction:column;gap:8px}.praxis-decision-inspector__xray-item{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border-radius:8px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high, rgba(15, 23, 42, .2)) 78%,transparent)}.praxis-decision-inspector__xray-item.is-clickable{cursor:pointer}.praxis-decision-inspector__xray-item.is-clickable:focus-visible,.praxis-decision-inspector__lens-tab:focus-visible,.praxis-decision-inspector__ruleset-pill:focus-visible,.praxis-decision-inspector__action-btn:focus-visible,.praxis-decision-inspector__studio-link:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.praxis-decision-inspector__xray-badges{display:flex;flex-wrap:wrap;gap:6px}.praxis-decision-inspector__xray-message{margin:0;font-size:13px;font-weight:500;line-height:1.4}.praxis-decision-inspector__chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 9%,transparent);color:var(--md-sys-color-on-surface-variant, inherit)}.praxis-decision-inspector__chip.is-mono{font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)}.praxis-decision-inspector__chip.is-error{background:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 18%,transparent);color:var(--md-sys-color-error, #dc2626)}.praxis-decision-inspector__chip.is-warning{background:color-mix(in srgb,var(--praxis-warning, #d97706) 18%,transparent);color:var(--praxis-warning, #d97706)}.praxis-decision-inspector__chip.is-success{background:color-mix(in srgb,var(--praxis-success, #059669) 16%,transparent);color:var(--praxis-success, #059669)}.praxis-decision-inspector__chip.is-accent{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 16%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__ruleset-pills{display:flex;flex-wrap:wrap;gap:8px}.praxis-decision-inspector__ruleset-pill{appearance:none;display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;cursor:pointer;font-family:inherit;font-size:12.5px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .1));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 65%,transparent);color:var(--md-sys-color-on-surface, inherit);transition:border-color .14s ease,background-color .14s ease}.praxis-decision-inspector__ruleset-pill.is-active{border-color:var(--md-sys-color-primary, #4f46e5);background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,var(--md-sys-color-surface-container, transparent))}.praxis-decision-inspector__ruleset-op{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__ruleset-label{font-weight:600}.praxis-decision-inspector__slot-heading{margin:2px 0 0;font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:14px;font-weight:700}.praxis-decision-inspector__slot-badges,.praxis-decision-inspector__binding-chips{display:flex;flex-wrap:wrap;gap:6px}.praxis-decision-inspector__bindings{display:flex;flex-direction:column;gap:10px}.praxis-decision-inspector__binding{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:10px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__binding.is-violated{border-color:var(--md-sys-color-error, #dc2626)}.praxis-decision-inspector__binding.is-blocked-card{border-style:dashed}.praxis-decision-inspector__binding-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.praxis-decision-inspector__item-title-group{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.praxis-decision-inspector__item-title{font-size:13px;font-weight:600}.praxis-decision-inspector__binding-key{font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:12px;font-weight:600}.praxis-decision-inspector__binding-message{margin:0;font-size:13px;line-height:1.4}.praxis-decision-inspector__reason-callout{margin:2px 0 0;padding:6px 10px;border-radius:8px;font-size:12px;line-height:1.4;background:color-mix(in srgb,var(--praxis-warning, #d97706) 11%,transparent);color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-inspector__ops-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:8px}.praxis-decision-inspector__op-pill{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border-radius:9px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 50%,transparent)}.praxis-decision-inspector__op-pill.is-blocked{opacity:.72;border-style:dashed}.praxis-decision-inspector__op-main{display:flex;align-items:center;gap:6px}.praxis-decision-inspector__op-icon{font-size:16px;color:var(--praxis-success, #059669)}.praxis-decision-inspector__op-pill.is-blocked .praxis-decision-inspector__op-icon{color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__op-label{font-size:12px;font-weight:600}.praxis-decision-inspector__op-reason{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__kpi-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}@media(max-width:560px){.praxis-decision-inspector__kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}.praxis-decision-inspector__kpi-tile{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border-radius:10px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 50%,transparent)}.praxis-decision-inspector__kpi-value{font-size:18px;font-weight:700;line-height:1.2}.praxis-decision-inspector__kpi-label{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__privacy-note{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;font-size:11.5px;line-height:1.4;color:var(--md-sys-color-on-surface-variant, #64748b);background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 5%,transparent)}.praxis-decision-inspector__privacy-icon{font-size:16px;flex-shrink:0}.praxis-decision-inspector__binding-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:11.5px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__meta-item{display:inline-flex;align-items:center;gap:4px}.praxis-decision-inspector__roots{display:flex;flex-direction:column;gap:8px}.praxis-decision-inspector__root-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.praxis-decision-inspector__root-pill{padding:2px 8px;border-radius:6px;font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:11.5px;font-weight:700;background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__fact-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.praxis-decision-inspector__fact-label{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__fact-chip{padding:2px 6px;border-radius:6px;font-size:11px;background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 7%,transparent)}.praxis-decision-inspector__facts-block{display:flex;flex-direction:column;gap:8px;margin-top:6px}.praxis-decision-inspector__status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border-radius:12px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__status-copy{display:flex;flex-direction:column;gap:4px}.praxis-decision-inspector__status-copy p{margin:0;font-size:12.5px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__action-btn,.praxis-decision-inspector__studio-link{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer;border:1px solid color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 38%,transparent);background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,transparent);color:var(--md-sys-color-primary, #4f46e5);white-space:nowrap}.praxis-decision-inspector__studio-link .material-symbols-outlined{font-size:16px}.praxis-decision-inspector__footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:14px;border-top:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__footer-hint{margin:0;font-size:12px;color:var(--md-sys-color-on-surface-variant, #64748b);flex:1 1 240px}\n"], dependencies: [{ kind: "component", type: PraxisRuleDecisionDagComponent, selector: "praxis-rule-decision-dag", inputs: ["slots", "bindings", "selectedSlotKey", "violatedSlotKeys"], outputs: ["slotSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
24607
|
+
}
|
|
24608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisDecisionInspectorSurfaceComponent, decorators: [{
|
|
24609
|
+
type: Component,
|
|
24610
|
+
args: [{ selector: 'praxis-decision-inspector-surface', standalone: true, imports: [PraxisRuleDecisionDagComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
24611
|
+
<div class="praxis-decision-inspector" data-testid="praxis-decision-inspector-surface">
|
|
24612
|
+
<!-- 1. Explainable X-Ray Callout when 422/409 Rule Violations are present -->
|
|
24613
|
+
@if (effectiveViolations().length > 0) {
|
|
24614
|
+
<section
|
|
24615
|
+
class="praxis-decision-inspector__xray"
|
|
24616
|
+
role="region"
|
|
24617
|
+
[attr.aria-label]="tx('violation.bannerTitle')"
|
|
24618
|
+
data-testid="decision-inspector-xray-banner"
|
|
24619
|
+
>
|
|
24620
|
+
<div class="praxis-decision-inspector__xray-header">
|
|
24621
|
+
<span class="material-symbols-outlined praxis-decision-inspector__xray-icon" aria-hidden="true">
|
|
24622
|
+
policy
|
|
24623
|
+
</span>
|
|
24624
|
+
<strong class="praxis-decision-inspector__xray-title">
|
|
24625
|
+
{{ tx('violation.bannerTitle') }}
|
|
24626
|
+
</strong>
|
|
24627
|
+
</div>
|
|
24628
|
+
|
|
24629
|
+
<div class="praxis-decision-inspector__xray-list">
|
|
24630
|
+
@for (violation of effectiveViolations(); track $index) {
|
|
24631
|
+
<div
|
|
24632
|
+
class="praxis-decision-inspector__xray-item"
|
|
24633
|
+
[class.is-clickable]="!!violation.slotKey"
|
|
24634
|
+
[attr.role]="violation.slotKey ? 'button' : null"
|
|
24635
|
+
[attr.tabindex]="violation.slotKey ? 0 : null"
|
|
24636
|
+
(click)="focusViolation(violation)"
|
|
24637
|
+
(keydown.enter)="focusViolation(violation)"
|
|
24638
|
+
(keydown.space)="onViolationKeydownSpace($event, violation)"
|
|
24639
|
+
>
|
|
24640
|
+
<div class="praxis-decision-inspector__xray-badges">
|
|
24641
|
+
@if (violation.code) {
|
|
24642
|
+
<span class="praxis-decision-inspector__chip is-error">
|
|
24643
|
+
{{ violation.code }}
|
|
24644
|
+
</span>
|
|
24645
|
+
}
|
|
24646
|
+
@if (violation.stage) {
|
|
24647
|
+
<span class="praxis-decision-inspector__chip">
|
|
24648
|
+
{{ tx('violation.stage') }}: {{ formatStageLabel(violation.stage) }}
|
|
24649
|
+
</span>
|
|
24650
|
+
}
|
|
24651
|
+
@if (violation.source) {
|
|
24652
|
+
<span class="praxis-decision-inspector__chip">
|
|
24653
|
+
{{ tx('violation.source') }}: {{ formatSourceLabel(violation.source) }}
|
|
24654
|
+
</span>
|
|
24655
|
+
}
|
|
24656
|
+
@if (violation.slotKey) {
|
|
24657
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24658
|
+
{{ violation.slotKey }}
|
|
24659
|
+
</span>
|
|
24660
|
+
}
|
|
24661
|
+
@if (violation.targetField) {
|
|
24662
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24663
|
+
{{ tx('violation.targetField') }}: {{ violation.targetField }}
|
|
24664
|
+
</span>
|
|
24665
|
+
}
|
|
24666
|
+
@if (violation.lineage) {
|
|
24667
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24668
|
+
{{ tx('violation.lineage') }}: {{ violation.lineage }}
|
|
24669
|
+
</span>
|
|
24670
|
+
}
|
|
24671
|
+
</div>
|
|
24672
|
+
<p class="praxis-decision-inspector__xray-message">
|
|
24673
|
+
{{ violation.message }}
|
|
24674
|
+
</p>
|
|
24675
|
+
</div>
|
|
24676
|
+
}
|
|
24677
|
+
</div>
|
|
24678
|
+
</section>
|
|
24679
|
+
}
|
|
24680
|
+
|
|
24681
|
+
<!-- 2. Catalog Loading / Error / Unified 3-Lens Ready Surface -->
|
|
24682
|
+
@switch (loadState()) {
|
|
24683
|
+
@case ('loading') {
|
|
24684
|
+
<div class="praxis-decision-inspector__status" role="status" aria-live="polite">
|
|
24685
|
+
<span class="material-symbols-outlined praxis-decision-inspector__spinner" aria-hidden="true">
|
|
24686
|
+
progress_activity
|
|
24687
|
+
</span>
|
|
24688
|
+
<span>{{ tx('state.loading') }}</span>
|
|
24689
|
+
</div>
|
|
24690
|
+
}
|
|
24691
|
+
@case ('error') {
|
|
24692
|
+
<div class="praxis-decision-inspector__status is-error" role="alert">
|
|
24693
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
24694
|
+
<strong>{{ tx('state.errorTitle') }}</strong>
|
|
24695
|
+
<p>{{ tx('state.errorDescription') }}</p>
|
|
24696
|
+
</div>
|
|
24697
|
+
<button
|
|
24698
|
+
type="button"
|
|
24699
|
+
class="praxis-decision-inspector__action-btn"
|
|
24700
|
+
(click)="reload(true)"
|
|
24701
|
+
>
|
|
24702
|
+
{{ tx('state.retry') }}
|
|
24703
|
+
</button>
|
|
24704
|
+
</div>
|
|
24705
|
+
}
|
|
24706
|
+
@default {
|
|
24707
|
+
<!-- Unified 3-Lens Segmented Tab Bar -->
|
|
24708
|
+
<div
|
|
24709
|
+
class="praxis-decision-inspector__lens-bar"
|
|
24710
|
+
role="tablist"
|
|
24711
|
+
[attr.aria-label]="tx('lens.ariaLabel')"
|
|
24712
|
+
data-testid="decision-inspector-lens-tabs"
|
|
24713
|
+
>
|
|
24714
|
+
@for (lens of lensDescriptors(); track lens.id; let lensIdx = $index) {
|
|
24715
|
+
<button
|
|
24716
|
+
type="button"
|
|
24717
|
+
role="tab"
|
|
24718
|
+
[id]="'decision-inspector-lens-tab-' + lens.id"
|
|
24719
|
+
class="praxis-decision-inspector__lens-tab"
|
|
24720
|
+
[class.is-active]="activeLens() === lens.id"
|
|
24721
|
+
[attr.aria-selected]="activeLens() === lens.id"
|
|
24722
|
+
[attr.aria-controls]="'decision-inspector-lens-panel-' + lens.id"
|
|
24723
|
+
[attr.tabindex]="activeLens() === lens.id ? 0 : -1"
|
|
24724
|
+
[attr.data-testid]="'decision-inspector-lens-' + lens.id"
|
|
24725
|
+
(click)="selectLens(lens.id)"
|
|
24726
|
+
(keydown)="onLensTabKeydown($event, lensIdx)"
|
|
24727
|
+
>
|
|
24728
|
+
<span class="material-symbols-outlined praxis-decision-inspector__lens-icon" aria-hidden="true">
|
|
24729
|
+
{{ lens.icon }}
|
|
24730
|
+
</span>
|
|
24731
|
+
<span class="praxis-decision-inspector__lens-label">{{ lens.label }}</span>
|
|
24732
|
+
<span class="praxis-decision-inspector__lens-count">{{ lens.count }}</span>
|
|
24733
|
+
</button>
|
|
24734
|
+
}
|
|
24735
|
+
</div>
|
|
24736
|
+
|
|
24737
|
+
<!-- LENS 1: BUSINESS RULES (5-Stage DAG, Slots, Bindings, Ontological Facts) -->
|
|
24738
|
+
@if (activeLens() === 'business') {
|
|
24739
|
+
<div
|
|
24740
|
+
id="decision-inspector-lens-panel-business"
|
|
24741
|
+
role="tabpanel"
|
|
24742
|
+
aria-labelledby="decision-inspector-lens-tab-business"
|
|
24743
|
+
class="praxis-decision-inspector__lens-panel"
|
|
24744
|
+
data-testid="decision-inspector-panel-business"
|
|
24745
|
+
>
|
|
24746
|
+
@if (selectedRuleSet(); as activeRuleSet) {
|
|
24747
|
+
<!-- Operation / RuleSet Selector -->
|
|
24748
|
+
<section class="praxis-decision-inspector__section">
|
|
24749
|
+
<div class="praxis-decision-inspector__section-top">
|
|
24750
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24751
|
+
{{ tx('operations.label') }}
|
|
24752
|
+
</span>
|
|
24753
|
+
@if (activeRuleSet.failPolicy) {
|
|
24754
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24755
|
+
{{ activeRuleSet.failPolicy }}
|
|
24756
|
+
</span>
|
|
24757
|
+
}
|
|
24758
|
+
</div>
|
|
24759
|
+
|
|
24760
|
+
<div
|
|
24761
|
+
class="praxis-decision-inspector__ruleset-pills"
|
|
24762
|
+
role="tablist"
|
|
24763
|
+
[attr.aria-label]="tx('operations.label')"
|
|
24764
|
+
>
|
|
24765
|
+
@for (ruleSet of ruleSets(); track ruleSet.nodeKey; let idx = $index) {
|
|
24766
|
+
<button
|
|
24767
|
+
type="button"
|
|
24768
|
+
role="tab"
|
|
24769
|
+
[id]="'decision-inspector-tab-' + idx"
|
|
24770
|
+
class="praxis-decision-inspector__ruleset-pill"
|
|
24771
|
+
[class.is-active]="ruleSet.nodeKey === activeRuleSet.nodeKey"
|
|
24772
|
+
[attr.aria-selected]="ruleSet.nodeKey === activeRuleSet.nodeKey"
|
|
24773
|
+
[attr.aria-controls]="'decision-inspector-tabpanel'"
|
|
24774
|
+
[attr.tabindex]="ruleSet.nodeKey === activeRuleSet.nodeKey ? 0 : -1"
|
|
24775
|
+
[attr.data-ruleset-key]="ruleSet.ruleSetKey"
|
|
24776
|
+
(click)="selectRuleSet(ruleSet)"
|
|
24777
|
+
(keydown)="onRuleSetTabKeydown($event, idx)"
|
|
24778
|
+
>
|
|
24779
|
+
<span class="praxis-decision-inspector__ruleset-op">
|
|
24780
|
+
{{ ruleSet.operationKey || tx('operations.defaultOperation') }}
|
|
24781
|
+
</span>
|
|
24782
|
+
<span class="praxis-decision-inspector__ruleset-label">
|
|
24783
|
+
{{ ruleSet.label }}
|
|
24784
|
+
</span>
|
|
24785
|
+
</button>
|
|
24786
|
+
}
|
|
24787
|
+
</div>
|
|
24788
|
+
|
|
24789
|
+
@if (activeRuleSet.description) {
|
|
24790
|
+
<p class="praxis-decision-inspector__description">
|
|
24791
|
+
{{ activeRuleSet.description }}
|
|
24792
|
+
</p>
|
|
24793
|
+
}
|
|
24794
|
+
</section>
|
|
24795
|
+
|
|
24796
|
+
<!-- 5-Stage Canonical Decision DAG -->
|
|
24797
|
+
<div id="decision-inspector-tabpanel" role="tabpanel" class="praxis-decision-inspector__lens-panel">
|
|
24798
|
+
<section class="praxis-decision-inspector__section praxis-decision-inspector__section--divider">
|
|
24799
|
+
<praxis-rule-decision-dag
|
|
24800
|
+
[slots]="activeRuleSet.slots"
|
|
24801
|
+
[bindings]="activeRuleSet.bindings"
|
|
24802
|
+
[selectedSlotKey]="selectedSlotKey()"
|
|
24803
|
+
[violatedSlotKeys]="violatedSlotKeys()"
|
|
24804
|
+
(slotSelected)="selectSlot($event)"
|
|
24805
|
+
/>
|
|
24806
|
+
</section>
|
|
24807
|
+
|
|
24808
|
+
<!-- Selected Slot & Active Bindings Detail -->
|
|
24809
|
+
@if (selectedSlot(); as activeSlot) {
|
|
24810
|
+
<section
|
|
24811
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
24812
|
+
data-testid="decision-inspector-slot-detail"
|
|
24813
|
+
>
|
|
24814
|
+
<div class="praxis-decision-inspector__section-top">
|
|
24815
|
+
<div>
|
|
24816
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24817
|
+
{{ tx('slotDetail.heading') }}
|
|
24818
|
+
</span>
|
|
24819
|
+
<h3 class="praxis-decision-inspector__slot-heading">
|
|
24820
|
+
{{ activeSlot.slotKey }}
|
|
24821
|
+
</h3>
|
|
24822
|
+
</div>
|
|
24823
|
+
<div class="praxis-decision-inspector__slot-badges">
|
|
24824
|
+
@if (activeSlot.overridePolicy) {
|
|
24825
|
+
<span class="praxis-decision-inspector__chip">
|
|
24826
|
+
{{ tx('slotDetail.overridePolicy') }}:
|
|
24827
|
+
{{ formatPolicyLabel(activeSlot.overridePolicy) }}
|
|
24828
|
+
</span>
|
|
24829
|
+
}
|
|
24830
|
+
@if (activeSlot.aggregationPolicy) {
|
|
24831
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24832
|
+
{{ tx('slotDetail.aggregation') }}: {{ activeSlot.aggregationPolicy }}
|
|
24833
|
+
</span>
|
|
24834
|
+
}
|
|
24835
|
+
@if (activeSlot.templateKey) {
|
|
24836
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24837
|
+
{{ tx('slotDetail.templateKey') }}: {{ activeSlot.templateKey }}
|
|
24838
|
+
</span>
|
|
24839
|
+
}
|
|
24840
|
+
</div>
|
|
24841
|
+
</div>
|
|
24842
|
+
|
|
24843
|
+
@if (selectedSlotBindings().length === 0) {
|
|
24844
|
+
<p class="praxis-decision-inspector__muted">
|
|
24845
|
+
{{ tx('slotDetail.noBindings') }}
|
|
24846
|
+
</p>
|
|
24847
|
+
} @else {
|
|
24848
|
+
<div class="praxis-decision-inspector__bindings">
|
|
24849
|
+
@for (binding of selectedSlotBindings(); track binding.bindingKey) {
|
|
24850
|
+
<article
|
|
24851
|
+
class="praxis-decision-inspector__binding"
|
|
24852
|
+
[class.is-violated]="isBindingViolated(binding)"
|
|
24853
|
+
[attr.data-binding-key]="binding.bindingKey"
|
|
24854
|
+
>
|
|
24855
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
24856
|
+
<span class="praxis-decision-inspector__binding-key">
|
|
24857
|
+
{{ binding.bindingKey }}
|
|
24858
|
+
</span>
|
|
24859
|
+
<div class="praxis-decision-inspector__binding-chips">
|
|
24860
|
+
@if (binding.reasonCode) {
|
|
24861
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
24862
|
+
{{ binding.reasonCode }}
|
|
24863
|
+
</span>
|
|
24864
|
+
}
|
|
24865
|
+
@if (binding.source) {
|
|
24866
|
+
<span class="praxis-decision-inspector__chip">
|
|
24867
|
+
{{ formatSourceLabel(binding.source) }}
|
|
24868
|
+
</span>
|
|
24869
|
+
}
|
|
24870
|
+
@if (binding.falseDecision) {
|
|
24871
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24872
|
+
{{ binding.falseDecision }}
|
|
24873
|
+
</span>
|
|
24874
|
+
}
|
|
24875
|
+
</div>
|
|
24876
|
+
</div>
|
|
24877
|
+
|
|
24878
|
+
@if (binding.message) {
|
|
24879
|
+
<p class="praxis-decision-inspector__binding-message">
|
|
24880
|
+
{{ binding.message }}
|
|
24881
|
+
</p>
|
|
24882
|
+
}
|
|
24883
|
+
|
|
24884
|
+
<div class="praxis-decision-inspector__binding-meta">
|
|
24885
|
+
@if (binding.targetField) {
|
|
24886
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24887
|
+
<strong>{{ tx('binding.targetField') }}:</strong>
|
|
24888
|
+
<code>{{ binding.targetField }}</code>
|
|
24889
|
+
</span>
|
|
24890
|
+
}
|
|
24891
|
+
@if (binding.lineage) {
|
|
24892
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
24893
|
+
<strong>{{ tx('binding.lineage') }}:</strong>
|
|
24894
|
+
<code>{{ binding.lineage }}</code>
|
|
24895
|
+
</span>
|
|
24896
|
+
}
|
|
24897
|
+
</div>
|
|
24898
|
+
|
|
24899
|
+
@if (binding.referencedFactPaths?.length) {
|
|
24900
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24901
|
+
<span class="praxis-decision-inspector__fact-label">
|
|
24902
|
+
{{ tx('binding.factPaths') }}:
|
|
24903
|
+
</span>
|
|
24904
|
+
@for (factPath of binding.referencedFactPaths; track factPath) {
|
|
24905
|
+
<code class="praxis-decision-inspector__fact-chip">{{ factPath }}</code>
|
|
24906
|
+
}
|
|
24907
|
+
</div>
|
|
24908
|
+
}
|
|
24909
|
+
</article>
|
|
24910
|
+
}
|
|
24911
|
+
</div>
|
|
24912
|
+
}
|
|
24913
|
+
</section>
|
|
24914
|
+
}
|
|
24915
|
+
|
|
24916
|
+
<!-- Ontological Roots & Deterministic Resource Facts -->
|
|
24917
|
+
<section class="praxis-decision-inspector__section praxis-decision-inspector__section--divider">
|
|
24918
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24919
|
+
{{ tx('roots.heading') }}
|
|
24920
|
+
</span>
|
|
24921
|
+
<div class="praxis-decision-inspector__roots">
|
|
24922
|
+
@for (root of activeRoots(); track root.rootKey) {
|
|
24923
|
+
<div class="praxis-decision-inspector__root-group">
|
|
24924
|
+
<span class="praxis-decision-inspector__root-pill">{{ root.rootKey }}</span>
|
|
24925
|
+
@if (root.paths.length > 0) {
|
|
24926
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24927
|
+
@for (path of root.paths; track path) {
|
|
24928
|
+
<code class="praxis-decision-inspector__fact-chip">{{ path }}</code>
|
|
24929
|
+
}
|
|
24930
|
+
</div>
|
|
24931
|
+
}
|
|
24932
|
+
</div>
|
|
24933
|
+
} @empty {
|
|
24934
|
+
<p class="praxis-decision-inspector__muted">{{ tx('roots.empty') }}</p>
|
|
24935
|
+
}
|
|
24936
|
+
</div>
|
|
24937
|
+
|
|
24938
|
+
@if (resourceFacts().length > 0) {
|
|
24939
|
+
<div class="praxis-decision-inspector__facts-block">
|
|
24940
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24941
|
+
{{ tx('facts.heading') }}
|
|
24942
|
+
</span>
|
|
24943
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
24944
|
+
@for (fact of resourceFacts(); track fact.key) {
|
|
24945
|
+
<span class="praxis-decision-inspector__chip">
|
|
24946
|
+
{{ fact.label }}
|
|
24947
|
+
@if (fact.factPath) {
|
|
24948
|
+
<code>({{ fact.factPath }})</code>
|
|
24949
|
+
}
|
|
24950
|
+
</span>
|
|
24951
|
+
}
|
|
24952
|
+
</div>
|
|
24953
|
+
</div>
|
|
24954
|
+
}
|
|
24955
|
+
</section>
|
|
24956
|
+
</div>
|
|
24957
|
+
} @else {
|
|
24958
|
+
<div class="praxis-decision-inspector__status" role="status">
|
|
24959
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
24960
|
+
<strong>{{ tx('state.emptyTitle') }}</strong>
|
|
24961
|
+
<p>{{ tx('state.emptyDescription') }}</p>
|
|
24962
|
+
</div>
|
|
24963
|
+
</div>
|
|
24964
|
+
}
|
|
24965
|
+
</div>
|
|
24966
|
+
}
|
|
24967
|
+
|
|
24968
|
+
<!-- LENS 2: LIFECYCLE & CAPABILITIES (/capabilities, @WorkflowAction, @UiSurface) -->
|
|
24969
|
+
@if (activeLens() === 'capabilities') {
|
|
24970
|
+
<div
|
|
24971
|
+
id="decision-inspector-lens-panel-capabilities"
|
|
24972
|
+
role="tabpanel"
|
|
24973
|
+
aria-labelledby="decision-inspector-lens-tab-capabilities"
|
|
24974
|
+
class="praxis-decision-inspector__lens-panel"
|
|
24975
|
+
data-testid="decision-inspector-panel-capabilities"
|
|
24976
|
+
>
|
|
24977
|
+
@if (capabilitiesContext(); as capCtx) {
|
|
24978
|
+
<!-- Scope & Canonical Operations -->
|
|
24979
|
+
<section class="praxis-decision-inspector__section">
|
|
24980
|
+
<div class="praxis-decision-inspector__section-top">
|
|
24981
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
24982
|
+
{{ tx('capabilities.operationsHeading') }}
|
|
24983
|
+
</span>
|
|
24984
|
+
<div class="praxis-decision-inspector__slot-badges">
|
|
24985
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
24986
|
+
{{
|
|
24987
|
+
capCtx.scope === 'ITEM' && capCtx.resourceId !== null && capCtx.resourceId !== undefined
|
|
24988
|
+
? tx('capabilities.scopeItem', { id: capCtx.resourceId })
|
|
24989
|
+
: tx('capabilities.scopeCollection')
|
|
24990
|
+
}}
|
|
24991
|
+
</span>
|
|
24992
|
+
@if (capCtx.resourcePath) {
|
|
24993
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
24994
|
+
{{ capCtx.resourcePath }}
|
|
24995
|
+
</span>
|
|
24996
|
+
}
|
|
24997
|
+
</div>
|
|
24998
|
+
</div>
|
|
24999
|
+
|
|
25000
|
+
@if (canonicalOperationChips().length > 0) {
|
|
25001
|
+
<div
|
|
25002
|
+
class="praxis-decision-inspector__ops-grid"
|
|
25003
|
+
data-testid="decision-inspector-canonical-ops"
|
|
25004
|
+
>
|
|
25005
|
+
@for (op of canonicalOperationChips(); track op.key) {
|
|
25006
|
+
<div
|
|
25007
|
+
class="praxis-decision-inspector__op-pill"
|
|
25008
|
+
[class.is-supported]="op.supported && op.allowed"
|
|
25009
|
+
[class.is-blocked]="!op.supported || !op.allowed"
|
|
25010
|
+
[attr.data-op-key]="op.key"
|
|
25011
|
+
>
|
|
25012
|
+
<div class="praxis-decision-inspector__op-main">
|
|
25013
|
+
<span class="material-symbols-outlined praxis-decision-inspector__op-icon" aria-hidden="true">
|
|
25014
|
+
{{ op.supported && op.allowed ? 'check_circle' : 'block' }}
|
|
25015
|
+
</span>
|
|
25016
|
+
<span class="praxis-decision-inspector__op-label">{{ op.label }}</span>
|
|
25017
|
+
</div>
|
|
25018
|
+
@if (op.reason) {
|
|
25019
|
+
<span class="praxis-decision-inspector__op-reason">{{ op.reason }}</span>
|
|
25020
|
+
}
|
|
25021
|
+
</div>
|
|
25022
|
+
}
|
|
25023
|
+
</div>
|
|
25024
|
+
}
|
|
25025
|
+
</section>
|
|
25026
|
+
|
|
25027
|
+
<!-- Workflow Actions (@WorkflowAction) -->
|
|
25028
|
+
<section
|
|
25029
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
25030
|
+
data-testid="decision-inspector-workflow-actions"
|
|
25031
|
+
>
|
|
25032
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
25033
|
+
{{ tx('capabilities.actionsHeading') }}
|
|
25034
|
+
</span>
|
|
25035
|
+
|
|
25036
|
+
@if (workflowActions().length === 0) {
|
|
25037
|
+
<p class="praxis-decision-inspector__muted">
|
|
25038
|
+
{{ tx('capabilities.noActions') }}
|
|
25039
|
+
</p>
|
|
25040
|
+
} @else {
|
|
25041
|
+
<div class="praxis-decision-inspector__bindings">
|
|
25042
|
+
@for (action of workflowActions(); track action.id) {
|
|
25043
|
+
<article
|
|
25044
|
+
class="praxis-decision-inspector__binding"
|
|
25045
|
+
[class.is-blocked-card]="!action.availability.allowed"
|
|
25046
|
+
[attr.data-action-id]="action.id"
|
|
25047
|
+
>
|
|
25048
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
25049
|
+
<div class="praxis-decision-inspector__item-title-group">
|
|
25050
|
+
<strong class="praxis-decision-inspector__item-title">
|
|
25051
|
+
{{ action.title || action.id }}
|
|
25052
|
+
</strong>
|
|
25053
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
25054
|
+
{{ action.method }} · {{ action.scope }}
|
|
25055
|
+
</code>
|
|
25056
|
+
</div>
|
|
25057
|
+
|
|
25058
|
+
<div class="praxis-decision-inspector__binding-chips">
|
|
25059
|
+
<span
|
|
25060
|
+
class="praxis-decision-inspector__chip"
|
|
25061
|
+
[class.is-success]="action.availability.allowed"
|
|
25062
|
+
[class.is-warning]="!action.availability.allowed"
|
|
25063
|
+
>
|
|
25064
|
+
{{
|
|
25065
|
+
action.availability.allowed
|
|
25066
|
+
? tx('capabilities.allowed')
|
|
25067
|
+
: tx('capabilities.blocked')
|
|
25068
|
+
}}
|
|
25069
|
+
</span>
|
|
25070
|
+
@if (action.execution?.interaction?.riskLevel; as risk) {
|
|
25071
|
+
<span
|
|
25072
|
+
class="praxis-decision-inspector__chip"
|
|
25073
|
+
[class.is-error]="risk === 'HIGH' || risk === 'CRITICAL'"
|
|
25074
|
+
>
|
|
25075
|
+
{{ formatRiskLabel(risk) }}
|
|
25076
|
+
</span>
|
|
25077
|
+
}
|
|
25078
|
+
</div>
|
|
25079
|
+
</div>
|
|
25080
|
+
|
|
25081
|
+
@if (action.description) {
|
|
25082
|
+
<p class="praxis-decision-inspector__binding-message">
|
|
25083
|
+
{{ action.description }}
|
|
25084
|
+
</p>
|
|
25085
|
+
}
|
|
25086
|
+
|
|
25087
|
+
@if (action.availability.reason) {
|
|
25088
|
+
<p class="praxis-decision-inspector__reason-callout">
|
|
25089
|
+
<strong>{{ tx('capabilities.blockedReasonLabel') }}:</strong>
|
|
25090
|
+
{{ action.availability.reason }}
|
|
25091
|
+
</p>
|
|
25092
|
+
}
|
|
25093
|
+
|
|
25094
|
+
@if (hasActionExecutionBadges(action)) {
|
|
25095
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
25096
|
+
@if (action.execution?.preconditions?.resourceVersion === 'REQUIRED') {
|
|
25097
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
25098
|
+
{{ tx('capabilities.preconditionIfMatch') }}
|
|
25099
|
+
</span>
|
|
25100
|
+
}
|
|
25101
|
+
@if (action.execution?.preconditions?.idempotencyKey === 'REQUIRED') {
|
|
25102
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
25103
|
+
{{ tx('capabilities.preconditionIdempotency') }}
|
|
25104
|
+
</span>
|
|
25105
|
+
}
|
|
25106
|
+
@if (action.execution?.interaction?.confirmationRequired) {
|
|
25107
|
+
<span class="praxis-decision-inspector__chip">
|
|
25108
|
+
{{ tx('capabilities.preconditionConfirmation') }}
|
|
25109
|
+
</span>
|
|
25110
|
+
}
|
|
25111
|
+
@if (action.execution?.bulk; as bulkContract) {
|
|
25112
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
25113
|
+
{{
|
|
25114
|
+
tx('capabilities.bulkEnabled', {
|
|
25115
|
+
mode: bulkContract.mode || 'DOMAIN_COMMAND',
|
|
25116
|
+
})
|
|
25117
|
+
}}
|
|
25118
|
+
</span>
|
|
25119
|
+
}
|
|
25120
|
+
</div>
|
|
25121
|
+
}
|
|
25122
|
+
</article>
|
|
25123
|
+
}
|
|
25124
|
+
</div>
|
|
25125
|
+
}
|
|
25126
|
+
</section>
|
|
25127
|
+
|
|
25128
|
+
<!-- Semantic Surfaces (@UiSurface) -->
|
|
25129
|
+
<section
|
|
25130
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
25131
|
+
data-testid="decision-inspector-surfaces"
|
|
25132
|
+
>
|
|
25133
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
25134
|
+
{{ tx('capabilities.surfacesHeading') }}
|
|
25135
|
+
</span>
|
|
25136
|
+
|
|
25137
|
+
@if (semanticSurfaces().length === 0) {
|
|
25138
|
+
<p class="praxis-decision-inspector__muted">
|
|
25139
|
+
{{ tx('capabilities.noSurfaces') }}
|
|
25140
|
+
</p>
|
|
25141
|
+
} @else {
|
|
25142
|
+
<div class="praxis-decision-inspector__bindings">
|
|
25143
|
+
@for (surface of semanticSurfaces(); track surface.id) {
|
|
25144
|
+
<article
|
|
25145
|
+
class="praxis-decision-inspector__binding"
|
|
25146
|
+
[class.is-blocked-card]="!surface.availability.allowed"
|
|
25147
|
+
[attr.data-surface-id]="surface.id"
|
|
25148
|
+
>
|
|
25149
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
25150
|
+
<div class="praxis-decision-inspector__item-title-group">
|
|
25151
|
+
<strong class="praxis-decision-inspector__item-title">
|
|
25152
|
+
{{ surface.title || surface.id }}
|
|
25153
|
+
</strong>
|
|
25154
|
+
<span class="praxis-decision-inspector__chip">
|
|
25155
|
+
{{ formatSurfaceKindLabel(surface.kind) }}
|
|
25156
|
+
</span>
|
|
25157
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
25158
|
+
{{ surface.scope }}
|
|
25159
|
+
</code>
|
|
25160
|
+
</div>
|
|
25161
|
+
|
|
25162
|
+
<span
|
|
25163
|
+
class="praxis-decision-inspector__chip"
|
|
25164
|
+
[class.is-success]="surface.availability.allowed"
|
|
25165
|
+
[class.is-warning]="!surface.availability.allowed"
|
|
25166
|
+
>
|
|
25167
|
+
{{
|
|
25168
|
+
surface.availability.allowed
|
|
25169
|
+
? tx('capabilities.allowed')
|
|
25170
|
+
: tx('capabilities.blocked')
|
|
25171
|
+
}}
|
|
25172
|
+
</span>
|
|
25173
|
+
</div>
|
|
25174
|
+
|
|
25175
|
+
@if (surface.description) {
|
|
25176
|
+
<p class="praxis-decision-inspector__binding-message">
|
|
25177
|
+
{{ surface.description }}
|
|
25178
|
+
</p>
|
|
25179
|
+
}
|
|
25180
|
+
|
|
25181
|
+
@if (surface.availability.reason) {
|
|
25182
|
+
<p class="praxis-decision-inspector__reason-callout">
|
|
25183
|
+
<strong>{{ tx('capabilities.blockedReasonLabel') }}:</strong>
|
|
25184
|
+
{{ surface.availability.reason }}
|
|
25185
|
+
</p>
|
|
25186
|
+
}
|
|
25187
|
+
|
|
25188
|
+
@if (surface.relatedResource?.childResourceKey; as childKey) {
|
|
25189
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
25190
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
25191
|
+
1:N → {{ childKey }}
|
|
25192
|
+
</code>
|
|
25193
|
+
</div>
|
|
25194
|
+
}
|
|
25195
|
+
</article>
|
|
25196
|
+
}
|
|
25197
|
+
</div>
|
|
25198
|
+
}
|
|
25199
|
+
</section>
|
|
25200
|
+
} @else {
|
|
25201
|
+
<div class="praxis-decision-inspector__status" role="status">
|
|
25202
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
25203
|
+
<strong>{{ tx('capabilities.emptyTitle') }}</strong>
|
|
25204
|
+
<p>{{ tx('capabilities.emptyDescription') }}</p>
|
|
25205
|
+
</div>
|
|
25206
|
+
</div>
|
|
25207
|
+
}
|
|
25208
|
+
</div>
|
|
25209
|
+
}
|
|
25210
|
+
|
|
25211
|
+
<!-- LENS 3: GOVERNANCE & PRIVACY (@DomainGovernance & x-ui.fieldAccess) -->
|
|
25212
|
+
@if (activeLens() === 'governance') {
|
|
25213
|
+
<div
|
|
25214
|
+
id="decision-inspector-lens-panel-governance"
|
|
25215
|
+
role="tabpanel"
|
|
25216
|
+
aria-labelledby="decision-inspector-lens-tab-governance"
|
|
25217
|
+
class="praxis-decision-inspector__lens-panel"
|
|
25218
|
+
data-testid="decision-inspector-panel-governance"
|
|
25219
|
+
>
|
|
25220
|
+
@if (governanceItems().length > 0) {
|
|
25221
|
+
<!-- Executive Governance Summary Strip -->
|
|
25222
|
+
<section class="praxis-decision-inspector__section">
|
|
25223
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
25224
|
+
{{ tx('governance.summaryHeading') }}
|
|
25225
|
+
</span>
|
|
25226
|
+
|
|
25227
|
+
<div
|
|
25228
|
+
class="praxis-decision-inspector__kpi-strip"
|
|
25229
|
+
data-testid="decision-inspector-governance-kpis"
|
|
25230
|
+
>
|
|
25231
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
25232
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
25233
|
+
{{ governanceItems().length }}
|
|
25234
|
+
</strong>
|
|
25235
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
25236
|
+
{{ tx('governance.kpiTotal') }}
|
|
25237
|
+
</span>
|
|
25238
|
+
</div>
|
|
25239
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
25240
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
25241
|
+
{{ sensitiveGovernanceCount() }}
|
|
25242
|
+
</strong>
|
|
25243
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
25244
|
+
{{ tx('governance.kpiSensitive') }}
|
|
25245
|
+
</span>
|
|
25246
|
+
</div>
|
|
25247
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
25248
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
25249
|
+
{{ nonExportableGovernanceCount() }}
|
|
25250
|
+
</strong>
|
|
25251
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
25252
|
+
{{ tx('governance.kpiNonExportable') }}
|
|
25253
|
+
</span>
|
|
25254
|
+
</div>
|
|
25255
|
+
<div class="praxis-decision-inspector__kpi-tile">
|
|
25256
|
+
<strong class="praxis-decision-inspector__kpi-value">
|
|
25257
|
+
{{ aiRestrictedGovernanceCount() }}
|
|
25258
|
+
</strong>
|
|
25259
|
+
<span class="praxis-decision-inspector__kpi-label">
|
|
25260
|
+
{{ tx('governance.kpiAiRestricted') }}
|
|
25261
|
+
</span>
|
|
25262
|
+
</div>
|
|
25263
|
+
</div>
|
|
25264
|
+
</section>
|
|
25265
|
+
|
|
25266
|
+
<!-- Governed Fields & Policies -->
|
|
25267
|
+
<section
|
|
25268
|
+
class="praxis-decision-inspector__section praxis-decision-inspector__section--divider"
|
|
25269
|
+
data-testid="decision-inspector-governance-list"
|
|
25270
|
+
>
|
|
25271
|
+
<span class="praxis-decision-inspector__eyebrow">
|
|
25272
|
+
{{ tx('governance.fieldsHeading') }}
|
|
25273
|
+
</span>
|
|
25274
|
+
|
|
25275
|
+
<div class="praxis-decision-inspector__bindings">
|
|
25276
|
+
@for (gov of sortedGovernanceItems(); track gov.governanceKey) {
|
|
25277
|
+
<article
|
|
25278
|
+
class="praxis-decision-inspector__binding"
|
|
25279
|
+
[attr.data-governance-node]="gov.nodeKey"
|
|
25280
|
+
>
|
|
25281
|
+
<div class="praxis-decision-inspector__binding-top">
|
|
25282
|
+
<div class="praxis-decision-inspector__item-title-group">
|
|
25283
|
+
<strong class="praxis-decision-inspector__item-title">
|
|
25284
|
+
{{ gov.label }}
|
|
25285
|
+
</strong>
|
|
25286
|
+
@if (gov.fieldName && gov.fieldName !== gov.label) {
|
|
25287
|
+
<code class="praxis-decision-inspector__fact-chip">
|
|
25288
|
+
{{ gov.fieldName }}
|
|
25289
|
+
</code>
|
|
25290
|
+
}
|
|
25291
|
+
<span class="praxis-decision-inspector__chip">
|
|
25292
|
+
{{ formatGovernanceTargetKind(gov.targetKind) }}
|
|
25293
|
+
</span>
|
|
25294
|
+
</div>
|
|
25295
|
+
|
|
25296
|
+
<div class="praxis-decision-inspector__binding-chips">
|
|
25297
|
+
@if (gov.classification) {
|
|
25298
|
+
<span
|
|
25299
|
+
class="praxis-decision-inspector__chip"
|
|
25300
|
+
[class.is-warning]="isSensitiveClassification(gov.classification)"
|
|
25301
|
+
>
|
|
25302
|
+
{{ formatClassificationLabel(gov.classification) }}
|
|
25303
|
+
</span>
|
|
25304
|
+
}
|
|
25305
|
+
@if (gov.dataCategory) {
|
|
25306
|
+
<span class="praxis-decision-inspector__chip">
|
|
25307
|
+
{{ formatDataCategoryLabel(gov.dataCategory) }}
|
|
25308
|
+
</span>
|
|
25309
|
+
}
|
|
25310
|
+
@if (gov.exportable === false) {
|
|
25311
|
+
<span class="praxis-decision-inspector__chip is-error">
|
|
25312
|
+
{{ tx('governance.exportBlocked') }}
|
|
25313
|
+
</span>
|
|
25314
|
+
} @else if (gov.exportable === true) {
|
|
25315
|
+
<span class="praxis-decision-inspector__chip is-success">
|
|
25316
|
+
{{ tx('governance.exportAllowed') }}
|
|
25317
|
+
</span>
|
|
25318
|
+
}
|
|
25319
|
+
</div>
|
|
25320
|
+
</div>
|
|
25321
|
+
|
|
25322
|
+
@if (gov.fieldAccess) {
|
|
25323
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
25324
|
+
@if (gov.fieldAccessEvaluation?.evaluated) {
|
|
25325
|
+
<span
|
|
25326
|
+
class="praxis-decision-inspector__chip"
|
|
25327
|
+
[class.is-success]="gov.fieldAccessEvaluation?.visible"
|
|
25328
|
+
[class.is-error]="!gov.fieldAccessEvaluation?.visible"
|
|
25329
|
+
>
|
|
25330
|
+
{{
|
|
25331
|
+
gov.fieldAccessEvaluation?.visible
|
|
25332
|
+
? tx('governance.fieldAccessVisible')
|
|
25333
|
+
: tx('governance.fieldAccessHidden')
|
|
25334
|
+
}}
|
|
25335
|
+
</span>
|
|
25336
|
+
@if (gov.fieldAccessEvaluation?.visible) {
|
|
25337
|
+
<span
|
|
25338
|
+
class="praxis-decision-inspector__chip"
|
|
25339
|
+
[class.is-warning]="!gov.fieldAccessEvaluation?.editable"
|
|
25340
|
+
>
|
|
25341
|
+
{{
|
|
25342
|
+
gov.fieldAccessEvaluation?.editable
|
|
25343
|
+
? tx('governance.fieldAccessEditable')
|
|
25344
|
+
: tx('governance.fieldAccessReadOnly')
|
|
25345
|
+
}}
|
|
25346
|
+
</span>
|
|
25347
|
+
}
|
|
25348
|
+
} @else {
|
|
25349
|
+
<span class="praxis-decision-inspector__chip is-accent">
|
|
25350
|
+
{{ tx('governance.fieldAccessDeclared') }}
|
|
25351
|
+
</span>
|
|
25352
|
+
}
|
|
25353
|
+
</div>
|
|
25354
|
+
|
|
25355
|
+
@if (gov.fieldAccess.reason) {
|
|
25356
|
+
<p class="praxis-decision-inspector__reason-callout">
|
|
25357
|
+
{{ gov.fieldAccess.reason }}
|
|
25358
|
+
</p>
|
|
25359
|
+
}
|
|
25360
|
+
}
|
|
25361
|
+
|
|
25362
|
+
@if (gov.complianceTags.length > 0 || gov.aiVisibility || gov.aiRestrictions.length > 0) {
|
|
25363
|
+
<div class="praxis-decision-inspector__fact-chips">
|
|
25364
|
+
@for (tag of gov.complianceTags; track tag) {
|
|
25365
|
+
<code class="praxis-decision-inspector__fact-chip">{{ tag }}</code>
|
|
25366
|
+
}
|
|
25367
|
+
@if (gov.aiVisibility) {
|
|
25368
|
+
<span class="praxis-decision-inspector__chip is-mono">
|
|
25369
|
+
{{ tx('governance.aiPolicyLabel') }}: {{ gov.aiVisibility }}
|
|
25370
|
+
</span>
|
|
25371
|
+
}
|
|
25372
|
+
@for (restriction of gov.aiRestrictions; track restriction) {
|
|
25373
|
+
<span class="praxis-decision-inspector__chip is-warning">
|
|
25374
|
+
{{ restriction }}
|
|
25375
|
+
</span>
|
|
25376
|
+
}
|
|
25377
|
+
</div>
|
|
25378
|
+
}
|
|
25379
|
+
|
|
25380
|
+
@if (gov.retentionPolicy || gov.owner || gov.steward) {
|
|
25381
|
+
<div class="praxis-decision-inspector__binding-meta">
|
|
25382
|
+
@if (gov.retentionPolicy) {
|
|
25383
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
25384
|
+
<strong>{{ tx('governance.retentionLabel') }}:</strong>
|
|
25385
|
+
<code>{{ gov.retentionPolicy }}</code>
|
|
25386
|
+
</span>
|
|
25387
|
+
}
|
|
25388
|
+
@if (gov.owner) {
|
|
25389
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
25390
|
+
<strong>{{ tx('governance.ownerLabel') }}:</strong>
|
|
25391
|
+
<span>{{ gov.owner }}</span>
|
|
25392
|
+
</span>
|
|
25393
|
+
}
|
|
25394
|
+
@if (gov.steward) {
|
|
25395
|
+
<span class="praxis-decision-inspector__meta-item">
|
|
25396
|
+
<strong>{{ tx('governance.stewardLabel') }}:</strong>
|
|
25397
|
+
<span>{{ gov.steward }}</span>
|
|
25398
|
+
</span>
|
|
25399
|
+
}
|
|
25400
|
+
</div>
|
|
25401
|
+
}
|
|
25402
|
+
</article>
|
|
25403
|
+
}
|
|
25404
|
+
</div>
|
|
25405
|
+
</section>
|
|
25406
|
+
} @else {
|
|
25407
|
+
<div class="praxis-decision-inspector__status" role="status">
|
|
25408
|
+
<div class="praxis-decision-inspector__status-copy">
|
|
25409
|
+
<strong>{{ tx('governance.emptyTitle') }}</strong>
|
|
25410
|
+
<p>{{ tx('governance.emptyDescription') }}</p>
|
|
25411
|
+
</div>
|
|
25412
|
+
</div>
|
|
25413
|
+
}
|
|
25414
|
+
|
|
25415
|
+
<!-- Anti-Oracle Security Guarantee Notice (CC07) -->
|
|
25416
|
+
<div
|
|
25417
|
+
class="praxis-decision-inspector__privacy-note"
|
|
25418
|
+
data-testid="decision-inspector-anti-oracle-note"
|
|
25419
|
+
>
|
|
25420
|
+
<span class="material-symbols-outlined praxis-decision-inspector__privacy-icon" aria-hidden="true">
|
|
25421
|
+
shield_lock
|
|
25422
|
+
</span>
|
|
25423
|
+
<span>{{ tx('governance.antiOracleNotice') }}</span>
|
|
25424
|
+
</div>
|
|
25425
|
+
</div>
|
|
25426
|
+
}
|
|
25427
|
+
}
|
|
25428
|
+
}
|
|
25429
|
+
|
|
25430
|
+
<!-- 3. Governed External Handoff to Praxis Rules Studio -->
|
|
25431
|
+
@if (effectiveStudioUrl(); as studioHref) {
|
|
25432
|
+
<footer
|
|
25433
|
+
class="praxis-decision-inspector__footer"
|
|
25434
|
+
data-testid="decision-inspector-studio-handoff"
|
|
25435
|
+
>
|
|
25436
|
+
<p class="praxis-decision-inspector__footer-hint">
|
|
25437
|
+
{{ tx('studio.handoffHint') }}
|
|
25438
|
+
</p>
|
|
25439
|
+
<a
|
|
25440
|
+
class="praxis-decision-inspector__studio-link"
|
|
25441
|
+
[href]="studioHref"
|
|
25442
|
+
target="_blank"
|
|
25443
|
+
rel="noopener noreferrer"
|
|
25444
|
+
data-testid="decision-inspector-open-studio-link"
|
|
25445
|
+
>
|
|
25446
|
+
<span class="material-symbols-outlined" aria-hidden="true">open_in_new</span>
|
|
25447
|
+
<span>{{ tx('studio.openAction') }}</span>
|
|
25448
|
+
</a>
|
|
25449
|
+
</footer>
|
|
25450
|
+
}
|
|
25451
|
+
</div>
|
|
25452
|
+
`, styles: [":host{display:block;width:100%}.praxis-decision-inspector{display:flex;flex-direction:column;gap:18px;padding:4px 2px 16px;color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-inspector__lens-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px;border-radius:12px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .1));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}@media(max-width:560px){.praxis-decision-inspector__lens-bar{grid-template-columns:1fr}}.praxis-decision-inspector__lens-tab{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:6px 10px;border-radius:9px;border:1px solid transparent;background:transparent;color:var(--md-sys-color-on-surface-variant, #64748b);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .14s ease,color .14s ease,border-color .14s ease}.praxis-decision-inspector__lens-tab:hover{color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-inspector__lens-tab.is-active{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,var(--md-sys-color-surface-container-high, transparent));border-color:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 42%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__lens-icon{font-size:16px;flex-shrink:0}.praxis-decision-inspector__lens-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.praxis-decision-inspector__lens-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;font-size:10.5px;font-weight:700;background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 10%,transparent)}.praxis-decision-inspector__lens-tab.is-active .praxis-decision-inspector__lens-count{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 22%,transparent)}.praxis-decision-inspector__lens-panel{display:flex;flex-direction:column;gap:18px}.praxis-decision-inspector__section{display:flex;flex-direction:column;gap:10px}.praxis-decision-inspector__section--divider{padding-top:16px;border-top:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__section-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap}.praxis-decision-inspector__eyebrow{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__description,.praxis-decision-inspector__muted{margin:0;font-size:13px;line-height:1.45;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__xray{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--md-sys-color-error-container, rgba(220, 38, 38, .14)) 42%,var(--md-sys-color-surface-container, transparent));border:1px solid color-mix(in srgb,var(--md-sys-color-error, #dc2626) 45%,transparent)}.praxis-decision-inspector__xray-header{display:flex;align-items:center;gap:8px;color:var(--md-sys-color-error, #dc2626)}.praxis-decision-inspector__xray-icon{font-size:18px}.praxis-decision-inspector__xray-title{font-size:13px;font-weight:700}.praxis-decision-inspector__xray-list{display:flex;flex-direction:column;gap:8px}.praxis-decision-inspector__xray-item{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border-radius:8px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high, rgba(15, 23, 42, .2)) 78%,transparent)}.praxis-decision-inspector__xray-item.is-clickable{cursor:pointer}.praxis-decision-inspector__xray-item.is-clickable:focus-visible,.praxis-decision-inspector__lens-tab:focus-visible,.praxis-decision-inspector__ruleset-pill:focus-visible,.praxis-decision-inspector__action-btn:focus-visible,.praxis-decision-inspector__studio-link:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.praxis-decision-inspector__xray-badges{display:flex;flex-wrap:wrap;gap:6px}.praxis-decision-inspector__xray-message{margin:0;font-size:13px;font-weight:500;line-height:1.4}.praxis-decision-inspector__chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 9%,transparent);color:var(--md-sys-color-on-surface-variant, inherit)}.praxis-decision-inspector__chip.is-mono{font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)}.praxis-decision-inspector__chip.is-error{background:color-mix(in srgb,var(--md-sys-color-error, #dc2626) 18%,transparent);color:var(--md-sys-color-error, #dc2626)}.praxis-decision-inspector__chip.is-warning{background:color-mix(in srgb,var(--praxis-warning, #d97706) 18%,transparent);color:var(--praxis-warning, #d97706)}.praxis-decision-inspector__chip.is-success{background:color-mix(in srgb,var(--praxis-success, #059669) 16%,transparent);color:var(--praxis-success, #059669)}.praxis-decision-inspector__chip.is-accent{background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 16%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__ruleset-pills{display:flex;flex-wrap:wrap;gap:8px}.praxis-decision-inspector__ruleset-pill{appearance:none;display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;cursor:pointer;font-family:inherit;font-size:12.5px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .1));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 65%,transparent);color:var(--md-sys-color-on-surface, inherit);transition:border-color .14s ease,background-color .14s ease}.praxis-decision-inspector__ruleset-pill.is-active{border-color:var(--md-sys-color-primary, #4f46e5);background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,var(--md-sys-color-surface-container, transparent))}.praxis-decision-inspector__ruleset-op{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__ruleset-label{font-weight:600}.praxis-decision-inspector__slot-heading{margin:2px 0 0;font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:14px;font-weight:700}.praxis-decision-inspector__slot-badges,.praxis-decision-inspector__binding-chips{display:flex;flex-wrap:wrap;gap:6px}.praxis-decision-inspector__bindings{display:flex;flex-direction:column;gap:10px}.praxis-decision-inspector__binding{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:10px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__binding.is-violated{border-color:var(--md-sys-color-error, #dc2626)}.praxis-decision-inspector__binding.is-blocked-card{border-style:dashed}.praxis-decision-inspector__binding-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.praxis-decision-inspector__item-title-group{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.praxis-decision-inspector__item-title{font-size:13px;font-weight:600}.praxis-decision-inspector__binding-key{font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:12px;font-weight:600}.praxis-decision-inspector__binding-message{margin:0;font-size:13px;line-height:1.4}.praxis-decision-inspector__reason-callout{margin:2px 0 0;padding:6px 10px;border-radius:8px;font-size:12px;line-height:1.4;background:color-mix(in srgb,var(--praxis-warning, #d97706) 11%,transparent);color:var(--md-sys-color-on-surface, inherit)}.praxis-decision-inspector__ops-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:8px}.praxis-decision-inspector__op-pill{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border-radius:9px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 50%,transparent)}.praxis-decision-inspector__op-pill.is-blocked{opacity:.72;border-style:dashed}.praxis-decision-inspector__op-main{display:flex;align-items:center;gap:6px}.praxis-decision-inspector__op-icon{font-size:16px;color:var(--praxis-success, #059669)}.praxis-decision-inspector__op-pill.is-blocked .praxis-decision-inspector__op-icon{color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__op-label{font-size:12px;font-weight:600}.praxis-decision-inspector__op-reason{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__kpi-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}@media(max-width:560px){.praxis-decision-inspector__kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}.praxis-decision-inspector__kpi-tile{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border-radius:10px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 50%,transparent)}.praxis-decision-inspector__kpi-value{font-size:18px;font-weight:700;line-height:1.2}.praxis-decision-inspector__kpi-label{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__privacy-note{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;font-size:11.5px;line-height:1.4;color:var(--md-sys-color-on-surface-variant, #64748b);background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 5%,transparent)}.praxis-decision-inspector__privacy-icon{font-size:16px;flex-shrink:0}.praxis-decision-inspector__binding-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:11.5px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__meta-item{display:inline-flex;align-items:center;gap:4px}.praxis-decision-inspector__roots{display:flex;flex-direction:column;gap:8px}.praxis-decision-inspector__root-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.praxis-decision-inspector__root-pill{padding:2px 8px;border-radius:6px;font-family:var(--praxis-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:11.5px;font-weight:700;background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,transparent);color:var(--md-sys-color-primary, #4f46e5)}.praxis-decision-inspector__fact-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.praxis-decision-inspector__fact-label{font-size:11px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__fact-chip{padding:2px 6px;border-radius:6px;font-size:11px;background:color-mix(in srgb,var(--md-sys-color-on-surface, #0f172a) 7%,transparent)}.praxis-decision-inspector__facts-block{display:flex;flex-direction:column;gap:8px;margin-top:6px}.praxis-decision-inspector__status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border-radius:12px;background:var(--md-sys-color-surface-container, rgba(148, 163, 184, .08));border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__status-copy{display:flex;flex-direction:column;gap:4px}.praxis-decision-inspector__status-copy p{margin:0;font-size:12.5px;color:var(--md-sys-color-on-surface-variant, #64748b)}.praxis-decision-inspector__action-btn,.praxis-decision-inspector__studio-link{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer;border:1px solid color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 38%,transparent);background:color-mix(in srgb,var(--md-sys-color-primary, #4f46e5) 14%,transparent);color:var(--md-sys-color-primary, #4f46e5);white-space:nowrap}.praxis-decision-inspector__studio-link .material-symbols-outlined{font-size:16px}.praxis-decision-inspector__footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:14px;border-top:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 55%,transparent)}.praxis-decision-inspector__footer-hint{margin:0;font-size:12px;color:var(--md-sys-color-on-surface-variant, #64748b);flex:1 1 240px}\n"] }]
|
|
25453
|
+
}], ctorParameters: () => [], propDecorators: { resourceKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceKey", required: false }] }], resourcePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourcePath", required: false }] }], resourceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceId", required: false }] }], resourceTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceTitle", required: false }] }], initialLens: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialLens", required: false }] }], initialOperationKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialOperationKey", required: false }] }], initialRuleSetKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialRuleSetKey", required: false }] }], initialSlotKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialSlotKey", required: false }] }], initialBindingKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialBindingKey", required: false }] }], violations: [{ type: i0.Input, args: [{ isSignal: true, alias: "violations", required: false }] }], preloadedCatalog: [{ type: i0.Input, args: [{ isSignal: true, alias: "preloadedCatalog", required: false }] }], preloadedCapabilities: [{ type: i0.Input, args: [{ isSignal: true, alias: "preloadedCapabilities", required: false }] }], studioUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "studioUrl", required: false }] }], endpointKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "endpointKey", required: false }] }], apiUrlEntry: [{ type: i0.Input, args: [{ isSignal: true, alias: "apiUrlEntry", required: false }] }] } });
|
|
25454
|
+
|
|
25455
|
+
/**
|
|
25456
|
+
* Registers the canonical contextual Business Rules Inspector (`PRAXIS_DECISION_INSPECTOR_SURFACE`),
|
|
25457
|
+
* its `pt-BR`/`en-US` i18n catalog, and optional deep-link handoff configuration to `praxis-rules-studio`.
|
|
25458
|
+
*
|
|
25459
|
+
* Requires `SURFACE_DRAWER_BRIDGE` (for example via `provideSettingsPanelAsSurfaceDrawerBridge()`).
|
|
25460
|
+
*/
|
|
25461
|
+
function providePraxisDecisionInspector(config = {}) {
|
|
25462
|
+
return makeEnvironmentProviders([
|
|
25463
|
+
{
|
|
25464
|
+
provide: PRAXIS_I18N_CONFIG,
|
|
25465
|
+
useValue: DECISION_INSPECTOR_I18N_CONFIG,
|
|
25466
|
+
multi: true,
|
|
25467
|
+
},
|
|
25468
|
+
{
|
|
25469
|
+
provide: PRAXIS_DECISION_INSPECTOR_SURFACE,
|
|
25470
|
+
useValue: PraxisDecisionInspectorSurfaceComponent,
|
|
25471
|
+
},
|
|
25472
|
+
{
|
|
25473
|
+
provide: PRAXIS_DECISION_INSPECTOR_CONFIG,
|
|
25474
|
+
useValue: config,
|
|
25475
|
+
},
|
|
25476
|
+
]);
|
|
25477
|
+
}
|
|
25478
|
+
|
|
22532
25479
|
/*
|
|
22533
25480
|
* Public API Surface of praxis-visual-builder
|
|
22534
25481
|
*/
|
|
@@ -22538,4 +25485,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
22538
25485
|
* Generated bundle index. Do not edit.
|
|
22539
25486
|
*/
|
|
22540
25487
|
|
|
22541
|
-
export { ArrayFieldAnalyzer, CollectionValidatorEditorComponent, ConditionalValidatorEditorComponent, ConditionalValidatorType, ConfigurationError, ContextError, ContextManagementService, ConversionError, ErrorCategory, ErrorHandler, ErrorSeverity, ExportDialogComponent, ExportIntegrationService, ExpressionError, FIELD_TYPE_OPERATORS, FieldConditionEditorComponent, FieldSchemaService, FieldType, InternalError, JsonViewerComponent, MetadataEditorComponent, OPERATOR_LABELS, PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST, PRAXIS_VISUAL_BUILDER_COMPONENT_METADATA, PraxisVisualBuilder, RegistryError, RuleBuilderService, RuleCanvasComponent, RuleEditorComponent, RuleListComponent, RuleNodeComponent, RuleNodeRegistryService, RuleNodeType, RuleTemplateService, RuleValidationService, TemplateEditorDialogComponent, TemplateGalleryComponent, TemplatePreviewDialogComponent, ValidationError as VBValidationError, ValidationCategory, ValidationSeverity, VisualBuilderError, VisualRuleBuilderComponent, WebhookIntegrationService, createError, getArrayItemFieldPaths, globalErrorHandler, isArrayFieldSchema, providePraxisVisualBuilderMetadata };
|
|
25488
|
+
export { ArrayFieldAnalyzer, CollectionValidatorEditorComponent, ConditionalValidatorEditorComponent, ConditionalValidatorType, ConfigurationError, ContextError, ContextManagementService, ConversionError, ErrorCategory, ErrorHandler, ErrorSeverity, ExportDialogComponent, ExportIntegrationService, ExpressionError, FIELD_TYPE_OPERATORS, FieldConditionEditorComponent, FieldSchemaService, FieldType, InternalError, JsonViewerComponent, MetadataEditorComponent, OPERATOR_LABELS, PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST, PRAXIS_VISUAL_BUILDER_COMPONENT_METADATA, PraxisDecisionInspectorSurfaceComponent, PraxisRuleDecisionDagComponent, PraxisVisualBuilder, RegistryError, RuleBuilderService, RuleCanvasComponent, RuleEditorComponent, RuleListComponent, RuleNodeComponent, RuleNodeRegistryService, RuleNodeType, RuleTemplateService, RuleValidationService, TemplateEditorDialogComponent, TemplateGalleryComponent, TemplatePreviewDialogComponent, ValidationError as VBValidationError, ValidationCategory, ValidationSeverity, VisualBuilderError, VisualRuleBuilderComponent, WebhookIntegrationService, createError, getArrayItemFieldPaths, globalErrorHandler, isArrayFieldSchema, providePraxisDecisionInspector, providePraxisVisualBuilderMetadata };
|