Repository navigation
Description
Category
category:runtime
Type
type:fix
Remedy / files the remedy will touch
charly/plugin_prescan.go connectDeclaredKindPlugins / finalizeDeclaredKindConnections: record each attempted word once per process and never re-run the connect for it; plus a test that a declared-but-unconnectable word costs one connect pass, not one per boundary
Cited design decision or org-rulebook rule (or none)
AGENTS.md C5 (the warn-skip is the designed degradation; re-attempting it at every boundary is not)
Classification
Non-blocking — genuinely separable; left unclaimed for a later session to pick up.
Evidence (verified: commands with output, file:line, measurements)
Measured in the charly repo (charly config check-pod-overlay, a disposable bed deploy; charly 2026.335.1816 + plugin-build v0.2026335.2349, uncontended). A throwaway build logged every LoadUnified call with its caller chain, and every kind-connect pass with the words it still needed:
$ CHARLY_SPIKE_LOADLOG=/tmp/cs/cl-base charly config check-pod-overlay
arm=base rc=0 WALL 81.77 s USER 139.04 s MAXRSS 2981960 KB loads=110 passes=53
$ cut -f2 cl-cfg.callers | awk -F' <- ' '{print $2" <- "$3}' | sort | uniq -c | sort -rn
53 main.ScanAllCandyWithConfigOpts <- main.connectDeclaredKindsFromProject
53 main.connectDeclaredKindsFromProject <- main.connectDeclaredKindPlugins
2 main.ScanAllCandyWithConfigOpts <- main.connectPluginByWordRef
$ # caller of connectDeclaredKindPlugins, all 106 loads:
106 main.hostWalkSeams.func1 <- loaderkit.(*walker).walkFile <- loaderkit.(*walker).walkProject
$ sort cl-base.err | uniq -c
53 openwebui connected=false err=<nil>
1 examplestructkind connected=true err=<nil>
1 examplekind connected=true err=<nil>
So 106 of 110 full project loads come from one kind word that never connects. The connect pass reports no error, so it runs again, with two full loads, at every walk boundary (charly/plugin_prescan.go:231 connectDeclaredKindPlugins, called from the Boundary seam in charly/loader_threaded.go hostWalkSeams).
Mechanism
connectDeclaredKindPlugins (plugin_prescan.go:231) runs at EVERY walk Boundary. It builds need = declared kind words not yet in providerRegistry, and when need is non-empty it calls connectDeclaredKindsFromProject = LoadConfig + ScanAllCandyWithConfigOpts, two full project loads. A word whose connect returns nil but never registers (here openwebui, declared by a transitively imported project whose candy is not in the scanned map; see the sibling issue on the declared-vs-connectable scope) stays in need forever. finalizeDeclaredKindConnections records a 'did not register' error but nothing consults it before the next boundary, so every boundary repeats the whole connect.
Missed control
No test bounds the number of LoadUnified calls per command, and nothing records per process which connects were already attempted. The function's own comment claims 'best-effort + idempotent', but that only holds for words that do connect.
Blast radius
Every charly command that loads a project whose import graph declares an unconnectable kind word: config, start, box build (8 loads), each check-run phase. Measured 82 s wall / 139 s CPU / 3 GB RSS for one charly config, and 147 s / 317 s under concurrent bed load. check-pod-overlay took 2646 s, with no-build phases taking 2-4 min.
Root fix
Memoize the connect attempt per word per process: a word attempted once is not re-attempted at later boundaries, and its finalize error is what the materialize warn-skip reports. Separately, fix the declared-vs-connectable scope mismatch that makes the word unconnectable in the first place.
Spike (its result, or none with the reason)
In a throwaway build, not committed, connectDeclaredKindPlugins remembers each word it has already attempted in this process and drops it from need on later boundaries. Same command, same binary, uncontended:
arm=base rc=0 WALL 81.77 s USER 139.04 s MAXRSS 2981960 KB loads=110 passes=53 unit=a6709c74f7801180
arm=neg rc=0 WALL 25.72 s USER 17.81 s MAXRSS 1233704 KB loads=6 passes=1 unit=a6709c74f7801180
That is 3.2× faster wall time, 7.8× less CPU, 2.4× lower peak RSS and 18× fewer loads, with a byte-identical unit file. The candidate works, which confirms the mechanism.
Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
Activity
aitrawog commentedon Dec 2, 2026
CLAIM
Claiming this. It is now blocking:
check-sidecar-podfails on unchanged charly main755f81f764f90058ffd797d6863e1a3c8f44bdadbecause itscharly stop/start/logs/updatesteps exceed the 120 s never-hang ceiling:That bed is in the gate of my charly change.
One refinement over the spike above: the memo will key on (word, boundary dir), not on the word alone. The connect scans the boundary dir's own candy map, so a word that cannot connect from one project may still connect from an imported project that composes its plugin. I will re-spike with that key before implementing.
Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
aitrawog commentedon Dec 2, 2026
WAITING
Waiting on #1357, which repairs
check-plugin-buildcache-local(#1138) andcheck-boxload-pod. Both beds are in this issue's gate roster (check-loader-roster) and are red onmainuntil #1357 merges. This issue's PR opens after that merge, rebased onto it. #1357 carries the matching HOLDING.Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
aitrawog commentedon Dec 2, 2026
CLEARED
#1357 merged as
a45b8864cd124de5c1de26247ae0c85f75861efd, socheck-plugin-buildcache-localandcheck-boxload-podare green onmain. One more blocker turned up in this issue's gate: concurrent roster lanes race in plugin loading. It's being filed and fixed before this PR opens.Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
aitrawog commentedon Dec 2, 2026
STATUS
Branch
feat/kind-connect-attempt-memo(local, unpushed) is rebuilt onmainafter #1357 merged. It carries two commits: the per-(word, dir) connect memo, and thecheck-sidecar-podupdate timeout (#1345). Thecheck-loader-rosterentity is dropped: its in-process lanes race (opencharly/plugin-check#160, handed to the #1391 redesign). The gate is now the six loader beds, each as its owncharly check runprocess, on charly2026.336.1350.go test ./...passes. 4/6 beds PASS with 0 warnings so far (flat-import, requires, pod-overlay, buildcache); sidecar and boxload are running. The PR opens when they finish.Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
aitrawog commentedon Dec 2, 2026
STATUS
PR open: #1363, head
f0e01d42eaaa8b4c139574a995e80f1e5e75aa17. Waiting on the validator.Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
aitrawog commentedon Dec 2, 2026
STATUS
#1363 has a validator PASS on head
1d9bebb9118f355a2f489d1f7c723ba7873a8028(round 2 fixed the body findings; two empty re-freezes went through the Actions outage, with the tree unchanged). Waiting on its CI (go,lint,pin-currency) to finish, then auto-merge. This issue closes with that merge.Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
fix(loader): try each declared kind connect once per boundary dir (Cl…
aitrawog commentedon Dec 2, 2026
RESOLVED
Fixed by #1363, merged as
7e4c8359de7d85ea21ebb03d51ee5ea522ce42c5. Each declared kind connect is tried once per (word, absolute boundary dir).charly config check-pod-overlaydrops from 168 s to 66 s (mainvs branch), with a byte-identical unit.Agent:
vol-cdi· Claude Code session8daa865c-d43e-447b-90b3-7d16ccc921d7Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)