Skip to content

docs: reconcile OpenSpec, product docs, and the DOX chain with shipped code - #8

Merged
guilhermexp merged 5 commits into
mainfrom
docs/align-repo-documentation
Sep 3, 2026
Merged

guilhermexp merged 5 commits into
mainfrom
docs/align-repo-documentation

Conversation

@guilhermexp

Copy link
Copy Markdown
Owner

Intent

docs: reconcile OpenSpec, product docs, and the DOX chain with shipped code

The repo had three independent kinds of documentation drift, found by
auditing every change, spec, AGENTS.md, and product doc against the code on
main. The worst was not omission — it was documentation that actively
contradicted the app.

OpenSpec: 22 changes were fully implemented and merged but never archived,
so openspec/specs/ — the source of truth after archive — described 11
capabilities while ~18 live ones existed only as drafts under
openspec/changes/*/specs/. Archived them in three batches (usage, workers,
UI/chat/sync), validating --strict per change; specs went 11 -> 30 and only
two changes remain open, both legitimately: repair-native-runtime-integrity
(16/20, phase 1 still diagnosing RefCell reentrancy) and
unlock-chat-checkout-switching (0/9, the checkout lock is still in
crates/ui/src/pickers.rs:1253).

The canonical spec for omp-live-voice was the dangerous one: it carried
Purpose: TBD and forbade Live Voice during active runs, while the shipped
code allows it in Working and AwaitingInput
(crates/engine/src/sessions.rs, crates/harness/src/omp/live_voice.rs).
Anyone implementing against that spec would have coded the opposite of the
product. Archiving allow-live-voice-during-active-run and
fix-live-voice-delegation-continuity replaced it with the real contract.

elevate-workers-wait-ceiling-and-bridge-timeout proposed a 120s wait ceiling
that orchestrator-owns-workers-wait had already replaced with 4h. It was
archived only after the change that supersedes it, so
specs/workers-host-bridge now states WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS =
14400, not the dead 120s. Two tasks.md files (add-agy-worker-runtime,
polish-workers-subagent-widget) had every box unchecked against shipped,
tested code; boxes were ticked from verified evidence only.

Product docs: FUNCTIONAL-BASELINE.html still listed "TUI ratatui" as an
active feature and viewport, including in the Mermaid diagrams, for a crate
that was deleted; it now inventories 21 areas (3 OK, 18 PARCIAL) and covers
Workers, Live Voice, Chat Transcript Export, Projects Settings, Dev
Inspector, and Managed Provider Usage. New rows are PARCIAL, not OK, because
the file defines OK as runtime evidence in-session and these have none yet.
ARCHITECTURE.md was missing 4 of the 12 workspace members (comet-syntax,
zeron-theme, zeron-update, zeron-workers-unpeel) and the whole Trajectory
surface. ARCHITECTURE.md and docs/PARITY.md both claimed mobile was out of
scope while apps/ios/ ships a SwiftUI client with its own XCTest suite;
PARITY also omitted the OpenCode and OMP harness adapters and marked Token
Usage as dropped and the Idle Reaper as deferred, both of which shipped.

CONTEXT.md is the naming authority the root AGENTS.md makes mandatory
reading, and it lacked the terms the code uses daily: Worker/CLI Worker,
Live Voice, Degraded Interval, Raw Reveal. Each entry now states what the
term is NOT, like the existing Chat/Session and Managed Provider Usage
entries — that pairing is what keeps the collisions from coming back.

DOX chain: three AGENTS.md pointed verification at
crates/sync/tests/edge_convergence.rs, renamed to registry_edge.rs, so the
documented proof command did not run. apps/AGENTS.md claimed the iOS client
had no test suite (six XCTest files exist). crates/ui/AGENTS.md had five
Settings contracts stranded after the Child DOX Index, breaking the section
contract, and omitted the workers/ subtree it governs.

Docs only: no source file changed. openspec validate --specs --strict passes
30/30 and --changes --strict passes 2/2.

Contexto adicional de decisão (o intent acima é o registro da mudança): a auditoria que originou isto foi read-only e cruzou branches (só existe main), os 25 changes OpenSpec abertos, os 11 specs, os 21 AGENTS.md e as docs de produto contra o código. Decisões deliberadas: (1) arquivei orchestrator-owns-workers-wait ANTES do change superado elevate-workers-wait-ceiling-and-bridge-timeout, de propósito, para o spec final de workers-host-bridge dizer 14400s e não os 120s mortos; (2) as features que adicionei ao FUNCTIONAL-BASELINE.html entraram como PARCIAL e não OK porque a convenção declarada no próprio arquivo é que OK exige evidência de runtime na sessão; (3) deixei repair-native-runtime-integrity e unlock-chat-checkout-switching abertos porque são trabalho real que falta e arquivar seria mentir. Nenhum arquivo de código foi tocado, por isso não rodei cargo test; verificação foi openspec validate --specs --strict 30/30 e --changes --strict 2/2. O working tree do checkout principal tem trabalho não commitado do usuário em third_party/ (sync do unpeel) que NÃO faz parte desta mudança e por isso esta validação roda numa worktree limpa.

What Changed

  • Archived 22 fully shipped OpenSpec changes into openspec/changes/archive/2026-09-03-*, promoting their delta specs into openspec/specs/ (11 → 30 canonical specs). omp-live-voice now states that Live Voice is allowed during Working/AwaitingInput runs, workers-host-bridge carries the 14400s wait ceiling instead of the superseded 120s, and tasks.md boxes for add-agy-worker-runtime and polish-workers-subagent-widget were ticked against shipped code. Only repair-native-runtime-integrity and unlock-chat-checkout-switching remain open.
  • Updated product docs: FUNCTIONAL-BASELINE.html drops the deleted ratatui TUI and inventories 21 areas (Workers, Live Voice, Chat Transcript Export, Projects Settings, Dev Inspector, Managed Provider Usage added as PARCIAL); ARCHITECTURE.md lists all 12 workspace members and the Trajectory surface; docs/PARITY.md adds the iOS client, OpenCode/OMP adapters, and marks Token Usage and Idle Reaper as shipped; CONTEXT.md gains Worker/CLI Worker, Live Voice, Degraded Interval, and Raw Reveal entries; fork_changelog.md and README.zh-CN.md refreshed.
  • Fixed the DOX chain: apps/, crates/doc/, crates/sync/, edge/ AGENTS.md, openspec/project.md, and the doc comment in crates/engine/tests/workspace_sync.rs now point at crates/sync/tests/registry_edge.rs (renamed from edge_convergence.rs); apps/AGENTS.md documents the iOS XCTest suite; crates/ui/AGENTS.md moves the stranded Settings contracts above the Child DOX Index and adds the workers/ subtree.

Risk Assessment

✅ Low: Mudança docs-only cujos fix rounds foram verificados contra o código e contra o CLI: openspec/changes/ agora rastreia só os dois changes legítimos (git ls-files confirma o move), openspec validate dá 30/30 specs e 2/2 changes, a contagem do resumo (48 done + 1 changed shape = 49, 5 partial) bate com as tabelas, e as referências de código citadas (SESSION_IDLE em sessions.rs, update_provider_telemetry em activity_bridge.rs:510, view.rs:1455/1607, instance_lock.rs) existem onde o texto diz.

Testing

Confirmei que o diff é docs-only, rodei openspec list/validate --strict (2/2 changes, 30/30 specs) com transcript salvo, cruzei cada alegação do intent contra o código e os docs (ceiling 14400s, Live Voice em Working/AwaitingInput, stall watchdog, token usage refs, contagem 49/5 do PARITY, membros do workspace, termos do CONTEXT, XCTest do iOS), executei o comando de prova documentado na cadeia DOX para o zeron-sync (compila e roda, testes ignored por exigirem edge vivo, como o AGENTS.md declara) e renderizei o FUNCTIONAL-BASELINE.html no Chrome headless, capturando screenshot que mostra 21 áreas (3 OK, 18 PARCIAL) e o diagrama sem TUI; tudo bate com o intent e a árvore ficou limpa.

  • Evidence: FUNCTIONAL-BASELINE.html renderizado (21 áreas, 3 OK / 18 PARCIAL, diagrama sem TUI) (local file: ~/.no-mistakes/evidence/01M1JYT9CZSE7HBBHTF055FR93/functional-baseline-render.png)
Evidence: openspec list/validate --strict transcript

$ ls openspec/changes archive repair-native-runtime-integrity unlock-chat-checkout-switching $ openspec validate --changes --strict ✓ change/repair-native-runtime-integrity ✓ change/unlock-chat-checkout-switching Totals: 2 passed, 0 failed (2 items) $ openspec validate --specs --strict Totals: 30 passed, 0 failed (30 items)

$ ls openspec/changes
archive
repair-native-runtime-integrity
unlock-chat-checkout-switching

$ openspec list --changes
Changes:
  unlock-chat-checkout-switching      0/9 tasks     8m ago
  repair-native-runtime-integrity     16/20 tasks   8m ago

$ openspec validate --changes --strict
- Validating...
✓ change/repair-native-runtime-integrity
✓ change/unlock-chat-checkout-switching
Totals: 2 passed, 0 failed (2 items)
exit=0

$ openspec validate --specs --strict
✓ spec/worker-hibernation
✓ spec/workers-host-bridge
✓ spec/workers-widget-interaction
✓ spec/workers-widget-model-usage
Totals: 30 passed, 0 failed (30 items)
exit=

$ openspec list --specs | wc -l
      30
Evidence: Checagem das alegações do intent contra código e docs
## workers-host-bridge ceiling
33:The Workers controller MCP tool schema, `action=help` limits, and the runtime clamp for `wait_for_status` SHALL derive their maximum blocking wait from a single public constant (`WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS` = 14400, four hours) in `zeron-workers-unpeel`; the orchestrator chooses any `timeout_seconds` up to it and the default remains 30 seconds. The controller SHALL dispatch requests concurrently so a pending wait never blocks `stop_worker`, `archive_worker` or `ping`, SHALL honour `notifications/cancelled` by interrupting the pending wait without sending a response, and SHALL cancel pending waits when its input closes. A `timed_out: true` result SHALL carry a `next` field stating that the caller may wait again with a timeout sized to the work or end the turn and receive `[worker-task-notification]`.
36:Test: controller MCP integration test asserting schema `maximum`, `help` limits, and runtime clamp match `WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS`.
39:- **THEN** `timeout_seconds.maximum` equals `WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS` (14400)
40:- **AND** `action=help` reports `limits.wait_seconds` equal to `WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS`
63:When the Workers controller MCP is mounted into a native orchestrator runtime, the harness SHALL configure that runtime's MCP tool-call deadline to `WORKERS_CLIENT_DEADLINE_SECONDS` = `WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS + 60`: Claude via the `MCP_TOOL_TIMEOUT` environment variable (milliseconds) and Codex via the `mcp_servers.comet-workers.tool_timeout_sec` override. The harness constant SHALL be pinned to the controller constant by test.
(eval):3: no matches found: --include=*.rs

## omp-live-voice spec
11:The system SHALL offer Live Voice when an existing selected Chat is hosted on the current device, uses OMP, is not archived, has no other Live call, and the installed OMP advertises the capability required for the Chat's current Session state. Basic Live support SHALL permit start while the Session is `Idle`; starting while the Session is `Working` or `AwaitingInput` SHALL additionally require operational-context support. An `Idle` backend retained for warm OMP session reuse SHALL NOT count as active work. The system SHALL also offer the action on an OMP new-Chat draft targeting the current device; start-time validation remains authoritative.
13:#### Scenario: Working Session accepts Live
16:- **WHEN** an otherwise eligible local OMP Chat has a `Working` Session
23:- **WHEN** an otherwise eligible local OMP Chat has an `AwaitingInput` Session
32:- **AND** Live Voice SHALL be unavailable with actionable update guidance while the Session is `Working` or `AwaitingInput`

## DOX references to sync test
crates/doc/AGENTS.md:40:| Interop de shape com o edge | integration — pelo `crates/sync/tests/registry_edge.rs` | `cargo test -p zeron-sync` |
crates/sync/AGENTS.md:21:- Bug de "device sumiu" / "não converge": comece pelo `tests/registry_edge.rs`, que roda contra o edge real, antes de suspeitar do schema.
crates/sync/AGENTS.md:31:| `tests/registry_edge.rs` | e2e, `--ignored` por padrão; precisa de `wrangler dev` + `AUTH_MODE=dev` | `ZERON_EDGE_WS=ws://127.0.0.1:27640 cargo test -p zeron-sync --test registry_edge -- --ignored` |
edge/AGENTS.md:24:- Convergência com o cliente Rust se prova em `crates/sync/tests/registry_edge.rs`, não por inspeção.
registry_client.rs
registry_edge.rs

## iOS tests
apps/ios/ZeronTests/DeviceRelayClientTests.swift
apps/ios/ZeronTests/ChangeRequestTrackingTests.swift
apps/ios/ZeronTests/NetworkReliabilityTests.swift
apps/ios/ZeronTests/ChatFramesTests.swift
apps/ios/ZeronTests/RegistryDocTests.swift
apps/ios/ZeronTests/RegistryCoreTests.swift
19:- `apps/ios` não entra no `cargo build`; build e teste são pelo Xcode.
31:| `zeron/src/**` (wiring, dispatch) | none — casca fina; o comportamento é testado nas crates | `cargo build -p zeron` |
33:| `ios/**` (`apps/ios/ZeronTests/`) | unit / integration (XCTest: tracking de PRs/checkout, RPC/stream de device relay, gates de versão/resiliência de rede, wire layout de chat frames, merge/conformance de registry e persistência/HLC de RegistryDoc) | `xcodebuild test -project apps/ios/Zeron.xcodeproj -scheme Zeron -destination 'platform=iOS Simulator,name=iPhone 17 Pro'` ou Product → Test no Xcode |

## baseline ratatui/TUI
0
FUNCTIONAL-BASELINE.html

## PARITY watchdog / counts
docs/PARITY.md:12:| 1.1 Window shell | partial | gpui window, light/dark built-in and imported themes, accent/surface preferences, configurable interface typography, and external links via OS browser. Deferred: frameless-inset/traffic-light chrome (macOS packaging not executed), single-instance lock, dev-vs-packaged port split (env vars instead). |
docs/PARITY.md:48:| 3.1 Lifecycle | partial | Device registration, presence heartbeat (ephemeral, 15s), stale-session recovery, host-only doc executor with steer→new-turn fallback, single-instance data-dir lock. CLI auth decoupled from the daemon: `zeron login`/`logout`/`status` work on the persisted session and exit; headless TTY sign-in remains, and off-TTY (systemd/launchd) headless fails fast with "run `zeron login` first"; `zeron daemon install/start/stop/restart/status/uninstall` manages launchd / systemd `--user` units (install-time PATH captured into the unit for harness CLIs). Gaps: login-shell PATH capture for the headed app, crash shield, parent-PID watchdog. |
docs/PARITY.md:49:| 3.2 Sessions engine | done | Run journal on disk with crash recovery (aborted stamps), steering mailbox at step boundaries, doc hooks at boundaries, streamed part folding at STREAM_COMMIT_MS, idle reaper for parked persistent sessions (`SESSION_IDLE` 30 min, `crates/engine/src/sessions.rs`). The 10-min stall watchdog was deliberately not ported (rejected in review, see the module doc in `sessions.rs`): a live child is the working signal and every dying path carries its own visible error. Worker hibernation (`hibernation_candidates` / `idle_since_unix_ms`, `crates/workers-unpeel/src/lib.rs`, spec `worker-hibernation`) is a separate capability, not the session reaper. |
docs/PARITY.md:113:Table rows above: **49 done · 5 partial** (the `done (changed shape)` row counts as done), plus the cross-cutting deferrals
ARCHITECTURE.md:237:  reaper, 30min `SESSION_IDLE`; the 10min stall watchdog was deliberately not ported — see the

## workspace members
apps/zeron
crates/syntax
crates/theme
crates/proto
crates/doc
crates/sync
crates/harness
crates/engine
crates/rpc
crates/update
crates/workers-unpeel
crates/ui
apps/zeron
third_party/unpeel
third_party/rust/block-0.1.6
third_party/rust/proc-macro-error2-2.0.1
-- ARCHITECTURE mentions:
comet-syntax: 1
zeron-theme: 1
zeron-update: 1
zeron-workers-unpeel: 1
Trajectory: 7

## CONTEXT.md terms
89:## Workers
8
## PARITY row status count
  16 done
   4 partial

## PARITY line 12 in diff?
0

## CONTEXT.md terms
3:Comet coordinates native agent chats, local CLI Workers, and device-local provider account state.
41:**Degraded Interval**:
45:**Raw Reveal**:
50:Uma cópia do Chat Transcript num formato levável para fora do comet. Do transcript nunca carrega nada que o Chat Transcript já não mostre; a única fonte adicional é o índice de CLI Workers do Chat, que entra como Artifact.
54:Algo substantivo que um Chat produziu — um arquivo escrito, um subagente executado, um CLI Worker despachado, um output pesado o bastante para não caber inline. É o que um Chat Transcript Export lista no topo para o registro ficar navegável.
91:**Worker** / **CLI Worker**:
97:**Live Voice**:

## sessions.rs watchdog note
//! - recovery (interrupt or a stale journal at boot) stamps the streaming entry `aborted`.
//!
//! Scope notes: sessions are keyed by chat id (one live run per chat). Zeron's pulse
//! loop is ported as the 15s liveness heartbeat in `drive_run`; its stall watchdog is
//! deliberately NOT ported (rejected in review — agents may legitimately wait on
//! something for far longer than any timeout, and a live child IS the working signal).
//! Every dying path must instead carry its own visible error (child crash with stderr,

## code constant
crates/workers-unpeel/src/controller_mcp.rs:23:pub const WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS: u64 = 4 * 60 * 60;

## instance_lock
crates/engine/src/instance_lock.rs

## ui AGENTS child index / workers
38:- **Os dois terminais não compartilham transporte.** `crates/ui/src/terminal/panel.rs` (painel do chat) assina `SubscribeTerminal` e recebe **push** da engine; `workers/terminal.rs` (Codex, Claude Code, pi — todos os presets iguais, não há caminho por preset) **sonda** o journal de output do session host. Diferença de preset é ícone, cor e comando, nada de dado. Ao medir fluidez, medir o transporte, não o preset.
39:- O `NSStatusItem` da menu bar (`workers/menu_bar.rs`, ObjC via `msg_send!`, fora da janela gpui) mostra **spinner + contagem de agentes rodando** nos dois estados `Working`. A contagem é **anotação, não segundo símbolo**: 11pt contra os 15pt do spinner, separada por espaço fino, e **na mesma cor dele**. O tamanho é a única pista de hierarquia — sem tint nenhum atributo de cor é aplicado, então os dois herdam a cor adaptativa do botão, inclusive a inversão quando o popover realça o item. Um `secondaryLabelColor` na contagem já foi tentado e reprovado na tela: cinza demais para ler na menu bar, e cor cravada ainda desliga aquela inversão. Por isso `activity_menu::spinner_parts` devolve glifo e contagem **separados**: o range em UTF-16 sai daí, não de fatiar string pronta. A contagem viaja dentro da variante `Working { blocked, running }` de propósito: um contador paralelo sobreviveria ao estado que o justifica e pintaria número numa menu bar parada. `running` é `jobs.len()`, **não** o total de sessões — bloqueado e não-lido aparecem no popover mas não estão rodando. `Blocked`/`Unread` seguem com marcador fixo sem contagem, e as linhas do popover seguem com frame puro (cada uma é uma sessão só).
54:- **A ui fala com os Workers por uma instância só de `LocalWorkersClient`**: `workers/client.rs::shared()` (`LazyLock` + clone barato — a struct é quatro `Arc`). Terminal, model, resource monitor, workspace e Settings → Projects passam por ela; `LocalWorkersClient::new()` direto na ui volta a criar cliente com contador de request id próprio (`crates/workers-unpeel/AGENTS.md`).
171:## Child DOX Index
175:Subárvores sem doc próprio (ainda não têm regra local além da desta pasta): `shell/` (spaces, tabs), `terminal/` (emulator, panel, view), `settings/`, `markdown/`, `workers/` (model, client compartilhado, terminal de polling/journal, menus de sessão/projeto/workspace, menu bar status item e monitor de recursos — interface com `crates/workers-unpeel`). Os módulos-raiz `chat_export.rs`, `composer.rs`, `markdown_decor.rs` e `inspector.rs` (dev-only) também permanecem governados por este doc. Adensar aqui quando alguma subárvore ganhar contrato próprio.
1:## Child DOX Index
## PARITY all table rows by status column
  48 done
   1 done (changed shape)
   5 partial

- **E2EE** — transport is TLS + WorkOS bearers; end-to-end encryption of doc
  contents not designed.
- **macOS packaging execution** — config + steps in `dist/` only (needs a Mac).
- **Engine hardening**: parent-PID watchdog, crash shield, boot warm-open of
  recent chats.

## Summary

Table rows above: **49 done · 5 partial** (the `done (changed shape)` row counts as done), plus the cross-cutting deferrals
(mobile, E2EE, macOS packaging execution, engine hardening) — the last
overlaps the named gaps in the partial rows.
## PARITY token usage rows
73:| Containers (meta/messages/commands), LoroText bodies | done | Shape-compatible with TS `packages/session-doc`; `tokens` dropped per §8. |
99:| Token-usage display dropped | done | No WatchUsage, no doc `tokens`, no profile heatmap; rate-limit meters + Usage AgentEvent passthrough kept as specified. |
100:| Worker model/token usage (Workers widget) | done | Separate feature, spec `workers-widget-model-usage`: per-worker `total_tokens` + `model_usage` from provider telemetry (`update_provider_telemetry`, `crates/workers-unpeel/src/activity_bridge.rs:510`), p

## view.rs refs
        let collapsible = worker.total_tokens.is_some() && !worker.model_usage.is_empty();
                                        .child(format_token_total(usage.total_tokens)),

## baseline area counts
   7 OK
  24 PARCIAL
15
Evidence: Comando de prova documentado na cadeia DOX (crates/sync)
$ cargo test -p zeron-sync --test registry_edge
test two_rust_clients_converge_through_a_real_registry_do ... ignored, requires a live edge: set ZERON_EDGE_WS (e.g. ws://127.0.0.1:27640)
test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • 🚨 openspec/changes/add-agy-worker-runtime/tasks.md:13 - O intent exige que "only two changes remain open" e que openspec validate --changes --strict passe 2/2, mas o commit 96d50dd ainda rastreia os 23 diretórios originais em openspec/changes/ (git ls-tree confirma; só dois arquivos foram deletados: fix-dead-antigravity-error-and-workers-timeout/specs/antigravity-managed-usage/spec.md e polish-workers-subagent-widget/tasks.md). O archive foi commitado como cópia, não como move — as deleções ficaram fora do commit. Efeito observável: openspec list --changes mostra 25 changes; openspec validate --changes --strict dá 23 passed / 2 failed (elevate-workers-wait-ceiling-and-bridge-timeout e fix-live-voice-delegation-continuity falham porque os deltas MODIFIED agora colidem com o spec canônico já atualizado); polish-workers-subagent-widget fica aberto com "No tasks"; e as cópias abertas são versões PRÉ-edição (add-agy-worker-runtime aberto está 0/5, o arquivado 5/5; allow-live-voice aberto tem o header "Media and operational context remain transient" enquanto o canônico usa "Media remains inside OMP"). Um openspec archive futuro tentaria reaplicar os deltas em cima de specs que já os contêm. Contradiz diretamente o critério do intent; a remediação é mecânica (remover os 23 diretórios abertos — em todos os 14 casos que divergem, a versão arquivada é a mais nova e é a que foi aplicada ao spec canônico), mas por ser deleção em massa e contradição de intent, precisa de confirmação do autor.
  • ⚠️ docs/PARITY.md:49 - §3.2 passou para done afirmando "and stall watchdog", mas crates/engine/src/sessions.rs:15-17 diz que o stall watchdog foi "deliberately NOT ported (rejected in review)". É exatamente o tipo de doc-que-contradiz-código que o intent diz querer eliminar. O idle reaper existe, mas no próprio sessions engine (SESSION_IDLE de 30 min, sessions.rs:~2508), não em hibernation_candidates/idle_since_unix_ms de crates/workers-unpeel, que é hibernação de Worker (outra capability, spec worker-hibernation). ARCHITECTURE.md:237 (linha reescrita neste diff) também mantém "10min stall watchdog". Correção: citar o reaper de 30 min do sessions engine como evidência e registrar o stall watchdog como decisão explícita de não portar (mantendo-o fora de "Engine hardening" na linha 107 só se o texto disser que foi rejeitado, não que foi feito).
  • ⚠️ docs/PARITY.md:99 - A linha reescreve "Token-usage display dropped" como done, mas o item original é o display de token usage de Chat (WatchUsage, doc tokens, profile heatmap), que continua ausente e foi dropado por decisão de spec; o que shipou é o Worker model/token usage do widget de Workers (spec workers-widget-model-usage). Além disso as duas referências de linha estão erradas: activity_bridge.rs:1400 cai dentro de um teste (tempfile::tempdir() de fixture) e details_sidebar/view.rs:1623 é o contador de workflows/subagents/workers; a apresentação de tokens está em view.rs:1455/1607. Sugestão: manter o item de Chat como dropped e adicionar uma linha própria para Worker token usage com refs corretas — como isso muda a leitura de paridade do produto, precisa do autor.

🔧 Fix: drop copied openspec changes; fix stall watchdog and token-usage claims
2 issues (1 warning, 1 info) still open:

  • ⚠️ docs/PARITY.md:113 - O resumo diz "43 done · 6 partial", mas as tabelas acima têm 48 linhas done (49 contando a done (changed shape)) e 5 partial. O fix round só incrementou o done de 42 para 43 ao adicionar a linha de Worker token usage, mas esta mudança também flipou 3.2 de partial para done (6→5 partial) e adicionou as linhas OpenCode adapter e OMP adapter & Live Voice; além disso o número base já estava errado (42 vs 44 reais). É uma contagem que contradiz o próprio documento, o tipo de deriva que o intent existe para eliminar. Correção: reescrever como 48 done · 5 partial (ou 49 se contar a linha "changed shape"), contando pelas linhas das tabelas.
  • ℹ️ docs/PARITY.md:108 - A linha de "Engine hardening" (editada neste diff para remover idle reaper/stall watchdog) ainda lista single-instance lock como deferido, enquanto a linha 3.1 do mesmo arquivo o marca como entregue ("single-instance data-dir lock") e o código existe em crates/engine/src/instance_lock.rs (flock exclusivo em {data_dir}/engine.lock). Contradição pré-existente na base, mas está na mesma linha que a mudança reescreveu; a remoção do item da lista de deferidos é trivial e alinha com o objetivo declarado. Não bloqueia.

🔧 Fix: recount PARITY summary rows; drop shipped lock from deferred
1 info still open:

  • ℹ️ docs/PARITY.md:12 - A linha 1.1 Window shell ainda lista single-instance lock como deferido, enquanto 3.1 (linha 48) o marca entregue ("single-instance data-dir lock"), crates/engine/src/instance_lock.rs existe, e o fix round já removeu o mesmo item da lista de Engine hardening (linha 108). É a mesma contradição interna que a rodada anterior corrigiu, só que numa linha não tocada pelo diff. Remédio mínimo: retirar single-instance lock da lista de deferidos de 1.1. Não bloqueia.
✅ **Test** - passed

✅ No issues found.

  • git diff --name-only c99834d8..08593d00 filtrado por não-docs e third_party/ → vazio (docs-only confirmado)
  • ls openspec/changes e openspec list --changes → só repair-native-runtime-integrity e unlock-chat-checkout-switching
  • openspec validate --changes --strict → 2 passed / 0 failed
  • openspec validate --specs --strict → 30 passed / 0 failed; openspec list --specs → 30
  • grep de WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS/14400 em openspec/specs/workers-host-bridge/spec.md vs crates/workers-unpeel/src/controller_mcp.rs:23
  • grep de TBD/Working/AwaitingInput em openspec/specs/omp-live-voice/spec.md
  • Contagem de linhas de tabela por status em docs/PARITY.md (48 done + 1 done (changed shape) + 5 partial) vs resumo declarado
  • Verificação de docs/PARITY.md e ARCHITECTURE.md contra crates/engine/src/sessions.rs:12-18 (stall watchdog não portado) e existência de crates/engine/src/instance_lock.rs
  • Conferência de crates/ui/src/details_sidebar/view.rs:1455 e :1607 como refs de apresentação de tokens
  • grep de edge_convergence|registry_edge em todos os AGENTS.md + ls crates/sync/tests/ (só registry_edge.rs referenciado, arquivo existe)
  • cargo test -p zeron-sync --test registry_edge → ok, 0 passed / 0 failed / 2 ignored (exigem ZERON_EDGE_WS, conforme documentado em crates/sync/AGENTS.md)
  • find apps/ios -name '*Tests*.swift' → 6 arquivos XCTest, batendo com apps/AGENTS.md
  • Membros do workspace em Cargo.toml vs menções em ARCHITECTURE.md (comet-syntax, zeron-theme, zeron-update, zeron-workers-unpeel, Trajectory)
  • grep de termos Worker/CLI Worker, Live Voice, Degraded Interval, Raw Reveal em CONTEXT.md
  • Render headless do FUNCTIONAL-BASELINE.html no Chrome (screenshot 1280x6000) + contagem de células de status (3 OK / 18 PARCIAL) + grep de ratatui/TUI → 0
  • git status --porcelain ao final → árvore limpa, target/ ignorado
🔧 **Document** - 1 issue found → auto-fixed ✅
  • ℹ️ crates/engine/tests/workspace_sync.rs:8 - O doc comment //! em crates/engine/tests/workspace_sync.rs:8 ainda referencia o teste edge_convergence de zeron-sync, renomeado para crates/sync/tests/registry_edge.rs. Não editei porque a decisão registrada nesta run fixa a mudança como docs-only (nenhum arquivo de código). Correção trivial de uma palavra num comentário, sem efeito de comportamento, para um commit à parte.

🔧 Fix: point workspace_sync doc comment at registry_edge test
✅ Re-checked - no issues remain.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…d code

The repo had three independent kinds of documentation drift, found by
auditing every change, spec, AGENTS.md, and product doc against the code on
main. The worst was not omission — it was documentation that actively
contradicted the app.

OpenSpec: 22 changes were fully implemented and merged but never archived,
so openspec/specs/ — the source of truth after archive — described 11
capabilities while ~18 live ones existed only as drafts under
openspec/changes/*/specs/. Archived them in three batches (usage, workers,
UI/chat/sync), validating --strict per change; specs went 11 -> 30 and only
two changes remain open, both legitimately: repair-native-runtime-integrity
(16/20, phase 1 still diagnosing RefCell reentrancy) and
unlock-chat-checkout-switching (0/9, the checkout lock is still in
crates/ui/src/pickers.rs:1253).

The canonical spec for omp-live-voice was the dangerous one: it carried
`Purpose: TBD` and forbade Live Voice during active runs, while the shipped
code allows it in `Working` and `AwaitingInput`
(crates/engine/src/sessions.rs, crates/harness/src/omp/live_voice.rs).
Anyone implementing against that spec would have coded the opposite of the
product. Archiving allow-live-voice-during-active-run and
fix-live-voice-delegation-continuity replaced it with the real contract.

elevate-workers-wait-ceiling-and-bridge-timeout proposed a 120s wait ceiling
that orchestrator-owns-workers-wait had already replaced with 4h. It was
archived only after the change that supersedes it, so
specs/workers-host-bridge now states WAIT_FOR_STATUS_MAX_TIMEOUT_SECONDS =
14400, not the dead 120s. Two tasks.md files (add-agy-worker-runtime,
polish-workers-subagent-widget) had every box unchecked against shipped,
tested code; boxes were ticked from verified evidence only.

Product docs: FUNCTIONAL-BASELINE.html still listed "TUI ratatui" as an
active feature and viewport, including in the Mermaid diagrams, for a crate
that was deleted; it now inventories 21 areas (3 OK, 18 PARCIAL) and covers
Workers, Live Voice, Chat Transcript Export, Projects Settings, Dev
Inspector, and Managed Provider Usage. New rows are PARCIAL, not OK, because
the file defines OK as runtime evidence in-session and these have none yet.
ARCHITECTURE.md was missing 4 of the 12 workspace members (comet-syntax,
zeron-theme, zeron-update, zeron-workers-unpeel) and the whole Trajectory
surface. ARCHITECTURE.md and docs/PARITY.md both claimed mobile was out of
scope while apps/ios/ ships a SwiftUI client with its own XCTest suite;
PARITY also omitted the OpenCode and OMP harness adapters and marked Token
Usage as dropped and the Idle Reaper as deferred, both of which shipped.

CONTEXT.md is the naming authority the root AGENTS.md makes mandatory
reading, and it lacked the terms the code uses daily: Worker/CLI Worker,
Live Voice, Degraded Interval, Raw Reveal. Each entry now states what the
term is NOT, like the existing Chat/Session and Managed Provider Usage
entries — that pairing is what keeps the collisions from coming back.

DOX chain: three AGENTS.md pointed verification at
crates/sync/tests/edge_convergence.rs, renamed to registry_edge.rs, so the
documented proof command did not run. apps/AGENTS.md claimed the iOS client
had no test suite (six XCTest files exist). crates/ui/AGENTS.md had five
Settings contracts stranded after the Child DOX Index, breaking the section
contract, and omitted the workers/ subtree it governs.

Docs only: no source file changed. openspec validate --specs --strict passes
30/30 and --changes --strict passes 2/2.
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown

Too many files changed for review (134 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 173be049-22a0-498b-857a-a41623c5f9c3


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.

@guilhermexp
guilhermexp merged commit 8f5407e into main Sep 3, 2026
1 check passed
@guilhermexp
guilhermexp deleted the docs/align-repo-documentation branch September 3, 2026 06:49
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