Commit graph

4 commits

Author SHA1 Message Date
Pascal André
40870d5d39
docs: tighten developer and agent guidance (#1537)
Trim repetition and historical commentary in developer documentation and
agent guidance without changing contracts or behavior. Areas: runtime
and ownership, Missions, memory, browser and transcript workflows,
settings, repository skills and bundled Design recipes.

Preserve current dev contracts, safety boundaries and agent rules.
Proposed design changes remain outside this editorial pass.

Validated with Design unit and bundle tests, isolated native skill
discovery and loading, palette quality, UI typecheck and help tests.
2026-11-16 02:46:18 +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é
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é
7a1fc90310
docs(agents): keep AGENTS.md to universal rules and agent docs to the current state (#1082)
AGENTS.md loaded about 33,000 tokens into every agent session, subagent and reviewer, mostly per-feature contracts, and the agent documentation around it had accumulated duplicates, dated logs and history of removed designs. This PR makes AGENTS.md a short set of rules that apply everywhere plus an index of area documents, and leaves AGENTS.md, dev-docs and the repository skills describing only the current state.

Three commits, reviewable separately:

1. **Move (lossless).** Every per-area rule moved verbatim from AGENTS.md into its area document (existing ones, or six new ones: UI_CONVENTIONS, UI_SHELL, COMPOSER, TRANSCRIPT, SETTINGS, PROJECTS). A script split the old file into 208 units, required one destination for each and checked all 199 content units verbatim at their destination. AGENTS.md went from 134,000 to 16,000 characters.
2. **Trim.** A per-area ponytail review removed rules stated two or three times (keeping the more precise copy), dated validation logs, per-version qualification sections below the current minimum, abandoned designs and self-references; seven documents whose surviving rules live elsewhere were deleted. It also fixed statements the code contradicts (locale registration, the Mission play/recovery condition, plugin package updates, cleanup progress UI, timeline index persistence, automation restart/targets, stale pins and minimums).
3. **Current state only.** The new AGENTS.md rule: no history (removed features and their names, former behavior, provenance, dated logs) and no denials; correct a contradicted statement at its source. DEVELOPER_MODE.md is merged into BROWSER_AUTOMATION.md and every Developer Mode mention is gone (including the README and the browser help page in ten locales). Names that only made sense against older designs are renamed with every reference updated, MISSIONS_ENVIRONMENT_ADMISSION is folded into SESSION_ENVIRONMENT, and INDEX lists every document. The server npm README now states the real OpenCode minimum (2.1.2).

AGENTS.md is now about 14,000 characters (roughly 3,500 tokens); AGENTS.md, dev-docs and the vendor README went from about 11,200 lines to under 4,700.

Validation: every relative Markdown link and every cited dev-docs path resolves; no reference to a renamed or deleted document remains; `npm run test:help` passes for all ten locales.

Review: three independent GPT-6.1 Sol (high) reviews by area found binding rules lost in the trim and current-state passes; 25 were restored as present-tense facts or prohibitions and four contradicting statements corrected, each checked against code. A Fable 5.1 gatekeeper review of the whole PR passed; its follow-up routes session recovery from the index, points to dev-docs/INDEX.md and documents the family identity read.
2026-10-21 16:59:43 +02:00