Commit graph

86 commits

Author SHA1 Message Date
1f5c4b2798 Add KSEI archive fallback import 2026-03-31 19:29:00 +07:00
8404b27628 Add ownership snapshot sync 2026-03-31 19:28:13 +07:00
1e5be755ea Merge branch 'codex/batch-2' 2026-03-31 07:41:28 +07:00
a52712b063 Complete batch 2 ownership import hardening 2026-03-30 16:40:32 +07:00
b1a8c88024 docs: record post-merge batch 1 reconfirmation 2026-03-30 14:59:56 +07:00
c0bcf9c688 test: add real above1 parser fixture
Add a compact parser fixture excerpted from the real 2026-03-10 IDX above1 lamp1 mutool stext output and assert the first live row still parses as expected.

This keeps the post-merge ownership parser coverage grounded in the supported above1 layout instead of relying only on synthetic line fixtures.
2026-03-30 13:06:39 +07:00
5f75856b16 Merge pull request #17 from 0xrsydn/codex/test-first-batch-live-e2e
Ownership Refactor
2026-03-30 12:59:48 +07:00
7928e83cc5 test: reset smoke cache between warm cases
Clear the smoke cache before each cache-group warm case so the following offline and stale-cache checks always start from a fresh baseline instead of earlier group state.

Document the runner behavior in the smoke guide to make the cache-group sequencing explicit.
2026-03-30 12:35:22 +07:00
9d406ba3ee Add IDX above1 ownership discovery and import 2026-03-30 11:58:53 +07:00
a36648fd89 ownership: add IDX above1 discovery and import
Refactor KSEI PDF parsing for the live above-1 holder-register layout, add IDX announcement discovery plus browser-impersonated PDF fetches, and update the ownership docs to mark Batch 1 complete and scope Batch 2 around above1 hardening and unsupported legacy inputs.
2026-03-30 11:57:14 +07:00
b431a8c251 docs: smoke testing 2026-03-27 16:54:05 +07:00
d23f16e7a3 test: live smoke testing 2026-03-27 16:53:57 +07:00
5d80891d40 chore: type, schema, error define 2026-03-27 16:53:50 +07:00
76656de1f6 feat: cache, schema 2026-03-27 16:53:09 +07:00
06e06975b8 improve: error handling, output table enhancement 2026-03-27 16:45:14 +07:00
0fd6c666a6 test: autoresgressive simple 2026-03-27 16:44:52 +07:00
7ea79d24e6 test: fixture test msn-only 2026-03-27 16:44:45 +07:00
fe5f46f4d2 test: mock body tets 2026-03-26 18:33:31 +07:00
1df47affb3 test: autoregressive 2026-03-26 18:33:17 +07:00
fece94c9fc test: fixture test 2026-03-26 18:33:08 +07:00
7d32e9d69d fix(screen): debug the msn api, remove probelamtic msn api, filtering via client side 2026-03-18 11:09:51 +07:00
69ca349c49 chore: add alias idx for cli testing 2026-03-18 11:08:59 +07:00
3a81d86ff8 chore: idx direnv switch 2026-03-18 11:08:51 +07:00
83d362afcd Fix clippy warnings for CI 2026-03-17 22:02:58 +07:00
65b95aa7b8 Fix config regressions and ownership import errors 2026-03-17 21:23:33 +07:00
Rasyidan A F
db4ff4f9fe
Merge pull request #12 from 0xrsydn/fix/resilient-cache
fix(cache): treat corrupted cache entries as cache misses
2026-03-17 09:03:15 +07:00
3533670d92 fix: narrow cache miss recovery behavior 2026-03-17 09:02:06 +07:00
Rasyidan A F
8b8d261802
Merge pull request #13 from 0xrsydn/fix/config-validation
fix(config): validate known config keys at write time
2026-03-17 09:00:09 +07:00
018b8aeb55 fix: stabilize cache behavior and local xdg paths 2026-03-17 08:53:13 +07:00
d8ab300748 style: format config tests and fix clippy import 2026-03-17 08:52:00 +07:00
e20b41642f style: format cache tests and fix clippy import 2026-03-17 08:52:00 +07:00
Ciphercat
0bcb7adffb fix(config): validate known config keys at write time
Reject invalid values for known config keys in 'idx config set':
- general.provider: only yahoo|msn
- general.history_provider: only auto|yahoo|msn
- general.output: only table|json
- general.color: only true|false
- cache TTL fields: non-negative integers only
- Unknown keys: rejected with clear error listing valid keys
2026-03-12 17:23:45 +00:00
Ciphercat
299d315a16 fix(cache): treat corrupted cache entries as cache misses
Issue #9: Previously, corrupted JSON in cache files would cause commands
to fail with a ParseError. Now:

