Skip to content

fix(plugin): give step-class dispatches the heavy idle window - #997

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/step-dispatch-window
Oct 20, 2026
Merged

github-actions[bot] merged 4 commits into
mainfrom
feat/step-dispatch-window

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Head 502cd7b183740714655ee3cc1935200eb047e633.

The peer-dispatch idle guard used the probe no_progress window (90s) for EVERY provider class. The step providers run package installs, which go minutes between host-visible legs: on the CachyOS VM bed's deploy, step:system-packages was killed after a single reverse leg while pacman was upgrading packages (host reverse legs=1 (last 1m30.001s ago), CPU advances=0 … window=1m30s).

Step-class dispatches now use the heavy per-attempt window (loadedReadiness().PerAttemptHeavy, 15m by default) — the same sparseness rationale #123 applied to the build steps — while every other class keeps the probe window. TestStepDispatchUsesTheHeavyIdleWindow pins the class mapping and the floor (the step window must exceed the probe fallback).

How tested

$ go build ./...
rc=0
$ go test -run TestStepDispatchUsesTheHeavyIdleWindow .
ok  	github.com/opencharly/charly/charly	2.252s

The changed path executed live: a charly binary built from this tree (2026.293.1809, ./bin/charly version printed the same value) and TestStepWindowCallSiteUsesTheClassSelector pins the call-site wiring (RED on the pre-fix dispatch, GREEN here) ran the distro-cachyos VM bed with the disk staged on a disk-backed TMPDIR. The deploy's SystemPackages step ran for 2m+ — past the old 90s kill — and reached the package transaction's REAL error:

$ charly check run check-cachyos-vm
charly check run check-cachyos-vm: [deploy-add] FAIL after 3m50.745s: exit 1: charly subcommand exited 1
$ tail -3 .check/check-cachyos-vm/2026.293.1844/deploy-add.log
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: charly-full-2026.279.2144-1 and charly-minimal-2026.279.2144-1 are in conflict

Before this fix the same bed died at 1m30s with the idle-guard message; now the guard is no longer the limiter — the step's own package conflict is. That conflict is a separate finding, filed as charly#996 (the generated charly package's full/minimal variants both land on the CachyOS guest).

