
مهارات وكيل الذكاء الاصطناعي لاختبار الأنظمة الموزعة
مهارتان لوكلاء الترميز بالذكاء الاصطناعي يصممان وينفذان اختبارات مدفوعة بالادعاءات للأنظمة الموزعة وذات الحالة. معًا ينتجان خطة اختبار Markdown منظمة وتقرير نتائج مع أحكام من 10 حالات وتصنيف صريح للمسؤولية (SUT / harness / checker / environment). يقرأ المراجع القطعتين ويقرر ما إذا كان سيتم الإصدار؛ لا شيء آخر يجب إعادة تشغيله.
يعمل مع Claude Code، Codex، Copilot CLI، Cursor، Gemini، أو أي وكيل يقرأ Markdown ويشغل الصدفة. المهارات هي ملفات SKILL.md عادية. ينفذها الوكيل؛ خطة الاختبار وتقرير النتائج هما المخرجات.
مهارة واحدة تصمم الخطة. الأخرى تنفذها. تبدأ الخطة من ادعاءات المنتج، وتولد فرضيات مرتبطة بتلك الادعاءات، وتكتب سيناريوهات مسماة باسم الادعاء الذي يحاول كل منها تزييفه. بالنسبة للسيناريوهات الحساسة للاتساق، يربط كل سيناريو أيضًا نموذجًا مجردًا (register | queue | log | lock | lease | ledger | …) بمخطط تاريخ العمليات، ومدقق مسمى، وخصم (nemesis) مع أدلة هبوط قابلة للملاحظة. تنتهي الخطة بحجة كفاية تغطية وبيان ثقة محافظ.
الافتراضي لاختبار الأنظمة الموزعة وذات الحالة — كتابة بضعة اختبارات تكامل والانتهاء — يجد جزءًا صغيرًا من الأخطاء التي تكسر هذه الأنظمة بالفعل في الإنتاج: تجزئات الشبكة الجزئية، التزامن غير الحتمي، استرداد الأعطال، الترقية/الاسترجاع، القابلية للتكرار تحت إعادة التشغيل، الترتيب الحساس للتوقيت.
تفرض هذه المهارات سير عمل رأسي يستمد من المعرفة التي تم اكتسابها بشق الأنفس في المجال:
من البداية إلى النهاية، تنتج المهارتان ما يلي:
docs/testing-plans/<slug>.md ← plan with §0–§9 (see below)
test-sessions/<slug>/<UTC>/
├── session-log.md ← timeline + toolbox + env probe
├── logs/ ← per-scenario stdout/stderr
├── metrics/ ← metric snapshots
├── artifacts/ ← ephemeral harnesses, dumps
└── findings/
├── <scenario>.md ← per-scenario verdict (written as run proceeds)
└── report.md ← summary + adequacy + confidence delta
هيكل الخطة (يمكن للمراجع قراءة هذا وتقرير ما إذا كان سيتم الإصدار دون إعادة تشغيل الاختبارات):
0. Architectural summary — system as it actually exists
1. Scope
1b. Claims under test — the spine
1c. Missing claims discovered — docs ↔ code drift
2. SUT model
3. Existing test inventory — what's already covered
4. Failure-mode hypotheses — tied to claim IDs
5. Coverage matrix — claim × hypothesis
6. Technique selection — from the catalog
6b. Environment requirements
7. Scenarios — each named after the claim, with
Target test file + Skeleton
7.M Model / history / — mandatory when the scenario falsifies
checker discipline a claim in {safety, durability,
idempotency, isolation, ordering,
membership}: model under test,
operation-history schema, named
checker, nemesis + landing evidence,
ambiguous-outcome handling, reduction
plan (SUT/harness/checker/env blame)
7b. Coverage adequacy argument — why these tests are enough
7c. Residual uncertainty — what stays unverified, and why ok
7d. Confidence statement — the reviewer's verdict
8. What this plan does NOT cover
9. Open questions / followups
### Scenario S3: linearizable_append_under_partition
- Falsifies if it FAILs: C1 (every acknowledged append is durable
and linearisable), C5 (leader election completes within 5s)
- Workload: 8 clients, 70% append / 30% read, 5min, key-skew zipf
- Faults: asymmetric partition isolating current leader at T+60s
for 30s
- Oracle: linearizability via Porcupine over per-key histories
§7.M (model / history / checker discipline)
- Model under test: log
- Operation history: default 11-field schema (op id, process id,
invoke/complete ts, op type, key, input,
output, error, timeout marker, node seen,
fault epoch). Recorded in-process + server-
side audit.
- Checker: linearizability (Porcupine) per-key, then
no-lost-ack against final state
- Nemesis + landing: asymmetric-partition (iptables drop one
direction). Landing evidence = iptables drop
counter goes 0 → 14,712 over the 30s window
AND raft log emits "leader-lost; starting
election" within 2s of injection.
- Ambiguous outcomes: timeouts → timeout_marker=true, complete_ts
=null, treated as could-have-succeeded;
retries are separate ops sharing input
- Reduction plan: if FAIL, bisect fault window + fix seed, then
classify SUT / harness / checker / environment
per references/test-case-reduction.md
| ID | الحكم | أدلة هبوط الخصم | فئة التخفيض |
|---|---|---|---|
| S3 | PASS-hardening | iptables ctr 0→14,712; raft re-election at T+1.8s | n/a |
| S4 | FAIL-reproducible | partition landed; Elle: G2-item anomaly on key K17 | SUT |
| S7 | INCONCLUSIVE-fault-not-proven | iptables rule installed but counter stayed 0 — wrong chain | harness |
| S9 | PARTIAL-model | landing ok; checker covered per-key, not cross-key | n/a |
(يحمل قالب النتائج الكامل المراقب، أدلة تنفيذ المراقب، روابط القطع الأثرية، قسم كفاية مقابل خطة، وفارق الثقة — انظر skills/executing-distributed-system-tests/assets/findings-report-template.md.)
الصق هذا في أي وكيل ترميز بالذكاء الاصطناعي (Claude Code، Codex، Copilot CLI، Cursor، Gemini، أو أي شيء آخر يقرأ Markdown ويشغل الصدفة):
Read https://raw.githubusercontent.com/shenli/distributed-system-testing/main/INSTALL.md
and follow the instructions to install and configure
distributed-testing-skills for this agent.
يجلب الوكيل INSTALL.md، ويستنسخ المستودع إلى ~/.local/share/distributed-testing-skills/، ويُدخل المهارات (روابط رمزية تحت ~/.claude/skills/ لـ Claude Code، كتلة مؤشر في ~/AGENTS.md للوكلاء الآخرين).