Skip to content

Add conditional tokens to the menu bar layout editor - #3076

Merged
steipete merged 12 commits into
steipete:mainfrom
wdmitchelluk:feat/menu-bar-conditional-tokens
Aug 19, 2026
Merged

Add conditional tokens to the menu bar layout editor#3076
steipete merged 12 commits into
steipete:mainfrom
wdmitchelluk:feat/menu-bar-conditional-tokens

Conversation

@wdmitchelluk

@wdmitchelluk wdmitchelluk commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds conditional tokens to the menu bar layout editor: named, reusable if/then/else rules that decide what the menu bar shows based on live usage. Example: show the session percentage only once it crosses 50%, and nothing (or a countdown) below that.

Found under Settings → Menu bar layout → new "Conditionals" palette group.

What it does

  • Conditionals library: create, edit, duplicate, and remove named conditionals from the layout editor. Each has 1–4 clauses (Session / Weekly / Model-scoped weekly / Auto metric, > >= < <= comparison, 0–100% threshold) joined by AND/OR, plus a then token and an else token. Thresholds compare the window's used percentage.
  • Starter library: a fresh install ships five editable rules so the palette is not an empty box. Identities are fixed, so a placed reference keeps resolving across launches; seeding only happens when no library key exists, so a library you empty is never reseeded.
  • Hide branch: a branch can be Hide, rendering nothing — including its would-be separator spacing, and including its whole line if that leaves the line empty.
  • Placement: conditionals drag/append into the layout like any other token, on either line, alongside all existing tokens.
  • Live evaluation: the renderer evaluates clauses left-to-right (left fold) against the same windows the percent tokens use; a predicate on a missing window is false. The editor summary parenthesizes mixed AND/OR chains (e.g. (Session > 10% or Weekly > 20%) and Auto > 30%) so it reads exactly as evaluated.

Design

  • Reference-by-ID: placed tokens store only the conditional's UUID ({"conditional":{"id":…}}); the library is the single source of truth. Editing a library entry updates every placed copy immediately (the render cache keys on the library), and removing one strips its references from the global layout and all provider overrides.
  • Downgrade contract preserved: .conditional and .hidden have no case in the 0.53.x token surface, so the legacy dual-write projection drops them rather than emitting a token an older decoder would choke on. A line emptied by that filtering is dropped too, and a layout with nothing left falls back to defaultLayout. Both the global and provider-override paths are covered.
  • Dangling references and self-referencing chains (depth-capped at 8) render the standard placeholder with a localized accessibility label.
  • The conditionals palette uses a small wrapping flow layout (MenuBarLayoutChipFlowLayout) rather than an adaptive grid: chips are user-named and variable width, so adaptive columns either stretched them into equal columns with large gaps or, as a plain HStack, pushed later chips out of the pane.
  • Duplicate naming (%@ (copy), %1$@ (copy %2$d)), the shipped rule names, and all new UI strings are localized across the 23 catalogs.
  • The edit sheet's clause-row bindings guard against stale AppKit control callbacks after a clause is removed, so removing rows can't crash.
  • No persisted-format migration needed: the token format is new in this PR.

Proof

Packaged release bundle (Scripts/package_app.sh), driven through the real UI. Artifacts: .github/pr-proof/menubar-conditionals-editor.png, .github/pr-proof/menubar-conditionals-runtime.log.

Menu bar layout editor with the seeded conditionals library

The screenshot shows, in one shot:

  • the five shipped rules in the Conditionals group, wrapping across two tight rows (fresh-install path: the library key was deleted before launch);
  • a placed conditional chip resolving its name from the library by ID (Session over 50% used, on line 2 of the strip);
  • Menu bar strip with two lines while Live preview shows a single 87% row — line 2's conditional resolved to .hidden, so the whole line collapsed.

Downgrade projection, read back out of the running app's UserDefaults:

menuBarLayoutV2 (current): {"lines":[[{"icon":{}},{"percent":{"window":"automatic"}}],[{"conditional":{"id":"B715B1D1-…"}}]]}
menuBarLayout   (legacy) : {"lines":[[{"icon":{}},{"percent":{"window":"automatic"}}]]}

The legacy blob carries no conditional token, so an older release decodes the layout instead of discarding the whole blob.

Hidden-line collapse, read off the live status item:

status item AXTitle: Claude icon, Usage 87%

One line announced — no Line 2 segment, no blank trailing line, single-line typography.

Testing

  • swift test --filter 'MenuBarLayout|MenuBar|SettingsStore|StatusItem|MenuLayout'562 tests in 32 suites pass.
  • New coverage for this round: conditional and hidden tokens drop out of the older-readable projection, conditional layouts dual-write an older-readable fallback (global + override + reload), a line emptied by a hidden branch collapses instead of rendering blank, every line hidden renders an empty title without crashing, conditional palette chips wrap instead of overflowing the pane, a fresh install ships an editable conditionals library, clearing the shipped conditionals library survives a reload.
  • Existing feature coverage: then/else/hidden branches, AND/OR semantics, the left-fold contract, hidden-branch spacing (exact "5h 25%\u{2009}W 60%"), dangling references, depth cap, library-edit cache invalidation, copy naming, summary parenthesization, and library-removal reference stripping across reload.
  • make check clean (SwiftFormat + SwiftLint --strict + locale catalogs: 22 catalogs against 1472 English keys).
  • ./.build/release/CodexBarCLI --help exits 0 locally — the review bot's swift run CodexBarCLI --help failure was its sandbox failing pnpm install (corepack download) before reaching the build.
  • Branch is merged up to current main (lane tokens integrated).

Maintainer decision still open

VISION.md requires sign-off for new features and for changes that affect persisted data, and this adds both a feature and persisted global configuration (the conditionals library). That call is yours — the code-level blockers from review are addressed above, but I have not assumed the product decision.

- Add required `name` field to `MenuBarLayoutConditional` with backward-compatible Codable (legacy data decodes to empty string)
- Add `.hidden` token that renders nothing, used as a conditional branch value to suppress output
- Chips in the palette now show the conditional's display name instead of the full summary
- Conditional editor enforces a non-empty unique name with inline validation
- Add Duplicate action to conditional context menu with auto-generated unique names
- Refactor palette section: add button moved to header row, empty-state placeholder when no conditionals exist, wider chip grid
- Update all 20 locale files with new string keys
- Add renderer and model tests for the new features
Move placed conditional tokens to reference-by-ID: layouts store a
conditional's UUID and the library is the single source of truth, so
library edits reach every placed copy and removal strips references
from all layouts. Pre-resolve conditionals in the renderer so hidden
branches leave no orphaned thin-space separators, key the title cache
on the library, guard the edit sheet's clause bindings against stale
indices, localize duplicate naming, and parenthesize mixed AND/OR
summaries to match left-fold evaluation.
@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48faf424a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBar/MenuBarLayoutRenderer.swift Outdated
Comment thread Sources/CodexBar/MenuBarLayoutEditor.swift Outdated
# Conflicts:
#	Sources/CodexBar/MenuBarLayout.swift
#	Sources/CodexBar/MenuBarLayoutEditor.swift
#	Sources/CodexBar/MenuBarLayoutRenderer.swift
#	Sources/CodexBar/SettingsStore.swift
The Settings scene exists only to own the app-menu Settings command;
the real settings window is AppKit-managed. macOS could present or
state-restore the scene's empty placeholder window at startup.
@wdmitchelluk wdmitchelluk changed the title Menu bar conditional tokens: reference-by-ID model + review fixes Add conditional tokens to the menu bar layout editor Aug 19, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codex review: needs changes before merge. Reviewed August 19, 2026, 5:54 PM ET / 21:54 UTC.

ClawSweeper review

What this changes

Adds named, reusable conditional rules to the menu-bar layout editor so usage thresholds can show, replace, or hide layout tokens.

Merge readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep open: the packaged-bundle proof is convincing, but the branch duplicates an existing main-branch Settings-window guard and still permits visually duplicate conditional names; adopting this persisted feature also needs VISION sign-off.

Priority: P2
Reviewed head: 3d5bf61f79e5248dab465688732815545557fac2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong real-behavior evidence supports a substantial feature, but one duplicated main-branch implementation and one remaining name-collision defect need repair.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): A packaged-bundle screenshot plus a runtime log directly show the seeded editor library, hidden-line collapse, and older-readable layout projection.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): A packaged-bundle screenshot plus a runtime log directly show the seeded editor library, hidden-line collapse, and older-readable layout projection.
Evidence reviewed 7 items Current main already owns placeholder-window handling: The existing guard closes the SwiftUI placeholder at launch and on later window-state changes, including identifier-less windows via the frame-autosave name.
Duplicate implementation in this PR: The new launch-time closer reimplements the current guard with a one-shot identifier-prefix sweep instead of reusing the established lifecycle guard.
Copy-name collision remains: Duplication lowercases raw stored names while the editor validates trimmed names, so a stored trailing-space name can yield two indistinguishable copy labels.
Findings 2 actionable findings [P1] Remove the duplicate SwiftUI Settings-window closer
[P3] Normalize names before generating duplicate suffixes
Security None None.

Live Verification

Command: swift run CodexBarCLI --help

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: Usage:

How this fits together

The menu-bar layout editor stores user token arrangements and settings in local preferences, then the status-item renderer turns them into the visible menu-bar title. This PR adds a conditional-rule library between those persisted layouts and the renderer.

flowchart LR
A[Usage snapshots] --> B[Conditional rule library]
C[Saved menu bar layout] --> D[Layout editor]
D --> C
B --> E[Layout renderer]
C --> E
A --> E
E --> F[Menu bar title and accessibility label]
Loading

Decision needed

Question Recommendation
Should CodexBar adopt persisted named conditional rules as a supported menu-bar customization feature? Sponsor conditional rules: Accept the persisted conditional-library direction after the two concrete review repairs are made.

Why: VISION.md requires explicit sign-off for new features and behavior that affects stored data; implementation correctness cannot determine whether this added configuration surface is desired.

Before merge

  • Remove the duplicate SwiftUI Settings-window closer (P1) - Current main already starts PlaceholderSettingsWindowGuard before launch; it also watches later window updates and recognizes an identifier-less restored placeholder through its frame-autosave name. This added one-shot closer duplicates that behavior with a narrower rule, so remove it and retain the established guard as the single owner.
  • Normalize names before generating duplicate suffixes (P3) - The editor validates names after trimming whitespace, but this set uses raw names. A stored Gate (copy) lets duplicating Gate create Gate (copy), producing two visually identical rule names; use the same trim/lowercase canonicalization and add a regression test.
  • Resolve merge risk (P1) - Merging preserves two competing implementations of SwiftUI Settings-placeholder suppression, and the new one misses the existing guard's restoration and frame-autosave handling.
  • Resolve merge risk (P1) - Conditional rules introduce persisted library data and new layout tokens, so a maintainer must explicitly accept the long-term upgrade and support contract despite the supplied legacy projection tests.

Findings

  • [P1] Remove the duplicate SwiftUI Settings-window closer — Sources/CodexBar/CodexbarApp.swift:461
  • [P3] Normalize names before generating duplicate suffixes — Sources/CodexBar/MenuBarLayoutEditor.swift:650-653
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 43 files, 2,560 added, 74 deleted The feature spans renderer, persistence, editor UI, localized strings, proof, and regression coverage.
Production versus tests production +1,662/-67, tests +865/-7 The substantial production addition has focused layout and persistence coverage, but the remaining integration defects should be resolved before adoption.

Merge-risk options

Maintainer options:

  1. Repair and explicitly approve the stored-rule contract (recommended)
    Remove the duplicate Settings-window closer, normalize duplicate names, and obtain maintainer sign-off before merging the new persisted layout format.
  2. Pause the feature direction
    Do not merge the persisted conditional library until a maintainer confirms that this customization surface belongs in CodexBar.

Technical review

Best possible solution:

Reuse the existing placeholder-window guard, normalize duplicate names consistently, then land the conditional library only if a maintainer sponsors its persisted configuration contract.

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

Not applicable: this PR adds a feature rather than repairing a reported failure; its packaged-bundle screenshot and runtime log directly demonstrate the proposed behavior.

Is this the best way to solve the issue?

No: the conditional implementation is otherwise focused, but it should not add a second placeholder-window handler and needs maintainer approval for its persistent configuration surface.

Full review comments:

  • [P1] Remove the duplicate SwiftUI Settings-window closer — Sources/CodexBar/CodexbarApp.swift:461
    Current main already starts PlaceholderSettingsWindowGuard before launch; it also watches later window updates and recognizes an identifier-less restored placeholder through its frame-autosave name. This added one-shot closer duplicates that behavior with a narrower rule, so remove it and retain the established guard as the single owner.
    Confidence: 0.99
  • [P3] Normalize names before generating duplicate suffixes — Sources/CodexBar/MenuBarLayoutEditor.swift:650-653
    The editor validates names after trimming whitespace, but this set uses raw names. A stored Gate (copy) lets duplicating Gate create Gate (copy), producing two visually identical rule names; use the same trim/lowercase canonicalization and add a regression test.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e7779924f98a.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): A packaged-bundle screenshot plus a runtime log directly show the seeded editor library, hidden-line collapse, and older-readable layout projection.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a useful but optional menu-bar customization feature whose remaining defects and product decision have limited blast radius.
  • merge-risk: 🚨 compatibility: The PR introduces persisted conditional references and dual-write downgrade behavior that must remain safe for existing layouts and older releases.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): A packaged-bundle screenshot plus a runtime log directly show the seeded editor library, hidden-line collapse, and older-readable layout projection.
  • proof: sufficient: Contributor real behavior proof is sufficient. A packaged-bundle screenshot plus a runtime log directly show the seeded editor library, hidden-line collapse, and older-readable layout projection.

Evidence

Acceptance criteria:

  • [P1] swift test --filter 'MenuBarLayout|PlaceholderSettingsWindowGuard'.
  • [P1] make check.
  • [P1] make test.

What I checked:

Likely related people:

  • Elijah Friedman: Introduced the main-branch lifecycle guard that already owns the placeholder Settings-window behavior duplicated by this branch. (role: introduced current placeholder-window guard; confidence: high; commits: f16c55c54867; files: Sources/CodexBar/CodexbarApp.swift, Sources/CodexBar/PlaceholderSettingsWindowGuard.swift, Tests/CodexBarTests/PlaceholderSettingsWindowGuardTests.swift)
  • Giuseppe Bisemi: Introduced and subsequently maintained the provider-lane menu-layout and downgrade paths this feature extends. (role: menu-layout feature owner; confidence: high; commits: 83e7deb3566e, 87378e25f026; files: Sources/CodexBar/MenuBarLayout.swift, Sources/CodexBar/MenuBarLayoutEditor.swift, Sources/CodexBar/MenuBarLayoutRenderer.swift)

Rank-up moves

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

  • Remove the redundant Settings-window closer and rely on the existing guard.
  • Canonicalize names consistently in duplicate generation and add the regression test.
  • Obtain explicit maintainer sign-off for the persisted conditional-library direction.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-19T17:37:17.691Z sha 5616fc9 :: needs real behavior proof before merge. :: [P1] Preserve an older-readable layout projection | [P2] Collapse lines emptied by hidden branches | [P2] Make the conditional palette wrap or scroll
  • reviewed 2026-08-19T19:32:58.385Z sha c7066b7 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-19T20:43:42.453Z sha f717284 :: needs changes before merge. :: [P3] Normalize names before generating duplicate suffixes

The dual-write path promises the legacy blob stays decodable by the
0.53.x token surface, but .conditional and .hidden have no case there,
so an older decoder dropped the whole saved layout or override. Filter
tokens with no legacy representation out of the projection instead of
mapping them, drop a line emptied purely by that filtering, and fall
back to the default layout when nothing remains.
Resolving a conditional to .hidden removed the token but kept its line,
so a stacked layout still emitted that line's newline, held stacked
typography, and announced a blank line to VoiceOver. Drop resolved-empty
lines before deriving stacking and separators, and keep the debug marker
safe when every line collapses.
A plain HStack pushed later chips outside the settings pane once the
library grew or names got long, and an adaptive LazyVGrid stretched the
chips into equal columns with large gaps. Add a leading-aligned wrapping
flow layout that places each chip at its natural width, with the row
packing rule covered by a test.
A fresh install showed an empty Conditionals palette, leaving the
feature undiscoverable until someone hand-built a rule. Seed five
editable conditionals covering the common cases. Identities are fixed so
a placed reference keeps resolving across launches, and seeding only
happens when no library key exists, so an emptied library is never
reseeded.
Captures the packaged-bundle behavior behind this PR: the seeded starter
library in the editor, the legacy layout blob staying free of conditional
tokens, and a hidden branch collapsing its line in the rendered title.
@wdmitchelluk

Copy link
Copy Markdown
Contributor Author

All three actionable findings are fixed, each in its own commit, and the proof ask is satisfied. Head is now c7066b72b.

Finding Commit What changed
[P1] Preserve an older-readable layout projection 1f91002c9 legacyCompatible filters tokens with no 0.53.x case instead of passing them through; a line emptied by filtering is dropped; nothing left falls back to defaultLayout. Covered for the global and override paths plus reload.
[P2] Collapse lines emptied by hidden branches 43c509732 Resolved-empty lines are dropped before isStacked, newline insertion, and accessibility lines are derived. Also guarded the debug-marker append, which indexed [-1] when every line collapsed.
[P2] Make the conditional palette wrap or scroll e2dc2ffb7 New MenuBarLayoutChipFlowLayout wraps chips at their natural width, leading-aligned. Row packing is a pure function with test coverage.
Add real behavior proof c7066b72b Screenshot + runtime log from the packaged bundle, committed under .github/pr-proof/ and inlined in the PR body.

One extra change while in here (c1c220460): a fresh install now seeds five editable starter conditionals, because an empty palette made the feature effectively undiscoverable. Identities are fixed so placed references keep resolving, and seeding only runs when no library key exists — a library you empty is never reseeded, which the new clearing the shipped conditionals library survives a reload test pins down.

Notes on two items in the checklist:

  • Downgrade merge risk — this is the same root cause as the P1 finding and is fixed by 1f91002c9. The runtime log shows the legacy blob for a layout containing a conditional reference, with no conditional token in it.
  • VISION.md sign-off — left to you deliberately. I have not tried to self-resolve the product decision about adopting persisted named conditional rules; the code-level blockers are what I addressed.

On the failed live verification: swift run CodexBarCLI --help failed in the review sandbox during pnpm install --ignore-scripts --frozen-lockfile with a corepack download error, before any build ran. ./.build/release/CodexBarCLI --help exits 0 here, so that looks like sandbox networking rather than this branch.

Verification: 562 tests in 32 suites pass across the layout, settings-store, and status-item suites, and make check is clean including SwiftLint --strict.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@wdmitchelluk

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex review is not enabled for this repo. Please contact the admins of this repo to enable Codex.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 19, 2026
Two problems made the macOS test shard fail:

Restore two '// Provider-specific by design:' markers for the Mistral
lanes in the layout preview. The branch's first commit deleted them, so
the gatekeeper saw unjustified provider-specific clusters.

Realign five allowlist line anchors that this branch shifted, in
MenuBarLayout, MenuBarLayoutEditor, SettingsStore, and
StatusItemController+MenuBarLayout.
@wdmitchelluk

Copy link
Copy Markdown
Contributor Author

CI update for f71728499: both macOS test shards now pass.

The earlier red gate (macOS test gate/result mismatch: required=true deferred=false result=failure) was ProviderArchitectureGatekeeperTests / cross provider case clusters are derived or specifically justified, and it had two distinct causes:

  1. Two // Provider-specific by design: markers were missing for the Mistral lanes in MenuBarLayoutPreview. git log -S traces their deletion to this branch's first commit (f901a683c), so the gatekeeper had been seeing unjustified provider-specific clusters on every run. Restored verbatim.
  2. Five allowlist line anchors had drifted, because the gatekeeper pins file:line + exact source text and this branch shifted those lines (MenuBarLayout.swift, MenuBarLayoutEditor.swift ×2, SettingsStore.swift, StatusItemController+MenuBarLayout.swift). Realigned.

I audited all 391 allowlist/suppression anchors in the gatekeeper against their source files rather than fixing them one failure at a time; all 391 now resolve exactly.

Local verification: 600 tests across 33 suites pass (MenuBarLayout|MenuBar|SettingsStore|StatusItem|MenuLayout|ProviderArchitecture), and make check is clean at 0 violations.

The one remaining red job is unrelated infrastructure

build-linux-musl-cli segfaulted inside swift sdk install, immediately after downloading the static SDK bundle and before compiling anything:

*** Program crashed: Bad pointer dereference at 0x0000000000000018 ***
Thread 0 "swift-sdk":
##[error]Process completed with exit code 11.

That it is not this branch:

  • the same job passed on the previous run (c7066b72b), and the only difference here is two comment lines in a macOS-only file plus a macOS test file;
  • build-linux-cli (linux-arm64) succeeded on this very run, so the CLI compiles fine on Linux;
  • this branch touches nothing outside the macOS app target, its tests, and the proof artifacts — CodexBarCore and CodexBarCLI are untouched.

I do not have re-run rights on this repo, and the workflow has no workflow_dispatch, so I cannot clear it myself and did not want to push an empty commit just to re-trigger. A maintainer re-run of that job should clear it, or it will re-run on the next push.

Two behaviors this branch introduced were unproven: a conditional whose
branch resolves to .icon in first position has to reach button.image the
same way a literal .icon token does, since AppKit only dims that path on
inactive displays; and a line the user left empty must survive the
older-readable projection, unlike one emptied by token filtering.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 19, 2026
@wdmitchelluk

Copy link
Copy Markdown
Contributor Author

CI is green on 3d5bf61f7 — all 8 jobs pass and the aggregate lint-build-test gate is satisfied:

success  changes
success  lint
success  swift-test-macos (0, 2)
success  swift-test-macos (1, 2)
success  build-linux-cli (linux-x64, ubuntu-24.04)
success  build-linux-cli (linux-arm64, ubuntu-24.04-arm)
success  build-linux-musl-cli
success  lint-build-test

build-linux-musl-cli passed on re-run without any change to that path, which confirms the earlier swift sdk install segfault was a transient toolchain failure rather than anything on this branch.

The push that re-triggered the run also closes two edges my earlier commits introduced but left unproven, rather than being an empty re-trigger:

  • a conditional whose branch resolves to .icon in first position must reach button.image on the same path a literal .icon takes — AppKit only applies inactive-display dimming to that path, so an attributed attachment would silently lose it;
  • a line the user left empty (line break added, no token dropped in yet) must survive the older-readable projection, unlike a line emptied by token filtering.

Both behaviors were already correct; they are now pinned by tests.

Local verification: 601 tests across 33 suites pass, and make check reports 0 violations.

@steipete
steipete merged commit 4615951 into steipete:main Aug 19, 2026
9 checks passed
steipete added a commit that referenced this pull request Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants