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 combined (playlist/feed) dataset builds — merge, failures, totals, resume. Offline: source ``run`` closures slice the committed fixture WAV via the real ffmpeg path; network/transcription is never touched (injected fetchers). """ import json from pathlib import Path import pytest from hearsay.dataset.b...
mudassar531/hearsay
tests/test_dataset_combined.py
.py
7b43c94290cff9ee
8.14
18
"""Tests for the markdown renderer — the output format is the product.""" from hearsay.models import Chapter, Document, Paragraph, Section, SourceMetadata from hearsay.render import render_markdown from hearsay.timefmt import format_timestamp def make_doc(**overrides: object) -> Document: meta = SourceMetadata( ...
mudassar531/hearsay
tests/test_render.py
.py
7c88bbd2cc36c8f1
8.14
18
"""Shared apt/dpkg advisory base for the Debian and Ubuntu providers. Both classify installed SOURCE packages against cached rows the same way (dpkg for version comparison + source mapping); only the *fetch/parse* of their tracker differs. Subclasses implement ``is_present`` + ``refresh`` and set ``source``. """ from...
pasadoorian/fettle
fettle/advisories/apt_base.py
.py
88dbc7b1c82065d9
7.45
7
"""SQLite cache for advisory data — ``~/.cache/fettle/advisories.db``. A rebuildable CACHE (PLAN.md §19.8): if it's wiped or the schema version changes, the next refresh repopulates it; nothing authoritative lives only here. ``sqlite3`` is Python stdlib, so this keeps fettle's zero-runtime-dependency core intact. """ ...
pasadoorian/fettle
fettle/advisories/db.py
.py
ca5b6860f4b2c926
7.45
7
"""OSV.dev client — the shared engine for the language-ecosystem provider and (later) Ubuntu pending (PLAN.md §19.10). ``querybatch`` the installed packages (cheap — returns vuln IDs + ``modified`` only), then fetch each vuln's full record, cached in SQLite and synced incrementally off ``modified`` (first run heavier,...
pasadoorian/fettle
fettle/advisories/osv.py
.py
73d1a3d9b87d92e5
7.45
7
"""OSV language-ecosystem provider (PLAN.md §19.10). Flags vulnerable **Python (PyPI)**, **Node (npm)** and **Rust (crates.io)** packages your distro does **not** manage — virtualenvs, uv/pipx apps, per-user installs, bun/nvm trees, ``cargo install``ed crates — which no OS tracker can see. Queries OSV.dev (via the sha...
pasadoorian/fettle
fettle/advisories/osv_source.py
.py
3845a518227574a3
7.45
7
"""Minimal Anthropic ``/v1/messages`` client over ``urllib`` — no SDK dependency. Keeps fettle zero-dep: handles auth, the POST, server-tool ``pause_turn`` continuation, and light retry by hand. Returns the final message dict, or ``None`` on any failure so the Upgrade Checker can degrade to a plain package diff when t...
pasadoorian/fettle
fettle/ai/client.py
.py
e8e4bd8a2f91e6ba
7.45
7
"""System snapshot for the Upgrade Checker — the payload we send to the model. Gathers ``inxi -SCGaxxa`` (colour off), os-release, kernel, and the pending-upgrade list into one compact, factual payload. Hardware **serials / MAC addresses / UUIDs are redacted before anything leaves the machine** (privacy: send redacted...
pasadoorian/fettle
fettle/ai/snapshot.py
.py
57ab1c6b6546759f
7.45
7
"""AUR audit (`-A`) — the update.sh-style health/metrics table. Reproduces ``update.sh``'s ``aur_audit``: a per-package metrics table (age, votes, out-of-date, orphan, recently-changed), a not-found-in-AUR list, and the maintainer-change (re-adoption) section — printed and saved to ``~/aur-audit.txt``. Provenance/heal...
pasadoorian/fettle
fettle/aur/audit.py
.py
d095513255d5cb40
7.45
7
"""Shared AUR helpers used by the audit (`-A`), the IoC scan (`-S`), and the normalized `pkg-audit` provider — the Python analogue of ``lib/aur-common.sh``. Kept dependency-light (only ``command`` + the IOC/util helpers) so any of the three entry points can pull the installed-foreign set, an IOC feed, or run the JS-ca...
pasadoorian/fettle
fettle/aur/common.py
.py
3570bd2d28b4276e
7.45
7
"""IOC feed fetch + TTL disk cache (lenucksi/aur-malware-check). Replaces ``aur_fetch_bad_accounts`` / ``aur_fetch_bad_packages`` / ``aur_fetch_bad_npm`` (curl + jq). Each campaign file is cached on disk with a TTL so a bulk audit doesn't refetch per package; a failed fetch falls back to any stale cache rather than si...
pasadoorian/fettle
fettle/aur/ioc.py
.py
cd4667a1c0292d2d
7.45
7
"""AUR RPC v5 client — replaces ``aur_query_rpc`` (curl) + the ``jq`` parsing. Pure stdlib (urllib + json). POSTs the package list so a large set doesn't blow the URL-length limit, and degrades to ``[]`` on any network/parse failure so callers never mistake "offline" for "all clear". """ from __future__ import annota...
pasadoorian/fettle
fettle/aur/meta.py
.py
cdb0f88790e9bca1
7.45
7
"""Candidate lists for shell completion. The shell script that drives this is deliberately tiny (see ``contrib/fettle.bash``) — it knows nothing about fettle's options and just asks:: fettle --complete <cword> -- <words...> where ``cword`` is bash's ``COMP_CWORD`` and ``words`` is ``COMP_WORDS`` verbatim, progra...
pasadoorian/fettle
fettle/completion.py
.py
3e72cbc559e27e08
7.45
7
"""Compromise indicators — *has this machine already been compromised?* A different question from `hardening-audit`, and deliberately a different action. Hardening asks whether the system is **configured** safely; this asks whether something is **already here**. The two have different answers, different audiences and ...
pasadoorian/fettle
fettle/compromise/__init__.py
.py
a2d80b0f62873672
7.45
7
"""The `compromise-check` action — is there evidence something is already here? Read-only, and **read-only is not the same as rootless**: most of what this action wants to read is root-only, which is the distinction `cli._READ_ONLY_BUT_NEEDS_ROOT` exists to carry. It is classified there alongside `sys-audit` and `pkg-...
pasadoorian/fettle
fettle/compromise/audit.py
.py
e2f87c56bd1d7139
7.45
7
"""Scheduled jobs — cron, anacron and `at`. Cron persistence is still the most common way Linux malware survives a reboot, for the unglamorous reason that it is simple, it works everywhere, and nobody looks at it. This module answers the same question the systemd half asks: *what is scheduled to run that nobody sancti...
pasadoorian/fettle
fettle/compromise/cron.py
.py
74ddb14f0c0725eb
7.45
7
"""Which accounts are worth looking at, and which are noise. The user-scope half of the persistence checks has to walk every real user's ``~/.config/systemd/user/``, because the non-root branch of the June 2026 AUR wave persisted there rather than in ``/etc/systemd/system``. "Every user" is the trap: **wopr has 32 `ni...
pasadoorian/fettle
fettle/compromise/users.py
.py
8ca44ae591e28ded
7.45
7
"""Distro detection: parse /etc/os-release and map to a :class:`PackageBackend`. Detection uses ``ID`` first, then falls through the ``ID_LIKE`` chain, so derivatives (Linux Mint, Pop!_OS, KDE neon, EndeavourOS, ...) resolve to their parent family's backend with no new code. """ from __future__ import annotations fr...
pasadoorian/fettle
fettle/distro.py
.py
5336b844fbeaf789
7.45
7
"""AppArmor: is it confining anything, or is it just switched on? "AppArmor is enabled" is the number everyone quotes and it says very little. Measured on three ordinary installs, none of them tuned by hand: ============================ ====== ======= ======== ========== ============= host ...
pasadoorian/fettle
fettle/hardening/axes/apparmor.py
.py
09545b2b5ae2f0e1
7.45
7
"""TLS certificates — is anything this host serves with expired, or about to be? **The trust store is deliberately excluded, and that is the whole design.** ``/etc/ssl/certs`` on the reference machine is 121 root CAs, symlinked out of the ``ca-certificates`` bundle. Some of them expire; that is normal, it is the distr...
pasadoorian/fettle
fettle/hardening/axes/certs.py
.py
05caa0e663c7ea5b
7.45
7
"""Filesystem hygiene — can a local user tamper with shared directories? Two questions, both answered by stat and ``/proc/mounts``, with no directory walk: 1. **Is a world-writable directory missing its sticky bit?** Without it, any local user can delete or rename any other user's files there, regardless of who ow...
pasadoorian/fettle
fettle/hardening/axes/filesystem.py
.py
7a96b7cd5d8ce162
7.45
7
#!/usr/bin/env python3 # /// script # requires-python = ">=3.12,<3.13" # dependencies = ["pyyaml"] # /// """ Base configuration loader for Claude Code hooks. This module provides standardized YAML/JSON config file loading with sensible defaults, error handling, and type safety. Usage in hooks: import sys from...
alex-feel/claude-code-artifacts-public
hooks/library/hook_config_loader.py
.py
f34f8d8e53535911
7.42
6
#!/usr/bin/env python3 # /// script # requires-python = ">=3.12,<3.13" # dependencies = ["pyyaml", "desktop-notifier>=6.0.0"] # /// """ Desktop Notification Hook for Claude Code. Sends a desktop notification for configured Notification event types. By default only idle_prompt (Claude Code is waiting for user input aft...
alex-feel/claude-code-artifacts-public
hooks/library/idle_notification.py
.py
d304061fdf9d77a6
7.42
6
#!/usr/bin/env python3 # /// script # requires-python = ">=3.12,<3.13" # dependencies = ["pyyaml"] # /// """ Claude Code Hook: Serena Tool Enforcement (Command Hook, advisory). This hook is the fast, deterministic first tier of Serena tool steering, and it is NON-BLOCKING: it never denies a search. For Search/Grep cal...
alex-feel/claude-code-artifacts-public
hooks/library/serena_tool_enforcement.py
.py
cd51d9dd724d7b87
7.42
6
#!/usr/bin/env python3 """ Validate XML-style semantic tags in Markdown files. This script checks for common XML tag errors in Markdown files: - Unclosed tags (<role> without </role>) - Mismatched tags (<role> closed by </constraints>) - Improper nesting (<outer><inner></outer></inner>) It skips content within fenced...
alex-feel/claude-code-artifacts-public
scripts/validate_xml_tags.py
.py
816d1266d7201360
7.42
6
"""The Supernotify integration""" from __future__ import annotations import logging from typing import TYPE_CHECKING import voluptuous as vol from homeassistant.const import CONF_NAME, SERVICE_RELOAD from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.reload import async_integration_y...
rhizomatics/supernotify
custom_components/supernotify/__init__.py
.py
f4ec87f21b926fe3
7.65
19
from __future__ import annotations import copy import logging import string import time import typing import uuid from typing import Any, cast from homeassistant.components.notify.const import ATTR_MESSAGE, ATTR_TITLE from homeassistant.helpers.template import is_template_string from jinja2 import TemplateError from...
rhizomatics/supernotify
custom_components/supernotify/envelope.py
.py
2cc96fa64dc33804
7.65
19
"""Repairs for supernotify's legacy `notify: - platform: supernotify` YAML block. The config entry is the sole, unconditional owner of registering notify.supernotify (see async_setup_entry in __init__.py) - delivery/transports/scenarios/recipients/cameras/ action_groups/links/snooze now live under a top-level `superno...
rhizomatics/supernotify
custom_components/supernotify/repairs.py
.py
bae4f265924c1fdf
7.65
19
from __future__ import annotations import logging from typing import TYPE_CHECKING, Any from homeassistant.const import ATTR_ENTITY_ID # ATTR_VARIABLES from script.const has import issues from custom_components.supernotify.const import ( OPTION_MESSAGE_USAGE, OPTION_SIMPLIFY_TEXT, OPTION_STRIP_URLS, ...
rhizomatics/supernotify
custom_components/supernotify/transports/notify_entity.py
.py
364785bed03418f9
7.65
19
"""Telegram transport for SuperNotify. Sends push notifications via Telegram using Home Assistant's telegram_bot integration. Supports text messages, photos (with optional captions), and inline action buttons. Uses telegram_bot service for granular control over formatting, media types, and protection. Supported data ...
rhizomatics/supernotify
custom_components/supernotify/transports/telegram.py
.py
9d23705170a174b7
7.65
19
"""Helpers for the panel JS URL with cache busting. The HA frontend service worker caches static panel assets aggressively. To avoid having to bump a hard-coded ``?v=N`` query string on every bundle deploy we fingerprint the bundle's mtime and append it to the URL. Re-registering the panel (HA restart or config entry...
kingchddg901/Vacuum_Agent
custom_components/eufy_vacuum/_frontend_url.py
.py
ea43dc65a772e70a
7.52
10
"""Brand selection — which adapter registrar runs for a given vacuum. THE single place that answers "what brand is this vacuum?". Before this module the answer was a two-arm ``if/else`` in ``__init__.py`` with Eufy as the unconditional ``else``, which had four costs: - Eufy was a *structural* default, not a declared ...
kingchddg901/Vacuum_Agent
custom_components/eufy_vacuum/adapters/brands.py
.py
f9f55610e1bc9f4f
7.52
10
""" Stored adapter config loader for the ha_vacuum_manager framework. Reads stored adapter configs from integration storage and registers them with the adapter registry at startup. ⚠ was: "written by the UI wizard" — there is no UI wizard (ledger A27, corrected 2026-08-24). ``config_flow.py`` contains no reference to...
kingchddg901/Vacuum_Agent
custom_components/eufy_vacuum/adapters/config_loader.py
.py
6f1ea874cb262afc
7.52
10
"""Roborock dock identification from the HA device registry. Roborock splits one vacuum across TWO devices in a single config entry: the robot (`identifiers={("roborock", duid)}`) and the dock (`identifiers={("roborock", f"{duid}_dock")}`). The dock device carries ``model_id=str(dock_type.value)``, or the string ``"Un...
kingchddg901/Vacuum_Agent
custom_components/eufy_vacuum/adapters/roborock/dock.py
.py
92c58dbf0ccd3b22
7.52
10
"""Session-transcript adapters. Each adapter maps one agent's native transcript format to the normalized event stream that `emit.build_trace` consumes — so the trace-building core stays agent-agnostic and a new agent is just a new module here. An adapter module exposes: NAME : str IMPLEMENTED : bool defau...
imandra-ai/ponens
cli/ponens/adapters/__init__.py
.py
3dfab5c1eca44f74
7.48
8
"""`ponens agent` — print the agent workflow guide. The guide is embedded here (not a repo file) so an agent with only the CLI installed can self-onboard: `ponens agent` prints how to produce a good trace, `ponens agent --review` prints the reviewing-agent protocol. The fuller canonical versions live in AGENT_PROMPT.m...
imandra-ai/ponens
cli/ponens/agent.py
.py
9d1e52156fb3ab53
7.48
8
"""HTTP client for the hub API.""" import json import os import urllib.request import urllib.error DEFAULT_HUB = "http://localhost:3001" def hub_url() -> str: return os.environ.get("PONENS_HUB_URL", DEFAULT_HUB) def api(method: str, path: str, body: dict | None = None) -> dict | list | str: """Make an API...
imandra-ai/ponens
cli/ponens/client.py
.py
778b7489ad232ffa
7.48
8
"""Engine adapters for reproduction replay (Gap 4). A ReproductionBundle names an ``execution_environment``; an engine adapter turns that environment into a concrete, safe replay command and PREFLIGHTS whether the engine is actually runnable here (binary on PATH, credentials present). Pluggable — a new engine (Lean, Z...
imandra-ai/ponens
cli/ponens/engines.py
.py
7e3697b733806c8c
7.48
8
"""PROV-O interchange — export a ponens trace as W3C PROV (PROV-JSON). Maps the trace's typed-artifact lineage onto the standard provenance vocabulary so a trace interoperates with the PROV tooling ecosystem. The mapping is the normative profile in `spec/PROV_INTERCHANGE_v0_1.md`; in brief: artifact ...
imandra-ai/ponens
cli/ponens/prov.py
.py
422db75313239e44
7.48
8
"""Shared fixtures for E2E tests.""" import os import signal import subprocess import sys import time import urllib.request import urllib.error import pytest APP_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "app") # Preferred port for tests; falls back to existing dev server on 3001 PORTS_TO_TRY = [309...
imandra-ai/ponens
cli/tests/conftest.py
.py
204399da66cdf8e3
7.98
8
"""`ponens agent` — the embedded, self-onboarding workflow guide, and a contract test that every command the guide tells an agent to run actually exists in the CLI (so the guide can't drift).""" import argparse import re import types from ponens.agent import cmd_agent, GUIDE, REVIEW_GUIDE from ponens.cli import build...
imandra-ai/ponens
cli/tests/unit/test_agent.py
.py
f7a395f615d2d5ed
7.98
8
"""The faithfulness gate in `ponens trace check` (_faithfulness_findings).""" from ponens.trace import _faithfulness_findings def _trace(goal): return {"trace_id": "t", "actions": [], "artifacts": [], "residuals": [], "goals": [goal]} def test_no_goals_no_findings(): assert _faithfulness_findings({"trace_i...
imandra-ai/ponens
cli/tests/unit/test_check_faithfulness.py
.py
2b177305878e3dc2
7.98
8
"""Unit tests for the Codex CLI rollout adapter.""" from ponens.adapters import codex from ponens.emit import build_trace from ponens.trace import validate_trace def _resp(payload): return {"type": "response_item", "timestamp": "2026-05-01T00:00:00Z", "payload": payload} ENTRIES = [ {"type": "session_meta"...
imandra-ai/ponens
cli/tests/unit/test_codex_adapter.py
.py
3a51d69cc2fa6cc6
7.98
8
"""Engine adapters for replay (Gap 4): matching, the replay command (explicit recipe wins over the default), preflight, the generic fallback, and adapter registration.""" from ponens import engines def test_imandrax_matches_by_env_id_name_or_component(): a = engines.ImandraXAdapter() assert a.matches({"enviro...
imandra-ai/ponens
cli/tests/unit/test_engines.py
.py
136d4d56e6d9cea6
7.98
8
"""Beacon dependency-injection config. Beacon is framework-agnostic (the "born outside server.py" constraint). It does NOT import Flask, server.py, or the route blueprints. Instead server.py wires the few shared functions it needs through `configure()` at startup (called from mc/blueprints/beacon_routes.wire()). Submo...
ronle/clayrune
beacon/_config.py
.py
720856434e21ed39
7.56
12
"""Beacon aggregator — compose the cross-project digest. Reads every persisted heartbeat (the narrative), overlays LIVE state from agent_sessions (running/resting + plan/question blockers) at read time, computes `stale` from absence of signal, and sorts by attention need. Core principle: suppression, not display. Ink...
ronle/clayrune
beacon/aggregator.py
.py
aadfd8004ee93499
7.56
12
"""Beacon write path — piggyback existing rituals, never add a new discipline. The expensive field is the brief, so it regenerates only on session-close (the existing Scribe trigger) or explicit refresh — never on dashboard load. Live state (running/asking) is read-time-overlaid by the aggregator from agent_sessions, ...
ronle/clayrune
beacon/hooks.py
.py
4e487ed0c5b37c19
7.56
12
"""Beacon heartbeat schema — field caps + normalization. The field caps are load-bearing per the brief: they are what keep the expanded view a *briefing* and not a wall of text. `done`/`standing`/`next` are hard 1-2-sentence fields; `headline` is one verb-led line. """ # Blocker taxonomy (brief §1.2). `stale` is comp...
ronle/clayrune
beacon/schema.py
.py
525a4e53eea1a5dd
7.56
12
"""Beacon heartbeat persistence — JSON-on-disk, last-write-wins. Heartbeats live at `data/beacon/<id>.json` — OUTSIDE DATA_DIR (data/projects/) by deliberate choice: DATA_DIR's load_projects() treats every stray *.json as a project (the load-bearing DATA_DIR-pollution rule), so per-project sidecar state belongs outsid...
ronle/clayrune
beacon/store.py
.py
95a82b27c06bee56
7.56
12
"""Canonical-JSON (RFC 8785 / JCS) helpers. PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. Used to recompute envelope_canonical_sha256 and verify the client-side hash matches. See `02-attestation-protocol.md` §2 + §7. This is a SKELETON wrapping rfc8785. """ from __future__ import an...
ronle/clayrune
control_plane/app/canonical.py
.py
f387c5441f8920b5
7.56
12
"""The suspension denylist — the edge's immediate kill switch. PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. The session JWT's 30-minute TTL is a *deliberate* revocation lag. For a cancellation that is fine — nobody is harmed because a cancelled user kept their dashboard for another ...
ronle/clayrune
control_plane/app/denylist.py
.py
818beb25468d53e1
7.56
12
"""The entitlement predicate. One function, two callers. PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. `is_entitled()` is the single source of truth for "may this user have remote access right now". Per `clayrune-cloud/docs/BILLING_DESIGN.md` §3 it is enforced at exactly **two** chok...
ronle/clayrune
control_plane/app/entitlement.py
.py
b8f995347a9ccb7f
7.56
12
"""Attestation verification — the 14+1-step checklist. PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. Implements `docs/remote-access/02-attestation-protocol.md` §7.4. Each step's failure produces a stable error code (see `error_codes.md`). Steps run in order; first failure short-circu...
ronle/clayrune
control_plane/app/verify.py
.py
b6cfa8347ce3d81f
7.56
12
"""Bring an enrolled user's tunnel online — Path A (no attestation yet). PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. Quick demo: spawns the bundled `cloudflared.exe` with the tunnel token issued at /v1/enroll time, so traffic to https://<username>.clayrune.io actually reaches your ...
ronle/clayrune
control_plane/bring_tunnel_up.py
.py
14f091212bb46f3c
7.56
12
"""Wire up a custom domain (e.g. api.clayrune.io) to a Cloud Run service. PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. Adds two CF resources, idempotently: 1. Proxied CNAME `<name>.<zone>` -> `<run-app-host>` 2. An entry in the zone's `http_request_origin` ruleset that rewrites ...
ronle/clayrune
control_plane/configure_custom_domain.py
.py
6d15674f866c41dc
7.56
12
"""First real enrollment demo. PROPRIETARY AND CONFIDENTIAL. Copyright (c) 2026 Clayrune. All rights reserved. Drives a single end-to-end /v1/enroll against REAL Cloudflare + REAL Firestore. This is the milestone validation: if it succeeds, the entire client/CP/CF chain works. Usage from PowerShell: $env:CLOUDF...
ronle/clayrune
control_plane/first_enroll_demo.py
.py
f030e428e204cbd4
7.56
12
"""Marketing-site preview (dev convenience). Extracted verbatim from server.py — IMPROVEMENT_PLAN_V2.md P1-1 / docs/SERVER_SPLIT_PLAN.md Tier 1 (step a). Behavior unchanged: same routes, same logic, same `Path(__file__).parent` resolution (this module lives in the repo root next to server.py, and is co-bundled at the ...
ronle/clayrune
marketing_preview.py
.py
186abc4b3ec22d37
7.56
12
"""jobContext Desktop entrypoint. Runs the server in single-user, local-first desktop mode: - All mutable state lives in the per-OS app-data dir (lib/app_dirs.py); nothing is written next to the executable. - SQLite is the sole datastore (SQLITE_ONLY=1), auth middleware is off (no API key ⇒ local admin), ...
JustLikeFrank3/jobContextMCP
desktop_main.py
.py
6016408c45cc7b24
7.45
7
"""Golden dataset loading for Layer 3. The manifest (``golden_dataset.json``) is committed; the JD / reference files it points to are personal data living in the user's workspace and are resolved at run time. A missing file is reported per-entry, never fatal for the whole suite. """ from __future__ import annotations ...
JustLikeFrank3/jobContextMCP
evals/golden.py
.py
20c7d4539a0d9603
7.45
7
"""Shared results ingest — persist eval payloads and mirror gauges. Used by two producers with identical semantics: the HTTP ingest route (``POST /api/evals/results``, results pushed from a CLI run elsewhere) and the ``run_evals`` control-plane executor (suite executed server-side). Both run inside a partition context...
JustLikeFrank3/jobContextMCP
evals/ingest.py
.py
1848f9f4205ab0f2
7.45
7
"""Layer 3 — adversarial LLM judge. A separate model call receives the JD, a master-resume excerpt, and the generated output, and returns structured per-dimension scores. The judge is prompted to find weaknesses — hallucinations, weak bullets, missing keywords, voice drift — not to be generous. Calls go through ``lib...
JustLikeFrank3/jobContextMCP
evals/judge.py
.py
d45a973b309e25a8
7.45
7
"""Layer 2 — output-quality rubrics. Each rubric scores an output 1–5 per dimension. Applied by a human reviewer or by the Layer 3 judge; either way the scores land in the same schema and the same passing thresholds apply. """ from __future__ import annotations from dataclasses import dataclass RESUME_RUBRIC: dict[s...
JustLikeFrank3/jobContextMCP
evals/rubrics.py
.py
fd97d4867b7944c2
7.45
7
"""Layer 3 — variance analysis across N judge runs. LLM outputs are non-deterministic; the same input can produce different quality on different runs. These metrics quantify that risk per the variance-analysis table in docs/eval-framework.md: Mean score — mean below the resume rubric threshold → flag for...
JustLikeFrank3/jobContextMCP
evals/variance.py
.py
4c481a10ace0506a
7.45
7
"""Desktop deployment helpers: mode detection, app-data dir, frozen resources. The desktop distribution (Tauri shell + PyInstaller sidecar) runs the server in single-user, local-first mode. Installed apps live in read-only locations, so all mutable state must go to the per-OS app-data directory: macOS ~/Libra...
JustLikeFrank3/jobContextMCP
lib/app_dirs.py
.py
f16e6b9eb3bf3de2
7.45
7
"""Application-level encryption for secrets at rest. Protects sensitive per-user values (OAuth access/refresh tokens, and any other secret a tool chooses to wrap) before they are written to the per-user SQLite DB. The encryption key is app-wide infrastructure: it lives only in the k8s secret / Key Vault (env ``APP_ENC...
JustLikeFrank3/jobContextMCP
lib/crypto.py
.py
5b4108a35e9e9efe
7.45
7
"""Persistent dismissals for derived to-do surfaces. The follow-up queue and Home priorities are DERIVED views over people.json and the application log — there is no row to delete when an entry stops making sense (a ghosted recruiter, a priority that's just wrong). This module is the per-user overlay that records "sto...
JustLikeFrank3/jobContextMCP
lib/dismissals.py
.py
48c34b0b71a5949e
7.45
7
import datetime import re from lib import config # Windows-illegal filename characters plus control chars; macOS/Linux allow # these, so files named there can be unwritable on a Windows sync peer. _ILLEGAL_FILENAME_CHARS = re.compile(r'[<>:"/\\|?*\x00-\x1f]') def sanitize_filename(name: str) -> str: """Make a s...
JustLikeFrank3/jobContextMCP
lib/helpers.py
.py
467e6a423f78be49
7.45
7
import json import os import datetime from pathlib import Path # When USE_SQLITE=1 (or true/yes), _load_json reads from SQLite instead of JSON. # By default writes go to BOTH SQLite and JSON (dual-write audit trail). # Set SQLITE_ONLY=1 to disable JSON writes once SQLite is the sole source of # truth (e.g. in producti...
JustLikeFrank3/jobContextMCP
lib/io.py
.py
dde4b24c4c04b48c
7.45
7
"""baseline schema Revision ID: 0001_baseline_schema Revises: Create Date: 2026-05-17 00:00:00.000000 """ from __future__ import annotations from alembic import op from app.models import Base revision = "0001_baseline_schema" down_revision = None branch_labels = None depends_on = None def upgrade() -> None: ...
ChengjinLii/studyhub
backend/alembic/versions/0001_baseline_schema.py
.py
f78d8da19ced0998
7.13
17
"""add market source and order uploader fields Revision ID: 0002_add_market_source_and_order_uploader Revises: 0001_baseline_schema Create Date: 2026-06-08 00:00:00.000000 """ from __future__ import annotations from alembic import op import sqlalchemy as sa revision = "0002_add_market_source_and_order_uploader" do...
ChengjinLii/studyhub
backend/alembic/versions/0002_add_market_source_and_order_uploader.py
.py
08b5bbe91af81a1f
7.63
17
"""add settlements.payout_transfer_id for transfer-settlement binding Revision ID: 0003_settlement_transfer_binding Revises: 0002_add_market_source_and_order_uploader Create Date: 2026-06-07 00:00:00.000000 """ from __future__ import annotations import sqlalchemy as sa from alembic import op revision = "0003_settl...
ChengjinLii/studyhub
backend/alembic/versions/0003_settlement_transfer_binding.py
.py
cd91d5d72981a32c
7.63
17
"""add refund tracking fields to material_request_contributions Revision ID: 0004_contribution_refund_fields Revises: 0003_settlement_transfer_binding Create Date: 2026-06-16 00:00:00.000000 """ from __future__ import annotations import sqlalchemy as sa from alembic import op revision = "0004_contribution_refund_f...
ChengjinLii/studyhub
backend/alembic/versions/0004_contribution_refund_fields.py
.py
d7008b5ffeaef3e2
7.63
17
"""add durable agentic runtime tables Revision ID: 0005_add_agentic_runtime_tables Revises: 0004_contribution_refund_fields Create Date: 2026-07-26 00:00:00.000000 """ from __future__ import annotations revision = "0005_add_agentic_runtime_tables" down_revision = "0004_contribution_refund_fields" branch_labels = Non...
ChengjinLii/studyhub
backend/alembic/versions/0005_add_agentic_runtime_tables.py
.py
a1ded9e86eb4c355
7.63
17
"""add durable proactive agent event outbox Revision ID: 0006_add_agentic_proactive_outbox Revises: 0005_add_agentic_runtime_tables Create Date: 2026-07-26 00:00:00.000000 """ from __future__ import annotations revision = "0006_add_agentic_proactive_outbox" down_revision = "0005_add_agentic_runtime_tables" branch_la...
ChengjinLii/studyhub
backend/alembic/versions/0006_add_agentic_proactive_outbox.py
.py
f97cfa71c5969d5b
7.63
17
"""add agentic data-governance provenance Revision ID: 0007_add_agentic_data_governance Revises: 0006_add_agentic_proactive_outbox Create Date: 2026-07-27 00:00:00.000000 This migration is intentionally explicit. It does not import ORM metadata, which keeps deployed schema changes independent from whatever model def...
ChengjinLii/studyhub
backend/alembic/versions/0007_add_agentic_data_governance.py
.py
9511559b5a1b54d1
7.63
17
"""add idempotency key for material submissions Revision ID: 0008_material_submission_idempotency Revises: 0007_add_agentic_data_governance Create Date: 2026-07-31 00:00:00.000000 """ from __future__ import annotations from alembic import op import sqlalchemy as sa revision = "0008_material_submission_idempotency"...
ChengjinLii/studyhub
backend/alembic/versions/0008_material_submission_idempotency.py
.py
63e1f4136e7c85e0
7.63
17
import numpy as np import pytest from pytest import approx import starlord from starlord.samplers import SamplerBuiltin @pytest.mark.flaky(reruns=3) def test_initial_state_generator(): builder = starlord.ModelBuilder() builder.assign("v.asquared", "p.a*p.a") builder.constraint("v.asquared", "normal", [2....
dpthorngren/Starlord
tests/test_builtin_sampler.py
.py
970bfc17336adbb9
7.02
10
import re import sys import numpy as np import pytest # flake8: noqa from test_grids import dummy_grids from starlord import GridGenerator, cli from starlord._config import config def test_grid_listing(dummy_grids, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture): monkeypatch.setattr(sys, 'argv',...
dpthorngren/Starlord
tests/test_cli.py
.py
2c339f57eb966926
7.02
10
import numpy as np import pytest from pytest import approx from scipy import stats from scipy.interpolate import RegularGridInterpolator from scipy.special import logsumexp from starlord import cy_tools @pytest.mark.flaky(reruns=3) def test_helpers(): for a, b in 20 * np.random.rand(100, 2): assert cy_to...
dpthorngren/Starlord
tests/test_cy_tools.py
.py
790f1962e43c4ec3
7.02
10
import sys import pytest # flake8: noqa from test_grids import dummy_grids import starlord from starlord import cli from starlord._config import config def test_hashing(tmpdir): test_file = tmpdir.join("test_file.txt") test_file.write("This is a checksum test file.") expect = "55955d0e48724a1981ba25cde1...
dpthorngren/Starlord
tests/test_io.py
.py
9696249d6045402a
8.02
10
import re from pathlib import Path import numpy as np import pytest # flake8: noqa from test_grids import dummy_grids import starlord from starlord._config import config @pytest.mark.flaky(reruns=3) def test_grid_retrieval(dummy_grids: Path): config.grid_dir = dummy_grids starlord.GridGenerator.reload_grids...
dpthorngren/Starlord
tests/test_samplers.py
.py
6f795b0353c38151
7.02
10
"""Module for color code.""" from __future__ import annotations import colorsys import math def _round_float(number: float, decimal_points: int = 3) -> float: decimal = 10**decimal_points return round(number * decimal) / decimal class _RGBA: """Class handling RGBA color code.""" def __init__(self...
akkaraponsala/thaipua
src/qdarktheme/_color.py
.py
848f7b85bd21c81b
7.56
12
from qdarktheme._color import Color from qdarktheme._icon.svg import Svg from qdarktheme.qtpy.QtCore import QPoint, QRect, QRectF, QSize, Qt from qdarktheme.qtpy.QtGui import ( QGuiApplication, QIcon, QIconEngine, QImage, QPainter, QPalette, QPixmap, ) from qdarktheme.qtpy.QtSvg import QSvgR...
akkaraponsala/thaipua
src/qdarktheme/_icon/icon_engine.py
.py
fa0625284c5d6086
7.56
12
from __future__ import annotations import json import re from functools import lru_cache from qdarktheme import _resources from qdarktheme._color import Color @lru_cache def _svg_resources() -> dict[str, str]: return json.loads(_resources.svg.SVG_RESOURCES) class Svg: """Class to manage SVG.""" _SVG_...
akkaraponsala/thaipua
src/qdarktheme/_icon/svg.py
.py
b37c5f41dab14226
7.56
12
"""This script is inspired by darkdetect(https://github.com/albertosottile/darkdetect).""" from __future__ import annotations import ctypes from ctypes import c_void_p try: # macOS Big Sur+ use "a built-in dynamic linker cache of all system-provided libraries" _objc = ctypes.cdll.LoadLibrary("libobjc.dylib")...
akkaraponsala/thaipua
src/qdarktheme/_os_appearance/_accent/_mac_detect.py
.py
42d9bcc1f7fbfa3d
7.56
12
from __future__ import annotations import darkdetect from qdarktheme import _os_appearance from qdarktheme.qtpy.QtCore import QCoreApplication, QEvent, QObject, QThread, Signal class OSThemeSwitchListener(QThread): """Listener to detect to change OS's theme.""" sig_run = Signal(bool) _sig_listen_os_the...
akkaraponsala/thaipua
src/qdarktheme/_os_appearance/listener.py
.py
e65f4ea5a8c4c7ba
7.56
12
from __future__ import annotations import platform from qdarktheme._icon.icon_engine import SvgIconEngine from qdarktheme._icon.svg import Svg from qdarktheme._resources.standard_icons import NEW_STANDARD_ICON_MAP from qdarktheme.qtpy.QtGui import QIcon from qdarktheme.qtpy.QtWidgets import QProxyStyle, QStyle, QStyl...
akkaraponsala/thaipua
src/qdarktheme/_proxy_style.py
.py
fc10dd118e15d021
7.56
12
"""A module containing multiple filters used by template engine.""" from __future__ import annotations import platform from qdarktheme import __version__ from qdarktheme._color import Color from qdarktheme._icon.svg import Svg from qdarktheme._util import analyze_version_str, get_cash_root_path, get_logger from qdar...
akkaraponsala/thaipua
src/qdarktheme/_template/filter.py
.py
21b8c05b61f09937
7.56
12
"""Utility methods for qdarktheme.""" from __future__ import annotations import inspect import logging import operator as ope import re from pathlib import Path import qdarktheme # greater_equal and less_equal must be evaluated before greater and less. _OPERATORS = {"==": ope.eq, "!=": ope.ne, ">=": ope.ge, "<=": o...
akkaraponsala/thaipua
src/qdarktheme/_util.py
.py
5e645a6f516d65d4
7.56
12
"""Module for QtWidgets.""" from __future__ import annotations from collections.abc import Sequence from qdarktheme.qtpy.qt_compat import QT_API if QT_API == "PySide6": from PySide6.QtWidgets import * # type: ignore # noqa: F403 elif QT_API == "PyQt6": from PyQt6.QtWidgets import * # type: ignore # noqa...
akkaraponsala/thaipua
src/qdarktheme/qtpy/QtWidgets/__init__.py
.py
ff7339dca0d16954
7.56
12
"""Module for Qt compat.""" from __future__ import annotations import os import sys class QtImportError(ImportError): """Error raise if no bindings could be selected.""" qt_import_error = QtImportError( "Failed to import qt-binding. Check packages(pip list)." "\n\tAvailable Qt-binding packages: PySide...
akkaraponsala/thaipua
src/qdarktheme/qtpy/qt_compat.py
.py
bfa125f2892506aa
7.56
12
"""Module setting up ui of dock window.""" from __future__ import annotations from qdarktheme.qtpy.QtCore import Qt from qdarktheme.qtpy.QtWidgets import QDockWidget, QMainWindow, QTextEdit, QVBoxLayout, QWidget class DockUI: """The ui class of dock window.""" def setup_ui(self, win: QWidget) -> None: ...
akkaraponsala/thaipua
src/qdarktheme/widget_gallery/_ui/dock_ui.py
.py
cac77e982a9a946d
7.56
12
"""Module setting up ui of frame window.""" from qdarktheme.qtpy.QtGui import QIcon from qdarktheme.qtpy.QtWidgets import ( QCalendarWidget, QCheckBox, QFrame, QGridLayout, QGroupBox, QHBoxLayout, QPushButton, QRadioButton, QScrollArea, QSpinBox, QToolButton, QVBoxLayout...
akkaraponsala/thaipua
src/qdarktheme/widget_gallery/_ui/frame_ui.py
.py
84985577f5386eaa
7.56
12
"""The ui to show Qt standard icons.""" from __future__ import annotations from qdarktheme.qtpy.QtCore import Qt from qdarktheme.qtpy.QtGui import QIcon from qdarktheme.qtpy.QtWidgets import ( QGridLayout, QScrollArea, QStyle, QToolButton, QVBoxLayout, QWidget, ) class IconsUi: """The ui...
akkaraponsala/thaipua
src/qdarktheme/widget_gallery/_ui/icons_ui.py
.py
ff3a5aa613151a74
7.56
12
"""Module setting up ui of mdi window.""" from qdarktheme.qtpy.QtWidgets import ( QHBoxLayout, QLabel, QMdiArea, QMdiSubWindow, QPushButton, QSplitter, QTextEdit, QVBoxLayout, QWidget, ) class MdiUI: """The ui class of mdi window.""" def _make_mdi_area_test_widget(self, e...
akkaraponsala/thaipua
src/qdarktheme/widget_gallery/_ui/mdi_ui.py
.py
1feb18a327ec719a
7.56
12
"""Module setting up ui of widgets window.""" from __future__ import annotations from typing import Any from qdarktheme.qtpy.QtCore import QAbstractTableModel, QModelIndex, Qt from qdarktheme.qtpy.QtGui import QIcon, QStandardItem, QStandardItemModel, QTextOption from qdarktheme.qtpy.QtWidgets import ( QCheckBox...
akkaraponsala/thaipua
src/qdarktheme/widget_gallery/_ui/widgets_ui.py
.py
d899bbfed2819832
7.56
12
"""Thai-to-PUA encoding maps and text transforms.""" from __future__ import annotations import logging import re from collections.abc import Callable from dataclasses import dataclass from pathlib import Path from thaipua.core.constants import SARA_AM_REPLACEMENTS from thaipua.core.pua_map import load_pua...
akkaraponsala/thaipua
src/thaipua/core/encoding.py
.py
c2bc893cf56aa944
7.56
12
"""Encode and decode files between Thai text and PUA codepoints, routing by extension.""" from __future__ import annotations import logging from collections.abc import Callable from functools import partial from pathlib import Path from thaipua.core.constants import STRING_TABLE_EXTENSIONS from thaipua.cor...
akkaraponsala/thaipua
src/thaipua/core/file_codec.py
.py
29a85828cc57e49d
7.56
12
#!/usr/bin/env python3 """Route an Israeli car-accident claim to the right insurance / fund and surface time limits. This does NOT compute compensation amounts (the non-pecuniary head is a share of a CPI-linked statutory maximum, and lasting disability is assessed by a court-appointed medical expert). It tells the use...
skills-il/legal-tech
israeli-car-accident-claim/scripts/claim_router.py
.py
51bacc6e19a90e0e
7.42
6
#!/usr/bin/env python3 """Property-balancing (izun mashabim) worksheet for Israeli divorce. Computes the equal-value balance under the Spousal Property Relations Law, 5733-1973 (chok yachasei mamon), section 5. Each spouse is entitled to half the value of ALL the couple's assets, EXCEPT a closed list of exclusions (as...
skills-il/legal-tech
israeli-divorce-navigator/scripts/izun_mashabim.py
.py
d30a3b3e6b2de8cf
7.42
6