This repository stores structured request documents (organized into sources/, claims/, and proofs/), the OpenAPI schema that defines their expected shape, and helper scripts used by CI to validate and POST new documents to an API.
oapi.yaml— OpenAPI / schema file that defines the JSON schemas used for documents and the POST endpoints.sources/— Source documents (YAML files) that describe original sources.claims/— Claim documents (YAML files) that assert specific claims and reference sources.proofs/— Proof documents (YAML files) that support or refute claims.scripts/— Validation and POST helper scripts. See scripts/validate.py and scripts/post_requests.py.requirements.txt— Python dependencies for running the scripts locally.AGENTS.md— guidance for AI agents working with this repo.
- PR Validation: A GitHub Actions workflow runs on pull requests (to
main) and executespython scripts/validate.pyto validate any new documents in the tracked folders. This ensures added documents conform to the schemas inoapi.yamlbefore merge. - Post-on-merge: After a PR is merged to
main, another workflow runspython scripts/post_requests.pyand POSTs newly added files to configured API endpoints. The POST script expectsAPI_BASE_URLandAPI_KEYenvironment variables and receives the list of added files via theADDED_FILESenvironment variable. - Verify Claims and Source Scores: A dedicated workflow (scheduled or on-demand) verifies claims in
claims/and computes or updates source scores. The canonical verification and scoring logic is maintained in thesource-scoreproject (see note below).
See scripts/validate.py and scripts/post_requests.py for exact behavior and failure modes.
-
Single source of truth:
oapi.yamlcontains the document schemas (eg.SourceInput,ClaimInput,ProofInput) undercomponents.schemasand maps those schemas to POST paths underpaths. -
Validation:
scripts/validate.pyloads the relevant schema fromoapi.yamland validates new YAML docs against it (JSON Schema Draft 2020-12). -
Routing:
scripts/post_requests.pymaps schema$refs to the APIpathsso that validated documents are posted to the correct endpoint. -
Important:
oapi.yamlin this repository is a copy and should never be edited here. The source of truth for the schema is thesource-scorerepository: https://github.com/SatyaLens/source-score.
- Identify the correct folder and schema in
oapi.yamlfor your document type (sources/,claims/, orproofs/). - Create a new YAML file in the appropriate folder, satisfying all
requiredfields from the schema. Example constraints are documented inoapi.yaml(and summarized inAGENTS.md). - Validate locally before opening a PR:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python scripts/validate.py path/to/your-file.yaml- Open a PR that only adds new files (per repo rules). The CI validation workflow will run automatically.
- After merge, the post-merge workflow will run
scripts/post_requests.pyfor any newly added tracked files and attempt to POST them to the configured API.
Notes about post_requests.py: it requires API_BASE_URL and API_KEY to be set in the environment (CI supplies these as a variable and secret respectively). Locally you can run the script with those env vars, but be careful with credentials.
Important: This directory layout and workflow are a first iteration to make document validation and posting work. The structure of sources/, claims/, and proofs/ will most likely change in future updates to make it easier to author and contribute new documents. Expect schema refinements, directory reorganizations, and improved developer ergonomics in later iterations.