Skip to content

fix(console): pin the long-name overlap invariant and drop the dead credential-saved line - #2943

Merged
freeqaz merged 5 commits into
mainfrom
ux-fixes-130b
Oct 19, 2026
Merged

freeqaz merged 5 commits into
mainfrom
ux-fixes-130b

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Three follow-ups from bughunt-128 on #2926/#2935 and #2931:

  • Finding 2013: the long-name rule (list.mjs) must never let two of its alternatives match the same character, nor let a combining mark start one: each overlap doubles the ways to split a run (finding 1999). The only guard was a 50 ms timing bound in console-agent-name-runs.test.mjs, which cannot see a small overlap at the 200-character limit. The bughunt's two mutants (dropping LETTER_EMOJI from the last alternative's exclusion, and dropping the (?<![A-Za-z0-9]) lookbehind on the hyphen-before-digit alternative) both passed 15/15.
  • Finding 2014: the channel Secrets "Credential changes may have been saved" line (credentials.mjs, made an alert in fix(console): announce danger feedback lines as alerts and pin the form refusals #2931) could never show. outcomeUnknown is only set together with a non-definitive saveError, and the line required the opposite. Its only test asserted that it is absent.
  • Finding 2015: two setStatusTone callers in the channel Secrets panel wrote the text before the tone (Secret select and save refusal), against setStatusTone's rule from fix(console): announce danger feedback lines as alerts and pin the form refusals #2931.

Change

  • list.mjs: export the alternatives as UNBROKEN_ALTERNATIVES (the joined regex is unchanged). console-agent-name-runs.test.mjs gains a direct check over every code point. Each alternative is widened by stripping its lookarounds (a class-aware scan). Widening only matches more, so it is a sound filter. Characters that two widened alternatives can consume, and combining marks that any can, are then tried with the real alternatives between 38x38 contexts chosen to satisfy each lookaround (digits of several scripts, joiners, marks, dashes, quotes, letter emoji, and a mark before several lookahead targets). It asserts that no two alternatives match the same character and no mark starts one. It takes about 0.2 s. The 50 ms bounds stay.
  • credentials.mjs: remove the unreachable line. An unknown outcome is still reported, as a danger alert: the save error line says "Outcome unknown. Reload this Agent to confirm the saved Secret bindings.", Reload draft shows, and the deploy gate names it. That line is now pinned as role=alert, data-tone=danger.
  • credentials.mjs: set the tone before the text at both callers.

UX plan follow-ups to #2931 and #2935 (findings 2013, 2014, 2015).

Verification

  • console-agent-name-runs.test.mjs: the new test passes, and fails on both named mutants (M1 at the letter-emoji exclusion, M2 at the hyphen-before-digit lookbehind).
  • console-agent-channels.test.mjs: new "Agent credentials set the channel Secrets feedback tone before its text". A MutationObserver on the feedback line records ["data-tone", "text"] for a 403 save refusal and again for the next Secret choice. Reverting either swap alone fails it (["text", "data-tone"]).
  • console-agent-draft-guards.test.mjs: the outcome-unknown line is a danger alert. A mutant saveErrorTone() returning "warning" fails it.
  • Touched files (channels, draft-guards, name-runs) 20/20 (before the main merge; the merge brought only fix(console): Create Agent re-enables when the Namespace becomes ready #2937, which touches none of these files, and the three files passed 58/58 again after it; name-runs 20/20 on the final head) at 2 CPUs (taskset -c 2,3).
  • prettier and eslint clean on touched files.
  • UI media (commit a99d495, removed before squash): nothing visible changes. The removed line could never render, and the tone swap happens within one task, so before (main) and after look the same. Shown are the two channel Secrets states this PR touches: a refused save (danger alert, tone set before text) and an unknown outcome (the "Outcome unknown" danger alert that remains the panel's only word on it). No Storybook story covers the channel Secrets panel's save outcomes.
before (main) after
1440, refused save before 1440 refused after 1440 refused
1440, unknown outcome before 1440 unknown after 1440 unknown
390, refused save before 390 refused after 390 refused
390, unknown outcome before 390 unknown after 390 unknown

Open-PR conflict check

3-way git merge-tree of this head with each open PR in the plan's conflict map (#906, #2253, #2255, #2258, #2445, #2524, #2599, #2833, #2922, #1619 and freeqaz-openai's open PRs), compared with origin/main: no new conflicted file or hunk with any of them. #2524 already conflicts with main in list.mjs, and #2599 touches console-agent-draft-guards.test.mjs; the hunk counts are unchanged.

Risks

  • UNBROKEN_ALTERNATIVES is a new export that only the test reads.
  • The overlap check is bounded by its context set: an overlap that needs a context outside these contexts would slip through, as with the bughunt's own check. The 50 ms bounds still catch steep blowups.

…rets feedback order

- Export the long-name rule's alternatives and check directly that no two
  match the same character and no combining mark starts one, over every code
  point; the 50 ms bound could not catch an overlap (finding 2013). Both
  mutants the bughunt named fail it.
- Remove the channel Secrets 'Credential changes may have been saved' line:
  it could never show, because an unknown outcome always carries its save
  error, whose 'Outcome unknown' line is now pinned as a danger alert
  (finding 2014).
- Set the feedback tone before its text on Secret select and save refusal,
  pinned by a mutation-order test (finding 2015).
Review follow-up: the contexts were single characters, so a \p{M}* lookahead
was never tried with a mark before its target. Also writes the context
characters as escapes.
@freeqaz
freeqaz requested a review from a team as a code owner October 19, 2026 13:46
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR checks long-name regex alternatives for overlap, removes an unreachable credential warning, and sets feedback tones before updating text.

Example: Saving Slack channel Secret bindings returns HTTP 403.

  • Before: The feedback text is written before its danger tone.
  • After: The danger tone is set before the refusal text; the visible message remains unchanged.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and source-consistent, but static screenshots leave the required interactive UI verification incomplete.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Future console edits could reintroduce slow Agent-name rendering or violate the established credential-feedback ordering contract.
Reason: The maintainer-authored direction is authorized, the regression guards protect documented failures, and the cleanup preserves existing user behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides useful regression protection and focused console cleanup, with no introduced correctness defect found.

Priority: P3
Reviewed head: b76ae48315b66e3daa3a3924433d3cfe0ef4d886

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply the credential-save walkthrough with feedback mutation diagnostics; the PR reports mutant failures, but this read-only review did not independently execute them.
Agent review details

How this fits together

The console classifies Agent names for wrapping and turns channel Secret save results into feedback, reload controls, and deployment gates.

flowchart TB
  A[Agent names] --> B[Long-name classifier]
  B --> C[Agents list rendering]
  D[Secret picker and save] --> E[Configuration API]
  E --> F[Credential feedback]
  F --> G[Reload and deployment controls]
Loading

Technical review

Best possible solution:

Land the focused invariant coverage and feedback cleanup while preserving existing regex, save, reload, and deployment behavior.

Do we have a high-confidence way to reproduce the issue?

Current-main source demonstrates both text-before-tone calls and the unreachable warning condition; no target code or tests were run during this review.

Is this the best way to solve the issue?

The focused changes preserve established behavior, and the new overlap check protects an invariant that the existing timing threshold cannot reliably detect.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8fe071637376.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit 61ec422 adds apps/controller/src/console/agents/list.mjs:288 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 61ec42252eb8; files: apps/controller/src/console/agents/list.mjs)
  • Kevin: Raw commit e47b14a adds apps/controller/src/console/agents/credentials.mjs:360 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e47b14a7e285; files: apps/controller/src/console/agents/credentials.mjs)

Review metrics

Metric Value Why it matters
Production versus test changes Production +9/-15; tests +189/-1 Most growth protects the regex overlap invariant and feedback ordering; production code shrinks.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P3: This is focused regression protection, unreachable-code removal, and feedback-order maintenance.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the walkthrough and native media attachments described in the proof assessment.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-19T13:59:46.817Z sha 6a7ba85 :: needs maintainer review before merge. :: none

Reviewed October 19, 2026, 10:11 AM ET / 14:11 UTC (Revision 2).

@freeqaz

freeqaz commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
@freeqaz
freeqaz merged commit def1817 into main Oct 19, 2026
68 of 69 checks passed
@freeqaz
freeqaz deleted the ux-fixes-130b branch October 19, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant