KIS·정성매도·스냅샷어드민·캘리브레이션을 CI/npm/문서에 통합 배선

이전 커밋들에서 추가한 기능을 실제로 동작시키는 배선 작업.

- .gitea/workflows/ci.yml: No Direct API Trading 게이트, KIS 자격증명
  검증(mock), 캘리브레이션 백로그 빌드, 정성매도 파이프라인 검증,
  Gitea secrets 계약 검증, snapshot admin 워크플로/웹 검증 단계 추가
- package.json: ops:data-collect, ops:sell-*, ops:snapshot-*,
  ops:calibration-* npm 스크립트 추가
- src/gas/core/gas_lib.gs doPost(): "trigger_run_all" action 추가 —
  Gitea CI가 공유 비밀키로 run_all()을 원격 트리거(주문 실행 없음,
  governance/rules/06·07과 동일 원칙)
- tools/trigger_gas_run_all_v1.py: 위 GAS 엔드포인트를 호출하는 CLI
- AGENTS.md/README.md: 신규 파일 인덱스 및 사용 가이드 갱신
This commit is contained in:
2026-06-21 20:11:26 +09:00
parent 670ab8e15a
commit 4c00229442
8 changed files with 505 additions and 2 deletions
+23
View File
@@ -2467,6 +2467,29 @@ function doPost(e) {
.createTextOutput(JSON.stringify(result, null, 2))
.setMimeType(ContentService.MimeType.JSON);
}
if (action === "trigger_run_all") {
// 외부(Gitea CI) 스케줄러가 run_all()을 원격 트리거할 수 있게 하는 진입점.
// run_all은 매수/매도 주문을 실행하지 않는다(데이터 갱신·분석 전용) — governance
// 06/07과 동일한 "조회/분석만, 주문 없음" 원칙을 따른다. 공유 비밀키로 무단 호출 차단.
const expectedSecret = String(PropertiesService.getScriptProperties().getProperty("RUN_ALL_TRIGGER_SECRET") || "");
const providedSecret = String(payload.secret || "");
if (!expectedSecret || providedSecret !== expectedSecret) {
return ContentService
.createTextOutput(JSON.stringify({ status: "ERROR", message: "unauthorized" }, null, 2))
.setMimeType(ContentService.MimeType.JSON);
}
const startedAt = new Date().toISOString();
try {
run_all();
return ContentService
.createTextOutput(JSON.stringify({ status: "OK", started_at: startedAt, finished_at: new Date().toISOString() }, null, 2))
.setMimeType(ContentService.MimeType.JSON);
} catch (runErr) {
return ContentService
.createTextOutput(JSON.stringify({ status: "ERROR", message: String(runErr && runErr.message ? runErr.message : runErr) }, null, 2))
.setMimeType(ContentService.MimeType.JSON);
}
}
return ContentService
.createTextOutput(JSON.stringify({
status: "ERROR",