feat: control-plane DB substrate for atomic assign/lease (Closes #613) #619

Merged
sysadmin merged 4 commits from feat/issue-613-allocator-db-substrate into master 2026-07-10 01:44:19 -05:00
Owner

Summary

Implements #613 — the control-plane DB substrate required by the allocator/control-plane/observability ADR (merged in PR #614 at 08c3488).

Architecture: DB coordinates · Gitea records · Sentry/GlitchTip observe · bridge is the only path from observations → Gitea work.

Changes

File Purpose
control_plane_db.py SQLite single-writer MVP: schema, atomic assign+lease, mutation gate, heartbeats, terminal-lock index, incident_links
tests/test_control_plane_db.py Concurrency, foreign-lease WAIT, expiry, incident kind rejection, terminal locks
docs/architecture/control-plane-db-substrate.md Operator notes + dependency chain

Hard rules enforced

  • Assignable work kinds: issue / pr only (never raw Sentry/GlitchTip incidents)
  • Atomic assignment + lease in one BEGIN IMMEDIATE transaction
  • Concurrent sessions: second gets wait (not a duplicate lease)
  • Merged/closed work → no_safe_work
  • require_valid_assignment gates mutations by live lease + allowed actions
  • SQLite = single-writer MVP; multi-host needs Postgres or single allocator daemon (ADR §6)

Dependency chain (unchanged)

#613 (this PR)  →  #600 allocator API  →  #612 incident bridge
  • Do not complete #600 with file locks / comment-only leases alone.
  • #612 must use incident_links + normal Gitea issues for assignable work.

Validation

python3 -m pytest tests/test_control_plane_db.py -q  → 12 passed
python3 -m pytest tests/test_issue_lock_store.py -q → 12 passed
git diff --check → clean

Closes #613

## Summary Implements **#613** — the control-plane DB substrate required by the allocator/control-plane/observability ADR (merged in PR #614 at `08c3488`). **Architecture:** DB coordinates · Gitea records · Sentry/GlitchTip observe · bridge is the only path from observations → Gitea work. ## Changes | File | Purpose | |------|--------| | `control_plane_db.py` | SQLite single-writer MVP: schema, atomic assign+lease, mutation gate, heartbeats, terminal-lock index, `incident_links` | | `tests/test_control_plane_db.py` | Concurrency, foreign-lease WAIT, expiry, incident kind rejection, terminal locks | | `docs/architecture/control-plane-db-substrate.md` | Operator notes + dependency chain | ### Hard rules enforced - Assignable work kinds: **`issue` / `pr` only** (never raw Sentry/GlitchTip incidents) - **Atomic** assignment + lease in one `BEGIN IMMEDIATE` transaction - Concurrent sessions: second gets **`wait`** (not a duplicate lease) - Merged/closed work → **`no_safe_work`** - `require_valid_assignment` gates mutations by live lease + allowed actions - SQLite = **single-writer MVP**; multi-host needs Postgres or single allocator daemon (ADR §6) ## Dependency chain (unchanged) ```text #613 (this PR) → #600 allocator API → #612 incident bridge ``` - Do **not** complete #600 with file locks / comment-only leases alone. - #612 must use `incident_links` + normal Gitea issues for assignable work. ## Validation ```text python3 -m pytest tests/test_control_plane_db.py -q → 12 passed python3 -m pytest tests/test_issue_lock_store.py -q → 12 passed git diff --check → clean ``` Closes #613
jcwalker3 added 1 commit 2026-07-09 21:28:07 -05:00
Add SQLite single-writer MVP control plane per the allocator ADR:
sessions, work_items (issue/pr only), atomic assign+lease, mutation
gates, terminal-lock index, and provider-neutral incident_links.

DB coordinates concurrency; Gitea remains assignable work; raw
Sentry/GlitchTip incidents are never work items. #600 and #612 build on
this substrate.
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate
phase: claimed
candidate_head: 036b78e31e
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:31:14Z
expires_at: 2026-07-10T04:31:14Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate phase: claimed candidate_head: 036b78e31ea5d036452b3a52e0e086b01e0c763f target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:31:14Z expires_at: 2026-07-10T04:31:14Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate
phase: validating
candidate_head: 036b78e31e
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:31:25Z
expires_at: 2026-07-10T04:31:25Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate phase: validating candidate_head: 036b78e31ea5d036452b3a52e0e086b01e0c763f target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:31:25Z expires_at: 2026-07-10T04:31:25Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate
phase: validated_blockers_found
candidate_head: 036b78e31e
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:33:19Z
expires_at: 2026-07-10T04:33:19Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate phase: validated_blockers_found candidate_head: 036b78e31ea5d036452b3a52e0e086b01e0c763f target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:33:19Z expires_at: 2026-07-10T04:33:19Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate
phase: review_decision
candidate_head: 036b78e31e
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:34:00Z
expires_at: 2026-07-10T04:34:00Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate phase: review_decision candidate_head: 036b78e31ea5d036452b3a52e0e086b01e0c763f target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:34:00Z expires_at: 2026-07-10T04:34:00Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate
phase: claimed
candidate_head: 036b78e31e
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:34:58Z
expires_at: 2026-07-10T04:34:58Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate phase: claimed candidate_head: 036b78e31ea5d036452b3a52e0e086b01e0c763f target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:34:58Z expires_at: 2026-07-10T04:34:58Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate
phase: review_decision
candidate_head: 036b78e31e
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:35:08Z
expires_at: 2026-07-10T04:35:08Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-feat-issue-613-allocator-db-substrate phase: review_decision candidate_head: 036b78e31ea5d036452b3a52e0e086b01e0c763f target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:35:08Z expires_at: 2026-07-10T04:35:08Z blocker: none
sysadmin requested changes 2026-07-09 21:35:27 -05:00
Dismissed
sysadmin left a comment
Owner

Canonical PR State

STATE: open; changes requested at pinned head
WHO_IS_NEXT: author
NEXT_ACTION: Fix the stale/terminal mutation gate, canonical incident_links uniqueness, regression coverage, and PR-range whitespace failure; push a new head for fresh review
NEXT_PROMPT:

Address PR #619 review findings for issue #613. Make require_valid_assignment fail closed on terminal state and head drift, make incident_links upsert one canonical row when optional scope is omitted, add regression tests, remove trailing whitespace, push a new head, and request fresh review. Do not claim #600 or #612 complete.

WHAT_HAPPENED: Reviewer validated pinned head 036b78e31e and reproduced two substrate safety defects
WHY: The current gate authorizes stale/merged work and nullable incident scope permits duplicate canonical links
ISSUE: #613
HEAD_SHA: 036b78e31e
REVIEW_STATUS: REQUEST_CHANGES prepared; formal submission pending this dry-run
MERGE_READY: false
BLOCKERS: stale/terminal mutation authorization; duplicate incident_links rows with NULL scope; PR-range trailing whitespace
VALIDATION: test_control_plane_db 12 passed; test_issue_lock_store 12 passed; targeted diagnostics reproduced both safety blockers; git diff --check prgs/master...HEAD failed at docs lines 3-4
LAST_UPDATED_BY: sysadmin (prgs-reviewer)

REQUEST_CHANGES at pinned head 036b78e31ea5d036452b3a52e0e086b01e0c763f.

Blocking findings:

  1. Mutation gate accepts stale or terminal work (control_plane_db.py:737-782). require_valid_assignment checks only assignment/lease/action state. It never rejects work_items.state in {merged, closed} and never compares assignments.expected_head_sha with work_items.current_head_sha. A diagnostic at this head assigned PR head old, updated the work item to head new, then to state merged; both calls to require_valid_assignment(..., action="review") still succeeded. This lets #600 build on a substrate that authorizes stale-head or post-merge mutations. Fail closed on terminal state and head mismatch, and add regression tests.

  2. incident_links does not preserve one canonical row when optional scope fields are NULL (control_plane_db.py:123-143, 870-930). SQLite UNIQUE constraints treat NULL values as distinct, so the declared conflict target does not fire when provider_base_url, provider_org, or provider_project is omitted. Two upserts for the same provider/issue produced [(1, "123", 1), (2, "123", 2)]. Normalize these key columns or use an expression index/conflict strategy that makes NULL scope canonical, and test repeated minimal upserts.

  3. PR-range diff check fails: git diff --check prgs/master...HEAD reports trailing whitespace in docs/architecture/control-plane-db-substrate.md:3-4. The bare git diff --check on a clean detached checkout does not inspect committed PR changes.

Validation:

  • pytest tests/test_control_plane_db.py -q — 12 passed
  • pytest tests/test_issue_lock_store.py -q — 12 passed
  • independent four-contender test using four ControlPlaneDB instances — one assigned, three wait
  • worktree remained at the pinned head with no tracked/untracked changes

Dependency note: #600 and #612 remain downstream until #613 is merged. This review does not treat either downstream issue as complete.

CTH: Reviewer Handoff

Status: request_changes_at_current_head
Next owner: author
Current blocker: stale/terminal mutation authorization and non-canonical incident_links upsert
Decision: REQUEST_CHANGES at head 036b78e31e
Proof: requested tests passed; targeted diagnostics reproduced both safety defects; PR-range diff check failed
Next action: fix the mutation gate and incident link uniqueness, add regression tests, remove trailing whitespace, then push a new head for fresh review
Ready-to-paste prompt: Address PR #619 review findings for issue #613, push fixes, and request a fresh reviewer run. Do not claim #600 or #612 complete.

[THREAD STATE LEDGER] PR #619 / Issue #613 — REQUEST_CHANGES prepared at pinned head

What is true now:

  • PR state: open
  • Issue state: open
  • Current head SHA: 036b78e31e
  • Server-side decision state: pending formal REQUEST_CHANGES submission
  • Local verdict/state: REQUEST_CHANGES prepared locally
  • Latest known validation: both requested pytest targets passed; PR-range diff check failed; two targeted safety defects reproduced

What changed:

  • Independent review found stale/terminal assignment-gate acceptance and duplicate incident_links rows with NULL scope

What is blocked:

  • Blocker classification: code blocker and test blocker

Who/what acts next:

  • Next actor: author
  • Required action: fix findings, add regression tests, and push a new head
  • Do not do: merge or treat #600/#612 as complete
  • Resume from: fresh review of the new PR #619 head
## Canonical PR State STATE: open; changes requested at pinned head WHO_IS_NEXT: author NEXT_ACTION: Fix the stale/terminal mutation gate, canonical incident_links uniqueness, regression coverage, and PR-range whitespace failure; push a new head for fresh review NEXT_PROMPT: ```text Address PR #619 review findings for issue #613. Make require_valid_assignment fail closed on terminal state and head drift, make incident_links upsert one canonical row when optional scope is omitted, add regression tests, remove trailing whitespace, push a new head, and request fresh review. Do not claim #600 or #612 complete. ``` WHAT_HAPPENED: Reviewer validated pinned head 036b78e31ea5d036452b3a52e0e086b01e0c763f and reproduced two substrate safety defects WHY: The current gate authorizes stale/merged work and nullable incident scope permits duplicate canonical links ISSUE: #613 HEAD_SHA: 036b78e31ea5d036452b3a52e0e086b01e0c763f REVIEW_STATUS: REQUEST_CHANGES prepared; formal submission pending this dry-run MERGE_READY: false BLOCKERS: stale/terminal mutation authorization; duplicate incident_links rows with NULL scope; PR-range trailing whitespace VALIDATION: test_control_plane_db 12 passed; test_issue_lock_store 12 passed; targeted diagnostics reproduced both safety blockers; git diff --check prgs/master...HEAD failed at docs lines 3-4 LAST_UPDATED_BY: sysadmin (prgs-reviewer) REQUEST_CHANGES at pinned head `036b78e31ea5d036452b3a52e0e086b01e0c763f`. Blocking findings: 1. **Mutation gate accepts stale or terminal work** (`control_plane_db.py:737-782`). `require_valid_assignment` checks only assignment/lease/action state. It never rejects `work_items.state in {merged, closed}` and never compares `assignments.expected_head_sha` with `work_items.current_head_sha`. A diagnostic at this head assigned PR head `old`, updated the work item to head `new`, then to state `merged`; both calls to `require_valid_assignment(..., action="review")` still succeeded. This lets #600 build on a substrate that authorizes stale-head or post-merge mutations. Fail closed on terminal state and head mismatch, and add regression tests. 2. **`incident_links` does not preserve one canonical row when optional scope fields are NULL** (`control_plane_db.py:123-143, 870-930`). SQLite UNIQUE constraints treat NULL values as distinct, so the declared conflict target does not fire when `provider_base_url`, `provider_org`, or `provider_project` is omitted. Two upserts for the same provider/issue produced `[(1, "123", 1), (2, "123", 2)]`. Normalize these key columns or use an expression index/conflict strategy that makes NULL scope canonical, and test repeated minimal upserts. 3. **PR-range diff check fails**: `git diff --check prgs/master...HEAD` reports trailing whitespace in `docs/architecture/control-plane-db-substrate.md:3-4`. The bare `git diff --check` on a clean detached checkout does not inspect committed PR changes. Validation: - `pytest tests/test_control_plane_db.py -q` — 12 passed - `pytest tests/test_issue_lock_store.py -q` — 12 passed - independent four-contender test using four `ControlPlaneDB` instances — one `assigned`, three `wait` - worktree remained at the pinned head with no tracked/untracked changes Dependency note: **#600 and #612 remain downstream until #613 is merged**. This review does not treat either downstream issue as complete. ## CTH: Reviewer Handoff Status: request_changes_at_current_head Next owner: author Current blocker: stale/terminal mutation authorization and non-canonical incident_links upsert Decision: REQUEST_CHANGES at head 036b78e31ea5d036452b3a52e0e086b01e0c763f Proof: requested tests passed; targeted diagnostics reproduced both safety defects; PR-range diff check failed Next action: fix the mutation gate and incident link uniqueness, add regression tests, remove trailing whitespace, then push a new head for fresh review Ready-to-paste prompt: Address PR #619 review findings for issue #613, push fixes, and request a fresh reviewer run. Do not claim #600 or #612 complete. [THREAD STATE LEDGER] PR #619 / Issue #613 — REQUEST_CHANGES prepared at pinned head What is true now: - PR state: open - Issue state: open - Current head SHA: 036b78e31ea5d036452b3a52e0e086b01e0c763f - Server-side decision state: pending formal REQUEST_CHANGES submission - Local verdict/state: REQUEST_CHANGES prepared locally - Latest known validation: both requested pytest targets passed; PR-range diff check failed; two targeted safety defects reproduced What changed: - Independent review found stale/terminal assignment-gate acceptance and duplicate incident_links rows with NULL scope What is blocked: - Blocker classification: code blocker and test blocker Who/what acts next: - Next actor: author - Required action: fix findings, add regression tests, and push a new head - Do not do: merge or treat #600/#612 as complete - Resume from: fresh review of the new PR #619 head
jcwalker3 added 1 commit 2026-07-09 21:41:30 -05:00
Address REQUEST_CHANGES on PR #619:

- require_valid_assignment rejects terminal work states and head drift
- incident_links scope keys normalize NULL/blank to '' for UNIQUE
- remove trailing whitespace in control-plane-db-substrate.md
Author
Owner

Canonical Issue State

STATE: open; author fix commit pushed on PR #619 after REQUEST_CHANGES; awaiting re-review
WHO_IS_NEXT: reviewer
NEXT_ACTION: Re-review PR #619 at head 783ea88a01
NEXT_PROMPT:

Re-review PR #619 on prgs Scaled-Tech-Consulting/Gitea-Tools after author fixes.
Pin expected_head_sha=783ea88a01da721138429ede8dc8a6c0c186206a.
Confirm: stale-head and terminal-state assignment rejection; incident_links NULL-safe uniqueness; git diff --check prgs/master...HEAD clean.
Do not merge without explicit MERGE PR 619. #600/#612 remain downstream.

WHAT_HAPPENED: Author pushed fix commit 783ea88 addressing REQUEST_CHANGES that was posted against reviewed head 036b78e.
WHY: Reviewer required fail-closed stale/terminal assignment gates, canonical incident_links upserts, and PR-range whitespace cleanup.
RELATED_PRS: #619; ADR via #614; issue #613; downstream #600 #612
BLOCKERS: no blocker
VALIDATION: pytest tests/test_control_plane_db.py -q → 15 passed; pytest tests/test_issue_lock_store.py -q → 12 passed; git diff --check prgs/master...HEAD → clean (exit 0)
LAST_UPDATED_BY: jcwalker3 (prgs-author)

[THREAD STATE LEDGER] PR #619 / Issue #613 — author fix commit pushed after REQUEST_CHANGES

What is true now:

  • PR state: open
  • Issue state: open (status:pr-open)
  • Current head SHA: 783ea88a01
  • Prior reviewed head SHA: 036b78e31e
  • Server-side decision state: REQUEST_CHANGES posted to Gitea (on prior head); author fix commit pushed; no new formal review yet
  • Local verdict/state: author fixes implemented and pushed; no approve/merge attempted
  • Latest known validation: pytest tests/test_control_plane_db.py 15 passed; test_issue_lock_store 12 passed; git diff --check prgs/master...HEAD clean

What changed:

  • require_valid_assignment fails closed on terminal work states and stale expected_head_sha
  • incident_links scope keys normalize NULL/blank to empty string for UNIQUE/canonical upsert
  • trailing whitespace removed from docs/architecture/control-plane-db-substrate.md
  • regression tests added for all three fixes

What is blocked:

  • Blocker classification: no blocker
  • Merge remains unauthorized until reviewer re-approval and explicit MERGE PR 619

Who/what acts next:

  • Next actor: reviewer
  • Required action: re-review PR #619 at head 783ea88a01 and verify the three prior blockers are resolved
  • Do not do: merge without explicit operator MERGE PR 619; do not treat #600 or #612 as complete; do not implement new scope outside RC fixes
  • Resume from: REQUEST_CHANGES thread on PR #619 at prior head 036b78e; new head 783ea88
## Canonical Issue State STATE: open; author fix commit pushed on PR #619 after REQUEST_CHANGES; awaiting re-review WHO_IS_NEXT: reviewer NEXT_ACTION: Re-review PR #619 at head 783ea88a01da721138429ede8dc8a6c0c186206a NEXT_PROMPT: ```text Re-review PR #619 on prgs Scaled-Tech-Consulting/Gitea-Tools after author fixes. Pin expected_head_sha=783ea88a01da721138429ede8dc8a6c0c186206a. Confirm: stale-head and terminal-state assignment rejection; incident_links NULL-safe uniqueness; git diff --check prgs/master...HEAD clean. Do not merge without explicit MERGE PR 619. #600/#612 remain downstream. ``` WHAT_HAPPENED: Author pushed fix commit 783ea88 addressing REQUEST_CHANGES that was posted against reviewed head 036b78e. WHY: Reviewer required fail-closed stale/terminal assignment gates, canonical incident_links upserts, and PR-range whitespace cleanup. RELATED_PRS: #619; ADR via #614; issue #613; downstream #600 #612 BLOCKERS: no blocker VALIDATION: pytest tests/test_control_plane_db.py -q → 15 passed; pytest tests/test_issue_lock_store.py -q → 12 passed; git diff --check prgs/master...HEAD → clean (exit 0) LAST_UPDATED_BY: jcwalker3 (prgs-author) [THREAD STATE LEDGER] PR #619 / Issue #613 — author fix commit pushed after REQUEST_CHANGES What is true now: - PR state: open - Issue state: open (status:pr-open) - Current head SHA: 783ea88a01da721138429ede8dc8a6c0c186206a - Prior reviewed head SHA: 036b78e31ea5d036452b3a52e0e086b01e0c763f - Server-side decision state: REQUEST_CHANGES posted to Gitea (on prior head); author fix commit pushed; no new formal review yet - Local verdict/state: author fixes implemented and pushed; no approve/merge attempted - Latest known validation: pytest tests/test_control_plane_db.py 15 passed; test_issue_lock_store 12 passed; git diff --check prgs/master...HEAD clean What changed: - require_valid_assignment fails closed on terminal work states and stale expected_head_sha - incident_links scope keys normalize NULL/blank to empty string for UNIQUE/canonical upsert - trailing whitespace removed from docs/architecture/control-plane-db-substrate.md - regression tests added for all three fixes What is blocked: - Blocker classification: no blocker - Merge remains unauthorized until reviewer re-approval and explicit MERGE PR 619 Who/what acts next: - Next actor: reviewer - Required action: re-review PR #619 at head 783ea88a01da721138429ede8dc8a6c0c186206a and verify the three prior blockers are resolved - Do not do: merge without explicit operator MERGE PR 619; do not treat #600 or #612 as complete; do not implement new scope outside RC fixes - Resume from: REQUEST_CHANGES thread on PR #619 at prior head 036b78e; new head 783ea88
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88
phase: claimed
candidate_head: 783ea88a01
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:44:30Z
expires_at: 2026-07-10T04:44:30Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88 phase: claimed candidate_head: 783ea88a01da721138429ede8dc8a6c0c186206a target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:44:30Z expires_at: 2026-07-10T04:44:30Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88
phase: validating
candidate_head: 783ea88a01
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:44:36Z
expires_at: 2026-07-10T04:44:36Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88 phase: validating candidate_head: 783ea88a01da721138429ede8dc8a6c0c186206a target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:44:36Z expires_at: 2026-07-10T04:44:36Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88
phase: validated_blockers_found
candidate_head: 783ea88a01
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:45:51Z
expires_at: 2026-07-10T04:45:51Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88 phase: validated_blockers_found candidate_head: 783ea88a01da721138429ede8dc8a6c0c186206a target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:45:51Z expires_at: 2026-07-10T04:45:51Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88
phase: review_decision
candidate_head: 783ea88a01
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:46:35Z
expires_at: 2026-07-10T04:46:35Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-783ea88 phase: review_decision candidate_head: 783ea88a01da721138429ede8dc8a6c0c186206a target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:46:35Z expires_at: 2026-07-10T04:46:35Z blocker: none
jcwalker3 added 1 commit 2026-07-09 21:51:33 -05:00
Address remaining PR #619 blockers on head 783ea88:

- Deduplicate legacy NULL-scope incident_links before normalizing to ''
- Fail closed when duplicate rows disagree on Gitea target
- Require non-empty expected_head_sha for PR assign and mutation
Author
Owner

Canonical Issue State

STATE: open; author fix commit pushed on PR #619 for remaining code blockers from handoff at 783ea88; awaiting re-review
WHO_IS_NEXT: reviewer
NEXT_ACTION: Re-review PR #619 at head 16cd871fbd
NEXT_PROMPT:

Re-review PR #619 on prgs Scaled-Tech-Consulting/Gitea-Tools after author fixes for remaining blockers.
Pin expected_head_sha=16cd871fbd214529248e33c6dfc2d53884f67867.
Confirm: legacy NULL-scope incident_links migration dedupes before normalize and fails closed on Gitea-target conflicts; PR assign/mutation requires non-empty expected_head_sha; prior stale-head and terminal gates still hold.
Note: formal new-head REQUEST_CHANGES may have been blocked by #332 review-lock lifecycle; code fixed from handoff anyway.
Do not merge without explicit MERGE PR 619. #600/#612 remain downstream.

WHAT_HAPPENED: Author pushed 16cd871 fixing two remaining blockers identified on head 783ea88 (formal RC post may be blocked by #332).
WHY: Migration order and PR head-pin gaps were valid code defects independent of review-tooling status.
RELATED_PRS: #619; #613; #600 and #612 remain downstream
BLOCKERS: no blocker
VALIDATION: pytest tests/test_control_plane_db.py -q → 18 passed; pytest tests/test_issue_lock_store.py -q → 12 passed; git diff --check prgs/master...HEAD → clean
LAST_UPDATED_BY: jcwalker3 (prgs-author)

[THREAD STATE LEDGER] PR #619 / Issue #613 — author fix for remaining blockers after handoff at 783ea88

What is true now:

  • PR state: open
  • Issue state: open (status:pr-open)
  • Current head SHA: 16cd871fbd
  • Prior head needing fixes: 783ea88a01
  • Server-side decision state: prior REQUEST_CHANGES on older head; formal new-head REQUEST_CHANGES may be blocked by #332 durable review-lock lifecycle; author still applied handoff code fixes
  • Local verdict/state: author fixes implemented and pushed; no approve/merge attempted
  • Latest known validation: pytest tests/test_control_plane_db.py 18 passed; test_issue_lock_store 12 passed; git diff --check prgs/master...HEAD clean

What changed:

  • incident_links migration deduplicates under normalized keys before NULL→'' coercion
  • conflicting Gitea targets among duplicates fail closed
  • PR assign and require_valid_assignment require non-empty expected_head_sha
  • regression tests for migration dups, conflict fail-closed, and missing PR head pin

What is blocked:

  • Blocker classification: no blocker
  • Merge remains unauthorized until reviewer re-approval and explicit MERGE PR 619
  • Process note: #332 may still block formal review-tooling posts until cleaned separately

Who/what acts next:

  • Next actor: reviewer
  • Required action: re-review PR #619 at head 16cd871fbd and verify both remaining blockers
  • Do not do: merge without explicit MERGE PR 619; do not treat #600 or #612 as complete
  • Resume from: reviewer handoff at head 783ea88; new head 16cd871
## Canonical Issue State STATE: open; author fix commit pushed on PR #619 for remaining code blockers from handoff at 783ea88; awaiting re-review WHO_IS_NEXT: reviewer NEXT_ACTION: Re-review PR #619 at head 16cd871fbd214529248e33c6dfc2d53884f67867 NEXT_PROMPT: ```text Re-review PR #619 on prgs Scaled-Tech-Consulting/Gitea-Tools after author fixes for remaining blockers. Pin expected_head_sha=16cd871fbd214529248e33c6dfc2d53884f67867. Confirm: legacy NULL-scope incident_links migration dedupes before normalize and fails closed on Gitea-target conflicts; PR assign/mutation requires non-empty expected_head_sha; prior stale-head and terminal gates still hold. Note: formal new-head REQUEST_CHANGES may have been blocked by #332 review-lock lifecycle; code fixed from handoff anyway. Do not merge without explicit MERGE PR 619. #600/#612 remain downstream. ``` WHAT_HAPPENED: Author pushed 16cd871 fixing two remaining blockers identified on head 783ea88 (formal RC post may be blocked by #332). WHY: Migration order and PR head-pin gaps were valid code defects independent of review-tooling status. RELATED_PRS: #619; #613; #600 and #612 remain downstream BLOCKERS: no blocker VALIDATION: pytest tests/test_control_plane_db.py -q → 18 passed; pytest tests/test_issue_lock_store.py -q → 12 passed; git diff --check prgs/master...HEAD → clean LAST_UPDATED_BY: jcwalker3 (prgs-author) [THREAD STATE LEDGER] PR #619 / Issue #613 — author fix for remaining blockers after handoff at 783ea88 What is true now: - PR state: open - Issue state: open (status:pr-open) - Current head SHA: 16cd871fbd214529248e33c6dfc2d53884f67867 - Prior head needing fixes: 783ea88a01da721138429ede8dc8a6c0c186206a - Server-side decision state: prior REQUEST_CHANGES on older head; formal new-head REQUEST_CHANGES may be blocked by #332 durable review-lock lifecycle; author still applied handoff code fixes - Local verdict/state: author fixes implemented and pushed; no approve/merge attempted - Latest known validation: pytest tests/test_control_plane_db.py 18 passed; test_issue_lock_store 12 passed; git diff --check prgs/master...HEAD clean What changed: - incident_links migration deduplicates under normalized keys before NULL→'' coercion - conflicting Gitea targets among duplicates fail closed - PR assign and require_valid_assignment require non-empty expected_head_sha - regression tests for migration dups, conflict fail-closed, and missing PR head pin What is blocked: - Blocker classification: no blocker - Merge remains unauthorized until reviewer re-approval and explicit MERGE PR 619 - Process note: #332 may still block formal review-tooling posts until cleaned separately Who/what acts next: - Next actor: reviewer - Required action: re-review PR #619 at head 16cd871fbd214529248e33c6dfc2d53884f67867 and verify both remaining blockers - Do not do: merge without explicit MERGE PR 619; do not treat #600 or #612 as complete - Resume from: reviewer handoff at head 783ea88; new head 16cd871
Author
Owner

Canonical Issue State

STATE:
blocked
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
implement and merge issue #620 so formal re-review can post on a new head after prior REQUEST_CHANGES without manual lock deletion
NEXT_PROMPT:

You are the AUTHOR for Scaled-Tech-Consulting/Gitea-Tools on issue #620.
Implement head-scoped durable review-decision locks so prior REQUEST_CHANGES on head A does not block formal review on head B of the same open PR.
Preserve historical reviews; keep same-head duplicate formal review blocked; keep open-PR cleanup fail-closed unless truly moot.
Evidence: PR #619 old head 036b78e31ea5d036452b3a52e0e086b01e0c763f vs new head 783ea88a01da721138429ede8dc8a6c0c186206a.

WHAT_HAPPENED:
Author controller filed durable issue #620 for the #332 open-PR new-head re-review deadlock observed on this PR.
WHY:
gitea_mark_final_review_decision treated prior REQUEST_CHANGES on the old head as terminal consumption for the same open PR, so formal review could not be posted at the new head; #594 only cleans locks after merge/close.
RELATED_PRS:
#619 (this PR, evidence); depends on product fix in #620
BLOCKERS:
product blocker: durable review-decision lock keys by PR/run without head boundary; unblock after #620 lands so current head differs from locked old-head decision and fresh formal review is allowed
VALIDATION:
lock assessment has_lock=true is_moot=false cleanup_allowed=false PR open; error text terminal review mutation already consumed in this run (request_changes on PR #619); old formal RC head 036b78e31ea5d036452b3a52e0e086b01e0c763f; new head 783ea88a01
LAST_UPDATED_BY:
jcwalker3 (prgs-author)

Cross-link

Durable defect: #620 — Allow fresh formal re-review on new PR head after prior REQUEST_CHANGES

## Canonical Issue State STATE: blocked WHO_IS_NEXT: reviewer NEXT_ACTION: implement and merge issue #620 so formal re-review can post on a new head after prior REQUEST_CHANGES without manual lock deletion NEXT_PROMPT: ```text You are the AUTHOR for Scaled-Tech-Consulting/Gitea-Tools on issue #620. Implement head-scoped durable review-decision locks so prior REQUEST_CHANGES on head A does not block formal review on head B of the same open PR. Preserve historical reviews; keep same-head duplicate formal review blocked; keep open-PR cleanup fail-closed unless truly moot. Evidence: PR #619 old head 036b78e31ea5d036452b3a52e0e086b01e0c763f vs new head 783ea88a01da721138429ede8dc8a6c0c186206a. ``` WHAT_HAPPENED: Author controller filed durable issue #620 for the #332 open-PR new-head re-review deadlock observed on this PR. WHY: `gitea_mark_final_review_decision` treated prior REQUEST_CHANGES on the old head as terminal consumption for the same open PR, so formal review could not be posted at the new head; #594 only cleans locks after merge/close. RELATED_PRS: #619 (this PR, evidence); depends on product fix in #620 BLOCKERS: product blocker: durable review-decision lock keys by PR/run without head boundary; unblock after #620 lands so current head differs from locked old-head decision and fresh formal review is allowed VALIDATION: lock assessment has_lock=true is_moot=false cleanup_allowed=false PR open; error text terminal review mutation already consumed in this run (request_changes on PR #619); old formal RC head 036b78e31ea5d036452b3a52e0e086b01e0c763f; new head 783ea88a01da721138429ede8dc8a6c0c186206a LAST_UPDATED_BY: jcwalker3 (prgs-author) ## Cross-link Durable defect: **#620** — Allow fresh formal re-review on new PR head after prior REQUEST_CHANGES
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871
phase: claimed
candidate_head: 16cd871fbd
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:58:03Z
expires_at: 2026-07-10T04:58:03Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871 phase: claimed candidate_head: 16cd871fbd214529248e33c6dfc2d53884f67867 target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:58:03Z expires_at: 2026-07-10T04:58:03Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871
phase: validating
candidate_head: 16cd871fbd
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T02:58:10Z
expires_at: 2026-07-10T04:58:10Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871 phase: validating candidate_head: 16cd871fbd214529248e33c6dfc2d53884f67867 target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T02:58:10Z expires_at: 2026-07-10T04:58:10Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871
phase: review_decision
candidate_head: 16cd871fbd
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T03:00:16Z
expires_at: 2026-07-10T05:00:16Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871 phase: review_decision candidate_head: 16cd871fbd214529248e33c6dfc2d53884f67867 target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T03:00:16Z expires_at: 2026-07-10T05:00:16Z blocker: none
jcwalker3 added 1 commit 2026-07-09 22:04:24 -05:00
Legacy NULL-scope dedupe only compared Gitea targets, so duplicate rows
with the same provider key and issue but different fingerprint/status/
event_count/etc. collapsed to the lowest link_id and silently dropped
observation data. Migration now compares all meaningful observation
fields and refuses to discard conflicts (#619 RC3 / #613).
Author
Owner

Canonical Issue State

STATE:
ready for review
WHO_IS_NEXT:
reviewer
NEXT_ACTION:
re-review PR #619 at head 2429d9d2e8 for the incident_links migration metadata fail-closed fix and prior #613 substrate acceptance criteria
NEXT_PROMPT:

You are the REVIEWER for Scaled-Tech-Consulting/Gitea-Tools PR #619 (issue #613).
Pin head 2429d9d2e826e519eb8eb4ade45987c00838aefb.
Validate: legacy incident_links migration fails closed when duplicate rows share provider key + Gitea target but conflict on observation metadata (fingerprint/status/event_count/etc.); identical safe dups still collapse; conflicting Gitea targets still fail closed; PR head pin, stale/terminal gates, whitespace, tests.
Do not work #620 in this review unless blocking productively. Formal review may still hit #332/#620 new-head lock tooling; if so, report local verdict + #620 blocker clearly.

WHAT_HAPPENED:
Author pushed fix for remaining re-review blocker: silent discard of conflicting observation metadata during legacy incident_links migration.
WHY:
Migration previously compared only Gitea targets before deleting all but the lowest link_id; same-target rows with fingerprint-A vs B / event_count 1 vs 99 / status open vs resolved could collapse with silent data loss.
RELATED_PRS:
#619 (this PR, #613 substrate); #620 tracks separate #332 new-head formal review lock defect (not fixed here)
BLOCKERS:
none for re-review of this code fix; formal Gitea review posting may still be blocked by #620 tooling until that lands — local verdict still required
VALIDATION:
pytest tests/test_control_plane_db.py -q → 19 passed; pytest tests/test_issue_lock_store.py -q → 12 passed; git diff --check prgs/master...HEAD clean; previous head 16cd871fbd214529248e33c6dfc2d53884f67867; new head 2429d9d2e8
LAST_UPDATED_BY:
jcwalker3 (prgs-author)

Author mutation ledger

Mutation Result
commit 2429d9d fail closed on conflicting incident_links observation metadata
push prgs/feat/issue-613-allocator-db-substrate 16cd8712429d9d

Files: control_plane_db.py, tests/test_control_plane_db.py, docs/architecture/control-plane-db-substrate.md

#600 and #612 remain downstream of #613; not complete.

## Canonical Issue State STATE: ready for review WHO_IS_NEXT: reviewer NEXT_ACTION: re-review PR #619 at head 2429d9d2e826e519eb8eb4ade45987c00838aefb for the incident_links migration metadata fail-closed fix and prior #613 substrate acceptance criteria NEXT_PROMPT: ```text You are the REVIEWER for Scaled-Tech-Consulting/Gitea-Tools PR #619 (issue #613). Pin head 2429d9d2e826e519eb8eb4ade45987c00838aefb. Validate: legacy incident_links migration fails closed when duplicate rows share provider key + Gitea target but conflict on observation metadata (fingerprint/status/event_count/etc.); identical safe dups still collapse; conflicting Gitea targets still fail closed; PR head pin, stale/terminal gates, whitespace, tests. Do not work #620 in this review unless blocking productively. Formal review may still hit #332/#620 new-head lock tooling; if so, report local verdict + #620 blocker clearly. ``` WHAT_HAPPENED: Author pushed fix for remaining re-review blocker: silent discard of conflicting observation metadata during legacy incident_links migration. WHY: Migration previously compared only Gitea targets before deleting all but the lowest link_id; same-target rows with fingerprint-A vs B / event_count 1 vs 99 / status open vs resolved could collapse with silent data loss. RELATED_PRS: #619 (this PR, #613 substrate); #620 tracks separate #332 new-head formal review lock defect (not fixed here) BLOCKERS: none for re-review of this code fix; formal Gitea review posting may still be blocked by #620 tooling until that lands — local verdict still required VALIDATION: pytest tests/test_control_plane_db.py -q → 19 passed; pytest tests/test_issue_lock_store.py -q → 12 passed; git diff --check prgs/master...HEAD clean; previous head 16cd871fbd214529248e33c6dfc2d53884f67867; new head 2429d9d2e826e519eb8eb4ade45987c00838aefb LAST_UPDATED_BY: jcwalker3 (prgs-author) ## Author mutation ledger | Mutation | Result | |----------|--------| | commit `2429d9d` | fail closed on conflicting incident_links observation metadata | | push `prgs/feat/issue-613-allocator-db-substrate` | 16cd871 → 2429d9d | Files: `control_plane_db.py`, `tests/test_control_plane_db.py`, `docs/architecture/control-plane-db-substrate.md` #600 and #612 remain downstream of #613; not complete.
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-a874e27fc740
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871
phase: released
candidate_head: 16cd871fbd
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T04:54:45Z
expires_at: 2026-07-10T06:54:45Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-a874e27fc740 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-16cd871 phase: released candidate_head: 16cd871fbd214529248e33c6dfc2d53884f67867 target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T04:54:45Z expires_at: 2026-07-10T06:54:45Z blocker: manual-release
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-ab2ea1a15166
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d
phase: claimed
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T04:55:02Z
expires_at: 2026-07-10T06:55:02Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-ab2ea1a15166 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d phase: claimed candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T04:55:02Z expires_at: 2026-07-10T06:55:02Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-ab2ea1a15166
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d
phase: validating
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T04:55:09Z
expires_at: 2026-07-10T06:55:09Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-ab2ea1a15166 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d phase: validating candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T04:55:09Z expires_at: 2026-07-10T06:55:09Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-ab2ea1a15166
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d
phase: validated
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T04:55:37Z
expires_at: 2026-07-10T06:55:37Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-ab2ea1a15166 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d phase: validated candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T04:55:37Z expires_at: 2026-07-10T06:55:37Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-ab2ea1a15166
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d
phase: review_decision
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T04:56:53Z
expires_at: 2026-07-10T06:56:53Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-ab2ea1a15166 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d phase: review_decision candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T04:56:53Z expires_at: 2026-07-10T06:56:53Z blocker: none
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 27644-ab2ea1a15166
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d
phase: released
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: 08c3488d7c
last_activity: 2026-07-10T06:26:36Z
expires_at: 2026-07-10T08:26:36Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 27644-ab2ea1a15166 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d phase: released candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: 08c3488d7c35ba27efcd5119514aeeac37b657f7 last_activity: 2026-07-10T06:26:36Z expires_at: 2026-07-10T08:26:36Z blocker: manual-release
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 12774-12f944a63b21
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d
phase: claimed
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: d8b2b8f1a7
last_activity: 2026-07-10T06:26:50Z
expires_at: 2026-07-10T08:26:50Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 12774-12f944a63b21 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr619-2429d9d phase: claimed candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719 last_activity: 2026-07-10T06:26:50Z expires_at: 2026-07-10T08:26:50Z blocker: none
sysadmin approved these changes 2026-07-10 01:29:34 -05:00
sysadmin left a comment
Owner

Review verdict: APPROVE

PR #619 implements the #613 control-plane DB substrate. Fresh from-scratch review under promoted master d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719 (#620/#621). No prior #619 validation, lease, or decision reused.

Verification (all 11 criteria PASS)

  1. Legacy incident_links migration fails closed on same provider key + same Gitea target but conflicting observation metadata — _incident_link_observation_identity / obs_identities guard (control_plane_db.py:456-468); test test_migrate_conflicting_observation_metadata_fails_closed.
  2. Identical/safe legacy NULL-scope duplicates collapse to lowest link_idcontrol_plane_db.py:469-474; test test_migrate_duplicate_null_scope_incident_links.
  3. Conflicting Gitea targets fail closed — control_plane_db.py:443-455; test test_migrate_conflicting_duplicate_incident_links_fails_closed.
  4. Minimal incident_links upsert canonical (NULL-safe scope via _norm_scope, COALESCE preserve) — control_plane_db.py:1058-1137; test test_incident_links_minimal_upsert_is_canonical.
  5. Distinct provider scopes stay distinct — UNIQUE(provider,base_url,org,project,issue_id) (control_plane_db.py:147).
  6. PR assign + mutation require non-empty expected_head_shacontrol_plane_db.py:618-622 and 967-974; test test_pr_assignment_requires_expected_head_sha.
  7. Stale-head assignments rejected — control_plane_db.py:976-980; test test_require_valid_assignment_rejects_stale_head.
  8. Terminal merged/closed work rejected (assign + mutation) — control_plane_db.py:672-676 and 939-943; tests test_merged_work_never_assigned, test_require_valid_assignment_rejects_terminal_state.
  9. Observation links non-assignable — WORK_KINDS={issue,pr} raises InvalidWorkKindError; test test_incident_links_not_work_items.
  10. PR-range whitespace clean — git diff --check prgs/master...HEAD clean.
  11. #600 (allocator API) and #612 (incident bridge) remain downstream and are NOT complete; this PR is substrate only.

Validation run (head 2429d9d2, worktree branches/review-pr619-2429d9d)

pytest tests/test_control_plane_db.py -q  → 19 passed
pytest tests/test_issue_lock_store.py -q  → 12 passed
git diff --check prgs/master...HEAD       → clean

Files reviewed: control_plane_db.py, tests/test_control_plane_db.py, docs/architecture/control-plane-db-substrate.md.

Downstream note: #600 and #612 remain downstream and are not complete until #613 is merged.

[THREAD STATE LEDGER]

  • Reviewer: sysadmin / prgs-reviewer (not author jcwalker3)
  • Runtime: promoted master d8b2b8f1a7 (in parity, not stale)
  • Lease: session 12774-12f944a63b21, head 2429d9d2, target d8b2b8f (fresh; prior lease released, comment 9303)
  • Reviewed head == expected head == 2429d9d2e8
  • Decision: APPROVE
  • Merge: awaiting explicit operator command MERGE PR 619 (reviewer does not merge)

Canonical PR State

STATE: reviewed-approved
WHO_IS_NEXT: MERGER
NEXT_ACTION: Await explicit operator command MERGE PR 619, then merge PR #619 at head 2429d9d2e8 into master d8b2b8f1a7 after confirming the live head is unchanged.
NEXT_PROMPT:

MERGE PR 619
Merge PR #619 (Closes #613) on prgs/Scaled-Tech-Consulting/Gitea-Tools at head 2429d9d2e826e519eb8eb4ade45987c00838aefb into master d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719. Reviewer sysadmin/prgs-reviewer APPROVED; tests 19+12 passed; whitespace clean. Confirm live head unchanged before merge.

WHAT_HAPPENED: Fresh from-scratch reviewer review of PR #619 under promoted master; all 11 criteria verified; required test suites and whitespace check passed; APPROVE submitted head-scoped to 2429d9d2.
WHY: #613 control-plane DB substrate is correct — fail-closed migration, head-pin + stale-head + terminal-state gates, non-assignable observation links, canonical NULL-safe incident upsert — with green validation.
ISSUE: #613
HEAD_SHA: 2429d9d2e8
REVIEW_STATUS: APPROVED
MERGE_READY: yes-pending-operator-command
BLOCKERS: none
VALIDATION: pytest test_control_plane_db.py 19 passed; pytest test_issue_lock_store.py 12 passed; git diff --check prgs/master...HEAD clean
LAST_UPDATED_BY: sysadmin / prgs-reviewer

## Review verdict: APPROVE PR #619 implements the #613 control-plane DB substrate. Fresh from-scratch review under promoted master `d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719` (#620/#621). No prior #619 validation, lease, or decision reused. ### Verification (all 11 criteria PASS) 1. Legacy `incident_links` migration fails closed on same provider key + same Gitea target but conflicting observation metadata — `_incident_link_observation_identity` / `obs_identities` guard (`control_plane_db.py:456-468`); test `test_migrate_conflicting_observation_metadata_fails_closed`. 2. Identical/safe legacy NULL-scope duplicates collapse to lowest `link_id` — `control_plane_db.py:469-474`; test `test_migrate_duplicate_null_scope_incident_links`. 3. Conflicting Gitea targets fail closed — `control_plane_db.py:443-455`; test `test_migrate_conflicting_duplicate_incident_links_fails_closed`. 4. Minimal `incident_links` upsert canonical (NULL-safe scope via `_norm_scope`, COALESCE preserve) — `control_plane_db.py:1058-1137`; test `test_incident_links_minimal_upsert_is_canonical`. 5. Distinct provider scopes stay distinct — `UNIQUE(provider,base_url,org,project,issue_id)` (`control_plane_db.py:147`). 6. PR assign + mutation require non-empty `expected_head_sha` — `control_plane_db.py:618-622` and `967-974`; test `test_pr_assignment_requires_expected_head_sha`. 7. Stale-head assignments rejected — `control_plane_db.py:976-980`; test `test_require_valid_assignment_rejects_stale_head`. 8. Terminal `merged`/`closed` work rejected (assign + mutation) — `control_plane_db.py:672-676` and `939-943`; tests `test_merged_work_never_assigned`, `test_require_valid_assignment_rejects_terminal_state`. 9. Observation links non-assignable — `WORK_KINDS={issue,pr}` raises `InvalidWorkKindError`; test `test_incident_links_not_work_items`. 10. PR-range whitespace clean — `git diff --check prgs/master...HEAD` clean. 11. #600 (allocator API) and #612 (incident bridge) remain downstream and are NOT complete; this PR is substrate only. ### Validation run (head 2429d9d2, worktree branches/review-pr619-2429d9d) ```text pytest tests/test_control_plane_db.py -q → 19 passed pytest tests/test_issue_lock_store.py -q → 12 passed git diff --check prgs/master...HEAD → clean ``` Files reviewed: `control_plane_db.py`, `tests/test_control_plane_db.py`, `docs/architecture/control-plane-db-substrate.md`. Downstream note: **#600 and #612 remain downstream and are not complete until #613 is merged.** [THREAD STATE LEDGER] - Reviewer: sysadmin / prgs-reviewer (not author jcwalker3) - Runtime: promoted master d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719 (in parity, not stale) - Lease: session 12774-12f944a63b21, head 2429d9d2, target d8b2b8f (fresh; prior lease released, comment 9303) - Reviewed head == expected head == 2429d9d2e826e519eb8eb4ade45987c00838aefb - Decision: APPROVE - Merge: awaiting explicit operator command `MERGE PR 619` (reviewer does not merge) ## Canonical PR State STATE: reviewed-approved WHO_IS_NEXT: MERGER NEXT_ACTION: Await explicit operator command `MERGE PR 619`, then merge PR #619 at head 2429d9d2e826e519eb8eb4ade45987c00838aefb into master d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719 after confirming the live head is unchanged. NEXT_PROMPT: ```text MERGE PR 619 Merge PR #619 (Closes #613) on prgs/Scaled-Tech-Consulting/Gitea-Tools at head 2429d9d2e826e519eb8eb4ade45987c00838aefb into master d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719. Reviewer sysadmin/prgs-reviewer APPROVED; tests 19+12 passed; whitespace clean. Confirm live head unchanged before merge. ``` WHAT_HAPPENED: Fresh from-scratch reviewer review of PR #619 under promoted master; all 11 criteria verified; required test suites and whitespace check passed; APPROVE submitted head-scoped to 2429d9d2. WHY: #613 control-plane DB substrate is correct — fail-closed migration, head-pin + stale-head + terminal-state gates, non-assignable observation links, canonical NULL-safe incident upsert — with green validation. ISSUE: #613 HEAD_SHA: 2429d9d2e826e519eb8eb4ade45987c00838aefb REVIEW_STATUS: APPROVED MERGE_READY: yes-pending-operator-command BLOCKERS: none VALIDATION: pytest test_control_plane_db.py 19 passed; pytest test_issue_lock_store.py 12 passed; git diff --check prgs/master...HEAD clean LAST_UPDATED_BY: sysadmin / prgs-reviewer
Owner

adopted_at: 2026-07-10T06:43:55Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 12774-12f944a63b21
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 9305
adoption_reason: merger-handoff-approved-head

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #619
issue: #613
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 12801-af76937517c8
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-control
phase: adopted
candidate_head: 2429d9d2e8
target_branch: master
target_branch_sha: d8b2b8f1a7
last_activity: 2026-07-10T06:43:55Z
expires_at: 2026-07-10T08:43:55Z
blocker: none

<!-- mcp-review-lease-adoption:v1 --> adopted_at: 2026-07-10T06:43:55Z adopted_by_identity: sysadmin adopted_by_profile: prgs-merger adopted_from_session_id: 12774-12f944a63b21 adopted_from_profile: prgs-reviewer adopted_from_reviewer_identity: sysadmin adopted_from_comment_id: 9305 adoption_reason: merger-handoff-approved-head <!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #619 issue: #613 reviewer_identity: sysadmin profile: prgs-merger session_id: 12801-af76937517c8 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-control phase: adopted candidate_head: 2429d9d2e826e519eb8eb4ade45987c00838aefb target_branch: master target_branch_sha: d8b2b8f1a7a0497ded8c671a9a7cd6ace36e5719 last_activity: 2026-07-10T06:43:55Z expires_at: 2026-07-10T08:43:55Z blocker: none
sysadmin merged commit 10228e1c06 into master 2026-07-10 01:44:19 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#619