Skip to content

feat(autonudge): pause and play icon controls in the goal popover - #16030

Merged
bolichen97 merged 2 commits into
mainfrom
feat/autonudge-pause-play-controls
Oct 2, 2026
Merged

bolichen97 merged 2 commits into
mainfrom
feat/autonudge-pause-play-controls

Conversation

@pepmach

@pepmach pepmach commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Replace the goal popover's text buttons with two icon controls, Pause and Play, so a loop's state is readable and one press resumes it.

While a goal loop is running, its popover offers two text buttons, Stop loop and Save. There is no way to pause the loop and pick it up later: the only way to halt it is Stop, which removes the goal for good, and the one-off Trigger nudge sits alone as a text button on the schedule line. A stopped loop and a paused loop look the same, so a reader cannot tell which one is safe to bring back. Bringing a paused or limit-stopped loop back should also give it a fresh budget, so one Play press resumes it instead of being refused until a limit is raised.

Why it matters

A goal loop is the one feature a person leaves running unattended, so its controls have to say what state the loop is in and what one press will do. Today Stop deletes, paused and stopped look alike, and a loop that hit its cycle or time limit cannot be resumed without raising a limit first.

Not a goal

  • A "Done" state for a loop whose stop file was created or whose watched pull request merged. Follow-up PR.
  • A separate save-without-firing control. Play applies pending edits.
  • Any change to how the stop file, the cycle cap or the runtime budget end a running loop. Only resume changes.

What changed (motivation → approach → change)

Backend (feat(autonudge): resuming a loop resets its budget). The timer re-checks the cap and budget before every fire, so a loop stopped on either was re-stopped on its first tick after active: true unless the bound was raised. _update_unserialized in src/kiro_crew/autonudge_service/mutations.py now runs the user's resume as a fresh run: a revival (keyed on not was_active) flagged fresh_run zeroes cycle_count and re-anchors created_ts. Only the dashboard PATCH route passes it (dashboard/handlers/autonudge.py via autonudge_authz.py); a bare revival keeps count and clock, so a monitor_update raise buys its increment and the Research Lab and Issue Radar reconcilers (which re-arm any inactive loop every few seconds) cannot turn a cap into a per-run allowance. created_ts is the anchor because every reader of the runtime left measures from it; a running loop's save resets nothing. Also: the autonudge_state frame (src/kiro_crew/slack/gateway.py) carries stopped_reason and next_due_ts for every loop, and a reasonless pause landing after a bound keeps the bound. docs/system-specs/modules/learn-cron-dashboard.md documents all of it.

Frontend (feat(autonudge): pause and play icon controls in the goal popover). website/src/components/AutoNudgePopover.tsx: while a loop exists the footer is ONE row -- Clear stopped goal as a text link at the left on a paused loop (no button chrome) and, at the right, two icon-only controls named in aria-label and title: Pause, and a fire control -- a lightning glyph while running (saves only the edited fields, never active, then fires now; a play triangle beside Goal active had no cold reading), a Play glyph while paused (Pause disabled; Play saves the edits, sends active: true and fires -- one request path, no bound to raise first). A pending edit marks it with a dot and keeps it live while due. The title names the state (Goal active (cycle N/M), Paused, or Set a goal with no loop) and the line under it is boxed in the state's tone: the countdown in the ok tone while running (neutral while writes are disabled, so it never asserts a fire beside the capability note), otherwise Paused · <why> in the warn tone per stopped_reason (paused by you, stopped by the agent, cycle or time limit reached with the fresh-budget clause, awaiting approval, the last cycle could not run; unknown reads Paused). Clear's confirm replaces the row with a danger-bordered box -- the question in the primary text colour, a filled Clear, a plain Cancel -- under the status line. Gone: the Stopped state label, the Save, Stop and Nudge-now buttons, and every help line naming a tool or a config key. website/src/components/SessionAutomationPopover.tsx keeps its identity guard and armedNow; website/src/components/autoNudgeLoop.ts and website/src/hooks/websocket/automationSeed.ts change only comments. Catalogs (website/src/i18n/locales/): six paused_* keys added, thirteen retired (the bound help lines, the Save, Stop, Stopped and Nudge-now strings, cycle), en-XA regenerated, dead-key count at baseline.

The decision is recorded in docs/request-for-change/rfc-goal-popover-pause-play-controls.md (state model, controls, resume resets the budget, rejected alternatives; decision owner the PR author, 2026-10-01), indexed there. It ships in this PR, so the First Principles lane, reading status off the base, sees no accepted record yet.

Backwards compatibility

Compatible: no route, field or key the wire accepts today is rejected, renamed or removed. The websocket frame gains two fields on plain loops (additive). update(active=True) on an inactive loop now resets the count and clock -- every caller of that revival (the popover's Play, monitor_update's bound-raise, the Research Lab and Issue Radar re-arms) asks for a fresh run; an active loop's saves are untouched. The retired catalog keys were referenced only by this popover.

Tests

  • test/test_autonudge.py: red-first test_revival_runs_a_fresh_budget_and_a_running_save_keeps_the_old_one -- a cap-stopped loop resumes and fires again under the same cap (assert 1 == 2 without the fix), a budget-stopped loop resumes with created_ts re-anchored, a save on a running loop keeps its count and clock; test_a_bare_revival_keeps_the_count_so_a_reconciler_cannot_mint_a_fresh_allowance (red without the flag) pins the unflagged revival re-stopping unfired; test_a_pause_landing_after_a_bound_keeps_the_bound pins the mirror race. test_monitor_directive_apply.py: a cap raise keeps the count. test_autonudge_handlers_cov80.py / test_autonudge_authz_cov80.py: the route passes fresh_run, the authorizer forwards it and leaves it off by default. test/test_slack_gateway_coverage.py: the frame carries stopped_reason and next_due_ts for a plain loop.
  • website/src/test/AutoNudgePopover.test.tsx (104 → 71 tests): the paused line per reason as one it.each (seven reasons plus unknown and absent; never the word Stopped; title Paused, warn box), the row per state as one it.each (running, paused, paused at its cap, paused on its time limit: Pause and the fire control, live and named for its press, lightning while running and Play while paused, the dot on an edit), the fire control's write-then-fire on running and paused records (pristine and edited, refused write, refused fire, a legacy stub answer, a due cycle disabling only a pristine press), Pause, Start loop, Clear (text link first in the icon row, the danger-boxed confirm with a filled Clear then Cancel, intent clear, the loops query invalidated, refusal, primed confirm dropped on a record change), the ok box and its neutral tone while writes are disabled. Every behaviour assertion of the previous head is retained.
  • website/src/test/SessionAutomationPopover.test.tsx (98 tests): crew/member mode, the stopped-reason carry per reason, Clear through the bridge, and the two-leg press suite retargeted to Play.
  • Coverage, the touched test files only, before → after. AutoNudgePopover.tsx lines 96.25% → 98.08%, branches 91.42% → 91.63%, statements 93.27% → 95.76%; SessionAutomationPopover.tsx lines 96.51% → 96.51%, branches 90.82% → 91.13%; autoNudgeLoop.ts unchanged (96.55% / 95.23%); mutations.py 68% → 68% (the two new statements covered, one fewer partial branch), gateway.py unchanged.

Manual verification

