본문으로 건너뛰기
cccskills
무료GitHub에 공개

gz-obpi-lock

Use to claim, release or list OBPI work locks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

gz-obpi-lock

Claim or release OBPI-level work locks for multi-agent coordination.

Common Rationalizations

These thoughts mean STOP — you are about to bypass coordination:

ThoughtReality
"No one else is working on this, I don't need to lock"You do not know what other agents are doing. The lock is coordination, not permission.
"I'll just do a quick fix, no need for a lock"Quick fixes that conflict with another agent's work create merge conflicts. Lock first, always.
"The lock expired, so I'll just re-claim it"An expired lock may mean another agent started work. Check status before re-claiming.
"I'll release the lock manually later"gz obpi complete surrenders it at Stage 5. Manual release outside the pipeline risks orphaned work.
"Lock conflicts slow me down"Merge conflict resolution after concurrent edits is far slower than waiting for a lock.

Red Flags

  • Multiple agents editing the same ADR's files without lock coordination
  • Lock file exists but agent proceeds without checking it
  • Pipeline completes but lock is never released (orphaned lock)
  • Agent force-releases another agent's lock without investigating
  • Work begins on an OBPI without any gz obpi lock claim in the session

Three subjects (operator ruling, verbatim canon)

Keep three subjects distinct: transit is ecosystem movement through the airlock (ADR-0.33.0); exchange is one block’s occupancy (ADR-0.0.41); handoff is session memory (ADR-0.0.65). Classify by the citing event type, never a shared field name or path. Token blocks implement features through the airlock’s Build door. The airlock provides awareness and synthetic memory, controls project movement, keeps the agent focused and watches for contamination, and monitors results/disturbance; it is not a verification gate. ADR-0.33.0 incompletely captures those purposes; silence does not revoke them. Transit supplies current ecosystem orientation and handoff carries the prior session model; they cooperate, and neither alone supplies a resident project model.

