deerflow2/scripts
AochenShen99 dc2ababf00
feat(skill): add blocking-io-guard — SOP skill for blocking-IO triage and runtime anchors (#3503)
* feat(blocking-io): add changed-lines blocking-IO scanner (L1)

* feat(blocking-io): add scan-changed CLI wrapper

* feat(skill): add blocking-io-guard developer SOP skill

* docs(blocking-io): point contributors at the blocking-io-guard skill

* style(blocking-io): apply ruff format to scanner and tests

* docs(backend): document changed-lines blocking-IO scanner in CLAUDE.md

* feat(skill): add post-fix re-scan check and PR batching policy

* refactor(skill): fix SOP step ordering, align template with repo conventions

- Move re-scan into an explicit 'apply the fix' step (was wedged after
  anchor generation while telling you to go back before the anchor)
- Renumber steps 0-6; drop undefined 'L1' jargon
- Mode A: document that the diff is <base>...HEAD (commit first)
- Mode B: prefer make detect-blocking-io + findings JSON file
- anchor template: module-level pytestmark per tests/blocking_io convention
- CLAUDE.md: fix 'git diff --base' phrasing

* fix(skill): catch findings introduced without touching the blocking line

Review follow-up: changed-line intersection alone misses the case where a
new async caller exposes an old sync helper — the static finding sits on
the untouched blocking line, so Mode A returned empty and the SOP stopped
on a false 'no blocking-IO surface'.

Selection is now a union over the changed files:
- findings on added lines of git diff <base>...HEAD (kept: a second
  identical symbol in an already-flagged function collides on the stable
  key and only this selection sees it);
- findings new versus the merge base, matched by (path, function,
  symbol) — never line numbers.

Base sources are materialized via git show <merge-base>:<path>; files
absent at base count every head finding as new. SKILL.md now states the
residual same-file-only blind spot (cross-file async callers) instead of
treating an empty list as proof of zero exposure, and only requires
reading sop-skeleton.md when generalizing to another detector domain.

* docs(skill): examples teach test-writing, the teeth check defines the rule

All examples in the references/template are filesystem-flavored; make
explicit that they are instances, not the SOP's boundary — the same rules
apply to every detector category (FILE_IO, HTTP, SUBPROCESS, SLEEP) and
acceptance is always red/green teeth, never similarity to an example.
Neutralize the template's arrange comment accordingly.

* fix(blocking-io): harden changed-lines scanner per review

- Dedup the union selection by the stable key (path, function, symbol)
  instead of dict identity, so a future selector returning copied dicts
  cannot silently empty the result.
- parse_changed_lines now handles any unified diff: context lines advance
  the new-file counter, \-markers and deletions do not, and the counter
  resets at each +++ header. Previously correct only for --unified=0.
- Add blocking_io_static.scan_source (in-memory scan); base-version
  comparison no longer round-trips through temp files.
- Empty Mode A report now prints the same-file-only reachability caveat
  at the point of use instead of relying on the SOP text alone.

* docs(skill): bound best-effort cleanup when the offload sits in finally

Lesson from the #3505 review: the SOP routinely drives 'offload the
cleanup branch' transformations, and an awaited cleanup in finally can
mask or stall the primary exception. One sentence in Step 2 closes that
gap at the point where the fix is written.
2026-06-12 10:20:38 +08:00
..
wizard feat: MiniMax provider for image/video/podcast skills + new music-generation skill (#3437) 2026-06-08 22:04:38 +08:00
check.py fix(check): windows pnpm version detection in check script (#2189) 2026-04-14 10:29:44 +08:00
check.sh feat(dx): Setup Wizard + doctor command — closes #2030 (#2034) 2026-04-10 17:43:39 +08:00
cleanup-containers.sh feat: send custom event 2026-02-06 17:48:15 +08:00
config-upgrade.sh Fix Windows startup and dependency checks (#1709) 2026-04-01 23:13:00 +08:00
configure.py fix: make check/config cross-platform for Windows (#1080) (#1093) 2026-03-13 21:33:12 +08:00
deploy.sh fix(auth): share internal gateway token across workers (#3184) 2026-05-26 23:19:57 +08:00
detect_blocking_io_static.py Add static blocking IO inventory (#3208) 2026-05-26 23:30:24 +08:00
detect_thread_boundaries.py chore(dev): add async/thread boundary detector (#2936) 2026-05-20 10:00:17 +08:00
detect_uv_extras.py feat(channels): enhance Discord with mention-only mode, thread routing, and typing indicators (#2842) 2026-05-15 22:30:05 +08:00
docker.sh fix(web_fetch): support proxy for Jina reader in restricted networks (#3418) (#3430) 2026-06-08 23:25:29 +08:00
doctor.py feat(dx): Setup Wizard + doctor command — closes #2030 (#2034) 2026-04-10 17:43:39 +08:00
export_claude_code_oauth.py feat: add Claude Code OAuth and Codex CLI as LLM providers (#1166) 2026-03-22 22:39:50 +08:00
load_memory_sample.py feat: add memory management actions and local filters in memory settings (#1467) 2026-03-29 13:14:45 +08:00
run-with-git-bash.cmd fix: use Git Bash for Windows local startup (#1551) 2026-03-29 21:38:29 +08:00
sandbox_memory_profile.py chore: add sandbox memory profiling tools (#3249) 2026-06-03 22:02:27 +08:00
scan_changed_blocking_io.py feat(skill): add blocking-io-guard — SOP skill for blocking-IO triage and runtime anchors (#3503) 2026-06-12 10:20:38 +08:00
serve.sh Fix 'make dev' failure in Windows environment (#3236) 2026-06-09 22:37:54 +08:00
setup_wizard.py feat: MiniMax provider for image/video/podcast skills + new music-generation skill (#3437) 2026-06-08 22:04:38 +08:00
setup-sandbox.sh fix(makefile): extract setup-sandbox inline bash to script for Windows compatibility (#3326) 2026-06-01 07:28:13 +08:00
start-daemon.sh feat: unified serve.sh with gateway mode support (#1847) 2026-04-05 21:07:35 +08:00
sync_labels.py feat(ci): PR/issue auto-labeling + declarative label sync (#3360) 2026-06-03 16:40:24 +08:00
tool-error-degradation-detection.sh refactor(lead-agent): make build_middlewares public to drop the last cross-module private import (#3458) 2026-06-09 11:56:28 +08:00
wait-for-port.sh Fix 'make dev' failure in Windows environment (#3236) 2026-06-09 22:37:54 +08:00