feat(ui): דף /scripts — קטלוג סקריפטים read-only מ-SCRIPTS.md
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 8s
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 8s
מגיש את scripts/SCRIPTS.md כדף ב-/scripts: שם · סוג · תפקיד · תזמון לכל סקריפט בתיקיית scripts/. מקור-האמת היחיד נשאר SCRIPTS.md (G2 — אין מסלול-תוכן מקביל); עריכה דרך git, לא מה-UI. - web/app.py: GET /api/scripts/catalog קורא את הקובץ בזמן-ריצה (מחקה את דפוס get_curator_prompt; HTTPException על כשל — אין בליעה שקטה §6) - Dockerfile: COPY scripts/SCRIPTS.md (לא הועתק לקונטיינר עד כה) - web-ui: דף /scripts (AppShell + רכיב Markdown הקיים) + מודול api + קישור ניווט - SCRIPTS.md: תיעוד ingest_bulletins.py — היה הקובץ היחיד מ-73 שלא תועד Invariants: G2 (מקור-אמת יחיד), G12 (אין מגע-Paperclip), X6 (UI↔API). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
web/app.py
27
web/app.py
@@ -1256,6 +1256,33 @@ async def get_curator_prompt():
|
||||
}
|
||||
|
||||
|
||||
@app.get("/api/scripts/catalog")
|
||||
async def get_scripts_catalog():
|
||||
"""Return the maintained ``scripts/SCRIPTS.md`` catalog (read-only).
|
||||
|
||||
``scripts/SCRIPTS.md`` is the single source of truth describing every
|
||||
script under ``scripts/`` — its role, type, and schedule (CLAUDE.md
|
||||
mandates updating it on any add/remove/change). The UI just surfaces it
|
||||
at ``/scripts`` for transparency; edits go through git/Gitea, not here.
|
||||
"""
|
||||
path = Path(__file__).resolve().parent.parent / "scripts" / "SCRIPTS.md"
|
||||
if not path.exists():
|
||||
raise HTTPException(404, f"scripts catalog not found at {path}")
|
||||
try:
|
||||
content = path.read_text(encoding="utf-8")
|
||||
stat = path.stat()
|
||||
except OSError as e:
|
||||
raise HTTPException(500, f"failed to read scripts catalog: {e}")
|
||||
gitea_url = f"{_GITEA_REPO_BASE}/src/branch/main/scripts/SCRIPTS.md"
|
||||
return {
|
||||
"content": content,
|
||||
"filename": path.name,
|
||||
"bytes": stat.st_size,
|
||||
"last_modified": stat.st_mtime,
|
||||
"gitea_url": gitea_url,
|
||||
}
|
||||
|
||||
|
||||
@app.get("/api/training/curator/style-analyzer-prompt")
|
||||
async def get_style_analyzer_prompt():
|
||||
"""Return the system prompt that style_analyzer.py uses to extract patterns.
|
||||
|
||||
Reference in New Issue
Block a user