The accept loop serves between start_accept and record_auto_enable, so activation_offer_e2e can see auto_enabled ABSENT under load #156
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#156
Loading…
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?
Pre-existing, found while implementing #144 and separated from it deliberately — #144's
StartupBeaconslightly widened this window but did not create it, and papering over it with beacon placement would hide the real defect.The window
crates/daemon/src/main.rs:Between 383 and 487 the daemon answers requests, and
auto_enabledhas not been recorded yet. A client that connects in that window gets a reply in which the field is ABSENT — which, under this project's own doctrine, must never read as "nothing to enable".Observed:
activation_offer_e2efailing 3/7 under load on the daemon leg, clean on three subsequent isolated runs and clean on the no-changes baseline. The suite's own doc already calls this window race-prone.Why beacon placement is the wrong fix
beacon.finish()at 421 is well-argued and should stay: the beacon stops on the far side of a probe that proved a request/response round trip, and clearing the heartbeat is what re-armstakeover. Moving it pastrecord_auto_enablewould narrow this window slightly at the cost of a clear invariant, and would leave the underlying defect — that the daemon serves before its activation state is recorded — untouched.The actual question
Either:
unavailable/not reported, never absent.(2) is cheaper and is what the disclosure doctrine already demands everywhere else. (1) is more honest but needs a second readiness notion.
Note this is the same family as #152: a field that is correct on one path and collapsed on another, where absence reads as a measured negative.
Test note
A flake that appears only under load is still a defect — the window is real, and load only changes how often a client lands in it. Fixing it by retrying or by serialising the test would be hiding it.
Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1zj5VcFJvJt3pQxe9259K
Triage 2026-09-06: CLOSING. Repair (2) — the one this issue names as the cheaper option the doctrine already demands — is in, and neither forbidden shortcut was taken.
Verified against master; landed in
d0279c0.The fix, and why the placement is the whole thing
AutoEnableState { Recorded, Pending, Unavailable }—crates/daemon/src/eligibility.rs:169-180.auto_enable_ran(:144) is marked before thelet Some(new) = enabled else { return }early return —eligibility.rs:279-289. That single line is the fix: a step that ran and could not tell must not advertisependingforever. Without it the third state would have been a permanent lie rather than a transient truth.auto_enable_expected(:160) defaults tofalse— the safe direction. A forgotten declaration degrades to today's behaviour, not to a stuckpending.expecting_auto_enable()(:333-344) is declared at construction, by the daemon only —crates/daemon/src/main.rs:415-416, rationale at:407-414.Neither thing this issue forbids was done. No retry, no test serialisation, and
beacon.finish()was not moved.Runs (exit 0)
The originally-flaking suite passes on both legs, which matters here — this repo has a recorded scar where e2e ran
--no-daemonand left five RPC arms deletable-green.the_state_reaches_stats_on_every_legasserts all four readings including the wire-skew one: a pre-#156 daemon's missing key must land onNone, not on any of the three. That is the direction field-rename work keeps getting wrong here.Residuals, named
start_acceptandrecord_auto_enable. That is this issue's own stated preference, so it is a choice rather than a gap, but it was never recorded as declined on the issue. It is now.pendingis not observed on a real daemon inside the real window. Grading is holder-level (auto_enable_state_e2ebuildsProjectExtractorsdirectly) plus a renderer unit test. Nothing catches an actual accept-loop reply carryingactivation_auto_enable_state: "pending". That is the one test an e2e could still add — and worth knowing, because on this projectpendingis a promise, not a neutral state.🤖 Triage lane, 2026-09-06, master
45cf6e4