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
""" Tests for the Phase 2.5 MCAP/Foxglove glue. ``export_session_to_mcap`` and ``open_in_foxglove`` are thin wrappers around ``polyumi_ingest``'s real exporter and the local ``foxglove-studio`` binary; those are exercised elsewhere (ingest's own test suite, and manual smoke testing), so here we monkeypatch them and te...
cwoodhayes/PolyUMI
catalog/test/test_mcap_tools.py
.py
36221a934ab31b05
7.95
7
"""Tests for the scene detail pane's recording/preprocessing commit provenance.""" from __future__ import annotations import json import pathlib import zarr from polyumi_catalog import provenance def _make_session(scene_dir: pathlib.Path, name: str, polyumi_version: str | None) -> pathlib.Path: """ Write a...
cwoodhayes/PolyUMI
catalog/test/test_provenance.py
.py
08a999c728e013f5
7.95
7
"""Tests for the per-session pzarr stream summary (Phase 4), wrapping ingest's inspect_pzarr.""" from __future__ import annotations import pathlib import numpy as np import zarr from polyumi_catalog import pzarr_inspect def _make_pzarr_with_finger_stream(scene_dir: pathlib.Path, session_dirname: str, *, n_frames: ...
cwoodhayes/PolyUMI
catalog/test/test_pzarr_inspect.py
.py
511ac04f7b094e2a
7.95
7
"""Tests for on-demand gopro.mp4 thumbnail decoding (Phase 4).""" from __future__ import annotations import pathlib import cv2 import numpy as np import pytest from polyumi_catalog import thumbnails _N = 40 _H, _W = 48, 64 def _write_test_mp4(path: pathlib.Path, n_frames: int = _N) -> int: """Write an n_frame...
cwoodhayes/PolyUMI
catalog/test/test_thumbnails.py
.py
fcfacb7f92fc5ed2
7.95
7
""" A sine-wave backend, so the ROS client can be brought up without a GPU or a checkpoint. Two channels oscillate, at the same frequency but 90 degrees apart: X on a sine, gripper width on a cosine. The phase offset is deliberate -- the gripper's extremes land on X's zero crossings, so a routing bug that feeds X into...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/backends/sine.py
.py
1f0e2c0628e8d592
7.45
7
""" Client half of the inference protocol. :class:`PolicyClient` is what the ROS-side ``policy_client_node`` holds. It owns the three endpoints, the URL arithmetic between them, and the persistent connection; it does not own logging or retry policy, which belong to the caller (the node logs and carries on; a script mi...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/client.py
.py
83f5773ccf305b35
7.45
7
""" Exceptions raised across the inference protocol. Two failure modes, deliberately distinct because they have different fixes. A :class:`WireFormatError` means the *frame* is wrong -- malformed, truncated, or missing a channel the policy needs -- and is always the requester's fault, so every server turns it into a 4...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/errors.py
.py
c33f1df12a6f14b8
7.45
7
""" Server half of the inference protocol: the app every PolyUMI inference server is. :func:`create_app` owns the HTTP surface -- the three routes, decoding the frame, enforcing the contract, turning a bad frame into a 422, truncating the chunk, and the request timing. A server is then only a :class:`PolicyBackend`: a...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/server.py
.py
01024ad4da12a4ab
7.45
7
""" Drive a real :class:`~polyumi_inference.client.PolicyClient` against a real app, in process. This is why :class:`~polyumi_inference.client.Transport` is a seam. With it, a test can send the exact bytes the ROS node sends and have them decoded by the exact code the server runs, with no socket, no port, and no secon...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/testing.py
.py
f3b27fe7ff6ce4ec
7.95
7
""" The two types the client and the server both hold. An :class:`Observation` goes one way and an :class:`ActionChunk` comes back, and each is built by one end and consumed by the other. They are defined once, here, so the two ends cannot disagree about them -- which is the whole reason this library exists. Plain da...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/types.py
.py
1f633addc38e2cb7
7.45
7
""" Binary framing for the ``/predict_cartesian/`` observation request. The frame is a length-prefixed JSON header followed by the raw bytes of each channel:: [4B big-endian uint32: header length N][N bytes UTF-8 JSON header][channel blobs] and the header names every blob's dtype, shape and position:: {"ver...
cwoodhayes/PolyUMI
inference_server/polyumi_inference/wire.py
.py
5ba710efe1d28da8
7.45
7
""" Tests for the dummy server's oscillator and its HOME_POSE validation. The dummy is the only thing exercising the ROS-side action path without a GPU or a checkpoint, so its output shape matters: if the gripper channel is constant, a broken gripper route looks identical to a working one. What it *refuses* is tested...
cwoodhayes/PolyUMI
inference_server/test/test_dummy_server.py
.py
8dcaf6bee998ed7b
7.95
7
""" Guard the library's Python 3.9 floor. The diffusion-policy container's conda env is ``python=3.9`` (numpy 1.24) and imports this library; the ROS node imports it under 3.12. There is no 3.9 interpreter on a development laptop, so the floor cannot be checked by running the tests -- and the realistic way to break it...
cwoodhayes/PolyUMI
inference_server/test/test_python39_floor.py
.py
401dfb6ac54a045d
7.95
7
r""" Populate an ORB-SLAM3 settings YAML from OpenImuCameraCalibrator output. Reads the FISHEYE camera calibration JSON and the cam-IMU calibration result from a calibration dataset directory, then writes the derived values into the target ORB-SLAM3 settings YAML in-place. Supported camera model: FISHEYE (OpenImuCame...
cwoodhayes/PolyUMI
ingest/integration/populate_slam_yaml.py
.py
82115a8a70efc4e8
7.45
7
""" Visualize SLAM-to-optitrack alignment for a scene after preprocessing step 3. Shows three trajectories in the optitrack frame: 1. OptiTrack ground truth (GoPro position, optitrack frame) 2. SLAM trajectory after applying the slam->optitrack transform (aligned) 3. SLAM trajectory before the transform (raw SLA...
cwoodhayes/PolyUMI
ingest/integration/visualize_slam_alignment.py
.py
5ce249f8e5f89613
7.45
7
""" Visualize time-sync alignment for a scene after preprocessing step 1 (pp). Usage: uv run python ingest/integration/visualize_timesync.py recordings/scene_YYYY-MM-DD_... """ import argparse import logging import os import pathlib import signal import sys import matplotlib.pyplot as plt import matplotlib.ticke...
cwoodhayes/PolyUMI
ingest/integration/visualize_timesync.py
.py
c65cf38f1a896387
7.45
7
"""Resolve BLE devices through Home Assistant.""" from dataclasses import dataclass import bleak from bleak import BleakClient from bleak.backends.device import BLEDevice from homeassistant.components import bluetooth from homeassistant.core import HomeAssistant @dataclass(frozen=True, slots=True) class BLEDeviceRe...
teh-hippo/ha-govee-led-ble
custom_components/ha_govee_led_ble/ble_device_resolver.py
.py
b0f299a22a777160
7.54
11
"""Constants for HA Govee LED BLE.""" from collections.abc import Mapping from dataclasses import dataclass from typing import Any DOMAIN = "ha_govee_led_ble" CONF_MODEL = "model" CONF_EFFECT_CATEGORIES = "effect_categories" CONF_EFFECT_FAMILIES = "effect_families" CONF_PREFIX_EFFECT_NAMES = "prefix_effect_names" CON...
teh-hippo/ha-govee-led-ble
custom_components/ha_govee_led_ble/const.py
.py
eb7f53541f1cc059
7.54
11
"""Shared typed base for the coordinator and its write mixins.""" from collections.abc import Awaitable, Callable, Sequence from typing import TYPE_CHECKING, Any from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import ModelProfile from .control_arbiter import BLEControlArbiter, ...
teh-hippo/ha-govee-led-ble
custom_components/ha_govee_led_ble/coordinator_base.py
.py
82e86b3c3de50fa4
7.54
11
"""Versioned document storage port and Home Assistant adapter.""" from __future__ import annotations from collections.abc import Awaitable, Callable from typing import Any, Protocol from homeassistant.core import HomeAssistant from homeassistant.helpers.storage import Store type EffectDocument = dict[str, Any] type...
teh-hippo/ha-govee-led-ble
custom_components/ha_govee_led_ble/effect_store.py
.py
33766cd697d8e687
7.54
11
"""Shared base entity for the Govee BLE integration.""" from homeassistant.helpers.update_coordinator import CoordinatorEntity from .coordinator import GoveeBLECoordinator class GoveeBLEEntity(CoordinatorEntity[GoveeBLECoordinator]): """Base entity whose availability follows BLE presence and the coordinator ref...
teh-hippo/ha-govee-led-ble
custom_components/ha_govee_led_ble/entity.py
.py
871c20dbebba2bb2
7.54
11
""" Lazarus Forge - Shared Audit Library (audit_lib.py) Extracted from Automation/AUDIT_HARNESS.py, 2026-07-21, so that Automation/integrity_check.py (repo-wide checks) and AUDIT_HARNESS.py (single-session audits) both import one implementation of routing parsing, cross-reference extraction, and finding classification...
ksarith/LazarusForge
Automation/audit_lib.py
.py
b1ab7f289d938b74
7.63
17
"""BB content research strategy — wraps fetch_ai_creators + parse_extract.""" from __future__ import annotations import json import logging import re import time from datetime import datetime, timezone from pathlib import Path from typing import Any from genlab_core.strategies import ContentResearchStrategy BB_ROOT...
AnarchistSid/genlab-platform
BlackboxBrief/bb_strategies/content_research.py
.py
fc3a7c0132ea3e6b
7.45
7
"""BB platform adaptation strategy. Migrated to BasePlatformAdaptationStrategy (Sprint 69). Inherits full 8-rule platform enforcement for all 6 platforms. Adds (OPS #2 + #6, 2026-06-30) the source-tool affiliate disclosure hook — after the standard per-platform adaptations run, look at the SOURCE video's metadata and...
AnarchistSid/genlab-platform
BlackboxBrief/bb_strategies/platform_adaptation.py
.py
d0efcd60b705efc5
7.45
7
"""BB scoring strategy — wraps dedupe_rank_items.py.""" from __future__ import annotations import json import logging import time from datetime import datetime, timezone from pathlib import Path from typing import Any from genlab_core.strategies import ScoringStrategy BB_ROOT = Path(__file__).resolve().parent.paren...
AnarchistSid/genlab-platform
BlackboxBrief/bb_strategies/scoring.py
.py
b730218492ac1e31
7.45
7
"""BB writing strategy — LLM content generation for AI creator stories. Migrated to BaseWritingStrategy (Sprint 69). Inherits the shared LLM + template-fallback writing pipeline with AI-specific config from config/writing.yaml and config/templates.yaml. Previous version (115 lines) called write_video_content() direct...
AnarchistSid/genlab-platform
BlackboxBrief/bb_strategies/writing.py
.py
f40393e156409dcc
7.45
7
"""YouTube connector for creator-video discovery.""" from __future__ import annotations import os import re from datetime import datetime, timedelta, timezone from typing import Any, Dict, Iterable, List, Optional def _build_service(): """Build YouTube API service via OAuth refresh token credentials.""" cli...
AnarchistSid/genlab-platform
BlackboxBrief/execution/sources/youtube_connector.py
.py
500c2e8890555d4a
7.45
7
"""Centralized YAML config loader with caching. Provides a single function to load any config file from config/ directory. Caches loaded configs in memory to avoid repeated disk reads within a run. Shared-config routing --------------------- A handful of yamls are owned by ``genlab-core`` and read by every niche (Sh...
AnarchistSid/genlab-platform
BlackboxBrief/execution/utils/config_loader.py
.py
b47cb63d13745365
7.45
7
"""Typed boundary contracts for backlog and artifact payloads.""" from __future__ import annotations from dataclasses import dataclass from typing import Any, Dict class ContractValidationError(ValueError): """Raised when a boundary payload does not satisfy contract.""" @dataclass(frozen=True) class Blueprint...
AnarchistSid/genlab-platform
BlackboxBrief/execution/utils/contracts.py
.py
382cc4a1bf3f2bd2
7.45
7
"""Structured error event helpers for operational pipeline logging.""" from __future__ import annotations import json from dataclasses import dataclass, field from datetime import datetime, timezone from typing import Any, Dict, Mapping, Optional @dataclass(frozen=True) class ErrorEvent: """Normalized machine-r...
AnarchistSid/genlab-platform
BlackboxBrief/execution/utils/error_events.py
.py
4234a3fc680b399c
7.45
7
"""Playwright-based fetcher for JS-rendered pages. Some sources (OpenAI blog, Anthropic news) serve JS-rendered SPAs that feedparser/requests can't parse. This module uses Playwright to render the page and extract article content. Requires: pip install playwright && python -m playwright install chromium Falls back g...
AnarchistSid/genlab-platform
BlackboxBrief/execution/utils/playwright_fetcher.py
.py
a1e09820d0f9bea5
7.45
7
"""Daily cleanup of old pipeline runs using the DiskQuotaManager. Keeps the 5 most recent runs protected, evicts lowest-scoring runs first. Designed to run via launchd at 00:30 UTC (06:00 IST) daily — before the daily pipeline fires so it never competes for disk space mid-render. Retention windows (optimised for 1-po...
AnarchistSid/genlab-platform
BlackboxBrief/scripts/cleanup_runs.py
.py
ca07b246e859dc48
7.45
7
"""Tests for the updated score_authority() function. Verifies that source_priority (from sources.yaml) takes precedence over domain-based lookup, with proper fallback behavior. """ from execution.dedupe_rank_items import score_authority AUTHORITY_MAP = { "reddit.com": 0.85, "i.redd.it": 0.85, "youtube.co...
AnarchistSid/genlab-platform
BlackboxBrief/tests/_legacy/test_authority_scoring.py
.py
25d88774f3698f14
7.95
7
"""Shared pytest fixtures for the content intelligence pipeline.""" import json import os from unittest.mock import MagicMock import pytest # Disable Postgres so tests use SharePoint mocks (avoid schema gaps). # Must set before any genlab_core import triggers pydantic-settings. os.environ["GENLAB_USE_POSTGRES"] = "f...
AnarchistSid/genlab-platform
BlackboxBrief/tests/conftest.py
.py
39f41d432dc9e704
7.95
7
#!/usr/bin/env python3 """Integration tests for BacklogClient (Microsoft Lists). These tests require a live Microsoft Graph connection AND an explicit opt-in via RUN_INTEGRATION_TESTS=1 environment variable. This prevents accidental execution against production data during normal test runs. SAFETY: These tests hit RE...
AnarchistSid/genlab-platform
BlackboxBrief/tests/test_backlog_integration.py
.py
de204a24ebdc0c91
7.95
7
"""Tests for file-based cache.""" import json import time import pytest from genlab_core.cache.disk_cache import Cache @pytest.fixture def cache(tmp_path): """Create a cache in a temp directory.""" return Cache(str(tmp_path / "cache")) class TestCache: def test_set_and_get(self, cache): cache....
AnarchistSid/genlab-platform
BlackboxBrief/tests/test_cache.py
.py
c7b7a1fd327dd0e1
7.95
7
"""Tests for the publish lock mechanism in cleanup_runs.py.""" from __future__ import annotations import sys from pathlib import Path # Ensure scripts/ is importable PROJECT_ROOT = Path(__file__).resolve().parent.parent sys.path.insert(0, str(PROJECT_ROOT / "scripts")) from cleanup_runs import ( acquire_publish...
AnarchistSid/genlab-platform
BlackboxBrief/tests/test_cleanup_publish_lock.py
.py
1a262bd83e7f9f87
7.95
7
"""Regression guards for ``execution.utils.config_loader`` after the symlink-to-shared-config refactor. History ------- ``BlackboxBrief/config/`` used to contain seven symlinks pointing at ``genlab-core/config/*.yaml``. They were the last "BB-as-special-case" architectural debt: every reader had to know about the link...
AnarchistSid/genlab-platform
BlackboxBrief/tests/test_config_loader.py
.py
a668053406f127c3
7.95
7
"""Tests for execution/utils/ffmpeg_utils.py constants and helpers. P1.5: FINAL_VIDEO_PARAMS must include -r 30 for consistent framerate. P1.6: No hardcoded 192k audio bitrate anywhere — canonical value is 256k. P1.14: Clip pre-processing timeout must scale with duration. """ # ── P1.5: FINAL_VIDEO_PARAMS must con...
AnarchistSid/genlab-platform
BlackboxBrief/tests/test_ffmpeg_utils.py
.py
98ae2939ee0f61c0
7.95
7
"""Tests for backlog formula → OData $filter translator. Validates all 7 formula patterns used across the codebase. """ from genlab_core.http.graph_proxy import formula_to_odata as _formula_to_odata class TestSimpleEquality: """Pattern 1: {field}='value' → fields/field eq 'value'""" def test_simple_string(...
AnarchistSid/genlab-platform
BlackboxBrief/tests/test_formula_translator.py
.py
d6e958e1530c58ad
7.95
7
"""Dedup capability — find & merge duplicate entities through the agent (COG-122). Reuses the EXISTING entity-resolution engine end-to-end (no reimplementation, no new matching code): * ``plan`` proposes ONE :class:`PlanStep` (``capability="dedup"``, ``action="run_dedup"``) describing a second-pass entity-resolutio...
infona-ai/infona-oss
infona_client/agent/capabilities/dedup_cap.py
.py
73304ac600ba5e74
7.42
6
"""Brief scope / attribute-match clarify steps for the enrich capability. When a described subset, multi-value scope, or value-filter cannot be resolved — or a weak schema-attr mapping needs approval — emit a short ``action="clarify"`` step instead of a silent whole-type enrich or an empty paid job. Invariants other ...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_clarify.py
.py
9eb2ed77dcbe2e71
7.42
6
"""Shared constants and call-time host lookup for the enrich capability. Owns process-wide background-task strong-refs (``_bg_tasks`` / ``_spawn``) and the small scope-value splitter. Implementation of plan/execute lives in sibling ``enrich_*.py`` modules. Invariants other agents must not break: - Look up monkeypatch...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_common.py
.py
d089912bb53111e4
7.42
6
"""Tier, source-clause, and plan-time cost estimate for enrich. Owns ``_coerce_tier``, the free-registry coverage probe, the human "via …" clause, and the honest paid-call estimate (COG-123). Invariants other agents must not break: - Per-entity paid cost / has_paid come from adapter-declared metadata (``_resolve_ch...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_cost.py
.py
8a5c3a052e4b9fbb
7.42
6
"""Execute a planned enrichment as a background EnrichJob. Owns count / subset-URI / multi-value-scope resolution helpers and :meth:`EnrichCapability.execute`. Builds the same :class:`EnrichJob` the ``/enrich/jobs`` route builds and hands it to the shared executor. Invariants other agents must not break: - Look up ``...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_execute.py
.py
6ce73a3699116c6f
7.42
6
"""LLM + deterministic extraction of an EnrichRequest from NL. Owns the schema-grounded extract prompt, the OpenRouter call, JSON coercion, and the no-key regex fallback parser. Invariants other agents must not break: - Look up ``openrouter_chat`` and ``logger`` on the public ``enrich_cap`` module via :func:`_host`...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_extract.py
.py
06587beb45399d6a
7.42
6
"""Refresh / overwrite / composite-scope detectors for the enrich capability. Owns conflict-policy selection (stage / verify / overwrite) and the conservative verb detectors that flip a plan onto the refresh or replace rail. Invariants other agents must not break: - A bare "refresh / re-verify" stays ``verify`` (ONTA...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_intent.py
.py
3d60617300e86b7b
7.42
6
"""Schema-ground a parsed enrich request (attributes / scope / subset / tier). Owns sanitizing an extracted request against the type's real schema, plus the attribute-name normalizer and the confidence-gated soft matcher (exact / high-similarity auto-accept; weaker unique hits need approval). Invariants other agents ...
infona-ai/infona-oss
infona_client/agent/capabilities/enrich_validate.py
.py
2d65165ce999ef94
7.42
6
"""Cleanup capability — propose + apply normalization rules through the agent. Reuses the existing normalization engine end-to-end (no reimplementation): * ``plan`` → :func:`infona_client.normalization.inference.suggest_rules_for_predicates` (the TARGETED variant: only the predicate(s) the instruction names, never ...
infona-ai/infona-oss
infona_client/agent/capabilities/normalize_cap.py
.py
d47bdad435767999
7.42
6
"""Read-only Q&A capability — wraps the existing NL→SPARQL ask pipeline. This is the only capability that needs no plan/confirm round-trip: a question does not mutate the graph, so the agent answers immediately. The planner special-cases the ``question`` intent and calls :meth:`QueryCapability.answer` directly. We sti...
infona-ai/infona-oss
infona_client/agent/capabilities/query.py
.py
f163c43b6f941f27
7.42
6
"""Subscribe capability — set up a recurring standing alert / weekly refresh through the agent (ONTA-235). This is the conversational front door to the ``notify`` schedule: the persona says "set up a standing weekly alert that notifies my orchestrator whenever a model I route to changes price or gets a deprecation dat...
infona-ai/infona-oss
infona_client/agent/capabilities/subscribe_cap.py
.py
0d124cf60f9813db
7.42
6
"""Web-research capability — answer a question FROM THE WEB, cite it, don't store it. This is the READ-ONLY web-research capability. Premium web-discovery ingest INGEST creates new graph entities from a query; research ANSWERS a question by reading the web and returns a cited answer plus a downloadable table (CSV/JSON...
infona-ai/infona-oss
infona_client/agent/capabilities/web_research_cap.py
.py
87920ef9e71235f1
7.42
6
"""Intent classifier (one bounded LLM call) for the agent planner. Looks up ``openrouter_chat`` / ``get_capabilities`` on the :mod:`infona_client.agent.planner` facade at call time so existing monkeypatches keep working. """ from __future__ import annotations import json import structlog from infona_client.agent.co...
infona-ai/infona-oss
infona_client/agent/planner_classify.py
.py
8a89a0380279ce5c
7.42
6
"""Confirm / execute path for the agent planner. Looks up ``get_capability`` / ``order_steps`` / ``register_capability`` on the :mod:`infona_client.agent.planner` facade at call time so existing monkeypatches keep working. """ from __future__ import annotations import os from datetime import datetime, timedelta, time...
infona-ai/infona-oss
infona_client/agent/planner_execute.py
.py
335ffec5077dc4f2
7.42
6
"""Classify → dispatch: handle / _respond. Looks up ``openrouter_chat`` / ``get_capability`` / ``order_steps`` / ``_classify`` on the :mod:`infona_client.agent.planner` facade at call time so existing monkeypatches keep working. The hosted-only web-ingest discover path stays here (web_ingest is not in OSS). """ from _...
infona-ai/infona-oss
infona_client/agent/planner_handle.py
.py
ffa9a9e3f297f92b
7.42
6
"""Session-transcript helpers for the agent planner. Implementation sibling of :mod:`infona_client.agent.planner`. """ from __future__ import annotations import re from infona_client.agent.conversation_store import Turn # How many recent turns of a (possibly long, history-backed) transcript to feed # the classifier...
infona-ai/infona-oss
infona_client/agent/planner_history.py
.py
00c4c9a80f7deced
7.42
6
"""Capability protocol + module-level registry for the unified Ask-AI agent. The agent has exactly ONE conversational surface (``POST /graphs/{tenant}/agent``). Everything a user can ask the agent to do is a *capability* registered here — question answering, normalization, enrichment, and (later) dedup / ontology edit...
infona-ai/infona-oss
infona_client/agent/registry.py
.py
186cea2e5567e041
7.42
6
from fastapi import Request from infona_client.enrichment.cache import get_enrichment_cache from infona_client.enrichment.executor import EnrichmentExecutor from infona_client.enrichment.job_store import make_job_store from infona_client.enrichment.sources.wikidata import WikidataAdapter from infona_client.graph.clien...
infona-ai/infona-oss
infona_client/api/deps.py
.py
7b046df74d959a02
7.42
6
"""THE single conversational surface for the unified Ask-AI agent (COG-118). ``POST /graphs/{tenant}/agent`` is the ONLY endpoint. Everything the agent can do is a capability behind the registry — there is no per-task conversational endpoint. The legacy ``/ask``, ``/enrich/*`` and ``/normalize/*`` routes stay for back...
infona-ai/infona-oss
infona_client/api/routes/agent.py
.py
635b267bc999d2ff
7.42
6
import time import structlog from fastapi import APIRouter, Depends, HTTPException, Request from infona_client.analytics import distinct_id_for, emit from infona_client.api.deps import get_enrichment_job_store, get_neptune_client from infona_client.api.rate_limit import limiter from infona_client.auth.api_keys import...
infona-ai/infona-oss
infona_client/api/routes/ask.py
.py
30901b1d3f7377ab
7.42
6
"""POST /graphs/{tenant}/corrections — the A10 user-correction write path (ONTA-281). The ONE canonical route every client (Explorer webapp, CLI, MCP) uses to fix a wrong fact. A human corrects an attribute value in the Explorer; this route turns it into an A10 :class:`~infona_client.pipeline.corrections.UserAssertion...
infona-ai/infona-oss
infona_client/api/routes/corrections.py
.py
12de2934bdff2ff3
7.42
6
"""HTTP routes for the auto-enrichment feature.""" from __future__ import annotations import asyncio import os import uuid from datetime import datetime, timezone from typing import Optional from fastapi import APIRouter, Depends, HTTPException, Query from pydantic import BaseModel from infona_client.api.deps impor...
infona-ai/infona-oss
infona_client/api/routes/enrich.py
.py
a8f045ace0266dc7
7.42
6
"""Entity detail, Explorer search, and ER-rebuild routes. ``er_rebuild`` is a real merge via ``rewrite_subject`` plus one ``refresh_after_write`` — do not fork a second write path. """ from __future__ import annotations import asyncio from typing import Any import structlog from fastapi import Depends, Query from ...
infona-ai/infona-oss
infona_client/api/routes/explore_entity.py
.py
7bd1912aa9f08a47
7.42
6
"""ACP auth helpers — detect and advertise Nastech authentication methods.""" from __future__ import annotations from typing import Any, Optional TERMINAL_SETUP_AUTH_METHOD_ID = "nastech-setup" def detect_provider() -> Optional[str]: """Resolve the active Nastech runtime provider, or None if unavailable. ...
nastechresearch/nastech-agent
acp_adapter/auth.py
.py
d384e1b33d3b78b1
7.5
9
"""CLI entry point for the nastech-agent ACP adapter. Loads environment variables from ``~/.nastech/.env``, configures logging to write to stderr (so stdout is reserved for ACP JSON-RPC transport), and starts the ACP agent server. Usage:: python -m acp_adapter.entry # or nastech acp # or nastech-...
nastechresearch/nastech-agent
acp_adapter/entry.py
.py
28f680d3925071bf
7.5
9
"""ACP permission bridging for Nastech dangerous-command approvals.""" from __future__ import annotations import asyncio import logging from concurrent.futures import TimeoutError as FutureTimeout from itertools import count from typing import Callable from acp.schema import ( AllowedOutcome, PermissionOptio...
nastechresearch/nastech-agent
acp_adapter/permissions.py
.py
524aa20df123093d
7.5
9
"""Derive ACP session-provenance metadata from the existing compression chain. This is an additive Nastech extension surfaced under ACP ``_meta.nastech`` so existing ACP clients ignore it. It carries no new persisted state: everything is derived on demand from the ``sessions`` table (``parent_session_id`` / ``end_reas...
nastechresearch/nastech-agent
acp_adapter/provenance.py
.py
59b145a7aecbccbd
7.5
9
"""OpenAI-shape bridge shared by Nastech' ACP clients. An ACP agent (``copilot --acp``, and the ACP CLIs that reach Nastech as providers) speaks the Agent Client Protocol, which has no OpenAI-style ``tools``/``tool_calls`` channel: a prompt is text, and a response is text plus the agent's *own* tool notifications. Nas...
nastechresearch/nastech-agent
agent/acp_openai_bridge.py
.py
5f11081902b9922b
7.5
9
"""Ambient session-accounting context for auxiliary LLM calls. Auxiliary calls (vision, compression, title generation, web_extract, session_search, ...) funnel through ``agent.auxiliary_client`` which has no session handle — so their token usage was historically discarded, leaving dashboard analytics blind to aux mode...
nastechresearch/nastech-agent
agent/aux_accounting.py
.py
4d1e6c36c76187a7
7.5
9
"""Single owner for backend identity and failure-scoped skip decisions. Every fallback / dedup / skip / quarantine decision in Nastech ultimately asks one question: **"is this candidate the same backend as the one that failed, along the axis that failure invalidated?"** Before this module, that question was re-implem...
nastechresearch/nastech-agent
agent/backend_identity.py
.py
d56ef72cf0bf57e0
7.5
9
"""System-battery read-out for the CLI/TUI status bar. Reads the host battery through ``psutil`` (already a Nastech dependency) and exposes a compact, colour-coded label. Everything degrades to "unavailable" when there is no battery (desktops, servers, VMs) or when the read fails, so callers can render the result unc...
nastechresearch/nastech-agent
agent/battery.py
.py
72a8c442e52987ed
7.5
9
"""Provider-agnostic billing/credit recovery links. Maps a billing-classified failure onto a recovery link + label. *Detection* is not done here — that is :mod:`agent.error_classifier` (``FailoverReason.billing``), the single source of truth for "credit wall vs. rate limit / auth / transport". The resulting :class:`Bi...
nastechresearch/nastech-agent
agent/billing_links.py
.py
43c614fe854066f3
7.5
9
"""Bounded reads of HTTP error response bodies. When a provider returns a non-OK status on a *streaming* request, Nastech reads the response body to build a useful diagnostic error. A bare ``response.read()`` on a streaming httpx response is unbounded in two dangerous ways: 1. A server can declare (or stream) an arbi...
nastechresearch/nastech-agent
agent/bounded_response.py
.py
e1a3123404e3f27b
7.5
9
"""Mint a provider API key by running a command (``key_cmd``). Static API keys are the exception at enterprise gateways: SSO/OIDC brokers, cloud IAM, and internal auth proxies all issue SHORT-LIVED bearers instead. A key copied into ``.env`` (``key_env``) is stale within the hour, so every request after that 401s and ...
nastechresearch/nastech-agent
agent/command_token_source.py
.py
7bfde21c9de08f29
7.5
9
# custom_components/evconduit/abrp.py """ABRP (A Better Route Planner) telemetry client.""" import logging import time import aiohttp from .const import ABRP_API_URL _LOGGER = logging.getLogger(__name__) class ABRPClient: """Client for sending telemetry to ABRP.""" def __init__(self, session: aiohttp.Cli...
stevelea/evconduit-homeassistant
custom_components/evconduit/abrp.py
.py
dd7c5f365a8a8eb0
7.57
13
from homeassistant import config_entries from homeassistant.helpers.selector import EntitySelector, EntitySelectorConfig import voluptuous as vol import logging from .const import ( DOMAIN, CONF_API_KEY, CONF_VEHICLE_ID, CONF_UPDATE_INTERVAL, CONF_ENVIRONMENT, CONF_ABRP_TOKEN, CONF_ODOMETER_ENTITY, CONF_ELE...
stevelea/evconduit-homeassistant
custom_components/evconduit/config_flow.py
.py
a57f93eef9c9d1ef
7.57
13
# custom_components/evconduit/device_tracker.py import logging from homeassistant.components.device_tracker import SourceType, TrackerEntity from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .sensor import _build_d...
stevelea/evconduit-homeassistant
custom_components/evconduit/device_tracker.py
.py
826fa664ff873444
7.57
13
# custom_components/evconduit/image.py """Image platform exposing the vehicle's manufacturer artwork.""" import logging from homeassistant.components.image import ImageEntity from homeassistant.core import callback from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator impo...
stevelea/evconduit-homeassistant
custom_components/evconduit/image.py
.py
2c8162bce486c551
7.57
13
"""v7.7 Binding Field — composite field from live interconnect + buffer + sense. Named from live evidence: - Local spectral/graph coupling can be high while epoch binding lags (UNBOUND). - Resonant Frame live buffer can hold samples without closed frames (BUFFER_PENDING). - Until both binding and frames warm, se...
jacksonjp0311-gif/Cortex
cortex/binding_field.py
.py
9da0cf96cf105c70
7.66
20
"""SPIKE: audio-driven H3 — pin a full audio TRACK across the whole clip. Appended to ComfyUI-H3-Motion-Context/nodes.py inside the worker container. Reuses the pack's layout/payload patches and audio encode path: the track is encoded with the H3 audio VAE and its reference rows are TRANSLATED onto the clip's own time...
pizzato/stephen_spielbot
docker/comfyui/h3_audio_track/append_to_motion_context.py
.py
73c17202a243501e
7.45
7
"""C2PA / Content Credentials signing for published videos. Embeds a cryptographically-signed provenance manifest declaring the video as AI-generated by Stephen Spielbot. Best-effort: when c2patool is not installed (or signing fails) we log and skip, exactly like the rest of the media pipeline. Signing must be the LA...
pizzato/stephen_spielbot
pipeline/c2pa.py
.py
3cbe54b53552ef75
7.45
7
"""Build a timed caption (SRT) track from a finished film's work directory. The spoken text is known exactly — narration is the script we fed to TTS, an acted scene's dialogue is the lines the take performed, and a singing scene's lyrics are the slice of the song it mouths — so we can hand YouTube accurate subtitles i...
pizzato/stephen_spielbot
pipeline/captions.py
.py
958fd3b878cdf03c
7.45
7
"""Chatterbox Multilingual TTS — the multilingual narration engine (issue #176). Resemble AI's Chatterbox Multilingual synthesises expressive speech in 23 languages with zero-shot voice cloning from a reference clip, so the existing voice library carries straight over. Code (``chatterbox-tts``) and weights (``Resemble...
pizzato/stephen_spielbot
pipeline/chatterbox.py
.py
11a7b5d129be5d85
7.45
7
"""YouTube cover image generation utilities (shared between app.py and resume_generation.py).""" from __future__ import annotations import logging from pathlib import Path from pipeline import prompts as _prompts logger = logging.getLogger("video_gen") COVER_WIDTH = 1280 COVER_HEIGHT = 720 def cover_dimensions(v...
pizzato/stephen_spielbot
pipeline/cover.py
.py
f2dbb96f6ba9c229
7.45
7
"""Learned durations for post-render film-edit jobs. The main render learns how long each task kind takes and predicts an ETA (see ``pipeline/timing.py`` + ``DurableStore.timing_table``). The film-edit operations — scene re-renders, the parallel scene upscale, narrator/music regeneration — run as in-process daemon th...
pizzato/stephen_spielbot
pipeline/film_timing.py
.py
3ebc889ce0ad3a4e
7.45
7
"""Background-music regeneration history. Music is a film-level asset (one ``background_music.wav`` per work dir), so this mirrors the cover-image history rather than the per-scene image/video history: there is no scene id. Every regeneration keeps the prior tracks so the user can listen to each one and pick the best....
pizzato/stephen_spielbot
pipeline/music_history.py
.py
b69da248f3d2d6f1
7.45
7
"""Where an acted take can be picked up again. H3 can only continue a take it still holds the motion context for, and that context is a latent file in the WORKER's ComfyUI output folder — not in the film folder, and not on any other worker. So each acted render drops a note next to the scene saying where its continuat...
pizzato/stephen_spielbot
pipeline/scene_context.py
.py
d7a9a26cce79f18b
7.45
7
"""Quality gate for performance shots: did they say the line? H3 is stochastic — a shot can come out with the wrong words, invented tail speech, or garbled delivery, and until now nothing checked. The gate transcribes each rendered shot (faster-whisper, CPU, ~2s per clip against a ~6 minute render) and scores the tran...
pizzato/stephen_spielbot
pipeline/shot_gate.py
.py
3934bb068357180a
7.45
7
"""Where the singing actually is inside a generated song. A music video pins each scene's slice of the track into its H3 take, so the prompt has to AGREE with that slice. Two ways it used not to: naming lyrics that are not in the slice, and asking for a moving mouth over an instrumental intro. Both pull the model off ...
pizzato/stephen_spielbot
pipeline/song_timing.py
.py
28525a8a0cc12b34
7.45
7
"""Per-style look of burned-in subtitles (open captions). The burn itself is ffmpeg's ``subtitles`` filter (libass). Left alone it draws every film the same way — Arial, white, bottom-centre. A style's ``subtitle_style`` dict (font, size, colours, outline, box, position) is turned into an ASS ``force_style`` override ...
pizzato/stephen_spielbot
pipeline/subtitle_style.py
.py
c817a1479e5da926
7.45
7
"""Zero-shot singing-voice conversion — "Sing this as [voice]". seed-vc re-voices a SUNG track as any library voice from its ~10 s reference clip: melody, timing and words are kept, only the timbre changes. It is the one true voice-clone in the singing pipeline — the music engines can only be *described* a vocalist, n...
pizzato/stephen_spielbot
pipeline/svc.py
.py
378a6b35fa626c7c
7.45
7
"""Render-ETA prediction from learned per-task durations. The orchestrator records how long each task kind takes (see ``DurableStore.timing_table``). This module turns that learned table, plus a job's planned tasks and the configured worker counts, into a wall-clock ETA. Model (deliberately simple — see CLAUDE.md §2...
pizzato/stephen_spielbot
pipeline/timing.py
.py
39047f176b15d43d
7.45
7
"""TTS-engine registry: selectable narration models (mirrors pipeline/engines.py). A TTS *engine* is a narration model the user can pick per style as ``tts_engine`` (falls back to the Apache-2.0 default). All engines do zero-shot voice cloning from a reference WAV, so the voice library carries across. Each engine name...
pizzato/stephen_spielbot
pipeline/tts_engines.py
.py
078e8e0bc7dc81d8
7.45
7
#!/usr/bin/env python3 """HTTP F5-TTS server — the containerized TTS worker (issue #12). Wraps the F5-TTS CLI in a tiny HTTP service so the TTS worker can run as a container with no SSH access. Endpoints: GET /health -> {"status": "ok"} POST /tts -> audio/wav bytes body: {"text": "...
pizzato/stephen_spielbot
pipeline/tts_server.py
.py
adc9911ac5971e7e
7.45
7
"""Spoken-text layer: what TTS pronounces vs what captions/readers see. The narration string plays two roles that used to be entangled: it is the caption/display text AND the exact characters handed to the TTS engine. The engines (F5/Chatterbox) offer no SSML, so the only way to steer pronunciation and pacing is to ch...
pizzato/stephen_spielbot
pipeline/tts_text.py
.py
db2f357104cff800
7.45
7
"""Shared UI-activity signal (issue #98). Replaces the dedicated "ui worker" with a dynamic reservation: while the web UI is being actively used, the render's WorkerPool holds one ComfyUI worker idle so cover/preview jobs land on a free GPU instead of queueing behind a render. After the UI has been idle for ``ui_idle_...
pizzato/stephen_spielbot
pipeline/ui_activity.py
.py
612a12bc4eb03e0d
7.45
7
"""Per-scene rendered-video history. Every time a scene's video is re-rendered (or re-muxed after a narration change) we keep the prior takes so the user can flip back and forth in the edit screen and pick the best one. History lives entirely in the job's work directory — no DB schema change, mirroring ``image_history...
pizzato/stephen_spielbot
pipeline/video_history.py
.py
d668933812923366
7.45
7
#!/usr/bin/env python3 """Render `channels.yaml` into the two places the channel list is shown. `channels.yaml` is the single source of truth — contributors add their channel there in a pull request and touch nothing else. This script fans it out to: * webapp/frontend/src/channels.json — bundled into the About scre...
pizzato/stephen_spielbot
scripts/gen_channels.py
.py
fe02508eff80bd84
7.45
7
"""Point HOME at a scratch directory before anything imports app. app binds OUTPUT_DIR, CONFIG_FILE and LOG_DIR from ``Path.home()`` at import time, so a test run that imports app under the real HOME reads and writes the user's live ~/.config/video-generator/config.yaml. Individual test modules each redirect HOME them...
pizzato/stephen_spielbot
tests/conftest.py
.py
2b7203ca80398683
7.95
7
#!/usr/bin/env python3 """Demo session gateway — single process on $PORT (8765). Status: verified 2026-07-13 — this exact file runs the nav-trial live demo on robium.org (Cloud Run service demo-nav-trial). Adapt FLEET_BUDGET and the CORS origin for your deployment. Routes: * WebSocket upgrade (any path) -> raw byt...
robium-ai/robium
archive/live-demo/1.0.0/examples/demo_gateway.py
.py
ba4f602cb653f225
7.48
8