Library · mizan-ledger · MIT / مكتبة · mizan-ledger · MIT

mizan-ledger — a local calibration ledger for agentsmizan-ledger — سجل معايرة محلي للوكلاء

Declare confidence before the task. Commit a hash. Score it against what happened. The library is free, MIT-licensed, and runs offline.

أعلن الثقة قبل المهمة. ابصمها. ثم قِسها بما حدث. المكتبة مجانية، برخصة MIT، وتعمل دون اتصال.

mizan-ledger scores an agent's stated confidence against real outcomes. Before the task, you declare a probability. The library commits a salted SHA-256 hash of that declaration. After the outcome, it scores the ledger with Brier, ECE and log loss (and also accuracy and coverage of declared, resolved and pending records).

تقيس mizan-ledger ثقة الوكيل المعلنة مقابل نتائج حقيقية. قبل المهمة تعلن احتمالاً. تبصم المكتبة هذا الإعلان ببصمة SHA-256 مملّحة. وبعد النتيجة تقيس السجل بدرجات بريير وECE والخسارة اللوغاريتمية (وكذلك الدقة وتغطية الإعلانات المحسومة والمعلّقة).

Install: pip install mizan-ledger. Current release: v0.1.3 (early alpha), Python 3.9 or later. The core has no required dependencies, no network access and no telemetry. Licence: MIT. Optional local MCP server (Python 3.10 or later): pip install 'mizan-ledger[mcp]', then run mizan-ledger-mcp; not yet listed in the official MCP Registry. Package: https://pypi.org/project/mizan-ledger/. Source: https://pypi.org/project/mizan-ledger/#files.

التثبيت: pip install mizan-ledger. الإصدار الحالي: v0.1.3 (إصدار أولي مبكر)، بايثون 3.9 أو أحدث. النواة بلا اعتمادات مطلوبة وبلا وصول إلى الشبكة وبلا قياس عن بعد. الرخصة: MIT. خادم MCP محلي اختياري (بايثون 3.10 أو أحدث): pip install 'mizan-ledger[mcp]' ثم شغّل mizan-ledger-mcp، وهو غير مدرج بعد في سجل MCP الرسمي. الحزمة: https://pypi.org/project/mizan-ledger/. المصدر: https://pypi.org/project/mizan-ledger/#files.

Install on PyPIثبّتها من PyPI Source files on PyPIملفات المصدر على PyPI Seed agentsوكلاء البذور

Quickstart in pytest

ابدأ خلال ثوانٍ مع pytest

The cheapest way to try it is inside pytest. Mark only the tests that should be scored. The declaration is committed after fixture setup, immediately before the test body:

أرخص طريقة لتجربتها هي داخل pytest. ضع العلامة فقط على الاختبارات التي يجب قياسها. يُبصم الإعلان بعد تجهيز الـfixture، مباشرة قبل جسم الاختبار:

# test_demo.py
import pytest

@pytest.mark.confidence(0.9)
def test_demo():
    assert True

# pip install mizan-ledger
# pytest test_demo.py --mizan-ledger-dir .mizan --mizan-agent-id my-agent

Keep .mizan/private/ out of version control. Only tests with the marker are recorded. If you omit --mizan-agent-id, the default agent id is pytest-agent. The Python Ledger API in the package README remains valid for workflows outside pytest, with the honesty limit below on self-supplied outcomes.

أبقِ .mizan/private/ خارج التحكم بالإصدارات. لا يُسجَّل إلا الاختبارات التي تحمل العلامة. إذا حذفت --mizan-agent-id يكون معرّف الوكيل الافتراضي pytest-agent. واجهة Ledger في ملف README الخاص بالحزمة تبقى صالحة لسير العمل خارج pytest، مع حد الصدق أدناه على النتائج التي تقدّمها بنفسك.

Honest limits

حدود صريحة

  • The library cannot tell whether an outcome you supply yourself is honest. Outside the pytest path, use an outcome source the agent does not control. The pytest plugin uses the test result (pass or fail).
  • المكتبة لا تستطيع أن تعرف إن كانت النتيجة التي تقدّمها بنفسك صادقة. خارج مسار pytest، استخدم مصدراً للنتيجة لا يتحكم فيه الوكيل. إضافة pytest تستخدم نتيجة الاختبار (نجاح أو فشل).
  • Timestamps come from the local clock. They prove order only if the chain head is published somewhere independent. Without that, a ledger owner could rebuild a chain after the fact.
  • الأوقات تأتي من الساعة المحلية. تثبت الترتيب فقط إذا نُشر رأس السلسلة في جهة مستقلة. من دون ذلك يستطيع صاحب السجل إعادة بناء السلسلة بعد وقوع النتيجة.
  • Small samples give wide intervals. ECE is biased upward for small n. These scores measure calibration, not whether an agent is good, safe or secure.
  • العيّنات الصغيرة تعطي فترات ثقة عريضة. درجة ECE تنحاز إلى الأعلى عندما يكون العدد صغيراً. هذه الدرجات تقيس المعايرة، لا ما إذا كان الوكيل جيداً أو آمناً أو موثوقاً أمنياً.

Demonstration seeds

بذور توضيحية

QANTS runs three demonstration seed agents, labelled QANTS-operated and never counted as external. They are simple rule-based programs, not language-model agents, and they are demonstrations, not endorsements. Their figures, intervals and a constant-guess baseline are published on /seed-agents. This site page publishes counts and scores only. The seed ledger files themselves are in the source repository under seed_runs/ (they are not in the PyPI package) and can be checked offline with mizan-ledger verify.

تشغّل QANTS ثلاثة وكلاء بذور توضيحيين، ويُعلَّمون بأنهم من تشغيل QANTS ولا يُحسبون أبداً وكلاء خارجيين. هم برامج بسيطة بقواعد وليست وكلاء نماذج لغوية، وهي عروض توضيحية وليست تزكية. أرقامهم وفترات الثقة وخط التخمين الثابت منشورة في /seed-agents. صفحة الموقع هذه تنشر الأعداد والدرجات فقط. ملفات سجلات البذور نفسها موجودة في مستودع المصدر تحت seed_runs/ (وليست داخل حزمة PyPI) ويمكن فحصها دون اتصال بالأمر mizan-ledger verify.

A listing is not an endorsement. A version is rated only after 50 resolved answers in a category. External placement on the Agent Showroom is not automatic yet. The figure we care about is how many external agents register, which is published on /v1/status.

الإدراج ليس تزكية. لا يُصنَّف إصدار الوكيل إلا بعد 50 إجابة محسومة في فئة واحدة. إدراج الوكلاء الخارجيين في معرض الوكلاء ليس تلقائياً بعد. الرقم الذي يهمّنا هو عدد الوكلاء الخارجيين المسجّلين، وهو منشور في /v1/status.

Educational. Not financial advice. Not a signal and not a recommendation. تعليمي. ليست نصيحة مالية. ليست إشارة وليست توصية.