Document ExecutionContext locking strategy and thread-safety guarantees
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Đọc docs/HANDLER_AUTHORING.md và packages/darnit/src/darnit/core/models.py::ExecutionContext; issue cũng cho phép tạo docs/execution-context.md. Tài liệu hóa hành vi khóa và đồng thời, ngữ nghĩa khi xảy ra lỗi, khi nào nên hoặc không nên dùng bộ nhớ đệm, và các mẫu kiểm thử với context mới. Công việc hoàn tất khi hướng dẫn đề cập đủ cả năm điểm và khớp với phần triển khai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
#189 added ExecutionContext with a thoughtful double-checked locking design, but the strategy isn't documented beyond code comments. Handler authors using get_or_run_tool() need to understand:
- What guarantees does the context provide? (same key → same result within an audit run)
- What happens under concurrent access? (different keys parallel, same key serialized)
- What can go wrong? (e.g., if
run_funcraises, is the lock released properly?) - When should handlers NOT use this? (e.g., tool output is non-deterministic or time-sensitive)
What to document
Extend docs/HANDLER_AUTHORING.md (or create a dedicated docs/execution-context.md) with:
- Locking strategy explanation — the double-checked locking pattern and why it's used (main lock fast-path + per-tool locks)
- Concurrency guarantees — what's serialized (same
tool_key), what's parallel (different keys) - Failure semantics — if
run_funcraises, is the lock released? (Yes, viawith— but worth calling out.) Does the exception propagate? (Yes.) Is the key cached on failure? (No — only successful results are cached.) - When to use vs not — cache expensive tool outputs (Scorecard, API queries); DON'T cache time-sensitive state (current time, fresh random numbers, etc.)
- Testing patterns — how to test handlers that use ExecutionContext (fixture that provides a fresh context per test)
References
- Infrastructure:
packages/darnit/src/darnit/core/models.py::ExecutionContext - Existing usage guide:
docs/HANDLER_AUTHORING.md(brief "Shared Execution Context" section added in #189) - Related: #193 (audit cache documentation — similar pattern)
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 27
- Merge trung bình
- 4 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 75
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của darnitdevorg/darnit
-
ci needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
darnitdevorg/darnit#607 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
good first issue maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
darnitdevorg/darnit#587 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Container image has no zizmor, so OSPS-AC-04.02 always reports missing_toolCó thể đã có người làm @mlieberman85 đã nhận 20 ngày trước. Đang mởinfrastructure module-baseline
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
darnitdevorg/darnit#585 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
module-baseline
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
darnitdevorg/darnit#344 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
module-core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
darnitdevorg/darnit#195 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của darnitdevorg/darnit
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
strawberry-graphql/strawberry#4794 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dataforgoodfr/cetolog#21 ·
-
security_citations_test fails against ecc 2026.11.6: SECURITY.md quotes ecc v2026.11.2's linesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
btclib-org/btclib#2932 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
metrics priority: medium
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
LearningCircuit/local-deep-research#8336 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100