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
"""Graficos: distribuicao de vagas por area e principais tecnologias por area. Decisoes de forma (e por que): - **Barras horizontais, nao pizza.** A tarefa do leitor e comparar grandezas e os nomes das areas sao longos. - **Uma cor so, nao um degrade por valor.** Areas de tecnologia sao categorias *nominais* (nao...
diasgarcia/tech-skills-br
scraper/charts.py
.py
937da10869722241
7.42
6
"""Classificacao de vagas em areas de tecnologia via keywords ponderadas. As regras vivem em `scraper/rules/areas.yml` -- edite la, nao aqui. """ from __future__ import annotations import re from dataclasses import dataclass from functools import lru_cache from pathlib import Path import yaml from .config import R...
diasgarcia/tech-skills-br
scraper/classifier.py
.py
547de43697abe423
7.42
6
"""Configuracao central do projeto. Tudo que voce provavelmente vai querer ajustar (termos de busca, delays, caminhos) esta neste arquivo ou nos YAMLs em `scraper/rules/`. """ from __future__ import annotations import os from dataclasses import dataclass, field from pathlib import Path PROJECT_ROOT = Path(__file__)...
diasgarcia/tech-skills-br
scraper/config.py
.py
ccf51357c28d7204
7.42
6
"""Remocao de vagas duplicadas. Duplicatas aparecem por tres motivos: 1. o mesmo termo de busca traz a mesma vaga em paginas diferentes; 2. termos diferentes ("desenvolvedor junior" e "desenvolvedor jr") trazem a mesma vaga; 3. portais diferentes anunciam a mesma vaga -- e cada um escreve o nome da emp...
diasgarcia/tech-skills-br
scraper/dedupe.py
.py
d072ddd877115fa4
7.42
6
"""Classificador geografico: associa cada vaga a um polo tecnologico e macrorregiao.""" from __future__ import annotations import re import unicodedata from functools import lru_cache from pathlib import Path from typing import Any import yaml from .config import RULES_DIR from .models import REMOTO, Job, normalize...
diasgarcia/tech-skills-br
scraper/geo.py
.py
18f308aedfee7a27
7.42
6
"""Estruturas de dados compartilhadas entre coleta, classificacao e exportacao.""" from __future__ import annotations import hashlib import re import unicodedata from dataclasses import asdict, dataclass, field from typing import Any _TAG_RE = re.compile(r"<[^>]+>") _WS_RE = re.compile(r"\s+") _NON_ALNUM_RE = re.com...
diasgarcia/tech-skills-br
scraper/models.py
.py
5109411aa97ffd53
7.42
6
"""Filtro de senioridade: mantem apenas vagas de entrada (junior/estagio/trainee).""" from __future__ import annotations import re from functools import lru_cache from pathlib import Path import yaml from .config import RULES_DIR from .models import Job, normalize class SeniorityFilter: """Decide se um titulo...
diasgarcia/tech-skills-br
scraper/seniority.py
.py
c508b15bbe440f70
7.42
6
"""Extracao das tecnologias/habilidades citadas em cada vaga. As regras vivem em `scraper/rules/skills.yml` -- edite la, nao aqui. Diferente do resto do projeto, aqui o texto passa por uma normalizacao propria que PRESERVA "#" e "+": com a normalizacao padrao, "C#" viraria "c" e casaria com qualquer "c" solto no text...
diasgarcia/tech-skills-br
scraper/skills.py
.py
f21f94ac615e9122
7.42
6
"""Contrato comum a todos os portais.""" from __future__ import annotations import logging from abc import ABC, abstractmethod from ..config import Settings from ..http_client import PoliteSession from ..models import Job, SourceStats logger = logging.getLogger(__name__) class JobSource(ABC): """Um portal de ...
diasgarcia/tech-skills-br
scraper/sources/base.py
.py
76f036b526535489
7.42
6
"""Coletor da ProgramaThor (programathor.com.br). Portal 100% de vagas de tecnologia. A listagem e renderizada no servidor, entao `requests` + BeautifulSoup bastam (verificado ao vivo). Duas particularidades descobertas testando o site, e que mudam a integracao: 1. **O parametro `?search=` e ignorado.** Buscar `?sea...
diasgarcia/tech-skills-br
scraper/sources/programathor.py
.py
9e5fa17b52ce1b34
7.42
6
"""Coletor do Trampos.co. O site e uma SPA em Ember: o HTML entregue traz so um `<noscript>` de fallback, sem link nem id por vaga. O que serve e a API JSON que o app consome, publica e sem autenticacao, descoberta inspecionando a aba Network: GET https://trampos.co/api/v2/opportunities?tr=<termo>&page=<n> Param...
diasgarcia/tech-skills-br
scraper/sources/trampos.py
.py
17d97709f6415dad
7.42
6
"""Enriquecedor de descricoes para Vagas.com e Trampos. A listagem dessas fontes nao traz a descricao completa da vaga. Este script busca o detalhe de cada vaga PENDENTE, atualiza a descricao no banco e re-extrai as tecnologias com o skills.yml atual. - Vagas.com: GET na propria URL da vaga (pagina server-rendered, s...
diasgarcia/tech-skills-br
scripts/enrich_outras_fontes.py
.py
408b0817ea3487ad
7.42
6
"""Importa o CSV de vagas gerado pelo scraper para o SQLite. python scripts/import_csv.py # pega o CSV mais recente python scripts/import_csv.py --csv caminho.csv python scripts/import_csv.py --db data/outro.db --recriar python scripts/import_csv.py --db postgresql://vagas:vagas@localh...
diasgarcia/tech-skills-br
scripts/import_csv.py
.py
43bcca171da011d8
7.42
6
"""Gera um relatorio consolidado completo da base de dados (SQLite/PostgreSQL). Exemplos de uso: python scripts/report_db.py # exibe resumo no terminal e salva relatorio MD python scripts/report_db.py --db data/vagas.db python scripts/report_db.py --no-export # apenas exibe no termin...
diasgarcia/tech-skills-br
scripts/report_db.py
.py
4e11b7ee7b9bf7d3
7.42
6
"""Fixtures da API: banco SQLite em memoria, sem rede e sem tocar em data/vagas.db. Os testes da API ficam num diretorio proprio para que quem so usa o scraper possa rodar `pytest tests/` sem ter FastAPI instalado -- o importorskip abaixo pula esta pasta inteira nesse caso. """ from __future__ import annotations fro...
diasgarcia/tech-skills-br
tests/api/conftest.py
.py
2738ad1046e65dfc
7.92
6
"""Resolucao do destino do banco: SQLite por padrao, Postgres por configuracao.""" from __future__ import annotations from pathlib import Path import pytest from api.database import database_url, make_engine, url_sem_senha @pytest.fixture(autouse=True) def _ambiente_limpo(monkeypatch): """Isola dos envs da má...
diasgarcia/tech-skills-br
tests/api/test_database_url.py
.py
6288f7ed3f398cea
7.92
6
"""API client for the Codex CLI Worker add-on.""" from __future__ import annotations from typing import Any from aiohttp import ClientError, ClientResponseError, ClientSession class CodexCliApiError(Exception): """Raised when the Codex CLI Worker API fails.""" def __init__(self, message: str, *, status: i...
moryoav/home-assistant-codex
custom_components/codex_cli/api.py
.py
1cf02b48050e8549
7.48
8
"""Binary sensors for the Codex CLI integration.""" from __future__ import annotations from homeassistant.components.binary_sensor import BinarySensorDeviceClass, BinarySensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import EntityCategory from homeassistant.core import HomeA...
moryoav/home-assistant-codex
custom_components/codex_cli/binary_sensor.py
.py
3ecee086f99a769c
7.48
8
"""Worker discovery helpers for the Codex integration.""" from __future__ import annotations import os import secrets from dataclasses import dataclass from typing import Any from aiohttp import ClientError, ClientSession from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistant...
moryoav/home-assistant-codex
custom_components/codex_cli/discovery.py
.py
bc404e95e21e07e9
7.48
8
"""Custom `toc` slugify used by `.mkdocs/mkdocs.yml` (#4173). Same slug output as python-markdown's own default `toc.slugify` for every character it can already ASCII-fold (Latin diacritics, circled numerals, etc. via NFKD) — this function changes NOTHING for those. It differs only for a character NFKD+ascii-fold woul...
tya5/reyn
.mkdocs/reyn_slugify_hook.py
.py
58cb3d29b3c5880d
7.5
9
"""Root pytest configuration: in-process import-identity guard (#3233). `#3231`'s real incident: a coder ran `pytest` in a git worktree whose ambient venv had an editable `.pth` pointing at a DIFFERENT worktree. In-process `import reyn` resolved that OTHER checkout, so the whole suite ran stale code and reported a fal...
tya5/reyn
conftest.py
.py
eb8c2e178e6cd5fd
8
9
"""Failing tests for the FizzBuzz TDD iteration scenario. The agent's job: implement ``fizzbuzz(n: int) -> str`` in ``fizzbuzz.py`` so all of these pass. Tests cover the edge cases that catch most naive first-attempt implementations. """ from fizzbuzz import fizzbuzz def test_classic(): """Classic FizzBuzz rules...
tya5/reyn
dogfood/fixtures/fizzbuzz_5bugs_interleaved/test_fizzbuzz.py
.py
7205486ec390ed14
8
9
"""Dogfood verify: production permission-prompt structure post-#163. Goal: confirm that the actual require_web_fetch path (production code, not a stub UserIntervention) produces an OutboxMessage with the structured ``meta.prompt`` + ``meta.detail`` fields the TUI renderer relies on. Tier 2 tests for #163 used a hand-b...
tya5/reyn
dogfood/scripts/verify_permission_prompt_structure.py
.py
1dfa712999066827
7.5
9
"""#3995/#4002 — resolving a ``__file__``-rooted expression to a real Path. Two gates each build their own boolean check on top of this ONE shared resolver — they do NOT share a single predicate (that was tried, twice, and retracted twice: #3995's original "leaves own directory by hop count" missed #4002's ``Path(__fi...
tya5/reyn
scripts/_file_depth_predicate.py
.py
a8a71d72eff0e5d1
7.5
9
"""Managed reyn-web subprocess — guaranteed teardown, orphan-leak fix (#268). A bare ``subprocess.Popen`` + ``try/finally`` leaks reyn web when the driver process dies via a *signal* (terminal close = SIGHUP, session end = SIGTERM, Ctrl-C = SIGINT) BEFORE the ``finally`` block runs — the leftover ``reyn web`` reparent...
tya5/reyn
scripts/_reyn_web_proc.py
.py
269c0a33553b221d
7.5
9
#!/usr/bin/env python3 """#5177 — enforces that ``src/reyn/security/permissions/approval_ledger.py`` never imports a reyn-internal module. ``src/reyn/api/safe/file.py`` runs inside the python-harness SUBPROCESS and deliberately stays self-contained (see that module's own ``_project_root_for_gate`` docstring — it does ...
tya5/reyn
scripts/check_approval_ledger_import_boundary.py
.py
1d61cdf01fbac8c9
7.5
9
#!/usr/bin/env python3 """#4008 — the bare-import sibling of the ``__file__``-depth class (#3995/#4002/#4019, ``check_file_depth_reference.py``). A DIFFERENT resolution mechanism, deliberately kept as its own gate rather than folded into that one (see this issue's own body for the three reasons: distinct AST shape, dis...
tya5/reyn
scripts/check_bare_tests_import_reference.py
.py
4ef16a90b795d537
8
9
#!/usr/bin/env python3 """#4988 — a static gate against the "cancel-then-await-then-swallow" class: a coroutine cancels a task/future it owns, awaits it, and catches the resulting ``CancelledError`` unconditionally — with no check for whether the CATCHING coroutine's own task was ALSO, independently, externally cancell...
tya5/reyn
scripts/check_cancel_swallow.py
.py
3bfd1246efa1b1fc
7.5
9
#!/usr/bin/env python3 """Measure verbatim-span overlap between every ``CLAUDE.md`` file and the ``docs/`` corpus — the re-runnable form of #4858/#4860's measurement. #4858: 3/3 same-day mirror-drift misses (`#4841→#4843`, `#4851→#4853`, `#4854`'s own bullet) all landed inside a ~10%-of-CLAUDE.md verbatim overlap with...
tya5/reyn
scripts/check_claude_md_doc_overlap.py
.py
a68b6d01b38896e2
7.5
9
#!/usr/bin/env python3 """#3698 — the enforcement half of the fastmcp import boundary (P2/P3 were the convention half). P2 (#4053) introduced ``src/reyn/mcp/_fastmcp_boundary.py`` as the single seam every reyn-side ``fastmcp`` import went through, but nothing stopped a future direct ``import fastmcp`` anywhere else in...
tya5/reyn
scripts/check_fastmcp_import_boundary.py
.py
d3c9c52eef469221
7.5
9
#!/usr/bin/env python3 """#3995/#4002 — the "new file, static-time" half of the __file__-depth class. NOT the same mechanism as `check_migration_diff_shape.py`'s a′ (#4002 explicitly retracted "1機構" — see that module's own docstring for the two retractions this arc went through the same night). ## Why this is a DIFFER...
tya5/reyn
scripts/check_file_depth_reference.py
.py
60249a603e1fb7dc
7.5
9
#!/usr/bin/env python3 """Fail a PR whose blocking point was closed without a corroborating record (#5314) — an open checkbox (#5135, unchanged), a checked checkbox nobody commented on, or a BLOCKING comment nobody posted BLOCKING-CLEARED for. ## The measured bypass (#5311, one night, 2 real instances) The original g...
tya5/reyn
scripts/check_open_blocking_checkboxes.py
.py
099349c3391f10f9
7.5
9
#!/usr/bin/env python3 """#5093 — a graceful-degrade placeholder in ``project_remote_snapshot``'s return dict must have a declared axis (or a cited, permanent exemption), never a hand-typed literal a producer can silently forget to update. ## The bug class this closes ``project_remote_snapshot`` (``reyn/interfaces/re...
tya5/reyn
scripts/check_remote_snapshot_placeholder_declared.py
.py
1bf7b8728bc5b9f6
7.5
9
#!/usr/bin/env python3 """#4327 — a retired top-level `reyn.yaml` key must not appear, at top level, in operator-facing docs or the shipped config example. ## The gap this closes `tests/config/test_config_mirror_coverage_1056.py` already gates two files (`reyn.local.yaml.example` / `docs/reference/config/reyn-yaml.md...
tya5/reyn
scripts/check_retired_config_keys_denylist.py
.py
9b9f19fa9f6894e6
7.5
9
#!/usr/bin/env python3 """#5267 (Family A) — a static gate against a raw ``asyncio.create_task`` call inside a module that OWNS a :class:`~reyn.runtime.tracked_tasks. TrackedTaskSet`, bypassing the single funnel #4759 built for exactly this ("SpawnTracker and OutboxHub made task_tracker a REQUIRED constructor param ......
tya5/reyn
scripts/check_task_funnel_bypass.py
.py
99c63b02c0cfd1e2
7.5
9
#!/usr/bin/env python3 """A ``tests/<name>/`` directory name must not collide with real import machinery, and (going forward) must mirror ``src/reyn/`` — #3879, lead-coder's two follow-up corrections (broker 2026-08-09 01:20:15 / 01:20:32). Two independent checks, both mechanical (never a declaration): SHADOW (always...
tya5/reyn
scripts/check_tests_dir_names.py
.py
02a12eef12048d34
8
9
#!/usr/bin/env python3 """#4065 — every `tests/...py` path literal, repo-wide, must resolve to a real file. ## The class this closes A path literal referencing a `tests/` file — in a docstring, a code comment, a doc's prose, a YAML/workflow file's command args — goes stale the moment that file moves, UNLESS something...
tya5/reyn
scripts/check_tests_path_literal_reference.py
.py
f2b606596a8ede17
8
9
#!/usr/bin/env python3 """Fail a ``tests/``-touching PR whose TESTS-READ note does not name the PR's CURRENT head, or carries no such note at all. #5039. House rule 8 says a PR touching ``tests/`` does not self-merge until a reviewer's TESTS-READ note lands on it. The rule is satisfied by the note *existing* — nothing...
tya5/reyn
scripts/check_tests_read_names_its_tree.py
.py
ae14ac9ed8ea8133
7
9
#!/usr/bin/env python3 """#5131 gate B — the "down" reactive framework never shrinks, and App's imperative pushes into a widget never grow. Gate A (``check_tui_widget_boundary.py``) is structural and zero-FP: an import statement is unambiguous. Whether App→widget state flow actually goes through ``reactive``/``watch_`...
tya5/reyn
scripts/check_tui_reactive_ratchet.py
.py
1ff03b01dd2f0ce9
7.5
9
#!/usr/bin/env python3 """#5131 gate A — a ``textual_chat/`` WIDGET module never imports transport or registry. Architect ruling (#5131): the "up" half of this arc's react discipline is already a framework (Textual ``Message`` subclasses, 10+ of them — widgets throw events upward, never touch the wire directly) — meas...
tya5/reyn
scripts/check_tui_widget_boundary.py
.py
afbc8ce830ef7133
7.5
9
"""Aggregate dogfood batch results — produce aggregate.json + a past-batch comparison table for the retrospective.md. Consumes the per-worker JSON files written under ``<journal_dir>/workers/results-worker-{N}.json`` plus the past-batch aggregate.json files declared in the YAML batch config (see ``dogfood_batch_config...
tya5/reyn
scripts/dogfood_aggregate.py
.py
4971a36c3ce3dfe8
7.5
9
"""Minimal stdio MCP server for the ``hello-lingtai`` example Agent Plugin. Deliberately **stdlib only**. A real third-party plugin cannot import the kernel it is dropped into, and it cannot assume which MCP SDK — or which SDK major version — the host happens to have installed for the ``python3`` on PATH. So this spea...
Lingtai-AI/lingtai-kernel
docs/examples/agent-plugins/hello-lingtai/server.py
.py
bb1d1897bc90f2af
7.5
9
"""Setuptools shim — adds Rust sidecar build hooks on top of pyproject.toml. Project metadata lives in ``pyproject.toml``. This file exists only to wire two extra steps into the standard ``setuptools.build_meta`` flow: 1. **Bundle the Rust sidecar binary into the wheel.** ``BuildPyWithSidecar`` and ``BdistWheelImp...
Lingtai-AI/lingtai-kernel
setup.py
.py
80213c3d6dfea87b
7.5
9
"""lingtai — generic AI agent framework with intrinsic tools, composable capabilities, and pluggable services. This top-level module is a lightweight, lazy facade. ``import lingtai`` loads only the stdlib and the package version; every public name in ``__all__`` is resolved on first access via :pep:`562` ``__getattr__...
Lingtai-AI/lingtai-kernel
src/lingtai/__init__.py
.py
042383e1257285be
7.5
9
"""Production static HTTP(S) Adapter for the browser Core Port. The adapter is intentionally outside ``lingtai.tools.browser`` Core. It dials the exact vetted IP supplied by Core, keeps the original hostname for Host/SNI, never follows redirects, and does not consult proxy environment variables. """ from __future__ i...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/browser_transport.py
.py
2b3b19653684130b
7.5
9
"""Portable system lifecycle-clock adapter. ``SystemLifecycleClockAdapter`` implements the Core-owned ``lingtai.kernel.lifecycle_clock.LifecycleClockPort`` by delegating directly to Python's standard wall and monotonic clocks. It is the sole production adapter for that Port. This adapter is portable, not POSIX-specif...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/lifecycle_clock.py
.py
6fbd730f07831868
7.5
9
"""Platform selection and same-process Store resource serialization.""" from __future__ import annotations import contextlib import os import threading from contextlib import ExitStack from pathlib import Path from typing import Iterable from lingtai.kernel.notification_store._mutation_lock import ( Notification...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/notification_store_lock.py
.py
78cbe706fa3f7b9d
7.5
9
"""POSIX production adapter for the Bash-local shell dialect.""" from __future__ import annotations from lingtai.tools.bash._shell_dialect import ( ShellDialect, ShellInvocation, ShellKind, extract_posix_commands, make_invocation_for_kind, ) class PosixBashDialect(ShellDialect): def extract_c...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/bash.py
.py
03cf19ab40ddfb9b
7.5
9
"""POSIX adapter for Bash async state serialization.""" from __future__ import annotations import contextlib import fcntl from pathlib import Path class PosixBashStateLockAdapter: @contextlib.contextmanager def exclusive(self, job_dir: Path): handle = open(job_dir / ".state.lock", "a", encoding="utf-...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/bash_state_lock.py
.py
6d0b758f5822dfb7
7.5
9
"""Exact run-owned execution child for a detached daemon supervisor.""" from __future__ import annotations import json import os import sys from pathlib import Path from threading import Event from .process_identity import process_identity _MAX_CAPSULE_BYTES = 4 * 1024 * 1024 def _read_capsule() -> dict: raw =...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/daemon_execution_child_entrypoint.py
.py
3d6c1d41993216c6
7.5
9
"""Ordinary importable/executable entrypoint for the detached daemon supervisor. ``PosixDaemonSupervisorAdapter.spawn_detached`` launches ``<python_executable> -m lingtai.adapters.posix.daemon_supervisor_entrypoint <encoded-request>``, where ``<encoded-request>`` is the compact deterministic JSON payload produced by `...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/daemon_supervisor_entrypoint.py
.py
c0270d884f80a09f
7.5
9
"""POSIX JSONL event journal backed by the existing SQLite sidecar index.""" from __future__ import annotations from pathlib import Path from typing import Any from lingtai.kernel.event_journal import EventJournalPort, JournalPosition from lingtai.kernel.services.logging import ( CompositeLoggingService, JSON...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/event_journal.py
.py
20ce1db2534b826f
7.5
9
"""POSIX adapter for the daemon-local interactive terminal Port.""" from __future__ import annotations from dataclasses import dataclass import fcntl import os import pty import select import signal import struct import subprocess import threading import termios import time from collections.abc import Callable from l...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/interactive_terminal.py
.py
d4a730e2dc8f3913
7.5
9
"""POSIX resource locks with a one-release legacy `.store.lock` bridge.""" from __future__ import annotations import contextlib import fcntl from pathlib import Path from lingtai.kernel.notification_store._mutation_lock import notification_mutation_lock_path _LEGACY_LOCK_FILE = ".store.lock" class PosixNotificati...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/notification_store_lock.py
.py
a993851fd23313e0
7.5
9
"""POSIX process-incarnation identities used by daemon ownership checks. PID values are reusable. This module deliberately returns ``None`` when the operating system cannot provide a bounded, stable observation; callers must then refuse ownership-sensitive signalling. """ from __future__ import annotations import os...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/process_identity.py
.py
2e9ef62d03c19ea3
7.5
9
"""POSIX process-table scan adapter for the duplicate-launch guard. ``PosixAgentProcessScanAdapter`` implements the Core-owned ``lingtai.kernel.process_scan.AgentProcessScanPort`` with one bounded ``ps -eo pid=,command=`` invocation — a faithful move of the mechanism the CLI host previously performed inline. Any failu...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/process_scan.py
.py
b395152297ca8949
7.5
9
"""POSIX detached-process refresh-watcher adapter. ``PosixRefreshWatcherAdapter`` implements the Core-owned ``lingtai.kernel.refresh_watcher.RefreshWatcherPort`` by encoding a ``RefreshWatcherRequest`` to its compact deterministic JSON wire form (``lingtai.kernel.refresh_watcher.encode_request``) and launching a new i...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/refresh_watcher.py
.py
9c9c0dedcf63646b
7.5
9
"""POSIX process-mechanism adapter for the Core refresh-watcher policy. The outer ``PosixRefreshWatcherAdapter`` still owns the first detached handoff that starts the watcher entrypoint. This adapter owns only the process operations the already-running watcher policy needs while supervising the replacement agent: com...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/refresh_watcher_process.py
.py
f7474a33c17d4e0f
7.5
9
"""POSIX filesystem working-directory lease adapter. ``PosixWorkdirLeaseAdapter`` implements the Core-owned ``lingtai.kernel.workdir_lease.WorkdirLeasePort`` by holding an exclusive, non-blocking ``fcntl.flock`` on ``<workdir>/.agent.lock``. It is the only production lease adapter; Core never constructs it. The concr...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/posix/workdir_lease.py
.py
c8d3f4a6863d55e9
7.5
9
"""Filesystem adapter for one fresh local Project seed.""" from __future__ import annotations import shutil from collections.abc import Callable from pathlib import Path from lingtai.kernel.project import ( ProjectCreationError, ProjectError, ProjectSeed, ProjectWorkspacePort, ) StageValidator = Call...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/project_workspace.py
.py
5eefb2a31d38527c
7.5
9
"""Composition selector for the canonical ``shell`` capability. The implementation package remains ``lingtai.tools.bash`` for PR1 durable and packaging compatibility. Platform identity belongs at this outer selector: :func:`resolve_shell_kind` turns platform + discovered executables + config override (``LINGTAI_SHELL...
Lingtai-AI/lingtai-kernel
src/lingtai/adapters/shell.py
.py
3222c76ae73686f6
7.5
9
""" ai_cache.py — cache Grok estimates per condition_id. The scanner runs every 6h and re-evaluates the same slow-moving event markets, paying for a fresh Grok call each time. Event prices move slowly, so a recent estimate is reusable UNLESS: • it's older than MAX_AGE_SECONDS, or • the market's YES price has moved...
BRKME/Polymarket_insider
ai_cache.py
.py
f6161d7c07b583da
7.64
18
"""Посткалибровка оценок Grok по фактической таблице корзин. Вердикт (n=38): Grok систематически промахивается — в корзине 0.0-0.2 реально YES 100%, в 0.2-0.4 реально 77%. Это измеренная функция ошибки. Мы её применяем как поправку: сырую оценку Grok пересчитываем в откалиброванную по тому, что РЕАЛЬНО случалось в это...
BRKME/Polymarket_insider
calibration_map.py
.py
7e220c7a0674d73e
7.64
18
""" category_exposure.py — tag positions by thesis category and show how much of the bankroll sits in each. Why: all our NO bets are short "the dramatic thing happens". Twenty of them is one big short-vol bet on a calm world — a single crisis flips a correlated cluster at once, and at $15-70 stakes that's the real rui...
BRKME/Polymarket_insider
category_exposure.py
.py
1f53e6b1d5fea306
7.64
18
"""Копи-монитор — финальное звено спортивного копи-трейда. Для каждого кита из ЖИВОГО списка (trusted_whales.json) смотрит свежие сделки через /activity. Копирует только: BUY (не SELL), спорт (детектор из whale_scout), свежий вход (цена ≤3¢ от китовой — иначе edge уже съеден), новое (дедуп по хешу/условию, чтобы не сл...
BRKME/Polymarket_insider
copy_monitor.py
.py
e2e9c17f1fc61f13
7.64
18
import sqlite3 from datetime import datetime, timezone from typing import Dict, Optional, List import os from pathlib import Path import shutil import threading # FIX BUG #2: Persistent database path # Use home directory for persistence across GitHub Actions runs DATA_DIR = Path.home() / ".polymarket_data" DATA_DIR.mk...
BRKME/Polymarket_insider
database_fixed.py
.py
190539b26e079763
7.64
18
from datetime import datetime, timedelta, timezone from typing import Dict, Optional, Tuple import re from functools import lru_cache # FIX BUG #1 & #7: Copy extract_event_date_from_title to avoid circular import # Previously imported from analyzer, causing circular dependency @lru_cache(maxsize=100) def extract_even...
BRKME/Polymarket_insider
event_detector_fixed.py
.py
7fa2afd69b3dc233
7.64
18
# -*- coding: utf-8 -*- """exit_dedup.py — дедупликация exit-сигналов mark_to_market. Баг 15.07: run() слал один и тот же сигнал каждый 2ч-крон, пока позиция открыта (18:27 и 20:19 — идентичные «РЕЖЬ»). Правило: по одной позиции повторный алерт только если (а) действие ЭСКАЛИРОВАЛО (другой action) или (б) прошло ≥ REN...
BRKME/Polymarket_insider
exit_dedup.py
.py
bfdd7e5656d7baf8
7.64
18
"""Leaderboard scout — диагностика спортивных китов через ОФИЦИАЛЬНЫЙ лидерборд. Polymarket сам ведёт лидерборд с фильтром category=SPORTS (docs подтвердили). Отдаёт pnl и vol (НЕ winrate — его нет в API). Компенсируем отсутствие winrate двумя фильтрами эксперта: 1. Консистентность: кит в топе И за WEEK, И за MONTH —...
BRKME/Polymarket_insider
leaderboard_scout.py
.py
0364fb62fd2b3102
7.64
18
"""Раздельный вердикт YES vs NO по РЕАЛЬНЫМ позициям (event_journal). Зачем отдельно от verify_journal: тот считает Brier по калибровочному журналу, где только сырые оценки Grok и НЕТ сторон. Стороны (NO осн. / YES средняя зона) живут в event_journal. Вопрос, на который отвечает этот отчёт: NO получил вердикт на n=...
BRKME/Polymarket_insider
side_split.py
.py
06b947e9c685ffa2
7.64
18
""" Tests for the compact alert format (scan_events._format_alert) and the reasoning/presentation split in event_scanner. The old format repeated the same numbers three times (header, prose paragraph, entry line) across four divider rules. The new contract: • the decision lives in the first line: NO price · edge · d...
BRKME/Polymarket_insider
tests/test_alert_format.py
.py
2b4e5f938239e597
8.14
18
"""Калибровка Grok по корзинам: когда Grok говорит 60-80% YES, как часто YES реально случается? Проверка гипотезы оператора: Grok недооценивает фаворитов, поэтому механический NO против них убыточен.""" import os, sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from v5_weekly_status...
BRKME/Polymarket_insider
tests/test_calibration_buckets.py
.py
eef1995ed2da67a3
8.14
18
"""Посткалибровка: пересчёт сырой оценки Grok по фактической таблице корзин. Таблица копится на резолвах и уточняется. Где данных мало (малый n) — поправка слабее (тянемся к сырой оценке), чтобы не довериться шуму.""" import os, sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from c...
BRKME/Polymarket_insider
tests/test_calibration_map.py
.py
8f4fe6ce77848323
8.14
18
""" Tests for category_exposure.py — tag positions by thesis category and report how much of the bankroll sits in each. The LIMIT itself stays an operator rule (manual mode); this module only provides the visibility so the operator doesn't have to keep a spreadsheet by hand. Run: python -m pytest tests/test_category_e...
BRKME/Polymarket_insider
tests/test_category_exposure.py
.py
74c0dba3967f2c9a
8.14
18
"""Копи-монитор: свежие спортивные входы доверенных китов → копи-алерт. Только BUY, только спорт, только свежий вход (цена ≤3¢ от китовой), только новые (не дублировать уже виденное).""" import os, sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from copy_monitor import copy_signal,...
BRKME/Polymarket_insider
tests/test_copy_monitor.py
.py
288acd1dfb800809
7.14
18
"""Полевой баг 15.08.2026: дневной статус показывал −29% при реальном +2%. Два дефекта: 1. P&L брался из cashPnl — в Polymarket это РЕАЛИЗОВАННЫЙ денежный поток, а не нереализованная прибыль открытой позиции. Само сообщение себе противоречило: «P&L −$25 от $86» и рядом «Позиции: $91» (86 вложено + 91 стоит = +5,...
BRKME/Polymarket_insider
tests/test_daily_status_pnl_side.py
.py
fe935cdbea7bf100
8.14
18
"""Полевой баг 03-05.08.2026: daily_status падал 3 дня подряд с TypeError: can't compare offset-naive and offset-aware datetimes. Polymarket отдаёт endDate в двух форматах — часть с 'Z' (aware), часть без (naive). Парсинг обеих проходил, но sorted() сравнивал их между собой и падал. Все даты должны приводиться к aware...
BRKME/Polymarket_insider
tests/test_daily_status_tz_mix.py
.py
17c9e6cc9da42cfa
8.14
18
""" Tests for passing market description + resolution date into the estimator, so Grok can see resolution rules (the source of linked/grouped-market traps) instead of guessing from the question title alone. Run: python -m pytest tests/test_estimator_context.py -v """ import os import sys sys.path.insert(0, os.path.di...
BRKME/Polymarket_insider
tests/test_estimator_context.py
.py
55899ebf24964180
8.14
18
""" Tests for fill_matcher.py — auto-fill actual entry price & stake from the Polymarket Data API by matching our journal positions to real on-chain trades. Shapes are taken from the live /activity response for our address: trade = {proxyWallet, conditionId, side, outcome, outcomeIndex, size, price, usdcS...
BRKME/Polymarket_insider
tests/test_fill_matcher.py
.py
ce1addeea27b8b7d
8.14
18
"""Stable public API errors that never expose provider or server internals.""" from __future__ import annotations from typing import Any from pydantic import BaseModel, Field class ErrorDetail(BaseModel): code: str = Field(min_length=2, max_length=80) message: str = Field(min_length=2, max_length=300) ...
roberthuynh/dau-tones
api/dau/errors.py
.py
58fcdd2d6ca2f3dc
7.48
8
"""Runtime settings and repository paths. All OpenAI access stays server-side. Importing this module never creates a client or requires a key, which keeps the offline product path cold-start safe. """ from __future__ import annotations import os from pathlib import Path API_ROOT = Path(__file__).resolve().parents[1...
roberthuynh/dau-tones
api/dau/settings.py
.py
80fca03d9572e95f
7.48
8
import configparser import json import os import socket import subprocess import time from functools import cached_property, lru_cache from pathlib import Path from openpilot.cereal import log from openpilot.common.utils import sudo_read, sudo_write from openpilot.common.gpio import gpio_set, gpio_init, get_irqs_for_a...
zoompilot/zoompilot
openpilot/common/hardware/comma/hardware.py
.py
d357b90f878ef7b8
7.5
9
//! #830 negative fixture: a missing empirical fixture serializes as //! `UNAVAILABLE`, never `PASS`. //! //! The register's `build` level is harness-built (structural) status. An //! empirical verdict is a separate axis, and its non-vacuity rule is that an //! absent, CID-bound fixture cannot mint a `PASS` — the RF-29...
UOR-Foundation/uor-r4
crates/repo-conformance/tests/empirical_absence.rs
.rs
4f239f44db6b8e16
7.09
14
//! #844 (S4 item A) — compositional-planning benchmark constitution and typed //! state/action reference semantics. Frozen contract: //! `docs/compositional_planning_spec_844.md`. //! //! This is the machine-checked record for #844. Increment 1 (this file) freezes //! the `s4-compositional-reasoning` benchmark constit...
UOR-Foundation/uor-r4
crates/uor-r4-api/tests/compositional_planning_spec_844.rs
.rs
c8b1376d3097bb70
7.09
14
"""Shared MuJoCo model-state initialization helpers.""" from __future__ import annotations from collections.abc import Iterable, Mapping import mujoco import numpy as np # Joint qpos widths by mjtJoint enum value: free=7, ball=4, slide=1, hinge=1. _QPOS_WIDTH = {0: 7, 1: 4, 2: 1, 3: 1} def _is_joint_position_actu...
OpenGHz/auto-atomic-operation
auto_atom/basis/mjc/model_initialization.py
.py
9a24b4abcb41a8e4
7.42
6
"""Door latch callback backed by a switchable MuJoCo joint constraint.""" from __future__ import annotations from typing import Literal import mujoco from pydantic import ( BaseModel, ConfigDict, NonNegativeFloat, PositiveFloat, model_validator, ) class DoorLatchConfig(BaseModel, frozen=True): ...
OpenGHz/auto-atomic-operation
auto_atom/callbacks/door_latch.py
.py
f6318682cd4533ad
7.42
6
"""Config-loading utilities that read YAML/Hydra and emit plain Python types. This module is the single boundary between OmegaConf/Hydra and the rest of the codebase. Everything outside this module (and the runner entry-point layer) operates on plain ``dict`` / ``list`` / Pydantic models, never on ``DictConfig`` / ``L...
OpenGHz/auto-atomic-operation
auto_atom/config_loader.py
.py
473c3d16c3e38a2e
7.42
6
"""EEF mapper that converts between raw joint qpos/ctrl and finger-pad distance. Works for any parallel-linkage gripper where the finger opening can be measured as the Euclidean distance between two geom centers. At ``bind()`` time the mapper sweeps the actuator range, records the (qpos, finger_dist) curve, and build...
OpenGHz/auto-atomic-operation
auto_atom/mappers/finger_distance.py
.py
2134ee3ae52744ef
7.42
6
"""Backend-independent geometry for partially constrained pose goals. The task configuration layer describes axes in named coordinate frames, while motion backends consume concrete world-frame orientations. This module keeps the geometry between those layers independent of a simulator or controller. All quaternions u...
OpenGHz/auto-atomic-operation
auto_atom/pose_goal.py
.py
2210480851e51354
7.42
6
"""Runtime adapter registry for declarative scene layers.""" from __future__ import annotations from collections.abc import Callable from ..config import AssetAssemblyLayerConfig from ..contracts import SceneAssembler, SceneContribution AssetAdapter = Callable[[AssetAssemblyLayerConfig], SceneContribution] _ASSET_A...
OpenGHz/auto-atomic-operation
auto_atom/scene_composition/adapters/__init__.py
.py
0442a4c35dad2bb7
7.42
6
import logging import re from typing import Any import httpx from helpers import env_config from helpers.logging import MAIN_LOGGER_NAME from helpers.user_agent import USER_AGENT logger = logging.getLogger(MAIN_LOGGER_NAME) _TIMEOUT = 20.0 _CSRF_RE = re.compile(r'name="ncsrf"\s+value="([a-f0-9]+)"') _DOWNLOAD_LINK...
DweskZ/EcuDataMCP
helpers/anda_client.py
.py
0ce80898fbb296c9
7.56
12
"""Client for Banco Central del Ecuador's BCEData statistical API. BCEData (https://contenido.bce.fin.ec/bcedata/) is a JS grid app built on top of a WordPress plugin (bcedata-grid). It isn't publicly documented as an API, but inspecting its own network traffic shows it's backed by a clean, versioned, public REST name...
DweskZ/EcuDataMCP
helpers/bce_client.py
.py
50dd193c4ed54c43
7.56
12
"""Simple in-memory TTL cache for hot, rarely-changing API responses.""" from __future__ import annotations import time from collections.abc import Hashable from typing import Any class TtlCache: def __init__(self, ttl_seconds: float = 3600.0, max_entries: int = 256) -> None: self._ttl = ttl_seconds ...
DweskZ/EcuDataMCP
helpers/cache.py
.py
b1ddb908b0b77c30
7.56
12
"""Helpers to return either human text or JSON from MCP tools.""" from __future__ import annotations import json from collections.abc import Callable from typing import Any def normalize_format(fmt: str | None) -> str: value = (fmt or "text").strip().lower() return "json" if value == "json" else "text" de...
DweskZ/EcuDataMCP
helpers/format_out.py
.py
69a4ef9729a9ef30
7.56
12
"""Client for the Instituto Geofísico EPN (IG-EPN) public earthquake feed. The IG-EPN publishes machine-readable earthquake exports as flat CSV, but the exact column names/order are not documented and have been observed to differ across sources: the live map feed at https://www.igepn.edu.ec/portal/eventos/www/events.c...
DweskZ/EcuDataMCP
helpers/igepn_client.py
.py
b3e0e9a358cff746
7.56
12
"""SSRF guard for downloading URLs sourced from external, untrusted metadata. `preview_resource_data` downloads whatever URL a CKAN resource's `url` field contains -- and that field is set by whoever published or last edited that dataset on the portal, not by this codebase. A malicious or compromised publisher account...
DweskZ/EcuDataMCP
helpers/safe_download.py
.py
7d8d3ef6bb54042c
7.56
12
"""Client for the SRI open datasets page (https://www.sri.gob.ec/datasets). The SRI publishes ~130 direct download links (CSV/XLSX/ZIP) plus variable dictionaries on a single stable HTML page — it isn't in the CKAN portal's DataStore, so those files aren't reachable through search_datasets. The page is a Liferay CMS l...
DweskZ/EcuDataMCP
helpers/sri_client.py
.py
9b12f4e3481a158c
7.56
12
"""Query layer over the Supercías financial-ranking dataset (bi_ranking.csv). Distinct from helpers/supercias_client.py's company directory: this is the "Ranking" dataset (https://appscvsmovil.supercias.gob.ec/ranking/reporte.html), derived from real balance-sheet filings — revenue, assets, equity, profit, and ~38 fin...
DweskZ/EcuDataMCP
helpers/supercias_financials.py
.py
d6e2514425cb634a
7.56
12
import os import ssl from urllib.parse import urlparse # Portal domains known to ship an expired/broken cert. Keep this narrow so # third-party resource hosts are never silently downgraded. _INSECURE_TLS_HOST_SUFFIXES = ( "datosabiertos.gob.ec", "datosabiertos.presidencia.gob.ec", "mercadodevalores.superci...
DweskZ/EcuDataMCP
helpers/tls.py
.py
04a7bc4a9ab9b9d5
7.56
12
from mcp.server.fastmcp import FastMCP def register_workflow_prompts(mcp: FastMCP) -> None: @mcp.prompt( name="explorar_datos", title="Explorar datos abiertos", description="Guía para encontrar y previsualizar datasets del portal CKAN de Ecuador.", ) def explorar_datos(tema: str = ...
DweskZ/EcuDataMCP
prompts/workflows.py
.py
e00d325695a058b3
7.56
12