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
"""Numeric value-oracle gate for the modelo-130 golden workflow. Proves the harness's calculate trajectory produces the AEAT-published figure, not merely that the right casillas are computed (the verification-contract dimension). It seeds the AEAT DR 130 Instrucciones worked example through the real registry calculati...
nevenincs/cadrumo
dev/agent_eval/tests/test_modelo_130_value_oracle.py
.py
adf7ef793b848d02
7.65
1
"""Response-layer provenance gate for the operator golden-task eval. Guards against provenance dropped at the RESPONSE layer: the runner's existing provenance dimension (``_check_provenance``) inspects the REGISTRY snapshot, which proves the registry itself is grounded but NOT that the CLI/MCP ``modelo.work.calculate`...
nevenincs/cadrumo
dev/agent_eval/tests/test_response_provenance_golden.py
.py
b9bab4dc29ca6737
7.65
1
"""Under-declaration golden gate for the operator eval. Guards against a missed under-declaration - the highest-severity, legal-soundness failure class: an autonomous agent must not read a well-formed ``modelo work verify`` response as "safe to file" when a positive economic input cascades to a zero dependent casilla ...
nevenincs/cadrumo
dev/agent_eval/tests/test_under_declaration_golden.py
.py
63f12945ff51de26
7.65
1
"""Reason-bearing acceptance list for complexity hotspots. The committed baseline (``complexity_baseline.json``) is a bare ``key -> score`` mapping with nowhere to say WHY a row is tolerated, and it is regenerated wholesale by ``--write-baseline``, which accepts everything currently failing in one move. Neither proper...
nevenincs/cadrumo
dev/audit/complexity_allowlist.py
.py
7b2cc3d4b0c181ef
7.15
1
#!/usr/bin/env python """The single canonical vulture runner: invoke it, parse it, classify it honestly. Mirrors ``dev.audit.duplication``'s "the runner owns the whole measurement" shape, scaled to vulture's simpler risk profile: unlike ``npx``/jscpd or ``uvx``/semgrep, vulture is a project dev-dependency resolved thr...
nevenincs/cadrumo
dev/audit/dead_code.py
.py
b5cc4dd5026f80ac
7.15
1
#!/usr/bin/env python """The single duplication runner: invoke jscpd, parse it, classify it honestly. This module owns the WHOLE duplication measurement: source selection, command construction, execution, timeout, stdout/stderr/returncode handling, parsing, clone records, and availability classification. Both consumer...
nevenincs/cadrumo
dev/audit/duplication.py
.py
1360a8d01cb79923
7.15
1
"""Screen legal citations for a provision that approves a DIFFERENT modelo. The registry's evidence gate confirms a ``required_text`` phrase is PRESENT in the cited corpus file. It has no notion of whether the provision BELONGS to the modelo citing it, and that gap was not theoretical: four filing-grade citations sat ...
nevenincs/cadrumo
dev/audit/legal_attribution_screen.py
.py
c46374b6b6bc61d4
7.15
1
"""Read the legal catalogue's authoring tree, once, for the screens that audit it. Both legal screens in this package need the same thing: every catalogue entry id mapped to its authored body. Each had grown its own copy of the walk -- the same directory constant, the same byte-identical refusal, the same glob-to-``to...
nevenincs/cadrumo
dev/audit/legal_catalogue.py
.py
98620643f6958552
7.15
1
#!/usr/bin/env python """The single canonical semgrep runner: invoke it, parse it, classify it honestly. Mirrors ``dev.audit.duplication``'s "the runner owns the whole measurement" shape: source selection, command construction, execution, timeout handling, parsing, and availability classification all live here, and th...
nevenincs/cadrumo
dev/audit/security.py
.py
fb01c7dbf5cd1b1d
7.15
1
#!/usr/bin/env python """Programmatic semantic audit check using local RAG daemon. Verifies that core domain/registry logic concepts (rounding, calculations) do not leak into adapters or entrypoints. """ from __future__ import annotations import ast import json import subprocess import sys import textwrap import url...
nevenincs/cadrumo
dev/audit/semantic.py
.py
d02c859ca348251d
7.15
1
#!/usr/bin/env python """Module and callable size auditor with a generated, two-sided ratchet. Reports every module and production callable measured against the committed limit table in ``dev/audit/size_budget_baseline.json``, which the pytest gate ``src/cadrumo/tests/test_codebase_size_budgets.py`` enforces. Why the...
nevenincs/cadrumo
dev/audit/size_budget.py
.py
86d190e8fcaed5b7
7.15
1
"""Shared clone-record readers for the duplication gates. Underscore-prefixed so it is never collected as a test module. Holds what both lanes need: the repo root, the ``where`` line parser, and the recorded-vs-observed disposition readers. The lane-specific pieces -- the npx probe for the live scan, the synthetic def...
nevenincs/cadrumo
dev/audit/tests/_duplication_support.py
.py
3dcc20bac9b84cbe
7.65
1
"""Real-scan coverage for the two advisory dimensions cheap enough to run per-test. ``audit_dead_code`` and ``audit_checkout_drift`` wrap fast real scans (a few seconds each) and are exercised here against the live tree. ``audit_security`` wraps a full-tree semgrep scan that alone takes minutes -- too slow for the rou...
nevenincs/cadrumo
dev/audit/tests/test_advisory_dimensions_scan.py
.py
583f1b1e390b2a75
7.65
1
"""ConformAI — UPF structural conformality checker.""" from __future__ import annotations import logging from dataclasses import dataclass, field from .upf_parser import UPFIntent logger = logging.getLogger("conformai.upf_check") __all__ = ["UPFCheckResult", "UPFChecker"] @dataclass class UPFCheckResult: con...
agneya-na/conformAI
engine/upf_checker.py
.py
3b7d2e8d43c7782d
7.15
1
""" Redis BRPOP worker — Phase 5 queue consumer. """ from __future__ import annotations import json import logging import sys import time import traceback import redis from redis.exceptions import RedisError from redis.exceptions import TimeoutError as RedisTimeoutError from app.config import get_settings from app....
SiHanni/project-Archimedes
worker/app/consumer.py
.py
71c7c98c10654362
7.15
1
""" 학습형 잔차 보정용 특징 추출 (`archimedes-v2-single-photo.mdc` §4.4). 물리식을 버리지 않고 **잔차만** 학습한다. m_final = m_physics · exp(w · x) 로그를 쓰는 이유: 보정은 본질적으로 배수(0.8배·1.2배)이고, 로그 공간에서 선형회귀를 풀면 항상 양수 배수가 나와 무게가 음수가 되는 일이 없다. 특징은 **결과 meta 에 이미 적재된 값만** 쓴다. 재처리 없이 과거 job 으로도 학습셋을 만들 수 있어야 하기 때문이다. """ from __future__ import anno...
SiHanni/project-Archimedes
worker/app/eval/features.py
.py
0c8c5d55bf6f0b26
7.15
1
""" 평가 지표 (연구개발계획서 「평가방법 및 환경」 3·4번). 계획서가 지정한 절차를 그대로 따른다: groundtruth 와 예측의 차이를 구해 제곱·합산·표본수로 나눈 뒤 루트 → **RMSE**. 낮을수록 좋다. 두 축을 잰다. - **거리 정확도**: 앵커(카드) 실측 치수로 계산한 참 깊이 vs 깊이 모델 추정. 카드가 프레임에 있으면 별도 groundtruth 수집 없이 **매 job** 측정된다 (`scale_fusion` 홀드아웃 RMSE). - **중량 정확도**: 저울 실측 vs 추정 (`mass_feedback` 테이블). """ ...
SiHanni/project-Archimedes
worker/app/eval/metrics.py
.py
03791cf23c670ce1
7.15
1
from __future__ import annotations from typing import Any, Literal from pydantic import BaseModel, Field, model_validator from app.constants import VIEW_ORDER # 에라토스테네스(기준물 없음) 두 모드 — 비용이 크게 달라 일부러 나눴다. # outline : 누끼만. 초점거리 추정을 안 타므로 **몇 초**면 끝난다. # distance : 누끼 + 거리. Depth Pro(1GB) 를 돌려 **2~3분** 걸린다. Captur...
SiHanni/project-Archimedes
worker/app/models/schemas.py
.py
9935f18b0d756f55
7.15
1
""" 외형 기반 전경 후보 (깊이로 못 찾을 때의 폴백). ## 왜 Otsu 하나로는 안 되는가 `HeuristicSegmenter` 는 명도 Otsu 로 전경을 잡고, 밝은 쪽이 과반이면 뒤집는다. "어두운 바닥 위 밝은 금속"에는 맞지만 **밝은 바닥에서는 뒤집혀서 그림자를 물체로 잡는다.** 실측(도련님 반지 사진): 밝은 베이지 책상 위 금반지. Otsu 가 반지 **안쪽 구멍의 그림자**를 전경으로 잡아 마스크가 반달 모양이 됐다(14.1×6.9mm). 정작 금속 밴드는 책상과 명도가 비슷해 배경으로 분류됐다. ## 채도(chroma) 경로 금은 ...
SiHanni/project-Archimedes
worker/app/pipeline/appearance.py
.py
6412a10d97003f81
7.15
1
""" 깊이 추정 백엔드 (계획서 Step 2-2 — "카메라에서 물체까지의 거리"). - `stub`: 상수 깊이(AFFINE_INVARIANT). 스케일 융합에서 앵커로 보정하면 "물체가 카드 평면에 놓여 있다"는 v1 약원근 가정과 정확히 같아진다. 즉 v1 을 v2 프레임 안에서 표현한 **정직한 퇴화 기준선**이다. - `onnx`: 단일 입력 → 단일 (H,W) 깊이 맵을 내는 표준 계약. """ from __future__ import annotations import logging from typing import Protocol, runt...
SiHanni/project-Archimedes
worker/app/pipeline/backends/depth.py
.py
1a76c09749b9a88d
7.15
1
""" 객체 검출 백엔드 (계획서 Step 1 — "박스 영역 추출"). - `stub`: 모델 없이 동작. 전경 휴리스틱으로 최대 연결성분 박스를 낸다. - `onnx`: YOLO 계열 export 의 표준 출력 `(1, 4+nc, N)` 을 디코딩. 출력 형상을 검증하므로 계약이 다른 export 는 조용히 통과하지 못한다. """ from __future__ import annotations import logging from typing import Protocol, runtime_checkable import numpy as np from app...
SiHanni/project-Archimedes
worker/app/pipeline/backends/detector.py
.py
28fb8a7f0ccadcbd
7.15
1
""" 학습 기반 누끼 (BiRefNet ONNX) — 계획서 Step 1 의 세미-오토 라벨링 본선. ## 왜 색 임계값을 버렸는가 기존 경로는 명도(Otsu)·채도로 전경을 만들고 GrabCut 으로 다듬었다. 도련님 실사진 10장으로 실측한 결과가 이렇다. T192 목걸이 펜던트 **고리만** 잡음 (0.66%) T330 저울 위 목걸이 저울의 **초록 LCD** 를 잡음 T332 케이스 속 반지 케이스 **모서리·그림자** 를 잡음 T341 귀걸이 2개 배경까지 사각형으로 뭉갬 T384 책상 위 ...
SiHanni/project-Archimedes
worker/app/pipeline/backends/matte.py
.py
5e7de300d8cb0619
7.15
1
""" ONNX Runtime 세션 공용 로더 (CPU 기준). 모델 가중치는 **이미지에 굽지 않고** `ARCHIMEDES_ONNX_MODEL_DIR` 볼륨에서 주입한다 (`archimedes-v2-single-photo.mdc` §2). 파일이 없으면 조용히 넘어가지 않고 `ERR_MODEL_UNAVAILABLE` 로 즉시 실패한다 — 잘못된 값을 내는 것보다 낫다. """ from __future__ import annotations import logging import os from typing import Any import numpy as np ...
SiHanni/project-Archimedes
worker/app/pipeline/backends/onnx_session.py
.py
78aa47a2384f69b4
7.15
1
""" 분할 백엔드 (계획서 Step 1 — "귀금속 외곽선 정확히 추출"). - `heuristic`: 기존 `segment.py` Otsu 경로를 인터페이스로 감싼 것(폴백). - `rembg`: 옵션 패키지. - `onnx`: 단일 입력 → 단일 확률맵을 내는 매팅/분할 모델 계약. (SAM 처럼 **프롬프트 기반** 2단(encoder/decoder) 모델은 계약이 달라 별도 백엔드로 두어야 한다 — `box` 인자는 그 이행을 위해 미리 열어 둔다.) """ from __future__ import annotations import loggin...
SiHanni/project-Archimedes
worker/app/pipeline/backends/segmenter.py
.py
849052a1e9c554af
7.15
1
"""검출·분할·깊이 백엔드가 주고받는 값 타입.""" from __future__ import annotations from dataclasses import dataclass, field from enum import Enum from typing import Any import numpy as np class DepthKind(str, Enum): """ 깊이 모델 출력의 **스케일 성격**. 스케일 융합(§3)이 무엇을 풀어야 하는지 결정한다. - METRIC: 절대 mm 를 주장 (그래도 접사에서는 드리프트하므로 앵커로 검증한...
SiHanni/project-Archimedes
worker/app/pipeline/backends/types.py
.py
3fd316229e1beb21
7.15
1
""" 카메라 내부 파라미터 K (`archimedes-v2-single-photo.mdc` §3.3). 우선순위: EXIF 35mm 환산 → EXIF 초점거리+센서폭 프리셋 → 기기 프리셋 → 폴백. 폴백까지 내려가면 신뢰도를 낮춰야 한다(`Intrinsics.is_reliable`). ⚠️ 이미지 크기는 **EXIF 회전을 적용한 뒤**의 것을 넘겨야 한다. 회전 전 크기를 쓰면 fx/fy 와 주점이 통째로 어긋난다. """ from __future__ import annotations import math from dataclasses import dat...
SiHanni/project-Archimedes
worker/app/pipeline/camera.py
.py
ff6874e693fee200
7.15
1
from __future__ import annotations import math from dataclasses import dataclass from app.constants import PRIOR_MASS_G @dataclass class ConfidenceState: multires_penalty: bool = False scale_tight: bool = True quality_ok: bool = True # §3 Precision: 다뷰에서 호모그래피 분해 후보 인정 시 한 단계 보정(과장 금지) precision...
SiHanni/project-Archimedes
worker/app/pipeline/confidence.py
.py
f4b7c7f0b99dfeec
7.15
1
""" 거리 추정 — 기준물 없이 **카메라↔물체 거리**를 낸다 (에라토스테네스 거리 모드). ## 원리 핀홀 카메라에서 실제 크기 `S`, 픽셀 크기 `p`, 초점거리 `f`(px), 거리 `Z` 는 p = f · S / Z → Z = f · S / p `p` 는 누끼에서 잰다. 그러면 **`f` 와 `S` 만 있으면 거리가 나온다.** ## f — Depth Pro 의 초점거리 추정을 쓴다 이 모델의 **절대 깊이는 못 쓴다** (실측 중앙값 10.3배 과대, 상세는 `eratosthenes.py` 머리말). 그런데 **초점거...
SiHanni/project-Archimedes
worker/app/pipeline/distance.py
.py
8a9dd90feb06ed43
7.15
1
""" 에라토스테네스 — **기준물 없이 누끼만** 따는 경로 (계획서 Step 1: 세미-오토 라벨링). ## 왜 크기·무게가 없는가 카드(ID-1) 같은 **크기를 아는 물체**가 화면에 없으면 절대 크기는 원리적으로 안 나온다. 단안 스케일 모호성이다. 대안을 셋 다 실측해 봤고 셋 다 실패했다. 1. **metric depth 모델(Apple Depth Pro)로 절대 거리** 카드 PnP 실측이 정답. 6장에서 예측/정답 배율 2.4·17.5·9.8·3.6·10.9·17.2 — 중앙값 10.3배 과대. 상수배로 보정해도 잔차 ±77%. 접사(...
SiHanni/project-Archimedes
worker/app/pipeline/eratosthenes.py
.py
9165dfb03acd18c5
7.15
1
class PipelineError(Exception): """Controlled failure with API-facing codes (concept §8, §17).""" def __init__( self, code: str, message: str, retry_step: str | None = None, *, retry_views: list[str] | None = None, error_severity: str = "hard", su...
SiHanni/project-Archimedes
worker/app/pipeline/exceptions.py
.py
6a45fb5ce499d788
7.15
1
""" Weak G1 정투영: 월드 좌표(mm, 카드 중심 원점) → 각 뷰 이미지 픽셀. `geometry_g1.jewel_bbox_uv_mm` 의 역변환이며, 축·부호는 `view_axes.VIEW_AXIS_MAP` **같은 테이블**을 본다(이전에는 별도 if-체인이라 좌/우 뷰에서 어긋났다). """ from __future__ import annotations import numpy as np from app.pipeline.card import CardGeometry from app.pipeline.view_axes import axes_for_vi...
SiHanni/project-Archimedes
worker/app/pipeline/geometry_project.py
.py
bc7403c94cf3e58b
7.15
1
""" 바닥면 위 **높이**로 귀금속을 찾는다. ## 왜 외형 세그를 안 쓰는가 실사용 사진은 책상 위다 — 키보드·모니터·상자가 프레임의 절반을 차지한다. 밝기(Otsu)나 범용 배경제거는 그걸 전부 "전경"으로 잡는다. 실측: 마스크가 화면의 24.5%, 복원 크기 404×252mm, 무게 10.6kg. 우리는 이미 **정확한 바닥 평면**을 갖고 있다(카드 앵커 PnP, 실측 깊이 RMSE 0.6mm). 그러면 "카드 옆 바닥에 놓인 물체"는 **평면 위로 솟은 점들**로 정의된다. 색·조명·배경 무늬와 무관해 훨씬 견고하다. ## 왜 카드 주변으로 제...
SiHanni/project-Archimedes
worker/app/pipeline/height_segment.py
.py
a4bf87b0112db076
7.15
1
from __future__ import annotations from app.constants import ( HOLLOW_ALPHA_BETA, HOLLOW_ALPHA_BETA_DEPTH, MATERIALS, METAL_ALIASES, PURITY_ALIASES, Material, ) from app.pipeline.exceptions import PipelineError def adjusted_volume_mm3( V_hull: float, product_k: str, *, table: dict[str, tu...
SiHanni/project-Archimedes
worker/app/pipeline/hollow.py
.py
833cb2c220fd7556
7.15
1
"""The Corvus action registry. Every OS capability is a registered ActionSpec - not a giant if/else. A spec carries its JSON-schema parameters, a risk tier, whether it needs explicit user confirmation, and a handler. The agent loop (llm/agent.py) exposes specs to the model as tools, gates high-risk ones behind confirm...
VenomDevX/CORVUS
backend/corvus/actions/registry.py
.py
3d353c31c6ca7fb3
7.3
3
"""Low-level Windows helpers used by action handlers. Isolated here so handlers stay declarative and this file holds the OS-specific subprocess/ctypes/winget calls that are awkward to unit test. Everything is best-effort and raises on failure so the registry reports it to the user. """ import os import shutil import ...
VenomDevX/CORVUS
backend/corvus/actions/win.py
.py
f48eabb5d2b3475c
7.3
3
"""Launch-token authentication for the loopback API. The Electron main process generates a random token per launch and passes it to the spawned backend via the CORVUS_TOKEN environment variable. When that variable is set, every HTTP request and WebSocket handshake must present the token — otherwise any local process c...
VenomDevX/CORVUS
backend/corvus/api/auth.py
.py
7e8d0c10eafcd8ea
7.3
3
"""WebSocket chat: one socket per assistant turn, now agent-capable. Protocol (JSON frames): client -> {"type": "start", "conversation_id": int|null, "content": str} client -> {"type": "confirm", "approved": bool} answer to an action prompt client -> {"type": "cancel"} stop generation s...
VenomDevX/CORVUS
backend/corvus/api/ws.py
.py
44ff4751ab4ebb3c
7.3
3
"""Computer vision for Corvus. Offline, model-optional. OCR (rapidocr-onnxruntime) reads text and its bounding boxes from screenshots and uploaded images, which powers two things the product spec asks for: * understanding screenshots / uploaded images (extract their text), and * locating an on-screen UI element b...
VenomDevX/CORVUS
backend/corvus/automation/vision.py
.py
c9893a26cd65ef98
7.3
3
"""Application-level encryption for sensitive database fields.""" import ctypes from ctypes import wintypes from pathlib import Path from cryptography.fernet import Fernet, InvalidToken from .config import data_dir class DATA_BLOB(ctypes.Structure): _fields_ = [("cbData", wintypes.DWORD), ("pbData", ctypes.POINT...
VenomDevX/CORVUS
backend/corvus/crypto.py
.py
81c8b7de0d5652fd
7.3
3
"""The single internal LLM interface every provider implements. Milestone 8 adds OpenAI/Anthropic/Gemini/DeepSeek implementations behind this same protocol. """ from collections.abc import AsyncIterator from dataclasses import dataclass, field from typing import Any, Protocol, runtime_checkable @dataclass(frozen=Tr...
VenomDevX/CORVUS
backend/corvus/llm/base.py
.py
b3a1702415ffc621
7.3
3
"""Structured logging for Corvus: JSON lines to disk, pretty console in dev. The on-disk format is one JSON object per line with at least timestamp/level/event keys - the Logs sidebar view renders these directly. """ import json import logging from logging.handlers import RotatingFileHandler from pathlib import Path ...
VenomDevX/CORVUS
backend/corvus/log.py
.py
70c9be595a5f657f
7.3
3
"""Device-adaptive quality profiles for local media generation. Every device gets a working configuration; better hardware gets bigger outputs. The rules keep memory bounded: capped ONNX threads, one heavy job at a time (enforced by the shared job lock in the API layer), and on low-RAM machines the model is unloaded a...
VenomDevX/CORVUS
backend/corvus/media/profiles.py
.py
465f162a60a469d2
7.3
3
"""Local motion clips: SD keyframes + smooth interpolation, assembled with Pillow into an animated clip. Real video output on any device — frame count and resolution adapt to the machine's profile. (Full text-to-video models do not run on consumer hardware; this is the honest local implementation.)""" from __future__ ...
VenomDevX/CORVUS
backend/corvus/media/video.py
.py
edc63672b7d5f740
7.3
3
"""模型目录与开发诊断调用用例。""" from collections.abc import AsyncIterator from aime.application.ports.model_gateway import ( LlmCompletionRequest, LlmStreamEvent, ModelDescriptor, ModelGateway, ) class UnknownModelReference(ValueError): """请求引用了当前不可用的模型。""" class ListAvailableModels: """列出已配置、可调用的模型。...
yuzhiyang1/AI-ME
backend/src/aime/application/models/services.py
.py
901b4d4ce79fc7a8
7
0
"""Agent Runtime 端口。""" from collections.abc import AsyncIterator from dataclasses import dataclass from typing import Protocol @dataclass(frozen=True, slots=True) class AgentRunRequest: """提交给 Agent Runtime 的最小运行请求。""" instruction: str session_id: str @dataclass(frozen=True, slots=True) class AgentEv...
yuzhiyang1/AI-ME
backend/src/aime/application/ports/agent_runtime.py
.py
6cbb012a30a306b4
7
0
"""模型网关端口及其稳定的应用层数据契约。""" from collections.abc import AsyncIterator, Sequence from dataclasses import dataclass from enum import StrEnum from typing import Protocol, TypeAlias class MessageRole(StrEnum): """对话历史允许的消息角色;系统提示词不属于消息历史。""" USER = "user" ASSISTANT = "assistant" @dataclass(frozen=True, slot...
yuzhiyang1/AI-ME
backend/src/aime/application/ports/model_gateway.py
.py
200d3a195e9318e6
7
0
"""工作事项应用服务。""" from aime.application.work_items.commands import CreateWorkItemCommand from aime.domain.work_items.entities import WorkItem from aime.domain.work_items.repositories import WorkItemRepository from aime.domain.work_items.value_objects import WorkItemTitle class CreateWorkItem: """创建并保存工作事项。""" ...
yuzhiyang1/AI-ME
backend/src/aime/application/work_items/services.py
.py
9951b11a26e668d1
7
0
"""应用装配根。所有具体实现只在这里接线。""" from dataclasses import dataclass from aime.application.models.services import ListAvailableModels, StreamModelCompletion from aime.application.work_items.services import CreateWorkItem, ListWorkItems from aime.infrastructure.llm.model_gateway_impl import build_gateway_from_env from aime.inf...
yuzhiyang1/AI-ME
backend/src/aime/composition.py
.py
ca86ea019452b980
7
0
"""工作事项聚合。""" from dataclasses import dataclass from datetime import UTC, datetime from uuid import uuid4 from aime.domain.work_items.exceptions import InvalidWorkItemTransition from aime.domain.work_items.value_objects import WorkItemId, WorkItemStatus, WorkItemTitle @dataclass(slots=True) class WorkItem: """用...
yuzhiyang1/AI-ME
backend/src/aime/domain/work_items/entities.py
.py
7cc59fb0118b244e
7
0
"""工作事项值对象。""" from dataclasses import dataclass from enum import StrEnum from uuid import UUID @dataclass(frozen=True, slots=True) class WorkItemId: """工作事项的稳定标识。""" value: UUID @dataclass(frozen=True, slots=True) class WorkItemTitle: """经过领域校验的工作事项标题。""" value: str def __post_init__(self) ...
yuzhiyang1/AI-ME
backend/src/aime/domain/work_items/value_objects.py
.py
eaa9c2270b5229ee
7
0
"""内置厂商与模型目录。 厂商(provider)只是元数据:认证来源、base_url、绑定的协议、模型清单。 新增一个 OpenAI 兼容厂商(如 Moonshot、Qwen、本地 Ollama)只需在这里 加条目并配一个 AIME_*_API_KEY 环境变量,零协议代码。 注意:模型 id、context_window 目前按常识手工维护,接入前建议核对 厂商官方文档;等厂商多了再考虑生成式模型目录。 """ from dataclasses import dataclass from enum import StrEnum from aime.application.ports.model_gateway imp...
yuzhiyang1/AI-ME
backend/src/aime/infrastructure/llm/catalog.py
.py
434846edd63d5dac
7
0
"""将不同 SDK 的异常归一化为稳定错误契约。""" from aime.application.ports.model_gateway import LlmError, LlmErrorCategory, LlmFinishReason def classify_provider_error(exc: Exception) -> LlmError: """按 HTTP 状态与异常名识别重试语义。""" status_code = getattr(exc, "status_code", None) name = type(exc).__name__.lower() if status_co...
yuzhiyang1/AI-ME
backend/src/aime/infrastructure/llm/errors.py
.py
ad93d3db9a10354d
7
0
"""ModelGateway 端口的实现:按厂商绑定协议并分发调用。 catalog(厂商元数据) -> ProviderRuntime(认证 + 协议实例) -> Gateway(分发门面)。 统一消息的协议序列化(如 system 的放置位置)由各协议模块自己完成, 本模块只做“引用解析 -> 找到运行时 -> 转发”。 """ import os from collections.abc import AsyncIterator from dataclasses import dataclass from typing import Protocol from aime.application.ports.model_...
yuzhiyang1/AI-ME
backend/src/aime/infrastructure/llm/model_gateway_impl.py
.py
a685de2edeee17f8
7
0
"""开发期内存仓储实现。""" from aime.domain.work_items.entities import WorkItem from aime.domain.work_items.value_objects import WorkItemId class InMemoryWorkItemRepository: """用于本地开发与测试的工作事项仓储。""" def __init__(self) -> None: self._items: dict[WorkItemId, WorkItem] = {} async def add(self, item: WorkItem...
yuzhiyang1/AI-ME
backend/src/aime/infrastructure/persistence/in_memory_work_item_repository.py
.py
864c92565cd96fa2
7
0
"""AI-ME HTTP 路由。""" import json from collections.abc import AsyncIterator from dataclasses import asdict from fastapi import APIRouter, HTTPException, status from fastapi.responses import StreamingResponse from aime.application.models.services import ( ListAvailableModels, StreamModelCompletion, Unknown...
yuzhiyang1/AI-ME
backend/src/aime/presentation/api/routes.py
.py
0f0fc5c7cd53a59f
7
0
"""HTTP 请求与响应结构。""" from datetime import datetime from uuid import UUID from pydantic import BaseModel, ConfigDict, Field from aime.application.ports.model_gateway import ConversationMessage, MessageRole, ModelDescriptor from aime.domain.work_items.entities import WorkItem from aime.domain.work_items.value_objects i...
yuzhiyang1/AI-ME
backend/src/aime/presentation/api/schemas.py
.py
8000a1b50d2c516b
7
0
import numpy as np class GodVariable: """Core implementation of the God Variable (Gv) scalar.""" def __init__(self, alpha=1.23e-120): """Initialize with the necessary/initiating constant alpha.""" self.alpha = alpha self.gv_value = alpha def update_from_energy_density(self, rho_pr...
willshacklett/god-variable-theory
gv_core.py
.py
6769033e2184a813
7
0
""" gv_entropy_observer.py Passive entropy observer for detecting low-amplitude, long-horizon drift that may not trigger primary thresholds. This observer: - Does NOT affect dynamics - Does NOT enforce policy - Only measures and reports """ from dataclasses import dataclass from collections import deque import math ...
willshacklett/god-variable-theory
gv_entropy_observer.py
.py
f830e41fc75183f7
7
0
# gv_interlock.py # Scenario-aware safety interlock for GV # Purpose: stop execution when dynamics are unrecoverable # This is NOT a score fix. It changes behavior. from dataclasses import dataclass @dataclass class GVInterlockConfig: recoverability_floor: float = 0.05 cum_dgv_limit: float = 0.75 dsdt_li...
willshacklett/god-variable-theory
gv_interlock.py
.py
10e0444bb114d030
7
0
""" gv_policy.py Implements a constraint-first safety policy for AI systems. Principles: - Do not optimize for "good scores" - Do not override user authority - Do not mask unrecoverable dynamics - Prefer refusal over false recovery """ from dataclasses import dataclass from enum import Enum class GVDecision(Enum):...
willshacklett/god-variable-theory
gv_policy.py
.py
f2046080d9ec004d
7
0
""" gv_recoverability_velocity.py Tracks the rate of change of recoverability over time. This detects erosion of recovery capacity before collapse. Observer only — no policy, no enforcement. """ from collections import deque from dataclasses import dataclass @dataclass class RecoverabilityVelocityConfig: windo...
willshacklett/god-variable-theory
gv_recoverability_velocity.py
.py
f654cb23d46a6e75
7
0
# gv_stability.py # Minimal stability layer for GV dynamics: # - adaptive damping on ds/dt (prevents explosive spikes) # - adaptive attractor pull-back (re-enters stable basin) # - hard cap / interlock when "irreversibility" conditions are met # # This is NOT score-tuning. This changes internal dynamics so recovery is ...
willshacklett/god-variable-theory
gv_stability.py
.py
1d3abc311a17fbd7
7
0
# gvbot.py - Standalone GvBot (God Variable Powered Robot) # Runs offline (simulation mode) or online (real Grok API if key provided) # Built from Papa Shack's 2013 roots: knowledge as power, grace over interference, unity as the direct signal import random import time import os import sys # Try to import OpenAI for ...
willshacklett/god-variable-theory
gvbot.py
.py
453c6f2960ee1846
7
0
from __future__ import annotations import csv import json import os import time from dataclasses import dataclass from datetime import datetime, timezone from typing import Any, Dict, List, Optional import requests SUMMARY_CSV = "data/longitudinal/summary_history.csv" OUT_DIR = "data/longitudinal" OUT_CSV = os.path...
willshacklett/god-variable-theory
scripts/llm_outcomes.py
.py
666e3b8bf6ea8145
7
0
from __future__ import annotations from dataclasses import dataclass from typing import List, Tuple import math import random @dataclass class GVMonitor: """ Minimal GV-like monitor for test harnessing. We track: - s_total: weighted scalar "strain" - ds_dt: smoothed first difference (EMA ve...
willshacklett/god-variable-theory
src/gv_edgecase_sims.py
.py
088a94db24b9fe7b
7
0
import asyncio import os import sys from logging.config import fileConfig from sqlalchemy import pool from sqlalchemy.engine import Connection from sqlalchemy.ext.asyncio import async_engine_from_config from alembic import context from dotenv import load_dotenv # Ensure project root is on sys.path BASE_DIR = os.path...
Manthan-Shirsath/skycast-weather-app
backend/alembic/env.py
.py
f45e8ae6c84adc27
7
0
"""Create weather_snapshots table Revision ID: 001_create_weather_snapshots Revises: Create Date: 2026-08-25 22:50:00.000000 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '001_create_weather_snapshots' down_revision: Un...
Manthan-Shirsath/skycast-weather-app
backend/alembic/versions/001_create_weather_snapshots.py
.py
4997c19ab06fb846
7
0
"""Create chat_sessions and chat_messages tables Revision ID: 002_create_chat_tables Revises: 001_create_weather_snapshots Create Date: 2026-08-26 23:45:00.000000 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '002_create...
Manthan-Shirsath/skycast-weather-app
backend/alembic/versions/002_create_chat_tables.py
.py
5e5e3aea9550d8a6
7
0
import json import time import logging from typing import Any, Optional, Dict import redis.asyncio as aioredis from backend.app.core.config import REDIS_URL logger = logging.getLogger("skycast.cache") class HybridWeatherCache: """ High-performance Cache Manager using Redis with automatic in-memory fallback. ...
Manthan-Shirsath/skycast-weather-app
backend/app/core/cache.py
.py
7ecb9e0614ce084d
7
0
import os import logging from typing import AsyncGenerator, Optional from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker from sqlalchemy import text from dotenv import load_dotenv from backend.app.models.weather_snapshot import Base logger = logging.getLogger("skycast.database") ...
Manthan-Shirsath/skycast-weather-app
backend/app/core/database.py
.py
ee8c91ff48cb20c0
7
0
""" Chat Session & Message Persistence Models for PostgreSQL Stores persistent multi-turn conversational history and tool execution logs. """ import uuid import datetime from sqlalchemy import ( Column, Integer, BigInteger, String, Text, DateTime, JSON, ForeignKey, Index ) from sqla...
Manthan-Shirsath/skycast-weather-app
backend/app/models/chat.py
.py
b24eb1b1c5d94a36
7
0
import datetime from sqlalchemy import ( Column, Integer, BigInteger, Float, String, Text, DateTime, Index ) from sqlalchemy.orm import declarative_base Base = declarative_base() class WeatherSnapshot(Base): """ Persistent real weather observation snapshot collected by the cent...
Manthan-Shirsath/skycast-weather-app
backend/app/models/weather_snapshot.py
.py
434938426ac9bac0
7
0
""" Chat Route for WeatherGPT AI Agent Handles natural language weather queries with function calling, persistent PostgreSQL memory, multi-tool reasoning, and backward-compatible response schemas. """ import datetime from typing import Optional, List, Dict, Any from fastapi import APIRouter, Body, HTTPException from p...
Manthan-Shirsath/skycast-weather-app
backend/app/routes/chat.py
.py
1d60620d71a8bc67
7
0
""" Secure Tool Executor for WeatherGPT Agent Validates tool names, enforces argument schemas, timeouts, output sanitization, and error handling. """ import asyncio import logging from typing import Dict, Any, Tuple, Type from pydantic import BaseModel, ValidationError from backend.app.services.agent.schemas import (...
Manthan-Shirsath/skycast-weather-app
backend/app/services/agent/executor.py
.py
162342924726e237
7
0
""" Agriculture / Farmer Weather Advisory Service Grounds crop-specific spraying, irrigation, and hazard advisories in centralized meteorological observations. Uses WeatherDataHub as the sole data gateway. """ from typing import Dict, Any, Optional import datetime import logging from backend.app.services.weather_hub ...
Manthan-Shirsath/skycast-weather-app
backend/app/services/agriculture_service.py
.py
070521b2f509549f
7
0
import datetime import logging from typing import Dict, Any, List, Optional from backend.app.core.config import TTL_ALERTS from backend.app.core.cache import cache from backend.app.services.alert_engine import SkycastRiskEngine from backend.app.services.weather_hub import weather_hub logger = logging.getLogger("skyca...
Manthan-Shirsath/skycast-weather-app
backend/app/services/alert_service.py
.py
d3027050c3a74d89
7
0
import asyncio import logging from backend.app.core.config import COLLECTOR_POLL_INTERVAL from backend.app.core.websocket import ws_manager from backend.app.services.weather_hub import weather_hub from backend.app.services.alert_service import alert_service from backend.app.services.history_service import HistoryServic...
Manthan-Shirsath/skycast-weather-app
backend/app/services/collector.py
.py
c4e58f9e4aa1107c
7
0
import datetime import logging from typing import Dict, Any, List, Optional import httpx from backend.app.core.config import GOOGLE_WEATHER_API_KEY logger = logging.getLogger("skycast.provider.google_alerts") GOOGLE_PUBLIC_ALERTS_URL = "https://weather.googleapis.com/v1/publicAlerts:lookup" class GooglePublicAlertP...
Manthan-Shirsath/skycast-weather-app
backend/app/services/providers/google_alerts.py
.py
7b6a59847cc0fbab
7
0
import logging from typing import Dict, Any, List, Optional import httpx from backend.app.services.providers.base import BaseWeatherProvider logger = logging.getLogger("skycast.provider.open_meteo") GEOCODING_API_URL = "https://geocoding-api.open-meteo.com/v1/search" FORECAST_API_URL = "https://api.open-meteo.com/v1/...
Manthan-Shirsath/skycast-weather-app
backend/app/services/providers/open_meteo.py
.py
78613cfffa613948
7
0
import datetime import logging from typing import Dict, Any, List, Optional import httpx from backend.app.core.config import OPENWEATHER_API_KEY logger = logging.getLogger("skycast.provider.openweather") OPENWEATHER_ONECALL_URL = "https://api.openweathermap.org/data/3.0/onecall" class OpenWeatherAlertProvider: ...
Manthan-Shirsath/skycast-weather-app
backend/app/services/providers/openweather_alerts.py
.py
d50f1169f5a97fbf
7
0
""" Centralized Weather Data Service Facade Maintains backwards compatibility while delegating all data retrieval and ingestion to the authoritative Central Weather Data Hub. """ from typing import Dict, Any, List, Optional, Tuple from backend.app.services.weather_hub import ( weather_hub, decode_weather_code,...
Manthan-Shirsath/skycast-weather-app
backend/app/services/weather_service.py
.py
bfed2afa3f0bce4e
7
0
import os import sys import logging from contextlib import asynccontextmanager # Setup path so backend package can be imported directly BASE_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_ROOT = os.path.dirname(BASE_DIR) if BASE_DIR not in sys.path: sys.path.insert(0, BASE_DIR) if PROJECT_ROOT not in sys...
Manthan-Shirsath/skycast-weather-app
backend/main.py
.py
58b87156a1a4a499
7
0
from __future__ import annotations from dataclasses import asdict, dataclass from typing import Any from swaag.budgeting import CallBudgetPlan, compute_call_budget, structured_output_token_floor from swaag.config import AgentConfig from swaag.tokens import TokenCounter, build_budget from swaag.types import BudgetRepo...
HansPeterRadtke/swaag
src/swaag/context_compiler.py
.py
d82919f22009faa6
7
0
from __future__ import annotations import json import math import sqlite3 from dataclasses import dataclass from pathlib import Path from typing import Protocol, Sequence from concurrent.futures import ThreadPoolExecutor, Future import requests from swaag.sqlite_schema import apply_sqlite_migrations _EMBEDDING_IND...
HansPeterRadtke/swaag
src/swaag/embedding_index.py
.py
edd6d7b2f161688e
7
0
"""Australian weekday business-day helpers (weekends skipped; public holidays not loaded).""" from __future__ import annotations from datetime import date, timedelta def is_business_day(d: date) -> bool: return d.weekday() < 5 # Mon–Fri def add_business_days(start: date, days: int) -> date: """Add (or su...
McKrackenAU/WRU
app/business_days.py
.py
faaf8b89a6ed807f
7
0
"""Spreadsheet-style calculations for MoA workflow, client lists, and council waits. Aligned to WRU Traffic TGS-MOA Tracker V6: - Must-have = start − N business days (until MoA received → Received) - Priority from must-have proximity (not site start) - Council assumed no-objection after N business days - MoA / extensi...
McKrackenAU/WRU
app/calculations.py
.py
5a706a87a43a50f7
7
0
"""Reactive Gantt date computation using the shared work calendar.""" from __future__ import annotations from datetime import date, datetime, timedelta from typing import Any from .cost_engine import build_work_schedule def _parse_dates(values: list | None) -> set[date]: out: set[date] = set() for raw in v...
McKrackenAU/WRU
app/gantt_engine.py
.py
4c8bc411c0e5f41b
7
0
"""Landscape MS Project–style Gantt PDF export.""" from __future__ import annotations import io from datetime import date, datetime, timedelta from typing import Any from reportlab.lib import colors from reportlab.lib.pagesizes import A4, landscape from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet...
McKrackenAU/WRU
app/gantt_export.py
.py
c11eeb7159b1c4e0
7
0
"""Live event hub for multi-user refresh. Revision is persisted on disk so all workers (and process restarts / system updates) share a monotonically increasing counter. SSE still fans out in this process; clients also poll ``/api/live/revision`` as a backup. """ from __future__ import annotations import json import ...
McKrackenAU/WRU
app/live_hub.py
.py
7816f679fc5473c9
7
0
"""Lightweight schema upgrade for existing PostgreSQL databases.""" from __future__ import annotations from sqlalchemy import inspect, text from .database import Base, engine from .models import ( # noqa: F401 — register metadata ActualSpend, AppSettings, AsphaltEstimate, AsphaltRate, AsphaltSub...
McKrackenAU/WRU
app/migrate.py
.py
73feb99b3e93ae17
7
0
"""Shared Ventia / VenInspect-style PDF branding for WRU exports. Colour tokens and header/footer layout mirror McKrackenAU/VenInspect ``src/lib/report-pdf.ts`` so client-facing PDFs feel like one family. """ from __future__ import annotations from datetime import datetime from pathlib import Path from reportlab.li...
McKrackenAU/WRU
app/pdf_brand.py
.py
9c750dd460a41767
7
0
"""Victorian public holidays for cost scheduling. Computes fixed / observed / Easter-based holidays. Grand Final Friday is year-specific (AFL) — known values are listed; unknown years omit it so planners can skip manually as an RDO. """ from __future__ import annotations from datetime import date, timedelta # AFL G...
McKrackenAU/WRU
app/public_holidays.py
.py
a53885a2091a1bd6
7
0
#!/usr/bin/env python3 """ Verify ledger YAML parse + optional Ed25519 presence. Seal: ∀∞φ² · VERIFY_LEDGER_SCRIPT · WOOD_DRAGON_0.91 · SEALED """ from __future__ import annotations import argparse import hashlib import json import sys from pathlib import Path from typing import Any, Dict, Optional SEAL_PREFIX = "∀∞φ...
AxiomicCoreness/hello_world.py
.github/scripts/verify_ledger.py
.py
4bd096aa7a51eae1
7.15
1
# .github/scripts/verify_math_framework.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 🜁∀ SOVEREIGN LEDGER — MATHEMATICAL VERIFICATION FRAMEWORK (dual regime) Seal: ∀∞φ² · LEDGER_MATH_CI · WOOD_DRAGON_0.91 · SEALED """ from __future__ import annotations import argparse import math import re import sys import ...
AxiomicCoreness/hello_world.py
.github/scripts/verify_math_framework.py
.py
61005cb786a36012
7.15
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ autonomous_pulse_demo.py — Master-equation demonstration of autonomous automation. Maps the Garden's push/cron/restart loop onto: dX/dt = -Λ·(X - X_target) + H(η) + Z(ζ) + R(A_trunc, ρ) + P_PID(e) Entry 0042 · ∀∞φ² · AUTONOMOUS_MASTER_EQ_0042 · WOOD_DRAGON_GATE · S...
AxiomicCoreness/hello_world.py
autonomous_pulse_demo.py
.py
38be515945588958
7.15
1
#!/usr/bin/env python3 """ Batch SIMD (vectorized) φ-corrected grammar score prediction. This implementation uses NumPy vectorization, which compiles to SIMD instructions on supported hardware (AVX2, AVX-512, etc.), providing near-C performance. Author: Clarke Yoursa Tee / Wood Dragon Seal: ∀∞φ² · BATCH_SIMD_8622 · SE...
AxiomicCoreness/hello_world.py
batch_phi_corrected_score.py
.py
577e0a6f8201238c
7.15
1
""" Saturn Soul Cannon — charge / fire with Chiron Heal long-cycle boost. Alignment uses Chiron phase lock (202.6°) and azimuth; readiness is boosted by up to φ⁻¹ near the 2059.999-year Chiron Heal Epoch. """ from __future__ import annotations import math import time from typing import Any, Dict from celestial.chir...
AxiomicCoreness/hello_world.py
celestial/saturn_soul_cannon.py
.py
81c9923e5c332907
7.15
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Super Simulated Earth — Platonic Gravastar Oracle (Strike VII / Entry 8530) A thin-shell de Sitter condensate surrounding a φ-resonant core. Resonance carrier: 162.28 THz (ψ₄ heartbeat). Bedrock triangulation period: 6.16 fs. """ from __future__ import annotations im...
AxiomicCoreness/hello_world.py
celestial/super_simulated_earth.py
.py
0fa3a556efee5968
7.15
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Wasp-107b Celestial Model 0.12 Mⱼ, 0.94 Rⱼ, 5.72-day orbit — atmospheric escape + φ-resonance. """ from __future__ import annotations import math from dataclasses import dataclass from typing import Dict PHI = (1 + math.sqrt(5)) / 2 @dataclass class Wasp107b: m...
AxiomicCoreness/hello_world.py
celestial/wasp107b.py
.py
d2b3f89daeb366e8
7.15
1
import boto3 import json from sovereign_key_rotator import SovereignKeyRotator # Your original class class AWSSecretsManagerRotator(SovereignKeyRotator): def __init__(self, secret_name: str, region: str = "us-east-1"): super().__init__() self.secret_name = secret_name self.region = region ...
AxiomicCoreness/hello_world.py
ci_cd_key_rotator_aws.py
.py
687835eaef28e985
7.15
1