Skip to content

fix: repair release validation and desktop restoration - #694

Merged
pedronauck merged 2 commits into
mainfrom
fix/attention-ledger-ci
Oct 6, 2026
Merged

pedronauck merged 2 commits into
mainfrom
fix/attention-ledger-ci

Conversation

@pedronauck

@pedronauck pedronauck commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What & why

Corrige as falhas de validação na main, na release #688 e neste PR após a atualização de dependências em #692:

  • Cancelar uma lane de run-agent inseria uma limpeza genérica antes do encerramento terminal do vínculo. A inserção idempotente preservava a causa errada. A transação agora captura a sessão endereçada, encerra o vínculo e só então preenche as limpezas restantes, preservando sessão e época.

  • Os leitores SSE dos testes HTTP/UDS podiam ficar presos no encerramento do corpo com o transporte do Go 1.27. Os helpers agora cancelam o contexto da requisição antes de fechar o corpo. A reprodução falhou 10/10 vezes antes e passou 10/10 depois, com prazos e assertivas originais.

  • O cenário de sino desconectado interrompia um endpoint antigo do catálogo, enquanto o sino consumia o ledger de notificações normalmente. O teste existente agora interrompe o endpoint realmente consumido e observa a falha antes de conferir o aviso.

  • A restauração de janelas montava um desktop vazio e seu composer quando o snapshot chegava antes da configuração do layout. A projeção agora espera essa configuração antes de expor os desktops; o limite de 500 ms e as assertivas de geometria permanecem iguais.

  • O teste de segurança do Electron enviava o segundo atalho sem recuperar o foco nativo após abrir DevTools em uma janela separada. O cenário agora observa o foco da janela do produto antes de injetar o atalho, como exige a API do Electron.

Implementação e verificação executadas com Codex.

How you verified it

  • E2E Web oficial, shard 1: 79 testes passaram; três skips existentes.
  • E2E Web oficial, shard 2 no head 61a44e350: 83 testes passaram (14,4 min). A restauração das 12 janelas levou 72,9 ms, mantendo o limite de 500 ms; nenhuma tarefa de arraste excedeu 50 ms.
  • Suítes HTTP/UDS de stream e SSE com race passaram.
  • Suítes de vínculo, atomicidade de cancelamento e autoridade de encerramento com SQLite real e race passaram; a regressão existente também confere a sessão retornada.
  • make gate: passou; lint Go sem problemas, testes API/store com race e lane Web (lint/typecheck/test/codegen) verdes.
  • CI Linux no mesmo head: shard Web 2 aprovado, 83 testes (13,7 min); restauração em 397,9 ms e nenhuma tarefa de arraste acima de 50 ms. Job 112135716565.
  • Regressão de prontidão na suíte existente de hooks: falha com o código anterior; 57 testes passam com a correção através de Turbo. Perfil local com CPU 5x: 494,9 ms antes e 406,9 ms depois (medições individuais, sem substituir CI Linux).
  • E2E empacotado de segurança do Electron: três repetições passam no macOS; a reprodução anterior também passava localmente. No CI Linux do head 61a44e350, os 30 testes desktop passaram, incluindo E2E-034 (12,9 s) e a estabilidade de uma hora. Job 112135716585.
  • React Doctor: 100/100, sem problemas.
  • O verificador heurístico de formato mantém 14 achados preexistentes na suíte UDS; apenas seu helper de requisição mudou.

Evidência e cenários atualizados em docs/qa/reports/2026-10-05-dependency-upgrades.md, RT-web-attention-bell-jump.md e LP-per-lane-node-control.md.

CI final do head 61a44e35093589865c44dc20e9625bf751ff9bc2: 33 checks aprovados, 17 skips esperados, nenhuma falha ou pendência. CodeRabbit aprovou esse head e não há threads abertas.

Impact

A correção interna afeta a limpeza de sessões ao cancelar uma lane pelo Web, CLI, HTTP/UDS ou compozy__loop_node_cancel. Formatos públicos, isolamento por workspace, época do vínculo, hooks, configuração, esquema SQLite e skills permanecem compatíveis. A prontidão da projeção Web é interna e o ajuste de foco afeta somente a preparação do teste Electron. Auditoria registrada em docs/_memory/change-impact.md; sem alteração necessária no site. Nota de release incluída.

  • make gate passes locally; this PR is delivered only after its required CI checks are green
  • New or changed behavior is covered by tests, or I explained above why not
  • If an agent wrote or co-wrote this, I named it above and verified the result myself

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
compozy-site Ready Ready Preview Oct 6, 2026 6:17am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: compozy/compozy/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12f05f33-56ae-455c-b884-5bd0fffe5661
📥 Commits

