Files
weatherreporter/docs/internal/comparison-publication.md

29 lines
1.6 KiB
Markdown

# Comparison Publication Internals
`internal/comparison` separates the logical bundle from filesystem mechanics.
The application builds a validated manifest, exact shared data-package bytes,
and only the Markdown files for successful profiles. The durable layout,
schema, and compatibility rules are owned by the [comparison bundle
contract](../integrations/comparison-bundle.md).
Destination planning is read-only. It requires an exact absolute target that
is neither the filesystem root nor the working directory, rejects unsafe
symlinks and non-directories, accepts a missing or empty directory, and permits
replacement only for a recognized current bundle. Publication rechecks that
plan, writes a private sibling staging directory, and installs it atomically.
Replacement temporarily moves the recognized prior bundle aside, reauthorizes
that moved entry, and restores it if installation fails.
Publication reports whether the new bundle committed. Once the new bundle is
installed, a failure to remove the prior sibling backup does not roll it back.
The result retains the absolute backup path and returns an inspectable cleanup
error that unwraps the filesystem cause so an operator can recover the prior
bundle if needed.
The application preflights before prompt inspection and collection, then
preflights again before publication. A cancellation or any failure before the
commit leaves the prior destination untouched. Completed bundles include
partial profile results; comparison publication never coordinates Distributor
notification. Operator-facing lifecycle and cleanup are in the
[operations guide](../operations.md).