Skip to content

loader: the kind-connect pass re-runs (2 full project loads) at every walk boundary for a declared kind word that never connects — 106 of 110 loads in one charly config #1340

Done

Description

@aitrawog

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

  1. added
    category:runtime
    type:fix
    on Dec 2, 2026
  2. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    CLAIM

    Claiming this. It is now blocking: check-sidecar-pod fails on unchanged charly main 755f81f764f90058ffd797d6863e1a3c8f44bdad because its charly stop / start / logs / update steps exceed the 120 s never-hang ceiling:

    probe killed by never-hang ceiling after 2m0.136s (no exit status — the process was signalled, not returned); command: /tmp/cs/charly-main/bin/charly stop check-sidecar-pod
    probe killed by never-hang ceiling after 2m0.121s …; command: …/charly start check-sidecar-pod
    probe killed by never-hang ceiling after 2m0.14s …; command: …/charly logs check-sidecar-pod
    probe killed by never-hang ceiling after 2m0.103s …; command: …/charly update check-sidecar-pod
    CONTROL check-sidecar-pod rc=2 3933s :: charly check run check-sidecar-pod: FAIL (steps=11, skipped_checks=3)
    

    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 session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)

  3. self-assigned this
    on Dec 2, 2026
  4. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    WAITING

    Waiting on #1357, which repairs check-plugin-buildcache-local (#1138) and check-boxload-pod. Both beds are in this issue's gate roster (check-loader-roster) and are red on main until #1357 merges. This issue's PR opens after that merge, rebased onto it. #1357 carries the matching HOLDING.

    Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)

  5. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    CLEARED

    #1357 merged as a45b8864cd124de5c1de26247ae0c85f75861efd, so check-plugin-buildcache-local and check-boxload-pod are green on main. 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 session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)

  6. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    Branch feat/kind-connect-attempt-memo (local, unpushed) is rebuilt on main after #1357 merged. It carries two commits: the per-(word, dir) connect memo, and the check-sidecar-pod update timeout (#1345). The check-loader-roster entity 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 own charly check run process, on charly 2026.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 session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)

  7. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    PR open: #1363, head f0e01d42eaaa8b4c139574a995e80f1e5e75aa17. Waiting on the validator.

    Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)

  8. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    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 session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)

  9. added a commit that references this issue on Dec 2, 2026
    7e4c835
  10. aitrawog commented on Dec 2, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED

    Fixed by #1363, merged as 7e4c8359de7d85ea21ebb03d51ee5ea522ce42c5. Each declared kind connect is tried once per (word, absolute boundary dir). charly config check-pod-overlay drops from 168 s to 66 s (main vs branch), with a byte-identical unit.

    Agent: vol-cdi · Claude Code session 8daa865c-d43e-447b-90b3-7d16ccc921d7
    Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category:runtimetype:fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions