Files
scriptorium/docs/internal/overview.md

3.7 KiB

Internal Component Overview

Purpose

This is the inventory of Scriptorium's implemented components for contributors. The architecture policy owns normative boundaries and invariants; public behavior belongs in the linked contracts.

Public And Command Entrypoints

Component Implemented responsibility References
Root package scriptorium Public Go facade that constructs the engine, exposes request/result types and options, and maps internal errors. Go package contract, adapter internals
cmd/scriptorium Process entrypoint that delegates command execution to the CLI adapter. CLI contract, adapter internals

Adapters, Domain, And Use Case

Component Implemented responsibility References
internal/adapter/cli Parses CLI commands, applies application wiring, and handles process input and output. CLI contract, adapter internals
internal/adapter/http Maps HTTP requests and responses to domain operations and maps public errors. HTTP API contract, adapter internals
internal/domain Defines core request, result, output-contract, and LLM-boundary types. runner internals
internal/usecase Implements Runner preparation, execution, validation coordination, and the repairer boundary. runner internals

Configuration And Sources

Component Implemented responsibility References
internal/config Loads application settings, applies defaults, and applies CLI overrides. configuration contract, adapter internals
internal/defaults Holds compile-time default values used when application settings are resolved. configuration contract
internal/promptdef Loads prompt definitions from filesystem and fs.FS sources. configuration contract, source internals
internal/profile Loads filesystem and fs.FS execution profiles and combines profile repositories. configuration contract, source internals
internal/profile/builtin Provides embedded built-in execution profiles as a repository. configuration contract, source internals
internal/filecatalog Provides shared YAML discovery and source-root helpers. source internals
internal/artifact Reads inline and file-backed input artifacts. configuration contract, HTTP API contract, source internals
internal/prompt Renders prompt templates into messages. runner internals

Formatting, Validation, And Model Access

Component Implemented responsibility References
internal/format Formats prepared-run information for CLI output. CLI contract, adapter internals
internal/validate Defines validation interfaces and provides standard filesystem and fs.FS schema validation. configuration contract, source internals, runner internals
internal/llm Defines the provider-neutral LLM client boundary and its OpenAI-compatible implementation. OpenAI-compatible integration, LLM internals, runner internals

Focused internal documents describe the components that have detailed orchestration, adapter, or source behavior. Package tests live alongside the implementation and are identified in those focused documents where relevant.