refactor(module): Sidecar to phase-invocation layer + archetypes emit all 10 (deepening #2+#4)#256
Merged
Merged
Conversation
…emit all 10 (deepening #2+#4) #2: the Sidecar write/remove invariant moves out of every module into one shared _module_sidecar_after_phase helper, called from BOTH invokers (lib/runner.sh _runner_run_phase for engine, module_standalone_main for standalone) -- so all 39 modules + both modes are covered. New standardized module_provided_version() (apt: dpkg of APT_PKGS[0]; github-release: resolved tag, preserved on idempotent re-install; config/D: VERSION_PROVIDED, overridable). Removed the sidecar calls from all 29 modules and the 15 per-module _xxx_pkg_version helpers. #4: module_use_{apt,github_release,config}_archetype now emit all 10 lifecycle functions (default is_outdated + a read-only doctor); redundant hand-written stubs removed, genuine overrides kept. detect + is_recommended stay module-defined. Tests rewired: sidecar-after-install assertions now route through the invoker (module_standalone_main); the is_installed==false <-> Sidecar-absent invariant is preserved at the invoker layer. Adds lib-level tests (module_helper_spec, runner_spec). ADR-0027 records the move (refines ADR-0001 on WHERE + ADR-0002 on the 10-fn macro contract). Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
… keeps its skip The sweep moved lazydocker's "remove is a no-op when not installed" skip into the SHARED module_default_github_release_remove, which broke fzf (its remove must clean a Sidecar-less partial install). Resolution mirrors main: the shared github-release remove default no longer gates on is_installed (rm -rf / rm -f are idempotent and must clean a partial install), and lazydocker keeps its own remove() override with the skip (dryrun_guard -> skip-if-not-installed -> default), minus the Sidecar line (the phase-invocation wrapper handles it). Verified: fzf + lazydocker specs green in Docker. Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combined architecture deepening #2 + #4 (grilling-locked).
_module_sidecar_after_phasehelper, called from
lib/runner.sh(engine) andmodule_standalone_main(standalone) -- covers all 39 modules incl. hand-written archetype-D, both
modes. New
module_provided_version()(apt dpkg / github-release resolved tag,preserved on idempotent re-install / config+D VERSION_PROVIDED). Removed
sidecar calls from 29 modules and 15
_xxx_pkg_versionhelpers (now 0).is_outdated+ a read-onlydoctor; redundant stubs removed, real overrides kept.detect/is_recommendedstay module-defined.is_installed==false <-> Sidecar absentpreserved at the invoker layer. New lib tests (module_helper_spec,runner_spec). ADR-0027 added (refines ADR-0001 + ADR-0002).
Sidecar instead of clobbering it (integration AC-5/6).
Test plan
truncated-tail false green; the agent caught and fixed an earlier one).
Risk: coverage margin is thin (80.03%). A pre-existing kcov instability on the
fzf shard (its bats exits 1 under ptrace after all tests pass, same on unmodified
HEAD) can drop the merge to 79.54% if that shard truncates; CI on main records it
cleanly (~80.2-80.8%). If the coverage job flakes on fzf, a rerun fixes it.
Deepening #2+#4 -- the last NOW-batch piece.
.agents/memoryuntouched.Generated with Claude Code.