شعار Clock Drift Monitoring Alerting Thresholds

Clock Drift Monitoring Alerting Thresholds

المجتمع
HimanshuJ16
clock-drift-monitoring-alerting-thresholds

استخدم ذلك عندما يتعين على مضيف يسجّل توقيت الأحداث الخاضعة للإبلاغ إثبات بقاء ساعته ضمن حدّ الانحراف الذي يفرضه MiFID II RTS 25 على ذلك النشاط، وذلك بتقييم انحراف PTP وحالة الخدمة الخفية وتفعيل الإيقاف عند تجاوز الحد. ضبط الساعة مهارة منفصلة.

Add to TypingMind

نظرة عامة

الناشرHimanshuJ16
المستودعAlgo-Trading-Skills
اسم المهارةclock-drift-monitoring-alerting-thresholds
النجوم
50
التفريعات
7
الملفات المرفقة
5
الترخيصApache-2.0
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 5

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها HimanshuJ16 على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Clock Drift Monitoring Alerting Thresholds في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/clock-drift-monitoring-alerting-thresholds
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/clock-drift-monitoring-alerting-thresholds .claude/skills/clock-drift-monitoring-alerting-thresholds
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Clock Drift Monitoring Alerting Thresholds في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Clock Drift Monitoring Alerting Thresholds تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Clock Drift Monitoring Alerting Thresholds بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

When to Use

Use this skill when a host that stamps reportable events must demonstrate traceability to UTC inside a stated tolerance, and you need that tolerance enforced automatically rather than reviewed after the fact.

Pick the threshold from the activity, not from the headline number. RTS 25 (Commission Delegated Regulation (EU) 2017/574) Annex Table 2 binds members and participants of EU trading venues by type of trading activity:

ActivityMax divergence from UTCGranularity
High frequency algorithmic trading technique100 µs1 µs or better
Any other trading activity1 ms1 ms or better
Voice / RFQ with human intervention / negotiated transactions1 s1 s or better

The 100 µs default this skill ships is the HFT row of one EU table. It is not a universal clock rule: a US CAT reporter is bound by FINRA Rule 6820 to 50 milliseconds against NIST — 500× looser — and non-HFT EU algo flow is bound to 1 ms. Configure critical_threshold_us from the row that applies to you. Enforcing 100 µs on a book that is not running an HFT technique into an EU venue buys no compliance and manufactures outages.

When NOT to Use

  • As a substitute for a time-sync stack. This measures and reacts; it does not discipline anything. Configuring ptp4l/phc2sys, NIC hardware timestamping and grandmaster selection belongs to clock-synchronization-ptp-for-trading-hosts.
  • To repair timestamps already written. A halt stops the bleeding. Correcting event times recorded during the breach window is clock-skew-correction-for-tick-timestamps.
  • For US-only trading, at these defaults. See the table above; run it at CAT_MAX_DIVERGENCE_US, and note that FINRA also requires a daily pre-open sync check, which is a procedure this monitor does not perform.
  • As the sole justification of RTS 25 compliance. Article 4 requires a documented, annually reviewed traceability system — system design, functioning, specifications, and the exact point at which each timestamp is applied. A monitor is evidence within that system, not the system.
  • Under concurrency, unguarded. ClockDriftMonitor is not thread-safe. Drive it from one polling loop or wrap it in your own lock.

Prerequisites

  • A PTP daemon on the host (ptp4l, plus phc2sys if events are stamped from CLOCK_REALTIME rather than the PHC) emitting parseable offset telemetry.
  • A mapping from your daemon's states to PtpState. ptp4l has no HOLDOVER state of its own — it reports IEEE 1588 port states (SLAVE, UNCALIBRATED, FAULTY, …) and servo states (s0 unlocked, s1 clock step, s2 locked). references/workflows.md gives the mapping this skill assumes.
  • A measured holdover drift rate for the host oscillator, in µs/s. Without it, holdover_grace_s must stay at its fail-closed default of 0.0.
  • A kill-switch entry point the monitor can call synchronously, and an out-of-band alert path that does not depend on the trading engine still being up.

Workflow

  1. Convert units at the boundary. ptp4l logs master offset in nanoseconds; this module takes microseconds. Call offset_us_from_ptp4l_ns() rather than passing the raw figure — see Pitfalls for what happens if you don't.

  2. Poll, and validate before you compare. process_telemetry(offset_us, ptp_state) rejects a non-finite offset with ClockTelemetryError instead of classifying it. Catch that exception in the polling loop and treat it as a fault, not as a skipped reading: an offset you could not parse is a clock state you do not know.

  3. Evaluate state before offset. An UNLOCKED servo halts regardless of the number it reported, because an unlocked servo's offset is meaningless. HOLDOVER starts a grace timer on a monotonic clock — never the wall clock, which is the thing under suspicion — and returns WARNING while inside grace so a lost grandmaster is visible to operations immediately rather than at expiry.

  4. Evaluate the offset. |offset| ≥ critical latches the halt and fires the callback once; |offset| ≥ warning alerts without blocking, and re-logs only on transition into the warning state, so a host sitting at 60 µs does not generate an alarm per poll.

  5. Check liveness on every tick, including empty ones. Call check_liveness() even when no telemetry was read. process_telemetry is reactive and cannot observe absence; a crashed ptp4l emits no offsets at all, and with max_telemetry_age_s unset that silence reads as continued health.

  6. Resume deliberately. The halt latches. reset(operator, reason) requires both arguments and logs them at CRITICAL, because resuming order origination after a clock breach is a compliance decision that has to be attributable at the annual Article 4 review.

Full procedure: see references/workflows.md. Standards reference: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Feeding raw ptp4l nanoseconds into a microsecond threshold. A real 120 µs breach arrives as 120 and reads HEALTHY — the monitor runs green forever while the firm is continuously non-compliant. This is the single most likely way to deploy this skill and get nothing from it.
  • Letting a NaN offset mean "fine". abs(nan) >= 100 is False and so is abs(nan) >= 50, so an unvalidated bad parse falls through every threshold and returns HEALTHY. Absence of a breach signal is not evidence of a healthy clock.
  • Treating silence as health. The common failure is not a drifting clock, it is a dead daemon. A monitor with no staleness deadline never fires, because nothing calls it.
  • Ignoring HOLDOVER because the offset still looks small. On entering holdover the reported offset is against a grandmaster that is no longer there. It looks excellent right up until the local oscillator walks past the limit, and how long that takes is a hardware property you must measure, not assume.
  • Setting the halt threshold exactly at the regulatory limit. By the time drift reaches 100 µs, non-compliant timestamps have already been written. The regulatory number is the ceiling, not the alarm point — leave headroom for detection and halt latency.
  • Alert fatigue from a too-tight warning level. A 5 µs warning on a network with ordinary jitter trains operations to ignore the channel, so the real breach lands in a muted room.
  • Monitoring software clocks only. NTP over UDP carries millisecond-scale OS jitter; it cannot evidence a 100 µs bound. Hardware timestamping at the NIC is the prerequisite, not an optimization.
  • Assuming the kill switch worked. If the callback raises, the monitor stays latched and re-raises — but the engine may still be live. Treat a failed callback as a manual escalation, not a logged warning.

Verification

  • Feed a 120 µs offset with PtpState.LOCKED; confirm CRITICAL, one callback invocation, and that a subsequent 10 µs reading still returns CRITICAL until reset.
  • Feed PtpState.HOLDOVER at a 1 µs offset with holdover_grace_s=30; confirm WARNING before expiry and CRITICAL after, using an injected monotonic clock rather than sleeps.
  • Feed float("nan"); confirm ClockTelemetryError and that the monitor did not halt and did not report HEALTHY.
  • Stop feeding telemetry with max_telemetry_age_s set; confirm check_liveness() halts.
  • Run python -m unittest discover -s skills/clock-drift-monitoring-alerting-thresholds/scripts.

Related Skills

  • clock-synchronization-ptp-for-trading-hosts
  • clock-skew-correction-for-tick-timestamps
  • cross-datacenter-clock-sync-validation
  • execution-algorithm-kill-switch-integration
  • mifid-ii-algo-trading-compliance-eu

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Clock Drift Monitoring Alerting Thresholds؟

استخدم ذلك عندما يتعين على مضيف يسجّل توقيت الأحداث الخاضعة للإبلاغ إثبات بقاء ساعته ضمن حدّ الانحراف الذي يفرضه MiFID II RTS 25 على ذلك النشاط، وذلك بتقييم انحراف PTP وحالة الخدمة الخفية وتفعيل الإيقاف عند تجاوز الحد. ضبط الساعة مهارة منفصلة.

لماذا تستخدم Clock Drift Monitoring Alerting Thresholds على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Clock Drift Monitoring Alerting Thresholds عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Clock Drift Monitoring Alerting Thresholds في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/clock-drift-monitoring-alerting-thresholds. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Clock Drift Monitoring Alerting Thresholds؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Clock Drift Monitoring Alerting Thresholds؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Clock Drift Monitoring Alerting Thresholds معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Clock Drift Monitoring Alerting Thresholds مجانية؟

نعم. نشرها HimanshuJ16 على GitHub بموجب ترخيص Apache-2.0. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