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
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ help-full:
@echo " export SEC_USER_AGENT='Name email@example.com'"
@echo " make sec-stage TICKERS=NVDA,MSFT"
@echo " make sec-fundamentals-preview TICKERS=AAPL,NVDA,AMD Official SEC annual comparison; max five explicit tickers; no cache, staging, or apply writes"
@echo " make sec-fundamentals-patch-preview SEC_PREVIEW=/tmp/reviewed-sec-preview.json EXPECTED_SEC_PREVIEW_SHA256=<sha256> EXPECTED_CANONICAL_SHA256=<sha256> Exact reviewed-cell projection; drift fails closed; no writes or apply"
@echo " make yfinance-stage TICKERS=NVDA"
@echo " make fundamentals-source-ladder TICKERS=NVDA"
@echo " Try SEC, yfinance, FMP, Alpha Vantage, then Finnhub before stopping at reviewed blocker evidence"
Expand Down Expand Up @@ -1286,6 +1287,19 @@ ifndef TICKERS
endif
@PYTHONDONTWRITEBYTECODE=1 python3 -m src.sec_fundamentals_preview --tickers "$(TICKERS)"

.PHONY: sec-fundamentals-patch-preview
sec-fundamentals-patch-preview:
ifndef SEC_PREVIEW
$(error SEC_PREVIEW is required, for example: make sec-fundamentals-patch-preview SEC_PREVIEW=/tmp/reviewed-sec-preview.json)
endif
ifndef EXPECTED_SEC_PREVIEW_SHA256
$(error EXPECTED_SEC_PREVIEW_SHA256 is required)
endif
ifndef EXPECTED_CANONICAL_SHA256
$(error EXPECTED_CANONICAL_SHA256 is required)
endif
@PYTHONDONTWRITEBYTECODE=1 python3 -m src.sec_fundamentals_patch_preview --sec-preview-path "$(SEC_PREVIEW)" --canonical-path "$(or $(CANONICAL_PATH),data/fundamentals.csv)" --expected-sec-preview-sha256 "$(EXPECTED_SEC_PREVIEW_SHA256)" --expected-canonical-sha256 "$(EXPECTED_CANONICAL_SHA256)" --repository-head "$(shell git rev-parse HEAD)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require the reviewed repository hash

When the checkout has moved since the SEC packet was reviewed, this launcher substitutes the new git rev-parse HEAD value and the Python code only validates its format, so the command succeeds and records the drifted commit as if it were a satisfied precondition. This defeats the advertised hash-bound, fail-closed behavior and could let an owner approve cells projected by unreviewed code; require an externally supplied expected repository hash and compare it with the actual HEAD instead.

Useful? React with 👍 / 👎.


demo-dashboard-render-smoke:
@STOCK_RESEARCH_DATA_PROFILE=demo python3 -m src.dashboard_render_smoke

Expand Down
Loading