Files
weatherfeeder/docs/roadmap/audit.md

83 lines
3.0 KiB
Markdown
Raw Normal View History

2026-06-11 10:00:15 -05:00
# Code Quality Audit Snapshot
2026-06-11 10:00:15 -05:00
## Purpose
2026-06-11 10:00:15 -05:00
This roadmap file records the current cleanup audit status for `weatherfeeder`.
It is not current-behavior documentation and should not be used as the source of
truth for implemented features. Current behavior belongs in README, config,
operations, internal, consumer, and integration docs.
2026-06-11 10:00:15 -05:00
## Current Assessment
2026-06-11 10:00:15 -05:00
`weatherfeeder` remains architecturally coherent:
2026-06-11 10:00:15 -05:00
- `cmd/weatherfeeder` is runtime composition.
- Source adapters fetch upstream provider payloads.
- Provider helpers isolate provider-specific parsing.
- Normalizers map raw schemas into canonical `model` payloads.
- `standards` owns schema, kind, and WMO constants.
- Postgres sink mapping is isolated under `internal/sinks/postgres`.
- Feedkit owns generic config, scheduling, processing, dispatch, and sink
mechanics.
2026-06-11 10:00:15 -05:00
The highest-value completed cleanup work since the original audit includes:
2026-06-11 10:00:15 -05:00
- event kind constants in `standards`;
- source driver constants in provider source packages;
- source registry tests derived from registered drivers;
- shared HTTP config parsing for multi-document sources;
- config/example load coverage;
- shallow documentation consistency tests for current schemas and source
drivers;
- consumer documentation for public Go packages.
2026-06-11 10:00:15 -05:00
## Remaining Cleanup Opportunities
2026-06-11 10:00:15 -05:00
### Postgres Mapper Boilerplate
2026-06-11 10:00:15 -05:00
The Postgres mapper still repeats event envelope values and parent-row map
patterns across canonical product families.
2026-06-11 10:00:15 -05:00
Recommended next action: implement the Postgres mapper envelope cleanup in
[`cleanup.md`](cleanup.md) without changing table contracts or mapper behavior.
2026-06-11 10:00:15 -05:00
### Package-Local Fixture Helpers
2026-06-11 10:00:15 -05:00
Some tests still use package-local fixture-loading helpers that may be
consolidated where multiple files in the same package duplicate the same logic.
2026-06-11 10:00:15 -05:00
Recommended next action: consolidate only obvious same-package duplication. Do
not add cross-package test helper packages.
2026-06-11 10:00:15 -05:00
### Literal Sweep
2026-06-11 10:00:15 -05:00
Some string literals remain intentional in docs, YAML examples, and negative
tests. Internal code and tests can still be reviewed for opportunities to use
existing constants where that reduces drift risk.
2026-06-11 10:00:15 -05:00
Recommended next action: perform a final literal sweep only after higher-value
cleanup stages are complete.
2026-06-11 10:00:15 -05:00
## Non-Issues
2026-06-11 10:00:15 -05:00
These areas were reviewed and should not be refactored without a new roadmap:
2026-06-11 10:00:15 -05:00
- Normalizer `Match` methods are intentionally explicit schema checks.
- Provider-specific time parsers should remain provider-specific.
- SPC multi-document polling should remain source-local and atomic.
- The current runtime does not need a generic workflow engine.
- The Postgres sink should not become an ORM or reflection mapper.
- Documentation should remain audience-specific rather than generated from code.
2026-06-11 10:00:15 -05:00
## Validation Baseline
2026-06-11 10:00:15 -05:00
The current test suite covers source construction, normalizer registration and
mapping, Postgres schema/mapping, maintained config loading, source-driver docs,
and event-schema docs.
2026-06-11 10:00:15 -05:00
Recommended baseline after any cleanup:
```sh
go test ./...
```