caelum0x dd069746b9 chore(repo): flatten project to repository root
The whole project lived under a redundant veritas/ subdirectory with only a
stub README.md at the repo root, so GitHub showed caelum0x/veritas as
veritas/<everything>. Move all files up to the root and drop the stub.
History is preserved (git detects renames). Build unaffected: 0 type errors
across packages + all 31 apps, 49 tests passing from the new root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 15:05:43 +03:00

48 lines
1.4 KiB
TypeScript

// Classification levels for data sensitivity: public < internal < confidential < restricted
import { z } from "zod";
export const ClassificationLevelSchema = z.enum([
"public",
"internal",
"confidential",
"restricted",
]);
export type ClassificationLevel = z.infer<typeof ClassificationLevelSchema>;
export const CLASSIFICATION_LEVELS: readonly ClassificationLevel[] = [
"public",
"internal",
"confidential",
"restricted",
] as const;
export const CLASSIFICATION_ORDINAL: Record<ClassificationLevel, number> = {
public: 0,
internal: 1,
confidential: 2,
restricted: 3,
};
/** Returns true if `a` is at least as sensitive as `b`. */
export function atLeast(a: ClassificationLevel, b: ClassificationLevel): boolean {
return CLASSIFICATION_ORDINAL[a] >= CLASSIFICATION_ORDINAL[b];
}
/** Returns the more sensitive of two levels. */
export function maxLevel(
a: ClassificationLevel,
b: ClassificationLevel,
): ClassificationLevel {
return CLASSIFICATION_ORDINAL[a] >= CLASSIFICATION_ORDINAL[b] ? a : b;
}
/** Human-readable description for each classification level. */
export const CLASSIFICATION_DESCRIPTIONS: Record<ClassificationLevel, string> = {
public: "No restrictions; freely shareable.",
internal: "Internal use only; not for public disclosure.",
confidential: "Sensitive data; need-to-know access required.",
restricted: "Highest sensitivity; tightly controlled access.",
};