Skip to content

[truealpha-datahub] Accept bounded raw source interaction - #192

Merged
wangzitian0 merged 2 commits into
mainfrom
batch/d3-e1-tiny
Jul 14, 2026
Merged

[truealpha-datahub] Accept bounded raw source interaction#192
wangzitian0 merged 2 commits into
mainfrom
batch/d3-e1-tiny

Conversation

@wangzitian0

Copy link
Copy Markdown
Owner

Summary

  • split the batch-private Yahoo path into an HTTP raw adapter, append-only in-memory raw-byte ledger, and landed-response normalizer
  • require the frozen scope and call plan before every source call, retaining exact response bytes before normalization
  • bound transport and retryable HTTP attempts to the declared maximum of three and expose content-addressed attempt/call evidence
  • accept only D3 E1 and advance the canonical target to E2 ephemeral persistence

Acceptance evidence

  • targeted D3 suite: 38 passed
  • fresh PostgreSQL database: migrations 0001 through 0021 passed
  • full make check: 699 passed, 4 skipped; Ruff, formatting, mypy, web typecheck, contract conformance, and delivery governance passed
  • live GitHub parity and pull-request authorization passed against base d62131fc54742e17594cda71518c10568db903c4

Claim ceiling

This accepts one frozen, mocked HTTP source interaction with exact in-memory raw-byte retention, bounded retries, and observable calls. It adds no durable persistence, live Staging run, schedule, strategy, Production access, or release activation.

Advances #171.

Copilot AI review requested due to automatic review settings July 14, 2026 13:08
@wangzitian0
wangzitian0 merged commit 3b18ac4 into main Jul 14, 2026
9 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR advances the D3 Staging TOPT capture batch from E1 to E2 in governance tracking, and introduces a batch-private E1 “raw interaction boundary” for Yahoo Chart: a frozen HTTP adapter + append-only in-memory raw-byte ledger + normalization step with bounded retries and content-addressed attempt evidence.

Changes:

  • Advance governance tracking for the D3 batch to target rung E2 and update the batch manifest (revision/base SHA/accepted slice details).
  • Add e1_slice.py implementing bounded HTTP attempts, raw-byte landing, normalization, and content-addressed interaction IDs.
  • Add an E1 test suite validating raw-byte retention, retry/attempt budgeting, and fail-closed behavior across retryable/terminal/transport/normalization outcomes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
governance/vision-issue-graph.json Advances the D3 batch target rung to E2 and updates the manifest hash pointer.
governance/batches/D3-staging-topt-capture.v1.json Updates batch revision, base SHA, accepted slice state/claim ceiling, and E1 evidence fields before targeting E2.
apps/data-engine/src/data_engine/batches/staging_topt_capture/e1_slice.py Adds the E1 raw interaction boundary: HTTP adapter, in-memory raw ledger, attempt evidence, and normalization.
apps/data-engine/tests/batches/staging_topt_capture/test_e1_slice.py Adds tests covering bounded retries, raw-byte landing semantics, drift rejection, and fail-closed behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +114 to +121
payload = {
"call_plan_id": response.call_plan_id,
"attempt_number": response.attempt_number,
"landing_number": landing_number,
"status_code": response.status_code,
"fetched_at": response.fetched_at.isoformat(),
"raw_object_id": response.raw_object_id,
}
Comment on lines +130 to +131
def contains(self, landed: LandedRawResponse) -> bool:
return any(entry is landed for entry in self._entries)
Comment on lines +279 to +280
if self.source_call_count != len(self.attempts):
raise ValueError("source call count does not match attempt evidence")
@wangzitian0
wangzitian0 deleted the batch/d3-e1-tiny branch July 15, 2026 03:52
@wangzitian0 wangzitian0 changed the title [truealpha-data] [D3:E1] Accept bounded raw source interaction [truealpha-datahub] Accept bounded raw source interaction Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants