Skip to content

feat(autonudge): show a Done state when a goal loop finishes - #16352

Merged
bolichen97 merged 2 commits into
mainfrom
feat/autonudge-done-state
Oct 6, 2026
Merged

bolichen97 merged 2 commits into
mainfrom
feat/autonudge-done-state

Conversation

@pepmach

@pepmach pepmach commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Keep a finished goal loop's record and show it as Done, so a loop that reached its end is not shown as Paused or as no goal at all.

Closes #16488

When the agent creates the stop file, the backend deletes the loop record, so the popover falls back to the empty Set a goal form: the goal text is gone and nothing says it was reached. When a watched pull request merges or closes, the record is kept with a reason the popover does not know, so it shows a bare Paused and offers Play, which would poll a finished pull request. This PR keeps the record in both cases and shows Done with the reason, with Clear as the only action.

Why it matters

A goal loop is the one feature a person leaves running unattended, so its popover has to say how the loop ended: it reached its goal, or its subject is gone. Today it says Paused, or nothing.

Not a goal

What changed (motivation → approach → change)

Piece Before After
Stop file found by the timer loop removed kept, inactive, stopped_reason: stop_sentinel
Reviving a finished loop (stop_sentinel, monitor_terminal) Play / monitor_update / app reconcilers could re-arm it refused unless the operator deleted the stop file; reason kept against a later pause or bound
autonudge_state frame stopped_reason, next_due_ts plus monitor_outcome, monitor_kind on every loop
Goal popover, finished loop empty form, or bare Paused with Play live Done title, info-tone line naming the finish, read-only fields, dead Pause/Play, Clear finished goal

Backend (src/kiro_crew/autonudge_service/). A {{STOP_FILE}} goal's agent reports it reached by the stop file: firing.py deactivates the loop under STOP_SENTINEL_REASON instead of removing it, keeping the removal's other effects: timer retired (the timer task pops its own registration first, so the shielded update cannot cancel it), the WARNING line, no expired (that means stopped short). The stop file stays where the agent wrote it; an inactive loop's timer is never armed, and authorize_and_add_nudge unlinks the per-slot path before the next loop exists, so a goal set after Clear survives its first tick. model.py names the finished reasons (FINISHED_LOOP_REASONS), stop_sentinel displaceable by a new arm like monitor_terminal; src/kiro_crew/autonudge.py re-exports both. mutations.py declines update(active=True) on a finished row, whoever asks (a bare declined revival writes and emits nothing), keeping a finished reason under a later reasonless pause or bound (_KEPT_STOP_REASONS). One exception: Issue Radar and Research Lab arm the stop file as an operator's kill switch, so a stop_sentinel row whose file is gone is revivable and their reconciler re-arms it; the popover never deletes it. dashboard/session_directive_apply.py names the stop-file finish in monitor_update's refusal; dashboard/chat_runner.py's /goal status reads a kept record's state, not its presence. The frame builder in slack/gateway.py adds monitor_outcome and monitor_kind (the watch's settled outcome and the class of subject; the kind redacted as the structured record is): the frame withholds the gated loop's monitor record and the popover needs the two to tell merged from closed, pull request from work ledger. Its observer logs a finished loop's updated frame as a patrol stop. docs/system-specs/modules/learn-cron-dashboard.md, babysit-pr-watch.md carry it.

Frontend (website/src/). components/AutoNudgePopover.tsx renders Done for an inactive loop under a finished reason: title Done; an info-tone box reading Done · the agent created the stop file, Done · the watched pull request merged or Done · the watched pull request was closed without merging (check glyph before the first two); another finished watch (a work ledger) reads Done · the watched subject finished with the glyph or Done · the watched subject ended without finishing without — two sentences, as a screen reader hears no glyph. The text is the info hue (text-info), like every info wash; --info-fg is black in dark themes. Fields stay visible, disabled, dimmed; Clear finished goal left (the existing confirm), Pause and Play right, both disabled, Paused glyphs. components/autoNudgeLoop.ts types the two fields and owns loopFinished; monitoring/automation.ts carries them and reads a GATED REST row (nested monitor record, no scalars) as the goal loop it is, outcome and kind off that record — read as a bounded monitor it was dropped from the cold seed, so a finished goal reloaded as none; components/SessionAutomationPopover.tsx forwards them. website/src/i18n/locales/ gain seven popover keys per locale; pseudolocale regenerated. (The Crew Members drawer's patrol block this PR also worded was removed on main by #16317, so that part is gone from this PR.) The RFC docs/request-for-change/rfc-goal-popover-pause-play-controls.md (#16030's record, in progress) records Done.

