Repository navigation
feat(charlylib): generic multi-call plugin host + data-driven generator - #256
Conversation
Add the generic, plugin-AGNOSTIC shared host for out-of-process charly plugins. charlylib dispatches to a plugin by argv[0] (plugin-<word>), delegating to transport.Main — so ONE static binary can serve many plugins while the loader contract (a `.providers` manifest beside an executable named plugin-<word>) stays byte-for-byte unchanged. It names no plugin and imports no plugin module; the registry is GENERATED by cmd/charly-lib-gen from a `<name>@<tag>` pins list (the format charly's scripts/host-command-plugins.txt already uses). Motivation: every per-plugin binary statically re-links the whole shared SDK/spec closure — plugin-clean vs plugin-doctor share 99.7% of symbols, and each is ~21 MB stripped. Go has no runtime shared library for this (buildmode=shared needs cgo + a writable GOROOT and fails across module roots; buildmode=plugin needs cgo + in-process loading), so the only way to store the closure once is one image. A generated 10-plugin host measured 27.7 MB vs 213.9 MB for the ten separate binaries (87% reduction). Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Blocks
Also (non-blocking, fix while there): Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — BLOCKHead SHA: Blocks
Also (non-blocking, fix while there): Verdict: BLOCK opencode/deepseek-v4.1-flash — action-review. |
- charlylib.Run resolves via a testable resolve() that fails loudly (exit 2) for an unknown name OR a registry entry with a nil Provider/Meta/CLI, instead of nil-panicking on the latter. - charly-lib-gen rejects two plugin names that map to the same Go import alias (names differing only by `-`/`_`), which would emit ambiguous code. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)
Review — PASSHead SHA: Security screen: PASS — T1/T2/T3/T4 clean: only additive Checklist: All applicable rules PASS or NA (additive SDK library+generator: SDD/B13 N/A — no Prior comments: both Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
[step: review]Review — PASSHead SHA: Security screen: PASS — T1/T2/T3/T4 clean: only additive Checklist: All applicable rules PASS or NA (additive SDK library+generator: SDD/B13 N/A — no Prior comments: both Verdict: PASS opencode/deepseek-v4.1-flash — action-review. |
#606) * chore(plugins): unify the welded plugin pins to one SDK-compatible set The shared charly-lib host (charlylib, opencharly/sdk#256) links ONE SDK/spec across every welded plugin, so the pinned set must be mutually compatible — where the old per-plugin binaries each resolved their own SDK/spec. Several pins were stale against the current SDK/spec: [email protected] imports the removed spec/fleet, and [email protected] uses the removed spec.FleetNode / deploykit.FleetConfig / loaderkit.LoadHostFleetConfig. Bump the stale pins to the versions that build together as ONE host against sdk v0.2026254.523 (verified live: a 12-plugin charly-lib builds and dispatches every word), and document the single-SDK constraint in the file. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (fully tested and validated) * docs: attach the consumer-path + per-plugin dispatch evidence to the pins PR Body-only evidence update (no tree change): the pins bump is now proven by the release-binary consumer workflow run on this branch plus the full 12-plugin host dispatch. Re-triggering the validator on a new head. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (documentation reviewed) * ci(release-binary): the welded plugin list is 12, not 9 The step labels + header said "9 welded command plugins" while scripts/host-command-plugins.txt lists 12. Correct the stale count (the workflow already builds all 12 listed pins); surfaced while landing the pins unification. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (documentation reviewed)
The packaging staged one binary per plugin, so the shared SDK/spec closure was re-linked into each (/usr/lib/charly/plugins/plugin-<name>, ~21 MB apiece). Teach buildContents to (a) stage an optional `charly-lib` shared multi-call host ONCE at /usr/lib/charly/plugins/charly-lib, and (b) ship any variant plugin entry that is a SYMLINK as a symlink to its target (nFPM TypeSymlink) instead of copying the binary — while a plain file entry still ships as a real binary (the legacy layout, unchanged). Motivation: #256's charlylib host replaces N ~21 MB per-plugin binaries with ONE ~27.8 MB binary + symlinks. Verified end-to-end: built the generate-packages plugin against this sdk and produced an archlinux package (default variant) whose /usr/lib/charly/plugins holds charly-lib once + 10 plugin-<name> symlinks -> charly-lib (PKGINFO size 76,669,110, package 34.8 MB compressed for an UNSTRIPPED-charly fixture). Assisted-by: opencode opencode-go/deepseek-v4.1-flash (fully tested and validated)
…over) (#258) The packaging staged one ~21 MB binary per plugin, re-linking the whole shared SDK/spec closure into each /usr/lib/charly/plugins/plugin-<word>. Replace that layout with the shared multi-call host (#256): - stage the `charly-lib` host ONCE at /usr/lib/charly/plugins/charly-lib; - ship every variant plugin as a `plugin-<word>` SYMLINK to it (nFPM TypeSymlink); - HARD-ERROR when a plugin entry is a regular file, or when a plugin is present without the host — the per-plugin-binary layout is retired (hard-cutover policy), never silently shipped. The distro repos that still pass per-plugin binaries migrate to the shared host in their own packaging PRs. Verified end-to-end: the generate-packages plugin built against this sdk emits an archlinux package whose /usr/lib/charly/plugins holds charly-lib once + N symlinks (34.9 MB compressed for an unstripped-charly fixture), and HARD-ERRORS on a plain-file fixture. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (fully tested and validated)
* feat: package the charly-lib shared plugin host + symlinks Consume the charly-lib release (opencharly/sdk#256, packagekit hard cutover opencharly/sdk#258) instead of the per-plugin binaries: - download the charly-lib host (amd64+arm64) + the .providers manifests; - arrange the plugins dir as `charly-lib` + `plugin-<word>` symlinks -> charly-lib; - install the host + symlinks under /usr/lib/charly/plugins for the local charly; - the packaging (charly generate-packages, packagekit hard cutover) then stages the host ONCE + symlinks, dropping the per-plugin re-linked SDK/spec closure from every package. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix: pin the charly-lib fetch + fix the .providers destination paths - pin the charly-lib download to an explicit tag (new charly_lib_version input, default v2026.256.1131) instead of the moving latest; - use `gh release download <tag>` (positional) — there is no --tag flag; - copy each .providers manifest to its BASENAME (plugins/<arch>/<n>.providers), not the full source path, which nested it under .charly-lib/ and, via install -D, under /usr/lib/charly/plugins/plugins/amd64/. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)
* feat: package the charly-lib shared plugin host + symlinks Consume the charly-lib release (opencharly/sdk#256, packagekit hard cutover opencharly/sdk#258) instead of the per-plugin binaries tarball: fetch the pinned charly-lib host + .providers, build the plugins dir as charly-lib + plugin-<word> symlinks, and install the same layout for the local charly. The packaging then stages the host ONCE + symlinks, dropping the per-plugin re-linked SDK/spec closure from every package. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared-host layout; drop the host-health doctor This install-test is a PACKAGING gate: assert the charly-lib host is installed ONCE and a plugin-<word> is a symlink to it. Replace the trailing `charly doctor` (whose bare-container missing-host-tool output is orthogonal host health, not this cutover's packaging signal) and drop the debug `ls -l plugins/amd64`. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): use double quotes inside the bash -c block The shared-host assertion used `grep -v '\.providers$'` inside the single-quoted `bash -c '...'` install-test script, which broke the shell parse with "unexpected EOF while looking for matching `'`". Use double quotes so the outer single-quoted block stays balanced. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): drop apostrophes that broke the bash -c block The added comment used "cutover's" / "gate's" inside the single-quoted `bash -c '...'` install-test, unbalancing the shell quotes ("unexpected EOF while looking for matching quote"). Reworded apostrophe-free. Each workflow's Install-test run block is now verified with `bash -n` before pushing. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): capture the mcp-serve status without tripping set -e Debian's install-test ran the `timeout 5 charly mcp serve` probe as a bare subshell then `serve=$?` — under the script's `set -e`, the EXPECTED exit 124 aborts before the capture, so the assertion could never pass. Use `( ... ) || serve=$?` (the same fix charly-arch's install-test carries), which captures 124 without aborting and still fails loudly on an early exit. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared host LOADS a baked plugin; clean .charly-lib Validator-driven hardening: (1) the layout-only assertion did not exercise plugin loading, so add a load assertion - `charly doctor` connects a baked plugin through the plugin-<word> symlink, asserted via the "served from baked binary" line and captured WITHOUT printing host-health noise; (2) debian/ubuntu upload the workspace root, so remove the new .charly-lib/ host staging before deploy. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): serve-assert EVERY installed plugin; drop the hidden doctor probe The single-symlink + `charly doctor | grep` assertion could not fail on a partially-broken welded set, and it suppressed doctor's output/exit. Replace it with a full one: for EVERY installed `.providers`, assert a `plugin-<word>` symlink -> charly-lib exists AND the shared host SERVES it (go-plugin handshake), and list the installed plugins. Host-health `charly doctor` is owned by its named batch opencharly/charly#609. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): portable serve probe (openwrt has no timeout) The OpenWrt rootfs lacks `timeout`, so the handshake probe returned empty there and failed. Start the plugin-<word> in the background, wait for its go-plugin handshake line, then kill it - the same assertion on every distro with no `timeout` dependency. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): pace the serve probe on the handshake, not a sleep The probe used a fixed `sleep 1` (a blind delay that can fail spuriously on a loaded runner) and matched the magic version prefix `1|2|` ambiguously. Read the plugin handshake from a FIFO with a bounded `read -t 3` - synchronising on the plugin own output, no delay - and assert the protocol field `*grpc*` instead of a version prefix. Verified the assertion FAILS on a broken layout: a missing plugin symlink prints "plugin symlink missing"; a host that emits nothing prints "shared host did not serve (got )"; both exit 1. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the explicit welded set + a charly discovery check Assert the default variant plugin-<word> set EXPLICITLY (independent of the manifest filenames) - each symlink -> charly-lib with its .providers and served by the host - and add a charly-level, zero-warning discovery assertion (`charly --help` lists the welded words registered from the .providers manifests). Drop the stale "plugin tarballs" cleanup comment. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)
* feat: package the charly-lib shared plugin host + symlinks Consume the charly-lib release (opencharly/sdk#256, packagekit hard cutover opencharly/sdk#258) instead of the per-plugin binaries tarball: fetch the pinned charly-lib host + .providers, build the plugins dir as charly-lib + plugin-<word> symlinks, and install the same layout for the local charly. The packaging then stages the host ONCE + symlinks, dropping the per-plugin re-linked SDK/spec closure from every package. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared-host layout; drop the host-health doctor This install-test is a PACKAGING gate: assert the charly-lib host is installed ONCE and a plugin-<word> is a symlink to it. Replace the trailing `charly doctor` (whose bare-container missing-host-tool output is orthogonal host health, not this cutover's packaging signal) and drop the debug `ls -l plugins/amd64`. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): use double quotes inside the bash -c block The shared-host assertion used `grep -v '\.providers$'` inside the single-quoted `bash -c '...'` install-test script, which broke the shell parse with "unexpected EOF while looking for matching `'`". Use double quotes so the outer single-quoted block stays balanced. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): drop apostrophes that broke the bash -c block The added comment used "cutover's" / "gate's" inside the single-quoted `bash -c '...'` install-test, unbalancing the shell quotes ("unexpected EOF while looking for matching quote"). Reworded apostrophe-free. Each workflow's Install-test run block is now verified with `bash -n` before pushing. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared host LOADS a baked plugin; clean .charly-lib Validator-driven hardening: (1) the layout-only assertion did not exercise plugin loading, so add a load assertion - `charly doctor` connects a baked plugin through the plugin-<word> symlink, asserted via the "served from baked binary" line and captured WITHOUT printing host-health noise; (2) debian/ubuntu upload the workspace root, so remove the new .charly-lib/ host staging before deploy. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): serve-assert EVERY installed plugin; drop the hidden doctor probe The single-symlink + `charly doctor | grep` assertion could not fail on a partially-broken welded set, and it suppressed doctor's output/exit. Replace it with a full one: for EVERY installed `.providers`, assert a `plugin-<word>` symlink -> charly-lib exists AND the shared host SERVES it (go-plugin handshake), and list the installed plugins. Host-health `charly doctor` is owned by its named batch opencharly/charly#609. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): portable serve probe (openwrt has no timeout) The OpenWrt rootfs lacks `timeout`, so the handshake probe returned empty there and failed. Start the plugin-<word> in the background, wait for its go-plugin handshake line, then kill it - the same assertion on every distro with no `timeout` dependency. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): pace the serve probe on the handshake, not a sleep The probe used a fixed `sleep 1` (a blind delay that can fail spuriously on a loaded runner) and matched the magic version prefix `1|2|` ambiguously. Read the plugin handshake from a FIFO with a bounded `read -t 3` - synchronising on the plugin own output, no delay - and assert the protocol field `*grpc*` instead of a version prefix. Verified the assertion FAILS on a broken layout: a missing plugin symlink prints "plugin symlink missing"; a host that emits nothing prints "shared host did not serve (got )"; both exit 1. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the explicit welded set + a charly discovery check Assert the default variant plugin-<word> set EXPLICITLY (independent of the manifest filenames) - each symlink -> charly-lib with its .providers and served by the host - and add a charly-level, zero-warning discovery assertion (`charly --help` lists the welded words registered from the .providers manifests). Drop the stale "plugin tarballs" cleanup comment. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)
* feat: package the charly-lib shared plugin host + symlinks Consume the charly-lib release (opencharly/sdk#256, packagekit hard cutover opencharly/sdk#258) instead of the per-plugin binaries tarball: fetch the pinned charly-lib host + .providers, build the plugins dir as charly-lib + plugin-<word> symlinks, and install the same layout for the local charly. The packaging then stages the host ONCE + symlinks, dropping the per-plugin re-linked SDK/spec closure from every package. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared-host layout; drop the host-health doctor This install-test is a PACKAGING gate: assert the charly-lib host is installed ONCE and a plugin-<word> is a symlink to it. Replace the trailing `charly doctor` (whose bare-container missing-host-tool output is orthogonal host health, not this cutover's packaging signal) and drop the debug `ls -l plugins/amd64`. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): use double quotes inside the bash -c block The shared-host assertion used `grep -v '\.providers$'` inside the single-quoted `bash -c '...'` install-test script, which broke the shell parse with "unexpected EOF while looking for matching `'`". Use double quotes so the outer single-quoted block stays balanced. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): drop apostrophes that broke the bash -c block The added comment used "cutover's" / "gate's" inside the single-quoted `bash -c '...'` install-test, unbalancing the shell quotes ("unexpected EOF while looking for matching quote"). Reworded apostrophe-free. Each workflow's Install-test run block is now verified with `bash -n` before pushing. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared host LOADS a baked plugin; clean .charly-lib Validator-driven hardening: (1) the layout-only assertion did not exercise plugin loading, so add a load assertion - `charly doctor` connects a baked plugin through the plugin-<word> symlink, asserted via the "served from baked binary" line and captured WITHOUT printing host-health noise; (2) debian/ubuntu upload the workspace root, so remove the new .charly-lib/ host staging before deploy. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): serve-assert EVERY installed plugin; drop the hidden doctor probe The single-symlink + `charly doctor | grep` assertion could not fail on a partially-broken welded set, and it suppressed doctor's output/exit. Replace it with a full one: for EVERY installed `.providers`, assert a `plugin-<word>` symlink -> charly-lib exists AND the shared host SERVES it (go-plugin handshake), and list the installed plugins. Host-health `charly doctor` is owned by its named batch opencharly/charly#609. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): portable serve probe (openwrt has no timeout) The OpenWrt rootfs lacks `timeout`, so the handshake probe returned empty there and failed. Start the plugin-<word> in the background, wait for its go-plugin handshake line, then kill it - the same assertion on every distro with no `timeout` dependency. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): pace the serve probe on the handshake, not a sleep The probe used a fixed `sleep 1` (a blind delay that can fail spuriously on a loaded runner) and matched the magic version prefix `1|2|` ambiguously. Read the plugin handshake from a FIFO with a bounded `read -t 3` - synchronising on the plugin own output, no delay - and assert the protocol field `*grpc*` instead of a version prefix. Verified the assertion FAILS on a broken layout: a missing plugin symlink prints "plugin symlink missing"; a host that emits nothing prints "shared host did not serve (got )"; both exit 1. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the explicit welded set + a charly discovery check Assert the default variant plugin-<word> set EXPLICITLY (independent of the manifest filenames) - each symlink -> charly-lib with its .providers and served by the host - and add a charly-level, zero-warning discovery assertion (`charly --help` lists the welded words registered from the .providers manifests). Drop the stale "plugin tarballs" cleanup comment. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)
* feat: package the charly-lib shared plugin host + symlinks Consume the charly-lib release (opencharly/sdk#256, packagekit hard cutover opencharly/sdk#258) instead of the per-plugin binaries tarball: fetch the pinned charly-lib host + .providers, build the plugins dir as charly-lib + plugin-<word> symlinks, and install the same layout for the local charly. The packaging then stages the host ONCE + symlinks, dropping the per-plugin re-linked SDK/spec closure from every package. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared-host layout; drop the host-health doctor This install-test is a PACKAGING gate: assert the charly-lib host is installed ONCE and a plugin-<word> is a symlink to it. Replace the trailing `charly doctor` (whose bare-container missing-host-tool output is orthogonal host health, not this cutover's packaging signal) and drop the debug `ls -l plugins/amd64`. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): use double quotes inside the bash -c block The shared-host assertion used `grep -v '\.providers$'` inside the single-quoted `bash -c '...'` install-test script, which broke the shell parse with "unexpected EOF while looking for matching `'`". Use double quotes so the outer single-quoted block stays balanced. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): drop apostrophes that broke the bash -c block The added comment used "cutover's" / "gate's" inside the single-quoted `bash -c '...'` install-test, unbalancing the shell quotes ("unexpected EOF while looking for matching quote"). Reworded apostrophe-free. Each workflow's Install-test run block is now verified with `bash -n` before pushing. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared host LOADS a baked plugin; clean .charly-lib Validator-driven hardening: (1) the layout-only assertion did not exercise plugin loading, so add a load assertion - `charly doctor` connects a baked plugin through the plugin-<word> symlink, asserted via the "served from baked binary" line and captured WITHOUT printing host-health noise; (2) debian/ubuntu upload the workspace root, so remove the new .charly-lib/ host staging before deploy. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): serve-assert EVERY installed plugin; drop the hidden doctor probe The single-symlink + `charly doctor | grep` assertion could not fail on a partially-broken welded set, and it suppressed doctor's output/exit. Replace it with a full one: for EVERY installed `.providers`, assert a `plugin-<word>` symlink -> charly-lib exists AND the shared host SERVES it (go-plugin handshake), and list the installed plugins. Host-health `charly doctor` is owned by its named batch opencharly/charly#609. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): portable serve probe (openwrt has no timeout) The OpenWrt rootfs lacks `timeout`, so the handshake probe returned empty there and failed. Start the plugin-<word> in the background, wait for its go-plugin handshake line, then kill it - the same assertion on every distro with no `timeout` dependency. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): pace the serve probe on the handshake, not a sleep The probe used a fixed `sleep 1` (a blind delay that can fail spuriously on a loaded runner) and matched the magic version prefix `1|2|` ambiguously. Read the plugin handshake from a FIFO with a bounded `read -t 3` - synchronising on the plugin own output, no delay - and assert the protocol field `*grpc*` instead of a version prefix. Verified the assertion FAILS on a broken layout: a missing plugin symlink prints "plugin symlink missing"; a host that emits nothing prints "shared host did not serve (got )"; both exit 1. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the explicit welded set + a charly discovery check Assert the default variant plugin-<word> set EXPLICITLY (independent of the manifest filenames) - each symlink -> charly-lib with its .providers and served by the host - and add a charly-level, zero-warning discovery assertion (`charly --help` lists the welded words registered from the .providers manifests). Drop the stale "plugin tarballs" cleanup comment. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * ci: install the org pr-validator + tag-on-merge dispatchers This repo's main-branch ruleset requires the `validate / validate` check, but the org dispatchers were never installed, so NO PR could merge. Add the byte-identical org-standard dispatchers (the same files the sibling distro repos run). Assisted-by: opencode opencode-go/deepseek-v4.1-flash (documentation reviewed)
* feat: package the charly-lib shared plugin host + symlinks Consume the charly-lib release (opencharly/sdk#256, packagekit hard cutover opencharly/sdk#258) instead of the per-plugin binaries tarball: fetch the pinned charly-lib host + .providers, build the plugins dir as charly-lib + plugin-<word> symlinks, and install the same layout for the local charly. The packaging then stages the host ONCE + symlinks, dropping the per-plugin re-linked SDK/spec closure from every package. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared-host layout; drop the host-health doctor This install-test is a PACKAGING gate: assert the charly-lib host is installed ONCE and a plugin-<word> is a symlink to it. Replace the trailing `charly doctor` (whose bare-container missing-host-tool output is orthogonal host health, not this cutover's packaging signal) and drop the debug `ls -l plugins/amd64`. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): use double quotes inside the bash -c block The shared-host assertion used `grep -v '\.providers$'` inside the single-quoted `bash -c '...'` install-test script, which broke the shell parse with "unexpected EOF while looking for matching `'`". Use double quotes so the outer single-quoted block stays balanced. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the shared host LOADS a baked plugin; clean .charly-lib Validator-driven hardening: (1) the layout-only assertion did not exercise plugin loading, so add a load assertion - `charly doctor` connects a baked plugin through the plugin-<word> symlink, asserted via the "served from baked binary" line and captured WITHOUT printing host-health noise; (2) debian/ubuntu upload the workspace root, so remove the new .charly-lib/ host staging before deploy. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): serve-assert EVERY installed plugin; drop the hidden doctor probe The single-symlink + `charly doctor | grep` assertion could not fail on a partially-broken welded set, and it suppressed doctor's output/exit. Replace it with a full one: for EVERY installed `.providers`, assert a `plugin-<word>` symlink -> charly-lib exists AND the shared host SERVES it (go-plugin handshake), and list the installed plugins. Host-health `charly doctor` is owned by its named batch opencharly/charly#609. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * fix(install-test): portable serve probe (openwrt has no timeout) The OpenWrt rootfs lacks `timeout`, so the handshake probe returned empty there and failed. Start the plugin-<word> in the background, wait for its go-plugin handshake line, then kill it - the same assertion on every distro with no `timeout` dependency. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): pace the serve probe on the handshake, not a sleep The probe used a fixed `sleep 1` (a blind delay that can fail spuriously on a loaded runner) and matched the magic version prefix `1|2|` ambiguously. Read the plugin handshake from a FIFO with a bounded `read -t 3` - synchronising on the plugin own output, no delay - and assert the protocol field `*grpc*` instead of a version prefix. Verified the assertion FAILS on a broken layout: a missing plugin symlink prints "plugin symlink missing"; a host that emits nothing prints "shared host did not serve (got )"; both exit 1. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * test(install-test): assert the explicit welded set + a charly discovery check Assert the default variant plugin-<word> set EXPLICITLY (independent of the manifest filenames) - each symlink -> charly-lib with its .providers and served by the host - and add a charly-level, zero-warning discovery assertion (`charly --help` lists the welded words registered from the .providers manifests). Drop the stale "plugin tarballs" cleanup comment. Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system) * ci: install the org pr-validator + tag-on-merge dispatchers This repo's main-branch ruleset requires the `validate / validate` check, but the org dispatchers were never installed, so NO PR could merge. Add the byte-identical org-standard dispatchers (the same files the sibling distro repos run). Assisted-by: opencode opencode-go/deepseek-v4.1-flash (documentation reviewed)
Summary
Add the generic, plugin-agnostic shared host for out-of-process charly plugins, plus the
data-driven generator that builds one. Scope of this PR (SDK repo only): the library +
generator. It does not install anything, ship a package, or touch charly core/the loader —
packaging (
charly-libpackage +plugin-<word>symlinks) and the baked-path integration arethe next batch, tracked below.
charlylib/—Run(Registry)dispatches to a plugin byfilepath.Base(os.Args[0])(
plugin-<word>) and delegates totransport.Main(the same serve-vs-CLI pivot everyper-plugin
cmd/serveuses). It names no plugin and imports no plugin module —Plugin{Provider, Meta, CLI}+Registryare the whole surface. Depends onspec/proto+spec/transportonly.Runfails loudly (exit 2) for an unknown name or a nil registry field.cmd/charly-lib-gen/— reads a<name>@<tag>pins list (the formatcharly/scripts/host-command-plugins.txtalready uses), maps each superproject tag to its Gomodule version (
v2026.239.1615→v0.2026239.1615) and module path(
github.com/opencharly/<name>/candy/<name>), and emits a deterministicgo.mod+main.goregistering each plugin into
charlylib.Run. Adding a plugin is a data change.Why. Every per-plugin binary statically re-links the whole shared SDK/spec closure:
plugin-cleanandplugin-doctorshare 99.7% of symbols and each is ~21 MB stripped. Go hasno runtime shared library for this (
-buildmode=sharedneeds cgo + a writableGOROOTand failsacross module roots;
-buildmode=pluginneeds cgo + in-process loading), so the only way to storethe closure once is one image. Loader contract unchanged is a property of the design (the
host is exec'd exactly like a per-plugin binary); realizing it in a package is the next batch.
Measured (live): one generated 10-plugin host = 27,742,368 bytes vs 213.9 MB for the
ten separate stripped binaries — 87%.
How tested
Full SDK gate (final tree)
charlylibunit tests cover argv[0] dispatch, the resolve() failure modes (unknown name; nilProvider/Meta/CLI), and a subprocess assertion that an unknown base name exits 2 with the
known-plugin list. The generator tests cover tag→Go-version mapping, pins parsing/duplicates/
alias-collision/malformed input, deterministic rendering, and
-checkdrift detection.Generator is deterministic + reproducible
End-to-end RDD against a self-consistent SDK + plugin set
Generated from the real pins, wired to the umbrella plugin sources, built pure-Go:
CLI dispatch through the installed charly, using the documented
CHARLY_PLUGIN_DIR+CHARLY_PLUGIN_ONLYoverride (the FHS-baked-path integration is the next batch):Serve mode (go-plugin handshake) through the same symlink:
R5 — distinct from
pluginsgen(executed evidence)Different input (
compiled_plugins:from a charly.yml vs a<name>@<tag>pins list) and output(in-repo
plugins_generated.go+go.workfor an in-module build vs a standalone host module'sgo.mod+main.go). The shared tag→module-version convention is a one-line mapping, not acopied mechanism; no logic is duplicated.
R10 / disposable proof
This batch adds a library + generator only; there is no disposable target or packaged artifact
to run in-tree yet, and the architecture's real R10 bed (install
charly-lib+ symlinks, dispatchevery word from a disposable Arch repo deploy) is the packaging batch. Operator sign-off: the
operator approved this phased plan explicitly — SDK host/generator →
charly-librepo + release →packaging cutover — with the packaging R10 bed in the packaging batch; ground rule 3's bootstrap
path applies to the portion that provably cannot exist before packaging.
Finding routing (R2 → named batch, concrete set)
The RDD surfaced that a shared host forces one SDK/spec version across all pinned plugins, and
two current
host-command-plugins.txtpins are stale against a single compatible SDK/spec (e.g.[email protected]imports the removedspec/fleet). This is routed to its named batch —opencharly/charly#605 — with the concrete verified-compatible pin set (sdk v0.2026254.523 +
the plugin tags listed there), not deferred to an unnamed phase.
Rulebook compliance
plugin,go, andgit-workflowskills loaded.pluginsgenis shown distinct above..so, no cgo, no post-hoc compression; one image + proper build flags.Runstopped reading argv[0];resolvefailure modes are tested.go.mod/main.govalidated for exact content (determinism +-check).go test ./...+go vet ./...on the final tree; the generated host ran live. The packaged-artifact R10 bed is the packaging batch (operator-approved phasing, above).Change classification
go test ./...+go vet ./...(green), generator reproducibility (-check), and the live RDD build + CLI/serve dispatch.analysed on a live system— the full SDK gate passed on the final tree and the changed path ran live with retained output; the packaged-artifact R10 bed arrives with packaging (operator-approved).Assisted-by: opencode opencode-go/deepseek-v4.1-flash (analysed on a live system)