- .wolf/anatomy-index.json, anatomy.md, memory.md: OpenWolf hook-maintained project index and session log, refreshed by this session's activity. - .kiro/specs/controller-peers-env-fallback/: spec scaffold (brief, requirements, design, research) from prior spec-init work. - issues/new_requirements.md: scheduler simulator enhancement backlog (info-command improvements, pend-reason detail, decision tracing). Excluded as non-persistent: issues/Issues.md (empty placeholder), src/lib/testsuite/test_xcectx_reconnect_race.c (self-documented as an ASAN stress reproduction only, not a committed regression test, and not wired into meson.build), scheduler-replay-20260922-095207.replay (4MB binary debug capture, no .replay files are tracked in this repo). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
7.8 KiB
Requirements Document
Introduction
Operators and deploy/test scripts must retype the full --peers candidate
list on every invocation of controller, scheduler, worker, and
harness/xce_test, and the --controller target on every invocation of
xceadmin — there is no way to set a default once per session or
environment for the four --peers-based components today. --peers is
optional for all four, and omitting it intentionally selects each
component's existing standalone/single-controller behavior (confirmed:
each component's own startup log already names this an intentional path,
not an error) — that behavior must keep working unchanged. xceadmin
already solved the equivalent problem for its own --controller option via
the XCEADMIN_CONTROLLER environment variable (bug-1566), and, separately,
xceadmin's --controller option can already accept a comma-separated list
of candidates and will try each in order until one is reachable (bug-1821),
rather than only a single target.
This feature introduces one new environment variable,
XCE_CONTROLLER_PEERS, read as a fallback default by all five components
(controller, scheduler, worker, harness/xce_test, and xceadmin) whenever
their respective connection-target option (--peers or --controller) is
not explicitly given on the command line — and only then; an explicit
option value is always used exactly as it is today, with the environment
variable never consulted. xceadmin's existing XCEADMIN_CONTROLLER
variable keeps working exactly as it does today, as a lower-priority
fallback beneath the new variable.
Boundary Context
- In scope: A single new environment variable,
XCE_CONTROLLER_PEERS, providing the default connection target for controller, scheduler, worker, harness/xce_test (via their existing--peersoption) and xceadmin (via its existing--controlleroption), consulted only when the corresponding command-line option is omitted. - Out of scope: The apiserver (its controller connection comes from a
configuration file, not a command-line option, and is unaffected) and
xcecli's
--urloption (a different target — the apiserver, not a controller — and unaffected). Any change tosrc/tools/deploy-ha.sh's generated scripts, which continue to pass--peers/--controllerexplicitly exactly as they do today. Any change to what each component does today when its connection-target option is omitted and no environment variable applies either (today's standalone/single-controller behavior is preserved exactly). - Adjacent expectations: xceadmin's existing multi-candidate,
try-until-reachable behavior for
--controller(bug-1821) and its existingXCEADMIN_CONTROLLERfallback (bug-1566) are both reused unmodified — this feature only changes what value feeds into that already-existing behavior, never how that behavior itself works.
Requirements
Requirement 1: Default peers candidate list for --peers-based components
Objective: As an operator running controller, scheduler, worker, or
harness/xce_test, I want a default --peers candidate list available via
an environment variable, so that I don't have to retype it on every
invocation while still being able to run any single invocation without it.
Acceptance Criteria
- The peers-based component (controller, scheduler, worker, or
harness/xce_test) shall recognize
XCE_CONTROLLER_PEERSas the environment variable providing its default--peerscandidate list. - When the peers-based component starts with an explicit
--peersargument, the peers-based component shall use that argument's value and shall not consultXCE_CONTROLLER_PEERS. - When the peers-based component starts without an explicit
--peersargument andXCE_CONTROLLER_PEERSis set to a non-empty value, the peers-based component shall use that value as its--peerscandidate list, exactly as if it had been supplied via--peers. - When the peers-based component starts without an explicit
--peersargument andXCE_CONTROLLER_PEERSis unset or empty, the peers-based component shall behave exactly as it does today when started with no--peersargument (today's standalone/single-controller behavior, unchanged). - If the candidate-list value in use — from either
--peersorXCE_CONTROLLER_PEERS— fails to parse as a valid candidate list, the peers-based component shall report a parse-error message, and that message shall identify whether the invalid value came from the--peersargument or from theXCE_CONTROLLER_PEERSenvironment variable. - The peers-based component's
--peershelp/usage text shall documentXCE_CONTROLLER_PEERSas an environment-variable fallback for that option.
Requirement 2: Default controller candidate list for xceadmin
Objective: As an xceadmin operator, I want --controller to fall back
to the same environment variable the other XCE components use, so that one
variable configures every tool's default connection target.
Acceptance Criteria
- When an xceadmin subcommand that accepts
--controllerruns without an explicit--controlleroption andXCE_CONTROLLER_PEERSis set to a non-empty value, xceadmin shall derive its controller candidate list fromXCE_CONTROLLER_PEERS. - Where a candidate entry in
XCE_CONTROLLER_PEERScarries aname=prefix, xceadmin shall remove the prefix before treating that entry as a controller candidate. - When xceadmin derives its controller candidate list from
XCE_CONTROLLER_PEERS, xceadmin shall attempt each resulting candidate in the same order the variable lists them, moving to the next candidate only when the current one is unreachable — the same behavior xceadmin already provides for an explicit multi-candidate--controllervalue. - When an xceadmin subcommand that accepts
--controllerruns with an explicit--controlleroption, xceadmin shall use that option's value and shall not consultXCE_CONTROLLER_PEERSorXCEADMIN_CONTROLLER. - When an xceadmin subcommand that accepts
--controllerruns without an explicit--controlleroption, andXCE_CONTROLLER_PEERSis unset or empty, andXCEADMIN_CONTROLLERis set to a non-empty value, xceadmin shall useXCEADMIN_CONTROLLERexactly as it does today. - When an xceadmin subcommand that accepts
--controllerruns without an explicit--controlleroption, and bothXCE_CONTROLLER_PEERSandXCEADMIN_CONTROLLERare unset or empty, xceadmin shall fall back to its existing hardcoded default controller target, unchanged. - The
--controlleroption's help text shall documentXCE_CONTROLLER_PEERSas its preferred environment-variable fallback, alongside the existingXCEADMIN_CONTROLLERmention.
Requirement 3: Documentation of the new environment variable
Objective: As an operator or future contributor, I want the project's
build/deployment documentation to describe XCE_CONTROLLER_PEERS, so that
I can discover and use it without reading source code.
Acceptance Criteria
- The project's build/deployment steering documentation shall describe
XCE_CONTROLLER_PEERS: which components read it, its value format, and its precedence relative to each component's connection-target option (--peersor--controller). - The HA cluster deployment guidance shall note that
XCE_CONTROLLER_PEERSis available as an alternative to passing--peers/--controllerexplicitly on every generated script invocation, without stating or implying any change to what those generated scripts themselves pass. - The multi-host verification guidance shall note the same availability
wherever it currently documents driving deployment via
--peers, without stating or implying any change to that verification's own generated invocations.