Backwards compatibility

Compatible: no route, field or key the wire accepts today is rejected, renamed or removed. The frame gains two additive fields. A loop stopped by its stop file now leaves a record where it left none; the record is cleared by the same DELETE every paused goal uses, a directive re-arm may displace it exactly as it displaces a merged watch, and an Issue Radar crew or Research Lab campaign whose operator deletes the stop file is re-armed by its reconciler as before (crew_runtime.py, watchdog.py).

One acceptance is taken away: update(active=True) on a stop_sentinel or monitor_terminal row used to revive it and is now refused (while a stop file stands; a finished watch always). The readers that send it outside this patch:

Reader: src/kiro_crew/apps/builtins/issue_radar/backend/crew_runtime.py:launch_crew -- app -- a refused revival writes and emits nothing; once the operator deletes STOP the same call re-arms (test_a_stop_file_finish_is_revived_only_once_the_file_is_gone, test_a_crew_with_no_loop_and_no_dismissal_IS_re_armed)
Reader: src/kiro_crew/apps/builtins/auto_research/campaign/watchdog.py -- app -- same re-arm path and same answer; a campaign's exhausted loop already stayed inactive (test_exhausted_terminal_loop_removal_stays_inactive_after_restart)
Reader: src/kiro_crew/apps/builtins/spec_builder/backend/orchestration/execution_state.py:_exec_loop_active_for_slot -- app -- reads `active` only; a kept finished row reads inactive exactly as a paused one does
Reader: src/kiro_crew/dashboard/session_directive_apply.py:monitor_update -- chat -- already refused a `monitor_terminal` row; the stop-file finish now gets the same refusal, worded (test_monitor_directive_apply)

The stop-file path keeps a row it used to delete. The stop file is the finish of a goal whose text carries {{STOP_FILE}} (the apps' patrols, /goal, a custom goal); the popover's default goal text has the agent call autonudge_stop, and that call still removes the row and shows no Done (the first Not-a-goal bullet). Two readers of that row's absence are updated to read its state instead: the /goal status reply in dashboard/chat_runner.py (a kept, inactive record is reported as finished or stopped, with /goal clear as the way out, not as an active goal) and the frame's observer in slack/gateway.py; the WARNING stop line still fires with the same reason.

Tests

  • test/test_autonudge.py: the stop file keeps the record finished with the timer gone, the stop line, the file left in place, updated and no expired; a finished loop (both reasons) is not revived by update(active=True, fresh_run=True), a bare revival writes nothing and emits nothing while one carrying a field change still applies it, the reason survives a reasonless pause and a bound, and a stop-file finish is re-armed once its file is deleted while a finished watch never is; a finished row is displaced by a directive re-arm and refused by a create-only add; the re-homed sentinel test pins the kept record.
  • test/test_autonudge_authz_cov80.py: end to end, a goal finished by its stop file, cleared, then a new goal on the same slot is not ended by the stale file.
  • test/test_autonudge_manual_fire.py: a manual trigger still honours the stop file and the finished loop refuses a further fire.
  • test/test_monitor_directive_apply.py: monitor_update on a stop-file finish is refused with the finished wording and applies nothing.
  • test/test_slack_gateway_coverage.py: the frame carries monitor_outcome and monitor_kind on every loop, settled for a finished gated watch, with the monitor record still withheld; a member patrol finished by its stop file is logged as a patrol stop and a plain pause is not.
  • website/src/test/AutoNudgePopover.test.tsx: the Done renderings for the stop file, a merged and a closed pull request, and an accepted and a rejected work ledger (title, info box, check mark only on a finish that went well, read-only dimmed fields with values kept, Clear finished goal, dead Pause and Play with the Paused glyphs), dead controls send nothing, the confirm opens from the link with the Done line kept, and a finished code on a still-active loop is not Done.
  • website/src/test/automationNormalizer.test.ts: the legacy record carries monitorOutcome and monitorKind.
  • .github/coverage-baselines/backend.txt: one entry removed, src/kiro_crew/apps/hooks_integration.py, because the Coverage Gate measured it above its graduation band on this PR's run (82.3% against the 80% floor plus a 2pp band; 81.4% on main's own run at the same base) and refuses until the baseline shrinks; refreshed with the gate's own --update-baseline from that run's artifact, which only deletes entries.
  • Coverage of the touched frontend files, before → after (statements / branches / functions / lines): AutoNudgePopover.tsx 95.81 / 91.97 / 92.30 / 98.11 → 95.87 / 92.64 / 92.30 / 98.14; autoNudgeLoop.ts 97.14 / 97.61 / 85.71 / 96.55 → 97.29 / 97.87 / 87.50 / 96.77; SessionAutomationPopover.tsx and monitoring/automation.ts unchanged (93.61 / 91.13 / 98.07 / 96.51 and 91.37 / 92.34 / 95.83 / 96.00).

Manual verification

Gates on this head: black ratchet, subprocess encoding, isort, flake8, mypy, scripts/docs-lint.sh, scripts/local-gate.py (backend related set 28,543 passed; two failures reproduce identically on a pristine origin/main worktree and are the host's sandbox class: test_store_ancestor_chain.py symlink refusal and test_auto_improvement_members.py treating the scratch TMPDIR as managed state), npm run build, tsc, eslint, npm run i18n:check with I18N_BASE_REF set (19 checks pass), the touched vitest files. The i18n:render browser gate, the bundle-size analyze build and the Electron suite were not run locally. No local review lane ran; the server lanes are the first model read.

The before frames and the running frame are a real pod of origin/main and of this worktree driven by Playwright: a loop armed through POST /api/autonudge, its stop file written, the 15 s tick observed, then the popover photographed (the kept record and its Done rendering were first observed there). The after frames are the built SPA behind the repository's gateway-free API stub (the harness #16030 used), fed the rows exactly as GET /api/autonudge/slot and the loop list return them (a gated loop's nested monitor record, no frame scalars — the cold read a reload makes) — the stub because a loop armed through the REST route carries no provider credential, so a pod's probe cannot read GitHub, and because the frames were re-taken after the status text took the info hue. Every frame passed its DOM assertions (title, status line, glyph, disabled controls and fields, link text) before being used here.

Screenshots / video

Before (origin/main): the stop file empties the form; a merged watch reads a bare Paused with Play offered.

Before, after the agent created the stop file: the empty Set a goal form, the goal text gone

Before, the watched pull request merged: title Paused, the bare Paused line in the warn tone, Play offered

After (this head): Done.

After, the agent created the stop file: title Done, the info box with a check mark reading Done · the agent created the stop file, the fields read-only and dimmed with their values, Clear finished goal at the left, Pause and Play disabled

After, the watched pull request merged: Done · the watched pull request merged with the check mark

After, the watched pull request was closed without merging: Done · the watched pull request was closed without merging, no check mark

After, Clear finished goal pressed: the Remove this goal for good? confirm with Clear and Cancel, the Done line kept above it

