@usefragments/core 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -4
- package/dist/index.js +38 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/evaluation/canonical-facts-trust.test.ts +337 -0
- package/src/evaluation/evaluate.ts +67 -10
- package/src/evaluation/evaluation-v2-receipt-v1.test.ts +1 -1
- package/src/evaluation/index.ts +1 -1
- package/src/evaluation/types.ts +5 -3
- package/src/index.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -14128,9 +14128,11 @@ declare function coverageArtifactDigestV1(rawPlan: AnalysisPlanV1, rawCoverage:
|
|
|
14128
14128
|
*/
|
|
14129
14129
|
|
|
14130
14130
|
/** Bumped when kernel semantics change in a way that can flip a verdict. */
|
|
14131
|
-
declare const EVALUATOR_VERSION: "evaluation-kernel:v1";
|
|
14132
|
-
/**
|
|
14133
|
-
declare const EVALUATOR_VERSION_V2: "evaluation-kernel:v2";
|
|
14131
|
+
declare const EVALUATOR_VERSION: "evaluation-kernel:v1.1";
|
|
14132
|
+
/** Current facts-only evaluator. The input schema remains V2. */
|
|
14133
|
+
declare const EVALUATOR_VERSION_V2: "evaluation-kernel:v2.1";
|
|
14134
|
+
/** Replay-only generation: its captured mapping judgments remain authoritative. */
|
|
14135
|
+
declare const LEGACY_EVALUATOR_VERSION_V2: "evaluation-kernel:v2";
|
|
14134
14136
|
/**
|
|
14135
14137
|
* Four-state per-finding model (spec §2). `candidate` is the derivation step —
|
|
14136
14138
|
* "severity/rule says it could block" — and always resolves to one of the
|
|
@@ -14542,4 +14544,4 @@ declare const APPROVED_CONTRACT_TOKEN_MAX_NAME_LENGTH = 512;
|
|
|
14542
14544
|
/** Empty is authored absence; missing is unavailable authority. */
|
|
14543
14545
|
declare function isApprovedContractTokenNames(value: unknown): value is string[];
|
|
14544
14546
|
|
|
14545
|
-
export { type A11yNameRequiredFact, AGENT_CONTEXT_RELATIVE_PATH, ANALYSIS_LIMIT_CEILINGS_V1, ANALYSIS_PLAN_MAX_CAPABILITIES_V1, ANALYSIS_PLAN_MAX_DIALECTS_PER_REGION_V1, ANALYSIS_PLAN_MAX_REGIONS_V1, APPROVED_CONTRACT_TOKEN_MAX_NAMES, APPROVED_CONTRACT_TOKEN_MAX_NAME_LENGTH, AgentFormat, type AnalysisLimitsV1, type AnalysisPlanId, type AnalysisPlanInputV1, type AnalysisPlanV1, type AnalysisRegionV1, BLOCKING_RULE_ALLOWLIST, BRAND, BlockDefinition, type Brand, type BuildAgentFormatInput, type BuildRegistryInstallPlanInput, type BundleArtifactMetadata, type BundleComponentShard, type BundleManifest, type BundleManifestComponentEntry, type BundleSchemaVersion, type BundleTarget, type BundleTokenFile, CANONICAL_FACT_MAX_CONFLICTS_V1, CANONICAL_FACT_MAX_PROVENANCE_PER_VALUE_V1, CANONICAL_FACT_MAX_VALUES_PER_CONFLICT_V1, CATALOG_FIXTURE_A_FCID, type CSSGeneratorOptions, type CanonicalBridgeIdentityBinding, CanonicalBridgeV1, type CanonicalCandidateFact, type CanonicalDirectionConflict, type CanonicalFactConflictV1, type CanonicalFactConflictValueV1, type CanonicalFactIntegrityV1, Finding as CanonicalFinding, type CanonicalIdentityReference, type CanonicalMappingFact, type CanonicalReplacementFact, CanonicalSource, type CheckedSpacingValue, type ClassNameDynamicFact, type ClassNameDynamicReason, type ClassNameFact, type ClassNameLiteralFact, type ClassNameOrigin, type ClassifyIdentityInput, type CompileEffectiveGovernanceInputsOptions, CompiledBlock, type CompiledContractOutput, CompiledFragment, type ComplexityTier, type ComponentCapabilityFact, type ComponentContract, type ComponentDefinitionFact, type ComponentDefinitionRenderRoot, type ComponentFactInput, type ComponentId, type ComponentIdentityFact, type ComponentIdentityUsage, type ComponentKeyInput, type ComponentLevelFact, type ComponentMetadataFact, type CompositionAnalysis, type CompositionAuthoringEntry, type CompositionChildSelector, type CompositionConstraint, type CompositionGuideline, type CompositionPattern, type CompositionRegionSelector, type CompositionSuggestion, type CompositionWarning, type ConformChange, type ConformComponentMapping, type ConformConfidence, type ConformCoverage, type ConformInput, type ConformLocation, type ConformPropMapping, type ConformResult, type ConformSuggestion, type ConformToken, type ConformUnresolved, ContractCanonicalMappingInput, ContractCatalogInput, ContractDomain, ContractPreimage, type ContractStampPin, type ContractStampRecord, type ContractTokenReferenceCensus, type CoverageRegionV1, type CoverageStateV1, type CoverageSummaryV1, CoverageValidationErrorV1, DEFAULTS, DEFAULT_ENHANCED_STYLE_PROPERTIES, DEFAULT_STYLE_PROPERTIES, type DTCGColorValue, type DTCGDimensionValue, type DTCGGroup, type DTCGToken, type DTCGTokenFile, type DTCGTokenType, type Defaults, type DeltaEMatch, type DesignSystemContext, type DesignToken, type DesignTokenParseOptions, type DigestHex, type DiscoverComponentsOptions, EFFECTIVE_GOVERNANCE_INPUTS_SCHEMA, EMPTY_VOCABULARY_MESSAGE, EVALUATION_MAX_FINDINGS_V2, EVALUATION_MAX_MAP_ENTRIES_V2, EVALUATION_MAX_POLICY_RULES_V2, EVALUATION_MAX_REASON_CODES_V2, EVALUATION_MAX_WAIVERS_V2, EVALUATION_MAX_WAIVER_MATCHES_V2, EVALUATION_RECEIPT_STRING_MAX_BYTES_V1, EVALUATOR_VERSION, EVALUATOR_VERSION_V2, type EffectiveEvaluationWaiverV2, type EffectiveGovernanceInputs, type EffectiveGovernanceInputsSourceState, type EffectivePolicy, type EffectiveRulePolicy, type EnhancedStyleComparisonResult, type EnhancedStyleDiffItem, type EvaluatedFinding, type EvaluationAuthorityV1, type EvaluationBaseline, type EvaluationContractInput, type EvaluationEvidence, type EvaluationEvidenceTrustV1, type EvaluationFindingInput, type EvaluationFindingState, type EvaluationInput, type EvaluationInputV2, type EvaluationIntegrityInput, type EvaluationIntegrityInputV2, type EvaluationMappingTrust, type EvaluationReason, type EvaluationReasonV2, type EvaluationReceiptId, type EvaluationReceiptMintInputV1, type EvaluationReceiptSemanticV1, type EvaluationReceiptV1, type EvaluationResult, type EvaluationResultV2, type EvaluationScope, type EvaluationSourceTrust, type EvaluationTrust, type EvaluationVerdict, type EvaluationWaiver, EvidenceGrade, type ExternalIdentityReference, FRAGMENTS_INTERNAL_RULE_IDS, FRAGMENT_V3_SCHEMA_URL, type Fact, type FactConflict, type FactEvidence, type FactId, FactIndex, type FactKind, type FactLocation, type FactOfKind, FigmaBooleanMapping, FigmaChildrenMapping, FigmaEnumMapping, FigmaInstanceMapping, FigmaStringMapping, FigmaTextContentMapping, type FigmaVariable, type FigmaVariableCollection, Finding, FindingFix, type FindingV2, FragmentAnnotationsV3, FragmentComponent, FragmentDefinition, FragmentDefinitionV2, FragmentDefinitionV3, FragmentDefinitionV3Body, FragmentDesignV3, FragmentDontExampleV3, FragmentGuidanceV3, FragmentMatrixV3, FragmentMetaV3, FragmentPreviewV3, FragmentStateV3, FragmentsConfig, Severity as FuiSeverity, GovernanceConfig, type GovernanceIntegrityFamily, type GovernanceIntegrityFamilyId, type GovernanceIntegrityInput, type GovernanceIntegrityRoster, type GovernanceIntegrityStatus, type GovernanceIntegrityVerdict, GovernanceSeverity, GovernedFragmentDefinition, type IdentityClassification, type IdentityConfidence, type IdentityDecision, type IdentityFact, type IdentityState, type InertConfigDiagnostic, type InertConfigDiagnosticCode, type InertConfigDiagnosticKind, type InferProps, type JsxComponentPreferredFact, type JsxImportPathPreferredFact, type JsxInlineStyleForbiddenRawFact, type JsxUnknownPropsForbiddenFact, type LocalIdentityReference, type McpBlock, type McpCapability, type McpComponent, type McpComponentExample, type McpComponentGuidance, type McpComponentMetadata, type McpComponentProp, type McpComponentRelation, type McpCompoundChild, type McpGuidancePattern, type McpPerformanceData, type McpPerformanceImport, type McpPerformanceSummary, type McpSnapshot, type McpSnapshotMetadata, type McpSnapshotSchemaVersion, type McpSourceType, type McpToken, type McpTokenData, type NearestByDeltaEOptions, type NormalizedStyleMap, type NormalizedToken, PRESET_NAMES, PROVE_DEFAULT_MAX_PASSES, PROVE_MAX_PASSES, PROVIDER_ID_MAX_BYTES_V1, type ParseTokensOptions, type ParsedToken, type PerformanceData as PerfData, type PerformanceSummary as PerfSummary, type PerformanceBudgets, type PerformanceConfig, type PolicyExclude, type PolicyExcludeInput, type PolicyFact, type PresetRuleState, PropAnnotation, type PropMetadataFact, type PropValueAvoidedFact, type PropValueForbiddenFact, type ProveCallbacks, type ProveLoopResult, type ProveOptions, type ProvePass, type ProvePassSampling, type ProveResidual, type ProveSample, type ProveSamplerArgs, type ProveVerdict, type ProviderProofSemanticV1, type ProviderProofV1, RAW_HTML_ADVISORY_TAGS, RAW_HTML_CANONICAL_TAGS, RAW_HTML_INPUT_TYPE_CANONICALS, RAW_HTML_ROLE_CANONICALS, REPOSITORY_BINDING_ID_MAX_BYTES_V1, type RGB, type RGBA, RULES, RULE_FAMILY_IDS, RULE_FAMILY_MEMBERS, RULE_TIER, type RawHtmlCanonicalMatch, type RawHtmlPrecisionTier, RegistryArtifact, RegistryDependency, RegistryFile, type RegistryInstallPlan, RegistryInstallReceipt, type RegistryInstallSelection, type RegistryInstallSelectionInput, type RegistryInstallSourceFile, type RegistryInstallSources, type RegistryInstallSourcesInput, RegistryManifest, type RegistryWritePlan, RelationshipType, type RepositoryBindingKeyV1, type RepositoryBindingKeyV1Input, type ResolvedDTCGToken, ResolvedGovernedFragmentDefinition, type ResolvedIdentityRenderRoot, type ResolvedIntrinsicIdentityRoot, type Rule, type RuleConfigView, type RuleFn, type RuleTier, type SCSSGeneratorOptions, type ScaleFact, type ScaleValueFact, Severity, type SpacingResolutionScale, type SpacingTokenLookup, type StructuralConfidenceFact, type StyleComparisonOptions, type StyleComparisonResult, type StyleCssVarsMustBeDefinedFact, type StyleDeclarationFact, type StyleDiffItem, type StyleFontSizeScaleFact, type StylePropertyScaleFact, type StyleRawColorForbiddenFact, type StyleUnsupportedFact, type StyleValueProvenance, type SupersededImportPathPreference, type SuppressionDirectiveFact, type TailwindClassFact, type TailwindModifier, type TailwindModifierKind, type TailwindPaletteAllowFact, type TailwindPaletteDenyFact, type TailwindResolutionSource, type TailwindResolvedKind, type TailwindResolvedValue, type TailwindTokenResolvedFact, type TailwindUnknownClassEnabledFact, type TailwindValue, type ThemeDeclarationFact, type ThemeParserResult, type TokenCatalog, type TokenCatalogDefinition, type TokenCatalogDiagnostic, type TokenCatalogLocation, type TokenCatalogReference, type TokenCatalogSourceState, type TokenCategory, TokenConfig, type TokenDefinitionFact, type TokenFix, type TokenFormat, type TokenLookup, type TokenMatchRequest, type TokenMatchResult, type TokenParseError, type TokenParseOutput, type TokenParseResult, type TokenRegistry, type TokenRegistryMeta, type TokenUsageSummary, type UnsupportedStyleReason, type UsageChildContentFact, type UsageComponentFact, type UsageFact, type UsageImportFact, type UsageInlineStyleFact, type UsageNodeFact, type UsagePropResolvedFact, type UsageTextChildFact, aiMetadataSchema, analysisLimitsV1Schema, analysisObligationsDigestV1, analysisPlanDigestV1, analysisPlanIdFromDigest, analysisPlanIdSchema, analysisPlanIdStringSchema, analysisPlanInputV1Schema, analysisPlanV1Schema, analysisRegionV1Schema, analyzeComposition, artifactContentHash, asComponentId, assertPortableRegistryPath, blockDefinitionSchema, budgetBar, buildAgentFormat, buildAnalysisPlanV1, buildComponentKey, buildRegistryInstallPlan, buildRegistryInstallReceipt, buildSpacingTokenLookup, bundleArtifactMetadataSchema, bundleComponentShardSchema, bundleManifestComponentEntrySchema, bundleManifestSchema, bundleSchemaVersionSchema, bundleTargetSchema, bundleTokenFileSchema, calculateDeltaE, canonicalBridgeContractMappings, canonicalBridgeIdentityBindings, canonicalBridgeIdentitySources, canonicalDirectionConflictsTarget, canonicalFactConflictV1Schema, canonicalFactConflictValueV1Schema, canonicalFactIntegrityV1Schema, canonicalJson, canonicalPreimage, canonicalSourceContainsFile, canonicalSourceIncludesExport, capConfiguredSeverity, catalogFixtureA, catalogFixtureAContractPayload, catalogFixtureATokensDtcg, clampMaxPasses, classifyComplexity, classifyIdentity, collectRegistryInstallDependencies, collidingRecordDiagnostic, collidingRecordDiagnostics, colorSimilarity, compareByVocabularyRank, compareColors, compareNumericValues, compareStyleValue, compareStyles, compareStylesWithTokens, compileBlock, compileComponentFacts, compileEffectiveGovernanceInputs, compileFragment, compileGlobalGovernanceFacts, componentContractSchema, componentId, componentRelationSchema, compositionAuthoringEntrySchema, compositionMetadataSchema, compositionPatternSchema, configDeclarationForDiagnostics, configRecordShape, configuredFindingSeverity, containsTailwindV4Theme, contractHash, contractTierRuleIds, contractTokenReferenceCensus, coverageArtifactDigestV1, coverageRegionV1Schema, coverageStateV1Schema, coverageSummaryV1Schema, customerDefaultRuleStates, defineBlock, defineConfig, defineFragment, deriveCoverageSummaryV1, describePolicyExclude, detectOrphanGovernanceScales, detectUnconsumedConfigKeys, detectUnmatchedPolicyExcludes, digestHexSchema, digestHexStringSchema, discoverComponents, dtcgTokenFileSchema, effectiveEvaluationWaiverV2Schema, emptyConformResult, emptyVocabularyConfigFile, evaluate, evaluateGovernanceIntegrity, evaluationInputDigestV2, evaluationInputV2Schema, evaluationReceiptDigestV1, evaluationReceiptIdFromDigest, evaluationReceiptIdSchema, evaluationReceiptIdStringSchema, evaluationReceiptMintInputV1Schema, evaluationReceiptV1Schema, evaluationResultDigestV2, evaluationResultV2Schema, excludeGlobToRegExp, expandRegistryComponentClosure, factId, familyDistance, figma, figmaPropMappingSchema, formatBytes, formatStampHeader, formatStampPin, formatStampVersionHash, formatTokenSummary, fragmentAnnotationsV3Schema, fragmentBanSchema, fragmentContractSchema, fragmentDefinitionSchema, fragmentDefinitionV2Schema, fragmentDefinitionV3BodySchema, fragmentDefinitionV3Schema, fragmentDesignV3Schema, fragmentDontExampleV3Schema, fragmentGeneratedSchema, fragmentGuidanceV3Schema, fragmentMatrixV3Schema, fragmentMetaSchema, fragmentMetaV3Schema, fragmentPreviewV3Schema, fragmentProvenanceSchema, fragmentSourceValues, fragmentStateV3Schema, fragmentUsageSchema, fragmentVariantSchema, fragmentsConfigSchema, fragmentsPresetRuleStates, gatesCi, generateCSSCustomProperties, generateFigmaVariables, generateSCSSVariables, generateTailwindConfig, getComplianceBadge, governedFragmentDefinitionSchema, hasEffectiveComponentVocabulary, hash64Hex, hexToRgb, hygieneTierRuleIds, indexComponentIdentityUsage, inferTokenCategory, inferTokenGroup, isApprovedContractTokenNames, isCanonicalSourceDefinition, isColorLike, isCompositionPattern, isContractFile, isContractTierRule, isDTCGFile, isDenyEligible, isEffectiveCanonicalSource, isEnforceableHtmlEquivalent, isFigmaPropMapping, isPortableRepoPath, isRawHtmlAdvisoryTier, isReactComponent, isRuleFamilyId, lowerCompositionContract, makeA11yNameRequiredFact, makeCanonicalCandidateFact, makeCanonicalMappingFact, makeCanonicalReplacementFact, makeClassNameDynamicFact, makeClassNameLiteralFact, makeComponentCapabilityFact, makeComponentDefinitionFact, makeComponentIdentityFact, makeComponentMetadataFact, makeContractTokenFact, makeFinding, makeJsxComponentPreferredFact, makeJsxImportPathPreferredFact, makeJsxInlineStyleForbiddenRawFact, makeJsxUnknownPropsForbiddenFact, makePropMetadataFact, makePropValueAvoidedFact, makePropValueForbiddenFact, makeScaleFact, makeScaleValueFact, makeStructuralConfidenceFact, makeStyleCssVarsMustBeDefinedFact, makeStyleDeclarationFact, makeStyleFontSizeScaleFact, makeStylePropertyScaleFact, makeStyleRawColorForbiddenFact, makeStyleUnsupportedFact, makeTailwindClassFact, makeTailwindPaletteAllowFact, makeTailwindPaletteDenyFact, makeTailwindTokenResolvedFact, makeTailwindUnknownClassEnabledFact, makeThemeDeclarationFact, makeTokenDefinitionFact, makeUsageChildContentFact, makeUsageComponentFact, makeUsageImportFact, makeUsageInlineStyleFact, makeUsageNodeFact, makeUsagePropResolvedFact, makeUsageTextChildFact, matchPolicyExclude, matchesGlob, mcpBlockSchema, mcpCapabilitySchema, mcpComponentExampleSchema, mcpComponentGuidanceSchema, mcpComponentMetadataSchema, mcpComponentPropSchema, mcpComponentRelationSchema, mcpComponentSchema, mcpCompoundChildSchema, mcpGuidancePatternSchema, mcpPerformanceDataSchema, mcpPerformanceImportSchema, mcpPerformanceSummarySchema, mcpSnapshotMetadataSchema, mcpSnapshotSchema, mcpSnapshotSchemaVersionSchema, mcpSourceTypeSchema, mcpTokenDataSchema, mcpTokenSchema, mintEvaluationReceiptId, nearestByDeltaE, nearestSignedScaleValue, normalizeAnalysisPlanInputV1, normalizeCanonicalFactIntegrityV1, normalizeColor, normalizeConfigPath, normalizeExcludePath, normalizePolicyExcludes, normalizeRegistryRepoPath, normalizeRepositoryBindingKeyV1, normalizeStyleValue, normalizeToV1, normalizeTokenGroupComment, normalizeTokenValue, overriddenRecordSeverityDiagnostic, parseAnalysisPlanId, parseAnalysisPlanV1, parseColor, parseColorToRgb, parseComponentContract, parseContractStamp, parseCssTokens, parseDtcgTokens as parseDTCGFile, parseDesignTokenContent, parseDigestHex, parseDtcgTokens, parseEvaluationReceiptId, parseEvaluationReceiptV1, parseRgb, parseScssTokens, parseScssVariables, parseTailwindV4Theme, parseTokenFile, parseTokens, policyExcludeMatchesPath, policyExcludeSchema, portableRepoPathError, projectCanonicalDirectionConflicts, projectSupersededImportPathPreferences, propAnnotationSchema, propDefinitionSchema, proveCompliant, proveIssueCount, providerProofDigestV1, providerProofV1Schema, readRuleConfig, repositoryBindingDigestV1, repositoryBindingKeyV1Schema, resolveCanonicalForAriaRole, resolveCanonicalForRawHtml, resolveConfiguredAppPath, resolveDesignTokenValue, resolveFigmaMapping, resolvePerformanceConfig, resolveProveVerdict, resolveRegistryComponentId, resolveRegistryInstallSelection, resolveRegistryInstallSources, resolveSpacingValue, resolveTokenValue, rgbToHex, ruleA11yRequiredAccessibleName, ruleA11yStandard, ruleComponentsForbiddenPropValue, ruleComponentsPreferLibrary, ruleComponentsShadowComponent, ruleComponentsUnknownProp, ruleFamilyMembers, ruleJsxPreferredComponent, ruleJsxPreferredImportPath, rulePropsInvalidValue, ruleStylesNoRawColor, ruleStylesNoRawDimensions, ruleStylesNoRawSpacing, ruleStylesNoRawTypography, ruleTailwindArbitraryColor, ruleTailwindArbitrarySpacing, ruleTailwindForbiddenPalette, ruleTailwindOffScaleSpacingToken, ruleTailwindRawColorViaToken, ruleTailwindUnknownClass, ruleThemeNoThemeCoupledLiteral, ruleTokensRequireDualFallback, runRules, serializeContractStamp, sha256Hex, sourceToRegistryTargetPath, tierFor, tokenIncludesFromConfig, topologyBase, vocabularyRank };
|
|
14547
|
+
export { type A11yNameRequiredFact, AGENT_CONTEXT_RELATIVE_PATH, ANALYSIS_LIMIT_CEILINGS_V1, ANALYSIS_PLAN_MAX_CAPABILITIES_V1, ANALYSIS_PLAN_MAX_DIALECTS_PER_REGION_V1, ANALYSIS_PLAN_MAX_REGIONS_V1, APPROVED_CONTRACT_TOKEN_MAX_NAMES, APPROVED_CONTRACT_TOKEN_MAX_NAME_LENGTH, AgentFormat, type AnalysisLimitsV1, type AnalysisPlanId, type AnalysisPlanInputV1, type AnalysisPlanV1, type AnalysisRegionV1, BLOCKING_RULE_ALLOWLIST, BRAND, BlockDefinition, type Brand, type BuildAgentFormatInput, type BuildRegistryInstallPlanInput, type BundleArtifactMetadata, type BundleComponentShard, type BundleManifest, type BundleManifestComponentEntry, type BundleSchemaVersion, type BundleTarget, type BundleTokenFile, CANONICAL_FACT_MAX_CONFLICTS_V1, CANONICAL_FACT_MAX_PROVENANCE_PER_VALUE_V1, CANONICAL_FACT_MAX_VALUES_PER_CONFLICT_V1, CATALOG_FIXTURE_A_FCID, type CSSGeneratorOptions, type CanonicalBridgeIdentityBinding, CanonicalBridgeV1, type CanonicalCandidateFact, type CanonicalDirectionConflict, type CanonicalFactConflictV1, type CanonicalFactConflictValueV1, type CanonicalFactIntegrityV1, Finding as CanonicalFinding, type CanonicalIdentityReference, type CanonicalMappingFact, type CanonicalReplacementFact, CanonicalSource, type CheckedSpacingValue, type ClassNameDynamicFact, type ClassNameDynamicReason, type ClassNameFact, type ClassNameLiteralFact, type ClassNameOrigin, type ClassifyIdentityInput, type CompileEffectiveGovernanceInputsOptions, CompiledBlock, type CompiledContractOutput, CompiledFragment, type ComplexityTier, type ComponentCapabilityFact, type ComponentContract, type ComponentDefinitionFact, type ComponentDefinitionRenderRoot, type ComponentFactInput, type ComponentId, type ComponentIdentityFact, type ComponentIdentityUsage, type ComponentKeyInput, type ComponentLevelFact, type ComponentMetadataFact, type CompositionAnalysis, type CompositionAuthoringEntry, type CompositionChildSelector, type CompositionConstraint, type CompositionGuideline, type CompositionPattern, type CompositionRegionSelector, type CompositionSuggestion, type CompositionWarning, type ConformChange, type ConformComponentMapping, type ConformConfidence, type ConformCoverage, type ConformInput, type ConformLocation, type ConformPropMapping, type ConformResult, type ConformSuggestion, type ConformToken, type ConformUnresolved, ContractCanonicalMappingInput, ContractCatalogInput, ContractDomain, ContractPreimage, type ContractStampPin, type ContractStampRecord, type ContractTokenReferenceCensus, type CoverageRegionV1, type CoverageStateV1, type CoverageSummaryV1, CoverageValidationErrorV1, DEFAULTS, DEFAULT_ENHANCED_STYLE_PROPERTIES, DEFAULT_STYLE_PROPERTIES, type DTCGColorValue, type DTCGDimensionValue, type DTCGGroup, type DTCGToken, type DTCGTokenFile, type DTCGTokenType, type Defaults, type DeltaEMatch, type DesignSystemContext, type DesignToken, type DesignTokenParseOptions, type DigestHex, type DiscoverComponentsOptions, EFFECTIVE_GOVERNANCE_INPUTS_SCHEMA, EMPTY_VOCABULARY_MESSAGE, EVALUATION_MAX_FINDINGS_V2, EVALUATION_MAX_MAP_ENTRIES_V2, EVALUATION_MAX_POLICY_RULES_V2, EVALUATION_MAX_REASON_CODES_V2, EVALUATION_MAX_WAIVERS_V2, EVALUATION_MAX_WAIVER_MATCHES_V2, EVALUATION_RECEIPT_STRING_MAX_BYTES_V1, EVALUATOR_VERSION, EVALUATOR_VERSION_V2, type EffectiveEvaluationWaiverV2, type EffectiveGovernanceInputs, type EffectiveGovernanceInputsSourceState, type EffectivePolicy, type EffectiveRulePolicy, type EnhancedStyleComparisonResult, type EnhancedStyleDiffItem, type EvaluatedFinding, type EvaluationAuthorityV1, type EvaluationBaseline, type EvaluationContractInput, type EvaluationEvidence, type EvaluationEvidenceTrustV1, type EvaluationFindingInput, type EvaluationFindingState, type EvaluationInput, type EvaluationInputV2, type EvaluationIntegrityInput, type EvaluationIntegrityInputV2, type EvaluationMappingTrust, type EvaluationReason, type EvaluationReasonV2, type EvaluationReceiptId, type EvaluationReceiptMintInputV1, type EvaluationReceiptSemanticV1, type EvaluationReceiptV1, type EvaluationResult, type EvaluationResultV2, type EvaluationScope, type EvaluationSourceTrust, type EvaluationTrust, type EvaluationVerdict, type EvaluationWaiver, EvidenceGrade, type ExternalIdentityReference, FRAGMENTS_INTERNAL_RULE_IDS, FRAGMENT_V3_SCHEMA_URL, type Fact, type FactConflict, type FactEvidence, type FactId, FactIndex, type FactKind, type FactLocation, type FactOfKind, FigmaBooleanMapping, FigmaChildrenMapping, FigmaEnumMapping, FigmaInstanceMapping, FigmaStringMapping, FigmaTextContentMapping, type FigmaVariable, type FigmaVariableCollection, Finding, FindingFix, type FindingV2, FragmentAnnotationsV3, FragmentComponent, FragmentDefinition, FragmentDefinitionV2, FragmentDefinitionV3, FragmentDefinitionV3Body, FragmentDesignV3, FragmentDontExampleV3, FragmentGuidanceV3, FragmentMatrixV3, FragmentMetaV3, FragmentPreviewV3, FragmentStateV3, FragmentsConfig, Severity as FuiSeverity, GovernanceConfig, type GovernanceIntegrityFamily, type GovernanceIntegrityFamilyId, type GovernanceIntegrityInput, type GovernanceIntegrityRoster, type GovernanceIntegrityStatus, type GovernanceIntegrityVerdict, GovernanceSeverity, GovernedFragmentDefinition, type IdentityClassification, type IdentityConfidence, type IdentityDecision, type IdentityFact, type IdentityState, type InertConfigDiagnostic, type InertConfigDiagnosticCode, type InertConfigDiagnosticKind, type InferProps, type JsxComponentPreferredFact, type JsxImportPathPreferredFact, type JsxInlineStyleForbiddenRawFact, type JsxUnknownPropsForbiddenFact, LEGACY_EVALUATOR_VERSION_V2, type LocalIdentityReference, type McpBlock, type McpCapability, type McpComponent, type McpComponentExample, type McpComponentGuidance, type McpComponentMetadata, type McpComponentProp, type McpComponentRelation, type McpCompoundChild, type McpGuidancePattern, type McpPerformanceData, type McpPerformanceImport, type McpPerformanceSummary, type McpSnapshot, type McpSnapshotMetadata, type McpSnapshotSchemaVersion, type McpSourceType, type McpToken, type McpTokenData, type NearestByDeltaEOptions, type NormalizedStyleMap, type NormalizedToken, PRESET_NAMES, PROVE_DEFAULT_MAX_PASSES, PROVE_MAX_PASSES, PROVIDER_ID_MAX_BYTES_V1, type ParseTokensOptions, type ParsedToken, type PerformanceData as PerfData, type PerformanceSummary as PerfSummary, type PerformanceBudgets, type PerformanceConfig, type PolicyExclude, type PolicyExcludeInput, type PolicyFact, type PresetRuleState, PropAnnotation, type PropMetadataFact, type PropValueAvoidedFact, type PropValueForbiddenFact, type ProveCallbacks, type ProveLoopResult, type ProveOptions, type ProvePass, type ProvePassSampling, type ProveResidual, type ProveSample, type ProveSamplerArgs, type ProveVerdict, type ProviderProofSemanticV1, type ProviderProofV1, RAW_HTML_ADVISORY_TAGS, RAW_HTML_CANONICAL_TAGS, RAW_HTML_INPUT_TYPE_CANONICALS, RAW_HTML_ROLE_CANONICALS, REPOSITORY_BINDING_ID_MAX_BYTES_V1, type RGB, type RGBA, RULES, RULE_FAMILY_IDS, RULE_FAMILY_MEMBERS, RULE_TIER, type RawHtmlCanonicalMatch, type RawHtmlPrecisionTier, RegistryArtifact, RegistryDependency, RegistryFile, type RegistryInstallPlan, RegistryInstallReceipt, type RegistryInstallSelection, type RegistryInstallSelectionInput, type RegistryInstallSourceFile, type RegistryInstallSources, type RegistryInstallSourcesInput, RegistryManifest, type RegistryWritePlan, RelationshipType, type RepositoryBindingKeyV1, type RepositoryBindingKeyV1Input, type ResolvedDTCGToken, ResolvedGovernedFragmentDefinition, type ResolvedIdentityRenderRoot, type ResolvedIntrinsicIdentityRoot, type Rule, type RuleConfigView, type RuleFn, type RuleTier, type SCSSGeneratorOptions, type ScaleFact, type ScaleValueFact, Severity, type SpacingResolutionScale, type SpacingTokenLookup, type StructuralConfidenceFact, type StyleComparisonOptions, type StyleComparisonResult, type StyleCssVarsMustBeDefinedFact, type StyleDeclarationFact, type StyleDiffItem, type StyleFontSizeScaleFact, type StylePropertyScaleFact, type StyleRawColorForbiddenFact, type StyleUnsupportedFact, type StyleValueProvenance, type SupersededImportPathPreference, type SuppressionDirectiveFact, type TailwindClassFact, type TailwindModifier, type TailwindModifierKind, type TailwindPaletteAllowFact, type TailwindPaletteDenyFact, type TailwindResolutionSource, type TailwindResolvedKind, type TailwindResolvedValue, type TailwindTokenResolvedFact, type TailwindUnknownClassEnabledFact, type TailwindValue, type ThemeDeclarationFact, type ThemeParserResult, type TokenCatalog, type TokenCatalogDefinition, type TokenCatalogDiagnostic, type TokenCatalogLocation, type TokenCatalogReference, type TokenCatalogSourceState, type TokenCategory, TokenConfig, type TokenDefinitionFact, type TokenFix, type TokenFormat, type TokenLookup, type TokenMatchRequest, type TokenMatchResult, type TokenParseError, type TokenParseOutput, type TokenParseResult, type TokenRegistry, type TokenRegistryMeta, type TokenUsageSummary, type UnsupportedStyleReason, type UsageChildContentFact, type UsageComponentFact, type UsageFact, type UsageImportFact, type UsageInlineStyleFact, type UsageNodeFact, type UsagePropResolvedFact, type UsageTextChildFact, aiMetadataSchema, analysisLimitsV1Schema, analysisObligationsDigestV1, analysisPlanDigestV1, analysisPlanIdFromDigest, analysisPlanIdSchema, analysisPlanIdStringSchema, analysisPlanInputV1Schema, analysisPlanV1Schema, analysisRegionV1Schema, analyzeComposition, artifactContentHash, asComponentId, assertPortableRegistryPath, blockDefinitionSchema, budgetBar, buildAgentFormat, buildAnalysisPlanV1, buildComponentKey, buildRegistryInstallPlan, buildRegistryInstallReceipt, buildSpacingTokenLookup, bundleArtifactMetadataSchema, bundleComponentShardSchema, bundleManifestComponentEntrySchema, bundleManifestSchema, bundleSchemaVersionSchema, bundleTargetSchema, bundleTokenFileSchema, calculateDeltaE, canonicalBridgeContractMappings, canonicalBridgeIdentityBindings, canonicalBridgeIdentitySources, canonicalDirectionConflictsTarget, canonicalFactConflictV1Schema, canonicalFactConflictValueV1Schema, canonicalFactIntegrityV1Schema, canonicalJson, canonicalPreimage, canonicalSourceContainsFile, canonicalSourceIncludesExport, capConfiguredSeverity, catalogFixtureA, catalogFixtureAContractPayload, catalogFixtureATokensDtcg, clampMaxPasses, classifyComplexity, classifyIdentity, collectRegistryInstallDependencies, collidingRecordDiagnostic, collidingRecordDiagnostics, colorSimilarity, compareByVocabularyRank, compareColors, compareNumericValues, compareStyleValue, compareStyles, compareStylesWithTokens, compileBlock, compileComponentFacts, compileEffectiveGovernanceInputs, compileFragment, compileGlobalGovernanceFacts, componentContractSchema, componentId, componentRelationSchema, compositionAuthoringEntrySchema, compositionMetadataSchema, compositionPatternSchema, configDeclarationForDiagnostics, configRecordShape, configuredFindingSeverity, containsTailwindV4Theme, contractHash, contractTierRuleIds, contractTokenReferenceCensus, coverageArtifactDigestV1, coverageRegionV1Schema, coverageStateV1Schema, coverageSummaryV1Schema, customerDefaultRuleStates, defineBlock, defineConfig, defineFragment, deriveCoverageSummaryV1, describePolicyExclude, detectOrphanGovernanceScales, detectUnconsumedConfigKeys, detectUnmatchedPolicyExcludes, digestHexSchema, digestHexStringSchema, discoverComponents, dtcgTokenFileSchema, effectiveEvaluationWaiverV2Schema, emptyConformResult, emptyVocabularyConfigFile, evaluate, evaluateGovernanceIntegrity, evaluationInputDigestV2, evaluationInputV2Schema, evaluationReceiptDigestV1, evaluationReceiptIdFromDigest, evaluationReceiptIdSchema, evaluationReceiptIdStringSchema, evaluationReceiptMintInputV1Schema, evaluationReceiptV1Schema, evaluationResultDigestV2, evaluationResultV2Schema, excludeGlobToRegExp, expandRegistryComponentClosure, factId, familyDistance, figma, figmaPropMappingSchema, formatBytes, formatStampHeader, formatStampPin, formatStampVersionHash, formatTokenSummary, fragmentAnnotationsV3Schema, fragmentBanSchema, fragmentContractSchema, fragmentDefinitionSchema, fragmentDefinitionV2Schema, fragmentDefinitionV3BodySchema, fragmentDefinitionV3Schema, fragmentDesignV3Schema, fragmentDontExampleV3Schema, fragmentGeneratedSchema, fragmentGuidanceV3Schema, fragmentMatrixV3Schema, fragmentMetaSchema, fragmentMetaV3Schema, fragmentPreviewV3Schema, fragmentProvenanceSchema, fragmentSourceValues, fragmentStateV3Schema, fragmentUsageSchema, fragmentVariantSchema, fragmentsConfigSchema, fragmentsPresetRuleStates, gatesCi, generateCSSCustomProperties, generateFigmaVariables, generateSCSSVariables, generateTailwindConfig, getComplianceBadge, governedFragmentDefinitionSchema, hasEffectiveComponentVocabulary, hash64Hex, hexToRgb, hygieneTierRuleIds, indexComponentIdentityUsage, inferTokenCategory, inferTokenGroup, isApprovedContractTokenNames, isCanonicalSourceDefinition, isColorLike, isCompositionPattern, isContractFile, isContractTierRule, isDTCGFile, isDenyEligible, isEffectiveCanonicalSource, isEnforceableHtmlEquivalent, isFigmaPropMapping, isPortableRepoPath, isRawHtmlAdvisoryTier, isReactComponent, isRuleFamilyId, lowerCompositionContract, makeA11yNameRequiredFact, makeCanonicalCandidateFact, makeCanonicalMappingFact, makeCanonicalReplacementFact, makeClassNameDynamicFact, makeClassNameLiteralFact, makeComponentCapabilityFact, makeComponentDefinitionFact, makeComponentIdentityFact, makeComponentMetadataFact, makeContractTokenFact, makeFinding, makeJsxComponentPreferredFact, makeJsxImportPathPreferredFact, makeJsxInlineStyleForbiddenRawFact, makeJsxUnknownPropsForbiddenFact, makePropMetadataFact, makePropValueAvoidedFact, makePropValueForbiddenFact, makeScaleFact, makeScaleValueFact, makeStructuralConfidenceFact, makeStyleCssVarsMustBeDefinedFact, makeStyleDeclarationFact, makeStyleFontSizeScaleFact, makeStylePropertyScaleFact, makeStyleRawColorForbiddenFact, makeStyleUnsupportedFact, makeTailwindClassFact, makeTailwindPaletteAllowFact, makeTailwindPaletteDenyFact, makeTailwindTokenResolvedFact, makeTailwindUnknownClassEnabledFact, makeThemeDeclarationFact, makeTokenDefinitionFact, makeUsageChildContentFact, makeUsageComponentFact, makeUsageImportFact, makeUsageInlineStyleFact, makeUsageNodeFact, makeUsagePropResolvedFact, makeUsageTextChildFact, matchPolicyExclude, matchesGlob, mcpBlockSchema, mcpCapabilitySchema, mcpComponentExampleSchema, mcpComponentGuidanceSchema, mcpComponentMetadataSchema, mcpComponentPropSchema, mcpComponentRelationSchema, mcpComponentSchema, mcpCompoundChildSchema, mcpGuidancePatternSchema, mcpPerformanceDataSchema, mcpPerformanceImportSchema, mcpPerformanceSummarySchema, mcpSnapshotMetadataSchema, mcpSnapshotSchema, mcpSnapshotSchemaVersionSchema, mcpSourceTypeSchema, mcpTokenDataSchema, mcpTokenSchema, mintEvaluationReceiptId, nearestByDeltaE, nearestSignedScaleValue, normalizeAnalysisPlanInputV1, normalizeCanonicalFactIntegrityV1, normalizeColor, normalizeConfigPath, normalizeExcludePath, normalizePolicyExcludes, normalizeRegistryRepoPath, normalizeRepositoryBindingKeyV1, normalizeStyleValue, normalizeToV1, normalizeTokenGroupComment, normalizeTokenValue, overriddenRecordSeverityDiagnostic, parseAnalysisPlanId, parseAnalysisPlanV1, parseColor, parseColorToRgb, parseComponentContract, parseContractStamp, parseCssTokens, parseDtcgTokens as parseDTCGFile, parseDesignTokenContent, parseDigestHex, parseDtcgTokens, parseEvaluationReceiptId, parseEvaluationReceiptV1, parseRgb, parseScssTokens, parseScssVariables, parseTailwindV4Theme, parseTokenFile, parseTokens, policyExcludeMatchesPath, policyExcludeSchema, portableRepoPathError, projectCanonicalDirectionConflicts, projectSupersededImportPathPreferences, propAnnotationSchema, propDefinitionSchema, proveCompliant, proveIssueCount, providerProofDigestV1, providerProofV1Schema, readRuleConfig, repositoryBindingDigestV1, repositoryBindingKeyV1Schema, resolveCanonicalForAriaRole, resolveCanonicalForRawHtml, resolveConfiguredAppPath, resolveDesignTokenValue, resolveFigmaMapping, resolvePerformanceConfig, resolveProveVerdict, resolveRegistryComponentId, resolveRegistryInstallSelection, resolveRegistryInstallSources, resolveSpacingValue, resolveTokenValue, rgbToHex, ruleA11yRequiredAccessibleName, ruleA11yStandard, ruleComponentsForbiddenPropValue, ruleComponentsPreferLibrary, ruleComponentsShadowComponent, ruleComponentsUnknownProp, ruleFamilyMembers, ruleJsxPreferredComponent, ruleJsxPreferredImportPath, rulePropsInvalidValue, ruleStylesNoRawColor, ruleStylesNoRawDimensions, ruleStylesNoRawSpacing, ruleStylesNoRawTypography, ruleTailwindArbitraryColor, ruleTailwindArbitrarySpacing, ruleTailwindForbiddenPalette, ruleTailwindOffScaleSpacingToken, ruleTailwindRawColorViaToken, ruleTailwindUnknownClass, ruleThemeNoThemeCoupledLiteral, ruleTokensRequireDualFallback, runRules, serializeContractStamp, sha256Hex, sourceToRegistryTargetPath, tierFor, tokenIncludesFromConfig, topologyBase, vocabularyRank };
|
package/dist/index.js
CHANGED
|
@@ -10945,8 +10945,9 @@ function coverageArtifactDigestV1(rawPlan, rawCoverage) {
|
|
|
10945
10945
|
}
|
|
10946
10946
|
|
|
10947
10947
|
// src/evaluation/types.ts
|
|
10948
|
-
var EVALUATOR_VERSION = "evaluation-kernel:v1";
|
|
10949
|
-
var EVALUATOR_VERSION_V2 = "evaluation-kernel:v2";
|
|
10948
|
+
var EVALUATOR_VERSION = "evaluation-kernel:v1.1";
|
|
10949
|
+
var EVALUATOR_VERSION_V2 = "evaluation-kernel:v2.1";
|
|
10950
|
+
var LEGACY_EVALUATOR_VERSION_V2 = "evaluation-kernel:v2";
|
|
10950
10951
|
|
|
10951
10952
|
// src/evaluation/receipt.ts
|
|
10952
10953
|
import { z as z10 } from "zod";
|
|
@@ -11546,7 +11547,7 @@ function evaluate2(input) {
|
|
|
11546
11547
|
function isEvaluationInputV2(input) {
|
|
11547
11548
|
return "schemaVersion" in input && input.schemaVersion === 2;
|
|
11548
11549
|
}
|
|
11549
|
-
function evaluateV1(input) {
|
|
11550
|
+
function evaluateV1(input, deriveCanonicalTrust = true) {
|
|
11550
11551
|
const reasons = /* @__PURE__ */ new Set();
|
|
11551
11552
|
let fcidVerified = "unavailable";
|
|
11552
11553
|
if (input.contract.state === "unpinned") {
|
|
@@ -11583,7 +11584,7 @@ function evaluateV1(input) {
|
|
|
11583
11584
|
activeWaivers.add(waiver.fingerprint);
|
|
11584
11585
|
}
|
|
11585
11586
|
}
|
|
11586
|
-
const evidence = evidenceFindings(input);
|
|
11587
|
+
const evidence = evidenceFindings(input, deriveCanonicalTrust);
|
|
11587
11588
|
const findings = [...groupByFingerprint(evidence).values()].map((rows) => {
|
|
11588
11589
|
const classified = rows.map((row) => classifyFinding(row, input, activeWaivers));
|
|
11589
11590
|
return classified.reduce(
|
|
@@ -11613,7 +11614,7 @@ function evaluateV1(input) {
|
|
|
11613
11614
|
warnPresent: evidence.some((finding) => finding.severity === "warn"),
|
|
11614
11615
|
gatingFindingsPresent: counts.blocked > 0
|
|
11615
11616
|
};
|
|
11616
|
-
const inputDigest = sha256Hex(canonicalPreimage(normalizeInputForDigest(input)));
|
|
11617
|
+
const inputDigest = sha256Hex(canonicalPreimage(normalizeInputForDigest(input, evidence)));
|
|
11617
11618
|
const partial = {
|
|
11618
11619
|
evaluatorVersion: EVALUATOR_VERSION,
|
|
11619
11620
|
verdict,
|
|
@@ -11648,7 +11649,7 @@ var V2_INTEGRITY_REASONS = /* @__PURE__ */ new Set([
|
|
|
11648
11649
|
var SUPPORTED_FACT_SCHEMA_VERSIONS_V2 = /* @__PURE__ */ new Set(["facts:v1"]);
|
|
11649
11650
|
var SUPPORTED_REACT_WEB_PROFILE_VERSIONS_V1 = /* @__PURE__ */ new Set(["1"]);
|
|
11650
11651
|
function evaluateV2(rawInput) {
|
|
11651
|
-
if (rawInput.evaluatorVersion !== EVALUATOR_VERSION_V2) {
|
|
11652
|
+
if (rawInput.evaluatorVersion !== EVALUATOR_VERSION_V2 && rawInput.evaluatorVersion !== LEGACY_EVALUATOR_VERSION_V2) {
|
|
11652
11653
|
throw new Error(`Unsupported evaluator version: ${rawInput.evaluatorVersion}`);
|
|
11653
11654
|
}
|
|
11654
11655
|
if (!SUPPORTED_FACT_SCHEMA_VERSIONS_V2.has(rawInput.factSchemaVersion)) {
|
|
@@ -11687,7 +11688,10 @@ function evaluateV2(rawInput) {
|
|
|
11687
11688
|
},
|
|
11688
11689
|
evaluatedAt: input.evaluatedAt
|
|
11689
11690
|
};
|
|
11690
|
-
const compatibilityResult = evaluateV1(
|
|
11691
|
+
const compatibilityResult = evaluateV1(
|
|
11692
|
+
compatibilityInput,
|
|
11693
|
+
input.evaluatorVersion === EVALUATOR_VERSION_V2
|
|
11694
|
+
);
|
|
11691
11695
|
const requiredCoverage = coverageSummary.requiredRegions === 0 ? "no_required_regions" : coverageSummary.requiredByState.analyzed === coverageSummary.requiredRegions ? "complete" : "incomplete";
|
|
11692
11696
|
const integrity = {
|
|
11693
11697
|
fcidVerified: compatibilityResult.integrity.fcidVerified === true,
|
|
@@ -11773,17 +11777,39 @@ function normalizeInputV2ForDigest(input, coverageSummary) {
|
|
|
11773
11777
|
evaluatorVersion: input.evaluatorVersion
|
|
11774
11778
|
};
|
|
11775
11779
|
}
|
|
11776
|
-
function evidenceFindings(input) {
|
|
11780
|
+
function evidenceFindings(input, deriveCanonicalTrust) {
|
|
11777
11781
|
if (input.evidence.kind === "findings") return [...input.evidence.findings];
|
|
11778
11782
|
const ruleConfig = readRuleConfig(input.evidence.facts);
|
|
11783
|
+
const hasContractTokens = input.evidence.facts.byKind("contract_token").length > 0;
|
|
11779
11784
|
return runRules(input.evidence.facts).map((finding) => ({
|
|
11780
11785
|
fingerprint: finding.fingerprint,
|
|
11781
11786
|
ruleId: finding.ruleId,
|
|
11782
11787
|
severity: severityLevel(configuredFindingSeverity(finding, ruleConfig)),
|
|
11783
11788
|
advisory: finding.attributes?.advisory === true,
|
|
11784
|
-
evidenceGrade: finding.evidenceGrade
|
|
11789
|
+
evidenceGrade: finding.evidenceGrade,
|
|
11790
|
+
// An explicit trust decision still wins, including unknown/unconfirmed.
|
|
11791
|
+
// Only findings derived here from canonical facts earn the fallback.
|
|
11792
|
+
...deriveCanonicalTrust ? {
|
|
11793
|
+
mappingTrust: input.trust?.mappings[finding.fingerprint] ?? canonicalFactMappingTrust(finding, hasContractTokens)
|
|
11794
|
+
} : {}
|
|
11785
11795
|
}));
|
|
11786
11796
|
}
|
|
11797
|
+
function canonicalFactMappingTrust(finding, hasContractTokens) {
|
|
11798
|
+
switch (finding.ruleId) {
|
|
11799
|
+
case "components/shadow-component":
|
|
11800
|
+
return finding.attributes?.confidence === "confirmed" && typeof finding.attributes.canonicalTarget === "string" && finding.attributes.canonicalTarget.length > 0 ? "confirmed" : void 0;
|
|
11801
|
+
case "components/prefer-library":
|
|
11802
|
+
return typeof finding.attributes?.suggestedComponent === "string" && finding.attributes.suggestedComponent.length > 0 ? "confirmed" : void 0;
|
|
11803
|
+
case "tokens/css-vars-must-be-defined":
|
|
11804
|
+
return hasContractTokens ? "confirmed" : void 0;
|
|
11805
|
+
case "tokens/upstream-drift":
|
|
11806
|
+
return finding.evidence.some(
|
|
11807
|
+
({ fact }) => fact.kind === "token_definition" && "role" in fact && fact.role === "upstream"
|
|
11808
|
+
) ? "confirmed" : void 0;
|
|
11809
|
+
default:
|
|
11810
|
+
return void 0;
|
|
11811
|
+
}
|
|
11812
|
+
}
|
|
11787
11813
|
var STATE_RANK = { blocked: 0, pending_cloud_trust: 1, advisory: 2 };
|
|
11788
11814
|
var SEVERITY_RANK2 = { error: 0, warn: 1, info: 2 };
|
|
11789
11815
|
function canonicalRow(finding) {
|
|
@@ -11907,12 +11933,12 @@ function mappingFact(finding, input) {
|
|
|
11907
11933
|
if (mapping === "unconfirmed") return ["mapping:unconfirmed", "negative"];
|
|
11908
11934
|
return ["mapping:unknown", "unknown"];
|
|
11909
11935
|
}
|
|
11910
|
-
function normalizeInputForDigest(input) {
|
|
11936
|
+
function normalizeInputForDigest(input, evidence) {
|
|
11911
11937
|
return {
|
|
11912
11938
|
schema: "evaluation-input:v1",
|
|
11913
11939
|
contract: input.contract,
|
|
11914
11940
|
scope: input.scope,
|
|
11915
|
-
evidence: canonicalRows(
|
|
11941
|
+
evidence: canonicalRows(evidence),
|
|
11916
11942
|
policy: input.policy,
|
|
11917
11943
|
baseline: input.baseline,
|
|
11918
11944
|
adoption: input.adoption,
|
|
@@ -11999,6 +12025,7 @@ export {
|
|
|
11999
12025
|
GOVERNANCE_TELEMETRY_FIELDS,
|
|
12000
12026
|
GOVERNANCE_TELEMETRY_SOURCE_DISCLOSURE,
|
|
12001
12027
|
GOVERNANCE_TELEMETRY_TOP_LEVEL_FIELDS,
|
|
12028
|
+
LEGACY_EVALUATOR_VERSION_V2,
|
|
12002
12029
|
OWNED_PACKAGE_IDENTITY_EPOCH,
|
|
12003
12030
|
OWNED_PACKAGE_IDENTITY_SOURCE_SHA256,
|
|
12004
12031
|
PRESET_NAMES,
|