From 88e46afebee8c288be42125e5177a8d7a23ff705 Mon Sep 17 00:00:00 2001 From: Phototonic <35551999+Phototonic@users.noreply.github.com> Date: Thu, 19 Nov 2026 06:25:02 +1100 Subject: [PATCH 1/2] docs(openspec): archive the Windows default permissions change --- .../proposal.md | 0 .../specs/managed-companion-delivery/spec.md | 0 .../windows-setup-responsiveness/spec.md | 0 .../tasks.md | 0 .../specs/managed-companion-delivery/spec.md | 13 ++++- .../windows-setup-responsiveness/spec.md | 54 +++++++++---------- 6 files changed, 38 insertions(+), 29 deletions(-) rename openspec/changes/{windows-default-permissions => archive/2026-11-19-windows-default-permissions}/proposal.md (100%) rename openspec/changes/{windows-default-permissions => archive/2026-11-19-windows-default-permissions}/specs/managed-companion-delivery/spec.md (100%) rename openspec/changes/{windows-default-permissions => archive/2026-11-19-windows-default-permissions}/specs/windows-setup-responsiveness/spec.md (100%) rename openspec/changes/{windows-default-permissions => archive/2026-11-19-windows-default-permissions}/tasks.md (100%) diff --git a/openspec/changes/windows-default-permissions/proposal.md b/openspec/changes/archive/2026-11-19-windows-default-permissions/proposal.md similarity index 100% rename from openspec/changes/windows-default-permissions/proposal.md rename to openspec/changes/archive/2026-11-19-windows-default-permissions/proposal.md diff --git a/openspec/changes/windows-default-permissions/specs/managed-companion-delivery/spec.md b/openspec/changes/archive/2026-11-19-windows-default-permissions/specs/managed-companion-delivery/spec.md similarity index 100% rename from openspec/changes/windows-default-permissions/specs/managed-companion-delivery/spec.md rename to openspec/changes/archive/2026-11-19-windows-default-permissions/specs/managed-companion-delivery/spec.md diff --git a/openspec/changes/windows-default-permissions/specs/windows-setup-responsiveness/spec.md b/openspec/changes/archive/2026-11-19-windows-default-permissions/specs/windows-setup-responsiveness/spec.md similarity index 100% rename from openspec/changes/windows-default-permissions/specs/windows-setup-responsiveness/spec.md rename to openspec/changes/archive/2026-11-19-windows-default-permissions/specs/windows-setup-responsiveness/spec.md diff --git a/openspec/changes/windows-default-permissions/tasks.md b/openspec/changes/archive/2026-11-19-windows-default-permissions/tasks.md similarity index 100% rename from openspec/changes/windows-default-permissions/tasks.md rename to openspec/changes/archive/2026-11-19-windows-default-permissions/tasks.md diff --git a/openspec/specs/managed-companion-delivery/spec.md b/openspec/specs/managed-companion-delivery/spec.md index cea010c4..5aae2880 100644 --- a/openspec/specs/managed-companion-delivery/spec.md +++ b/openspec/specs/managed-companion-delivery/spec.md @@ -21,7 +21,7 @@ The extension SHALL declare the existing companion directory through `contribute ### Requirement: Single private verified binding -Service and managed companion SHALL discover the same single descriptor in a dedicated product-owned subfolder of the canonical OpenCode data root derived from XDG data/HOME. They SHALL preserve marker, canonical-path, ownership, private-mode or equivalent ACL, binding and Store/source validation. They MUST NOT scan roots, fall back from invalid state, auto-adopt legacy selectors or put private state in the extension code folder. +Service and managed companion SHALL discover the same single descriptor in a dedicated product-owned subfolder of the canonical OpenCode data root derived from XDG data/HOME. They SHALL keep marker, canonical-path, binding and Store/source validation, and private modes on Linux and macOS. Windows relies on the user profile's default permissions: no ACL is queried, applied or repaired. They MUST NOT scan roots, fall back from invalid state or auto-adopt legacy selectors. #### Scenario: Service environment omits state root - **WHEN** the service lacks `XDG_STATE_HOME` and an explicit binding variable but shares the supported XDG data root with managed OpenCode @@ -32,7 +32,7 @@ Service and managed companion SHALL discover the same single descriptor in a ded - **THEN** the state is unconfigured and no directory, ownership marker, descriptor or store is automatically created or adopted #### Scenario: Invalid selection -- **WHEN** the selected directory, marker, descriptor, source scope or Store is invalid, modified, aliased, foreign, non-private or unsupported +- **WHEN** the selected directory, marker, descriptor, source scope or Store is invalid, modified, aliased, foreign, unsupported or, on Linux and macOS, non-private - **THEN** capture fails closed and existing bytes remain intact - **AND** a present invalid selection is not treated as absence or permission to try another root @@ -145,3 +145,12 @@ Folder, ZIP and Git distributions SHALL include the declared resolvable plugin d - **WHEN** the accepted built candidate is installed on an isolated 2.7.1 host with credential-free local scripted reporting - **THEN** plugin approval, reporting in all three views, lifecycle, legacy migration, retained history and below-floor installer refusal have behavioral evidence - **AND** screenshots and diagnostics use synthetic content, with unavailable platform coverage explicitly identified rather than certified + +### Requirement: Companion checks start no process + +The managed companion's load, guard, tool-hook and status paths SHALL start no child process on any platform. Re-reading the binding uses plain filesystem calls only. + +#### Scenario: Windows companion in the host +- **WHEN** the companion loads on native Windows, guards a report, runs a tool hook or answers a status inspection +- **THEN** no child process is started, so the host event loop is never blocked waiting on one +- **AND** a changed or invalid binding still retires the companion and refuses the call diff --git a/openspec/specs/windows-setup-responsiveness/spec.md b/openspec/specs/windows-setup-responsiveness/spec.md index 62d8cdfe..bffe62d9 100644 --- a/openspec/specs/windows-setup-responsiveness/spec.md +++ b/openspec/specs/windows-setup-responsiveness/spec.md @@ -7,22 +7,22 @@ Keep Windows service health responsive and support legacy migration and fresh co ### Requirement: Cheap honest health and nonblocking admission -Authenticated health SHALL return a cheap last-observed liveness/admission snapshot without security queries or legacy discovery. Starting or unverified state MUST NOT be presented as fresh Store authority. +Authenticated health SHALL return a cheap last-observed liveness/admission snapshot without filesystem validation or legacy discovery. Starting or unverified state MUST NOT be presented as fresh Store authority. #### Scenario: Admission and worker boundaries - **WHEN** migration, fresh configuration or data access needs admission -- **THEN** required fresh admission SHALL be obtained on demand without synchronous security work blocking the health-serving event loop +- **THEN** required fresh admission SHALL be obtained on demand without blocking the health-serving event loop - **AND** fresh inspection, effects, controls and status SHALL reuse the existing request-driven worker boundary, not an autonomous job #### Scenario: Cold legacy upgrade - **WHEN** the service starts with a released legacy installation and no managed selection -- **THEN** health responds without opening/adopting the legacy store or spawning security helpers +- **THEN** health responds without opening/adopting the legacy store or starting any process - **AND** Setup and background composer access can request admission rather than treating starting as permanently unavailable #### Scenario: Slow security work is active -- **WHEN** a migration, fresh-setup or admission request performs a cold, slow or failing security query +- **WHEN** a migration, fresh-setup or admission request is running - **THEN** a concurrent authenticated health request remains responsive and honest -- **AND** scheduling main-thread spawnSync through a timer or Promise is not treated as nonblocking +- **AND** no permission check starts a process, so none can block that request #### Scenario: No fresh store yet - **WHEN** a fresh operation has prepared its journal but has not created its store @@ -31,13 +31,12 @@ Authenticated health SHALL return a cheap last-observed liveness/admission snaps ### Requirement: Bounded separate setup requests -Each migration or negotiated fresh-setup step SHALL be a separate request driven by Setup, with at most six actual security-process spawns including retries, validation, mutation, diagnostics and cleanup. +Each migration or negotiated fresh-setup step SHALL be a separate request driven by Setup, bounded by a 17-second work deadline and an 18-second response deadline below the host's 20-second limit. No step starts a process; deadline exhaustion SHALL be explicit rather than weakening checks. #### Scenario: Request deadline allocation -- **WHEN** a request budgets security work at the 2.5-second-per-spawn planning assumption -- **THEN** six spawns allow 15 seconds of security work plus 5 seconds of headroom under the host's 20-second limit -- **AND** inspection/status SHALL be trimmed or continued to meet the same budget -- **AND** work and response deadlines SHALL remain 17 and 18 seconds respectively; deadline exhaustion SHALL be explicit rather than weakening checks +- **WHEN** a request is admitted +- **THEN** work and response deadlines SHALL remain 17 and 18 seconds respectively, and no step starts a process +- **AND** inspection/status SHALL be trimmed or continued to meet the same deadlines - **AND** fresh store-directory creation, database initialization and source registration MUST NOT be hidden inside an already full preparation request #### Scenario: A phase exceeds the request budget @@ -46,33 +45,33 @@ Each migration or negotiated fresh-setup step SHALL be a separate request driven - **AND** Setup receives bounded progress and explicitly drives the next request rather than one long background operation #### Scenario: Helper exceeds the planning assumption -- **WHEN** a helper is slower than assumed or fails within the service's below-host deadline +- **WHEN** a request runs past its work deadline, for example on a slow disk - **THEN** the request stops admitting further work and reports pending, uncertain or failed effects honestly -- **AND** no unbounded cold retry or misleading rollback/success claim occurs +- **AND** no unbounded retry or misleading rollback/success claim occurs #### Scenario: Supported migration on a slow machine -- **WHEN** the supported legacy fixture is inspected and migrated with helper latency around the 2.5-second-per-spawn assumption -- **THEN** the full switch completes successfully through separate requests below the 20-second host limit and within the six-spawn ceiling +- **WHEN** the supported legacy fixture is inspected and migrated +- **THEN** the full switch completes successfully through separate requests below the 20-second host limit with no process started - **AND** repeated bounded refusals are not accepted as successful migration #### Scenario: Fresh setup on a slow machine -- **WHEN** a supported Windows fixture has no legacy install, managed journal or store and helpers take 2.5 seconds per launch -- **THEN** reviewed fresh setup completes with a valid selected Store/source and verified capture through requests below twenty seconds and within six launches each +- **WHEN** a supported Windows fixture has no legacy install, managed journal or store +- **THEN** reviewed fresh setup completes with a valid selected Store/source and verified capture through requests below twenty seconds with no process started - **AND** repeated bounded refusals do not count as successful setup -- **AND** persistent slower-helper exhaustion is a bounded recovery refusal, not a guarantee of eventual completion +- **AND** persistent deadline exhaustion is a bounded recovery refusal, not a guarantee of eventual completion ### Requirement: Fresh authority for every mutation step -Every step SHALL freshly validate its current target, consent/sequence, ownership, privacy, path safety, relevant files and Store/source identity before its mutation. Previous discoveries and durable progress MUST NOT replace current security checks. +Every step SHALL freshly validate its current target, consent/sequence, canonical path, links, relevant files and Store/source identity before its mutation. Previous discoveries and durable progress MUST NOT replace current checks. Windows applies no ACL or ownership query. #### Scenario: Fresh creation authority - **WHEN** a step creates an object -- **THEN** full legacy ownership and existing removal safeguards SHALL remain, with no ACL cache across requests or mutations +- **THEN** full legacy ownership-of-content and existing removal safeguards SHALL remain, and nothing is cached across requests or mutations - **AND** fresh creation SHALL validate absence and frozen proposed identity where objects do not yet exist, and freshly validate resulting objects before further effects - **AND** proposed identities MUST NOT authorize ordinary selected-binding or companion admission #### Scenario: State changes between steps -- **WHEN** an ACL, path object, manifest, source/store, reviewed selection or operation sequence changes +- **WHEN** a path object, manifest, source/store, reviewed selection or operation sequence changes - **THEN** the next affected mutation refuses before acting on stale authority - **AND** no foreign bytes, history or existing locks are removed to force progress @@ -166,7 +165,7 @@ Setup SHALL show actual step progress, pending/paused state, fixed last-action s #### Scenario: Older fresh client on Windows - **WHEN** an authenticated caller posts old managed-inspect or managed-configure input to the new Windows service - **THEN** it receives HTTP 409 with exactly the existing managed-action-required error object -- **AND** no security helper, worker or product write occurs +- **AND** no worker or product write occurs #### Scenario: Non-Windows compatibility - **WHEN** an older caller uses the old fresh routes on Linux or macOS with no legacy discovery or journal @@ -185,23 +184,24 @@ Setup SHALL show actual step progress, pending/paused state, fixed last-action s ### Requirement: Native Windows responsiveness evidence -Acceptance SHALL include native Windows released-legacy migration and fresh setup over authenticated HTTP, per-request spawn ceilings, sanitized per-step traces and concurrent health checks. Undelayed CI requests SHALL take at most 8 seconds, providing more than twofold margin to the host timeout. Delayed tests SHALL meet the below-host deadline instead. +Acceptance SHALL include native Windows released-legacy migration and fresh setup over authenticated HTTP, an independent count of process launches that must be zero, sanitized per-step traces and health checks. Requests SHALL take at most 8 seconds, providing more than twofold margin to the host timeout. #### Scenario: Evidence fidelity - **WHEN** acceptance results are recorded - **THEN** native effect/recovery evidence and browser screenshots SHALL accompany logic checks -- **AND** portable fake-spawn tests SHALL count actual launch attempts for each new step, including errors and replay, but MUST NOT be described as native Windows measurements +- **AND** portable tests SHALL spy on every child-process entry point and prove none is called, but MUST NOT be described as native Windows measurements #### Scenario: CI verifies the built candidate - **WHEN** the final built service migrates an isolated released 1.1.1 installation under a non-admin Windows test principal -- **THEN** inspect, step, failure, retry and status paths meet the spawn/time bounds with retained identities/history and honest capture state +- **THEN** inspect, step, retry and status paths start no process and meet the time bound with retained identities/history and honest capture state - **AND** traces contain only bounded stage/code/timing/count/state facts, never account names, paths, credentials or raw logs #### Scenario: CI verifies empty-store setup - **WHEN** the built candidate starts with only isolated config/data roots and no legacy, managed directory, store or journal -- **THEN** undelayed and 2.5-second-helper fresh journeys complete within their respective request bounds -- **AND** concurrent health uses zero security launches and responds within the existing 1.25-second native health bound -- **AND** representative restart, dropped-reply, pause/resume, retained reconnection and over-budget cases assert actual durable effects +- **THEN** fresh journeys complete within the request bound with no process started +- **AND** health starts no process and responds within the existing 1.25-second native health bound +- **AND** representative restart, dropped-reply, pause/resume and retained reconnection cases assert actual durable effects +- **AND** over-budget, late-worker and injected-fault cases are covered by portable fixtures only, not by native CI #### Scenario: Rendered fresh Setup - **WHEN** current-source guests run the fresh journey in the existing rendered browser harness From 7846d620b32e675f043280fe2c877a5b67b8f1b2 Mon Sep 17 00:00:00 2001 From: Phototonic <35551999+Phototonic@users.noreply.github.com> Date: Thu, 19 Nov 2026 06:25:23 +1100 Subject: [PATCH 2/2] docs(release): add the Windows fix to the 1.5.2 notes and changelog --- CHANGELOG.md | 4 +++- release-notes/1.5.2.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d32a60..3d8424cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,16 +10,18 @@ Cleanup follow-ups from the 1.5.1 review and a companion system prompt section t ### Changed +- Windows relies on the user profile's default per-user permissions. Windows no longer queries, applies or repairs ACLs, and no longer refuses a root for its owner, its permissions or the permissions of an ancestor, so a store or custom root in a folder other users can write to is accepted (stated in `docs/setup.md`). Windows keeps drive-qualified path syntax, canonical path, symbolic link and junction refusal, hard-link refusal for owned state files, content-ownership markers, hashes and schema validation; Linux and macOS uid and mode checks are unchanged, and existing installs whose roots carry private ACLs keep working with those ACLs untouched. The per-request spawn ceiling, the helper cold-start budgets and the PowerShell mutex barrier are removed; steps reserve a fixed 2.5 s of time headroom instead of spawn-count reservations, and the work and response deadlines, writer slots and fresh validation of every mutation stay. `accounting.securitySpawns` stays on the wire as a constant 0, and the retired diagnostic codes are still accepted but no longer produced (#175, reported in #172). - The companion's system prompt section holds only the fixed activation guidance and is byte-identical on every request where it is present. The one-request hint after a dispatch or plan write, the sub-agent resume capsule and the delegation refusal note keep their text and eligibility but are delivered after the cacheable prefix: as a text part after a user message, or at the end of the last tool result of a tool message, never on the Code Mode `execute` wrapper's result or a non-text result, and otherwise on the next request with a valid carrier. A delivered note stays in the same place on later requests built from the same history, keyed per session and bounded to 128 sessions, 256 carriers and 128 KiB of note text per session; notes due together are joined in a fixed order, a capsule or refusal is delivered again when its text changed or its last carrier is gone, and one fixed line clears a refusal that no longer applies. Every path that removes the section removes the added notes. Providers that drop plugin system sections now also receive these notes. Cache hit rates were not measured; tests assert the byte-for-byte prefix (#165, #167; reported in #161). - Companion inline and packaged guidance tells an agent to clear a task's dependency block against the plan's current prerequisites, read before a handoff and when a prerequisite finishes: a prerequisite the plan no longer lists no longer holds the task, and a skipped prerequisite that is still listed counts as unfinished. Decision, review and external blockers are left alone, and the guidance stays advisory (#162). - Coordinator refusal guidance validates a pending or reserved delegation receipt against its dispatch and declared tasks before inferring that cleanup retired it, and reports incomplete guidance when the check fails. Cancellation receipts, bound receipts and the explicit-link recovery are read as before (#162). - `docs/ui.md` and `docs/contracts.md` state when chosen plans are checked by `/v1/search-state` point lookup, when loaded rows or a list scan are used instead, and which revision a retry compares against (#162). - The large-library gate bounds each timed window by request and reply offsets read in the browser evaluation that starts and stops it, counts cadence, list starts and both inbox forms by the requests sent inside it, and shows run reads per window as an informational row. It records how an artifact attributed its traffic, compares the list-carried inbox form on its own, and reports a budget it cannot compare as unverified with exit status 2 instead of passing it. QA tooling only; no shipped behaviour changes (#166). -- The `release-1-5-2` OpenSpec change records the proposal, design and tasks (#160). The 1.5.0, 1.5.1 and 1.5.2 changes are archived in that order with their task lists reconciled, the 1.5.1 deltas corrected to keep the scenario names and requirement lengths the specs hold, and a Purpose written for each of the ten capabilities the first two archives created; the third creates none. +- The `release-1-5-2` OpenSpec change records the proposal, design and tasks (#160). The 1.5.0, 1.5.1 and 1.5.2 changes are archived in that order with their task lists reconciled, the 1.5.1 deltas corrected to keep the scenario names and requirement lengths the specs hold, and a Purpose written for each of the ten capabilities the first two archives created; the third creates none. The `windows-default-permissions` change (#175) is archived after them and creates none either. - Portable tests run faster, locally and in CI, with no test removed or relaxed. The serial backend group that takes Setup coordination ports runs beside a second lane (both typechecks, the parallel backend group, and the browser-model and automation tests) instead of before them, in one `--test-concurrency=1` invocation that nothing else joins; the second lane has its worker count capped at cores minus two and runs under `nice`. With `CP_BUILT_SERVICE=1`, the one file that takes ports moves into the serial group. New `bun run test:fast` (everything except the serial port-bound group) and `bun run test:all` (everything portable CI tests except packaging and the rebuild comparison) share one plan with CI through a POSIX-first runner whose stop path on Windows is best effort and was not run there. Node's compile cache, emptied at the start of each run, serves every step. The Linux jobs install the ZIP tools only when the image lacks them, and the Windows job starts its two native test files as two processes at once. The Linux test step fell from about 305 s to about 150 to 230 s in CI (#170). ### Fixed +- On Windows the companion no longer blocks OpenCode's event loop while loading, running tool hooks or answering status polls. Every ownership, privacy and ancestor check started Windows PowerShell synchronously (1 to 2.4 s each): about 10 to 20 times while loading, once per tool hook and twice per status inspection, which stalled OpenCode for 28 to 43 s, so its model catalogue request timed out and `/api/provider` answered 503. No product code now starts a child process, on any platform; the fix removes the Windows ACL queries from the companion, service and setup (#175, reported in #172). - Tidy and Select all result lines separate plans that were skipped (refused as changed, closed, reused or not found, store busy, left out of the view or never sent after Stop) from plans whose request got no valid answer and may have been applied, in English, Russian and Simplified Chinese with plural rules. Undo still restores only validated receipts; Try again recounts skipped and unconfirmed plans together, or sends the restore again for the remainder after a partial Undo (#163). - A bulk run that ends after an account, store or binding change the frame observed, including a switch away and back, no longer resets caches, changes the selection, closes the opened plan or shows a result on the board then shown; a validated Delete receipt still removes the review marker of the account and store the run started in. The busy state belongs to the request that set it, so an observed switch releases it and a late answer cannot complete, release or reset a newer run. Cleanup controls follow the latest health reply the controller accepted, whichever remembered list is shown, and a failed list read applies its health facts in both directions (#164). - A count that finishes in the background, a run's progress and the end of a run with its result line repaint as background data and wait while a control is held, so a press on Stop or a click on another control is not lost; a refresh no longer expires a result that has not been painted yet. A deferred cleanup focus move is decided when it is applied and dropped if focus has moved to another control (#168). diff --git a/release-notes/1.5.2.md b/release-notes/1.5.2.md index 7ea141f8..5bc0d9e5 100644 --- a/release-notes/1.5.2.md +++ b/release-notes/1.5.2.md @@ -7,6 +7,7 @@ ## Fixes +- **Windows: the companion no longer freezes OpenCode.** On Windows the companion started PowerShell to check folder permissions when it loaded, on tool calls and on every status poll. That could block OpenCode for 28 to 43 seconds, leaving the model list empty, `/api/provider` answering 503 and sessions timing out (#172). The companion now starts no process for permission checks on any platform, so loading, tool calls and status polls no longer wait on one. Agent Progress no longer checks Windows folder permissions: Windows relies on your profile's default per-user permissions, and a store or custom folder that other users can write to is now accepted. Link, path, marker and schema checks remain, Linux and macOS checks are unchanged, and existing installs keep working. (thanks to [@NOMOO8](https://github.com/NOMOO8)) - Full page: a Tidy or selection run that finishes after you switch account or store no longer resets or changes the board you switched to, and Tidy and Select work at once on the new board. Cleanup controls follow what the service currently offers, including after a failed list read or a switch between Current and Archived plans. - Full page: a count, a run's progress or its result arriving in the background no longer cancels a click or a press on Stop, and a focus move Tidy queued no longer pulls focus away from a control you chose. A result you have not seen yet is no longer dropped by the next refresh. - Full page: Tidy and Select all now say when their count may have missed plans, which can happen when the plan list was read in more than one page. A count from a single page, or from rows you chose yourself, stays exact. A selection made during a search follows plans archived, deleted or restored elsewhere, and a plan restored elsewhere is counted again by the next action.