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 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python3
"""
Shared authentication utilities for madengine.
Centralises credential loading logic used by both BuildOrchestrator and
RunOrchestrator so that fixes and improvements only need to be made once.
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
import json
import os
import ... | ROCm/madengine | src/madengine/core/auth.py | .py | 5a712105fe5b3c33 | 7.5 | 9 |
#!/usr/bin/env python3
"""Module to run console commands.
This module provides a class to run console commands.
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
# built-in modules
import subprocess
import typing
import re
# Mask secret values (e.g. MAD_SECRETS_HFTOKEN) before printing/raising com... | ROCm/madengine | src/madengine/core/console.py | .py | b564fc590368feea | 7.5 | 9 |
#!/usr/bin/env python
"""Module to define constants.
This module provides the constants used in the MAD Engine.
Environment Variables:
- MAD_VERBOSE_CONFIG: Set to "true" to enable verbose configuration logging
- MAD_SETUP_MODEL_DIR: Set to "true" to enable automatic MODEL_DIR setup during import
- MODEL_... | ROCm/madengine | src/madengine/core/constants.py | .py | 0c2eed49e3fb27a8 | 7.5 | 9 |
#!/usr/bin/env python3
"""Module to define the Timeout class.
This module provides the Timeout class to handle timeouts.
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
# built-in modules
import signal
from typing import Optional
class Timeout:
"""Class to handle timeouts.
Attributes:
... | ROCm/madengine | src/madengine/core/timeout.py | .py | 3084fa1eccf3d4db | 7.5 | 9 |
#!/usr/bin/env python3
"""
Configuration loader with multi-layer merging for deployments.
Layers (low to high priority):
1. System defaults (built-in presets)
2. User file (--additional-context-file)
3. User CLI (--additional-context)
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
import json
fr... | ROCm/madengine | src/madengine/deployment/config_loader.py | .py | 5d417c582eaf8c3c | 7.5 | 9 |
#!/usr/bin/env python3
"""
Deployment Factory - Creates appropriate deployment instances.
Implements Factory pattern to dynamically create SLURM or Kubernetes
deployment instances based on target configuration.
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
from typing import Dict, Type
from .b... | ROCm/madengine | src/madengine/deployment/factory.py | .py | 882afb91a7eb2cdf | 7.5 | 9 |
#!/usr/bin/env python3
"""
Kubernetes-safe names for metadata.name, label values, and container names.
Model names from data.json may contain ``/``, spaces, or uppercase letters that
are invalid for ``metadata.name`` (RFC 1123 subdomain) or for label values.
Container names must be a single DNS label (no dots), strict... | ROCm/madengine | src/madengine/deployment/k8s_names.py | .py | e7e42b10054d3eb0 | 7.5 | 9 |
"""
Kubernetes PVC lifecycle management mixin.
Handles PersistentVolumeClaim creation, deletion, and storage class
resolution for both per-job results and long-lived shared data volumes.
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
import time
from pathlib import Path
from typing import Option... | ROCm/madengine | src/madengine/deployment/k8s_pvc.py | .py | d0c60e3452221aae | 7.5 | 9 |
#!/usr/bin/env python3
"""
Kubernetes Secret helpers for madengine deployment: registry pull + runtime credentials.
Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
"""
from __future__ import annotations
import base64
import json
from pathlib import Path
from typing import Any, Dict, List, Optional, T... | ROCm/madengine | src/madengine/deployment/k8s_secrets.py | .py | d53d128bd467648d | 7.5 | 9 |
#!/usr/bin/env python3
"""
Infer Primus ``BACKEND`` from madengine model names.
Convention (see ``scripts/primus_pretrain/get_models_json.py`` in MAD-internal):
``primus_pretrain/<launcher>_<arch>_<config_stem>``, e.g.
``primus_pretrain/torchtitan_MI300X_qwen3_4B-pretrain`` → launcher ``torchtitan``.
Copyright (c) Ad... | ROCm/madengine | src/madengine/deployment/primus_backend.py | .py | 7970f7582e3a8a6c | 7.5 | 9 |
#!/usr/bin/env python3
"""
Pure helpers for container run flow (log paths, timeout resolution).
Extracted so run_container logic is easier to test and maintain.
"""
import re
import typing
# Default substrings matched in container run logs post-hoc (see ContainerRunner).
DEFAULT_LOG_ERROR_PATTERNS: typing.Tuple[str,... | ROCm/madengine | src/madengine/execution/container_runner_helpers.py | .py | 0250bc1aca27efa5 | 7.5 | 9 |
#!/usr/bin/env python3
"""
Pure helpers for parsing Dockerfile GPU variables and validating target architecture.
Used by DockerBuilder for build-phase validation. No I/O or context dependency.
"""
import re
import typing
# GPU architecture variables used in MAD/DLM Dockerfiles
GPU_ARCH_VARIABLES = [
"MAD_SYSTEM_... | ROCm/madengine | src/madengine/execution/dockerfile_utils.py | .py | e7c4731cc64702b2 | 7.5 | 9 |
"""Пример: распаковка обычных форм 1С как pre-step индексации.
Пример полностью синтетический и самодостаточный: вместо реального v8unpack
используется распаковщик-заглушка, который пишет текстовый файл рядом. Реальные
данные, контейнеры 1С и внутренняя инфраструктура не используются.
Запуск:
python examples/bas... | MRDK80/v8unpack-agent | examples/basic_usage.py | .py | 960c2228802a6652 | 7.45 | 7 |
"""FormContext прокидывает type_resolver в object_decoder (issue #147).
Фикстуры синтетические: production-подобный raw-header собирается теми же
хелперами, что и tests/test_reference_type_resolution.py (#88), поэтому в
проекте не появляется второго описания layout. Расположение файла объекта
определяет сам ``object_j... | MRDK80/v8unpack-agent | tests/test_form_context_issue147.py | .py | 83a34b909a5a92bc | 7.95 | 7 |
#!/usr/bin/env python3
"""Sema ref gate — Claude Code hook that blocks stale sema refs.
Thin shim over ``sema.core.check``: reads the hook event JSON from stdin,
extracts content-addressed refs (Handle#stub), and verdicts each against the
active sema registry:
KNOWN handle exists, stub matches -> pass
STAL... | emergent-wisdom/sema | hooks/ref_gate.py | .py | 4dee1fba56cad949 | 7.57 | 13 |
import json
import os
import re
from typing import Dict, Set, Tuple
VOCAB_DIR = "data/vocabulary"
def get_dependencies_usage(pattern: Dict) -> Tuple[Set[str], Set[str], Dict[str, str]]:
"""Return (declared_keys, used_keys, key_to_category)."""
deps = pattern.get("dependencies", {})
declared_keys = set()
... | emergent-wisdom/sema | scripts/align_text_refs.py | .py | add47ba920ca3c5d | 7.57 | 13 |
#!/usr/bin/env python3
"""Apply staged vocabulary edits in the one order that works.
apply_vocabulary_change.py # apply data/staging, export, rehash, export
apply_vocabulary_change.py --check # validate only; touch nothing
apply_vocabulary_change.py --keep-staging
apply_vocabulary_change.... | emergent-wisdom/sema | scripts/apply_vocabulary_change.py | .py | 90261432ccd9e9ab | 7.57 | 13 |
#!/usr/bin/env python3
"""
Check Half-Concepts (Rule H)
Detects violations where a Compound Concept (e.g., "ProblemStatement") is referenced
by its parts (e.g., "Problem Statement", "{{problem}} statement", "{{problem}} {{statement}}")
instead of the full concept handle (e.g., "{{problem_statement}}").
"""
import glo... | emergent-wisdom/sema | scripts/audit/check_half_concepts.py | .py | 528e419720a066e4 | 7.57 | 13 |
import glob
import json
import os
from collections import defaultdict
def get_dependencies_handles(p):
"""
Return set of Handles that this pattern depends on.
"""
deps = set()
d = p.get('dependencies', {})
# Categorized
for cat in ['accepts', 'yields', 'composes_with', 'references']:
... | emergent-wisdom/sema | scripts/audit/find_cycles.py | .py | c8665b577b03a6bb | 7.57 | 13 |
#!/usr/bin/env python3
"""
Generate a Situational Review of the Sema vocabulary.
Infers usage context from Category and value from Tier/Gloss.
"""
import glob
import json
import os
VOCAB_DIR = "data/vocabulary"
OUTPUT_FILE = "vocabulary_situational_review.md"
# Map Categories to Situational Contexts
CATEGORY_CONTEXT... | emergent-wisdom/sema | scripts/audit/generate_situational_review.py | .py | a102474cd4c3b507 | 7.57 | 13 |
#!/usr/bin/env python3
"""
Generate a human-readable review of the Sema vocabulary.
Grades patterns based on structural rigor and utility.
"""
import glob
import json
import os
VOCAB_DIR = "data/vocabulary"
OUTPUT_FILE = "vocabulary_review.md"
def load_patterns():
patterns = []
for filepath in glob.glob(os.p... | emergent-wisdom/sema | scripts/audit/generate_vocabulary_review.py | .py | 461f6d8fcb4bbb7a | 7.57 | 13 |
#!/usr/bin/env python3
"""Measure the bundled vocabulary against the lettered rules in
docs/specification/validation.md.
Rules A–K are stated there. Not all are mechanical: J (Semantic Meaningfulness)
and the Truth-in-Advertising half of F need a reader, and this script says so
rather than scoring them. What it does c... | emergent-wisdom/sema | scripts/audit/rule_adherence.py | .py | 92977f5121bc5178 | 7.57 | 13 |
#!/usr/bin/env python3
"""
ExportSema Vocabulary (Pinned)
Exports patterns with Weak Links in content (for stable hashing)
and Strong Links in metadata (for precise resolution).
"""
import json
import os
import sys
# Fix paths
# Add 'src' to path relative to this script (../../src)
script_dir = os.path.dirname(os.pat... | emergent-wisdom/sema | scripts/export/export_sema.py | .py | 39d56e366275a07d | 7.57 | 13 |
import json
import os
import re
import sys
# Add src to path for imports
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "src"))
from sema.core.registry import RegistryManager # noqa: E402
OUTPUT_FILE = "data/shorthand/all_patterns_short.md"
def pattern_path(pattern):
"""Return the cano... | emergent-wisdom/sema | scripts/export/export_short_hand.py | .py | 00809aab5753c782 | 7.57 | 13 |
#!/usr/bin/env python3
"""
Generate Pattern Cards LaTeX
Reads from vocabulary folder and generates pattern card specifications
for the paper appendix with full hashes (not truncated stubs).
"""
import json
import os
VOCAB_DIR = "data/vocabulary"
OUTPUT_PATH = "paper/generated_pattern_cards.tex"
# Patterns to include... | emergent-wisdom/sema | scripts/generate_pattern_cards.py | .py | 18df5d7fe362594e | 7.57 | 13 |
#!/usr/bin/env python3
"""
Iterative Improvement
Runs rounds of sampling, analysis, and automatic hardening.
"""
import json
import os
import random
import sqlite3
import sys
# Add project root to path
sys.path.append(os.getcwd())
from sema.taxonomy_graph.graph_store import EdgeType, GraphStore, NodeType
TAXONOMY_D... | emergent-wisdom/sema | scripts/iterative_improve.py | .py | 2402028866a3b782 | 7.57 | 13 |
#!/usr/bin/env python3
"""
Migrate parameters from string format to object format (Rule 4.2).
String format: "name: Type [range] (description)"
Object format: {"name": "name", "type": "Type", "range": "[range]", "description": "description"}
"""
import json
import re
from pathlib import Path
def parse_parameter_str... | emergent-wisdom/sema | scripts/migrate_parameters.py | .py | bb3583d8385409fc | 7.57 | 13 |
#!/usr/bin/env python3
"""One-shot migration: _meta.layer + _meta.category → _meta.path.
Rewrites every pattern JSON under data/vocabulary/ and data/staging/ (if
present). Idempotent: skips files that already carry `_meta.path`.
Also removes the top-level `sema_layer` and `sema_category` fields,
which were computed/d... | emergent-wisdom/sema | scripts/migrate_taxonomy_to_path.py | .py | 56ed2b7c3f3520dd | 7.57 | 13 |
#!/usr/bin/env python3
"""Rebuild the vocabulary DB from JSON source files and verify hash stability.
Usage:
python scripts/rebuild_vocabulary.py # rebuild + verify (no git diff = pass)
python scripts/rebuild_vocabulary.py --check # dry-run: only report if hashes would change
python scrip... | emergent-wisdom/sema | scripts/rebuild_vocabulary.py | .py | 5d3c2fba103783cc | 7.57 | 13 |
#!/usr/bin/env python3
"""
Test to verify exactly what gets hashed in Sema patterns.
Manually hashes a pattern and compares with the stored sema_id.
"""
import hashlib
import json
import math
import unicodedata
from typing import Any
# Independent copy of the canonicalization-v2 logic from
# src/sema/core/hashing.py.... | emergent-wisdom/sema | scripts/test_hash_verification.py | .py | 0aec4c756a6608d3 | 8.07 | 13 |
#!/usr/bin/env python3
"""Rewrite stale `Handle#stub` references in docs to current pattern stubs.
A hash drift in the vocabulary (cascade or content update) changes
`sema_ref` values. Any doc that cited those refs becomes stale. This
script walks a scoped set of docs, finds every `Handle#stub` mention,
looks up the c... | emergent-wisdom/sema | scripts/update_doc_refs.py | .py | 770af7457193f2a5 | 7.57 | 13 |
r"""
Update Paper Hashes
Updates inline \sema{}{} references and Handle#Stub references in the paper
to match the current vocabulary hashes.
Note: Pattern card appendix is now generated by generate_pattern_cards.py
"""
import json
import os
import re
VOCAB_DIR = "data/vocabulary"
PAPER_PATH = "paper/sema.tex"
def ... | emergent-wisdom/sema | scripts/update_paper_hashes.py | .py | 17cb1c2899d86aec | 7.57 | 13 |
#!/usr/bin/env python3
"""
Inspect dependencies of a pattern in the Sema graph.
Prints the DAG reachable from the given pattern.
"""
import argparse
import os
import sys
# Add project root to path
sys.path.append(os.getcwd())
from sema.taxonomy_graph.graph_store import EdgeType, GraphStore
def inspect_deps(handle:... | emergent-wisdom/sema | scripts/viz/inspect_deps.py | .py | 0e774da27fd393e3 | 8.07 | 13 |
import hashlib
import json
import time
# Simulation Constants
AGENT_A = "Agent_Alpha (Standard)"
AGENT_B = "Agent_Beta (Drifting)"
# --- The Sema Protocols (Simulated Registry) ---
# The "True" Definition (Standard)
DEF_STATELOCK_STD = {
"handle": "StateLock",
"gloss": "Atomic coordination via temporary stat... | emergent-wisdom/sema | scripts/viz/multi_agent_mock.py | .py | 1b87f4eb4a818b77 | 7.57 | 13 |
#!/usr/bin/env python3
"""
Calculate the Merkle root and generate vocabulary statistics.
This script:
1. Loads all patterns from the database (source of truth)
2. Computes the Merkle root
3. Calculates statistics (Layer/Category distribution)
4. Generates a comprehensive information page (docs/information/vocabulary_i... | emergent-wisdom/sema | scripts/vocabulary_merkle_root.py | .py | 79167765e332c1d1 | 7.57 | 13 |
"""Generate model-friendly documentation entry points for the HTML build."""
from pathlib import Path
from typing import Any, Optional
DOCS_URL = "https://proteusllp-actuarial-library.readthedocs.io/en/latest/"
LLMS_INDEX = f"""# Proteus Actuarial Library (PAL)
> PAL is an open-source Python library for simulation-... | ProteusLLP/proteusllp-actuarial-library | docs/source/_ext/pal_llms.py | .py | 2ac406e192477280 | 7.54 | 11 |
"""Hardware specific math functions for PAL."""
import logging
import os
import typing as t
import numpy as np
import numpy.typing as npt
_USE_GPU_ENV_VAR = "PAL_USE_GPU"
_USE_GPU = os.environ.get(_USE_GPU_ENV_VAR) == "1"
LOGGER = logging.getLogger(__file__)
if t.TYPE_CHECKING:
# For type checking, we need to ... | ProteusLLP/proteusllp-actuarial-library | src/pal/_maths.py | .py | 740a5a301777d3fc | 7.54 | 11 |
"""Configuration utilities for the PAL library.
Provides configuration management for random seeding, simulation parameters,
and global library settings.
"""
from pal._maths import create_random_generator
from pal.types import Config
config = Config() # config is assumed to be a singleton
def set_default_n_sims(n... | ProteusLLP/proteusllp-actuarial-library | src/pal/config.py | .py | 09356209a1a92598 | 7.54 | 11 |
"""Reinsurance contract modeling for excess of loss and tower structures.
Provides classes for modeling XoL (excess of loss) reinsurance contracts
including individual layers and complete towers with aggregate limits,
reinstatement premiums, franchise deductibles, and complex layering.
"""
from __future__ import anno... | ProteusLLP/proteusllp-actuarial-library | src/pal/contracts.py | .py | d7fa92fdd63c843b | 7.54 | 11 |
"""Stochastic variable coupling and dependency management.
Provides coupling mechanisms for stochastic variables, allowing them to maintain
dependency relationships during reordering and copula applications. Key classes
include CouplingGroup for managing variable groups and ProteusStochasticVariable
as the base class ... | ProteusLLP/proteusllp-actuarial-library | src/pal/couplings.py | .py | eae6ffc584b96ba3 | 7.54 | 11 |
"""Empirical distribution.
This module contains a finite empirical distribution defined by observed samples
and optional observation weights. It is separate from :mod:`pal.distributions`
because its support and weights are vector-valued inputs rather than scalar
distribution parameters.
"""
from __future__ import ann... | ProteusLLP/proteusllp-actuarial-library | src/pal/empirical.py | .py | b604fcbe4c61c259 | 7.54 | 11 |
"""Frequency-severity modeling for actuarial applications.
This module provides classes and functions for modeling compound distributions
commonly used in insurance and actuarial science, where claims are modeled as
the sum of a random number (frequency) of random amounts (severity).
Key components:
- FrequencySeveri... | ProteusLLP/proteusllp-actuarial-library | src/pal/frequency_severity.py | .py | 7d1601988a026216 | 7.54 | 11 |
"""Hyperexponential distribution.
This module contains the finite-mixture hyperexponential distribution. It lives
separately from :mod:`pal.distributions` because its component weights and rates
are vector-valued parameters rather than single ``DistributionParameter`` values.
The public class is exposed as ``pal.Hyper... | ProteusLLP/proteusllp-actuarial-library | src/pal/hyperexponential.py | .py | 5a08b3a8109f571f | 7.54 | 11 |
"""Math functions that preserve PAL custom types.
This module provides wrappers around numpy math functions that preserve
PAL's custom types (StochasticScalar, etc.). Import as 'pnp' to mimic
numpy usage patterns.
Type signatures are in maths.pyi.
"""
from __future__ import annotations
import typing as t
# third p... | ProteusLLP/proteusllp-actuarial-library | src/pal/maths.py | .py | af99a27ffca26ca6 | 7.54 | 11 |
"""Statistical utilities for actuarial loss analysis.
Provides functions for generating loss summaries, percentile calculations,
and statistical analysis of frequency-severity simulation results.
"""
from __future__ import annotations
import math
import typing
import numpy.typing as npt
from ._maths import xp as n... | ProteusLLP/proteusllp-actuarial-library | src/pal/stats.py | .py | 3774e92774791019 | 7.54 | 11 |
"""Stochastic scalar variables for Monte Carlo simulation.
Provides the StochasticScalar class for representing and manipulating
scalar-valued stochastic variables in actuarial and risk modeling applications.
Supports arithmetic operations, statistical functions, and numpy integration.
"""
from __future__ import anno... | ProteusLLP/proteusllp-actuarial-library | src/pal/stochastic_scalar.py | .py | 22ec18ebc2839e98 | 7.54 | 11 |
"""Type definitions and protocols for the PAL library.
Defines common type aliases, protocols, and configuration classes used
throughout the library for type safety and consistency.
"""
# standard library
from __future__ import annotations
import dataclasses
import itertools
import typing as t
# third party
import ... | ProteusLLP/proteusllp-actuarial-library | src/pal/types.py | .py | 1b86773e0b00ff45 | 7.54 | 11 |
"""Backend-neutral array assertions for CPU and GPU test runs."""
from __future__ import annotations
import typing as t
import numpy as np
from pal._maths import asnumpy
from pal.couplings import ProteusStochasticVariable
def _host(value: t.Any) -> t.Any:
"""Copy stochastic/backend arrays to the host before N... | ProteusLLP/proteusllp-actuarial-library | tests/_assertions.py | .py | 2838e851890fcd2e | 8.04 | 11 |
"""Regression tests for NumPy dispatch to PAL's active array backend."""
import numpy as np
from pal import maths as pnp
from pal._maths import xp
from pal.frequency_severity import FreqSevSims
from pal.stochastic_scalar import StochasticScalar
from tests._assertions import array_equal
def test_numpy_ufunc_normaliz... | ProteusLLP/proteusllp-actuarial-library | tests/test_backend_dispatch.py | .py | 21e1de7d5b676997 | 7.04 | 11 |
"""Tests for config and stats modules to improve coverage."""
import numpy as np
import pytest
from pal import config
from pal._maths import create_random_generator, xp
from pal.stats import tvar
from pal.types import Config
def test_set_default_n_sims():
"""Test set_default_n_sims function (config.py line 18).... | ProteusLLP/proteusllp-actuarial-library | tests/test_config_stats_minimal.py | .py | c7df1a4676e2fb62 | 8.04 | 11 |
"""Tests for contracts module to improve coverage."""
import numpy as np
from pal.contracts import XoL, XoLTower
from pal.frequency_severity import FreqSevSims
def test_xol_print_summary(capsys):
"""Test XoL print_summary method (lines 248-260)."""
sim_idx = np.array([0, 0, 1, 1, 2])
losses = np.array([... | ProteusLLP/proteusllp-actuarial-library | tests/test_contracts_minimal.py | .py | c3c0392ae09bbbdd | 8.04 | 11 |
"""Tests for copula functionality and margin validation.
Tests covering copula sampling, margin validation, and integration
with ProteusVariable for dependency modeling in actuarial applications.
"""
import re
import numpy as np
import numpy.typing as npt
import pytest
import scipy
import scipy.special
import scipy.... | ProteusLLP/proteusllp-actuarial-library | tests/test_copulas.py | .py | 0fd97d3f57452eb6 | 8.04 | 11 |
"""Tests for stochastic variable coupling and reordering.
Tests covering copula-based coupling mechanisms and simulation reordering
for dependency modeling between stochastic variables.
"""
from pal import copulas
from pal.variables import StochasticScalar
from tests._assertions import array_equal
def test_copula_r... | ProteusLLP/proteusllp-actuarial-library | tests/test_couplings.py | .py | 6e847d63a5dbb8a4 | 7.04 | 11 |
"""Tests for frequency-severity coupling with copulas.
Integration tests combining frequency-severity modeling with copula-based
dependency structures for complex actuarial risk modeling scenarios.
"""
import numpy as np
import scipy
from pal import config
from pal.copulas import GumbelCopula, apply_copula
from pal.... | ProteusLLP/proteusllp-actuarial-library | tests/test_couplings_fs.py | .py | f737fd704d590538 | 8.04 | 11 |
"""Tests for couplings module to improve coverage."""
from pal.couplings import CouplingGroup
from pal.variables import StochasticScalar
def test_coupling_group_discard():
"""Test discard method removes variable from coupling group (line 41)."""
x = StochasticScalar([1, 2, 3])
y = StochasticScalar([4, 5,... | ProteusLLP/proteusllp-actuarial-library | tests/test_couplings_minimal.py | .py | b774d2c1f4875f03 | 8.04 | 11 |
"""
Cognify MCP server — exposes ingest/recall/stats as MCP tools so Claude Code,
Claude Desktop, or any MCP client can build and query a knowledge graph directly.
Run: cognify-mcp (stdio transport)
Add to Claude Code:
claude mcp add cognify -- cognify-mcp
Add to Claude Desktop (claude_desktop_c... | S3YED/appie-kit | packages/cognify/src/cognify/mcp_server.py | .py | 15ade97671e45605 | 7.42 | 6 |
#!/usr/bin/env python3
"""Regenerate skills/INDEX.md from SKILL.md frontmatter."""
import os, re, datetime
REPO = os.path.expanduser("~/clawd/projects/appie-kit")
SKILLS_DIR = os.path.join(REPO, "skills")
CATEGORY_ORDER = [
"automation", "communication", "content", "ecc",
"integrations", "knowledge", "meta", ... | S3YED/appie-kit | scripts/rebuild-index.py | .py | ab6eba9f17e65168 | 7.42 | 6 |
#!/usr/bin/env python3
"""Memory search script for Hermes Agent.
Searches across all memory files (daily logs, topics, projects, decisions)
with ranked results based on relevance.
Usage:
python3 search.py "query" [--limit 10] [--recent 7] [--files-only]
"""
import argparse
import os
import re
import sys
from dat... | S3YED/appie-kit | skills/automation/memory-search/scripts/search.py | .py | 8bc7c6ece1552d5d | 7.42 | 6 |
#!/usr/bin/env python3
"""
check_deps.py — Verify a ComfyUI workflow's dependencies (custom nodes, models,
embeddings) against a running server.
Improvements over v1:
- Cloud-aware endpoint mapping (handles `/api/experiment/models/{folder}` and
`/api/object_info` variants verified against live cloud API)
- Dis... | S3YED/appie-kit | skills/content/comfyui/scripts/check_deps.py | .py | 319d18c9a24b96d8 | 7.42 | 6 |
#!/usr/bin/env python3
"""
extract_schema.py — Analyze a ComfyUI API-format workflow and extract
controllable parameters.
Improvements over v1:
- Catalogs live in `_common.py`, shared with `check_deps.py`
- Coverage expanded for Flux / SD3 / Wan / Hunyuan / LTX / IPAdapter / rgthree
- Symmetric duplicate-name re... | S3YED/appie-kit | skills/content/comfyui/scripts/extract_schema.py | .py | 280c53a95ae54604 | 7.42 | 6 |
#!/usr/bin/env python3
"""
fetch_logs.py — Retrieve workflow execution diagnostics from a ComfyUI server.
When a workflow errors, the server's /history (local) or /jobs (cloud) entry
contains the full Python traceback. This script makes it easy to fetch by
prompt_id, with sensible formatting.
Usage:
python3 fetch... | S3YED/appie-kit | skills/content/comfyui/scripts/fetch_logs.py | .py | 5dad70cd09b7fc49 | 7.42 | 6 |
#!/usr/bin/env python3
"""
health_check.py — One-stop verification that the ComfyUI environment is ready.
Runs through the verification checklist:
1. comfy-cli on PATH
2. server reachable (/system_stats)
3. at least one checkpoint installed
4. (optional) a specific workflow's deps are met
5. (optional) actua... | S3YED/appie-kit | skills/content/comfyui/scripts/health_check.py | .py | b4e2abb14224094d | 7.42 | 6 |
"""Pytest configuration for the comfyui skill test suite.
Adds `scripts/` to sys.path so tests can `from _common import ...`, and
provides a few common fixtures.
"""
from __future__ import annotations
import json
import os
import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parent.par... | S3YED/appie-kit | skills/content/comfyui/tests/conftest.py | .py | b3cedf4b285c1e93 | 7.92 | 6 |
"""Tests for check_deps.py — focuses on parsing logic that doesn't need a server."""
from __future__ import annotations
from check_deps import (
NODE_TO_PACKAGE,
model_present,
normalize_for_match,
suggest_install_command,
)
class TestNormalizeForMatch:
def test_basic(self):
s = normaliz... | S3YED/appie-kit | skills/content/comfyui/tests/test_check_deps.py | .py | 82e250c9d8d42132 | 7.92 | 6 |
"""Integration tests against the live Comfy Cloud API.
These tests are auto-skipped when COMFY_CLOUD_API_KEY is not set.
They never SUBMIT workflows (would need a paid subscription) — they only
verify the read-only endpoints we rely on.
"""
from __future__ import annotations
import pytest
from _common import http_g... | S3YED/appie-kit | skills/content/comfyui/tests/test_cloud_integration.py | .py | a2f0d4cb6ec289ba | 7.92 | 6 |
#!/usr/bin/env python3
"""
Upload an .excalidraw file to excalidraw.com and print a shareable URL.
No account required. The diagram is encrypted client-side (AES-GCM) before
upload -- the encryption key is embedded in the URL fragment, so the server
never sees plaintext.
Requirements:
pip install cryptography
Us... | S3YED/appie-kit | skills/content/excalidraw/scripts/upload.py | .py | d3d88dfd8930942a | 7.42 | 6 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
# -----------------------
# Parameters / settings
# -----------------------
T = 12.0
x0 = np.array([0.5, -1.0]) # [position, velocity]
# Tracking gains (choose kp>0, kd>0)
kp = 10.0
kd = 6.0
# Integral gains ==========>
I = 0.0... | gfloresc/RoboticsToolbox-Python-Lessons | code/02_automation/2ndOrderControl.py | .py | a735fb4f36a24aff | 7.5 | 9 |
# -*- coding: utf-8 -*-
"""HT_2D.ipynb
"""
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact
# Homogeneous transformation 2D
def T2D(x, y, theta):
theta = np.radians(theta)
T = np.array([
[np.cos(theta), -np.sin(theta), x],
[np.sin(theta), np.cos(theta), y]... | gfloresc/RoboticsToolbox-Python-Lessons | code/03_position_orientation/ht_2d.py | .py | 1ba5ad534c422660 | 7.5 | 9 |
# -*- coding: utf-8 -*-
"""HT_3D.ipynb
"""
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact
from mpl_toolkits.mplot3d import Axes3D
# Rotation matrices
def rot_x(angle):
a = np.radians(angle)
return np.array([
[1, 0, 0],
[0, np.cos(a), -np.sin(a)],
[0... | gfloresc/RoboticsToolbox-Python-Lessons | code/03_position_orientation/ht_3d.py | .py | 34288f7680f58882 | 7.5 | 9 |
import roboticstoolbox as rtb
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import PillowWriter
# Definir el robot
L1 = rtb.RevoluteDH(a=1) # Primer eslabón
L2 = rtb.RevoluteDH(a=1) # Segundo eslabón
L3 = rtb.RevoluteDH(a=1) # Tercer eslabón
robot = rtb.DHRobot([L1, L2, L3], ... | gfloresc/RoboticsToolbox-Python-Lessons | code/robotics/test.py | .py | 9008082304f07f97 | 7 | 9 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Checkpoint persistence — session snapshots above the kernel."""
from __future__ import annotations
import json
from dataclasses import dataclass, field
from pathlib import Path
from typing import Protocol
class Ch... | outshift-open/mas-lab | ctl/src/mas/ctl/adapters/checkpoint.py | .py | 0ee1acee52e48568 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""HITL terminals — terminate EMIT_HITL_REQUEST / HITL_RESOLVE at the boundary."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Protocol
from mas.runtime.schema.egress... | outshift-open/mas-lab | ctl/src/mas/ctl/adapters/hitl_terminal.py | .py | 6fb39507b8439e8c | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Memory seeds — preload context before first turn (TLA M_mem + manifest parity)."""
from __future__ import annotations
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import Any
... | outshift-open/mas-lab | ctl/src/mas/ctl/adapters/memory_seed.py | .py | 622ce75bcd5dbf65 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""SessionObservabilityRecorder — lifecycle handle for a session's obs plugin set."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
if TYPE_CHECKING:
f... | outshift-open/mas-lab | ctl/src/mas/ctl/adapters/obs/session.py | .py | 5383c85be366d7ef | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Bench runner routing helpers — manifest kind detection for MasBenchRunner."""
from __future__ import annotations
from pathlib import Path
from typing import Any
def is_mas_manifest_kind(config: dict[str, Any], spe... | outshift-open/mas-lab | ctl/src/mas/ctl/benchmark/runner_dispatch.py | .py | 8754781cd8be1242 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Checkpoint list/show — ctl persistence helpers."""
from __future__ import annotations
import json
from pathlib import Path
import click
from mas.ctl.adapters.checkpoint import JsonCheckpointStore
@click.group("c... | outshift-open/mas-lab | ctl/src/mas/ctl/cli/commands/checkpoint.py | .py | 900a5aaf9628e7d3 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""mas-ctl compose — emit EffectiveBind + PlacementPlan."""
from __future__ import annotations
from pathlib import Path
import click
import yaml
from mas.ctl.cli.runtime_flags import runtime_id_choice
from mas.ctl.co... | outshift-open/mas-lab | ctl/src/mas/ctl/cli/commands/compose.py | .py | 5fe57a5f00ab8ff7 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""mas-ctl registry — list and query runtime + ctl components."""
from __future__ import annotations
import json
import click
from mas.ctl.registry import query_registry
@click.group("registry")
def registry_group(... | outshift-open/mas-lab | ctl/src/mas/ctl/cli/commands/registry.py | .py | addd06a80d2271a3 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""mas-ctl infra / flavour — list bundles from installed manifest libraries."""
from __future__ import annotations
import click
from mas.ctl.libraries.bundles import list_bundles, list_manifest_libraries
@click.grou... | outshift-open/mas-lab | ctl/src/mas/ctl/cli/commands/workspace.py | .py | 01cc015628e6bc25 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""mas-ctl CLI — compose, chat, TUI (runtime has no UI)."""
from __future__ import annotations
from pathlib import Path
import click
from mas.ctl.cli.commands.bundles import list_bundles_cmd
from mas.ctl.cli.commands... | outshift-open/mas-lab | ctl/src/mas/ctl/cli/main.py | .py | db164bbdb60c69ed | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Shared CLI observability overrides.
Precedence: agent/MAS manifest ``spec.observability`` (per-agent authored) >
active flavour ``spec.observability`` (deployment-posture default) > these
CLI flags, which override wh... | outshift-open/mas-lab | ctl/src/mas/ctl/cli/obs_flags.py | .py | 63ac8f957a6b978d | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""LangGraph framework adapter — wraps native RuntimeInstance (requires langgraph)."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
from mas.ctl.compose.models imp... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/adapters/langgraph.py | .py | 21bce7498e0d43b3 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Framework adapter registry — LangGraph etc. wrap kernel, not replace it."""
from __future__ import annotations
from typing import Protocol
from mas.ctl.compose.models import EffectiveBindManifest, FrameworkAdapterI... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/framework_registry.py | .py | fd35c15c09a89d98 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Kernel runtime registry — IDs from component-registry.yaml."""
from __future__ import annotations
from typing import Protocol
from mas.ctl.compose.models import EffectiveBindManifest, RuntimeId
from mas.ctl.deploym... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/kernel_registry.py | .py | 4081f8b4ee02b4b3 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Compose pipeline models — mas-ctl output types (bind/v1, deployment/v1)."""
from __future__ import annotations
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Literal
from ... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/models.py | .py | dbc354f7514bb6cf | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Resolve agent design_pattern manifest fields to registry plugin ids (compose only)."""
from __future__ import annotations
from pathlib import Path
from typing import Any
import yaml
from mas.runtime.agent_defaults... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/pattern_registry.py | .py | 40c2e0c94f491631 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""mas-ctl compose pipeline — merge application, infra, deployment → EffectiveBind."""
from __future__ import annotations
from pathlib import Path
from typing import Any
from mas.ctl.compose.pattern_registry import pa... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/pipeline.py | .py | 0de339930aa399d1 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Placement strategy validation at compose time (before materialize)."""
from __future__ import annotations
OSS_SUPPORTED_STRATEGIES = frozenset({"local-inproc"})
_LIBRARY_NEXT_STRATEGIES = frozenset({"local-multipro... | outshift-open/mas-lab | ctl/src/mas/ctl/compose/placement_validate.py | .py | df7f5840dceb005f | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Load deployment/v1 manifests and resolve runtime_id for a run."""
from __future__ import annotations
from pathlib import Path
from typing import Any
from mas.runtime.spec.source import load_yaml_mapping
from mas.c... | outshift-open/mas-lab | ctl/src/mas/ctl/deployment/load.py | .py | dcaa204d01578fd9 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Runtime identity — validated against component-registry.yaml."""
from __future__ import annotations
from typing import Any
from mas.ctl.registry.catalog import validate_runtime_id as _validate_catalog
from mas.run... | outshift-open/mas-lab | ctl/src/mas/ctl/deployment/runtime_id.py | .py | cbc992522c06e612 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""Shared MAS compose → materialize → session bootstrap (CLI and bench)."""
from __future__ import annotations
import logging
import uuid
from collections.abc import Callable
from dataclasses import dataclass
from path... | outshift-open/mas-lab | ctl/src/mas/ctl/executor/mas_session.py | .py | cc0ddabb25bc7ad7 | 7.59 | 14 |
# Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
# SPDX-License-Identifier: Apache-2.0
"""MAS run executor — compose, materialize, session (ctl-owned)."""
from __future__ import annotations
import logging
from pathlib import Path
from typing import TYPE_CHECKING
from mas.ctl.compose.runner import Compos... | outshift-open/mas-lab | ctl/src/mas/ctl/executor/run_mas.py | .py | 47f252a326f75ad7 | 7.59 | 14 |
"""FTW-Planet LightningDataModule.
Reads the PlanetScope layout via :class:`FTWPlanet`, or stock FTW Sentinel-2
via ``ftw_tools`` when ``dataset_backend="s2"``. Patches are non-uniform in
size, so we crop to a fixed ``crop_size`` before augmenting.
"""
from collections.abc import Callable
from typing import Any
impo... | taylor-geospatial/fields-of-the-planet | src/ftw_planet/datamodules.py | .py | 5bf7a9239a0cb4a2 | 7.45 | 7 |
"""FTW-Planet dataset: paired PlanetScope SR windows + FTW 3-class label.
Reads the GeoParquet index at ``<root>/planet/index.parquet`` and derives
train/val/test splits by joining ``patch_id`` against FTW's
``chips_<country>.parquet``.
"""
import os
from collections.abc import Callable, Sequence
from typing import A... | taylor-geospatial/fields-of-the-planet | src/ftw_planet/datasets.py | .py | 0ef2ba5610bee719 | 7.45 | 7 |
"""Shared inference infrastructure for evaluation: checkpoint loading, padding,
D4 test-time augmentation, and watershed instance separation.
"""
from collections.abc import Callable
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
from scipy.ndimage import label
from skimage.m... | taylor-geospatial/fields-of-the-planet | src/ftw_planet/inference.py | .py | 5a796d2daf02bb13 | 7.45 | 7 |
import { describe, expect, it } from "vitest";
import { actorPose } from "./actorPose";
import type { GuildEvent, Lane, LaneStatus } from "./types";
let seq = 0;
const ev = (partial: Partial<GuildEvent> & { type: string }): GuildEvent =>
({ seq: ++seq, run_id: "r1", ts: 1000 + seq, agent: "qa-engineer", ...partial }... | HamzaAlayed/laravel-claude-agents | console-ui/src/lib/actorPose.test.ts | .ts | 471ce664be94701e | 7.07 | 13 |
/**
* A prop ships only when its silhouette reads at nine pixels in the sprite's
* hand. A craft that needs explaining gets none, and its specialist keeps the
* plain rig — which is what stops a newly added agent from looking unfinished.
*/
import { describe, expect, it } from "vitest";
import { PROPS, propFor } fr... | HamzaAlayed/laravel-claude-agents | console-ui/src/lib/agentProp.test.ts | .ts | f49b8be586786a71 | 7.07 | 13 |
/**
* The promise this rule keeps: a marked card is really the blocked one. It was
* written inside Board and untested; the actor needs the same answer in the lane
* panel, and two copies of a subtle rule is how the two surfaces drift apart.
*/
import { describe, expect, it } from "vitest";
import { parkedLaneIds }... | HamzaAlayed/laravel-claude-agents | console-ui/src/lib/parkedLanes.test.ts | .ts | 4132b6be14f7efda | 7.07 | 13 |
import { describe, expect, it } from "vitest";
import { armGate, canSubmit, settleSubmit, startSubmit } from "./submitGate";
// These are the exact double-click sequence from the field report, replayed as
// gate transitions: two prompts queued, "Allow once" clicked twice while the
// first answer is still on the wire... | HamzaAlayed/laravel-claude-agents | console-ui/src/lib/submitGate.test.ts | .ts | 95592cb2129d76b2 | 7.07 | 13 |
/**
* The console API, faked at the boundary the browser actually talks to: `fetch`
* and `EventSource`.
*
* Deliberately NOT a mock of `lib/api` — the two worst defects in this console
* were a wire-format mismatch and a queue the UI modelled as a single slot, and
* both hid behind fixtures written from the spec... | HamzaAlayed/laravel-claude-agents | console-ui/src/test/fakeServer.ts | .ts | 7e1eeaddf5b370f9 | 7.07 | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.