Skip to content

fix: stop double reports and handoff churn for 26.11.20 - #43

Merged
ancongui merged 2 commits into
mainfrom
fix/main-ci-wait-race
Nov 17, 2026
Merged

ancongui merged 2 commits into
mainfrom
fix/main-ci-wait-race

Conversation

@ancongui

@ancongui ancongui commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

Release 26.11.20: makes devkit hold up under heavy daily use, and fixes the race that turned main's CI red after
v26.11.19.

  • dev watch reported one message twice: the wait printed a crew or peer message before claiming it, so a hook
    that took it in between reported it too (main CI run 44027389111). The wait now claims under the lock first and
    gives the claim back if printing fails.
  • Handoff repository growth: background syncs push at most every sync.push_interval seconds (default 300)
    through one flusher per Mac; claims, embargoes, the end of a session and a sync you run still push at once; files
    over 45 MB are never committed; git gc --auto runs only in the scheduled sync. registry.json (a per-Mac cache
    committed thousands of times) leaves git, generated views skip timestamp-only changes, a note's generated block is
    written only by a Mac with the clone, and presence is written on real changes.
  • Audit trail: the handoff copy is one file per closed UTC day (a month past 45 MB publishes again; a day over the
    limit is held and named); queries filter before cleaning and the table cleans only the rows it shows: a plain
    7-day dev audit on a 91,000-record month went from 4.9 s to 0.35 s.
  • Triaged bugs (this Mac's logs, held bug reports, GitHub issues, the backlog): task writes print only their own
    line and act on several ids, dev progress survives a malformed presence file, answered questions count as read,
    writers that shared one temp file name are atomic, dev plan revise touches only Markdown, short Spanish messages
    decide the reply language, dev test prove no longer counts an import error as proof, the test runner's receipt
    works in this repository, old-format bug reports say they cannot be sent, dev doctor judges its own job and
    shows a used-up quota as a warning, dev release <version> takes a plain argument.
  • CI: the dashboard's browser tests retry once with a fresh Chrome after a hang.

Why

The developer asked for devkit to be as stable as possible for daily, heavy use, and main's CI failed after v26.11.19
on a real race and a runner Chrome hang.

How to verify

  • dev ci --run on this branch (the local CI below passed on 85f4a00); dev audit on a heavy month; two Macs
    sharing a handoff repository: a claim with a batched change waiting reaches the remote.

How it was verified

  • Local CI (dev ci --run) on a751449 and again on 85f4a00 (the review fixes): compile, unit tests on Python 3.13 and 3.9 (24 min), gitleaks, semgrep,
    osv-scanner, trivy, zizmor; evidence recorded.
  • Every new test fails without its change (dev test prove), several lanes added targeted mutants.
  • Measured on this Mac's real data: audit query times, the handoff repository's commit counts and object sizes.
  • Code review of the whole change; its high and medium findings (two Macs: a claim with a batched change
    waiting, registry.json traded with an older Mac) are fixed in 85f4a00 and the re-review approved them.

Refs: #40, #41, #42

The developer asked for devkit to be as stable as possible for daily, heavy use, and main's CI failed after v26.11.19.

Root cause: The wait printed a crew or peer message before claiming it, so a hook that took it in between reported it too (main CI run 44027389111). The handoff repository took a commit and push on every hook sync and tracked a per-Mac registry cache, so it grew about 10 MB a day; the audit copy was one monthly file that stopped publishing past 45 MB; audit queries cleaned every record before filtering. The rest came from a triage of this Mac's logs, held bug reports, GitHub issues and the backlog: task writes printed the whole list after their own line, several ids were joined into one search, a peer's malformed presence file crashed dev progress, answered questions stayed unacknowledged, writers shared one fixed temp file name, dev plan revise stamped non-Markdown files, a two-word Spanish message counted as unclear, dev test prove took an import error as proof, and the test runner's receipt was refused by the repository's test guard.

dev watch claims each message under the lock before printing and gives the claim back on failure. Background syncs push the handoff at most every sync.push_interval seconds (default 300) through one flusher per Mac; urgent changes push at once; files over 45 MB are never committed; gc runs only in the scheduled sync. registry.json leaves git, generated views skip timestamp-only changes, note blocks are written only by a Mac with the clone, presence is written on real changes. The audit copy is one file per closed UTC day; queries filter before cleaning and the table cleans only the rows it shows. dev doctor judges its own job, shows quota as a warning, prints each header once. Plus the triaged fixes listed in the CHANGELOG, the Chrome test harness retry, and docs.

Verified: lanes' runs on python3 3.15 and /usr/bin/python3 3.9: dev test 4,733/4,737 with the 3 release-argument failures fixed and rerun green; dev test prove on every new test; dev docs check 0 issues; plain dev audit 4.87 s to 0.35 s on this Mac's 91,000-record month
The final review of the 26.11.20 stabilization reproduced both with two Macs, plus five low findings.

Root cause: A background sync left generated files uncommitted for up to the push interval, and an urgent pull moves the checkout with git reset --keep, which refuses when such a file differs on the remote, so a claim failed and a release or done stayed local. registry.json was untracked in the handoff repository while a Mac on an older devkit kept committing it, so the two Macs traded it back and overwrote each other's copy.

An urgent pull or push first commits what waits, with the same staging and 45 MB gate as the batched sync. Each Mac's registry.json lives in devkit's state folder (core.REGISTRY); readers fall back to the handoff copy only while the state copy is missing, and devkit no longer writes or untracks the handoff copy. The wait acknowledges a peer message only after printing it, the flusher pushes under the sync lock and clears its record on exit, dev task edit refuses several ids with --title or --body-file, and dev test prove matches only messages that start with an import or collection error. Docs and the CHANGELOG follow.

Verified: Senior engineer: 807 tests on python3 3.15 and /usr/bin/python3 3.9, dev test prove 15 of 15 new tests fail without the change, blast radius 4,741 of 4,750 then the 8 fixture failures fixed (617 tests on both); the reviewer's two-Mac probes pass; dev docs check 0 issues
@ancongui
ancongui marked this pull request as ready for review November 17, 2026 10:59
@ancongui
ancongui merged commit 06bcf52 into main Nov 17, 2026
5 checks passed
@ancongui
ancongui deleted the fix/main-ci-wait-race branch November 17, 2026 11:48
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.

1 participant