- IO errors and parse errors are caught in read_entry()
- A warning is printed to stderr with the data_type/symbol
- The corrupted file is deleted
- Ok(None) is returned (treated as cache miss)

This applies to both get() and get_stale() since they share read_entry().

Added tests:
- corrupted_cache_entry_returns_none_and_deletes_file
- corrupted_cache_entry_get_stale_returns_none_and_deletes_file

Both verify the corrupted file is cleaned up after the graceful failure.
2026-03-12 17:15:40 +00:00
Rasyidan A F
df80a8201a
Merge pull request #11 from 0xrsydn/fix/dead-flags-financials-earnings
fix(cli): remove ignored financials and earnings flags
2026-03-13 00:10:16 +07:00
Ciphercat
97502608c8 fix(cli): remove ignored financials and earnings flags 2026-03-12 17:07:24 +00:00
Ciphercat
cd4d8d8323 fix(api): reject empty ticker in resolve_symbol()
- Change resolve_symbol return type from String to Result<String, IdxError>
- Add early validation for empty/whitespace-only ticker input
- Return Err(IdxError::InvalidInput) for empty tickers
- Add InvalidInput variant to IdxError enum
- Update all 15 callers in cli/stocks.rs to handle Result with ? propagation
- Update tests: empty/whitespace tickers now return error

Fixes #7
2026-03-12 16:53:28 +00:00
Ciphercat
bd4f3d49cc 2026-03-12 16:48:29 +00:00
Ciphercat
3d3b4d1dc4 chore: bump version to v0.2.0 v0.2.0 2026-03-07 22:19:27 +00:00
Rasyidan A F
6b760525ed
Merge pull request #5 from 0xrsydn/feat/ownership 2026-03-08 05:01:10 +07:00
Ciphercat
6671e22976 feat(ownership): complete ownership intelligence module
Sprints 0-8: Types, schema, KSEI parser, entity resolution, DB CRUD,
Bing API client, import pipeline, query commands, graph traversal,
changes diff, entity resolution CLI, FTS5 search.

- KSEI PDF parser (mutool stext + quick-xml, 99.2% accuracy)
- 7 query commands: ticker, entity, search, cross-holders, concentration, flow, releases
- Ownership graph with recursive CTE (ASCII tree + Graphviz DOT)
- Release diff/changes between KSEI snapshots
- Entity resolution CLI: unresolved, map, merge
- FTS5 trigram search on entity names
- Feature-gated under 'ownership' (default-on)
- 82 tests passing
2026-03-07 21:10:58 +00:00
Rasyidan A F
d49a8ed60e
Merge pull request #4 from 0xrsydn/feat/hybrid-provider
feat: hybrid provider with Yahoo history fallback
2026-03-07 19:22:10 +07:00
Ciphercat
ed85428c90 feat: hybrid provider with Yahoo history fallback 2026-03-07 08:22:39 +00:00
Rasyidan A F
17e90d4601
Merge pull request #3 from 0xrsydn/feat/msn-full
feat(msn): full MSN Finance endpoint coverage
2026-03-07 04:30:24 +07:00
Ciphercat
6d6d51a04f refactor(msn): remove HistoryProvider — Finance/Charts 404s on all IDX stocks
MSN Finance/Charts does not serve OHLCV data for XIDX stocks (returns 404).
Following the FP principle of not exposing capabilities a provider cannot fulfil:

- Remove impl HistoryProvider for MsnProvider entirely
- Remove fetch_charts from MsnClient
- Remove parse_chart_history, resample_history, trim_history_to_period from map.rs
- Remove MsnChart, ChartSeries, RawChart from raw_types.rs
- Remove parse_history_from_str, parse_close_only_history from parse.rs
- Decouple HistoryProvider from MarketDataProvider trait bound
- Add history_provider() factory: returns None for MSN, Some(Yahoo) for Yahoo
- CLI gates History/Technical on history_provider(), fails fast for MSN
- MSN mock returns Err(Unsupported); tests verify the behaviour explicitly
2026-03-06 20:55:35 +00:00
Ciphercat
2207c928b2 fix(msn): correct API response parsing for profile, financials, insights, screener, history
- financials: fix incomeStatement serde rename (was incomeStatements, API sends singular)
- financials: flatten nested sub-objects (income/revenue/expense/cash) in parse_statement_section
- insights: rewrite RawInsight to match actual API shape ({insights:[{insightName,insightStatement,category}]})
- insights: group insight items into highlights (non-risk) and risks by category
- screener: build Quote directly in parse_screener_results, skip stocks with no price
- profile: use short_name fallback when long_name is null, hide empty fields
- history: map Finance/Charts 404 to Unsupported with clear IDX-specific message
- tests: update MSN history/technical tests to use mock provider
2026-03-06 20:08:03 +00:00
Ciphercat
a0da0a3adb feat(msn): implement full MSN Finance endpoint coverage
- Finance/Equities: company profile + executives (idx stock profile)
- Finance/Equities/financialstatements: balance sheet, cash flow, income (idx stock financials)
- Finance/Events/Earnings: EPS history + forecast (idx stock earnings)
- Finance/Charts: OHLCV chart history, unblocks MSN history command
- Finance/SentimentBrowser: crowd sentiment (idx stock sentiment)
- api.msn.com/insights: AI insights (idx stock insights)
- MSN/Feed/me: stock news feed (idx stock news)
- Finance/Screener: IDX universe screener with 8 presets (idx screen)
- Wire ProfileProvider, EarningsProvider, FinancialsProvider, SentimentProvider,
  InsightsProvider, NewsProvider traits on MsnProvider
- Remove HISTORY_UNSUPPORTED_REASON — MSN history now works via charts API
2026-03-06 19:32:56 +00:00
Ciphercat
3998e38ffc refactor: schema-driven architecture, capability traits, hardened error paths
- Split parse.rs into raw_types.rs (serde structs) + map.rs (pure transforms) for MSN and Yahoo
- Replace Yahoo fundamentals dynamic HashMap with typed structs (SummaryDetail, DefaultKeyStatistics, etc.)
- Introduce capability-based provider traits: QuoteProvider, FundamentalsProvider, HistoryProvider
- Add future MSN capability traits: ProfileProvider, EarningsProvider, FinancialsProvider,
  SentimentProvider, InsightsProvider, NewsProvider (all dead_code until wired to CLI)
- Add shared domain types in src/api/types.rs (CompanyProfile, EarningsReport, FinancialStatements,
  SentimentData, InsightData, NewsItem)
- Harden error propagation: Yahoo cookie auth, MSN partial fundamentals, history symbol context,
  cache clear failures
- Strict config parsing: invalid IDX_OUTPUT returns ConfigError instead of silent fallback
- Cache schema version enforcement: version mismatch treated as cache miss
- Extract fetch_with_cache() helper in cli/stocks.rs
- Add MSN retry/backoff parity with Yahoo client
- Standardize Option<T> policy through parse/map layers
- All 56 tests passing, clippy clean
2026-03-06 19:17:50 +00:00
Ciphercat
a45ee3620f docs: add FEATURE_SPEC.md for MSN full coverage (feat/msn-full) 2026-03-06 18:50:04 +00:00
0xrsydn
4f338a92d6 refactor: yahoo code restructure 2026-03-06 16:54:16 +00:00
Rasyidan A F
343dac92ee
Merge pull request #1 from 0xrsydn/feature/msn-provider-mvp
feat(api): add MSN Finance as alternative data provider
2026-03-06 18:41:29 +07:00