diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-28 13:49:28 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-28 13:49:28 +0300 |
| commit | cf889b4cc771d44e36189d6fc09dfa23b2529bfd (patch) | |
| tree | d5933f455196e4655c2c6fbec00d5412b12d7fca /bin | |
| parent | 493f8aa11ce49572fa23ac06ebde323b470e1623 (diff) | |
mr0: finish config consolidation; document bespoke log/dry-run consumers
Consumers 5 (log_configured_action) and 6 (the --dry-run plan) are
consciously left bespoke: both are human-facing prose that interleaves a
curated subset of config fields (each with its own label and per-field
decoration) with non-config values (resolved rc_file path,
SHURIKEN_FORCE_GENERATE, computed image/page/redirect counts, planned
tarball name, and whole non-config 'Planned directories/files' sections).
Driving them from CONFIG_SPECS would require per-line label+format+marker
facets that contort the schema for no DRY benefit, since each string
appears exactly once.
They already read the canonical registry-driven globals, so CONFIG_SPECS
remains the single source of truth for the config schema; only the
presentation stays hand-written. Added comments to both explaining the
decision. No behavior change -- output stays byte-identical (asserted by
the effective-config log and dry-run plan tests).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/shuriken | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/shuriken b/bin/shuriken index 9da619d..b129d70 100755 --- a/bin/shuriken +++ b/bin/shuriken @@ -2604,6 +2604,25 @@ collect_dry_run_page_plan() { fi } +# Gather every value the dry-run plan reports into an associative array, then +# hand it to print_dry_run_plan. +# +# Deliberately NOT derived from CONFIG_SPECS (task mr0, consumer 6). CONFIG_SPECS +# stays the single source of truth for the config SCHEMA (defaults, CLI, +# validation, print_config formatting), and the config VALUES read below +# ($INCOMING_DIR, $TITLE, $SPLASH_PAGE, ...) are the canonical globals +# apply_config_defaults already fills from the registry -- so there is no second +# source of truth for any config fact. But the plan is bespoke human-facing prose +# that interleaves config with NON-config: derived/computed values (the image, +# page, redirect and details counts, the planned tarball name, the index-page +# count) and whole non-config sections ("Planned directories:", "Planned +# generated files:") that have no registry entry. It also reports only a curated +# subset of fields, each with its own label and several with bespoke conditional +# rendering (splash-vs-redirect index line, stats/tarball blocks). Forcing this +# through a registry facet would need per-line label + format encoding plus markers +# for the non-config lines, contorting the schema for no DRY benefit (each label +# appears once). So presentation stays hand-written here; the dry-run plan tests +# assert the output byte-for-byte. collect_dry_run_plan() { local -r plan_name="$1"; shift # shellcheck disable=SC2178 @@ -6895,6 +6914,23 @@ load_configured_action() { export SHURIKEN_CONFIG_SOURCE } +# Log the effective configuration for a configured action (verbose mode). +# +# Deliberately NOT derived from CONFIG_SPECS (task mr0, consumer 5). The registry +# is the single source of truth for the config SCHEMA -- defaults, CLI +# overridability, validation, and print_config formatting all derive from it, so +# there is no competing source of truth for those facts. This log, by contrast, +# is bespoke human-facing PROSE: a curated subset of fields (not all 25), each +# with its own label ("Effective incoming directory:"), per-field decoration +# (the "s" suffix on the *_TIMEOUT seconds, the "(bundled default)" placeholder +# for an empty FAVICON), and two values that are NOT config variables at all +# (the resolved rc_file path and SHURIKEN_FORCE_GENERATE). Encoding all that in a +# registry facet would mean a per-field label string plus format directives plus +# an in/out flag -- contorting the schema and harming readability for no DRY win, +# since these strings appear exactly once. So formatting stays hand-written here; +# the config VALUES it reads ($INCOMING_DIR, $SPLASH_PAGE, ...) are the canonical +# globals, which apply_config_defaults already populates from CONFIG_SPECS. +# Output is asserted byte-for-byte by the effective-config log tests. log_configured_action() { local -r rc_file="$1"; shift |
