Files
2026-10-18 09:21:12 -06:00

56 lines
6.8 KiB
Markdown

# Architecture and data contracts
## Default local-review profile (0.2.0)
The primary workflow starts with three files, metadata intake, local generation, then human review. `folder_builder.py` implements `intake.schema.json` and `folder-export.schema.json`, preserving unknowns without requiring invented URLs or prior approval. Originals remain unchanged; TXT/VTT differences become review notes. All output is draft. Intake and structure-plan JSON are editable inputs.
The remaining sections describe the stricter optional public exporter retained from 0.1.0. Its catalog/manifest contracts and gates do not apply to ordinary local drafts. See [folder workflow](workflow.md) and [later public export](public-export.md).
Version 0.3.0 adds an explicit `approved` state within the local-review profile. Final approval is a separate action over a reviewed draft: source files, intake, semantic plan, output hashes, reviewer, and evidence are bound in an approval record. Verification and local search accept both states. Public readiness stays separate. Repository identity follows the software-automation profile with MIT code/docs, a source document catalog, and upstream-compatible manifest schemas.
## Sources and build direction
The original recording is the evidence for what happened. A reviewed VTT is the authoritative timed text representation. TXT mirrors its words. `media.json` owns recording facts, rights, publication clearance, and transcription provenance. `plan.json` owns semantic boundaries, stable identities, authored interpretations, citations, chapters, and review metadata. A collection catalog lists the intended release set.
Generated files are disposable derivatives. Never edit them as source. A build has no wall-clock timestamps: meaningful dates come from authored metadata, so identical inputs produce identical bytes. Exact source hashes detect transcription/metadata changes; exported checksums detect derivative changes.
| Implemented | Deliberately separate / future |
| --- | --- |
| Reviewed VTT/TXT ingestion and alignment | STT vendor orchestration and downloads |
| Authored semantic plans; deterministic source text | Automatic LLM interpretation and review |
| Timed citations, chunks, grounded Q&A, chapters | OCR, slides, scene/frame descriptions, visual evidence |
| Static companion pages, JSON-LD, catalog, sitemap | Deployment, search-engine validation, video sitemap extension |
| Local keyword search with citations | Hosted API, MCP runtime, authentication, rate limits |
| Checksummed input/output and explicit versions | Full CIS envelope, registry, graph, policy service, tombstones |
| Portable JSON for downstream retrieval | Vector database, embeddings, hybrid ranking, evaluation corpus |
## Minimum semantic projection
This uses the guide repositories' lightweight CIS approach rather than copying the entire advanced envelope. Each chunk has an authored `chunk_id`, conceptual `knowledge_id`, integer version, prior IDs when superseding, label, heading path, summary, tags, order, exact transcript text, cue IDs, start/end seconds, speakers when present, and citations. Document-level rights and the input fingerprint apply to all chunks and Q&A.
IDs are namespaced by media ID in the examples. They are assigned during authoring and preserved across compatible edits. They are not text hashes or timecodes. The builder enforces uniqueness within a recording; a future cross-corpus registry must reconcile conceptual identity explicitly. `supersedes` is authored lineage, not a validated remote relationship.
Each citation includes media/cue IDs, start/end seconds, a canonical transcript anchor, and a native player link when available. Transcript cue IDs are revision-sensitive locators, so archive the input hash/version with a citation when exact historical reconstruction matters. Keep old approved releases privately as needed; public permanent version URLs are a future hosting decision.
## JSON contracts
The seven public-export schemas plus the two local intake/export [JSON Schemas](../schemas/README.md) use Draft 2020-12 and reject unknown fields. Runtime validation also checks relationships that JSON Schema alone cannot establish: identity alignment, sequential cue coverage, time bounds, exact evidence quotes, chapter ordering, TXT/VTT equality, review hashes, URL safety, output boundaries, and publication clearance.
`qa.json` may contain zero answers. A claim in a transcript is attributed speech, not independent verification. Q&A can synthesize multiple cues, but each supporting quote must be a literal substring of its referenced cue. The builder cannot mechanically prove entailment; review is required.
`chapters.json` uses the Podcast Namespace chapter format with `version: 1.2.0` and seconds as numbers. It is separate from our transcript schema and from the namespace's alternative transcript JSON format. Those formats use different field names; do not advertise our `transcript.json` as a Podcast Namespace JSON transcript. Use the exported TXT/VTT for podcast links today.
## Discovery and playback
The public URL root is the contents of a build directory. `/media/<id>/` contains the human page and relative alternate links. JSON artifact URLs share that canonical path. `/ai-index.json` routes to all release items and their artifacts. `llms.txt` is optional guidance, while `sitemap.xml` is a standard URL sitemap. Neither is an access-control mechanism or a guarantee that an AI will fetch content.
Native `content_url` playback uses HTML video/audio and `?t=<seconds>` on the companion page. Its small player script seeks after metadata loads. A source URL's CORS, media availability, MIME, codecs, and range support must be checked at publication. Embed-only media gets an outbound recording link and transcript anchors; it does not claim universal external-platform seeking. Integrate a host's supported player API explicitly if needed.
Video chapters become Schema.org `Clip` records only for a native player, where the builder actually implements time links. Audio emits `AudioObject`. Generic Schema.org validity is distinct from eligibility for a particular search feature. No `FAQPage`, `SeekToAction`, live API, or MCP capability is advertised just because a Q&A file or interface design exists.
## Privacy and rights
Raw source locations never appear in the export. The public `media.json` omits local transcript paths. It still contains reviewed creator/provenance and rights facts; review those for intended publication. VTT is copied intact, including NOTE blocks, so remove private annotations before clearance. No automatic PII redactor is claimed.
This first profile is for fully public, cleared content. It is not a private meeting vault or multi-tenant permission system. A private or paid corpus needs an access layer that checks policy before any list/search/fetch response, including snippets and Q&A; static obscurity and robots directives are insufficient.