Skip to content

Separate CHASM scheduler action capacity APIs - #36

Draft
chaptersix wants to merge 1 commit into
sch-readablefrom
sch-readable-action-capacity
Draft

chaptersix wants to merge 1 commit into
sch-readablefrom
sch-readable-action-capacity

Conversation

@chaptersix

@chaptersix chaptersix commented Aug 19, 2026

Copy link
Copy Markdown
Owner

What changed?

  • Split the CHASM scheduler action-capacity predicate and mutation into canTakeScheduledAction and consumeScheduledAction.
  • Update only the direct query and consumption call sites.
  • Add focused tests for query non-mutation and zero, one, and multiple successful consumptions.

Production behavior is unchanged. Each successful limited-action consumption decrements RemainingActions exactly once and increments the conflict token exactly once; N successful consumptions preserve an N-token delta. Paused or exhausted attempts mutate neither counter, and unlimited consumption remains allowed without changing either counter.

Why?

This is PR 1 of the CHASM scheduler readability stack. It removes the boolean mutation mode from useScheduledAction(bool) so callers state whether they are querying capacity or consuming it, without introducing the lifecycle classifier, transition helpers, buffer planner, or later refactors.

Stack

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)
.bin/gci-v0.13.6 write --skip-generated -s standard -s default <changed Go files>
go test -tags test_dep ./chasm/lib/scheduler -run <focused action-capacity and affected behavior tests> -count=1
go test -tags test_dep ./chasm/lib/scheduler -count=1
GOLANGCI_LINT_BASE_REV=sch-readable GOLANGCI_LINT_FIX=false make lint-code
git diff --check

Potential risks

The risk is limited to accidentally changing action-limit or conflict-token accounting while separating the APIs. The focused tests pin the paused, unlimited, exhausted, single-consumption, and multi-consumption behavior and exact counter/token deltas.

@chaptersix
chaptersix force-pushed the sch-readable-action-capacity branch 2 times, most recently from 30787d0 to 461524a Compare August 19, 2026 07:52
@chaptersix
chaptersix force-pushed the sch-readable-action-capacity branch from 461524a to d0d4e47 Compare August 19, 2026 11:30
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