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
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto
*.json text eol=lf
*.jsonl text eol=lf
*.md text eol=lf
*.py text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
13 changes: 13 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* @Da7-Tech

/src/mind/00_prelude.py @Da7-Tech
/src/mind/20_embedding.py @Da7-Tech
/src/mind/30_graph.py @Da7-Tech
/src/mind/70_policy.py @Da7-Tech
/src/mind/80_lifecycle.py @Da7-Tech
/src/mind/90_cli.py @Da7-Tech
/SECURITY.md @Da7-Tech
/.github/workflows/ @Da7-Tech
/tools/build_single.py @Da7-Tech
/tools/claims.py @Da7-Tech
/tools/privacy_scan.py @Da7-Tech
25 changes: 23 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
## What & why

## Risk and compatibility

- Storage or format change:
- Security or process-boundary change:
- Backward-compatibility impact:
- Rollback or recovery path:

## Evidence

- Red reproduction or absence detector:
- Dynamic/adversarial result:
- Differential or unchanged-path result:
- Raw benchmark artifact, if applicable:

## Checklist
- [ ] `python3 -m unittest discover -s tests` passes (all of it)
- [ ] `python3 tools/build_single.py --check` passes
- [ ] `python3 tools/claims.py check` passes
- [ ] `python3 tools/privacy_scan.py --tracked` passes
- [ ] `python3 -m unittest discover -s tests` passes in full
- [ ] behavior changes come with a regression test that fails before the fix
- [ ] measured claims in README/SKILL still true (rerun the relevant bench)
- [ ] storage changes cover crash, concurrency, old format, oversize, and privacy
- [ ] retrieval changes cover fallback, noisy, multilingual, and benchmark paths
- [ ] measured claims point to immutable committed JSON
- [ ] English and Arabic sections remain substantively equivalent
- [ ] zero new dependencies (the whole point of the tool)
- [ ] all review conversations are resolved
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
labels:
- dependencies
- github-actions
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ on:
push:
branches: [main]
pull_request:
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
timeout-minutes: 35
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -20,10 +24,26 @@ jobs:
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ matrix.python }}
- run: python3 -m unittest discover -s tests -v
- run: python3 bench/bench.py
- run: python3 bench/multilang.py
- run: python3 bench/discrim.py
- run: python3 bench/longmemeval.py --data tests/fixtures/longmemeval_tiny.json --limit 2
- run: python3 bench/soak.py
- run: python3 bench/fuzz.py --quick
- name: Structural and claims gates
run: |
python tools/build_single.py --check
python tools/claims.py check
python tools/privacy_scan.py --tracked
python -m compileall -q mind.py src/mind bench contrib tools
- name: Complete test suite
run: python -m unittest discover -s tests -v
- name: Retrieval and lifecycle benchmarks
run: |
python bench/bench.py
python bench/multilang.py
python bench/discrim.py
python bench/slots.py
python bench/soak.py
python bench/fuzz.py --quick
- name: Immutable-harness smoke tests
run: |
python bench/longmemeval.py --data tests/fixtures/longmemeval_tiny.json --limit 2
python bench/longmemeval.py --data tests/fixtures/longmemeval_tiny.json --limit 2 --engine bm25
python bench/paraphrase.py --server-cmd "python contrib/concept_embed_server.py"
python bench/bulk.py --records 1000 --serial-sample 50 --serial-repetitions 1
python bench/autonomy.py --quick
34 changes: 34 additions & 0 deletions .github/workflows/release-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release-dry-run
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
verify:
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.14"
- name: Rebuild and verify public claims
run: |
python tools/build_single.py --check
python tools/claims.py check
python tools/privacy_scan.py --tracked
- name: Full local release gates
run: |
python -m unittest discover -s tests -v
python bench/bench.py
python bench/multilang.py
python bench/discrim.py
python bench/slots.py
python bench/soak.py
python bench/fuzz.py --quick
python bench/autonomy.py --quick
47 changes: 30 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,36 @@

## Unreleased

