Documentation

Architecture

Components, governance flow, failure semantics, multi-channel readiness.

Gospel in Action is a theologically governed content factory. The governance layer is not a plugin; it is the substrate. An agent cannot receive work without a policy pack, and no artifact can reach YouTube without a passing audit record.

1. Layout

gospel-in-action/
├── constitution/              # source of truth, immutable versions
│   ├── current.json           # pointer: {"version": "1.0.1"}
│   ├── versions/<semver>.json # ratified policy (never edited in place)
│   ├── schemas/               # JSON schema for authoring new versions
│   └── CHANGELOG.md
├── data/bible/                # licensed translation corpus + manifest (not committed)
├── services/api/              # FastAPI application (Python 3.12+)
│   ├── app/constitution/      # loader, models, policy-pack renderer
│   ├── app/theology/          # audit engine, detectors, scripture verification
│   ├── app/workflow/          # persistent state machine
│   ├── app/agents/            # contracts + registry
│   ├── app/api/               # HTTP routers
│   ├── app/models.py          # SQLAlchemy schema
│   └── tests/
├── web/                       # Next.js dashboard shell
└── docker-compose.yml         # postgres + redis + api

2. Components

flowchart TD
    subgraph Control["Control plane"]
        D[Channel Director<br/>AGENT-00]
        CAL[(Content calendar)]
        BUD[(Budget ledger)]
    end

    subgraph Governance["Theological governance"]
        CONST[(Constitution<br/>v1.0.1 + hash)]
        PACK[Policy pack renderer]
        ENGINE[Audit engine]
        CORPUS[(Licensed scripture corpus)]
        STATUS[[Verified / Conflict / Unverified / Review]]
    end

    subgraph Production["Production plane"]
        R[Research AGENT-01]
        B[Biblical research AGENT-02]
        H[Hermeneutics AGENT-03]
        S[Script AGENT-04]
        P[Cinematics AGENT-05]
        V[Voice AGENT-06]
        T[Thumbnail AGENT-07]
        SEO[SEO AGENT-08]
        SH[Shorts AGENT-09]
    end

    subgraph Delivery["Delivery plane"]
        PUB[Publishing AGENT-10]
        YT[(YouTube)]
        AN[Analytics AGENT-11]
    end

    D -->|task + policy pack| R & B & H & S & P & V & T & SEO & SH
    CONST --> PACK
    PACK --> D
    S --> ENGINE
    B --> ENGINE
    SEO --> ENGINE
    CORPUS --> ENGINE
    ENGINE --> STATUS
    STATUS -->|publishable=false| D
    STATUS -->|publishable=true| PUB
    PUB --> YT --> AN --> D
    AN --> CAL
Diagram source (Mermaid). Rendered on GitHub; shown as source here.

3. Governance flow (the only path to publication)

  1. Director composes an AgentTask. The task carries the constitution version and hash.
  2. Policy pack renderer produces a role-scoped, document-kind-scoped markdown pack plus its own SHA-256. The pack is injected into the agent call; the agent is never trusted to remember policy.
  3. Agent returns an AgentResult (strict schema) with status, scripture, claims, uncertainties, interpretive_notes.
  4. Audit engine runs deterministic checks and fails closed: - regex prohibitions (transactional framing, penal substitution, determinism, dispensationalism, replacement theology, etymology fallacies, prosperity, sensationalism, misrepresentation) - terminology list - scripture reference resolution + quotation matching against the licensed corpus - citation completeness for historical/linguistic claims - required attestations for the document kind (exegetical judgement is attested, not invented by a regex)
  5. Gate: any of THEOLOGY_CONFLICT, THEOLOGY_UNCERTAIN, SCRIPTURE_UNVERIFIED, HISTORICAL_CLAIM_UNVERIFIED, NEEDS_THEOLOGICAL_REVIEW blocks READY_TO_PUBLISH.
  6. Publishing is refused by the state machine, not merely discouraged by the UI.

4. Failure semantics

Situation Behaviour
Detector/validator crashes NEEDS_THEOLOGICAL_REVIEW (never VERIFIED)
Scripture corpus missing SCRIPTURE_UNVERIFIED, publication blocked
Disputed passage Series position + named alternatives; firm novel claims need review
Agent returns partial output Contract validation error, task retried or flagged
Stage fails Status FAILED; project state preserved; resume from the failed stage
Duplicate request Idempotency key returns the original record

Negated usage (e.g. "this is not a transaction") is surfaced as a non-blocking qualification so reviewers still see it, without punishing correct contrastive writing.

5. Multi-channel readiness

Constitution is channel-agnostic by id + version. A second channel means a second constitution version (or a channel-scoped overlay) and its own content_projects scope; the engine, contracts, workflow and audit tables are unchanged. Translation is treated as a new artifact kind that must re-pass the audit — meaning is preserved, not just words.

6. Where the decisions live

Decision Location
What the channel believes constitution/versions/*.json
Which agent is allowed to do what app/agents/registry.py
What counts as a conflict prohibitions[].detectors
What counts as publishable publication_gate in the constitution + app/workflow/machine.py
What was true when a video shipped theological_audits.constitution_sha256

7. Deliberate non-decisions (Phase 1)

No LLM calls, no asset generation, no YouTube writes. The gate had to exist before the pipe; adding generation first would have produced content that could not be legally or theologically certified.

Source

Rendered from docs/ARCHITECTURE.md at build time. Return to the documentation index.