23 KiB
Documentation Refresh Implementation Plan
Status
Accepted for implementation.
This is a temporary, staged coordination plan for refreshing Weatherreporter's current documentation. Implement each stage in order. Do not treat this file as a current-behavior reference.
Objective
Bring every maintained document and example into agreement with:
- the implemented Go application;
- the canonical ownership rules in
docs/policy/documentation.md; - the architectural boundaries in
docs/policy/architecture.md; - the testing rules in
docs/policy/testing.md; and - the contributor routing in
docs/development.md.
The completed documentation set must be concise, task-oriented, free of stale or duplicate contracts, and verifiably consistent with the executable sources of truth.
Scope And Constraints
This is a documentation-only refresh.
- Do not add or change product behavior.
- Do not modify Go code, schemas, prompts, or templates to make documentation claims true.
examples/*.ymlmay be corrected when they disagree with implemented configuration, because examples are maintained documentation artifacts.- If code and documentation disagree, document implemented and tested behavior.
- If code appears to violate an architecture or safety policy, do not conceal the conflict with prose and do not fix it during this refresh. Record the conflict in this plan's implementation notes and report it to the maintainer.
- Do not implement any work from
docs/roadmap/future.mdordocs/roadmap/promptkit.md. - Preserve the exact contents of
AGENTS.md. - Treat
docs/policy/*.mdanddocs/development.mdas the governing baseline. Change them only to repair a link made stale by this refresh; do not reopen their substantive decisions. - Do not create
docs/internal/overview.md;docs/development.mdowns the current concise package inventory. - Do not introduce a release guide, public API guide, consumer guide, or ADR unless a separate maintainer decision expands this plan.
- Preserve unrelated working-tree changes and do not commit unless explicitly instructed.
Executable Authorities
Use codebase-memory graph tools before text search for code discovery. Index the
repository first if needed, use search_graph to locate symbols,
trace_path for dependencies and impact, and get_code_snippet for exact
source. Use graph-augmented search_code or rg for literal flags, paths,
errors, schemas, asset names, and configuration values.
The primary authorities for this refresh are:
| Contract | Executable authority |
|---|---|
| CLI commands, flags, help, and dispatch | internal/cli/root.go, internal/report/names.go, and internal/cli/root_test.go |
| CLI JSON summaries and stdout/stderr behavior | internal/cli/output.go, internal/cli/result.go, and their tests |
| Configuration fields, defaults, loading, precedence, secrets, templates, and validation | internal/config/*.go and internal/config/config_test.go |
| Report IDs, modes, periods, modules, output names, comparison, and Distributor paths | internal/report/*.go and internal/report/period_test.go |
| Application generation, batch, inspection, persistence, and notification order | internal/app/*.go, internal/app/*_test.go, and internal/cli/root_test.go |
| Weather collection and external Weather API behavior | internal/collect, internal/weatherdata, internal/adapters/weatherapi, fixtures, and focused tests |
| Facts, forecast derivation, modules, and Recent Changes | internal/facts, internal/forecast, internal/module, internal/briefing, internal/changes, and focused tests |
| Prompt packages and Scriptorium invocation | internal/promptinput, internal/adapters/scriptorium, and focused tests |
| Generated text, render contexts, templates, and schemas | internal/generatedtext, internal/reporttemplate, embedded assets, and focused tests |
| Workspace paths, metadata, atomic writes, prior lookup, and inspection | internal/state, internal/fileutil, and focused tests |
| Distributor bundle, upload, polling, redaction, and notification behavior | internal/adapters/distributor, internal/app/batch_notification.go, go.mod, and focused tests |
Sibling repositories may be used only as secondary integration references. Weatherreporter's pinned dependency, adapter code, and tests determine the subset this repository actually uses. Do not copy broad upstream manuals into this repository.
Rules For Every Stage
For each stage:
- Read the task-specific entries in
docs/development.md. - Inspect the listed executable authorities and focused tests.
- Update only the files assigned to the stage, plus this plan's stage status if progress tracking is requested.
- Keep exact facts in their canonical owner. Replace duplicate detail with a short stable summary and a relative link.
- Describe implemented behavior only outside
docs/roadmap/. - Keep examples synthetic, valid, and secret-free.
- Use language tags on every fenced block.
- Run the stage validation before proceeding.
- Do not reinterpret surprising behavior as intent; tests and executable contracts take precedence over old prose.
Stage 1: Inventory And Mechanical Hygiene
Files
README.md- all Markdown files under
docs/ examples/*.yml
Work
- Classify every document under the ownership table in
docs/policy/documentation.md. Do not create a separate permanent inventory document. - Identify duplicated exact contracts, stale paths, broken links, untagged code fences, and current-state claims in the wrong document.
- Repair mechanical link and path defects that do not require content redesign.
- In
docs/integrations/distributor/pkg-bundle.md, remove the broken local link to../integrations/source-bundle.md. Identify the upstream canonical file asdocs/integrations/source-bundle.mdin the Distributor repository using prose or code formatting, not a nonexistent repository-relative link. - In
docs/integrations/distributor/pkg-upload.md, do the same for the broken../integrations/http-upload.mdlink. - Confirm that no document references the retired development-policy path.
- Defer substantive rewrites to the assigned later stage; this stage should establish a clean mechanical baseline.
Acceptance
- Every repository-relative link target exists.
- All fenced blocks have language tags.
- No stale development-policy reference remains.
- No future feature is presented as current behavior outside
docs/roadmap/. git diff --checkpasses.
Stage 2: CLI, Configuration, And Examples
Files
docs/cli.mddocs/config.mdexamples/minimal-config.ymlexamples/config.yml
CLI Work
- Regenerate the command inventory from
go run ./cmd/weatherreporter --helpand verify it againstinternal/cli/root.goand report command-name tests. - Keep this document's order:
- shortest useful command;
- command overview and complete usage;
- stdout, stderr, JSON summary, quiet-mode, and exit behavior;
- complete flag reference;
- concise invocation examples; and
- inspection commands.
- Keep exact command syntax and output semantics here. Move or replace
operational workflow explanations with links to
operations.md. - Verify all seven generate commands, both batch commands, and every inspect command.
- Verify command-specific restrictions: required Daily date, optional Today date, Storm bounds, Hourly restrictions, generate output copies, batch output directories, and inspection quiet-mode rejection.
Configuration Work
- Compare every documented field and default with
Config,Defaults, loading, secret loading, report overrides, notification templates, and validation code. - Keep discovery, precedence, fields, defaults, accepted values, validation rules, secret-supply behavior, and links to examples here.
- Keep operational notification sequencing, filesystem lifecycle, and
recovery in
operations.md; summarize and link rather than duplicate them. - Verify report-module override keys against the report registry and module registry.
- Verify every template placeholder accepted by Distributor notification configuration.
Example Work
- Ensure both examples contain only implemented fields and synthetic endpoints.
- Keep
minimal-config.ymlgenuinely minimal. - Keep
config.ymlproduction-oriented and representative without becoming a second field reference. - Do not add credentials, private endpoints, or generated reports.
Validation
go run ./cmd/weatherreporter --help
go test ./internal/cli ./internal/config ./internal/report ./internal/module
git diff --check
The config tests must load the maintained examples successfully.
Stage 3: README And Operations
Files
README.mddocs/operations.md
README Work
Keep the README short and in this order:
- concise product description;
- one-sentence value proposition;
- the shortest successful generation command; and
- links to CLI, configuration, operations, troubleshooting, development, and architecture documentation.
Do not add a complete command list, configuration fields, workspace layout, or future Promptkit behavior.
Operations Work
- Verify generation and batch workflow order against
internal/app. - Verify the physical workspace tree, artifact names, RunID placement,
metadata links, notification artifact placement, and prior lookup against
internal/state. - Verify output-copy behavior and the rule that managed reports are the only upload sources.
- Verify single-report and batch notification sequencing, skip conditions, failure accounting, and inspectable artifacts.
- Verify inspection is read-only and identify exactly which artifacts each command reads.
- Keep normal operation, state lifecycle, inspection, recovery, and operational caveats here.
- Replace complete flag or config-field definitions with links to their canonical references.
- Keep only the minimal commands needed to illustrate an operational procedure.
Validation
go test ./internal/app ./internal/state ./internal/cli
go run ./cmd/weatherreporter --help
git diff --check
Stage 4: Troubleshooting
File
docs/troubleshooting.md
Work
- Verify every documented symptom and diagnostic fragment against current errors and failure tests.
- Use one consistent entry shape:
- symptom;
- likely cause;
- diagnostic step or command;
- safe fix; and
- links to canonical references.
- Keep symptom-oriented diagnosis here. Remove repeated normal workflows, full endpoint inventories, config-field definitions, and artifact schemas.
- Preserve the distinction between pre-run failures, collection failures, Scriptorium preparation/run failures, generated-text validation failures, template failures, report failures, batch partial failures, skipped batch uploads, Distributor failures, secret loading, and state lookup failures.
- Use exact error text only when it is a stable operator-facing contract; otherwise use the smallest stable identifying fragment.
- Ensure fixes are safe, narrow, and do not recommend broad workspace deletion or expose secret values.
Validation
go test ./internal/cli ./internal/config ./internal/app ./internal/state
go test ./internal/adapters/weatherapi ./internal/adapters/scriptorium ./internal/adapters/distributor
git diff --check
Stage 5: Report Template Guide
File
docs/templates.md
Work
- Verify top-level templates, shared partials, schema IDs, prompt sources, and
registered template functions against
internal/reporttemplate. - Verify every documented render-context field against
internal/generatedtext; remove fields that are absent and add implemented fields needed by maintainers. - Keep the maintainer-facing editing rules, context contracts, and minimal template examples here.
- Clearly distinguish deterministic module values, collected/derived facts, and validated GeneratedText prose.
- Keep weather derivation and generated-text validation mechanics in their internal owners; summarize and link from this guide.
- Avoid duplicating the full JSON schema bodies or package implementation flow.
Validation
go test ./internal/reporttemplate ./internal/generatedtext ./internal/app
git diff --check
Stage 6: Weather API Integration
File
docs/integrations/weatherapi.md
Work
- Verify URL joining, query parameters, timeout and retry behavior, response envelope, endpoint set, decoding, source identity, warnings, and required/optional source behavior against the adapter, collection layer, fixtures, and tests.
- Keep the external Weather API contract and compatibility assumptions here.
- Move internal normalization and orchestration mechanics to links pointing at the relevant internal documents.
- Document only endpoints and fields Weatherreporter currently consumes.
Validation
go test ./internal/adapters/weatherapi ./internal/collect ./internal/weatherdata
git diff --check
Stage 7: Scriptorium Integration
File
docs/integrations/scriptorium.md
Work
- Verify the exact
renderandruninvocations, argument ordering, timeouts, output paths, result decoding, stderr handling, cancellation, and failure behavior against the adapter and tests. - Keep the external CLI contract here and link to internal prompt-input, adapter, generated-text, and orchestration mechanics.
- Describe Scriptorium as the implemented runtime. Do not mention the proposed
Promptkit replacement outside
docs/roadmap/promptkit.md. - Do not copy Scriptorium's general manual; document only the commands and result fields Weatherreporter uses.
Validation
go test ./internal/adapters/scriptorium ./internal/promptinput ./internal/app
git diff --check
Stage 8: Distributor Integration
Files
docs/integrations/distributor/api.mddocs/integrations/distributor/pkg-bundle.mddocs/integrations/distributor/pkg-upload.md
Work
- Rewrite these as concise references to the exact Distributor surface used
by Weatherreporter:
api.mdowns accepted upload, authentication, idempotency, run status, terminal failure, and retention assumptions used by the adapter;pkg-bundle.mdowns the bundle file mapping and path constraints used by Weatherreporter;pkg-upload.mdowns the client construction, upload, retry, conflict, and status operations used by the adapter.
- Remove generic producer tutorials, broad upstream feature descriptions, unrelated examples, and claims Weatherreporter does not rely on.
- Verify the pinned module version in
go.modand the adapter's actual calls. - Use the sibling Distributor repository only to confirm the pinned API. Do not make Weatherreporter documentation depend on sibling-relative links.
- Keep internal request construction, redaction, polling decisions, and app notification order in internal documents.
- Ensure all local links resolve and upstream canonical paths are identified without pretending those files exist in this repository.
Validation
go test ./internal/adapters/distributor ./internal/app ./internal/config
git diff --check
Stage 9: CLI, Collection, And App Internals
Files
docs/internal/cli.mddocs/internal/collect.mddocs/internal/app-orchestration.md
Work
Verify purpose, inputs and outputs, ownership boundaries, workflow composition,
failure propagation, focused tests, and invariants. Keep public CLI syntax in
docs/cli.md, Weather API wire behavior in its integration document, and
physical state layout in docs/operations.md or docs/internal/state.md.
The app document may retain explicit workflow ordering because orchestration is its owned internal contract. It must not duplicate complete config, CLI, or external protocol references.
Validation
go test ./internal/cli ./internal/collect ./internal/app
git diff --check
Stage 10: State, Source, And Adapter Internals
Files
docs/internal/state.mddocs/internal/weather-data.mddocs/internal/scriptorium-adapter.mddocs/internal/distributor-adapter.md
Work
- Verify each document against its package and focused tests.
- Keep state path derivation, metadata ownership, prior lookup, atomic writes, and inspection mechanics in the state document.
- Keep normalized bundle, source metadata, and warning semantics in the weather-data document.
- Keep argv/result translation in the Scriptorium adapter document and dependency/client translation in the Distributor adapter document.
- Link external contracts and user-facing references rather than repeating them.
Validation
go test ./internal/state ./internal/weatherdata
go test ./internal/adapters/scriptorium ./internal/adapters/distributor
git diff --check
Stage 11: Deterministic Domain Internals
Files
docs/internal/facts.mddocs/internal/forecast-derivation.mddocs/internal/changes.md
Work
Verify fact ownership, derivation inputs, period and daypart behavior, thresholds, comparison strategies, missing-data behavior, failures, tests, and invariants. Keep these documents deterministic and independent of CLI, filesystem, subprocess, and transport mechanics. Link configuration defaults instead of restating them.
Validation
go test ./internal/facts ./internal/forecast ./internal/changes ./internal/timeutil
git diff --check
Stage 12: Reports, Modules, Briefing, And Prompt Input
Files
docs/internal/report-registry.mddocs/internal/module.mddocs/internal/briefing.mddocs/internal/prompt-input.md
Work
- Verify all report definitions, registry fields, valid periods, batch membership, comparison policy, output naming, module defaults, and Distributor path declarations.
- Verify registered module IDs, options, rich values, prompt exports, composition by report, and missing-source behavior.
- Verify prompt package schema, ordering, metadata, serialization, validation, and the boundary between rich module values and prompt-facing exports.
- Keep exact CLI command syntax, config defaults, integration protocol, and rendered template contracts in their canonical owners.
- Prefer tables for report-to-module or report-to-mode mappings where they materially reduce repeated prose.
Validation
go test ./internal/report ./internal/module ./internal/briefing ./internal/promptinput
git diff --check
Stage 13: Generated Text And Template Internals
Files
docs/internal/generatedtext.mddocs/internal/reporttemplate.md
Work
Verify catalog registration, schema selection, decoding and validation,
generated-text types, render-context construction, embedded asset lookup,
template parsing, partials, failure behavior, and invariants. Keep the complete
maintainer-facing context-field reference in docs/templates.md; internal
documents should explain implementation and link to that contract.
Validation
go test ./internal/generatedtext ./internal/reporttemplate ./internal/app
git diff --check
Stage 14: Roadmap Review
Files
docs/roadmap/future.mddocs/roadmap/promptkit.md
Work
- Ensure every roadmap item is explicitly unimplemented, proposed, accepted, deferred, or rejected.
- Remove or rewrite work that has already been implemented.
- Keep current-state summaries minimal and link to canonical current documentation instead of reproducing it.
- In
future.md, correct the Distributor enhancement introduction so it acknowledges implemented single-report and batch notification without maintaining their detailed current contract. - Preserve the Promptkit roadmap as future migration policy. Do not implement it, resolve its product-design open questions, or describe it as current.
- Ensure future architecture does not leak into README, user/operator docs, integrations, or current internal docs.
Validation
rg -n "Promptkit|promptkit" README.md docs \
--glob "*.md" --glob "!docs/roadmap/**"
git diff --check
The Promptkit search must return no current-state documentation matches.
Stage 15: Cross-Document Consistency And Final Validation
Semantic Review
Verify these cross-document facts have one exact owner and consistent summaries elsewhere:
- seven generate report commands;
- four generated-text-template reports and three direct-Markdown reports;
- morning and evening batch membership and future Daily eligibility;
- configuration precedence and defaults;
- module and report IDs;
- managed workspace and notification paths;
- Recent Changes structured comparison;
- Scriptorium preflight and run behavior;
- single-report and batch Distributor behavior;
- output copies versus managed upload sources; and
- inspection's read-only behavior.
Remove duplicate exact tables or narratives from non-owning documents. Preserve short task-relevant summaries and relative links.
Link Validation
Check every Markdown link in README.md and docs/. Repository-relative
targets and changed heading anchors must resolve. No maintained document may
depend on sibling checkout paths.
At minimum, run a repository-relative target check equivalent to:
find README.md docs -type f -name "*.md" -print0 |
while IFS= read -r -d "" file; do
dir=$(dirname "$file")
rg -o '\]\([^)]+\)' "$file" |
sed -E 's/^\]\(([^)#]+)(#[^)]+)?\)$/\1/' |
while IFS= read -r target; do
case "$target" in
http:*|https:*|mailto:*) continue
esac
test -z "$target" || test -e "$dir/$target" ||
printf '%s -> %s\n' "$file" "$target"
done
done
Manually verify anchors on every changed link because the target check does not validate fragments.
Final Commands
go test ./...
go run ./cmd/weatherreporter --help
git diff --check
Review git diff --name-only and confirm the refresh changed only Markdown and
maintained YAML examples. Confirm no secrets, private endpoints, generated
artifacts, code changes, go.work, or local module replacements were added.
Completion Criteria
The refresh is complete when:
- every document has one clear canonical owner;
- current user and operator documentation matches implemented behavior;
- CLI and configuration references are complete and verified;
- examples load and contain no secrets;
- operation, recovery, template, and integration contracts are accurate;
- internal documents preserve package boundaries without duplicating public references;
- roadmaps contain only future or coordination material;
- all repository-relative links and changed anchors resolve;
- all validation commands pass; and
- no unresolved architecture-policy conflict was hidden or implemented as part of the documentation work.
After all stages are accepted, remove this temporary implementation plan in a final documentation-only change. Do not move its task sequencing or completion history into current-state documentation.