- Added `bench/longmemeval.py`, an independent LongMemEval retrieval harness
that downloads the official cleaned oracle dataset by default, maps history
sessions to `remember()` and questions to `recall()`, and reports exact
evidence-turn retrieval (with answer-session fallback only for unannotated
sessions), answer-string retrieval, latency, dataset SHA-256, git commit,
and the exact command.
- CI now smoke-tests the LongMemEval harness against a tiny local fixture,
keeping the public dataset download out of the test matrix.
- Added an optional `MIND_EMBED_CMD` recall re-ranker. The command reads text
from stdin and returns a numeric vector as JSON or whitespace-separated
floats; failures, timeouts, invalid vectors, and unset commands fall back to
the deterministic hash embedder without mixing vector spaces. Transient
failures are retried after a short cache window, and oversized output stays
off the Python heap.
- Benchmarks now report the default offline recall column and, when
`MIND_EMBED_CMD` is set, a second embedded re-rank column so semantic
backend gains can be measured without changing the offline baseline.
- Development identity is now `7.0.0.dev0`, distinct from the pinned stable
`6.2.10` artifact. Verbose version output includes commit and artifact hash.
- Split development source into ten domain fragments under `src/mind/` while
preserving one deterministic, standard-library-only `mind.py` artifact.
- Closed archive, signals, CRLF/BOM export, cortex ownership, failed
transaction, directional relation, journal accounting, FIPS, Windows,
command resolution, cache-bound, dash-query, conflict-age, temporary-file,
and redundant-write defects from the consolidated audit.
- Replaced per-candidate semantic processes with one versioned batch per
ranking, a total deadline, process-group termination, whole-ranking
fallback, bounded caches, explain receipts, and an optional persistent
framed sidecar.
- Added policy-gated automatic capture, quarantine approval, typed/scoped
memory, explicit user-global memory, slot conflicts, context recipes, and a
same-file stdio protocol server with seventeen tools.
- Added journal format 2 with stable event IDs and UTC nanoseconds,
deterministic three-way journal replay merge, backup/checkpoint/restore,
segmentation/compaction, doctor, growth, and crash-resumable
forget/unlink/redact/purge.
- Rebuilt mutation analysis with a green baseline preflight, complete staging,
structured classifications, bounded diagnostics, source hashes, and a
second LongMemEval-harness target.
- Added immutable LongMemEval manifests, an identical-mapping BM25 baseline,
paraphrase, bulk-ingest, thirty-session, five-year, and public raw-result
gates with privacy-safe clean-commit provenance.
- Replaced hand-maintained volatile claims with generated facts and benchmark
tables, restored English/Arabic structural parity, and documented the
default/optional security boundary and three host quickstarts.
- Added code ownership, pinned-action update automation, bounded CI jobs,
release and privacy gates, and an explicit solo-maintainer review policy.

## 6.2.10 — 2026-07-12

Expand Down
79 changes: 65 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,67 @@
# Contributing

Ground rules (they keep the tool what it is):

1. **`mind.py` stays a single stdlib-only file.** No dependencies, no
network calls in the default path. Helper tooling may live in
`bench/`/`tests/` and use whatever it needs.
2. **Every behavior change needs a test** (`tests/`, stdlib `unittest`):
`python3 -m unittest discover -s tests`
3. **Every performance or lifecycle claim needs a measurement**:
`python3 bench/bench.py` and `python3 bench/soak.py` must stay green —
both run in CI on Linux/macOS/Windows × 3 Python versions.
4. Scoped, ready-to-pick-up work lives in the
[issues](https://github.com/Da7-Tech/mind/issues).

If you're unsure, open a Discussion first — happy to scope things together.
## Invariants

1. The default kernel is deterministic, offline, and standard-library only.
2. `src/mind/` is the source of truth. Never hand-edit generated `mind.py`.
3. `python3 tools/build_single.py` must reconstruct `mind.py` byte-for-byte.
4. Plain files remain the default storage, and current plus previous formats
remain readable.
5. Recall stays a pure read. Durable writes are atomic, serialized,
recoverable, and journaled.

## Change Protocols

Every behavior change needs an absence detector or red regression test.

Storage changes must cover:

- every durable crash point;
- concurrent writers;
- the previous format;
- below, at, and beyond each size boundary;
- backup, restore, compaction, redaction, and purge behavior.

Retrieval changes must cover:

- clean and noisy corpora;
- competing vocabulary and near duplicates;
- multilingual and temporal cases;
- empty/no-result precision;
- semantic failure and whole-ranking fallback;
- immutable LongMemEval evidence.

Every bounded constant needs a crossing test and a lifecycle policy. Every
quality harness needs a green baseline preflight and a planted-defect
self-test.

## Required Local Gates

```bash
python3 tools/build_single.py --check
python3 tools/claims.py check
python3 tools/privacy_scan.py --tracked
python3 -m unittest discover -s tests -v
python3 bench/bench.py
python3 bench/multilang.py
python3 bench/discrim.py
python3 bench/slots.py
python3 bench/soak.py
python3 bench/fuzz.py --quick
python3 bench/autonomy.py --quick
```

Performance claims require immutable input, source commit, raw JSON, and a
README summary generated from that JSON. Do not edit generated facts or
benchmark tables manually.

## Review

Storage, privacy, semantic-process, protocol, workflow, and release changes
request code-owner review. Resolve every review conversation. In a
solo-maintainer repository, an administrator bypass is explicit governance
debt and is not independent review.

Scoped work lives in the
[issues](https://github.com/Da7-Tech/mind/issues). Use a Discussion when the
format, compatibility, or product boundary is still uncertain.
Loading