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
"""Agent orchestration for live NFL betting operations. Provides specialized agents that independently analyze betting opportunities, plus a coordinator that merges their recommendations into consensus decisions. """ from __future__ import annotations from dataclasses import dataclass, field from datetime import dat...
mattleonard16/nflalgorithm
agents/__init__.py
.py
549be2ba5e0ff357
7.52
10
"""Agent coordinator: runs all agents and produces consensus decisions. The coordinator executes each specialized agent, merges their reports per player/market combination, resolves conflicts using consensus logic, and persists final decisions to the ``agent_decisions`` table. """ from __future__ import annotations ...
mattleonard16/nflalgorithm
agents/coordinator.py
.py
5a12a750295eebda
7.52
10
"""Market bias detection agent. Wraps the TE market bias analysis module and checks for position-specific market inefficiencies that represent structural mispricing opportunities. """ from __future__ import annotations from typing import Dict, List, Optional from agents import AgentReport from agents.base_agent imp...
mattleonard16/nflalgorithm
agents/market_bias_agent.py
.py
9d0e2aebd1d68a3e
7.52
10
"""Model diagnostics agent. Investigates projection-vs-market gaps and flags players where the model's projection deviates suspiciously from the market line. Uses volatility scores and confidence scoring to determine which projections are least reliable. """ from __future__ import annotations from typing import List...
mattleonard16/nflalgorithm
agents/model_diagnostics_agent.py
.py
d7585e845b761f62
7.52
10
"""NBA agent coordinator: runs all NBA agents and produces consensus decisions. Reuses sport-agnostic functions ``_group_reports`` and ``_resolve_consensus`` from the NFL coordinator, with NBA-specific agent instantiation and persistence to ``nba_agent_decisions``. """ from __future__ import annotations import json ...
mattleonard16/nflalgorithm
agents/nba_coordinator.py
.py
cfc210c9f6c3529f
7.52
10
"""NBA market bias detection agent. Detects fg3m recency staleness: when a player's last-5 game average for 3-pointers differs significantly from their last-10 average, the market line may lag behind the trend. Returns NEUTRAL for non-fg3m markets. """ from __future__ import annotations from typing import List, Opti...
mattleonard16/nflalgorithm
agents/nba_market_bias_agent.py
.py
8a81c3f437c00ba7
7.52
10
"""NBA model diagnostics agent. Flags players where the model's projection deviates suspiciously from the market line, using an inline sigma estimate. """ from __future__ import annotations from typing import List, Optional import pandas as pd from agents import AgentReport from agents.nba_base_agent import NbaBas...
mattleonard16/nflalgorithm
agents/nba_model_diagnostics_agent.py
.py
4f5c75b8e05891dd
7.52
10
"""Odds monitoring agent. Tracks line movement from the weekly_odds table, detects steam moves (large line shifts in short windows), and reports best available prices per player/market. """ from __future__ import annotations from typing import Dict, List, Optional import pandas as pd from agents import AgentReport...
mattleonard16/nflalgorithm
agents/odds_agent.py
.py
6ee38b0fad6ffe4d
7.52
10
""" Authentication utilities for NFL Algorithm API. bcrypt password hashing with dual-path legacy SHA256 verification so existing accounts created before T0 #2 can still log in (their hash is rewritten to bcrypt on next successful login). """ import hashlib import logging import secrets from datetime import datetime,...
mattleonard16/nflalgorithm
api/auth.py
.py
79cf515912c79ec8
7.52
10
"""Simple in-memory TTL cache for hot API endpoints.""" from __future__ import annotations import time import threading from typing import Any, Dict, Optional, Tuple class EndpointCache: """Thread-safe in-memory cache with TTL and max size, keyed by arbitrary string keys.""" def __init__(self, default_ttl:...
mattleonard16/nflalgorithm
api/cache.py
.py
2f89de365ac491e5
7.52
10
"""Data health invariant checks run after pipeline completion.""" from __future__ import annotations import logging from typing import Any, Dict, List from utils.db import fetchone logger = logging.getLogger(__name__) def check_missing_player_info(season: int, week: int) -> Dict[str, Any]: """Check rate of mi...
mattleonard16/nflalgorithm
api/data_health.py
.py
dbbc41b662e0338e
7.52
10
"""Per-client-IP token-bucket rate limiting for the public API surface. Two tiers protect different costs: the auth prefix guards bcrypt CPU (each login/register burns hundreds of milliseconds of unauthenticated work), while the global tier bounds full-table export and read traffic. Buckets live in this process only....
mattleonard16/nflalgorithm
api/rate_limit.py
.py
327869be0739e2cc
7.52
10
"""Materialize weekly value betting view.""" from __future__ import annotations import argparse import logging from datetime import datetime, timezone from typing import Optional import pandas as pd import numpy as np from config import config from confidence_engine import score_plays from risk_manager import norma...
mattleonard16/nflalgorithm
materialized_value_view.py
.py
c0dfd23d573ff349
7.52
10
"""Position-specific model entry points. The weekly NFL implementation may be supplied as a private deployment module. Importing the shared package must remain safe when that optional module is not installed, so the public entry points resolve it only when invoked. """ from __future__ import annotations from importl...
mattleonard16/nflalgorithm
models/position_specific/__init__.py
.py
b8602eb35e898188
8.02
10
""" Base model class for position-specific NFL player performance prediction. """ from abc import ABC, abstractmethod from typing import Dict, List import numpy as np import pandas as pd from sklearn.base import BaseEstimator from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score from sklearn.pr...
mattleonard16/nflalgorithm
models/position_specific/base_model.py
.py
f9f3e3b4c29c2373
8.02
10
"""Raw adapter: a directory of markdown -> NCR. Last resort; no structure assumed. Domain mapping: each top-level subdirectory containing *.md files is a domain; *.md files at the root are shared context prepended to every domain. A flat directory (markdown only at the root) becomes a single domain named after the dir...
nodal-data/nodal-context
eval_harness/adapters/raw.py
.py
5758f4c3cd245d98
7.45
7
"""skill adapter: an agent data-analysis skill -> NCR. Reads the artifact produced by skill-based context extractors (e.g. Anthropic's `data-context-extractor`): a skill folder — or the packaged `.zip` / `.skill` file — laid out as SKILL.md frontmatter (name, description) + the main context body: ...
nodal-data/nodal-context
eval_harness/adapters/skill.py
.py
3b11c06215132922
7.45
7
"""Grade a generated answer against a seed's `expected`, keyed on `expected.kind`. sql_shape -> LLM judge on must_include/must_exclude semantic_entity -> LLM judge on resolving to expected.entity value_at_snapshot -> SKIPPED (needs a live warehouse to produce the number; that's the p...
nodal-data/nodal-context
eval_harness/grader.py
.py
0eafe0bef545ed09
7.45
7
"""Normalized Context Representation (NCR) — the intermediate every adapter maps into. Per eval_harness/INTERFACE.md the format isn't the moat: every source (ACF, dbt docs, raw markdown, …) collapses to this, and the delta is computed on it. Kept deliberately small: the runner needs the seeds (ground truth) and a per-...
nodal-data/nodal-context
eval_harness/ncr.py
.py
d31c6d58938f3493
7.45
7
"""Render the on/off/perfect delta report (the `--report pr-comment` markdown). Pure: takes already-computed per-domain results, returns a markdown string. Shape follows eval_harness/INTERFACE.md — three percentages + the "still wrong with context on" punch-list. """ from .grader import PASS, FAIL, SKIPPED def _bar(...
nodal-data/nodal-context
eval_harness/report.py
.py
31927f76e72c909a
7.45
7
#!/usr/bin/env python3 """Extract *draft* context signal from a dbt project into a compact dbt-findings.json. Primary (run `dbt parse` first — no warehouse needed): python3 scripts/dbt_extract.py --manifest path/to/target/manifest.json Fallback (bare clone, can't produce a manifest): python3 scripts/d...
nodal-data/nodal-context
scripts/dbt_extract.py
.py
d508349e76ca7676
7.45
7
# -*- coding: utf-8 -*- """Generate feed.xml (RSS 2.0) from the longreads/ essays. python tools/build_feed.py # rewrite feed.xml python tools/build_feed.py --check # verify only, change nothing (exit 1 if stale) Why it exists: the profile README on github.com/tonydzi pulls the latest essays automatica...
tonydzi/clawrush
tools/build_feed.py
.py
21df2a42a39c1912
7.56
12
#!/usr/bin/env python """Analyze the cradle-mother OPERANT orient results (benchmark_cradle_mother.py). The claim: a hungry infant with NO intrinsic orient drive learns to orient toward a sound PURELY because a mother feeds it (operant credit) when its own turn moved toward the sound. As the session proceeds, the TAUG...
dennys246/Maxim
scripts/analyze_cradle_mother.py
.py
c761b4082239eee9
7.48
8
#!/usr/bin/env python3 """Audit — and optionally reconstruct — the git tags for released versions. Every version with a ``## [X.Y.Z]`` CHANGELOG section should have a matching annotated ``vX.Y.Z`` tag on the commit that introduced the version bump. PyPI is immutable but carries no git history, so an untagged release c...
dennys246/Maxim
scripts/audit_release_tags.py
.py
f86f29115d5f6905
7.48
8
#!/usr/bin/env python3 """Behavioral Convergence Experiment 4 — Scale Validation (20+ seeds). Wraps the Tier 3 organic learning experiment and runs it N times to prove the learning effect is statistically robust, not a fluke of LLM sampling. Each seed runs the full 3-session training pipeline + 1 fresh control with a...
dennys246/Maxim
scripts/behavioral_convergence_exp4_scale.py
.py
7df428d3a6396e0d
7.48
8
#!/usr/bin/env python3 """PKG seam — prove the lean Pi extra resolves on aarch64 with no heavy backends. Cross-resolves an extras combination for **linux aarch64 / CPython 3.11** (Raspberry Pi OS bookworm = glibc 2.36) and asserts no heavy backend leaked in (torch / CUDA / llama-cpp / tensorflow / triton) — the ``PKG`...
dennys246/Maxim
scripts/check_aarch64_install.py
.py
827ab3c7c6fe868d
7.48
8
#!/usr/bin/env python3 """ Reachy Mini Connection Diagnostics Tests connectivity to a Reachy Mini robot and diagnoses common connection issues. This is a standalone script that doesn't require the maxim package to be installed. Usage: python scripts/check_reachy_connection.py [--host REACHY_IP] python scripts...
dennys246/Maxim
scripts/check_reachy_connection.py
.py
bd1271f49bdc1053
7.48
8
"""Exp 44b S4 — is the substrate annotation stationary across a capture run? Pilot finding F6 ([docs/experiments/44b_pilot.md]): cluster bias fell ~0.997 → 0.059 WITHIN a single capture despite the decay-tau hold, while the annotation's bands are ABSOLUTE (>=0.5 "strongly rewarding", >=0.1 "mildly rewarding", else "ne...
dennys246/Maxim
scripts/exp44/analyze_nonstationarity.py
.py
467e6289ce08ca54
7.48
8
"""Exp 44b campaign statistics — actual hypothesis tests over pooled counterfactual flips. Consumes a campaign directory produced by campaign.py and the campaign config (for per-arm safe/harm ground-truth labels), and reports per requery model: PRIMARY (pre-registered, ONE test): Per-seed net safety direction, si...
dennys246/Maxim
scripts/exp44/stats_counterfactual.py
.py
e37c5101b289345b
7.48
8
"""Shared Exp 49 harness pieces: config writer, JSONL parsing, metrics. Pre-registration: docs/experiments/49_two_joint_centering.md. The trial driver (run_trials.py) and the offline scripted smoke both route through this module so the metric definitions exist in exactly one place — the instrument being verified once,...
dennys246/Maxim
scripts/exp49/exp49_common.py
.py
8a3366510811d9b6
7.48
8
#!/usr/bin/env python3 """Fine-grained threshold sweep on both P1 and Roy paraphrase fixtures. Phase 2 of docs/plans/archive/ec_centroid_drift_fix.md — sample the ECConfig.pattern_complete_threshold at 0.01 granularity around the Phase 1 matrix's 0.05-grid winner, on BOTH fixtures, to find the single threshold that st...
dennys246/Maxim
scripts/fine_sweep_phase_2.py
.py
babd4fee0d0b0567
7.48
8
#!/usr/bin/env python3 """Lint the canonical agent-guidance corpus and its provider-neutral adapter. Four checks (the first is the original Principle 5 lint; the next two were added by docs/plans/archive/claude_md_diet.md, 2026-08-13; the fourth closes the AGENTS.md drift seam): 1. **Guard citations.** For each `[eng...
dennys246/Maxim
scripts/lint_claude_md_invariants.py
.py
94e8c414bde66c00
7.48
8
#!/usr/bin/env python3 """Lint NEW tests that touch per-agent state for the multi-agent-modes marker. Per CLAUDE.md L43 (P4 multi-agent rule), any per-agent runtime stash MUST be a ``dict[agent_id, value]`` from day one. This lint turns the rule into a forcing function on every NEW test that touches per-agent state: t...
dennys246/Maxim
scripts/lint_multi_agent_marker.py
.py
c635447ce33df5fa
7.48
8
#!/usr/bin/env python3 """Stage 4 of measurement_path_fail_loud.md — the no-silent-swallows lock. Two checks, both comment-tolerant (the PR #487 review found the comment-blind pattern missed 10 ``pass # best-effort`` swallows): 1. **Zero-total over the measurement path.** The 16 scoped files from the plan's inven...
dennys246/Maxim
scripts/lint_no_silent_swallows.py
.py
c2e98de2e39a76e4
7.48
8
#!/usr/bin/env python3 """Measure the console /ws record cadence while the agent is IDLE. Open bug 1 in docs/bugs/console_seam_findings.md: with a talk loop alive and nothing happening, `hippocampus` and `scn` records arrive at roughly the loop's 2 Hz. The emitters are per-OPERATION (`sim_memory` on store/recall, `sim...
dennys246/Maxim
scripts/measure_idle_stream_cadence.py
.py
0297d2bd4f0bbf1d
7.48
8
#!/usr/bin/env python3 """Attribute the `respond` fixation: learned saturation, or prior/framing? Three hypotheses are on record and NONE is attributed: A. PROMPT FRAMING — docs/bugs/sim_embodiment_followups.md Issue 1 (2026-04-19): the orchestrator addresses the AUT as if it were a human, triggering resp...
dennys246/Maxim
scripts/measure_respond_fixation.py
.py
00c3959e85dc3d60
7.48
8
#!/usr/bin/env python """DoA settle curve — is the azimuth estimate a FILTER, not a function of pose? The properly-powered version of a test I already got wrong once. Exp 45b's gain gap (sweep 0.605 az/rad vs learner trials 0.39, an identical ~65% shortfall at BOTH 0.3 and 0.9 rad steps) is the signature of a running-...
dennys246/Maxim
scripts/orient_backbone/doa_settle.py
.py
a6aa48a35a917882
7.48
8
#!/usr/bin/env python """DoA static response sweep — characterize the bearing sensor, no learning. Motivated by the s1 perturb-run forensics (2026-07-16): the XVF3800 DoA is NOT the linear device the orient loop modeled. Observed: large base rotations (±0.7-0.9 rad) measured ~0.1 azimuth change while 0.25 rad steps tr...
dennys246/Maxim
scripts/orient_backbone/doa_sweep.py
.py
39abb5ab5f0b82c5
7.48
8
from typing import Annotated, TypedDict, List, Optional, Any try: from langgraph.graph.message import add_messages except ImportError: # deterministic/lite build ships no langgraph def add_messages(left, right): # simple concat reducer stand-in return (left or []) + (right or []) class SuggestionIte...
EKirschmann/WarCounsel
backend/agent/state.py
.py
2d36ff0618bf645a
7.59
14
"""Non-secret settings the UI can change, persisted across restarts. A packaged build has no .env to edit, so anything a user must be able to set lives here (data/app_config.json) and OVERRIDES the corresponding .env field at startup. Secrets deliberately do not live here -- see secrets_store. Applied in backend/conf...
EKirschmann/WarCounsel
backend/app_config.py
.py
a41b95f77a7b4864
7.59
14
import time from typing import Any, Dict, Optional import hashlib import json class Cache: """Simple in-memory cache with TTL support.""" def __init__(self, default_ttl: int = 3600): self.store: Dict[str, tuple[Any, float]] = {} self.default_ttl = default_ttl def _key(self, *args, **kwarg...
EKirschmann/WarCounsel
backend/cache.py
.py
dfb711c4d7e91351
7.59
14
"""Item facts LEARNED from the game's own exports, not the wiki. eqlwiki does not document every item -- launch added a whole block of them (ids around 69xxx) and several are gear a player is already WEARING. Without a wiki page there is no Slot line, and every recommend path needs one to place an item, so a perfectly...
EKirschmann/WarCounsel
backend/item_facts.py
.py
d15f45da8b930e96
7.59
14
"""Event schemas for parsed EQL log lines. Every parser match becomes one of these models. To add a new event type: 1. Add a subclass here with `type` set to a new string. 2. Add a regex + branch in parser.py that returns it. 3. (Optional) Handle it in state_tracker.py and/or persist it in main.py. The WebSocket paylo...
EKirschmann/WarCounsel
backend/log_system/events.py
.py
e5c793d1b7f7df51
7.59
14
"""Tail the active EQL log file and emit parsed events. Polling tail (0.4s) rather than watchdog: single-file polling is cheap, and unlike directory watchers it behaves identically on all Windows filesystems and network drives. Reads in binary and tracks a byte offset so partial lines and UTF-8 edge bytes never corrup...
EKirschmann/WarCounsel
backend/log_system/watcher.py
.py
21942e52780ac995
7.59
14
"""OCR region calibrator — an always-on-top translucent gold box. Run: python -m backend.ocr_overlay (the web UI's Calibrate button does this) Drag the box over the in-game map's location text (X:/Y:/Z:/zone), drag the bottom-right grip to resize, then DOUBLE-CLICK (or press Enter) to save the region to data/ocr_c...
EKirschmann/WarCounsel
backend/ocr_overlay.py
.py
02574188ddf6815c
7.59
14
"""What the overlay shows -- chosen in the web Settings panel. The overlay is a glance surface, not a dashboard. The webapp already covers session analytics in depth, so a player who wants nothing but a damage meter and their timers should be able to cut the rest; what is left then gets the whole of a 300px column ins...
EKirschmann/WarCounsel
backend/overlay_prefs.py
.py
68b0bf4ba26dfa74
7.59
14
"""System-tray icon for the combat overlay. The overlay is click-through most of the time and has no title bar, so once it is hidden — or once someone has dragged it off-screen — there is nothing left to click. The tray is the way back in, and the only always-available place to say "quit" without hunting for the windo...
EKirschmann/WarCounsel
backend/overlay_tray.py
.py
7d8b0d6b3133a545
7.59
14
"""What each WEB panel shows -- chosen in Settings. Separate from overlay_prefs.py on purpose, and the separation is the whole design decision. A 42px overlay strip and a 340px column answer different questions: you genuinely want a damage meter and nothing else while fighting, and the full session ledger while planni...
EKirschmann/WarCounsel
backend/panel_prefs.py
.py
6107589880660f4d
7.59
14
"""Where things live — the one place that knows about being frozen. Running from source, everything is relative to the repo root exactly as it always was. Running as the packaged executable, two different roots apply and conflating them is the classic PyInstaller bug: * BUNDLED assets (the built UI, class guides, t...
EKirschmann/WarCounsel
backend/paths.py
.py
51c06b11c063ddc3
7.59
14
"""Loot that feeds a race-unlock faction grind. Some drops are worth keeping for a reason nothing in the game tells you at the moment you loot them: they are turn-ins on a race-unlock path. A Gnoll Fang looks like vendor trash and is 1/1200th of a Barbarian. Deliberately LOOTABLE turn-ins only. The guide's other rout...
EKirschmann/WarCounsel
backend/race_unlocks.py
.py
33f69eca5e66ef93
7.59
14
"""API keys, kept apart from everything else on purpose. Keys live in data/secrets.json and NOTHING else does. The separation is the whole point: data/llm_config.json, data/app_config.json and the log file all get pasted into bug reports, and a key that shares a file with ordinary settings eventually gets shared with ...
EKirschmann/WarCounsel
backend/secrets_store.py
.py
6e4d784ac5082f83
7.59
14
"""Session persistence: the live session survives backend restarts. A restart used to rebuild from a 1MB seed replay whose events deliberately do not count toward session stats — wiping DPS records, kills, XP, encounters, and the ledger. Instead the state-push loop snapshots the tracker (plus the log byte offset) ever...
EKirschmann/WarCounsel
backend/session_state.py
.py
211317c86e605399
7.59
14
"""Curated spell lines: which buffs share a slot, and which supersede which. EverQuest buffs occupy effect SLOTS. Two buffs in the same slot do not add — the later cast overwrites the earlier one. A loadout that recommends both Center and Bravery (both `ac-slot-1`) is therefore recommending one wasted gem, and nothing...
EKirschmann/WarCounsel
backend/spell_lines.py
.py
520b2c66f24bfacd
7.59
14
"""Direct-HTTP wiki access — the no-Node fallback for the MCP server. The MCP server is the enhanced path (structured eql_builds_* data); when it is absent (not cloned, Node missing, disabled), these fetch the same wiki pages over plain HTTP and extract text in the same line-per-block shape the MCP extractor produces,...
EKirschmann/WarCounsel
backend/wiki_http.py
.py
71426fcdccd00a01
7.59
14
"""comfyui-identity-forge — V3 custom node pack entrypoint. Exposes eight nodes: * ``IdentityForge`` — a multi-field character description randomizer with a constraint engine and dual prose/JSON output. * ``IdentityForgeArchetype`` — themed presets that seed IdentityForge. * ``IdentityForgeCosplayer`` — fictional-c...
EnragedAntelope/comfyui-identity-forge
__init__.py
.py
cac84cd11de85680
7.65
19
"""Optional user-supplied dropdown options (survive ``git pull``). Drop a ``user_options.json`` in the pack root to add choices without editing the source — so updates won't clobber them. Two sections, both optional:: { "fields": { "ethnicity": ["Atlantean"], "hair_color": ["galaxy swirl", "...
EnragedAntelope/comfyui-identity-forge
data/user_options.py
.py
4bcb5f65be65fcf1
7.65
19
#!/usr/bin/env python """Generate ``tests/frontend/fixtures/nodes.json`` from live ``define_schema()``. The jsdom frontend tests (``tests/frontend/*.test.mjs``) need to know, for each node, the widgets a real ComfyUI would build and the order they'd appear in — without that, a test asserting "every field lands in the ...
EnragedAntelope/comfyui-identity-forge
scripts/dump_frontend_fixtures.py
.py
e07fbee22ec2e540
7.65
19
#!/usr/bin/env python """Generate the frontend data block embedded in ``js/identity_forge.js``. ``js/identity_forge.js`` needs three lookups that are *derived from* the Python field definitions: ``GROUP_ORDER`` (widget group order), ``FIELD_TO_GROUP`` (which group each widget belongs to) and ``GENDER_POOLS`` (the per-...
EnragedAntelope/comfyui-identity-forge
scripts/generate_js_data.py
.py
2b6ba800a85f3639
7.65
19
"""A record-only stand-in for ``comfy_api.latest.io``, used only when the real package is not importable (i.e. this process has no ComfyUI install). Without this, every node class in ``nodes/*.py`` sits behind that module's own ``try: from comfy_api.latest import io / except ImportError`` guard and is never *defined* ...
EnragedAntelope/comfyui-identity-forge
tests/comfy_stub/comfy_api/latest/io.py
.py
33853f28186331cb
8.15
19
"""Minimal stand-in for ComfyUI's ``folder_paths`` module — used only when the real ComfyUI is not installed (see ``tests/__init__.py``, which puts this directory on ``sys.path`` only after the real ``comfy_api`` fails to import, so a real ``folder_paths`` always wins when one is actually present). Scope: just ``get_u...
EnragedAntelope/comfyui-identity-forge
tests/comfy_stub/folder_paths.py
.py
8ef896ffa6a87995
7.15
19
/** * Stand-in for ComfyUI's `scripts/api.js`. The vault frontend (js/identity_forge_vault.js) * is the only consumer -- `apiURL` for building preview <img> src attributes and * `fetchApi` for the vault's list/delete/rename routes. A test points * `__setFetchApiHandler` at a function returning whatever response sha...
EnragedAntelope/comfyui-identity-forge
tests/frontend/stubs/api.js
.js
72d71c3dd6e77bb9
7.15
19
/** * Stand-in for ComfyUI's `scripts/app.js`, resolved in place of the real * module by `hooks.mjs`. Records every `app.registerExtension({...})` call * so a test can retrieve the registered extension object and drive its * lifecycle hooks (`beforeRegisterNodeDef`, `nodeCreated`) by hand. */ export const __exten...
EnragedAntelope/comfyui-identity-forge
tests/frontend/stubs/app.js
.js
d47c6abf995d9643
7.15
19
"""Preview the Cosplayer node end-to-end without ComfyUI. Wires IdentityForgeCosplayer into IdentityForge exactly as the graph does, so you can eyeball real output (prose + optional JSON) for any character. Examples (run from the repo root):: python tests/preview_cosplayer.py "She-Hulk" python tests/preview_...
EnragedAntelope/comfyui-identity-forge
tests/preview_cosplayer.py
.py
0f81d08cdfd627e0
8.15
19
#!/usr/bin/env python3 """Deterministic replay of the parsing-srx-configs extraction contract plus the firewall-best-practices-audit v1.1 check catalog over a live SRX policy set. Companion to `../2026-07-31-firewall-best-practices-audit-live-srx.md`. Input: one or more files of `show configuration ... | display set`...
fastrevmd-lab/fwskillsshare
docs/skill-tests/fixtures/2026-07-31-live-srx-audit-replay.py
.py
da873f4d55b83df6
7.98
8
#!/usr/bin/env python3 """Validate portable skill packaging and Codex discovery metadata.""" from __future__ import annotations import ast import json import re import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[1] SKILLS_DIR = ROOT / "skills" NAME_RE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)...
fastrevmd-lab/fwskillsshare
scripts/check-skill-packages.py
.py
c0f2cbad95d6d17f
7.48
8
#!/usr/bin/env python3 """Emit QEMU-monitor sendkey commands that type a literal string into a guest. The ClearPass setup wizard renders on the VGA console only (its kernel command line ends with `console=tty0`, which wins for userspace), so a serial port shows the boot but never the questions. The only way to answer ...
fastrevmd-lab/fwskillsshare
skills/clearpass-proxmox-deploy/scripts/console-type.py
.py
b1a2ef166101cb59
7.48
8
"""Configuration loader and defaults for the swarm. Loads from swarm_config.json with fallback to hardcoded defaults. """ import json import os import sys CONFIG_PATH = os.environ.get("SWARM_CONFIG", "swarm_config.json") def load_swarm_config(path: str = CONFIG_PATH) -> dict: """Load swarm configuration from J...
adilfaisal01/llm-multiagent-swarm
demo-swarm/swarm/config.py
.py
e8e28130c80e3742
7.48
8
"""Output formatting and file saving for swarm results. Separated from the CLI so the library can be used without the terminal output side effects. """ import json import re import sys import time def print_summary(result: dict, *, file=None): """Print a human-readable summary of swarm results to a stream.""" ...
adilfaisal01/llm-multiagent-swarm
demo-swarm/swarm/output.py
.py
66df0935f8b45126
7.48
8
"""Scratchpad — write-only RAM SQLite database for raw findings. Agents WRITE only — they never read from it. The orchestrator reads after all agents finish to synthesize across all sources. """ import sqlite3 class Scratchpad: """Temporary SQLite database in RAM for agents to dump raw findings.""" def __i...
adilfaisal01/llm-multiagent-swarm
demo-swarm/swarm/scratchpad.py
.py
66140e2bf5dac495
7.48
8
"""Search backends for the swarm. Supported backends: - searxng: Self-hosted SearXNG instance (default) - ddgs: DuckDuckGo HTML endpoint (no API key needed) - google: Google Custom Search JSON API (requires GOOGLE_API_KEY + GOOGLE_CX) """ import json import os import re import urllib.parse import urllib.request SEAR...
adilfaisal01/llm-multiagent-swarm
demo-swarm/swarm/search.py
.py
8d8e549368d273b1
7.48
8
#!/usr/bin/env python3 """Generate a Keep a Changelog section from git history and prepend it to CHANGELOG.md. Usage: python3 scripts/gen_changelog.py <tag> [--dry-run] Reads commits since the previous tag (or full history if none), categorizes them by conventional-commit prefix, and prepends a new section to CHA...
adilfaisal01/llm-multiagent-swarm
scripts/gen_changelog.py
.py
3251b4270c27bbc5
7.48
8
"""Search/extract result cache — SQLite-backed, keyed on backend + query. Workers hit the same queries across runs (and across workers within a run), so caching search + extract results cuts latency and Ollama cost. The cache is transparent to workers: a cache hit still logs to the scratchpad exactly like a live call....
adilfaisal01/llm-multiagent-swarm
swarm/cache.py
.py
6ddd0daca1c0f2ae
7.48
8
"""AI-based probabilistic source credibility scoring. The heuristic score in scratchpad.py becomes a Bayesian PRIOR. An LLM judge provides its own probability estimate + confidence (the likelihood). The two are combined via confidence-weighted log-odds pooling into a POSTERIOR probability. If the LLM call fails or re...
adilfaisal01/llm-multiagent-swarm
swarm/credibility.py
.py
b5616b58aa0cf57c
7.48
8
"""MCP server implementation — stdio transport, single swarm_research tool. The server wraps ``run_swarm()`` and relays preflight + synthesis streamed tokens to the client as progress notifications, so a connected MCP client sees live research progress. The full result dict (including ``citations`` and ``cost``) is re...
adilfaisal01/llm-multiagent-swarm
swarm/integrations/mcp/server.py
.py
cffbe2bae2725da6
7.48
8
"""Shared LLM chat helper — retry/backoff, streaming, and cost accounting. Centralizes the repeated chat calls that used to live in worker.py, synthesis.py, and preflight.py. Speaks the OpenAI-compatible ``/v1/chat/completions`` protocol, which covers OpenAI, Anthropic (compat layer), Ollama (``/v1``), Groq, Together,...
adilfaisal01/llm-multiagent-swarm
swarm/llm.py
.py
7c6d9787c1cfdda5
7.48
8
"""Output formatting and file saving for swarm results. Separated from the CLI so the library can be used without the terminal output side effects. """ import json import re import sys import time from pathlib import Path def print_summary(result: dict, *, file=None): """Print a human-readable summary of swarm ...
adilfaisal01/llm-multiagent-swarm
swarm/output.py
.py
df8141e84729d9a1
7.48
8
"""Prompt loader — reads markdown prompt templates from swarm/prompts/.""" from __future__ import annotations import importlib.resources from pathlib import Path # Directory where prompt markdown files live, relative to this package. _PROMPTS_DIR = Path(__file__).parent def load_prompt(name: str) -> str: """L...
adilfaisal01/llm-multiagent-swarm
swarm/prompts/__init__.py
.py
13e229425071ad34
7.48
8
"""Provider resolution — maps model tags to endpoints, keys, and headers. Model tags carry a ``provider/name`` shape (e.g. ``openai/gpt-4o``, ``ollama/deepseek-v4-flash:cloud``). The provider prefix selects a block from the config ``providers`` dict; the remainder is the model name sent to the API. Bare tags with no `...
adilfaisal01/llm-multiagent-swarm
swarm/providers.py
.py
b73802a84e810f99
7.48
8
"""Search backends for the swarm. Supported backends: - searxng: Self-hosted SearXNG instance (default) - ddgs: DuckDuckGo HTML endpoint (no API key needed) - google: Google Custom Search JSON API (requires GOOGLE_API_KEY + GOOGLE_CX) """ import json import os import re import urllib.parse import urllib.request SEAR...
adilfaisal01/llm-multiagent-swarm
swarm/search.py
.py
98c65bd626bd37a4
7.48
8
"""Skill model + registry for the swarm. A skill is a capability pack: a folder under swarm/skills/<name>/ with a SKILL.md file. The frontmatter (YAML, delimited by ---) declares metadata and which tools the skill grants; the markdown body becomes the worker's behavior rules. Frontmatter fields: name ...
adilfaisal01/llm-multiagent-swarm
swarm/skills/_base.py
.py
9f5e97042eab0b99
7.48
8
"""Synthesis — the orchestrator reads all worker reports + scratchpad and produces a unified answer. This is the final pass that actually connects the dots across all 5 angles. Without this, the swarm is just "here's 5 separate reports." With it, you get a coherent research answer. Synthesis now produces inline ``[N]...
adilfaisal01/llm-multiagent-swarm
swarm/synthesis.py
.py
823f077f4aaa5a03
7.48
8
"""Modular tool system for swarm workers. Each tool is a module in swarm/tools/ with a TOOLS list. The registry auto-discovers all tools; skills (swarm/skills/) reference tools by name and provide bundle-based filtering. """ from .registry import ToolRegistry # Global default registry, populated once _DEFAULT_REGISTR...
adilfaisal01/llm-multiagent-swarm
swarm/tools/__init__.py
.py
c7c2df898193a407
7.48
8
"""arXiv search tool — search academic papers via the arXiv API.""" from __future__ import annotations import urllib.parse import urllib.request import xml.etree.ElementTree as ET from swarm.cache import cache_enabled, cache_key, get_cache from swarm.scratchpad import get_scratchpad from .base import BaseTool _ARXIV_A...
adilfaisal01/llm-multiagent-swarm
swarm/tools/arxiv_search.py
.py
148094a0f9d63920
7.48
8
"""Base class for all swarm tools.""" from __future__ import annotations from typing import Any class BaseTool: """Extend this to create a new tool. Required overrides: name — unique tool identifier (e.g. 'web_search') description — shown to the LLM parameters — JSON schema fo...
adilfaisal01/llm-multiagent-swarm
swarm/tools/base.py
.py
6b0baefcf211d5d6
7.48
8
"""Date calculator tool — date arithmetic, weekdays, and age computations.""" from __future__ import annotations from datetime import date, datetime from .base import BaseTool _DAY_NAMES = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday") class DateCalculator(BaseTool): """Compute da...
adilfaisal01/llm-multiagent-swarm
swarm/tools/date_calculator.py
.py
9d7c4b8a8f862b83
7.48
8
"""Generic HTTP request tool — call any REST API from a worker.""" from __future__ import annotations import json import urllib.request from swarm.cache import cache_enabled, cache_key, get_cache from swarm.scratchpad import get_scratchpad from .base import BaseTool _METHODS = ("GET", "POST", "PUT", "DELETE", "HEAD", ...
adilfaisal01/llm-multiagent-swarm
swarm/tools/http_request.py
.py
14f709458f409b53
7.48
8
"""PDF extract tool — read text from PDF files (optional pypdf extra).""" from __future__ import annotations import os from swarm.scratchpad import get_scratchpad from .base import BaseTool _MAX_CHARS = 8000 class PdfExtract(BaseTool): """Extract text from a PDF file. Requires the optional ``pdf`` extra (``...
adilfaisal01/llm-multiagent-swarm
swarm/tools/pdf_extract.py
.py
23cf4d6fe1968e09
7.48
8
#!/usr/bin/env python3 """Replay a real Claude Code transcript's memo read-tool calls with the emission ledger off, then on, and measure whether MEMO_EMITTED_LEDGER pays for itself. Scope (per the Task 5 finding recorded in docs/SPECS/2026-08-10-emission-ledger-design.md): only `memo_search`, `memo_ask`, and `memo_evi...
jagoff/memo
scripts/eval_emission_ledger.py
.py
517f418e80684aec
7.59
14
"""Migrate mem-vault frontmatter → memo schema (in-place). mem-vault writes .md files with frontmatter shaped like: --- agent_id: web name: Title here description: One-line summary created: 2026-04-29T04:15:37-03:00 last_used: 2026-04-30T20:35:58-03:00 tags: [a, b, c] --- body mem...
jagoff/memo
scripts/migrate-from-mem-vault.py
.py
4556187d6e059088
7.59
14
#!/usr/bin/env python3 """Measure token usage baseline for Wave 1 gating. Requires: 50+ representative recall-hook prompts (JSON file with list of dicts) Output: baseline_tokens.json with per-prompt token counts + summary stats Usage: python scripts/wave1_token_baseline.py --prompts prompts.json --output baseline_t...
jagoff/memo
scripts/wave1_token_baseline.py
.py
9bd23c9c55dd7388
7.59
14
"""memo — local MCP memory backed by Markdown, sqlite-vec, and MCP. 100% local stack — zero Ollama, zero cloud APIs: - LLM: `mlx-lm` running quantized Qwen models on Apple Silicon Metal (in-process, no daemon) for ask/synthesis/dream. - Embedder: MLX Qwen3-Embedding on Apple Silicon, or CPU sentence-transformers ...
jagoff/memo
src/memo/__init__.py
.py
3e556c72dd0aaa90
7.59
14
"""Lockless local multi-agent event bus, backed by the event journal. Gated by ``MEMO_EVENT_BUS_ENABLED`` (read once at construction): with the flag off, ``publish``/``poll_new_events`` are no-ops so the bus costs nothing in agents that never opted in. Unlike the original jsonl-dangling implementation, this is a *fac...
jagoff/memo
src/memo/agent_event_bus.py
.py
8b90593034288d49
7.59
14
"""Memory analytics dashboard — metrics and visualizations. Provides: - Dashboard web UI with corpus metrics - Growth charts over time - Distribution by type/tags - Word cloud of most frequent entities """ from __future__ import annotations import json from collections import Counter from dataclasses import dataclas...
jagoff/memo
src/memo/analytics.py
.py
3c97bfaf08d24f91
7.59
14
"""Spreading-activation associative recall — pure, local, no I/O. Given the recall seeds (the hybrid top-K), walk one or two hops over the entity-memory graph and the codegraph symbol graph (joined by name) and return the most-activated *other* memories. Stateless: all graph access is injected so the engine is hermeti...
jagoff/memo
src/memo/associative.py
.py
3c6c8e1a69431610
7.59
14
"""Small durable file-write primitives for runtime sidecar state.""" from __future__ import annotations import contextlib import fcntl import hashlib import os import tempfile from collections.abc import Iterator from contextlib import contextmanager from pathlib import Path @contextmanager def authority_write_lock...
jagoff/memo
src/memo/atomic_io.py
.py
3c83803b6a6908f8
7.59
14
"""Belief-revision decision: which side of a contradiction (if any) supersedes. Shared by `memo maintain` (cli_maintain) and the nightly Dream contradict pass (cli_dream_passes) so the recency-clobber fix lives in exactly one place. Pure and READ-ONLY over the store (no writes, no MLX). Runs only in the maintenance p...
jagoff/memo
src/memo/belief.py
.py
f5395d6ec8805699
7.59
14
"""Citation-type feedback — nightly grounding stats → capture-time type weights. If grounding data shows ``type=decision`` gets cited 3x more often than ``type=note``, capture should favor the higher-value type when a candidate's classification is genuinely ambiguous. Two halves: - ``compute_type_citation_stats`` (th...
jagoff/memo
src/memo/capture_weights.py
.py
53526ce8710f7c97
7.59
14
"""Fulldoc inline: when one doc dominates the hits, answer with the whole doc.""" from __future__ import annotations from typing import Any from memo.chat.dedup import CHUNK_NUM, dedup_key, normalize_title _MIN_SHARE = 0.6 _MIN_CHUNKS = 2 def dominant_doc_group( sources: list[dict[str, Any]], *, min_s...
jagoff/memo
src/memo/chat/fulldoc.py
.py
01b838e355c3e7b4
7.59
14
"""Rules-only follow-up rewrite (the LLM paraphrase path was not rescued).""" from __future__ import annotations import re _SUMMARY_FOLLOWUP_RE = re.compile( r"^[\s¿¡]*(resum[ií](me)?(lo)?|ampli[aá]|expand[ií]|m[aá]s detalles?|contame m[aá]s" r"|y de eso|tell me more|summar(y|ize))\b", re.IGNORECASE, ) _...
jagoff/memo
src/memo/chat/rewrite.py
.py
eab95609e71c420a
7.59
14
"""Shared, provider-agnostic parsing helpers for LLM browser-automation responses.""" from __future__ import annotations import re def clean_json_raw(raw: str) -> str: """ Best-effort cleanup of an LLM's raw text response before JSON parsing. Handles several edge cases: - ```json ... ``` code fences...
ultrahikerpp/invest-digest
backend/browser_common.py
.py
3daca8330c4139c5
7.42
6