migrate to root dir

This commit is contained in:
2025-08-08 19:26:21 +02:00
parent cf8219691b
commit 8720500442
41 changed files with 2478 additions and 4440 deletions

31
lib/pipeline/validator.ts Normal file
View File

@@ -0,0 +1,31 @@
import { StoryConfig } from "./config";
export interface ValidationResult {
is_public_domain: boolean;
message: string;
}
export function validatePublicDomain(storyConfig: StoryConfig): ValidationResult {
const publicationYear = storyConfig.metadata.publication_year;
if (!publicationYear) {
return {
is_public_domain: false,
message: "Publication year not found in metadata.",
};
}
const currentYear = new Date().getFullYear();
const cutoffYear = currentYear - 95;
if (publicationYear > cutoffYear) {
return {
is_public_domain: false,
message: `Work published in ${publicationYear} is not yet in the US public domain (cutoff: ≤ ${cutoffYear}).`,
};
}
return {
is_public_domain: true,
message: "Work is in the public domain in the US (95-year rule).",
};
}