text stringlengths 185 73.3k | repo stringlengths 7 100 | path stringlengths 4 146 | language stringclasses 7
values | hash stringlengths 16 16 | score float64 7 8.5 | stars int64 0 237k |
|---|---|---|---|---|---|---|
"""The compositional IMU, in equinox: what state costs without a contract.
The nodejax version is five nodes and one line of composition
(`imu_nodejax.py`):
imu = derivative(DT) >> derivative(DT) >> noise() >> drift(DT) >> quantizer(RES)
with state priming, key routing, and state threading all derived from
the c... | EelcoHoogendoorn/nodejax | examples/comparisons/imu/imu_equinox.py | .py | 8dc621d6fbe68d8c | 7.54 | 11 |
"""The compositional IMU, in nodejax: the version the other files chase.
Side by side with `imu_equinox.py` and `imu_flax.py`: the same sensor,
with the state container, init composition, threading and key routing
derived from the component definitions.
position -> derivative >> derivative >> noise >> drift >> quanti... | EelcoHoogendoorn/nodejax | examples/comparisons/imu/imu_nodejax.py | .py | 5a78374c9f36190d | 7.54 | 11 |
"""Shared checks for the reusable lifted-stack comparison.
Twelve behaviours are the parity contract and are asserted, so a column
that fails one stops rather than printing a prettier number.
``nests`` is measured and printed instead. It is the one criterion the
columns disagree on, and asserting it would only make t... | EelcoHoogendoorn/nodejax | examples/comparisons/lift/lift_common.py | .py | c1841ca866f06938 | 7.54 | 11 |
"""An attempt at a reusable lifted layer stack in idiomatic Flax NNX.
This is deliberately more than ``vmap`` over parameters. ``layer_stack``
attempts to reach true feature parity with nodejax stack. It
constructs independent layers, stores their complete NNX graphs on a leading
axis, and scans that axis when called.... | EelcoHoogendoorn/nodejax | examples/comparisons/lift/lift_nnx.py | .py | 07f62f0d9ba87132 | 7.54 | 11 |
"""NodeJAX's native stack under the lifted-stack parity contract.
The layer owns parameters, mutable state, apply-time randomness, and aux.
``stack`` constructs one independent row per layer and scans those rows while
feeding each clean output to the next layer.
Run directly:
python -m examples.comparisons.lift.l... | EelcoHoogendoorn/nodejax | examples/comparisons/lift/lift_nodejax.py | .py | f67de9e91c304958 | 7.54 | 11 |
"""Shared task, data and checks for the mode comparison: TRAIN AND EVAL
as a property of the program, not a flag on it.
The model carries the two classic mode-dependent members: dropout, alive
in training and gone at eval, and a batch norm, stats accumulating in
training and frozen at eval. Every column trains the sam... | EelcoHoogendoorn/nodejax | examples/comparisons/mode/mode_common.py | .py | cd8df2f8dd79c7d2 | 7.54 | 11 |
"""The mode switch, the equinox side of the comparison.
Self-contained: no nodejax import.
Equinox splits the mode across three mechanisms. Dropout takes a KEY per
call and an inference flag; BatchNorm keeps its running stats in an
eqx.nn.State object the caller threads through every forward by hand;
and the switch i... | EelcoHoogendoorn/nodejax | examples/comparisons/mode/mode_equinox.py | .py | 2b7aed05bfeb4726 | 7.54 | 11 |
"""The mode switch, the haiku side of the comparison.
Self-contained: no nodejax import.
Haiku threads the mode as an ARGUMENT: is_training rides through every
call signature that contains a mode-aware layer, hk.BatchNorm takes it
explicitly, and dropout is a plain `if` around hk.dropout with a key
drawn only on the ... | EelcoHoogendoorn/nodejax | examples/comparisons/mode/mode_haiku.py | .py | a9c9b49544bc883d | 7.54 | 11 |
"""The mode switch, the nodejax side of the comparison.
THERE IS NO MODE. Dropout's rate is a STATIC: eval is the rate-0 build,
which is the identity with no state, so a model whose only stochastic
member is dropout comes out non-cyclic. The batch norm's running stats
are ordinary cyclic state: eval freezes them at wh... | EelcoHoogendoorn/nodejax | examples/comparisons/mode/mode_nodejax.py | .py | e2269dd326b38122 | 7.54 | 11 |
"""The mode switch, the torch side of the comparison.
Self-contained: no nodejax import.
The famous spelling: ONE BIT ON THE OBJECT. model.train() and
model.eval() flip self.training on every submodule in place, and each
mode-dependent layer consults the bit at call time: Dropout draws or
passes through, BatchNorm po... | EelcoHoogendoorn/nodejax | examples/comparisons/mode/mode_torch.py | .py | 29b25f050ab55821 | 7.54 | 11 |
#!/usr/bin/env python3
"""claude_headless.py — shared `claude -p` subprocess wrapper.
Single source of truth for headless Claude Code invocations. Callers today:
- `llm_distill.py` — distill papers into source/. Text output, no tools.
- `inner_agent.py` (7.2) — autonomous-loop inner cycle. Tool allow-list... | jmsung/einstein | docs/tools/claude_headless.py | .py | 3c6cfc4cdf4b92a6 | 7.42 | 6 |
#!/usr/bin/env python3
"""concept_inventory.py — generate the wiki's concept coverage matrix.
Walks `knowledge/wiki/problems/*.md`, aggregates the `concepts_invoked`,
`techniques_used`, and `findings_produced` frontmatter lists, then
cross-checks each referent against:
1. its own page in `knowledge/wiki/{concepts,t... | jmsung/einstein | docs/tools/concept_inventory.py | .py | 47f6361be363100b | 7.42 | 6 |
#!/usr/bin/env python3
"""gap_search.py — auto-suggest source artifacts for open gap questions.
Closes the gap→ingest chain. Reads knowledge/wiki/questions/*.md with status: open,
builds a search query from the question's title + related_concepts frontmatter,
queries the arxiv API, and appends a "## Suggested sources"... | jmsung/einstein | docs/tools/gap_search.py | .py | b10090190252282c | 7.42 | 6 |
#!/usr/bin/env python3
"""inner_agent_output.py — schema + validator for the inner-agent JSON reply.
Goal 7.3 of `mb/active/feat-autonomous-loop.md`. The agent (running inside
`claude -p` per cycle) emits one JSON object matching `OUTPUT_SCHEMA`.
This module is the contract: prompt embeds the schema string, parser
enf... | jmsung/einstein | docs/tools/inner_agent_output.py | .py | 2b7562d6a6969d4a | 7.42 | 6 |
#!/usr/bin/env python3
"""inner_agent_telemetry.py — per-cycle telemetry for the LLM inner-agent path.
Phase 2 Goal 1 of `mb/active/js-feat-meta-learning-inner-agent.md`. The wired
LLM path (`autonomous_loop._try_llm_path`) is *graceful* on failure — every
error returns None and the loop falls back to mechanical — but... | jmsung/einstein | docs/tools/inner_agent_telemetry.py | .py | 2a9069b242fcf3b2 | 7.42 | 6 |
#!/usr/bin/env python3
"""llm_distill.py — Claude Code-headless distillation of extracted papers.
The wiki contract says `knowledge/source/*.md` should hold LLM-distilled summaries,
not raw extractions. This module shells out to `claude -p` (Claude Code's
headless mode) per paper to produce a Karpathy-llm-wiki-style s... | jmsung/einstein | docs/tools/llm_distill.py | .py | f5ec2c8e0c3a5dda | 7.42 | 6 |
#!/usr/bin/env python3
"""monitor.py — autonomous-loop progress dashboard.
Reads `docs/agent/cycle-log.md` (and optionally `skill-library.md`) and
prints a quick status summary:
- cumulative totals (cycles run, findings added, concepts added,
author mix)
- outcome distribution (conquered / improved / no-chang... | jmsung/einstein | docs/tools/monitor.py | .py | 77ce20c12c757309 | 7.42 | 6 |
#!/usr/bin/env python3
"""notify_milestone.py — macOS native notification on autonomous-loop milestones.
Goal 7.8c. When `auto_submit` accepts a new arena record (`submitted=True`),
the orchestrator fires a desktop notification so the human knows to check
the leaderboard. Zero-dep — calls `osascript display notificati... | jmsung/einstein | docs/tools/notify_milestone.py | .py | a5f929bb693e1560 | 7.42 | 6 |
#!/usr/bin/env python3
"""pdf_to_md.py — wrap opendataloader-pdf for math-aware ingestion.
Why this exists: /wiki-ingest's default PDF→md path reads the PDF
directly with an LLM, which loses inline LaTeX in math-heavy papers.
opendataloader-pdf (Java backend, hybrid Docling mode) is the
benchmark leader for table + fo... | jmsung/einstein | docs/tools/pdf_to_md.py | .py | 0091c7e648dd2e66 | 7.42 | 6 |
"""Priority picker for the autonomous loop — Phase 3 Goal 1.
priority = headroom × hit-rate × staleness
Replaces problem_id-ascending order for `--one-problem --by-priority` so the
unattended scheduler targets problems with real headroom instead of grinding
P1. Pure logic lives here (testable, fetcher-injectable); th... | jmsung/einstein | docs/tools/problem_priority.py | .py | 62f5c429ef84cb7c | 7.42 | 6 |
#!/usr/bin/env python3
"""promotion_candidates.py — surface source/ pages cited ≥N times cross-cycle.
Goal 4 of `js/feat/research-synthesis`. Reads the per-cycle citation sidecar
(`mb/logs/cited-sources.jsonl`), counts citations per `knowledge/source/<file>.md`
path, and writes `mb/logs/promotion-candidates.md` listin... | jmsung/einstein | docs/tools/promotion_candidates.py | .py | 97a12abaf02782ab | 7.42 | 6 |
#!/usr/bin/env python3
"""select_top.py — promote the top-N candidates in a seed-ingest JSON to approved=true.
After running `seed_ingest.py author-sweep` (or `propose`), you typically
want the top-N by relevance auto-approved without hand-editing the JSON.
This script does that: sort all candidates by relevance desce... | jmsung/einstein | docs/tools/select_top.py | .py | 13541e2112c76954 | 7.42 | 6 |
#!/usr/bin/env python3
"""strategy_picker.py — pick (prior, novel) approaches per the autoresearch 1+1 rule.
Reads `docs/agent/skill-library.md` (which tracks technique hit rates per
category) and picks two approaches for the next attempt on a given
problem:
- **prior**: highest hit-rate technique already attempted... | jmsung/einstein | docs/tools/strategy_picker.py | .py | 444afc3099a5b069 | 7.42 | 6 |
#!/usr/bin/env python3
"""wiki_lint.py — agent-native subset of the wiki-lint skill.
Runs the three structural checks from `harness/skills/wiki-lint/SKILL.md`
that don't need an LLM: orphans, broken cites, body link gaps. The
semantic checks (contradictions, stale claims) stay in the human-driven
`/wiki-lint` skill.
... | jmsung/einstein | docs/tools/wiki_lint.py | .py | 730e4c765eb4aeec | 7.42 | 6 |
"""Batched Adam optimizer for Problem 3.
Based on Jaech & Joseph (arXiv:2508.02803).
Algorithm:
Phase 1: Exploration — batch of B candidates, Adam + noise
Phase 2: Exploitation — top candidates, Adam refined
Phase 3: Upsample 4x + refine, repeat
"""
import sys
sys.path.insert(0, "src")
import json
import tim... | jmsung/einstein | scripts/autocorrelation/adam_peak_flatten.py | .py | bd512a1a413c00eb | 7.42 | 6 |
"""Chebyshev basis optimizer for Problem 3.
Inspired by Rechnitzer (arXiv:2602.07292): parameterize f using
(1-4x²)^(j-1/2) basis functions. This reduces optimization from
n=100k parameters to ~50-100 coefficients.
Also tries arcsine distribution seed (Martin & O'Bryant):
f(x) = 1/sqrt(1-4x²) — near-minimal autoconvo... | jmsung/einstein | scripts/autocorrelation/chebyshev_c2.py | .py | c69ec16e4d87f99e | 7.42 | 6 |
"""Deautoconvolution optimizer for Problem 3 (Second Autocorrelation Inequality).
Novel approach: instead of maximizing C directly, find f≥0 whose autoconvolution
is as flat as possible using EM-style multiplicative updates (Finesso & Spreij).
Target: flat autoconvolution → C close to 1.
Algorithm:
Given target g_... | jmsung/einstein | scripts/autocorrelation/deautoconv_c2.py | .py | 7133597b231245cb | 7.42 | 6 |
"""Fourier-domain alternating projections for Problem 3.
Gerchberg-Saxton style: alternate between
1. Space domain: project to f ≥ 0
2. Fourier domain: modify power spectrum |f̂|² toward flat autoconvolution
Since g = f*f has ĝ = |f̂|², a flat g means |f̂|² ≈ constant.
So we want |f̂| ≈ constant (flat spectrum) w... | jmsung/einstein | scripts/autocorrelation/fourier_proj_c2.py | .py | f4bad9a41ed93adf | 7.42 | 6 |
"""H3-cap upper bound via Lasserre level-2 SDP relaxation.
Builds the moment SDP for:
$\\sup_F (M(F) - \\lambda C(F))$
where $M(F) = 8 \\sum_k \\hat{F}_k^4$, degree-4 polynomial in $\\hat{F}_k$.
Lasserre level $\\ell = 2$: introduce moments $y_\\alpha$ for $|\\alpha| \\leq 4$,
PSD moment matrix $M_2(y) \\succeq 0... | jmsung/einstein | scripts/autocorrelation/h3_cap_lasserre.py | .py | 7e93dcf81df0041e | 7.42 | 6 |
"""H3-cap upper bound for arena P3 — v2 with linearization.
The previous version (h3_cap_sdp.py) failed because $\hat{f}_k^4$ is convex,
so maximizing $M(f) = \\sum \\hat{f}_k^4$ over a convex set is non-DCP and the
SOC lift $z_k \\geq \\hat{f}_k^2$ is one-sided (gives unbounded SDP).
Fix: linearize each convex quart... | jmsung/einstein | scripts/autocorrelation/h3_cap_sdp_v2.py | .py | 0b09385bd2d700ab | 7.42 | 6 |
"""H3-cap upper bound, v3 — cross-term added with constant majorant.
Adds the Rechnitzer eq. 8 cross-term with the simplest valid upper bound under
maximization: $|u_m|^4 \\leq H_m^4$ where $H_m = \\sum_k |L_{m,k}|$, valid
because $|\\hat{f}_k| \\leq 1$ (implied by Toeplitz PSD with $\\hat{f}_0 = 1$).
This is a *cons... | jmsung/einstein | scripts/autocorrelation/h3_cap_sdp_v3.py | .py | 4ff8842d07d6be66 | 7.42 | 6 |
"""H3-cap upper bound, v4 — Toeplitz-Carathéodory sup-norm SOS.
KEY INSIGHT (from re-reading Rechnitzer eq. 8 more carefully):
Working directly with the Fourier-series coefficients $\\hat{F}(k)$ on the
period-2 torus ($\\hat{F}(0) = 1/2$ for unit-mass $f$ extended by 0):
$\\|F * F\\|_2^2 = 8 \\sum_k |\\hat... | jmsung/einstein | scripts/autocorrelation/h3_cap_sdp_v4.py | .py | ed0ac4c7058cf3f6 | 7.42 | 6 |
"""Optimize C2 at n=400k and n=800k via transplant + Dinkelbach refinement.
Strategy:
1. Transplant 1.6M → target_n via average pooling
2. Try multiple thresholds for active region detection
3. Dinkelbach + L-BFGS refinement (CPU, float64)
4. Also try warm-starting from ClaudeExplorer's 400k SOTA
Target: C > ... | jmsung/einstein | scripts/autocorrelation/optimize_400k_800k.py | .py | 372865f52f4920e2 | 7.42 | 6 |
"""HTTP 客户端模块
处理 ``aur-packages-helper`` API 的响应语义:
- 成功:HTTP 200,body ``{"code":0,"message":"ok","data":{...}}`` → 返回 body 文本
- 错误:HTTP 状态码对齐 helper 业务码前三位,body
``{"code":<int>,"message":<str>,"data":null}``
按状态码区分两类错误:
- **永久错误**(404 包未注册 / 422 参数错误等 4xx):重试无意义,记日志后立即放弃
- **瞬时错误**(429 采集过频 / 5xx 上游错误·数据未就绪·内部错误... | awsl1414/aur-packages | scripts/fetcher/fetcher.py | .py | 47e435f071d3bc7c | 7.45 | 7 |
"""配置文件加载模块"""
import logging
import yaml
from pydantic import BaseModel, ConfigDict, Field
from constants.constants import ArchEnum, HashAlgorithmEnum
logger = logging.getLogger(__name__)
class DownloadSettings(BaseModel):
"""下载配置(回退下载路径使用)"""
model_config = ConfigDict(extra="ignore")
max_retries: ... | awsl1414/aur-packages | scripts/loaders/config_loader.py | .py | 8094e0a4f3d81fa5 | 7.45 | 7 |
#!/usr/bin/env python3
"""AUR 包自动更新工具主入口"""
import argparse
import asyncio
import logging
import sys
from core.package_updater import PackageUpdater
def _configure_logging() -> None:
"""配置日志格式"""
logging.basicConfig(
level=logging.INFO,
format="%(message)s",
handlers=[logging.StreamH... | awsl1414/aur-packages | scripts/main.py | .py | 4913aea869b46ba4 | 7.45 | 7 |
"""helper API 统一响应解析器(唯一解析器)
数据源:``aur-packages-helper`` 项目的 ``GET /api/v1/packages/{name}`` 接口。
所有上游(QQ / Navicat / Trae / Zen / PyPI)的源解析均在 helper 服务端完成,
客户端只消费统一 JSON 结构::
{
"code": 0,
"message": "ok",
"data": {
"name": "qq",
"version": "3.2.31_260710",
"urls": { "<ar... | awsl1414/aur-packages | scripts/parsers/api_parser.py | .py | 91ea4ba54aad3ee9 | 7.45 | 7 |
"""配置加载器单元测试"""
from pathlib import Path
import pytest
from constants.constants import ArchEnum
from loaders.config_loader import ConfigLoader, PackageConfig
class TestPackageConfig:
def test_defaults(self) -> None:
config = PackageConfig(
name="test",
pkgbuild="packages/test/PK... | awsl1414/aur-packages | scripts/tests/loaders/test_config_loader.py | .py | 8abac95ddaa330c6 | 7.95 | 7 |
"""hash 工具模块单元测试"""
from pathlib import Path
import pytest
from constants.constants import HashAlgorithmEnum
from utils.hash import calculate_file_hash
class TestCalculateFileHash:
"""calculate_file_hash 测试"""
def test_sha512(self, tmp_path: Path) -> None:
"""正常计算 SHA512"""
f = tmp_path / ... | awsl1414/aur-packages | scripts/tests/utils/test_hash.py | .py | fb6647c0f9b29c08 | 7.95 | 7 |
"""PKGBUILD 文件编辑器模块"""
import re
from pathlib import Path
from constants.constants import HashAlgorithmEnum
# shell 变量引用:匹配 ${VAR} 或 $VAR / $_VAR(无花括号形式)
_SHELL_VAR_RE = re.compile(r"\$\{|\$[A-Za-z_]")
# 远程 URL 协议头,如 https://、git+https://
_REMOTE_PROTO_RE = re.compile(r"^[a-z][a-z0-9+.\-]*://", re.IGNORECASE)
# sour... | awsl1414/aur-packages | scripts/updater/pkgbuild_editor.py | .py | ad65ef617ec56b98 | 7.45 | 7 |
"""基于 aria2c 的异步文件下载器模块"""
import asyncio
import shutil
import tempfile
from dataclasses import dataclass
from pathlib import Path
@dataclass(frozen=True)
class DownloadResult:
"""下载结果"""
arch: str
success: bool
file_path: Path | None = None
error: str | None = None
class Downloader:
"""
... | awsl1414/aur-packages | scripts/utils/downloader.py | .py | df3509e53d484d22 | 7.45 | 7 |
"""哈希计算工具模块"""
import hashlib
from collections.abc import Callable
from pathlib import Path
from typing import Protocol, runtime_checkable
from constants.constants import HashAlgorithmEnum
@runtime_checkable
class _Hash(Protocol):
def update(self, data: bytes, /) -> None: ...
def hexdigest(self) -> str: ...... | awsl1414/aur-packages | scripts/utils/hash.py | .py | 29fc3f87d11fa3bf | 7.45 | 7 |
"""URL 解析工具模块"""
from pathlib import Path
from urllib.parse import urlparse
def extract_filename_from_url(url: str) -> str:
"""
从 URL 中提取文件名(包含扩展名)
支持处理查询参数和片段标识符
"""
parsed_url = urlparse(url)
path = parsed_url.path
filename = Path(path).name
if not filename:
return ""
... | awsl1414/aur-packages | scripts/utils/url_utils.py | .py | b0007af77bfbd093 | 7.45 | 7 |
"""版本比较工具模块"""
from re import split
def parse_version(version: str) -> list[str]:
"""
解析版本号为可比较的组成部分
Args:
version: 版本字符串,如 "3.2.22_251203", "17.3.5"
Returns:
版本组成部分列表
Examples:
>>> parse_version("3.2.22_251203")
['3', '2', '22', '251203']
>>> parse_vers... | awsl1414/aur-packages | scripts/utils/version_utils.py | .py | 9c1cc66720b4af01 | 7.45 | 7 |
"""Audio format conversion and resampling for mic→Sonic and Sonic→speaker paths."""
import numpy as np
def preprocess_mic_audio(audio, mic_sr: int, target_sr: int = 16000, aec_channel: int | None = 0) -> np.ndarray:
"""Convert raw mic audio to float32 mono at target sample rate.
Handles bytes (int16), non-f... | OriNachum/reachy-nova | reachy_nova/audio_pipeline.py | .py | a02a209c1cbef72d | 7.6 | 15 |
"""Central model/region configuration for every Nova service (t1).
All Bedrock model IDs and the AWS region live here, env-overridable with the
previously hardcoded literals as defaults. Values are resolved at *call* time
(not import time) so ``load_dotenv()`` in an entry point takes effect no matter
the import order.... | OriNachum/reachy-nova | reachy_nova/config.py | .py | 419f3d86cea4c54a | 7.6 | 15 |
"""Face storage and lifecycle management for Reachy Nova.
Manages face embeddings with two tiers:
- Temporary: in-memory with 15-min TTL, auto-cleaned periodically
- Permanent: JSON-persisted with .npy embedding files on disk
Storage layout:
~/.reachy_nova/faces/
faces.json # metadata for all per... | OriNachum/reachy-nova | reachy_nova/face_manager.py | .py | 52626a747a5eb5b2 | 7.6 | 15 |
"""Face recognition engine for Reachy Nova.
Uses OpenCV's built-in YuNet (face detection) + SFace (face recognition).
Lightweight enough for Raspberry Pi CM4 — no insightface/ONNX GPU needed.
YuNet model: ~230KB, very fast face detector
SFace model: ~37MB, 128-dim face embeddings
Threading pattern mirrors YOLO in tr... | OriNachum/reachy-nova | reachy_nova/face_recognition.py | .py | 42f8c8b2e0f96198 | 7.6 | 15 |
"""Static validator for forged skills — AST-only, never imports.
A forged skill (generated at runtime by the skill-forge) may only compose the
sanctioned reaction primitives exposed on the injected ``ctx`` object. This
module is the gate in front of activation: it parses ``executor.py`` with
:mod:`ast` and rejects any... | OriNachum/reachy-nova | reachy_nova/forge_validator.py | .py | 41f3d11ca73131dd | 7.6 | 15 |
"""Cognition feed emitter — reachy-mini-cli's export-schema NDJSON contract.
Mirrors ``reachy-mini-cli``'s cognition feed
(``docs/export-schema.md``, ``reachy/export/events.py``): the same three block
types, the same key ordering, the same compact/`ensure_ascii=False` wire
format, so a consumer written against that fe... | OriNachum/reachy-nova | reachy_nova/harness/cognition_feed.py | .py | 9f41032f0e73d36c | 7.6 | 15 |
"""A small, queryable memory of what the harness actually injected (t8).
Every stage of the sensory pipeline already gets one grep-able senselog line
(``sensory_log.stage``), but a log line is not something Nova can read back
mid-conversation. This module is the read seam behind the ``recall_senses``
tool (see ``reach... | OriNachum/reachy-nova | reachy_nova/harness/sense_history.py | .py | 9a270770bc4e1af8 | 7.6 | 15 |
"""State-dir resolution + peer-liveness checks, mirroring reachy-mini-cli.
The wire contract is filesystem paths under one state dir:
- ``$REACHY_STATE_DIR`` -> ``$XDG_STATE_HOME/reachy`` -> ``~/.local/state/reachy``
- intents spool: ``<state>/behavior/intents/{commands,results}/``
- reload spool: ``<state>/behavi... | OriNachum/reachy-nova | reachy_nova/harness/statedir.py | .py | 07a77f2fa42089e6 | 7.6 | 15 |
"""The harness's systemd ``--user`` unit — pure text, plus a thin installer.
Mirrors ``reachy-mini-cli``'s ``reachy/service/units.py`` grammar
(``Type=simple`` / ``Restart=on-failure`` / ``RestartSec=5`` /
``WantedBy=default.target`` / an ``ExecStart`` that re-invokes a named
interpreter against a ``-m`` module entry,... | OriNachum/reachy-nova | reachy_nova/harness/unit.py | .py | 8ab0a916c06e0ccb | 7.6 | 15 |
"""Shared movement math utilities for Reachy Mini motion animation."""
import numpy as np
def ease_sin(t: float, freq: float) -> float:
"""Pure sine wave — naturally smooth, decelerates at peaks."""
return np.sin(2.0 * np.pi * freq * t)
def ease_sin_soft(t: float, freq: float) -> float:
"""Sine-of-sine... | OriNachum/reachy-nova | reachy_nova/movement_math.py | .py | 92526f43e1de9786 | 7.6 | 15 |
"""Pure failover policy for the dual-network never-downtime harness (task t2).
This module decides *what to do*, never *how to do it*. It has no I/O, no
``subprocess``, no ``nmcli`` calls, and it never reads the clock itself —
every call to :meth:`Policy.decide` is handed an :class:`Observation` built
by the caller (a... | OriNachum/reachy-nova | reachy_nova/netpolicy.py | .py | c2da28f673efc0c5 | 7.6 | 15 |
"""Nova Act - Browser automation triggered by voice commands.
Gated behind ``NOVA_ACT_ENABLED`` (default off, see :func:`act_enabled`).
When the flag is off, no code path in this module imports ``nova_act`` or
``playwright`` — those imports are function-local (inside
``_ensure_workflow``/``_execute_task``, on the enab... | OriNachum/reachy-nova | reachy_nova/nova_browser.py | .py | 72d40e8ae37da238 | 7.6 | 15 |
"""Nova Feedback - RLHF feedback capture for Reachy Nova.
Records multimodal feedback packages (conversation, camera frames, audio)
for future reinforcement learning from human feedback. Each feedback event
creates a timestamped folder with metadata, messages, JPEG frames, and a
WAV audio file.
Supports three storage... | OriNachum/reachy-nova | reachy_nova/nova_feedback.py | .py | ed0c41c27b2d6426 | 7.6 | 15 |
"""MQTT nervous system bridge for Reachy Nova.
Publishes state changes and events, subscribes to inject commands.
"""
import json
import logging
import os
import time
import uuid
from collections.abc import Callable
logger = logging.getLogger(__name__)
class NovaMQTT:
"""MQTT client wrapper for the Nova nervou... | OriNachum/reachy-nova | reachy_nova/nova_mqtt.py | .py | 7fc557fd00c2d7a0 | 7.6 | 15 |
"""Nova Slack - Slack integration for Reachy Nova using Socket Mode.
Connects to Slack via slack-bolt (Socket Mode, no public URL needed).
Publishes events to MQTT; the Nervous System handles interrupt decisions.
"""
import logging
import os
import threading
import time
from collections import deque
from collections.... | OriNachum/reachy-nova | reachy_nova/nova_slack.py | .py | 85c4487348d8cdd7 | 7.6 | 15 |
"""Nova Vision - Camera frame analysis via Amazon Bedrock Nova 2 Lite."""
import base64
import json
import logging
import threading
import time
from collections import deque
from collections.abc import Callable
import cv2
import numpy as np
from . import config
import boto3
logger = logging.getLogger(__name__)
DEF... | OriNachum/reachy-nova | reachy_nova/nova_vision.py | .py | 8bd5f4e775696838 | 7.6 | 15 |
"""Safety Manager for Reachy Nova.
Enforces head-body collision avoidance with head-priority resolution.
The head is treated as "self" — the body adjusts to accommodate head movements,
creating organic coordinated motion (body follows head at extremes).
Simplified from conversation_app's SafetyManager: no roll handli... | OriNachum/reachy-nova | reachy_nova/safety.py | .py | 3d94ee7f1b897195 | 7.6 | 15 |
#!/usr/bin/env python3
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
"""
Version bumping script for mockloop-mcp.
This script automate... | MockLoop/mockloop-mcp | scripts/bump_version.py | .py | 097a55beb033612c | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
#!/usr/bin/env python3
"""
MockLoop MCP Package Monitoring Script
This script monitors P... | MockLoop/mockloop-mcp | scripts/monitor_package.py | .py | 5b3fa65253efe682 | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
#!/usr/bin/env python3
"""
Release preparation script for mockloop-mcp.
This script prov... | MockLoop/mockloop-mcp | scripts/prepare_release.py | .py | 65d7a93935a75d44 | 7.62 | 16 |
#!/usr/bin/env python3
"""
Batch Schema Signing Utility
This script discovers and signs all MCP tools in the codebase using the
SchemaSigner class. It supports specifying private keys and domains via
command line arguments.
Usage:
python scripts/sign_all_schemas.py --domain example.com --private-key /path/to/key.... | MockLoop/mockloop-mcp | scripts/sign_all_schemas.py | .py | a6924b3bbff82956 | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
"""
Log analysis utilities for MockLoop servers.
"""
from collections import Counter, de... | MockLoop/mockloop-mcp | src/mockloop_mcp/log_analyzer.py | .py | 234e181208676748 | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
import json
import logging
from pathlib import Path
from typing import Any
import reques... | MockLoop/mockloop-mcp | src/mockloop_mcp/parser.py | .py | 507e8452c2ffba0b | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
"""
Authentication Handler
Manages authentication and authorization for proxy requests,
... | MockLoop/mockloop-mcp | src/mockloop_mcp/proxy/auth_handler.py | .py | 4a41db3ab0fac082 | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
"""
Proxy Configuration
Configuration models and settings for the MCP proxy functionalit... | MockLoop/mockloop-mcp | src/mockloop_mcp/proxy/config.py | .py | d9dde05e580faac3 | 7.62 | 16 |
# Copyright (c) 2025 Jascha Wanger / Tarnover, LLC
# SPDX-License-Identifier: MIT
#
# This file is part of the MockLoop project. (https://mockloop.com)
# You may obtain a copy of the license at https://opensource.org/licenses/MIT
"""
Proxy Handler
Handles API proxy requests, routing them between mock and production e... | MockLoop/mockloop-mcp | src/mockloop_mcp/proxy/proxy_handler.py | .py | 31c014b372e67e59 | 7.62 | 16 |
"""
SchemaPin Configuration Module
Defines configuration classes and data structures for SchemaPin integration.
"""
import json
from dataclasses import dataclass, field
from enum import Enum
from typing import Any
class PolicyAction(Enum):
"""Policy enforcement actions."""
ALLOW = "allow"
BLOCK = "block... | MockLoop/mockloop-mcp | src/mockloop_mcp/schemapin/config.py | .py | 4ad3dd65c3869733 | 7.62 | 16 |
"""Backfill vectors for memories written while embedding was unavailable.
The public ``backfill`` function deliberately depends on a small database and
embedder protocol. This keeps the operation testable and lets the live
runner provide the same store/backend that the MCP server uses.
"""
from __future__ import ann... | n24q02m/mnemo-mcp | scripts/backfill_embeddings.py | .py | a5563309a8843f61 | 7.52 | 10 |
#!/usr/bin/env python3
"""Pre-commit hook: prevent ASCII rewriting of Vietnamese diacritics + Unicode punctuation.
Blocks commits that replace:
1. Unicode punctuation (em-dash, ellipsis, arrows, smart quotes) with ASCII equivalents.
2. Vietnamese diacritics with bare vowels (NFD-strip or transliteration).
3. Emo... | n24q02m/mnemo-mcp | scripts/preserve-diacritics.py | .py | b82b572dc4ab9662 | 7.52 | 10 |
"""Alembic environment for mnemo-mcp.
This environment is tuned for SQLite + WAL and raw-SQL migrations
(``op.execute(...)`` style). We do not use SQLAlchemy ORM models, so
``target_metadata`` is set to ``None`` and ``autogenerate`` is not used.
The database URL is resolved at runtime from the ``MNEMO_DB_PATH`` envir... | n24q02m/mnemo-mcp | src/mnemo_mcp/alembic/env.py | .py | 2f22ef4b70ff9b47 | 7.52 | 10 |
"""Baseline revision: lock existing schema.
This revision is intentionally a no-op. It exists to anchor the migration
chain at the schema produced by ``MemoryDB._init_schema`` prior to Alembic
adoption (memories + memories_fts + memories_vec + entities + relations +
memory_entities + archived_memories, with the pre-Al... | n24q02m/mnemo-mcp | src/mnemo_mcp/alembic/versions/baseline_001_existing_schema.py | .py | 4d7c50df9c6e7aa4 | 7.52 | 10 |
"""Add context_type and archived_at columns to memories table.
Implements ``mem_001_context_types`` from the Phase 1 design (spec
``2026-04-19-mnemo-v2-design.md`` §6). Adds:
* ``context_type TEXT NOT NULL DEFAULT 'conversation'`` — supports
conversation/fact/preference/skill/task/decision typing for the new
``me... | n24q02m/mnemo-mcp | src/mnemo_mcp/alembic/versions/mem_001_context_types.py | .py | 09855924f39f0b70 | 7.52 | 10 |
"""Add compression columns and sync_state table.
Implements ``mem_002_compression`` from the Phase 2 design (spec
``2026-04-19-mnemo-v2-design.md`` §6). Adds:
* ``memories.text_raw TEXT`` - original uncompressed text retained for audit /
recovery when compression rewrites ``memories.content``.
* ``memories.compress... | n24q02m/mnemo-mcp | src/mnemo_mcp/alembic/versions/mem_002_compression.py | .py | 9419aa849c4f1cf4 | 7.52 | 10 |
"""Add store_meta key/value table for vector-store embedding identity.
The vector store records the ``(embedding_model, embedding_dims)`` that
produced its stored vectors so a later embedding-model change cannot silently
mix incompatible vectors and corrupt similarity search (guarded in
``db.MemoryDB._guard_embedding_... | n24q02m/mnemo-mcp | src/mnemo_mcp/alembic/versions/mem_004_store_meta.py | .py | 674f6d8a1ae5f001 | 7.52 | 10 |
"""Console-script entry: mounts the shared mcp_core CLI builder.
Bare invocation and any leading-dash argv (e.g. --http) start the server
exactly as before; subcommands run one-shot operator actions.
"""
from __future__ import annotations
import argparse
import asyncio
import json
import sys
from mcp_core import bu... | n24q02m/mnemo-mcp | src/mnemo_mcp/cli.py | .py | 8da1b24ac99ca58f | 7.52 | 10 |
"""Tamper-evident audit chain primitives (spec §4.1).
Per-tenant HMAC-SHA256 chain: event_hash = HMAC(key, prev_hash || canonical).
Keys come from skret-injected env at deploy time (C2) — never from this repo.
"""
from __future__ import annotations
import hashlib
import hmac
import json
import uuid
from dataclasses ... | n24q02m/mnemo-mcp | src/mnemo_mcp/enterprise/audit.py | .py | 1069be6956ef37e0 | 7.52 | 10 |
"""Verified-identity principal for the enterprise profile.
A PrincipalContext is built ONLY from JWT claims that mcp-core already
verified (server.py auth_scope). Tool arguments can never mint one.
"""
from __future__ import annotations
from collections.abc import Mapping
from contextvars import ContextVar
from data... | n24q02m/mnemo-mcp | src/mnemo_mcp/enterprise/identity.py | .py | 2de549111aaa9f8f | 7.52 | 10 |
"""Custom exceptions for Mnemo MCP Server."""
from __future__ import annotations
class EmbeddingModelMismatch(RuntimeError):
"""Raised when the active embedding identity differs from the stored one.
The vector store records the ``(embedding_model, embedding_dims)`` that
produced its stored vectors. Open... | n24q02m/mnemo-mcp | src/mnemo_mcp/exceptions.py | .py | ccb246df65e66d15 | 7.52 | 10 |
"""Lightweight knowledge graph: entity extraction + relation management."""
import json
import uuid
from datetime import UTC, datetime
from loguru import logger
def _has_llm_provider() -> bool:
"""Check if any LLM provider API key is available."""
from mnemo_mcp.credential_state import has_llm_provider
... | n24q02m/mnemo-mcp | src/mnemo_mcp/graph.py | .py | ab21b2ef4b22b397 | 7.52 | 10 |
"""Multi-provider LLM dispatch layer (Phase 1 foundation).
Provides a single ``call_llm`` entry point that auto-detects the active
provider from environment variables and dispatches via ``mcp_core.llm``
(litellm passthrough). The priority order matches the spec
(`2026-04-19-mnemo-v2-design.md` §4.2):
1. Gemini (`... | n24q02m/mnemo-mcp | src/mnemo_mcp/llm.py | .py | 0113121ce81e8982 | 7.52 | 10 |
"""Credential resolution for mnemo-mcp.
Resolution order (relay only when ALL local sources are empty):
1. ENV VARS -- User explicitly set (highest priority, skip everything)
2. RELAY CONFIG -- Saved from previous relay setup (~/.config/mcp/config.enc)
3. RELAY SETUP -- Interactive, ONLY when steps... | n24q02m/mnemo-mcp | src/mnemo_mcp/relay_setup.py | .py | 194067cfca5f7076 | 7.52 | 10 |
"""Setup tool -- warmup and setup-sync logic as MCP-callable functions.
Extracted from __main__.py CLI commands and server.py config tool into
async functions that return structured dicts for MCP tool responses.
"""
import asyncio
import os
import shutil
from pathlib import Path
from loguru import logger
from mnemo... | n24q02m/mnemo-mcp | src/mnemo_mcp/setup_tool.py | .py | d0c3d24d639d2bdc | 7.52 | 10 |
"""Abstract base class for passport-sync backends (Phase 2).
Each backend (gdrive, s3, ...) implements the same four-method contract so the
sync orchestrator can push delta bundles, pull full passports, query the
remote sequence cursor, and probe health uniformly.
The bundle bytes themselves are produced by :mod:`mne... | n24q02m/mnemo-mcp | src/mnemo_mcp/sync/base.py | .py | 559bacf43118002c | 7.52 | 10 |
"""S3-compatible passport-sync backend (Phase 2 Task 5).
Implements :class:`SyncBackend` against any S3-compatible object store
(AWS S3, Cloudflare R2, Backblaze B2, MinIO, etc.) via boto3. The same
opaque-bundle layout used by ``GDriveBackend`` applies here -
``<prefix>/seq-NNNNNN.bin`` keyed by monotonic sequence nu... | n24q02m/mnemo-mcp | src/mnemo_mcp/sync/s3.py | .py | d67f3179a37fc70d | 7.52 | 10 |
"""Phase 3 KG-aware queries: entity_search / entity_graph / history / as_of.
Spec § 4.3 Phase 3 actions. These are read-only helpers consumed by
``memory(action="entity_search"|"entity_graph"|"history")`` in
:mod:`mnemo_mcp.server`. They live outside ``db.py`` so the temporal-KG
surface stays modular and swappable.
""... | n24q02m/mnemo-mcp | src/mnemo_mcp/temporal/queries.py | .py | f690b5f8382fe207 | 7.52 | 10 |
"""Phase 3 entity resolution: cross-memory dedup via embedding + name match.
When the LLM extracts the same real-world entity twice (e.g. "FastAPI" and
"Fast API", "K8s" and "Kubernetes") under different name strings, the
naive ``upsert_entities`` path stores both as distinct rows because the
unique index keys on ``(n... | n24q02m/mnemo-mcp | src/mnemo_mcp/temporal/resolve.py | .py | 2b527f28a8b1e842 | 7.52 | 10 |
"""Local token storage for OAuth tokens.
Stores tokens in ~/.mnemo-mcp/tokens/<provider>.json with secure
file permissions (0600). Eliminates the need to paste long tokens
into MCP config -- tokens are persisted locally after the
first interactive OAuth flow.
Token lifecycle:
1. First run: no token -> Device Code OAu... | n24q02m/mnemo-mcp | src/mnemo_mcp/token_store.py | .py | ce80e1066ef2113b | 7.52 | 10 |
import logging
from typing import Any, Literal, cast
_applied = False
TelemetryModelName = Literal["SecurityEvent", "SecurityMetric", "EventBatch"]
def _mute_pydantic_plugin_instrumentation() -> None:
"""Opt guard-agent's hot-path telemetry models out of pydantic plugin
instrumentation (e.g. logfire.instrum... | rennf93/guard-core | guard_core/_pydantic_plugin_mute.py | .py | b049452c302bba6b | 7.45 | 7 |
"""
Claude Agent SDK ドキュメントクローラ
このスクリプトは https://platform.claude.com/docs/ja/agent-sdk/ 配下の
ドキュメントを再帰的にクローリングして、Markdown形式で保存します。
URLに.mdを付けることで、直接マークダウン形式でコンテンツを取得できます。
"""
import os
import re
import time
from urllib.parse import urljoin, urlparse
from pathlib import Path
from typing import Set, Optional, Tuple
im... | is0383kk/claude-multi-agent-api-server | docs/script/crawler.py | .py | 7f1cd7465f66ee23 | 7.57 | 13 |
"""
Sample client code for Claude Agent SDK API
This module provides a sample client implementation
for using the Claude Agent SDK API.
"""
import time
from typing import Dict, Optional
import requests
class ClaudeAgentClient:
"""
Client class for Claude Agent SDK API
Wrapper class for interacting wit... | is0383kk/claude-multi-agent-api-server | examples/client_example.py | .py | b5d313a173634f12 | 7.57 | 13 |
"""
FastAPI application for Claude Agent SDK
Provides a web service for asynchronous execution of Claude Agent SDK via HTTP endpoints.
"""
import os
from typing import Any, Dict, List, Union
from claude_agent_sdk import ClaudeAgentOptions
from fastapi import FastAPI, HTTPException, Path
from fastapi.middleware.cors ... | is0383kk/claude-multi-agent-api-server | main.py | .py | 00ae87eddaae954b | 7.57 | 13 |
"""
FastAPI request/response models for Claude Agent SDK API
Defines data structures for API requests and responses.
"""
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field, field_validator
class SessionStatus(str, Enum):
"""Enumeration representing session ... | is0383kk/claude-multi-agent-api-server | models.py | .py | a1a3cd7143c92e3b | 7.57 | 13 |
#!/usr/bin/env python3
"""Validate the YAML frontmatter of SKILL.md files.
A SKILL.md whose frontmatter fails to parse loads at runtime with *empty
metadata* — every field (including the `description` that drives auto-activation)
is silently dropped. `claude plugin validate` does NOT parse skill frontmatter,
so this h... | aaif/community-events | scripts/check_frontmatter.py | .py | 6408eeed2f3baf95 | 7.45 | 7 |
#!/usr/bin/env python3
"""Fail if any script accepts a token, key, or secret as a command-line flag.
argv is public: it shows in `ps`, in shell history, in CI logs, and an agent
running the script echoes the full command line to the console. Secrets come
in through environment variables (or the gitignored `.env` / the... | aaif/community-events | scripts/check_no_secret_args.py | .py | 5b68507c166dc6f2 | 7.45 | 7 |
#!/usr/bin/env python3
"""Assert the "Tooling rule" banner is byte-identical in every SKILL.md that carries it.
The rule (gws + Python only, native Google formats, never LibreOffice) has to be
duplicated into each SKILL.md because the skills ship downstream on their own —
CLAUDE.md does not travel with them. Duplicati... | aaif/community-events | scripts/check_tooling_banner.py | .py | 6e1929f83dfefc3e | 7.45 | 7 |
#!/usr/bin/env python3
"""Self-tests for the design-token extractor.
Standalone (not pytest) to match the repo's other `scripts/test_*.py`, which CI
runs directly.
The failure this guards against is silent by construction: a bad extraction
still writes a file, `--check` then compares the committed copy against the sa... | aaif/community-events | scripts/test_extract_design_tokens.py | .py | ba2f15c8af363735 | 7.95 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.