Skip to content

refactor(core/bundle): invert runner -> cli direction#154

Merged
indaco merged 2 commits intomainfrom
refactor/bundle-runner-invert
Apr 23, 2026
Merged

refactor(core/bundle): invert runner -> cli direction#154
indaco merged 2 commits intomainfrom
refactor/bundle-runner-invert

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented Apr 23, 2026

Description

Invert the core/bundle/runner.zig -> cli/* direction. The runner now routes each bundle member through an injected Dispatcher (function-pointer vtable with installFormula / installCask / tapAdd / serviceStart). The CLI layer (cli/bundle.zig) supplies a default dispatcher that forwards to new non-argv primitives in cli/install.zig::installAll, cli/tap.zig::tapAdd, cli/services.zig::servicesStart. The argv-taking execute functions stay put as the interactive CLI entry point.

Related Issue

  • None

Notes for Reviewers

  • New RunnerError.NoDispatcher is raised when the runner is invoked
    in-process without a dispatcher and without malt_bin; existing tests
    either use dry_run or malt_bin = "/usr/bin/false" so they don't hit
    this path. cli/bundle.zig::cmdInstall always supplies the default.

indaco added 2 commits April 23, 2026 09:19
Add installAll, tapAdd, servicesStart entry points that take
(allocator, name|packages, opts) instead of argv. The argv-taking
execute functions stay as the interactive CLI path; these primitives
are the seam for core/bundle to call into without argv synthesis.
runner.zig drops its cli/install, cli/tap, cli/services imports and
routes each member through an injected Dispatcher vtable (supplied by
cli/bundle.zig's default wiring). Bundle tests no longer drag the full
CLI into their link. New RunnerError.NoDispatcher guards the in-process
path when neither a dispatcher nor malt_bin is supplied.
@indaco indaco merged commit 049acc5 into main Apr 23, 2026
3 checks passed
@indaco indaco deleted the refactor/bundle-runner-invert branch April 23, 2026 07:28
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