/** * Regulatory-update watcher types. * * The watcher polls public regulator feeds for new AI-relevant rules, compares * what it sees against a persisted "last seen" snapshot, and emits a digest * of new documents. This is the moat for plainstamp — the bundled rules in * `rules/seed.json` need ongoing maintenance, and this watcher surfaces the * documents that may justify a rule addition or `last_verified` bump. * * Sources are pluggable. Each source exposes a stable id, a fetch function * that returns a list of `Article`s, and a description for human auditors. */ export interface Article { /** Stable identifier the source uses for this document (e.g. Federal Register `document_number`). */ id: string; /** Human-readable title of the document. */ title: string; /** Publisher's canonical URL for the document. */ url: string; /** YYYY-MM-DD publication date. */ publishedAt: string; /** Free-form summary the source provides (abstract, summary, first paragraph, etc.). */ summary?: string; /** Names of the issuing agencies / publishers, where the source provides them. */ agencies?: string[]; /** Anything else the source returns that an auditor might want to inspect. */ extra?: Record; } export interface Source { /** Stable id used as the key in the state store. Lowercase kebab-case. */ id: string; /** Human-readable description for the audit log. */ description: string; /** Fetches recent articles from the regulator. May throw on transient network failure; the orchestrator catches and skips. */ fetch: () => Promise; } export interface SourceState { /** IDs of articles seen in prior runs. */ seen: string[]; /** Timestamp of the last successful run for this source. */ lastRunAt: string | null; } export interface WatcherState { schema_version: 1; sources: Record; } export interface SourceRunReport { source_id: string; description: string; ok: boolean; error?: string; new_articles: Article[]; total_seen: number; } export interface RunReport { run_at: string; sources: SourceRunReport[]; } /** * Pluggable state store. The Node CLI uses a filesystem-backed store * (`fsStateStore`); Cloudflare Workers / Deno Deploy / browsers use a * KV-backed store. Implementations may be sync or async; the watcher * always awaits. */ export interface StateStore { read(): Promise | WatcherState; write(state: WatcherState): Promise | void; } //# sourceMappingURL=types.d.ts.map