TenantAtlas/apps/platform/app/Support/Artifacts/ArtifactSourceTaxonomy.php
ahmido 75ebade345 feat: implement provider-neutral artifact source taxonomy (#343)
## Summary

Implements Spec 284 for provider-neutral artifact source taxonomy.

- add shared artifact source descriptor, resolver, taxonomy, and provider-detail support
- update findings, evidence snapshots, stored reports, inventory items, and tenant review surfaces to disclose descriptor-first artifact summaries
- add bounded Pest unit, feature, guard, and browser coverage for the taxonomy slice
- include the completed Spec 284 package artifacts under `specs/284-provider-neutral-artifact-source-taxonomy/`

## Notes

- branch: `284-provider-neutral-artifact-source-taxonomy`
- commit: `bf8d59e0`
- this PR was created as part of the requested commit/push/PR flow against `platform-dev`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #343
2026-05-08 23:47:31 +00:00

102 lines
2.7 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\Artifacts;
use Illuminate\Support\Str;
final class ArtifactSourceTaxonomy
{
public const string SOURCE_FAMILY_FINDING = 'finding';
public const string SOURCE_FAMILY_STORED_REPORT = 'stored_report';
public const string SOURCE_FAMILY_EVIDENCE_SNAPSHOT = 'evidence_snapshot';
public const string SOURCE_FAMILY_INVENTORY = 'inventory';
public const string SOURCE_FAMILY_OPERATION_RUN = 'operation_run';
public const string SOURCE_KIND_MODEL_SUMMARY = 'model_summary';
public const string SOURCE_KIND_STORED_REPORT = 'stored_report';
public const string SOURCE_KIND_OPERATION_ROLLUP = 'operation_rollup';
public const string SOURCE_KIND_INVENTORY_PROJECTION = 'inventory_projection';
public const string SOURCE_TARGET_MANAGED_ENVIRONMENT = 'managed_environment';
public const string SOURCE_TARGET_GOVERNED_SUBJECT = 'governed_subject';
public const string SOURCE_TARGET_PROVIDER_CONNECTION = 'provider_connection';
public const string SOURCE_TARGET_OPERATION_RUN = 'operation_run';
/**
* @return list<string>
*/
public static function sourceFamilies(): array
{
return [
self::SOURCE_FAMILY_FINDING,
self::SOURCE_FAMILY_STORED_REPORT,
self::SOURCE_FAMILY_EVIDENCE_SNAPSHOT,
self::SOURCE_FAMILY_INVENTORY,
self::SOURCE_FAMILY_OPERATION_RUN,
];
}
/**
* @return list<string>
*/
public static function sourceKinds(): array
{
return [
self::SOURCE_KIND_MODEL_SUMMARY,
self::SOURCE_KIND_STORED_REPORT,
self::SOURCE_KIND_OPERATION_ROLLUP,
self::SOURCE_KIND_INVENTORY_PROJECTION,
];
}
/**
* @return list<string>
*/
public static function sourceTargetKinds(): array
{
return [
self::SOURCE_TARGET_MANAGED_ENVIRONMENT,
self::SOURCE_TARGET_GOVERNED_SUBJECT,
self::SOURCE_TARGET_PROVIDER_CONNECTION,
self::SOURCE_TARGET_OPERATION_RUN,
];
}
public static function hasDetectorCatalog(): bool
{
return false;
}
public static function isSourceFamily(string $value): bool
{
return in_array($value, self::sourceFamilies(), true);
}
public static function isSourceKind(string $value): bool
{
return in_array($value, self::sourceKinds(), true);
}
public static function isSourceTargetKind(string $value): bool
{
return in_array($value, self::sourceTargetKinds(), true);
}
public static function label(?string $value): string
{
return filled($value) ? Str::headline((string) $value) : 'Unknown';
}
}