Repository navigation
fix: close five monitor-ceiling and directive gaps left after #14371 - #14514
Conversation
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the restart's silent clamp (7200→3600) is visible to the user somewhere — the response carries the new number but nothing says it changed. Suggestions
[DESIGN-REVIEWED] 2854906 |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the restart clamp's silence: a stored 7200 budget quietly becomes 3600 with no notice to the operator — confirm #14513 agreed to that. What this change shipsInventory (7 items) — 7 justifiedIntent: FIX — five deferred defects from #14371 (tracked in #14513): misleading restart 400s, doubled refusals, invisible stop denials, schema/validator mismatch.
Only one restart entry point exists ( [FIRST-PRINCIPLES-REVIEWED] 2854906 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed Review detailsNothing blocks; the one unfixed sibling of the audit-name bug this PR fixes still writes a denied SEL row naming no tool. FINDING — src/kiro_crew/dashboard/chat_runner.py:14014 — for an identified directive call whose marker fails to decode (the PR's own FINDING — docs/system-specs/modules/learn-cron-dashboard.md:2989 — the untouched "Monitor runtime ceiling" section still states [OPUS-REVIEWED] 2854906 |
|
Pushed 9ee35a7 on top of 1320c39. It fixes the three round-1 regressions and the First Principles float coverage; each fix has a test that failed on the previous head. Two CI reds on this PR are inherited from main and reproduce on a clean |
|
|
|
|
|
|
|
|
9ee35a7 to
b21bd2f
Compare
|
Pushed b21bd2f, which squashes the round-2 fixes into the second commit so the PR stays at two commits: the stop-gate comment and spec now describe stop refusals, native denial rows name the directive tool, and the description matches the code. Two CI reds on this PR are inherited from main and reproduce on a clean |
|
|
|
|
|
|
|
…dev#14371 Restart caps a stored budget at the live ceiling; undecoded out-of-band directive frames are refused once; stale-wake stops get an identity check with stop wording and a visible refusal; MCP schemas advertise integer runtimes again; structured API requests accept whole-number float runtimes.
…notices A stale-wake stop refuses a person-paused row as the arm gate does; restart forwards a monitor whose budgets carry the clamped runtime; the forged-marker branch no longer clears the pending directive, so the decode-failure notice reaches the person; _bounded_int accepts whole-number floats for every monitor budget field; stop refusals are documented and native denial rows name the directive tool.
b21bd2f to
2854906
Compare
|
Problem / Motivation
Goal: Monitor restart, stop refusals, directive notices and runtime-budget input all behave consistently after #14371, with no misleading errors, duplicate audit rows or silent refusals.
Five defects in code added by #14371 were deferred during its review and are listed in #14513. After an operator lowers the runtime ceiling, restarting a monitor fails with a 400 for a number the user never typed. An undecoded out-of-band directive frame is refused twice. A stale-wake stop is refused with arming wording and no visible notice. The MCP schemas advertise a fractional runtime type the validator rejects. The structured monitor API refuses
3600.0, which every other entry point accepts.Why it matters
Operators who configure a lower ceiling cannot revive monitors from the dashboard. The audit trail double-counts denials. People get no signal when a stale wake's stop is refused. Agents reading the published schema can send values the server refuses.
Not a goal
contract.json.DISABLE_MCP_CONFIG_FILTERING); that waits on a maintainer ruling on fix: restore verified monitor delivery and configurable runtime limits #14371.What changed (motivation → approach → change)
api_monitor_restartforwards a monitor whose budgets carrymin(stored budget, runtime_ceiling_secs()), so the store's own check sees the clamped value; aValueErrorfrom a ceiling change between the clamp and that check maps to an audited 400 with acode._dir_tool, pops the pending entry) so it is refused once, and its audit row names the directive tool. The forged-marker branch leaves the pending entry in place, so an identified call whose marker does not decode still reaches the decode-failure path: one audit row, one notice, sentinel stripped.numbermax_runtime_secsis"type": "integer"again;validate_runtime_secsstill accepts JSON bodies that spell an integer as3600.0.3600.0_bounded_intaccepts an integral non-bool float and returns the int, so all five bounded fields (cadence_secs,max_agent_turns,max_tokens,max_provider_errors,max_runtime_secs) accept3600.0; fractional and boolean values still get a 400 withcode: invalid_monitor.Backwards compatibility
None breaking. Each change narrows an error path added by #14371 or corrects its wording.
Tests
Each defect has a regression test that failed on main before its fix and passes after it:
test_autonudge_handlers_cov80.py: restart under a lowered ceiling, driven through the real authorizer and service, succeeds with the clamped budget; structured create and update accept3600.0for every bounded field and store the int, and refuse3600.5andtrue.test_session_directive_input_digest.py: undecoded native and identified forged-marker frames each produce one denied audit row and one notice with the sentinel stripped; the native row names the directive tool.test_monitor_directive_apply.py, against a real AutoNudgeService: a stale-wake stop of a replaced loop, or of a loop a person paused, is refused with stop wording and surfaced, and the paused row survives intact; a live wake stops its own active loop.test_monitor_mcp.py: the published schemas declareinteger;3600.0is still accepted.Targeted suites (monitor, autonudge, directive, handler, MCP, transport, error-contract): 779 passed, plus 427 on the directive and transport suites after the documentation round. Every regression test drives the real service, not a mocked authorizer. flake8, black, mypy on touched sources and the comment-history gate are clean.
Manual verification
N/A: server-side paths only, all covered by the regression tests above.
Screenshots / video
Why no screenshot: No component or layout change. The only user-visible text change is the stop-refusal transcript row, which uses the existing refusal row style.
Related Issues
Fixes #14513. Follow-up to #14371.
Pattern harvest
Rule candidate: review-prompt
Pattern: When a gate is added to one branch of a dispatch (arm, revise, stop), check that every sibling branch gets matching wording, state cleanup and refusal surfacing.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)