Commit graph

135 commits

Author SHA1 Message Date
Pascal André
32f2961329
fix(missions): make the tree behave like the session list (#1402)
## Summary

Follow-up to #1318: the delivered Missions tree diverged from the
session list it was modelled on. This brings it in line with the issue's
design.

- **One selection, session-list highlight.** The panel selects a row
**or** one task, never both. A click only selects; only the chevron (the
session list's own `SessionExpander`) expands. Expanded rows are kept
per project. A Mission without tasks has no chevron: summaries now carry
an optional `taskCount`.
- **Tasks are session-list rows**, nested one level, with the same
height, separators, rollover and highlight.
- **The eye is a mode.** Pressed, the central reader shows the selection
(a Mission's overview, or the task's reader) and follows each new
selection. Released, it closes. A selected task takes the header
toolbar.
- **Colours agree.** The chevron uses the task rows' own states
(`missionTaskRowState`): input, then active, then unseen finished.
- Finished tasks stay **green until seen**. Selecting one, clicking its
icon or sweeping across icons greys it. The chevron's right-click **Mark
as read** clears a Mission's tasks and its own completion.
  - Tasks not started yet are **blue**.
- **No text under rows.**
- Command progress and errors are announced and appended to the primary
button's tooltip; their actions stay visible.
  - The empty-plan and loading lines are gone.
- Delete happens at once. Deleting task conversations is a Settings ›
Missions checkbox, and the delete form only appears on failure.
- **Dependency rail.** Lanes start under the Mission chevron with a
fixed step. Rows move over when the lanes need more room, instead of
lanes merging at the panel edge.

![A task selected under its Mission, the eye pressed and the reader
following it, the dependency rail under the chevron (real dev
instance)](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/53d37ad19ed2994b9df859fa338f4c31a09b4726/pr-assets/missions-tree-parity.png)

![Task rows as session-list rows with a single highlight (real dev
instance)](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/53d37ad19ed2994b9df859fa338f4c31a09b4726/pr-assets/missions-tree-task-selected.png)

Not in this PR: a recurring Mission listing its passages as children
(#1318) needs a passage listing the panel does not have yet. It follows
separately.

## Docs

- `dev-docs/MISSIONS.md` describes the selection, expansion, eye,
colour, seen and deletion model.
- The Missions help (ten locales) covers the same.

## Validation

- Missions browser tests migrated to the new behaviour.
- New `mission-tree-parity.test.ts`, every test failing on the previous
UI:
  - single highlight;
  - chevron-only expansion;
  - the eye following the selection;
  - chevron colours from task states;
  - unseen tasks and Mark as read;
  - leaf Missions;
  - immediate delete honouring the preference;
  - feedback in the tooltip.
- Missions, session and automation browser suites: 669/670. The
schedule-list cold-start timeout passes alone (37/37).
- Server mission tests, plus a `taskCount` test.
- UI and server typecheck; `npm run test:help`.
- `tests/browser/mission-control.test.ts` is about 1,700 lines.
2026-11-09 01:12:21 +01:00
Pascal André
d9998432a0
feat(sessions): archive and restore native conversations (#1406)
## Summary

Closes #929 and #1207 by using the native archive/restore API already
present in OpenCode 2.2.3. The 2.2.6 `run --archived` announcement adds
CLI convenience; no minimum or dependency bump is required.

- Session row **Archive session / Restore session** actions and an
**Archived** badge.
- Search-local **Unarchived sessions / Archived sessions / All
sessions** selector.
- Hide idle archived branches in normal browsing and session-list
cycling; preserve selected conversations and paths to running work or
pending requests. Children retain independent native flags and remain
independently searchable.
- Serialize native writes, follow with ordinary authoritative inventory
refresh and verify the flag. Failed/uncertain writes never synthesize
local archive state or replay automatically.
- Project archive events and fence older metadata reads; retain complete
native inventory for ownership and recovery.
- Technical docs and help in all ten locales; native minimum/latest
coverage in CI.

## Validation

- Official isolated **2.2.6 and 2.2.3** CLI probes pass archive/restore,
filtered cursor pagination, unfiltered listing, persisted flag,
idempotent events, retained transcript and unchanged child flag, with no
archive-induced model execution.
- **132** targeted UI/store/recovery/pagination tests pass; **61** proxy
ownership tests pass.
- Workspace typechecks and **31** help tests pass.
- Main real-browser archive/restore/search/failure journey passes, as do
existing search and child-activity checks. Final compact-menu/delete
reruns are in progress.
- The repository fixture-wiring checker reports two pre-existing
violations in unchanged WebKit automation tests
(`automation-webkit-geometry.test.ts`,
`automation-webkit-page.test.ts`); the new browser fixture uses the
shared daemon and navigation budget.

Native probes use synthetic private databases and a local provider,
never the shared daemon or user state. Large existing touched files:
`session-list.tsx` (~1168 lines), `session-events.ts` (~732),
`session-state.ts` (~1343).
2026-11-09 01:04:02 +01:00
Pascal André
339ecf945c
feat(help): open localized guide sections from contextual info icons (#1404)
## Summary

- Extend the existing `SettingsInfoTip` with `help?: { page: string;
anchor?: string }`; retain short hover/focus explanations and open
matching localized help externally on click, Enter or touch.
- Reuse `helpUrl` and `openExternalUrl`, guard page/anchor syntax,
preserve containing controls and disclosures, and show the existing
localized help error without replaying failed actions.
- Carry destinations through existing choice rows, behavior settings and
core Status metadata; document the reusable pattern and update the
settings guide in all ten languages.

## Linked inventory

- General: automatic subsession expansion, keep-awake, Memory, Tidy up
and memory-review warning.
- Advanced: whitespace-only changes and session environment variables.
- OpenCode: startup launch.
- Providers: image generation and image storage.
- Notifications: On screen, History and System column tips.
- Speech: provider, separate providers, shared/input/output base URLs,
playback mode, output format, playback test and prompt voice input.
- Status: Tokens, Yolo mode, Usage, Background Shells, MCP and Plugins.

Mission creation/scheduling/depth/preferences belong to the separate
form change, which can use the shared prop directly. Dynamic mission
budget, attention and diagnostics tips retain their information-only
purpose. Existing `SettingsInfoLink` and integration `InfoPopoverButton`
explanations retain their actionable/runtime-specific popovers; sidebar
Info navigation and Info-card heading icons keep their distinct purpose.

## Validation

- `npm ci` in the isolated checkout.
- UI typecheck.
- URL/section checks: every literal contextual destination resolves in
all ten locales, including `zh-Hans`.
- Behavior and right-panel registry tests: 14 passed.
- Full help suite: 31 passed, validating 28 pages × 10 locales.
- Real Solid browser gesture and relevant settings regressions: 56
passed (new shared-tip cases, startup launch, General/appearance,
Memory, notifications and help-command routes). All eight new
gesture/native-route cases pass.
- The fixture-wiring audit reports two existing WebKit fixtures without
the required exemption/navigation-budget wiring; those files and the
audit inputs are unchanged from `origin/dev`.

## Scope

No Mission form/tree edits, new dependencies, URL registry, plugin
extension point or duplicated info component. Visible explanations and
opener errors reuse existing translations.

## Independent review and CI

Round 1 found a translation-readiness race in the browser test. The test
now waits for the real localized info-link label before activating it.
Round 2: **No findings**.

Current `origin/dev` is merged. CI has baseline failures in the
unchanged binary-build ordering expectation and Cargo lockfile; the unit
failure reproduces locally and the affected inputs match `origin/dev`.
The existing fixture-wiring audit likewise reports only unchanged WebKit
files. These are tracked in the PR discussion separately from
contextual-help validation. Additional platform jobs remain
queued/running; admin merge is explicitly authorized for this change.

## Real component capture

![Startup and keep-awake settings with the shared contextual info
tooltip](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/95c2ada0f/pr-assets/contextual-help.png)
2026-11-09 00:22:03 +01:00
Pascal André
296af865a0
feat(tauri): embed native WebKit previews on macOS and Linux (#1301)
## Scope

Native browser previews, agent browser automation parity, and preview
capabilities across **Electron, Tauri Windows, Tauri macOS and Tauri
Linux**.

- Shared native embedding, geometry, overlay masking, session-owned
history and profile-scoped preview storage, isolated from the trusted
application renderer.
- Public `codenomad.browser`: open, navigate, snapshot, click, type,
select, press, scroll, hover, drag, wait and screenshot through the
authenticated backend and fenced native-parent channel.
- Six native viewport presets, WebKit HTTP/JavaScript mobile identity,
reset/reload and per-registration isolation. Native WebKit density/input
differences remain explicit.
- OAuth pop-ups with opener/postMessage and shared preview storage;
downloads with sanitized unique names; native dialogs and
owner/opener/renderer lifetime cleanup.
- Camera, microphone, location and notifications remain denied. Other
classified permissions retain native consent/selection and fail-closed
attribution. Guests receive no application privileges, app IPC, page
Node access or general evaluation bridge.
- Current-state developer documentation and user help in ten languages.

**Tauri macOS requires macOS 14 or newer; Electron keeps its own
platform baseline.**

## Host matrix

| Host | Native preview/history | Agent automation | Mobile profiles |
Pop-ups/downloads/dialogs |
| --- | --- | --- | --- | --- |
| Electron | Chromium | Supported | Chromium | Supported |
| Tauri Windows | WebView2 | Supported | Chromium | Supported |
| Tauri macOS 14+ | WKWebView | Supported | Native WebKit | Supported |
| Tauri Linux | WebKitGTK | Supported | Native WebKit | Supported |

## Qualification

- **Ubuntu 24.04 KDE VM:** real application built from the merged
sources, real backend and parent channel, private OpenCode daemon and
deterministic provider producing actual agent tool calls. Full browser
action sequence, OAuth opener messaging, downloaded-file contents,
native dialog acceptance and PNG passed under X11/Xwayland. Additional
native Wayland qualification uses an owned private KWin compositor;
native dialog operator coverage is recorded separately.
- **macOS 15.8 Intel VM:** same real-application/agent-tool path, all
actions and capability smoke passed with the built UI, private
profile/configuration and private OpenCode daemon. The app-window
nested-scroll check also qualifies the Cocoa wheel-coordinate
correction.
- **Windows:** Tauri release executable under its own
profile/configuration; all actions, OAuth, completed download, native
dialog and PNG passed through actual agent tool calls. The user's main
CodeNomad and shared OpenCode service remain untouched.
- Native CI qualifies Linux, macOS Intel, macOS ARM64 and Windows.
Authorized draft qualification uses no signing secrets.
- A **real Mac trial remains a release qualification step**. Graphical
macOS ARM64 and physical hardware capabilities retain their own
qualification scope; the capability matrix describes supported contracts
rather than exhaustive peripheral testing.

## Documented limits

- macOS first standalone hover can omit `pointerenter`; ⌘A selects
through the native responder while consuming the main A keydown.
- WebKit captures script-created closed shadow roots; declarative closed
shadow roots remain opaque.
- WebKitGTK preserves CVE-2025-13947 dropped-file protection; use the
page's native file input. No dropped URI text is converted into host
file access.
- GTK async clipboard reads lack requesting-frame attribution and are
refused; native Ctrl+V and clipboard writing remain available.
- WebKit keeps native screen/platform/pointer/hover/touch metadata.
WKWebView uses DPR 2.75 when its runtime-checked native selector exists;
GTK DPR follows monitor scale × fitted zoom. CSS dimensions remain
stable across app zoom/DPI. No JavaScript getter shims.
- Cross-origin frame contents retain the documented opaque automation
boundary. Page input timeouts have unknown outcomes and are never
replayed automatically.

## Integration

- Merge `ef69b4085`: `feat/tauri-webkit-parity`.
- Merge `e0d56d428`: `feat/tauri-webkit-capabilities` (`d58022b13`).
- Activation `3c68ab566`; Cocoa wheel correction `ecf5751ec`.
- The fetched `origin/dev` merges cleanly with this head. Pushed history
is preserved; no force-push or merge into `dev`.

The shared embedded-view layer remains available to remote-tabs work
while each consumer retains its own origin/profile/login/pairing/events
policy.
2026-11-08 23:46:06 +01:00
Pascal André
414e2d29ea
chore(release): prepare CodeNomad 1.1.0 (#1394)
## Summary

Prepare **CodeNomad 1.1.0** on dev `689f73b62`. Align the root, all five
workspaces, npm lock entries, Tauri configuration and Cargo package/lock
version. The npm lock differs only in seven release-version fields;
dependency versions and metadata are unchanged.

Set the separately published UI's **minimum server to 1.1.0**. This is a
consumed API boundary: its Missions store uses `POST
/api/workspaces/:id/missions/panel-page` for inventory and task pages,
absent from v1.0.1. Older servers retain their cached/bundled UI instead
of downloading the incompatible 1.1 UI. Test 1.0.0, 1.0.1, 1.1.0 and
future-server behavior; document the contract and update all ten help
locales.

## Validation

- Stable 1.1.0 and preview-family versioning plus clean offline
workspace installation/local remote-tunnel linking pass.
- Tauri/Cargo alignment and the remote UI server floor are checked.
- UI compatibility and release-PR-note contracts: **7/7** passed.
- Help checks: **31/31** passed across ten locales.
- Workspace typechecks and server/UI/native plugin build pass.
- npm package dry-run confirms `@neuralnomads/codenomad@1.1.0` and its
shipped CLI/Missions/pruning/memory entrypoints.
- Strict lockfile metadata comparison and whitespace checks pass.

## Publication boundary

This preparation creates no stable release or tag and changes no signing
or publishing credentials. After merge, prepare a **draft dev → main**
release PR whose body is the public release notes. Merging that separate
PR publishes GitHub/npm/UI/updater assets and requires explicit
publication approval. Existing nightly dev previews retain their normal
schedule and will use the new base version. Production Windows signing
remains disabled in current repository configuration.
2026-11-08 18:25:34 +01:00
Pascal André
8656d1f7e5
fix(missions): make the subagent depth one menu row and Save as brief an icon (#1391)
## Summary

The creation form's subsession nesting depth was a block of prose:
- a heading and its info icon;
- the write target, the effective depth and a nesting sentence;
- the configuration file, often the same path again;
- a numeric field, then the nesting rule;
- a second rendering of the info text;
- an Inherit button.

It is now **one row**, like Task sessions.

- **Subagent depth ⓘ [menu]**: Inherit (naming the inherited depth while
no project override is set), then 1 to 10 within the capability's
maximum. A choice saves at once, so the Inherit button, the Enter/Escape
handling and the invalid-value state are gone.
- While an empty project `experimental` block hides the inherited depth,
the menu shows **OpenCode default**; choosing Inherit repairs it.
- **Everything else is in the one info tip**, one part per line: scope,
nesting rule, effective depth, nesting status and both paths (isolated
left-to-right). The shared tooltip now honours line breaks.
- Only actionable alerts and the unsupported-contract status stay under
the row. Saving and saved states are announced to assistive technology
only.
- Reads and writes lock the menu with `aria-disabled` (keeping focus)
and refuse a choice made meanwhile.
- In the creation form the row is part of **Delegation**, whose rows
share one label column, so both menus line up. Preferences shows the
same row.
- The creation footer's **Save as brief** is a bookmark icon named by
its tooltip.

![The Delegation group: Task sessions and Subagent depth as two aligned
rows, the bookmark icon in the footer (real dev
instance)](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/e14f3e7817b428394fc6dfbbf9eaa51dd421f69c/pr-assets/missions-depth-row.png)

![The depth info tip, one part per line (real dev
instance)](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/e14f3e7817b428394fc6dfbbf9eaa51dd421f69c/pr-assets/missions-depth-info.png)

## i18n, docs and help

- Ten locales: `missions.depth.label` shortened, `inheritValue` and
`masked` added, `title` and `invalidValue` removed; the hint no longer
says an empty value inherits.
- `dev-docs/MISSIONS.md` describes the row, its info and the icon.
- The Missions help is updated in ten locales.

## Validation

- Browser tests drive the menu:
  - the one-row layout (one info tip, no prose, no buttons);
  - the offered values and Inherit's label;
  - immediate saves;
  - locked reads and writes refusing a forced choice;
  - the empty-block repair;
  - the info lines (nesting status, paths);
  - uncertainty fencing across Locations;
  - the row inside Delegation and the footer icon.
- Full `mission-*` suite plus automation-forms and preferences-startup:
549/549.
- UI typecheck and `npm run test:help` pass.
2026-11-08 17:31:31 +01:00
Pascal André
c51d55ed76
fix(missions): keep the panel inside the window and move Save as brief to its menu (#1389)
## Summary

Follow-up to #1318.

- **The panel stays inside the window.** Scrolling the Missions panel to
its end scrolled the whole window under the project tabs. Every row's
screen-reader label (and any absolutely positioned element of the panel)
had no positioned ancestor inside the panel's scroller. Those elements
escaped its clipping and grew the shell's overflow by thousands of
pixels; wheel scrolling then chained into it at the panel's end.
- The panel is now their containing block, like the creation form's
scrolling body.
- The right panel's tab scroller is positioned too, so no tab, an
extension's included, can do this again.
- **Save as brief in the ⋯ menu**, as #1318 specified. The menu is now
Request an update, Interrupt now, Save as brief, Edit.
- It opens the brief name field, which shows only while naming and takes
focus once the menu closes. The creation footer keeps its own button.
  - A finished Mission's menu stays enabled for it.
- **No lone info icon under the selected Mission.** Its activity paging
shows only with Load more or Retry.

![The selected Mission with its tasks directly under its row and the
overflow menu open on Save as brief (real dev
instance)](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/74a47f2963b2a5b74beb9213b7a2e61a720d1c6d/pr-assets/missions-brief-menu.png)

Real dev instance on the project's own missions. Measured over CDP
before the fix, two ancestors of the panel had a scroll height of 11,678
px for an 815 px panel. After the fix both measure 815/815, and no
positioned descendant escapes the panel.

## Docs

- `dev-docs/MISSIONS.md` and `dev-docs/UI_SHELL.md` state the
containment rules.
- The Missions help lists the menu in ten locales.

## Validation

- Browser tests:
- no positioned descendant escapes the panel and the window never
overflows (fails without the containment);
  - the menu's items and states for a finished Mission;
- Save as brief from the menu, with no control under the Mission and the
focus in the name field.
- Full `mission-*` suite 520/522; the two setup timeouts pass alone
(6/6, 37/37). UI typecheck, `npm run test:help`.
2026-11-08 14:54:28 +01:00
Pascal André
47259a1da0
feat(missions): open questions from red mission and task rows (#1385)
## Summary

Fourth step of #1318: questions are opened from the tree's red rows,
like the session list, and the "Needs you" section is removed.

- **Mission flag (red)** only for the questions it carries: its
coordinator's own, one of the coordinator's family that no known task
conversation carries, and, once its map is read, a task's question that
no loaded live task row carries (a task further down), so every question
stays one click away.
- **Task (red)** when its declared actor, or its exact conversation,
asks. The mission row's **chevron** carries its tasks' questions (and
work) with the session list's `data-child-activity` colours.
- **Selecting a red mission row, or clicking a red task**, opens the
asking conversation and focuses that request in its interruption dock. A
red task opens its question instead of its reader. A red task of an
unselected, expanded mission also selects that mission.

![A task's question (red task and chevron, yellow working flag) and
another mission's coordinator question (red
flag)](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/8d22a25f09870d88c8f54575b0041ba4cc1b7119/pr-assets/missions-tree-questions.png)

Synthetic fixture rendered with the real MissionControl: "Backlog #5"
works (yellow flag) while its "Browser tests" task asks (red task, red
chevron); "Backlog #2"'s coordinator asks (red flag).

## Implementation

- `mission-question-owners.ts` (pure): coordinator vs task attribution,
live-task matching, flag fallback for questions no loaded row carries.
- `mission-questions.ts`: open questions from the native queues and the
panel's off-page request windows; the coordinator always counts.
- `MissionControl`: row questions, flag/chevron, opening a question from
a list row before its map is read (authorized from the row's actors).
- `MissionTaskTree`: `questions`/`onAnswer`; `MissionTracking` and
`MissionTaskPreview` supply them.
- Removed: `mission-attention.tsx`, its styles and the "Needs you"
strings (ten locales); two new strings name a task awaiting input on a
row and a red task's action.

## Docs

`dev-docs/MISSIONS.md`; Missions and Playbooks help pages in all ten
locales.

## Validation

- Unit: attribution rules (`mission-question-owners.test.ts`),
`missionMark` (a task actor's question never reds the flag), i18n.
- Browser: a red task opens its asking descendant with the question
focused (real dock); the coordinator family's question on the flag,
desktop and 390px RTL touch; a task's question on its row and chevron
only; an off-page actor's question on the flag; passages; full
`mission-*` suite locally.
- UI typecheck, `npm run test:help`.
2026-11-08 08:11:45 +01:00
Pascal André
5871175757
feat(missions): show tasks as child rows and let a task take the header toolbar (#1384)
## Summary

Third step of #1318: tasks become the mission row's children.

- **Task rows** take the session rows' height and separators; the
dependency rail is lighter (35% opacity) since the icons carry the
state. The "Tasks" disclosure and its persisted fold are gone: the
mission row's chevron folds its tasks.
- **No per-row controls.** While a task's reader is open, the header
toolbar acts on that task: the primary action is the task's report
recovery when eligible, Summary closes the task's reader, and **Open the
task's conversation** reaches its own conversation. The mission's
lifecycle, delete and overflow actions stay in place, disabled.
- **Expand without selecting.** The chevron of an unselected one-time
mission shows its tasks; its map is read only while expanded and its
pages load as the panel scrolls. A task there selects its mission and
opens the task's reader.

![Selected mission with its tasks, and another mission expanded without
being
selected](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/1caf5a5d2477c194f4dcc4de76c6a8f9c92156cc/pr-assets/missions-task-rows.png)

Synthetic fixture rendered with the real MissionControl.

## Implementation

- `mission-task-tree.tsx`: rows only (no heading, arrow or recovery);
attention counts keep their info tip on a Tasks line shown only when
pins lie outside the loaded rows; the group's label carries the task
count.
- `mission-task-actions.tsx`: the task toolbar through the existing
`MissionActionBar`, keyed by task so activity refreshes keep it mounted;
the mission's lifecycle, briefing and recovery state stays mounted in
`MissionSelectedActions`.
- `mission-task-preview.tsx` and `MissionRows` `preview`/`expandable`:
on-demand expansion of unselected one-time missions.
- `mission-view-state.ts`: `tasksCollapsed` removed.

## Docs

`dev-docs/MISSIONS.md` and the Missions help page in all ten locales.

## Validation

- Full `mission-*` browser suite locally; two tests that timed out under
parallel load (`mission-control-feedback` exact briefing,
`mission-schedule-list` first test) pass alone (37/37 for the schedule
list).
- New or updated checks: task toolbar hand-off and return, expansion
without selection (mouse and keyboard), report recovery reached through
the toolbar, counts carried by the group's label.
- UI typecheck, mission unit tests, `npm run test:help`.
2026-11-08 04:18:39 +01:00
Pascal André
494f1b369b
feat(missions): show the Missions panel as a tree under a two-line header (#1381)
## Summary

Second step of #1318: the Missions panel becomes one tree modelled on
the session list.

- **Rows**: one row per mission or schedule, built with the session
list's own row classes (same height, separators, chevron, selection
highlight): chevron, a flag coloured by the mission's mark (a repeat
icon for a schedule), then the title.
- **Selection = expansion**: the selected row's detail (Needs you, the
task tree, a schedule's runs) is its children; its chevron folds them,
another row's chevron selects that row.
- **Header, two lines**: create / preferences / refresh, then the
selection's toolbar (primary action, stop, run now for schedules,
Summary, open conversation, delete) with a **More actions** menu
(Interrupt now, Request an update, Edit) and the filter. Buttons and
menu items stay in place, disabled when they do not apply. In a narrow
panel the filter wraps above the toolbar.
- **Summary follows the selection**: while a reader of a one-time
mission is open, choosing another one shows its overview.
- **One scroller**: the header stays at the top, the panel is the only
scroller (the task flow no longer scrolls on its own) and a stable
gutter keeps the panel width when the scrollbar appears. The header's
height is the panel's scroll padding, so focused content never hides
under it; while creating and in windows under 400px tall it scrolls
away.

Removed: the "current mission" combobox and popup, the collapsible list
with its own scroller and persisted `listExpanded` flag, the
collapsed-list attention chevron, and their strings in all ten locales.

![Missions tree with the selection's overflow menu
open](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/72b46f26c96a6171933d79c58ce0bd690ec2a74f/pr-assets/missions-tree-menu.png)

Narrow panel (filter wrapped above the toolbar):

![Missions tree in a narrow
panel](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/72b46f26c96a6171933d79c58ce0bd690ec2a74f/pr-assets/missions-tree-narrow.png)

Synthetic fixture rendered with the real MissionControl.

## Implementation

- `mission-picker.tsx`: `MissionPanelHeader` and `MissionRows`. The
detail is rendered once, between the rows above and below the selection,
so pending controls and retries survive a selection change; folding only
hides it.
- `mission-action-bar.tsx`: the existing toolbar mounts into the header
through a `MissionActionSlot` context (lifecycle, recovery, retry and
briefing logic unchanged); secondary actions move to
`ActionOverflowMenu`, whose items now expose `data-action-key`.
- `MissionControl.tsx`: composition, `followReader`, header height 
`--mission-header-height` scroll padding; `mission-panel-scroll.ts`
honours that padding in its focus repair.
- Tasks as their own child rows, lazy loading per expanded mission, the
coordinator-only red flag and click-to-question come in the next steps
of #1318.

## Docs

`dev-docs/MISSIONS.md` (header, tree, detail placement, single scroller)
and the Missions help page in all ten locales.

## Validation

- All `mission-*` browser tests plus `history-navigation` and
`session-child-activity` pass locally, updated through shared helpers
(rows, header toolbar, overflow-menu items by key). New checks: row
selection, folding and filtering; single scroller with fixed header and
stable width; keyboard activation of rows; the header never hides
scrolled-to tasks.
- UI typecheck, mission unit tests and `npm run test:help`.
2026-11-08 00:41:53 +01:00
Pascal André
7292e4e3b1
chore(opencode): recommend qualified runtime 2.2.6 (#1379)
## Summary

Recommend OpenCode **2.2.6** after the scheduled-wake correction (#1350)
and split assistant storage support (#1359) were qualified together and
merged. Keep the technical minimum and client/schema/plugin pins at
**2.2.3**. This changes the displayed qualification target, not the
service, user configuration or capability-based admission policy.

Update the runtime/update-status regressions, server guide, architecture
references and installation/setup/server/troubleshooting help in all ten
locales. Describe the host-provided Effect/Schema runtime independently
of a release number.

## Qualification provenance

The exact integrated source `735a9714c0d2bf0227dbb19871064f11df9a894b`
passed the final campaign. After merging #1350, `git diff
735a9714c0d2bf0227dbb19871064f11df9a894b
4d6a517602` was empty: actual merged dev
is byte-identical to the tested tree. Detailed gatekeeper evidence:
https://github.com/NeuralNomadsAI/CodeNomad/pull/1350#issuecomment-6712960223.

- **335/335** combined pruning/wake/affected Missions regressions;
server/UI typechecks; server and all plugin builds.
- **18 isolated native invocations**, all successful: context, full
foundation and retained-product cold at/in on **2.2.6 and minimum
2.2.3**; default pruning; split pruning with real UI and reload; split
Design gallery; native migrations **2.2.3 → 2.2.6** and **2.2.5 →
2.2.6**; host plugin bindings, Code Mode, automation, memory, Goal,
Missions contract and recursive/parallel trajectory.
- The original exact-tag/API/package review and its unchanged-contract
evidence remain applicable to the same official 2.2.6 CLI (SHA256
`98cb0aa854c7c015cf6febafa7afb872c359bfe5a823a526f3b4fd347a9e9677`).
Previously reproduced cross-version baseline fixture failures are not
claimed fixed; optional third-party MCP pooling and the broader
experimental VM remain outside these native journeys.
- This recommendation change passes **32/32** runtime/update-status
tests, server typecheck and **31/31** help checks over ten locales.
Verified exact recommendation-only substitutions across all 40
translated help pages and the four guide/reference files; package
manifests and lockfile are unchanged.

All native checks used private synthetic state, isolated official CLIs
and local providers. No shared daemon, user database, user configuration
or production provider account was changed.
2026-11-07 22:06:31 +01:00
Pascal André
ffdb4a70d7
fix(storage): support native split assistant parts across history and pruning (#1359)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
## Summary

Support OpenCode's optional `experimental.part_rows` storage throughout
direct history/search, navigation/outline, image gallery and technical
cleanup. Reconstruct ordinal split rows followed by any inline tail,
including existing split data after the flag is disabled. Missions
source projections share the same ordering.

Validate the actual storage schema, part ownership/type/call identity
and byte/row budgets before reconstruction. Keep metadata reads free of
JSON decoding and preserve native rowid seeks. Cleanup deletes selected
split rows and inline entries atomically with the envelope CAS,
media-reference release and retry receipt; retained split rows keep
their exact bytes and ordinals.

## Validation

- Storage-specific regressions: 10/10 passed, covering mixed messages,
stale revisions, rollback, media ownership, gallery pixels/provenance,
metadata queries and malformed/oversized storage.
- Final-source pruning and affected native Missions tests: 318/318
passed.
- Full server suite: 4,098 passed, 23 skipped, one timeout in the
70-passage recurring-Missions scenario; the same scenario passed in
isolation in 35 seconds.
- Server and workspace typechecks passed; help tests passed 31/31 over
all ten locales.
- Rebuilt final committed bundles: official private CLI 2.2.3 passed the
complete default-storage journey; 2.2.6 passed split storage with real
UI cleanup and persisted reload, media release, claim concurrency, next
model payload and mixed content after flag-off/restart.
- Official private CLI 2.2.6 passed the split Design gallery journey:
exact pixels, proven lineage and late read-back with unverifiable
provenance.
- Add a latest-runtime split-storage CI journey. Update technical
documentation and history help in all ten locales.

Minimum runtime and dependency pins stay at 2.2.3; the recommendation
remains 2.2.5. No user database or shared service is modified by the
isolated fixtures. This PR does not include the separate scheduled-wake
fix in #1350.
2026-11-07 15:34:22 +01:00
Pascal André
fdc5e3c1d7
feat(sessions): keep the chevron's activity when expanded and mark a hierarchy as read (#1319)
## Summary

- A parent's chevron now carries its descendants' most urgent state
(input, working, compacting, idle) whether the row is expanded or
collapsed. It used to turn plain once expanded, so activity further down
a long family was no longer signalled at its parent.
- Right-clicking the chevron (or the Menu key / Shift+F10) opens **Mark
as read**, which clears the **Idle** and **Interrupted** badges of the
row and all its descendants, exactly as clicking each badge does. Work,
retries and pending questions or permissions are left alone; the item is
disabled while nothing in the hierarchy shows such a badge.

First step of #1318: the Missions tree reuses these chevrons.

![Expanded parent keeping its descendants' red input state, with the
chevron's Mark as read
menu](https://raw.githubusercontent.com/NeuralNomadsAI/CodeNomad/4fffa04dbaeb102e8e32905b92b7400f6ee8edb2/pr-assets/session-chevron-mark-read.png)

Synthetic fixture rendered with the real session list.

## Implementation

- `session-expander.tsx`: the expander button wrapped in a Kobalte
`ContextMenu` reusing the shared overflow-menu items.
- `session-list.tsx`: child activity computed independently of
expansion; the readable hierarchy goes through the existing
`markSessionIdleSeen` / `markSessionInterruptionSeen` paths, so the
seen/fade lifecycle and recovery acknowledgement are unchanged.
- i18n key `sessionList.expand.markRead` in all ten locales;
`dev-docs/UI_SHELL.md` and the Conversations help page (ten locales)
updated.

## Validation

- `tests/browser/session-child-activity.test.ts`: 4/4, including the
expanded chevron and a right-click test marking a hierarchy as read
without clearing working or input states.
- `npm run typecheck --workspace @codenomad/ui`, `npm run test:help`.
- Checked in a separate desktop instance (Electron dev build).
2026-11-07 00:43:40 +01:00
Pascal André
0115b46ad2
feat(usage): read OpenCode Console usage and mark free quota exhaustion (#1317)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
## Summary
- Read paid OpenCode Zen usage from the OpenCode Console and show
localized request counters and per-model request totals.
- Mark the estimated daily quota for free OpenCode models as exhausted
after an attributed native quota failure, until the next UTC midnight.
- Allow a configured provider without a connection to add its first
account from Settings → Providers.

## Behavior changes
- Paid `opencode` sessions show Today (UTC), 7 days (UTC), and 30 days
(UTC) request counts, plus requests by provider/model over 30 days,
without percentage gauges.
- Missing, invalid/expired, and denied Console credentials have distinct
localized states with a Settings → Providers action. Malformed responses
and network/timeouts keep distinct error messages.
- Settings → Providers exposes the existing add-account control when a
provider has an API-key or OAuth connection method, even before its
first connection exists. Environment-only providers keep their existing
controls.
- Free models (`big-pickle`, `*-free`) retain the Estimated label when
exhausted; unknown counts remain unknown. Exhaustion is shared across
free models for the current connection and expires at UTC midnight.
- Service-account budgets display as unavailable because the Console
budget endpoint is absent.
- Display evidence is never used for automatic account selection.

## Implementation notes
- Resolve credentials exclusively through the native `opencode`
integration. Console OAuth takes precedence over an API key, validates
the exact Console server and organization-ID shape, and sends
`x-org-id`; credentials are never refreshed or exchanged.
- Use the existing bounded transport, a fixed Console base URL, refused
redirects, a 64 KiB response limit, a 15-second overall deadline, and
strict safe-integer decimal-string parsing. USD 1 equals 100,000,000
micro-cents.
- Require all three summaries and every sequential 50-row models page to
succeed. Bound pagination to 20 pages / 1,000 rows, reject inconsistent
pagination and discard partial results on failure.
- Reuse credential-scoped display caching and stale-response/ownership
fences; cancellation remains isolated between callers sharing a Console
read.
- Attribute free quota failures to the free model captured at step
start; ignore ambiguous, duplicate, stale, and unrelated failures. Keep
exhaustion in connection-local backend memory.
- Keep the tested `max(local estimate, Console free-model requests)`
calibration path behind `OPENCODE_FREE_CONSOLE_CALIBRATION = false`
pending verified free-request accounting.
- Keep counters readable in narrow panels and localize UI copy and
number formatting across all ten app locales.

## Limitations
- The Console endpoints are undocumented internal APIs and may change.
- The service-account budgets endpoint returns 404, so budgets remain
unavailable; per-account budget data cannot currently be delivered.
- Console calibration of free requests remains disabled until the
Console is proven to count that traffic in the relevant scope.
- Exhaustion marks are in memory and are lost when the backend restarts.
Daily usage remains an estimate, based on a 200-request reference.
- The usage-panel connect action opens Settings → Providers without
focusing the specific provider.

## Validation
All focused automated checks below were rerun successfully on the PR
head:
- From `packages/server`: `node --import tsx --test src/usage/*.test.ts
src/usage/providers/*.test.ts src/provider-accounts/*.test.ts
src/server/routes/usage*.test.ts` — **317/317 passed**. Parser,
transport, calibration, attribution, route, credential, and
account-selection regressions use simulated responses, without real
credentials.
- From `packages/ui`: `node --import tsx --test --test-concurrency=1
tests/browser/provider-usage.test.ts
tests/browser/provider-accounts.test.ts
src/components/session/provider-usage-panel.test.ts
src/components/session/provider-usage-state.test.ts` — **128/128
passed**. Includes the real provider manager's first API-key/OAuth
connection controls, localized counters/errors, narrow-panel layout,
contrast, and free-exhaustion rollover.
- `npm run typecheck --workspace @neuralnomads/codenomad` — **passed**.
- `npm run typecheck --workspace @codenomad/ui` — **passed**.
- `npm run test:help` — **31/31 passed**, validating **28 pages × 10
locales**.
- `git diff --check origin/dev...HEAD` — **passed**.
- Earlier full-browser QA reported **1,846 passed / 1 failed / 2
skipped** out of 1,849. The unrelated data-profile fixture timeout
passed when rerun alone both on this branch and on `origin/dev`.

Separate real-account verification, reported by the delivery coordinator
(read-only Console OAuth usage requests):
- Summary endpoints for `24h`, `7d`, and `30d`, plus models for `30d`,
returned **HTTP 200** and parsed successfully with this branch's reader.
Counters were zero and the model list was empty; decimal-string metrics
and numeric pagination matched the parser, including empty page 1 /
pageCount 0.
- Budgets were unavailable.
- Free-request counting is **inconclusive**: the free-model test request
timed out before completing. No successful free-traffic accounting was
established; Console calibration therefore remains disabled.
- No secrets or account identifiers are included in these results.

## Help updated
- `docs/help/en/providers.md` and all nine translations document Console
usage, estimated free exhaustion, connection recovery, and first-account
creation from Settings → Providers.
- `dev-docs/PROVIDER_ACCOUNTS.md` documents credential precedence,
parser/transport/cache bounds, unavailable budgets, failure attribution,
UTC rollover, and the calibration gate.
2026-11-06 23:17:25 +01:00
Pascal André
0829c7cfe6
feat(memory): add opt-in persistent agent memory (#1313)
## Why

Let agents retain useful facts and preferences across conversations
without relying on hand-written user context or sending memory to a
remote service. Memory is opt-in and belongs to the connected CodeNomad
configuration.

## User-visible behavior

- Add **Memory** under **Preferences → General**, also available in
embedded Settings; it is **disabled by default**.
- Provide **About you** (60 entries) and **Project** (200 entries). The
server derives project identity from the normalized Git remote, with a
canonical local-path fallback shared by worktrees.
- Expose `codenomad_memory` for listing, reading, saving and forgetting
agent-written entries. Each accepted save or deletion creates a local
Git commit.
- Synchronize the session-local `codenomad.memory` instructions,
including native children: recording rules plus bounded title/type
lists, with read-before-action and verification guidance.
- Review New/Modified badges, edit entries directly, confirm Forget,
resolve stale revisions, and inspect suspicious entries excluded from
agent use.
- **Tidy up** (**Ranger** in French) opens a project-bound session to
verify and merge the selected scope, preserving unverifiable claims and
external references.
- Existing external agent memory stays under its own management; agents
can store a literal Reference to it. No automatic import or remote
synchronization.

## Approach and edge cases

- Server-owned Markdown entries in the configuration's private Git
repository, atomic file replacement, process-generation-fenced locking
and recoverable local commit transactions.
- Shared validation contracts, 60-character titles and 2,000-character
bodies, multilingual duplicate matching and injection heuristics across
all ten interface languages. Flagged entries remain reviewable and count
toward capacity, but are rechecked and excluded from agent projections.
- Missing folders are empty; malformed/unreadable scopes return explicit
errors. Capacity errors ask the agent to merge or remove entries.
Revision checks preserve concurrent edits and drafts.
- Bundle the native memory plugin through the existing native-plugin
build/provisioning lifecycle, including the managed-plugin descriptor
used by the current dev branch.
- Authorize session/project ownership and enablement at mutation time.
Optional instruction capability absence stays silent. Ordinary sends
continue during optional memory outages; stale instruction cleanup is
best-effort and memory claims must still be verified.
- Rebased onto `origin/dev`; preserved its graceful shutdown lifecycle,
nested-worktree error handling and translated keep-awake help alongside
memory.

## Documentation

- Updated `docs/help/en/settings.md` and all nine translations with
activation, scopes, editing, forgetting/history retention, warnings,
Tidy up, external references and local-only storage.
- Added the agent-memory developer contract and updated the related
settings, project, plugin and OpenCode integration guidance.

## Validation

- Focused memory/server suite, including
`packages/server/src/memory/integration.test.ts`, native memory tool
units, session memory context, project/forge identity, standalone
authenticated bridge, nested-worktree and Git-probe regressions: **115
passed, 0 failed, 1 skipped** (real WSL qualification is opt-in).
- Admission, plugin installation/lifecycle/provisioning, managed-plugin
recognition, graceful shutdown, cleanup and shared UI contract
regressions: **127 passed**.
- `npm run typecheck` (remote tunnel, UI and Electron): **passed**.
- `npm run typecheck --workspace @neuralnomads/codenomad`: **passed**.
- Memory and Preferences browser tests (`agent-memory`,
`preferences-window`, `preferences-startup`,
`preferences-startup-state`, serial): **38 passed**.
- `npm run test:help`: **31 passed**, including all ten locales'
structure and links.
- `npm run build:memory --workspace @neuralnomads/codenomad` plus
native-plugin build, managed-plugin and desktop resource checks: **36
passed**. Verified the built memory bundle's first-line plugin
descriptor.
- `git diff --check`: **passed**; checkout clean and branch contains the
current fetched `origin/dev` before its first push.

## Known test noise

`missions/mission-local-sources.test.ts:73` also fails on `origin/dev`.
Four intermittent full-suite failures outside memory are being compared
with `origin/dev`; these are separate from the focused post-rebase
checks above.
2026-11-06 15:29:24 +01:00
Pascal André
d71c812a8a
feat(usage): show Gemini CLI and Antigravity quotas with an in-memory Google refresh (#1312)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
Show the Gemini CLI per-model quota and the Antigravity five-hour and weekly quotas for OpenCode's Google connections.

Google does not rotate refresh tokens for installed-application OAuth clients, so CodeNomad uses OpenCode's access token while it is valid and otherwise refreshes it in bounded server memory with the client matching the connection's native method (gemini-cli or antigravity). CodeNomad never rewrites an OpenCode connection, never sends tokens to the browser or logs, calls only Google's fixed token endpoint with redirects refused, filters model and group identities strictly, and reports any failure or timeout as an unknown quota. Google stays outside automatic account selection. dev-docs/PROVIDER_ACCOUNTS.md and the Providers help in ten locales describe the rule and the Antigravity terms risk.

Validation: 273 server usage, provider, route and provider-account tests, 99 provider-usage browser tests, 31 help tests, server and UI typechecks and the full CI pass; five independent review rounds ended with zero findings.
2026-11-06 15:16:42 +01:00
Pascal André
cb2dcb704a
chore(runtime): update Node LTS to 24.22.2 (#1314)
## Summary

Updates the Node LTS pin from 24.20.0 to **24.22.2**, the latest Node 24
LTS. It includes the 24.22.1 security release. The pin drives CI,
Tauri's bundled Node and the npm both desktop hosts bundle (npm 11.19.0
→ 11.19.1).

The scheduled *Bundled Runtime Maintenance* workflow has proposed this
update since 24.22.0. Each run failed while opening its PR because
GitHub Actions is not permitted to create pull requests in this
repository. So the update never reached `dev`.

Documents that restated the pin (README, server README, the `install`,
`server` and `support` help pages in all ten locales) now reference
`.node-version`. That workflow updates only that file, so they stay
accurate. `RUNTIME_MAINTENANCE.md` records that convention.

## Validation

- `nodejs.org/dist/v24.22.2/SHASUMS256.txt` lists every archive
`prepare-node-runtime.cjs` downloads (win x64/arm64, darwin x64/arm64,
linux x64/arm64).
- Bundled npm audit (`--omit=dev`): 11.19.0 has 5 high / 32 moderate;
11.19.1 has 2 high (brace-expansion, undici inside npm's own tree) / 34
moderate.
- `scripts/test-help.mjs` 31/31, `runtime-maintenance.test.cjs` 8/8,
`prepare-node-runtime` + `desktop-server-resources` tests 11/11.
2026-11-06 12:44:46 +01:00
Pascal André
5939d4c9c5
feat(usage): upgrade provider usage readers (#1309)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
Upgrade provider usage readers with bounded requests, validated destinations, translated labels and current provider help.

- Crof: remove the closed provider and obsolete tests.
- GitHub Copilot: support validated Enterprise hosts, consumed credits and plan labels.
- Kimi: recognize China/global plans, try selected credentials within one deadline and parse ratio-based monthly quotas.
- OpenRouter: honor the configured base URL and distinguish Key Limit from account credits.
- z.ai / Zhipu: use resolved file/environment keys and show sanitized business errors; leave gift-reset writes outside scope.
- Cursor: read best-effort Enterprise request counts and team-scoped hard limits.
- MiniMax: localize the limits-not-shared status while preserving fallback and error handling.
- OpenCode Go: show the Console credit balance and actionable expired-key recovery.
- Sign in with ChatGPT: link the existing token-sharing explanation to ChatGPT usage settings.

Provider tests use simulated responses; provider help and labels cover all ten locales. Focused validation passed: 215 server tests, 96 browser tests and 31 help tests.

Admin merge approved with one remaining out-of-scope CI failure: the mission-control held-French-dictionary cleanup test timed out after 30 seconds; the coordinator confirmed that file passes locally on the reviewed head (29/29). The other 17 checks passed after the single permitted failed-job rerun.
2026-11-06 06:48:24 +01:00
Pascal André
78a734cb6b
perf(electron): run the backend with Electron's Node (#1304)
## Summary

Electron already ships the Node runtime the backend needs. The Electron
package now launches the CodeNomad server through `process.execPath`
with `ELECTRON_RUN_AS_NODE=1` and keeps only npm (from the pinned
`.node-version` archive), dropping the redundant standalone `node.exe`
(~89 MiB on Windows). Tauri keeps its full bundled runtime unchanged.

## Changes

- **Launch**: `process-manager.ts` runs the backend with Electron's own
executable in run-as-Node mode; `managed-node.ts` is removed.
- **Resources**: `prepare-node-runtime.cjs` gains an npm-only layout
requested by `electron-app/scripts/prepare-resources.js`; Tauri keeps
the full Node + npm layout.
- **npm discovery**: `bundledNpm()` (`npm-runtime.ts`) finds npm in
Electron resources (Windows, Linux, macOS `.app/Contents/Resources`)
while preserving Node/Tauri layouts.
- **npm lifecycle scripts**: `@opencode/cli` runs `node
./postinstall.mjs`; installation (`shared-installation.ts`) and native
upgrades (`native-upgrade.ts`) get a private, scoped `node` command
pointing at the Electron executable, removed afterwards. The shared
OpenCode daemon never inherits `ELECTRON_RUN_AS_NODE`.
- **Checks/CI**: packaged-resource smoke, `verify-bundled-node`,
`build.js` and `build-and-upload.yml` separate the Electron (npm-only)
and Tauri contracts; `test-opencode-*-native.mjs` and the desktop setup
qualification can target the packaged Electron runtime without a system
Node on PATH.
- **Docs**: `dev-docs/RUNTIME_MAINTENANCE.md` (the Electron package
follows Electron's Node version), `dev-docs/OPENCODE_RUNTIME_SETUP.md`,
and `server.md` / `updates.md` help pages in all ten locales.

## Validation

- Electron 39.0.0 → Node 22.20.0; npm 11.19.0 (engines `^20.17.0 ||
>=22.9.0`).
- Packaged Windows ZIP and Linux (`linux-unpacked` + extracted DEB,
Ubuntu 24.04 VM): backend reaches ready, API answers 200, both backend
processes run as the app executable with `ELECTRON_RUN_AS_NODE=1`, no
Node in resources or on PATH, clean exit with no orphan and the
executable released.
- `test-opencode-install-native` (2.2.3), `test-opencode-upgrade-native`
(→ 2.2.5, isolated service PID kept) and
`test-opencode-legacy-replacement-native` (1.18.10 → 2.2.5) pass on
Windows and Linux with the packaged Electron runtime.
- Typechecks (server, Electron), resource tests 11/11, `opencode-update`
tests (Windows 66 pass / 1 POSIX skip; Linux 62 pass / 5 Windows skips),
help validation.
- The full Electron suite on Windows shows intermittent failures in
`process-stop.test.ts` and `native-service-start.test.ts` (PowerShell
capture timeout of 1.5 s); they reproduce identically on `dev`
(30527e58d) and the files are unchanged here.

## Size (same machine and options)

| | Before | After | Delta |
|---|---:|---:|---:|
| Windows `resources` | 344 274 218 B | 250 740 778 B | −89.20 MiB |
| Windows ZIP | 221 737 165 B | 188 286 779 B | −31.90 MiB |
| Linux `resources` | 377 016 175 B | 250 408 680 B | −120.74 MiB |
| Linux DEB | 138 393 810 B | 107 123 634 B | −29.82 MiB |

macOS was not exercised at runtime (path handling is covered by unit
tests; arm64/x64 builds run in CI).
2026-11-06 06:35:53 +01:00
Pascal André
c29b885adc
feat(settings): keep the computer awake while CodeNomad is running (#1307)
CodeNomad blocked system sleep only while a session was working, so a machine
left with CodeNomad open between tasks could still go to sleep.

Settings > General gains "Keep the computer awake while CodeNomad is running",
off by default, with its explanation behind the (i) info tip. When on, a local
application window holds the existing native wake lock while it is open,
minimized included, even with no session; the display can still turn off.
When off, the per-session rule applies unchanged.

The preference is persisted as ui.settings.keepComputerAwake through the
existing config path, with no server change. A pure shouldAppHoldWakeLock()
counts it only in local windows: remote windows read the remote server's
config, so Electron remote windows keep holding the lock only for their own
qualifying sessions, and Tauri remote windows and the Preferences window never
request it. The row is shown in local desktop windows and Preferences, and
hidden in a web browser and remote views. A failed save rejects the setter so
the row never shows an unpersisted value. The Tauri keep-awake reason reported
to the OS is now neutral.

Labels ship in all 10 locales; dev-docs/SETTINGS.md, the wake-lock
specification and the Settings help (English + 9 translations) describe the
behavior.

Validation: unit matrix (preference x eligible work x window context) and
preference tests, the appearance browser test (hidden on web; default,
keyboard info tip, (i) never toggles, persistence on and off after reload),
UI typecheck and build, help tests, cargo check, and the full CI suite.
2026-11-06 04:44:18 +01:00
Pascal André
f3bf6c4032
feat(plugins): protect CodeNomad-managed system plugins (#1308)
## Problem

CodeNomad's own OpenCode plugins appeared as ordinary plugins with
activation switches, so users could disable an application feature
without knowing it. Filtering by a `codenomad` name or ID would also
hide unrelated third-party plugins and lose loading failures.

## Behavior

- Verified CodeNomad-managed plugins stay outside ordinary plugin rows,
activation switches, package actions and source-removal controls.
- Disabled, failed or loading-unconfirmed managed plugins appear in a
compact warning above the list, with accessible on-demand
error/configuration details.
- **Re-enable** uses the existing activation path: append a positive
exact-ID rule, preserve the disabling rule and unrelated configuration,
and target the disabling Global/Project scope when writable, otherwise
the writable Project override.
- A configuration write does not clear the warning. A fenced native
inventory refresh must confirm active runtime; failed or unconfirmed
loading stays visible. OpenCode is never restarted automatically.

## Approach and edge cases

The server computes `managedBy: "codenomad"` from the authenticated
daemon's discovery root, a validated installer-generated entry and its
SHA-256-addressed payload location/content. The UI filters that marker
rather than recognizing names. Shared installer parsing preserves
retained outside-root storage. Build scripts publish a minimal
exported-ID descriptor inside the hashed payload so absent runtime
entries can still be correlated with exact, prefix and all-plugin
disabling rules, without importing executable code or adding an ID
catalogue.

- Windows paths and file URLs retain their native identity; WSL
translates native directories only for host IO. Reserved WSL UNC
zero-device metadata still requires independent handles, matching
nonzero inodes, regular single-link files, stable bounded reads and
SHA-256 verification. Final file links remain detectable.
- Inherited/external and virtual configuration origins remain distinct
from the writable Project recovery destination; unavailable destinations
offer no mutation.
- Managed failures before exporting an ID retain details, including
native references, without fabricated activation switches or duplicate
warnings. Unproven and third-party local failures retain ordinary path
rows.
- Third-party homonyms remain controllable. The separately packaged
session-pruning TUI companion is not installer-owned merely because its
ID resembles a desktop plugin.
- Concurrent mutation/read reconciliation preserves newer runtime
provenance and failure details; keyboard focus returns to Refresh when a
warning disappears.

## Documentation

Updated `dev-docs/PLUGIN_CONTROLS.md`,
`dev-docs/OPENCODE_COMPATIBILITY.md`, and `docs/help/*/integrations.md`
in all ten supported languages, alongside localized UI labels. The
plugin list is documented on the Integrations help page.

## Validation

Publication rerun on the pushed commits:

- `node --import tsx --test
packages/server/src/opencode/desktop-plugin-artifact.test.ts
packages/server/src/opencode/desktop-plugin-managed.test.ts
packages/server/src/opencode/plugin-controls.test.ts
packages/ui/src/stores/plugin-controls.test.ts` — **96 passed, 0 failed,
0 skipped**. Covers verified managed files, third-party homonyms,
tampering/links, disabled rules, scoped recovery, stale-response fencing
and runtime confirmation.
- `node --import tsx --test --test-concurrency=1
packages/ui/tests/browser/plugin-controls.test.ts` — **28 passed, 0
failed, 0 skipped**. Exercises the real list, warning, Re-enable, native
events, failure details, scope labels and keyboard focus.
- `npm run test:help` — **31 passed**; validates **28 pages in 10
locales**.
- `npm run typecheck --workspace @neuralnomads/codenomad` and `npm run
typecheck --workspace @codenomad/ui` — **passed**.
- `node --import tsx scripts/test-plugin-runtime-native.mjs
<absolute-isolated-cli>` with **OpenCode 2.2.5** — **passed**: native
loading reports the generated `.ts` shim, matches verified installation
provenance, and agrees with the exported-ID descriptor; isolated native
RPC/Form checks also pass.
- With `CODENOMAD_TEST_WSL_PLUGIN_CONTROLS=Ubuntu`, the real
`desktop-plugin-managed-wsl.test.ts` case **passed**, including
zero-device metadata, corruption repair and hard/symbolic-link refusal.
The combined rerun with `plugin-control-document-wsl.test.ts` exceeded
its 180-second local budget after successful document cases; that full
rerun is not claimed complete.
- `git diff --check origin/dev...HEAD` — **passed**. Clean worktree;
exactly the two delivery commits above `origin/dev`, with no rebase,
force push or push to `dev`.
2026-11-06 04:13:30 +01:00
Pascal André
dccb57ebec
fix(worktrees): keep checkouts lacking the opened nested folder out of recovery (#1299)
A project opened as a folder inside a repository mirrored that folder over
every linked checkout, even where it does not exist. Pending-request recovery
required each absent mirror, so the "questions and permissions not fully
recovered" warning listed dozens of nonexistent worktree folders and never
cleared.

The native inventory now flags such checkouts `nestedFolderMissing` while
keeping their ownership, so conversations placed there stay routed and
accessible. Recovery no longer derives a required location from them (the
selected conversation, active sessions and known requests stay required), and
the worktree selector lists them only while selected. Creation checks before
any native call that the starting revision tracks the opened folder and
otherwise answers 409 `nested_folder_unavailable`, shown translated, leaving
no checkout or branch behind.

Covered by the nested-workspace Git fixture and a pending-recovery store test;
dev-docs and the Projects help page (ten locales) describe the behavior.
2026-11-06 01:35:49 +01:00
Pascal André
fc1b9e72b2
feat(transcript): optional first/latest controls in the timeline corner (#1295)
General gains "Put the first/latest message arrows under the timeline", off by
default. With it on and the timeline shown, the first/latest controls leave the
transcript for the corner cell under the timeline, right of Send: small filled
stop arrows in the accent colour, both always in place, the end the reader has
reached faded and without hover highlight but still clickable. Otherwise (option
off, timeline hidden, conversations under 420px) the floating controls stay.

PromptInput renders the corner inside its footer and SessionView hands it to
MessageSection as a portal mount, so it follows the composer when an open
interruption dock scrolls the session stack. One view-scoped width sizes the
corner and the footer reservation; touch layouts get two 32px targets.

Two fixes keep the First control honest: the oldest window (the first ascending
page) no longer stores the native boundary cursor as older history, and a
viewport resize keeps a reader at offset 0 at the start.

Validation: gatekeeper review approved with no remaining findings (geometry,
accessibility tree, ten-locale help). Store and browser regression tests cover
the cursor, the resize at the start, the General checkbox and its persistence,
the corner geometry and fallbacks, header-windows and the Android short-keyboard
dock. Help and SESSION_HISTORY_NAVIGATION.md are updated in all ten locales.
2026-11-05 20:46:07 +01:00
Pascal André
4bac37339f
fix(sessions): restore the collapsed parent chevron (#1292)
Some checks failed
Publish help / build (push) Has been cancelled
Publish help / deploy (push) Has been cancelled
#1286 also changed a collapsed parent's chevron, which the maintainer never
approved: when subsessions were Idle or Interrupted, clicking the chevron
cleared their badges instead of expanding the parent, and an interrupted
subsession coloured the chevron a steady orange that read like frozen
work.

The chevron is restored exactly to its earlier behavior: a click always
expands or collapses, with its original labels, and it mirrors the
subsessions' live state as before (input steady, working and compacting
pulsing, idle steady green); interrupted subsessions do not colour it.
Clearing stays on row badges only, by click or drag sweep; acknowledgement
and persistence from #1286 and #1287 are unchanged.

Implementation: reverted the expander click, labels and sweep membership,
the added interrupted descendant kind, its CSS and the auto-expand
exclusion; removed clearDescendantStatus, the expander-specific sweep
clear callback and the now-unused strings in ten locales. Docs and the
conversations help page in ten locales no longer mention chevron clearing.

Validation: a browser regression with the real session list and native
dispatcher (a collapsed parent with Idle and Interrupted children expands
and collapses, badges intact, no interrupted colour) failed on dev and
passes; 227 unit/store tests, 18 browser tests, UI typecheck, 31 help
checks. The chevron code, session-tree.ts, session-child-activity.ts and
its CSS were checked identical to the pre-#1286 sources. Merged at the
maintainer's request without an independent review and before CI
finished.

Refs #1274
2026-11-04 19:01:41 +01:00
Pascal André
990f6ce06b
feat(missions): join launch criteria with or/if/else connectors and fallbacks (#1291)
## Summary

Recurring Missions now launch from one ordered list of criteria
(schedules and events). Small automatic connectors between the cards
show how they combine; dragging the cards changes the meaning.

- **or**: two schedules, or two events, side by side.
- **if**: events after a schedule group are the conditions of every
schedule in that group. They never trigger on their own.
- **else**: a schedule group after events is a fallback for everything
above it. At each of its slots it launches only if the criteria above it
(or **Run now**) started no passage since that schedule's previous slot.
Events after a fallback condition only that fallback.
- Events at the top launch on each new occurrence (checked every 15
minutes). Schedules at the top launch at their times. An empty list is a
one-time Mission.

Example: *new commits, 18:00, new messages, 20:00* launches on each
commit; else at 18:00 if new messages arrived; else at 20:00,
unconditionally.

## Implementation

- **One shared parser.** `missionCriteriaStructure`
(`missions/mission-launch-kind.ts`) gives connectors, roles and
per-schedule plans (`conditions`, `fallback`, `group`). The codec,
engine, editor and list summary all use it.
- **Fallback periods.**
- A fallback's period starts at its previous slot (`lastDueAt`). Before
its first slot, it starts when its calendar was armed (`armedAt`).
- After an edit, an unchanged schedule keeps its origin, even when the
calendar is re-armed. A changed or added schedule starts at its new
anchor.
- A passage counts by its slot once admitted, even if it fails later. A
pending passage not yet admitted makes the decision uncertain, so the
fallback does not launch.
- **Grouped launches are decided at the slot.** Wakes that arrive while
a passage runs are judged by a source read made then, measured against
the references the running passage will consume. Settlement launches at
most one grouped passage, and its `deferred` origin records the
calendars it came from.
- **Sources.** Source snapshots report each changed event key, so a
schedule group reads only its own conditions. A skipped slot consumes no
source. Trigger marks are removed.
- **Editor.**
- Cards still reorder with solid-dnd drag and with Alt+Up/Down on the
grip, which announces the new position in a live region.
- While dragging, connectors follow the projected order in a
fixed-height line, so the layout does not shift.
- The **i** tip explains if/else in two sentences and links to the
OpenCode login-start setting.
- **Stored legacy policies.** They keep their bytes and behaviour:
multi-calendar conditions, stored end dates, and the single launch of an
event-only policy until the schedule is edited.

## Validation

- **Server Missions suites:** 1750 of 1752 pass, 1 skipped. The other
failure is `mission-local-sources`, the known git timeout under parallel
load; it passes alone (10/10). New tests cover:
  - the parser table: E,E / H,H,E,E / E,H,E,H / H,E,H / E,H,H,E,E,H;
  - the approved chain over six days, and fallbacks on consecutive days;
  - Run now and failed passages that were admitted; uncertain admission;
  - grouped decisions frozen at the slot;
  - calendar arming and re-arming after edits, through the owner;
  - legacy multi-calendar compatibility.
- **Browser (mission, preferences, settings, service, provider-accounts,
websearch and opencode-login-start files):** 571 of 572 pass. The
failure is `mission-task-pages`, a timing flake under load; it passes
alone (20/20). Coverage includes pointer and keyboard drags, connectors
during and after a drop, focus, and no reflow.
- UI and server typechecks, UI build, missions plugin bundle, UI unit
and locale tests (100/100), help structure (31/31) and `git diff
--check` all pass.
- Dev docs (`MISSIONS.md`, `MISSIONS_RECURRING.md`) and the Missions
help in ten languages are updated.

## Notes

- A wake whose source read fails at its slot stays unconsumed and is
decided by the next read, like any retried wake.
- While a card is being dragged, it can visually cover the connector of
the card below it.
2026-11-04 17:59:56 +01:00
Pascal André
25b8553060
fix(settings): label login start as Start OpenCode at startup (#1290)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
## Summary

- Renames the Settings → OpenCode row **Start OpenCode at login** to
**Start OpenCode at startup** (French: **Démarrer OpenCode au
démarrage**), with a natural equivalent in all ten locales.
- Its "i" tip now says in one sentence that OpenCode starts when the
user session opens.
- Copy only: behaviour, the `#opencode-login-start` anchor, i18n keys,
API and OS artifacts are unchanged.
- Help `opencode.md#login-start` in every locale uses the new UI label;
the behaviour is still described as starting at sign-in. Developer docs
quoting the label follow it.

| Locale | Label | Tip |
| --- | --- | --- |
| en | Start OpenCode at startup | OpenCode starts when you sign in to
your user session. |
| fr | Démarrer OpenCode au démarrage | OpenCode démarre à l'ouverture
de votre session utilisateur. |
| de | OpenCode beim Systemstart starten | OpenCode startet bei der
Anmeldung an Ihrer Benutzersitzung. |
| es | Iniciar OpenCode al arrancar | OpenCode se inicia al iniciar tu
sesión de usuario. |
| he | הפעלת OpenCode בעת האתחול | OpenCode מופעל בעת הכניסה לחשבון
המשתמש שלכם. |
| ja | スタートアップ時に OpenCode を起動 | OpenCode はユーザーセッションへのサインイン時に起動します。 |
| ne | स्टार्टअपमा OpenCode सुरु गर्नुहोस् | तपाईं आफ्नो प्रयोगकर्ता
सत्रमा साइन इन गर्दा OpenCode सुरु हुन्छ। |
| ru | Запускать OpenCode при старте системы | OpenCode запускается при
входе в ваш сеанс пользователя. |
| tr | Başlangıçta OpenCode'u başlat | OpenCode, kullanıcı oturumunuz
açıldığında başlar. |
| zh-Hans | 开机时启动 OpenCode | OpenCode 会在你登录用户会话时启动。 |

## Tests

- `opencode-login-start` browser test (headless Chromium,
`hide-console-windows.mjs`): 5/5; it now also checks that each locale's
info icon carries that locale's tip.
- i18n tests: 9/9.
- `scripts/test-help.mjs`: 31/31.
- UI typecheck and `git diff --check`: clean.
2026-11-04 13:25:04 +01:00
Pascal André
c8fb4f13c3
feat(opencode): replace service supervision with Start OpenCode at login (#1288)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
## Summary

Replaces the **Keep OpenCode running** OS supervision with a simple,
voluntary **Start OpenCode at login** setting (Settings → OpenCode). It
is off by default, has no link to Missions, and its only state is one OS
artifact per user account that starts `opencode serve --service` at
sign-in. CodeNomad no longer supervises, health-checks or restarts
OpenCode itself.

## Behavior per OS

| OS | Artifact | Crash handling |
| --- | --- | --- |
| Windows | One scheduled task (`CodeNomad-OpenCode-Login`) with a
single logon trigger for the current SID, `InteractiveToken` +
`LeastPrivilege` (no password, no elevation). Its action is a stable
copy of a GUI-subsystem launcher
(`%LOCALAPPDATA%\CodeNomadOpenCodeLogin`) that starts OpenCode with
`CreateNoWindow` and exits, so no console window appears. | Not
restarted. |
| Windows → WSL | Same task, launching `wsl.exe --distribution <d>
--exec <binary> serve --service` when the selected executable is a WSL
path (a distribution root alone is refused). A CodeNomad server running
*inside* WSL reports the setting as unavailable. | Not restarted. |
| macOS | `~/Library/LaunchAgents/org.codenomad.opencode-login.plist`
with `RunAtLoad`, `KeepAlive { Crashed = true }` and the server's `PATH`
in `EnvironmentVariables`. Written/deleted without `launchctl`, so it
applies at next login. | Relaunched by launchd after a crash; an
explicit `opencode service stop` stays stopped. |
| Linux | `~/.config/systemd/user/codenomad-opencode-login.service`,
`WantedBy=default.target`, `Restart=on-abnormal` +
`RestartPreventExitStatus=SIGKILL`, `Environment="PATH=…"` (server's
PATH only), enabled/disabled without `--now`, no linger. Hosts without
`/usr/bin/systemctl` report unavailable. | Relaunched after a crash
signal (SIGSEGV, SIGABRT…); never after an exit code (`opencode service
stop` exits 130) or SIGKILL. |

- Turning the setting off removes only that task / LaunchAgent / unit; a
running OpenCode keeps running.
- The artifact keeps the selected executable path (package-manager links
survive versioned upgrades) and follows explicit executable changes and
verified installs (`refresh()` also rewrites the PATH). Command wrappers
(`.cmd`, `.ps1`) are refused with a fixed `unsupported-binary` error.
- Windows reads a task as absent only on Task Scheduler's
`ObjectNotFound`; any other lookup failure is an error.
- UI: one switch with a one-sentence info tip, and one fixed localized
error when a change is refused or the state cannot be read (10 locales).
Stable row anchor: `#opencode-login-start`; help section id:
`#login-start`.
- API: `GET|POST /api/opencode/login-start` (`{ state: "on" | "off" |
"unavailable" }` / `{ enabled }`); POST requires a live human session. A
GET also applies the migration below.

## Migration from the former supervision

At server startup and before every read or change:
- If a former service key was ON, the new login artifact is installed
**first**. If that fails, the former installation is left untouched and
reported as `on` (it still starts OpenCode); an explicit OFF then
retires it without installing anything, and fails while it cannot be
released.
- Each former guard is released by rewriting its manifest to OFF; only
its exact resources are removed. Windows:
`CodeNomad-OpenCode-<key>-Main/-Recovery` matched by their exact
description marker, disabled, Main awaited (never ended), then
unregistered. macOS: `bootout` (relies on `AbandonProcessGroup`) and
plist removal once unloaded. Linux: `stop` only when `systemctl show`
reports that exact file loaded with `KillMode=process` and no drop-in,
then disable/unlink.
- Linger is disabled only when CodeNomad owned it (unchanged marker
fingerprint) **and** a user session is open; personal or altered linger
is never touched.
- The running OpenCode is never stopped during migration.

## Removed

The PowerShell guard, probe, Recovery task and per-minute backstop;
runtime provisioning and target pinning; manifests, receipts, stores and
locks; linger registry and ownership; the WSL bridge; health circuit and
the Failed/Retry UI; the unused connection-pinning resolver parameter
and `maximumBytes` storage parameters; their native qualification
scripts, UI card, hook and i18n. The macOS process-identity helper used
by Missions is kept (renamed `process-identity-macos`, `identity` only).

## Validation

- Server and UI typecheck; `git diff --check`.
- Unit tests: artifact generation (task XML, plist incl. PATH and
XML-invalid characters, unit incl. restart policy and PATH), idempotent
install/remove per OS, `ObjectNotFound`-only absence, migration from
each former installation including linger ownership, route auth/error
codes, launch resolution (WSL root refusal, PATH filtering) — 25 tests
in the two login-start files; targeted server suites 1003 tests (998
pass, 5 pre-existing skips).
- Browser: `tests/browser/opencode-login-start.test.ts` (states,
one-sentence tip, read error kept after a refused change, all 10
locales) plus related settings/setup fixtures — 104/104.
- Help: `scripts/test-help.mjs` 31/31.

### Real runs (each removed everything it created; the shared service
registration's SHA256 and LastWriteTimeUtc were unchanged)

- **Windows** (`scripts/test-opencode-login-start-windows-native.mjs`):
uniquely named task + isolated OpenCode service (own HOME/XDG roots and
port). Started on demand: `opencode.exe serve --service` on the isolated
port, no visible window (only a hidden `conhost.exe` child), launcher
exited, task back to Ready with result 0. Disabling removed the task
while the service kept running.
- **Windows → WSL** (`scripts/test-opencode-login-start-wsl-native.mjs`,
Ubuntu, OpenCode 2.2.5 in a run-owned directory, isolated XDG roots via
`WSLENV`): the task started a hidden `wsl.exe` chain, and `serve
--service` ran in the distribution with the isolated environment,
listening on the isolated port and reachable from Windows (HTTP 401
without credentials). No owned or new visible window, task Ready/0.
Disabling removed the task and the service kept running. Cleanup stopped
it, removed the downloaded CLI and roots, and returned the distribution
to Stopped.
- **Linux** (`scripts/test-opencode-login-start-linux-native.mjs`,
Ubuntu 24.04 VM, no linger, unique unit name, isolated XDG roots and
port):
- a real logout/login (user manager restarted) started the unit with the
server's PATH;
- `opencode service stop` exited 130 and was **not** restarted (the
former `Restart=on-failure` restarted it, measured);
- a port held by another listener caused no restart loop (OpenCode 2.2.5
waits without exiting);
  - SIGSEGV was relaunched, SIGKILL was not;
  - disabling removed the unit while OpenCode kept running;
- linger stayed `no`, and the user unit directory was unchanged after
cleanup.
- macOS: artifact and adapter tests only (no real login run).
2026-11-04 03:54:39 +01:00
Pascal André
e4b40d85fa
feat(integrations): ship native Status sections and catalogue installation (#1283)
Ship native integration Status sections and catalogue installation by integration ID, including the complete change from #1280. Keep plugin package management in Plugins, per-conversation attachment authority in Status, guarded installation, shared controls, persistent section customization and all ten UI/help locales.

Merge current origin/dev into the feature branch with an ordinary merge, preserving file-reader lifetime and the latest native browser fixture contracts. Resolve conflicts in instance-shell2.tsx, right-panel/core-runtime.tsx, automation-forms.test.ts and session-child-activity.test.ts without weakening assertions or deadlines.

ADMIN-FORCED MERGE AT THE HUMAN'S EXPLICIT REQUEST. The human accepts exactly these two remaining Missions browser failures for this merge:
- mission-schedule-list: fresh-read Start scenario, 15-second SSE setup timeout; reproduced on dev cc5961a797 and established as pre-existing.
- mission-lifecycle-revision: 409 without certified code scenario, 30-second bootstrap timeout; not reproduced by the bounded diagnosis, attribution UNKNOWN, not claimed as pre-existing.

Diagnosis evidence: https://github.com/NeuralNomadsAI/CodeNomad/pull/1283#issuecomment-6617704358
Original full-suite record: https://github.com/NeuralNomadsAI/CodeNomad/pull/1283#issuecomment-6617213011 (1805 pass / 2 fail / 0 skip).

Post-synchronization validation on aba257802949123028741982ba64da988abcbb01: root/server/UI typechecks pass; relevant unit and route suites 142/142; help 31/31; integration browser plus conflicted Forms/session-child suites 144/144; additional file-preview browser regression 5/5. Zero skips or weakened assertions/deadlines.

Foreground gh pr checks --watch completed. Ready-for-review CI run 41737660774 succeeded on this exact head, including all four browser shards, unit tests, compatibility, runtime contracts, native pruning and desktop builds: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/41737660774 . The preceding run 41737659582 was cancelled; its four cancelled jobs have no steps and remain displayed as fail by gh. These are cancellation records, not executed test failures. The historical two-failure local full result and its limited acceptance remain recorded above.

This exception is limited to this administrative merge. Separate desktop/manual/privacy and publication gates remain scoped independently. No release, tag, npm publication or catalogue change.
2026-11-04 01:36:40 +01:00
Pascal André
5092ef152d
fix(sessions): clear Interrupted badges only on explicit gesture (#1287)
After #1286, opening or viewing a session also acknowledged its
"Interrupted" badge. The maintainer decided an interruption must stay
visible until the user explicitly clears it, so returning to a session
does not hide that its last run was interrupted.

Behavior: the Interrupted badge now clears only by clicking it, by the
drag sweep across rows, or through a collapsed parent's indicator. Idle
still clears when the session is viewed. Acknowledgement watermarks, the
re-show on a new interruption, no resurrection on refresh, and the
non-clearable Working, question and permission states are unchanged.

Implementation: removed the view-triggered interruption acknowledgement
path; explicit clearing and persistence are untouched. Developer docs
and help in ten locales no longer say that opening clears Interrupted.

Validation: 192 unit tests, 67 browser tests, UI typecheck, 31 help
checks; both new regressions failed before the change. Independent
review found no P0-P3 defects. Merged at the maintainer's request while
CI was still queued or running with no failure reported.

Refs #1273
2026-11-04 00:46:27 +01:00
Pascal André
8195da0f33
fix(missions): disconnect Missions from service supervision so Play and Resume always run (#1285)
## Symptoms

Reported on the latest dev build (last healthy:
`1.0.1-dev-20261101-fb44655c`):

1. Starting a one-time Mission fails with **"Action not yet confirmed.
Check status before retrying."**, and nothing confirms the outcome.
2. After a Pause, **Resume** tries to resume but appears to hang.

## Cause

#1259 (a5efdefc8) made Play default the shared service supervision
("Keep OpenCode running") to ON. Four routes called
`supervision.missionPlay` before dispatch: one-time Play and Resume,
unified schedule Play, and recurring Play. On any host where supervision
cannot be acquired, that call throws. Examples: an unsupported platform,
OpenCode not running as the registered native service, a wrapper
executable, or a namespace that cannot be read. The route then answered
a codeless 503, and the Mission never started. The panel kept the
request as unconfirmed, and no read could ever settle it.

## Changes

- **Missions no longer touch supervision.**
- The one-time control route, the unified schedule route and the
recurring Play preparation have no supervision dependency, and the HTTP
server no longer wires one into them.
- The supervision-only human check on one-time Play is gone. Fenced
connection and workspace checks still refuse before dispatch, and
schedule and recurring Play keep their own human proofs.
- `ServiceSupervisionSettings.missionPlay` and `firstPlay` are removed.
- **Supervision is voluntary.**
- A never-chosen preference is OFF, and only the Settings switch turns
it on.
- A stored ON stays ON: no migration and no uninstall. Retained
`first-play` receipts still parse.
- Settings drops **Keep off at first Mission Play**, and its info text
no longer refers to Missions in any of the ten locales.
- **Lifecycle controls** (`components/mission-lifecycle-controls.tsx`):
when a re-read shows the exact request saved with nothing pending, the
request is settled without a resend. A missing control never settles a
request, and durable partial controls keep their explicit
refresh-and-resend path.
- **Docs**: the dev-docs and the help pages (all ten locales) describe
supervision as a standalone OpenCode setting that stays off until turned
on. Neither the Missions docs nor the supervision docs mention a link
between the two.

## Validation

- Route tests now check that Play never calls an injected supervision
dependency that would throw: one-time Play and Resume, schedule Play and
recurring Play.
- **RED** on the previous code (503, or a supervision call), GREEN now.
- Lifecycle browser tests (a lost reply whose saved control confirms a
Play or a Resume): **RED 0/2** on origin/dev, GREEN now.
- Service-supervision browser tests (a never-chosen preference shows
only Off, in all ten locales): **RED 0/2**, GREEN now (12/12).
- Server Missions and supervision suites: 1802 tests, 1799 passed, 3
platform skips, 0 failed.
- Missions browser suites: 511 of 513 passed.
- The two `mission-panel-focus` unfocused-window preconditions fail
identically on the base.
- Server and UI typecheck, Missions plugin bundle, help checks 31/31,
`git diff --check`.

## Limits

- The Resume symptom was reported as "hangs in *Waiting to run…*".
Resume went through the same `start` path, so on affected hosts it
failed for the same reason. However, no isolated OpenCode service was
available to reproduce that exact display.
- The supervision resolvers still accept a connection-pinning argument
that no caller passes now. That is left for the planned supervision
simplification.
- A control refused before dispatch for another reason (changed
connection or workspace) still answers a codeless error, which the panel
keeps as unconfirmed.
2026-11-04 00:12:04 +01:00
Pascal André
3f72ba43a8
fix(sessions): clear acknowledged idle and interrupted badges (#1286)
The session list kept "Interrupted" badges forever (#1273) and offered no
way to clear stale "Idle" and "Interrupted" badges without opening each
session (#1274).

Behavior: clicking an Idle or Interrupted badge clears it without selecting
the session; pressing on a badge and dragging across rows clears every
badge passed over, reusing the shared sweep helper from #1221 (touch
scrolling never clears); a collapsed parent's indicator clears its
descendants' badges; opening a session clears its Interrupted badge as it
already did for Idle. Working, pending questions and pending permissions
are never clearable. No new button or menu; the reload action is
unchanged. Help is updated in ten locales.

Implementation: clearing is an acknowledgement only and never changes
native outcome or recovery facts. Acknowledgements are per-window and
per-project-tab watermarks on native boundaries, persisted with the Idle
markers inside the native client-state budgets. A new native interruption
shows the badge again; refresh, reconnect and hydration do not resurrect
an acknowledged one. The acknowledgement authority is claimed before the
asynchronous activity read, older metadata never lowers a clear, metadata
from a later run (or a run start received after the clear) retires the
provisional association without extending it, and deleted or pruned
sessions release their entries.

Validation: 243 unit/store tests, 66 browser tests with the real session
list and native dispatcher, UI typecheck, 31 help checks; each review
finding was reproduced by a sleep-free real-handler regression before its
fix. Four review rounds found 0 P0/P1; all P2 findings are fixed.

Merged at the maintainer's request before the fifth confirmation review
and CI finished: the build job of this head was still running.
2026-11-04 00:02:39 +01:00
Pascal André
252e07b4a8
fix(files): keep the central file reader open when the right panel hides (#1267)
Fixes #1265

## Problem

Opening a file with the eye in the Files panel and then hiding the right
panel (top-right **Right panel** toggle) to gain reading width closed
the file reader too.

## Root cause

The central reader's lifetime was owned by the Files panel runtime
(`core-runtime.tsx`), which closed the preview in its `onCleanup` and
again in a non-deferred session/worktree effect that also runs on mount.
Hiding a docked panel (or a window too narrow for it) moves `RightPanel`
from the docked box into the floating drawer branch of
`instance-shell2.tsx`, disposing and recreating that runtime, so a
presentation change acted as a dismissal.

## Fix

- New `instance/shell/file-preview-lifetime.ts`, used by the instance
shell: closes the reader on a session or session-worktree change
(deferred), when the target's worktree is removed, and on shell
disposal. These are the existing cleanup rules, now independent of panel
visibility.
- `core-runtime.tsx` only opens readers; its browsed worktree stays
panel state. An explicit worktree switch in the panel and the reader's
own close button still close the reader.
- Readers stay mounted in the session view, so hiding or showing the
panel doesn't duplicate the reader, and its editor, draft, selection and
scroll are kept. The Workspace reader isn't reread. Showing a hidden
**Changes** view again remounts its sidebar, which revalidates Git
status and rereads the open local diff once, into the same Monaco editor
and model. That revalidation is kept on purpose because it picks up
filesystem changes made while the panel was hidden. No new background
work: the hidden panel's Workspace/Changes/Commits hooks stay gated by
panel activity, and the Changes reconciliation still checks target
identity before reopening.
- Help `files.md` (10 locales) and `dev-docs/FILES_PANEL.md` updated.

## Validation

- New `tests/browser/file-preview-panel.test.ts` (real instance shell,
Files panel, real toggle, viewport and keyboard):
- on `origin/dev` source: 3 of 4 fail (docked toggle, lost-room resize,
hidden-panel session fence); the floating-drawer dismissal case passes,
so it guards the phone layout rather than reproducing the bug
  - with this change: 4/4 pass
- added after review: a Changes test opens a local diff in production
Monaco, then scrolls and selects inside it, then hides and shows the
panel. Git reads are 1/1 after opening, 1/1 while hidden and 2/2 after
showing. The reader DOM, diff editor, modified model, selection, scroll,
path and scope all stay the same. It fails on `origin/dev` source
(hiding disposes the editor) and passes here; the whole file is 5/5
- After the follow-up commit: `file-preview-panel`, `git-history`,
`git-changes-scale`, `drawer-width`, `drawer-accessibility`,
`panel-resize`, `shell-navigation`: 74/74 pass; `tsc --noEmit` and `git
diff --check` pass
- Affected browser suites (git-history, git-changes-scale, git-init,
header-windows, mission-cross-navigation, mission-native-family,
mission-reader-transcript, drawer-width, panel-resize, shell-navigation,
mobile-interruption): 168/168 pass
- Right-panel/shell/workspace-editor unit tests
(`--conditions=browser`): 52/52 pass
- `tsc --noEmit -p packages/ui/tsconfig.json`: pass
- `npm run test:help`: 31/31 pass

`instance-shell2.tsx` is about 1350 lines; this change only adds two
lines to it.
2026-11-03 15:07:31 +01:00
Pascal André
8271801e27
fix(supervision): run Windows Main and Recovery without consoles (#1278)
Windows supervision tasks launched interactive console PowerShell processes.
Closing the console could trigger Recovery to recreate Main, repeatedly
disrupting the desktop even when an independently running OpenCode service
was already healthy. The unchanged guard reproduced this in an isolated
owned fixture; PowerShell's hidden-window switch alone did not prevent it.

Launch Main and Recovery through a GUI-subsystem helper using
CreateNoWindow, and start host/WSL children with CREATE_NO_WINDOW and
CREATE_UNICODE_ENVIRONMENT. Preserve hidden activation/probes and the
existing service ownership boundary: an observed OpenCode daemon is never
stopped by this change.

Upgrade exact owned task actions during startup/acquisition, retaining the
desired preference, revision, receipts, principal and recovery triggers.
Pin artifacts while an upgrade is pending and require strict read-back.
Existing running guards remain until they exit; subsequent launches use
the windowless action. Update runtime documentation and ten help locales.

Validation includes baseline console/recovery reproduction, native owned
task migration to a windowless Main with the fake incumbent preserved,
host-lifetime/updater/help suites and typechecks. Independent review found
no P0-P3 defects. Packaged desktop, login/reboot, actual WSL and short-lived
Recovery window tracing remain unqualified.

Merge explicitly requested despite the general CI failures. Paired
base/head qualification reproduced inherited automation counter/focus and
offscreen-session failures; the counters include panel-read POSTs. Windows
election failures have matching historical evidence, but their cause and
the exact Pause-form variant remain unresolved. No PR regression was
established; this is not a claim of a fully green CI run.

Fixes #1275
2026-11-03 13:57:27 +01:00
Pascal André
404f160901
feat(usage): estimate OpenCode Zen free quota in Status (#1276)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
## Summary
- Add a daily estimate for identified OpenCode Zen free models to Status
> Usage, using the existing bar and a translated caveat.
- Sum this OpenCode service's recorded free-model steps since UTC
midnight against an explicitly assumed 200-request reference. Mark the
next UTC midnight as an estimated reset; actual provider/IP limits and
other clients remain unknown.
- Reuse session ownership and reconnect/movement fencing; read no
provider credentials, load no transcripts, and leave Stats and
paid-provider readers unchanged.
- Update provider help in all ten locales.

## Validation
- 16 server tests: estimator plus real SDK usage route, including UTC
midnight, unavailable/malformed stats, movement/reconnect fencing and
credential-free aggregation.
- 14 browser usage-panel tests, including estimate rendering and
provider-switch cleanup.
- Server and UI TypeScript checks.
- 31 multilingual help checks.

## Review
Autonomous review/correction passes continue on this PR before the
explicitly requested administrator merge. The estimate is a local
heuristic, not provider-authoritative quota data.
2026-11-03 01:57:01 +01:00
Pascal André
a579403b70
fix(missions): keep Scheduling stable while it revalidates (#1272)
## Summary
Scheduling in the Mission editor no longer flickers while it
revalidates, and it no longer shows the OpenCode configuration file
path.

## Changes
- `mission-editor-schedule.ts`: a single memoized owner (view, client,
native generation) decides when Scheduling resets; capability and
document reads are separate, started outside reactive tracking, fenced
by owner and visibility, and coalesced to one active read plus at most
one trailing read. Task changes, transcript releases and instance
updates no longer trigger reads; config, plugin and reconnect events
still do. Hiding the panel aborts the read; showing it again rereads. No
polling, and the global generation getter is unchanged.
- During a reread the form keeps its content, enabled state, geometry,
focus and open select; the existing update icon in the Missions toolbar
is the only progress cue (`mission-editor.tsx`, `MissionControl.tsx`).
- `mission-scheduling.tsx`: removes the configuration path line. The
shared i18n key stays because the subagent depth setting still uses it.
- Writes still reread the document before sending; read errors stay
visible with their refresh action.
- Docs: `dev-docs/MISSIONS.md` and the Missions help page in all ten
locales.

## Validation
- New browser regression `mission-scheduling-stability.test.ts` fails on
the base (4 capability reads on open) and passes with the fix.
- Browser: 102/102 across mission-scheduling-stability, mission-control,
mission-editor-scheduling, mission-scheduling, mission-preparation and
mission-schedule-list.
- Unit (`--conditions=browser`): 113/113 targeted; UI typecheck,
`scripts/test-help.mjs` and `git diff --check` clean.
- Independent QA also exercised a fence with abort disabled, hide →
owner change → show, Edit mode document reread and a parent operation
during a read: all passing, no P0–P2.

## Known follow-ups (minor)
- After a failed document read, Retry briefly replaces the error message
with the loading message.
- `props.directory` is read once at creation; not reachable from Mission
Control today.
2026-11-02 22:49:26 +01:00
Pascal André
6b8baf2320
feat(missions): bound current recurring passage display reads (#1269)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
Complete bounded display reads for daily and unified-scheduled current
passages. Project inventory is already merged; this branch includes the
Missions UX correction from #1271.

## Contract

- `recurrenceCurrent` reads only exact owner/project/Location,
schedule/passage/execution identity, frozen-source digest and separate
owner revision. Scheduled sources include configuration/time
generations.
- `recurrenceCurrentPage` validates that source, one accepted isolated
range, creation proof, coordinator/profiles/task mode and a fresh owner
identity before publication.
- Reuse ordinary bounded headers, task/field/activity windows and exact
body selectors: **64 KiB UTF-8 responses**, **16 KiB requests**, bounded
assembly, original deadlines/cancellation and exact digests.
- Both passage kinds use scoped inventories for tracking, graph, Needs
you, fields and central readers. Immutable report selectors retain
historical evidence; unrelated updates retain unchanged task/body
caches.
- Central promotion checks stale state, marks, exact expected digest and
the pending value's original live operation. Demand contraction, late
completion and a later owner cannot resurrect an unvalidated pending
body.
- Internal/admission/mutation maps and schedule controls retain
authoritative full reads. Display reads grant no replay/input/control
authority.
- No cumulative 32-MiB display-source cliff or arbitrary task cap. One
accepted journal range is still reconstructed per native page; this is
bounded display transport, not a constant-memory journal redesign.

## Preserved presentation

The scoped consumers retain #1271's continuous scroll-loading task tree,
one manual fallback, info tooltips, stable refresh geometry and existing
top-right indicator. They also preserve the incoming active/focus policy
and schedule publication/edit barriers. The indicator includes
actor/task reads owned by the selected passage. No new polling or
redesign.

## Measurements

Accepted source qualification includes 864 tasks / 17,518,776 bytes and
1,728 tasks / 35,037,353 bytes, with approximately 2.4-KB logical
headers. All task rows and exact briefs are reachable. Fresh actual
UI/HTTP flows for both owners use 180 tasks, no initial prose fan-out,
scroll continuation, an off-page native request, exact/raw-field Retry
and unchanged-cache checks; maximum response sizes are 63,153 and 63,209
bytes.

## Qualification

- Fresh integrated tree: UI/server types, production UI build, native
Missions plugin build, **255 focused UI contracts**, **31
current-source/HTTP/passage tests** and **31 help checks** pass.
- **141 affected browser cases covered across completed corrected
runs.** Initial 16-file run: 138 passed, three test-assertion failures.
Two-file rerun: 13 passed, two current-selector assertion failures.
Final exact daily/scheduled rerun: 2 passed. Corrections wait for growth
beyond actual initial rows, inspect the real nested task wire selector
and require honest fresh marks continuation while keeping
geometry/held-label checks. No failing product assertion was skipped.
- Independent R4 at exact `a7ad14f06`: 255 contracts including all 56
promotion cases, four browser cases including both real 31-second
page-back cases, original pending/fresh/expired matrix and additional
assignment/deadline probes all pass.
- Independent integration reviews cover scoped inventories, preserved
UX/fences and the test-only corrections. Detailed English reports are
linked in comments; their exact tree/runtime scopes remain explicit.
- Earlier full UI/server, native 2.2.3 and source-cliff qualification
remains prior evidence. The separately documented wider
offscreen-grandchild failure and Windows headless unfocused-window setup
limitation are not silently waived or claimed green.

Ten-locale help and developer contracts are included. All
checkouts/dependencies/evidence remain separate and retained; no shared
daemon restart, OpenCode modification, borrowed dependencies or live
mission controls were used.

**Explicit approval is still required before merging #1269. Approval to
administratively merge #1271 did not authorize this merge.**
2026-11-02 14:17:44 +01:00
Pascal André
fb4e244b5a
fix(missions): stabilize refresh and simplify task continuation (#1271)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
## Purpose

Repair Missions panel presentation regressions introduced by bounded
display reads. Scaling approval did not authorize technical coverage
paragraphs, loading-only body blocks or per-gap continuation controls.

## Changes

- Keep loaded tasks and pins in one continuous dependency tree. A single
trailing sentinel loads the earliest missing bounded window on scroll,
with one standard manual fallback.
- Keep coverage/search explanations and explicitly scoped whole-mission
attention counts behind the existing focusable/touch-capable info
tooltip pattern.
- Preserve an existing continuation/info slot across passive refresh
cycles and retain stable button labels. Loading alone never mounts a
body block.
- Use the existing top-right indicator for inventory, selected header,
task, daily/current-passage and unified schedule reads.
- Retain explicit Retry, last-good rows, provenance/sequence fences,
off-page Needs you and recovery actions. Backend limits, ownership
checks and transport budgets are unchanged.
- Update the Missions help in all ten languages.

## Validation

- UI typecheck and production build.
- 29 store/task-page/native-event unit checks.
- Real-component browser checks for panel geometry, long/short
single-scroller layouts, dependency rails, held event-driven refreshes,
schedule-only background reads, 400-task scroll loading, failed
continuation Retry and sliced transport/reconnect fencing.
- 31 help checks.
- Screenshots inspected before/during/after held refreshes and on a
large mission.

The review's intermediate-page counterexample is covered: with 350 of
400 rows loaded and all 300 blocked tasks visible, the tooltip states
only whole-mission counts. It never infers an unread-attention count
from unrelated ordinary-window coverage, and no extra attention scan is
issued.

Before updating from dev, affected browser runs covered 93 distinct
cases and independent review closed the intermediate-count finding with
a fresh exact regression. The merge resolution retains upstream
active/focus and schedule-publication guards and adds inactive-sentinel
and held-keyboard regressions. UI typecheck/build, 110 units and 31 help
checks pass on the merged tree; the final task-page file passes 20/20
and host file 18/18. Two incoming unfocused-window tests stop at a
Windows headless Chromium focus setup precondition, reproduced on two
blank pages without CodeNomad. Their tests stay enabled and unchanged.
The final three-file run is 44 passed, 2 failed preconditions; no
full-green-browser-suite claim or blanket waiver is made. Detailed
English qualification and merge reviews are in the comments.

No live mission controls, shared daemon restart, borrowed dependencies
or worktree cleanup are used by this qualification. The window used by
the user is not replaced by these fixture builds.

## Merge gate

The user explicitly authorized resolving the conflicts and merging
#1271. PR #1269 remains suspended and separate; this correction does not
approve or merge its current-passage work.
2026-11-02 11:17:10 +01:00
Pascal André
f9a97d8a51
feat(integrations): attach native applications and manage plugin sources
Deliver authenticated native application attachment, host installation, binding refresh and revision-fenced plugin source management. Removal warns and confirms possible disruption without coordinating active conversations; local detach remains explicit and uncertain mutations are never replayed automatically.

Integrate accessibility and confirmed schedule-publication corrections, browser-fixture repairs and ownership of readiness writes during shutdown. Preserve the feature branch for the stacked integration-management work.

Admin squash merge explicitly requested by the user before all remaining browser and build checks finished. Targeted and native validation evidence is retained in the PR; this merge does not constitute complete CI, extension, platform or manual pilot acceptance. Remaining qualification continues separately.
2026-11-02 10:47:02 +01:00
Pascal André
903b286df3
feat(sessions): control recursive activity expansion from General settings (#1268)
Some checks are pending
Publish help / build (push) Waiting to run
Publish help / deploy (push) Blocked by required conditions
General now offers Automatically expand subsessions, enabled by default. A
visible collapsed row opens paths to its active descendants when its chevron
changes to working, compacting or awaiting permission/form input, provided the
row is selected or has the selected conversation as an ancestor. Visible
subsessions follow the rule recursively at every depth; other families retain
their activity indicators without opening. Pointer position is irrelevant.

SessionList owns the transition check and excludes Virtua's buffered offscreen
rows using the scroll viewport. Collapsing an already active branch, enabling
the setting or scrolling a busy row into view alone does not reopen it. Status
setters and metadata reconciliation only publish runtime state.

Delete the per-descendant suppression map and the automatic/manual distinction
in saved expansion state. All open branches restore normally, with the existing
local authority and deletion fences protecting concurrent restoration.

Validation: the user approved the behavior in a separate Electron dev instance;
gatekeeper review found no P0-P2 defects. Final local browser validation passes
62/62 tests across recursive expansion, search/selection, Electron/Tauri project
restoration, deletion, native Preferences and fixture wiring. UI typecheck, store
and client-state checks and 31 help checks also pass. UI messages and help are
updated in all ten locales.
2026-11-02 02:30:01 +01:00
Pascal André
8423db502f
feat(missions): adopt bounded panel inventory and selected headers (#1264)
Main **bounded-inventory UI adoption** following #1246, #1249 and #1250.
The live panel now uses `createMissionPanelInventory` →
`fetchMissionPanel`; public `fetchMissions` fan-out is removed.

## Contract and UI
- Independently verifiable 50-row directory/field windows: echoed
`{order,offset,end,total}`, window content digest, collection-order
continuation fence.
- Inventory summaries carry actor counts. A selected header excludes
whole actor/receipt/task collections; those are separately paged.
Native-scheduler `document`, cleanup `documentPending` and history
`requestID` survive.
- Initial durable `finishHighWater` is captured before discovery and
seeds once: later-discovered old completions stay seen; new completions
above the fixed baseline stay unseen, including deletion/purge counter
gaps.
- Explicit Show more/Retry for summaries, cleanup, fields, marks and
actors; loaded-only search. Selected/reader identities work outside the
first inventory page and do not wait for stalled discovery.
- Last-good display, owner/generation/page-revision fencing,
failed-middle Retry, no automatic changed-cursor restart. Separate actor
observations never become atomic whole-mission absence or recovery
authority.
- Exact cleanup retry/lost-ACK identity preserved.
Snapshot/admission/internal/mutation authority stays full. No mass
snapshot fallback.
- All ten help locales updated.

Every response stays within **64 KiB**, request within **16 KiB**;
logical reconstruction has explicit budgets/deadlines before allocation
and publication. Native per-Location lists and producer-sized
enumeration/hash costs remain disclosed.

## Measurements
- 50/120 summary rows: 11,915 bytes, one transfer, zero warm range/map
reads.
- Valid 601-actor selected header: 3,226 bytes.
- Explicit actor continuation: 160 root observations, largest measured
body 61,471 bytes.
- All 2,101 pending cleanups reachable; initial finish baseline remains
fixed during new completions.
- Notes-only revision: one wanted header, no task transfer or
expanded-task reread.

## Qualification fixes included
- Directory-only project Location omitted `workspaceID:undefined`, which
strict document CAS rejects; adapter now omits only an absent optional
field. Regression verifies directory-only and supplied-workspace
placement without weakening validation.
- Missing edit still returns mission-not-found/404.
- Native document-cleanup receipts/replay are checked exactly; safe
help-fixture link teardown and a data favicon fix remain test-only.

## Validation and recovery disclosure
Implementation recovered after another session's dependency-junction
cleanup deleted the original worktree. Tracked changes came from saved
Git state; nine new sources were reconstructed from 137 archived
successful operations and nine read checkpoints. All sources were
checkpointed, then qualified in a new independently installed worktree.
Original/evidence/recovery checkpoint remain untouched.

Passing: typechecks, real UI build, 1,322 UI tests, 1,381 server tests
plus one optional skip, 615 latest-complete serial browser cases, 31
help checks, plugin rebuild and 21 isolated OpenCode 2.2.3 gates. Twelve
negative controls caught/restored. This is not a claim that the initial
browser sweep was entirely green: one extension-fixture activation
failure passed two fresh full-file reruns unchanged. Test manifests are
explicit/nonempty; no borrowed dependencies or implicit Node discovery.

Qualification report/provenance retained by the coordinator.
Current-passage compaction (slice 5) remains the next separate work;
scheduler #1259 is already merged.
2026-11-02 01:58:36 +01:00
Pascal André
926e2c7d98
ci(release): sign Windows artifacts with SignPath (#1257)
## Summary

CodeNomad was accepted into SignPath Foundation's open-source program
(organization "CodeNomad [OSS]", project `CodeNomad`, GitHub.com trusted
build system, `test-signing` and `release-signing` policies with manual
approval). This wires Authenticode signing of the Windows artifacts into
the release CI. **Signing is off by default**: until the repository
variable `SIGNPATH_RELEASE_SIGNING=true` is set (once SignPath
Foundation issues the release certificate, still "CSR pending"),
releases publish exactly what they publish today.

## What Windows users get, and what is signed

Checked against the `v1.0.1-dev-20261101-fb44655c` prerelease:

- **Tauri NSIS installer** (download, WinGet package and in-app update
file) and the `codenomad-tauri.exe` it installs: both signed. Tauri
rewrites the executable while packaging it (the NSIS bundle-type marker
the updater relies on), which would break a signature applied first, so
the Tauri job becomes two-stage:
  1. `tauri build --no-bundle`;
2. `patch-bundle-type.mjs` writes the NSIS marker (same rewrite as Tauri
2.12.4, verified on a real binary);
  3. sign the executable;
  4. `tauri bundle --no-binary-patching`;
  5. sign the installer;
6. recompute the updater signature over the signed installer (`tauri
signer sign --app-version`); the existing staging check, `latest.json`
and WinGet then hash the signed file.

Unsigned builds take the same path, so every PR build exercises it.
`uninstall.exe` is generated during packaging and stays unsigned;
`node.exe` is already signed by OpenJS.
- **Electron portable ZIP:** `CodeNomad.exe` is signed; CI checks that
every other entry of the returned ZIP is unchanged.

SignPath only accepts uploaded GitHub artifacts and waits for a manual
approval on `release-signing`, so the electron-builder and Tauri
in-build signing hooks are not used. Requests go through
`signpath/github-action-submit-signing-request@v3` (composite action
`.github/actions/signpath-sign`), with artifact configurations in
`.signpath/artifact-configurations/` (zip root, `<authenticode-sign/>`,
metadata restrictions on product name `CodeNomad` and the release
version; validated against SignPath's XSD).

## When signing runs

- PR and fork builds: never signed, never fail for lack of a token.
- Stable releases: `release-signing` when
`SIGNPATH_RELEASE_SIGNING=true`; the release then fails before building
if `SIGNPATH_API_TOKEN` is missing (fail closed).
- New manual **SignPath Test Signing** workflow: signs a real build with
`test-signing` and publishes nothing. The dev prerelease gains a
`signpath_test_signing` input for an end-to-end check including the
updater signature.
- Returned files are verified: product name and version before
submission; afterwards a timestamped Authenticode signature, signer
`CN=SignPath Foundation` and `signtool verify` for releases (test
certificates accept an untrusted root).

## Docs

`CODE_SIGNING.md` describes the actual workflow (release certificate
pending); `dev-docs/TAURI_UPDATER.md`, `dev-docs/INDEX.md`, `BUILD.md`
and `docs/guides/winget-release-automation.md` follow the two-stage
Tauri build. No UI change, so no help pages.

## Validation

- actionlint 1.7.12: no new findings (the only one is the existing `if:
${{ false }}` on the disabled Linux arm64 job).
- The three artifact configurations validate against SignPath's official
XSD.
- Node tests 21/21, including signing gates and the build → sign →
package → re-sign order; `patch-bundle-type.mjs` tested.
- PowerShell checks run on the real dev artifacts: wrong versions,
unsigned files, a wrong signer and a modified DLL in the ZIP are
rejected.
- Not run: the signed path itself (needs the token and the SignPath
portal artifact configurations), and a full Tauri build locally; this
PR's CI exercises the unsigned two-stage Tauri build.

Large file: `.github/workflows/build-and-upload.yml` is now about 1,260
lines.


Final review: ZERO FINDINGS at a4ca8d255. Electron uses
shortVersionWindows before native signing; no post-sign hook remains.
Stable and prerelease native-signed ZIPs retain their timestamped
signatures (temporary untrusted root). Actual SignPath testing remains
pending and release signing stays off.
2026-11-01 16:07:50 +01:00
Pascal André
70c0c96a3e
fix(desktop): recover local windows after the last local view closes (#1258)
Closing every local Tauri window while a remote window remained open
discarded WebView2's local authentication cookie. Opening another local
window then reached an unusable frameless sign-in page; close and quit
waited for a state-save acknowledgement that this page could not send.

Authenticate each new local Tauri window before its first local-server
load. In both hosts, retain the last local window's saved tabs while
remote windows remain, and let host loading/sign-in/pairing pages close
without a renderer save acknowledgement. Ordinary user windows keep their
state-preservation safeguards. Remote windows are not restored as local
application windows.

Give failed Electron remote loads a host-owned recovery page with retry,
open-local-window and close actions. Authorize recovery IPC against its
registered main frame, host-issued per-document token and committed
origin. Revoke old tokens on navigation and renderer exit, issue a fresh
document after failed retries including HTTP 204, and allow explicit
reload/history recovery without reviving old tokens or creating automatic
crash loops. Keep recovery authority separate from remote server content.

Update architecture documentation and remote-access help in ten locales.
Tests cover cookie/restore/close rules and real Electron preload/IPC,
including rejected unauthorized requests, retry without document commit,
reload, history and renderer termination. The Linux fixture terminates
only its owned renderer and asserts the expected lifecycle event.

Validation: scratch-profile Tauri and Electron reproductions recover
signed-in local windows with saved state and quit cleanly; native suites,
focused UI tests, typecheck and help checks pass. Final independent review
has no P0-P3 findings. Complete CI including packaging is green at
012dfb2fb44f36be0109436ccba197038211e217.
2026-11-01 14:57:18 +01:00
Pascal André
a5efdefc8d
feat(missions): resume recurring Missions after OpenCode restarts with native schedules (#1259)
Closes #926.

## What changes

Recurring Missions now survive OpenCode restarts (update, crash and
relaunch, reboot) without a manual **Resume**, and the scheduler offers
more than "once a day at a fixed time".

- **Native schedules.** OpenCode's own scheduler
(`experimental.schedules`, OpenCode 2.2.3+) owns the calendar; Missions
decides whether a passage may run (CAS admission, no duplicates,
Pause/Stop, errors and uncertain states stay manual). A dedicated
technical conversation with a local no-op model carries the wake, so
wakes, titles and compaction make no provider HTTP requests.
- **Richer scheduling**, in one collapsed **Scheduling** section of the
Create/Edit editor (default: once, immediately, no condition): date,
delay, interval (≥15 min), daily, chosen weekdays, up to eight times a
day, day of month, native cron; optional end date/duration and a maximum
number of launched passages; five event conditions (another schedule
succeeds, a one-time Mission completes, new local commits, a new message
in a followed conversation, explicit files change). Up to five upcoming
dates are previewed in the saved IANA zone.
- **Created paused, started with Play.** Everything is editable before
the first launch; after it, edits follow the approved matrix (future
parameters between passages, objective/notes journaled during a
passage).
- **Keep OpenCode running.** A Preferences setting supervises the shared
OpenCode service through the OS (Windows Task Scheduler with a periodic
recovery task, macOS LaunchAgent, Linux systemd user unit with
lingering, WSL from Windows). ON by default at the first Play unless OFF
was saved; OFF removes supervision without stopping OpenCode; a live
service is never killed or duplicated.
- **Existing daily schedules** keep their path and controls; no
migration.
- Help (English and nine translations) and dev-docs are updated.

## Validation

- Typechecks (4 workspaces); server Missions/host-lifetime suites; UI
unit tests 1945/1945; help 31/31 and build.
- Real isolated OpenCode services (2.2.5, minimum 2.2.3): resting
schedule resumes after service restart with no client and no Resume; 32
real passages with history/quota/phase preserved; concurrent wakes admit
once; DST and catch-up for every frequency type; forced local
auto-compaction and restart during maintenance with zero provider HTTP;
real upgrade 2.2.3 → 2.2.5.
- OS supervision on Windows, WSL, Ubuntu VM (two real reboots, healthy
before login; OFF without a session) and macOS VM (Aqua session,
crashes, OFF/adoption). On the final bundle: two real periodic Windows
recovery relaunches; WSL OFF/Retry on a live HTTP 500 service keeps the
same process.
- Windows Electron and Tauri packages run in private profiles: paused
creation, nine frequencies, preview.
- Full browser suite: 956/957 in the last tier; the failure is
`directory-browser.test.ts` (folder picker timeout), unchanged by this
branch, and that file passes 20/20 on rerun. Earlier dev-baseline runs
on the same machine also lost module loads to
`net::ERR_NO_BUFFER_SPACE`.

## Known limits (not qualified in this PR)

- macOS reboot followed by a real login, and a Windows host reboot/logon
(needs a disposable bench).
- Real screen-reader output (keyboard, ARIA and RTL checks pass).
- Linux/macOS desktop packages.
- OpenCode's background *pre*-compaction never applies to the technical
wake conversations: their local model reports zero tokens, below the
native minimum. Their automatic local compaction is qualified.

## Follow-up

Integration with native `/goal` comes in a separate PR.
2026-11-01 14:40:24 +01:00
Pascal André
dc71b88f50
feat(missions): consume byte-bounded task pages in the panel (#1250)
**Task-read UI adoption only**, a coherent first part of 4b.3. This does
**not** remove the old list fan-out yet.

## Change
- Selected task/attention windows and named task/report targets use
`POST /missions/panel-page` with `source: "tasks"`.
- Browser consumer bounds actual response bytes before parsing (64 KiB),
validates the envelope and immutable selector, pins
digest/length/provenance, and checks the final collection hash before
publishing complete rows. Requests fit 16 KiB.
- Secondary read budget and 30-second logical deadline. No legacy task
GET fallback, automatic cursor restart or mutation.
- Last-good rows/toolbars survive failures; changed content is distinct
and explicit Retry starts at slice zero.
- Store fencing covers queued ownership, project/client generations,
reconnect/plugin invalidation and stale publication.
- Ten-locale strings/help plus contract tests wired into CI.

## Validation
- Eleven caught red checks: byte/digest/length/header validation, stale
reads, reconnect, parked failures, changed messaging, queued ownership,
unwanted revision reads and immutable selectors.
- Fixture: 151 tasks, four logical windows, seven transfers, maximum
65,536 bytes; zero legacy task GETs/mutations.
- Typechecks, actual UI production build, 1,865 UI/contract tests, 1,520
server tests, 456 serial browser cases and 31 help tests pass.
- No server product changes; plugin/native qualification not rerun.

## Remaining 4b work
Picker summary discovery, selected/wanted maps, activity/marks and
cleanup display still use `fetchMissions`; exact cleanup reconciliation
still uses `fetchMission`. Complete-inventory completion seeding is
unchanged. Summary/cleanup windows, actor/activity windows and
partial-inventory high-water remain unfinished. Passage slice 5 still
waits for #926.

#926 scheduling/document/passage and editor callback contracts,
`document`, `documentPending` and history `requestID` remain unchanged.
Only the internal task-fetch callback gains `{projectID, current,
signal}` and failures may carry a reason.
2026-11-01 10:11:00 +01:00
Pascal André
fb44655cdd
fix(missions): enable General delegation with project depth overrides (#1217)
Setting a project subagent depth did not enable nested delegation for
OpenCode's General agent, whose built-in permission still denies the
subagent tool. Treat a project depth override as the user's explicit
request to enable delegation up to that depth.

Saving any override, including 0 and 1, writes one CodeNomad-marked allow
rule in the project's existing General config block. Keep OpenCode's
depth semantics: 0 disables delegation and 1 prevents further nesting.
The Inherit button and an empty field remove the override and marked
rules, preserving unmarked user permissions and pre-existing containers.
Explain the project rule's precedence and display OpenCode's resolved
General permission state. If a legacy config cannot safely accept the
rule, save the depth and explicitly warn that General's permission needs
manual adjustment.

Use OpenCode's winning agents/mode/agent block rather than creating a
native block that shadows legacy prompts, limits or edit/shell denials.
Keep JSONC comments and formatting, follow the winning block when config
changes and record ownership of created containers for safe removal.
No checkbox or admission/freshness/frontmatter-scanning machinery is
needed. The documentation and help in ten locales explain the behavior
and cite upstream anomalyco/opencode#60961.

Validation covers native and legacy blocks, precedence, idempotence,
marked-rule migration/removal, pre-existing empty containers, partial
permissions and the explicit warning. Server, browser, i18n, help and
typechecks pass. An isolated OpenCode 2.2.5 run verifies depth 2 nesting,
depth 1 and 0 limits, preservation of legacy General settings and
restoration after Inherit. Six review rounds resolved all actionable
findings; the rebased patches are unchanged and the complete CI is green
at d7cf2d35, including desktop builds.
2026-11-01 07:10:26 +01:00
Pascal André
abb14f83c6
feat(missions): page a mission's tasks in the panel (#1241)
Slice 4a of bounded Missions reads (#1220's R4; slices 1–3 are #1229,
#1231 and #1237). **A compact map now holds one page of tasks, every row
has a size budget, and every task stays reachable through a new paged
tasks read.** The commit message has the full design.

## Change
- **Row budgets:**
  - 32 KiB per task row, 8 KiB per report row, 4 KiB per plan change.
  - Observations leave the panel map.
  - A task keeps only its newest late report, plus a count.
- A plan change's added, retired and rewired task lists become content
bodies.
- **What a map carries:**
  - the first 50 tasks of the shared display order;
- up to 20 pinned rows (pending notifications, blockages, recovery
candidates, the newest reports' tasks, briefing sources);
  - `taskPage`: an order digest, the window, totals and status counts;
  - `actorEvidence`, computed over every task.
- **New `tasks` RPC and `GET …/missions/:id/tasks`:**
  - return a window of tasks, or tasks named by key, ID or report;
  - refuse a stale order with `order-changed`;
  - for a plugin without `tasks`, page through its single-mission read.
- **UI:**
  - a page cache per mission;
- tree gaps with Show more, and graph stubs for edges to tasks not
shown;
- reader targets that aren't loaded are read by key or ID before
opening;
  - Show all for earlier results;
  - 13 strings in ten locales, and the help pages updated.
- **Unchanged:** authoritative reads and recurring passage maps stay
full.

## Payload (2,400 tasks × 20,000-character briefs, 1,224-task rewire)
| Read | Bytes |
|---|---|
| Full map | 49,431,307 |
| List | 49,220 |
| Map | 48,862 |
| Each of 48 pages | ≤ 38,780 |

Before this PR, one task with 1,997 observations weighed 4,617,922 B; it
now weighs 4,836 B. One with 100 late reports went from 173,666 B to
2,830 B.

**Next (4b):** full maps only for the selection and wanted missions,
paged summary rows and cleanups, and bounded actor-scale arrays.

## Validation
- **Server:** page traversal reaches every task exactly once, in display
order. Also covered: the `order-changed` refusal, the row and report
caps, pins, taskless reports, and the route fallback.
- **Store:** merging, reads recorded before fetching, coalescing, and
`clear` fences.
- **Browser:** tree gaps, graph stubs, Show more, re-measured rails,
Needs you for a task outside the page, a dependency loaded by key, Show
all, and reader targets read by ID.
- **Red checks:** each new test fails with its fix reverted.
- **Passing:**
  - server and UI typecheck;
  - 1,312 server tests;
  - 1,827 UI units;
  - all 41 `mission*` browser files plus 3 panel files;
  - `test:help`;
  - `test-missions-native.mjs` on isolated OpenCode 2.2.3.
2026-11-01 01:58:10 +01:00
Pascal André
f90cbbc32e
feat(desktop): connect directly to remote servers from launch arguments (#1240)
Add --connect-server <URL|saved-server-name-or-id> and the inline form to
Electron and Tauri. Desktop launches can now open a remote CodeNomad
window directly, without leaving an empty local window behind. Existing
instances receive the launch intent; explicit folder and new-window
arguments retain their normal behavior.

Reuse the UI connection flow, including saved credentials, certificate
checks and sign-in. Reject credentials and pairing fragments in command
line URLs. Resolve saved entries by id, name and URL, with translated
errors for missing, unknown or ambiguous values. Windows Tauri refuses
arguments containing its forwarding delimiter rather than guessing their
boundaries; the help describes this limit in all ten locales.

Connect-only startup uses a hidden helper excluded from user-window
capacity, restoration, last-window decisions and state flushing. Success
disposes it; errors, timeouts or interactive prompts fall back to normal
startup without losing saved windows or the deferred Preferences restore.
Electron waits for the initial remote page load before reporting success.
Helpers close without a renderer flush; ordinary windows keep their
state-preservation safeguards.

Validation: Electron native suite (319 pass, 4 skipped), Tauri tests
(302 pass), UI connection tests, typecheck and help checks. Live isolated
Electron runs cover cold success, unreachable and unknown servers, page
failure, second-instance forwarding, Preferences restoration and backend
startup failure. Four review rounds resolved all P0-P3 findings; the final
head passed the complete CI, including all desktop builds.

Closes #1234
2026-11-01 01:54:05 +01:00
Pascal André
794ac20306
feat(integrations): recognise OpenCode integrations from the reviewed catalog and read their state (#1243)
## Summary

Slice C2 of the OpenCode integrations plan: CodeNomad recognises
configured OpenCode integrations from the reviewed catalog and reads
their state. This is the base for attaching an open application to a
conversation (C4) and for the Bundles extension (C3).

- **Catalog** (`opencode/integrations/catalog.ts`): newest
`catalog-v<n>` release of `NeuralNomadsAI/opencode-integrations` (GitHub
releases API, never "latest"), `catalog.json` asset through the API
origin, 256 KiB / 10 s bounds, zod validation, 30 s shared cache with
conditional list requests, last valid catalog persisted and served as
`stale`, `unavailable` with an empty list otherwise. No catalog release
exists yet: the real repository reads as `unavailable` today (no release
was created).
- **Recognition** (`recognition.ts`): registry package (aliases
resolved), plugin ID or exact `-<plugin>` rule (disabled plugins),
`sources.git` prefix; a source designating two integrations or loaded
under another plugin ID is non-conforming.
- **State route** `GET /api/workspaces/:id/integrations?directory=`
(`status.ts`, `integrations.ts`, `routes/integrations.ts`): absent /
inactive / failed / unsupported / non-conforming / unknown / ok; fixed
`status` method under the catalog's RPC ID only, 4 in flight, 8 s each;
full output validation, marker mismatch and path-like `appVersion`
refused; ownership rechecked with `assertCurrent` after the calls;
catalog internals never returned.
- **Plugin add** (AC-P7, D18): recognised `native` integrations are
Global-only (`global-only`, 10 locales); registry and Git specs of one
integration are duplicates.
- **UI store** `stores/integrations-store.ts`: demand reads, 300 ms
coalescing of `rpc.neuralnomads.<app>.*`, `plugin.updated`,
`config.updated`, no polling. Mounted by C4.
- Docs: `dev-docs/OPENCODE_INTEGRATIONS.md`, `PLUGIN_CONTROLS.md`; help
`integrations.md` in English and the nine translations.

## Validation

- `node --import tsx --test
packages/server/src/opencode/integrations/catalog.test.ts` (11 pass,
local release server)
- `node --import tsx --test
packages/server/src/opencode/integrations/recognition.test.ts` (8 pass)
- `node --import tsx --test
packages/server/src/server/routes/integrations.test.ts` (4 pass)
- `node --import tsx --test
packages/server/src/opencode/plugin-sources.test.ts` (11 pass)
- `node --import tsx --test
packages/ui/src/stores/integrations-store.test.ts` (4 pass)
- `node --import tsx scripts/test-integrations-recognition-native.mjs
<opencode 2.2.5 cli>`: PASS (added to the runtime matrix)
- Server and UI typecheck; `npm run test:help` pass.

File sizes: `http-server.ts` ~2500 lines (+7), `index.ts` ~790 (+2),
`pr-build.yml` ~770.
2026-11-01 01:47:20 +01:00
Pascal André
54a93e7c10
fix(plugins): repair damaged plugin payloads and show recovery notices once (#1239)
On a Windows Server CLI install, the console kept logging "Managed plugin
bundle differs from its digest" and the browser filled with identical
"questions and permissions not fully recovered" toasts, covering a phone's
whole screen (#1235).

The published package was correct. A bundled plugin file is named by its
sha256 in a folder shared by every connection using the same OpenCode
configuration, and it was written in place with writeFile(..., "wx"). A
concurrent installer could read it half-written, and a write interrupted
by stopping the server left a truncated file that "wx" never replaced, so
every later connection failed. Both modes were reproduced with the
published code and the exact reported error.

A payload is now published only by renaming a complete temporary copy
over its name. A file with the wrong bytes or a link is replaced the same
way; a Windows directory link is re-checked and removed with rmdir, which
never touches its target or a regular file, and a changed entry is
re-verified instead of replaced, so one installer never deletes another's
verified repair. An ordinary directory at that name is refused with a
clear error. Verification and replacement share one bounded retry with
backoff (about 3 s) for EPERM, EBUSY and EACCES locks from antivirus or
readers. Each distinct failure (error code, operation and path, with only
generated temporary names masked) is logged once as an actionable error;
repeats go to debug until provisioning succeeds.

In the UI, each recovery warning is shown at most once per project and
message per tab, across reconnects, re-added projects and reloads, and a
successful recovery re-arms it. The plugin-unavailable case is one plain
notice, "Some waiting questions may be missing", saying that requests
already waiting may not appear, new ones still do, and restarting
CodeNomad may fix it. Toasts fit narrow screens. Strings, the permissions
help page and NATIVE_INTERRUPTION_UX.md / OPENCODE_COMPATIBILITY.md are
updated in all ten locales where applicable.

Tests: installation regressions for wrong bytes, truncation, concurrent
installers, file and directory links, a reader-held lock, an ordinary
directory and a replayed concurrent-repair race; log dedupe across random
temporary names and UUID-named directories; a store test with the real
notification code (one notice after eight reconnects and a second project,
nine before). Server plugin suites, UI recovery suites, both typechecks
and the help checks pass.

Fixes #1235
2026-10-31 21:55:48 +01:00
Ledracarnos
091361d116
fix(ui): capture pointer while resizing side panels (#1233)
Resizing a docked side panel listened for mouse and touch moves on the
whole document, so a drag that left the handle's narrow hit area could
reach controls under the pointer and the handle lost its highlight.

The handles now use local Pointer Events with pointer capture, like the
composer's resize handle: the initiating primary pointer is captured on
the handle, which keeps an .is-resizing highlight until release,
cancellation, capture loss or its own removal; secondary buttons never
start a drag, and touch-action: none keeps touch drags from scrolling.
Each handle's cleanup stops only its own side's drag, so closing the
opposite panel mid-drag does not interrupt it. The document-wide drag
helper is removed. Width calculation, clamping, RTL, persistence and
resize scheduling are unchanged. The help pages in all ten locales
mention dragging a panel's inner edge to resize it.

panel-resize.test.ts drives the real shell for both panels in LTR and
RTL: capture and highlight outside the handle, release, cancellation,
capture loss, handle removal, closing the opposite panel mid-drag, touch
and a held secondary button. drawer-width, the help tests and the UI
typecheck pass.
2026-10-31 21:13:51 +01:00