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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ User-facing changes to session-bridge. Newest first. Each version lists

### Changes

- 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 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.
Expand Down
247 changes: 247 additions & 0 deletions LOG.md

Large diffs are not rendered by default.

58 changes: 43 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,32 +497,35 @@ they run. Only the admin page restarts sessions.

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
Expand All @@ -534,7 +537,7 @@ board list the moves an issue can make (`moves`, with what each needs), and

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

Expand All @@ -554,6 +557,31 @@ 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-<uuid>.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
`<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
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@
- REQ-054: The admin page's Issues and Requirements tabs are consistent and cross-referenced. Consistent: both use the same view switcher (Board and List; the Requirements tree is a mode of List), one filter bar (search, issue, requirement, release, state or lane, owner, status and level, each only where it applies), the same card, row and detail panel design, and keep the view and filters in the page URL's hash in one format, so a view reloads, can be shared, and back and forward step through views. Cross-referenced: every issue number on the Requirements tab and every requirement id on the Issues tab opens the other tab with that item's detail open; Back returns to the previous tab's view, filters, scroll and selection; each detail lists the linked items of the other kind with their state or lane. A link to a filtered-out item opens its detail without changing filters; following links changes no data; all text, including the hash, is shown as text only. Built as one shared view module with REQ-043 A-1 and REQ-044 A-1 (A-2 is #23); the release filter waits for REQ-052's page (#31). Out of scope: the phone, other tabs, saved views. Detail, with AC-1..AC-8: [views-requirements.md](views-requirements.md).

- REQ-059: Declarative project delivery workflows use the current workflow as default and allow project overrides through an editable SVG block diagram. Issues pin versioned playbooks in IssueStore with source-bound execution, retained approval holds, transactional audit events and readable derived project-home exports. Exact assigned agents claim a generation and complete an exact attempt; durable handoffs follow the configured chain peer-to-peer, without broadcasts or automatic uncertain-send retries. Failed checks block only their dependent work. User-authorized implementation does not wait for procedural review-round or PM permission gates. Details: [delivery contract](design/119-wire-contract.md).
- REQ-060: Default declarative teamwork pipeline: PM prioritizes and assigns defined issues; defined is clarified by clarify, in-progress and fix executed by developer, review by reviewer, qa by qa, and release by project-manager. Each issue exposes one current assigned field and a release field; release is required before work, with one active release and release filters. Preserve existing assignment/stage/evidence history through supported migrations. Existing Workflow/IssueStore is the sole authority; per-project user overrides remain supported. Provide /teamwork-configure so a user-directed agent edits project pipeline rules, runs an executable canonical validation script, previews and applies validated rules, with readback and rollback. Role instructions follow that declarative definition. Apply before next publication (0.8.0), retaining actual verification and in-flight evidence.
12 changes: 8 additions & 4 deletions src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ async fn call(State(page): State<Page>, headers: HeaderMap, body: Bytes) -> Resp
Ok(value) => value,
Err(e) => return (StatusCode::BAD_REQUEST, e.to_string()).into_response(),
};
let request: Request = match serde_json::from_value(value.clone()) {
let request: Request = match crate::phone::replay::decode_request(&value) {
Ok(request) => request,
Err(e) => return (StatusCode::BAD_REQUEST, e.to_string()).into_response(),
};
Expand Down Expand Up @@ -464,7 +464,11 @@ mod tests {
#[test]
fn finds_unknown_spawn_fields() {
let raw = serde_json::json!({"method": "spawn", "project": "/w", "role": "qa", "bogus": 1});
let request: Request = serde_json::from_value(raw.clone()).unwrap();
// REQ-060: strict request decoding rejects extras before dispatch.
assert!(serde_json::from_value::<Request>(raw.clone()).is_err());
let mut valid = raw.clone();
valid.as_object_mut().unwrap().remove("bogus");
let request: Request = serde_json::from_value(valid).unwrap();
assert_eq!(crate::protocol::unknown_fields(&raw, &request), ["bogus"]);
let raw = serde_json::json!({"method": "spawn", "project": "/w", "agent": "claude",
"role": "qa", "model": "opus", "effort": "max", "note": null});
Expand Down Expand Up @@ -641,14 +645,14 @@ mod tests {
}));
}

/* REQ-043: A-1: the page reads the Issues tab's List. */
/* REQ-060: the assigned Issues list retains admin-only page access. */
#[test]
fn allows_the_issue_list() {
assert!(allowed(&Request::IssueRows {
project: std::path::PathBuf::from("/w/shop"),
query: Some("cart".into()),
state: vec!["qa".into()],
owner: Some("-".into()),
assigned: Some("-".into()),
requirement: None,
release: None,
sort: None,
Expand Down
13 changes: 11 additions & 2 deletions src/daemon/delivery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ impl Control {
let issue = store
.get(handoff.number)
.map_err(|e| anyhow::anyhow!("{e}"))?;
let all = store.all().map_err(|e| anyhow::anyhow!("{e}"))?;
let active = crate::issues::release::active_release(&all);
if !active.is_ok_and(|card| issue.release.as_ref() == Some(&card.version)) {
return Ok(false);
}
let book = store
.playbook(handoff.number)
.map_err(|e| anyhow::anyhow!("{e}"))?;
Expand All @@ -138,6 +143,11 @@ impl Control {
&live,
folder,
);
if let Err(reason) = store.check_delivery_readiness(handoff.number, &context.actor)
{
eprintln!("Pipeline handoff {} remains pending: {reason}", handoff.id);
return Ok(false);
}
let definition = book
.configuration
.delivery
Expand All @@ -152,8 +162,7 @@ impl Control {
&& (step.roles.is_empty()
|| step.roles.iter().any(|r| roles.contains(r)))
&& (!step.independent_of_owner
|| context.owner_session.as_deref()
!= Some(handoff.target.as_str()))
|| issue.independent_reviewer(&handoff.target))
});
let state = if current { "dispatching" } else { "superseded" };
let changed = store
Expand Down
Loading