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 |
|---|---|---|---|---|---|---|
"""Custom exception hierarchy for strava-mcp-vault.
All vault-specific exceptions inherit from VaultError, which lets
server.py tool functions catch errors with a single except clause.
"""
class VaultError(Exception):
"""Base exception for all vault errors."""
class RateLimitError(VaultError):
"""Strava AP... | pete-builds/strava-mcp-vault | src/strava_mcp_vault/exceptions.py | .py | 8312bad1ba1b28c1 | 7.52 | 10 |
#!/usr/bin/env python3
"""Docker HEALTHCHECK probe.
Streamable HTTP exposes a single ``/mcp`` endpoint. A bare GET (no
SSE-streaming Accept header) returns HTTP 400/405/406 from the MCP
transport layer. Treat that as healthy: it confirms the server is
listening, routed, and (if MCP_AUTH_TOKEN is set) accepting the bea... | pete-builds/strava-mcp-vault | src/strava_mcp_vault/healthcheck.py | .py | 01e774e892a9bcbd | 7.52 | 10 |
import logging
import os
import sys
from contextlib import asynccontextmanager
from dotenv import load_dotenv
from mcp.server import MCPServer
from strava_mcp_vault.cache.db import CacheDB
from strava_mcp_vault.cache.geocode import forward_geocode, reverse_geocode_many
from strava_mcp_vault.cache.manager import Cache... | pete-builds/strava-mcp-vault | src/strava_mcp_vault/server.py | .py | 968ffe1a2bdd04bf | 7.52 | 10 |
"""Shared test fixtures for strava-mcp-vault."""
from unittest.mock import AsyncMock
import pytest
from strava_mcp_vault.cache.db import CacheDB
@pytest.fixture
async def tmp_db(tmp_path):
"""Create a fresh CacheDB in a temp directory."""
db_path = str(tmp_path / "test-vault.db")
db = CacheDB(db_path)
... | pete-builds/strava-mcp-vault | tests/conftest.py | .py | c7183b7d6ad2e3ad | 8.02 | 10 |
"""Every tool declares what it does, and whether it leaves this host.
Nothing in an MCP manifest distinguishes delete_vault_activity from
get_activity unless the tool says so, so a client has no basis on which to
prompt before a destructive call.
The open-world split is the part worth stating. The vault is a LOCAL st... | pete-builds/strava-mcp-vault | tests/test_annotations.py | .py | 9575dcc6c90ec3cd | 8.02 | 10 |
"""Tests for cache/encryption.py."""
from cryptography.fernet import Fernet
import strava_mcp_vault.cache.encryption as enc
def _reset_encryption():
"""Reset module-level state so each test starts clean."""
enc._fernet = None
enc._initialized = False
def test_encrypt_decrypt_roundtrip(monkeypatch):
... | pete-builds/strava-mcp-vault | tests/test_encryption.py | .py | 6d3ad726ac31d4e8 | 7.02 | 10 |
"""Upstream error bodies are summarised, not forwarded into a tool result.
The detail string ends up in a tool result, which goes straight into an agent's
context. Strava's documented JSON shape is genuinely useful and is kept;
everything else is an arbitrary blob that says nothing an agent can act on, and
truncating ... | pete-builds/strava-mcp-vault | tests/test_error_bodies.py | .py | 1dc191176fc22bbc | 8.02 | 10 |
"""Tests for cache/geocode.py."""
import json
from unittest.mock import MagicMock, patch
from strava_mcp_vault.cache.geocode import forward_geocode, reverse_geocode_many
def _mock_urlopen(response_data):
"""Create a mock urlopen context manager returning JSON data."""
mock_response = MagicMock()
mock_re... | pete-builds/strava-mcp-vault | tests/test_geocode.py | .py | a0b28e71fd6e4685 | 8.02 | 10 |
"""Regression tests for the Streamable HTTP transport bind host.
Since mcp 2.0, MCPServer.streamable_http_app() auto-enables DNS-rebinding
protection whenever it is called with a loopback host, and its default host
is "127.0.0.1". Under that protection the server answers HTTP 421
"Invalid Host header" to any request w... | pete-builds/strava-mcp-vault | tests/test_transport_host.py | .py | 916698536c8a3327 | 8.02 | 10 |
import os
from logging.config import fileConfig
from alembic import context
from app.models import SQLModel
from sqlalchemy import engine_from_config, pool
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for P... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/env.py | .py | 1903b89abb5e6382 | 7.64 | 18 |
"""Initialize models
Revision ID: 001
Revises:
Create Date: 2023-11-24 22:55:43.195942
"""
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from alembic import op
# revision identifiers, used by Alembic.
revision = "001"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### comma... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/001_initialize_models.py | .py | 4a8186528840b107 | 7.64 | 18 |
"""Add cascade delete relationships
Revision ID: 004
Revises: 003
Create Date: 2024-07-31 22:24:34.447891
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "004"
down_revision = "003"
branch_labels = None
depends_on = None
def upgra... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/004_add_cascade_delete_relationships.py | .py | 2907a99be6f2c568 | 7.64 | 18 |
"""add organization project setup
Revision ID: 005
Revises: 004
Create Date: 2025-03-21 20:51:00.759926
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "005"
down_revision = "004"
branch_labels = None
depends_on = None
def upgrade... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/005_add_organization_project_setup.py | .py | f467c3d0c8369228 | 7.64 | 18 |
"""add api key table
Revision ID: 006
Revises: 005
Create Date: 2025-03-21 23:43:34.181704
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "006"
down_revision = "005"
branch_labels = None
depends_on = None
def upgrade():
# ###... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/006_add_api_key_table.py | .py | 8b888414216e3c62 | 7.64 | 18 |
"""Add document tables
Revision ID: 007
Revises: 006
Create Date: 2025-04-07 10:04:10.414165
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "007"
down_revision = "006"
branch_labels = None
depends_on = None
def upgrade():
# #... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/007_add_document_tables.py | .py | b93c3943d0b965c3 | 7.64 | 18 |
"""item table drop
Revision ID: 008
Revises: 007
Create Date: 2025-04-08 15:26:46.613516
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "008"
down_revision = "007"
branch_labels = None
depends_on = None
def upgrade():
# ### c... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/008_item_table_drop.py | .py | 6a84ddcf8fc1fe97 | 7.64 | 18 |
"""add credential table
Revision ID: 009
Revises: 008
Create Date: 2025-04-14 23:50:51.118373
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "009"
down_revision = "008"
branch_labels = None
depends_on = None
def upgrade():
op... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/009_add_credential_table.py | .py | 48f13beff36cc35f | 7.64 | 18 |
"""Add collection tables
Revision ID: 010
Revises: 009
Create Date: 2025-04-23 20:42:48.254463
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "010"
down_revision = "009"
branch_labels = None
depends_on = None
def upgrade():
#... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/010_add_collection_tables.py | .py | 57a81024353167a6 | 7.64 | 18 |
"""add threads table
Revision ID: 011
Revises: 010
Create Date: 2025-05-12 15:49:39.142806
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "011"
down_revision = "010"
branch_labels = None
depends_on = None
def upgrade():
# ###... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/011_add_threads_table.py | .py | c9161a8c4db6bc98 | 7.64 | 18 |
"""Add project_id in api_key table
Revision ID: 013
Revises: 012
Create Date: 2025-06-10 13:22:59.947971
"""
from alembic import op
import sqlalchemy as sa
from sqlmodel import text
# revision identifiers, used by Alembic.
revision = "013"
down_revision = "012"
branch_labels = None
depends_on = None
def upgrade()... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/013_add_project_id_in_api_key_table.py | .py | baa812876ffcbd5f | 7.64 | 18 |
"""add fk constraint to user id columns
Revision ID: 015
Revises: 014
Create Date: 2025-06-16 11:08:46.893642
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "015"
down_revision = "014"
branch_labels = None
depends_on = None
def u... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/015_add_fk_constraint_to_user_id_columns.py | .py | 956b84d124e183a7 | 7.64 | 18 |
"""create assistant table
Revision ID: 016
Revises: 015
Create Date: 2025-06-16 13:40:10.447538
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "016"
down_revision = "015"
branch_labels = None
depends_on = None
def upgrade():
... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/016_create_assistant_table.py | .py | 6961dcec76fd9b6e | 7.64 | 18 |
"""Change vector_store_id to vector_store_ids in openai_assistant table
Revision ID: 018
Revises: 017
Create Date: 2025-07-10 11:18:21.223114
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "018"
down_revision = "017"
b... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/018_change_vector_store_id_to_vector_store_ids.py | .py | 9b66c1e8b4ff51d5 | 7.64 | 18 |
"""Add is_deleted column in assistant table
Revision ID: 020
Revises: 019
Create Date: 2025-07-21 12:40:03.791321
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "020"
down_revision = "019"
branch_labels = None
depends_on = None
def upgrade():
op.add_colu... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/020_add_is_deleted_column_in_assistant_table.py | .py | 267736b892301b50 | 7.64 | 18 |
"""add error message column in collections table
Revision ID: 022
Revises: 021
Create Date: 2025-08-11 15:40:40.127161
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "022"
down_revision = "021"
branch_labels = None
depends_on = Non... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/022_add_error_message_column_in_collections_.py | .py | aa6a67b0190b2414 | 7.64 | 18 |
"""Alter unique constraint assistant table
Revision ID: 023
Revises: 022
Create Date: 2025-08-20 15:02:39.151977
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "023"
down_revision = "022"
branch_labels = None
depends_on = None
de... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/023_alter_unique_constraint_assistant_table.py | .py | 47d2baded3b7e5d0 | 7.64 | 18 |
"""unique constraint on project_name and org id
Revision ID: 024
Revises: 023
Create Date: 2025-08-27 12:22:36.633904
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "024"
down_revision = "023"
branch_labels = None
depends_on = None... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/024_unique_constraint_on_project_name_and_.py | .py | 0d9ba0b86df20bab | 7.64 | 18 |
"""add storage_path to project and project_id to document table
Revision ID: 025
Revises: 024
Create Date: 2025-08-28 10:54:30.712627
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "025"
down_revision = "024"
branch_labels = None
depends_on = None
def upgrad... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/025_add_storage_path_to_project_and_project_to_document_table.py | .py | df6660ac83115306 | 7.64 | 18 |
"""add source document id to document table
Revision ID: 026
Revises: 025
Create Date: 2025-08-29 15:59:34.347031
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "026"
down_revision = "025"
branch_labels = None
depends_on = None
d... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/026_add_source_document_id_to_document_table.py | .py | 1aaa878e403dd671 | 7.64 | 18 |
"""create doc transformation job table
Revision ID: 027
Revises: 026
Create Date: 2025-08-29 16:00:47.848950
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "027"
down_revision = "026"
branch_labels = None
depends_on = None
def up... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/027_create_doc_transformation_job_table.py | .py | 6648f4d709330bc6 | 7.64 | 18 |
"""create job table
Revision ID: 029
Revises: 028
Create Date: 2025-09-22 17:55:57.558157
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "029"
down_revision = "028"
branch_labels = None
depends_on = None
def upgrade():
# ### ... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/029_create_job_table.py | .py | 237b870f1ed439ed | 7.64 | 18 |
"""delete processing and failed columns from collection table
Revision ID: 030
Revises: 029
Create Date: 2025-10-06 13:59:28.561706
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = "030"
down_revision = "029"
branch_labels = None
dep... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/030_delete_non_successful_columns_from_collection_table.py | .py | 444920a1c806d56f | 7.64 | 18 |
"""Refactor Project user
Revision ID: 032
Revises: 031
Create Date: 2025-10-10 17:55:46.327616
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "032"
down_revision = "031"
branch_labels = Non... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/032_refactor_project_user.py | .py | 567c88e2f9980811 | 7.64 | 18 |
"""drop column deleted_at from credentials
Revision ID: 033
Revises: 032
Create Date: 2025-10-15 11:10:02.554097
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "033"
down_revision = "032"
branch_labels = None
depends_on = None
def upgrade():
# Drop only d... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/033_drop_deleted_at_credentials.py | .py | db639baf078d1565 | 7.64 | 18 |
"""Refactor API key table
Revision ID: 034
Revises: 033
Create Date: 2025-10-16 13:06:51.777671
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlalchemy.orm import Session
# revision identifiers, used by Alembic.
revision = "034"
down_revision = "033"
branch_labels = None
depe... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/034_refactor_api_key_table.py | .py | ebcc3905735e73a3 | 7.64 | 18 |
"""Add LLM in jobs table
Revision ID: 035
Revises: 034
Create Date: 2025-10-17 15:38:33.565674
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "035"
down_revision = "034"
branch_labels = None
depends_on = None
def upgrade():
op.execute("ALTER TYPE jobtype... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/035_add_llm_im_jobs_table.py | .py | aecdd27f9ab49e91 | 7.64 | 18 |
"""alter doc transform table for celery
Revision ID: 039
Revises: 038
Create Date: 2025-11-12 20:08:39.774862
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "039"
down_revision = "038"
bran... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/039_alter_doc_transform_table_for_celery.py | .py | 9dd674f41d63e902 | 7.64 | 18 |
"""add config in evals run table
Revision ID: 041
Revises: 040
Create Date: 2025-12-15 14:03:22.082746
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "041"
down_revision = "040"
branch_labels = None
depends_on = None
... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/041_add_config_in_evals_run_table.py | .py | c2ee4947a8446230 | 7.64 | 18 |
"""extend collection table for provider agnostic support
Revision ID: 042
Revises: 041
Create Date: 2026-01-15 16:53:19.495583
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "042"
down_rev... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/042_extend_collection_table_for_provider_.py | .py | 909113bcefc2ff40 | 7.64 | 18 |
"""create global schema and languages table
Revision ID: 043
Revises: 042
Create Date: 2026-02-05 12:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "043"
down_revision = "042"
branch_labels = None
depends_on = None
def upgrade():
# Create th... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/043_create_global_schema_and_languages_table.py | .py | c60fac41f9ef15e4 | 7.64 | 18 |
"""Add score_trace_url to evaluation_run
Revision ID: 044
Revises: 043
Create Date: 2026-01-24 19:34:46.763908
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
revision = "044"
down_revision = "043"
branch_labels = None
depends_on = None
def upgrade():
op.add_column(
"ev... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/044_add_score_trace_url_to_evaluation_run.py | .py | 7a763745e6bfecdd | 7.64 | 18 |
"""backfill legacy config completion type
Revision ID: 047
Revises: 046
Create Date: 2026-02-17 00:00:00.000000
"""
from alembic import op
revision = "047"
down_revision = "046"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.execute(
"""
UPDATE config_version
SET confi... | ProjectTech4DevAI/kaapi-backend | backend/app/alembic/versions/047_backfill_legacy_config_completion_type.py | .py | 8b5758384cdadf27 | 7.64 | 18 |
#!/usr/bin/env python3
"""Validation test for schemas/trace-event.schema.json (issue #29).
Asserts that every real trace sample under trace-samples/ validates against the
frozen v1 schema, and that the schema's conditional rules actually reject the
malformed events they are meant to catch.
Runs with the standard libr... | CarlosCaPe/octorato | schemas/tests/test_trace_event_schema.py | .py | f36ceeb20c9a1196 | 8.1 | 15 |
"""
_brain_obs.py — Shared helpers for the brain observability layer.
NOT a CLI. Imported by:
- trace-hook.py (Phase A) — capture hook
- brain-trace.py (Phase A) — query CLI
- update_neural_activity.py (Phase A) — Hebbian update
- watchdog.py (Phase B) — anomaly detector
- slos.py (Pha... | CarlosCaPe/octorato | scripts/_brain_obs.py | .py | 3f27681b75bd8baf | 7.6 | 15 |
"""
_pricing.py — shared multi-vendor API pricing helpers.
Single source of truth for USD conversion across the FinOps pipeline.
Used by skill-cost-profiler, brain-digest, watchdog cost_spike, and the
budget-check halt hook.
Prices are per 1M tokens (USD), list price as published by each vendor.
Update the dict when ... | CarlosCaPe/octorato | scripts/_pricing.py | .py | 23d33f7ee2ed6ac9 | 7.6 | 15 |
#!/usr/bin/env python3
"""
arm-synthetics-runner.py — Port 7 (Phase D) probe runner.
Reads <arm>/synthetics.yaml and runs each probe in sequence. Exits 0 if
all probes pass, 1 if any fail. Writes a JSON summary to --out so the
calling workflow can post a structured failure notification.
This script lives in the brain... | CarlosCaPe/octorato | scripts/arm-synthetics-runner.py | .py | 4924bfd9ac33f399 | 7.6 | 15 |
#!/usr/bin/env python3
"""brain-memory-recall.py - UserPromptSubmit beat: surface the BRAIN's own life-memories
(its auto-memory MEMORY.md index) relevant to the current prompt, BEFORE asking or asserting.
Why this exists
---------------
Two existing reflexes leave a hole:
- connectome-heartbeat circulates only the ... | CarlosCaPe/octorato | scripts/brain-memory-recall.py | .py | efc2592b36ee16af | 7.6 | 15 |
#!/usr/bin/env python3
"""
brain-stats — the SINGLE SOURCE OF TRUTH for Octorato's headline counts.
Independent multidisciplinary review (2026-05-25) found the same facts (skill /
agent / division counts) stated DIFFERENTLY in every layer — README even
contradicted itself, and three reviewers produced three different ... | CarlosCaPe/octorato | scripts/brain-stats.py | .py | 8572a0ce92326e29 | 7.6 | 15 |
#!/usr/bin/env python3
"""
budget-check.py — FinOps Feature 3 (budget caps + halt mechanism).
Reads ~/.claude/budgets.yaml (gitignored — private operator config),
computes the current-month spend per arm from skill-cost-profiler's
--json output, and emits:
OK — exit 0, every arm under its cap (or no cap confi... | CarlosCaPe/octorato | scripts/budget-check.py | .py | 8c40c6554539ddc6 | 7.6 | 15 |
#!/usr/bin/env python3
"""cadence-stop-hook.py — Stop hook: human-cadence enforcement for CHAT output.
The file linter (cadence-lint.py, PostToolUse) covers prose WRITES, but chat
replies — the comments and messages the operator actually asked for — never
pass through a Write tool. They relied on instruction + discipl... | CarlosCaPe/octorato | scripts/cadence-stop-hook.py | .py | d8df6acfb7a435a5 | 7.6 | 15 |
#!/usr/bin/env python3
"""canon-detect — sweep EVERY pixel that speaks a canonical fact.
Read-only companion to canon-render. Where canon-render *heals* the surfaces
that opted in (carry a marker), canon-detect *finds the ones that haven't* — it
walks the whole brain, locates every place a canonical fact VALUE appears... | CarlosCaPe/octorato | scripts/canon-detect.py | .py | a9dda9e053368c26 | 7.6 | 15 |
#!/usr/bin/env python3
"""canon-heal-hook — the per-edit reflex (autonomic Hz of the content canon).
Wired as a PostToolUse Write|Edit hook. After any file write, if that file
carries a canon marker, it self-heals to the canonical value via canon-render
--file. This is the smallest "transcend the marionette" unit: a f... | CarlosCaPe/octorato | scripts/canon-heal-hook.py | .py | 15525afbe13945d0 | 7.6 | 15 |
#!/usr/bin/env python3
"""canon-render — propagate canonical FACTS to every subscribed surface.
The content counterpart of harmony-check.py (which governs design VALUES).
A surface subscribes to a fact by embedding a marker span:
<!--canon:octorato.tagline-->old or stale text<!--/canon-->
canon-render rewrites t... | CarlosCaPe/octorato | scripts/canon-render.py | .py | 3a9a484863ea422e | 7.6 | 15 |
#!/usr/bin/env python3
"""capability-census.py - the live-source census heartbeat (UserPromptSubmit hook).
The connectome-heartbeat surfaces what the BRAIN has (skills/agents). It is
structurally blind to what is ALREADY LIVE outside the connectome: registered MCP
servers, connected client arms, and the authoritative ... | CarlosCaPe/octorato | scripts/capability-census.py | .py | b4b0a97bae2a822b | 7.6 | 15 |
#!/usr/bin/env python3
"""capability_inventory.py — read-only capability census of skills + agents (issue #28).
Scans every agent (`agents/**/*.md`) and skill (`skills/**/SKILL.md`) and counts
which tools / privileged actions each one declares or invokes:
- Agents declare tools in YAML front-matter: `tools: Read, W... | CarlosCaPe/octorato | scripts/capability_inventory.py | .py | 7bb06f0d26d8221c | 7.6 | 15 |
#!/usr/bin/env python3
"""
check-generic.py — Block commits that leak arm/client/person identifiers.
The brain (~/.claude/) is open-source. Its git history is public. Anything
that references an arm code, client name, coworker, internal project, vendor
incident, or other sensitive token must NEVER reach the remote.
T... | CarlosCaPe/octorato | scripts/check-generic.py | .py | bb01ccedc8eac933 | 7.6 | 15 |
#!/usr/bin/env python3
"""
Octorato traffic watcher — runs daily in GitHub Actions.
Pulls clone/view/star/fork stats from the GitHub Traffic API, compares
against the prior snapshot stored in .metrics/traffic_history.json, and
opens a GitHub Issue when a spike is detected.
Spike definition (the OR of):
- today's cl... | CarlosCaPe/octorato | scripts/check_traffic.py | .py | 734918f653d8f149 | 7.6 | 15 |
#!/usr/bin/env python3
"""claim-verify-stop.py — Stop hook: block-once when visual/runtime claims lack proof.
When the assistant asserts completion of a visual, runtime, or deploy change
("verified", "done", "deployed", "live", etc.) but the recent transcript shows
no verification evidence (no agent-browser, screensho... | CarlosCaPe/octorato | scripts/claim-verify-stop.py | .py | b2fb7a290eb5ae63 | 7.6 | 15 |
#!/usr/bin/env python3
"""claim_vocab.py: vocabulario compartido de CLAIMS DE CIERRE.
Un claim de cierre es la frase con la que el agente declara terminado un
trabajo: "listo", "quedo", "resuelto", "arreglado", "ya funciona", "fixed",
"done", "PASS", "✅".
Vive aqui, en un solo lugar, a proposito. Varios gates Stop ne... | CarlosCaPe/octorato | scripts/claim_vocab.py | .py | 6094806b3bd6892c | 7.6 | 15 |
#!/usr/bin/env python3
"""commit-msg language gate — the public octorato repo is English-only.
WHY. The brain (~/.claude == the octorato repo) is published open-source; its
git history is world-visible forever, and commit messages are part of it. The
operator's rule is that the public repo ships in English (i18n lives... | CarlosCaPe/octorato | scripts/commit_msg_language_gate.py | .py | 1cd875bc2e5a52aa | 7.6 | 15 |
#!/usr/bin/env python3
"""connectome-heartbeat.py — the Delegate-phase heartbeat (UserPromptSubmit hook).
> "Like the octopus — when its heart beats, blood circulates through its entire
> being and returns. That's how I always imagined the graph."
One light beat per prompt: circulate the whole connectome, surface th... | CarlosCaPe/octorato | scripts/connectome-heartbeat.py | .py | fc40f96906f23098 | 7.6 | 15 |
#!/usr/bin/env python3
"""
cost-vs-change.py — "is the new thing making me cheaper or more expensive?"
Correlates the daily Claude cost curve (reused from usage_report — single
source of truth for pricing) with the brain's own git log: which skills /
scripts / agents landed on which day. For every day a NEW capability... | CarlosCaPe/octorato | scripts/cost-vs-change.py | .py | 5e1ac3e3ec3e0608 | 7.6 | 15 |
#!/usr/bin/env python3
"""d__stop__wa-guardia.py — Stop detector: si mande un mensaje y espero respuesta, arma la guardia.
Directiva del operador (2026-08-04): "el hook que arme la guardia solo". Los
watchers le sirven, pero "a veces entran y a veces no" porque hasta ahora
dependian de que el modelo se acordara de arm... | CarlosCaPe/octorato | scripts/d__stop__wa-guardia.py | .py | d64c3a895c156251 | 7.6 | 15 |
#!/usr/bin/env python3
"""PreToolUse hook — involuntary delegation reflex (FAIL-OPEN, by design).
When a non-trivial / batchable Bash command runs, or when Write/Edit fires
on substantive implementation, this injects a 2D Delegate nudge reminding the
model to prefer routing that work to a sub-agent on the cheapest suf... | CarlosCaPe/octorato | scripts/delegate-gate.py | .py | 40c1f5f9f0978aa6 | 7.6 | 15 |
#!/usr/bin/env python3
"""g__pretool-bash__git-discipline.py: PreToolUse gate for the deterministic subset of GIT.version-control.
Two string-deterministic prohibitions from CLAUDE.md become fail-closed here; the
intent-bound halves (atomic commits, pull-before-push) stay model-side.
(a) Bash: deny `git push --forc... | CarlosCaPe/octorato | scripts/g__pretool-bash__git-discipline.py | .py | e07a3e521ebd599e | 7.6 | 15 |
#!/usr/bin/env python3
"""g__pretool-mcp__chat-context.py: PreToolUse gate for COMMS.chat-context-before-send.
Entering a live chat without loading its history is the no-context-chatbot
failure: the message ignores what was already said in the thread, and the
operator has to correct it. This gate makes the read involu... | CarlosCaPe/octorato | scripts/g__pretool-mcp__chat-context.py | .py | 9036e9be22a88392 | 7.6 | 15 |
#!/usr/bin/env python3
"""g__stop__delegation-audit.py: Stop gate for FLOW.bulk-fetch-delegation.
The model-ladder rule ("never burn the build/judgment engine on what a cheaper
tier does") was chronically skipped under load: the PreToolUse nudge in
delegate-gate.py is fail-open because that event carries no main-loop ... | CarlosCaPe/octorato | scripts/g__stop__delegation-audit.py | .py | c4faa01beec4272b | 7.6 | 15 |
#!/usr/bin/env python3
"""g__stop__draft-promise.py — Stop gate: no future-tense promises in paste-ready drafts.
Operator directive (2026-07-06, repeated): any paste-ready draft message handed
to the operator must NOT contain first-person future commitments ("I'll check X
and get back", "voy a revisar y te digo"). The... | CarlosCaPe/octorato | scripts/g__stop__draft-promise.py | .py | a2dafd74cdf5a5b8 | 7.6 | 15 |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tenstorrent USA, Inc.
"""One-time script: backfill added_at from git history into all entry JSON files.
Usage:
python3 scripts/backfill_added_at.py [--dry-run]
For each entry JSON under entries/ that does not already have... | tenstorrent/tt-awesome | scripts/backfill_added_at.py | .py | a25a49da380f3184 | 7.56 | 12 |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tenstorrent USA, Inc.
"""Decline a planet feed item — record that we saw it and chose not to publish.
Some feeds are broader than Planet Tenstorrent (clehaxze.tw, for instance,
mixes Tenstorrent posts with Arch/ROCm/search-eng... | tenstorrent/tt-awesome | scripts/decline_planet_item.py | .py | d161b9ecef4d031d | 7.56 | 12 |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tenstorrent USA, Inc.
"""Fetch stars, updatedAt, and a preview image for all repo-linked entries.
Writes src/_data/github_meta.json."""
import base64
import json
import os
import re
import sys
import urllib.request
import urlli... | tenstorrent/tt-awesome | scripts/fetch_github_meta.py | .py | 04acb584d4352877 | 7.56 | 12 |
#!/usr/bin/env python3
"""Generate data.json — machine-readable API export of all entries.
Output structure:
{
"meta": { generated, schema_version, total_entries, categories },
"categories": {
"<slug>": { "label": "...", "count": N, "entries": [...] },
...
}
}
Each top-level key under "cat... | tenstorrent/tt-awesome | scripts/generate_data_json.py | .py | 3195dd036ecfe9c4 | 7.56 | 12 |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tenstorrent USA, Inc.
"""Generate README.md from entries/*.json."""
import json
import re
import sys
from pathlib import Path
ROOT = Path(__file__).parent.parent
ENTRIES_DIR = ROOT / "entries"
CATEGORIES = [
("getting-sta... | tenstorrent/tt-awesome | scripts/generate_readme.py | .py | 55109c8922d11598 | 7.56 | 12 |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tenstorrent USA, Inc.
"""Build the digest that opens an automated metadata-refresh pull request.
Both CI fetch jobs (scripts/summarize_releases.py for GitHub releases,
scripts/fetch_planet_feeds.py for everything else) add ite... | tenstorrent/tt-awesome | scripts/pr_digest.py | .py | 96a5bab5514f2b4d | 7.56 | 12 |
# tests/test_validate_added_at.py
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tenstorrent USA, Inc.
import sys
from pathlib import Path
import pytest
sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))
from validate import validate_entry, validate_entry_warnings
def p(stem="te... | tenstorrent/tt-awesome | tests/test_validate_added_at.py | .py | 14e55857416bcf5d | 7.06 | 12 |
"""Shared utilities for CVE scanning and verification scripts.
Centralizes subprocess execution, exit-code normalization, timeout parsing,
and CVE ID validation so scan.py and verify.py stay DRY.
"""
import json
import os
import re
import subprocess
from datetime import datetime, timezone
from pathlib import Path
CV... | flightctl/ai-workflows | cve-fix/scripts/_common.py | .py | 4979b2cda0907d6c | 7.42 | 6 |
#!/usr/bin/env python3
"""Check for existing open PRs that address a CVE before creating duplicates.
Searches by CVE ID, package name, and diff content to catch PRs from
other CVEs that bump the same dependency, as well as Dependabot/Renovate PRs.
Usage: check_existing_prs.py <repo_full> <target_branch> <cve_id> <pac... | flightctl/ai-workflows | cve-fix/scripts/check_existing_prs.py | .py | d61e55e867026c4d | 7.42 | 6 |
#!/usr/bin/env python3
"""Render a triage report by filling an HTML template with analyzed data.
Replaces placeholder tokens in the HTML template with data from the
analysis phase and AI-generated synthesis, producing a single self-contained
HTML file that can be opened in any browser.
Usage:
render_report.py --a... | flightctl/ai-workflows | triage/scripts/render_report.py | .py | 77ea28b15dac449b | 7.42 | 6 |
"""Helpers for deriving MCP tool titles and ToolAnnotations from function names.
Centralises the classification logic so that every Check API tool is registered
with a consistent, accurate set of MCP hints (``readOnlyHint``,
``destructiveHint``, ``idempotentHint``, ``openWorldHint``) and a human-readable
``title``. Th... | check-technologies/mcp-server-check | src/mcp_server_check/annotations.py | .py | 0da10ec90cebbbf8 | 7.64 | 18 |
"""CLI context and authentication for the Check CLI."""
from __future__ import annotations
import os
from dataclasses import dataclass
from mcp_server_check.helpers import CheckContext
SANDBOX_URL = "https://sandbox.checkhq.com"
PRODUCTION_URL = "https://api.checkhq.com"
@dataclass
class _RequestContext:
life... | check-technologies/mcp-server-check | src/mcp_server_check/cli/context.py | .py | 86be4dab31fc516e | 7.64 | 18 |
"""Output formatters for the Check CLI."""
from __future__ import annotations
import json
import sys
def format_json(data: dict | list) -> str:
"""Format data as compact JSON (pipe-friendly)."""
return json.dumps(data, separators=(",", ":"))
def format_table(data: dict | list) -> str:
"""Format data a... | check-technologies/mcp-server-check | src/mcp_server_check/cli/output.py | .py | 7d7feda56a651893 | 7.64 | 18 |
"""``check init`` command — configures AI coding agents with Check API context."""
from __future__ import annotations
import json
import os
import shutil
import click
# Sentinel used to detect whether a file already has Check CLI instructions.
CHECK_SENTINEL = "<!-- check-cli -->"
# Permission entry written to .cl... | check-technologies/mcp-server-check | src/mcp_server_check/cli/setup.py | .py | 62f8406c26608bee | 7.64 | 18 |
"""Shared helpers for the Check MCP server."""
from __future__ import annotations
from collections.abc import Callable, Sequence
from dataclasses import dataclass, field
from importlib.metadata import PackageNotFoundError, version
from urllib.parse import parse_qs, urlparse
import httpx
from fastmcp import Context
... | check-technologies/mcp-server-check | src/mcp_server_check/helpers.py | .py | b692252dede7e010 | 7.64 | 18 |
"""MCP server for the Check Payroll API."""
from __future__ import annotations
import json
import os
import sys
from collections.abc import AsyncIterator, Sequence
from contextlib import asynccontextmanager
from typing import Any
import httpx
from fastmcp import Context, FastMCP
from fastmcp.exceptions import ToolEr... | check-technologies/mcp-server-check | src/mcp_server_check/server.py | .py | ace0502fa92edf2a | 7.64 | 18 |
"""Declarative tool factory for generating CRUD tools from resource definitions.
Eliminates the repeated `if field is not None: body["field"] = field` boilerplate
by generating list/get/create/update/delete tool functions from a compact schema.
Usage:
from mcp_server_check.tool_factory import Resource, Field, gen... | check-technologies/mcp-server-check | src/mcp_server_check/tool_factory.py | .py | a47e0bc58155c4e8 | 7.64 | 18 |
"""Toolset-based tool filtering for the Check MCP server.
Supports filtering via HTTP headers (remote) or environment variables (local),
following the GitHub MCP Server configuration pattern.
"""
from __future__ import annotations
import logging
import os
from dataclasses import dataclass
logger = logging.getLogger... | check-technologies/mcp-server-check | src/mcp_server_check/tool_filter.py | .py | 089784354152cb99 | 7.64 | 18 |
"""Tool metadata index for dynamic 2-tool MCP mode.
Builds a searchable index of all tool functions, enabling LLMs to discover
and execute tools on-demand via search_tools + run_tool instead of receiving
all tool schemas upfront.
"""
from __future__ import annotations
import re
from dataclasses import dataclass, fie... | check-technologies/mcp-server-check | src/mcp_server_check/tool_index.py | .py | 9c876e689971f552 | 7.64 | 18 |
"""Tool modules for the Check MCP server."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any
from fastmcp import FastMCP
from . import (
agencies,
bank_accounts,
companies,
compensation,
components,
contractor_payments,
contractors,
docu... | check-technologies/mcp-server-check | src/mcp_server_check/tools/__init__.py | .py | 28a318cbfa615855 | 7.64 | 18 |
"""Agency tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
build_params,
check_api_get,
check_api_list,
)
async def list_agencies(
ctx: Ctx,
ids:... | check-technologies/mcp-server-check | src/mcp_server_check/tools/agencies.py | .py | b39aa398f663ee82 | 7.64 | 18 |
"""Bank account tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
check_api_delete,
check_api_get,
check_api_list,
check_api_patch,
check_api_post,
... | check-technologies/mcp-server-check | src/mcp_server_check/tools/bank_accounts.py | .py | ecc5716689f28c09 | 7.64 | 18 |
"""Contractor payment tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
build_params,
check_api_delete,
check_api_get,
check_api_list,
check_api_pat... | check-technologies/mcp-server-check | src/mcp_server_check/tools/contractor_payments.py | .py | 17fa8c220d1cc4e1 | 7.64 | 18 |
"""External payroll tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
check_api_delete,
check_api_get,
check_api_list,
check_api_patch,
check_api_po... | check-technologies/mcp-server-check | src/mcp_server_check/tools/external_payrolls.py | .py | d7db8bbcc95a2713 | 7.64 | 18 |
"""Form tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.types import FormParameter
from mcp_server_check.helpers import (
Ctx,
build_params,
check_api_get,
check_api_list,
... | check-technologies/mcp-server-check | src/mcp_server_check/tools/forms.py | .py | 395a9b7093ca4042 | 7.64 | 18 |
"""API request log tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
build_params,
check_api_get,
check_api_list,
)
async def list_logs(
ctx: Ctx,
... | check-technologies/mcp-server-check | src/mcp_server_check/tools/logs.py | .py | e7dcc256908a7ff7 | 7.64 | 18 |
"""Payment tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
build_params,
check_api_get,
check_api_list,
check_api_post,
)
async def list_payments(
... | check-technologies/mcp-server-check | src/mcp_server_check/tools/payments.py | .py | 9cf4e9756c4e5b48 | 7.64 | 18 |
"""Payroll item tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.helpers import (
Ctx,
check_api_delete,
check_api_get,
check_api_list,
check_api_patch,
check_api_post,
... | check-technologies/mcp-server-check | src/mcp_server_check/tools/payroll_items.py | .py | a588230f235c5ac1 | 7.64 | 18 |
"""Workflow-level composite tools for common multi-step operations.
These tools compose multiple API calls server-side, saving the LLM
3-4 round-trips per operation.
"""
from __future__ import annotations
import asyncio
from collections.abc import Coroutine
from typing import Any
from fastmcp import FastMCP
from m... | check-technologies/mcp-server-check | src/mcp_server_check/tools/workflows.py | .py | 3a0f28a698a5f684 | 7.64 | 18 |
"""Workplace tools for the Check API."""
from __future__ import annotations
from fastmcp import FastMCP
from mcp_server_check.annotations import add_annotated_tool
from mcp_server_check.types import Address
from mcp_server_check.helpers import (
Ctx,
build_body,
build_params,
check_api_get,
check... | check-technologies/mcp-server-check | src/mcp_server_check/tools/workplaces.py | .py | 80618db8c1c98c94 | 7.64 | 18 |
"""Shared types for the Check MCP server."""
from __future__ import annotations
from typing_extensions import TypedDict
class Address(TypedDict, total=False):
"""A US mailing address. All keys are optional at the type level; the API
will enforce which ones are required for each endpoint."""
line1: str
... | check-technologies/mcp-server-check | src/mcp_server_check/types.py | .py | 2c9bebabcf280430 | 7.64 | 18 |
"""Shared test fixtures for the Check MCP server."""
from __future__ import annotations
from dataclasses import dataclass
import httpx
import pytest
import respx
from fastmcp import Context, FastMCP
from fastmcp.server.context import _current_context
from mcp.server.lowlevel.server import request_ctx
from mcp_server... | check-technologies/mcp-server-check | tests/conftest.py | .py | 91a5870085dfc48a | 8.14 | 18 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.