Gates on this head (rebased onto main's tip d8d052f4cc; the full runs below were made on the day's earlier tip 5ca51b0a4e and the targeted ones re-run after each rebase): black ratchet, subprocess-encoding, isort, flake8, mypy (2026 files), comment-history, harness parity, scripts/docs-lint.sh; every test_autonudge*.py file plus the gateway coverage and composition-contract files -n0 (1,746 tests); scripts/local-gate.py backend related set 121,901 passed with 48 failures all in the sandbox's own class (test_cloud_source.py × 40 '/' is owned by another account (uid 65534), the restart-supervisor and adopted-daemon process tests, two conductor-skill subprocess tests, one served-model test; the two test_slack_gateway_composition_contract.py failures were a relative PYTHONPATH in a cwd-changed subprocess and pass with an absolute one); npm run build; the full website suite 2,551 files / 42,866 tests green (the electron stage has no electron module installed on this host); npx eslint src/ --max-warnings 0; vitest run src/i18n and npm run i18n:check with I18N_BASE_REF=origin/main, all ten gates ok. Frames below are the built SPA of this head served with the repository's gateway-free API stub, driven by Playwright, 10/10 states passing their DOM assertions (row names off aria-label, every icon's title equal to its name with no visible text, the title and the boxed status line per state in the right tone, the dot only on an edit, Clear as a text link first in the icon row, the danger-boxed confirm with a filled Clear, no Stopped and no tool or config name anywhere); re-shot after the owner's 23:20Z ruling moved the implementation onto the state mocks. No local review lane ran; the server lanes are the first model read.

Screenshots / video

Before (origin/main): text buttons, Trigger nudge on the schedule line, and a paused record indistinguishable from a stopped one.

Before, running loop: Trigger nudge text button under the schedule line, Stop loop and Save text buttons in the row

Before, a manually paused record: reads Stopped with the help line, Clear stopped goal and Start loop, no way to tell it from a stop

After (this head): the title names the state, the boxed status line under it, Pause and the fire control (lightning while running, Play while paused), Clear as a text link in the same row.

After, running: title Goal active (cycle 1/3), the countdown boxed in the ok tone, Pause and the lightning Nudge now

After, running with an edit: the lightning control carries a dot and reads Save edits and nudge now

After, paused at its cycle cap: title Paused, the warn box "Paused · cycle limit reached (3 of 3). Play resumes it with a fresh budget.", Clear stopped goal at the left of the row, Pause disabled, Play live

After, the clear confirm: a danger-bordered box with the question, a filled Clear and a plain Cancel; the status line stays above it

The other states

After, no loop: Play alone, Start loop

After, paused by hand: title Paused, the warn box "Paused · you paused it"

After, paused with an edit: Play reads Save edits, resume loop and nudge now, with the dot

After, paused on its time limit: "Paused · time limit reached. Play resumes it with a fresh budget."

After, stopped by the agent: "Paused · the agent stopped it"

After, a crew session: the capability note, the countdown box in the neutral tone, both controls disabled

Related Issues

Supersedes #11478 (the same redesign, reopened on a fresh branch so the review starts from a clean thread). No linked issue: operator product decision delivered through the crew conductor.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

@pepmach
pepmach requested a review from a team October 1, 2026 23:07
@pepmach
pepmach requested a review from a team as a code owner October 1, 2026 23:07
@pepmach
pepmach requested a review from kyleseaman October 1, 2026 23:07
@pepmach
pepmach force-pushed the feat/autonudge-pause-play-controls branch from af1f2dc to ebc813e Compare October 1, 2026 23:46
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ human override accepted

Human judgment by @pepmach overrides the GPT 5.6 finding for 3d6c7e271db212c61c44cb893d33271094ad9835; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] 3d6c7e2

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3d6c7e271db212c61c44cb893d33271094ad9835: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 3d6c7e271db212c61c44cb893d33271094ad9835 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the product-owner overrides the RFC defers to the PR itself: the Clear-link row placement lane reading, and the First-Principles draft-status lane.

Suggestions

  • created_ts now means "current run start"; if any reader ever needs true creation time (audit, stop-log history), capture it at first arm in a follow-up before resumes erase it in live stores.

[DESIGN-REVIEWED] 3d6c7e2

Description read

[DESCRIPTION-READ] 60b7d6fac27040c308987b7e5f7625c94738d26b3260dea9a1e842fb5951e7b5

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ human override accepted

@pepmach overrode this lane for 3d6c7e271db212c61c44cb893d33271094ad9835 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ human override accepted

@pepmach overrode this lane for 3d6c7e271db212c61c44cb893d33271094ad9835 via /ai-review override (this commit only).

@pepmach
pepmach force-pushed the feat/autonudge-pause-play-controls branch 2 times, most recently from 1b573a2 to b7f4bb6 Compare October 2, 2026 00:58
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ human override accepted

Reviewed 3d6c7e271db212c61c44cb893d33271094ad9835 — this comment is updated in place on each push.

Human judgment by @pepmach overrides the Opus 5 finding for 3d6c7e271db212c61c44cb893d33271094ad9835; the recorded reason is authoritative for this commit.

[OPUS-OVERRIDE] 3d6c7e2

Verdict recorded from an authorized human decision for commit 3d6c7e271db212c61c44cb893d33271094ad9835.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 3d6c7e271db212c61c44cb893d33271094ad9835: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 2, 2026
@pepmach
pepmach force-pushed the feat/autonudge-pause-play-controls branch from b7f4bb6 to d8513ea Compare October 2, 2026 01:48
@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt d8513ea: Clear stopped goal is a text link, not a button; the row holds exactly two buttons. The two-buttons-per-row rule guards against button clutter, which this layout keeps. PR owner's layout decision.

@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles d8513ea: Product shape decided by the PR owner: Pause and Lightning icon controls while running, Play while paused, Clear as the only delete, resume resets the loop budget, limit stops read Paused. The RFC recording it ships in this PR at docs/request-for-change/rfc-goal-popover-pause-play-controls.md.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the gpt AI finding as false positive, not applicable, or explicitly accepted for d8513eaeebfaf7679d20f92284901b147e9ada70.

Clear stopped goal is a text link, not a button; the row holds exactly two buttons. The two-buttons-per-row rule guards against button clutter, which this layout keeps. PR owner's layout decision.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for d8513eaeebfaf7679d20f92284901b147e9ada70.

