asi-integration-architecture
Skill2 starsChanged 40 days agoApache-2.0View on GitHub
Use when integrating ASI as native in-process tools.
In this repository303 other files it gives its agents.
- AGENTS.mdAGENTS.md
- a2a-brain-meshlearn-verifySkill
- apple-notesSkill
- apple-remindersSkill
- findmySkill
- imessageSkill
- asi-core-integrationSkill
- asi-narrativeSkill
- asi-research-labSkill
- asi-capability-summarySkill
- asi-coreSkill
- asi-identitySkill
- auto-env-checkerSkill
- auto-best-practice-from-officialSkill
- auto-competitor-intelligence-ai-codingSkill
- auto-competitor-intelligence-an-aiSkill
- auto-competitor-intelligence-autogpt-improvemSkill
- auto-competitor-intelligence-claudepowered-aiSkill
- auto-competitor-intelligence-contractmd-theSkill
- auto-competitor-intelligence-crush-glamourousSkill
- auto-competitor-intelligence-devin-aiSkill
- auto-competitor-intelligence-electricity-useSkill
- auto-competitor-intelligence-intent-weavingSkill
- auto-competitor-intelligence-jetbrains-idesSkill
- auto-competitor-intelligence-jetbrains-zedSkill
- auto-competitor-intelligence-layerfs-aSkill
- auto-competitor-intelligence-mouse-precisionSkill
- auto-competitor-intelligence-okf-agentSkill
- auto-competitor-intelligence-opencode-aiSkill
- auto-competitor-intelligence-opencode-openSkill
- auto-competitor-intelligence-openhands-agentSkill
- auto-competitor-intelligence-pythonopenaichatSkill
- auto-competitor-intelligence-some-uncomfortabSkill
- auto-competitor-intelligence-stack-overflowSkill
- auto-competitor-intelligence-the-secretSkill
- auto-competitor-intelligence-things-iSkill
- auto-competitor-intelligence-undisclosed-addiSkill
- auto-competitor-intelligence-we-askedSkill
- auto-competitor-intelligence-what-iSkill
- auto-efficiency-learning-advanced-quantizatioSkill
- auto-efficiency-learning-a-visualSkill
- auto-efficiency-learning-edge-aiSkill
- auto-efficiency-learning-efficientqat-llmSkill
- auto-efficiency-learning-finetuning-llmsSkill
- auto-efficiency-learning-ondevice-llmSkill
- auto-efficiency-learning-pushing-theSkill
- auto-efficiency-learning-quantization-techniqSkill
- auto-efficiency-learning-quip-2bitSkill
- auto-efficiency-learning-ragkit-withSkill
- auto-efficiency-learning-show-hnSkill
- auto-efficiency-learning-small-languageSkill
- auto-efficiency-learning-splitquantv2-enhanciSkill
- auto-efficiency-learning-towards-optimalSkill
- auto-efficiency-learning-vptq-extremeSkill
- auto-explain-how-sleep-consolidationSkill
- auto-how-does-energy-efficiencySkill
- auto-internet-learning-40-ofSkill
- auto-internet-learning-ai-agentSkill
- auto-internet-learning-ai-agentsSkill
- auto-internet-learning-amazon-ceoSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Import their core logic from the existing scripts/training/*.py via sys.path.insert + importlib.import_module (no subprocess)
- Very specific: line 79
Do NOT add new external scripts as standalone cron jobs: Add a subsystem to tools/asi/heartbeat.py instead.
- Very specific: line 80
Direct import over subprocess: Always try importlib.import_module + mod.function() first.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ASI Integration Architecture
Class-level pattern for how ASI capabilities are built into OpenAmer: native in-process tools, not standalone scripts. All 104 cron jobs → 1 ASI Heartbeat with 10 subsystem pulses.
Core Rule
ASI capabilities are NOT standalone .py scripts called via subprocess. They are native tools/asi_*.py or tools/asi/*.py modules that:
registry.register()at module level — same as all other tools- Import their core logic from the existing
scripts/training/*.pyviasys.path.insert+importlib.import_module(no subprocess) - Fall back to
subprocess.run()only when a script has side effects at module level and cannot be imported cleanly - Export 1-5 model-accessible tools (asi_status, asi_think, asi_learn, asi_remember, asi_trigger)
- Are part of the
asitoolset intoolsets.py
Heartbeat Architecture (replaces 104 cron jobs)
Single asi-heartbeat-tick cron job (every 5 min) runs scripts/asi_heartbeat.py which calls tools/asi/heartbeat.Heartbeat.tick(). Each subsystem has its own cadence:
| Subsystem | Cadence | What it does |
| darwin | 15m | Skill evolution, autopatch, publish |
| swarm | 30m | Multi-agent coordination, autonomous loop |
| a2a | 240m | Brain export, peer communication |
| learning | 5m | Internet learner, active learn, self-model, KTA |
| senses | 30m | Circadian rhythm, watchtower, trend scout |
| system | 5m | Self-healer, resource monitor, traffic cop, smart cache |
| security | 240m | Bugbot, CVE scan, pen tester, code review |
| outreach | 180m | Social & GitHub outreach, growth |
| infra | 30m | Browser, env-check, plugin loader, mesh daemon |
| meta | 60m | Self-reflection, self-rewriter, metacognition, goal engine |
State persisted in memory/asi_heartbeat.json (last_run per subsystem survives cron process restarts).
Key Files
| File | Role |
tools/asi_core.py | 5 ASI tools (asi_status, asi_think, asi_learn, asi_remember, asi_trigger) |
tools/asi/__init__.py | Subsystem package namespace |
tools/asi/self_model.py | Self-model — wraps scripts/training/self_model.py |
tools/asi/world_model.py | World model — wraps scripts/training/world_model.py |
tools/asi/reasoning.py | Recursive reasoning — wraps scripts/training/reasoning_loop.py |
tools/asi/prediction.py | Prediction validation — wraps scripts/training/predict_validate.py |
tools/asi/improvement.py | Self-improvement — wraps scripts/training/self_improve.py |
tools/asi/heartbeat.py | Zentraler Herzschlag mit 10 Subsystem-Pulsen |
scripts/asi_heartbeat.py | Cron-Einstiegspunkt für den Heartbeat |
toolsets.py | asi-toolset registriert + Tools in _OPENAMER_CORE_TOOLS |
Pitfalls
- An organ can be BUILT and still DEAD (orphaned). A subsystem script that
runs fine by hand is dead if no cron schedules it AND no subsystem lists it in
scripts=[...]. Found this way:homeostasis/calibration/metacognitionwere runnable but appeared in neither list → never ticked, whilelast_status: okproved nothing. Audit: (1) missing? scan for expected organ names; (2) orphaned? check each existing organ appears in a subsystemscripts=[...]or a cron; (3) wire it in AND raise that subsystem'stimeoutif the list grew (observed:meta15 scripts →timeout=180,system→240, or the tick cuts the organ off). - A TICK must PROBE, never RUN the heavy job. A subsystem tick runs every few
minutes; a full filesystem backup in a tick took ~7 min and blew the timeout.
Split it: the CRON does the labour, the heartbeat runs a light
*_health.pyfreshness probe (mtime age vs threshold), silent when healthy. - A no-arg script invoked bare by a cron must DO the useful thing. If a new
organ's
main()falls through toprint_help()on no args, its cron is a silent no-op (frozen state,last_statusstaysok). Test with ZERO arguments and assert it acted, not that it printed usage. tools/asi/heartbeat.pyhas multiple writers (cron commits/pushes too). Confirm no foreignindex.lockbefore editing; never delete a foreignindex.lock; land changes on a branch rather than a sharedmainother crons also push to.- Full recipe (three-pass audit, probe-vs-run split, wiring table): see
autonomous-learning-architecture→references/heartbeat-organ-wiring.md. - Do NOT add new external scripts as standalone cron jobs. Add a subsystem to
tools/asi/heartbeat.pyinstead. - Direct import over subprocess. Always try
importlib.import_module+mod.function()first. Fall back tosubprocess.run()only when import fails due to module-level side effects. - State persistence matters. The heartbeat cron is a separate process each tick. Use
memory/asi_heartbeat.jsonfor last-run timestamps, not in-memory state. - Subsystem cadences must not be shorter than the heartbeat interval (5 min). Use 5, 15, 30, 60, 120, 180, 240, 360, 720, or 1440 minutes.
- asi_trigger(capability='heartbeat', params={'system': '...', 'force': true}) triggers heartbeat live during a session.
The integrated cycle: chaining blocks in ONE run (2026-10-11)
Ticking blocks separately is this architecture's default failure: each subsystem runs its scripts on its own cadence and nothing links them. Measured cost (live, this laptop):
world model: 484 facts | 168 predictions | 0 corrections
calibration: 19/204 correct -> adjustment floored at 0.3The system predicted 168 times and NEVER turned a failed prediction into a
correction — because training/predict_validate.py and training/self_model.py
were ticked in SEPARATE subsystems, and nothing ever saw a prediction together
with its outcome.
tools/asi/cognition.py closes that. ONE cycle() run chains
perceive -> recall -> predict (calibrated) -> score -> correct -> validate -> reflectand uses world_model + prediction + self_model in the same pass. It writes
kind="correction" edges — the first corrections this store ever held.
Native subsystems (no cron behind them)
A subsystem normally derives its scripts from jobs.json via cron_ids
(_reconcile_scripts). An integrated loop has no cron job, and wiring one would
be the cron-wrapper anti-pattern. Subsystem(native=True) marks it:
reconciliation skips it, its explicit script list stays, and the script is routed
by native_map ("cognition_cycle.py" -> "tools.asi.cognition.cycle").
Register in _init_subsystems with cron_ids=[], native=True, timeout=300.
Traps the integration exposed (all real, all fixed)
- The wrapper did not mirror the real module.
tools/asi/world_model.recallhad noexclude;tools/asi/predictionexposedapply_confidence_adjustmentswhile the real module definesapply_confidence_to_new_predictions. Nothing noticed, because the blocks were never called in a chain. Chain them and their signatures diverge. Check signatures before wiring. - An edge is always its own nearest neighbour (cosine 1.0). A first version
scored 4/4 "hit" at sim=1.0 — it was confirming itself. Fix needs BOTH
recall(..., exclude={edge_key})AND dropping priors whosetsis not strictly older than the observation; either alone still self-confirms. python tools/asi/<module>.pyputstools/asi/onsys.path[0], so a wrapper'simportlib.import_module("<name>")re-imports ITSELF →RecursionError. Remove the script directory fromsys.pathfirst.OPENAMER_HOMEmust be a native path. An MSYS/c/...value makes everySCRIPTS_TRAININGlookup miss →ModuleNotFoundError: world_model.- A native function called bare by the tick must be safe with no args. The
heartbeat calls
cycle()with nothing; every parameter needs a default.
See references/cognition-cycle-integration-2026-10-11.md for the full integration story: the 5 traps discovered (signature drift, self-match, sys.path recursion, OPENAMER_HOME path form, bare-call safety), the native subsystem pattern (Subsystem(native=True) + native_map), correction path proof (first corrected: true in system history), and the canonical repo ship via scripts/ship.py with CRLF normalization.
export OPENAMER_HOME="C:/Users/<u>/AppData/Local/openamer-laptop" # native!
cd <install>/openamer-agent
./venv/Scripts/openamer.exe asi cycle --status
./venv/Scripts/openamer.exe asi cycle --limit 6 # autonomous
./venv/Scripts/openamer.exe asi cycle --situation "X" --effect "Y" # proves the correction path
./venv/Scripts/openamer.exe asi heartbeat --tick --system cognition --force
<laptop-venv>/Scripts/python.exe -m pytest tests/tools/test_asi_cognition.py -qVerification
# Test all imports (no subprocess)
cd /c/Users/damir/AppData/Local/openamer-laptop/openamer-agent
python -c "from tools.asi_core import get_asi_core; from tools.asi.heartbeat import get_heartbeat"
# Full heartbeat status
python tools/asi/heartbeat.py --status
# Dry-run one subsystem
python tools/asi/heartbeat.py --tick --system infra --force
# Registry test
scripts/run_tests.sh tests/tools/test_registry.pyDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