Carried verbatim from root AGENTS.md § Operator Doctrine on 2026-09-17 (GHI #921), and into this surface on 2026-09-24 (GHI #1091, sweep findings S07/S08), where transit, exchange and lock work happens. The corpus .gzkit/corpus/AGENTS.md.jsonl keeps the ruling's history.

When to Use

  • Before starting work on an OBPI (claim it)
  • After completing or abandoning OBPI work (release it)
  • To check which OBPIs are currently claimed by agents

Invocation

/gz-obpi-lock claim OBPI-0.0.25-03
/gz-obpi-lock release OBPI-0.0.25-03
/gz-obpi-lock status                    # show all locks
/gz-obpi-lock status ADR-0.0.25        # show locks for one ADR

Lock Mechanism

File-based locks in .gzkit/locks/ (gitignored — local coordination only).

Lock File Format

Path: .gzkit/locks/obpi/{OBPI-ID}.lock.json

{
  "obpi_id": "OBPI-0.0.25-03",
  "agent": "claude-code",
  "pid": 12345,
  "session_id": "abc123",
  "claimed_at": "2026-02-14T12:00:00Z",
  "branch": "master",
  "ttl_minutes": 120
}

Lock Rules

  1. Claim succeeds if no lock file exists or existing lock is expired (past TTL)
  2. Claim fails if lock exists and is not expired — show who holds it
  3. Release deletes the lock file once the surrender is accounted for: an exchange record that postdates the claim, or an --abandon category
  4. Stale lock detection — locks older than TTL are automatically released on next claim attempt
  5. Same-agent re-claim — if the claiming agent already holds the lock, refresh the timestamp
  6. Concurrent locks — Multiple OBPIs from the same ADR can be locked concurrently by different agents when their allowed paths are non-overlapping. One lock per OBPI at a time; each OBPI's human attestation is independent (universal per ADR-0.0.36).

Procedure

Claim

uv run gz obpi lock claim OBPI-X.Y.Z-NN
uv run gz obpi lock claim OBPI-X.Y.Z-NN --ttl 240
uv run gz obpi lock claim OBPI-X.Y.Z-NN --json

Exit code 0 = claimed, 1 = conflict (another agent holds it).

Release

uv run gz obpi lock release OBPI-X.Y.Z-NN
uv run gz obpi lock release OBPI-X.Y.Z-NN --json
uv run gz obpi lock release OBPI-X.Y.Z-NN --abandon <category>:<reason>   # abort — surrender with a recorded category
uv run gz obpi lock release OBPI-X.Y.Z-NN --force   # waives the ownership check only

Exit code 0 = released (or no lock found), 1 = ownership error (without --force) or an invalid --abandon spec, 3 = refused: no exchange record postdates the claim and no --abandon was given.

A held lock is released only against a register entry (.gzkit/rules/token-block-discipline.md § Sub-Invariant 5). gz obpi complete writes that entry and surrenders the lock itself. Before completion the route is --abandon, whose categories are a closed enum listed in docs/user/manpages/obpi-lock-release.md. --force does not bypass the register entry, and a session handoff is not one (GHI #1167).

Check (single OBPI)

uv run gz obpi lock check OBPI-X.Y.Z-NN
uv run gz obpi lock check OBPI-X.Y.Z-NN --json

Exit code 0 = held (prints holder info), 1 = free.

List (all locks)

uv run gz obpi lock list
uv run gz obpi lock list --adr ADR-X.Y.Z
uv run gz obpi lock list --json

Agent Identity

Agents identify themselves by environment:

SignalAgent
CLAUDE_CODE env var or Claude Code runtimeclaude-code
CODEX_SANDBOX env varcodex
VS Code Copilot contextcopilot
Fallbackunknown-{PID}

Integration with Pipeline

The pipeline calls uv run gz obpi lock claim at Stage 1 (Load Context). At Stage 5 uv run gz obpi complete writes the completion exchange record and surrenders the lock; no separate release runs. On an abort the pipeline surrenders with uv run gz obpi lock release {OBPI-SLUG} --abandon <category>:<reason>; when no category describes the abort the lock stays held, is named in the handoff, and is reaped at its TTL.


Conflict Detection

Shared File Registry

Files known to cause multi-agent conflicts:

File PatternConflict TypeMitigation
docs/governance/GovZero/adr-status.mdDerived ADR status indexNever hand-edit; regenerate via uv run gz register-adrs
**/logs/obpi-audit.jsonlAppend-only ledgerJSONL merge driver (see below)
docs/design/adr/**/*.md (status field)Brief statusLock prevents concurrent edits
.gzkit/insights/agent-insights.jsonlAppend-only logJSONL merge driver

JSONL Merge Strategy

For append-only JSONL files, conflicts are resolvable by union merge:

  1. Parse both sides as line arrays
  2. Union (deduplicate by timestamp + content hash)
  3. Sort by timestamp ascending
  4. Write merged result

Add to .gitattributes:

*.jsonl merge=union

The merge=union strategy keeps lines from both sides, which is correct for append-only ledgers.

Pre-Push Conflict Check

Before pushing, agents should verify no divergence on shared files:

# Check if shared governance files have diverged from remote
git fetch origin
git diff --name-only origin/main..HEAD | grep -E '(adr_status|obpi-audit\.jsonl|agent-insights\.jsonl)'

If shared files appear in the diff, the agent should:

  1. Pull and rebase
  2. Regenerate computed files (/gz-adr-sync, /gz-obpi-sync)
  3. Re-push

Worktree Isolation (Advanced)

For heavy parallel workloads, a subagent may work in an ephemeral local git worktree that is never pushed. Its result lands on main through the single writer, never by merging a branch (AGENTS.md § Operator Doctrine):

# Detached worktree at HEAD; no branch is created
git worktree add --detach ../gzkit-claude-code HEAD

# In the worktree: stage the work and write it out as a patch
git -C ../gzkit-claude-code add -A
git -C ../gzkit-claude-code diff --cached --binary HEAD > ../gzkit-claude-code.patch

# On main, the single writer applies the patch and commits through the hooks
git apply ../gzkit-claude-code.patch
git worktree remove --force ../gzkit-claude-code

When to use worktrees:

  • 2+ agents working on the same ADR simultaneously
  • OBPIs with overlapping file paths
  • Long-running implementation sessions (>2 hours)

When NOT to use worktrees:

  • Single agent sessions (unnecessary overhead)
  • Quick fixes or single-OBPI work
  • OBPIs with non-overlapping paths

Related

  • Pipeline integration: gz obpi lock claim (Stage 1), gz obpi complete (Stage 5 surrender)
  • Session handoff: /gz-session-handoff (session memory; it names a held lock and never releases one)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use to mine ../airlineops for governance habits gzkit lacks; produces a parity scan report (gzkit leads, AirlineOps adopts).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 23일 업데이트

Use to file a GitHub issue when a finding needs its own work order or the operator asks; OBPI corrections stay in its change log.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 23일 업데이트

ghi-close

무료

Use to do the work a GHI describes, verify it and close the issue with evidence in one sweep.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 23일 업데이트

Use to triage the open GHI queue before planning or choosing what to pull; produces a ranked deliverable.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 23일 업데이트

git-sync

무료

Run the guarded repository sync ritual; the hooks your pre-commit config declares enforce the quality gates.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 23일 업데이트

git-sync

무료

Run the guarded repository sync ritual; commit-time hooks enforce the cheap gates and the pre-push hook runs gz check.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 23일 업데이트

tvproductions의 스킬 모두 보기

이 스킬의 문제 신고