You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: wait on signals, not timeouts, in the chip-pass and workspace-registry tests - #1788
Three ordering tests could pass without proving the order they claim. The chip-pass test assumed one Task.yield() was enough for the second loadFileChipReferences caller to start waiting behind the first. The two stale-response workspace tests held the first response behind a semaphore with a 2-second timeout, so the hold could end on its own.
Each test now waits on a signal:
The second chip-pass task fulfils an expectation right before it calls in, and the test awaits that expectation. Both run on the main actor, so the test can't resume until the second caller has suspended in the wait loop. No production hook was needed.
The workspace tests hold the stale response with a plain wait() that the test releases itself, the same pattern TaskRunHistoryTests uses. The rename test now unwraps its beta row before the held request starts, so a failed lookup can't leave the mock queue blocked.
How it was tested
scripts/test-sim <udid> --repeat 50 --only on the three tests: 50/50 each. After rebasing onto chore/ban-comments: --repeat 20, 20/20 each.
With the source check moved above the wait loop in ChatViewModel.loadFileChipReferences, the chip test fails (complete.path writes 2 ≠ 1).
With guard !superseded deleted from WorkspaceRegistryViewModel.performMutation, both workspace tests fail: the stale order and the removed workspace come back.
Local validation passes using scripts/test-sim <assigned-simulator-udid> with the tests required by AGENTS.md § Verifying; the selection and results are recorded above
New/changed Codable models decode tolerantly (optionals for fields the server might add or rename)
No new third-party dependencies (the list in AGENTS.md is locked)
No invented API endpoints or JSON shapes (verified against upstream source or a running server)
Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code).
We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Walkthrough
Three tests now use explicit signals or gates to control request ordering. The chip-pass test waits for the second lookup to start. The workspace-registry tests block reorder and rename requests until released, and the stale-rename test captures beta before starting the rename task.
This PR only makes three ordering tests more deterministic and does not change app behavior. One chip-pass test can still fail spuriously if the test runner stalls for several seconds. It is safe to merge, and a test-controlled gate for the first lookup could be a later follow-up.
Security architecture risk: Minimal · up to 60314
The changes make three asynchronous tests coordinate explicitly. They do not introduce or worsen a material security or architecture risk.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Issue #1784 is the only active direct target. Its coding requirements are: (1) remove the Task.yield() ordering assumption from HermesChatTurnTests.testAWaitingChipPassRechecksTheBackend; (2) remove t…
Provide readable text of the changed hunks or blobs for HermesMobileTests/HermesChatTurnTests.swift and HermesMobileTests/WorkspaceRegistryViewModelTests.swift at the reviewed head, or a narrowed read of the chip-pass test and the two works…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title "test: wait on signals, not timeouts, in the chip-pass and workspace-registry tests" matches the main change. The raw summary and objectives show the PR replaces timed waits and Task.yield()…
Out of Scope Changes check
The PR summary and the raw summary both state that only two test files changed: HermesChatTurnTests.swift (+6/-2) and WorkspaceRegistryViewModelTests.swift (+3/-3). The chip-pass test change adds an e…
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "test: wait on signals, not timeouts, in the chip-pass and workspace-registry tests" matches the main change. The raw summary and objectives show the PR replaces timed waits and Task.yield() ordering assumptions with explicit signals in the chip-pass test (HermesChatTurnTests) and the stale-response workspace registry tests. The title names the two areas touched and the core change. It is slightly long at 82 characters, but it is specific and accurate.
Full details: Out of Scope Changes check
Explanation
The PR summary and the raw summary both state that only two test files changed: HermesChatTurnTests.swift (+6/-2) and WorkspaceRegistryViewModelTests.swift (+3/-3). The chip-pass test change adds an expectation signal before the second loadFileChipReferences call. The workspace changes replace timed semaphore waits with released waits and move the beta row capture before the rename request. The PR description states that no production code changed; the fault-check notes say production code was restored after testing. All changes map to the three tests named in #1784. The ci/ script runs are validation steps, not changes. Limit: the diff text could not be read, so the line-level content is based on the summaries and the PR description.
Full details: Linked Issues check
Explanation
Issue #1784 is the only active direct target. Its coding requirements are: (1) remove the Task.yield() ordering assumption from HermesChatTurnTests.testAWaitingChipPassRechecksTheBackend; (2) remove the DispatchSemaphore timeout from WorkspaceRegistryViewModelTests.testStaleReorderResponseDoesNotClobberNewerOrder and testStaleRenameResponseDoesNotResurrectRemovedWorkspace; (3) make each test fail when its named behavior breaks; (4) pass python3 ci/check_test_waits.py. The PR description states that each change was made and that fault checks were run. The PR summary describes the same changes. Repository diff reads for both changed test files failed because the changed blobs are missing from the checkout. A file read of HermesChatTurnTests.swift at head returned only the first part of the file (truncated at 16000 bytes), and the chip-pass test was not in the returned text. I could not confirm the edited test bodies, the absence of Task.yield() or timeout calls, or the fault-check results. Stack evidence is unavailable; the objective is test-only and needs no stack members. Scope of the requirements is limited to the three named tests.
Resolution
Provide readable text of the changed hunks or blobs for HermesMobileTests/HermesChatTurnTests.swift and HermesMobileTests/WorkspaceRegistryViewModelTests.swift at the reviewed head, or a narrowed read of the chip-pass test and the two workspace tests. Confirm that no Task.yield() ordering assumption and no semaphore timeout remain in the three tests. Include the output of python3 ci/check_test_waits.py at the reviewed head.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Minor comments: 1
HermesMobileTests/HermesChatTurnTests.swift: 1
1090-1095: Minor · Functional Correctness · Poor tradeoff
Keep the first pass pending until the backend changes.
An unusually long scheduling delay can let the five-second RPC deadline expire before the second pass starts. The second pass can then retry on the local backend and cause a false failure on the complete.path write count.
Use a test-controlled gate that is not subject to the RPC deadline, and release it after the backend change.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
🤖 Claude Fable 5.2 responding on behalf of uzairansaruzi
Not changing the rpcDeadline point from CodeRabbit's review. The 5 s deadline predates this PR (openChat(rpcDeadline: .seconds(5)) is on the base) and the test no longer waits on it: both passes are released by the session.info event the test sends. It would only matter if the runner stalled for more than five seconds between two consecutive awaits, and replacing the deadline with a second gate adds test machinery for that case alone. The test passed 50 of 50 and 20 of 20 repeated runs.
…1789)
## Linked issue
No issue: a maintainer-requested chore.
## What changed
About 10% of our Swift was comments (28,500 of them, 29,000 lines). Most
restated the code, a few gave cover to shortcuts, and the ones that
recorded a real decision were scattered where nobody looks for
decisions. This PR deletes them and bans new ones.
- **Every comment was classified** as a tautology, stale, an excuse, or
a decision record. The decision records are now 180 ADRs holding 979
decisions under `docs/adr/` (format in `docs/adr/README.md`). The
excuses became #1781, #1782, #1783, #1784 and #1785.
- **The comments are gone**: 29,032 lines across 665 Swift files. Two
third-party licence notices stay (`ReviewDiffCanvasView.swift`,
`BotProfileAppearance.swift`) because no file in `ThirdPartyNotices/`
covers them yet, and so do the `// test-wait:` annotations
`ci/check_test_waits.py` reads.
- **`ci/check_comments.py` fails a Swift file that gains a comment.** It
runs in Tooling Tests. `ci/comment_baseline.txt` lists the two files
that still hold comments; a count there only goes down, and a pull
request cannot raise it past the target branch's.
- **The `delete-comment` skill** (`.agents/skills/delete-comment`,
linked from `.claude/skills`) repeats the sweep for whatever is left.
`.gitignore` now tracks repo skills.
- **`AGENTS.md`** states the rule in Taste and points decisions at
`docs/adr/`.
Nothing but comments and the blank lines around them changes in Swift.
## How it was tested
- **Only comments changed.** An oracle built on the toolchain's
SwiftParser compared the token stream of all 701 Swift files with
`master`'s: none differ. The only comment trivia it finds at this head
are the 26 licence lines and 15 `// test-wait:` lines.
- **The checker finds what Swift finds.** Its scanner and SwiftParser
agree on every one of the 28,507 comments in the 701 files at the base.
- `python3 -m unittest discover -s ci -p 'test_*.py'`: 21 passed.
`python3 ci/check_comments.py` and `python3 ci/check_test_waits.py`
pass.
- `scripts/test-sim` on iPhone 17e, after the rebase onto current
`master`: 246 passed, 0 failed. The selection is the classes that read
source-relative fixtures or had a `test-wait` annotation rewritten, plus
the files `master` changed under the rebase: `HermesSlashCommandTests`,
`HermesInsightsClientTests`, `HermesChatSettingsTests`,
`LocalizationCatalogTests`, `HermesAgentFixtureTests`, `SSEClientTests`,
`KanbanLiveUpdateTests`, `CronManagementModelTests`,
`CronManagementViewModelTests`, `HermesCronClientTests`,
`HermesConversationTests`, `HermesBranchDuplicateTests`,
`ToolCallSummaryFormatterTests`. The full suite is left to this PR's CI.
## Checklist
- [x] Local validation passes using `scripts/test-sim
<assigned-simulator-udid>` with the tests required by `AGENTS.md` §
Verifying; the selection and results are recorded above
- [x] New/changed `Codable` models decode tolerantly (none changed)
- [x] No new third-party dependencies (the list in `AGENTS.md` is
locked)
- [x] No invented API endpoints or JSON shapes (none touched)
Reviewed with sol-loop: 3 rounds with gpt-6.2-sol on high. Sol verdict:
changes requested in round 3 (a regex literal after a comment, stray
`test-wait` annotations, paths outside the checkout); all fixed in the
last commit, which Sol has not re-reviewed.
Created with Claude Fable 5.2 in Claude Code (T3 Code). Classification
and ADR drafting by Claude Opus 5.5 subagents.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The chip-pass test assumed one Task.yield() put the second caller behind
the first pass; it now waits on an expectation the second task fulfils
right before it calls in. The two stale-response workspace tests held the
first response with a 2-second semaphore timeout; the test now releases
the gate itself.
Fixes#1784
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Fixes #1784
What changed
Three ordering tests could pass without proving the order they claim. The chip-pass test assumed one
Task.yield()was enough for the secondloadFileChipReferencescaller to start waiting behind the first. The two stale-response workspace tests held the first response behind a semaphore with a 2-second timeout, so the hold could end on its own.Each test now waits on a signal:
wait()that the test releases itself, the same patternTaskRunHistoryTestsuses. The rename test now unwraps itsbetarow before the held request starts, so a failed lookup can't leave the mock queue blocked.How it was tested
scripts/test-sim <udid> --repeat 50 --onlyon the three tests: 50/50 each. After rebasing ontochore/ban-comments:--repeat 20, 20/20 each.ChatViewModel.loadFileChipReferences, the chip test fails (complete.pathwrites 2 ≠ 1).guard !supersededdeleted fromWorkspaceRegistryViewModel.performMutation, both workspace tests fail: the stale order and the removed workspace come back.python3 ci/check_test_waits.py,python3 ci/check_comments.py,python3 -m unittest discover -s ci -p 'test_*.py': pass.Checklist
scripts/test-sim <assigned-simulator-udid>with the tests required byAGENTS.md§ Verifying; the selection and results are recorded aboveCodablemodels decode tolerantly (optionals for fields the server might add or rename)AGENTS.mdis locked)Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code