Repository navigation
feat(director): Tell a wake what the verb found, the streak, and the last 12s - #1425
Merged
Merged
Conversation
…last 12s The Engine answers a verb before the Director hears it, so a wake read the State after the verb: poked awake said `state: idle`, pulled off the wall said `state: held`, and a third poke read like the first. `director::Recency`, one per Instance, is fed every tick and read when a wake is built. The follow-up gains, each only when it adds something: - `was:` the State and Behavior the latest gesture found - `poked (3 in a row)` when the same verb came again within 12s - `doing:` the Behavior playing at the wake - `lately:` up to five States and Behaviors entered in the last 12s No timestamps or ages. Closes #1380.
omesser
commented
Oct 8, 2026
omesser
left a comment
Owner
Author
There was a problem hiding this comment.
Soft CLEARED
0a4848e7f8b555a19ca5a602a5dad5d317b732d5
What changed
- Recency: One per Instance. Fed once per tick after the Engine. Read into
Context.latelywhen a wake is built. - Wake lines:
was:for what the gesture found, a streak suffix onwhat just happened,doing:for the Behavior playing, andlately:for up to five steps in the last 12s. - Instant react: Unchanged. The Engine is untouched.
- Proof: Six scenario tests drive the real Engine for asleep, streak, and mid-climb. Live Xvfb payloads in the PR body cover streak and mid-climb.
What is wrong
- None.
Soft-FIX
None.
Non-blocking
- Ambient drift:
doing:andlately:also ride ambient follow-ups. That is fine. To the user Fidget and its AI are one character, so a true recent window on ambient is useful and a gate would only add a branch. - Asleep live: Proven on the real Engine in the unit test. Live Xvfb could not hold idle for 60s under the Static Director. Acceptable.
— Cursor agent (Architect), on @omesser's behalf.
This was referenced Oct 8, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The Engine answers a verb before the Director hears it. A Poke plays
reactand wakes a sleeping sprite on the same tick, and a Grab takes the sprite off the wall. The wake is built after that tick, so the model only ever saw the result:state: idle, neverasleep.picked up/state: held, with nothing about the climb.recentcould not help. It lists Behaviors the Engine played from proposals, never the Engine's ownreact, and it can be hours old.What changed
director::Recencyholds one Instance's last few seconds. The frame loop feeds it once per tick, after the Engine, with that tick's verbs andFrame. It counts a streak each timetouchednames a verb, and the wake reads it into a newContext.lately.follow_upturns that into at most four additions, each shown only when it says something new:was:was: asleep,was: idle, doing walk)poked (3 in a row)what just happeneddoing:lately:held → climbing → held)Decisions a reviewer would otherwise have to dig out:
held. A snapshot nobody reads is dropped after 12s, so a grab with no wake does not turn up aswas: heldon the next ambient wake.touched, so the first click of a double-click does not count.lately:to about 20 tokens.reactis unchanged. The Engine is untouched.Not done:
doing:andlately:go on every follow-up, ambient included, rather than only on reactive wakes. On an ambient wake two or more minutes after the last one they are usually empty, and when they are not, they are still true. Adding a gate would only add a branch. Say if you want one.How to verify
cargo test -p fidget-core recencyruns six tests. Each drives the realEngineandRecencythe way the frame loop does, and compares the wholefollow_upstring:poked_awake_the_wake_says_it_was_asleepeach_poke_in_a_row_is_counted_and_a_pause_starts_overpulled_off_the_wall_mid_climb_the_wake_says_it_was_climbinga_poke_ends_a_behavior_and_the_wake_says_which(the Poke clearsplaying_behavior, so onlywas:still names the walk)a_verb_no_wake_read_is_forgotten_with_the_windowa_busy_window_hands_the_wake_its_last_five_stepsMutation check: I broke each of these and every one turned at least one test red: the snapshot, the streak, the expiry, the five-step cap, and snapshot-per-gesture (swapped for first-verb-wins).
Live run on Linux under Xvfb, debug build, with an HTTP Director pointed at a local stub that logs every request. I clicked and dragged with
xdotool. Excerpts from the payloads it received:Poked while asleep was proven only in the unit test. Live, the Static Director keeps Buddy Bot busy, so it never stays idle for the 60s it takes to fall asleep.
Full suite:
cargo test --workspace --no-fail-fastpasses everywhere exceptfidget --bin fidgeton this box. There, the threelinux_secret_servicetests fail because the box has no secret service.public_double_click_interval_is_cached_and_resolvedfails under parallel GTK and passes when run alone under Xvfb. None of those four touch this change.pre-commit run(fmt, clippy-D warnings, codespell, ast-grep) is clean.Closes #1380
— Cursor agent (Coder), on @omesser's behalf.