A finished watch whose subject is not a pull request (a conductor's work ledger).

After, an accepted work ledger: Done · the watched subject finished, with the check mark

After, a rejected work ledger: Done · the watched subject ended without finishing, no check mark

The running state the stop-file frames started from

After, running: Goal active (cycle 0), the countdown in the ok tone, before the stop file was written

Related Issues

no linked issue: the follow-up #16030 deferred in its "Not a goal" section, 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 3, 2026 01:42
@pepmach
pepmach requested a review from a team as a code owner October 3, 2026 01:42
@pepmach
pepmach requested a review from cruisercohen October 3, 2026 01:42
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 3, 2026
@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Disposition of the local GPT review lane's one advisory (AutoNudgePopover.tsx, the Done wording), run on this diff before the PR opened:

  • "the agent created the stop file" may misattribute a person's stop file — REBUTTED, wording kept. The stop file is the loop's own completion signal: the default goal instruction tells the agent to create it when the goal is met, and the help line under the goal text says what the token becomes. A person who wants to end a loop uses Pause or Clear, which the popover offers; writing the stop file by hand is not a path the surface describes. The line is the product owner's approved mock text, so it stands.
  • monitor_terminal is not only pull requests — TAKEN. A conductor's work-ledger watch (watch: "work-ledger") reaches the same reason when its board closes (probes.terminal_succeeded, key all-accepted). The frame now also carries monitor_kind, and a finished watch whose kind is not a pull or merge request reads Done · the watched subject finished (check mark when it finished well); pull and merge requests keep the merged / closed wording. Pinned by the two work-ledger cases in AutoNudgePopover.test.tsx and the frame test in test_slack_gateway_coverage.py. No screenshot changes: the pull-request frames are unchanged and the work-ledger line differs only in its text.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

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

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 01ea90ea5b3a31f19df4111a7536d89353d39882 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 01ea90e

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

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

Successful and failed endings both say "Done" in the same blue, so a pull request closed without merging reads as a success.

Watch

  • Failed endings look like successes. done_pr_closed and done_subject_ended get the same bg-info-subtle text-info box and the same "Done ·" opening as a merge, and only a missing 12px check tells them apart. The blind reader said of shot-05: "It's the same blue as a success, and only the missing tick tells them apart. I'd easily mistake it for success." Of shot-08 they said "'Done' plus 'without finishing' contradict each other." This matters because the PR exists to say how an unattended loop ended, and it misleads on every non-success finish. Fix: use a different title and status opening for these two (for example "Ended") and a neutral tone, and keep "Done" plus the check for the three success finishes.
  • The reasons use words a new user doesn't know. For "Done · the agent created the stop file" (shot-03) the reader said "I don't know what a 'stop file' is." For "the watched subject finished" (shot-07) they said "'Watched subject' is vague." This hits every stop-file finish and every ledger finish, but only as friction, because the reader still got "finished". Fix: name what happened from the user's side, e.g. "Done · the agent reported the goal reached".
  • Play still looks live on Done. The disabled Play stays a filled purple button (shot-05), and the reader had "no idea whether play would run it again". Fix: render it as an obviously disabled button on Done, or hide Pause and Play there, since Clear is the only action.

Suggestions

  • On the Done state, swap the "Set a goal for the agent…" help paragraph for one line saying the goal ended and that clearing it lets you set a new one. The reader called the current text "leftover help text" (shots 03–08).

[UX-REVIEWED] 01ea90e

Description read

[DESCRIPTION-READ] f2457ebbee394dd46a9d71bebb115d94bb4d5c5687b923958187aa8e57507454

That sha256 names everything this verdict read: the PR description, plus the 12 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 3, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

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

Design-Verdict: CONCERNS

Goals set from the popover itself still show no goal when they finish, because the default goal text ends through autonudge_stop, which still deletes the row.

Watch

  • The most common way a goal ends is left out. The Goal line says a finished loop should not show "as no goal at all". But the description says "the popover's default goal text has the agent call autonudge_stop, and that call still removes the row and shows no Done". So the new Done state only appears for {{STOP_FILE}} goals (app patrols, /goal, custom text). Someone who sets a goal with the popover's pre-filled text still gets the empty form when the goal is reached. That is the harm issue Goal popover: show a Done state when a goal loop finishes (stop file or finished watch), instead of the empty form or a bare Paused #16488 describes. Not-a-goal rules out changing the stop call, but it does not rule out showing Done for that ending. One fix: when a non-research autonudge_stop finishes the loop, deactivate it under a finished reason instead of removing it. Another: make the default goal text use {{STOP_FILE}}.
    Clears when: the popover's default goal shows Done when it finishes, or the PR records why this half is deferred to a named follow-up issue.

Suggestions

  • autonudge_stop and the stop file both mean "goal reached" but now leave different records. Keeping both rows under FINISHED_LOOP_REASONS would give one Done path, so the popover would not need to check which way the agent reported success.

[DESIGN-REVIEWED] 01ea90e

Description read

[DESCRIPTION-READ] ba0fccc225392abb0bb0f5848a12aaf726749e42a05cea106fa5fe9ad170d989

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 added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 3, 2026
@pepmach
pepmach force-pushed the feat/autonudge-done-state branch from 173ba06 to e86261c Compare October 3, 2026 01:59
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 01ea90ea5b3a31f19df4111a7536d89353d39882 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 01ea90e

Verdict parsed from the review's SHA-scoped output markers for commit 01ea90ea5b3a31f19df4111a7536d89353d39882.

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

@pepmach
pepmach force-pushed the feat/autonudge-done-state branch from e86261c to 611bd44 Compare October 3, 2026 02:42
@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 611bd44: product owner decision (pepmach, 2026-10-02), recorded on this PR's thread and in the RFC this PR carries: the Done state is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear finished goal as the only action). The base RFC lists Done as a deferred decision, not a rejected one, and this PR records that decision in the same in-progress RFC, as #16030 did for its own shape; merging the RFC first was ruled unnecessary for this follow-up.

@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Disposition of the UX Review (Fable 5) verdict on 173ba066fa, re-read against the current head:

  • Evidence gap, Done · the watched subject finished — CLOSED. Two frames added to the description: an accepted work ledger (check mark) and a rejected one (none), the built SPA behind the repository's API stub, each asserted in the DOM before capture.
  • Evidence gap, the Crew Members patrol lines — CLOSED. Two drawer frames added: Patrol stopped. Finished · the agent created the stop file. and … Finished · the watched pull request merged or closed., same harness, asserted the same way.
  • Watch: reword "the agent created the stop file" — REBUTTED, owner ruling. The line is the product owner's approved mock text. The stop file is the loop's own completion signal (the default goal instruction tells the agent to create it when the goal is met, and the help line under the goal text explains the token); the agent's own report of the goal reached is what the popover relays.
  • Watch: add "To run again, clear this goal and set a new one." to the Done box — REBUTTED, owner ruling. The approved Done box carries one line, and the frozen goal of this PR names Clear as the only action. Clear finished goal is the one live control on the row, in the place Clear stopped goal already occupies on a paused loop; a reader who used the Paused state finds the same exit here.
  • Suggestion: an explicit read-only cue beside the dimming — DEFERRED. The fields are disabled and dimmed as the approved mock draws them; a separate cue is a design change for the owner to call.
  • Suggestion: word "Last fire: never" on a finished loop — DEFERRED. The schedule line is shared by every loop state and unchanged by this PR.

@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Disposition of the Design Review (Fable 5) CONCERNS on 173ba066fa (the stop file as an operator kill switch for Issue Radar and Research Lab) — TAKEN, as the lane proposed.

A stop_sentinel row is revivable once its stop file no longer exists: _stop_file_lifted in autonudge_service/mutations.py consults the row's own stop_sentinel_path, so an operator who deletes a crew's or campaign's STOP file gets the loop re-armed on the reconciler's next update(active=True) (crew_runtime.py, watchdog.py), as before this PR. While the file stands the revival is refused and the row reads Done; a finished watch (monitor_terminal) has no file to lift and stays finished; a row whose path was dropped at load stays finished too. The goal popover never deletes the file (the next arm on the slot does, after Clear), so a goal's Done keeps its shape and its Play stays disabled for every Done row. Pinned by test_a_stop_file_finish_is_revived_only_once_the_file_is_gone; the spec and the RFC carry the rule.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

AI-review override not recorded: keep the reason to 500 characters or fewer.

@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 3, 2026
@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 611bd44: product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

@github-actions

github-actions Bot commented Oct 3, 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 611bd4429f8952618462691217938a498df73e7f.

product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

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

@pepmach

pepmach commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition of the UX Review (Fable 5) CONCERNS on 611bd4429f (advisory) — both Watch items DECIDED by the conductor running this PR under the owner's hands-off rule, and folded in on the head that follows:

  • Watch: success and failure finishes of a non-pull-request watch shared one sentence — FIXED. A finished watch whose subject is not a pull or merge request now reads Done · the watched subject finished (with the check glyph) when it finished well and Done · the watched subject ended without finishing (no glyph) otherwise, since a screen reader hears the sentence and not the glyph. New key done_subject_ended in every locale; the rejected work-ledger frame in the description is re-taken.
  • Watch: the Crew Members patrol block said Finished · … where the popover says Done — FIXED. The two patrol reason lines are this PR's, so they now open with Done · … (the locale's same word as the popover's title) in every locale; the two drawer frames are re-taken. The block's header Patrol stopped. is the existing one every stopped reason shares and is unchanged.
  • Suggestions (done_stop_file wording; a run-again pointer on the Done surface) — dispositioned above (feat(autonudge): show a Done state when a goal loop finishes #16352 (comment)): both restate the owner's approved mock text and single-action Done row.

@pepmach
pepmach force-pushed the feat/autonudge-done-state branch from 611bd44 to dda90a7 Compare October 3, 2026 03:42
@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles dda90a7: product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

@pepmach

pepmach commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Disposition of the Opus 5 Review advisory on 611bd4429f (the Done box painted --info-fg, black in the dark themes, over a 12% info wash) — CONFIRMED and FIXED.

Measured in the built SPA under the stub harness: computed color: rgb(0, 0, 0) on the status box in kiro-dark, and the frame's text pixels were black over rgb(42, 44, 59). The finished arm of the status box now uses text-info, the hue itself, as the other eight bg-info-subtle washes in the app do; the popover test pins the class, and every Done frame in the description is re-taken from the fixed build (text pixels now the info hue, none black).

@pepmach

pepmach commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 1aafa69: product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

@pepmach

pepmach commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main (c6bfd72dba) after the PR went CONFLICTING. The conflict came from #15495 (fix(autonudge): stand a self-wake loop down after five consecutive failed cycles), which added CONSECUTIVE_FAILURE_REASON beside this PR's STOP_SENTINEL_REASON / FINISHED_LOOP_REASONS in the import lists of src/kiro_crew/slack/gateway.py and test/test_monitor_directive_apply.py, a new elif arm next to this PR's stop-file arm in the monitor_update denial path of src/kiro_crew/dashboard/session_directive_apply.py, and one test at the same anchor as this PR's in test/test_monitor_directive_apply.py — all kept as unions (main's arm and test first, this PR's after). #15682 edited the AutoNudge paragraph of docs/system-specs/modules/learn-cron-dashboard.md (the busy predicate is now slot.running) and shortened a test signature in test/test_goal_command.py; both edits applied to this PR's versions. autonudge.py, firing.py, model.py and mutations.py auto-merged: #15495's consecutive-failure bound and #16802's earlier persistence-refusal check sit beside the kept Done record unchanged.

No code change: the sorted +/- content lines of the pre- and post-rebase diffs differ only by main's own slot.running edit and the import list's multi-line form. Backend related suites 1,197 passed (including main's new test_autonudge_cycle_failures.py); frontend 253; isort / black ratchet / flake8 / mypy / i18n / tsc / docs lint / comment-history / body check green. The full local gate's 59 other reds reproduce identically on a pristine main clone at c6bfd72dba (host-specific) and one test_cli_doctor.py census test passes alone (order-dependent); none touches a file this PR changes. Still two commits; description unchanged; the popover diff is identical, so the nine frames stand.

@github-actions

github-actions Bot commented Oct 5, 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 1aafa6999091dbba444fdcb58c12447d3fdbbbfa.

product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

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 readiness: passed Eligible automated validation passed for the current revision labels Oct 5, 2026
The stop file at stop_sentinel_path is how the agent declares a goal
reached, and the timer answered it by removing the loop, so the goal
popover fell back to its empty form with nothing saying the goal was
met. The timer now deactivates the loop under a new reason,
stop_sentinel, and keeps the record. Every other effect of the removal
stays: the timer is retired, the WARNING stop line names the reason, no
expired event is emitted, and the stop file is left where the agent
wrote it (the arm path unlinks it before the next loop on the slot).

stop_sentinel and monitor_terminal are the two finished reasons, and
Done is a dead end: update(active=True) on a finished row is declined
whoever asks (the popover's Play, monitor_update, the Research Lab and
Issue Radar reconcilers), a reasonless pause or a bound landing on it
keeps the finished reason, and the ways on are the person's Clear or a
new arm, which may displace the row as it displaces a merged watch.
monitor_update's paused-loop denial names the stop-file finish and
points at a new goal.

The autonudge_state frame carries monitor_outcome for every loop: the
settled outcome of the loop's own watch, so the popover can tell a
merged pull request from one closed without merging while the frame
keeps withholding the monitor record itself.
A loop whose goal is reached is finished, not paused, and the goal
popover now says so. When the record is inactive under stop_sentinel
or monitor_terminal the title reads Done and the status line, boxed in
the info tone, reads one of three lines: the agent created the stop
file, the watched pull request merged, or the watched pull request was
closed without merging. A check-mark glyph precedes the first two; the
third ended on a question, so it carries none. Merged versus closed is
read off the settled monitor_outcome the frame carries, never prose.

The goal text and the two number fields stay visible, read-only and
dimmed. The footer keeps its shape: Clear finished goal as the text
link at the left, Pause and Play at the right, both disabled, with the
Paused-state glyphs. Clear opens the existing confirm. Done is a dead
end: no Play and no edits, because the service refuses to revive a
finished loop; to run again the person clears the goal and sets a new
one. The Crew Members patrol block words the two finished codes
instead of printing the raw code.

Catalogs gain the five popover keys and the two patrol keys in every
locale, with the pseudolocale regenerated; the RFC records the state.
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 5, 2026
@pepmach
pepmach force-pushed the feat/autonudge-done-state branch from 1aafa69 to 01ea90e Compare October 5, 2026 21:41
@pepmach

pepmach commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 01ea90e: product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

@pepmach

pepmach commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

CI on 1aafa69990 ended with two reds, neither in this PR's code:

  • Backend Tests (namespace sandbox) — cancelled by GitHub before a runner was assigned (no runner name, zero steps, no log; waited 19:44–20:00 UTC). Eight sibling PR runs created 19:33–19:50 show the same zero-step cancellation while the job passed in about two minutes wherever a runner was acquired, including main's run at this base. Infra, no code action.
  • Coverage Gate — src/kiro_crew/apps/hooks_integration.py, a baselined file this PR does not touch, measured 82.3% (261/317) and crossed the graduation band (80% floor + 2pp), so the gate requires its baseline entry removed. On main's own run at the same base (c6bfd72dba) the file measured 81.4% (258/317), inside the band; the three extra lines hit here are a CronStoreBusy except branch, an audit-log call behind a bounded startup-hook wait, and a route deregistration behind module state — xdist shard noise, not anything this PR exercises. Applied the gate's own remedy with this run's artifact (--update-baseline, which only deletes entries): one line removed from .github/coverage-baselines/backend.txt, folded into the backend commit, named in the description's Tests section.

Head 01ea90ea5b carries that one-line change and nothing else (git diff 1aafa69990 01ea90ea5b is the single deletion). The push re-runs the cancelled shard with everything else, so no separate --failed rerun of run 37365139530 is needed.

@github-actions

github-actions Bot commented Oct 5, 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 01ea90ea5b3a31f19df4111a7536d89353d39882.

product owner decision (pepmach, 2026-10-02), on this PR's thread and in the RFC it carries: Done is the follow-up #16030 deferred by design, specified by the owner's approved mock (kept record, Done title and line, read-only fields, dead Pause and Play, Clear as the only action). The base RFC lists Done as deferred, not rejected; this PR records the decision in the same in-progress RFC, as #16030 did for its own shape. Merging the RFC first was ruled unnecessary.

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

@pepmach

pepmach commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

CI on 01ea90ea5b: one red, Backend Tests (Windows) (2), on a single test in a file this PR does not touch — test/test_slot_ownership_checkpoint.py::TestTranscriptOwnershipWithoutALiveSlot::test_no_key_or_the_bare_name_means_the_slots_own_transcript[no-key], which got the late resume barrier's resume_conflict 409 instead of a 200. The sibling [bare-key] case passed in the same shard, the Linux and macOS shards passed the same test on this head, and main's run at this base passed the shard; the code path is dashboard/chat_api/resume.py, outside this diff. Filed as #17155 in the flake pattern. Only that job will be re-run once the run completes (a job cannot be re-run while its run is in progress), in the next push window.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 5, 2026
@pepmach

pepmach commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

All green on 01ea90ea5b: 90 checks pass, 0 fail, PR Readiness success (23:02 UTC). The one red of this round, Backend Tests (Windows) (2), was the #17155 resume-barrier race in an untouched file; its re-run passed on the same code. MERGEABLE on origin/main c6bfd72dba (14 commits behind the current tip; a dry merge against it is clean), two commits, description unchanged apart from the baseline sentence noted above.

@iamwhatever

Copy link
Copy Markdown
Contributor

Reviewed, not approving (crew-pr-reviewer). This is a new UI and state feature (+874/-60). Large features need a maintainer's review rather than an approval from this sweep.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed on behalf of the maintainers (sweep 2026-10-06): full diff read, callers verified against current main, readiness passed, required checks green, no blocking review threads. Maintainer review of the new Done state: a stop-file finish keeps an inactive stop_sentinel row instead of deleting it, the popover shows Done with a Clear link, and reconcilers can no longer re-launch a crew the operator stopped. Create-only POST on a finished slot answers 409 only from a stale client. Approving and merging.

@bolichen97
bolichen97 merged commit d4a3e2f into main Oct 6, 2026
147 of 152 checks passed
@bolichen97
bolichen97 deleted the feat/autonudge-done-state branch October 6, 2026 07:26
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 6, 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.

Goal popover: show a Done state when a goal loop finishes (stop file or finished watch), instead of the empty form or a bare Paused

3 participants