Skip to content

refactor(module): extract dual-mode bootstrap into lib/module_bootstrap.sh (deepening #3)#255

Merged
ycpss91255 merged 1 commit into
mainfrom
feat/module-bootstrap
Jun 21, 2026
Merged

refactor(module): extract dual-mode bootstrap into lib/module_bootstrap.sh (deepening #3)#255
ycpss91255 merged 1 commit into
mainfrom
feat/module-bootstrap

Conversation

@ycpss91255

Copy link
Copy Markdown
Owner

Summary

Architecture deepening #3 (grilling-locked): extract the repeated dual-mode
bootstrap header out of every module into one lib/module_bootstrap.sh.

  • module_bootstrap: no-op in engine mode; in standalone runs the strict-mode
    options, resolves MODULE_DIR/REPO_ROOT/LIB_DIR, and sources
    logger/general/module_helper -- byte-identical behavior, self-locating from
    its own path.
  • All 39 module/*.module.sh + 4 templates now carry a ~3-line stub (down from
    ~13-17). ADR-0001 boundary + runner contract unchanged.
  • SC2034 handled without a new disable (a kcov-excluded, never-executed
    source with a # shellcheck source= hint so static analysis can follow the
    2-level dynamic source).

Test plan

  • new module_bootstrap_spec.bats (11): guard, standalone helpers+strict-mode+
    paths+export, engine no-op (no clobber/re-source), self-location, env-LIB_DIR
    precedence.
  • test-unit / test-integration / lint green in Docker (the agent caught a
    false-green from a hidden template_smoke failure and fixed it).
  • coverage AC-17: 80.23% via the sharded merge (module_bootstrap.sh 100%).
  • CI re-runs the full gate.

Note: coverage margin is thin (baseline 80.83% -> 80.23%; the extraction removed
~13 per-module executed header lines). Clears the gate but a future unrelated dip
could push it under.

Deepening candidate #3. .agents/memory untouched.

Generated with Claude Code.

…ap.sh (deepening #3)

Every module/*.module.sh repeated a ~13-17 line standalone-vs-engine bootstrap
header. That collapses into one lib/module_bootstrap.sh exposing module_bootstrap
(no-op in engine mode; in standalone: set -euo pipefail + inherit_errexit,
resolve MODULE_DIR/REPO_ROOT/LIB_DIR, source logger/general/module_helper -- same
options, same libs, same order, self-locating from its own path). Each module +
the 4 templates now carry a ~3-line stub that sources the bootstrap and calls it.
ADR-0001 standalone/engine boundary + the runner contract are unchanged.

A guarded never-executed `source module_helper.sh` (with a `# shellcheck source=`
directive, kcov-excluded) lets shellcheck follow the 2-level dynamic source so
metadata vars are not flagged SC2034 -- avoids a new disable directive.

Adds module_bootstrap_spec.bats (11 tests).

Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@ycpss91255 ycpss91255 enabled auto-merge (squash) June 21, 2026 19:46
@ycpss91255 ycpss91255 merged commit 4d44f7d into main Jun 21, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant