Skip to content

feat: add autonomous goal suggestions - #12829

Open
rubencu wants to merge 1 commit into
kirodotdev:mainfrom
rubencu:feat/goal-suggestion-actions
Open

rubencu wants to merge 1 commit into
kirodotdev:mainfrom
rubencu:feat/goal-suggestion-actions

Conversation

@rubencu

@rubencu rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let an agent offer a clearly labeled multi-turn goal that the user reviews in the existing goal editor before autonomous work starts.

Agents can suggest one-turn replies, but users must copy a longer objective into Set a goal and infer that it continues across turns.

Why it matters

The choice between one reply and autonomous work should be explicit before work starts. A goal card lets the user review the objective, cadence, and cycle cap instead of accepting an ambiguous suggestion.

Not a goal

  • Start autonomous work directly from assistant output.
  • Add goal-start controls to ChatEmbed, Side Chat, or other hosts without the existing review flow.
  • Change messaging-channel action protocols.

What changed (motivation → approach → change)

A standalone [GOAL: objective] line in an assistant reply is a typed suggestion, not a command to start work. The dashboard critical rules of any slot full chat can open teach it: offer at most one goal, only for multi-turn work, on its own line before any final [OPTIONS:] line. One slot can be open in full chat, a split pane and the companion chat at once, and the server cannot tell which host shows it, so the rule says so directly: full chat and the companion chat (an embedded full chat) show an Autonomous goal card, and split panes offer the same objective as an ordinary one-turn reply. Crew, member, and App Kit slots, Side Chat, cron, sub-agents, and every messaging runtime keep a rules block that never mentions the marker.

Full chat shows the objective in an Autonomous goal card. Review & start stores it in the existing Set-a-goal draft and opens that editor. A goal or monitor in the session, running, paused or stopped, or a crew or member session, disables the card. The status line says which: a goal or monitor waiting on the reply options reads as active and waiting on the reply, as the goal panel's "Goal active" does, and the copy names the goal panel rather than the button. When the session's active goal is the suggested objective, the card confirms "Started. Running in this session." instead of asking the user to stop it. Each blocked or started state offers Open goal, a labeled button that opens the composer's goal control, so the user never has to find the icon in the toolbar. That status line is the accessible description of both buttons. If the browser refuses to store the objective, the error notice says so, Review & start turns off, and Open goal becomes the primary action. The objective stays visible in the card to select and paste.

The bounded parser removes complete marker lines without backtracking, including CRLF-terminated lines. Split panes, Side Chat, ChatEmbed, and composers without goal review offer the objective as an ordinary editable reply. Goal lines are removed inside strip_control_comments, the projection boundary previews, text-to-speech, channel renderers, channel egress and both mirror backfills already call. Slot projections and the Slack options extractor, which do not call it, strip them too. Callers that measure a tail offset or ask whether a tag ended the reply use strip_trailing_control_tags, the unchanged tail-only grammar. Marker-free output is returned unchanged.

Scope Purpose
context.py and its context_assembly/ owners output_contract.py, session_start.py and turn_message.py Teach the marker to slots full chat can open, and name the pane fallback in the rule.
constants.py, dashboard/state_parts/slot_transcript.py, slack/format.py, slack/handler.py, slack/handler_runtime/stream.py, messaging/egress.py Strip complete goal markers at the shared projection boundary and keep tail-offset callers on the tail grammar.
app-sdk/protocol/, ChatEmbed.tsx, SideChat.tsx, AssistantMessage.tsx Parse markers, hide streaming tails, and keep objectives on thin hosts.
ChatInput.tsx, chat-input/props.ts and suggestedGoal.ts, ChatPane.tsx, FollowUpBar.tsx, ChatPage.tsx, ComposerDockView.tsx, followUpChips.ts, chat/crewmateChips.ts Render the card, enter goal review, say whether the session's automation is running, active and waiting, or stopped, confirm a goal it just started, open the goal control, and turn Review & start off after a storage failure.
goalDrafts.ts Report whether the objective reached browser storage.
feature-map/README.md, website/src/i18n/locales/, website/src/test/, test/ Document the feature, localize its copy, and lock its producer, protocol, and surface behavior.

Backwards compatibility

Compatible: replies without a standalone [GOAL: ...] line keep existing follow-up behavior, and unsupported hosts keep the objective as an editable reply. Only dashboard sessions full chat can open receive the new rule text. Other runtimes receive byte-identical critical rules.

Removes nothing that has shipped.

Tests

  • New goalSuggestion vitest and test_preview_text.py scanner tests fail on the previous head and pass here: [GOAL: Fix dict[str, Any] parsing] and [GOAL: check arr[0] until it is set] yield the full objective and are stripped from projections, while [GOAL: a] b] and a closer followed by text stay prose; while such a line streams, its marker stays hidden until its own closer. ChatInput.goalSuggestion tests pin the card's started/blocked states, and searchableText tests keep goal lines out of message search. On this revision 3,180 scoped backend tests and 99 PR-scoped vitest tests (888 with the ChatEmbed suites) passed.
  • Focused backend tests passed across marker boundaries, context composition, preview, voice, egress, Slack, and determinism.
  • Frontend tests touching the composer, follow-up bar, goal drafts, marker protocol, ChatEmbed, Side Chat, ChatPane, and composer dock passed, as did the locale/i18n tests.
  • TypeScript, ESLint, jscpd, i18n checks, Semgrep, Black, isort, Flake8, mypy, feature-map, comment-history, brand, harness-parity, file-line-cap, and portability passed.

Manual verification

Images 01 and 02 come from the real built SPA with fixture APIs; the sidebar preview there is the backend _ChatSlot.to_dict() projection of a reply that carries the marker, and every capture asserted that no [GOAL: text node is visible. Images 03 to 10 were rendered from the real composer, card and goal panel components with synthetic data, so they show the transcript and composer without the sidebars; each capture checked the status text, card state and buttons first. The split-pane and Side Chat reply fallback is covered by the ChatPane and protocol tests.

No first-time reader has looked at the card cold yet. The evidence is committed because a read-only fork PR cannot use gh pr edit --attach.

Screenshots / video

State Desktop Mobile
Review & start opens the editor Desktop review Mobile review
Card and reply pills Desktop card Mobile card
Goal active, waiting on the reply Desktop waiting Mobile waiting
Goal running Desktop running Mobile running
Monitor running Desktop monitor Mobile monitor
Stopped record Desktop stopped Mobile stopped
Open goal Desktop open Mobile open
Storage failure Desktop failure Mobile failure
Crew or member session Desktop crew Mobile crew
Started from the card Desktop started Mobile started

Related Issues

Closes #12835

Checklist

  • At most two commits, with a Conventional Commits title
  • Existing tests pass and new tests cover the feature
  • Self-review completed and code follows project style guidelines
  • Documentation updated
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the repository's Apache 2.0 license.

@rubencu
rubencu requested review from a team and hoang-phan98 September 22, 2026 14:36
@rubencu

rubencu commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Intent: Let dashboard agents offer an explicit multi-turn objective as a distinct autonomous goal card, then open the existing Set-a-goal review flow with that objective prefilled. Keep ordinary suggested replies separate.
Not a goal: Replace or redesign the existing goal editor, start autonomy without review, or teach messaging channels to emit the dashboard-only marker.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of d2d886ca24ef426d9b057ea62ede6319184c2b18 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level blocker: the producer is gated to slots full chat can open, nothing runs without review, and the callers that measure offsets were moved to the tail-only grammar.

Notes

  • strip_goal_marker_lines has no fence-parity guard, unlike the tail grammar. A reply that quotes a standalone [GOAL: …] line inside a code block therefore loses that line from previews, TTS and channel egress, and the frontend reads it as a card. Skipping fenced lines in both scanners would close this.
  • In discord/renderer.py, the canonical_body != canonical check now also comes out true when the reply has a goal line. It does no harm today, but that check now means "any protocol was found", not "a tail tag was found".

[DESIGN-REVIEWED] d2d886c

Description read

[DESCRIPTION-READ] 16ed0546ee57aa39efb95e2782d499641957896fdfb15a44be420a7d7407d1f6

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 Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of eeafe0d9d073d6a6748768df2ebbd1ffd7b06931 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks: screenshots cover every card state (ready, review editor, goal active/running, monitor, stopped, storage failure, crew/member, started). No first-time reader has read the card cold; a same-repo branch run would add that.

Notes

  • In the started state (goal_started, image 10), Review & start stays on the card, greyed out, though it can't do anything there. Hide it when started so Open goal is the only action.
  • Review & start shows the same disabled look whether it's blocked by an automation, by a crew session, or already started. Only the status line tells these apart, so keep that line at full contrast (the amber text-warn copy in image 09 is faint and long).

[UX-REVIEWED] eeafe0d

Description read

[DESCRIPTION-READ] 8e48fa88cedc5b970218a441286a08038ba5bcd01b5043eddf39f2c4d9a32b11

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed eeafe0d9d073d6a6748768df2ebbd1ffd7b06931 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] eeafe0d

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of eeafe0d9d073d6a6748768df2ebbd1ffd7b06931 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The one open question is whether a rule that is on by default in every dashboard session counts as a product-shape change. That takes judgement, and nothing runs until the user reviews and starts the goal.

