Skip to content

refactor(state): make four implicit lifecycles explicit state machines - #556

Open
Ardnived wants to merge 17 commits into
mainfrom
refactor/explicit-state-machines
Open

Ardnived wants to merge 17 commits into
mainfrom
refactor/explicit-state-machines

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Four lifecycles held in booleans, refs, module lets and timers are now XState 5 machines with table specs
  • Fixes along the way: a lost-key embed report, Near me alerts for the map's refusals, a double-sent token

Change outline

Types — the four machines

Each is a pure module, with no React and no DOM, and a node-lane spec over its transition table. React reads each one through one hook, useActorSelector.

All four are XState 5, by the owner's decision (see Notes): one formalism for every lifecycle, at +11.6/+11.8 KiB on the eager payload. docs/rules/i18n-and-state.md carries the rule.

src/lib/ownership.ts                  vacant → owned ⇄ grace ──after 1s──► vacant (release)
  connect in owned:  owner itself → stay | owner still connected → refuse | else claim
  connect in grace:  owner itself → owned | keyChanged → release + claim | else claim

src/lib/locate-machine.ts             idle | found | failed ──request──► locating
  locating: entry requestId + 1, invoke ask, after 35s → failed
            answer → found, refuse → failed, request ignored
  root:     fix → found                  # Mapbox answering after a reported failure

src/lib/challenge-machine.ts          loading ──after 20s──► blocked
  loading → unsolved ⇄ needsClick → solved { shown | collapsed | spent }
  root: error → blocked, token → solved.collapsed
  spend: solved.shown|collapsed → solved.spent; exit solved drops the token

src/views/DrawerStack/sheet-machine.ts   parallel, context { snap, view, landing }
  results: idle ──SHOW_RESULTS(tall)──► tallNext ──VIEW_CHANGED | COLLAPSE | settle on same view──► idle
  landing: idle ──STEP_BACK──► pending ──LOCATION──► idle (rewriteLanding when the query moved)

Flow — page ownership and the embed report

The element passes its lifecycle callbacks to the machine and does nothing else. On release, a report still waiting for idle is cancelled, so the 500 ms < 1 s coincidence no longer decides whose key sends it.

 SahajAtlasElement.connectedCallback                src/Widget.tsx
-  clearTimeout(pendingTeardown); compare owner / apiKey; owner = this
+  ownership.send({ type: 'connect', element: this, keyChanged })
+  currentOwner() !== this → return             # refused, before super
   adoptStyles → super.connectedCallback
 SahajAtlasElement.disconnectedCallback
-  pendingTeardown = setTimeout(releaseOwnership, 1000)
+  ownership.send({ type: 'disconnect', element: this })
 releaseOwnership → releaseAnnouncement             src/lib/embed-announce.ts
+  abort the report waiting for idle, give back `reported`

Flow — one location request, two controls

The map's find-me and the filters' Near me share one request phase. A control shows a refusal only for the request it asked under.

 Locator.request()                                  src/hooks/use-locator.tsx
-  pending memo while a request is out
+  send request (the machine ignores it while locating) → waitFor(not locating)
 useNearMe.locate()                                 src/hooks/use-near-me.ts
+  press = { id: locator.getRequestId(), busy: true }
 useNearMe status
-  own status: idle | locating | failed
+  phase locating or press.busy → 'locating'
+  phase failed and press.id === requestId → 'failed'
 MapControls                                        src/components/organisms/Mapbox/MapControls.tsx
-  locate prop from Map (Map re-rendered on every phase)
+  useLocateState() read in place
 useLocate                                          src/components/organisms/Mapbox/use-locate.ts
-  state, failed boolean, waiting ref, live ref
+  dialogOpen only; the double tap reads locator.getPhase()

Flow — a submit takes the token

Both forms used to guard on token from the render, which two submits that clear validation in the same tick both pass.

 RegistrationForm / ReportIssueForm onSubmit
-  if (!token) return; mutate({ captcha: token })
+  captcha = useTurnstile().take()        # reads the actor; solved → solved.spent
+  if (captcha) mutate({ captcha })        # the second submit gets null
 RegistrationForm, the line under Register
-  checkIsSlow, a 4 s timer → 'security_check'
+  needsClick, from the frame's interactive/settled → 'security_check'
 useTurnstile reset()
