fix(sling): refuse cross-store routes that wedge scale_check#13
Open
eric-jones wants to merge 1 commit into
Open
fix(sling): refuse cross-store routes that wedge scale_check#13eric-jones wants to merge 1 commit into
eric-jones wants to merge 1 commit into
Conversation
b6b01ad to
a7d0b7a
Compare
5ab338f to
ecd201a
Compare
`gc sling <rig>/<pool> <bead>` silently created an unservable wedge
when the bead's store and the target pool's reachable store
disagreed: `cliBeadRouter.Route` set `gc.routed_to` metadata in
the bead's source store, but the supervisor's default
`EffectiveScaleCheck` runs `bd ready` in the agent's `poolDir` (the
rig directory for a rig-scoped agent) — which only sees the rig
store. A bead routed across stores stayed unassigned forever; the
pool sat at zero with no surfaced error.
Add a guard in `cliBeadRouter.Route`: when the resolved target
agent's reachable workflow store doesn't match `deps.StoreRef`,
refuse the route before `SetMetadata` runs. Error names the source
store, the target's reachable store, and links to tr-6s7yx so
operators can find the design context.
Two small helpers in `assigned_work_scope.go` next to
`assignedWorkStoreRefForAgent`:
- `agentReachesWorkflowStore` (predicate, used by the guard)
- `agentReachableStoreLabel` (positive output for error text)
Both are permissive when `cfg` or `agentCfg` is nil — the guard
only refuses on known mismatches so unknown-target routes
(custom sling_query, direct-name targets) fall through unchanged.
Test changes:
- 5 new tests cover the helpers (7 sub-cases on the predicate,
label form on the labeler, refuse / allow / hq-allow on the
router).
- `TestBuiltInSlingPoolRouteContractUsesMetadataOnly` aligned
`deps.StoreRef = "rig:saitoc"` (3-line change). The test re-uses
one physical store as both HQ and saitoc rig; aligning the ref
matches the rig-side use of that store and preserves the
original intent (routing uses metadata, not labels +
scale_check sees demand).
- Three cross-rig tests renamed and converted from
"...UsesPrefixStore" to "...RouteRefused" — their original
assertions documented the silent-wedge behavior this fix
refuses, so they now assert non-zero exit + refusal message +
unchanged bead metadata + empty target rig store. The
refactored `assertHyphenatedRigBeadNotMutatedAndNoOrphan`
helper mirrors the existing "routed without inline orphan"
shape for the refusal path.
Related beads:
- tr-m5fqd — investigation that uncovered the wedge (closed)
- tr-ht80e — sibling YAML bug from `gc rig add`; separate fix
- tr-hndhm — sibling caller-side scope bug at the
config-validation layer; separate fix
Upstream-PR: gastownhall#2295
ecd201a to
f2eb683
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fork-PR for review. Upstream: gastownhall#2295 WITHDRAWN 2026-05-20 (Q3 refusal-semantic; BLOCKED). Retained on fork.