Skip to content

feat(floating-mascot) : sommeil évident pour chaque personnage - #454

Merged
jencryzthers merged 2 commits into
mainfrom
cursor/floating-mascot-sleep-ff5b
Oct 14, 2026
Merged

jencryzthers merged 2 commits into
mainfrom
cursor/floating-mascot-sleep-ff5b

Conversation

@jencryzthers

@jencryzthers jencryzthers commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Résumé

Le sommeil de la mascotte flottante se lit d’un coup d’œil, pour chaque personnage (le crabe en premier) : personnage un peu atténué, « z Z » à côté de la tête, face endormie du crabe (yeux fermés, jamais effacés par un clignement) et respiration lente. Avec le mouvement réduit, le « z Z » reste statique.

Cette PR ne touche pas au placement hors du Dock. Ça reste dans #448.

Comportement

  • mascotAsleep (sleep.ts) : pose sleep du cerveau, ou l’activité sleep du personnage, sauf pendant un transport (glisser, marche, vol).
  • La scène porte data-asleep et les glyphes z z Z (data-sleep-glyphs).
  • Le crabe dessine une barre 4×1 sur la rangée du bas de l’œil ; le souffle continue ; un clignement ne rouvre pas l’œil.

Preuve

Les tests de cette PR, posés sur origin/main (e36f6f6f5, sans sleep.ts ni face asleep du crabe) :

pnpm exec vitest run src/components/floating-bots/sleep.test.ts src/components/crab-moves.test.ts src/components/crab.test.ts --reporter=verbose

Rouge :

 RUN  v5.0.3 /tmp/sagax-main-red

 × src/components/crab.test.ts > Crab's look > maps the app's states to its faces 6ms
   → expected 'sleepy' to be 'asleep' // Object.is equality
 × src/components/crab-moves.test.ts > Crab's rig > shows a move's face, still, under reduced motion 5ms
   → expected 'sleepy' to be 'asleep' // Object.is equality

 FAIL  src/components/floating-bots/sleep.test.ts [ src/components/floating-bots/sleep.test.ts ]
Error: Cannot find module './sleep' imported from /tmp/sagax-main-red/src/components/floating-bots/sleep.test.ts
 ❯ src/components/floating-bots/sleep.test.ts:12:1
     12| import { mascotAsleep } from "./sleep";
       | ^
Serialized Error: { code: 'ERR_MODULE_NOT_FOUND' }

 FAIL  src/components/crab-moves.test.ts > Crab's rig > shows a move's face, still, under reduced motion
AssertionError: expected 'sleepy' to be 'asleep' // Object.is equality
Expected: "asleep"
Received: "sleepy"
 ❯ src/components/crab-moves.test.ts:139:50
    139|     expect(crabReducedFace("sleep")?.expression).toBe("asleep");

 FAIL  src/components/crab.test.ts > Crab's look > maps the app's states to its faces
AssertionError: expected 'sleepy' to be 'asleep' // Object.is equality
Expected: "asleep"
Received: "sleepy"
 ❯ src/components/crab.test.ts:126:47
    126|     expect(crabExpressionForMood("sleeping")).toBe("asleep");

 Test Files  3 failed (3)
      Tests  2 failed | 26 passed (28)
   Duration  5.57s

Sur cette branche (3166e1da1) :

pnpm exec vitest run src/components/floating-bots/sleep.test.ts src/components/crab-moves.test.ts src/components/crab.test.ts --reporter=verbose

Vert :

 Test Files  3 passed (3)
      Tests  35 passed (35)
   Duration  5.47s

Dont, tous verts :

  • asleep, for every mascot > is its own nap, or the brain's sleep pose while it rests
  • marks the stage asleep and floats the z Z glyphs beside the head
  • under reduced motion keeps the glyphs and the closed eyes (static)
  • draws the desktop crab with closed eyes
  • closes its eyes: a 4x1 dash on the eye's lower row, never a squint, a lid or nothing
  • breathes slowly, one whole cell, with the eyes drawn closed and never blinked away
  • shows the closed eyes on the app's avatars too (the CSS idle, sleeping)

pnpm lint, pnpm typecheck et pnpm i18n:check ont passé au git push (crochet pre-push).

Pas de captures animées dans cet environnement (pas d’Electron réel pour le sommeil).

Checklist

  • pnpm typecheck passe (crochet pre-push)
  • Tests du sommeil et du crabe passent (35)
  • pnpm test complet
  • Pas d’édition de dist-server/
  • Pas de secret

Sleep (every character, crab first):
- sleep.ts mascotAsleep: the nap or the brain's sleep pose while resting
  (never dragged, walking or flying); the stage carries data-asleep.
- Shared layer: dimmed character, bold outlined floating "z Z" beside the
  head; reduced motion shows a static "z Z" and keeps the closed eyes.
- Crab: new "asleep" face (closed eyes as a 4x1 dash, never blinked away),
  sleep move breathes one whole cell over 4.2 s; CSS avatars match.

Placement off the Dock lives on fix/floating-mascot-dock (PR #448).

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
@jencryzthers
jencryzthers marked this pull request as ready for review October 14, 2026 12:23
Keep both the dock cluster placement from #448 and the sleep glyphs.
@jencryzthers
jencryzthers merged commit 89a0bd1 into main Oct 14, 2026
22 of 29 checks passed
@jencryzthers
jencryzthers deleted the cursor/floating-mascot-sleep-ff5b branch October 14, 2026 13:04
jencryzthers added a commit that referenced this pull request Oct 14, 2026
## Quoi

Bump de version, comme #421 pour 0.5.1 :

- `package.json` : `forkVersion` 0.5.2
- `ios/project.yml` : `MARKETING_VERSION` 0.5.2 (même version que le
desktop), `CURRENT_PROJECT_VERSION` 30, sur les quatre cibles
- `docs/releases/0.5.2.md` : notes complètes FR et EN (affichées dans
l'app avant et après la mise à jour), qui complètent celles de #458 avec
tout ce qui est entré depuis 0.5.1 : voix (#427, #435, #422/#424, #450,
#451, #458), démarrage serveur (#433, #460), approbations (#455),
modèles (#462, #466), sandboxes Kubernetes (#463, #465), image Docker
(#436, #444, #456), sécurité (#445), interface (#423, #425, #448, #454,
#461)
- `src/lib/bundled-release-notes.test.ts` : vérifie les nouvelles
entrées

NE PAS fusionner sans le GO de JC : la fusion sur main (changement de
`package.json`) lance `release.yml`.

## Prérequis avant la release

- Créer le secret de dépôt `TRIVYIGNORE_PRIVATE` (#456) : absent ou
vide, `docker.yml` échoue fermé sur le tag.

## Tests locaux (candidat, Node 26.11, macOS)

- `pnpm test:unit` : 8 shards, 1474 fichiers, exit 0
- `pnpm exec vitest run src/lib/bundled-release-notes.test.ts` : exit 0
- `pnpm test:shards` (tous les groupes) lancé avant #466 : exit 1. Les
échecs déterministes sont corrigés par #466 ; restent des e2e qui
passent seuls (charge des 8 shards) et
`server/codex-review.e2e.test.ts`, qui échoue sur ce Mac aussi au tag
`pulsa-v0.5.1` (Node 24 et 26).
- Tests Swift non lancés.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jean-Christophe Proulx <jencryzthers@Jean-Christophes-Macbook-Pro.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jencryzthers added a commit that referenced this pull request Oct 27, 2026
…onment (#1212)

Companion of pulsatrixtechnologies/perspicax#462 (a member manages their
own things, #454).

## Cause

The Perspicax console lets a person power their own server environment
("my computer"). The admin API only had `min: "admin"` on the computers
routes, so Perspicax signed those requests with the admin role after
checking the owner on its side: a general elevation for a narrow need.

## Fix

- `server/oidc-rp.ts`: the console assertion may carry a `grant` claim
`{ "kind": "own-computer", "method", "path" }`. The parsing is strict:
exactly those three keys, a known kind, `GET` or `POST`, and a path of
id characters at most 256 long with no `..`. Any other shape refuses the
assertion.
- `server/org-admin-console.ts`: a route may declare `ownerGrant`, and
`ConsoleContext.ownOnly` is set when the call passed through it.
- `server/org-admin-routes.ts`: below a route's role, only a grant bound
to this very request lets the call through. The grant must have the
route's kind, the same method and the same path below `/api/org/admin/`.
It never raises the role.
- `server/org-admin-computers.ts`: `GET computers`, `GET computers/{id}`
and `POST computers/{id}/start|stop|pause|resume|reset` declare
`own-computer`. Under `ownOnly`, the list keeps the viewer's own
computers and anyone else's computer is `404`. `update` and `delete`
take no grant.
- `docs/org-admin-api.md`, with `knowledge.generated.json` regenerated.

Nothing changes for an admin or for an assertion without a grant.

## Checks

- `tsc -p tsconfig.server.json --noEmit` is clean.
- `check:terms` is clean.
- No tests were run (the maintainer's rule for this pass: one full pass
at the release cut).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jean-Christophe Proulx <jencryzthers@JeanChrophesMBP.localdomain>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jencryzthers added a commit that referenced this pull request Oct 27, 2026
… role (#1217)

Follow-up of #1212. Companion of the matching Perspicax PR (a member
manages their own things, Perspicax #454).

## Cause

After #1212, a person's own computer was reached with their own role and
an `own-computer` grant. Their own bots and routines were still reached
with the Manager role (Admin for a bot's stop, delete, package,
incidents, logs and activity), after Perspicax had checked the owner.
That is a role above the person's own.

## Fix

- `server/oidc-rp.ts`: `CONSOLE_GRANT_KINDS` adds `own-bot` and
`own-routine`, with the same strict `{ kind, method, path }` shape bound
to one request.
- `server/org-admin-routes.ts`:
  - `grantCovers(grant, kind, method, sub)` is shared by every route.
- Under a grant, the reach is the person alone and a bot is visible only
when they own it, not when it is shared with them.
- The built-in routes `GET bots`, `GET usage` and `GET audit` take
`own-bot`. The list keeps the person's own bots and the usage keeps the
rows of their own bots. The audit needs `target`, a bot of their own,
else `404`.
- The file browser `files/{bot}/*` takes `own-bot` below manager, for a
bot of their own.
- `server/org-admin-bots.ts`: `bots/{id}`, `avatar`, `package`, `clone`,
`archive`, `restore`, `model`, `stop` and `delete` declare `own-bot`.
Under the grant, a copy naming another owner is `403`. `transfer`,
`bulk` and `import` take no grant.
- `server/org-admin-routines.ts`: `routines`, `routines/{id}`, `runs`,
`run` and `pause` declare `own-routine`. Under it, only a routine of the
person's own bot is visible.
- `server/org-admin-ops.ts` and `server/index.ts`:
- `logs` and `incidents` declare `own-bot`. Under it, they keep the
lines and incidents of the person's own bots, through the new
`botsOwnedBy` dep, which fails closed when it is absent.
- `docs/org-admin-api.md` (a table of the grant kinds and their routes)
and `knowledge.generated.json` regenerated.

Nothing changes for a caller whose role suffices, or for an assertion
without a grant. Once both PRs are deployed, the member's console
behaves as today.

## Checks

- `tsc -p tsconfig.server.json --noEmit` is clean.
- `check:terms` is clean.
- The pre-push hooks are green.
- No tests were run (the maintainer's rule for this pass).

Deploy together with the Perspicax PR: without this one, a member's own
bots and routines answer `403`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jean-Christophe Proulx <jencryzthers@JeanChrophesMBP.localdomain>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants