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 |
|---|---|---|---|---|---|---|
from transformers import CLIPTokenizer
from transformers.utils import logging
logger = logging.get_logger(__name__)
VOCAB_FILES_NAMES = {
"vocab_file": "vocab.json",
"merges_file": "merges.txt",
}
PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {
"lb203/LanguageBind-Audio": "https://huggingface.co/l... | oosuhada/multimodal-context-engine | languagebind/audio/tokenization_audio.py | .py | b6246a588befa63b | 7 | 0 |
"""
Phase 1 (Macroscopic) acoustic-distortion metrics from METRICS.md:
Mel-Cepstral Distortion (MCD) and F0 Frame Error / Pitch Pearson Correlation
between baseline and quantized waveforms for the same prompt.
These operate on raw audio rather than codec tokens, so they are naturally
codec-agnostic and apply the same ... | AdityaKulshrestha/Speech-Quant | src/evaluation/acoustic_metrics.py | .py | 191f7c163bc8b5d2 | 7 | 0 |
"""
Token-divergence metrics from METRICS.md: First Divergence Position (FDP)
and Cumulative Divergence Rate (D(t)), comparing a quantized model's
generated codec tokens against the full-precision baseline for the same
prompt.
Extended metrics:
- codebook_ids_for_tokens: maps flat token positions to SNAC codebook (0... | AdityaKulshrestha/Speech-Quant | src/evaluation/metrics.py | .py | a31489b4a4934da1 | 7 | 0 |
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from typing import Any, Optional
import torch
@dataclass
class GenerationOutput:
"""
Output of the autoregressive generation stage.
generated_ids:
Complete output from the language model, including prompt tokens.
a... | AdityaKulshrestha/Speech-Quant | src/models/base.py | .py | 334aaefb96cddf18 | 7 | 0 |
#!/usr/bin/env python3
"""Regenerate MANIFEST.sha256 for a skill bundle (deterministic, LF-normalized).
Usage:
py -3 scripts/regen_manifest.py plugins/manage-math-research-program/skills/manage-math-research-program
"""
from __future__ import annotations
import argparse
import hashlib
import pathlib
import sys
... | xsoc1/rigorous-open-math-research | scripts/regen_manifest.py | .py | d61be84a7d11ec7b | 7.39 | 5 |
#!/usr/bin/env python3
"""Smoke test for the workflow environment doctor (no live codex needed)."""
from __future__ import annotations
import json
import os
import subprocess
import sys
import tempfile
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SCRIPT = ROOT / "plugins" / "math-research-wor... | xsoc1/rigorous-open-math-research | tests/smoke_doctor.py | .py | a54a8807fa29763d | 7.89 | 5 |
#!/usr/bin/env python3
"""Smoke test for lake_build_guard.py.
Verifies that the guard:
1. allows a first build check;
2. refuses when a fresh lock exists;
3. releases the lock;
4. refuses when too many recent build attempts are logged;
5. allows again after clearing state.
"""
from __future__ import annotat... | xsoc1/rigorous-open-math-research | tests/smoke_lake_build_guard.py | .py | db46aa879ef0d038 | 7.89 | 5 |
#!/usr/bin/env python3
"""Smoke test: the pipeline gate must ignore nested git repositories.
A project may contain a cloned plugin repo (e.g. `_xsoc1_work/`) whose test
fixtures intentionally contain failing handoffs/whiteboards. The gate must not
validate those as part of the parent project.
"""
from __future__ impo... | xsoc1/rigorous-open-math-research | tests/smoke_nested_repo.py | .py | 7be55b113c6fc9b5 | 7.89 | 5 |
"""Questions about a potential map, answered in bytes rather than megabytes.
An agent cannot use a 12 MB grid — it can use "the most negative patch is at
these coordinates" or "this residue sits at -3.2 kT/e". ROADMAP.md §6 argues
this is where the agent-facing value is, and that moving the volume around is
the wrong ... | chemrich/sashimi | src/sashimi/analysis.py | .py | 7142065d5613d080 | 7 | 0 |
"""ApbsSolver — the subprocess backend, and the only thing debye replaces."""
from __future__ import annotations
from dataclasses import dataclass, field
from sashimi.apbs.discover import ApbsBinary, discover_apbs
from sashimi.apbs.grid import size_grid
from sashimi.apbs.input import build_input, resolved_parameters... | chemrich/sashimi | src/sashimi/apbs/backend.py | .py | 8bdb112a0cc1eaa5 | 7 | 0 |
"""Locating the APBS binary.
Order: `$SASHIMI_APBS_PATH`, then `shutil.which`, then an active conda
environment. APBS is a compiled binary that no Python installer can provide, so
it comes from the system package manager (`brew install apbs`, `apt install
apbs`) and `which` is the normal answer. The conda fallback is ... | chemrich/sashimi | src/sashimi/apbs/discover.py | .py | 0f700a16706dde65 | 7 | 0 |
"""Physical grid intent -> legal APBS mg-auto parameters.
This is where `GridSpec`'s physics becomes APBS's arithmetic, and it is the
reason `GridSpec` has no `dime`. APBS's multigrid requires dimensions of the
form n = c * 2^(l+1) + 1; with the default 4 levels that is n = 32c + 1, i.e.
33, 65, 97, 129, 161, ... A gr... | chemrich/sashimi | src/sashimi/apbs/grid.py | .py | a39fd7d5c3a98c07 | 7 | 0 |
"""FiniteDifferenceRequest -> an mg-auto input file.
One template, deliberately: mg-auto with the requested equation, `bcfl sdh`,
`chgm spl4`. The FEM, geoflow, BEM, PBAM and PBSAM paths are out of scope, so
none of their knobs appear here.
Energy needs two elec blocks. A single block reports total electrostatic
ener... | chemrich/sashimi | src/sashimi/apbs/input.py | .py | a914cb0d159e4af2 | 7 | 0 |
"""APBS-specific knobs, and the mapping from solver-neutral concepts onto them.
Everything here is APBS vocabulary, which is why it lives under `sashimi.apbs`
and not in the protocol. `ApbsOptions` is the escape hatch ROADMAP.md §14 Q2
decided on: the portable `SurfaceModel` covers what every backend can mean, and
any... | chemrich/sashimi | src/sashimi/apbs/options.py | .py | 916f4e0819af90a4 | 7 | 0 |
"""Running APBS.
Each solve gets a fresh temporary directory: APBS writes `io.mc` and its DX
output into the working directory, so anything less leaks files into the
caller's cwd and lets concurrent solves overwrite each other.
Success is verified structurally rather than from the exit code, because APBS
exits 0 on s... | chemrich/sashimi | src/sashimi/apbs/run.py | .py | edc3297816210ead | 7 | 0 |
"""Naming and lifetime of the files a solve leaves behind.
A potential map is large — 12 MB at 97³, 56 MB at the `max_points` cap — and
tools return a *path* to one rather than its contents, because inlining a grid
would cost millions of tokens (ROADMAP.md §6). That makes two things the
caller's problem, and this modu... | chemrich/sashimi | src/sashimi/artifacts.py | .py | 8f7106099bacc0c6 | 7 | 0 |
"""A boundary-element backend that computes nothing.
This exists to answer one question: does the protocol admit a BEM solver
without APBS-shaped concessions? ROADMAP.md phase 4's exit criterion. It
returns a `SurfacePotential` on a sphere-tessellated surface with analytic
Debye-Huckel values — physically a toy, struc... | chemrich/sashimi | src/sashimi/bem_stub.py | .py | bc87945566a00a66 | 7 | 0 |
"""What this installation can actually do, and whether a request would work.
Two questions an agent should be able to ask before committing to a solve that
takes a minute and writes 50 MB:
- *What can you do?* Which backends are installed, which surface models they
support, which equations they actually solve. Disc... | chemrich/sashimi | src/sashimi/capabilities.py | .py | cee60fcdb94a27bc | 7 | 0 |
"""DebyeSolver — the clean-room finite-difference solver, at M1.
The second backend with no binary and the first that is both in-process *and*
in the reference tier: `sashimi.gb` needs nothing installed but approximates the
equation, and every backend that discretizes it needs a compiled program. That
combination is t... | chemrich/sashimi | src/sashimi/debye/backend.py | .py | 4ff75547473ae9eb | 7 | 0 |
"""Geometry to coefficients: where the solvent is, and how strongly it screens.
Two maps, and they are not the same map. The **dielectric** boundary is the van
der Waals surface — the union of the atomic spheres — and it lives on the faces
between nodes, because a flux through a face is what the finite-volume operator... | chemrich/sashimi | src/sashimi/debye/dielectric.py | .py | d7fbb3d47c951689 | 7 | 0 |
"""Physical grid intent -> a Cartesian lattice debye can coarsen.
`GridSpec` has no `dime` because legal multigrid dimensions are an APBS
implementation detail (ROADMAP.md section 4). debye has its own, and it is a
looser one: APBS's mg-auto requires n = c * 2^(l+1) + 1 with l = 4, so its
ladder steps in 32s — 97, 129... | chemrich/sashimi | src/sashimi/debye/grid.py | .py | 831bb85f66564698 | 7 | 0 |
"""The discrete operator, and the multigrid that inverts it.
`-div(eps grad phi) + kappabar^2 phi = 4 pi l_B rho`, in finite-volume form on a
Cartesian grid: for each node, the sum of fluxes through its six faces plus the
Boltzmann term equals the charge it carries. Writing it as a flux balance rather
than as a differ... | chemrich/sashimi | src/sashimi/debye/linear.py | .py | be4f632a96fd12cf | 7 | 0 |
"""DelphiSolver — the second backend, and the protocol's first real test.
Implements `Solver[FiniteDifferenceRequest]` with no changes to the protocol at
all: the same request type APBS takes, the same `SolveResult` out. Everything
DelPhi does differently — a cubic grid instead of a multigrid lattice, energies
in kT, ... | chemrich/sashimi | src/sashimi/delphi/backend.py | .py | f6c02037be4d533e | 7 | 0 |
"""Gaussian Cube -> PotentialGrid.
DelPhi's native `.phi` map is an unformatted Fortran binary whose record layout
depends on the compiler that built it; both flavours can write a Gaussian Cube
instead, which is text, self-describing and identical across builds. That makes
Cube the only volumetric format the two DelPh... | chemrich/sashimi | src/sashimi/delphi/cube.py | .py | ed3b400f9b391e2c | 7 | 0 |
"""Locating a DelPhi executable, and deciding which of the two it is.
Order: `$SASHIMI_DELPHI_PATH`, then the C++ builds on PATH, then
`pydelphi-static`. The explicit variable wins because the C++ program has no
canonical installed name — its makefile emits `delphicpp_mac`,
`delphicpp_release`, `delphicpp_omp_release`... | chemrich/sashimi | src/sashimi/delphi/discover.py | .py | 244308c1ab390f71 | 7 | 0 |
"""Physical grid intent -> legal DelPhi grid parameters.
DelPhi's grid is described by two numbers: `scale`, the number of grid points
per angstrom, and `gsize`, the number of points along each side. The box is
cubic and `gsize` must be odd, so there is exactly one degree of freedom per
axis and no multigrid lattice t... | chemrich/sashimi | src/sashimi/delphi/grid.py | .py | c21250ce84d623e1 | 7 | 0 |
"""FiniteDifferenceRequest -> a DelPhi parameter file.
Both flavours read the same statement syntax and the same short parameter
names, so this is one generator with a `DelphiFlavour` switch rather than two.
They genuinely differ in four places, and every one of them is a silent wrong
answer rather than an error if it... | chemrich/sashimi | src/sashimi/delphi/input.py | .py | 3c6586cc81982f5c | 7 | 0 |
"""DelPhi-specific knobs, and the mapping from solver-neutral concepts onto them.
Everything here is DelPhi vocabulary, which is why it lives under
`sashimi.delphi` and not in the protocol — the same rule `sashimi.apbs.options`
follows.
**The surface-model mapping table.** ROADMAP.md section 14 left "which
solver-neu... | chemrich/sashimi | src/sashimi/delphi/options.py | .py | 9cd5d4e1272064bb | 7 | 0 |
"""Running DelPhi.
Each solve gets a fresh temporary directory, for the same reason APBS does: both
flavours write output next to the parameter file, so anything less leaks files
into the caller's cwd and lets concurrent solves collide.
As with APBS, success is verified **structurally rather than from the exit
code**... | chemrich/sashimi | src/sashimi/delphi/run.py | .py | c8ff152f4c9de12a | 7 | 0 |
"""OpenDX read/write.
Own reader/writer rather than gridData/MDAnalysis: the format is trivial and
owning it keeps the dependency tree at numpy. The writer exists so that any
backend's output can be exported for PyMOL/ChimeraX — it is not APBS-specific,
which is why it lives here rather than under `apbs/`.
Layout (ve... | chemrich/sashimi | src/sashimi/dx.py | .py | 8d5f8babc8f99562 | 7 | 0 |
"""Sampling a potential map around a sphere, in the directions the error varies over.
One owner for a rule two engines need. `sashimi.corpus` grades one backend's
field against a closed form; `sashimi.validate` grades backends against each
other. Both have to sample the same way or their numbers are not about the same... | chemrich/sashimi | src/sashimi/field.py | .py | 882c6bea0af99341 | 7 | 0 |
"""GbSolver — the first backend that is not a subprocess.
Two firsts, and they are related. This is the first backend that *approximates*
the Poisson-Boltzmann equation rather than discretizing it, so it is the first
to declare `AccuracyTier.APPROXIMATE` and the reason that enum exists. And it is
the first solver that... | chemrich/sashimi | src/sashimi/gb/backend.py | .py | 4bb8f70f187ef142 | 7 | 0 |
"""Still's equation, and the Debye screening that puts salt into it.
Given effective radii, the polar solvation energy is a double sum over atom
pairs with an interpolating denominator that reduces to the Born formula for a
single atom and to Coulomb's law at long range:
f_GB(i,j) = sqrt(r_ij^2 + R_i R_j exp(-r_i... | chemrich/sashimi | src/sashimi/gb/energy.py | .py | 52ef2631dce0f75c | 7 | 0 |
"""Effective Born radii by pairwise descreening.
The one quantity Generalized Born is really about. An atom's effective radius is
its distance to the dielectric boundary *as seen through the rest of the
solute*: an atom on the surface keeps nearly its van der Waals radius, one
buried in the core acquires a large one a... | chemrich/sashimi | src/sashimi/gb/radii.py | .py | 6991611d31ad2aa6 | 7 | 0 |
"""PQR read/write.
Own parser rather than a dependency: the format is trivial and owning it keeps
the dependency tree at numpy. PQR is whitespace-delimited in practice (unlike
PDB it is not column-fixed, because charges and radii overflow their columns),
so the fields are recovered positionally from the end of the lin... | chemrich/sashimi | src/sashimi/pqr.py | .py | 01a539dad2de1339 | 7 | 0 |
"""Structure preparation: PDB -> PQR, via pdb2pqr.
A subprocess wrapper, not a use of pdb2pqr's Python API. Its internals are not
a stability contract, and process isolation means a pdb2pqr hang cannot take
down the MCP server.
pdb2pqr rebuilds structures — it adds missing heavy atoms, debumps clashes and
places hydr... | chemrich/sashimi | src/sashimi/prep.py | .py | d20bdb4d149aaf65 | 7 | 0 |
"""The bounded structured report that moves between Ralph rounds."""
from __future__ import annotations
import json
from dataclasses import dataclass
from typing import Literal
from pydantic import BaseModel, field_validator, model_validator
Status = Literal["continue", "complete", "blocked"]
# A report is the onl... | BluePlanetSlumberer/ralph-loop | src/ralph_loop/report.py | .py | eb474c98493bb219 | 7 | 0 |
"""The ralph tool: a fixed fresh-agent loop exposed to any LangChain agent."""
from __future__ import annotations
from pathlib import Path
from typing import Callable
from langchain_core.tools import BaseTool
from pydantic import BaseModel, Field, field_validator
from .report import RalphReport, RalphRun
from .work... | BluePlanetSlumberer/ralph-loop | src/ralph_loop/tool.py | .py | f77b22f667262a9b | 7 | 0 |
"""Each round's fresh child: one callable that works and reports back."""
from __future__ import annotations
from typing import Protocol
from .report import RalphReport
class FreshWorker(Protocol):
"""Runs one fresh child per round.
Every call must be a brand-new agent: no parent conversation, no prior
... | BluePlanetSlumberer/ralph-loop | src/ralph_loop/worker.py | .py | 79a9f9a2b0627a2a | 7 | 0 |
"""TLC Taxi Zone Bronze/Silver1 적재 DAG.
원래 schedule=None(수동 트리거) "1회성" DAG였는데, ingest_taxi_zone_shapefile이
ETag 기반 변경 감지를 갖추면서(src/taxi_zone/bronze.py 참고) 매달 다시
돌려도 안전해졌다 — 원본이 그대로면 다운로드도, Silver1 재생성도,
Asset emit도 전부 스킵한다. Wayback Machine으로 실측한 실제 변경 주기가
1~2년에 한 번이라(2024-03~2024-10 무변경, 다음 변경 2026-02), 매달 확인하면
탐지 지연 ... | softeerbootcamp-8th/DE_team5-three-idiots | dags/taxi_zone_pipeline.py | .py | 1c89628e44960fc0 | 7 | 0 |
"""
DAG: toll_silver_gold_pipeline
toll_bronze_pipeline이 요금표/시설목록/CBD 폴리곤을 갱신하거나
(Asset("toll_bronze_updated")), lion_pipeline이 분기 LION을 갱신할 때
(Asset("lion_bronze_updated")) Silver2 매핑(lion_facility, lion_cbd)을
다시 만들고 Gold 값을 재계산해서 RDS에 적재한다. 이름을
"gold_pipeline"이 아니라 "silver_gold_pipeline"으로 붙인 이유는 실제로
Silver2 매핑 태스크가... | softeerbootcamp-8th/DE_team5-three-idiots | dags/toll_silver_gold_pipeline.py | .py | 7a7d0224af1efdd2 | 7 | 0 |
"""index.html에 박아넣을 DATA(JSON) 블록을 생성한다.
맨하튼(borough_code=="1") routable 세그먼트만 쓴다 - 기존 정적 데모의
background_coords 세그먼트 수(19,981)와 정확히 일치해서, 원래도 이
필터로 만들어졌던 것으로 보인다.
background_coords: 세그먼트별 지도 렌더링용 좌표(회색 배경 도로망,
기존 포맷 그대로 유지 - JS 렌더링 코드를 안 건드리기 위함).
graph: 브라우저에서 클릭 두 점 사이 실시간 경로 탐색(Dijkstra)에 쓸
그래프 - 노드 좌표 + 엣지(구간 길이... | softeerbootcamp-8th/DE_team5-three-idiots | demo/build_route_map_data.py | .py | 455b857c16d4892f | 7 | 0 |
"""
Type1(소요시간) 긴급 스펙 추정 백필 스크립트 (청크 버전)
배경: 도로 속도 원천(Socrata) API 호출 자체가 실패해 실측 데이터가 안
들어오는 동안, segment_metrics_type1에 값이 없는 (segment_id, time) 슬롯이
많다 - Fresh Exact/Historical AVG 둘 다 못 찾고 코드 상수(45초)로 응답이
떨어지는 상태다(src/serving/nav_lookup.py 참고). 원천 API가 복구될
때까지 임시로, 도로 스펙(길이 ÷ 제한속도)으로 추정한 통과시간을 avg
컬럼에 채워 넣어 최소한 세그먼트별... | softeerbootcamp-8th/DE_team5-three-idiots | scripts/backfill_type1_spec_avg.py | .py | f300f61dd8da64ac | 7.5 | 0 |
"""
RDS(PostgreSQL) 서빙 테이블 생성 스크립트 (idempotent)
배포 시 한 번 실행한다. 이미 테이블이 있으면 건너뛴다.
DynamoDB 사용을 완전히 중단하면서 예전 create_dynamodb_tables.py는 삭제했다.
python scripts/create_rds_tables.py
"""
from __future__ import annotations
import psycopg2
from src.common.config import (
SERVING_TABLE_TYPE1,
SERVING_TABLE_TYPE1... | softeerbootcamp-8th/DE_team5-three-idiots | scripts/create_rds_tables.py | .py | 3f1ddc751013fd35 | 7 | 0 |
"""
RDS GLOBAL 기본값 시딩 스크립트
fallback 체인의 마지막 안전망(설계 문서 7절 3단계)이다. 파이프라인이 한
번도 성공적으로 안 돌았어도 이 값이 있어야 API가 "무조건 응답"할 수
있으므로, 파이프라인 코드가 아니라 배포 시점에 이 스크립트로 수동 시딩한다.
DynamoDB 사용을 완전히 중단하면서 예전 seed_dynamodb_defaults.py는 삭제했다.
python scripts/seed_rds_defaults.py
type1(시간)은 여기서 시딩할 GLOBAL 기본값이 없다 - src/serving/nav_lookup... | softeerbootcamp-8th/DE_team5-three-idiots | scripts/seed_rds_defaults.py | .py | a095e3adc8cd2281 | 7 | 0 |
"""
EMR Serverless 잡 엔트리포인트 — Silver2(LION 세그먼트 단위) -> type1(시간) RDS upsert
nav_time_silver_job.py가 만들어둔 Silver2 parquet을 읽어서 Gold1(필터)
-> Gold2(버킷 평균+시간 계산 -> 검증 -> RDS upsert)를 처리한다
(docs/superpowers/specs/2026-08-24-split-silver-gold-tasks-design.md 참고).
인자:
--silver2-path : nav_time_silver_job.py가 저장한 Silver2 ... | softeerbootcamp-8th/DE_team5-three-idiots | spark_jobs/nav_time_gold_job.py | .py | 50ab7294b0e8dbf4 | 7 | 0 |
"""
EMR Serverless 잡 엔트리포인트 — 속도 Bronze -> Silver2(LION 세그먼트 단위)
Bronze -> Silver1(정제) -> Silver2(LION 세그먼트 매핑)까지만 처리하고
결과를 S3에 parquet로 남긴다. 이어지는 Gold1/Gold2는
nav_time_gold_job.py가 이 결과를 읽어서 별도 EMR job으로 처리한다 -
하나로 묶여있던 job을 Silver/Gold 두 Airflow task로 나눠서, 실패했을 때
Airflow 화면에서 바로 어느 단계인지 알 수 있게 하기 위함
(docs/superpower... | softeerbootcamp-8th/DE_team5-three-idiots | spark_jobs/nav_time_silver_job.py | .py | cec4b2d4057e97d9 | 7 | 0 |
"""
Slack 장애 알림
태스크가 재시도를 전부 소진하고 최종 실패했을 때만 호출된다(Airflow의
on_failure_callback은 매 시도가 아니라 "이 태스크 인스턴스가 더 이상 재시도
안 하고 최종 실패로 확정된 시점"에 한 번만 불린다).
DAG의 default_args에 이렇게 걸어서 쓴다:
from src.common.alerts import notify_slack_failure
default_args = {
...
"on_failure_callback": notify_slack_failure,
... | softeerbootcamp-8th/DE_team5-three-idiots | src/common/alerts.py | .py | 8fca117b05b0864c | 7 | 0 |
"""
EMR Serverless Spark 잡 제출/대기 헬퍼
Airflow worker 프로세스 안에서 SparkSession을 직접 여는 대신, 변환 로직을
담은 스크립트(spark_jobs/*.py)를 EMR Serverless에 제출하고 완료를 기다린다.
src/ 전체를 zip으로 묶어 --py-files로 넘겨서, 잡 스크립트가 src.tlc.* 등
기존 순수 변환 함수를 그대로 import해서 쓸 수 있게 한다 — 변환 로직을
spark_jobs 쪽에 복제하지 않기 위함이다.
우리 Spark job(nav_time_silver_job.py, nav_t... | softeerbootcamp-8th/DE_team5-three-idiots | src/common/emr_serverless.py | .py | e1e70473acff11f5 | 7 | 0 |
"""공통 파일 형식 검증 — 도메인을 몰라도 되는 순수 포맷 체크만 담당한다.
Bronze에 올리기 직전에 "이 파일이 애초에 열리는가"를 확인하는 용도다.
데이터 의미(taxi_type별 필수 컬럼, 값 범위 등)는 각 도메인의 GX
Expectation(src/tlc/expectations.py, src/speed/expectations.py 등)이
맡는다 — 여긴 형식만 본다(LION/Taxi Zone의 zip 검증, TLC/Speed의 GX
검증처럼 이미 각 도메인에 흩어져 있던 "파일이 파싱되는가" 체크를 한
곳으로 모은 것).
전부 검증 실패 시 예외... | softeerbootcamp-8th/DE_team5-three-idiots | src/common/file_validation.py | .py | 78910d085df7c4fa | 7 | 0 |
"""
Gold 서빙 데이터의 "마지막으로 성공한 값" 스냅샷.
RDS(src/common/rds.py)가 완전히 응답 불가능할 때 쓰는 폴백
(src/serving/nav_lookup.py 참고) - S3는 이미 멀티 AZ로 복제되는 관리형
스토리지라 RDS(Multi-AZ 안 쓰면 단일 인스턴스)보다 죽기 어렵다.
세그먼트당 AVG/SPEC/가장 최근 exact 값만 담는다(하루치 버킷 이력 전부는
안 담음 - 스냅샷을 쓰는 시점엔 오래된 실측값도 어차피 freshness 기준을
넘겨 못 쓰므로 최신 1개면 충분하고, 그만큼 스냅샷 크기가 작아진다).
Gol... | softeerbootcamp-8th/DE_team5-three-idiots | src/common/gold_snapshot.py | .py | 96c7ade830447012 | 7 | 0 |
"""GX(Great Expectations) 공통 러너.
Spark/pandas DataFrame과 Expectation 목록을 받아 검증을 실행하고, 결과를 dict
리스트로 반환하는 것까지만 책임진다. 검증 실패 시 어떻게 반응할지
(파일 제외/로그/알림)는 호출하는 도메인 코드가 결정한다.
반환하는 각 dict는 success/expectation_type/kwargs/result에 더해
exception_info도 포함한다 — GX가 메트릭 계산 중 내부적으로 예외를 잡은
경우(예: 컬럼 타입 불일치) success=False에 result={}만 남고 ... | softeerbootcamp-8th/DE_team5-three-idiots | src/common/gx.py | .py | 61fe7391e2b71cd2 | 7 | 0 |
"""공통 유틸."""
import re
def save_parquet(df, out_dir, filename="data.parquet"):
"""DataFrame을 parquet으로 저장한다.
out_dir는 S3Path다 — S3는 업로드가 완료된 객체만 노출하므로(부분 쓰기가
안 보임) 로컬 파일시스템에서 하던 tmp-then-rename 흉내가 필요 없다.
pandas가 S3Path를 로컬 캐시 경로로 오해하지 않도록 str()로 넘긴다.
"""
out_dir.mkdir(parents=True, exist_ok... | softeerbootcamp-8th/DE_team5-three-idiots | src/common/utils.py | .py | 11dddbefe5c63b72 | 7 | 0 |
"""
Bronze ingestion: NYC DCP LION (Single Line Street Base Map)
주의: LION은 Socrata에서 "non-tabular"(지도 전용) 자산으로 등록되어 있어서
$limit/$offset 같은 행 단위 API 조회가 불가능하다 (실제로 시도하면
"no row or column access to non-tabular tables" 에러가 남).
그래서 taxi_zone의 shapefile과 동일한 방식으로, NYC DCP가 제공하는
파일(zip) 원본을 통째로 받아서 그대로 압축 해제한다.
분기마다 새 버전이 나... | softeerbootcamp-8th/DE_team5-three-idiots | src/lion/bronze.py | .py | bf37d87c004ef80a | 7 | 0 |
"""
Gold2 — type2(길이) 최종 산출물을 RDS 포맷으로 변환하고 upsert한다.
RDS는 세그먼트당 항목 1개(length_ft)만 저장한다 — 길이는 시간에
따라 변하지 않으므로 버킷을 반복 저장하지 않는다(설계 문서 6절).
"""
from __future__ import annotations
import statistics
from datetime import date
import pandas as pd
from src.common import gold_snapshot
from src.common.config import GLOBAL_P... | softeerbootcamp-8th/DE_team5-three-idiots | src/nav_length/gold2.py | .py | 97a839f143845a1e | 7 | 0 |
"""
Gold2 — type1(시간) 최종 산출물 계산 + RDS 포맷/upsert
30분 버킷 하나엔 그 30분 동안 들어온 5분 단위 판독값이 최대 6개 있다.
시간순으로 1,2,...,n번째 판독값에 1:2:...:n 비율로 증가하는 가중치(최근
값이 가장 큰 비중)를 준 가중평균 속도를 구하고, LION 길이(length_ft)로
나눠 세그먼트별 통행시간(초)을 구한다.
과거 평균(avg)은 세그먼트 전체가 아니라 "이 (segment_id, time) 슬롯"
단위다 - 한 행 안에 오늘 실측값(value)과 그 슬롯의 과거 평균(avg)이 같이
있어서,... | softeerbootcamp-8th/DE_team5-three-idiots | src/nav_time/gold2.py | .py | 8d14d9e070a2a299 | 7 | 0 |
"""Type3(승차 수) 서빙 조회 라이브러리.
원래는 이 모듈 자체가 독립 FastAPI 앱(및 Lambda)이었지만, 여러 타입의
Lambda를 nav_api.py 하나로 통합하면서(docs/superpowers/plans/
2026-08-23-unified-navigation-api.md) 실제 배포는 src/serving/lambda_handler.py
-> nav_api.py 경로만 쓰게 됐다. 이 모듈은 이제 nav_api.py가 가져다 쓰는
get_type3_values() 조회 로직만 담은 라이브러리다 - 자체 FastAPI 앱/엔드포인트는
어디서도... | softeerbootcamp-8th/DE_team5-three-idiots | src/serving/api.py | .py | 894e87c1c2e4c09a | 7 | 0 |
"""
서빙 API — 세그먼트 지표 조회
라우팅은 얇게 두고, 실제 조회/fallback 로직은 src/serving/nav_lookup.py에
위임한다.
로컬 실행: uvicorn src.serving.nav_api:app --reload --port 8001
"""
from __future__ import annotations
from datetime import datetime
from typing import Literal
from fastapi import FastAPI, Request
from fastapi.middleware.cors impor... | softeerbootcamp-8th/DE_team5-three-idiots | src/serving/nav_api.py | .py | ef6fa619bbc191d5 | 7 | 0 |
"""
세그먼트 지표 조회 + fallback 체인
"무조건 응답"(설계 문서 7절)을 구현하는 핵심 모듈. 키가 없는 경우와 RDS
호출 자체가 실패(예외)하는 경우를 구분하지 않고 똑같이 다음 fallback
단계로 넘어간다.
Type1(시간)은 segment_metrics_type1(segment_id+time 복합키, src/common/
config.py 참고)로 서빙한다. 한 행 안에 오늘 실측값(value)과 그 시간대의
과거 평균(avg)을 같이 들고 있어서, "뉴욕 기준 오늘 값이 있으면 그걸,
없으면 평균을"
판단이 조회 한 번으로 끝난다. Dy... | softeerbootcamp-8th/DE_team5-three-idiots | src/serving/nav_lookup.py | .py | 8d1562dcb6c482ff | 7 | 0 |
#!/usr/bin/env python3
"""A14 · 从 NCCL 的 TUNING 日志里统计「分块字节数不被 16 整除」的**按字节加权**占比。
背景:E18 §10 证明了机制 —— NCCL 的 Simple kernel 按 16 字节(128 位)向量化访存,
**每 rank 分块字节数只要不能被 16 整除,就整段退化成标量路径,all_gather 掉 12×**。
但那是在微基准上证明的。**还没证明 verl 的 ZeRO-3 真的撞在上面** ⇒ 这就是 A14。
⚠️⚠️ **必须按字节加权,不能按调用次数** —— 小张量再多也解释不了 6.02×。
(一万次 128 字节的错位调... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/analyze_allgather_alignment.py | .py | acca5678636d5cc0 | 7.15 | 1 |
#!/usr/bin/env python3
"""E01 / A5 · 从 nsys 的 sqlite 里把「一步的时间去哪了」拆开。
★ 为什么不用 `nsys stats` 的现成报告就完事:
它给的是**全局**的 kernel 排行,而我们要回答的是两条 track 共用的那个问题 ——
**每张卡上、每个进程各自忙了多久、忙在什么类型的活上、剩下的时间在等谁**。
`trainer` 和 `rollout` 在同一份 trace 里,不按进程拆开就分不出 update_actor 和 gen。
两种模式:
① 无 NVTX(旧 trace):给「算子类型 × 进程 × 卡」的分解 + **kernel 级占空比*... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/analyze_nsys_step.py | .py | e7135f38da26d0ce | 7.15 | 1 |
#!/usr/bin/env python
"""上线候选的**晋级闸**:一条跑够不够格被当成上线候选。
python scripts/candidate_gate.py checkpoints/grpo/<run> # 查
python scripts/candidate_gate.py checkpoints/grpo/<run> --strict # 不够格就非零退出
★★★ 为什么约束加在**晋级**上,而不是**起跑**上(2026-08-19 定)
infra 一直在用 RL 跑**短的精度/吞吐实验**(60 步就够)。
把"必须跑到没梯度"加在起跑上,会**当场挡住他们**,... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/candidate_gate.py | .py | bb13cc55f9f060f8 | 7.15 | 1 |
"""flash-attn 的**反向**数值判据 —— 换轮子/换机器后必跑。
2026-08-17 的教训:一个 sm_120 轮子可以**前向三项全过、反向全错**。
前向对不代表反向对,而反向错在 RL 里的表现是"训练正常跑完但什么都没学到"。
flash_attn_func 反向 dq/dk/dv 全 nan ⇒ verl 打 WARN 跳过 optimizer.step
flash_attn_varlen_func 反向 有限但恒为 0 ⇒ ★ 静默,没有任何报错
用法: python scripts/check_flash_attn_backwar... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/check_flash_attn_backward.py | .py | 1f2665efc4a136d5 | 7.15 | 1 |
#!/usr/bin/env python
"""跑中盯「拒绝能力有没有塌」—— 读 rollout dump,报最长连续零 defer 步数。
python scripts/defer_watch.py checkpoints/grpo/<run> # 打一行摘要
python scripts/defer_watch.py checkpoints/grpo/<run> --streak # 只打数字(给守卫用)
★★ 为什么需要它(2026-08-19)
`defer` 塌陷是**不可逆**的:`[实测]` lr 1e-4 那跑,9 条该 defer 的 EVAL 题
全部掉到 0.000,... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/defer_watch.py | .py | f55bdf7d44710361 | 7.15 | 1 |
#!/usr/bin/env python
"""磁盘盘点:把产物按「能不能删」分类,并解释理由。
python scripts/disk_report.py # 只报告,不动任何文件
python scripts/disk_report.py --plan # 额外打印可执行的删除命令(仍然不执行)
★ 为什么要有这个脚本(2026-08-18)
本项目丢过一次最终 ckpt(M7,27 GB 写盘撞上配额被静默截断,训练日志里一个字都没有)。
纪律是「判断空间要用写入探针,不能信 df」——但更前面一步是:
**先知道 300 GB 里哪些是死的。** 手工 du 一次要十分钟... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/disk_report.py | .py | 8d084e3124488e3e | 7.15 | 1 |
"""给本项目的 venv 安装一个 `flash_attn.bert_padding` 垫片。
## ⛔ 已退役(2026-08-13 晚)——新机器别再跑这个脚本
已找到并装上完全匹配的**真 flash-attn 预编译轮子**(零编译,sm_120 kernel 经
cuobjdump 验证):
uv pip install /workspace/wheels/flash_attn-2.8.3+cu128torch2.9-cp312-cp312-linux_x86_64.whl
# 或重新下载:
# https://github.com/mjun0812/flash-attention-preb... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/install_flash_attn_shim.py | .py | ef5244c7e1b424d3 | 7.15 | 1 |
"""一条命令把 SFT / RL 的观测面板建到 W&B 上(可重跑,幂等覆盖同名 view)。
python scripts/make_wandb_panels.py # 建 SFT + RL 两个 view
python scripts/make_wandb_panels.py --only sft
★ 为什么要脚本而不是在网页上拖:**面板是判据的一部分**。
手拖的面板换个人、换台机器就没了,而"该看哪几条线、红线在哪"是要跟着仓库走的。
这份脚本和 `docs/syncopate/06-rl-run-protocol.md H 部分` 是同一件事的两种形态 ——
文档说为什么,脚... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/make_wandb_panels.py | .py | 7d438e98ac0af241 | 7.15 | 1 |
#!/usr/bin/env python3
"""从 verl 的训练日志里把 timing 行解析成「每 global step」的口径。
★ 为什么需要它(2026-08-17 建):
fully_async 的每条 timing 行**覆盖多个 global step**(本项目 sync_every=4 ⇒ 4 步一行),
直接读日志里的绝对秒数会**报错 4 倍** —— E18 §7-5 记着这个坑,此前已经犯过一次。
⇒ 把「除以覆盖步数」这件事固化进工具,别再靠人记得。
用法:
python scripts/parse_fully_async_timing.py logs/rl_v13... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/parse_fully_async_timing.py | .py | d51f331d092cfb67 | 7.15 | 1 |
#!/usr/bin/env python
"""O-2a · 先试最便宜的那条路:**改 `answer_fields` 契约,能不能不训练就说人话**。
python scripts/probe_answer_fields.py
★ 为什么先做这个(守则⑤ 先测量后动手):
O-1 定性里那条 —— 「谢谢,辛苦了」→ `{"summary": "无操作"}` —— 是**两件事叠加**:
① 表达退化(要 OPD)
② `answer_fields` 只给了 `summary`「本次任务的结论」这一个字段,
**逼着模型把任何回应都塞进"任务结论"的形状里**
⇒ ② 是 pr... | ChaoyuWang04/Syncopate_Async_AgenticRL | scripts/probe_answer_fields.py | .py | a59d35ba217db673 | 7.15 | 1 |
"""CLI entry point for the hermes-agent ACP adapter.
Loads environment variables from ``~/.hermes/.env``, configures logging
to write to stderr (so stdout is reserved for ACP JSON-RPC transport),
and starts the ACP agent server.
Usage::
python -m acp_adapter.entry
# or
hermes acp
# or
hermes-acp
... | 6TcbpVB4h7jSZWz2/NousResearch__hermes-agent | acp_adapter/entry.py | .py | 93dca1ab622b5e3d | 7 | 0 |
"""ACP permission bridging for Hermes dangerous-command approvals."""
from __future__ import annotations
import asyncio
import logging
from concurrent.futures import TimeoutError as FutureTimeout
from itertools import count
from typing import Callable
from acp.schema import (
AllowedOutcome,
PermissionOption... | 6TcbpVB4h7jSZWz2/NousResearch__hermes-agent | acp_adapter/permissions.py | .py | cff95b8e8a6be936 | 7 | 0 |
"""Ambient session-accounting context for auxiliary LLM calls.
Auxiliary calls (vision, compression, title generation, web_extract,
session_search, ...) funnel through ``agent.auxiliary_client`` which has no
session handle — so their token usage was historically discarded, leaving
dashboard analytics blind to aux mode... | 6TcbpVB4h7jSZWz2/NousResearch__hermes-agent | agent/aux_accounting.py | .py | 1ce741a528bbb918 | 7 | 0 |
"""Context-local state for delegate_task child execution.
The parent Hermes process may itself be a Kanban dispatcher worker with
HERMES_KANBAN_* variables in process env. delegate_task children run inside the
same Python process, but they are not dispatcher-owned Kanban workers. This
module lets code paths that resol... | 6TcbpVB4h7jSZWz2/NousResearch__hermes-agent | agent/delegation_context.py | .py | 81038bcaa0913b4f | 7 | 0 |
#!/usr/bin/env python3
"""Paired significance test over the matched grid.
python Paper/neurips2026/tools/significance.py results/runs_grid
"BaCP leads 35 of 48 cells" is a weak way to state the result: 35/48 is not far
from a coin flip by eye, and a reader has no way to judge it. This computes the
test that answe... | HaroonKhawaja/BaCP | Paper/neurips2026/workshop/tools/significance.py | .py | 1e04f0a86e8155e4 | 7 | 0 |
"""VGG (Simonyan & Zisserman, "Very Deep Convolutional Networks for
Large-Scale Image Recognition", ICLR 2015, arXiv 1409.1556).
vgg11/vgg19 are configurations A and E of their Table 1. State-dict keys match
torchvision's VGG exactly, so torchvision's ImageNet checkpoints load directly.
The three-layer classifier MLP ... | HaroonKhawaja/BaCP | project/models/vgg.py | .py | 9d868f9b2e119999 | 7 | 0 |
"""L8 -- the baseline/pruning training loop, end to end on a tiny model."""
import pytest
import torch
from pruning_factory import check_model_sparsity
pytestmark = pytest.mark.slow
PRUNE = dict(pruning_type="magnitude", target_sparsity=0.5, sparsity_scheduler="cubic")
def _trainer(initialized_args, **over):
... | HaroonKhawaja/BaCP | project/tests/test_baseline_loop.py | .py | 60633a3fbb4df7ac | 7.5 | 0 |
"""L6a -- DyReLU phasing (EAST component 1).
EAST's first trick: run DyReLU early so the network explores a richer activation
family, then anneal back to plain ReLU so the extra hyperfunction parameters are
gone by the end of training (Li et al. 2024, arXiv 2411.13545; DyReLU from
Chen et al. 2020, ECCV).
The anneal ... | HaroonKhawaja/BaCP | project/tests/test_dyrelu_phasing.py | .py | 7d21db8862a60c10 | 7.5 | 0 |
"""L6c -- the EAST pruner (cyclic sparsity, EAST component 3).
Every test in this file guards a defect that made EAST inert. Before these fixes
the pruner could not even be constructed, and if it had been, its mask update was
an unconditional early return -- so no EAST result has ever existed.
Reference: Li et al. 20... | HaroonKhawaja/BaCP | project/tests/test_east_pruner.py | .py | 12fe9188e2b2a6bf | 7.5 | 0 |
"""L0 -- static guards. No model, no data, no GPU. Runs in well under a second.
These are the cheapest tests in the suite and they catch the most expensive
class of bug in this codebase: a name that does not exist on a code path nobody
has run recently. Five of the eight blocking crashes on `main` are exactly that,
an... | HaroonKhawaja/BaCP | project/tests/test_imports.py | .py | 45221ded2e507b3f | 7.5 | 0 |
"""L4b -- WANDA pruner.
The point of these tests is narrow and specific: prove that WANDA is not
magnitude pruning wearing a different label. That is the failure mode that
matters, because the submitted paper reports a WANDA column produced by code
that was 133 commented-out lines containing a syntax error -- so whate... | HaroonKhawaja/BaCP | project/tests/test_wanda.py | .py | ecd846259555804a | 7.5 | 0 |
"""L6b -- EAST weight sharing (EAST component 2).
Promotes the notebook's `weight_sharing_test` -- which compared id(module.weight)
and *printed* a check mark -- into real assertions, and pins the checkpoint
ordering hazard that the printed version could not have caught.
Reference: Li et al. 2024, arXiv 2411.13545.
"... | HaroonKhawaja/BaCP | project/tests/test_weight_sharing.py | .py | c152fccfefe94c78 | 7.5 | 0 |
"""In-memory synthetic image dataset -- no downloads, no disk, no /dbfs.
Deliberately builds real ``PIL.Image`` objects and pushes them through the real
``dataset_factory.get_train_transform`` + ``AugmentData``, so the tests exercise
the actual augmentation recipe and the actual ``default_collate`` behaviour
rather th... | HaroonKhawaja/BaCP | project/tests/tiny_data.py | .py | 5fbe1c0200e03f21 | 7.5 | 0 |
import os
import torch
import torch.nn as nn
import contextlib
from tqdm import tqdm
from torch.amp import GradScaler, autocast
from dataclasses import dataclass
from training_utils import (
amp_dtype_and_scaler,
_finalize_run,
_initialize_all,
_initialize_logs,
_initialize_optimizer,
_optimize... | HaroonKhawaja/BaCP | project/trainer.py | .py | a9cb4311964f01ec | 7 | 0 |
import os
import torch
import numpy as np
import random
import matplotlib.pyplot as plt
from torchvision.utils import make_grid
import pickle
def set_seed(seed=42):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.determi... | HaroonKhawaja/BaCP | project/utils.py | .py | 602b58d806264c2c | 7 | 0 |
from __future__ import annotations
import math
import random
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class DemandProfile:
name: str
start_hour: float
arrivals_per_minute: float
PROFILES = {
"morning": DemandProfile("Morning rush", 8.0, 22.0),
"lunch": DemandProfile... | oosuhada/elevator-queue-lab | app/demand.py | .py | b77b22ed6ec9248f | 7 | 0 |
"""Shared config for the web-bridge server / CLI / MCP.
Reads ~/.config/web-bridge/config.json (chmod 600). The token gates every HTTP
and WebSocket call. Environment variables override the file for one-off use.
"""
from __future__ import annotations
import json
import os
from pathlib import Path
CONFIG_PATH = Path(... | ghbhiee/web-bridge | bridge/config.py | .py | f822d70afaccabf8 | 7 | 0 |
#!/usr/bin/env python3
"""Render the extension side panel into a plain web page for testing.
Chrome forbids scripting another extension's pages, so the side panel is the one part
of web-bridge that cannot be driven through the bridge itself. This builds an
equivalent page — the REAL panel.html and panel.js, with only ... | ghbhiee/web-bridge | bridge/panel_harness.py | .py | 8ff298f0dcd87240 | 7 | 0 |
"""User scripts — the page-beauty side of the panel.
Deliberately NOT capabilities. They look similar (both are JS injected into a
page) but they serve different people and must not be mixed:
capabilities/ written BY the agent, FOR the agent. Carry parameter
declarations, kinds, descriptions the... | ghbhiee/web-bridge | bridge/user_scripts.py | .py | e591180ae90e275f | 7 | 0 |
"""Runtime bootstrap helpers for CLI commands."""
from __future__ import annotations
import logging
import subprocess
import time
from dataclasses import dataclass
from pathlib import Path
import jj_stack
import jj_stack.console as console
import jj_stack.ui as ui
from jj_stack.config import AppConfig, load_config
f... | bos/jj-stack | src/jj_stack/bootstrap.py | .py | 198f43f133aee23b | 7.24 | 2 |
"""Shared cleanup command models, persistence, and rendering helpers."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Literal
from jj_stack.bootstrap import CommandContext
from jj_stack.github.resolution import (
GithubTarget,
UnresolvedGithubTarget,
)
from jj_stack... | bos/jj-stack | src/jj_stack/commands/cleanup/shared.py | .py | bb77245e4a1637d7 | 7.24 | 2 |
"""Shared data structures for the merge command."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Literal
from jj_stack.bootstrap import CommandContext
from jj_stack.github.resolution import GithubRepoAddress
from jj_stack.models.tracking import PRIdentity
from jj_stack.stac... | bos/jj-stack | src/jj_stack/commands/merge/models.py | .py | cfbe3472954c584b | 7.24 | 2 |
"""Merge preconditions checked against fresh PR facts."""
from __future__ import annotations
import jj_stack.ui as ui
from jj_stack.commands.merge.models import MergeChange
from jj_stack.formatting import format_pr_number
from jj_stack.github.resolution import GithubRepoAddress
from jj_stack.identifiers import short_... | bos/jj-stack | src/jj_stack/commands/merge/preconditions.py | .py | fb6cd2aed8134ec2 | 7.24 | 2 |
"""Prevent GitHub's reachability-based pull request auto-close."""
from __future__ import annotations
import jj_stack.ui as ui
from jj_stack.concurrency import DEFAULT_BOUNDED_CONCURRENCY, run_bounded_tasks
from jj_stack.errors import CliError
from jj_stack.formatting import format_pr_label
from jj_stack.github.clien... | bos/jj-stack | src/jj_stack/commands/submit/auto_close.py | .py | 53f813a4c57718d0 | 7.24 | 2 |
"""Build default pull request text from a jj change description."""
from __future__ import annotations
from markdown_it import MarkdownIt
_MARKDOWN = MarkdownIt("commonmark").enable("table")
def default_pr_body(description: str, *, template: str) -> str:
"""Return the default PR body, unfolding Markdown soft l... | bos/jj-stack | src/jj_stack/commands/submit/default_pr_text.py | .py | 7f09b21e934101f7 | 7.24 | 2 |
"""Shared data structures for the submit command."""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from typing import Literal, NamedTuple, Protocol
from jj_stack.jj.client import JjClient
from jj_stack.models.git import GitRemote
from jj_stack.models.github import Gith... | bos/jj-stack | src/jj_stack/commands/submit/models.py | .py | 61f9ba01c4f34188 | 7.24 | 2 |
"""Render submit command output."""
from __future__ import annotations
import jj_stack.console as console
import jj_stack.ui as ui
from jj_stack.formatting import (
format_pr_label,
render_commit_blocks,
render_commit_lines,
)
from jj_stack.jj.client import JjClient
from jj_stack.models.stack import Local... | bos/jj-stack | src/jj_stack/commands/submit/render.py | .py | c3c6941d7b286fe8 | 7.24 | 2 |
"""Configuration loading for `jj-stack`."""
from __future__ import annotations
import difflib
import logging
import tomllib
from collections.abc import Mapping
from typing import Literal
from pydantic import BaseModel, ConfigDict, Field, ValidationError, field_validator
from jj_stack.errors import CliError
from jj_... | bos/jj-stack | src/jj_stack/config.py | .py | 63779f16c4920fbf | 7.24 | 2 |
#!/usr/bin/env python3
"""Stop-hook guard: flag a reply that ENDS by offering to do work.
A cop-out offer converts work you have already been authorized to do back into
a request for permission -- "say the word and I'll push", "want me to kick off
the re-run?". It reads as courtesy and delivers nothing: the work does ... | Morrison-Lab/ai-config | hooks/flag-cop-out-offer.py | .py | 8a0e40e37d35e425 | 7.15 | 1 |
#!/usr/bin/env python3
"""PreToolUse guard: surface a write-capable `Agent` launch with no `isolation`.
We decided that subagent worktrees are **assigned by the orchestrator** --
`isolation` set on the `Agent` call -- rather than left to each agent to
organize for itself. Then `isolation: "worktree"` reclaimed an agen... | Morrison-Lab/ai-config | hooks/flag-unassigned-worktree.py | .py | a097518d2e4a55cf | 7.15 | 1 |
#!/usr/bin/env python3
"""PreToolUse guard: a branch switch and a later mutating git command, unchained.
## The incident
One Bash call carried this, on two lines:
git checkout feat/some-branch -q && git merge --ff-only origin/feat/some-branch -q
git merge origin/main -m "Merge branch 'main' into feat/some-br... | Morrison-Lab/ai-config | hooks/flag-unchained-branch-switch.py | .py | 7a32b9cb68fb88e3 | 7.15 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.