[P0-29] Implement managed startup, graceful shutdown, reconnect, and owned-thread cleanup #37
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server#37
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?
Governance / ARDR state
lost-rob0t/starintel-auto-research#182—READY_FOR_DESIGNlost-rob0t/starintel-auto-research#183—DESIGN_READY_FOR_OPERATOR_REVIEW8fb297d146e7332fae7e38170b5b49d49530ac53This issue must not enter executable RAGE until explicit operator implementation approval.
Current state: original defect partially fixed
Current master already has
source/runtime-lifecycle.lispand lifecycle tests. Preserve:star.runtimeauthority and lifecycle states;shutdown :wait t;Do not implement a second runtime owner or rewrite this foundation.
Remaining P0 defect
The runtime still hard-codes component ordering/slots, repeatedly starts fresh timeout windows during shutdown, can swallow cleanup failures, has no closed quiesce/drain component protocol, and has no bounded reconnect/fencing owner for Rabbit/CouchDB/KV dependencies. Some readiness checks still infer health from retained handles.
Approved architecture status
Design is ready for operator review only. No implementation slice is approved yet.
The proposed architecture extends
star.runtimewith a closed Common Lisp runtime-component registry/protocol. No new StarLang syntax and no external/Python supervisor.Every component has:
Startup derives deterministic topological order. Rollback stops exactly the successfully started prefix in reverse dependency order.
Shutdown computes one monotonic absolute deadline once. Every quiesce/drain/stop adapter consumes remaining time from that deadline; no phase gets a fresh full timeout.
Reconnect uses bounded backoff plus monotonically increasing generation/fencing. A late reconnect completion may install resources only if its generation is still current and the runtime is still running. Stop fences pending attempts so they cannot resurrect resources.
Dependency-ordered proposed implementation slices
All are AWAITING_OPERATOR_IMPLEMENTATION_APPROVAL.
P0 / prerequisite — component registry + graph validation
star.runtime;P0 — one absolute shutdown deadline + structured report
P0 — migrate current hard-coded resources into component registry
P0 — quiesce/drain lifecycle phase
P0 — reconnect generation/fencing
P0 — component health readiness + owned-resource accounting
Follow-on integration
Mandatory RED-first gate
No production mutation before the selected slice has legitimate RED evidence on untouched baseline.
First RED for slice 1
Add pure deterministic fixtures requiring a runtime-component graph:
A -> B -> Cyields start orderA B Cand stop orderC B A;Untouched current master must fail because
star.runtimehas no component registry/graph protocol.RED for slice 2
Fake three stop components whose adapters would each consume a fresh current timeout. Assert one shared absolute deadline is propagated and total shutdown cannot consume three fresh budgets. Untouched current lifecycle must fail this contract.
Also assert cleanup failure is retained in a structured shutdown result rather than disappearing behind
ignore-errors/logging.RED for reconnect slice
Reconnect generation N completes after N+1 and after runtime stop. Both stale completions must be rejected, must not replace current resources, and must close/fence their returned resource.
RED for readiness/accounting slice
Acceptance criteria
star.runtimeauthority owns lifecycle;Implementation approval
PENDING / AWAITING_OPERATOR_IMPLEMENTATION_APPROVALARDR/ADARD cannot change this state. Explicit operator approval is required before RAGE implementation.