Skip to content

fix: skip a damaged board dependency and bound user-repo git and preflight output - #309

Merged
memtomem merged 2 commits into
mainfrom
fix/board-git-robustness
Nov 14, 2026
Merged

memtomem merged 2 commits into
mainfrom
fix/board-git-robustness

Conversation

@memtomem

Copy link
Copy Markdown
Owner

Small robustness batch from the 2026-11-14 audit roadmap (PR 4). No persisted contract changes.

Board: one damaged depends_on no longer blocks the board

next_runnable now reads depends_on through _parse_deps, which accepts only a JSON list of strings. A damaged row is unsatisfied: it is skipped with a warning, never dispatched, and the items behind it are still claimed.

Measured on main with a damaged FIFO head and a healthy tail:

depends_on before after
[oops, null, 5, [["a"]], deeply nested BoardError (no item can be claimed) tail claimed, head skipped + warning
{}, "" damaged head claimed (vacuously done) tail claimed, head skipped + warning
"abc", {"x": 1} head claimed when a,b,c / x are done tail claimed, head skipped + warning
[1] tail claimed tail claimed, head skipped + warning

An explicit claim(id) (board run --id) is unchanged.

User-repo git calls are bounded

The 6 git calls in project.py and 2 in cli.py (git_root, marker listing, _git_query, check-ignore ×2, info/exclude, two git status) now go through worktree._run_git: a wedged git (hung filter, fsmonitor, credential helper) is group-killed after 600s and reaches each site's existing failure idiom. project.git_root reports the timeout instead of "not a Git repository".

Preflight output is bounded

The three toolgraph _sync_run calls pass tail_chars=4000. Syncmill never reads the binary's stdout (the verdict is the --out artifact) and shows only a 200-character stderr snippet. tail_chars drains the rest without a new exception type, so strict-mode outcomes are unchanged.

Migration state is durable

memory_migration._atomic_json fsyncs the file before os.replace and the directory after it.

Tests

  • tests/test_board.py: 10 damaged shapes; a valid dependency list still dispatches without warning. The old corrupt-depends_on rollback test now injects a different mid-transaction error, so the rollback guarantee is still covered.
  • tests/test_git_timeouts.py (new): AST guard against a subprocess.* git argv in project.py/cli.py; a wedged fake git proves git_root, _dirty_count, subprocess_status_dirty and project_id return in bounded time and that git's child dies.
  • tests/test_preflight.py: a real binary floods 4 MiB on each stream; advisory, strict and control paths keep ≤ 4000 characters.
  • tests/test_memory_migration.py: order is write → file fsync → replace → directory fsync.
  • tests/test_project.py: three tests that faked git through subprocess.run now patch project._run_git.

Every new guard was removed one at a time (18 mutations); each removal fails a test. Full hermetic suite clean locally; ruff clean. Codex design review (2 rounds) and implementation review (2 rounds, the second without framing): SHIP, no findings on this scope.

Not in this PR

  • The room candidate JOIN issue was split out to its own PR, which also covers the TUI.
  • board show still renders a damaged depends_on as no dependencies (display only).
  • The doctor auth probe (cli.py:661) has a timeout but no process-group kill.

🤖 Generated with Claude Code

memtomem and others added 2 commits November 14, 2026 22:53
…light output

- next_runnable reads depends_on through _parse_deps (a JSON list of
  strings only). A damaged row is unsatisfied and skipped with a warning.
  Before, 5 of 8 measured damage shapes raised BoardError and blocked every
  automatic claim, and {} or "" made the damaged item's dependencies
  vacuously done.
- The user-repository git calls in project.py (6) and cli.py (2) run
  through worktree._run_git: a wedged git is group-killed after 600s and
  reaches each site's existing failure idiom. git_root says the inspection
  timed out instead of "not a Git repository".
- The toolgraph preflight runner keeps a 4000-character tail of each
  stream; syncmill never reads its stdout and shows a short stderr snippet.
- memory_migration._atomic_json fsyncs the file before the rename and the
  directory after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Python 3.14 json.loads accepts the 100000-deep depends_on case, and
get() renders it through _load_list, whose repr of the nested list
overflows the C stack. The dispatch path under test already handles it;
read the state with SQL so the test checks only that path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@memtomem
memtomem merged commit 200dcbd into main Nov 14, 2026
12 checks passed
@memtomem
memtomem deleted the fix/board-git-robustness branch November 14, 2026 14:57
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