DESIGN_READY_FOR_OPERATOR_REVIEW: StarIntel runtime thread-budget authority #163
Labels
No labels
bug
design
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-auto-research#163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Authority / state
lost-rob0t/starintel-server#34starintel-server#35,#36,#37e99aadd3f44505bc692708aad5e34ab0c4ab0036READY_FOR_DESIGNDESIGN_READY_FOR_OPERATOR_REVIEWThis design is not executable by RAGE until the operator explicitly approves implementation.
Design goal
Create one runtime-owned thread-budget authority that validates and allocates every StarIntel-owned OS-thread demand before long-lived components start.
The fix is not a global executor. Workload-specific isolation remains, but every pool consumes capacity from one process-level budget.
Ownership
starintel-serverruntime/component layer ownsIndividual components own
StarLang owns no new syntax
StarLang actors/domain servers may carry resource-profile metadata where useful, but host runtime remains authoritative. A model/source definition cannot increase process thread authority.
Process-wide authority
Use canonical Common Lisp special variables as the process-wide thread-limit authority:
These values are process invariants, not a nested runtime configuration object. Runtime components read the canonical specials through the budget planner and may not independently reinterpret them as per-component capacity.
If the server init/config system later exposes overrides, the loader initializes/sets these specials. The parsed config object is not itself the runtime authority and no component receives an independent thread-budget config object.
Component-specific desired counts may remain explicit, but are interpreted only as demand inputs to the process-wide planner.
Closed demand classes
At minimum:
controlactor-datarabbitstoragecpuhttpschedulertransportpinnedfixed-overheadUnknown classes fail validation rather than becoming untracked pools.
Resource-plan API
Conceptual Common Lisp API:
The planner is pure/deterministic and testable without starting threads. Production callers normally pass the canonical values from
*max-process-threads*and*reserved-control-threads*.Startup sequence
Partial startup rollback remains #37 lifecycle behavior, but thread-plan validation should happen before rollback is needed wherever possible.
Deterministic allocation v1
Keep allocation simple:
Any rounding/remainder rule must be deterministic and covered by fixtures.
Dispatcher integration
The reserved
:pinnedSento semantic collision must be removed. Custom workload dispatchers introduced by #35 receive worker counts from the plan.A component may choose a Sento/cl-gserver/lparallel/Hunchentoot executor implementation appropriate to its workload, but executor construction must consume its grant and register resulting owned threads.
No subsystem may treat the same global knob as independent capacity.
Rabbit integration
Rabbit owner/reactor threads and processing workers are separate budget demands.
Consumer prefetch should later be derived by #36 from granted processing capacity plus bounded per-worker in-flight policy rather than remaining an unrelated hard-coded number.
HTTP integration
Hunchentoot worker/thread limits consume the HTTP allocation. HTTP configuration cannot independently raise process capacity above the runtime ceiling.
If the HTTP implementation internally creates unavoidable fixed housekeeping threads, declare/document them as fixed overhead and verify them in the observed-count fixture.
Timer/scheduler integration
Prefer shared timer/scheduler resources when current libraries permit it, but do not redesign scheduler semantics in this slice. Any dedicated runtime-owned timer threads must be registered and counted.
Control-reserve invariant
Data-plane allocations may not consume
*reserved-control-threads*.The reserve exists for:
This design does not promise every control action gets a dedicated OS thread; it guarantees data-plane planning cannot consume all execution capacity.
Live accounting
Expose at least:
The invariant is based on runtime-owned threads. SBCL GC/runtime threads or unavoidable foreign-library threads must be separately documented rather than silently counted/un-counted depending on timing.
Adversarial review
Rejected:
bt:make-threadin arbitrary product components;(:runtime ...)configuration object the canonical process authority when two process-wide Common Lisp specials are sufficient.Dependency-ordered implementation slices
All remain AWAITING_OPERATOR_IMPLEMENTATION_APPROVAL.
:pinnedcollision.Mandatory RED-first targets
Slice 1
Before any production mutation, add pure deterministic fixtures:
max=8, fixed/control minima + component minima total 10 -> expectedunsatisfiable-budget; untouched code fails because no planner exists;ingest-workers=4consumed by three independent current subsystems -> fixture demonstrates intended total budget violation instead of treating each 4 as independently valid;Slice 2
Startup fixture with
*max-process-threads*intentionally below the component graph's required minima must fail before any network/listener/thread side effects. Untouched current startup should fail the test because it has no central preflight gate.Slice 4
A fake runtime-owned-thread adapter must report an extra unregistered thread and cause readiness/accounting verification to fail.
Acceptance
*max-process-threads*process ceiling controls all StarIntel-owned execution sources;*reserved-control-threads*protects control capacity from data-plane allocation;ingest-workersor any successor knob cannot multiply independently across subsystems;Implementation approval
PENDING / AWAITING_OPERATOR_IMPLEMENTATION_APPROVALOnly the operator may authorize implementation.