(claim)
| 13 | |
| 14 | // Bad inputs surface as `unsupported` — never throws. |
| 15 | export async function verifyClaim(claim) { |
| 16 | if (!claim || typeof claim !== 'object') { |
| 17 | return { disposition: 'unverifiable', reason: 'claim is not an object' }; |
| 18 | } |
| 19 | switch (claim.type) { |
| 20 | case 'file_exists': return verifyFileExists(claim); |
| 21 | case 'pattern_count': return verifyPatternCount(claim); |
| 22 | case 'pattern_exists': return verifyPatternExists(claim); |
| 23 | case 'pattern_absent': return verifyPatternAbsent(claim); |
| 24 | case 'code_snippet': return verifyCodeSnippet(claim); |
| 25 | case 'repo_count': return verifyRepoCount(claim); |
| 26 | case 'citation_in_library': return verifyCitationInLibrary(claim); |
| 27 | case 'citation_applies_to_version': return verifyCitationAppliesToVersion(claim); |
| 28 | case 'cache_vary_matches_dynamic_inputs': return verifyCacheVaryMatchesDynamicInputs(claim); |
| 29 | case 'cache_vary_cardinality_safe': return verifyCacheVaryCardinalitySafe(claim); |
| 30 | case 'next_cached_not_found_causal_support': return verifyNextCachedNotFoundCausalSupport(claim); |
| 31 | case 'next_stable_cache_api_for_version': return verifyNextStableCacheApiForVersion(claim); |
| 32 | case 'next_runtime_cache_api_for_version': return verifyNextRuntimeCacheApiForVersion(claim); |
| 33 | case 'next_cache_components_runtime_cache_preference': return verifyNextCacheComponentsRuntimeCachePreference(claim); |
| 34 | case 'next_cache_life_single_execution': return verifyNextCacheLifeSingleExecution(claim); |
| 35 | case 'next_cache_lifetime_freshness_supported': return verifyNextCacheLifetimeFreshnessSupported(claim); |
| 36 | case 'next_cache_components_route_chain_file': return verifyNextCacheComponentsRouteChainFile(claim); |
| 37 | case 'next_cache_life_cdn_header_semantics': return verifyNextCacheLifeCdnHeaderSemantics(claim); |
| 38 | case 'image_response_headers_citation': return verifyImageResponseHeadersCitation(claim); |
| 39 | case 'next_image_priority_api_for_version': return verifyNextImagePriorityApiForVersion(claim); |
| 40 | case 'next_cache_components_route_segment_config': return verifyNextCacheComponentsRouteSegmentConfig(claim); |
| 41 | case 'next_route_revalidate_static_prereq': return verifyNextRouteRevalidateStaticPrereq(claim); |
| 42 | case 'next_cache_tag_invalidation_supported': return verifyNextCacheTagInvalidationSupported(claim); |
| 43 | case 'cache_rec_not_error_dominated_or_acknowledged': return verifyCacheRecNotErrorDominatedOrAcknowledged(claim); |
| 44 | case 'cache_control_header_syntax': return verifyCacheControlHeaderSyntax(claim); |
| 45 | case 'cache_control_headers_citation': return verifyCacheControlHeadersCitation(claim); |
| 46 | case 'cache_policy_positive_or_no_ready_rec': return verifyCachePolicyPositiveOrNoReadyRec(claim); |
| 47 | case 'cache_404_long_ttl_safety': return verifyCache404LongTtlSafety(claim); |
| 48 | case 'route_error_not_found_status_and_scope': return verifyRouteErrorNotFoundStatusAndScope(claim); |
| 49 | case 'immutable_dynamic_route_safety': return verifyImmutableDynamicRouteSafety(claim); |
| 50 | case 'auth_guard_parallelization_safety': return verifyAuthGuardParallelizationSafety(claim); |
| 51 | case 'parallelization_impact_not_overclaimed': return verifyParallelizationImpactNotOverclaimed(claim); |
| 52 | case 'parallelization_not_cpu_bound_work': return verifyParallelizationNotCpuBoundWork(claim); |
| 53 | case 'runtime_error_cause_supported': return verifyRuntimeErrorCauseSupported(claim); |
| 54 | case 'vercel_ignore_command_project_state': return verifyVercelIgnoreCommandProjectState(claim); |
| 55 | case 'turbo_build_cache_safety': return verifyTurboBuildCacheSafety(claim); |
| 56 | case 'does_not_contradict_project_config': return verifyNoProjectConfigContradiction(claim); |
| 57 | default: |
| 58 | return { disposition: 'unverifiable', reason: `unknown claim type: ${claim.type}` }; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // Catches "enable fluid compute" recs that the brief negative-space filter let through. |
| 63 | async function verifyNoProjectConfigContradiction({ rec, projectFacts }) { |
no test coverage detected