-  no contentWindow → silently keeps the spent token
+  no contentWindow → remount (back to loading, no token)

Components — DrawerStack's sheet

Escape and the header now read one collapsed local. The "Show N classes" intent and the landing rewrite live in the machine, not in refs.

 DrawerStack                                        src/views/DrawerStack/DrawerStack.tsx
-  useState snap, useRef resultsTall, useRef landing
+  sheetStore = createSheetStore(navigateRef-based rewrite); snap = useActorSelector(sheetStore, …)
+  effects send VIEW_CHANGED{view} · LOCATION_SETTLED{view} · LOCATION · SEARCH_MOVED · VAUL_SNAP
-  Escape: snap !== PEEK_SNAP     header: atPeek
+  both:   one `collapsed` local, canCollapse && atPeek

Files

 src/lib/
+├── ownership.ts            # which <sahaj-atlas> owns the page
+├── locate-machine.ts       # the shared position request
+├── challenge-machine.ts    # one Turnstile frame's token
 src/views/DrawerStack/
+├── sheet-machine.ts        # the phone sheet's stop and dismissal intents
 src/hooks/
+├── use-actor-selector.ts   # the one way React reads an actor
 scripts/check-bundle-size.mjs   # standalone 336 → 349, embed 338 → 350 KiB

Preview

Preview pending: the Workers alias is not posted yet. On a phone-width viewport:

  • App, full-map.html — press Escape on the sheet, then Show more
  • App, filters → Where → Near me — the map's find-me button lights up as found

Test results

  • Lean gate: ✓ lint, typecheck, unit 2871 passed / 1 skipped
  • Build: ✓. pnpm size: standalone 347.7 of 349 KiB, embed 349.1 of 350 KiB, loader 3.5 of 3.6
  • Browser lane: ✓ 40 passed with one worker, including the new sheet.spec.ts. With four workers, two first-boot cases timed out at 5 s on a machine at load average 25, and each passed alone
  • I watched each new regression spec fail with its defect put back, then restored the code

Manual verification

  1. On a phone, drag the sheet halfway and press Escape. "Show more" and the sheet agree on whether it is collapsed.
  2. Refuse location from the map's find-me button, then open the filters. Near me shows no alert. Press Near me, and it shows its own.
  3. Use Near me successfully. The map's find-me button shows found.
  4. On a registration form where Cloudflare asks for a click, "security check" appears under Register as soon as the frame shows, not after 4 s.

Notes for reviewer

Visible behaviour changes. Everything else is meant to be unchanged:

  • A Near me success lights find-me. A tap on find-me while Near me's request is out does nothing, where before it also navigated.
  • Escape reads the sheet's measured top, as the header does. A second Escape during the collapse animation no longer reaches outward.
  • A "Show N classes" intent is spent by a collapse, or by a move that changed no view.
  • A spent token stays shown, so Register keeps its look while the POST is out. The frame collapses on the spend.

Dismissed review findings:

  • Interactive before ready flips status to ready. Kept on purpose: any valid message proves the handshake, which is what the old timer read too. A frame asking for a click should get the click line. Pinned by a test.
  • waiting not cleared if whenIdle throws. Unreachable: whenIdle only resolves, and its executor catches the one call that can throw.
  • Ownership effects may throw. refuse goes through reportIntegrationWarning, which swallows a throwing console. release is assignments and idempotent DOM writes. A ⚠ comment records the rule.
  • Flatten the sheet's regions into booleans, and merge ownership's vacant into owned. Not taken: they are the named states this PR exists to add.

Owner decision, not open for review: XState for all four lifecycles, and the eager budget raise it costs. The adversarial review proposed plain tables for ownership and challenge, to keep xstate out of the eager graphs. That was pushed and then reverted in f274fbb at the owner's request: one formalism, with its visualiser and devtools, was the explicit choice over saving 11.6/11.8 KiB. The sheet and locate streamlines from the same push are kept.

The security review ran, triggered by package.json and Widget.tsx. It found nothing.