Reviewing files that changed from the base of the PR and between 5ccaf6e and 61a44e3.

⛔ Files ignored due to path filters (5)
  • .release-notes/window-restore-readiness.md is excluded by !**/*.md
  • docs/_memory/change-impact.md is excluded by !**/*.md
  • docs/qa/reports/2026-10-05-dependency-upgrades.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-electron-session-copy-debug.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-web-desktop-shell-lifecycle.md is excluded by !**/*.md
📒 Files selected for processing (3)
  • desktop/e2e/_electron/__tests__/shell.spec.ts
  • web/src/systems/os/hooks/__tests__/os-interaction-hooks.test.tsx
  • web/src/systems/os/hooks/use-os-win-layer.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

Integration request helpers now cancel request contexts on errors and response-body closure. Node-lane cancellation returns session IDs from cancellation preparation and enqueues cleanup sessions. The desktop projection waits for window-manager configuration, and the related E2E and hook tests were updated.

Changes

Integration request cleanup

Layer / File(s) Summary
Request context lifecycle
internal/api/httpapi/helpers_integration_test.go, internal/api/udsapi/udsapi_integration_test.go
Both integration request helpers use test-derived cancellable contexts. They cancel on request or client errors and when the response body closes.

Node-lane cancellation

Layer / File(s) Summary
Prepare and enqueue lane cancellation
internal/store/globaldb/global_db_loop_cancel_lane.go, internal/store/globaldb/global_db_loop_cancel_sessions.go, internal/store/globaldb/global_db_goal_binding_integration_test.go
Cancellation preparation returns session IDs and errors, then enqueues cleanup sessions with the stop cause. The integration test checks that the result contains exactly the lane’s bound session ID.

Electron DevTools E2E test

Layer / File(s) Summary
Focus product window before shortcut
desktop/e2e/_electron/__tests__/shell.spec.ts
The test focuses the product window and its web contents, then waits for native focus before sending the shortcut that closes DevTools.

Desktop projection readiness

Layer / File(s) Summary
Gate desktop layers on configuration
web/src/systems/os/hooks/use-os-win-layer.ts, web/src/systems/os/hooks/__tests__/os-interaction-hooks.test.tsx
The hook returns no desktop layers until window-manager configuration is available. The test checks that restored desktops appear with their frame and active and visible state after configuration and live hydration.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 61a44

The reviewed changes show no actionable issue that should prevent merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5ccaf

The change repairs cleanup precedence while preserving transactional cancellation. No introduced security weakness was established, but incomplete verification of downstream stopping authority and older-session behavior prevents a minimal-risk assessment.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — Session discovery remains run/workspace/node/item scoped but is not generation-scoped. Historical matching worker sessions can therefore remain candidates under the pre-existing selection rules. The base already enqueued and returned that source set; the PR does not introduce those broader predicates. Their production occurrence and intended policy remain unresolved.

Trust Boundaries and Controls

  • observed — The store rejects a run/workspace mismatch. Binding sources require run-owned creating or active bindings; worker sources require the addressed workspace and run and exclude the run's origin session. Terminal binding settlement resolves the current lane's task run and binding epoch before producing cleanup.

Resilience and Maintainability Implications

  • observed — Durable cleanup survives interruption after commit. The relay polls unacknowledged obligations, performs bounded stop attempts, and acknowledges successful or already-absent/inactive sessions. Other stop failures and acknowledgement failures leave obligations available for retry. Startup reconciliation releases pending stop/create races before delivery begins.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the validation fixes and desktop restoration changes described in the PR objectives.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 61a44e3.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes release validation and desktop window restoration.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR corrects run-agent lane cleanup ordering, stabilizes HTTP/UDS stream-test shutdown, updates the attention-bell failure injection, delays desktop rendering until layout configuration is ready, and restores native focus in the packaged Electron shortcut test.

Reviews (2) · Last reviewed commit: "fix: repair desktop restoration and nati..."

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 6, 2026
@pedronauck pedronauck changed the title fix: repair release validation and lane cleanup ownership fix: repair release validation and desktop restoration Oct 6, 2026
@pedronauck
pedronauck merged commit 9d842ad into main Oct 6, 2026
65 of 68 checks passed
@pedronauck
pedronauck deleted the fix/attention-ledger-ci branch October 6, 2026 07:43

This branch was successfully deployed

1 active deployment
Preview — 61a44e35 Deployed Oct 6, 2026 by vercel[bot]
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.

1 participant