Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ 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.

## Changelog

Default: every change a user of the bridge can observe (a command, a tool, an
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ User-facing changes to session-bridge. Newest first. Each version lists

## Unreleased

### Changes

- 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.

### Fixes

- Starting a session on macOS no longer brings Terminal or iTerm2 to the
Expand Down
133 changes: 133 additions & 0 deletions LOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Working log

## 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 #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.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,36 @@ 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.

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, choose owner/reviewer/QA owner, 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.

Playbooks live in the project's `issues.db`. Readable derived exports are in
`<project-home>/issues/<number>/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
Expand Down
65 changes: 65 additions & 0 deletions docs/design/119-acceptance.md
Original file line number Diff line number Diff line change
@@ -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.
Loading
Loading