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 |
|---|---|---|---|---|---|---|
"""honest geometric ray-tracer primitives · read-only."""
from __future__ import annotations
import numpy as np
def thin_lens_refract(
points: np.ndarray, # (N, 3) at lens plane (z=0 slice)
directions: np.ndarray, # (N, 3) ray direction before lens
z_local: float, # not used (thin-lens at plane)
... | chunxiaoxx/nautilus-compass | _scratch_parking/optics_poc_lens_pair/Optics/lens_pair_aberration_v1_001/verification/_core.py | .py | 207af6572efdf360 | 7.45 | 7 |
"""Honest geometric ray-tracing verifier · read-only.
Imports `align_lens_pair` from `baseline/init.py`, ray-traces through both
lenses, measures RMS spot radius on the target focal plane.
"""
from __future__ import annotations
import argparse
import json
import importlib.util
import sys
from pathlib import Path
im... | chunxiaoxx/nautilus-compass | _scratch_parking/optics_poc_lens_pair/Optics/lens_pair_aberration_v1_001/verification/evaluate.py | .py | acc91c611ad3eb67 | 7.45 | 7 |
# -*- coding: utf-8 -*-
"""86 题正解一致性自检(抽样版)。
双门(对每题,git worktree 隔离):
门1 starter 必败:worktree@buggy_commit + 测试@fix_commit → pytest 必须 FAIL
门2 正解必过:再把 starter_path 换成 @reference_fix_commit 版 → pytest 必须 PASS
"""
import json
import subprocess
import sys
import tempfile
from pathlib import Path
REPOS = {
"nautil... | chunxiaoxx/nautilus-compass | _v5_proof_deposit/g2b1/_g2b1_consistency_check.py | .py | 5f9553455d52813c | 7.45 | 7 |
"""compass ALE-Bench scorer · wraps ale_bench public_eval into an rsi_two_arm eval_fn.
齿轮⑤/③ 旁支 → 胜负手燃料线(ALE 连续分·非饱和)。eval_fn 跑在 T4 ALE env
(需 ale_bench 1.5.0 + cpp23 判题镜像 · /workdir 须 1777 · 见 docs)。
设计 = effect 注入(start_fn)· 与 V5 `ale_fuel_batch.py` 的 strong_fn/doubao_fn 注入
风格一致(anchor#5 不另造)。单测注 fake session 无需 li... | chunxiaoxx/nautilus-compass | ale_bench/ale_eval.py | .py | 5041db05e299081f | 7.45 | 7 |
#!/usr/bin/env python3
"""nautilus-compass KPI audit · 看真实使用率 · 1 周后跑.
Adds (2026-05-30 · E.fix-2): `act_on_rate()` function reading
drift_mitigation_log.jsonl to compute act-on rate (closes 5/27 finding's
open loop · detection side ~25k events · ack side previously 0).
"""
import json
import sys
from collections impo... | chunxiaoxx/nautilus-compass | audit_kpi.py | .py | 8a8afac2ec28c34b | 7.45 | 7 |
#!/usr/bin/env python3
"""v2.0.0 · #2 · self-evolve CLI · fallback for SessionEnd-hook missed runs.
Triggers L1 collapse + entity link scan for one project or all projects.
Designed for cron / systemd timer · every 1h is a reasonable backstop.
Usage:
python bin/cli_self_evolve.py --project <slug> # specific pro... | chunxiaoxx/nautilus-compass | bin/cli_self_evolve.py | .py | e354db28e01eaa0f | 7.45 | 7 |
"""v1.6.0 · 用户 #1 真融合 · 把本地 session_*.md push 到 cloud /v1/v14/ingest_obs
V7-N5 phase 2 P0:
本地 stop_hook 已写 session_*.md + drift sidecar · 但 cloud 不知道(local 不 sync cloud)。
V5/Kairos/Souls Fusion 的 cross-dialog recall 看不到我(claude-code-compass-dialog)写的。
修法: 每次 stop_hook 新写一份 session_*.md 后 · SSH inline POST 到 cloud:877... | chunxiaoxx/nautilus-compass | cloud_ingest.py | .py | cdaa17863c907b3c | 7.45 | 7 |
"""compass fleet 记忆胶囊客户端(cross-agent 集体学习)· 2026-06-17 · compass 交付给 V5/platform
把"飞轮 agent learning 写回 + claim 前 recall"降到两个 import 即用的函数,V5 无需自己写 HTTP。
- W1: write_learning(agent_id, task_family, reason) 解完 reward=1.0 后调
- W2: compass_recall_pits(task_family) -> [{item_id,reason}] claim/产出前调·直接喂 V5
fd... | chunxiaoxx/nautilus-compass | compass_fleet_memory.py | .py | a9919039ee27673c | 7.45 | 7 |
"""compass v1.0 · RAID-2 (writer-reviewer) write path · #7 fusion.
For org / enterprise plan: every observation must pass a reviewer-agent
audit before being written to memory. The reviewer is compass's own anchor
+ LLM judge · NOT the writer agent itself (defeats purpose).
Workflow:
1. Writer submits obs → POST /v... | chunxiaoxx/nautilus-compass | compass_raid.py | .py | 95b0ea575f3117a9 | 7.45 | 7 |
#!/usr/bin/env python3
"""compass verify · v1.0 tamper-evidence CLI.
Walks ~/.claude/projects/<encoded>/memory/ directories, verifies the Merkle
hash chain recorded in .chain.json, reports tampered / missing files.
Exit code:
0 · all verified chains are valid
1 · any tampered or missing file detected, or chain fi... | chunxiaoxx/nautilus-compass | compass_verify.py | .py | f2c2f982cb6d5e99 | 7.45 | 7 |
"""齿轮⑤ 深 consolidation:36k cycle-auto 日记碎片 → 挑信号做胶囊 + 噪声归档(可逆)。
实测(2026-06-22):~/.claude/projects 下 36032 个 cycle-*-auto 目录(93%)·95% 单文件·
内容 = V5 daemon 每 cycle 的 think:/learn:/evolve: 独白·抽样 learn: 字段全空 = 噪声非教训。
把它们整体做成胶囊会淹没真信号(反精炼)→ 正解:挑 learn: 非空的少数蒸馏·其余归档。
设计 = 纯解析/分类(TDD)+ 注入 I/O(walk/write/archive)。归档 = mv 可逆·非删... | chunxiaoxx/nautilus-compass | cycle_consolidator.py | .py | 1ff9b223f9695389 | 7.45 | 7 |
"""compass v0.9 · platform_anchors layered loader · #6 fusion.
合并 3 层 anchors:
1. anchors_platform_base.json · 平台通用 (15 pos + 25 neg)
2. anchors_<domain>.json · 行业 (finance/legal/medical/vc/zenmind)
3. anchors.json · tenant/user 个人补充
输出: list[positive], list[negative] · 喂给 daemon BGE 索引
调... | chunxiaoxx/nautilus-compass | daemon_anchor_loader.py | .py | 6397c36a375110e8 | 7.45 | 7 |
#!/usr/bin/env python3
"""V5 Memory Plugin · 深度边界测试 · 跑慢但真.
Test 1: hook 模式 (无 BGE) 速度真 < 1s
Test 2: BGE cold cache · 真冷启
Test 3: BGE warm cache · 应 < cold (即便 model load 是 fixed)
Test 4: anchors.json mtime 变 → 重 embed
Test 5: memory file mtime 变 → 部分重 embed (不是全部)
Test 6: 跨项目 (cwd 切到非 nautilus-core)
Test 7: 特殊 prompt... | chunxiaoxx/nautilus-compass | deeptest.py | .py | 9a261eaf0bd515e0 | 7.95 | 7 |
"""E.fix-1 (2026-05-30) · drift alert ack writer + reader.
Background (5/27 finding · session_20260527_drift_loop_open_tuneout):
detection side wrote 25k+ events to `.cache/drift_mitigation_log.jsonl`
(recall.py:159 writer) with stable `alert_id` per fire · but ZERO ack
records were ever written → act-on rate uncomput... | chunxiaoxx/nautilus-compass | drift/act_log.py | .py | 67a2775da7639bcc | 7.45 | 7 |
"""H.1 (2026-05-30) · stop_hook auto-detect drift alert acks in session text.
Closes the 5/27 drift loop open finding's last unmeasured side: agent
self-acknowledgement of drift alerts (vs the user-CLI-only path via E.fix-3).
Algorithm (rule-based · no LLM · stop_hook policy):
1. Find every `a-XXXXXXXX` literal (8 he... | chunxiaoxx/nautilus-compass | drift/auto_ack.py | .py | 756d791c822f94f2 | 7.45 | 7 |
"""Desktop notifications.
`notify(state, project, detail)` is the single entry point. It
respects the `@ccm-notify` tmux option (off / permit / completed /
permit,completed / all) and dispatches via the best available
backend:
- macOS, terminal-notifier installed → `terminal-notifier
-group ccm-<project>` so a ... | yohasebe/tmux-ccm | lib/ccm_notify.py | .py | 46205ecdf27bb089 | 7.59 | 14 |
"""Declarative state-detection rule table + evaluator.
This module owns the **legacy** detection path: the
priority-ordered `DETECTION_RULES` table and its supporting types
(`DetectionContext`, `Rule`, `Action`, `USE_RAW`). It runs as the
safety net when `ccm_activity.derive_state_from_events` returns
None (empty even... | yohasebe/tmux-ccm | lib/ccm_rules.py | .py | 1fe807f04fcd811f | 7.59 | 14 |
"""Project-state persistence: save / load / list / delete snapshots.
A snapshot is a JSON manifest at
`$CCM_SNAPSHOT_DIR/<name>.json` recording every ccm-tagged tmux
window: `(name, dir, auto_start_claude)`. The `_autosave` snapshot
written by `cmd_snapshot_save("_autosave", quiet=True)` is the
restore point for `ccm ... | yohasebe/tmux-ccm | lib/ccm_snapshot.py | .py | 78e5cfdeee82cd7a | 7.59 | 14 |
"""Shared test infrastructure: lib path setup, autouse fixtures,
and helpers used across the per-module test files."""
import json
import os
import sys
import time
from datetime import datetime, timezone
import pytest
# Make lib/ importable so each test file can `import ccm_core` etc.
sys.path.insert(0, os.path.join... | yohasebe/tmux-ccm | tests/conftest.py | .py | ef7fb735825d413c | 8.09 | 14 |
"""Tests for ccm_agentview — read-only access to Claude Code's
per-user agent-view daemon (roster.json + jobs/<short>/state.json)."""
import json
import os
import sys
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib"))
import ccm_agentview
@pytest.fixture
def fake_claude_home(tmp... | yohasebe/tmux-ccm | tests/test_agentview.py | .py | 1742fb651f76a5bd | 8.09 | 14 |
"""Tests for ccm_core.py — state detection, helpers, and batch tmux commands."""
import json
import os
import re
import sys
import time
from datetime import datetime, timezone
from unittest.mock import patch, MagicMock, call
import pytest
# Add lib to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "... | yohasebe/tmux-ccm | tests/test_ccm_core.py | .py | fc07c85b447ba8f8 | 7.09 | 14 |
"""Property-based tests for `derive_state_from_events`.
Where the parametric tests in `test_ccm_core.py::TestDeriveStateFromEvents`
exercise specific hook sequences, this file verifies invariants that
must hold across the entire input space:
- never raises (any input → either a valid state or None)
- returns a va... | yohasebe/tmux-ccm | tests/test_derive_invariants_pbt.py | .py | 92974460375ab5ce | 7.09 | 14 |
"""Tests for the CCM_IGNORE feature: hiding a pane/session from ccm.
Covers the predicate (`_pane_is_ignored`), the count helper, the raw
pane-aggregation skip, and the `ccm ignore` / `ccm unignore` command
markers. The bash side (hook early-exit + pane stamp) is covered in
tests/test_event_log.bats.
"""
import os
fr... | yohasebe/tmux-ccm | tests/test_ignore.py | .py | 541f6ecd6d831d11 | 8.09 | 14 |
"""Tests for ccm_pane_state.
Auto-split from test_ccm_core.py. Shared fixtures + helpers
(write_jsonl, make_ps_lines, real_activity_record, system_record,
iso_ts) live in conftest.py; import them here when used.
"""
import json
import os
import re
import sys
import time
from datetime import datetime, timezone
from un... | yohasebe/tmux-ccm | tests/test_pane_state.py | .py | 050ef930b377ddaa | 7.09 | 14 |
"""Tests for ccm_rules.
Auto-split from test_ccm_core.py. Shared fixtures + helpers
(write_jsonl, make_ps_lines, real_activity_record, system_record,
iso_ts) live in conftest.py; import them here when used.
"""
import json
import os
import re
import sys
import time
from datetime import datetime, timezone
from unittes... | yohasebe/tmux-ccm | tests/test_rules.py | .py | 6c7d498f1b0f7cec | 8.09 | 14 |
"""Tests for `ccm sidekick-send` — delivery to the external-agent
sidekick pane of the caller's own window.
The command's safety story is identity, not state: ccm tracks no
state for a non-Claude pane, so the target is found from tmux
metadata (foreground command + working directory), every ambiguity
refuses, and deli... | yohasebe/tmux-ccm | tests/test_sidekick_send.py | .py | e17103ab465fd952 | 8.09 | 14 |
"""Tests for ccm_signals.
Auto-split from test_ccm_core.py. Shared fixtures + helpers
(write_jsonl, make_ps_lines, real_activity_record, system_record,
iso_ts) live in conftest.py; import them here when used.
"""
import json
import os
import re
import sys
import time
from datetime import datetime, timezone
from unitt... | yohasebe/tmux-ccm | tests/test_signals.py | .py | e6c3a52fde0a92cf | 7.09 | 14 |
"""Regression tests for the "silent exception class" of bug.
The autosave NameError that ran for 38 hours, the notify dedup
keying mismatch, and the multi-line ❯ false-BUSY were all silent
because their failure paths were caught by broad `except Exception:`
clauses or by `log_caught_exception`. Tests that mock the cal... | yohasebe/tmux-ccm | tests/test_silent_exceptions.py | .py | 34f34d1ac679dcfd | 8.09 | 14 |
"""Trace-replay regression corpus.
Replays REAL captured event logs (hooks/<sessionId>.events.jsonl
files lifted verbatim from production incidents) through
`derive_state_from_events` and asserts the expected state at probe
points along the timeline.
Why this exists: every detection bug ccm has had shares one shape —... | yohasebe/tmux-ccm | tests/test_trace_replay.py | .py | 2361210d2282cb2f | 8.09 | 14 |
import json
import os
from typing import Annotated, TypedDict
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage, SystemMessage
from langchain_core.tools import tool
from langchain_openai import ChatOpenAI
from langgraph.graph import END, StateGraph
from langgraph.graph.message import add_message... | huaweicloud/agentarts-sdk-python | examples/agent_tools/integrate_tools.py | .py | 1349b91a9fb1d8ee | 7.6 | 15 |
"""LangChain Integration Example - Agent with tools using AgentArts SDK"""
import os
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.tools import tool
from langchain_openai import ChatOpenAI
from agentarts.sdk import Agen... | huaweicloud/agentarts-sdk-python | examples/integration/langchain/langchain_agent.py | .py | 06886b710b77ce42 | 7.6 | 15 |
"""
Navigation Agent Demo - Memory Recall Tool
Exposes a single LangChain tool, recall_memory, that performs
semantic search over the AgentArts Memory service to retrieve
long-term memories (user preferences, historical facts, etc.).
This is the ON-DEMAND component of the hybrid recall architecture.
The AUTO-INJECTIO... | huaweicloud/agentarts-sdk-python | examples/navigation_langgraph_memory/memory_tools.py | .py | 84cb2a824718f293 | 7.6 | 15 |
"""Navigation Agent Demo - Message Utilities
Shared helpers for extracting message content and fetching session history.
Used by both CLI (nav_agent.py) and TUI (tui_app.py) to avoid duplication.
"""
from typing import List, Tuple
import config # noqa: F401
from config import API_KEY, SPACE_ID, VERIFY_SSL
def ext... | huaweicloud/agentarts-sdk-python | examples/navigation_langgraph_memory/message_utils.py | .py | a7a3ec7a637337bf | 7.6 | 15 |
"""
Navigation Agent Demo - LangGraph Agent with AgentArts Memory
A local interactive navigation assistant that can:
- Search for POIs (gas stations, restaurants, parking, etc.)
- Plan routes (driving/walking/riding/transit)
- Generate map visualization links
- Recall long-term user preferences and history via... | huaweicloud/agentarts-sdk-python | examples/navigation_langgraph_memory/nav_agent.py | .py | e9190f03f81198e0 | 7.6 | 15 |
"""
Navigation Agent Demo - Session Manager
Manages multiple conversation sessions locally. Each session maps to
an AgentArts Memory session (via session_id). Session metadata is
persisted to sessions.json so sessions survive restarts.
Usage:
from session_manager import select_session_interactive
session_id =... | huaweicloud/agentarts-sdk-python | examples/navigation_langgraph_memory/session_manager.py | .py | 14f6215b6aca67a2 | 7.6 | 15 |
"""
Navigation Agent Demo - Memory Space Setup (run once)
Creates a new AgentArts Memory space with all four builtin extraction
strategies. Prints the Space ID and API Key that must be exported as
environment variables before running nav_agent.py.
Sessions are NOT created here — session_manager.py creates a new
Agent... | huaweicloud/agentarts-sdk-python | examples/navigation_langgraph_memory/setup_memory.py | .py | 7997ce88191f637d | 7.6 | 15 |
"""Navigation Agent TUI application using Textual framework."""
import asyncio
import io
import threading
from typing import Optional
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.screen import ModalScreen
from textual.widgets import Button, Footer, Header, Input, Lab... | huaweicloud/agentarts-sdk-python | examples/navigation_langgraph_memory/tui_app.py | .py | f0d83f76c31231da | 7.6 | 15 |
"""Type aliases for improved developer experience.
This module provides user-friendly type aliases for types used throughout the SDK.
These aliases make injected types discoverable without reading source code.
"""
import sys
from typing import TypeAlias
if sys.version_info >= (3, 11):
from enum import StrEnum
el... | huaweicloud/agentarts-sdk-python | src/agentarts/sdk/identity/types.py | .py | 72e5c16bb5ff7b35 | 7.6 | 15 |
"""
Configuration for AgentArts LangGraph Integration
Provides configuration classes for checkpoint saver and other LangGraph
integration components.
"""
from __future__ import annotations
from typing import Any
from pydantic import BaseModel
try:
from langchain_core.runnables import RunnableConfig
LANGGR... | huaweicloud/agentarts-sdk-python | src/agentarts/sdk/integration/langgraph/config.py | .py | 26294328431ae312 | 7.6 | 15 |
"""
Agent Memory SDK - AsyncMemoryClient
Async version of MemoryClient for non-blocking operations.
All request parameters and response handling identical to MemoryClient.
Control plane operations remain synchronous (low-frequency operations).
"""
import threading
from typing import Any
from agentarts.sdk.utils.con... | huaweicloud/agentarts-sdk-python | src/agentarts/sdk/memory/async_client.py | .py | f0c8d41aabc99208 | 7.6 | 15 |
"""
Agent Memory SDK - Async MemorySession
Async version of MemorySession for non-blocking operations.
All request parameters and response handling identical to MemorySession.
"""
import logging
from .inner.config import (
MemoryInfo,
MemoryListFilter,
MemoryListResponse,
MemorySearchFilter,
Mem... | huaweicloud/agentarts-sdk-python | src/agentarts/sdk/memory/async_session.py | .py | 9a932e856cbec1d9 | 7.6 | 15 |
"""
AgentArts Runtime Models
Defines constants, enumerations, and data models used by the runtime application.
"""
from __future__ import annotations
from enum import Enum
SESSION_HEADER = "x-hw-agentarts-session-id"
ACCESS_TOKEN_HEADER = "X-HW-AgentGateway-Workload-Access-Token"
USER_ID_HEADER = "X-HW-AgentGateway... | huaweicloud/agentarts-sdk-python | src/agentarts/sdk/runtime/model.py | .py | 1534616c51f450f6 | 7.6 | 15 |
"""
Base HTTP Client Module
Provides a base HTTP client for API calls. Other service implementations
should inherit from BaseHTTPClient to make HTTP requests.
The client automatically detects streaming responses based on the
response ``Content-Type`` header:
- **Regular** (JSON / text): ``data`` is a parsed ``dict``... | huaweicloud/agentarts-sdk-python | src/agentarts/sdk/service/http_client.py | .py | 0be20c86c71f83d0 | 7.6 | 15 |
# -*- coding: utf-8 -*-
"""Numbers the engine reads wrongly, rewritten before it sees them.
Leopard's front end is good at numbers up to six digits and gives up after
that. Measured on Alex, what the engine does with a bare digit string:
1234 "twelve thirty four" -- read as a year
12345 "... | tgeczy/panthera-speech | panthera/addon/synthDrivers/_panthera/pantheranumbers.py | .py | dfab245639eb36a0 | 7.59 | 14 |
# -*- coding: utf-8 -*-
"""Enough of NVDA to import and drive the synthesizers outside NVDA.
The fakes are installed once, here, for both generations. They used to be a
copy each, and the copies had drifted: only Leopard's fake `DriverSetting`
recorded its arguments, which is the whole of what `test_settings_panel.py... | tgeczy/panthera-speech | panthera/tests/conftest.py | .py | 6bd1be0e403b4dc4 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""Leopard's engine fixtures.
Scoped to this directory on purpose. Tiger's conftest calls its fixtures
exactly the same things, and pytest keeps them apart because a conftest only
reaches its own folder and below. The NVDA fakes both generations share are
one level up.
"""
import os
import pyt... | tgeczy/panthera-speech | panthera/tests/leopard/conftest.py | .py | 4e1d59aaf25ceac0 | 8.09 | 14 |
"""A breath needs a sentence boundary inside one utterance.
Measured on Alex: N sentences handed over together give N-1 breaths, at the
boundaries and nowhere else. A breath is 369-399 ms of turbulent noise --
rms 76-123 against a peak of ~680, around 3000 zero crossings a second -- which
is what tells it apart from ... | tgeczy/panthera-speech | panthera/tests/leopard/test_breath.py | .py | b21ee2478ab91d05 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""Arrowing by letter must not restart the engine on every keystroke.
Reported by Timothy Wynn, who could hear it happening:
"Interrupt the voice close to the start of the utterance, e.g., navigating
rapidly by letter. You will hear that the executable runs again."
`cancel()` used to... | tgeczy/panthera-speech | panthera/tests/leopard/test_leopard_interrupt_cost.py | .py | d455c24f751fc3f0 | 8.09 | 14 |
"""A single very long token must render audio, not one frame of silence.
Reported by Brandon (@serrebidev) as issue #4: **Alex returned one frame and a
status of 0 -- indistinguishable from success -- for an unbroken token of about
370 characters or more**, and was intermittently silent below that, one run in
five at ... | tgeczy/panthera-speech | panthera/tests/leopard/test_long_tokens.py | .py | 4fc05f808c97d935 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""The engine's sentence pause, restored between continuous-reading chunks.
Inside one utterance the engine composes a pause between sentences -- about
half a second at 180 wpm -- and a chunk ends with zero trailing frames, so
during say-all every chunk boundary slammed shut (panthera-speech#10... | tgeczy/panthera-speech | panthera/tests/leopard/test_sentence_pause.py | .py | cd5427061fb05262 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""The settings panel, checked the way it used to be checked by eye.
Two labels claiming the same access key is invisible in review and obvious to
somebody driving the panel from the keyboard: the second one silently stops
being reachable by its letter. It has happened, and the rule that came o... | tgeczy/panthera-speech | panthera/tests/leopard/test_settings_panel.py | .py | d18bf06e3f7d7b16 | 8.09 | 14 |
"""Toggling an engine setting must survive being done while speech is running.
The settings reach the engine through its environment, which is read once at
startup, so changing one has to replace the host process. How that replacement
is done is the whole question.
"""
import time
from test_leopard_driver import _wa... | tgeczy/panthera-speech | panthera/tests/leopard/test_toggle.py | .py | 4a4a003941154338 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""A song is one utterance, however many chunks say-all hands it over in.
The engine gives the last note of every utterance a sentence-final pitch
fall, and 1.1.1's input-mode carry made each say-all chunk its own
utterance -- so every verse ended on a droop that is in no score
(panthera-speech... | tgeczy/panthera-speech | panthera/tests/leopard/test_tune_join.py | .py | 0ec371eccf11ee12 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""Lion's engine fixtures.
Scoped to this directory on purpose. Tiger's and Leopard's conftests call
their fixtures exactly the same things, and pytest keeps them apart because a
conftest only reaches its own folder and below. The NVDA fakes all three
generations share are one level up.
"""
i... | tgeczy/panthera-speech | panthera/tests/lion/conftest.py | .py | f188ec1fe7e4ca1d | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""Silence must not cost you the next thing you ask for.
**This is the bug that shipped in 0.95.0**, and three people described it from
three directions before anything in this repository could see it:
Jerry: "if I don't do anything on the computer for maybe a minute or two,
then I hav... | tgeczy/panthera-speech | panthera/tests/lion/test_lion_idle.py | .py | abc75789439db6cb | 7.09 | 14 |
# -*- coding: utf-8 -*-
"""10.7's input modes work now, and the stripping machinery stays.
For two shipped releases this file guarded the opposite: `[[inpt TUNE]]`
annotations were ignored (the melody died in two CF constructors the host
had left as thunks) and a malformed phoneme after `[[inpt PHON]]` killed the
host... | tgeczy/panthera-speech | panthera/tests/lion/test_lion_input_modes.py | .py | 88c808a947149d02 | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""A paragraph must not stop at 511 characters.
Reported by Amir, who found the boundary from the outside and gave the exact
paragraph to reproduce it with:
"I've found an Alex-related text omission bug. It seems that if a paragraph
contains more than 500 characters, Alex Premium 2.0 s... | tgeczy/panthera-speech | panthera/tests/lion/test_lion_long_text.py | .py | 0bdbb617b9de340d | 8.09 | 14 |
# -*- coding: utf-8 -*-
"""The engine has to render much faster than it speaks.
**This file exists because nothing else in the suite could tell that Lion ran
at nine tenths of real time.** Every voice spoke, every render was clean, the
audio was byte-comparable with Leopard's -- and a three second announcement
took t... | tgeczy/panthera-speech | panthera/tests/lion/test_lion_speed.py | .py | 99de3b66a4b7a901 | 8.09 | 14 |
"""Tool Approval Policy resolver and store (CTR-0099, PRP-0067, UDR-0043).
Three responsibilities:
1. ``resolve_require_set()`` -- maps ``TOOL_APPROVAL_MODE`` and
``TOOL_APPROVAL_REQUIRE_LIST`` to a ``frozenset[str]`` of tool names
that should receive ``@tool(approval_mode="always_require")`` at
registration... | motojinc25/chatwalaau | backend/src/app/agent/approval.py | .py | a890155fbb2e0579 | 7.42 | 6 |
"""Fact-level tracing for the tool-approval resume path (CTR-0009 / CTR-0100).
Three releases in a row have fixed a provider 400 on this path from a hypothesis
that a reproduction confirmed and production then refuted. This module exists so
the NEXT report carries the facts instead: what the accumulator observed in th... | motojinc25/chatwalaau | backend/src/app/agent/approval_debug.py | .py | e860ffadba2768bd | 7.42 | 6 |
"""Structured capability guidance for Prompt Assembly slot #3 (PRP-0120, CTR-0104 v4).
Slot #1 is the Global Agent Identity, slot #2a/#2b are the User Profile / Agent Memory
Blocks (each delimited by a `<user-profile>` / `<agent-memory>` tag), and slot #3 is
the capability / tool guidance. Before PRP-0120 slot #3 was ... | motojinc25/chatwalaau | backend/src/app/agent/capability_guidance.py | .py | f14fb992551db893 | 7.42 | 6 |
"""Declarative agent discovery + inventory + CORE (CTR-0142, PRP-0094, UDR-0072).
The bundled CORE agent reproduces current ChatWalaʻau behavior (all-``None`` spec)
and is always present and active by default (UDR-0072 D7/D13). Custom agents are
discovered from ``DECLARATIVE_AGENTS_DIR`` (nested folders allowed) throu... | motojinc25/chatwalaau | backend/src/app/agent/declarative/loader.py | .py | 322e564c2274681f | 7.42 | 6 |
"""Parse + validate + map a declarative agent YAML (CTR-0142, PRP-0094, UDR-0072).
The YAML is a SPECIFICATION; ChatWalaʻau OWNS construction (UDR-0072 D1/D2). This
module:
1. Parses the YAML document (best-effort schema validation via the MAF
``AgentFactory`` when ``agent-framework-declarative`` is installed, els... | motojinc25/chatwalaau | backend/src/app/agent/declarative/mapping.py | .py | 13dc68a978d5677c | 7.42 | 6 |
"""Declarative agent mapped spec + error types (CTR-0142, PRP-0094, UDR-0072).
A ``DeclarativeAgentSpec`` is the ChatWalaʻau-side projection of a declarative
agent YAML: only the fields ChatWalaʻau can MAP onto its own construction path
(CTR-0070 / CTR-0102 / the prompt-assembly slots). Everything ChatWalaʻau owns --
... | motojinc25/chatwalaau | backend/src/app/agent/declarative/spec.py | .py | ff49972a843c3d46 | 7.92 | 6 |
"""In-memory active declarative-agent store (CTR-0142, PRP-0094, UDR-0072 D7).
Holds the single active agent id, process-global and NEVER persisted: on restart
the active agent re-initializes to CORE, so the default state reproduces
pre-PRP-0094 behavior byte-for-byte (UDR-0072 D7/D13). A small ``threading.Lock``
guar... | motojinc25/chatwalaau | backend/src/app/agent/declarative/store.py | .py | c4edde347b726121 | 7.42 | 6 |
"""Stable tool identifiers for the per-agent tool allow-list (PRP-0117, UDR-0100).
A declarative agent may carry a ``tool_allowlist`` -- a list of stable identifiers
that SUBSETS the globally available tool surface (UDR-0100 D1). This module is the
ONE definition of that identifier scheme, shared by:
* the mapping ... | motojinc25/chatwalaau | backend/src/app/agent/declarative/tool_ids.py | .py | b9ab199885ed71b2 | 7.42 | 6 |
"""Agent tool inventory: the selectable tool surface for authoring (CTR-0178).
Composes the tool surface a declarative agent may put in its ``tools:`` allow-list
into ONE read model for the authoring GUI (PRP-0117, FEAT-0061, UDR-0100 D3):
* built-in FUNCTION tools -- enumerated from a static registry that mirrors ... | motojinc25/chatwalaau | backend/src/app/agent/declarative/tool_inventory.py | .py | 09864de3d52ad328 | 7.42 | 6 |
"""Visibility into the harness conversation's own history (PRP-0148 Section 4).
RES-0003 F6: the request trace reports the message list AFTER every middleware has
run, fused into one ``maf_messages=`` number. Nothing reported what the history
provider HELD, what it LOADED, or which session it read from -- which is why... | motojinc25/chatwalaau | backend/src/app/agent/harness/history_debug.py | .py | 3cb1823316857b10 | 7.42 | 6 |
"""Harness agent discovery + inventory (CTR-0192, PRP-0135, UDR-0119).
Discovers ``kind: Harness`` YAML from ``DECLARATIVE_AGENTS_DIR`` -- the same tree
as Prompt agents and Workflows, dispatched by top-level ``kind`` through the
single ``read_top_kind()`` seam (UDR-0119 D1) -- via the loader's realpath jail
(the CTR-... | motojinc25/chatwalaau | backend/src/app/agent/harness/loader.py | .py | 75776ee61f7766f4 | 7.42 | 6 |
"""Parse + validate + map a ``kind: Harness`` YAML (CTR-0192, PRP-0135, UDR-0119).
The schema is ChatWalaʻau-OWNED (UDR-0119 D1): no MAF declarative factory is
involved. Structural problems and unknown fields are recorded as warnings; ANY
warning blocks the agent from becoming a selectable run-target (UDR-0119 D8).
Cr... | motojinc25/chatwalaau | backend/src/app/agent/harness/mapping.py | .py | aa5262bc21e044f8 | 7.42 | 6 |
"""Harness Agent Management + Authoring API (CTR-0194 / CTR-0195, PRP-0135).
CTR-0194 (management + run-target): inventory / detail / dry-run validate; the
run-target is selected per-conversation via AG-UI ``state.harness_id``
(CTR-0009), NOT a global activation -- there is no rebuild and no AgentRegistry
involvement ... | motojinc25/chatwalaau | backend/src/app/agent/harness/router.py | .py | 70d6e3d72c563822 | 7.42 | 6 |
"""Per-conversation harness session cache (CTR-0009 v-next, PRP-0135, UDR-0119 D3/D4).
A harness agent is a per-conversation RUN-TARGET. Its live state -- the MAF
InMemoryHistoryProvider history, todo list, mode, and loop state -- lives in ONE
(agent, AgentSession) pair per (harness_id, thread_id), cached here so it
s... | motojinc25/chatwalaau | backend/src/app/agent/harness/runtime.py | .py | db51257110bcba48 | 7.42 | 6 |
"""Workspace shell executor for harness agents (CTR-0193, PRP-0135, UDR-0119 D7).
WHY THIS EXISTS -- measured, not inferred:
MAF's ``LocalShellTool`` executes commands through ``asyncio`` subprocess
transports. Under uvicorn the running loop is a ``SelectorEventLoop``
(``uvicorn/loops/asyncio.py`` returns ``asyncio.S... | motojinc25/chatwalaau | backend/src/app/agent/harness/shell.py | .py | 46f710c2041df183 | 7.42 | 6 |
"""Harness agent mapped spec + error types (CTR-0192, PRP-0135, UDR-0119).
A ``HarnessAgentSpec`` is the ChatWalaʻau-side projection of a ``kind: Harness``
YAML -- a schema ChatWalaʻau OWNS end to end (UDR-0119 D1; MAF declarative has no
harness kind). Unlike the Prompt lane (UDR-0072 D1/D2), the runtime agent IS
MAF-... | motojinc25/chatwalaau | backend/src/app/agent/harness/spec.py | .py | fd9073945fc22994 | 7.92 | 6 |
"""Global Agent Identity and Prompt Assembly (PRP-0073, CTR-0104, UDR-0049).
The agent identity -- the instance-wide persona, tone, base posture, and
behaviors-to-avoid shared across every project and conversation -- is the
FIRST block of every agent's system prompt ("Prompt Assembly slot #1",
UDR-0049 D4).
It is loa... | motojinc25/chatwalaau | backend/src/app/agent/identity.py | .py | 19613fbaa9093d28 | 7.42 | 6 |
"""LLM prompt dump for debugging / observability (PROMPT_DUMP_*, CTR-0009 / CTR-0006).
When ``PROMPT_DUMP_ENABLED`` is set (default false), each AG-UI run writes the fully
assembled system prompt (Identity slot #1 + User Profile slot #2a + Agent Memory slot
#2b + capability guidance) together with the run's input mess... | motojinc25/chatwalaau | backend/src/app/agent/prompt_dump.py | .py | 88249d903c6d2b13 | 7.42 | 6 |
"""Tool Approval REST router (CTR-0099 part 2, PRP-0067).
Single mutating endpoint ``POST /api/tool-approval`` that the SPA uses
to release a parked tool call from the AG-UI streaming endpoint.
Lifecycle:
1. AG-UI ``_stream_with_reasoning`` sees a ``function_approval_request``
content, registers an ``ApprovalReco... | motojinc25/chatwalaau | backend/src/app/agent/router.py | .py | e0adb7cc564144a8 | 7.42 | 6 |
"""Temporary Chat session policy (CTR-0106, PRP-0076, UDR-0052).
An ephemeral, "incognito-style" conversation that:
- is excluded from the user-facing history (sidebar list / search) -- it lives
in a SEPARATE ``.temporary/`` quarantine directory, never in ``.sessions/``;
- runs de-personalized -- the effective syst... | motojinc25/chatwalaau | backend/src/app/agent/temporary.py | .py | 8eb2f5650eb09039 | 7.42 | 6 |
"""API Authentication Dependency (CTR-0083, PRP-0045, PRP-0051, PRP-0057).
Shared FastAPI dependencies for authentication across REST endpoints,
the AG-UI SSE endpoint, and the OpenAI Responses API.
Two dependencies are exposed:
- ``verify_api_key`` -- write endpoints consumed by the SPA, the CLI
client, and AG-UI... | motojinc25/chatwalaau | backend/src/app/auth/__init__.py | .py | bde7709bc577b5d8 | 7.42 | 6 |
"""Password hashing for the web SPA authentication lane (CTR-0093, PRP-0057).
Uses Python stdlib ``hashlib.scrypt`` -- no new package dependency.
Hash format (single-line, deliberately small and grep-able):
scrypt$N=<n>,r=<r>,p=<p>$<base64-salt>$<base64-hash>
Constraints validated by ``parse_password_hash``:
-... | motojinc25/chatwalaau | backend/src/app/auth/password.py | .py | 01a372b6b0f3f958 | 7.42 | 6 |
"""Opaque session token store with digest-only persistence (CTR-0095 v2).
Single in-memory dict guarded by an asyncio lock, projected to disk as a
JSON file that holds ``sha256(token)`` digests -- never the raw token
(PRP-0110 Part 2, UDR-0089 D2). A disclosed store file therefore yields
no forgeable cookie: the diges... | motojinc25/chatwalaau | backend/src/app/auth/session_store.py | .py | 311a87179b8346d0 | 7.42 | 6 |
"""Web Authentication REST API (CTR-0094, PRP-0057).
Provides four endpoints for the SPA web auth lane:
- ``POST /api/auth/login`` (unauth) -- exchange ID/PW for an opaque session cookie
- ``POST /api/auth/logout`` (auth via CTR-0083) -- revoke the current session
- ``GET /api/auth/me`` (auth via CTR-0083) -- i... | motojinc25/chatwalaau | backend/src/app/auth/web_auth.py | .py | bebc6b577d11b0cb | 7.42 | 6 |
"""Shared Azure OpenAI credential resolution (PRP-0058, PRP-0059, UDR-0034).
Centralizes the credential decision for every Azure OpenAI client in the
runtime so that all consumers (MAF AgentRegistry, MAF DevUI agent, Whisper
STT, image generation, RAG ingest embedder, RAG query embedder) agree on
which lane is active.... | motojinc25/chatwalaau | backend/src/app/azure_credential.py | .py | 7c091c99fa556b64 | 7.42 | 6 |
"""In-process background task runner (CTR-0108, PRP-0077, UDR-0053).
A thin, fire-and-forget asyncio runner that executes registered background
tasks ON THE MAIN FastAPI event loop, AFTER a chat turn, with total error
isolation. It exists for short-lived, post-conversation, LLM-driven side work
that must NOT block or ... | motojinc25/chatwalaau | backend/src/app/background/__init__.py | .py | 7c094c301f191ad4 | 7.42 | 6 |
"""Auto Session Title background task (CTR-0109, PRP-0077, UDR-0053).
Summarizes a chat's first user message + first assistant reply into a concise
title, replacing the leading-characters truncation. Runs only as a CTR-0108
background task (post-turn, fire-and-forget, error-isolated), so it never blocks
or fails the c... | motojinc25/chatwalaau | backend/src/app/background/session_title.py | .py | eecf025bea33207b | 7.42 | 6 |
"""Opt-in import gate for tool bundles that are absent from the default surface.
FastMCP registers decorated tools eagerly while their modules are imported. To
keep optional tool schemas out of the default MCP context, module selection must
therefore happen before import rather than by removing tools afterwards.
"""
... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/optional_tools.py | .py | 3a6f70c350060cdd | 7.56 | 12 |
import os
import re
from dataclasses import asdict, dataclass
from functools import wraps
from server.cli.runner import (
BROWSER_DEFAULT_TIMEOUT,
CliAuthError,
CliBrowserAuthError,
CliBrowserCaptchaError,
CliBrowserError,
CliBrowserProfileError,
CliError,
CliNotFoundError,
CliRegis... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/__init__.py | .py | 339bba298d128e9b | 7.56 | 12 |
"""MCP tools for ad extensions management."""
from server.main import mcp
from server.tools import get_runner, handle_cli_errors
from server.tools.helpers import (
CliOption,
append_cli_options,
append_pagination,
check_batch_limit,
run_single_id_batch,
tool_error_dict,
)
ADEXTENSION_GET_OPTIO... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/adextensions.py | .py | 1dc41c69801a1540 | 7.56 | 12 |
"""MCP tools for ad video management."""
from server.main import mcp
from server.tools import ToolError, get_runner, handle_cli_errors
from server.tools.helpers import (
append_pagination,
normalize_optional_str,
require_non_empty_csv,
tool_error_dict,
)
@mcp.tool(
name="advideos_get",
descri... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/advideos.py | .py | f3ea72874df66667 | 7.56 | 12 |
"""MCP tools for audience target management."""
from server.main import mcp
from server.tools import ToolError, get_runner, handle_cli_errors
from server.tools.helpers import (
CliOption,
append_cli_options,
append_pagination,
run_set_bids,
run_single_id_batch,
tool_error_dict,
)
AUDIENCE_GET_... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/audience.py | .py | 3befe41724b72ada | 7.56 | 12 |
"""MCP tools and prompts for direct auth profiles."""
import json
import time
from mcp.server.fastmcp import Context
from pydantic import BaseModel, Field
from server.cli.runner import (
CliError,
CliNotFoundError,
CliTimeoutError,
DirectCliRunner,
_find_direct,
_strip_ansi,
)
from server.mai... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/auth_tools.py | .py | 858df939eb21b671 | 7.56 | 12 |
"""MCP tools for checking changes in Yandex.Direct."""
import re
from server.main import mcp
from server.tools import ToolError, get_runner, handle_cli_errors
from server.tools.helpers import check_batch_limit, parse_ids, tool_error_dict
ALLOWED_FIELD_NAMES = {"CampaignIds", "AdGroupIds", "AdIds", "CampaignsStat"}
... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/changes.py | .py | 316388bd73cd48e8 | 7.56 | 12 |
"""MCP tools for creatives management."""
from server.main import mcp
from server.tools import get_runner, handle_cli_errors
from server.tools.helpers import append_pagination
@mcp.tool(
name="creatives_get",
description="List creatives (rich media/video creatives built in Constructor), optionally filtered b... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/creatives.py | .py | de100cb4fe5fcd26 | 7.56 | 12 |
"""MCP tools for Yandex.Direct dictionaries."""
from server.main import mcp
from server.tools import get_runner, handle_cli_errors
# Names accepted by Dictionaries.get in Direct API v5. The CLI's own
# `dictionaries list-names` only knows the first ten, but `dictionaries get`
# (and the API) accept the audience / sch... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/dictionaries.py | .py | 295a6f1cb4bdd09d | 7.56 | 12 |
"""MCP tools for dynamic ad (webpage) management."""
from server.main import mcp
from server.tools import get_runner, handle_cli_errors
from server.tools.helpers import (
append_id_filters,
append_pagination,
run_set_bids,
run_single_id_batch,
)
@mcp.tool(
name="dynamicads_get",
description="... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/dynamic_ads.py | .py | 000cc28f22a6ef4b | 7.56 | 12 |
"""MCP tools for dynamic feed ad target management."""
from server.main import mcp
from server.tools import get_runner, handle_cli_errors
from server.tools.helpers import (
append_id_filters,
append_pagination,
run_set_bids,
run_single_id_batch,
tool_error_dict,
validate_yes_no,
)
@mcp.tool(
... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/dynamic_feed_ad_targets.py | .py | 0f65b16991ff1c12 | 7.56 | 12 |
"""MCP tools for feed management."""
from server.main import mcp
from server.tools import ToolError, get_runner, handle_cli_errors
from server.tools.helpers import (
CliOption,
append_cli_options,
append_pagination,
require_update_fields,
run_single_id_batch,
tool_error_dict,
)
BUSINESS_TYPES ... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/feeds.py | .py | c142e0c4cc624874 | 7.56 | 12 |
"""Shared helpers for MCP tool modules."""
import json
from collections.abc import Iterable, Mapping, Sequence
from dataclasses import dataclass
from server.cli.runner import (
CliAuthError,
CliError,
CliNotFoundError,
CliRegistrationError,
CliTimeoutError,
)
from server.tools import ToolError, _h... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/helpers.py | .py | 5f2b9eaae7048541 | 7.56 | 12 |
"""MCP tools for ad images management."""
from server.main import mcp
from server.tools import ToolError, get_runner, handle_cli_errors
from server.tools.helpers import (
append_pagination,
normalize_optional_str,
tool_error_dict,
validate_yes_no,
)
# adimages_add uploads a base64-encoded JPEG/PNG (re... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/images.py | .py | 4ab9681e39acb1cd | 7.56 | 12 |
"""Read-only MCP tools for browser-backed Campaign Wizard campaigns."""
import os
from typing import cast
from server.contract import PUBLIC_CONTRACT
from server.main import mcp
from server.tools import ToolError, get_browser_runner, handle_cli_errors
from server.tools.browser_helpers import browser_session_args
from... | axisrow/yandex-direct-mcp-plugin | plugins/yandex-direct/server/tools/masters.py | .py | fdfe24f6352a0ae2 | 7.56 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.