Product shape decided by the PR owner: Pause and Lightning icon controls while running, Play while paused, Clear as the only delete, resume resets the loop budget, limit stops read Paused. The RFC recording it ships in this PR at docs/request-for-change/rfc-goal-popover-pause-play-controls.md.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 2, 2026
@pepmach
pepmach force-pushed the feat/autonudge-pause-play-controls branch from d8513ea to 35284f5 Compare October 2, 2026 02:48
@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 35284f5: Clear stopped goal is a text link, not a button; the row holds exactly two buttons. The two-buttons-per-row rule guards against button clutter, which this layout keeps. PR owner's layout decision.

@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 35284f5: Product shape decided by the PR owner: Pause and Lightning icon controls while running, Play while paused, Clear as the only delete, resume resets the loop budget, limit stops read Paused. The RFC recording it ships in this PR at docs/request-for-change/rfc-goal-popover-pause-play-controls.md.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 2, 2026
While a loop exists the popover offers exactly two icon-only controls in
every state, Pause and Play, each named in aria-label and title. On a
running loop Play saves the pending field edits and fires a nudge now; on
a paused loop Pause is disabled and Play saves the edits, resumes the loop
on a fresh budget and fires -- one request path, nothing to raise first.
A pending edit marks Play with a dot. Clear stays the only way to delete a
goal, as a text action on a paused loop behind its existing confirm.

The loop's state is one plain-English line by the title and independent
of the buttons: the countdown and cycle readout while running, and
"Paused · <why>" otherwise, worded per stopped_reason -- you paused it,
the agent stopped it, the cycle or time limit was reached (resuming
starts a fresh budget), approval is awaited, or the last cycle could not
run. The word Stopped, the Save and Stop buttons, the Nudge-now button
and every bound help line that named a tool or a config key are gone,
with their catalog keys in all twelve locales and the pseudolocale.

Tests are consolidated into table-driven cases per state and press,
keeping every behaviour assertion; coverage of the two components is at
or above the previous head's.
@pepmach
pepmach force-pushed the feat/autonudge-pause-play-controls branch from 35284f5 to 3d6c7e2 Compare October 2, 2026 05:42
@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 3d6c7e2: Clear stopped goal is a text link, not a button; the row holds exactly two buttons. The two-buttons-per-row rule guards against button clutter, which this layout keeps. PR owner's layout decision.

@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 3d6c7e2: Product shape decided by the PR owner: Pause and Lightning icon controls while running, Play while paused, Clear as the only delete, resume resets the loop budget, limit stops read Paused. The RFC recording it ships in this PR at docs/request-for-change/rfc-goal-popover-pause-play-controls.md.

@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override ux 3d6c7e2: Icon-only controls are the PR owner's design choice; the lightning button is named "Nudge now" / "Save edits and nudge now" on hover and for screen readers, and the dot marks unsaved edits. Visible labels are not wanted here.

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 3d6c7e271db212c61c44cb893d33271094ad9835.

Clear stopped goal is a text link, not a button; the row holds exactly two buttons. The two-buttons-per-row rule guards against button clutter, which this layout keeps. PR owner's layout decision.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the ux AI finding as false positive, not applicable, or explicitly accepted for 3d6c7e271db212c61c44cb893d33271094ad9835.

Icon-only controls are the PR owner's design choice; the lightning button is named "Nudge now" / "Save edits and nudge now" on hover and for screen readers, and the dot marks unsaved edits. Visible labels are not wanted here.

This decision applies only to this commit. A new push requires a new judgment.

@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 3d6c7e2: Product shape decided by the PR owner: Pause and Lightning icon controls while running, Play while paused, Clear as the only delete, resume resets the loop budget, limit stops read Paused. The RFC recording it ships in this PR at docs/request-for-change/rfc-goal-popover-pause-play-controls.md.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 3d6c7e271db212c61c44cb893d33271094ad9835.

Product shape decided by the PR owner: Pause and Lightning icon controls while running, Play while paused, Clear as the only delete, resume resets the loop budget, limit stops read Paused. The RFC recording it ships in this PR at docs/request-for-change/rfc-goal-popover-pause-play-controls.md.

This decision applies only to this commit. A new push requires a new judgment.

@pepmach

pepmach commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 3d6c7e2: Clear stopped goal is a text link, not a button; the row holds exactly two buttons. Same ruling as the GPT override on this head. PR owner's layout decision.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@pepmach marked the fable AI finding as false positive, not applicable, or explicitly accepted for 3d6c7e271db212c61c44cb893d33271094ad9835.

Clear stopped goal is a text link, not a button; the row holds exactly two buttons. Same ruling as the GPT override on this head. PR owner's layout decision.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants