aiProductKnowledgeAnswerDraftSource(); expect($source)->toMatchArray([ 'use_case_key' => 'product_knowledge.answer_draft', 'source_family' => 'product_knowledge', 'data_classifications' => [ AiDataClassification::ProductKnowledge->value, AiDataClassification::OperationalMetadata->value, ], ]) ->and($source['topics'])->not->toBeEmpty() ->and($source['operational_metadata'])->toHaveKeys(['version', 'topic_count']) ->and($source)->not->toHaveKeys(['tenant', 'tenant_id', 'workspace', 'workspace_id']); }); it('exposes only the approved redacted support summary input for ai diagnostic drafts', function (): void { $workspace = Workspace::factory()->create(); $tenant = Tenant::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), ]); $source = app(SupportDiagnosticBundleBuilder::class)->aiSupportDiagnosticsSummaryDraftSource($tenant); expect($source)->toMatchArray([ 'use_case_key' => 'support_diagnostics.summary_draft', 'source_family' => 'support_diagnostics', 'data_classifications' => [ AiDataClassification::RedactedSupportSummary->value, ], ]) ->and($source['summary'])->toHaveKeys([ 'headline', 'dominant_issue', 'freshness_state', 'redaction_note', 'generated_from', ]) ->and(data_get($source, 'redaction.mode'))->toBe('default_redacted') ->and($source)->not->toHaveKeys(['sections', 'context', 'tenant', 'workspace', 'operation_run']); });