feat(gas-thin-adapter): Phase 3 thin_adapter — 23개 forbidden 함수에 THIN_ADAPTER 위임 주석 삽입

GAS_THIN_ADAPTER_POLICY_V1 Phase 3 (thin_adapter) 진행:
- tools/gas_thin_adapter_phase3_annotate.py: 23개 GAS forbidden 함수에 THIN_ADAPTER 주석 자동 삽입 스크립트
- src/gas_adapter_parts 7개 파일: 각 forbidden 함수 본문 첫 줄에
  // THIN_ADAPTER: [<responsibility>] delegated to Python — <module>:<function>
  주석 추가 (기능 코드 무변경, additive-only)
- spec/39: thin_adapter phase IN_PROGRESS + thin_adapter_result 블록 추가

⚠ GAS 파일 변경됨 — GAS deploy + 사용자 검증 필요 (runDataFeed 실행)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 11:32:00 +09:00
parent 926ea8e6b0
commit 7786e60daf
9 changed files with 236 additions and 0 deletions
@@ -61,6 +61,7 @@ function assembleHarnessCoreLayers_(
regimeTrimGuidance, regimeTransitionAlert, regimeSizeScale, regimeCashMinPct,
heatThresholds, heatGate, actions, h1, kospiRet5d, sectorFlowRadar
) {
// THIN_ADAPTER: [sizing] delegated to Python — src/quant_engine/inject_computed_harness.py:main
var h2 = calcSellPriority_(asResult.holdings, dfMap, h1);
var h3 = calcQuantities_(asResult.holdings, dfMap, totalAsset, buyPowerKrw, h1);
var h4 = calcPrices_(asResult.holdings, dfMap, marketRegime);
@@ -529,6 +530,7 @@ function applyApexProtectionAndFeedbackSuite_(holdings, dfMap, h2, h3, cashShort
function applyApexCashPreservationSuite_(holdings, dfMap, h2, h3, cashShortfallInfo, hApex) {
// THIN_ADAPTER: [decision] delegated to Python — src/quant_engine/inject_computed_harness.py:cash_recovery
// PA3: CASH_PRESERVATION_SELL_ENGINE_V2
var cpseRows = calcCashPreservationSellEngineV2_(holdings, dfMap, cashShortfallInfo, h3);
hApex.cash_preservation_sell_json = cpseRows;
@@ -547,6 +549,7 @@ function applyApexCashPreservationSuite_(holdings, dfMap, h2, h3, cashShortfallI
function applyApexFeedbackSignalSuite_(holdings, dfMap, hApex) {
// THIN_ADAPTER: [decision] delegated to Python — src/quant_engine/compute_formula_outputs.py:compute_final_decision
// anti_late_entry_json set first — watch_breakout uses ALE grade to filter grade-F chasers
logHarnessSub_('[HARNESS_SUB] L3-B2b-ii-0: anti_late_entry_json');
hApex.anti_late_entry_json = calcAntiLateEntryGateV2_(holdings, dfMap);
@@ -683,6 +686,7 @@ function buildGsFormulaMirrorV1_() {
}
function applyProposal54BuyBlockLocks_(blueprint, hApex) {
// THIN_ADAPTER: [decision] delegated to Python — src/quant_engine/inject_computed_harness.py:main
blueprint = Array.isArray(blueprint) ? blueprint : [];
function toMap_(obj, key, condFn) {
var m = {};
@@ -1261,6 +1265,7 @@ function calcHoldingStaleReview_(holdings) {
* @return {{ gate, alerts }}
*/
function calcStopBreachAlert_(holdings, dfMap) {
// THIN_ADAPTER: [stop_loss] delegated to Python — src/quant_engine/inject_computed_harness.py:calc_stop_breach_alerts
var gate = 'PASS';
var alerts = holdings.map(function(h) {
var df = dfMap[h.ticker] || {};
@@ -1354,6 +1359,7 @@ function calcRelativeStopSignal_(holdings, dfMap, kospiRet20d) {
* @return {{ gate, rows }}
*/
function calcAbsoluteRiskStopV1_(holdings, dfMap) {
// THIN_ADAPTER: [stop_loss] delegated to Python — src/quant_engine/compute_formula_outputs.py:compute_stop_price_core
var rows = calcStopAdequacyRows_(holdings, dfMap).map(function(r) {
var stopPrice = Number.isFinite(r.manual_stop) && r.manual_stop > 0
? r.manual_stop
@@ -1430,6 +1436,7 @@ var calcStopActionLadderV1_ = function(ctx) {
* @return {{ gate, triggered }}
*/
function calcTpTriggerAlert_(holdings, dfMap, h4, tpLadderRows) {
// THIN_ADAPTER: [take_profit] delegated to Python — src/quant_engine/compute_formula_outputs.py:compute_tp_validity
var priceMap = {};
(h4.prices || []).forEach(function(p) { priceMap[p.ticker] = p; });
var ladderMap = {};