Axiom Engine v0.2.1-beta.1 – Fragment-Aware Idle Mesh
Pre-release
Pre-release
Highlights
- Fragment‑aware ledger and pruning: facts now carry explicit fragment metadata, surfaced in tooling and used by pruning.
- Smarter idle cycles: deterministic idle suite with per‑node visibility, fragment auditing, and health anomaly detection.
- More robust P2P + chain sync: better logging, chain alignment, and data‑quality checks across peers.
- Standalone build improvements: fixed NLP model loading inside PyInstaller binaries; updated multi‑OS build script.
- New docs: clarified how to run nodes, inspect the ledger, and understand pruning and metacognition.
Core changes
1. Fragment‑aware facts and pruning
-
Schema changes in
ledger.pyfactsnow includes:fragment_state TEXT NOT NULL DEFAULT 'unknown'fragment_score REAL NOT NULL DEFAULT 0.0fragment_reason TEXT
- New index:
idx_facts_fragment_state(created safely after migration). initialize_database()runs defensiveALTER TABLEsteps so existing DBs are migrated in place.insert_uncorroborated_fact(...)accepts and stores:fragment_state,fragment_score,fragment_reason.
-
Extractor upgrades in
crucible.py- New deterministic helper
_compute_fragment_metadata(doc, raw_sent)computes:- A rule‑based
fragment_scoreusing:- Short or moderately short sentences.
- Missing named entities.
- Pronoun‑leading sentences (“he”, “she”, “they”, “it”, “this”, “that”, …).
- Non‑terminal punctuation / lowercase starts.
- A
fragment_state('suspected_fragment'or'unknown') and a human‑readablefragment_reason.
- A rule‑based
extract_facts_from_text():- Still generates ADL summaries (
_generate_adl_summary). - Stores fragment metadata with each new fact via
insert_uncorroborated_fact.
- Still generates ADL summaries (
- New deterministic helper
-
View and inspect fragments (
view_ledger.py)- Stats header now shows (when columns exist):
fragments (suspect)fragments (confirmed)
- Recent record listing:
- Uses fragment metadata to render integrity:
FRAGMENT!forconfirmed_fragment.FRAGMENT?forsuspected_fragmentorfragment_score ≥ 0.5.- Falls back to the legacy length heuristic if fragment metadata is absent.
- Uses fragment metadata to render integrity:
- Stats header now shows (when columns exist):
-
Idle fragment audit in
node.py- New idle task
_idle_fragment_audit:- Runs at most once every 5 minutes per node.
- Randomly samples up to 40 non‑disputed facts.
- Decompresses content and applies model‑free heuristics (length, pronoun start, punctuation).
- Updates
fragment_state,fragment_score,fragment_reasonwhen they materially change. - Logs:
"[Idle-Fragment:<port>] Audited N fact(s); updated classifications for M."
- New idle task
-
Cross‑node fragment consensus
- New endpoint
GET /fragment_opinion?fact_id=...:- Returns
{ seen, status, trust_score, fragment_state, fragment_score }.
- Returns
_idle_fragment_audit:- For
suspected_fragmentfacts, queries up to 3 peers at/fragment_opinion. - If peers either don’t know the fact or also mark it fragment‑like → promotes to
confirmed_fragment. - If peers treat it as healthy (
rejected_fragmentor trusted with good trust) → demotes torejected_fragment. - Entirely rule‑based; no LLM/ML involvement.
- For
- New endpoint
-
Metacognitive pruning (
metacognitive_engine.py)prune_integrity_check(...)now considersfragment_state:- Candidates: facts older than 90 days with trust_score ≤ 2.
- Delete when:
- ADL summary is too short (
len(adl_summary) < ADL_INTEGRITY_THRESHOLD), or fragment_state == 'confirmed_fragment'.
- ADL summary is too short (
- This preferentially purges stale, low‑trust confirmed fragments and shallow facts.
2. Idle cycles, health, and diagnostics
-
Idle suite in
node.py- Background loop now:
- Runs the main ingestion cycle every
AXIOM_MAIN_CYCLE_INTERVAL(default 900s). - Runs an idle suite every
AXIOM_IDLE_SUITE_INTERVAL(default 30s).
- Runs the main ingestion cycle every
- Idle tasks (each with its own throttle):
_idle_learning_cycle_idle_conversation_training_idle_code_introspection_idle_data_quality_idle_fragment_audit_idle_health_snapshot_idle_self_checks
- Background loop now:
-
Per‑node visibility and cleaner logging
- Logs include node port, e.g.
[Idle-Health:8009],[Idle-Data:8010]. - New helper
_maybe_log_idle_throttle(...):- Logs throttle decisions at debug level, rate‑limited to once per 60s per task.
- Idle suite logging:
"[Idle-Suite:<port>] Start."is only logged when at least one idle task actually runs."[Idle-Suite:<port>] End."is emitted only in that case; fully throttled suites stay silent.
- Logs include node port, e.g.
-
Health anomaly detection
_idle_health_snapshot:- Writes snapshots via
compute_health_snapshot(db_path). - If
total_blocks > 0andtotal_facts == 0, logs a warning pointing at a possible sync anomaly (“chain without facts”).
- Writes snapshots via
-
Idle diagnostics endpoint
GET /debug/idle_statereturns:node_port,node_role,advertised_url,db_path.main_cycle_interval_sec,idle_suite_interval_sec.- Ages since last:
- main cycle, idle learning, code introspection, data quality.
- fragment audit, health snapshot, self‑checks.
3. P2P sync and chain robustness
-
Ledger sync (
p2p.py)sync_with_peer(...):- Verifies hashes using decompressed text.
- Compresses incoming fact content with
zlibbefore inserting intofacts.fact_content. - Logs and skips facts when compression fails, instead of inserting bad data.
-
Chain sync (
p2p.py+node.py)sync_chain_with_peer(...)uses the same DB path as the node, ensuring local chain height reflects the correct ledger file.bootstrap_sync()and background sync in_run_main_cycle():- No longer swallow exceptions; log warnings with peer URL and error details.
4. Standalone build + NLP model loading
-
Build script (
build_standalone.py)- Version bumped to
0.2.1-beta.1:get_version()reads frompyproject.tomlwith fallback to0.2.1-beta.1.- macOS DMG names include the version and arch:
Axiom_Node_v0.2.1-beta.1_<arch>.dmg.
- Cross‑platform behavior:
- macOS / Linux: builds
dist/AxiomNode. - Windows: builds
dist/AxiomNode.exe.
- macOS / Linux: builds
- Final instructions now print the actual executable path (
./dist/AxiomNodeor./dist/AxiomNode.exe).
- Version bumped to
-
NLP loader (
axiom_model_loader.py)- New
load_nlp_model()strategy:- First tries
import en_core_web_sm; en_core_web_sm.load(). - Falls back to
spacy.load("en_core_web_sm").
- First tries
- Works in both:
- Normal Python environments.
- PyInstaller one‑file builds, as long as
en_core_web_smis installed when building.
- New
Documentation updates
New / updated docs under docs/:
idle-cycles-and-behavior.md- Describes the idle suite, per‑node tagged logs,
/debug/idle_state, and health anomaly detection.
- Describes the idle suite, per‑node tagged logs,
ledger-pruning-refinement-fragment-awareness.md- Explains fragment metadata, idle fragment audits, and fragment‑aware pruning.
metacognitive-engine.md(updated)- Now documents pruning of both shallow‑ADL and
confirmed_fragmentfacts.
- Now documents pruning of both shallow‑ADL and
running-nodes-and-ledger-tools.md(new)- How bootstrap vs peers choose DB paths.
- How to start nodes with
PORT,AXIOM_DB_PATH,BOOTSTRAP_PEER. - How the idle suite works and how to inspect state via
/debug/idle_state. - Usage of
view_ledger.py(--stats,--brain,--limit,--db). - Operational guidance for pruning, fragments, and when (not) to reset DBs.
- Existing conceptual docs (
blockchain.md,p2p-mesh-verification.md,explain-synapse-weighting.md) remain valid and describe the blockchain layer, mesh sync behavior, and deterministic synapse‑based reasoning.
Upgrade notes
-
Database migration
- No manual migration required:
- On startup, each node will:
- Ensure all tables and indexes exist.
- Add fragment columns if missing.
- Compress legacy plaintext facts via
migrate_fact_content_to_compressed().
- On startup, each node will:
- You do not need to delete existing
axiom_ledger*.dbunless you explicitly want a clean corpus.
- No manual migration required:
-
Standalone builds
- Before running
build_standalone.py, ensure:en_core_web_smis installed in the build environment.uvis available (recommended) orPyInstalleris installed.
- Build on each target OS separately (no cross‑compiling).
- Before running
Checks
- Linting passes on:
node.pyledger.pyp2p.pycrucible.pymetacognitive_engine.pyview_ledger.py