feat: stack lock protocol for singleton project stack access #255

Closed
opened 2026-04-05 19:29:05 +00:00 by dev-bot · 3 comments
Collaborator

What

Define a file-based lock protocol so that CI pipelines and the reproduce-agent can share a single project stack (e.g. harb docker compose) without stepping on each other.

Why

The harb stack is expensive to run and should be a singleton. When CI needs a fresh stack for tests and the reproduce-agent needs one for bug reproduction, they must coordinate: wait for the current holder to finish, then tear down and start fresh.

Design

Lock file: /home/agent/data/locks/<project>-stack.lock

Contents:

{"holder": "reproduce-agent-42", "since": "2026-04-05T18:00:00Z", "heartbeat": "2026-04-05T18:05:00Z"}

Protocol:

  1. Before touching the stack, check if lock file exists
  2. If locked and heartbeat < 10 minutes old: wait and retry (poll every 30s)
  3. If locked but heartbeat stale (>10min): break the lock (holder crashed)
  4. Acquire: write lock file with holder ID + timestamp
  5. Update heartbeat every 2 minutes while holding
  6. Release: delete lock file when done

Consumers:

  • Woodpecker CI pipeline (before running integration tests)
  • Reproduce-agent (before starting fresh stack for bug reproduction)

Implementation:

  • lib/stack-lock.sh with functions: stack_lock_acquire, stack_lock_release, stack_lock_check
  • Shared volume between edge container and CI agent

Files

  • New: lib/stack-lock.sh
  • Consumers: Woodpecker pipeline config, future reproduce-agent
## What Define a file-based lock protocol so that CI pipelines and the reproduce-agent can share a single project stack (e.g. harb docker compose) without stepping on each other. ## Why The harb stack is expensive to run and should be a singleton. When CI needs a fresh stack for tests and the reproduce-agent needs one for bug reproduction, they must coordinate: wait for the current holder to finish, then tear down and start fresh. ## Design **Lock file**: `/home/agent/data/locks/<project>-stack.lock` Contents: ```json {"holder": "reproduce-agent-42", "since": "2026-04-05T18:00:00Z", "heartbeat": "2026-04-05T18:05:00Z"} ``` **Protocol**: 1. Before touching the stack, check if lock file exists 2. If locked and heartbeat < 10 minutes old: wait and retry (poll every 30s) 3. If locked but heartbeat stale (>10min): break the lock (holder crashed) 4. Acquire: write lock file with holder ID + timestamp 5. Update heartbeat every 2 minutes while holding 6. Release: delete lock file when done **Consumers**: - Woodpecker CI pipeline (before running integration tests) - Reproduce-agent (before starting fresh stack for bug reproduction) **Implementation**: - `lib/stack-lock.sh` with functions: `stack_lock_acquire`, `stack_lock_release`, `stack_lock_check` - Shared volume between edge container and CI agent ## Files - New: `lib/stack-lock.sh` - Consumers: Woodpecker pipeline config, future reproduce-agent
dev-bot added the
backlog
label 2026-04-05 19:29:05 +00:00
dev-bot self-assigned this 2026-04-05 20:39:02 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-05 20:39:02 +00:00
Author
Collaborator

Blocked — issue #255

Field Value
Exit reason no_push
Timestamp 2026-04-05T20:49:05Z
Diagnostic output
Claude did not push branch fix/issue-255
### Blocked — issue #255 | Field | Value | |---|---| | Exit reason | `no_push` | | Timestamp | `2026-04-05T20:49:05Z` | <details><summary>Diagnostic output</summary> ``` Claude did not push branch fix/issue-255 ``` </details>
dev-bot added
blocked
and removed
in-progress
labels 2026-04-05 20:49:05 +00:00
dev-bot removed their assignment 2026-04-05 20:49:36 +00:00
Author
Collaborator

Blocked — issue #255

Field Value
Exit reason closed_externally
Timestamp 2026-04-05T21:12:37Z
### Blocked — issue #255 | Field | Value | |---|---| | Exit reason | `closed_externally` | | Timestamp | `2026-04-05T21:12:37Z` |
dev-bot added
backlog
and removed
blocked
labels 2026-04-06 06:27:27 +00:00
dev-bot self-assigned this 2026-04-06 06:29:04 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-06 06:29:04 +00:00
Author
Collaborator

Blocked — issue #255

Field Value
Exit reason no_push
Timestamp 2026-04-06T06:29:09Z
Diagnostic output
Claude did not push branch fix/issue-255
### Blocked — issue #255 | Field | Value | |---|---| | Exit reason | `no_push` | | Timestamp | `2026-04-06T06:29:09Z` | <details><summary>Diagnostic output</summary> ``` Claude did not push branch fix/issue-255 ``` </details>
dev-bot added
blocked
and removed
in-progress
labels 2026-04-06 06:29:09 +00:00
dev-bot added the
in-progress
label 2026-04-06 07:04:03 +00:00
dev-bot was unassigned by dev-qwen 2026-04-06 07:13:49 +00:00
dev-qwen removed the
in-progress
label 2026-04-06 07:13:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#255
No description provided.