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
"""问答与检索 API:POST /api/chat(非流式)、POST /api/chat/stream(SSE 流式)、GET /api/search。 0.1.5(档位 3):流式输出(SSE)+ 对话历史(conversation_id 携带上下文,回答后入库)。 """ from __future__ import annotations import json from typing import Optional from fastapi import APIRouter, HTTPException, Request from fastapi.responses import StreamingRespons...
awardat/lantai
backend/app/routers/chat.py
.py
36b6d94406c7bf23
7
0
"""文档管理 API:上传 / 列表 / 详情 / 删除 / 预览。""" from __future__ import annotations from pathlib import Path from typing import Optional from fastapi import APIRouter, Body, File, HTTPException, UploadFile from fastapi.responses import FileResponse from .. import config, filetype, pipeline, store as store_mod from ..schemas i...
awardat/lantai
backend/app/routers/docs.py
.py
8f8f4566db07150e
7
0
"""Dify 外部知识库 API 适配(0.1.38,CH-071)。 协议(Dify External Knowledge API): - `POST {注册端点}/retrieval`,`Authorization: Bearer <API Key>`(兰台侧 = 设置页生成的 API token) - 请求:{knowledge_id, query, retrieval_setting:{top_k, score_threshold}, metadata_condition?} - 响应:{"records": [{"content", "score", "title", "metadata"}]};metadata 必须...
awardat/lantai
backend/app/routers/external.py
.py
7b4d483caae9944d
7
0
"""配置 API:密码门禁 / AI 配置 / API token / 修改密码 / 系统信息。 除 verify 与 system/info 外均需会话(设置页密码校验后发放的 Cookie)。 RBAC(R101)落地后,此处升级为权限点鉴权。 """ from __future__ import annotations import hashlib from fastapi import APIRouter, Cookie, Header, HTTPException, Request, Response from .. import config, llm, security, store as store_mod...
awardat/lantai
backend/app/routers/settings.py
.py
debb941c9d8853fc
7
0
"""解析任务队列(0.1.18):FIFO 队列 + 固定并发 worker(默认 10,设置可调)。 - 上传的文档先入队(status=queued),worker 取出后置 parsing 并执行解析; - 并发数可在设置页调整(1~50):增加即时启动新 worker,减少通过 None 哨兵优雅退出; - 单机内存队列(演示级);服务重启时 lifespan 将 queued/parsing 文档重新入队恢复。 """ from __future__ import annotations import queue import threading from .store import Store _QUEUE: ...
awardat/lantai
backend/app/task_queue.py
.py
a953ac0cb8d12c65
7
0
"""生成兰台桌面壳图标(shell/icons/):藏青渐变圆角方块 + 白色「兰」字。 输出:icon.ico(16/24/32/48/64/128/256 多尺寸)、icon.png(512)、 32x32.png、128x128.png、128x128@2x.png(Tauri 默认图标集)、 ui 启动页 logo.png(256)。 用法:python scripts/gen_shell_icon.py 依赖:Pillow(backend/requirements.txt 已含) """ from __future__ import annotations import sys from pathlib impor...
awardat/lantai
scripts/gen_shell_icon.py
.py
cf5319bfc99722dc
7
0
"""生成演示用样例文档(仅开发自测,演示文档由用户提供放入 docs/)。 用法:python make_sample_docs.py [输出目录] # 默认 scripts/sample_docs/ 生成:txt / md / docx / pdf(文字)/ 图片(png,用 PIL 可选)样例。 """ from __future__ import annotations import sys from pathlib import Path OUT_DEFAULT = Path(__file__).resolve().parent / "sample_docs" SAMPLES = { "兰台简介.txt...
awardat/lantai
scripts/make_sample_docs.py
.py
5d38e19e001cecab
7
0
"""一次性批量改造脚本:dsh-ui 壳 → 兰台壳(品牌/默认值/端口/配置)。 用法:python scripts/rebrand_shell.py """ from __future__ import annotations import io from pathlib import Path SHELL = Path(r"C:\code\lantai\shell") def read(p: Path) -> str: return p.read_text(encoding="utf-8") def write(p: Path, s: str) -> None: p.write_text(s, e...
awardat/lantai
scripts/rebrand_shell.py
.py
2c687007035c541c
7
0
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Build a self-contain...
kmgowda/sbk-dashboard
scripts/build_portable.py
.py
a142035a9a7cd639
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Validate release art...
kmgowda/sbk-dashboard
scripts/build_release_manifest.py
.py
7b270bdf8e59e68d
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Discover and optiona...
kmgowda/sbk-dashboard
scripts/check_mermaid.py
.py
42d04da59ed874f3
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Safely extract a sin...
kmgowda/sbk-dashboard
scripts/docker_safe_extract.py
.py
3a65c1d1fff86458
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Syntax-compatible so...
kmgowda/sbk-dashboard
scripts/python_requirement.py
.py
df4339117f01e278
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Shared names and bou...
kmgowda/sbk-dashboard
scripts/release_contract.py
.py
f4318fa1bcafb828
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Read one trusted nat...
kmgowda/sbk-dashboard
scripts/resolve_native_artifact.py
.py
4ba9a7a514ec3909
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Entry point for self...
kmgowda/sbk-dashboard
scripts/sbk_dashboard_portable_entry.py
.py
e45bc754a4f4e78c
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Print only missing G...
kmgowda/sbk-dashboard
scripts/select_release_assets.py
.py
4d9075865e0260f9
7.15
1
#!/usr/bin/env python3 # Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Check or update curr...
kmgowda/sbk-dashboard
scripts/sync_release_metadata.py
.py
9127587059d6091f
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Immutable comparison policy and determinist...
kmgowda/sbk-dashboard
src/sbk_dashboard/comparison.py
.py
3159e8696e7040cc
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Filesystem helpers.""" from __future__ imp...
kmgowda/sbk-dashboard
src/sbk_dashboard/files.py
.py
a72362d4441dd6c4
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Atomic installation of the bundled frontend...
kmgowda/sbk-dashboard
src/sbk_dashboard/grafana_plugin.py
.py
62cd89e0e46f43c0
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Internal native-process guardian for hard c...
kmgowda/sbk-dashboard
src/sbk_dashboard/guardian.py
.py
8bfbf537cf8b9022
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Persistent endpoint and health models.""" ...
kmgowda/sbk-dashboard
src/sbk_dashboard/models.py
.py
d5a6ae6d03e43938
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Shared runtime and portable-release platfor...
kmgowda/sbk-dashboard
src/sbk_dashboard/platforms.py
.py
ff575f272c27f5db
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Persistent endpoint registry.""" from __fu...
kmgowda/sbk-dashboard
src/sbk_dashboard/registry.py
.py
b95b71a4996cbe8e
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Windows kill-on-close Job Object containmen...
kmgowda/sbk-dashboard
src/sbk_dashboard/windows_job.py
.py
fdf18510810fc0ba
7.15
1
# Copyright (c) KMG. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ## """Verify production and development Compose f...
kmgowda/sbk-dashboard
tests/compose_contract.py
.py
f40cd1b12025b05b
7.65
1
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/akshare.py
.py
6bb966efdca0a9ff
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/answer.py
.py
692e8981129a1f70
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/baidu.py
.py
19b3249b0cbc932b
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/begin.py
.py
30c3d4f7baefcd94
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/categorize.py
.py
3b1c914b3710aa1e
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/crawler.py
.py
18e7fa7e7eff1ea7
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/email.py
.py
7427e69d73d5314d
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/github.py
.py
1a85c312bc8adb84
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/iteration.py
.py
192343a74d12803e
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/iterationitem.py
.py
a83ecc7dd05758cf
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/jin10.py
.py
7afb9bec2a8638a9
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/keyword.py
.py
0578953d57c4e9b2
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/message.py
.py
a94ee4412c31fa35
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/relevant.py
.py
aa9c73b35128bb3b
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/retrieval.py
.py
b6f7e29ece0e5ef1
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/rewrite.py
.py
60eb6c6d867c998f
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/switch.py
.py
77333f5a80b74668
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/template.py
.py
5e506948fc24b233
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agent/component/yahoofinance.py
.py
836b27652eadf231
7
0
# # Copyright 2024 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
agentic_reasoning/deep_research.py
.py
d5692472a951c919
7
0
# # Copyright 2025 The InfiniFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
rajath-raman/ragflow
api/apps/auth/github.py
.py
2cd7b3032fd23efc
7
0
from __future__ import annotations """Typed activation-usage limits owned by a permanent incarnation. Usage state lives on the source object so control changes and phasing preserve it, while the canonical zone-change reset gives a returning card a new limit. The owner deliberately knows nothing about Oracle text or c...
NullPriority/quorune
quorune/activation_usage.py
.py
f16644fe70d2a162
7
0
#!/usr/bin/env python3 """Lint the project knowledge base for governance hygiene issues. Runs lint passes against handoffs, intake index, wiki pages, and cross-references. Reads thresholds from wiki.yaml, falls back to sensible defaults. Exit code: 1 if any ERRORs found, 0 otherwise. """ from __future__ import annot...
pestopoppa/epyc-root
.claude/skills/project-wiki/scripts/lint_wiki.py
.py
090080d9cfdc101b
7.15
1
#!/usr/bin/env python3 """Query the project knowledge base for compiled knowledge on a topic. Pre-filters intake_index.yaml and scans handoffs/deep-dives to reduce context for LLM synthesis. Returns JSON with matching entries. Usage (run with the orchestrator venv interpreter — PyYAML is required): /workspace/rep...
pestopoppa/epyc-root
.claude/skills/project-wiki/scripts/query_wiki.py
.py
754f73a7e16bc35f
7.15
1
#!/usr/bin/env python3 """Bootstrap the intake index from existing arXiv references across all repos. Scans chapters, handoffs, experiments, and research notes for arXiv IDs, deduplicates, infers categories from source location, and writes the initial intake_index.yaml. """ from __future__ import annotations import ...
pestopoppa/epyc-root
.claude/skills/research-intake/scripts/seed_index.py
.py
6336d21b20cc6a24
7.15
1
#!/usr/bin/env python3 """Count directive (RFC-2119 + project-idiom) keyword occurrences in a markdown file. Used as the P1-4 proof gate: moving incident STORIES to an appendix must not change the number of DIRECTIVES. Run before and after; the totals must match exactly. """ import re import sys # RFC 2119 proper, pl...
pestopoppa/epyc-root
artifacts/operator/staged/rfc2119_count.py
.py
fe84726049292f5a
7.15
1
"""Freshness classification for the handoff dashboard hub. THE ONE CLASSIFIER. Before AK6 this module held an mtime badge and ``server.py`` held two more hand-rolled copies of the same threshold ladder (``_kernel_contract_freshness``, ``_outcome_contract_freshness``). Three copies of one rule is three thresholds vocab...
pestopoppa/epyc-root
dashboard/freshness.py
.py
eab1bd8080adcf98
7.15
1
#!/usr/bin/env python3 """Aggregate KB-RAG eval + pairwise judge → acceptance-criteria outcome. Per handoffs/active/internal-kb-rag.md § "Multilingual Ingest Quality-Gap" acceptance criteria table. Reads thresholds from config.yaml. Emits a markdown decision report. """ from __future__ import annotations import argpa...
pestopoppa/epyc-root
research/multilingual_ingest_test/aggregate_results.py
.py
698a94803e56965a
7.65
1
#!/usr/bin/env python3 """Seed samples.jsonl for the multilingual ingest quality-gap test. Sources: - Flores-200 dev/devtest splits (CC-BY-SA-4.0) — covers most required language codes EXCEPT the Mandarin-minority/dialect stratum (Tibetan/Mongolian/Uyghur/ Cantonese are partial; Cantonese (yue) is in NLLB but qual...
pestopoppa/epyc-root
research/multilingual_ingest_test/curate_samples.py
.py
b0d18cf961300c6e
7.65
1
#!/usr/bin/env python3 """Run Pipeline A / B / C over the curated samples.jsonl. Defaults to DRY-RUN (per feedback_speed_verify_via_llama_bench and feedback_no_concurrent_inference) — prints the curl-equivalent calls without hitting any endpoint. Pass --execute to actually call the endpoints (each pipeline emits a con...
pestopoppa/epyc-root
research/multilingual_ingest_test/run_pipeline.py
.py
19951544a7a87e06
7.65
1
#!/usr/bin/env python3 """Preflight and command emitter for the RustEvo2 Strand verification run. This helper intentionally does not launch llama-server or run the benchmark. It verifies the host-side prerequisites that previously blocked Phase B and prints copy-pastable commands for the exclusive inference window. ""...
pestopoppa/epyc-root
scripts/benchmark/rustevo2_bench_preflight.py
.py
f766dc91cabffc37
7.15
1
"""Shared data models for Search Panda.""" from __future__ import annotations from typing import Literal from pydantic import BaseModel, Field class SearchResponse(BaseModel): pass class SearchResult(BaseModel): """A single result returned from a web search.""" index: int title: str url: str ...
kandarpa02/search-panda
search_panda/agent/data_representation.py
.py
8b8d9a6956b20bdb
7
0
"""Assemble the playtest guide, and refuse to emit one that is broken. The guide is published as an Artifact, which wraps whatever this produces in a document skeleton -- so `head.html` carries the <title> and the whole stylesheet, `body.html` carries the route, and this script is only glue plus a gate. The gate matt...
EricHype/LionheartFixt
docs/playtest-guide/build.py
.py
dde19c21a16d919d
7.5
0
"""Static validation for every file in the Lionheart Fixt mod tree. .DialogTree - CDialogTree wrapper present and closed, brace balance, every 'Go to node ID' resolves (case-insensitively, which the engine tolerates -- 244 vanilla links rely on it), every named Req...
EricHype/LionheartFixt
tools/validate.py
.py
17f44b76de9b81c0
7
0
"""Reader for a flat APT repository's Packages index. The deb targets' `published_index` URLs are flat repos exactly as publish-tideforge-debs.yml writes them: `Packages` (and `Packages.gz`) at the root, one RFC-822-style stanza per binary package, `Filename:` pointing into `pool/`. This module parses that shape into ...
tuna-os/tunaos-packages
scripts/apt_packages.py
.py
ed3ffb1be0be0f77
7
0
#!/usr/bin/env python3 """Report Tideforge gate coverage, and refuse to let it get worse. A recipe declares the targets it wants built. The gate declares the cells it actually builds. Nothing connected the two, which is how openSUSE ended up declared by 19 recipes and built by zero cells (#139). The obvious fix -- as...
tuna-os/tunaos-packages
scripts/check-gate-coverage.py
.py
b64d4a27d48d386b
7
0
#!/usr/bin/env python3 """Refuse an index regeneration that breaks what the old index resolved. The deb and arch publishers do not merge a staged wave into a served tree the way publish-rpm-wave.sh does — they regenerate the WHOLE index in place (apt-ftparchive over pool/, repo-add into the .db) and sync it up. So the...
tuna-os/tunaos-packages
scripts/check-index-regression.py
.py
908f641b680ba0a0
7
0
#!/usr/bin/env python3 """Would publishing this wave break anything already served? Adapted from ebranch's `check-update` (slopfest/sandogasa, Apache-2.0 OR MIT), which refuses to ship a side tag whose new builds leave reverse dependencies uninstallable. Here the "side tag" is a staged wave and the "tag" is the served...
tuna-os/tunaos-packages
scripts/check-reverse-deps.py
.py
e02f824ed8081aa9
7
0
#!/usr/bin/env python3 """Report which factory targets upstream has moved past since we last measured. Hummingbird's whole reason for existing is shipping fixes as soon as they are published — near-zero CVE, per-package lifecycle, rolling with Rawhide. A factory that measures its gap against a snapshot taken weeks ago...
tuna-os/tunaos-packages
scripts/check-upstream-drift.py
.py
8007c1db3bf76281
7
0
#!/usr/bin/env python3 """Which packages we still serve are OLDER than the build upstream now ships. Hummingbird exists to ship fixes as soon as they are published. Our rebuild repository can defeat that, and silently. The gap measurement generates the build set as (desktop closure) minus (what upstream ships), so th...
tuna-os/tunaos-packages
scripts/check-upstream-shadowing.py
.py
3f54a28fd6b09342
7
0
#!/usr/bin/env python3 """ RPM Repository Cleanup Script Keeps only the latest N versions of each package to save storage costs. Can be run as part of CI/CD or as a standalone cron job. """ import argparse import os import re import subprocess import sys from collections import defaultdict from datetime import dateti...
tuna-os/tunaos-packages
scripts/cleanup.py
.py
4e25da54f65221ae
7
0
#!/usr/bin/env python3 """ COPR Build Chain Engine Triggers COPR builds tier-by-tier from build-order.yml. Packages within a tier are submitted in parallel; tiers are sequential. Bootstrap handling: - When spec_override is set, the COPR package name is derived from the spec filename (e.g. glib2-bootstrap.spec →...
tuna-os/tunaos-packages
scripts/copr-build-chain.py
.py
a80367e4beef4392
7
0
"""Debian version comparison, in pure Python. Implements dpkg's algorithm (deb-version(7)): an optional numeric ``epoch:``, an upstream version, and an optional ``-revision`` split on the LAST hyphen. Each part compares by alternating runs of non-digits and digits, where non-digit runs use modified ASCII — all letters...
tuna-os/tunaos-packages
scripts/deb_version.py
.py
ceb5e8d6cb5455c5
7
0
#!/usr/bin/env python3 """What changed between two buildroots — the koji-diff question, locally. Compares two buildroot manifests (one NEVRA per line, as written by scripts/extract-buildroot-manifest.py), or two directories of them package by package. The output is the answer to "it built last week and fails today": w...
tuna-os/tunaos-packages
scripts/diff-buildroots.py
.py
b856efb29776dc31
7
0
import subprocess import os import sys def download_source(url, dest_dir): """ Downloads a source file using wget. """ if not os.path.exists(dest_dir): os.makedirs(dest_dir) filename = url.split('/')[-1] dest_path = os.path.join(dest_dir, filename) if os.path.exists(de...
tuna-os/tunaos-packages
scripts/download_upstream_sources.py
.py
6c7cc9a38b9da7f8
7
0
#!/usr/bin/env python3 """What was actually in the buildroot when this package built. Adapted from koji-diff's buildroot comparison (slopfest/sandogasa, Apache-2.0 OR MIT), which answers "what changed between the build that worked and the build that did not" from build-system metadata instead of archaeology. This fact...
tuna-os/tunaos-packages
scripts/extract-buildroot-manifest.py
.py
bb0754e6f6216311
7
0
#!/usr/bin/env python3 """One definition of which target-contract fields can change a build. `manifests/package-factory.yaml` describes each target in a single block, and that block mixes three different audiences: * what a BUILD reads -- buildroot, probe_image, build_repositories, arc...
tuna-os/tunaos-packages
scripts/factory_contract.py
.py
fa020ded19cce62d
7
0
import subprocess import os import sys import argparse def clone_package(package_name, dest_dir, branch="rawhide"): """ Clones a package from Fedora Dist-Git via HTTPS with specific branch. """ pkg_dir = os.path.join(dest_dir, package_name) if os.path.exists(pkg_dir): # If it exists, try to...
tuna-os/tunaos-packages
scripts/fetch_rawhide_specs.py
.py
047789f17569cd7f
7.5
0
import os import sys import re def parse_spec_source(content): """ Simplistic SPEC parser to find Source0 URL and expand basic macros. """ macros = {} source0 = "" # First pass: find defines and standard tags for line in content.splitlines(): # Standard tags: Name, Version, etc...
tuna-os/tunaos-packages
scripts/identify_upstream_sources.py
.py
f8e0c3d6e22c104e
7
0
#!/usr/bin/env python3 """Import Fedora dist-git RPM packaging into src/hummingbird. Only packaging inputs are copied (specs, patches, source declarations and auxiliary build files); the dist-git repository itself is never nested in this repository. The result is reviewable and can be built by build-chain.sh. Two dr...
tuna-os/tunaos-packages
scripts/import-fedora-distgit.py
.py
fe0b2b389ea2bf6d
7
0
#!/usr/bin/env python3 """Print NAME-VERSION-RELEASE for every package a published rpm-md index serves. list-served-nvrs.py https://repo.tunaos.org/hummingbird/20251124-x86_64/ Output feeds `build-chain.sh --served-nvrs`: one NVR per line, deduplicated. Epoch is deliberately dropped -- the skip compares against `...
tuna-os/tunaos-packages
scripts/list-served-nvrs.py
.py
9cffc56c1a050425
7
0
import json import sys def parse_copr_json(json_str): """ Parses the JSON output from `copr-cli list-packages` and returns a list of package names. """ try: data = json.loads(json_str) if isinstance(data, list): return [pkg["name"] for pkg in data if "name" in pkg] r...
tuna-os/tunaos-packages
scripts/list_copr_packages.py
.py
fc43aea16ed6474f
7
0
"""Reader for a pacman repository database, plus libalpm's vercmp. The arch target publishes with repo-add (scripts/publish-arch-wave.sh): a `<name>.db` tar archive of `<pkg>-<ver>-<rel>/desc` entries. This module parses that into the same row/index structures the RPM and deb checks consume, so the moment the arch tar...
tuna-os/tunaos-packages
scripts/pacman_db.py
.py
75fbe1857735725f
7
0
#!/usr/bin/env python3 """Resolve build-chain cells for publishing, and refuse the unsafe ones. The build-chain families each declare an `r2_path` in the catalog, so where a cell publishes is data rather than something this workflow invents. What the data does NOT settle is whether that destination is safe to sync int...
tuna-os/tunaos-packages
scripts/plan-build-chain-publish.py
.py
b84ca9a4d279576e
7
0
#!/usr/bin/env python3 """Emit the deb publish matrix from the target contract and the recipes. publish-tideforge-debs.yml was the last publisher with a hand-written `include:` list. publish-tideforge-rpms.yml resolves its matrix from the recipes in a plan job and publish-build-chain-rpms.yml calls plan-build-chain-pu...
tuna-os/tunaos-packages
scripts/plan-deb-publish.py
.py
c4ea953fe9f48eba
7
0
#!/usr/bin/env python3 """Emit the RPM publish matrices for a target, from the contract and recipes. publish-tideforge-rpms.yml hard-coded el10 in six places: the plan job's `"el10" not in targets` check, CELL_ID, TARGET, IMAGE, a `case $arch` for the R2 sync path, and a second `case $arch` for the served verify URL. ...
tuna-os/tunaos-packages
scripts/plan-rpm-publish.py
.py
8104d70df976ed99
7
0
#!/usr/bin/env python3 """Decide which Tideforge gate cells actually need to run. WHY. `detect-changes` is one boolean for the whole gate: if anything under packages/, scripts/, the gate workflows or .github/actions/ changed, ALL 98 cells build (84 supported + 14 arch); otherwise none do. Editing one recipe therefor...
tuna-os/tunaos-packages
scripts/plan_gate_matrix.py
.py
e46c6b89bb8ac1de
7
0
#!/usr/bin/env python3 """Fan `build-hummingbird-desktops.yml` out over desktops. The workflow used to be a single job with a `desktop:` choice, so the whole 670-package gap was driven one dispatch at a time on one runner. Measured on five real runs (see docs/hummingbird-throughput.md) the build step is 95.6%- 97.8% ...
tuna-os/tunaos-packages
scripts/plan_hummingbird_matrix.py
.py
a80629fb9310e611
7
0
#!/usr/bin/env python3 """Find the packages that cannot build before spending four hours proving it. A tier's job only discovers an unsatisfiable BuildRequires when it gets there. On the 40-layer order that can be hours in, and the answer was knowable before the run started: for every source package in the build order...
tuna-os/tunaos-packages
scripts/preflight-buildrequires.py
.py
ea21366db444d368
7
0
#!/usr/bin/env python3 """Check Tideforge recipe dependencies against real distro repositories.""" from __future__ import annotations import argparse import importlib.util import json from pathlib import Path import subprocess import yaml ROOT = Path(__file__).resolve().parents[1] FACTORY = ROOT / "manifests" / "pa...
tuna-os/tunaos-packages
scripts/probe-target-dependencies.py
.py
d773de2dee23809b
7
0
#!/usr/bin/env python3 """Resolve a target/arch's published index URL(s) from the factory contract. `published_index` in manifests/package-factory.yaml is the SERVED read URL of what a target has published — distinct from `r2_path`, which is the bucket WRITE path. Three consumers read it, and until now each carried it...
tuna-os/tunaos-packages
scripts/published_index.py
.py
7c82722906a28a0d
7
0
"""The format-neutral index layer: one way to read any served repository. `manifests/package-factory.yaml` declares three package formats — rpm, deb, pkg.tar.zst — and every one of them is a first-class target. Yet the de-facto library for reading repositories grew inside the gap engine (scripts/gap_engine.py, which w...
tuna-os/tunaos-packages
scripts/repo_index.py
.py
28765500c38130db
7
0
#!/usr/bin/env python3 """Resume a build-chain cell from what a previous attempt already built. ## The problem A build-chain cell has `timeout-minutes: 360`. The GNOME cells build ~55 packages and have hit that ceiling (#480). When they do, the job is reported as CANCELLED, and everything it built -- up to six hours ...
tuna-os/tunaos-packages
scripts/restore-partial-chain-output.py
.py
58623b8f5dc5648e
7
0
"""Enforce immutable successful extraction content in PostgreSQL.""" from collections.abc import Sequence from alembic import op revision: str = "20260821_0010" down_revision: str | None = "20260821_0009" branch_labels: str | Sequence[str] | None = None depends_on: str | Sequence[str] | None = None def upgrade() -...
maxsmolka/private-document-intelligence
apps/api/migrations/versions/20260821_0010_enforce_extraction_immutability.py
.py
3d32c713d4cdcb8c
7
0
"""add update executor lease Revision ID: 20260828_0015 Revises: 20260827_0014 Create Date: 2026-08-28 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op revision: str = "20260828_0015" down_revision: str | None = "20260827_0014" branch_labels: str | Sequence[str] | None = None ...
maxsmolka/private-document-intelligence
apps/api/migrations/versions/20260828_0015_add_update_executor_lease.py
.py
a59c1b371a48fddd
7
0
"""Server-authoritative first-user bootstrap lifecycle.""" from sqlalchemy import select from sqlalchemy.ext.asyncio import AsyncSession from pdi.auth.service import LoginResult, audit_event, create_user, issue_session from pdi.core.concurrency import advisory_xact_lock from pdi.core.config import Settings from pdi.o...
maxsmolka/private-document-intelligence
apps/api/pdi/auth/bootstrap.py
.py
03649b1974238545
7
0
"""CEC2011 F21--F22 -- Spacecraft Trajectory Optimisation (MGA-DSM). F21 (Messenger) and F22 (Cassini-Huygens) minimise the total delta-V of interplanetary trajectories using Multiple Gravity Assist with Deep Space Maneuvers (MGA-DSM). Reference --------- Suganthan, P.N. et al., "Problem Definitions and Evaluation Cr...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2011/problems_spacecraft.py
.py
13bdcd67b0be5eed
7
0
"""Reference results for CEC2011 from published GSK paper. Source: Mohamed, A.W., Hadi, A.A. & Mohamed, A.K. "Gaining-sharing knowledge based algorithm for solving optimization problems: a novel nature-inspired algorithm" International Journal of Machine Learning and Cybernetics 11, 1501-1529 (...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2011/reference_results.py
.py
cb7a683eb51deb20
7
0
"""Thread-local selection between the batch and serial CEC2013 kernel sets. Suite mirror of ``cec2017/_kernel_mode.py`` — read that module's docstring for the full design rationale. The CEC2013 formula kernels in ``_numba.py`` are compiled ``parallel=True`` and pay a fixed parallel-runtime launch cost per kernel call...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2013/_kernel_mode.py
.py
dd87c673dcf9c529
7
0
"""Thread-local selection between the batch and serial CEC2013-LSGO kernel sets. Suite-local mirror of ``cec2017/_kernel_mode.py`` (see that module's full rationale). The LSGO JIT kernels in ``_numba.py`` are compiled ``parallel=True`` and pay a fixed parallel-runtime launch cost per call at ``numba_threads=1`` (meas...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2013lsgo/_kernel_mode.py
.py
a1efc0c83df41905
7
0
"""Serial (``parallel=False``) twins of the CEC2013-LSGO JIT kernels. Suite mirror of ``cec2017/_numba_serial.py`` — read that module's docstring for the full rationale. In short: every kernel in ``_numba.py`` is compiled ``parallel=True`` and pays a fixed parallel-runtime launch per call at ``numba_threads=1``. At ...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2013lsgo/_numba_serial.py
.py
831b03e9b7272a38
7
0
"""Thread-local selection between the batch and serial CEC2017 kernel sets. The CEC2017 JIT kernels in ``_numba.py`` are compiled ``parallel=True`` and pay a fixed parallel-runtime launch cost (~60 us per kernel launch at ``numba_threads=1``) regardless of batch size. That cost is invisible for full-population dispat...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2017/_kernel_mode.py
.py
aa110f32eb859940
7
0
"""CEC2017 simple functions F1–F10 (shifted + rotated single base functions). Each function applies shift_rotate(x, shift, rotation) → z, then calls the base function on z and adds a bias = fid × 100. Function mapping and special cases: F1: bent_cigar (standard shift+rotate) F2: sum_diff_pow (DEPRECATED —...
MostafaMassoud/DT-GSK
benchmarks/cec_suite_python/cec2017/simple.py
.py
b46a813b24687a2c
7
0