Rulebook compliance

  • R0 — /charly-internals:plugin, /charly-internals:go and the plugin-dispatch doctrine informed the change; the class table is the existing one (no new class).
  • R1 — the surfaced package conflict is filed (charly#996), not dismissed.
  • R2 — one window function, selected by class; no per-word branches.
  • R3 — no retry, no sleep; the guard's bound changes, the detection stays.
  • R4/R5 — no prose/legacy change.
  • R6 — clean tree; no force-push.
  • R7 — the changed path ran live on the bed (the step passed the old kill point); the regression test pins the mapping.
  • R8 — no mocked service.
  • R9 — the proving binary is the worktree-local build (2026.293.1809).
  • R10 — the affected bed ran on a disposable target; its remaining failure is the filed package conflict, not this change.

Change classification

Go source (the dispatch guard's window selection) + a test. Attribution tier: fully tested and validated — the build/test gate passes on the final tree and the changed path executed live on the bed.

Filed issues

  • charly#996 — the charly-full/charly-minimal package conflict the bed now surfaces.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

The peer-dispatch guard used the probe no_progress window (90s) for every class. The step providers run package installs (step:system-packages on the CachyOS VM deploy was killed after a single reverse leg while pacman upgraded packages — no host leg, no cpu advance from the peer tree). Step dispatches now use the heavy per-attempt window; every other class keeps the probe window. TestStepDispatchUsesTheHeavyIdleWindow pins the mapping and the floor.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: f3d4af03bdac367c9ea578266eb054ef0a9a0b1c (branch: feat/step-dispatch-window)

Change class: Go source (plugin dispatch idle-window selection) + unit test. No candy/CUE/wire/generation change.

Security screen: PASS — no injection, no secrets/egress, no guardrail weakening (the guard's bound for one class is widened by design; detection is unchanged), placement in charly/ (reverse-channel broker / dispatch) is placement: CORRECT; no alias-file growth, no sdk-kit import into core.

Blocks

  1. A1 — ## Filed issues reference is internally inconsistent, so the R1 "fix it or file it" discharge is unproven. The body files the surfaced CachyOS package conflict as charly#996 (prose says "filed as charly#996" three times), but the ## Filed issues entry is [charly#996](https://github.com/opencharly/charly/issues/995) — link text #996, href /issues/995. A1 requires each entry to be a real <repo>#<n>; the number and URL disagree, so a reader cannot tell which issue was actually filed (or whether one was). Because the only reason the red check-cachyos-vm bed (deploy-add FAIL, package conflict) is non-blocking is that it was filed, this defect leaves the R1 discharge unverified. Fix: correct the entry so the number and link agree and point to the actually-filed issue, then re-run/re-post the body.

Non-blocking notes (not gating):

  • plugin_activity_stepwindow_test.go pins pluginInvokeNoProgressFor's mapping and the poll.ReadinessNoProgressFallback floor, but does not assert the call-site wiring in plugin_dispatch_reverse.go (invokeProvider passing class). The live bed run (step ran past the old 90s kill) is what actually proves the wiring; consider a hook that would fail if the call site regressed to pluginInvokeNoProgress().
  • if time.Duration(stepWindow) < 10*time.Minute converts time.Duration→time.Duration; redundant. Leave to the mechanical lint gate rather than prose-policing.
  • R9: the body names the worktree-local build (2026.293.1809) but does not paste a charly version transcript matching source — acceptable here since the version string is asserted, but stronger proof would name the charly version output.

The diff itself is sound: the change is a one-class window selection, the test pins the mapping and floor, the live bed evidence is internally coherent (build time 1809 vs run time 1844 is not a contradiction; failure is the packaged charly-full/charly-minimal conflict, not the idle guard), and no duplication/retry/ad-hoc-workaround appears in the diff.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

TestStepWindowCallSiteUsesTheClassSelector reads plugin_dispatch_reverse.go and requires the class to reach idleBoundedContext, so a regression to the bare probe window fails the suite; proven RED on the pre-fix dispatch and GREEN here.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@aitrawog

Copy link
Copy Markdown
Contributor Author

RCA — validator BLOCK round 1 (a link-text/URL disagreement).

Missed control. When I renumbered the filed issue from #995 to #996 I replaced the number in the LINK TEXT only, leaving the href at /issues/995. The body then asserted a filed issue whose two identifiers disagreed, leaving the R1 discharge unverifiable.

Root fix (this round). The entry is [charly#996](https://github.com/opencharly/charly/issues/996) — text and href agree with the actually-filed issue. I also added the reviewer's suggested wiring pin: TestStepWindowCallSiteUsesTheClassSelector reads plugin_dispatch_reverse.go and requires the class to reach idleBoundedContext (RED on the pre-fix dispatch, GREEN here), so a regression to the bare probe window fails the suite.

Prevention. A filed-issue reference is checked as a unit (text == href == the real issue), and a helper-level mapping test is not enough where a call site is the fix.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: c5f9d3fe74ec2001b9c6511fe535eec16a22f1ed (branch: feat/step-dispatch-window)

Change class: Go source (reverse-dispatch idle-window selection) + unit tests. No candy/CUE/wire/generation change.

Security screen: PASS — no secrets/egress, no guardrail weakening (the bound for one class widens by design; detection is unchanged), placement in charly/ (reverse-channel broker / provider dispatch) is placement: CORRECT; no alias-file growth, no sdk-kit import into core.

Checklist: All applicable rules PASS or NA.

  • Prior block (A1 link text/href mismatch) resolved: ## Filed issues now reads [charly#996](…/issues/996) — text and href agree, matching the prose. The surfaced CachyOS charly-full/charly-minimal conflict is a genuinely separable, filed non-blocking finding (R1 file-it path), and the change's own behavior is proven live (the step survived past the old 90 s kill point).
  • Diff is a single-class window selection delegating to the existing pluginInvokeNoProgress() for all other classes (no duplication/R2, no retry/sleep/R3). Tests pin both the mapping/floor and the call-site wiring (would fail without the fix/R7).
  • Comment dispositions: Comment 6298776489 (bot BLOCK on link mismatch) → stale-superseded (current ## Filed issues is self-consistent). Comment 6299013882 (@aitrawog RCA + added TestStepWindowCallSiteUsesTheClassSelector) → verified-non-blocking (fix present in diff, accurate).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

…ert)

golangci-lint flagged time.Duration(stepWindow) — stepWindow is already a time.Duration. No behavior change.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@aitrawog

Copy link
Copy Markdown
Contributor Author

RCA — CI lint failure (round 2): golangci-lint's unconvert flagged time.Duration(stepWindow) in the new test — stepWindow is already a time.Duration. Fixed in 502cd7b (the reviewer had noted it as non-blocking; the CI gate made it real). Prevention: run the repo's golangci-lint (the .golangci.yml) locally before a push when the binary is available, and heed mechanical-lint notes in a review immediately rather than deferring them.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 502cd7b183740714655ee3cc1935200eb047e633 (branch: feat/step-dispatch-window)

Security screen: PASS — no secrets/egress, no guardrail weakening (idle-window bound widens for one class by design; detection unchanged, and it is an operational liveness guard, not a security gate). Placement in charly/ (reverse-channel broker / provider dispatch) is placement: CORRECT; no alias growth, no sdk-kit import into core.

Checklist: All applicable rules PASS or NA.

  • Diff: one-class window selection delegating to the existing pluginInvokeNoProgress() for all other classes (no R2 duplication, no R3 retry/sleep). Tests pin the mapping/floor and the call-site wiring; both fail without the fix (R7). The redundant time.Duration(stepWindow) is dropped in 502cd7b (unconvert resolved).
  • A1: ## Filed issues entry [charly#996](…/issues/996) — text and href now agree with the prose; R1 discharge intact. Body ends with the correct Assisted-by: line; Agent: precedes it.
  • Comment dispositions:

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 20, 2026 19:50
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 3019e3a0ae15cf4100d40056299f418f1135da55 (branch: feat/step-dispatch-window)

Security screen: PASS — no secrets/egress, no guardrail weakening (the idle bound widens for one class by design; detection unchanged), placement in charly/ (reverse-channel broker / provider dispatch) is placement: CORRECT; no alias-file growth, no sdk-kit import into core.
Checklist: All applicable rules PASS or NA — one-class window selection delegates to pluginInvokeNoProgress() for all other classes (no R2 duplication, no R3 retry/sleep); both tests would fail without the fix (R7); the filed #996 package conflict discharges the red bed under R1's file-it path.

Comment dispositions:

  • 6298776489 (bot BLOCK, #996 text vs /995 href) → stale-superseded: current body reads [charly#996](…/issues/996), text=href.
  • 6299013882 (@aitrawog round-1 RCA) → verified-non-blocking: corrected link + TestStepWindowCallSiteUsesTheClassSelector both present in current diff.
  • 6299084435 (bot PASS @ c5f9d3f) → verified-non-blocking: claims still hold for the diff.
  • 6299685351 (@aitrawog round-2 RCA, unconvert) → verified-non-blocking: conversion dropped; diff now has stepWindow < 10*time.Minute.
  • 6299770139 (bot PASS @ 502cd7b) → verified-non-blocking: claims hold; the only later commit is a content-neutral main merge.

Non-blocking notes:

  • Body's Head 502cd7b1 is stale vs the current merge head 3019e3a0; the PR diff is byte-identical to the pre-merge change, so the pasted evidence remains valid — refresh the head line for cleanliness.
  • 10*time.Minute and the source-grep TestStepWindowCallSiteUsesTheClassSelector are test-only constructs (not production magic-number tuning); acceptable.
  • The site test's GREEN is not in the pasted -run output, but is statically derivable from the diff (the required call string is present, the bare form absent).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot merged commit 1b79591 into main Oct 20, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 20, 2026
aitrawog pushed a commit that referenced this pull request Nov 13, 2026
173 commits behind; both touched files conflicted. main rewrote the guard's progress
source — cpu() -> work()/procWork, watchedRoots, excludeRoot and the charly-owned detached
daemon trees (#984, #997, #1004, #1088/#1102, #1121) — while this branch adds the
attempted-touch source (#913). Resolved by re-basing the attempt source onto main's
structure BY HAND rather than merging text:

  - pluginActivity.touches, incremented in touch() before the non-blocking send;
  - touchAttempts(), the accessor the confirmation reads;
  - observe(wake, last procWork, lastAttempts) reports progress when ANY of the three
    sources moved: a drained host-leg event, a tree-work advance, or a grown attempt count;
  - the lastAttempts baseline is carried through BOTH call sites (the work poll and the
    expiry confirmation) and refreshed by the wake case;
  - stallReport names the third source and carries the attempt count at the kill boundary;
  - the four tests re-added on main's test file (deterministic progressing arm, the
    attempt-vs-delivery property, the unit-level third source, and the confirmation arm),
    with main's #1088 daemon/descendant tests kept intact and their observe calls updated.

Verified on THIS tree: gofmt clean; go build ./... and go vet ./... rc=0; the focused
guard tests 15/15 PASS; the full module suite go test ./... -> ok 414.387s and
ok internal/pluginsgen 142.184s, rc=0, zero failures.

*Agent: pr-charly*

*Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)*
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