diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09a23b3..1ca02a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: LAN discovery, pairing and admin tests run: cargo test --locked --test lan --test lan_messaging --test admin_messaging --test shell_daemon --test update --test remote --test spawn --test usage --test codex_wake - name: Store, page and phone tests - run: cargo test --locked --test attachments --test channel --test editing --test issues --test phone --test phone_plain --test requirements --test trace --test workflow --test working_on + run: cargo test --locked --test attachments --test channel --test editing --test issues --test phone --test phone_plain --test requirements --test trace --test workflow --test working_on --test codex_remote ui: # The admin page end to end (qa/, headless Chrome, a test bridge with # stand-in agents). Observe mode: it reports but does not block yet; the diff --git a/AGENTS.md b/AGENTS.md index 1aa15b2..64e1382 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,6 +14,40 @@ Keep durable pending messages across service restarts. Never resend a message whose delivery is uncertain automatically. Never launch a second agent for an existing session. Keep source and runtime data separate. Append changes to LOG.md. +## Execution and blockers + +For user-authorized work, proceed with implementation and verification. Review +findings are work to resolve, not a requirement to obtain another permission +or review-stage grant. Do not stop after a fixed number of correction rounds. +Do not wait for PM permission, a draft requirement status, a design hash verdict, +or an unchanged status report before doing independently executable work. + +When a check is demonstrably wrong, document the source-backed contradiction +and correct the check as a separate change without another permission wait. +Preserve the behavior being verified; do not weaken assertions, delete failing +checks or convert failures to passes merely to accept an implementation. +Rerun affected checks, including lint, after a relevant correction; fixed +per-session run limits do not prevent verification. Avoid unchanged reruns. + +A failed check blocks only the steps that depend on its result. Record the +failure and continue independent checks. Preserve the aggregate failure until +it is resolved; never relabel unrun checks as passed. Serialize heavy builds +when an actual competing job is running, without an idle reservation or a +separate permission gate. Use source-bound verification evidence. + +Communicate handoffs directly to the assigned next agent in the delivery chain. +Do not broadcast, fan out status messages, or revive a superseded blocker from +a delayed message. Missing recipients and uncertain delivery are explicit +routing states, not reasons to stop unrelated work. User approval requirements +for external or irreversible actions and unresolved approval holds still apply. + +Do not add maintenance jobs, routine CPU/memory/disk preflights, magic +approval phrases, fixed review rounds or PM-permission waits as prerequisites +for already-authorized work. Reuse available sessions when appropriate. +Existing native Run settings, identity/root protections, peer authority, +exact routing and delivery integrity remain unchanged; prompt edits do not +change native approval configuration. + ## Changelog Default: every change a user of the bridge can observe (a command, a tool, an diff --git a/CHANGELOG.md b/CHANGELOG.md index 83bddc8..e67a3fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,67 @@ User-facing changes to session-bridge. Newest first. Each version lists ## Unreleased +### Changes + +### Fixes + +## 0.8.0 - 2026-12-01 + +### Changes + +- Codex enables live web search by default. For sessions you start or restart + from the admin page, the approval default is now Never with the configured + sandbox. Explicit Run choices take precedence, including On request imported + from a Codex shell alias. Agent and command-line starts keep their native + approvals. + +- Launched sessions proceed with already-authorized work without another + procedural confirmation. The built-in root prompt drops routine resource + preflights and session-maintenance requirements; native Run settings stay + under your existing choices. + +- Never kill root: the bridge no longer closes or restarts the session that + holds root, from the admin page, `session-bridge close`, or another session's + `close_session`; each says " holds root; the bridge does not close or + restart it". The Projects tab and the conversation header show no Close or + Restart for it, `list_sessions` marks it with `holds_root`, and the bridge's + instructions tell agents never to end its process. To end it, give the + session another role first, or close it in its own terminal. +- Use one current assignee and release per issue. Phase roles and the active + release control execution; future-release assignments remain queued without + occupying WIP, while upgrades retain assignment history and a recovery copy. + Unresolved historical names remain readable and unassigned during upgrades. + Assigned clarification work counts toward the active work limit, including + when an issue is created; explicit non-WIP queues remain exempt. + Admin and phone sends retain client replay IDs alongside strict issue inputs. + Review independence follows the current verified developer attempt while + preserving earlier authorship and unresolved legacy evidence. Retrying failed + work retains the authors of other passed steps for independent review. + +- Configure project teamwork workflows with a user-run skill helper, and offer + default pipeline roles on a new installation. + +- Filter the issue board and list by release and current assignee, with the + selected filters restored when you reopen the view. Choose a live session + by name and role when moving an issue to its next phase. + +- Configure project delivery workflows with editable SVG blocks and persisted + issue playbooks. Independent checks keep moving after a failure; handoffs go + only to the assigned agent, with revision-bound evidence and restart recovery. + Automatic recovery notices identify the bridge as their author, not the user, + and appear in the correct project channel without a filesystem path label; + the notification identity cannot be used as a caller to read channels or list sessions. + ### Fixes +- Keep Issues List titles readable beside an open issue, with horizontal scrolling for the remaining columns and a detail pane that leaves room for the list on narrower windows. +- A Codex session the bridge starts on your Codex app server, by you or by + an agent, carries the name the start returned and acts in its role, root + included, from its first request. Two starts in one folder get their own + names and roles. Closing or restarting it ends only its own terminal + client, never the shared app server or other sessions. If the app server + cannot create the session's conversation, the start fails with the reason + in its window. - Starting a session on macOS no longer brings Terminal or iTerm2 to the front: the new window or tab opens while you keep working where you were, and in iTerm2 the tab you were looking at stays selected. One exception: diff --git a/Cargo.lock b/Cargo.lock index 5c12511..7a33848 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2935,7 +2935,7 @@ dependencies = [ [[package]] name = "session-bridge" -version = "0.7.0" +version = "0.8.0" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index 6dfc510..bc33dc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "session-bridge" -version = "0.7.0" +version = "0.8.0" edition = "2024" rust-version = "1.95" diff --git a/LOG.md b/LOG.md new file mode 100644 index 0000000..ba25ad8 --- /dev/null +++ b/LOG.md @@ -0,0 +1,783 @@ +# Working log + +The component entries below retain their original evidence and historical release labels. +Current release coordination uses #120 (0.8.0); this private preview is not release acceptance. + +## Issue: #124 - Release: #120 - authorized-work prompts + +Remove maintenance and procedural confirmation prerequisites from the +built-in root prompt, shared first-prompt instructions and project agent +instructions. Reuse available sessions and coordinate actual heavy-job +starts/results without CPU/memory/disk preflights or PM permission rounds. +Keep root/identity binding, peer authority, routing, delivery integrity and +native user-selected Run arguments unchanged. This removes avoidable work +stalls from the current release workflow. + +Tests were prepared before production changes under REQ-026/REQ-028; +only superseded prompt-policy expectations change. Exact baseline/final +terminal results and per-dependent limits accompany the immutable handoff. +Fourteen canonical external role files were selectively updated with +hash-bound evidence and native filesystem approval, preserving unrelated +text. Prior sessions' already-received context was not rewritten. +No promptbox/prompbx executable or repository command prefix was found. + +Application evidence: the canonical project AGENTS file was reconciled with +#119's exact execution/blocker text and this issue's maintenance default; +its CLAUDE symlink is preserved. Fourteen matching installed role templates +were selectively updated with native filesystem approval, before-hash +checks and atomic writes; after-hashes and original modes verified. +Root separately applied eight global instruction clauses at +/Users/alexeus/.claude/CLAUDE.md (Codex AGENTS symlink preserved); worker +verified the supplied manifest and after-hash76f304f3 without editing it. +All owner evidence is retained with the issue's hash-named handoff. + +The exact pure-prompt regression harness fails on original source and passes +on the changed source. This is isolated-function evidence, not a full crate +or native-session verdict. Full affected Cargo tests and Clippy were initially deferred while the +release-candidate heavy build had priority; terminal results follow below. + +Review follow-up: replace the old broadcast instruction in both built-in +and installed root prompts with direct next-agent handoff. Extend the real +assembled-prompt test and verify the external root snapshot separately; +preserve all unrelated custom text. Earlier prompt-only harness evidence +is attributed to its recorded source hash, not substituted for final checks. + +Release-priority follow-up: keep current-release priority and serial publishing, +while explicitly allowing independent authorized work. The canonical root +release-order snapshot fails the focused REQ-028 check before correction +and passes afterward; direct routing and unrelated-text preservation also +pass. All fourteen current role-file hashes and original modes verified. +The token-only launch_argv source was inspected; no maintenance command +prefix exists there, and no native argv was changed. + +Final automated verification on frozen tree3e3ec0be: affected spawn53, +roles10, role_files6 and MCP5 unit tests pass (74 total); cargo fmt --check, +git diff --check and cargo clippy --workspace --locked -j1 -- -D warnings +all exit0. Checks ran sequentially with CARGO_BUILD_JOBS=1 and a private +per-tree target. The own single-thread graph emitted its final index; +AUTO_REFRESH=0 queries confirm first_prompt/ROOT_PROMPT reach the actual +new regression and role/preset/file consumers. Full graph build exit was +not retained by its detached launcher; successful index/query evidence is +reported with that limit. Original pre-edit cross-ref impact evidence and +post-edit own-graph supplement are distinguished. + +Root's supported roles response independently matches canonical root +prompt SHA d41699fd (HTTP200); this proves the current read response, not +retroactive session context or native approval behavior. Independent +global-rule review found no additional issue. Native/browser/installed +binary acceptance and release publication remain outside this change. +The final LOG-only evidence update leaves every Rust byte identical to +the checked tree; no heavy checks are rerun for this documentation edit. + +## 2026-11-30 - Issue: #119; Release: #121 + +Implemented declarative project workflows and persistent version-bound issue playbooks +in the existing Workflow/IssueStore owners. Added SVG editing, transactional evidence, +admin recovery and exact-target durable pipeline handoffs. Removed procedural +permission/round-count blockers so authorized independent delivery can continue. +Preserved approval holds, stale-attempt rejection and uncertain-send protection. + +Verified affected issues (81), domain (13), workflow service/property (4), phone/MCP +filters, frontend (23), formatting, Clippy and real CDP project save/restart isolation +(9 checks). Counts across filters overlap. See docs/design/119-verification.md for +commands, failure corrections, graph reach and runtime boundaries. No installation +or release publication performed. + +### CI correction - Issue: #119; Release: #121 + +macOS CI run 46431916822 failed the repository register import check (495 passed, +1 failed): REQ-059 was wrapped across lines instead of the established one-line +register format. Joined the entry without changing its words or the judging test. +Original job log retained in .wingbox/ci-macos-141893619095.log. Follow-up CI +verification pending; prior local passes do not imply CI acceptance. + +### UI CI correction - Issue: #119; Release: #121 + +Original UI CI had 79 passes, 2 failures and 11 skips. The new playbook event +list reused .issue-history before the actual lifecycle history. Gave it its own +.playbook__history class while retaining styling; existing QA assertions unchanged. +Direct CDP renderIssueDialog reproduction failed before (created/moved false, two +matches) and passed after (both true, one match). Node syntax and diff checks pass. +Rebuilt embedded UI verification remains with the replacement CI run. + +### State-filter CI correction - Issue: #119; Release: #121 + +CI b36929a passed Windows tests but exposed a macOS issue API regression: +state=["nowhere"] returned an empty page instead of the existing error. Restored +validation against the current workflow and each persisted pinned workflow, including +the no-store case. Existing tests unchanged. cargo test --test issues with one test +thread passed all 7, including the exact failing scenario; original CI failure retained +in .wingbox/ci-macos-b36929a.log. No unrelated source changed. + +All-target locked Clippy with warnings denied passed after the state-filter fix. +The rebuilt UI CI job on b36929a completed SUCCESS, confirming the history fix. + +### Ended-sender handoff - Issue: #119; Release: #121 + +Review found the durable dispatcher incorrectly required its original sender to +remain live. Resolve that sender from the bridge's existing private sessions.json +registry while preserving local parent identity and exact project checks. The target +must still be live, assigned to the same pinned generation, and permitted by the +existing role/independence checks; normal Send validation remains authoritative. + +Added a deterministic service regression: persist the intent while stopped, end the +sender, restart with the target live, require one receipt with original sender and +exact target, then restart again and require the same message ID. Old source timed +out as expected (.wingbox/119-sender-before-corrected.log). Corrected fixture omission +and private socket-directory setup separately; no production permission relaxation. +Full workflow suite passed 5/5 (.wingbox/119-sender-final.log), including the new case. +All-target locked Clippy with warnings denied passed after this correction. + +### Admin recovery handoff - Issue: #119; Release: #121 + +Review found queue_ready returned early for authenticated admin operations. Record +that origin as the existing internal user actor and dispatch through direct UserSend, +which derives the actual bridge user identity. No peer impersonation, channel or +broadcast fallback. Source/config/generation, exact target, hold and uncertain-send +checks remain unchanged. Update the wire description to state the user-origin path. + +New real-service admin_release_hold_notifies_assigned_agent_once failed before the +fix with a missing-notice timeout. Afterward workflow6/6 and delivery-store6/6 pass; +the test makes no agent mutation after release, requires exactly one user-origin +receipt to the assigned peer, and checks the same message ID after restart. The +existing scenario separately asserts the new user resumption intent and its original +peer successor intent. Initial wrong store-test filter selected zero and is not proof. +Logs: .wingbox/119-admin-before.log, 119-admin-after.log, 119-admin-store-final.log. +All-target locked Clippy with warnings denied and formatting passed after the fix. + +### Isolated generation regression - Issue: #119; Release: #121 + +Added a pure retry case that keeps source revision, configuration and target +unchanged, uses current aggregate CAS for both claims, and changes only generation +between the rejected stale claim and accepted current claim. This closes the review +gap where changing source and generation together could mask a missing generation +comparison. Production code unchanged; verification recorded after execution. +Focused delivery suite passed 14/14, including the generation-only case +(.wingbox/119-generation-only.log). Both claims use current CAS; changing only the +generation field changes refusal to acceptance. No source mutation was used. +All-target locked Clippy with warnings denied and formatting also passed. + +### Returning recipient reconciliation - Issue: #119; Release: #120 + +Reviewer found unresolved intents were never revisited when an assigned peer returned. +The regular drain now reconciles unresolved rows against the current roster. Store +resolution is transactional, checks the original source/configuration/generation and +step readiness, preserves sender identity, and queues only the affected step. Stale +intents become superseded; uncertain/dispatching rows remain protected across generations. + +The new real-service test failed before with a missing-successor timeout, then the +full workflow suite passed 7/7 after the fix. It restores the same registered peer +without an issue/playbook mutation, verifies one exact-target receipt, unchanged +execution state and no duplicate after restart. Added store regressions for stale +versions, repeated resolution and uncertain/dispatching suppression. Logs retained +under .wingbox/119-unresolved-before.log and 119-unresolved-after.log. +Delivery-store tests passed 8/8; all-target locked Clippy with warnings denied and +formatting passed. Refreshed Wingbox single-threaded after checks; saved reconcile +reach and test-module analysis in .wingbox/119-unresolved-reach.txt and +119-unresolved-test-analysis.txt. No runtime schema or public DTO changes. + +## Issue #128 / Release #120: single assignment and active release + +Implementation in the isolated assigned-pipeline worktree from f6bd667. +REQ-060 replaces current assignment inputs with assigned, resolves native identity +at the existing boundary, and keeps legacy stage provenance during an atomic +upgrade with a private recovery copy. Active release selection reuses release +rows; future assignments are excluded from execution/WIP. Verification ongoing. + +Fail-first wire regression on frozen f6bd667 source failed as expected: mixed +legacy assignment writes were accepted. Baseline cargo test --locked --lib +assignment_contract_tests exited 101 with 0 passed, 1 failed. Combined checks +and affected service tests are not yet terminal; no implementation PASS claimed. + + +REQ-060 verification update: affected issue unit checks passed 114/114, including +the new historical developer regression. The original regression failed before +the correction (/tmp/128-independence-before.log): recording a new developer +incorrectly let the previous developer review. Native historical developer IDs +now remain excluded; unresolved legacy author names cannot be guessed from a new +display name or erased by unrelated assignment history. + +Real-service issues 7/7, requirements 11/11 and working-on 1/1 passed through +isolated daemons/admin/control/MCP boundaries. Role fixtures explicitly provision +missing roles; role notices are counted separately from pipeline handoffs. +Original failing runs and documented fixture corrections are retained under +/tmp/sb-128-service-checks* and .wingbox/test-corrections. Workflow and final lint +results follow in the completed handoff; these lines do not claim those checks. + +Final local checks for Issue #128 / Release #120: workflow service 7/7 passed; +affected issue units passed 114/114 again after four fixture-only Clippy +corrections. cargo clippy --locked --workspace --all-targets -- -D warnings +passed (40.05s); cargo fmt --all -- --check and git diff --check passed. +Terminal results: /tmp/sb-128-lint-correction/results.json and +/tmp/sb-128-final-checks/results.json. No installed runtime, integrated UI129, +native acceptance, release integration or publication is claimed. + +### Issue #128 / Release #120: exact wire assertions and Windows test repair + +Added direct serializer assertions for detail assigned:null versus omitted +Card/IssueRow/ListRow fields, native-ID values, release-version strings and no +current legacy assignment keys. Move-assignment parsing now has explicit +omitted/null/string round-trip and legacy-only/mixed-key rejection assertions. +Focused issue tests passed 15/15 (/tmp/128-output-contract-tests.log). + +Windows CI job142005019508 at b35924d failed compilation because two phone +assertions referenced the Unix-only plain module. The original failure is +preserved in /tmp/128-windows-ci.log. Those two assertions now share the module's +not(windows) condition; cross-platform encrypted-phone refusal assertions remain. +Affected phone checks passed 2/2 locally; all-target Clippy with warnings denied +and formatting passed (/tmp/sb-128-contract-checks/results.json). Production code +is unchanged. Corrected Windows CI remains to run. + +## 2026-11-30 - Private integration preview + +Combined exact #124 input tree 7cd686ca with #128 head c45cfcb and applied +the accepted #130 role-provisioning slice 0e731f93 in a private Git index. +Resolved only additive AGENTS/changelog/requirement entries and retained both +component logs. REQ-057, REQ-059 and REQ-060 each remain on one physical line. +No build or runtime checks were run for this combined tree. #119 origin and +#128 production findings, #115 scope/evidence, #129 UI, remaining #130 work +and final native/release checks remain open. Shared source/index unchanged. + +### Private preview root-prompt component + +Applied exact #130 root-prompt delta 4f79f23a over its verified role parent. +Both before/after file SHA256 values match the immutable component manifest. +Author reports targeted test red-to-green, formatting and Clippy passing; +independent source review accepts only the supplied two-file delta. No tests +were run for this combined preview; active custom role files are unchanged. + + + +## Issue #119 / Release #120: distinguish generated notification origin + +The actual native inbox regression first failed because an automatic admin-action +handoff rendered the UserSend header and user reply address. Original runtime +failure: /tmp/sb-119-origin-before/test.log (cargo exit 101, 0 passed, 1 failed). +The prior test's user-origin expectation was incorrect: the user authorized the +playbook action, but did not author the generated text. Its assertion is corrected +separately from the retained fail-first envelope evidence. + +A private daemon event now enqueues a project-scoped bridge identity. No public +request variant was added. Native rendering marks machine input explicitly; +public send cannot impersonate that identity or address it. Genuine user messages +retain their existing attribution. Existing handoff version/target checks and +uncertain-delivery behavior are unchanged. Receipt sender metadata survives restart. + +Pre-edit Wingbox outputs: /tmp/119-origin-preedit-impact.txt, +/tmp/119-machine-origin-impact.json and /tmp/119-origin-agent-boundaries.txt. +Post-edit graph is stale; exact source checks supplement it. Verification: workflow integration 7 passed; transport 5, domain 6 and discovery +20 unit tests passed; messaging 5, peer-auth 1, issues 7 and requirements 11 +service tests passed. cargo fmt --all --check, locked all-target workspace Clippy +with -D warnings, and git diff --check passed. Evidence and coverage limits are +retained in .wingbox/119-machine-origin/. Windows CI and full independent review +remain separate from these local results. + +Private integration preview: preserve role notice plus machine-origin exact handoff assertion. No combined test/runtime/release acceptance. + +Private integration test correction: bind native frame and machine identity to exact handoff receipt; preserve role notice and no-resend checks. Source/static formatting only; runtime verification pending. + + +## Issue: #130 - Release: #120 - teamwork workflow support + +Add a user-directed workflow configuration skill, user-run canonical admin +helper, and offer-once pipeline role presets. Preserve custom roles, selected +workflow overrides, native permissions and message delivery boundaries. +Verification is recorded in the associated component handoffs; final integrated +service, installation and release verification remain pending. + +Private package composition: preserve reviewed helper-v4 bytes and both document inputs. Integrated runtime and final release verification remain pending. + + + +## Issue #128 / Release #120: preserve strict request boundary test intent + +CI run 46464899858 failed on macOS and Windows because two older tests expected +unknown/internal fields to deserialize successfully. Strict request decoding now +rejects them before dispatch. The spawn test retains unknown_fields helper coverage +and adds decoding refusal; phone attachment tests reject wire-supplied internal +paths and retain valid attachment-ID and empty internal-path assertions. +Original CI errors are preserved in .wingbox/128-verification/migration-correction/ci-before.log. +Admin tests 11/11 and phone allow tests 17/17 passed; formatting and locked +all-target workspace Clippy with warnings denied passed. No production decoding +rule was relaxed to make the checks pass. + + +## Issue #128 / Release #120: preserve unresolved legacy migration access + +The new two-slot migration test failed at runtime (exit 101) because distinct raw +display names were treated as trustworthy conflicting identities. Migration now +keeps an unresolved declared slot unassigned and retains raw history, while +conflicting exact native IDs still roll back schema and data atomically. The +previous conflict fixture's display names were incorrect evidence of identity; +its fixture now uses two different native IDs with rollback assertions unchanged. +Both original fixture and failure log remain in the migration-correction evidence. +Assignment migration tests passed 6/6, including two unresolved/mixed scenarios, +reopen/readback and exact-identity conflict rollback. Formatting, locked all-target +workspace Clippy -D warnings and diff checks passed. Current revision-scoped +independence and clean-home default-role service acceptance are separate open +items; these results do not establish them. + + +## Issue #128 / Release #120: count running start-phase attempts toward WIP + +A real-store regression demonstrated two simultaneous Running clarify attempts for +one nonexempt actor on defined issues in the active release. Start-stage queued +assignments were excluded from active_holder, and Start did not inspect running +attempts. The Start transaction now also checks other issues' running attempts in +pinned open WIP phases, retaining release filtering and role/phase exemptions. +Queued assignments remain allowed; completion frees the attempt for another issue. + +The initial fixture roster error is preserved separately from the actual runtime +RED (second Start incorrectly returned Ok). The corrected regression asserts +second-Start refusal, unchanged issue/playbook/handoff rows, and successful Start +after the first attempt completes. Delivery-store tests passed 12/12, WIP unit +tests 18/18 and store WIP 7/7; real-service assignment flow passed 1/1. Formatting, +locked all-target workspace Clippy -D warnings and diff checks passed. Evidence +and pre-edit impact summary: .wingbox/128-verification/start-wip/. +This does not resolve the separate revision-scoped provenance or clean-home role +provisioning acceptance items. The prepared clean-home service test is not included. + + +## Issue #128 / Release #120: count assigned start phases and validate creation + +The refined default contract treats assigned clarify work as active before a +playbook Start. An actual regression failed because active_holder excluded every +start state; a second real-store regression showed creation never called wip_ok. +The existing pure active-holder predicate now respects open/nonfinal/wip flags +without a blanket start exclusion. Assigned issue creation calls the same +transactional WIP guard used by edits, with existing per-issue pinned snapshots. +Unassigned work, future-release queues and explicit wip:false queues remain exempt. + +Old tests that intentionally model queued assignments now configure wip:false +explicitly. Their original source/failures are retained, and default start-state +assertions are strengthened. The real-store regression rejects duplicate active +creation/edit atomically, retains an unassigned queue, and starts the next issue +after completion and handback. This supersedes the earlier fixture that allowed +two active assigned start states before testing duplicate Start. + +Verification: 119 affected issue tests; issues 7, workflow 7 and working_on 1 +service tests; spawn 38 tests passed. An initial spawn_tests:: filter selected zero +checks and is not counted; the actual binary's spawn:: tests then passed 38/38. +Formatting, locked all-target workspace Clippy -D warnings and diff checks passed. +Evidence: .wingbox/128-verification/assigned-start/. The uncommitted clean-home +workflow test remains unrun pending #130 and was explicitly excluded. Revision- +scoped provenance and independent whole-candidate acceptance remain open. + +## Issue #128 / Release #120: preserve HTTP replay envelopes + +Strict command decoding also rejected the supported client_id send metadata +before the HTTP replay owner could read it. A real private-home admin request +against the frozen 55bb618+role candidate returned HTTP 400 unknown client_id; +replay-metadata/before.log retains that failure. The shared replay owner now +separates only user_send/channel_send client_id from the command clone. Admin, +TLS phone and encrypted plain-phone handlers retain the unchanged original body +for replay identity/digest. Other unknown command fields still refuse, including +legacy assignment keys and internal attachment paths. No public field, request +variant or replay persistence contract changes. + +Verification: actual admin replay regression passed (same receipt, one native +message, changed body 409, internal paths 400); 77 phone unit tests, 11 admin +unit tests and all 14 admin messaging service tests passed. Format passed. +Workspace all-target Clippy result is recorded in the immutable handoff manifest. +Phone-browser/TLS end-to-end replay was not exercised by the admin test. Wingbox +queries were stale and exact source confirmed the three entrypoint calls; +coverage.md records dependents and limitations. Authorship P1 remains separate. + +Private accepted core-corrections composition through74db: migration, assigned/Start WIP and replay fixes merged. Authorship and validation gaps remain; combined runtime not verified. + +Private integration correction: first source-bound d29 build failed E0063 because virtual Bridge lacked #82 client_pid. Set explicit None and extend REQ-059 machine-origin test to assert no native process/client/socket/restart. Original build101 retained; affected cached verification pending. + +Private integration fixture correction: e2 merged workflow run failed before delivery assertions because save_role(project-manager) duplicated newly provisioned defaults. Shared delivery_project now uses the real preset roles; manager assignment and all delivery/security assertions stay. Original 0/1 failure retained; six helper callers require affected workflow suite verification. + +Private integration origin-assertion correction: workflow suite reached scenarios,5passed/2failed. Two legacy assertions still treated generated handoffs as user-origin; now require typed Bridge origin and count complete outbox plus exact single machine receipt, retaining target/restart/no-broadcast controls. User initiator metadata assertions stay. Production code unchanged; two affected reruns and Clippy pending. + +Private partial integration verification terminal: source f6ef853 with production Rust equal e2f203; immutable binary SHA256 5880dc6d34eebb83638810364a6a8f4b46660419577782e5e36e8cce9933f06f. Build/fmt/all-target Clippy exited0; machine-origin exact unit1passed, five unchanged workflow cases passed on a474, and both corrected handoff/recovery cases passed exactly once on f6ef. Original E0063/duplicate-preset/old-user-origin failures retained. Separate UI composition bd7b530 has44 affected Bun tests passing. All10632 pinned source files reverified after commands. This is partial QA input, not final0.8: current core authorship fixes,119projection,132selected tests,129 binary and115policy inputs remain to compose/verify. No shared service install, release publication or native model approval claim. + +## Issue #128 / Release #120: scope independent review to current authorship + +Replaced the all-time assignment/legacy-owner veto with internal append-only +current-attempt evidence. Authenticated developer completion records exact native +identity; review and QA preserve the attempt, while a new developer attempt, +revision or adopted configuration invalidates current proof without deleting +history. Unknown legacy authorship remains readable and only refuses a new +independence-dependent action. Assignment alone is not authorship. Ordinary move, +playbook Start and dispatch share the predicate. Schema 7 uses the existing +transaction/migration owner and pre-upgrade recovery copy; no public setter or +invented source revision was added. + +Fail-first phase tests exposed both missing positive proof and permanent legacy +veto. The initial wider run exposed obsolete fixtures; their correction supplies +scoped developer proof while retaining self-review, role, result and evidence +assertions. Service fixtures retain declared developer phases instead of erasing +all phase roles before testing review. Original failures are retained under +.wingbox/128-verification/authorship. A separate attempt-ID regression prevents +mixing issue-history positions with evidence-log IDs. + +Verification: 123 affected issue tests passed; the final phase run passed 8, +including one additional regression (124 distinct issue tests covered overall). +Actual issue and workflow service suites passed 7 each. The independent clean-home +role-component test was excluded and is not proof for this revision. Final +requirements, formatter and Clippy outcomes are recorded in the handoff manifest. +The 26 requirement tests passed. Initial Clippy refused three collapsible +match/if forms; match guards preserve the same predicates without lint ignores. +Wingbox was stale; exact source confirmed the shared predicate callers. The +coverage report records the pre-edit analysis misses and post-edit query limits. + +Final terminal checks: affected issues 124/124, requirements 26/26, issue service +7/7 and workflow service 7/7; formatter and workspace all-target Clippy exit 0. +The final issue run follows the mechanical match-guard lint correction. Service +and requirement runs preceded that equivalent syntax-only correction. No CI, +independent-review or release acceptance is inferred from these local results. + +## Issue #128 / Release #120: retain direct second-Start WIP regression + +Reviewer11 identified that the assigned-start correction had replaced the direct +second-Start assertion with earlier assignment/create refusal. Added a separate +regression without changing those checks or production code. Two assignments +start in an explicit non-WIP queue; supported per-issue configuration adoption +lets the first start before the second adopts the WIP snapshot. The second Start +must then refuse with the existing holding error, leaving its issue, playbook, +outbox and the first running attempt unchanged. Coordinator and custom non-WIP +cases still succeed. No raw database fixture mutation is used. + +The first command compiled but its unqualified --exact filter ran zero tests; +this is not a PASS claim. Corrected selection executed the test and passed all +three scenarios. The affected delivery-store suite and final Clippy outcomes are +retained in start-wip/additive-* logs. Wingbox impact preceded this test edit; +the graph was stale, so exact source and historical26b diff were inspected. +Final outcomes: focused test 1/1, affected delivery-store suite 13/13, formatter, +diff check and workspace all-target Clippy passed. Independent acceptance and +current CI remain separate from this test-only correction. + +## Issue #128 / Release #120: exercise QA in the clean-home component test + +Reviewer11 found that fixture761a assigned QA without sending a QA action. +The superseding fixturea369 performs actual QA NOT_PASS to fix, checks the exact +actor/result/state history, then repeats developer/reviewer handoffs before PM +publication. A wrong-role QA move during clarification must refuse and leave +the entire issue unchanged. Production roles and privacy checks are unchanged. + +Exact private55bb+role0e731 combined source passed the expanded service test1/1, +formatter and focused workflow Clippy. Immutable full/incremental patches and +qa-manifest.json live in .wingbox/128-verification/clean-home-combined; prior761a +snapshot/results remain. This is component evidence, not current PR48 or release +acceptance. Fixture remains separate until the role component is integrated. + +## Issue #128 / Release #120: verify ChannelSend HTTP replay + +Root accepted narrow supported client_id separation in the existing replay +owner while strict Request decoding remains. Added real private-admin ChannelSend +coverage alongside UserSend: HTTP success, identical response on replay, changed +body 409, forged internal attached field 400, and exactly one native notice. +Both focused service tests passed; formatting/diff checks passed. Production +source did not change. Final focused Clippy status is in the channel handoff +manifest; competing #132/integration builds are coordinated by actual terminals. + +## Issue #128 / Release #120: preserve passed contributors across partial retry + +Reviewer1 found that Retry invalidated all issue authorship while the delivery +reducer resets only its failed or blocked target. A real-store two-developer +regression failed before the fix: after A passed and B failed, retrying B erased +A's retained contribution. Removed that whole-issue invalidation; successful +Complete still adds contributors and SetRevision/Adopt still require new proof. + +The regression now checks both authors remain excluded after B passes and after +restart, and Adopt preserves audit while requiring fresh proof. A separate pure +phase test proves an administrator's developer-phase exit does not infer the +assignee's authorship. The affected issues suite passed 127 tests. Original RED +and final logs are preserved under .wingbox/128-verification/authorship. +Wingbox impact preceded edits; its graph was stale and authorship absent, so +exact source was used. Post-edit diff_functions/usages was also stale/no-match; +real-store assertions establish update_playbook reach, not a graph coverage claim. +Final formatter, diff check and workspace all-target Clippy passed (46.92s). +ChannelSend service regression also passed 2/2 with UserSend; no independent +review or final CI acceptance is inferred. + + +Issue #129 / Release #120: add current-assignee and release filters to the +issue board and list, using exact session identities and project-scoped release +catalogs. The 44 affected unit tests passed. Headless CDP issues.pipeline passed +against binary SHA256 75f359237d05c2ffa518b1c17d75167dcab315bafaf3cdc81d2059a3f9340c10, +including release/assignee filters, stale CAS, phase move, future-release WIP, +focus and project-switch checks. +The affected Rust host passed cargo clippy --workspace --locked -j 1 -- -D +warnings and cargo fmt --all -- --check. Final core integration and review +remain pending. +The workflow example tests now expect the REQ-060 assigned field in place of +the retired phase-specific fields; the former expectations are preserved in +the base commit. The live move selector uses stable session IDs. + +Private UI-component composition preserves reviewed655c production/test bytes. Final corrected-core integration, source-bound browser checks and release remain pending. Running partiald29 build unchanged. + +## Release 0.8 integration: compose accepted core and validation inputs + +Composed current core 7d9, additive Start recovery, selected QA fixture and +reviewed UI into the private integration tree. Retained the Bridge client identity +and preset/origin fixture corrections. This composition has not been built or +executed; final 119 projection, 115 policy, native QA and CI remain pending. + +Issue #119 / Release #120: project the internal bridge session's public project +as the existing project name while retaining its canonical path and stable ID. +The real-service channel regression failed first with a false cross-project +path label. A persisted old record reproduced the same error after restart; +the read boundary now projects local bridge records in memory without a data +migration. The focused real-service workflow regression, channel integration, +five transport rendering tests and uncertain-delivery control passed. Locked +workspace Clippy, formatter and diff checks passed; release integration remains. + +Release integration: merged the 119 projection test with existing receipt-bound +frame/status assertions; the new restart identity assertion also selects that +receipt. No final-tree execution or independent composition acceptance yet. + +Release integration: actual eight-workflow run passed seven and failed the new +read_channel projection assertion because default role provisioning adds a second +channel entry. Retained the original failure. The test now obtains the machine +identity from the exact handoff receipt, keeps the full two-entry count and checks +exactly one machine line with its exact target/project and no other-project before +and after restart. Other-project empty and existing native/forgery checks remain. +Production source is unchanged; corrected execution and review are pending. + +Release integration CDP: the first actual headless issues.pipeline replay failed +during setup because save_role tried to recreate the provisioned project-manager +role. Removed only the three duplicate role creations for PM/clarify/developer; +all real role assignments and pipeline/CAS/filter/focus assertions remain. The +failed report is retained. Production source/binary is unchanged; replay pending. + +Release integration verification: exact composed production tree7ba8 built and +passed132 affected issue tests. The eight-workflow run passed7 and exposed the +role-plus-handoff projection assertion mismatch; its test-only correction1fc6 +then passed the exact test, full formatter and all-target workspace Clippy. This +is not one8/8 run on1fc6. The headless CDP pipeline initially failed duplicate +default role creation; test-only correction1a5c then passed1/1 on immutable binary +97c86900881981ed38fbf9a06fa09bb6b66762ab82623de0150ced258ca0455e. +Main and pinned vendor file hashes were verified before/after each run. Original +failures remain. #115, native acceptance, final independent review/version/CI and +publication/update checks are still required; this is not release acceptance. + +Issue #119 / Release #120: refuse the virtual bridge notification identity at +the existing public session-list and channel-read caller boundaries. Separate +real-service tests first reproduced acceptance of its observed ID in each path; +the corrected workflow and channel scenarios passed. Anonymous and native +listing and persisted machine history remain covered. Release integration and +independent review remain separate. + +Release integration: composed the 119 public-caller guard delta with the +receipt-derived machine identity and existing two-line projection controls. +No source checkout or cached target changed during QA2 handoff. New production +guards and the merged test remain pending independent review and execution. + +Issue #134 / Release #120: spawn fixtures now edit the offered QA role using +its current version instead of attempting to create it again. The custom test +prompt and root-protection assertions remain; the original duplicate-role +failure is retained in .scratch/qa95/spawn-nobody.log. Affected spawn tests +are pending execution on the composed candidate. + +Release integration: applied the reviewed 134 test-only QA-role CAS fixture +correction to the guarded b780 candidate. Production is unchanged from the +6ff79184 binary; full workflow8/8, channel1PASS/1ignored and CDPpipeline1/1 +passed on b780. Corrected spawn execution and final all-target Clippy pending. + +Release integration verification: guarded production tree b780 built with +formatter success and passed all8 workflow tests, channel1PASS/1ignored and +headless CDP issues.pipeline1/1 with no console errors. The test-only134 +fixture composition32d3 passed six affected exact spawn integration cases +independently under QA2, formatter and final workspace all-target Clippy. +Main and pinned vendor file hashes were reverified; no production rebuild was +needed for the fixture-only changes. Original setup failures remain preserved. + +Prepared a draft integration PR against current main593056e for CI validation, +not a versioned or published release. The source remains0.7.0 until final +versioning. #115 policy scope/input, authenticated native acceptance, broader +119 review and final exact-SHA CI remain open. No tag, release publication, +shared installation or shared daemon restart was performed. + +Issue #130 / Release #120 (0.8.0): corrected two admin role fixtures on exact +PR49 base dad56e886db30367018d431069b168b2bbaf3d17. REQ-060 provisioning +adds clarify, developer, project-manager and qa once, so the legacy role-list +expectations and the auditor-to-qa rename contradicted the production source. +Keep the pipeline roles, use a custom rename destination and assert that a +rename onto qa is refused without changing role files or assignments. Preserve +the existing migration, external-edit, version-conflict, rename-delivery, +deletion and admin-only assertions. Production behavior is unchanged. + +Before editing, the isolated native baseline reproduced both CI failures +(1 passed, 2 failed); the sandbox attempt failed earlier on socket permission. +After correction, admin_messaging passed 15/15; after formatting, roles_ passed +3/3 and routing scoping passed 5/5. Initial fmt required wrapping one call; +final cargo fmt --check and workspace all-target Clippy (-D warnings) passed. +Wingbox impact preceded edits; its routing edges over-resolved the receive +helper, which routing actually defines locally. The named routing tests were +still run. LOG.md is not source and has no graph dependents. No changelog entry +is needed for this test-only change. Independent review, exact final-candidate +CI and broader release acceptance remain separate. + +Issue #140 / Release #120 (0.8.0): the Codex app-server integration fixture +assumed `qa` did not exist. On pinned base 92adb458, `role_files::load` +already offers `qa` via `RoleBook::with_presets`. The standalone baseline +stopped all three tests at setup with "A role named qa already exists". +Read the preset's current version and edit its prompt through the admin +page. This preserves the fixture's prompt and all downstream assertions +about thread creation, identity, role, and close behavior. + +Standalone verification on 92adb458: `cargo test --test codex_remote -- +--test-threads=1` returned 0 passed, 3 failed before the edit and 3 passed, +0 failed after. The bridge executable hash stayed identical across both +runs. `cargo fmt --check`, `git diff --check`, and workspace all-target +Clippy with `-D warnings` passed. Wingbox reports that the three executed +tests call the only changed function, the fixture's `bridge` helper. +Baseline and passing logs are preserved separately for review. + +Issue: #137 / Release: #120. The Issues List now reserves readable Title width and +scrolls its other columns inside the list. The open issue pane scales with the +window so the list controls remain usable at narrower widths. A pinned PR49 +headless CDP check first reproduced the narrow Title (169px, no horizontal +overflow), then passed after the CSS change. The registered headless QA action +`issues-layout.table` passed at 1440px, 1100px and 900px with detail open and +closed; it verifies restored table width, keyboard scrolling, search and row +navigation. Release integration and independent review remain separate. + +Issue: #137 / Release: #120. The layout QA action now restores the shared +headless browser viewport in `finally`. Its added assertion failed first at +900x900; the paired `issues-layout.table workflow.graph` run then passed 2/2, +and the following workflow screenshot returned to the harness's 1440x900. + +Issue #132 / Release #120 (0.8.0), 2026-12-01: corrected the isolated +browser QA issues/workflow fixtures for the release-linked/single-assignee +contract. PM assignment, default phase roles and real session completion +replace obsolete owner/reviewer/qa_owner requests; presentation checks retain +search, sorting, markup safety, focus, history, missing-folder, session-state, +exact-ID chat and cross-project assertions. Three session states use separate +assigned cards. The current list has seven columns, including Assigned and +Release. No production contract or guard changed. + +Source-backed judging-check correction: the single Assigned rule disables +adding another rule through the UI. A malformed draft still proves per-rule +error placement, canonical validation and rejected-save/no-mutation behavior. +Default phase completion without a selected successor now queues unassigned +QA work; the checks additionally refuse an explicit wrong-role assignment +without any issue/history mutation, then verify atomic QA assignment-plus-move +on another completed issue. These expectations follow src/admin/workflow.js, +src/admin/admin.js and src/issues/phase_tests.rs rather than restoring old wire +fields. Original CI and local failures are retained. + +Verification on exact PR49 dad56e886db30367018d431069b168b2bbaf3d17: +headless CDP `bun qa/run.ts issues workflow` reproduced 4 PASS / 9 FAIL, then +passed all 13 affected cases with 0 FAIL / 0 SKIP after the fixture correction. +The immutable 6ff79184deff780358bcc54eb433c8e8ef743e960db384a23417246fa1de8c90 +candidate was reused: 240 production src/Cargo/build inputs match its manifest; +all 398 non-vendor manifest entries were compared. Before/after QA and binary +hashes match for the final run. `cargo fmt --all -- --check` and +`git diff --check` pass. Standalone strict tsc was attempted but cannot pass +without the repository's missing Bun/Node ambient definitions; no dependencies +were added. Fresh single-job Wingbox build and pre-edit impact cover both QA +files through qa/domains/index.ts and qa/run.ts; actual runner execution covers +both dependents and each fixture helper. LOG.md is not source in the graph. +Evidence: isolated .scratch/issue-132-ui-ca307/.wingbox/issue-132-evidence. +Clippy is deferred while actual peer cargo/rustc jobs run; it is not a PASS. +Independent review, final integration CI, native acceptance and release +publication remain outside this fixture-only result. + +Issue #132 / Release #120 (0.8.0), review correction, 2026-12-01: removed +the obsolete QA_A1_STUB page override from workflow.rules. The override +indexed live sessions by display names while the current fixture uses stable +session IDs, stripped rules before sending saves to the real bridge, and +fabricated assignment responses. The scenario now exercises the current +backend with or without the legacy environment flag and checks the chosen +QA assignee plus persisted move history. The wrong-role refusal, duplicate +rule rejected save with unchanged workflow, unassigned queue transition, +and browser editor assertions remain. Review1's flagged failure and the +original nine QA failures remain in their separate evidence logs. Affected +headless CDP and check results are in the immutable revision evidence under +.scratch/issue-132-ui-ca307/.wingbox/issue-132-evidence. + +Issue #132 / Release #120 (0.8.0), probe review correction, 2026-12-01: +required release metadata missing from workflow.rules now fails its QA +assertion instead of reporting Skip. Removed the obsolete skip import and +comment. A focused regression calls the real probe with boundary replies: +before the correction it received Skip instead of QaError (1 PASS/1 FAIL); +afterward both missing-metadata and valid-metadata checks pass. The probe +exports its narrow pageOk/expect context for this regression. No browser, +assignment, refusal or successor assertions were removed. +Headless real-backend CDP on the unchanged immutable 6ff79184 binary passed +all five workflow cases, then QA_A1_STUB=1 workflow.rules passed 1/1; both +runs had 0 FAIL/0 SKIP and identical before/after source/binary hashes. +`bun test qa/domains/workflow.test.ts`, `cargo fmt --all -- --check` and +`git diff --check` passed. Pre-edit Wingbox impact named index.ts and run.ts; +the new test file initially had no graph entry, then usages confirmed its +two calls to a1Probe. LOG is non-source. Prior Rust Clippy evidence and the +missing Bun/Node typings limitation remain as recorded; no new local Clippy +or strict tsc PASS is claimed. Original failure/review packets are preserved. + +Issue #143 / Release #120: correct the Codex restart fixture to edit the +provisioned qa role with its current file version, retaining the hold role, +prompts and full restart/client/pending-delivery assertions. The pinned +9886e77 baseline failed at duplicate-qa setup. The author sandbox run stopped +on Unix socket permission before assertions; root independently replayed the +unchanged compiled test and passed 1/1 in 17.53s. Independent reviewer replay +passed 1/1 in 17.56s and verified all 240 production inputs, exact fixture +source, executable and unchanged assertion-block hashes. Wingbox impact +reported no external test dependents; fmt and diff checks passed. Native +permissions were unchanged. Final composed-binary QA/CI remain separate. + +Issue #115 / Release #120 (0.8.0): bridge-managed Codex launches default to +`--ask-for-approval never` and `--search`. The existing Run approval field +gains `never`, with the configured Codex sandbox. Explicit saved approval +choices and launch flag overrides continue to apply on authorized admin +starts and restarts. Agent and senderless starts use the bridge defaults. +Search defaults yield to explicit search choices. The existing REQ-041 +thread/start payload and Codex client resume path carry the same fields. + +On the pinned base the new launch unit tests failed before implementation. +On the composition with independently reviewed #140 (9eb275b), launch +units passed 55/55, the existing REQ-041 wire unit passed, and spawn and +codex_remote passed 7/7 and 3/3. The headless Chrome Run tab check passed +default display and explicit override save/readback after reload with no +console errors. Formatter, diff, JavaScript syntax, and workspace +all-target Clippy with -D warnings passed. A separate Codex wake restart +diagnostic stopped before target assertions at its unchanged duplicate-qa +setup. The PM has the preserved failure log for separate tracking. + +Installed Codex 0.172.0 CLI help and native schema generation passed. +Authenticated native endpoint, effective approval and search settings, and +delivery receipts remain pending after the isolated auth attempt expired. +Evidence and pinned native source references are in the #115 handoff. + +Issue #115 / Release #120 (0.8.0) review correction: apply the Never +approval default only to authorized admin Run starts and restarts. Agent +and senderless command-line launches retain native approval behavior even +when an admin has saved an explicit choice. Live search is independent of +origin, and explicit admin Run settings still apply. The Codex sandbox +selection and REQ-041 thread/start payload are unchanged. + +The failing-first origin test on 9886e77 observed `--ask-for-approval +never` on a non-admin launch with saved Ask. After the correction, launch +units passed 56/56, the REQ-041 wire unit passed, and the isolated spawn +and codex_remote suites passed 7/7 and 3/3. The remote test captured a +root-agent child without an approval override. Formatting, diff checks, +and all-target Clippy passed. Authenticated native acceptance and release +candidate CI remain pending. The separate duplicate-qa wake fixture is +tracked in #143. + +Issue #35 / Release #120: prepare the 0.8.0 package and dated changelog for +source-bound candidate verification. The local tree composes reviewed role +and QA fixture fixes, the Issues layout correction, and the c6e4263c Codex +user-default implementation whose independent review is still pending. +Unstarted issue #139 is queued for 0.9.0 under the user small-release rule. +No publication, installation, final QA or CI success is claimed here. + +Issue #115 / Release #120 (0.8.0): integrate importer correction c08c5517 +onto the composed candidate. Preserve explicit on-request aliases in the +Run choice, including all installed-CLI short/long/attached spellings. +Runtime and test blobs exactly match author manifest77462f6098ea; root +impact was run before edits. Author RED, 58 spawn tests, REQ-041 wire, +headless alias/default CDP and all-target Clippy passed. Independent delta +review and final composed candidate verification remain pending. + +Issue #144 / Release #120 (0.8.0): update provisioned project-manager and +developer test-role prompts with their current file versions in Issues and +working-on fixtures. Preserve all behavior assertions and original RED +(7 + 1 duplicate-role failures). Root independently replayed the exact +frozen patch085b68db: Issues7/7 and working_on1/1 PASS, source/test/bridge +hashes unchanged; author all-target Clippy passed. All 240 production/build +inputs equal candidate b9f4500, so final binary85bc9aaa remains applicable. +Independent source review and corrected exact-head CI remain pending. diff --git a/README.md b/README.md index b721c6e..9d5d207 100644 --- a/README.md +++ b/README.md @@ -91,19 +91,18 @@ on their assignments and talk to the root session, not to you. the files it owns and the acceptance criteria, using `send_message`. Owners are explicit, so two sessions do not edit the same file. 5. **The team reports back.** Each session sends the root session its result: - the changed files, the tests it ran and what is still open. A good working - rule (root's instructions ask for it; the bridge does not enforce it): the - sessions do not commit; the root session reviews, runs the checks, and - commits. + the changed files, the tests it ran and what is still open. Authorized + owners complete their assigned work and affected verification without + another procedural go-ahead; the coordinator integrates their results. 6. **The root session balances.** **Kickoff** asks every session for its status; **Rebalance** asks the root session to redistribute the work using the team table (role, state, usage and last message of each session). A schedule on the Cron tab can send either one on a timer. 7. **You get the summary.** The root session answers you with what is done and - verified, who works on what, and the decisions that need you. Anything that - needs your permission (a release, an install, a push to a protected branch, - a choice between designs) comes back to you as a question; a session never - takes another session's message as your approval. + verified, who works on what, and any material scope or contract conflict. + Work you already requested proceeds without another procedural + confirmation; an action outside that authorization still needs your + decision. A session never takes another session's message as your approval. 8. **Close finished sessions.** Close a session from its chat or the Projects tab when its work is done. It leaves Chats; the project stays on the Projects tab, ready for the next session. @@ -365,11 +364,14 @@ folder's name; change it in the same form. Where it opens: How a session you start runs is set on the **Run** tab: the terminal app, and for each agent an approvals choice (Claude: Ask, Accept edits, Auto, Don't ask, Plan, Bypass all; Codex: Ask, On request, Auto review, Never ask -in a workspace sandbox, Bypass all) and extra flags; **Import from my shell** -fills them from your zsh `claude` and `codex` aliases. They apply to sessions -you start from the admin page; sessions a root agent or the command line -starts always ask for approval and get no extra flags. Some flags are fixed so the -session stays connected to the bridge: Claude's name (`-n`) and +with the configured sandbox, Never ask in a workspace sandbox, Bypass all) +and extra flags. **Import from my shell** fills them from your zsh `claude` +and `codex` aliases. Saved Run choices apply to sessions you start or restart +from the admin page. The Codex Run default is `--ask-for-approval never` +with the configured sandbox, and Codex launches default to live search +(`--search`). Root-agent and command-line starts use their native approval +settings without saved Run flags. Some flags keep sessions connected to the +bridge: Claude's name (`-n`) and `--disallowedTools AskUserQuestion`, Codex's `--remote unix://` when your Codex app server runs. For Codex sessions you start, **Run on my Codex app server** (on by default) decides whether they get `--remote unix://`; turned @@ -377,7 +379,8 @@ off, they run plain `codex`, and the bridge can no longer start your messages in them. Importing turns it on when your `codex` alias has `--remote` and otherwise leaves it as it is. Extra flags are limited to known ones (for example `--model`, `--add-dir`, `--search`, `-c key=value`); others are refused with -the reason. Extra flags can still change approvals indirectly: Claude's +the reason. Set `-c web_search=disabled` to turn off live search for your +Codex launches. Extra flags can still change approvals indirectly: Claude's `--settings ` with permission rules, Codex's `-c approval_policy=...` or `-c sandbox_mode=...` (only `-c mcp_servers...` is refused, since the bridge needs its MCP server). That is allowed because you set them for the @@ -410,11 +413,26 @@ A session's waiting list (**N waiting**) lets you remove a message that has not been read yet: from the bridge, or from a Codex session's own queue. A session's **Close session** button (local sessions only) ends its process -after you confirm. A Codex session that runs inside a shared Codex app server -is not closed this way; close it in its terminal. From a shell: +after you confirm. For a Codex session the bridge started on your Codex app +server, that is its own terminal client: a running turn is stopped first, +the app server and its other sessions keep running, and the session leaves +the list at once. A Codex session in the app server that the bridge did not +start is not closed this way; close it in its terminal. A session that holds root +has no Close button and is never closed by the bridge, on any path; the +answer is ` holds root; the bridge does not close or restart it`. End +it in its own terminal, or give root to another session and another role +(or none) to this one, and then close it. From a shell: `session-bridge spawn [--project ] [--model ] [--effort ]` and `session-bridge close `. +The built-in root prompt and common launch prompt tell sessions to continue +already-authorized work without maintenance jobs, routine CPU/memory/disk +preflights or fixed approval rounds. Heavy jobs still avoid actual overlap; +the team reports start and terminal facts instead of waiting for procedural +permission. Existing custom role files stay yours: edit their matching text +on the Roles tab when needed. This changes instructions, not native Run +approval flags or permissions. + The built-in **root** role coordinates a project. A session with it gets two more MCP tools: `spawn_session(role, agent?, model?, effort?)` starts a session with any role but root in its own project (at most 16 live sessions there), and @@ -423,18 +441,15 @@ Only you assign root or start a root session; you can edit root's instructions on the Roles tab but not rename or delete it. Root's own project is its directory, not just a folder of the same name elsewhere. Root acts only through the session you gave it (or the session started as root): another -session that takes the same name gets no root powers. Any program of your -account can still run `session-bridge spawn` and `close`, and the control +session that takes the same name gets no root powers and no protection from +a close. Any program of your account can still run `session-bridge spawn` +and `close` (a session that holds root is refused there too), and the control socket does not prove which session is calling (only a started session's claim is checked: it must come from its own launch process, on macOS and Linux), and whoever runs a launch chooses the `claude` or `codex` program it starts, so root is a convenience for coordinating agents, not a security boundary. -Known issue: Codex sessions the bridge starts on the Codex app server keep -Codex's own title and cannot be closed or restarted from the bridge yet; -close them in their terminal (#82). - The **Projects** tab shows this laptop's projects (directories with live sessions, and every existing, non-temporary directory the bridge knew a session in before, so a project stays after its sessions end) with their sessions, roles and coordinator, @@ -489,40 +504,47 @@ role's default; a value that came from the old role's defaults is not kept. What a session was started with is kept in `~/.session-bridge/launches.json` for 30 days after it was last seen; a session started before restarts existed, or not by the bridge, says it has no -launch record and cannot be restarted. Sessions sharing a process or running -in the Codex app server, and a paired laptop's sessions, are restarted where -they run. Only the admin page restarts sessions. +launch record and cannot be restarted. A Codex session the bridge started on +your Codex app server restarts in a new terminal client that continues the +same conversation. Sessions sharing a process, Codex sessions in the app +server that the bridge did not start, and a paired laptop's sessions are +restarted where they run. A session that holds root is not restarted by the bridge: it has +no Restart action, and a request answers ` holds root; the bridge does +not close or restart it`. Only the admin page restarts sessions. ## Issues Sessions track their project's work as issues along the SDLC: `defined`, `in-progress`, `review`, `fix`, `qa`, `released`, `closed`. Five more tools -come with the bridge: `create_issue`, `update_issue` (also to assign the -owner, reviewer or QA owner, each a live session of the project), +come with the bridge: `create_issue`, `update_issue` (the project manager assigns one `assigned` session, +by live project name or provider session ID), `move_issue`, `list_issues` (rows and a Markdown table, or a ranked search with `query`) and `show_issue` (all fields and the history). A session works on the issues of its own working directory only; the history records which session made each change. -Moves are checked: starting work needs acceptance criteria and an owner; -`review -> qa` needs result `pass`, evidence and a reviewer other than the -owner; going to `fix` needs result `not_pass`; `qa -> released` needs result +Moves are checked: starting work needs acceptance criteria, an assigned agent and a release; +`review -> qa` needs result `pass`, evidence and a reviewer independent of the +recorded developers; going to `fix` needs result `not_pass`; `qa -> released` needs result `pass`, evidence and the commit; closing needs a reason. Recording `released` commits, pushes and publishes nothing. These are the default workflow. Each project can have its own: its states (an id, a label, whether it is open), one start state, at least one final state, and the moves between states, each with a guard naming what it -needs: a result, evidence, a commit, acceptance criteria, an owner, a mover -other than the owner, or one of some roles (the role a session acts in; +needs: a result, evidence, a commit, acceptance criteria, a current assignee, +independence from recorded developers, or one of some roles (the role a session acts in; root only for the session that holds it; the user is never refused by -role). A state can also carry assignment rules: its owner, reviewer or QA -owner must name a live session of the project acting in one of the listed -roles (any live session when none is listed; root counts only for the -session that holds it, and only where a rule lists root). Every move into -the state checks them, the user's moves included, and while an issue is -there an edit cannot clear that field or give it to a session the rule -does not accept. A workflow save that moves issues out of a removed state +role). A state can also carry assignment rules for the single `assigned` session. +The defaults are clarify in `defined`, developer in `in-progress` and `fix`, +reviewer in `review`, qa in `qa`, and project-manager in `released`. +Project overrides use the same validator. Unassigned issues can remain queued; +execution requires the exact assigned identity and its configured role. +When the current agent completes a phase requiring a different role, the next +phase is queued unassigned for the project manager to assign. The admin page +can assign and move atomically. Reopened final issues likewise stay unassigned +until the project manager links current work and assigns its next agent. +A workflow save that moves issues out of a removed state checks no rules: it is your own change. One state can be marked `release`: the state REQ-052's releases put issues into (the default marks `released`; a workflow saved before this has none until you mark one). Only the admin page saves a workflow, after checking it (every @@ -532,6 +554,122 @@ moved issue gets one `workflow` entry in its history. `show_issue` and the board list the moves an issue can make (`moves`, with what each needs), and `list_issues` lists the open states by default. +### Install and configure teamwork + +The bridge binary does not install the teamwork skill. To install it manually, +obtain a source checkout of the same release from +`https://github.com/aileron-tech/session-bridge`, then copy the checkout's +`skills/teamwork-configure` directory to `~/.codex/skills/teamwork-configure`. +Identify the exact release tag matching your installed bridge version before +running the commands below. Replace every `vX.Y.Z` with that exact tag. The +clone fails if the tag is absent; it never falls back to the default branch. + +```sh +git clone --branch vX.Y.Z --single-branch https://github.com/aileron-tech/session-bridge.git session-bridge-source && \ + git -C session-bridge-source describe --tags --exact-match --match 'vX.Y.Z' HEAD && \ + git -C session-bridge-source rev-parse HEAD +``` + +Verify the displayed tag and commit match your intended installed release. +Then copy only if the checkout still points to that tag and the destination is +absent: + +```sh +test ! -e ~/.codex/skills/teamwork-configure && \ + git -C session-bridge-source rev-parse --verify 'refs/tags/vX.Y.Z^{commit}' >/dev/null && \ + test "$(git -C session-bridge-source rev-parse HEAD)" = "$(git -C session-bridge-source rev-parse 'refs/tags/vX.Y.Z^{commit}')" && \ + mkdir -p ~/.codex/skills && \ + cp -R session-bridge-source/skills/teamwork-configure ~/.codex/skills/ +``` + +If the destination already exists, inspect it and preserve your own changes +before replacing anything. Restart or refresh your Codex session to discover +newly installed skills. In the skills picker, choose `teamwork-configure`, or +invoke it as `$teamwork-configure`. + +The user-run helper requires Python 3 and `httpx`. One way to provide them on a +clean machine is to create a dedicated environment, then install the package in +that environment: + +```sh +python3 -m venv ~/.local/share/session-bridge/teamwork-venv +~/.local/share/session-bridge/teamwork-venv/bin/python -m pip install httpx +``` + +Use that environment's Python when running the helper. The skill resolves +`scripts/helper.py` relative to its own selected `SKILL.md` and gives you the +absolute helper path. The agent prepares a proposal for the selected project; +it does not acquire an admin token or save the workflow on its own. You run the +helper in your authorized local user context to export and check a proposal, +or to apply it with a new backup file. + +An apply previews the proposed workflow using the bridge's validator, checks +that its exported base version is still current, saves through the authenticated +local admin service, and reads the workflow back. A stale version or invalid +workflow is refused. The preview is not a per-issue snapshot lock; the service +revalidates in the save transaction. If a save or readback fails, inspect the +project before retrying because the save may already have completed. + +The helper uses the existing local admin authority. A process running as the +same OS user cannot be cryptographically distinguished from that user by this +helper; a peer message alone is not consent. Keep project-specific rules you +want to retain in the proposal. + +Project cards open **Configure workflow**. Select a stage or arrow in the SVG +editor to edit its properties; the tables provide the same controls by keyboard. +Add delivery checks to a stage using its current assignee, and name any +prerequisites in that stage. Save creates a project override; **Use default** +previews the built-in workflow before an explicit save. + +Each issue snapshots its configured delivery plan. `show_issue` includes its +playbook version, source revision, ready steps, audit events and handoff states. +Use `update_issue` with a `playbook` operation and `expected_version` to bind a +revision, start a ready check, report its result or record a blocker. Start +carries the exact assigned session id, configuration version, source revision +and generation; completion also carries the returned attempt version. Read the +current issue after a conflict. A transport receipt never completes a check. +Independent checks remain ready when another branch fails. + +Only the admin page releases approval holds, interrupts abandoned attempts, +skips optional checks or adopts the selected configuration. Revision changes +and adoption invalidate old evidence while preserving unresolved approval holds +and history. Required checks guard forward moves and release. Configured issues +keep their pinned workflow; incompatible state-removal mappings refuse until +explicit adoption. Legacy empty plans keep the existing workflow-save behavior. + +Assignment and release inputs use `assigned` and `release`; obsolete `owner`, +`reviewer` and `qa_owner` writes are refused. Release values remain version strings. +The sole frozen release is active; otherwise the unique lowest-priority-number +planning release is active. A tie or missing release refuses execution with a +reason. Future-release assignments remain queued and do not consume active WIP +or send execution handoffs. + +The assignment upgrade creates a private, uniquely named +`issues-before-assigned-.db` recovery copy in the project home before its +atomic migration. It keeps old identities and immutable history as provenance. +An ambiguous old display name stays unassigned until the project manager selects +a live identity. Historical developer provenance remains separate: an unresolved +current author name cannot prove review independence, and assignment alone does +not establish authorship. New authenticated developer completion records a scoped +attempt; review and QA retain that proof, while a new developer attempt or source +revision requires new proof. Earlier unrelated attempts remain in the audit and +do not permanently exclude their authors. Completed legacy verdicts stay intact. +Schema 7 stores this internal append-only evidence separately from assignment +history and creates the same recovery copy before upgrading existing databases. +No public input can set authorship. To roll back, stop the bridge, retain the upgraded database for +inspection, restore the logged recovery copy as `issues.db` in the same private +project directory, and run the matching pre-upgrade binary. Do not restore a copy +while a daemon has the database open. The recovery copy represents the moment +before upgrade; later changes remain in the retained upgraded database. + +Playbooks live in the project's `issues.db`. Readable derived exports are in +`/issues//playbook.json` and `events.jsonl`; they are never +imported as authority. An export failure is shown on the issue and a later read +regenerates it. Pipeline handoffs are durable direct messages to the exact +assigned next agent, never broadcasts. Missing targets are visible as unresolved +handoffs. A send with uncertain delivery requires inspection and is not resent +automatically. + A release is an issue of kind `release` with a version (`create_issue` with `kind: "release"` and `version`, or on the admin page's Issues tab), created and moved only by a release manager: a session acting as @@ -692,6 +830,9 @@ The CLI derives sender identity from `CODEX_THREAD_ID`, `CLAUDE_CODE_SESSION_ID`, or its Claude ancestor. A human shell without an agent identity can list/status but cannot silently impersonate a sender. +Never end a root session's process (no kill, no closing its terminal); the +bridge refuses to close or restart it. + ### Command reference | Command | Purpose | @@ -706,7 +847,7 @@ identity can list/status but cannot silently impersonate a sender. | `session-bridge status` | Show the service state and recent messages | | `session-bridge send [--project ]` | Send from an agent's shell tool | | `session-bridge spawn [--project ] [--model ] [--effort ]` | Start a session with a role in a terminal | -| `session-bridge close ` | End a local session's process | +| `session-bridge close ` | End a local session's process (refused for a session that holds root) | | `session-bridge network on [--port ] [--name ]` / `network off` | Announce this laptop on the local network and accept paired bridges | | `session-bridge discover` | Bridges found on the network, paired or not | | `session-bridge pair ` | Pair with a discovered laptop; type the code it shows | diff --git a/docs/design/119-acceptance.md b/docs/design/119-acceptance.md new file mode 100644 index 0000000..ff1f7c4 --- /dev/null +++ b/docs/design/119-acceptance.md @@ -0,0 +1,65 @@ +Issue #119 acceptance scenarios +============================== + +REQ-059. These cases exercise the bridge boundary and persisted state, not +merely the shape of the reducer's output. + +1. Project isolation. Open projects A and B without configuration. Both show + today's default. On A's configuration page, add a stage and guarded edge, + save and reload. A retains the override; B and a new C retain the default. +2. Dependency progress. Configure three implementation checks: unit, lint, and + acceptance (depends on unit). Fail unit with product evidence. lint remains + ready; acceptance cannot start. Passing lint does not make the issue pass. +3. Environment failure. Start unit then report an environment blocker before + assertions. Preserve the attempt and error. lint can run. A retry explicitly + starts a new attempt and cannot manufacture a PASS from the failed attempt. +4. Approval hold. Block unit for approval. Owner changes source revision. + unit remains held, start/complete/retry refuse, lint remains available. + Restart the daemon and repeat. Only an admin release with the current + version and note clears the hold, once; an identical stale request refuses. +5. Adoption. Change configuration while an issue has passing evidence and a + held step. Old evidence remains attached to its old configuration/revision. + Explicit admin adoption invalidates results and preserves the hold. A plan + omitting that held step is refused until explicit release, with no writes. +6. Concurrent workers. Two callers read playbook version N and attempt to + claim the same step. Exactly one commits; the other gets a conflict. A + different caller cannot complete the first caller's running attempt. +7. Restart. Start a step, restart the daemon, and read it. It is still running + with the same actor/revision; no process or command is launched or resent. + Explicit recovery records the interrupted attempt before retrying. +8. Stage guard. Try an ordinary forward issue move with required checks + incomplete. It refuses naming those checks. A declared rejection/fix or + cancellation remains available. Required skipped checks do not count as + PASS. Existing role, owner, WIP and evidence guards still apply. +9. Release guard. Freeze a release with an issue whose required check failed. + Attempt publication: release and all linked issues remain unchanged. Pass + all required checks on the exact revision and retry through normal guards. +10. Exports. Verify playbook.json and events.jsonl agree with the authoritative + database version. Remove/corrupt exports and regenerate. Force export I/O + failure after a committed mutation: return a visible warning and committed + version; no duplicated event. No export is loaded as authority. +11. SVG editor. Select a block by pointer and keyboard, edit its properties, + connect two stages, edit a guard, remove a connection, save, reload. Errors + name the invalid block/edge; markup in labels renders as text. Saved SVG + contains the current diagram. Config JSON and diagram stay equivalent. +12. Boundary refusals. Session/phone/control requests cannot save policy, + adopt a plan or release approval. Another project's session cannot update + the issue. Unknown fields, wrong types, cycles and unknown dependencies + refuse without writes. Actor/project/time come from trusted context. +13. Direct handoff. Complete developer step and verify exactly one message to + its assigned reviewer, none to project peers or a channel. The message + names issue/step/configuration/source/generation. A wrong or stale recipient + cannot claim. Missing target is a routing blocker, never a broadcast. +14. Handoff recovery. Crash before dispatch: the pending intent survives and + can dispatch once. Crash/lost reply after dispatching: mark uncertain and + never resend automatically. Delivered receipt alone leaves the step ready, + not passed. An independent addressed branch still progresses. +15. Late result. Actor starts A, admin interrupts it, then the same actor starts + B. Completing A with fresh aggregate CAS still refuses its old attempt token; + B remains running. A result from an old source revision also refuses. +16. Mixed snapshots. Old issue has an open active stage absent from the new + project workflow. It still participates in publication and WIP checks by + its snapshot. One failed linked guard leaves the whole publication intact. +17. Acceptance destination. Required steps with no release marker refuse + configuration validation. Empty and optional-only plans still support the + existing no-release workflow and explicit cancellation remains available. diff --git a/docs/design/119-declarative-delivery.md b/docs/design/119-declarative-delivery.md new file mode 100644 index 0000000..defa93f --- /dev/null +++ b/docs/design/119-declarative-delivery.md @@ -0,0 +1,156 @@ +Declarative delivery and issue playbooks +====================================== + +Issue: #119. Release: #121 (legacy #105). Requirement: REQ-059. +Base: github/main 593056e674ae1f99c887ba1bbc57ffb2498f12da. +Status: implemented under the user's instruction to fix and remove procedural blockers. +Normative payloads and lifecycle: [wire contract](119-wire-contract.md). +Behavioral scenarios: [acceptance](119-acceptance.md). + +Problem and scope +----------------- + +A failed check currently stops independent work through coordinator messages. +The issue board cannot reconstruct executable next steps or evidence provenance. +The bridge owns a declarative delivery plan and persistent execution state so +readiness follows dependencies, rather than a PM's temporary grant. + +The user's latest decision is authoritative: each project can override its +workflow on its project configuration page; today's workflow is the default. +This replaces #94's shared-only direction for this feature. #94's migration is +not a prerequisite. This change does not implement #85's automatic session +creation/closure or #34's arbitrary command execution. Agents run work and report +results; existing user approval boundaries remain. + +Boundaries +---------- + +System: the local Session Bridge and existing native sessions. +Container: the daemon owns project stores; the browser and MCP are adapters. +Component: workflow and playbook validation/reducers are pure Rust. IssueStore +owns atomic persistence; daemon adapters derive caller identity and project. +Code: src/workflow.rs remains the FSM owner. New delivery modules own step +configuration and execution, with no I/O in their domain functions. + +Contract +-------- + +The existing workflow JSON gains optional delivery configuration. Omission uses +an empty step plan and preserves current workflow behavior. A configured plan +contains steps with id, label, state, roles, depends_on, required, and +independent_of_owner, and assignee. State ids refer to the owning workflow. Step ids are +unique; dependencies are acyclic and reference existing steps within the same state; +inter-stage ordering belongs to the FSM. Every required step state must dominate +the release state: removing that state makes release unreachable from start. +A required plan must have a release marker. Configurations permitting shortcuts around required stages are refused. At most 100 steps, bounded text +and dependency lists. Unknown fields and invalid configurations are refused. + +Each issue has a playbook stored transactionally with its issue history. +New issues snapshot the selected configuration; migration initializes existing +issues without inventing PASS. The existing workflow engine evaluates snapshots. +Detail/board/move paths use the issue snapshot, not the latest project workflow. +Configured playbooks retain their snapshots when the project workflow changes. +A project save that maps away a configured issue's current stage refuses; move +it to a common state and explicitly adopt the selected configuration first. +Legacy empty plans retain existing workflow-save/remap behavior. Adoption is +bound to the playbook and selected configuration versions. An issue's +configuration snapshot and workflow version are pinned when initialized; +configuration edits affect new playbooks, not completed evidence. An explicit +user migration is required to adopt a new plan for an existing issue. Migration +records the old/new version and invalidates execution evidence; it never silently +reuses a PASS. Adoption is admin-user-only. An adoption that removes a step with +an unresolved approval hold is refused atomically; the user must release the +hold explicitly before removing that step. The issue row remains the sole authority for SDLC state. + +Playbook fields: configuration_version, configuration snapshot, source_revision, +version, steps and events. Step states: pending, running, passed, failed, +blocked, skipped. Ready is computed from the issue stage, prerequisites and +current results. Blocker kinds: product, environment, approval, scheduling, +release_order. Failed/blocked steps only block their descendants. Required steps +must pass before leaving their stage along an acceptance transition. Rejection +requires a declared not_pass guard; cancellation is a reason-guarded move to a +non-release final state. Caller-supplied not_pass alone cannot bypass checks. +The common move predicate checks all required steps on entry to the release +state, for ordinary moves and release publication. Publication checks only +linked issues it actually advances; cancelled nonparticipants remain excluded +and are never counted as PASS. Bulk publication and active-owner/WIP guards +resolve every issue using its own snapshot in the same transaction; no old +active stage disappears because the current project workflow lacks it. + +The existing show_issue response adds playbook, including ready steps and +missing transition requirements. update_issue accepts an optional playbook +operation, mutually exclusive with ordinary field edits: set_revision, start, +complete, block, retry. Operations carry expected_version. Completion includes +step, attempt_version, source_revision, result and evidence; both the running +attempt token and aggregate version must match. Role/owner checks use the live caller. Identity, +project, timestamp and role are never accepted from an agent's payload. +Evidence is bound to source_revision. A revision change resets all execution +results and requires a note, but preserves every unresolved approval hold. +Approval holds are persisted separately from execution results: source changes, +plan adoption, retries, stage changes and restart cannot clear them. set_revision +is allowed for the issue owner or admin user; it refuses while work is running +unless the admin user explicitly interrupts it, preserving the prior attempt. +Running steps survive restart and are not retried +automatically; an explicit retry records the interrupted/failed attempt. +Approval-blocked steps can only be resumed by the user on the admin page. +Agent messages and PASS reports never constitute approval. The authenticated +admin-only release_hold operation requires expected_version, step and note, +clears exactly that hold, and appends exactly one event. A repeated stale release +is refused. Independent steps remain eligible while that hold exists. + +Persistence and export +---------------------- + +Use the existing IssueStore migration mechanism; no live database editing. +Playbook updates, issue version/history and append-only delivery events commit +in one transaction. Stale versions refuse without writes. Project identity and +private permissions come from project_store::project_dir. + +Readable derived exports live at /issues//playbook.json +and events.jsonl. They are generated from committed state and replaced +atomically per file, carrying a common version. They are never imported or read +as live state. An export failure is surfaced as an export warning after a +successful database commit; it does not invite blindly replaying the operation. +Reads/restart can regenerate exports. The database remains recoverable even if +exports are missing or corrupt. + +Project configuration UI +------------------------ + +The Projects page opens the selected project's workflow configuration. Current +workflow is the default; saving creates a project override. The SVG editor uses +Camunda-style blocks, selectable transition arrows and a property panel. Users +add/remove stages and connections and edit roles, guards and delivery steps. +Diagram and JSON represent the same configuration. Keyboard controls accompany +pointer interactions; labels are text nodes, not markup. Save is explicit and +version-checked. BPMN import/export and an external BPMN engine are out of scope. + +Verification +------------ + +Pure tests: validation, cycle detection, dependency readiness, all step +transitions, role/independence checks, revision invalidation, stale updates. +Explicit bypass regression: block for approval, change revision as owner, try +start/complete/retry and confirm the hold persists; adopt a plan retaining the +step and confirm the hold persists; reject removal of its held step. Only the +admin release_hold permits progress. Repeat after restart while verifying an +independent branch can still run. +Store tests: migration, restart persistence, rollback, append-only history, +per-project isolation, explicit adoption and export recovery. +Adapter tests: derived caller/project, user-only configuration and approval +resume, existing tool compatibility, ordinary and release move guards. +Browser: edit a project-specific SVG workflow, save/reload, verify another +project stays unchanged; keyboard selection and visible validation errors. +Regression: reproduce independent check progress after one product/environment +failure, without converting the aggregate result to PASS. +Run affected tests only, cargo fmt --check and one final workspace Clippy. + +Pipeline messaging +------------------ + +Pipeline work follows the declared successor chain with direct, single-recipient +peer messages only. The wire contract defines exact target resolution, durable +handoff intent, stale-generation checks and uncertainty handling. The existing +message queue remains the transport owner; no broadcast fallback is introduced. +Only independent branches explicitly present in the plan can progress in +parallel, each with its own target. Message delivery never completes a step. diff --git a/docs/design/119-verification.md b/docs/design/119-verification.md new file mode 100644 index 0000000..db8494e --- /dev/null +++ b/docs/design/119-verification.md @@ -0,0 +1,85 @@ +# Issue: #119 - verification + +Release: #121. REQ-059. Base: 593056e674ae1f99c887ba1bbc57ffb2498f12da. + +Implemented project workflow overrides, SVG editing, version-pinned issue playbooks, +transactional evidence and targeted durable handoffs. Existing Workflow and IssueStore +remain the authorities. Removed procedural permission and fixed-round stop gates; +actual approval holds, identity checks and uncertain-delivery protection remain. + +## Executed checks + +Cargo commands used CARGO_BUILD_JOBS=1 and CARGO_TARGET_DIR=target-delivery. + +| Check | Result | Local evidence | +| --- | --- | --- | +| cargo test --lib issues:: -- --test-threads=1 | 81 passed | .wingbox/delivery-issues-final.log | +| Compiled library delivery:: tests | 13 passed | .wingbox/delivery-domain-final.log | +| Workflow, phone allowlists, MCP schema filters | 15, 17, 3, 1 passed; overlapping filters, not additive | .wingbox/delivery-other-unit.log | +| outbox_is_atomic_single_target_and_recovers_uncertain_without_resend | 1 passed after cross-generation regression added | .wingbox/delivery-outbox-final.log | +| cargo test --test workflow -- --test-threads=1 | 4 passed, real local service plus 64-case property check | .wingbox/delivery-workflow-final.log | +| cargo clippy --workspace -- -D warnings | passed | .wingbox/delivery-clippy-verified.log | +| cargo fmt --all -- --check; git diff --check | passed | final terminal output | +| Frontend Bun tests | 23 passed, 85 assertions | workflow UI agent evidence | +| node --check for admin.js and workflow.js | passed | terminal output | +| Real daemon and headless Chrome through CDP | 9 checks passed, no browser exceptions | /private/tmp/sb119-live-ui-xCLW6x/report.json | + +Browser checks cover actual SVG save, reload persistence, project isolation, sidebar +version and daemon restart persistence. Report SHA256: +59a8c9194eb35bf5f6b65a9f4e2269998affd3297e8256dce9a870cedb649ae4. +Synthetic-only screenshot: /private/tmp/sb119-live-ui-xCLW6x/workflow.png; +SHA256 6041a6fcc53c377bb3da3dcfb917b2a35887a3304a8239f2ad8cc415e56d0e9b. +Verified binary SHA256: +d618260018460f070937632286819392d0949a77dcd09155c93683c161c37143. + +Initial failures retained in .wingbox logs: checked SQL timestamp conversions; +private-directory test setup; historical migration fixture setup; empty-plan legacy +error precedence; expected MCP schema expansion; and large Reply enum size. Fixes +preserve assertions and compatibility. The schema snapshot changed only the intended +update_issue payload. Boxing the playbook fixed enum size without a lint suppression. + +## Graph and test reach + +Before edits, Wingbox impact queried workflow, IssueStore, projections, adapters, +phone allowlists, protocol and frontend owners. New files used their existing owner +boundary. Saved raw maps: delivery-impact-before.json, delivery-impact-extra-before.json, +delivery-dispatch-impact-before.json, delivery-adapters-before.json, +delivery-workflow-test-before.json, delivery-phone-tests-before.json, +delivery-schema-impact-before.json, store-delivery-impact-before.json, +store-delivery-tests-impact-before.json and store-delivery-projections-impact-before.json +under .wingbox. These accompany the local handoff, not the product. + +| Changed owner/files | Named dependents | Verification | +| --- | --- | --- | +| workflow.rs, delivery.rs, delivery/operations.rs, delivery/validation.rs | store, release, working, board, fields, rows, view, daemon, protocol | pure delivery tests, workflow tests, issues suite, workflow service test | +| issues/store.rs, store_delivery.rs | assignment, release, working, daemon and store/workflow tests | delivery_store_tests, issues suite, real restart test | +| issues/board.rs, release.rs, working.rs, view.rs | daemon issue lists, release and working projections | issues suite and mixed-version store cases | +| protocol.rs, mcp/issues.rs, daemon.rs, daemon/issues.rs, daemon/delivery.rs | MCP, control/admin dispatch, phone boundary | schema snapshot, allowlist tests, real service targeted handoff and refusal checks | +| admin.rs, admin/admin.js, admin/workflow.js, admin/index.html, admin/admin.css | admin page; workflow helper tests | Bun tests, syntax checks, real CDP flow | +| lib.rs | library consumers and integration tests | Cargo checks and workflow integration | + +Final commands: WINGBOX_JOBS=1 wingbox build .; wingbox diff_functions 593056e; +wingbox usages src/delivery/operations.rs::apply; +wingbox analyze src/issues/delivery_store_tests. Additional saved usages/analyze outputs +cover domain, store, service and UI tests. Queries used WINGBOX_AUTO_REFRESH=0. +The graph shows apply called by actual domain tests and store, and test modules import +production owners. It does not prove every dynamic JSON dispatch or DOM edge; real +service/browser checks supplement that limitation. HTML/CSS are not indexed. During +stale-graph intervals, named source reads and literal searches confirmed the answers. +No claim of complete static per-function coverage is made. + +MCP issue group: five existing tools retained; distinct jobs, consistent naming and +3-15 count each satisfied. Lifecycle retains show/update/move operations; recovery is +admin-only. No new broad tool or broadcast route. Full server tool inventory was not +re-audited. + +Modern Web Guidance informed explicit Save and labeled native forms: "DON'T trigger +validation errors ... on every keystroke." Existing page stack retained. + +## Limits + +Local source and isolated runtime verified. No installed daemon replacement, native +authenticated Codex turn, release publication or production migration performed. +Other Codex runtime issues were prioritized to root, not claimed fixed here. Existing +empty-plan workflow remapping is preserved; configured plans require explicit adoption. +Uncertain or dispatching handoffs never automatically resend across generations. diff --git a/docs/design/119-wire-contract.md b/docs/design/119-wire-contract.md new file mode 100644 index 0000000..c849d49 --- /dev/null +++ b/docs/design/119-wire-contract.md @@ -0,0 +1,226 @@ +Issue #119 wire and lifecycle contract +===================================== + +REQ-059. Implemented wire and lifecycle contract for issue #119 / release #121. + +Existing workflow JSON +---------------------- + +Add `delivery` (default `[]`) to `Workflow` alongside states/transitions. Each +step is `{id,label,state,roles,depends_on,required,independent_of_owner,assignee}`. +Steps belong only to open, non-release, non-final states, so a required check +can run before release entry. Ids use the existing StateId syntax. Defaults: roles/dependencies empty, +required true, independent_of_owner false. A step is execution within its +state; dependencies must be within the same state. Across-stage ordering is +already expressed by FSM transitions. This keeps readiness acyclic without +inventing an ordering for a cyclic FSM. Limits: 100 steps, 100 dependencies +per step, labels 1..100 characters, roles use current workflow role limits. + +Default selection is the existing default_workflow. Saving a project's +workflow through user_save_workflow creates/updates its override. A page +"Use default" action saves the current built-in definition explicitly using +the existing optimistic workflow version and removed-state mapping. It does +not edit any other project or invalidate an issue's existing evidence. + +Issue tools +----------- + +`show_issue(number)` adds `playbook` with: +- version (monotonic integer), configuration_version and configuration; +- generation and source_revision (null before work is bound to a revision); +- steps (id, execution, approval_hold) and events. +The issue view also carries ready_steps, handoffs and export_warning alongside +playbook. Empty optional view fields are omitted; an export warning gives a +recovery instruction and never changes the committed result. +The current issue.state is shown once on the existing issue view, not copied +as a second authoritative field of the stored playbook. + +`update_issue(number, playbook, note)` is mutually exclusive with ordinary +field edits. `playbook` is a tagged operation with `action` and +`expected_version`: +- set_revision: revision (1..200 printable characters); owner or admin user; +- start: step, generation, configuration_version, source_revision, + target_session_id; caller must be exactly that currently assigned native + session, with matching pinned generation/configuration/source, configured + role/independence and existing transactional holding/WIP checks. Refreshing + aggregate CAS does not make an old generation claim valid; +- complete: step, attempt_version, source_revision, result (pass/not_pass), + evidence (1..4000 characters); + only the caller that started this attempt or admin user; +- block: step, kind (product/environment/approval/scheduling/release_order), + reason (1..4000); assigned running caller or eligible caller of a ready step; +- retry: step, reason; eligible caller, only failed or non-approval blocked; + running attempts require admin recovery; records a new pending attempt. +Every operation requires note (1..4000), a current version, and a known issue. +The daemon derives project, live caller, roles and timestamp. Payloads cannot +set those. No new MCP tool; the existing update_issue schema gains one optional +object. Unknown properties and incomplete operation variants refuse. + +Admin-only issue operations +--------------------------- + +`user_update_playbook(project,number,operation,note)` uses the authenticated +admin path and the same CAS/reducer. In addition to the above: +- release_hold: step, expected_version; preserves evidence/attempt history; +- adopt: expected_version, configuration_version; adopts the current selected + project configuration only if its version matches, resets execution and + retains holds; removing a held step refuses; +- interrupt: step, expected_version, reason; marks a running attempt blocked + for scheduling without sending signals or stopping any native process. +No session, phone, LAN or control-socket path invokes these as the user. + +Atomicity and attempts +---------------------- + +Configuration, execution and events are one playbook aggregate in issues.db. +Every accepted operation increments its version once and appends one event. +Rejected/stale operations append nothing. Attempt identity is the start event's +version, owned by the derived caller. Complete requires both aggregate +expected_version and the exact running attempt_version and source_revision. +Refreshing aggregate CAS never authorizes an older attempt result: even the +same actor cannot complete replacement attempt B with attempt A's token. +Running block and admin interrupt also require the running attempt_version; +a ready-step block has no attempt token and refuses when the step is running. +Independent parallel steps may refresh the playbook version after a conflict; +they never silently replay a completion. + +Evidence invalidation never removes an approval_hold. Starting or completing a +held step refuses regardless of source/configuration version. Required skipped +steps do not satisfy gates; only an admin may skip an optional step with reason. +The backend stores events append-only and never executes a configured command. +An admin-only skip operation takes step, expected_version and reason; required +or approval-held steps cannot be skipped. start/complete/block/retry need a +bound revision. set_revision refuses empty or unchanged revisions. Only admin +can interrupt running work; roles alone cannot take over another attempt. + +Lifecycle and adoption +---------------------- + +An issue's playbook snapshots the workflow/configuration version. New issues +snapshot the selected project configuration. Existing issues are initialized +from their project's configuration by the migration path without fabricating +historical execution/PASS. An explicit admin adoption changes the snapshot; +ordinary workflow saves do not rewrite configured delivery snapshots or evidence. +For legacy workflows with an empty delivery plan, existing workflow-save/remap +behavior remains; there is no step evidence to reinterpret. Configured plans +remain pinned and incompatible state remaps refuse until explicit adoption. A configured playbook refuses a project save that maps away its current state. +Move it to a shared state and explicitly adopt the selected configuration first. +Empty legacy plans retain the existing project-save/remap behavior. Project +saves use the existing workflow-version CAS; explicit adoption additionally +uses the playbook version and selected configuration version. Adoption refuses +running attempts, a missing current state, or removing a held step; it preserves +other holds and invalidates execution evidence. No issue_versions field or +implicit fleet adoption is introduced. +The same workflow pure functions validate the snapshot and its moves: no second +FSM engine is introduced. Board/detail views expose the issue's pinned version +and allowed moves; project config shows the current default/override. + +A workflow containing required delivery steps must define a release state; +otherwise validation refuses. Empty and optional-only plans retain existing +no-release workflow compatibility. +Validation rejects paths from start to release that avoid a required step's +state (reachability with that state removed). An acceptance move requires its +current stage's required steps passed. +A move is a rejection only when its declared guard requires not_pass; a +cancellation is a declared reason-guarded move to a non-release final state. +Providing not_pass to an arbitrary transition does not bypass step checks. +Entering a stage resets that stage's execution records for a fresh visit, +preserving holds and prior events. A source revision change invalidates all +execution records. A common predicate checks all required steps across the pinned plan on any +entry to release, not just the last stage. Existing role/WIP/release guards +remain. Publication checks only linked issues it advances; cancelled issues +remain excluded. Close is never recorded as PASS. Direct ordinary release +moves use the same predicate. + +Every bulk move, publication and active-owner/WIP check resolves each issue +against its own pinned workflow inside the same transaction. Open-state, +release participation, move guards and active work cannot be classified using +the latest project workflow or another issue's snapshot. All affected issues +are validated before any writes; one refusal rolls back the entire operation. +Project-level WIP capacity uses the selected project configuration while +occupancy includes each issue whose own snapshot classifies it as active. + +Mixed-version release issues must agree on the release-state id before a +release card can publish. Otherwise publication refuses naming the issues and +requires explicit adoption; it never silently maps them or discards history. + +Initialization and schema compatibility +--------------------------------------- + +The existing migration mechanism adds playbooks and append-only event tables. +Missing playbooks are initialized in one transaction before the store opens. +The initialization event names the system/migration, not a historical actor, +and records no completed work. Normal issue creation writes its snapshot in +the same transaction. A missing row after migration is an integrity error, +not an empty-plan fallback. Release cards keep their existing release FSM; +their linked issues own delivery playbooks. + +Existing tool arguments remain valid. Omitting playbook performs an ordinary +update. Combining playbook with other field edits refuses. Expected playbook +version is mandatory, separate from the issue history version. A successful +operation increments both once. Admin operations use the same reducer and +transaction; privilege comes from the authenticated page, never a payload flag. + +Targeted pipeline handoffs +-------------------------- + +The user's additional requirement is direct peer-to-peer messaging only to the +target agent, following the delivery chain. This applies to pipeline-generated +work messages; it does not remove the user's existing general channel UI. + +Each delivery step declares assignee: owner, reviewer or qa_owner. This resolves +through the issue's local assignments to exactly one live parent session whose +role satisfies the step. Resolution captures its exact session_id, never merely +a display name. An absent/ambiguous/ended/wrong-role target produces a visible +routing blocker, never a broadcast, root fallback or automatic new session. +The property panel edits this assignment and shows its resolved recipient. + +On completion, an accepted stage move or authenticated admin recovery, ready steps produce durable +handoff intents in the same transaction as the playbook event. Each intent +names issue, step, configuration version, source revision, stage/attempt +generation, sender session id and exact target session id. A step becoming ready +again in the same generation produces no duplicate. The sender is the actual +session responsible for the accepted event. Authenticated admin actions retain a +user-origin marker and use the existing direct UserSend path, which derives the +real bridge user identity; they never impersonate an agent sender. +Same-agent successors remain ready locally; no self-message is sent. + +A daemon adapter drains pending intents after commit and on restart, using the +existing direct Send/UserSend paths and durable message store. A peer sender may +have exited: its registered local parent identity and project are checked against +the persisted bridge registry. Only the assigned destination must remain live. It rechecks the pinned +source/configuration/generation, readiness and exact target assignment before +sending. Stale intents become superseded; they are not redirected to a new +agent. Explicit assignment changes can create a new intent for the new target +only while the old intent is definitely unsent. A dispatched/uncertain intent +requires inspection before any manual replacement, retaining history. Uncertain +or dispatching intents suppress automatic replacement across generations too; +ready work can still be claimed explicitly after reading the current issue. + +Before crossing into Send, persist dispatching. Persist the returned receipt +and message id when known. A crash or lost reply in dispatching becomes +uncertain, never an automatic retry. Pending intents are retryable only before +that boundary. No channel routing, mentions expansion, team fanout or paired +project discovery is used. Each actual send has exactly one recipient. Unresolved intents are +reconciled during the regular drain when the live roster changes. Resolution checks +the original generation, configuration, source and current step readiness, retains +the original sender, and resolves only that step's current exact assignee. Stale +intents become superseded. Reconciliation changes routing state only and preserves +cross-generation dispatching/uncertain suppression and single-send deduplication. + +The message carries a compact structured handoff plus evidence references and +states that it is a pipeline notification, not additional user approval. The recipient reads the current +playbook and claims the matching ready step with CAS. Stale configuration/source +or generation cannot start work. Queued, delivered and step completion remain +separate states; a transport receipt never passes a check or moves an issue. +Unrelated ready branches retain their own addressed intents; failure of one +branch or recipient cannot block another independent branch. + +Execution policy +---------------- + +The user explicitly removed procedural blocking rules: design review and PM +slot grants are not permissions required before implementation. Resolve review +findings through implementation and verification. Failed checks block only +work that depends on their result; retain truthful aggregate outcomes. Native +approval holds, exact recipient checks and uncertain-send handling remain. diff --git a/docs/requirements.md b/docs/requirements.md index 2220b24..9bfabf4 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -41,7 +41,7 @@ - REQ-027: A bridge outside the local network is reached through SSH, not a public port: on the remote host the bridge runs with `network on --local-only` (listens on 127.0.0.1, no announcement); `session-bridge remote add [--port ]` (or the Peers tab) makes this bridge keep one `ssh -N` connection to that host with the user's own SSH configuration, keys or agent (BatchMode, no prompts), forwarding a local port to the remote bridge and a port on the remote's loopback back to this one, and reconnecting when it drops. `pair ` pairs through the tunnel with the remote's one-time code; afterwards both directions use the pinned Noise channel inside SSH. Remote hosts are listed with their tunnel state and removed with `remote remove`. -- REQ-028: The user starts a Claude or Codex session with a role (admin page channel, `session-bridge spawn`): it is named `{short}-{role}-{n}` (short project name set per project in `spawn.json`, default the folder name; lowest free n among live and starting sessions), starts in the project's directory with the role's instructions as its first prompt and the role assigned, and keeps the native approval checks, unless the user chose other approvals for sessions they start themselves (REQ-034); a session an agent starts always asks. A spawn service per system opens it: iTerm2 (a new tab in its front window; the default when it is installed and the user chose no terminal) or Terminal (macOS), `cmd` (Windows), tmux, screen or a detached `script` (Linux); the window runs only `session-bridge launch `, which claims its directory, name and prompt from the bridge and becomes the agent, so no user text enters a shell or AppleScript command. Codex sessions get their name through the launched process id (kept by session id in `names.json`). The user closes a local session (its process gets SIGTERM; a process that carries several sessions or a Codex app server is refused). The built-in role `root` cannot be renamed or deleted; root's authority belongs to the session the user gave it (by session id) or the session started as root (bound through its launch: only the launch process itself may claim it: the connecting process by the control socket's peer credentials, running exactly ` launch []` (not checked on Windows, which gives no peer process); the launched process itself takes the name whenever it appears, a session under it only within 2 minutes of the claim), not to whichever session has the name, and only a session that really holds root is protected from root's close; a session holding it may, through MCP, start sessions with any other role in its own project (its directory; below 16 live sessions) and close non-root sessions there; no session can start or close a root session. The admin page acts only as the user. The kickoff template fills a request for issue status and queued work in a direct conversation. +- REQ-028: The user starts a Claude or Codex session with a role (admin page channel, `session-bridge spawn`): it is named `{short}-{role}-{n}` (short project name set per project in `spawn.json`, default the folder name; lowest free n among live and starting sessions), starts in the project's directory with the role's instructions as its first prompt and the role assigned, and keeps the native approval checks, unless the user chose other approvals for sessions they start themselves (REQ-034); a session an agent starts always asks. A spawn service per system opens it: iTerm2 (a new tab in its front window; the default when it is installed and the user chose no terminal) or Terminal (macOS), `cmd` (Windows), tmux, screen or a detached `script` (Linux); the window runs only `session-bridge launch `, which claims its directory, name and prompt from the bridge and becomes the agent, so no user text enters a shell or AppleScript command. A Codex session on the Codex app server (REQ-041) gets its thread from the bridge at the launch's claim: the bridge starts the thread on the app server, names it with the session's name (which also writes it to disk), binds the thread to the name at once (`names.json`, by session id) and has the launch resume that thread with the first prompt (`codex resume --remote unix:// ... `); a start whose thread cannot be created fails with the reason in its window, binds nothing and frees its name, and a name bound at a claim stays taken until its session is listed. Other Codex sessions get their name through the launched process id (kept by session id in `names.json`). A started session is listed under the name its start returned and acts in its role, root included, from its first bridge request, with no second assignment. The user closes a local session (its process gets SIGTERM; a process that carries several sessions or a Codex app server is refused, and so is a session that holds root, REQ-057). For a Codex session the bridge started on the app server the process is its own terminal client, never the app server: the client's process id is kept with its launch record and is signalled only while its command line is that session's `codex resume ... `; a running turn is stopped first, and the closed session leaves the list at once and stays off it until its thread is no longer discovered; when its client is not known or no longer runs, the close is refused as for an app server. The built-in role `root` cannot be renamed or deleted; root's authority belongs to the session the user gave it (by session id) or the session started as root (bound through its launch: only the launch process itself may claim it: the connecting process by the control socket's peer credentials, running exactly ` launch []` (not checked on Windows, which gives no peer process); the launched process itself takes the name whenever it appears, a session under it only within 2 minutes of the claim), not to whichever session has the name, and only a session that really holds root is protected from a close and a restart (REQ-057); a session holding it may, through MCP, start sessions with any other role in its own project (its directory; below 16 live sessions) and close non-root sessions there; no session can start a root session, and nothing closes or restarts a session that holds root (REQ-057). The admin page acts only as the user. The kickoff template fills a request for issue status and queued work in a direct conversation. - REQ-029: The admin page's Peers tab (and nowhere else on the page) shows usage, refreshed about every 5 seconds while it is visible: for this laptop and each paired bridge, CPU %, memory used and total, and disk used and total of the filesystem that holds the user's home; for each live session on this laptop, the CPU % and memory of its process tree (the process and its descendants). A process that carries several sessions (a shared Codex app server, `codex --remote`) is shown as shared with its own numbers only, never summed or split per session. Sizes are binary units named as such (GiB). Usage polls read the last discovered sessions and never run discovery; a local sample serves every reader for 2 seconds, and a paired bridge's answer for 30 seconds, with longer waits (up to 5 minutes) after failures. A peer's usage request that fails gets a fixed text; the detail stays in the local log. A bridge asks each paired bridge for its usage over the paired channel; a bridge that does not answer, or an older one that does not know the request, is shown as "usage unavailable", never as an error. @@ -65,7 +65,7 @@ - REQ-039: The installed bridge keeps its config and message history in `~/.session-bridge` (owner-only), and its runtime files (control socket, lock, logs, update and install backups) in `~/.local/state/session-bridge`; a bridge with `SESSION_BRIDGE_STATE` keeps everything in that folder (REQ-021). Config stays as JSON files (written atomically). The message history is `history.jsonl`: each save appends the message's whole state as one line and syncs it (and the folder when the save creates the file). On start the last line of each message is its state. Only the last line may be damaged: NUL bytes a power loss left at its end are dropped; when nothing remains, or JSON that ends early (cut short by a crash), it is skipped and the start cuts it off before any save; a whole last line without its newline is kept and ended. A save that fails is cut off through a handle opened for writing; when that cut fails, the bridge refuses further saves until it restarts. Any other line that cannot be read fails the start with `history.jsonl line N: `, so no message falls back to an older state and is resent. On start, under the daemon lock and before any save, a history with more than twice as many lines as messages is rewritten with each message's latest state in first-seen order (`history.jsonl.tmp`, owner-only, synced, renamed, folder synced). On the first start, when `~/.session-bridge` does not exist, the bridge copies an allowlist of config files and folders from the old folder and starts an empty history (the user's choice): no message is carried over, not even one still in flight, runtime files are not copied, links are not followed, and the old folder is not changed. The copy is built beside the data folder, every copied file and folder synced, and renamed into place (the parent synced), so an interrupted copy is made again on the next start. A bridge whose data folder is its state folder (`SESSION_BRIDGE_STATE`, a launch state) also starts an empty history beside an old `messages/` folder and leaves `messages/` as it is. Going back to an older release reads the old folder again, which may send the messages still waiting there. - REQ-040: The user stars projects on the admin page's Projects tab (`ProjectStar`, admin page only; a paired phone sees which projects are starred but cannot star). A star names a project by its absolute folder and is kept in the data folder as `stars.json` (a JSON list of absolute folders, written atomically), also for a folder that is not listed; a relative folder, or one with `..` parts, is refused, and a star keeps one spelling of its folder (no repeated or trailing separators, no `.` parts). The Projects tab lists starred projects first, then projects with live sessions, then by project name, then by folder. -- REQ-041: The admin page's Run tab has a Codex choice "Run on my Codex app server (--remote unix://)", kept in `spawn.json` as `codex.remote` and on by default, also for settings saved before it existed or saved without it. A Codex session the user starts gets `--remote unix://` only when the choice is on and the user's Codex app server is there (its control socket exists); otherwise it runs plain `codex`. Sessions an agent starts are unaffected: they get `--remote unix://` whenever the app server is there. The Run tab's replies carry `app_server` (whether the app server is there) next to the preview, and the preview follows the same rule. Importing the zsh aliases turns the choice on when the `codex` alias has `--remote` and otherwise leaves it as it is; `--remote` never becomes an extra flag and stays refused as one. +- REQ-041: The admin page's Run tab has a Codex choice "Run on my Codex app server (--remote unix://)", kept in `spawn.json` as `codex.remote` and on by default, also for settings saved before it existed or saved without it. A Codex session the user starts gets `--remote unix://` only when the choice is on and the user's Codex app server is there (its control socket exists); otherwise it runs plain `codex`. Sessions an agent starts are unaffected: they get `--remote unix://` whenever the app server is there. A Codex session that gets `--remote unix://` resumes a thread the bridge created for it at the claim (REQ-028); the bridge creates that thread with the directory, model and effort only, never an approval or sandbox setting, so approvals stay with the client's own flags (REQ-034), and the Run tab's preview keeps showing the flags, not the resume form. The Run tab's replies carry `app_server` (whether the app server is there) next to the preview, and the preview follows the same rule. Importing the zsh aliases turns the choice on when the `codex` alias has `--remote` and otherwise leaves it as it is; `--remote` never becomes an extra flag and stays refused as one. - REQ-042: A live session waiting for its user (a permission prompt, a question, a plan approval or an input request in Claude; an approval or an input request in Codex) carries `waiting_for` in the session list (`list_sessions`, the admin page, the phone, a paired laptop's sessions): a short label of what it waits for, absent when it does not wait or the bridge cannot tell. Whitespace (tabs and line breaks too) becomes a space, other control and format characters are removed, each run of spaces then becomes one space, and the label is trimmed, cut to 40 characters (not bytes, no ellipsis) and trimmed again; it is absent when empty, is applied again to a paired laptop's labels, and is shown as text only. Claude: the `waitingFor` of the session's record (`~/.claude/sessions/.json`) when its `status` is `waiting`, read with each discovery. Codex: in the 30-second queue sweep, over one connection to the user's Codex app server (its control socket), the bridge lists the loaded threads (`thread/loaded/list`) and reads (`thread/read`) only the live local threads among them: a thread whose status is active with `waitingOnApproval` waits for "approval", otherwise with `waitingOnUserInput` for "your input"; a thread that is idle, not loaded, not answered or without an app server has no label. These calls only read: the bridge never loads, resumes or starts a thread for them (REQ-015). A send to a waiting local session answers with `recipient_waiting` (the label at send time, not saved with the message), and the `send_message` result adds " is waiting for its user (