Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# Changelog

## 6.2.10 — 2026-07-12

Comprehensive concurrency, filesystem, resource, export, and claims audit.
Twelve independent read-only reviews across two discovery rounds were
semantically merged, then every surviving family was reproduced and closed
with maintainer-written regression tests and three local verification
methods (static review, black-box/differential probes, and the complete
test/fuzz/benchmark/mutation gates).

- **Semantic operations are serializable now.** One existing
`graph.json.lock` covers fresh reload, decision, and one graph commit.
This closes stale `correct`, `link`, reopen, duplicate-remember, decay,
auto-dream, and parallel-correction races without a second lock that old
releases do not understand. Shared objects are thread-serialized and lock
waits are bounded.
- **Pruning is crash-recoverable and truthful.** A durable idempotent outbox
lands before graph deletion; archive and provenance delivery happen only
after the graph commit and recover after interruption. Vetoed/failed
prunes cannot create false archive lines, and retries cannot duplicate
archive or journal records.
- **Project files are treated as untrusted filesystem objects.** Reads and
appends require regular single-link files and use nonblocking,
no-follow opens; FIFOs, devices, sockets, symlinks, and hard links cannot
hang a command or redirect data. POSIX reads, appends, atomic writes, and
directory creation traverse opened directory handles, closing parent-swap
races, and preserve existing private permissions.
- **Derived files cannot roll the graph backward.** Agent export reloads the
newest graph while holding its lock, compares target identity before
preserving rewrites, skips unreadable or concurrently edited targets, and
reports every skip instead of claiming all files changed. Markerless legacy
blocks and fenced marker examples are preserved. Partial `init` layouts
repair themselves; `dream --dry-run` creates nothing.
- **Dream side effects follow the commit.** Cortex promotion, dream journals,
and signal consumption happen after graph persistence but before releasing
its lock. Signals consume only the observed prefix, preserving late
appends. Cortex filenames are deterministic and concurrent same-topic
promotions merge without losing facts.
- **Resource and rendering bounds are explicit.** The graph is capped at
50 MB / 10,000 nodes / 100,000 directional edges / 100 history records per
node; memories and queries at 10,000 characters; targeted journal scans at
the latest 100 MB and 10,000 retained matches. Dream pair work is budgeted.
C1 controls, lone surrogates, malformed journal fields, node ids, queries,
and cortex filenames are terminal-safe.
- **Append failures do not poison future provenance.** A short JSONL write is
terminated as a damaged fragment, so the next valid event remains
independently parseable.
- **Recovery damage is isolated, not contagious.** A corrupt prune outbox is
quarantined with a warning instead of bricking every memory command; its
safe removal cannot unlink a swapped or multiply-linked object.
- **The advertised Python floor is exercised.** Python 3.9 compatibility
paths avoid newer `pathlib` arguments, and simultaneous cortex-directory
and lock creation is retried and validated under contention. File-open
mode detection also uses a portable mask available on Windows.
- **Claims now match the implementation.** Removed “reversible,” “all stale
races,” “per-field merge,” and sub-millisecond-at-1,000 wording; documented
local-filesystem durability assumptions, resource limits, bounded journal
history, skipped exports, and the absence of rollback.
- 267 tests. Full fuzz: 420/420. Recall@1/5: 1.00/1.00 at 100 and 1,000
nodes; multilingual 24/24; discrimination 12/12; 180-day soak 15/15,
0/256 stale noise, 8/8 hot slots. Mutation rate: 38% on the
seeded 120-mutant sample.

## 6.2.9 — 2026-07-10

Independent re-audit of the 6.2.8 hardening release: one line-by-line
Expand Down
25 changes: 13 additions & 12 deletions README.ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
كودكس، كرسور، زد)، و`CLAUDE.md` (كلاود كود)، و`GEMINI.md` (جيمناي) — وتُتبنّى تلقائيًّا في `.cursorrules` و`.windsurfrules` و`.clinerules` و`.roo/rules/mind.md` للمشاريع التي تستخدم تلك الأدوات أصلًا.

```bash
curl -fsSLO https://raw.githubusercontent.com/Da7-Tech/mind/v6.2.9/mind.py
python3 -c "import hashlib;h=hashlib.sha256(open('mind.py','rb').read()).hexdigest();assert h=='6dda66fcdb4352fb215f0f285d356e4a110617ff7714f3bdd1d96ab85f766663',h;print('mind.py: OK')"
curl -fsSLO https://raw.githubusercontent.com/Da7-Tech/mind/v6.2.10/mind.py
python3 -c "import hashlib;h=hashlib.sha256(open('mind.py','rb').read()).hexdigest();assert h=='7cb64a6bb96824a6ac00d8871b889b02d57526fc9a70cf33488ae443c8bf139c',h;print('mind.py: OK')"
python3 mind.py init
python3 mind.py remember "قاعدة بيانات المشروع بوستغرس ١٦"
python3 mind.py recall "ما قاعدة البيانات"
Expand All @@ -34,8 +34,8 @@ python3 mind.py dream # بين الجلسات: نسيان وتوطيد و

| حجم الرسم | دقة أول نتيجة | دقة أول ٥ | الكمون الوسيط | الشريحة ٩٥ |
|---|---|---|---|---|
| ١٠٠ عقدة | **١٫٠٠** | ١٫٠٠ | **~٠٫٨ م.ث** | ~٢٫٧–٣٫٠ م.ث |
| ١٠٠٠ عقدة | **١٫٠٠** | ١٫٠٠ | ~٣٫٣–٣٫٩ م.ث | ~١٣٫٧–١٥٫٥ م.ث |
| ١٠٠ عقدة | **١٫٠٠** | ١٫٠٠ | **~٠٫٦ م.ث** | ~٢٫٦ م.ث |
| ١٠٠٠ عقدة | **١٫٠٠** | ١٫٠٠ | ~٢٫٩ م.ث | ~١٣٫٦ م.ث |

(فجوة ٠٫٩٥ التاريخية — سؤال بالفئة «ما إطار css» عن ذكرى لا تذكر إلا «tailwind» — أغلقتها بذرة المفاهيم في ٥٫٥٫٠؛ الترادف خارج البذرة والنص ما يزال حدًّا موثقًا أدناه.)

Expand All @@ -44,15 +44,15 @@ python3 mind.py dream # بين الجلسات: نسيان وتوطيد و
**اختبار معمّر ١٨٠ يومًا** (`bench/soak.py` — الكود الحقيقي بساعة محقونة وعبء
عمل واقعي: حقائق يومية/أسبوعية/شهرية + ٣٥٧ ملاحظة قمامة + حلم كل ليلة):
بقاء الحقائق الجوهرية **١٥/١٥** في كل الإيقاعات، بقاء القمامة الأقدم من
نافذة السماح **٠/٢٥٦**، و**٧/٨** خانات الذاكرة الساخنة حقائق جوهرية،
والرسم منضبط الحجم، والاسترجاع على رسم معمّر نحو ٠٫٤–٠٫٥ م.ث.
نافذة السماح **٠/٢٥٦**، و**٨/٨** خانات الذاكرة الساخنة حقائق جوهرية،
والرسم منضبط الحجم، والاسترجاع على رسم معمّر نحو ٠٫٥–٠٫٦ م.ث.
هذا الاختبار اصطاد عيبَي معايرة حقيقيين قبل النشر وأُصلحا باختبارات انحدار.

**متعددة اللغات بالقياس** (`bench/multilang.py`، يعمل في CI): الأداة مهندَسة للعربية والإنجليزية، لكن نواتها محايدة لغويًّا، و٥٫٦٫٠ أضافت فهرسة ثنائيات الحروف للنصوص عديمة المسافات. دقة أول نتيجة على ٨ لغات لم تُضبط لها قط (مع مشتتات): الفرنسية والألمانية والإسبانية والروسية والتركية والصينية واليابانية والكورية — **٣/٣ لكل لغة (٢٤/٢٤)**. (الصينية واليابانية كانتا ٣/٦ قبل ثنائيات الحروف؛ ٣ استعلامات للغة مقياس دخانيّ لا كحزمة العربية/الإنجليزية العشرين، والتصريف الثقيل بلا تجذير سيفوّت حالات لا يغطيها.)

**التمييز بالقياس** (`bench/discrim.py`، يعمل في CI): تدقيقان مستقلان أصابا حين قالا إن استرجاع الإبرة من ضجيج نظيف لا يقيس التفريق بين حقائق تتشارك المفردات — فهذا المقياس مشتِّتاته كلها متنافسة معجميًّا، وفيه حالات فشل التدقيقَين حرفيًّا («ما اسمي» ضد «اسم الملف يجب أن يطابق اسم الصنف» بالعربية والإنجليزية). النتيجة الحالية: **١٢/١٢** ببوابة ≥٠٫٨٥ في CI كي لا يتراجع التمييز صامتًا مجددًا.

الاختبارات: **٢٢٠ اختبارًا** بمكتبة بايثون القياسية وحدها + مشوّش (٤٢٠ حالة كاملة/١٦٠ في CI) + مطفّر بنسبة قتل **٤٢٪** على العينة المبذورة ذات ١٢٠ طفرة.
الاختبارات: **٢٦٧ اختبارًا** بمكتبة بايثون القياسية وحدها + مشوّش (٤٢٠ حالة كاملة/١٦٠ في CI) + مطفّر بنسبة قتل **٣٨٪** على العينة المبذورة ذات ١٢٠ طفرة.

## موضعها بين الأدوات — وظائف مختلفة لا لوحة فائزين

Expand Down Expand Up @@ -89,9 +89,9 @@ python3 mind.py correct "قاعدة ماي إس كيو إل" "قاعدة الب

كل حقيقة تجيب على السؤالين منذ لحظة تعلمها:

- **مصدر عند الكتابة:** كل عقدة تسجل `origin` (من كتبها — الوكلاء يصدّرون `MIND_BY`/`MIND_SESSION` — وعبر أي أمر)، وكل تحوير (تذكر/ربط/تأكيد/تصحيح/تقليم) يُلحق بـ**`.mind/journal.jsonl`** — سجل إلحاقي **لا يُدوَّر ولا يُمحى أبدًا** (بعكس signals.jsonl وهو قياس جلسة يُمسح). حتى بعد تقليم الحقيقة يبقى نسبها في اليومية.
- **مصدر عند الكتابة:** كل عقدة تسجل `origin` (من كتبها — الوكلاء يصدّرون `MIND_BY`/`MIND_SESSION` — وعبر أي أمر)، وكل تحوير (تذكر/ربط/تأكيد/تصحيح/تقليم) يُلحق بـ**`.mind/journal.jsonl`** — سجل إلحاقي **لا يُدوَّر ولا يُمحى أبدًا** (بعكس signals.jsonl وهو قياس جلسة يستهلك الحلم البادئة التي رآها ويُبقي ما أُلحق أثناءه). حتى بعد تقليم الحقيقة يبقى نسبها في اليومية.
- **صحة منفصلة عن الانتباه:** `weight` يقيس البروز، و`valid_from`/`valid_to` يقيسان الصحة. الاضمحلال يلمس البروز فقط — **النسيان لا يجعل شيئًا كاذبًا أبدًا**؛ الإبطال لا يقع إلا بـ`correct` صريح.
- **اسأل الرسم:** `why <id>` (المنشأ والصلاحية وعدد الأحداث الكامل مع آخر ثمانية؛ الملف الإلحاقي هو السجل الكامل)، `entity "قاعدة"` (كل الحقائق عن مصطلح — الجارية والمنسوخة بفتراتها)، `recall "سؤال" --at 2026-01-15` (ما الذي كان صحيحًا حينها).
- **اسأل الرسم:** `why <id>` (المنشأ والصلاحية وعدد المطابقات وآخر ثمانية ضمن آخر ١٠٠ ميغابايت وبحد ١٠٬٠٠٠ حدث محفوظ في الذاكرة؛ الملف الإلحاقي نفسه هو السجل الدائم)، `entity "قاعدة"` (كل الحقائق عن مصطلح — الجارية والمنسوخة بفتراتها)، `recall "سؤال" --at 2026-01-15` (ما الذي كان صحيحًا حينها).

**حدّ صادق:** حلّ الكيانات **معجميّ** (التطبيع + التجذير + بذرة المفاهيم توحّد الهجاءات والتصريفات وثنائية العربية/الإنجليزية لنفس المصطلح) — الضمائر والأوصاف الحرة («الموظفة الجديدة» = «سارة») لا تُحل؛ ذلك يحتاج نموذجًا ويكسر وعد صفر التبعيات.

Expand All @@ -111,10 +111,10 @@ python3 mind.py correct "قاعدة ماي إس كيو إل" "قاعدة الب

## خصائص الأمان

- كتابة ذرّية **معمّرة** بملف مؤقت فريد وفحص للكتابة الكاملة وfsync للملف والمجلد على POSIX، وترفض الروابط الرمزية
- كتابة ذرّية متينة على أنظمة الملفات المحلية، بمقابض أدلة على POSIX وملف مؤقت فريد وفحص للكتابة الكاملة وfsync للملف والمجلد، وترفض الروابط الرمزية والملفات الخاصة والروابط الصلبة
- لا إتلاف صامت أبدًا: الرسم التالف يُعزل لا يُمحى، والمنسيّ بالاضمحلال يُؤرشف في `‎.mind/archive.md` لا يُدمر (وإن تعذرت الأرشفة لا يُحذف شيء أصلًا)، ومحتواك في ملفات الوكلاء محفوظ خارج علامات الحماية
- `dream --dry-run` يعرض الخطة كاملة دون لمس القرص
- قفل ملفات عند الحفظالعقد تُدمج على مستوى الحقول، والحواف على مستوى كل اتجاه، واضمحلال الحواف اليومي يُحسم داخل القفل
- معاملة رسم تسلسلية واحدةالقفل يغطي القراءة الطازجة والقرار الدلالي والتثبيت الواحد، وسجل تقليم قابل للاسترداد يوحّد الرسم والأرشيف واليومية بعد الانقطاع
- الذاكرة ملفات نصية صرفة: راقبها بـ`git diff` وزامنها واقرأها

## حدود صادقة
Expand All @@ -129,6 +129,7 @@ python3 mind.py correct "قاعدة ماي إس كيو إل" "قاعدة الب
- الذاكرة والحقائق الساخنة المصدَّرة نص صريح؛ لا تحفظ أسرارًا أو مفاتيح أو بيانات شخصية خاصة أو نصوص prompt غير موثوقة. تُحيد البنية والعلامات عند العرض، لكنها تبقى مرئية للوكيل.
- أكواد الخروج عقد ثابت: ٠ نجاح (حتى «لا نتائج»)، ١ فشل تشغيلي، ٢ خطأ استخدام.
- مصممة لذاكرة وكيل شخصية/مشروعية (مئات إلى آلاف العقد)، لا لاسترجاع مؤسسي على ملايين الوثائق.
- حدود صريحة: ١٠٬٠٠٠ عقدة، و١٠٠٬٠٠٠ حافة اتجاهية، و٥٠ ميغابايت للرسم، و١٠٬٠٠٠ محرف للذكرى أو الاستعلام، و١٠٠ سجل تاريخ للعقدة، و٢٥٦ تقليمًا أو ٤ ميغابايت من حمولة التقليم للحلم، و٣٠ ثانية لانتظار القفل. تفحص قائمة القشرة ١٬٠٠٠ ملف ومذكرات الأحلام ١٠٬٠٠٠، ويفحص `why` آخر ١٠٠ ميغابايت ويحفظ في الذاكرة آخر ١٠٬٠٠٠ حدث مطابق.

## التعزيز الصريح

Expand All @@ -153,7 +154,7 @@ python3 mind.py correct "قاعدة ماي إس كيو إل" "قاعدة الب
## التطوير

```bash
python3 -m unittest discover -s tests # ٢٢٠ اختبارًا
python3 -m unittest discover -s tests # ٢٦٧ اختبارًا
python3 bench/bench.py # أرقام العربية/الإنجليزية
python3 bench/multilang.py # ٨ لغات غير مضبوطة
python3 bench/discrim.py # التمييز بمشتتات متنافسة
Expand Down
Loading
Loading