Notes

  • Item 1 — product-shape, decision not recorded: _critical_rules_for now returns _CRITICAL_RULES_GOAL for every dashboard slot that is not crew, member or App Kit, with no opt-out. That changes what the default agent can output for nearly every user. No RFC on the base list covers goal suggestions: rfc-crewmate-goals (accepted) and the goal-loop RFCs (implemented) are about other shapes. I kept this as a note because the old reply pills stay the default and "nothing runs until the user reviews the objective in the goal editor" holds in reviewSuggestedGoal. Subtraction: none (gating the rule would add a knob).

What this change ships

Inventory (10 items) — 9 justified

Intent: let the agent offer a labeled multi-turn goal that the user reviews in the existing goal editor before it starts — ADDITION.

  1. Dashboard agents (not crew, member or App Kit slots) are now told they may emit a [GOAL: …] line — product-shape, no recorded decision (see Notes)
  2. Full chat shows an Autonomous goal card; Review & start fills in the Set-a-goal editor and opens it — justified
  3. The card is disabled with a status line when a goal or monitor exists, or in a crew or member session — justified
  4. The card confirms "Started" when the active goal is the suggested objective — justified
  5. An Open goal button appears in the blocked, started and save-failed states — justified
  6. saveGoalDraft reports storage failure; Review & start turns off when it fails — justified
  7. Split panes, Side Chat and ChatEmbed show the objective as an ordinary reply pill — justified
  8. Goal lines are removed from previews, TTS, channels, egress, mirrors, slot projections, the Slack options extractor and message search — justified
  9. New public strip_trailing_control_tags keeps the four callers that measure a tail offset on the tail-only grammar (counted: constants.py×2, stream.py, handler.py) — justified
  10. 20 PNGs committed under temp-screenshots/pr12829/ (the evidence path pr-committed-evidence.sh allows for fork PRs) — justified

[FIRST-PRINCIPLES-REVIEWED] eeafe0d

Description read

[DESCRIPTION-READ] 72e0d3418cfabbcc4f1b5b66d1130cfa3b4eb9dcbf313dbfb18f6fff0d05a067

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed eeafe0d9d073d6a6748768df2ebbd1ffd7b06931 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] eeafe0d

@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 Sep 22, 2026
@rubencu
rubencu force-pushed the feat/goal-suggestion-actions branch from 51ff5a5 to 54da932 Compare September 22, 2026 16:23
@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

self-added: yes
mechanism: keep goal-marker post-colon whitespace on one line

  • Goal marker consumes the following prose line

fixed — goalMarkerPattern uses [ \t]* after GOAL: on 54da932c3, so it cannot cross a newline.
The regression test keeps [GOAL:\nordinary prose] visible and returns no goal suggestion.

@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

self-added: yes
mechanism: route a blocked suggestion to its existing automation

  • Disabled card offers no path to the blocking automation

fixed — 54da932c3 changes the blocked card action to Open automation and opens the existing automation popover.
It does not write the suggested goal draft or start/replace the live automation.

@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

self-added: yes
mechanism: switch the card action by live automation state

  • Use Open automation for the existing-automation case

fixed — 54da932c3 renders an enabled secondary Open automation action only when a live automation record exists.
Crew/member unavailability still renders disabled Review & start, because there is no automation record to open.

@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

  • Same marker has a card on main chat and a reply pill on thin hosts

rebutted — ChatEmbed, Side Chat, and split ChatPane do not host Set-a-goal, so a goal card there would promise autonomy the surface cannot start.
The objective becomes an ordinary editable reply through goalSuggestionReplyFallback; the Side Chat screenshot shows it beside the off-record composer.

@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

  • Autonomous goal card decision has no pointable record

fixed — issue #12835 records the approved card choice, review-before-start rule, channel boundary, thin-host fallback, and existing-automation constraint.
The PR body links that decision record.

@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

self-added: yes
mechanism: keep the goal sub-parser internal to parseOptions

  • parseGoalSuggestion has zero app-surface consumers

fixed — 54da932c3 removes parseGoalSuggestion from the protocol barrel and vendor stub.
options.ts keeps the direct internal import; stripPartialGoalMarker stays public for streaming transcript cleanup.

@rubencu

rubencu commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

UX evidence added on 54da932c3: the PR body now shows (1) the existing-automation card with Open automation, (2) crew/member mode with disabled Review & start, and (3) the real Side Chat fallback as an ordinary editable reply. All six attachment URLs were verified and the Side Chat capture asserted no raw marker, autonomous card, or horizontal overflow.

@rubencu

rubencu commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Design review note: replacing the remembered draft message is intentional prefill behavior only when the user chooses Review & start. The integration test proves cadence and cycle cap remain unchanged. In the existing-automation path, Open automation does not call saveGoalDraft, so the suggestion cannot overwrite the live record or its remembered draft.

@rubencu

rubencu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for an earlier head, kept for the record (no longer a ledger record):

  • Crew/member disabled card duplicates the thin-host reply fallback

rebutted — crew/member can render the card and therefore can state that the direct goal loop is unavailable; replacing it with an ordinary crew prompt would erase the autonomy boundary and route a multi-turn objective under different semantics.
ChatEmbed, Side Chat, and split ChatPane cannot render the autonomy review path at all, so their editable-reply fallback prevents silent loss. Issue #12835 records both constraints.

@rubencu
rubencu force-pushed the feat/goal-suggestion-actions branch from 54da932 to 7fc8ba4 Compare September 23, 2026 01:12
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 23, 2026
@rubencu
rubencu force-pushed the feat/goal-suggestion-actions branch from 7fc8ba4 to db6955c Compare September 23, 2026 02:17
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 23, 2026
@rubencu

rubencu commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Pass 11: rebased onto current main at cbf8e8456370; current ComposerDockView/ChatEmbed/SideChat composition and scoped frontend/static/2,000-line gates passed. Maintainer attestation remains required.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 16, 2026
@rubencu
rubencu force-pushed the feat/goal-suggestion-actions branch from cbf8e84 to 6264c44 Compare October 16, 2026 22:54
@rubencu

rubencu commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Pass 12: rebased onto main 9fba246d0c75. Main moved ContextBuilder into context_assembly owners (#21049) and split dashboard/state.py (#20507), so the goal rule, _goal_card_surface and the variant tuple live in context_assembly/output_contract.py, the call sites in session_start.py and turn_message.py (re-exported from context.py), and goal-marker stripping in dashboard/state_parts/slot_transcript.py; behavior is unchanged. Backend (2,722) and related frontend (5,419) tests, tsc, i18n, static gates and the 2,000-line cap passed, and the body table names the owners. Fork workflows for 326011836822 await maintainer approval.

@rubencu
rubencu force-pushed the feat/goal-suggestion-actions branch from 6264c44 to 3260118 Compare October 16, 2026 23:06
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 16, 2026
@rubencu

rubencu commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Pass 16: rebased onto main d8b353eb3da9 because main changed ChatInput.tsx, ChatPane.tsx, chat-input/props.ts, ChatPage.tsx, ComposerDockView.tsx, the locales and test_context_composition_contract.py, which this PR also edits. The rebase merged cleanly; 2,722 backend and 6,862 related frontend tests, tsc, i18n, eslint, static gates and the 2,000-line cap passed. Fork workflows for 207b50e75b97 await maintainer approval.

@rubencu

rubencu commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Pass 18: rebased onto main 503e9e32e494 because main split test/test_voice_reply.py (#21397), which this PR also edits; its two strip-markdown tests stay in the remaining TestStripMarkdown class. The rebase merged cleanly; 2,724 backend and 268 voice-reply tests, static gates and the 2,000-line cap passed. Fork workflows for 37b3dab6c1ba await maintainer approval.

@rubencu

rubencu commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Pass 22: rebased onto main 23affa7e785f because main changed all 13 locale files this PR also edits (#19257). The rebase merged cleanly; 93 PR frontend tests, tsc, eslint, i18n:check, static gates and the 2,000-line cap passed. i18n:render fails locally in its HEAD vite build on an unchanged file (stale auto-stamp manifest) on worktrees without UI changes too, so it is left to CI. Fork workflows for 039378f094c1 await maintainer approval.

@rubencu

rubencu commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Pass 26: rebased onto main 8892889b9142 because main changed src/kiro_crew/slack/handler.py (#20973), which this PR also edits. The rebase merged cleanly; 2,725 backend and 93 PR frontend tests, tsc, eslint, i18n:check, static gates and the 2,000-line cap passed. Fork workflows for 00514ddd8082 await maintainer approval.

@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Head 37b9240 (one commit on main 4c9d96a) answers the review of 00514dd. The rebase follows the main changes this PR touches: _strip_options in state_parts/slot_transcript.py (#22070) now strips goal lines on both of its paths, and test_slot_summary_hot_path.py pins that; the mirror backfill test moved with its class to test_chat_mirror_link_delivery.py (#22190); and the critical_rules_goal pin is re-measured after #22614 changed the shared head and tail text. _GOAL_RULE_DASHBOARD itself is unchanged by the rebase.

Fixed:

  • UX (blocking), the card warned about the goal it had just started: when the active goal matches the suggested objective, the card shows "Started. Running in this session." (new key goal_started) with Open goal and Review & start off. Three ChatInput.goalSuggestion tests fail on 00514dd and pass here.
  • UX, the card and the panel disagreed: the paused strings now read "active and waiting on your reply", which matches the panel showing Goal active.
  • UX, copy that treated a button as a place: the blocked-state strings name "the goal panel" instead of "Open goal".
  • UX evidence gap: desktop and mobile captures of the crew/member blocked state and of the started state are added under temp-screenshots/pr12829/, rendered from synthetic fixture data, and 03 to 08 are re-captured on this revision.
  • Opus finding: the companion-chat claim is gone from _GOAL_RULE_DASHBOARD, _goal_card_surface, the goalMarker.ts header and the feature-map row, since the companion chat mounts the full card. test_goal_marker_rule asserts it stays out, and the commit message no longer repeats it.
  • Locales follow the i18n rules of the repo: en.manual.json, the 11 translated catalogs, and en-XA regenerated with npm run i18n:pseudo.

Dispositioned:

  • First Principles (blocking), product shape without an accepted RFC: whether dashboard agents offer [GOAL:] cards by default is a maintainer decision, and it stays open. Next step: an accepted RFC covering agent-offered goal cards in dashboard chat (I can draft one if a maintainer wants it), or /ai-review override first-principles with the decision.
  • First Principles item 4 (collapse the five status strings into one reason): waits on that same decision.
  • Design (pass), the Discord live renderer with goal lines: not changed in this round.
  • The sidebar "Paused at 3/12" string is outside this diff.

On 3d6cda4, 2,305 scoped backend tests, 2,696 vitest tests, typecheck, zero-warning ESLint, gen:ui, i18n:check and the static gates passed; the PR tests, i18n:check and the 2,000-line cap passed again on 4c9d96a.

@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Review of 37b9240: the First Principles block repeats the product-shape gate dispositioned above for 00514dd. Whether dashboard agents offer [GOAL:] cards by default stays a maintainer decision; the next step is unchanged (an accepted RFC covering agent-offered goal cards in dashboard chat, or /ai-review override first-principles with the decision). GPT, Design and UX passed on this head (UX: the 20 committed screenshots cover every control and status state the PR adds), and CI passed. No code change this round.

@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 7b043e2, rebased onto 6457624 (no conflict).

GPT (upheld on a2413f1): fixed.

  • Both scanners now take the last ] on the line as the closer: parseGoalLine in goalMarker.ts and _is_goal_marker_line in constants.py. Only spaces, tabs or a CRLF \r may follow that closer, and the brackets inside the objective must balance.
  • So [GOAL: Fix dict[str, Any] parsing] and [GOAL: check arr[0] until it is set] keep their goal card and are stripped from projections. [GOAL: a] b] and a closer followed by text stay prose.
  • While such a line streams, stripPartialGoalMarker keeps hiding it until the closer of the marker arrives.
  • One input changes outcome: [GOAL: x[y] was accepted before and is now prose, because its brackets do not balance.
  • These tests fail on a2413f1 and pass here:
    • vitest: "keeps balanced brackets inside the objective", "leaves an unbalanced closer or trailing text as prose", "keeps hiding a streaming marker whose objective holds balanced brackets".
    • pytest: test_balanced_brackets_inside_the_objective_keep_the_marker, test_unbalanced_or_trailing_text_after_the_closer_stays_prose.

CI on a2413f1: Backend Tests shard 8 timed out in test_execution_context.py::test_every_binder_declares_whether_it_vouches (over 120 s). That test takes 14.4 s here on both this head and main, and the PR does not touch execution context. Coverage Gate failed downstream of that shard.

Tests

  • On 17008c1: 2,338 scoped backend tests, both composition files dist-less (65), the static gates, and 2,668 chat-suite vitest tests.
  • On 6457624: the PR tests and the 2,000-line cap (509), the PR vitest files (99), typecheck, i18n:check, pseudolocale freshness and gen:ui --check.

The First Principles RFC gate is unchanged.

@rubencu

rubencu commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 413031e, rebased onto d2417a4.

  • Conflict with main's feat(app-sdk): let ChatEmbed hosts hide parts of the chat #21135 (ChatEmbed hosts can hide parts of the chat) in website/src/app-sdk/ChatEmbed.tsx. Main gated the follow-up bar on !hidden('followUps'), and this PR renders followUpReplies, the options plus the goal-suggestion reply fallback. Both are kept: {!hidden('followUps') && followUpReplies.length > 0 && (. Every other PR line matches the published patch.
  • The runs on 3ae0248 finished green apart from the recorded First Principles gate (agent-suggested goals need an accepted RFC or a maintainer override). GPT and Opus had no findings, and UX passed.
  • On d842e65: 472 vitest tests across the ChatEmbed, FollowUp and goal-suggestion suites, tsc and eslint passed. On 3af84a4: the PR and main-touched tests, the dist-less composition contract (65), the static gates, tsc, i18n:check and the 2,000-line cap passed. On the final base: 368 PR and composition tests, 173 ChatEmbed, ChatPage and goal-suggestion vitest tests and tsc passed again.

@rubencu

rubencu commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 33cdb8f1. Main's #23423 made followUpOptions read-only and added one frozen empty result (NONE, sharing the NO_FOLLOW_UPS array) so streaming chunks stop re-rendering memoized consumers. That conflicted with this PR's followUpGoal field in website/src/app-sdk/protocol/options.ts, FollowUpBar.tsx and ComposerDockView.tsx.

Resolution, keeping both sides:

  • FollowUpDerivation keeps main's readonly string[] type and adds this PR's followUpGoal. NONE now also carries followUpGoal: null.
  • Every empty return uses main's NONE. This PR's per-call noFollowUp() returned the same fields as a fresh object, so it is removed.
  • A goal-only result (from an assistant reply or a note) reports NO_FOLLOW_UPS for its empty option list. Main's invariant that every option-less derivation shares one array therefore holds for the new goal results too.
  • goalSuggestionReplyFallback takes and returns the read-only list.
  • In FollowUpBar.tsx and ComposerDockView.tsx, main's read-only prop types sit beside this PR's goal props.

The other 74 paths in the patch are identical to the previous head.

Checks on 98382a93:

  • Frontend: 48 vitest files (1,451 tests), including main's new empty-result identity test and this PR's goal-suggestion tests. TypeScript, zero-warning ESLint on the changed files, i18n:check, lint:i18n, pseudolocale and gen:ui --check are clean.
  • Backend: the PR's tests and the tests main changed since the previous base (41 files) give 1,786 passed. Dist-less dashboard composition (65), static gates, the 2,000-line cap, docs lint and the PR body check all pass.

The previous head's only diff-independent reds were Backend shard 7 (test_config_loader_default_agent unraisable-warning failure, also seen on other PRs), the downstream Coverage Gate, and the Internal Content Scan, which did not run to completion.

@rubencu

rubencu commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the upheld GPT finding on 4ada6d3d09 (ChatInput.tsx:1019, a storage failure showing on another chat's goal card). The new head is 5b953d8029, rebased onto 8fdb1bb282.

  • Cause: failedSuggestedGoal held only the objective text, and the composer isn't remounted per chat. So after Review & start failed to save in one chat, another chat offering the same objective showed that error and turned Review & start off.
  • Fix: the composer's existing chat-change block (if (slotId !== sawSlot)) now also clears the failure, so the failure stays with the chat that tried to save. This adds 3 lines to ChatInput.tsx.
  • Test: keeps a storage failure in its own chat when the composer moves to another chat in website/src/test/ChatInput.goalSuggestion.test.tsx. It fails on 4ada6d3d09, where the error shows in the second chat, and passes here. It also checks that going back to the first chat offers Review & start again.

Tests:

  • The goal-suggestion file passed 14/14, and a 386-file vitest selection passed 6,446. They ran with main's vite.config.ts minus its unused @rolldown/plugin-babel import, because this host's npm registry token has expired.
  • TypeScript, ESLint, gen:ui --check, the static gates and the line cap passed.
  • Main's changes since f6cfc10434 are backend only. Those tests plus this PR's passed (1,234, and 65 without a built website/dist).

@rubencu

rubencu commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Fixed GPT's upheld finding on 4133fd4 (options.ts:22: message search kept [GOAL:] lines the transcript hides), and rebased onto 14fafafedc.

  • searchableText now reads parseOptions(...).text, the parser AssistantMessage renders through, instead of stripOptionMarkers. Message search (useMessageSearch, SearchResultsList) therefore drops the goal line exactly where the transcript does, so it no longer counts a hit the user cannot see or shows the raw marker in a snippet. Option markers are stripped as before, and a reply with no marker is unchanged.
  • Two new cases in website/src/test/searchableText.test.ts: a goal line alone, and a goal line before an [OPTIONS:] block. Both fail on 4133fd4 (expected 'Ready.\n[GOAL: Deliver the result]' to be 'Ready.') and pass here; the file passes 13/13.
  • Main's changes since the last push (UTF-8 decoding fixes, Slack comment cleanup, a webhook test stub) touch none of this PR's files. On this head, their 85 tests and this PR's own backend tests (383) pass.
  • Checks: 12,219 vitest tests plus 1 expected fail, TypeScript, zero-warning ESLint, gen:ui --check, pseudolocale freshness, i18n:check, lint:i18n, docs lint, the file line cap, the static gates, --check-body and the dist-less composition contract (65). This host cannot install @rolldown/plugin-babel, so vitest ran without the React Compiler pass, which perf(web): compile ChatPaneNotices with the React Compiler #23899 applies only to ChatPaneNotices.tsx, a file this PR does not touch. The body's Tests bullet now names the searchableText cases.

@rubencu

rubencu commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto aeb5c02 to clear a conflict with #23388 in website/src/utils/slotDraftStore.ts and its test. Main now ships the change this PR made there: save() reports whether the write stuck, alongside a new peek() and a newest-wins timestamp merge. The resolution takes main's file, so this PR no longer touches it. In the test, main's name for the save test is kept, and this PR's two eviction assertions on save()'s result stay. The description's file table drops slotDraftStore.ts. The rest of the patch is identical.

  • Scoped run: 23,480 Python and 14,640 vitest tests passed, plus main's newest delta (156 + 5).
  • The failures are main's strict XPASS in test_crew_log_fullscan_guard.py, the dist-built boot pin (passes dist-less), and two quietFocusReturn.test.tsx cases that fail the same way on main on this host.
  • Typecheck, eslint, i18n and the static gates passed.

@rubencu

rubencu commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto 9bf1d20 as 28c5383. The rebase resolved conflicts with #24766 (stale option chips) and #24776 (context pools).

  • deriveFollowUpOptions keeps both changes. Main's movedOnRow gate now also covers a goal suggestion, so a [GOAL: …] offered before a running turn's tool or thinking rows is hidden the same way the chips are. useFollowUpChips passes turnRunning ? isTurnActivityRow : undefined and still returns followUpGoal.
  • A new test, hides a goal suggestion once the running turn moves past its row (#15926) in goalSuggestion.test.tsx, fails when that gate skips goal-only rows.
  • test_context_composition_contract.py re-pins the background_overflow golden for the merged prompt. Its only difference from main is the masked <critical_rules_goal> tag (unclassified 64 → 69).

@rubencu

rubencu commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main to resolve a conflict with #25042, which added a sub-agent critical-rules block next to this PR's goal block in output_contract.py.

This PR's tests, the tests main changed since the last push, vitest, tsc, the composition contracts and the static gates pass. The only failures are ones main shows on this host too.

@rubencu

rubencu commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

First Principles gate (product shape). The First Principles lane's last verdict is BLOCK, on 28c5383: the default critical rules for full-chat dashboard slots now tell the agent to offer [GOAL: …] suggestions, and main has no accepted RFC for that. On the current head 5348de5 the lane could not run (GitHub API rate limit), so that BLOCK still holds readiness.

The same lane passed this shape on fa767f0 (2026-10-22, "Nothing blocks"). That head already had _critical_rules_for return _CRITICAL_RULES_GOAL for every dashboard slot _goal_card_surface admits, as 5348de5 does.

Product shape is a maintainer decision, so this PR does not add an RFC. If you accept the shape, please post /ai-review override first-principles 5348de5e86a31c9afdd8922fa34da62225ee8a73 product-shape: <decision>, or point to an accepted RFC that covers it. If you decline, the PR waits.

The other reds on 5348de5 are GitHub API rate limits (the AI review lanes that could not run, PR Policy, Fork PR Description, PR Readiness) and fork-only checks (Sensitive Change Review, Dependency License Gate). They need a maintainer re-run; no code here changes them.

@rubencu

rubencu commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Pushed ec5f8e1, rebased onto main 3cdcfe893c. The rebase resolved one conflict in website/src/app-sdk/ChatEmbed.tsx: main's #25364 now passes the slot's pending ask_question card to deriveFollowUpOptions, and this PR reads followUpGoal from the same call. The merged call does both, so a goal suggestion stands down while a question card is up, like the other follow-up chips. The rest of the patch is unchanged, and ChatEmbed.tsx is 1,590 lines.

On 9fb1d4aa52, 3,531 vitest tests (including every ChatEmbed and follow-up test), TypeScript, i18n:check, the backend tests the PR and main touch (8,759), the composition contracts and the static gates passed; the only failures also fail on main on this host. After the final re-sync onto 3cdcfe893c, main's newly changed test file and the composition contracts pass again.

@rubencu

rubencu commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main e57ea61b (head 52e9cb71). Conflicts, each resolved by keeping both sides:

Two changes beyond the conflicts:

  • Line cap: main grew ChatInput.tsx, and this PR's lines took it past 2,000. The PR's suggested-goal block now lives in website/src/components/chat-input/suggestedGoal.ts (useSuggestedGoal, which also builds the follow-up bar's goal props), with the same logic. ChatInput.tsx is 1,996 lines.
  • website/src/components/chat/crewmateChips.ts (fix(mate): hedge gated actions and hand blocked commands over as a card #26004): its empty offer gains followUpGoal: null, and when a crewmate chat drops every chip, a suggested goal stays on offer by itself, since a goal is not a chip. The new case is tested in goalSuggestion.test.tsx.

The description's file table now names both files; its stale test counts are gone.

@rubencu

rubencu commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Pushed d2d886c, rebased onto main d4c35f448f. The rebase resolved a conflict in test/test_preview_text.py: #30394 added a steer-ack preview test and the assert_rejected_without_backtracking import at the same spots as this PR's goal-marker test and import, and both sides are kept. The PR no longer adds that import line, since main has it now; the rest of its diff is unchanged.

Let agents offer an explicit multi-turn goal action beside ordinary reply
suggestions. Teach the marker only to dashboard slots full chat can open,
and say in the rule that split panes offer the objective as an ordinary
reply, since the same slot can also be shown in one. Reuse the
per-session goal draft and review flow so users see the autonomy
contract before starting it. A goal or monitor in the session disables
the card, which says whether it is running, waiting on your reply or
stopped, confirms a goal the card itself started, and offers Open goal,
the composer's goal control. A failed browser save turns Review & start
off and leaves Open goal as the one action. Strip goal lines at the
shared strip_control_comments projection boundary, so mirror backfill
gets the same treatment as previews, speech and channel egress.
@rubencu

rubencu commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 6a6db15, rebased onto main 40cfcd6ad4. The rebase resolved conflicts in nine files, keeping both sides:

  • output_contract.py: feat(context): tell every Crew agent to ask a person only when truly needed #31224 added the rule to ask a person only when truly needed to every critical-rules variant, so the goal variant carries it too. test_context_composition_contract.py re-pins the goal variant and the five dashboard prompts that include it.
  • options.ts, AssistantMessage.tsx and searchableText.ts: main's split of an inline <thinking> block now runs before the goal and options parse, as it already did for options.
  • ChatPane.tsx, slot_transcript.py, constants.py and the feature map: both edits kept.

Main's ChatInput.tsx was at 1,999 lines, so the rebased PR went over the 2,000-line cap. The four one-row composer layout constants moved unchanged to chat-input/sizing.ts, and the PR's FollowUpBar element is back on main's single line. ChatInput.tsx is now 1,990 lines. Nothing else changed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drive-to-green PR claimed by drive-to-green pipeline fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an autonomous goal suggestion card to dashboard chat

4 participants