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 |
|---|---|---|---|---|---|---|
"""Public contract and negative controls for ``calibration_report``."""
from __future__ import annotations
import inspect
from dataclasses import fields
import numpy as np
import pytest
from calibre import calibration_report
@pytest.fixture
def heldout_sample():
"""Independent held-out outcomes from calibrate... | finite-sample/calibre | tests/test_calibration_report.py | .py | d1456ebf2131bcf8 | 7.95 | 7 |
"""Behavior shared by every public binary calibrator."""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
import pytest
from sklearn.exceptions import NotFittedError
from calibre import (
CDIIsotonicCalibrator,
CenteredIsotonicCalibrator,
IsotonicCalibrator,
Nea... | finite-sample/calibre | tests/test_calibrator_contract.py | .py | d2e92eb9a66f49fa | 7.95 | 7 |
from __future__ import annotations
import json
import re
from collections.abc import Sequence
from urllib.parse import urlsplit
from erga_mcp.applications.research import build_job_snapshot
from erga_mcp.applications.role_profile import RoleProfile, role_profile_from_text
from erga_mcp.integrations.http import fetch_... | Adr1an04/erga-mcp | src/erga_mcp/applications/intake.py | .py | 17c7764bb5b81343 | 7.56 | 12 |
from __future__ import annotations
import json
import os
import shutil
import subprocess
import sys
import tempfile
from collections.abc import Callable
from pathlib import Path
_SETTINGS_NAME = "erga-mcp-monitor.json"
_MAIL_SCRIPT_NAME = "erga-mcp-mail.py"
_HISTORY_SCRIPT_NAME = "erga-mcp-history.py"
_UPDATE_SETTING... | Adr1an04/erga-mcp | src/erga_mcp/integrations/hermes.py | .py | 47325dfb13f7817a | 7.56 | 12 |
from __future__ import annotations
from collections.abc import Collection
from dataclasses import dataclass
from typing import Protocol
from erga_mcp.config import ErgaConfig
from erga_mcp.integrations.mail.gmail import fetch_all_inbox_metadata_with_gws
from erga_mcp.integrations.mail.zoho import MailMessageMetadata
... | Adr1an04/erga-mcp | src/erga_mcp/integrations/mail/provider.py | .py | 2a3896fa753c9d74 | 7.56 | 12 |
from __future__ import annotations
import json
from collections.abc import Sequence
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import Any, Protocol
from erga_mcp.models import MailEvent
from erga_mcp.store import ErgaStore
from erga_mcp.tracking.classification... | Adr1an04/erga-mcp | src/erga_mcp/integrations/mail/zoho.py | .py | b08522c1533d719d | 7.56 | 12 |
from __future__ import annotations
import re
from collections.abc import Iterable, Mapping, Sequence
from dataclasses import dataclass
from urllib.parse import urljoin, urlsplit
from ddgs import DDGS
from ddgs.exceptions import DDGSException
from scrapling.parser import Selector
from erga_mcp.integrations.http impor... | Adr1an04/erga-mcp | src/erga_mcp/integrations/web.py | .py | 0ad33c271d1260cd | 7.56 | 12 |
from __future__ import annotations
from pydantic import BaseModel, Field
class IntakeValidationResult(BaseModel):
"""Structured local LaTeX validation status returned by job intake."""
returncode: int | None
pdf: str | None
page_count: int | None = None
page_fill_ratio: float | None = None
m... | Adr1an04/erga-mcp | src/erga_mcp/mcp/contracts.py | .py | 64dfcdcb5620d8d3 | 7.56 | 12 |
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from mcp.server.mcpserver import MCPServer
@dataclass(frozen=True)
class ToolRegistry:
"""Apply Erga's capability and strict-input policy at the MCP SDK boundary."""
server: MCPServer
enabled_names: frozenset[st... | Adr1an04/erga-mcp | src/erga_mcp/mcp/registry.py | .py | d6cad6939a0d04e8 | 7.56 | 12 |
#!/usr/bin/env python3
"""
Main entry point for the AI Research Radar pipeline.
Orchestrates the full scan cycle:
1. Fetch papers from arXiv
2. Categorize papers
3. Generate summaries (optional, needs OPENAI_API_KEY)
4. Update README.md
5. Persist paper data and status
"""
from __future__ import annotations... | mlnjsh/ai-research-radar | scripts/run_scan.py | .py | 5812b9741ed5c232 | 7.48 | 8 |
"""Example BYO provider: wrap the `claude` CLI as an veracium `Complete` callable.
Shows the bring-your-own-model contract with zero SDK dependency — any callable
with this shape works, including your agent's existing client. This one ignores
`json_schema` (the CLI has no structured-output flag); veracium's tolerant J... | veracium-ai/Veracium | examples/claude_cli_provider.py | .py | 342f36eaa0d50b4a | 7.45 | 7 |
"""Veracium as the long-term memory layer of a LangChain chat app.
Mirrors the standard LangChain memory pattern — `RunnableWithMessageHistory`
over a session-keyed chat history — and upgrades its "hybrid memory" slot:
recent turns stay in LangChain's in-memory buffer (short-term coherence), and
the durable layer is V... | veracium-ai/Veracium | examples/langchain_memory.py | .py | 7a3547d9d9e588d0 | 7.45 | 7 |
#!/usr/bin/env python3
"""The C-plus COLLECTED.txt renderer — COLLECTED_HEADER_DESIGN.md §5.1.5/6.
Blocking 2: verifying parts separately leaves the next finding living
BETWEEN two verified artifacts — undeclared bytes between blocks, a
duplicated block, trailing prose, a header at the wrong boundary. So the
unit here... | veracium-ai/Veracium | specs/collected_render.py | .py | 06cc1d5d6aa456af | 7.95 | 7 |
#!/usr/bin/env python3
# Mutation-Matrix: tests/test_0011_policy_matrix.py::test_the_fold_checker_refuses_a_shadowed_helper
"""0011 — the round-1 fold, checked STRUCTURALLY rather than by substring.
P4 refuses closure evidence that greps for a diagnostic string, because a
no-op artifact containing that string satisfie... | veracium-ai/Veracium | specs/evidence/0011/check_round1_fold.py | .py | 112de5962653f666 | 7.95 | 7 |
"""specs/0019 §4b — the NORMATIVE reference predicate (resolution-set form, longest-match precedence).
PORTABLE AND PURE: no I/O, no external paths, no corpus dependency. Two
conforming implementations must agree with this module on every input; the
pinned vectors live beside it in `vectors.json` and
`test_predicate_m... | veracium-ai/Veracium | specs/evidence/0019/reference_predicate.py | .py | 03b775ecd178d08d | 7.95 | 7 |
"""specs/0021 §7b — the SCHEMA_V8 dual-manifestation evidence GENERATOR
(external round 10's artifact ask: the literal constructor and the
MEASURED ALTER-path stored DDL, produced NOW, never promised).
Emits, deterministically:
1. the LITERAL SCHEMA_V8 `contribution_ledger` CONSTRUCTOR — the accepted
v7 constructor... | veracium-ai/Veracium | specs/evidence/0020/schema_v8_evidence.py | .py | b377f66a7ba02600 | 7.95 | 7 |
#!/usr/bin/env python3
"""ONE strict implementation of a marker-delimited generated block.
EXTERNAL ROUND 16, R16-2. `review_lessons.py` located its generated block with
`text.split(BEGIN, 1)` and `rest.split(END, 1)` — the FIRST marker pair, with
no requirement that there be exactly one. The reviewer appended a secon... | veracium-ai/Veracium | specs/generated_block.py | .py | 955890d6410058a1 | 7.95 | 7 |
"""The supersession authority ladder, and every table derived from it.
specs/0003 v1 stated the ladder as one line of arithmetic and then wrote its
consequences out in prose. Two of the four ASSISTANT cases were inverted --
including `assistant -> third_party`, the unsafe direction -- while the document
being transcri... | veracium-ai/Veracium | specs/ladder.py | .py | 239a927b177dc3a6 | 7.95 | 7 |
#!/usr/bin/env python3
"""Reconcile rulings recorded in COORDINATION.md against the spec tables.
A ruling lands in COORDINATION, the spec's open-question table is updated
separately, and the two drift. `0001` Q5 read "blocking / research" for 16 hours
after it was answered; `0006` Q1 for 12. Anyone auditing "what is b... | veracium-ai/Veracium | specs/lint_rulings.py | .py | 9326cd96bef5068a | 7.95 | 7 |
#!/usr/bin/env python3
"""Fail if a withdrawn rule reappears as live specification text.
Four external reviews in a row found withdrawn rules still stated normatively,
each time after the document said they had been removed. The failure was always
the same shape: I searched for *my own edits* -- annotation markers, th... | veracium-ai/Veracium | specs/lint_withdrawn.py | .py | 4f34602989205258 | 7.95 | 7 |
"""Claude Code adapter: reads ~/.claude/projects/**.jsonl transcripts (read-only).
Layout (public, parsed by the wider ecosystem as well):
~/.claude/projects/<encoded-project-path>/<session-uuid>.jsonl ← main session
~/.claude/projects/<proj>/<session-uuid>/subagents/agent-*.jsonl ← subagents
Each line is a... | Socialpranker/agentburn | agentburn/adapters/claude_code.py | .py | 4b372ecdb134bb9e | 7.56 | 12 |
"""Community-measured reference points, embedded as dated constants.
These are NOT our measurements. Each constant carries its public source and
date; the report cites them verbatim so users can calibrate "is my number
normal?" without agentburn ever touching the network.
"""
from __future__ import annotations
# Pha... | Socialpranker/agentburn | agentburn/benchmarks.py | .py | 33a58d97b4497abd | 7.56 | 12 |
"""Burn Index — anonymous community percentiles of agent EFFICIENCY.
Volume leaderboards get gamed (people flex token burn; tops fill with fakes).
The Burn Index ranks nothing anyone would want to inflate: it compares
efficiency — fixed overhead per call, night share, idle heartbeats, failure
burn, cache utilization. ... | Socialpranker/agentburn | agentburn/burnindex.py | .py | 6ef16aab45b01441 | 7.56 | 12 |
"""Per-file parse cache.
Agent transcripts are append-only and large: a 30-day window over 3 GB of
Claude Code logs costs ~2 minutes of pure parsing, and today every command
(`report`, `limits`, `why`) pays it again from scratch. Almost none of those
files changed between two runs.
So each source file's parse result ... | Socialpranker/agentburn | agentburn/cache.py | .py | 3137e5f04f6b67d8 | 7.56 | 12 |
"""`agentburn drift` — your spend × the world's direction.
You pay for models. The world's usage of those models moves every week —
and nobody tells you when you're paying for a model everyone else is
leaving. drift joins two things only this toolchain has:
- YOUR model spend, computed locally from the agents' own lo... | Socialpranker/agentburn | agentburn/drift.py | .py | 50fd8b14327b742f | 7.56 | 12 |
"""`agentburn explain` — optional LLM interpretation of the numbers.
Privacy rules (non-negotiable):
- default endpoint is LOCAL (ollama / LM Studio at localhost) — nothing leaves
the machine, same promise as everywhere else;
- a remote endpoint must be chosen explicitly, triggers a visible notice, and
receives a ... | Socialpranker/agentburn | agentburn/llm.py | .py | ac8e4573fca179da | 7.56 | 12 |
"""Normalized, agent-agnostic data model.
Every adapter converts its agent's storage into these records. The analyzer
never sees agent-specific structures — that is what keeps the core reusable
for OpenClaw / Claude Code adapters later.
"""
from __future__ import annotations
from dataclasses import dataclass, field
... | Socialpranker/agentburn | agentburn/model.py | .py | c7addd9a12e2e281 | 7.56 | 12 |
"""Embedded model-price snapshot (USD per 1M tokens), pulled from the
OpenRouter endpoints API on AS_OF — median endpoint per model, not the
cheapest outlier. No network at runtime; every figure that uses these is
labeled with the snapshot date. Verify current rates before big decisions.
"""
from __future__ import ann... | Socialpranker/agentburn | agentburn/prices.py | .py | e79760b89bff1d81 | 7.56 | 12 |
"""Rule-based recommendations: each one names the burn and the action.
Rules are deliberately conservative: a recommendation fires only when the
category is a meaningful share of spend, and every estimate is phrased as
an upper bound of the saving, never a promise.
"""
from __future__ import annotations
from .analyz... | Socialpranker/agentburn | agentburn/recommend.py | .py | 059d54414d3a7dfd | 7.56 | 12 |
"""Shareable burn card: anonymized by construction.
Includes ONLY: period, totals, source categories, model names, the overnight
line and overhead calibration. Never includes session titles, paths, user ids
or message content — safe to paste into a public post.
"""
from __future__ import annotations
from .analyze im... | Socialpranker/agentburn | agentburn/share.py | .py | 7384b7b07ce1f709 | 7.56 | 12 |
#!/usr/bin/env python3
"""Render the GitHub social-preview card (1280×640 PNG).
The card is what a link to this repo looks like on X, Slack, Reddit and HN —
it has to carry the hook, not the feature list. Chrome renders the HTML; there
is no image dependency to install.
python3 tools/gen_social.py
Notes: Chrome ... | Socialpranker/agentburn | tools/gen_social.py | .py | dd8c0c097331ee2d | 7.56 | 12 |
"""番茄起名 agent · 决策层编排(对标 toonflow fangcun-drama 架构)
对齐 toonflow 原生 runDecisionAI:
- 每轮重建消息(system + assistant[项目信息] + user),不维护多轮对话历史
- 决策 LLM 用 tool calling 派发工具(get 类确定性工具 + run_sub_agent_titles +
run_supervision_agent)
- 执行层/监督层是独立 LLM 调用,system 分别为 title_execution.md / title_supervision.md
- 决策 LLM 输出 content(停下... | WindXRan/fangcun-write | skills/fangcun-title-agent/scripts/orchestrator.py | .py | 5df1d61c590570f0 | 7.5 | 9 |
"""番茄起名 agent · 确定性工具实现(文件=职责,纯函数为主)
对齐 toonflow 架构:工具实现与编排分离,本文件只放确定性读写,
LLM 调用统一走 orchestrator(llm_client 复用 fangcun-drama)。
"""
import json
import re
import sys
from pathlib import Path
SKILL_DIR = Path(__file__).resolve().parent.parent
WORKSPACE = SKILL_DIR.parents[1]
PROJECTS = WORKSPACE / "projects"
HOOK_REFS ... | WindXRan/fangcun-write | skills/fangcun-title-agent/scripts/tools_impl.py | .py | f7381e31a0dd5d73 | 7.5 | 9 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""批量下载番茄榜单书(严格 title+author,作者搜二次补下,落 downloads/)。
规则(用户拍板 2026-07-17):
- 作者必须精确匹配,不允许有出入。
- 书名+作者都对才算同一本书;一本书可能有多个书名(改名)。
- 因此匹配顺序:
Pass 1: 用快照书名搜 → 要求 书名+作者 双精确(无"仅书名"退路)。
Pass 2: 用作者名搜 → 在该作者名下找书(处理改名),作者依然精确。
- 唯一一本 → 下载(改名书,作者确认)。
- 多... | WindXRan/fangcun-write | skills/fanqie-download/bulk_download.py | .py | b7f375cd50169005 | 7.5 | 9 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
So Novel CLI(.agents/skills/sonovel-download/)
底层下载逻辑。被顶层 tools/sonovel_download.py 复用。
支持:search / download / url / status
用法:
python .agents/skills/sonovel-download/sonovel_cli.py search "大泼猴"
python .agents/skills/sonovel-download/sonovel_cli.py download "大泼猴"... | WindXRan/fangcun-write | skills/sonovel-download/sonovel_cli.py | .py | fed9520f0ca9bcd3 | 7.5 | 9 |
"""base.py — 平台适配器接口
每个平台实现一个 Adapter:
submit_first(book, human_gate) -> {ok, book_id, error}
push_chapters(book, chapters) -> {ok, added, error, needs_recon}
"""
from __future__ import annotations
from abc import ABC, abstractmethod
class Adapter(ABC):
name = "base"
@abstractmethod
def submit_fir... | WindXRan/fangcun-write | submission/adapters/base.py | .py | be33cc14c86770ca | 7 | 9 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""cli.py — 网文自动投稿 agent 决策循环(orchestrator)
流程:
1) discover publish/ 四件套 → 同步进 registry(含轻校验)
2) 首投(非 --auto 时):每本 pending 书填表+上传+等人工提交+抓 book_id
3) 续更(始终):每本 submitted 书 diff 新章 → 自动推送
安全模型(用户拍板):首投人工核一次 → 续更全自动。
· 出席运行(不带 --auto):首投(人工闸) + 续更
· 调度运行(--auto,接 ... | WindXRan/fangcun-write | submission/cli.py | .py | b5370e2e7ac61a50 | 7.5 | 9 |
"""intake.py — 读 publish/ 四件套,解析成 book dict,并做轻校验
直接复用 tools/wawa_publish.py 的 parse_submission(字段已对齐)。
"""
from __future__ import annotations
import sys
from pathlib import Path
# submission/core/intake.py -> parents[2] == 项目根;tools/ 是 wawa_publish 所在
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "to... | WindXRan/fangcun-write | submission/core/intake.py | .py | a05fdef10aff0c91 | 7.5 | 9 |
"""registry.py — 投稿 agent 状态库(唯一真源,替代 publish/ 目录位置标记)
落地:submission/registry.json
每本书记录:元信息 + 各平台状态(platforms) + 章节游标 + 上次同步时间。
"""
from __future__ import annotations
import json
import time
from pathlib import Path
REG_PATH = Path(__file__).resolve().parent.parent / "registry.json"
# platform 状态机:
# pending ... | WindXRan/fangcun-write | submission/core/registry.py | .py | f63f1eb3159cf1b5 | 7.5 | 9 |
"""sync.py — 章节切分、字数校验与自愈(首投/续更通用)
章节标记:# 第N章 标题(N 可为中文数字/阿拉伯数字)。
2026-08-26 收紧:章首必须带 `#` 前缀。此前允许裸「第N章」,会把正文里
「第10章,他在那处封印地…」这类叙述句误识别成章首(见 publish/ 洪荒大佬等书),
导致切分错位、章节字数过短。
"""
from __future__ import annotations
import re
# 章节号数字类:中文数字 + 阿拉伯数字
CHAPTER_NUM = r"[一二三四五六七八九十百千0-9零〇]+"
# 章首正则:行首(可选空白)后必须带 `#`
CHAPTER_RE ... | WindXRan/fangcun-write | submission/core/sync.py | .py | 0ab5009dba3dc2c0 | 7.5 | 9 |
# tests/conftest.py
"""Shared test fixtures for fangcun-write test suite."""
import pytest
from pathlib import Path
import tempfile
@pytest.fixture
def temp_project():
"""Create a temporary project directory for testing."""
with tempfile.TemporaryDirectory() as tmpdir:
project_dir = Path(tmpdir) / "te... | WindXRan/fangcun-write | tests/conftest.py | .py | 8b8d80fe102f2b97 | 8 | 9 |
# tests/test_anti_ai_writing.py
"""Tests for anti-AI writing rules integration."""
from pathlib import Path
class TestAntiAIWriting:
"""Tests for anti-AI writing reference and integration."""
def test_anti_ai_writing_reference_exists(self):
"""Test that anti-ai-writing.md reference file exists."""
... | WindXRan/fangcun-write | tests/test_anti_ai_writing.py | .py | dd0eeaecced5518b | 8 | 9 |
import sys
import json
import tempfile
import shutil
from pathlib import Path
from unittest import TestCase, main as unittest_main
# 将 tools 目录添加到 sys.path
sys.path.insert(0, str(Path(__file__).parent.parent / "tools"))
# 导入要测试的模块
import book_switcher
from book_switcher import (
_scan_projects,
search_books,
... | WindXRan/fangcun-write | tests/test_book_switcher.py | .py | f8bc0ab1d38fe50d | 8 | 9 |
# tests/test_character_design.py
"""Tests for character design reference and integration."""
from pathlib import Path
class TestCharacterDesign:
"""Tests for character design reference and integration."""
def test_character_design_reference_exists(self):
"""Test that character-design.md reference fil... | WindXRan/fangcun-write | tests/test_character_design.py | .py | e833b27064d5ca26 | 8 | 9 |
# -*- coding: utf-8 -*-
"""tools/common.py::utf8_path 回归测试。
背景(2026-08-28):PYTHONLEGACYWINDOWSFSENCODING=1 使 fsencoding=GBK,
sqlite3.connect(中文str路径) 会在中文用户名主目录下打不开(或静默落到乱码路径)。
utf8_path() 把路径转 UTF-8 字节绕开 fsencoding。本测试守护该契约,
防止并行会话/重构把裸 str 传回 sqlite3 调用点(曾发生 3 处被还原)。
"""
import os
import sys
import tempfile
from pat... | WindXRan/fangcun-write | tests/test_common_paths.py | .py | d51c7f3d18b0a3c4 | 8 | 9 |
# tests/test_emotion_driven.py
"""Tests for emotion-driven writing integration."""
from pathlib import Path
class TestEmotionDrivenWriting:
"""Tests for emotion-driven writing reference and integration."""
def test_emotion_driven_writing_reference_exists(self):
"""Test that emotion-driven-writing.md ... | WindXRan/fangcun-write | tests/test_emotion_driven.py | .py | 85ebd44a04a4aaca | 8 | 9 |
# -*- coding: utf-8 -*-
"""fangcun_cleaner 回归测试:覆盖最近修复的 bug。
覆盖:
1. AI_CLEAN_MARKER 与 pipeline 一致(曾出现 `-- ` 前缀不一致)
2. clean_text 返回正文不含 marker(曾默认带 marker,污染多轮清洗)
3. run_cleaner_pipeline(add_marker=True) 才带 marker
4. process_project 跳过逻辑(已处理章节不重跑)
5. process_project results 填充(曾恒为空)
6. process_project(mode="llm") 必需 l... | WindXRan/fangcun-write | tests/test_fangcun_cleaner.py | .py | 10c048c028900b16 | 8 | 9 |
# tests/test_genre_formulas.py
"""Tests for genre writing formulas reference file.
题材公式内容在 2026-08-25 的重构中从 prompts/skeleton_webnovel.md 迁出,
收敛为独立参考文件 references/genre-writing-formulas.md(供 S0–S3 阶段
按管线注入使用)。本测试验证该参考文件存在且内容完整。
"""
from pathlib import Path
REFERENCE_PATH = Path("references/genre-writing-formulas.md")... | WindXRan/fangcun-write | tests/test_genre_formulas.py | .py | c160f565678f1ba5 | 8 | 9 |
# tests/test_quality_checklist.py
"""Tests for quality checklist reference and integration."""
from pathlib import Path
import sys
# Add tools/transcript to path for pipeline imports (same pattern as test_integration_publish.py)
_TRANSCRIPT_DIR = str(Path(__file__).resolve().parent.parent / "tools" / "transcript")
if ... | WindXRan/fangcun-write | tests/test_quality_checklist.py | .py | 3640e40fa52066ca | 8 | 9 |
# tests/test_reader_hooks.py
"""Tests for reader engagement hooks reference and integration."""
from pathlib import Path
class TestReaderHooksReference:
"""Tests for reader-hooks.md reference file."""
def test_reader_hooks_reference_exists(self):
"""Test that reader-hooks.md reference file exists."""... | WindXRan/fangcun-write | tests/test_reader_hooks.py | .py | 9ef1f3985584610c | 8 | 9 |
import os
import json
import re
import base64
import requests
from datetime import datetime, timedelta
import subprocess
import logging
from concurrent.futures import ThreadPoolExecutor, as_completed
import time
import schedule
import jsonschema
import locale
from urllib.parse import unquote, urlparse, parse_qs, urlenc... | spincat/SmartProxyPipeline | v2rayN_updater.py | .py | 9a3602591be49fd6 | 7.48 | 8 |
import hmac
from uuid import UUID
from fastapi import Depends, Header, HTTPException, status
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from sqlalchemy.orm import Session
from app.core.config import settings
from app.core.database import get_db
from app.core.errors import ErrorCode, equip_e... | ArVaViT/equip | backend/app/api/dependencies.py | .py | d146d5bc0da74e61 | 7.42 | 6 |
"""What the school decides about itself — readable and writable at last.
`org_settings` holds the name printed on every ведомость, the city under it,
the scheme new courses inherit, and the band boundaries every letter and «5» on
the platform is resolved through. All of it has been read-only since it was
introduced: t... | ArVaViT/equip | backend/app/api/v1/admin_org_settings.py | .py | fa0105a561181704 | 7.42 | 6 |
from fastapi import APIRouter, Depends, Header, Query, Response
from pydantic import BaseModel
from sqlalchemy import func
from sqlalchemy.orm import Session
from app.api.dependencies import require_teacher, verify_course_owner
from app.core.database import get_db
from app.models.enrollment import Enrollment
from app.... | ArVaViT/equip | backend/app/api/v1/analytics.py | .py | df8367b4f6b0877b | 7.42 | 6 |
from datetime import datetime
from uuid import UUID
from fastapi import APIRouter, Depends, Query, status
from pydantic import BaseModel, ConfigDict
from sqlalchemy.orm import Session
from app.api.dependencies import require_admin
from app.core.database import get_db
from app.core.errors import ErrorCode, equip_error... | ArVaViT/equip | backend/app/api/v1/audit.py | .py | 7d1cbbd38b43cfd1 | 7.42 | 6 |
from uuid import UUID
from fastapi import APIRouter, Depends, Header, Query, Response, status
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import Session
from app.api.dependencies import get_current_user, require_teacher, verify_chapter_access, verify_chapter_owner
from app.core.database import get_d... | ArVaViT/equip | backend/app/api/v1/blocks.py | .py | 0582899aaff59e12 | 7.42 | 6 |
from uuid import UUID
from fastapi import APIRouter, Depends, Header, Query, Response, status
from sqlalchemy.orm import Session
from app.api.dependencies import get_current_user, require_teacher, verify_course_owner
from app.core.database import get_db
from app.core.errors import ErrorCode, equip_error
from app.core... | ArVaViT/equip | backend/app/api/v1/calendar.py | .py | bb1c45084af29c6f | 7.42 | 6 |
"""iCal subscription endpoints.
Two routes:
* ``POST /calendar/ical/token`` (auth) — issues a long-lived
HMAC-signed token bound to the calling user, returns the subscribe
URL, and stamps ``profiles.calendar_ical_min_iat`` to the new
token's ``iat``. That stamp is the actual rotation gate: the feed
verifier r... | ArVaViT/equip | backend/app/api/v1/calendar_ical.py | .py | b2daa96a784cc222 | 7.42 | 6 |
"""Course catalog read endpoints (listings + detail views)."""
from fastapi import Depends, Header, Query, Response
from sqlalchemy.orm import Session
from app.api.dependencies import get_current_user, get_optional_user, is_owner_or_admin, require_teacher
from app.core.database import get_db
from app.core.errors impo... | ArVaViT/equip | backend/app/api/v1/courses/catalog.py | .py | b4e54b4d9c278303 | 7.42 | 6 |
"""Course-level write endpoints: create / update / delete / clone / restore."""
import logging
from fastapi import Depends, Request, status
from sqlalchemy.orm import Session
from app.api.dependencies import assert_course_owner, organization_of, require_teacher
from app.core.config import settings
from app.core.data... | ArVaViT/equip | backend/app/api/v1/courses/crud.py | .py | 2debcc82d2a38b91 | 7.42 | 6 |
"""Enrollment endpoints: status probe + enroll."""
from datetime import UTC, datetime
from fastapi import Depends, Header, Request, Response, status
from pydantic import BaseModel
from sqlalchemy.orm import Session
from app.api.dependencies import get_current_user, lookup_enrollment
from app.core.database import get... | ArVaViT/equip | backend/app/api/v1/courses/enrollment.py | .py | 14dda17fbb38933b | 7.42 | 6 |
"""PDF export endpoint for a single course.
Returns a printable PDF rendering of the course outline + chapter
text content. Owner-or-admin OR enrolled-student gets through; anyone
else sees 403 (same gate as the existing teacher/student detail
views). The PDF is generated on demand — no caching layer yet, since
course... | ArVaViT/equip | backend/app/api/v1/courses/pdf.py | .py | 5dea02354b41c398 | 7.42 | 6 |
"""Manual translation backfill for already-published courses.
The publish/update hooks in ``crud.py`` and nested write endpoints already run
``translate_course_content`` when Gemini is configured. This endpoint lets a
teacher force a full pass (same logic as the hooks).
Safe to call repeatedly: unchanged sources shor... | ArVaViT/equip | backend/app/api/v1/courses/translate.py | .py | 712cf52b8aa017dc | 7.42 | 6 |
"""Daily Challenge API routes.
Sprint 2 ships three student-facing endpoints. Authoring + scheduling
admin routes land in Sprint 3 with the editorial pipeline.
Authentication: all routes require an authenticated user. There's no
role gate — every authenticated user, including students, can read
today's question, subm... | ArVaViT/equip | backend/app/api/v1/daily_challenge.py | .py | 170c66008f3da82a | 7.42 | 6 |
import logging
from fastapi import APIRouter, Depends, status
from sqlalchemy import text
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import Session
from app.api.dependencies import require_admin
from app.core.database import get_db
from app.core.errors import ErrorCode, equip_error
from app.models... | ArVaViT/equip | backend/app/api/v1/health.py | .py | a3c60695fa9146a6 | 7.42 | 6 |
"""Cron-driven worker that appends ONE Daily Challenge question per day.
Not user-facing. A daily cron (Vercel Cron) POSTs/GETs here with the same
shared secret as the translation worker (Vercel signs every cron request
with ``CRON_SECRET``; we map ``TRANSLATION_WORKER_SECRET`` to it). Per
call it generates one questi... | ArVaViT/equip | backend/app/api/v1/internal_daily_challenge_worker.py | .py | 2be7b95107000444 | 7.42 | 6 |
"""Serving the documents, and recording that somebody accepted one."""
from fastapi import APIRouter, Depends, Request, status
from sqlalchemy import select
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import Session
from app.api.dependencies import get_current_user
from app.core.database import get_... | ArVaViT/equip | backend/app/api/v1/legal.py | .py | 181295522bb7f83d | 7.42 | 6 |
from fastapi import APIRouter, Depends, Header, Response, status
from pydantic import BaseModel
from sqlalchemy.orm import Session
from app.api.dependencies import (
get_current_user,
get_live_course_or_404,
require_teacher,
verify_course_owner,
)
from app.core.database import get_db
from app.core.erro... | ArVaViT/equip | backend/app/api/v1/prerequisites.py | .py | 7ddbfe6c6d6fc493 | 7.42 | 6 |
from datetime import UTC, datetime
from uuid import UUID
from fastapi import APIRouter, Depends, Request, status
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import Session
from app.api.dependencies import (
get_current_user,
lookup_enrollment,
require_teacher,
verify_chapter_owner,
... | ArVaViT/equip | backend/app/api/v1/progress.py | .py | 7d25b9f6b30ac408 | 7.42 | 6 |
from uuid import UUID
from fastapi import status
from sqlalchemy.orm import Session, selectinload
from app.api.dependencies import verify_chapter_owner
from app.core.errors import ErrorCode, equip_error
from app.models.course import Chapter, Course, Module
from app.models.quiz import Quiz, QuizQuestion
def course_s... | ArVaViT/equip | backend/app/api/v1/quizzes/_deps.py | .py | 4b6fe0b103448b9f | 7.42 | 6 |
"""Quiz attempts: student submit + teacher/student attempt listing."""
from datetime import UTC, datetime
from uuid import UUID
from fastapi import Depends, Query, status
from sqlalchemy.orm import Session, selectinload
from app.api.dependencies import (
get_current_user,
require_teacher,
resolve_chapter... | ArVaViT/equip | backend/app/api/v1/quizzes/attempts.py | .py | 06bac1c4c46fba75 | 7.42 | 6 |
"""Quiz CRUD endpoints (teacher + student read-through).
Every route here attaches to the shared ``router`` in ``_router.py``.
"""
import uuid
from uuid import UUID
from fastapi import Depends, Header, Query, Response, status
from sqlalchemy.orm import Session, selectinload
from app.api.dependencies import (
ge... | ArVaViT/equip | backend/app/api/v1/quizzes/crud.py | .py | afb0b1855fe174c7 | 7.42 | 6 |
"""Teacher grading of open-ended quiz answers (and their pending queue)."""
from datetime import UTC, datetime
from uuid import UUID
from fastapi import Depends, Header, Query, Response, status
from sqlalchemy.orm import Session
from app.api.dependencies import require_teacher
from app.core.database import get_db
fr... | ArVaViT/equip | backend/app/api/v1/quizzes/grading.py | .py | cb0a79509f6b37cd | 7.42 | 6 |
"""Rubrics: defining a marking standard, and marking against it.
Design: `assessment-integrity-and-the-graders-day.md` §6.3.
Two things here deserve to be read before the code.
**A partially marked essay is not a graded essay.** Saving marks is
incremental — a teacher works down the criteria, and the queue autosaves... | ArVaViT/equip | backend/app/api/v1/rubrics.py | .py | 51cbba703aeeea8d | 7.42 | 6 |
import logging
from datetime import UTC, datetime
from uuid import UUID
from fastapi import APIRouter, Depends, Header, Query, Request, Response, status
from pydantic import BaseModel
from sqlalchemy.orm import Session
from app.api.dependencies import get_current_user, require_admin
from app.core.database import get_... | ArVaViT/equip | backend/app/api/v1/users.py | .py | 17723216f5b51465 | 7.42 | 6 |
#!/usr/bin/env python3
"""
Generate a complete post-production bundle for a Hebrew podcast episode.
This is a scaffolding helper: it takes a transcript + chapter list + clip list
and writes the directory structure described in SKILL.md. The agent (or a
human) is responsible for providing the semantic inputs (chapter t... | skills-il/marketing-growth | hebrew-podcast-postproduction/scripts/generate_bundle.py | .py | dd399caf4d5b7290 | 7.42 | 6 |
#!/usr/bin/env python3
"""
Score transcript segments for podcast clip shareability.
Reads a Whisper / ElevenLabs Scribe JSON transcript on stdin or from a file
and emits a ranked list of candidate clip windows (start, end, score, reason).
Usage:
python score_segments.py transcript.json
cat transcript.json | p... | skills-il/marketing-growth | hebrew-podcast-postproduction/scripts/score_segments.py | .py | 7942f30d60f9b0f6 | 7.42 | 6 |
#!/usr/bin/env python3
"""Analyze Hebrew keywords using morphological rules.
Generates prefix variants (ha-, ve-, be-, le-, me-, she-), plural forms,
and construct state (smikhut) combinations for Hebrew SEO keyword research.
Usage:
python scripts/analyze_keywords.py --keywords "nadlan,dira,bayit"
python scri... | skills-il/marketing-growth | hebrew-seo-geo-toolkit/scripts/analyze_keywords.py | .py | 4ca9b0bef2ce9d30 | 7.42 | 6 |
#!/usr/bin/env python3
"""
DataForSEO API wrapper
"""
import urllib.request
import urllib.parse
import json
import base64
import sys
from credential import get_dataforseo_credentials
API_BASE = "https://api.dataforseo.com/v3"
def api_post(endpoint: str, data: list) -> dict:
"""Make POST request to DataForSEO API... | skills-il/marketing-growth | hebrew-seo-geo-toolkit/scripts/dataforseo_api.py | .py | 281fe94df7096901 | 7.42 | 6 |
#!/usr/bin/env python3
"""
SEO audit script (no API required)
Usage: python3 scripts/seo_audit.py "https://example.com"
"""
import argparse
import urllib.request
import urllib.parse
import re
import time
import sys
import ssl
import urllib.error
# A bare tool token gets refused by a large share of real sites (CDN and... | skills-il/marketing-growth | hebrew-seo-geo-toolkit/scripts/seo_audit.py | .py | cf385b1153ce5cfa | 7.42 | 6 |
#!/usr/bin/env python3
"""Emit a ready-to-pipe JSON payload for `gws forms forms batchUpdate --json`.
Usage:
python3 scripts/build_batchupdate_payload.py --template nps
python3 scripts/build_batchupdate_payload.py --template csat
python3 scripts/build_batchupdate_payload.py --template ces
python3 scripts/build... | skills-il/marketing-growth | hebrew-survey-builder/scripts/build_batchupdate_payload.py | .py | 111d1fe2e9f61b61 | 7.42 | 6 |
#!/usr/bin/env python3
"""Plan content calendar for Israeli market.
Generates a content calendar with Jewish holidays,
Israeli national/memorial days, and an optimal posting schedule.
Usage:
python content_planner.py --month 9 --year 2026
python content_planner.py --help
Note: holiday dates are hardcoded per... | skills-il/marketing-growth | israeli-content-marketing/scripts/content_planner.py | .py | 2e37c68ac5e87ee9 | 7.42 | 6 |
#!/usr/bin/env python3
"""Validate Hebrew email content for RTL rendering and Chok HaSpam structure.
Checks email HTML for RTL attributes and for the structural elements section 30A
of the Communications Law requires in a commercial email. It checks structure
only. It cannot tell you whether your consent record is val... | skills-il/marketing-growth | israeli-email-sequences/scripts/email_validator.py | .py | 0742b7f814f6c225 | 7.42 | 6 |
#!/usr/bin/env python3
"""
market-sizing.py - bottom-up TAM/SAM/SOM estimator for the Israeli market.
The point of this script is discipline, not precision: it forces a market-fit
estimate to be built from a real segment population, a defensible adoption
fraction, and a per-buyer annual spend, instead of a hand-waved ... | skills-il/marketing-growth | israeli-market-fit/scripts/market-sizing.py | .py | 224117fc26b94d28 | 7.42 | 6 |
#!/usr/bin/env python3
"""Calculate Israeli PPC campaign budgets and estimates.
Provides ILLUSTRATIVE per-vertical CPC planning defaults and estimates campaign costs.
The CPC figures are NOT measured Israeli benchmark data: there is no published Israeli
CPC benchmark dataset, and the vertical ranking is derived from U... | skills-il/marketing-growth | israeli-paid-ads/scripts/cpc_calculator.py | .py | 204fc7fb7c1a246a | 7.42 | 6 |
#!/usr/bin/env python3
"""Generate optimal posting schedule for Israeli social media.
Creates a weekly posting calendar optimized for Israeli audience
engagement patterns across Facebook, Instagram, TikTok, and LinkedIn.
Usage:
python posting_scheduler.py --platform facebook
python posting_scheduler.py --all
... | skills-il/marketing-growth | israeli-social-content/scripts/posting_scheduler.py | .py | 3b0d3ac23b088232 | 7.42 | 6 |
"""GEODE — 범용 자율 실행 에이전트."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
# Declare ``__version__`` for mypy / IDEs. The runtime value is produced
# lazily by ``__getattr__`` below so module import does not pull
# ``importlib.metadata`` (~70 ms cumulative in... | mangowhoiscloud/geode | core/__init__.py | .py | 623385d2f1b5e195 | 7.59 | 14 |
"""Child->parent live-activity side-channel for the fleet view (Stage 1.5).
Design SOT: ``docs/plans/2026-07-03-fleet-view.md``.
Sub-agents run through the product-composed worker subprocess with the child
:class:`~core.agent.loop.AgenticLoop` in ``quiet=True`` mode, so the child emits
no per-tool IPC back to the par... | mangowhoiscloud/geode | core/agent/activity_channel.py | .py | d25e0efbf9c82c42 | 7.59 | 14 |
"""Agent contracts SoT reader — ADR-012 M2, JSON mutation surface.
Mutator overrides per-agent ``role`` / ``system_prompt`` / ``tools`` on
:class:`core.skills.agents.AgentDefinition` instances. ``model`` field
는 Tier 2 (안전성 invariants 의 root) 이므로 본 surface 에서 명시적
제외 — mutator 가 provider 를 임의로 바꿔 safety guardrail 을 우회하... | mangowhoiscloud/geode | core/agent/agent_contracts_policy.py | .py | 9e1875d0dfd7ae6d | 7.59 | 14 |
"""Explicit HITL approval FSM — per-transition records for decision diagnosis.
Every approval gate (write / expensive / bash / mcp / batch) threads ONE
:class:`ApprovalRecord` through its display → input-parse → verdict →
propagation → execution pipeline, appending a timestamped transition at each
handoff. The record ... | mangowhoiscloud/geode | core/agent/approval_fsm.py | .py | 632ecb08b438d6ec | 7.59 | 14 |
"""Optional wall-clock budget for one AgenticLoop session.
The loop activates this legacy session-wide cap only when an operator sets
``GEODE_SESSION_TIME_BUDGET_S``. Normal interactive and durable sessions are
unbounded; per-run limits remain the responsibility of ``time_budget_s``.
Budget tracking lives in the loop... | mangowhoiscloud/geode | core/agent/budget.py | .py | 3da6bc451ce81f9c | 7.59 | 14 |
"""Best-of-N candidate sampling + judge selection for ``delegate_task``.
GAP 2+4 of the test-time compute allocation audit (2026-07-06). The
runtime already had task-decomposition width (``SubAgentManager`` fans
out DIFFERENT subtasks in parallel) but no same-task N-candidate
sampling: there was no way to buy accuracy... | mangowhoiscloud/geode | core/agent/candidate_sampling.py | .py | cc3f56e3b23cc5f6 | 7.59 | 14 |
"""ContextVar-scoped accessor for the active :class:`CognitiveState`.
PR-4 C-3 of the cognitive-loop-uplift sprint
(``docs/plans/2026-05-21-cognitive-loop-uplift.md``).
Hooks fired from inside the agentic loop (TOOL_EXEC_ENDED in
particular) need to embed a ``cognitive_state`` snapshot in the
episode they record, but... | mangowhoiscloud/geode | core/agent/cognitive_state_ctx.py | .py | 5027f30f66524872 | 7.59 | 14 |
"""Convergence detection — extracted from AgenticLoop for SRP.
Tracks tool errors and detects stuck loop patterns (repeated identical failures).
v0.90.0 — auto-escalation removed. Earlier revisions retried convergence
breaks by silently escalating to the next model in the fallback chain
(Karpathy P4 runtime ratchet);... | mangowhoiscloud/geode | core/agent/convergence.py | .py | 9960ea239c7b79c0 | 7.59 | 14 |
"""Advisory planning policy reader (legacy target: ``decomposition``).
Applies the SIL ``decomposition`` mutation surface to advisory plan/replan
structure selection. The stable target and file names preserve lineage and
operator overrides; the runtime no longer performs automatic DAG decomposition.
**SoT schema** (모... | mangowhoiscloud/geode | core/agent/decomposition_policy.py | .py | 6beb341e679a555a | 7.59 | 14 |
"""Append-only evidence rows for GEODE runtime decisions."""
from __future__ import annotations
import hashlib
import json
import time
from collections.abc import Callable
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, TypedDict
EVIDENCE_ROW_SCHEMA_VERSION = 2
class Evide... | mangowhoiscloud/geode | core/agent/evidence_ledger.py | .py | 878ec8017efa102d | 7.59 | 14 |
"""Hand-off state machine — DB-backed pending/running/completed/failed.
Adapted from hermes-agent's `sessions` table handoff_state pattern
(`~/workspace/hermes-agent/hermes_state.py:218-220` + `gateway/run.py:
3712-3766` watcher). Three differences vs. the upstream port:
1. **Automatic trigger** — hermes fires on a u... | mangowhoiscloud/geode | core/agent/handoff.py | .py | 40dd45b70e562a61 | 7.59 | 14 |
"""Heuristic indicators SoT reader — ADR-013 T6, JSON mutation surface.
Mutator evolves keyword/phrase lists that prime the LLM's task-triage
heuristics — complexity / risk / time-pressure markers injected into the
system prompt's static block. Promptbreeder-식 evolution: agent uses
indicator phrases to classify the cu... | mangowhoiscloud/geode | core/agent/heuristics_policy.py | .py | 7056febc650dd3fc | 7.59 | 14 |
"""Context-window/message helpers + system-prompt assembly.
Extracted from the monolithic ``core/agent/loop.py`` (Tier 3 #7). Each
function takes the ``AgenticLoop`` as the first parameter (``loop``)
and reads/writes its state. The class methods on ``AgenticLoop`` are
thin one-line delegators.
"""
from __future__ imp... | mangowhoiscloud/geode | core/agent/loop/_context.py | .py | 4fd706a46afedf85 | 7.59 | 14 |
"""Persisted-goal continuation around one physical AgenticLoop turn."""
from __future__ import annotations
import logging
import time
from typing import TYPE_CHECKING, Any
from core.memory.goals import GoalStatus
from .models import AgenticResult, is_successful_task_termination
log = logging.getLogger(__name__)
_M... | mangowhoiscloud/geode | core/agent/loop/_goal.py | .py | eae5b1b909212e3d | 7.59 | 14 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.