text
stringlengths
185
73.3k
repo
stringlengths
7
100
path
stringlengths
4
146
language
stringclasses
7 values
hash
stringlengths
16
16
score
float64
7
8.5
stars
int64
0
237k
#!/usr/bin/env python3 """Generate a dated bureaucratic timeline for settling an estate in Israel. Anchors every milestone to the date of death and prints three horizons: first 72 hours, first 30 days, and first year. Most dates are calendar offsets to help a bereaved family plan. Rows marked [!] are hard statutory de...
skills-il/legal-tech
israeli-estate-settlement-navigator/scripts/generate_timeline.py
.py
80f2cf5a567deefe
7.42
6
#!/usr/bin/env python3 """ Israeli Fine Appeal Deadline Calculator Calculates remaining days in the appeal window based on fine receipt date. Supports both parking fines (30-day window) and traffic fines (90-day window). Usage: python deadline-calculator.py --date 2026-03-15 --type parking python deadline-cal...
skills-il/legal-tech
israeli-fines-fighter/scripts/deadline-calculator.py
.py
4b322ec4320e5e49
7.42
6
#!/usr/bin/env python3 """ Rent Index Adjustment Calculator (Hatzmada La'Madad) Calculates rent adjustment based on CPI (Consumer Price Index) linking (hatzmada la'madad, הצמדה למדד) as commonly used in Israeli rental contracts. Given the original rent amount, the contract start month, and the current month, this scr...
skills-il/legal-tech
israeli-rental-agreements/scripts/rent-index-calculator.py
.py
9fb4818ca1b17f41
7.42
6
#!/usr/bin/env python3 """ Israeli Small Claims Court Filing Fee Calculator Calculates the filing fee (agrah, אגרה) for Israeli small claims court based on the claim amount. The fee is 1% of the claim amount, with a minimum of NIS 50. Usage: python scripts/filing-fee-calculator.py --amount 15000 python script...
skills-il/legal-tech
israeli-small-claims-court/scripts/filing-fee-calculator.py
.py
1e5ca9fc40da94d2
7.42
6
from typing import Any import httpx from tools.constants import API_BASE_URL class TinyfishMixin: """Mixin for TinyFish tools with shared API request logic.""" @property def _api_headers(self) -> dict[str, str]: return {"X-API-Key": self.runtime.credentials["api_key"]} def _tf_request( ...
tinyfish-io/tinyfish-web-agent-integrations
dify/tools/base.py
.py
3b0cca98ceb8634a
7.63
17
"""TinyFish Search and Fetch REST client.""" from __future__ import annotations import math import time from typing import Any, NoReturn, cast import httpx SEARCH_URL = "https://api.search.tinyfish.ai" FETCH_URL = "https://api.fetch.tinyfish.ai" FETCH_MAX_URLS = 10 BROWSER_URL = "https://api.browser.tinyfish.ai" WA...
tinyfish-io/tinyfish-web-agent-integrations
hermes/tinyfish_hermes/rest_client.py
.py
8612af59b1697352
7.63
17
"""Once-per-context TinyFish tool-routing guidance for Hermes turns.""" from __future__ import annotations from collections.abc import Mapping, Sequence from typing import Any from urllib.parse import urlparse from .config import load_config, routing_context_enabled ROUTING_CONTEXT_MARKER = '<tinyfish-routing-conte...
tinyfish-io/tinyfish-web-agent-integrations
hermes/tinyfish_hermes/routing_context.py
.py
a52369bfd641e7fd
7.63
17
"""Integration tests for TinyFish LangChain tool. These tests make real API calls and require TINYFISH_API_KEY to be set. They are skipped automatically if the key is not available. """ from __future__ import annotations import json import os import pytest from langchain_tinyfish import TinyFishAPIWrapper, TinyFis...
tinyfish-io/tinyfish-web-agent-integrations
langchain/tests/integration_tests/test_integration.py
.py
555566bc4b01358e
8.13
17
"""Packaging metadata tests.""" from __future__ import annotations import tomllib from pathlib import Path def test_tinyfish_dependency_floor() -> None: pyproject_path = Path(__file__).resolve().parents[2] / "pyproject.toml" pyproject = tomllib.loads(pyproject_path.read_text()) dependencies = pyproject...
tinyfish-io/tinyfish-web-agent-integrations
langchain/tests/unit_tests/test_packaging.py
.py
c21c2227d8313070
7.13
17
#!/usr/bin/env python3 """Compare battery data between Modbus registers and Web API. This script connects to both the Modbus TCP interface and the Web API to compare what battery data is available from each source. Usage: uv run python scripts/compare_battery_data.py """ from __future__ import annotations impor...
joyfulhouse/pylxpweb
scripts/compare_battery_data.py
.py
ec0826f10159b9f9
7.6
15
#!/usr/bin/env python3 """Run multiple read cycles to confirm register correlations.""" from __future__ import annotations import asyncio import logging import os import sys from dataclasses import dataclass from pathlib import Path from dotenv import load_dotenv logging.getLogger("pymodbus").setLevel(logging.ERROR...
joyfulhouse/pylxpweb
scripts/confirm_registers.py
.py
2c3616f7f3aef11f
7.6
15
#!/usr/bin/env python3 """Decode Master Battery (Unit ID 1) registers using firmware-derived register map. The EG4-LL battery firmware uses TWO different register maps: - SLAVE batteries (ID 2+): Standard EG4-LL register map (regs 0-38 runtime, 105-127 info) - MASTER battery (ID 1): Different layout with data sta...
joyfulhouse/pylxpweb
scripts/decode_master_battery.py
.py
b9648db6f27a4948
7.6
15
#!/usr/bin/env python3 """Scan FlexBOSS21 registers via Modbus and identify unmapped data.""" from __future__ import annotations import asyncio import logging import os import sys from pathlib import Path from dotenv import load_dotenv # Suppress pymodbus debug output logging.getLogger("pymodbus").setLevel(logging....
joyfulhouse/pylxpweb
scripts/scan_flexboss.py
.py
1a08191691248bd1
7.6
15
#!/usr/bin/env python3 """Compare FlexBOSS21 Modbus registers with web API data availability. Reads all registers from the FlexBOSS21 via Modbus TCP and identifies: 1. Registers that contain non-zero data 2. Registers that are not mapped in the canonical register definitions 3. Comparison with InverterRuntime fields a...
joyfulhouse/pylxpweb
scripts/unmapped_registers.py
.py
52e6b5f8d83bb479
7.6
15
#!/usr/bin/env python3 """Validate register-to-parameter mappings by comparing HTTP vs local transport. This script reads hold parameters from both the web API (HTTP) and local transport (Dongle/Modbus), then compares the results to validate our register mappings. Usage: uv run python scripts/validate_register_ma...
joyfulhouse/pylxpweb
scripts/validate_register_mappings.py
.py
d0844635543ebdce
7.6
15
"""API Namespace for Luxpower/EG4 Client. This module provides the APINamespace class that organizes all API endpoint access under the `client.api.*` namespace for cleaner API design. Design Rationale: - Separates direct API calls (client.api.*) from high-level objects (client.get_station()) - Makes it clear when you...
joyfulhouse/pylxpweb
src/pylxpweb/api_namespace.py
.py
c2f41ad5440a47fc
7.6
15
"""Base classes for battery protocol definitions.""" from __future__ import annotations import struct from abc import ABC, abstractmethod from dataclasses import dataclass from pylxpweb.constants.scaling import ScaleFactor, apply_scale from pylxpweb.transports.data import BatteryData def signed_int16(raw: int) -> ...
joyfulhouse/pylxpweb
src/pylxpweb/battery_protocols/base.py
.py
15d37fe87863f2ef
7.6
15
"""EG4 master battery protocol (firmware-derived register map). Used by the master battery (unit ID 1) on the RS485 daisy chain. Register map derived from Ghidra decompilation of HC32 BMS firmware function FUN_0001cf78. Key differences from slave protocol: - Regs 0-18 are ALL ZEROS (data starts at reg 19) - SOC a...
joyfulhouse/pylxpweb
src/pylxpweb/battery_protocols/eg4_master.py
.py
1b5187849e06a579
7.6
15
"""EG4 slave battery protocol (standard EG4-LL register map). Used by batteries with unit ID 2+ on the RS485 daisy chain. Register map sourced from ricardocello's eg4_waveshare.py. Register layout: - Regs 0-38: Runtime state (voltage, current, cells, temps, SOC, etc.) - Regs 33-35: Packed per-cell NTC temperature...
joyfulhouse/pylxpweb
src/pylxpweb/battery_protocols/eg4_slave.py
.py
e85613c99cd323f3
7.6
15
"""Base classes and protocols for data collectors. Defines the common interface for all data collectors and the data structures used to represent collected register data. """ from __future__ import annotations from dataclasses import dataclass, field from datetime import datetime from typing import TYPE_CHECKING, Pr...
joyfulhouse/pylxpweb
src/pylxpweb/cli/collectors/base.py
.py
4bc91bc176b04bc8
7.6
15
"""Cloud API collector for register reading. Collects register data via the Luxpower/EG4 cloud API for comparison with local Modbus/dongle reads. """ from __future__ import annotations import asyncio import logging import time from collections.abc import Callable from datetime import datetime from typing import TYPE...
joyfulhouse/pylxpweb
src/pylxpweb/cli/collectors/cloud.py
.py
0d0c84f6a3be78c2
7.6
15
"""WiFi Dongle collector for local register reading. Collects register data directly from inverters via the WiFi dongle's TCP interface (port 8000) using the LuxPower proprietary protocol. """ from __future__ import annotations import asyncio import logging import time from collections.abc import Callable from datet...
joyfulhouse/pylxpweb
src/pylxpweb/cli/collectors/dongle.py
.py
e51e015aafb3f8d8
7.6
15
"""Modbus TCP collector for local register reading. Collects register data directly from inverters via Modbus TCP connection through an RS485-to-Ethernet adapter (e.g., Waveshare). """ from __future__ import annotations import asyncio import logging import time from collections.abc import Callable from datetime impo...
joyfulhouse/pylxpweb
src/pylxpweb/cli/collectors/modbus.py
.py
1fc9613d4591224f
7.6
15
"""Archive creator for diagnostic output. Bundles all format outputs into a single ZIP file for easy sharing. """ from __future__ import annotations import io import zipfile from datetime import datetime from pathlib import Path from pylxpweb.cli.utils.sanitize import sanitize_serial from .base import DiagnosticDa...
joyfulhouse/pylxpweb
src/pylxpweb/cli/formatters/archive.py
.py
a2fef974e806937c
7.6
15
"""Base classes and protocols for output formatters. Defines the common interface for all formatters and the data structures used to represent diagnostic data for formatting. """ from __future__ import annotations from dataclasses import dataclass, field from datetime import datetime from enum import StrEnum from ty...
joyfulhouse/pylxpweb
src/pylxpweb/cli/formatters/base.py
.py
b5b65a7dd9b45993
7.6
15
"""Binary formatter for diagnostic output. Generates raw binary register dumps with a header containing metadata. Useful for debugging 16-bit vs 32-bit register interpretation and endianness. """ from __future__ import annotations import struct from datetime import datetime from pylxpweb.cli.collectors.base import ...
joyfulhouse/pylxpweb
src/pylxpweb/cli/formatters/binary.py
.py
f94ce265f475842d
7.6
15
"""CSV formatter for diagnostic output. Generates CSV output suitable for import into spreadsheets. One row per register with values from each collection source. """ from __future__ import annotations import csv import io from pylxpweb.cli.collectors.base import CollectionResult from pylxpweb.cli.utils.sanitize imp...
joyfulhouse/pylxpweb
src/pylxpweb/cli/formatters/csv_fmt.py
.py
024f02f0ed0d2d38
7.6
15
"""JSON formatter for diagnostic output. Generates structured JSON output with all collection data, metadata, and comparison results. """ from __future__ import annotations import json from datetime import datetime from pylxpweb import __version__ from pylxpweb.cli.collectors.base import CollectionResult, Compariso...
joyfulhouse/pylxpweb
src/pylxpweb/cli/formatters/json_fmt.py
.py
1031e161a5827e72
7.6
15
"""Markdown formatter for diagnostic output. Generates human-readable Markdown tables with register data, comparison results, and summary statistics. """ from __future__ import annotations from pylxpweb import __version__ from pylxpweb.cli.collectors.base import ( CollectionResult, ComparisonResult, Regi...
joyfulhouse/pylxpweb
src/pylxpweb/cli/formatters/markdown.py
.py
f4f5e3e58474d147
7.6
15
"""Interactive prompts for the Modbus diagnostic CLI tool. Provides user-friendly prompts for collecting configuration options. """ from __future__ import annotations import getpass from typing import Literal def prompt_transport() -> Literal["modbus", "dongle", "both"]: """Prompt user to select transport type...
joyfulhouse/pylxpweb
src/pylxpweb/cli/utils/prompts.py
.py
0e28f1f978d4799b
7.6
15
"""Sanitization utilities for masking sensitive data. Provides deterministic sanitization that replaces sensitive portions with realistic-looking characters while preserving format validity. """ from __future__ import annotations import hashlib def sanitize_serial(serial: str, enabled: bool = True) -> str: """...
joyfulhouse/pylxpweb
src/pylxpweb/cli/utils/sanitize.py
.py
17497a8be109482c
7.6
15
"""Constants and mappings for Luxpower/EG4 API. This module contains mapping tables extracted from the EG4 web interface to convert between human-readable API values and the enum values required for configuration updates. These mappings were discovered by analyzing the HTML form at: /WManage/web/config/plant/edit/{pl...
joyfulhouse/pylxpweb
src/pylxpweb/constants/locations.py
.py
4aaa5029681c429b
7.6
15
"""Canonical validation and preview normalization for annotation elements. This module intentionally contains only the visual-elements contract. Scene identity, timing-plan bindings and publication remain coordinator concerns. All consumers (candidate validation, formal timing validation and preview rendering) can th...
renmengwen/InkCue
scripts/annotation_contract.py
.py
efaf20b1529b0910
7.48
8
#!/usr/bin/env python3 """读取 project.json 的单一 backgroundMusic.enabled 字段。""" from __future__ import annotations from pathlib import Path from typing import Any try: from .project_workspace import Project, sha256_file except ImportError: # pragma: no cover - direct script execution from project_workspace impo...
renmengwen/InkCue
scripts/background_music.py
.py
f1f3b7ed97ada13a
7.48
8
"""Shared process-boundary helpers for command-line entry points.""" from __future__ import annotations import sys from typing import TextIO def _configure_stream(stream: TextIO | None) -> None: """Prefer UTF-8 for a real reconfigurable CLI stream. Test doubles such as ``io.StringIO`` intentionally do not e...
renmengwen/InkCue
scripts/cli_runtime.py
.py
500a8d733824ece9
7.48
8
"""Optional social-cover first-frame replacement shared by delivery stages.""" from __future__ import annotations import shutil import subprocess from pathlib import Path from typing import Any, Mapping try: from .project_workspace import Project, ProjectValidationError, sha256_file except ImportError: # pragma:...
renmengwen/InkCue
scripts/cover_frame.py
.py
22fc6e93b427d08c
7.48
8
#!/usr/bin/env python3 """可选封面证据的读取与视觉检查豁免边界。 封面是独立图片,不属于普通 scene 源图。此模块只校验封面证据的身份和 `coverFrameRange`,不会从任何技术媒体校验中扣除封面帧。 """ from __future__ import annotations import json from pathlib import Path from typing import Any, Mapping from project_workspace import sha256_file class CoverReviewError(ValueError): """封...
renmengwen/InkCue
scripts/cover_review.py
.py
30c101702e2c6ccc
7.48
8
#!/usr/bin/env python3 """Optional deterministic Phase 4 runner. The runner is intentionally a thin coordinator. It invokes a registered deterministic adapter in-process, prints one machine-readable summary, and stops at the adapter's human gate. The existing step-by-step CLIs remain the recovery/debugging path; thi...
renmengwen/InkCue
scripts/run_phase.py
.py
5ce9568c7e75d1eb
7.48
8
"""CSV export of per-claim verification verdicts.""" from __future__ import annotations import csv import io from typing import Any, Dict, Iterable, List, Mapping from .core import classify_severity #: Column order and names of the exported CSV. CSV_COLUMNS = ["id", "claim", "verdict", "severity", "critique", "evid...
Muhtasim-Munif-Fahim/self-correct-agent
src/self_correct/csvreport.py
.py
1f8cb08668cf7c10
7.42
6
"""Persistent record of verification runs. The CLI is invoked once per run, so anything that should survive between invocations — history, aggregate statistics, cache effectiveness — has to be written somewhere. This module owns that file and nothing else. Records are JSON Lines: append-only, one self-contained objec...
Muhtasim-Munif-Fahim/self-correct-agent
src/self_correct/history.py
.py
8f42e1bdaaaca712
7.42
6
"""Mask sensitive spans before reports and logs are persisted. Verification reports can quote whatever the model was given, so API keys, tokens, or internal hostnames typed into a prompt would otherwise be written verbatim into ``--output`` files and printed reports. A redactor runs configurable regular expressions ov...
Muhtasim-Munif-Fahim/self-correct-agent
src/self_correct/redaction.py
.py
dd4debf934968a34
7.42
6
"""Portable verification sessions for pausing and resuming CLI work.""" from __future__ import annotations import json from pathlib import Path from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple from .core import VALID_SEVERITIES, classify_severity SESSION_SCHEMA_VERSION = 1 def save_session( ...
Muhtasim-Munif-Fahim/self-correct-agent
src/self_correct/sessions.py
.py
538c94676bf9b75f
7.42
6
"""Prompt templates for common verification tasks. Chain-of-Verification pays off most when the prompt asks for something checkable. These templates encode that: each one pushes the model toward discrete, attributable claims rather than prose that cannot be verified claim by claim. Built-ins live here. Users can add ...
Muhtasim-Munif-Fahim/self-correct-agent
src/self_correct/templates.py
.py
7c89c3e977b3276a
7.42
6
"""Alembic migration environment.""" from __future__ import annotations from logging.config import fileConfig from alembic import context from sqlalchemy import engine_from_config, pool # Importing models registers every table on Base.metadata for autogeneration. from opportunities.database import models as databas...
simonesiega/european-tech-opportunities-2027
migrations/env.py
.py
541ad12a69c20a7a
7.5
9
"""add work mode and start date to jobs Revision ID: c7d2a91e4f63 Revises: 8b4e2f3a1c90 Create Date: 2026-07-16 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "c7d2a91e4f63" down_revision: str | None = "8b4e2f3a1c90" branch_labels: str | Sequence[str] | None ...
simonesiega/european-tech-opportunities-2027
migrations/versions/c7d2a91e4f63_add_work_mode_and_start_date.py
.py
ef79f1a7f6fb3dae
7.5
9
"""add employment type to jobs Revision ID: d1f6b38c2a74 Revises: c7d2a91e4f63 Create Date: 2026-07-16 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "d1f6b38c2a74" down_revision: str | None = "c7d2a91e4f63" branch_labels: str | Sequence[str] | None = None de...
simonesiega/european-tech-opportunities-2027
migrations/versions/d1f6b38c2a74_add_employment_type.py
.py
d838fe55890b856f
7.5
9
"""replace work mode with industries Revision ID: e4a7c9d21b60 Revises: d1f6b38c2a74 Create Date: 2026-07-16 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "e4a7c9d21b60" down_revision: str | None = "d1f6b38c2a74" branch_labels: str | Sequence[str] | None = N...
simonesiega/european-tech-opportunities-2027
migrations/versions/e4a7c9d21b60_replace_work_mode_with_industries.py
.py
38c079d09602952d
7.5
9
"""normalize opportunity employment types Revision ID: f2b8d4c61a90 Revises: e4a7c9d21b60 Create Date: 2026-07-18 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "f2b8d4c61a90" down_revision: str | None = "e4a7c9d21b60" branch_labels: str | Sequence[str] | Non...
simonesiega/european-tech-opportunities-2027
migrations/versions/f2b8d4c61a90_normalize_opportunity_employment_types.py
.py
83ef6a0217324154
7.5
9
"""Validate local Markdown links, image paths, and heading anchors.""" from __future__ import annotations import re import sys import urllib.parse from pathlib import Path ROOT = Path(__file__).resolve().parents[1] MARKDOWN_FILES = ( ROOT / "README.md", ROOT / "CONTRIBUTING.md", ROOT / "SECURITY.md", ...
simonesiega/european-tech-opportunities-2027
scripts/check_docs.py
.py
3d93cb37d3a965dd
7.5
9
"""Typer CLI for LinkedIn collection, SQLite storage, and README rendering.""" from __future__ import annotations import asyncio import sys from pathlib import Path from typing import Annotated import typer from pydantic import ValidationError from rich.console import Console from rich.table import Table from sqlalc...
simonesiega/european-tech-opportunities-2027
src/opportunities/cli/app.py
.py
195260ce86e37ac3
7.5
9
"""Validated deterministic classification rules.""" from __future__ import annotations from pathlib import Path from typing import Literal import yaml from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from opportunities.models.enums import OpportunityCategory from opportunities.uti...
simonesiega/european-tech-opportunities-2027
src/opportunities/config/rules.py
.py
458389b9bbed1a31
7.5
9
"""YAML registry for bounded LinkedIn job searches.""" from __future__ import annotations from collections.abc import Iterable from pathlib import Path import yaml from pydantic import ValidationError from opportunities.models.search import LinkedInSearchConfig from opportunities.utils.text import normalized_key ...
simonesiega/european-tech-opportunities-2027
src/opportunities/config/search_registry.py
.py
2d11b6cf73d6a989
7.5
9
"""Validated settings loaded from `.env`, YAML, and process environment.""" from __future__ import annotations import os from collections.abc import Mapping from pathlib import Path from typing import TYPE_CHECKING import yaml from dotenv import dotenv_values from pydantic import BaseModel, ConfigDict, Field, field_...
simonesiega/european-tech-opportunities-2027
src/opportunities/config/settings.py
.py
4847d345716d5341
7.5
9
"""Programmatic Alembic migration entry point used by the CLI and tests.""" from __future__ import annotations from pathlib import Path from alembic import command from alembic.config import Config from alembic.script import ScriptDirectory from sqlalchemy.engine import make_url def _config(repository_root: Path) ...
simonesiega/european-tech-opportunities-2027
src/opportunities/database/migrations.py
.py
559efea30ce36d47
7.5
9
"""Database engine and transaction factories.""" from __future__ import annotations from pathlib import Path from sqlalchemy import Engine, create_engine, event, inspect, text from sqlalchemy.engine import make_url from sqlalchemy.orm import Session, sessionmaker EXPECTED_TABLES = frozenset({"alembic_version", "sea...
simonesiega/european-tech-opportunities-2027
src/opportunities/database/session.py
.py
8996aa4aa36c8b85
7.5
9
"""Small finite-value types used by the focused LinkedIn pipeline.""" from __future__ import annotations from enum import StrEnum class OpportunityCategory(StrEnum): """Enumerate supported technology opportunity categories.""" ARTIFICIAL_INTELLIGENCE = "artificial-intelligence" CLOUD_DEVOPS_INFRASTRUCT...
simonesiega/european-tech-opportunities-2027
src/opportunities/models/enums.py
.py
53ffea4cbf937a21
7.5
9
"""Validated job records crossing the scraper/database boundary.""" from __future__ import annotations from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from opportunities.models.enums import EmploymentType, JobStatus, OpportunityCategory from opportun...
simonesiega/european-tech-opportunities-2027
src/opportunities/models/job.py
.py
ca54629c843b885e
7.5
9
"""Minimal in-memory LinkedIn job records.""" from __future__ import annotations from dataclasses import dataclass from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from opportunities.utils.text import clean_text from opportunities.utils.url import can...
simonesiega/european-tech-opportunities-2027
src/opportunities/models/raw.py
.py
938c19e37db941a9
7.5
9
"""Validated configuration for public LinkedIn job searches.""" from __future__ import annotations from datetime import date from typing import Literal from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from opportunities.utils.text import clean_text, normalized_key DatePosted = Li...
simonesiega/european-tech-opportunities-2027
src/opportunities/models/search.py
.py
af9af1f4223f747b
7.5
9
""" board.py — shared kanban board primitives for Cardloop-Bot. Extracted from webapp.py (spec-034 L0) so that both webapp.py and bot.py share one source of truth for reading and writing TASKS.md / DONE.md. All names are re-exported from webapp.py for backward compatibility. """ # spec-034: https://github.com/igdigi...
igdigitallab/cardloop
board.py
.py
91d0a5f34c08a090
7.42
6
"""2captcha bridge — the network half of ``browser_solve_captcha``. Deliberately knows NOTHING about Playwright or the browser pane: it takes a task description, talks to the 2captcha API, and returns a token. The page-side half (detecting the widget, injecting the token, firing the site's callback) lives in ``browser...
igdigitallab/cardloop
captcha_solver.py
.py
22a1b9c861122ac3
7.42
6
""" e2e_fake_engine.py — deterministic scripted stand-in for engine.run_engine. Used ONLY when E2E_FAKE_ENGINE=1 (see bot.py:_build_ctx). Wired into ctx["run_engine"] after the real ctx is built, so it is a drop-in replacement everywhere the cockpit reads ctx["run_engine"] (chat, cards, deferred runs) — no SDK, no net...
igdigitallab/cardloop
e2e_fake_engine.py
.py
eefca6900e723504
7.42
6
"""features/board_janitor/loop.py — background sweep that gives Review an exit. Import rule: feature -> core is safe (spec-068 IRON RULE); core never imports this. What it does every tick: 1. stamps Review cards that carry no review timestamp (grandfathering), 2. auto-archives cards that pass the objective gate i...
igdigitallab/cardloop
features/board_janitor/loop.py
.py
705d5a2bf61f95ee
7.42
6
"""features/board_janitor/routes.py — HTTP surface for board acceptance. Import rule: feature -> core is safe; core never imports this module. """ from __future__ import annotations import time from aiohttp import web from webapp import ( _find_project_by_id, _get_board_lock, _load_board, _save_boar...
igdigitallab/cardloop
features/board_janitor/routes.py
.py
80afb51d257150f6
7.42
6
#!/usr/bin/env python3 """ secret.py — CLI for the built-in encrypted secret store (Spec 026, Phase 3). Usage: python secret.py init [--force] python secret.py get NAME python secret.py set NAME [VALUE] # VALUE may be omitted; reads from stdin python secret.py list python secret.py rm NAME ...
igdigitallab/cardloop
secret.py
.py
9a92aef39cee0e82
7.42
6
"""Epic-lens: aggregate docs/internal/specs/*.md as epics with their linked board cards. Read-only. Powers the cockpit Specs tab (spec-049 Workstream B / spec-059 Move 1): each spec file is an epic, every card carrying a `spec=<id>` ops-marker is one of its subtasks, and progress = done / total. Pure functions over bo...
igdigitallab/cardloop
spec_epics.py
.py
3ff9c38a7b8fec57
7.92
6
""" Shared fixtures for Cardloop tests. """ import os import sys from pathlib import Path # Add the project root to sys.path so webapp can be imported without installation ROOT = Path(__file__).parent.parent sys.path.insert(0, str(ROOT)) # The aiohttp test client talks plain HTTP, so a Secure-flagged auth cookie set ...
igdigitallab/cardloop
tests/conftest.py
.py
c65cb2b25e6a764f
7.92
6
""" Shared fixtures for the E2E Playwright suite (spec-072). Boots a REAL cockpit subprocess — its own private copy of the app under a fresh tmp "data/" dir, a random port, a random password, E2E_FAKE_ENGINE=1 (see e2e_fake_engine.py) — and drives it with a real (headless) browser via Playwright. Never touches the pro...
igdigitallab/cardloop
tests/e2e/conftest.py
.py
36e7552b408015b6
7.92
6
""" spec-080 — plan-approval card E2E (fake engine, zero SDK). `e2e:plan` parks a REAL pending plan through the same webapp store the real engine's gate uses, so this exercises the full stack: bus plan_ready → card render → decide POST → Future resolution → chat resumption, plus reload-durability mid-wait. Locale-ind...
igdigitallab/cardloop
tests/e2e/test_e2e_plan_mode.py
.py
82235c141807a063
7.92
6
""" spec-072 Part 1 — E2E smoke suite. Drives a REAL cockpit (subprocess, fake engine — see conftest.py/e2e_fake_engine.py) through a real headless browser. Covers the four scenarios from the spec: 1. plain streaming text (no duplicate/chopped bubbles) 2. a tool call renders + final text 3. mid-run reload re-att...
igdigitallab/cardloop
tests/e2e/test_smoke.py
.py
37ac02cc16db2413
7.92
6
""" E2E specs for the ONE invariant the composer must never break: while a turn is running, the operator can always interrupt it. Both scenarios below reproduce an operator report ("the session is clearly running, but there is no Stop button — my message just goes into the queue and I cannot cut the run off"): ...
igdigitallab/cardloop
tests/e2e/test_stop_button.py
.py
39559b64e7dc2818
7.92
6
"""FT glue for torchtitan's transformers_modeling_backend (HF-architecture pretraining and full-parameter fine-tuning). The backend builds any dense Llama-like HF architecture from a repo id. The hf_debugmodel/hf_full presets train it from scratch (random init); hf_finetune loads the repo's pretrained safetensors thro...
PanocularAI/panofabric-engine
models/hf_transformers/__init__.py
.py
fcb9f38ebf083907
7.42
6
# Config-as-code presets for FT training of HF-architecture models, mirroring # models/llama3/config_registry.py. Selected by torchtitan's # ConfigManager: --module models.hf_transformers --config <fn>. # The HF repo id is NOT baked into presets — it arrives via the --hf_model # CLI overlay (RunSpec.model.hf_model), so...
PanocularAI/panofabric-engine
models/hf_transformers/config_registry.py
.py
c8ca29b420b42eb0
7.42
6
# Config-as-code presets for LoRA fine-tuning, mirroring the # panoengine.train.* FT glue. Selected by torchtitan's ConfigManager: # --module models.lora --config <fn> (models.lora shims this package). # # What makes these FINE-TUNING presets rather than pretraining: # * checkpoint.initial_load_in_hf=True loads the r...
PanocularAI/panofabric-engine
models/lora/config_registry.py
.py
ed13a187172f9bdb
7.42
6
import numpy as np import torch from dataclasses import dataclass from datasets import Dataset, load_dataset from datasets.distributed import split_dataset_by_node from torch.distributed.checkpoint.stateful import Stateful from torch.utils.data import IterableDataset from torchtitan.components.dataloader import Para...
PanocularAI/panofabric-engine
models/resnet/datasets/cifar10.py
.py
5e1921d2cb8e6e1a
7.42
6
from dataclasses import dataclass from typing import Literal import torch import torch.nn as nn from torch.distributed._composable.replicate import replicate from torch.distributed.device_mesh import DeviceMesh from torchtitan.config import TORCH_DTYPE_MAP from torchtitan.config.configs import CompileConfig, Parallel...
PanocularAI/panofabric-engine
models/resnet/infra/parallelize.py
.py
0823520637ce886f
7.42
6
from dataclasses import dataclass from typing import Literal, Optional import math from torch import nn import dataclasses @dataclass class ResNetModelArgs: """ Configuration for building a ResNet-50 backbone. """ num_classes: int = 10 n_layers: int = 4 # number of layers to include (max 4) ...
PanocularAI/panofabric-engine
models/resnet/model/args.py
.py
6190f1b144b314d1
7.42
6
from dataclasses import dataclass import torch from torchtitan.components.loss import BaseLoss, LossFunction from torchtitan.config import CompileConfig def cross_entropy_loss(pred: torch.Tensor, labels: torch.Tensor) -> torch.Tensor: """Cross-entropy loss for image classification. Uses sum reduction (not ...
PanocularAI/panofabric-engine
models/resnet/model/loss.py
.py
b0968ff59936a22c
7.42
6
# Copyright (c) Panocular AI. # # The rollout queue: a standalone CPU process buffering rollout batches # between the generator workers (push) and the trainer replicas (pop), used # by BOTH decoupled strategies: # - async_inference: one trainer pops (the queue used to be embedded in the # trainer process; standal...
PanocularAI/panofabric-engine
panoengine/decentralized/rollout_queue.py
.py
4eb309c91dc76c8d
7.42
6
# Copyright (c) Panocular AI. # # HeLoCoRLClient against a real localhost AsyncDiLoCoServer (the HTTP /sync # protocol end to end), the applied=False re-baseline path (stubbed wire), # and build_server's outer-method dispatch. import pytest import torch from torch import nn import panoengine.decentralized.parameter_s...
PanocularAI/panofabric-engine
panoengine/decentralized/tests/test_heloco.py
.py
992cae4bc148bc04
7.92
6
# Copyright (c) Panocular AI. # # Weighted layer sharder for the cross-site pipeline. # # Splits an HF transformer checkpoint's decoder layers across S pipeline # stages proportional to each stage's GPU memory, then writes one pruned # checkpoint dir per stage plus a pipeline manifest. Stage 0 additionally # carries th...
PanocularAI/panofabric-engine
panoengine/serve/sharder.py
.py
e5831d5db8ea45b7
7.42
6
import pytest def test_ctl_frame_roundtrip(): """Control frames (admits/step/reload) survive the tensor transport encoding — the follower sees exactly what stage 0 broadcast.""" # The frames ride uint8 tensors (torch.distributed.broadcast is the wire), # so the encoding itself needs torch — absent f...
PanocularAI/panofabric-engine
panoengine/serve/tests/test_pipeline.py
.py
f9cc13f7719e99cf
7.92
6
# Copyright (c) Panocular AI. # # Streamed, integrity-verified weight fetch. # # Downloads a manifest of files by ranged HTTP chunks with bounded concurrency # (the ZML-style technique), sha256-verifying every file before it is moved # into place — a partial or corrupt write can never masquerade as a complete # checkpo...
PanocularAI/panofabric-engine
panoengine/serve/weights.py
.py
da1e83d318576bbe
7.42
6
# Copyright (c) Panocular AI. # # On-GPU trainer actors for the decentralized_rl coordination strategies. Each class # extends torchtitan.experiments.rl's PolicyTrainer (the base # forward_backward/optim_step -- stock token-level GRPO loss -- is reused # unchanged) with only its strategy's weight-exchange endpoints: # ...
PanocularAI/panofabric-engine
panoengine/train/rl/actors.py
.py
a020cf9055a1948f
7.42
6
# Copyright (c) Panocular AI. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. # # RL glue for the HF transformers modeling backend: a ModelSpec factory whose # result satisfies the async-RL contract (HF weight loa...
PanocularAI/panofabric-engine
panoengine/train/rl/hf_model_registry.py
.py
2ab2e172158c1bae
7.42
6
package com.example.kafkabatch; import static org.junit.jupiter.api.Assertions.assertEquals; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Arrays; import org.junit.jupiter.api.Test; class PaymentBatchProcessorTest { private final PaymentBatchProcessor processor = new PaymentBatchProcessor...
signalfx/obstudio
evals/java/kafka-batch-consumer/src/test/java/com/example/kafkabatch/PaymentBatchProcessorTest.java
.java
2ceba5e06fa063ca
7.1
15
# SPDX-License-Identifier: Apache-2.0 """Minimal synthetic source → raw-intake adapter (illustrative). This is a *generic, synthetic* worked example of the adapter contract documented in ``docs/adapter-contract.md``. It writes a single raw-intake file that the librarian will pick up on the next ``athenaeum run`` and c...
Kromatic-Innovation/athenaeum
examples/adapters/minimal_adapter.py
.py
7e95264500fa177b
7.54
11
#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 """Fail if any ``ATHENAEUM_*`` env var read by ``src/`` is undocumented (issue athenaeum#688). ~19 per-stage LLM tuning env vars were read by the code and documented nowhere, because prose ("document new env vars") does not enforce itself. This check does: i...
Kromatic-Innovation/athenaeum
scripts/check_env_docs.py
.py
c373722fb32c73eb
7.54
11
#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 """Baseline metric harness for the C4 contradiction detector (athenaeum#198). Runs the auto-memory discovery → cluster → merge → contradiction pipeline against a live ``~/knowledge/`` tree (or a user-specified knowledge root) and prints aggregate + per-clust...
Kromatic-Innovation/athenaeum
scripts/measure_contradiction_baseline.py
.py
e35489d9277982fa
7.54
11
#!/usr/bin/env python3 """Restore prose destroyed by the 2026-07-29 migrate-pii run (athenaeum#691). For every `[contact redacted -> excluded surface]` marker in the live wiki, recover the token it replaced from the pre-migration git revision and put it back IF that token was never PII (a date, an id fragment, an issu...
Kromatic-Innovation/athenaeum
scripts/pii-restore.py
.py
94629eabfc15558d
7.54
11
#!/usr/bin/env python3 """Deploy-SHA stamp for athenaeum (issue athenaeum#413). Mirrors voltaire's ``scripts/write-build-sha.mjs`` (cwc#1102) and hestia's deploy stamp (hestia#258): writes the running commit SHA to ``dist/.build-sha`` as a single 40-char lowercase-hex line + trailing newline. That byte shape is what m...
Kromatic-Innovation/athenaeum
scripts/write_build_sha.py
.py
f55ba8ba4ceb9d60
7.54
11
# SPDX-License-Identifier: Apache-2.0 """Shared CLI/argparse helpers for ``cli.py`` and the ``_cmd_*`` subcommands. Contract: the small argparse-type functions (``_positive_int``, ``_iso_date``), the run-lock flag group, the lock-acquire helper, and the lock-contention exit code that BOTH ``cli.py`` AND the per-subcom...
Kromatic-Innovation/athenaeum
src/athenaeum/_cli_shared.py
.py
fa9b929f79a81ca2
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum bounce-contract`` — Tier-0 bounce-note conformance CLI (issue athenaeum#854). Mirrors ``athenaeum outbound-lint`` in shape and purpose: a thin CLI dispatcher over a library function (:func:`athenaeum.bounce_contract.check_tier0_bounce_conformance`) with no detection...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_bounce_contract.py
.py
108d25ec1ec3c6aa
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum bounce-divergence`` — bounce-mark divergence report (issue athenaeum#853). Why a CLI is the shipped surface (the acceptance criterion lets the lane pick, and asks it to say why): this is an **operator** check run against a store — including a private store this repo...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_bounce_divergence.py
.py
bc132acc969ae089
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum calibration {summary,review}`` — tier-audit calibration CLI (issue athenaeum#438). The calibration loop for the tiered reasoning pass: a random audit share of T1 rejects and T2 approvals is surfaced (as ``type: "audit"`` items in the ``decisions`` queue) for a human...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_calibration.py
.py
3b1f9622021542eb
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum decay-sweep`` — deterministic sweep for expired ``bucket: daily`` wiki pages (issue athenaeum#904, AC6). Mirrors ``athenaeum auto-memory prune``'s CLI shape exactly (dry-run default, ``--apply`` git-archives the kill-list and rebuilds the recall index) — see ``athen...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_decay.py
.py
e285f0f713495db0
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum do-not-email-divergence`` — do_not_email divergence report (issue athenaeum#960). The anti-recurrence criterion of issue athenaeum#960: a check that reports the two-surface difference for ``do_not_email`` (wiki page frontmatter vs. the excluded-record surface) and, ...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_do_not_email_divergence.py
.py
1670cb674d6bffd1
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum drain`` — one-command supervised API+batch backlog drain (issue athenaeum#470). A thin CLI wrapper over :func:`athenaeum.drain.run_drain`: it runs the pre-flight guards (API key present, no finite deadline, cost confirmation), prints an up-front cost ESTIMATE, acqui...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_drain.py
.py
e8f6f34e822a324d
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum {init,status,disable,enable,spend}`` — knowledge-base lifecycle. Five small, independent subcommands grouped here because each is a thin, single-purpose operator command over knowledge-base or process-level state (create the directory, report status, flip the kill s...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_lifecycle.py
.py
0e45be9b63b02f6e
7.54
11
# SPDX-License-Identifier: Apache-2.0 """``athenaeum outbound-lint`` — outbound-draft PII lint CLI (issue athenaeum#455). Mirrors ``athenaeum authority`` / ``athenaeum merges`` in shape: a thin CLI dispatcher over the library functions in :mod:`athenaeum.outbound_pii`, with no detection logic of its own. Reads the ou...
Kromatic-Innovation/athenaeum
src/athenaeum/_cmd_outbound.py
.py
83e858e52594d78d
7.54
11