Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/soxl-free-split-close-p1-p3-research.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
output.write(f"SOXL_V4_P1_TERMINAL_SHA256={hashlib.sha256(encoded).hexdigest()}\n")
if result.get('manifest_sha256'):
output.write(f"SOXL_V4_P1_MANIFEST_SHA256={result['manifest_sha256']}\n")
print('SOXL_V4_P1_TERMINAL=' + encoded.decode('utf-8'))
PY
- name: Run v4 offline P3 evidence after accepted P1
if: steps.p1.outputs.status == 'ACCEPTED'
Expand Down Expand Up @@ -123,11 +124,45 @@ jobs:
if result.get('status') == 'SUCCESS' and isinstance(result.get('evidence_summary_sha256'), str):
status = 'SUCCESS'
evidence_sha256 = result['evidence_summary_sha256']
runs = result.get('runs')
if not isinstance(runs, list) or len(runs) != 12:
raise SystemExit('invalid sanitized SOXL v4 P3 run count')
metrics_fields = (
'net_return',
'max_drawdown',
'sharpe',
'cagr',
'calmar',
'win_rate',
'cost_total',
)
review_runs = []
for run in runs:
if not isinstance(run, dict) or not isinstance(run.get('metrics'), dict):
raise SystemExit('invalid sanitized SOXL v4 P3 run')
metrics = run['metrics']
if not all(isinstance(metrics.get(field), (int, float)) for field in metrics_fields):
raise SystemExit('invalid sanitized SOXL v4 P3 metrics')
review_runs.append(
{
'window_id': run.get('window_id'),
'window_kind': run.get('window_kind'),
'cost_bps': run.get('cost_bps'),
'metrics': {field: metrics[field] for field in metrics_fields},
}
)
review = {
'status': status,
'evidence_summary_sha256': evidence_sha256,
'runs': review_runs,
}
elif set(result) == {'schema_version', 'status', 'failure_class'} and result['status'] == 'PARKED':
status = 'PARKED'
evidence_sha256 = ''
review = {'status': status, 'failure_class': result['failure_class']}
else:
raise SystemExit('invalid sanitized SOXL v4 P3 terminal result')
encoded_review = json.dumps(review, sort_keys=True, separators=(',', ':'))
with open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as output:
output.write(f'status={status}\n')
output.write(f'evidence_summary_sha256={evidence_sha256}\n')
Expand All @@ -137,6 +172,7 @@ jobs:
output.write(f'SOXL_V4_P3_EVIDENCE_SUMMARY_SHA256={evidence_sha256}\n')
else:
output.write(f"SOXL_V4_P3_FAILURE_CLASS={result['failure_class']}\n")
print('SOXL_V4_P3_REVIEW=' + encoded_review)
PY
- name: Record parked P3 when P1 is not admitted
if: steps.p1.outputs.status != 'ACCEPTED'
Expand Down
3 changes: 3 additions & 0 deletions tests/test_soxl_free_split_close_p1_p3_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def test_v4_workflow_is_manual_market_data_research_without_broker_or_raw_artifa
assert "environment: market-data-nonlive" in workflow
assert "TWELVE_DATA_API_KEY: ${{ secrets.TWELVE_DATA_API_KEY }}" in workflow
assert "run_soxl_core_only_free_split_close_p3_evidence.py" in workflow
assert "SOXL_V4_P1_TERMINAL=" in workflow
assert "SOXL_V4_P3_REVIEW=" in workflow
assert "metrics_fields" in workflow
assert "actions/upload-artifact" not in workflow
assert "google-github-actions" not in workflow
assert "gcloud " not in workflow
Expand Down