Make monitor-tick check-(7) startup-peak phase grep quote-tolerant - #3937
Make monitor-tick check-(7) startup-peak phase grep quote-tolerant#3937tomerweller wants to merge 3 commits into
Conversation
Adds test_startup_peak_phase_extraction_quote_tolerant to scripts/test-monitor-skill-snippets.sh: extracts the check-(7) phase- extraction bash block from monitor-tick/SKILL.md and runs it against the real tracing-quoted summary line (phase="cache-scan"). On main the unquoted phase=[a-z_-]+ class matches nothing, so STARTUP_PEAK_PHASE is empty and both the behavioral and doc-consistency assertions fail. Refs #3844 Co-authored-by: Claude Code <claude-code@anthropic.com>
tracing's default field formatter quotes string values, so the sampler's summary line is `startup_peak_anon_rss_mb=<N> phase="<phase>"`. The extraction used `phase=[a-z_-]+`, whose class matched neither the leading `"` nor (because `+` requires a class member) the numeric prefix, so the whole alternation failed and STARTUP_PEAK_PHASE was silently empty on every tick — the `(phase=…)` suffix never reached WATCH_ITEMS. Add an optional quote `"?` on both sides of the class in both grep stages and strip captured quotes with `tr -d '"'`. Using `"?` (not a mandatory `"`) keeps the pattern robust to both the quoted Text form and any unquoted rendering, matching the sampler's own unit-test tolerance. Also correct the misleading format comment to show the quoted form. Refs #3844 Co-authored-by: Claude Code <claude-code@anthropic.com>
🔍 Reviewer: CorrectnessVerdict: APPROVE Summary: The regex is made quote-tolerant exactly as the issue prescribes, and a new self-sourcing regression test provably fails at the pre-fix pattern and passes after — a complete cycle-1 change-list with no outstanding concerns. Full reviewCycle-awareness: no prior Change under review (
Test-verification gate (linked issue
Build/verify: the No error-handling, readability, or dead-code concerns. Not self-modifying (monitor-tick is outside the pipeline-skill self-mod set). No concerns to raise. |
🔍 Reviewer: RiskVerdict: APPROVE Summary: Documentation/observability-only change to a monitor skill and its test harness; no runtime code, no observable/interop surface, no API/data-format or operational risk. Full reviewCycle-awareness: no prior Blast radius: two files —
No blocking concerns. |
Review: Bounce-Back Cycle 1Reason: CI failed (unrelated, will rebase) Reviewer A: APPROVE — fix matches the issue's prescribed quote-tolerant pattern; new self-sourcing regression test provably fails pre-fix and passes after. Both agent reviewers APPROVE. The blocking signal is CI, which is red on unrelated infrastructure flakiness — not the diff:
Both are Quickstart external-service (stellar-rpc / horizon / friendbot) container bring-up probes timing out at the tighter This PR touches only Routing back to |
No code change: branch is already based on the latest origin/main and both adversarial reviewers APPROVED. The prior review bounce was caused solely by unrelated flaky Quickstart external-service (rpc/horizon/friendbot) container bring-up timeouts, not this docs-only diff. Empty commit to trigger a fresh CI run. Refs #3844 Co-authored-by: Claude Code <claude-code@anthropic.com>
tomerweller
left a comment
There was a problem hiding this comment.
Rebased on origin/main (no-op — branch was already on the latest main) and re-pushed to re-trigger CI. The prior bounce was caused only by unrelated flaky Quickstart external-service (rpc/horizon/friendbot) container bring-up timeouts; the diff-relevant Monitor-Tick Skill Snippets check was green and both agent reviewers APPROVED. Ready for re-review.
Review: Blocked — Unrelated CI Red Persists After RetryReviewer A (Correctness): APPROVE — quote-tolerant regex matches the issue prescription; self-sourcing regression test provably fails pre-fix and passes after. Both agent reviewers APPROVE and the diff-relevant check ( Failing jobs:
Why blocked, not bounced: This is the second consecutive unrelated-CI-red cycle. The prior Operator options:
|
Closes #3844
Summary
Check-(7)'s startup-peak phase extraction in
.claude/skills/monitor-tick/SKILL.mdused the patternphase=[a-z_-]+, buttracing's default field formatter quotes string values, so the sampler actually emitsstartup_peak_anon_rss_mb=<N> phase="<phase>". The class matched neither the leading"nor — because+requires a class member — the numeric prefix, so the whole alternation failed to match andSTARTUP_PEAK_PHASEwas silently the empty string on every tick. The(phase=…)suffix therefore never reachedWATCH_ITEMS, and the daily summary could see the peak move but never which startup phase produced it.The fix adds an optional quote
"?on both sides of the class in both grep stages and strips captured quotes withtr -d '"'. Using"?rather than a mandatory"keeps the pattern robust to both the quoted Text form and any unquoted rendering (matching the sampler's own unit-test tolerance). The misleading format comment is corrected to the quoted form so the next reader isn't misled the same way.Plan reference
Converged Plan comment
Test plan
bash -n scripts/test-monitor-skill-snippets.sh— syntax OKbash scripts/test-monitor-skill-snippets.sh— all 489 TAP assertions pass (was 486; +3 for this fix)Regression test (kind: bug-fix)
scripts/test-monitor-skill-snippets.sh→ startup-peak phase block (extracts the check-(7)STARTUP_PEAK_PHASE=bash block fromSKILL.mdand runs it against the real emitted linestartup_peak_anon_rss_mb=21047 phase="cache-scan").85a77f7— verified FAILED:not ok 488 … quote-tolerant extraction yields 'cache-scan'(STARTUP_PEAK_PHASE empty) andnot ok 489 … pattern is quote-tolerant and strips quotes.3d72368(ok 487/488/489, harness exit 0).Deviations from plan
None.
🤖 Generated with Claude Code