Skip to content

feat(price): add price history from Serval #61 - #62

Merged
yashiels merged 1 commit into
mainfrom
agent/serval-price
Sep 27, 2026
Merged

yashiels merged 1 commit into
mainfrom
agent/serval-price

Conversation

@yashiels

Copy link
Copy Markdown
Owner

takealot price history <plid|PLID..|takealot url> [--since 90d|1y|all] [--series] [--no-cache] [--json]

Reads the daily price history that servaltracker.com already holds (owner has verbal permission from the operator). Implements the Oracle-signed plan in docs/plans/serval-price-history.md.

  • Output: current + date, low/high with dates, average, median, last change, listing ("was") price, stale flag, sparkline. All values computed from cleaned points, never from Serval's annotations.
  • Network: fixed URL template from an integer PLID, origin/path check before fetch, literal headers only (honest UA), no Takealot client/credentials/cookies/did, redirect manual, 15 s timeout, 2 MB cap, max 2 requests (one retry on network/timeout/5xx only). Never calls Serval search/submit. send() and PAYMENT_BLOCKED unchanged.
  • Cache: $XDG_CACHE_HOME/takealot-cli/serval, 24 h, schema-versioned, re-validated on read, 0700/0600, 404 cached as not_tracked.
  • Errors: 404 -> exit 4 not_tracked; bad input -> exit 4; format change/HTTP/network -> exit 1 with specific codes; never exit 3.

471 tests. Live checked (tracked product, cache hit, 1y window, cache modes, bad input). Oracle: plan signed off after 4 rounds, code signed off first round. Docs STE-100 lint 0.

Closes #61

@yashiels
yashiels merged commit 8bd2ad5 into main Sep 27, 2026
1 check passed
@yashiels
yashiels deleted the agent/serval-price branch September 27, 2026 10:05

@sentinel-skyner sentinel-skyner Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Sentinel review

No critical issues found in the diff

Automated review via openrouter:deepseek/deepseek-chat-v3.1. Findings only — not an approval. Push new commits to re-review.

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.

feat: takealot price history via Serval (read-only, one request per command)

1 participant