Detail
  • Why the budget moves: xstate reaches both eager graphs — the challenge machine through the app-wide report form, ownership through Widget.tsx — for +11.6/+11.8 KiB gzipped, so the budgets go 336 → 349 and 338 → 350, keeping the ~1 KiB each had spare. Widget.standalone.test.ts lists xstate among the eager packages. The locate and sheet machines reuse it from the lazy interface.
  • Why there is no @xstate/react: useActorSelector is about 10 lines, with a server snapshot so renderToStaticMarkup specs do not throw.
  • Sheet actor: it is never stopped. It holds no timer and no child, and a stopped actor would ignore StrictMode's remount. The challenge actor is stopped on teardown, because it holds the handshake timer.
  • Test timing: the two submit specs pin React Query's notify scheduler to a microtask. Its 0 ms timer raced async act, failing about 15/30 with the new hook and 1/30 on main.
  • History tests: the history's identical-URL, refused-write, pop and unsubscribe cases moved into routing.router.test.tsx, on jsdom's real session history. There is no hand-written fake window.

🤖 Generated with Claude Code

Ardnived and others added 7 commits November 28, 2026 08:43
Four lifecycles were spread across booleans, refs, module lets and timers,
with their rules held only in comments. Each is now an XState 5 machine in a
pure module with a node-lane table spec, read from React through
useSyncExternalStore:

- lib/ownership.ts: which <sahaj-atlas> owns the page, and the 1s teardown
  grace window (was `owner` + `pendingTeardown` in Widget.tsx). The embed
  report is now cancelled on release instead of relying on 500ms < 1s, so a
  different-key replacement can no longer send the old owner's report
  unauthenticated or under the new key.
- lib/locate-machine.ts: one request phase shared by the map's find-me and
  the filters' Near me, owned by the locator, with the 35s backstop as a
  delayed transition. A Near me fix now lights find-me; each control still
  acts on, and raises a failure alert for, only its own presses. The
  duplicate `failed` boolean and `waiting` ref are gone.
- lib/challenge-machine.ts: one Turnstile frame's token, click prompt and
  blocked state. The frame's `interactive`/`settled` events (SahajCloud#1090)
  now drive the line under Register, replacing the 4s `checkIsSlow` guess; a
  reset with no frame window remounts instead of keeping a spent token.
- views/DrawerStack/sheet-machine.ts: the phone sheet's stop plus the intents
  a dismissal leaves. Escape and the header now read one `isCollapsed`
  predicate, and a "Show N classes" intent no longer outlives a collapse.

Also: both forms hold a submit with a ref, so two submits that clear
validation together cannot send one single-use token twice (isPending reads
false in both callbacks); first unit spec for atlas-history; a browser-lane
scenario for the sheet; the lifecycle convention in i18n-and-state.md.

xstate joins both eager graphs: +11.6/+11.8 KiB gzipped, so the standalone
and embed budgets move to 349/350, keeping the ~1 KiB each had spare.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Near me kept a boolean for its own last refusal and joined it to the
shared phase, so a later refusal from the map's button brought Near me's
alert back for a press it never made. The machine now numbers each
request it starts; a control remembers the id it asked under and shows
'failed' only for that one, which also keeps a refusal from before a
remount off the alert.

