4.1 KiB
4.1 KiB
Development Policy
Purpose
This document defines contributor workflow for maintainers and coding agents. It complements architecture policy and documentation policy.
Repository layout
cmd/seriatim/: process entrypoint.internal/cli/: Cobra commands and flag wiring.internal/config/: option normalization and validation.internal/pipeline/: orchestration interfaces, registry, runner.internal/builtin/: implemented input/pre/post/output modules and merger.internal/artifact/: conversion from internal merged model to public shapes.internal/trim/: artifact-level trim logic.internal/normalize/: artifact-level normalize parsing/building.internal/render/: artifact-level rendering and renderer registry.internal/*domain packages: overlap, coalesce, danglers, filler, backchannel, speaker, autocorrect, report, model.schema/: public structs plus embedded JSON Schemas and validation.docs/: policy, user docs, roadmap, and internal docs.
Local checks
Primary repository check:
go test ./...
Useful manual checks for CLI-facing changes:
go run ./cmd/seriatim --help
go run ./cmd/seriatim merge --help
go run ./cmd/seriatim trim --help
go run ./cmd/seriatim normalize --help
go run ./cmd/seriatim render --help
Current toolchain note:
- There is no Makefile.
- There is no taskfile.
- There is no committed linter configuration.
- There is no automated documentation checker.
Coding conventions
- Keep core behavior deterministic for identical inputs/config/version.
- Keep CLI command functions thin: parse flags, construct config, delegate.
- Keep validation in
internal/configand package-specific validators. - Return errors from deep logic; do not print inside internal packages.
- Preserve clear package boundaries between adapters and domain transforms.
- Define configuration defaults as constants in internal/config/config.go.
Dependency policy
Prefer the Go standard library first.
Third-party dependencies should stay narrow and justified. Current direct runtime dependencies are:
github.com/spf13/cobrafor CLI structure.gopkg.in/yaml.v3for YAML rule files.github.com/santhosh-tekuri/jsonschema/v6for public schema validation.
Adding CLI flags
- Add the flag in the relevant
internal/cli/*.gocommand. - Thread the raw value through
config.*Options. - Add normalization/validation in
internal/config/config.go. - Update or add CLI/config tests.
- Update canonical docs (
docs/cli.md,docs/config.md) if user-visible.
Adding config fields or environment variables
- Add field(s) to the relevant config struct(s).
- Parse and validate in
internal/config/config.go. - Add tests in
internal/config/config_test.go. - Thread validated values into consuming modules.
- Update
docs/config.mdand related docs.
Adding modules or pipeline behavior
- Implement the module in the appropriate package (often
internal/builtin). - Expose a stable module name via
Name(). - Register it in
internal/builtin/registry.go. - Ensure preprocessing modules declare correct
Requires()/Produces()states. - Add/adjust tests in module packages and
internal/cli/merge_test.go. - Document internal behavior changes in
docs/internal/.
Schema and artifact changes
- Update public structs and validation logic in
schema/. - Update embedded JSON Schema files (
schema/*.schema.json) if contract changes. - Update conversion behavior in
internal/artifact,internal/trim, and/orinternal/normalizeas needed. - Add tests in
schema/,internal/artifact/,internal/trim/,internal/normalize/, and CLI tests. - Update user and internal docs that reference output contracts.
Documentation expectations
- Outside
docs/roadmap/, document only implemented behavior. - Keep canonical homes: CLI in
docs/cli.md, config indocs/config.md, operations indocs/operations.md, troubleshooting indocs/troubleshooting.md, internals indocs/internal/. - When behavior changes, update docs in the same change.