(feat) daemon: stamp the running build's identity into the event log at startup (issue #1486) #1493
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 544 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.377
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1493"
general
weight: 0.35
alexey-pelykh
What this is
The daemon recorded nothing about itself, so establishing which binary produced a stretch of log
needed out-of-band proofs — two of the three required the process to still be alive. A daemon start
now emits one line, readable from the log alone after the process is gone:
Closes #1486.rides in the commit body (this repo's[override]convention keeps the issue link inthe commit subject;
squash_merge_commit_messageisCOMMIT_MESSAGES, so the commit body is whatreaches
main— the PR body does not).Where to look
| Locus | What is there |
|---|---|
|
src/observability.rs—Event::DaemonBuildvariant +to_log_linerender arm | The event, its four render shapes, andpath_valueencoding for theexefield ||
src/cli.rs— daemon startup, betweenEventLog::openand the control-socket bind | The single production call site. Placement is deliberate: before the bind, because "which build failed to bind the socket?" is one of the questions this exists to answer ||
src/daemon/run_loop.rs—emit_best_effort| The third file, and the one to read first. See below |The third file — read this before the rest
emit_best_effortreported througheprintln!, which panics when stderr is unwritable. Thelaunchd plist routes stderr to the same volume as the log, so the one failure the fail-open path
exists to survive could have taken the daemon down before the socket bound. It now writes through a
discarded
writeln!.Two things a reviewer should weigh rather than take on trust:
1. That fix has no independent grader. It was both proposed and applied by the same polish pass.
2.
emit_best_efforthas other call sites across the crate, all of which now get the non-panicking report. Thediff is
src/only, but it is wider than the feature.Deliberately not done
No
build.rsbaking a git SHA. The operator builds from a working checkout, so abuild.rsstamps the last commit regardless of uncommitted changes — and "was this the build with my fix in
it?" is exactly the question a bare SHA answers confidently and wrongly. A confident false
attribution is worse than none. Path + size + mtime reproduce the
lsof-plus-stringsproof fromthe log instead. A SHA stays additive to this same event later, and must carry a dirty-tree marker
beside it. (Design
docs/design/daemon-diagnostic-integrity-solution-design.md§ 4 D-1.)Recorded residuals — in-band, not papered over
current_exe()arm is unprovable black-box on macOS:_NSGetExecutablePathnever fails, soonly
metadata()ever does. The rendering is verified; the conjunction is not.--managedlaunch emits nothing — correct by the product's own wording, but it narrows whatcounting these lines measures.
exeis not canonicalized. Bounded: the shipped plist path comes fromcurrent_binary(), whichdoes canonicalize.
the process alive with nothing bound. AC-5 enumerates these calls failing, never hanging.
Routed to the spec owner — no edit in this PR closes these
design disagree in the tree as merged. This change is faithful to D-1 and unfaithful to R-1 as
written.
%-prefixed unavailability marker (collision-proof by construction) would change theline the design pins.
metadata()call with a timeout — its own design decision, with its ownfailure mode (a degraded line for a healthy binary).
Sibling issue
A flaky
usage_storetest surfaced during verification and is filed as #1492. It is untouched here:usage_storehas no lines in this diff.CI this diff owes
src/only →test,msrv,deny, plus the unfiltereddoc-gates,gate-change-ack,ci-ok-needs-complete. Noapps/menubar/,build/fixtures/orFormula/*, soswift,panel-goldensandformulapath-skip. No commit trailer is owed.---
🤖 Generated with Claude Code