The locator's own pending-promise memo goes: the machine already ignores
a request while one is out, so a second ask simply waits on the first.
MapControls reads the phase itself, so a phase change no longer
re-renders the whole map, and every actor read goes through one
useActorSelector hook (with a server snapshot, which SSR needs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two forms each held a `sending` ref to stop two same-tick submits
sending one single-use token twice, with the reason written out in each.
The machine already owns the token, so it now owns that rule too: a new
`solved.spent` state, entered through `spend`, and `useTurnstile().take()`,
which reads the actor rather than the render and hands the token to one
submit only. Leaving `solved` drops the token, in one exit action.

The hook reads its actor through useActorSelector and clears it when the
frame is torn down, so a stopped machine's last token is never handed out
before the next frame mounts. The two submit specs pin React Query's
scheduler to a microtask instead of waiting out its 0ms timer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The sheet's "Show N classes" intent no longer depends on effect order:
  VIEW_CHANGED and LOCATION_SETTLED both carry the view, and a settle
  spends the intent only when its move changed none.
- The sheet's actor reads through useActorSelector, and its long-lived
  landing callback is built at module scope, holding the navigate ref
  rather than the first render's whole scope. `Stop` has one declaration.
- Ownership: the duplicated docblocks between Widget.tsx and
  lib/ownership.ts are one; unused type exports are private.
- The history spec's hand-written fake window is gone: its four new cases
  run on jsdom's own session history beside the router spec that already
  pinned the rest.
- The size budget's row names the right eager paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 20:38Z resolve-conflicts · attempt 1 · session · done
  • 20:38Z resolve-conflicts · attempt 1 · session
  • 16:02Z address-review · attempt 1 · session · done
  • 16:02Z address-review · attempt 1 · session
  • 15:51Z review-pr · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 28, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧐 Adversarial review

Four genuine lifecycles, and the table specs earn their keep — ownership's grace window and the challenge's non-latching blocked read in one place now. The refactor sits where the diff works, so none of it is smuggled.

The price is what I would not take as written. xstate reaches both eager graphs solely for ownership and challenge, and the eager budgets rise 336→349 and 338→350 KiB on the payload host pages load. locate and sheet get the library free from the lazy interface. With no ticket, "XState was the chosen approach" is not yet an answer.

Contracts held: SahajCloud's challenge protocol is identical; nothing new is fetched or framed. No preview links or question threads.

Findings

  • should-fix · 13 KiB of eager budget for two of the four machines — check-bundle-size.mjs:142
  • should-fix · the #556 ledger row matches neither pnpm size nor its own spare-KiB claim — :95
  • should-fix · Streamline isCollapsed + escapeGoesOutward — sheet-machine.ts:74
  • should-fix · Streamline sheetStoreFor — DrawerStack.tsx:123
  • should-fix · Streamline LocatePhase — locate-machine.ts:6
  • should-fix · Streamline LocatorApi — use-locator.tsx:30
  • consider · Streamline challengeView — challenge-machine.ts:114

What was checked

Read whole on the branch: the four machines, use-actor-selector, use-locator, use-locate, use-near-me, use-turnstile, embed-announce, both forms, Widget.tsx, DrawerStack, config/embed. Streamliner: 43 pieces, 33 kept, 5 of 6 held.

Dropped after checking: the ownership table against main's connectedCallback, cell by cell — equivalent; ReportIssueForm losing its isPending guard, which Button's disabled={disabled || isLoading} covers; the waiting AbortController, which fixes a race main had.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread scripts/check-bundle-size.mjs Resolved
Comment thread scripts/check-bundle-size.mjs Resolved
Comment thread src/views/DrawerStack/sheet-machine.ts Resolved
Comment thread src/views/DrawerStack/DrawerStack.tsx Resolved
Comment thread src/lib/locate-machine.ts Resolved
Comment thread src/hooks/use-locator.tsx Resolved
Comment thread src/lib/challenge-machine.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 28, 2026
`sheetStoreFor` was a module-level layer with one call site. The reason it
existed — the long-lived rewrite callback must hold the ref, not a render
scope — is a property of the callback, so it moves onto the callback.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
`isCollapsed` and `escapeGoesOutward` were one-expression predicates in the
machine module, though neither is machine state: one reads the sheet's live
top, the other the step back. Both had one caller.

The spec pinned them to agree. One `collapsed` local, read by the header's
control and by the Escape ladder, makes that agreement structural instead;
`sheet.spec.ts` holds Escape in a browser.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
`LocatePhase` re-declared the four state names the machine config already
holds, so the union could drift from the states it names.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
`LocatorApi` annotated one local that was immediately spread into the
return, while the exported `Locator` is already `ReturnType<typeof
createLocator>`. The JSDoc moves onto each property, and the three casts
go with the derived phase union.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
`Widget.tsx` reaches this module before anything renders, so XState here
was ~12 KiB gzipped on every host page. Three states, one timer and no
invoked actor fit a plain table.

Every one of the 14 table cells the spec pins — the grace window, the
refusal, the key comparison and the documented insert-first failure —
passes against the rewrite unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
…ection

`use-turnstile.ts` rides in both eager graphs through the app-wide report
form, so XState here was the other ~12 KiB. The `solved` region flattens
to three state names, which leaves a seven-row transition table and one
timer.

Flat names also make the projection one expression per field, so
`challengeView`, `ChallengeView` and `UNMOUNTED_CHALLENGE` give way to
three `useActorSelector` reads with their own absent values. The hook no
longer subscribes to whole-snapshot identity.

The spec keeps all 21 cells and gains the handshake clock's survival of an
ignored event, `canSpend` as a closed set, and the store's notification.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
With xstate out of both eager graphs the payload measures 334.8/336.0 KiB
again — `main`'s own figure — so neither budget moves and the ledger gains
no row. `Widget.standalone.test.ts` drops `xstate` from the eager packages,
which is what proves the library left rather than the figures.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
The convention this PR added read as "every lifecycle is an XState
machine". Two of the four are plain tables now, because they ride in the
eager graph, and the rule that decides between the two shapes is the part
worth writing down: xstate is in neither eager graph and must stay out.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVwrUoHZT8qUrVTuA8
@sydevs-bot sydevs-bot changed the title refactor(state): make four implicit lifecycles explicit XState machines refactor(state): make four implicit lifecycles explicit state machines Nov 28, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

All seven threads adopted and resolved, each answered in place. Pushed as claude/relay-556-6570be3.

The big one: xstate is now in neither eager graph. ownership and challenge are hand-rolled transition tables (8c40577, 02d7821); locate and sheet keep XState, behind the lazy seam that already pays for it. The eager payload measures 334.8/336.0 KiB — main's own figure — so 2cc1af2 reverts the budget raise. The ledger thread dissolves with it: no raise, no row.

Streamlines: the two predicates are one collapsed local (859c961) · sheetStoreFor inlined (c6537e7) · LocatePhase derived (39d7a01) · LocatorApi dropped (229ff5c) · challengeView folded into three useActorSelector reads (02d7821). Title, body and the state rule follow in 6570be3.

Gates: lean gate ✓ · browser lane ✓ 40 · pnpm size ✓ · security sweep clean. Both tables were watched failing with a defect back.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 28, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 19431ec Nov 28 2026, 08:49 PM

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 28, 2026
@Ardnived
Ardnived added this pull request to the merge queue Nov 28, 2026
@Ardnived
Ardnived removed this pull request from the merge queue due to a manual request Nov 28, 2026
The owner chose XState for all four lifecycles and accepted the eager
budget raise it costs (+11.6/+11.8 KiB gzipped, budgets 349/350), so this
restores the ownership and challenge machines on XState, the budget row
and the eager-package pin, and the state rule's wording. It reverts
8c40577, 02d7821, 2cc1af2 and 6570be3; the sheet and locate
streamlines pushed with them stay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 28, 2026
@Ardnived

Copy link
Copy Markdown
Contributor Author

Owner decision: keep XState for all four lifecycles, ownership and challenge included, and accept the eager budget raise it costs (336 → 349, 338 → 350 KiB). One formalism was the explicit choice over the 11.6/11.8 KiB. f274fbb reverts the move to plain tables (8c40577, 02d7821, 2cc1af2, 6570be3). The sheet and locate streamlines stay. Please don't re-propose the tables on this PR.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 28, 2026
Both sides added a Changed entry and its link definition to CHANGELOG.md;
both are kept, newest PR first as the file orders them.

The per-edit selection-width pin went red on the merge alone. #556's
use-locate.test.tsx and #555's shared.search-pick.test.tsx each took a
slot on src/hooks/use-locale.ts, measured at 24 on either side and 25
together, which is the two-PR interaction docs/testing.md describes. The
hook measures 8.8s for that edit on 4 cores against a 12s budget, and
8.8s for src/config/i18n.ts, so the ceiling is ratcheted to 25 rather
than a spec dropped from the selection.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4W5etXifdPPHPNAJ
@sydevs-bot

Copy link
Copy Markdown
Contributor

Merged main in. It had moved one commit, #555.

CHANGELOG.md was the only conflict: both sides added a Changed entry and its link definition. Both kept, #556 above #555, as the file orders them.

The one failure was the merge's own. select-unit-specs.test.ts caps the per-edit spec selection, and each side measured 24 against a ceiling of 24 on src/hooks/use-locale.ts — #556's use-locate.test.tsx and #555's shared.search-pick.test.tsx each took a slot, so only the merge reached 25. docs/testing.md names that two-PR case and says to time the hook and ratchet, never to drop a spec. Timed on 4 cores: 8.8s for that edit against a 12s budget, and 8.8s for src/config/i18n.ts. Ceiling ratcheted to 25.

Lean gate green: lint, typecheck, 2887 passed, 1 skipped. Nothing here asks a question.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 28, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 28, 2026
@sydevs-dispatcher

Copy link
Copy Markdown
Contributor

Not required, so not blocking: Browser lane failed. A preview link in the body may not open until it passes.

🤖 sydevs dispatcher

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants