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 |
|---|---|---|---|---|---|---|
# SPDX-License-Identifier: Apache-2.0
"""``athenaeum {ingest-answers,ingest-merges,reresolve-questions}`` — pending-sidecar maintenance.
Three subcommands grouped here because each is an idempotent, scheduler-safe
maintenance pass over one of the pending-decision sidecars
(``wiki/_pending_questions.md`` / ``wiki/_pend... | Kromatic-Innovation/athenaeum | src/athenaeum/_cmd_pending.py | .py | 1e20fd10ff053d50 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""``athenaeum questions {list,next,count}`` — surface unresolved pending questions.
Reads ``~/knowledge/wiki/_pending_questions.md`` via the existing
:mod:`athenaeum.answers` parser. Outputs are deterministic and JSON-friendly
so the example SessionStart hook (``pending-questions... | Kromatic-Innovation/athenaeum | src/athenaeum/_cmd_questions.py | .py | 64049373831a72e3 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""``athenaeum repair`` — YAML-frontmatter repair tools.
A single subcommand with a mutually-exclusive repair-mode group
(``--tag-indent`` / ``--value-quoting`` / ``--legacy-source-slugs`` /
``--backfill-sources`` / ``--bounce-fold`` / ``--all``), kept in its own
module because it... | Kromatic-Innovation/athenaeum | src/athenaeum/_cmd_repair.py | .py | 6baae0df46e4e216 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""``athenaeum run`` — execute the librarian pipeline.
Factoring rule (L5 presentation): a self-contained CLI subcommand lives in
its own ``_cmd_<name>.py`` and registers via ``add_<name>_subparser`` — this
is where a NEW subcommand goes, not inline in ``cli.py``'s ``main()``. Thi... | Kromatic-Innovation/athenaeum | src/athenaeum/_cmd_run.py | .py | b826347032e11fbc | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""``athenaeum serve`` — start the MCP memory server.
Factoring rule (L5 presentation): a self-contained CLI subcommand lives in
its own ``_cmd_<name>.py`` and registers via ``add_<name>_subparser`` — this
is where a NEW subcommand goes, not inline in ``cli.py``'s ``main()``. This... | Kromatic-Innovation/athenaeum | src/athenaeum/_cmd_serve.py | .py | 38fedf18e6874984 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""``athenaeum surface-divergence`` — the generalized per-field guard (issue athenaeum#963).
Generalizes ``bounce-divergence`` (issue athenaeum#853) and
``do-not-email-divergence`` (issue athenaeum#960) into ONE command,
parameterized by ``--field``, driven by the :mod:`athenaeum.... | Kromatic-Innovation/athenaeum | src/athenaeum/_cmd_surface_divergence.py | .py | a9c053ed11212473 | 7.54 | 11 |
"""Lint helpers for auto-memory file construction.
Issue athenaeum#183: extracted from ``librarian.py`` so the three
:class:`AutoMemoryFile` construction sites (discovery, cross-scope
similarity sweep, merge-time cluster shim) can share the helper without
:mod:`athenaeum.cross_scope` and :mod:`athenaeum.merge` having ... | Kromatic-Innovation/athenaeum | src/athenaeum/_lint.py | .py | 007f4716cd62a2ad | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""Asserter authority as a PARTIAL ORDER over declared grants (issue athenaeum#715).
Auto-supersession's asserter precondition offers three routes to a winner:
``(a)`` the same asserter revising its own claim, ``(b)`` strictly greater
authority, ``(c)`` equal authority with indepe... | Kromatic-Innovation/athenaeum | src/athenaeum/asserter_authority.py | .py | 602f8d1f7c5f0f58 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""Prune existing operational ``wiki/auto-*.md`` pages (issue athenaeum#278, Part 2).
Part 1 (the ephemeral-intake classifier) stops NEW operational session notes
from becoming durable wiki entities. This driver retires the ones already on
disk: it builds a precise kill-list of op... | Kromatic-Innovation/athenaeum | src/athenaeum/auto_memory_prune.py | .py | d7016444f6798340 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""Axiom promotion/demotion governance + assignment audit (issue athenaeum#434).
Issue athenaeum#424 added ``memory_class: axiom`` as one of the 7 recognized
taxonomy values (see :mod:`athenaeum.schemas`) — but that issue's validator
only checks that the *value itself* is recogniz... | Kromatic-Innovation/athenaeum | src/athenaeum/axiom_governance.py | .py | 8fd6fe04dd302eff | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""Pending-batch handle store and raw-file lease (issue athenaeum#1143).
Foundation for the async submit/collect split (parent epic athenaeum#1138).
Under any design where a run SUBMITS an Anthropic batch and exits, leaving
collection to a later run, the raw files that batch was b... | Kromatic-Innovation/athenaeum | src/athenaeum/batch_state.py | .py | 022030424b121cba | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""The Tier-0 bounce-note contract, and a read-only conformance check (issue athenaeum#854).
`librarian.tier0_bounce_mark` recognizes a hard-bounce fact in an ORDINARY
free-text raw-intake note and marks the address non-deliverable on the
contacts surface, LLM-free (issue athenaeu... | Kromatic-Innovation/athenaeum | src/athenaeum/bounce_contract.py | .py | c0cbf3fd982271c4 | 7.54 | 11 |
# SPDX-License-Identifier: Apache-2.0
"""Bounce-mark divergence across BOTH surfaces (issue athenaeum#853).
A count of one surface cannot tell a healthy system from a broken one here,
and this feature has already been misread twice by exactly that shape of
check — once in each direction (see
``docs/deprecated-email-tr... | Kromatic-Innovation/athenaeum | src/athenaeum/bounce_divergence.py | .py | ef4bf57a6cee6005 | 7.54 | 11 |
"""Mass distribution and inertial properties for lifting surfaces.
This module implements the mass properties computation routines of the
GVM methodology, based on a system of mass particles derived from the
three-dimensional distribution of chord and thickness.
The mass distribution model (Section 2.3.1) uses two ke... | VAero-Lab/AeroShape | aeroshape/analysis/mass.py | .py | 5daa40593fe4ee6e | 7.48 | 8 |
"""Triangular mesh generation for lifting surfaces.
This module implements the structured triangulation approach described
in Section 2.2.1 of the paper. It generates watertight triangulated
meshes from the vertex representation Vk, supporting both solid body
and thin-shell (offset approach) topologies.
The triangula... | VAero-Lab/AeroShape | aeroshape/analysis/mesh.py | .py | ecbe89fec873ba4a | 7.48 | 8 |
"""Volume computation for lifting surfaces and thin-shell structures.
This module implements the volume computation routines of the GVM
methodology, based on the discrete form of the Divergence Theorem.
Supported structural topologies (Fig. 1 in the paper):
- Solid body: direct volume from a watertight triangulated s... | VAero-Lab/AeroShape | aeroshape/analysis/volume.py | .py | 546113174c9d8028 | 7.48 | 8 |
"""Fuselage cross-section generation and representation.
Provides primitive shapes (circle, ellipse, arbitrary NURBS) for
defining the lateral cross-sections of a fuselage.
Coordinate convention:
For fuselages extending along the X-axis, the cross-sections
lie in the YZ plane. By default, profiles are center... | VAero-Lab/AeroShape | aeroshape/geometry/cross_sections.py | .py | 3fdbe51fe43ee2e5 | 7.48 | 8 |
"""Aerodynamic guide curve builder for planforms and lofts.
Provides an exact, mathematically robust API for constructing guide curves
(leading edges, trailing edges) using strict geometric constraints (lines,
tangents, interpolations) without approximations causing wavy artifacts.
"""
from typing import List, Tuple
... | VAero-Lab/AeroShape | aeroshape/geometry/curves.py | .py | 3c1cdb89fe46c299 | 7.48 | 8 |
"""NURBS surface construction operations.
Provides NurbsSurfaceBuilder for creating NURBS surfaces via loft, extrude,
and sweep operations, plus utilities for tessellation, parametric sampling,
OCC-based mass property computation, and B-spline wire/curve construction.
All OCC imports use the OCP package (pip-installa... | VAero-Lab/AeroShape | aeroshape/nurbs/surfaces.py | .py | ebeddab0f78db26a | 7.48 | 8 |
"""Box Wing Assembly Configuration.
Demonstrates assembling a robust box wing aircraft topology.
Highlights the use of deeply embedded MultiSegmentWings (lower deck,
upper deck, and spanning winglets) to construct a continuous closed-loop
surface natively supported by OpenCASCADE boolean representations.
"""
import ... | VAero-Lab/AeroShape | examples/aircraft_box_wing.py | .py | 6e361ecf9c90264c | 7.48 | 8 |
"""Modern Commercial Airliner Configuration.
Demonstrates assembling a robust, highly realistic commercial
transport aircraft. Unifies explicit mathematical fuselage primitives
(Ellipsoids and Paraboloids) with comprehensive MultiSegmentWing
assemblies for the main wing, horizontal stabilizer, and vertical tail.
"""
... | VAero-Lab/AeroShape | examples/aircraft_commercial_airliner.py | .py | dd7440c9e341c1fe | 7.48 | 8 |
"""Experimental Glider Configuration.
Demonstrates combining explicit low-level `NurbsProfile` modeling
for highly customized aerodynamics with a single continuous
curved fuselage boom utilizing the mathematical `guide_curve_z` logic.
"""
import os
import sys
import math
import numpy as np
import time
from aeroshape... | VAero-Lab/AeroShape | examples/aircraft_experimental_glider.py | .py | adb60d8cb1765f71 | 7.48 | 8 |
"""Military Cargo Transport Configuration.
Demonstrates combining explicit `NurbsCrossSection` geometry (to produce
a rounded-square double-bubble cargo fuselage) with high-lift,
strut-braced straight wings. Highlights integration of complex multi-part
geometries into a single analyzable model.
"""
import os
import s... | VAero-Lab/AeroShape | examples/aircraft_military_cargo.py | .py | 5a2199ed94282b6d | 7.48 | 8 |
"""Twin-Boom Aircraft Configuration.
Demonstrates assembling a robust multi-body aircraft involving a central
fuselage pod, two outboard tail booms, connected by spanning inner and
outer multi-segment wings. Highlights spatial assembly and positioning.
"""
import os
import sys
import math
import time
from aeroshape ... | VAero-Lab/AeroShape | examples/aircraft_twin_boom.py | .py | b74709202cf97b85 | 7.48 | 8 |
"""UAV Blended Wing Body Configuration.
Demonstrates integrating a flattened stealth-like body lifting profile
with perfectly swept multi-segment wings. Utilizes exact Elliptical
cross sections seamlessly feeding into a Circular exhaust boundary.
"""
import os
import sys
import math
import time
from aeroshape import... | VAero-Lab/AeroShape | examples/aircraft_uav_bwb.py | .py | 412bfea5b742c5cf | 7.48 | 8 |
"""Analytical validation using a unit cube (Section 3.1.1 of the paper).
Validates the Divergence Theorem implementation by computing the
volume of a 1x1x1 unit cube, whose analytical volume is 1.0 m^3.
The Divergence Theorem requires consistently-oriented normals (all
outward or all inward). This test uses outward-p... | VAero-Lab/AeroShape | examples/analytical_validation.py | .py | 7c7dc07a4fff1bfa | 7.48 | 8 |
import pytest
import numpy as np
from aeroshape.geometry.airfoils import AirfoilProfile, NACAProfileGenerator, NurbsProfile
def test_naca4_generation():
"""Test standard 4-digit NACA profile generation."""
x, z = NACAProfileGenerator.generate("2412", num_points=50, chord=1.0)
# 50 points per surface, ... | VAero-Lab/AeroShape | tests/test_airfoils.py | .py | d665a8532ac4654b | 7.98 | 8 |
import pytest
import numpy as np
from aeroshape.geometry.airfoils import AirfoilProfile
from aeroshape.geometry.wings import MultiSegmentWing, SegmentSpec
from aeroshape.geometry.aircraft import AircraftModel
@pytest.fixture
def box_wing():
"""Create a simple untapered, unswept wing (like a box) for validation."""... | VAero-Lab/AeroShape | tests/test_analysis.py | .py | e75dda571c9cb4cd | 7.98 | 8 |
import os
import pytest
from aeroshape.geometry.airfoils import AirfoilProfile
from aeroshape.geometry.wings import MultiSegmentWing, SegmentSpec
from aeroshape.geometry.aircraft import AircraftModel
from aeroshape.nurbs.export import NurbsExporter
@pytest.fixture
def simple_aircraft():
root = AirfoilProfile.from_... | VAero-Lab/AeroShape | tests/test_export.py | .py | b442c2ac339030d8 | 7.98 | 8 |
import pytest
import numpy as np
from aeroshape.geometry.airfoils import AirfoilProfile
from aeroshape.geometry.wings import MultiSegmentWing, SegmentSpec
@pytest.fixture
def base_airfoils():
root = AirfoilProfile.from_naca4("0012", num_points=20)
tip = AirfoilProfile.from_naca4("0012", num_points=20)
retu... | VAero-Lab/AeroShape | tests/test_wings.py | .py | 813032c9a26630f1 | 7.98 | 8 |
"""Constants for sssom-curator."""
from __future__ import annotations
from collections.abc import Collection, Iterable
from pathlib import Path
from typing import TYPE_CHECKING, Literal, TypeAlias
from curies import NamedReference
from pydantic import AnyUrl
if TYPE_CHECKING:
import curies
from sssom_pydant... | cthoyt/sssom-curator | src/sssom_curator/constants.py | .py | 77386b187ec15887 | 7.52 | 10 |
"""Export Biomappings as SSSOM."""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from pathlib import Path
import curies
from sssom_pydantic import MappingSet, Metadata, SemanticMapping
from ..repository import Repository
__all__ = [
"merge",
]
def _sss... | cthoyt/sssom-curator | src/sssom_curator/export/merge.py | .py | cb92fd98bf26af28 | 7.52 | 10 |
"""Utilities for lexical prediction workflows."""
from __future__ import annotations
import curies
from bioregistry import NormalizedReference
from curies.vocabulary import exact_match
from sssom_pydantic import MappingTool
from ..constants import TOOL_NAME, TOOL_REFERENCE
from ..version import get_version
__all__ ... | cthoyt/sssom-curator | src/sssom_curator/predict/utils.py | .py | a2a827e81e66906c | 7.52 | 10 |
"""Validation tests for :mod:`biomappings`."""
from __future__ import annotations
import unittest
from collections import defaultdict
from collections.abc import Callable, Iterable
from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias, TypeVar
import curies
if TYPE_CHECKING:
from c... | cthoyt/sssom-curator | src/sssom_curator/testing.py | .py | 8b9ff66e4b644868 | 8.02 | 10 |
"""Version information for :mod:`sssom_curator`.
Run with ``python -m sssom_curator.version``
"""
import os
from subprocess import CalledProcessError, check_output
__all__ = [
"VERSION",
"get_git_hash",
"get_version",
]
VERSION = "0.6.3-dev"
def get_git_hash() -> str:
"""Get the :mod:`sssom_curato... | cthoyt/sssom-curator | src/sssom_curator/version.py | .py | 1f2ec5edc6c3dc4f | 7.52 | 10 |
"""An abstract backend for the SSSOM Curator web application."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections import Counter
from collections.abc import Iterable, Sequence
import curies
from curies import Reference
from sssom_pydantic import SemanticMapping
from sssom_pydan... | cthoyt/sssom-curator | src/sssom_curator/web/backends/base.py | .py | 5441e23e876095aa | 7.52 | 10 |
"""A SQL database backend for the SSSOM Curator web application."""
from __future__ import annotations
from collections import Counter
from collections.abc import Iterable, Sequence
from typing import TYPE_CHECKING
import curies
import sssom_pydantic
from curies import Reference
from sssom_pydantic import MappingSet... | cthoyt/sssom-curator | src/sssom_curator/web/backends/database.py | .py | 4a74fc1b8b32daf2 | 7.52 | 10 |
"""A dictionary-based backend for the SSSOM Curator web application."""
from __future__ import annotations
from collections import Counter, defaultdict
from collections.abc import Iterable, Sequence
from functools import partial
from typing import TYPE_CHECKING
import curies
import sssom_pydantic
from curies import ... | cthoyt/sssom-curator | src/sssom_curator/web/backends/memory.py | .py | df2acf516a728fc1 | 7.52 | 10 |
"""Blueprint."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, cast
import flask
import werkzeug
from curies import Reference
from flask import current_app
from sssom_pydantic.process import MARKS, Mark
from werkzeug.local import LocalProxy
from .utils import PersistRemoteFailure, Persis... | cthoyt/sssom-curator | src/sssom_curator/web/blueprint.py | .py | fb0eacea5088fe1c | 7.52 | 10 |
"""SSSOM Curator web application factory."""
from __future__ import annotations
from typing import TYPE_CHECKING, Literal, TypeAlias
if TYPE_CHECKING:
from collections.abc import Iterable
import flask
import werkzeug
from curies import Converter, Reference
from .backends import Controller
f... | cthoyt/sssom-curator | src/sssom_curator/web/factory.py | .py | be7d704a2942c721 | 7.52 | 10 |
"""Utilities for the web app."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, Literal, NamedTuple
from pydantic import BaseModel, Field
from sssom_pydantic.query import Query, Sort
if TYPE_CHECKING:
from subprocess import CalledProcessError
__all__ = [
"Pagi... | cthoyt/sssom-curator | src/sssom_curator/web/utils.py | .py | 4127be8d336b0010 | 7.52 | 10 |
"""A test case with a repository."""
import tempfile
import unittest
from pathlib import Path
from typing import ClassVar
import curies
from sssom_pydantic import MappingSet, SemanticMapping
from sssom_curator import Repository
from sssom_curator.initialize import initialize_folder
__all__ = [
"RepositoryTestCa... | cthoyt/sssom-curator | tests/cases.py | .py | ca25c0a60e82087d | 8.02 | 10 |
"""Test controllers."""
import tempfile
from pathlib import Path
from typing import ClassVar
from sssom_curator.web.backends.base import Controller
from sssom_curator.web.backends.database import DatabaseController
from sssom_curator.web.backends.memory import DictController
from tests import wsgi_cases
class TestF... | cthoyt/sssom-curator | tests/test_controller.py | .py | 9670b9fe05b749ba | 8.02 | 10 |
"""Test initialization."""
import tempfile
import unittest
from pathlib import Path
from textwrap import dedent
from sssom_pydantic import MappingSet
from sssom_curator.constants import NEGATIVES_NAME, POSITIVES_NAME, PREDICTIONS_NAME
from sssom_curator.initialize import initialize_folder
TEST_PURL_BASE = "https://... | cthoyt/sssom-curator | tests/test_init.py | .py | 0e9fba88b39a5cc4 | 7.02 | 10 |
"""Test lexical mapping."""
import unittest
import unittest.mock
import pandas as pd
import ssslm
import sssom_pydantic
from curies import NamableReference
from curies.vocabulary import exact_match, manual_mapping_curation
from sssom_pydantic import SemanticMapping
from sssom_pydantic.examples import R1, R2
from sss... | cthoyt/sssom-curator | tests/test_lexical.py | .py | 50a7c3162768b4f2 | 8.02 | 10 |
"""Tests for merging."""
import datetime
from textwrap import dedent
import curies
from curies.vocabulary import charlie, manual_mapping_curation
from sssom_pydantic import SemanticMapping
from sssom_curator.export.merge import _get_merged_sssom, merge
from sssom_curator.initialize import (
EXAMPLE_NEGATIVE_MAPP... | cthoyt/sssom-curator | tests/test_merge.py | .py | 24d7533e03e46ee1 | 8.02 | 10 |
"""Trivial version test."""
import unittest
from sssom_curator.version import get_version
class TestVersion(unittest.TestCase):
"""Trivially test a version."""
def test_version_type(self) -> None:
"""Test the version is a string.
This is only meant to be an example test.
"""
... | cthoyt/sssom-curator | tests/test_version.py | .py | aab3a0ea1d2d2818 | 7.52 | 10 |
"""Test the web app."""
import datetime
from collections import Counter
from collections.abc import Sequence
from pathlib import Path
from typing import Any, ClassVar
import curies
import sssom_pydantic
from curies import NamedReference, Reference
from curies.vocabulary import (
broad_match,
exact_match,
... | cthoyt/sssom-curator | tests/wsgi_cases.py | .py | 9eb31b0c03a4ebaf | 7.02 | 10 |
import hashlib
import logging
from typing import Optional
from dagster import (
DagsterInstance,
DagsterRun,
QueuedRunCoordinator,
SubmitRunContext,
)
log = logging.getLogger(__name__)
TARGET_TAG_KEY = "cfa_dagster/target"
MAX_TAG_LENGTH = 255
class CFAQueuedRunCoordinator(QueuedRunCoordinator):
... | CDCgov/cfa-dagster | src/cfa_dagster/execution/run_coordinator.py | .py | 8874594ec92125b3 | 7.48 | 8 |
import json
import logging
import os
from collections.abc import Mapping
from datetime import datetime, timezone
from typing import Any, Optional, Union
import yaml
from dagster import (
DagsterRun,
DefaultRunLauncher,
JsonMetadataValue,
)
from dagster._core.launcher.base import (
CheckRunHealthResult,... | CDCgov/cfa-dagster | src/cfa_dagster/execution/run_launcher.py | .py | 138d143365855b16 | 7.48 | 8 |
import logging
import os
import subprocess
from typing import Iterator, Optional, cast
import dagster._check as check
from dagster import (
DagsterEvent,
ExecutorDefinition,
InitExecutorContext,
MetadataValue,
in_process_executor,
multiprocess_executor,
)
from dagster._core.events import Engine... | CDCgov/cfa-dagster | src/cfa_dagster/execution/step_handler.py | .py | 9092f799a3951316 | 7.48 | 8 |
import json
import logging
from dataclasses import dataclass, field
from typing import Any, Dict, Mapping, Optional
from dagster import (
DagsterInvalidConfigError,
Field,
Int,
MetadataValue,
Noneable,
Selector,
Shape,
in_process_executor,
multiprocess_executor,
)
from dagster._conf... | CDCgov/cfa-dagster | src/cfa_dagster/execution/utils.py | .py | f5816f3c5d3aac8f | 7.48 | 8 |
import os
from unittest.mock import patch
from cfa_dagster.execution.utils import get_dynamic_executor_config_schema
def test_dynamic_schema_in_dev_mode():
"""Test that the dynamic schema includes dev-only options when in dev mode"""
# Simulate dev mode by setting DAGSTER_IS_DEV_CLI
with patch.dict(os.en... | CDCgov/cfa-dagster | tests/test_dynamic_schema.py | .py | 04515a890b2d2fa8 | 7.98 | 8 |
"""Shared fixtures: one generated fictional corpus in a session temp folder."""
from __future__ import annotations
from pathlib import Path
import pytest
from ap_engine.engine import analyze_folder
from ap_engine.generate import generate_corpus
from ap_engine.model import DocumentReport
@pytest.fixture(scope="ses... | sophonfinance-wq/finance-automation-portfolio | accounts-payable-automation/ap_engine/tests/conftest.py | .py | 7726701a8373a883 | 8.02 | 10 |
"""The registry, the severity table and the fixture set must stay in step.
A rule can never be added without a fixture that exercises it, a severity the
design table agrees with, and an applier that plants the defect. These tests are
the mechanism that enforces that.
"""
from __future__ import annotations
from ap_en... | sophonfinance-wq/finance-automation-portfolio | accounts-payable-automation/ap_engine/tests/test_checks_coverage.py | .py | f39d1a86a01f8e44 | 8.02 | 10 |
"""The clean baseline document set must satisfy every registered control.
A control engine that flags a clean run is worse than no engine: reviewers stop
reading it. These tests pin the false-positive surface, including the four
benign cases the design calls out explicitly.
"""
from __future__ import annotations
fro... | sophonfinance-wq/finance-automation-portfolio | accounts-payable-automation/ap_engine/tests/test_clean_baseline.py | .py | 83fc6b0bff1b880e | 7.02 | 10 |
"""Every planted defect must trip its own control, and only its own control.
Three assertions per rule, parametrized over :data:`ap_engine.generate.DEFECTS`:
1. the rule fires on its own fixture,
2. at the severity the design table specifies (FAIL vs FLAG),
3. and nothing else fires on that fixture -- so a passing su... | sophonfinance-wq/finance-automation-portfolio | accounts-payable-automation/ap_engine/tests/test_planted_defects.py | .py | e50afc7fc33bb0b1 | 8.02 | 10 |
"""The engine must be strictly read-only and fully deterministic.
Three contract tests:
1. analyzing a corpus does not change a single byte on disk,
2. two generations with the same seed produce identical ``.json`` documents,
3. two runs over the same corpus produce identical findings once the one
legitimately var... | sophonfinance-wq/finance-automation-portfolio | accounts-payable-automation/ap_engine/tests/test_readonly_and_determinism.py | .py | 9f51fda2d6899036 | 8.02 | 10 |
"""The published artifacts must have a stable shape and stay plain ASCII."""
from __future__ import annotations
import json
from ap_engine.engine import REGISTRY, RULE_FAMILIES, analyze_folder, overall_verdict
from ap_engine.model import DocumentReport, Finding, Status, Verdict
from ap_engine.report import (
ENG... | sophonfinance-wq/finance-automation-portfolio | accounts-payable-automation/ap_engine/tests/test_report_structure.py | .py | 4ac188ad99476caf | 8.02 | 10 |
"""A deliberately tiny, safe arithmetic formula evaluator.
Workpaper formulas look like ``"=B2+B3-B4"`` -- references to other cells
joined by ``+``, ``-``, ``*`` and ``/`` with optional parentheses and numeric
literals. We do NOT use :func:`eval`. Instead we tokenise and run a small
shunting-yard evaluator, so a mali... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/formula.py | .py | a8c72148a75082bf | 7.52 | 10 |
"""Synthetic, fully-fictional sample workpaper generator.
Everything produced here is fake by construction: entity names come from a
hard-coded list of obviously-invented placeholders ("Demo Holdings LLC",
"Maple Fund LP", ...), and all figures are drawn from the stdlib :mod:`random`
module seeded for full reproducibi... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/generate.py | .py | 8d604daf1a76eca6 | 7.52 | 10 |
"""Finding reconciliation and the final VERDICT / HumanGate.
The reconciler takes every finding raised across the pipeline (Reviewer,
Specialist, Audit), de-duplicates and ranks them using the severity taxonomy
and the source-of-truth authority hierarchy, and produces a structured
:class:`Verdict`. The :class:`HumanGa... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/reconcile.py | .py | 129c3d8caaca6558 | 7.52 | 10 |
"""The deterministic, read-only automated Audit step.
A script cannot hallucinate "yes." This auditor re-derives every formula cell
mechanically and confirms structural integrity. It is the machine backstop the
framework relies on between AI review and human sign-off.
"""
from __future__ import annotations
from typi... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/roles/auditor.py | .py | b02d354a447caeaf | 7.52 | 10 |
"""Role interfaces (the pluggable contracts).
These abstract base classes define the separation of duties at the type level:
* A :class:`Preparer` is the *only* role handed a live, mutable
:class:`~triangulate.model.Workpaper`.
* A :class:`Reviewer`, :class:`Specialist` (in its review capacity) and
:class:`Audito... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/roles/base.py | .py | b47098aecc739ca4 | 7.52 | 10 |
"""The Preparer role -- builds and normalises the workpaper."""
from __future__ import annotations
from typing import List
from triangulate.formula import evaluate
from triangulate.generate import build_sample, make_adversarial_workpaper
from triangulate.model import Workpaper
from triangulate.roles.base import Prep... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/roles/preparer.py | .py | a63abfcfb1f2c50d | 7.52 | 10 |
"""The adversarial Reviewer role and its pluggable LLM backend.
Design:
* :class:`LLMReviewer` is the abstract *backend* interface -- "given a
read-only workpaper rendered as a prompt, return structured findings."
* :class:`MockLLMReviewer` is a **deterministic** implementation that runs the
whole pipeline with N... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/roles/reviewer.py | .py | 15005427ec4a0499 | 7.52 | 10 |
"""The Specialist role -- supporting transforms and a read-only second opinion."""
from __future__ import annotations
from typing import List
from triangulate.model import (
AuthoritySource,
Finding,
ReadOnlyWorkpaperView,
Severity,
Workpaper,
)
from triangulate.roles.base import Specialist
cla... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/roles/specialist.py | .py | 3ded1f70f0ecbbbf | 8.02 | 10 |
"""The adversarial demo is the portfolio's load-bearing claim, so it is pinned.
`--demo-adversarial` injects ONE hallucinated figure into an otherwise-clean
workpaper. The pipeline must catch it deterministically (Reviewer *and*
independent Auditor), return FAIL, and exit non-zero. A clean workpaper must
remain eligib... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/tests/test_adversarial_demo.py | .py | 12cbdf907c1036fc | 8.02 | 10 |
"""Bulk invariant grid for the Triangulate formula evaluator.
The evaluator (``triangulate.formula.evaluate``) is a pure, eval-free
shunting-yard arithmetic engine. Over INTEGER inputs the basic arithmetic
identities are exact (no float rounding), so we can assert them across a
very large Cartesian product of operand ... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/tests/test_bulk_invariant_grid.py | .py | 45a413d255396e6e | 7.02 | 10 |
"""Curated invariant grid for the Triangulate formula evaluator (1,500 cases).
A bounded, CI-gating slice of the SWEEP-gated ``test_bulk_invariant_grid.py``.
The evaluator is a pure, eval-free shunting-yard arithmetic engine, so over
integer inputs the basic identities are exact:
* ``=B2+B3`` -> ``a + b``; ``=B2-B3``... | sophonfinance-wq/finance-automation-portfolio | ai-validation-framework/triangulate/tests/test_curated_invariant_grid.py | .py | 8dc55c36e2289cfc | 8.02 | 10 |
#!/usr/bin/env python3
"""Structural checks for the skills in this repo. Standard library only.
Scope, stated plainly: this validates STRUCTURE, not quality. Most skills
here are prose, and nothing automated can tell you whether a skill's
instructions are good. What it catches is the drift that accumulates
silently ac... | kevin-burns/claude-skills | .github/scripts/check_conventions.py | .py | 2c718f13af87d925 | 7.48 | 8 |
#!/usr/bin/env python3
"""Grade a code-builder run against eval.json.
Usage: uv run python grade.py <eval.json> <workspace>
expects <workspace>/seed-a, <workspace>/seed-b (repos) and
<workspace>/run/seed-a.json, <workspace>/run/seed-b.json (agent results)
Exit 0 if all assertions pass, 1 otherwise.
"""
imp... | kevin-burns/claude-skills | agents/code-builder/evals/grade.py | .py | 02fd768fb4657459 | 7.48 | 8 |
"""Small stats helpers — fixture for the code-reviewer behavioral eval.
Contains ONE planted correctness bug (median, even-length branch) and one
deliberately-correct function (clamp) as a precision control: the reviewer
should flag the former and NOT invent a blocking issue in the latter.
"""
def median(nums):
... | kevin-burns/claude-skills | agents/code-reviewer/evals/fixtures/stats.py | .py | 8fc181a7bf95b92d | 7.48 | 8 |
"""Tiny record codec — fixture for the coherence-checker behavioral eval.
Per SPEC.md, encode/decode MUST round-trip EXACTLY: decode(encode(fields)) == fields,
including a trailing empty field. case_fold() is a separate helper whose contract IS to
lowercase (the precision control).
"""
def encode(fields):
"""Ser... | kevin-burns/claude-skills | agents/coherence-checker/evals/fixtures/codec.py | .py | 64be8a64c7cd56c4 | 7.48 | 8 |
"""Tests for codec — fixture for the coherence-checker behavioral eval.
ONE planted coherence failure: test_roundtrip looks like an identity check but rstrip()s
both sides, papering over decode() dropping the trailing empty field (inverse-pair check).
The control test lowercases legitimately — that's case_fold's contr... | kevin-burns/claude-skills | agents/coherence-checker/evals/fixtures/test_codec.py | .py | ecd256710c38bd8e | 7.98 | 8 |
#!/usr/bin/env python3
"""Grade a coherence-checker run against eval.json.
Usage: uv run python grade.py <eval.json> <coherence.json>
Exit 0 if all assertions pass, 1 otherwise.
The agent is run out-of-band (it needs the fixture dir + SPEC.md + the round-trip test);
save its JSON return to <coherence.json>, then grad... | kevin-burns/claude-skills | agents/coherence-checker/evals/grade.py | .py | b5bdbdb510fd74fa | 7.48 | 8 |
#!/usr/bin/env python3
"""Deterministic checks for a LinkedIn profile draft.
Character counting is the load-bearing part. LinkedIn's field counters run in
the browser, and ECMAScript defines String.prototype.length as the number of
UTF-16 code units -- so an emoji (a surrogate pair) counts as 2 there and as 1
under Py... | kevin-burns/claude-skills | cv-and-human/scripts/li_profile_check.py | .py | 3b7ecd8f3a9197b8 | 7.48 | 8 |
import json
import os
import subprocess
import sys
from pathlib import Path
from li_profile_check import count_chars, utf16_slice
SCRIPT = Path(__file__).parent.parent / "scripts" / "li_profile_check.py"
def test_count_chars_matches_js_string_length():
# JS String.prototype.length counts UTF-16 code units.
... | kevin-burns/claude-skills | cv-and-human/tests/test_li_profile_check.py | .py | 9ba57f15b76d5197 | 7.98 | 8 |
#!/usr/bin/env python3
"""Build the three ablation arms for clear-and-human.
A = SKILL.md + all three references, inlined.
B = identical to A, minus references/ai-patterns.md and minus every pointer to it.
C = nothing (no skill).
The only difference between A and B is the pattern list and the sentences that
point at ... | kevin-burns/claude-skills | evals/ablation/build_arms.py | .py | bb8acd0d353742cb | 7.48 | 8 |
#!/usr/bin/env python3
"""Fabrication metric: did the rewrite invent specifics the input did not have?
Core rule 1 of clear-and-human is "never invent specifics to add texture".
Coverage Jaccard cannot see a breach of it -- an arm can flag exactly the right
tells and then fabricate freely in the rewrite. This counts t... | kevin-burns/claude-skills | evals/ablation/fabrication.py | .py | d316d83829c8d6f0 | 7.48 | 8 |
#!/usr/bin/env python3
"""Grade the ablation runs mechanically.
The instrument is a coverage mask, not a label match. Each `tells[].quote` is
located in the case input and the character span it covers is marked. An arm's
output becomes a set of input positions it objected to. That is granularity
robust: "robust" and "... | kevin-burns/claude-skills | evals/ablation/grade.py | .py | fb2df5936a16ad5c | 7.48 | 8 |
#!/usr/bin/env python3
"""Grade the anchoring test: does a member echo vocabulary it could only have got
from the members that preceded it?
The metric is BORROWED VOCABULARY. Build three bags of content words:
brief the shared input both conditions see
prefix the five preceding contributions (LAST condition ... | kevin-burns/claude-skills | evals/council/anchor_grade.py | .py | c10356be18f80584 | 7.48 | 8 |
"""Render Excalidraw JSON to PNG using Playwright + headless Chromium.
Rendering is offline: the fonts are vendored under ``vendor/`` and the Excalidraw
engine (``vendor/excalidraw.mjs``) is downloaded once on first run from a pinned,
sha256-verified GitHub Release (see ``vendor/bundle.lock.json``) — like
``playwright... | kevin-burns/claude-skills | excalidraw-diagram/references/render_excalidraw.py | .py | f1556efa159d5e6b | 7.48 | 8 |
"""Place one icon from a split library into an .excalidraw diagram.
Deterministic and context-free: the icon's (often huge) JSON never enters the
agent's context. Offsets the icon to a target position, regenerates every
element id and groupId so repeated placements never collide, keeps internal
groups/bindings consist... | kevin-burns/claude-skills | excalidraw-diagram/references/scripts/place_icon.py | .py | 5e0da921095adc17 | 7.48 | 8 |
"""Split an Excalidraw library (.excalidrawlib) into per-icon JSON + an index.
Ingest a library once so the agent browses a lightweight `reference.md` (name →
file → size) and never loads 200–1000-line icon JSON into context. Pair with
`place_icon.py`, which places an icon into a diagram deterministically.
Usage:
... | kevin-burns/claude-skills | excalidraw-diagram/references/scripts/split_library.py | .py | c7653937c2828f6b | 7.48 | 8 |
#!/usr/bin/env python3
"""Check the installed `ghst` against the version this skill's traps were verified on.
WHY THIS EXISTS. SKILL.md and README.md both say "verified against 0.16.6 -- re-check the
traps above after an upgrade". That is a pin written in prose, which nothing enforces. The
same shape cost an afternoon... | kevin-burns/claude-skills | ghost-publish/scripts/preflight.py | .py | afec9c7b4a112827 | 7.48 | 8 |
#!/usr/bin/env python3
"""Split a markdown post into the body Ghost should receive and the metadata
it should receive separately.
`ghst post create --markdown-file` transmits the file verbatim. Ghost has no
concept of front matter -- unlike Hugo or Jekyll, where the `---` block is
metadata, Ghost treats it as prose an... | kevin-burns/claude-skills | ghost-publish/scripts/prepare_post.py | .py | 4e54f712b67afc5c | 7.48 | 8 |
#!/usr/bin/env python3
"""Offline behavioural eval for job-feeds. Exits non-zero on any failure.
Run: uv run evals/grade.py
or: python3 evals/grade.py (the skill is stdlib-only)
This is deliberately NOT a re-run of the unit suite. It asserts the handful
of behaviours whose absence would be SILENT in daily... | kevin-burns/claude-skills | job-feeds/evals/grade.py | .py | 8875e5b39ffed2aa | 7.48 | 8 |
"""Hacker News plugin - declarative login example (NoDriver).
Site: https://news.ycombinator.com
Auth: Requires real Hacker News account
Usage:
1. Symlink: ln -s $(pwd)/examples/plugins/hackernews.py ~/.config/graftpunk/plugins/
2. Login: gp hn login
3. Use: gp hn front
"""
from graftpunk.plugins import ... | stavxyz/graftpunk | examples/plugins/hackernews.py | .py | 5bf1b70a945922c6 | 7.48 | 8 |
"""Quotes to Scrape plugin - declarative login example (Selenium).
Site: https://quotes.toscrape.com
Auth: Any username/password works (test site)
Usage:
1. Symlink: ln -s $(pwd)/examples/plugins/quotes.py ~/.config/graftpunk/plugins/
2. Login: gp quotes login
3. Use: gp quotes list
"""
from graftpunk.pl... | stavxyz/graftpunk | examples/plugins/quotes.py | .py | 79787bb7f62f486e | 7.48 | 8 |
"""Python Plugin Template.
Copy this file and customize for your site.
Save or symlink to: ~/.config/graftpunk/plugins/<name>.py
Documentation: https://github.com/stavxyz/graftpunk
"""
from graftpunk import BrowserSession, cache_session
from graftpunk.plugins import CommandContext, SitePlugin, command
class MySite... | stavxyz/graftpunk | examples/templates/python_template.py | .py | a3c412b79b5eb42b | 7.48 | 8 |
"""graftpunk - Authenticated browser sessions, captured once and replayed over plain
HTTP: stealth login, encrypted at rest, pluggable storage.
Log in through a real browser once; graftpunk captures the authenticated session —
cookies, browser-fingerprinted headers, CSRF/API tokens — encrypts it at rest, and
replays i... | stavxyz/graftpunk | src/graftpunk/__init__.py | .py | c9ae70b7dbf21f4d | 7.48 | 8 |
"""Browser automation backends for graftpunk.
This module provides pluggable browser backends with a unified interface.
The default backend is "selenium" (using undetected-chromedriver).
All browser backends require the browser automation stack, which is an optional
extra: `pip install 'graftpunk[browser]'`. The base... | stavxyz/graftpunk | src/graftpunk/backends/__init__.py | .py | 2ac582bc180d9a42 | 7.48 | 8 |
"""Selenium-based browser backend using undetected-chromedriver.
This backend wraps graftpunk's existing stealth browser automation stack,
providing the BrowserBackend interface while maintaining full backward
compatibility with existing functionality.
Example:
>>> from graftpunk.backends.selenium import Selenium... | stavxyz/graftpunk | src/graftpunk/backends/selenium.py | .py | 640c381a36425cf8 | 7.48 | 8 |
"""Typer-native construction of plugin CLI commands.
Construction ONLY: mapping ``PluginParamSpec`` -> Typer parameter declarations
and synthesizing registerable command functions. The run-time execution
pipeline lives in ``cli/plugin_runtime.py`` (see the RFC: the factory is
body-parameterized; construction and execu... | stavxyz/graftpunk | src/graftpunk/cli/command_factory.py | .py | 8facde27be4179c8 | 7.48 | 8 |
"""gp config — inspect and manage graftpunk configuration.
Bare `gp config` renders the settings panel (behavior migrated verbatim from
the old root-level command); the verbs manage the workstation env file
(spec: docs/rfcs/2026-07-28-workstation-env.md).
"""
import os
import shlex
import subprocess
import typer
fro... | stavxyz/graftpunk | src/graftpunk/cli/config_commands.py | .py | 033569a9e8945e78 | 7.48 | 8 |
"""Ad-hoc HTTP requests with cached session cookies.
Provides the ``gp http`` command group for making authenticated HTTP
requests using session cookies cached by graftpunk plugins. Supports
browser-like headers, JSON/form bodies, token injection, and built-in
observability via HAR capture.
"""
from __future__ import... | stavxyz/graftpunk | src/graftpunk/cli/http_commands.py | .py | 06a0d2643e3f662d | 7.48 | 8 |
"""CLI command for importing HAR files and generating plugins.
This command analyzes HAR files captured from browser developer tools
and generates graftpunk plugins from them.
"""
from __future__ import annotations
from pathlib import Path
from typing import Annotated
import typer
from rich.console import Console
f... | stavxyz/graftpunk | src/graftpunk/cli/import_har.py | .py | 7ce87368b40230a8 | 7.48 | 8 |
"""Dynamic CLI command registration for plugins.
This module discovers and registers plugin commands with Typer at startup.
Python plugins (via entry points), Python file plugins (from the plugins
directory), and YAML plugins are all supported.
"""
from __future__ import annotations
import atexit
from dataclasses im... | stavxyz/graftpunk | src/graftpunk/cli/plugin_commands.py | .py | 01f70432ef6b38c8 | 7.48 | 8 |
"""Run-time execution pipeline for plugin CLI commands.
Execution ONLY (the construction factory lives in ``cli/command_factory.py``).
``run_plugin_command`` is the verbatim 12-step pipeline formerly inlined in
``_create_plugin_command``'s callback: session load -> observe -> token inject
-> execute_plugin_command -> ... | stavxyz/graftpunk | src/graftpunk/cli/plugin_runtime.py | .py | 97ee05bd780d0d47 | 7.48 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.