Skip to content

feat(runtime): local-first SQLite store for cycle history with PR-comment recovery - #227

Merged
datacas merged 4 commits into
mainfrom
feat/223-local-first-cycle-store
Oct 13, 2026
Merged

datacas merged 4 commits into
mainfrom
feat/223-local-first-cycle-store

Conversation

@datacas

@datacas datacas commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Closes #223 — #223

Keeps a verified local copy of each change request's review history (runs, findings, claims, survivals) in the existing telemetry database, so a --from resume on the same machine makes one lightweight remote check instead of refetching and reparsing every comment. PR comments remain the durable record.

Diagnosis

  • Symptom / request: every resume reads and parses the full PR comment history (refactor(F0): keep claimed-fix history across resumed runs #179 path). Feature request, no defect to reproduce.
  • Hypothesis vs. cause: the item's premise holds — seed_history in scripts/run_cycle.py called comment_run_history over every comment on each resume.
  • Invariant: no state needed to resume exists only in SQLite; local history is used only when verified complete, and a missing/unverifiable store is never read as "no earlier findings".
  • Related work (basic search): refactor(F0): keep claimed-fix history across resumed runs #179 / refactor(F0): keep claimed-fix history across resumed runs #224 (claimed-fix history rebuilt from trusted comments), which this builds on. No duplicate or superseding item found.
  • Fix shape: split the comment fold into token-only history_entry + fold_history, store those tokens in schema-18 tables, and verify them with one GraphQL probe (head, comment count, newest updatedAt) before use; reconcile via REST ?since=; rebuild on deletion, trusted-author change, or schema change.

Design

  • Privacy: tables hold IDs and closed tokens only (comment/run/REV-/attempt IDs, severity, status, disposition, SHAs), enforced by CHECK constraints and identifier grammars. A hash says when the trusted-author list changed; logins, titles and bodies are never stored.
  • Verified complete: watermark = repo, CR, head SHA, comment count, newest edit time + its comment ID, trusted fingerprint, schema version. Match → no fetch. Mismatch → filtered fetch and idempotent per-comment replace. Count still off → full rebuild. Probe failure → resume stops BLOCKED with the reason. Unusable database → skipped, history rebuilt from comments.
  • Outbox: each review/resolve/rereview attempt is recorded as pending; the post-stage sync marks it published when a trusted comment carries its schema-2 receipt. Unobserved → stage warning, and the next dispatch of that stage is told to reuse a comment carrying the earlier attempt_id instead of posting again. The runtime never posts.
  • Concurrency: per-machine writer lock per CR (stale when its process is gone or after 24 h; released in finally); a receipt from an attempt this machine never dispatched stops the cycle BLOCKED after reconciling. GitHub has no atomic check-and-publish, so cross-machine exclusion is reduced, not guaranteed.

Work units

Unit Behaviour Files Tests Verification Rollback
WU-1 Fold review history from token-only entries (history_entry, fold_history, trusted_logins); ProviderComment.updated_at scripts/review_contract.py existing comment_run_history tests python3 -m unittest discover -s tests → exit 0, 1286 tests OK dependent: revert with WU-2 (WU-2 imports the new helpers)
WU-2 Schema-18 local history store, freshness probe, reconciliation, outbox, writer lock, driver wiring, docs scripts/cycle_history.py, scripts/run_cycle.py, scripts/telemetry.py, scripts/runtime.manifest, docs/telemetry.md, docs/review-cycle.md, docs/instrumentation.md, CHANGELOG.md, tests/test_cycle_history.py, tests/test_stage_recovery.py, tests/test_work_item_outcomes.py tests/test_cycle_history.py (rebuild, verified resume, reconcile new/edited/deleted, trusted-author change, idempotent reprocessing, privacy, outbox, stale lock, foreign writer, driver resume) python3 -m unittest discover -s tests → exit 0, 1286 tests OK independent at code level; schema-18 tables stay in an existing database after revert (additive, unused by older code; drop cycle_history_*/cycle_publications manually if desired)

Verification (agent-reported)

  • python3 -m unittest discover -s tests → exit 0, Ran 1286 tests … OK.
  • Boundary check against the real GitHub API (read-only, PR refactor(F0): keep claimed-fix history across resumed runs #224): the GraphQL freshness query returns headRefOid, totalCount and the newest updatedAt (2026-10-13T13:23:25Z); REST issues/224/comments?since=2026-10-13T13%3A23%3A25Z returns that same comment with an identical updated_at string, confirming matching formats and inclusive since.
  • Not run locally: python3 scripts/validate-package.py and the installer jobs (not permitted in this executor); CI runs them.
  • Environment: the suite needs no global Git identity, credentials or network (remotes are injected fakes); it shares the local Python 3 interpreter with CI but not PyYAML installation state.

Split comment_run_history into history_entry, which reduces one trusted
comment to its run IDs, finding tokens and schema-2 receipts, and
fold_history, which folds those entries into runs. ProviderComment gains
the provider's updated_at. Behaviour is unchanged; the local cycle
history (#223) folds the same entries from stored tokens.

Refs #223
Schema 18 adds cycle_history_* and cycle_publications tables to the
telemetry database, holding only identifiers and closed tokens. A --from
resume on GitHub makes one GraphQL freshness check and uses the stored
history when it matches the sync watermark; otherwise it reconciles the
comments edited since (?since=) and rebuilds after a deletion, a
trusted-author change, or with no usable store. A failed check stops as
BLOCKED.

After each review, resolve and rereview the history is reconciled and the
stage's schema-2 receipt confirms its publication; an unobserved one is a
warning and the next dispatch of that stage is told to reuse a comment
carrying the earlier attempt ID. A per-machine writer lock (stale after
the process exits or 24 hours) and foreign-receipt detection stop
conflicting writers as BLOCKED. The change request remains the record.

Closes #223
sqlite3's connection context manager commits but does not close, so the
Windows runner could not delete the temporary database. A helper now
commits and closes each connection.

Refs #223
@datacas

datacas commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Implementation summary — #223

Status: IMPLEMENTED · decision implement (feature_request) · head 1cb7acee501eea92bb13371aac2ab9a4f2ab0819

Resumed an interrupted run: its uncommitted work (history store, schema 18, driver wiring, docs, tests) was kept as-is; this run fixed a stale SCHEMA_VERSION == 17 assertion, wrapped one docstring, committed, and opened this PR.

Commits

  • bad292a WU-1 — fold review history from token-only entries
  • 496e5ee WU-2 — verified local copy of the cycle history (schema 18)
  • 1cb7ace WU-2 follow-up — close test SQLite connections (Windows could not delete the temp DB; 9 test_cycle_history errors with WinError 32 on the first CI run). Revert together with 496e5ee.

Verification (agent-reported)

  • python3 -m unittest discover -s tests → exit 0, 1286 tests OK (on 1cb7ace).
  • Real-boundary read-only check against PR refactor(F0): keep claimed-fix history across resumed runs #224: the GraphQL freshness query and REST ?since= return the same updated_at string; since is inclusive.
  • scripts/validate-package.py not run locally (not permitted in this executor); CI ran it.

Checks on 1cb7acee501eea92bb13371aac2ab9a4f2ab0819

Check State
Skills, manifests, and Bash installer (push) pass
Skills, manifests, and Bash installer (pull_request) pass
PowerShell installer (push) pass
PowerShell installer (pull_request) pass

Not reviewed yet; review is a later stage.

@datacas

datacas commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Initial review — #227 (work item #223)

[CCR-20261013-227] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Verdict: CHANGES_REQUESTED · reviewed head 1cb7acee501eea92bb13371aac2ab9a4f2ab0819 · 1 blocking finding (REV-001)

Summary and scope

I reviewed the whole accumulated diff from origin/main (merge base 0bcf3bdb985fb74b9e00d4d5d4a6fb2cd55ae881) to the head: 12 files, 1995 diff lines (SHA-256 3e2d1cb5…a8ae7, line count confirmed). That covers scripts/cycle_history.py (new), scripts/review_contract.py, scripts/run_cycle.py, scripts/telemetry.py (schema 18), scripts/runtime.manifest, the docs, the CHANGELOG and the tests.

The design holds up: rows hold tokens only, every comment is parsed before anything is written, writes are idempotent per comment, deletions are caught by the count, and a mismatch on trusted authors or schema forces a full rebuild. comment_run_history behaves as before now that it is split into history_entry and fold_history. Two issues remain in the lock and the outbox, described below.

Findings

[REV-001] · medium · open · - · blocks:yes — On Windows, a crashed cycle's writer lock blocks every resume for 24 hours

scripts/cycle_history.py:148 (_process_alive), scripts/cycle_history.py (_stale), docs/telemetry.md:259

_process_alive returns None whenever os.name == "nt". _stale then counts only the 24-hour age, so on Windows a lock is never stale just because its process died. release_lock() runs from finally, so it cleans up after a normal return or a CycleInterrupted. It does not run when the process is killed: the console window closed, a hard kill from a host or orchestrator timeout, or a power loss. Those are exactly the cases where someone runs --from. After one of them, every resume of that change request on that machine stops as BLOCKED with "already being driven by process N on this machine" for up to 24 hours. Nothing documents a way out short of editing the SQLite file by hand. Windows is a supported platform (PowerShell installer job). The docs say "A lock whose process is gone … is stale" and give no platform caveat.

Execution evidence (repro outside the repo, os.name patched to nt, lock row with the PID of a process that has already exited and a fresh timestamp):

windows: LockHeld -> change request 74 is already being driven by process 647987 on this machine since 2026-10-13T14:50:21.152959+00:00
posix: owner lock-3d40

The new test test_a_lock_whose_process_is_gone_is_stale is skipped on Windows, so CI does not catch this.

Suggested direction (not prescriptive): check liveness on Windows too (OpenProcess + GetExitCodeProcess through ctypes, for example), or give the user an explicit, documented way to take over the lock. Either way, the docs should state the behaviour that applies on each platform.

[REV-002] · low · open · - · blocks:no — A recovered-review retry leaves a pending outbox entry that later prompts name as a lost publication

scripts/run_cycle.py:2044, scripts/run_cycle.py:2214, scripts/cycle_history.py (_confirm_publications)

run() calls expect_publication for every review/resolve/rereview dispatch. When a review is recovered, advance(role, "Obtain a structured verdict for the recovered review.", recover=False) dispatches a second attempt. Because recover is false, after_publication never runs for it, and that attempt need not publish anything. The original attempt is confirmed by its receipt, but supersession only covers pending attempts created at or before the confirmed one. The retry was created later, so it stays pending. Until another publication of the same stage is confirmed, the next same-stage dispatch receives RETRY_PUBLICATION, which names the retry as a publication that was never observed. The record is complete, so that prompt text is wrong and the outbox is misleading.

Execution evidence (store API, same sequence as the driver):

original: published | retry: pending
pending review: ['attempt-retry']

Suggested direction: don't record an outbox entry for a recover=False dispatch, or mark it superseded once the recovered attempt is confirmed.

Security triage

The repository's .code-cycle.yml declares no security_review.always_when rule. The default sensitive areas matched on my own reading: telemetry/observability (scripts/telemetry.py, schema 18) and privacy (data from PR comments is kept locally). The PR has no labels. So I ran the security pass, scoped to the new SQLite store and the gh calls:

  • SQL: every value is a bound parameter, and the f-string table names come from constant tuples. No injection path.
  • Untrusted comment content: only trusted_authors comments are folded. Run IDs, REV- IDs, attempt IDs, status tokens, SHAs, comment IDs and timestamps are checked against grammars before insert, and the closed vocabularies are also CHECK constraints. Receipts for another repo or change request are dropped.
  • Privacy: no bodies, titles, logins or models are stored. test_the_history_tables_hold_no_prose_titles_or_logins passes.
  • Subprocess: gh gets argument lists with no shell, and since comes from a stored timestamp that matched the grammar and is URL-quoted.

Result: no vulnerabilities or potential risks found.

Commands and flows executed

Command / flow Result
wc -l + sha256sum on the supplied diff 1995 lines, hash matches; PR head = 1cb7acee…
python3 -m unittest tests.test_cycle_history -v exit 0, 35 tests OK
python3 -m unittest discover -s tests exit 0, Ran 1286 tests … OK
python3 scripts/validate-package.py exit 0, VALID: 15 skills …; working tree still clean
_FRESHNESS_QUERY run read-only with gh api graphql on #227 headRefOid = head, totalCount 1, updatedAt 2026-10-13T14:44:58Z; REST ?since= returned the same comment with the same updated_at string
Ordering check on real data: PR #58, where an older comment (5804340168, edited 23:02:45) was edited after the newest one (5804362192, edited 23:02:07) the GraphQL probe returned 5804340168 / 23:02:45Z, so orderBy: UPDATED_AT does surface edits to older comments
REV-001 / REV-002 repros (script outside the repo, temporary database) outputs quoted above

Unverified

  • I did not run REV-001 on a real Windows host. I patched os.name; the code path is the same one Windows takes.
  • The whole driver path for REV-002 (a real recovered review followed by a second same-stage dispatch) is inferred from the code plus the store-level repro. It was not run end to end.

CI

gh pr checks 227: 4 passed, 0 failed, none pending or skipped. Two workflows report success on the head: Validate package / Skills, manifests, and Bash installer (push and pull_request) and Validate package / PowerShell installer (push and pull_request). No check the repository normally runs is missing.

Residual risks

  • Freshness uses one-second timestamps. Another edit in the same second as the last sync, with an unchanged comment count, would look unchanged. The window is very narrow. Comparing the probed node's databaseId with the stored latest_comment_id would narrow it further.
  • If the OS reuses a dead lock's PID for a new process, that lock looks live for up to 24 hours (POSIX).
  • On a fresh cycle, the writer lock is taken only when tracking is true. A resume takes it unconditionally. The two paths behave differently on non-GitHub hosts.
  • As the PR says, there is still no exclusion between machines.

… verdict retries

REV-001: _process_alive now asks OpenProcess/WaitForSingleObject on Windows
instead of returning None, so a killed cycle's lock is stale at once rather
than after 24 hours. The dead-process lock test runs on Windows again.

REV-002: the recover=False verdict retry of a recovered review no longer
records a pending outbox entry, so later prompts do not name it as a lost
publication.
@datacas

datacas commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Review resolution — #227 (work item #223)

[CCR-20261013-227] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCT-20261013-227] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:734b8dc0579ddadc1f374ab7b9e0826ec917e1df · schema:2

Status: RESOLVED · head 734b8dc0579ddadc1f374ab7b9e0826ec917e1df · 0 open findings

This run continues an earlier attempt of the same resolve stage. That attempt wrote and pushed the fix commit 734b8dc but did not publish a summary. This run did not change any code. It checked the supplied diff (2159 lines, SHA-256 b234e759…0fcc, merge base 0bcf3bdb), triaged both findings against 734b8dc, re-ran the verification, reviewed the fix delta and recorded the result here.

Findings

[REV-001] · medium · resolved · valid · blocks:yes — On Windows, a crashed cycle's writer lock blocks every resume for 24 hours

scripts/cycle_history.py (_windows_process_alive, _process_alive), docs/telemetry.md, CHANGELOG.md, tests/test_cycle_history.py

Disposition valid: at the reviewed head 1cb7ace, _process_alive returned None for os.name == "nt", so only the 24-hour age rule applied. The reviewer's repro shows this.
Fix (734b8dc): on Windows, _process_alive now calls _windows_process_alive. That function uses OpenProcess(SYNCHRONIZE | PROCESS_QUERY_LIMITED_INFORMATION) and WaitForSingleObject(handle, 0) through ctypes. An exited process, or ERROR_INVALID_PARAMETER, counts as dead. WAIT_TIMEOUT or ERROR_ACCESS_DENIED counts as alive. Any other answer falls back to the age rule. test_a_lock_whose_process_is_gone_is_stale is no longer skipped on Windows, and test_a_lock_whose_process_still_runs_is_held and WindowsLivenessTests were added. The docs now describe the behaviour on each platform, including PID reuse.

[REV-002] · low · resolved · valid · blocks:no — A recovered-review retry leaves a pending outbox entry that later prompts name as a lost publication

scripts/run_cycle.py (run(..., publishes=...), advance), tests/test_stage_recovery.py

Disposition valid: at 1cb7ace, run() called expect_publication for every comment stage, including the recover=False verdict retry. Nothing ever confirmed that entry.
Fix (734b8dc): run() takes publishes, and advance passes publishes=recover. The verdict retry at run_cycle.py:2221 is the only recover=False call site, so only that dispatch skips the outbox entry. I checked for a regression: a retry that does publish its own receipt is still not reported as a foreign writer, because _write treats every attempt in dispatch_attempts as expected.

Verification (agent-reported)

Level Command / flow Result
test python3 -m unittest discover -s tests (local, Linux) exit 0, Ran 1292 tests … OK
boundary (REV-001) CI job PowerShell installer (windows-latest, real ctypes/kernel32) on 734b8dc, py -3 -m unittest discover -s tests -v test_a_lock_whose_process_is_gone_is_stale … ok, test_a_lock_whose_process_still_runs_is_held … ok, Ran 1292 tests
reproduction (REV-002) test_the_verdict_retry_of_a_recovered_review_expects_no_publication, run as part of the suite the retry attempt has no publication row and is not listed in pending_publications

The local run and CI share the Python test suite. The local run is on WSL2 Linux and does not use the Windows API. That path was checked by the Windows CI job.

Post-change review and security triage

  • I reviewed the fix delta (1cb7ace..734b8dc, 6 files) inline. No new findings.
  • Security triage: .code-cycle.yml declares no security_review.always_when rule, and the PR has no labels. The fix adds a read-only Windows process query with a PID taken from the local SQLite store and range-checked. It adds no input, auth, public API, dependency or data-handling surface, so I did not run a separate security pass. The initial review's security pass still applies.

Checks on 734b8dc0579ddadc1f374ab7b9e0826ec917e1df

Check State
Skills, manifests, and Bash installer (push) pass
Skills, manifests, and Bash installer (pull_request) pass
PowerShell installer (push) pass
PowerShell installer (pull_request) pass

Residual risks

  • The initial review's residual risks are unchanged: one-second freshness timestamps, PID reuse within the 24-hour window (on both platforms now), the difference in lock acquisition between fresh and resumed cycles, and no exclusion between machines.

@datacas

datacas commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Rereview — #227 (work item #223)

[CCR-20261013-227] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCT-20261013-227] · deep_coder · anthropic/claude-opus-5-5→? · high · triaged:734b8dc0579ddadc1f374ab7b9e0826ec917e1df · schema:2

[CCR-20261013-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Verdict: APPROVED · reviewed head 734b8dc0579ddadc1f374ab7b9e0826ec917e1df · previous reviewed head 1cb7acee501eea92bb13371aac2ab9a4f2ab0819 · 0 open findings · no new findings

Scope and what changed since the previous review

I rereviewed the whole accumulated diff from merge base 0bcf3bdb985fb74b9e00d4d5d4a6fb2cd55ae881 to the head. It has 12 files and 2159 lines. The line count is confirmed, and its SHA-256 b234e759…0fcc matches both the supplied file and a git diff 0bcf3bdb..HEAD I generated myself. Since the initial review the only change is 734b8dc (1cb7ace..734b8dc, 6 files, +156/−14), which:

  • adds a Windows liveness check (_windows_process_alive), so a writer lock whose process is gone is stale on Windows too (REV-001);
  • adds run(..., publishes=...), so the recover=False verdict retry records no outbox entry (REV-002);
  • updates docs/telemetry.md and CHANGELOG.md, and adds tests in tests/test_cycle_history.py and tests/test_stage_recovery.py.

The rest of the accumulated diff is the code the initial review judged at 1cb7ace, and it has not changed. I re-read the run_cycle.py wiring of lock, outbox, sync and seed in the accumulated diff. With publishes=recover, the outbox entry, the retry directive and after_publication are now all skipped together, and only for the single recover=False call site (scripts/run_cycle.py:2221). A verdict retry that does publish a receipt is still not reported as a foreign writer, because _write treats every row of dispatch_attempts as expected.

Previous findings

[REV-001] · medium · resolved · valid · blocks:yes — On Windows, a crashed cycle's writer lock blocks every resume for 24 hours

scripts/cycle_history.py (_windows_process_alive, _process_alive), docs/telemetry.md, tests/test_cycle_history.py

Fixed and verified by execution. On Windows, _process_alive now asks OpenProcess(SYNCHRONIZE | PROCESS_QUERY_LIMITED_INFORMATION) and then WaitForSingleObject(handle, 0). A signalled handle or ERROR_INVALID_PARAMETER counts as dead. WAIT_TIMEOUT or ERROR_ACCESS_DENIED counts as alive. Any other answer returns None, which leaves only the age rule. The handle is closed in finally. If ctypes or WinDLL cannot be loaded, the function returns None.

  • Real Windows boundary: CI job PowerShell installer (windows-latest, run 38420254404, pull_request, head 734b8dc) ran test_a_lock_whose_process_is_gone_is_stale … ok and test_a_lock_whose_process_still_runs_is_held … ok against the real kernel32. The dead-process test keeps its Popen handle open, which exercises the "exited but handles remain" path. That job ran 1292 tests and reported no ERROR/FAIL lines.
  • Mutation check, in a scratch copy outside the working tree: with _process_alive returning None on nt again, WindowsLivenessTests fails (FAILED (failures=1)).
  • The docs now describe the behaviour on each platform and the PID-reuse exception.

[REV-002] · low · resolved · valid · blocks:no — A recovered-review retry leaves a pending outbox entry that later prompts name as a lost publication

scripts/run_cycle.py (run(..., publishes=...), advance), tests/test_stage_recovery.py

Fixed and verified by execution. test_the_verdict_retry_of_a_recovered_review_expects_no_publication passes locally: the retry attempt has no publication row and does not appear in pending_publications. Mutation check, in a scratch copy: with publishes=True restored at the call site, that test fails (FAILED (failures=1)). On Windows CI the test is skipped ("the gh fixture is a shebang script Windows cannot launch"). It is covered on Linux only.

New findings

None.

Security triage

.code-cycle.yml declares no security_review.always_when rule, and the PR has no labels. On my own reading the accumulated change still touches the default sensitive areas of telemetry and privacy (a local SQLite copy of data derived from PR comments). Triage therefore activates the security audit. I ran it inline, scoped to the accumulated diff with the fix delta as its focus:

  • The delta adds one read-only OS query. The PID comes from the local store and is range-checked to a DWORD. The delta adds no new input surface, SQL, subprocess, network or stored field.
  • I re-checked the accumulated diff. Every f-string SQL statement interpolates only constant table-name tuples; all values are bound parameters. There is no shell=True, eval or exec. gh receives argument lists, and since is URL-quoted.
  • The privacy test test_the_history_tables_hold_no_prose_titles_or_logins passes.

Result: no vulnerabilities or potential risks found.

Commands and flows executed

Command / flow Result
wc -l + sha256sum on the supplied diff, and a regenerated git diff 0bcf3bdb..HEAD 2159 lines; both hashes b234e759…0fcc; PR head = 734b8dc
python3 -m unittest discover -s tests (WSL2 Linux) exit 0, Ran 1292 tests … OK
python3 -m unittest tests.test_cycle_history tests.test_stage_recovery exit 0, Ran 56 tests … OK
python3 scripts/validate-package.py exit 0, VALID: 15 skills (7 cycle, 8 supporting) …
gh run view 38420254404 --job 115375388336 --log (Windows) lock tests and WindowsLivenessTests all ok; Ran 1292 tests; 0 ERROR/FAIL
Mutation checks for REV-001 and REV-002 (scratch copy) each targeted test fails when its fix is reverted
git status --short after all runs clean (0 entries)

Unverified

  • The full driver path of REV-002 has not been exercised on Windows (the test is skipped there). It is platform-independent Python and passes on Linux.

CI

gh pr checks 227: exit 0. 4 passed, 0 failed, none pending, skipped or cancelled. Validate package / Skills, manifests, and Bash installer passed on push and on pull_request, and so did Validate package / PowerShell installer. All four ran on 734b8dc. No check the repository normally runs is missing.

Residual risks (unchanged, non-blocking)

  • Freshness timestamps have one-second resolution. A same-second edit with an unchanged comment count looks unchanged.
  • PID reuse inside the 24-hour window keeps a dead lock looking live (POSIX and Windows).
  • A fresh cycle takes the writer lock only while tracking is true, but a resume always takes it.
  • There is no exclusion between machines.
  • After a recovered review, the original attempt's receipt is confirmed at the next stage's sync, not immediately, because the recovery path skips after_publication.

@datacas
datacas merged commit 6adf53b into main Oct 13, 2026
4 checks passed
@datacas
datacas deleted the feat/223-local-first-cycle-store branch October 13, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: local-first SQLite store for cycle history with PR-comment recovery

1 participant