Skip to content

chore(clis/eastmoney): mirror 13 adapters + _secid helper as Phase A oracle#1091

Merged
jackwener merged 1 commit intomainfrom
prep/eastmoney-oracle-mirror
Apr 20, 2026
Merged

chore(clis/eastmoney): mirror 13 adapters + _secid helper as Phase A oracle#1091
jackwener merged 1 commit intomainfrom
prep/eastmoney-oracle-mirror

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

Mirror the remaining 13 read-oriented eastmoney adapters and the shared _secid.js helper from the author's local workspace into the repo. After this PR, clis/eastmoney/ contains the full Phase A codegen regression oracle described in OpenCLI Improvement Spec v1.1 §B.10.

Oracle counting (unified, per spec §B.10 / codex-mini0 final):

repo oracle = 14 adapters total under clis/eastmoney/, where hot-rank.js already exists and this PR mirrors the remaining 13 adapters plus _secid.js helper.

Why this PR is standalone (oracle-only)

Per spec v1.1 §B.10, the oracle mirror is intentionally decoupled from the framework PR:

  • Framework PR diffs stay clean (only framework / skill code)
  • Oracle PR is pure data → trivial review
  • Merge order is fixed: this PR first → framework PR can run Phase A codegen diff gate

Files

All 14 files are pure fetch-based read adapters (no browser / no write / no auth state), written using the existing @jackwener/opencli/registry + @jackwener/opencli/errors exports. They were generated and live-verified during task #177.

  • _secid.js — KNOWN_MARKET_PREFIXES whitelist + regex dispatch; resolves 600519 / sh600519 / 00700.HK / us.AAPLmarket.code secid. Canonical example of the spec v1.1 §B.7 helper contract (pure normalize, serializable I/O, no env / fs / net / session, does not drive pagination / retry / fallback).
  • quote.js — batch quote (A / HK / US via secids=1.600000,0.000001,...)
  • rank.js — ranking across hs-a / sh-a / sz-a / bj-a / cyb / kcb / HK / US x 6 sorts
  • index-board.js — main / hk / us indices
  • kline.js — K-line history, 8 periods x 3 adjusts. Exercises spec §B.9 CSV row_format: data.klines = ["20250101,open,close,high,low,vol,...", ...] decoded by positional index.
  • sectors.js — industry / concept / region x 5 sorts
  • money-flow.js — main-force net inflow today / 5d / 10d
  • etf.js — ETF list by turnover / change / volume / rate
  • convertible.js — convertible bond listing. Exercises spec §B.9 :row_index special source: rank: i + 1 (1-based derived column).
  • northbound.js — northbound / southbound realtime, wan->yi conversion
  • longhu.js — longhubang (30-day default window)
  • holders.js — top 10 free-float holders
  • announcement.js — listed company announcements SHA / SZA / BJA
  • kuaixun.js — 7x24 newswire (columns 102 / 101 / 104 / 105 / 106 / 107)

Schema-expressiveness coverage

These adapters intentionally cover the two gaps discovered during spec prep (F2) that drove spec v1.1 §B.9:

gap driving adapter schema feature
CSV row with positional decode kline.js row_format: csv + delimiter + from: <int index> + transform: date_yyyymmdd
Computed column from row index convertible.js from: :row_index, offset: 1

Plus _secid.js as the canonical §B.7 helper case.

Test plan

  • All 14 adapters were live-verified during task feat(leetcode): add problems list command #177 before mirroring.
  • hot-rank.js (already in repo) is untouched.
  • Phase A framework PR (separate, follow-up) will run opencli validate eastmoney + per-command live diff against these 14 adapters; any schema gap surfaced there feeds back into spec v1.1.

Refs

  • Task feat(leetcode): add problems list command #177 (OpenCLI Improvement Spec v1.1)
  • Spec §B.7 (helper contract) / §B.9 (row model) / §B.10 (oracle layering)
  • Thread #OpenCLI:6df17bdb (reviewer consensus on option (a) — mirror now)

…oracle

Mirror the remaining 13 read-oriented adapters and the shared _secid.js
helper from the author's local workspace into the repo, so that
clis/eastmoney/ becomes the full Phase A codegen regression oracle
described in OpenCLI Improvement Spec v1.1 §B.10.

Total repo oracle after this PR: 14 adapters under clis/eastmoney/
(hot-rank.js already exists; this PR adds the other 13) plus the
_secid.js normalize helper.

Covers the two schema-expressiveness gaps discovered during prep:
- CSV row_format: kline.js decodes "YYYYMMDD,open,close,..." strings
- :row_index source: convertible.js derives rank = i + 1

_secid.js is the canonical example of the v1.1 §B.7 helper contract
(pure normalize/derive function, serializable I/O, no env/fs/net/session
access, does not drive pagination/retry/fallback).

This PR is oracle-only, carries no framework changes. Phase A framework
PR depends on this merging first so the codegen diff target is stable.

Refs: task #177 / spec v1.1 §B.10
@jackwener jackwener merged commit 0f903f5 into main Apr 20, 2026
11 checks passed
jackwener added a commit that referenced this pull request Apr 20, 2026
- site-memory hit path no longer jumps to writing adapter; forces Step 5
  endpoint re-verification + Step 7 field check, and 30-day expiry
- site-memory.md now specifies exact schemas for endpoints.json /
  field-map.json / notes.md / fixtures + write-back timing rules
- coverage-matrix.md marks unverified patterns as 🟡 with an evidence
  section citing coingecko dry run + PR #1091 eastmoney + bilibili
- eastmoney seed typo: resolveSecids -> resolveSecid (and splitSymbols)
- docs/developer/ai-workflow.md rewritten to teach the adapter-author
  skill + opencli browser * primitives (dropped generate/synthesize/
  cascade/explore references)
- ts-adapter.md, getting-started.md, CHANGELOG.md:87 updated to point
  at opencli-adapter-author
jackwener added a commit that referenced this pull request Apr 20, 2026
)

* refactor: consolidate 6 skills into 3, remove mechanical commands

Replaces opencli-oneshot / opencli-explorer / opencli-browser /
opencli-usage with a single opencli-adapter-author skill that takes
the AI agent end-to-end: site recon, API discovery, field decoding,
adapter coding, and `opencli browser verify`.

Removes the mechanical commands (`explore`, `synthesize`, `generate`,
`cascade`, `record`) and their src/tests — they were codegen scaffolding
meant for agents, which the new skill handles more flexibly via
`opencli browser` primitives.

Skill highlights:
- Top-level decision tree + 12-step runbook
- 5 site patterns (SPA / SSR / JSONP / Token / Streaming)
- 5-layer API discovery (network → initial state → bundle → token → interceptor)
- Field decode playbook (self-explanatory → codes → sort-key comparison)
- Output design guide (columns, types, order, ≤15 per adapter)
- Two-layer site memory: in-repo seeds for eastmoney/xueqiu/bilibili/tonghuashun
  plus local `~/.opencli/sites/<site>/` runtime workspace

Kept skills: opencli-autofix (now points to adapter-author for rewrites),
smart-search. Kept primitives: `browser *`, `doctor`, `list`, `validate`,
`verify`, `<site> <cmd>`, `plugin *`, `completion`.

No backward compatibility shims. Full test suite (1605 tests) passes.

* review fixes: honest coverage, hard memory-hit path, typo, stale docs

- site-memory hit path no longer jumps to writing adapter; forces Step 5
  endpoint re-verification + Step 7 field check, and 30-day expiry
- site-memory.md now specifies exact schemas for endpoints.json /
  field-map.json / notes.md / fixtures + write-back timing rules
- coverage-matrix.md marks unverified patterns as 🟡 with an evidence
  section citing coingecko dry run + PR #1091 eastmoney + bilibili
- eastmoney seed typo: resolveSecids -> resolveSecid (and splitSymbols)
- docs/developer/ai-workflow.md rewritten to teach the adapter-author
  skill + opencli browser * primitives (dropped generate/synthesize/
  cascade/explore references)
- ts-adapter.md, getting-started.md, CHANGELOG.md:87 updated to point
  at opencli-adapter-author

* fix(ci): resync package-lock + drop stale built-in list reference

- Regenerate package-lock.json to restore @emnapi/core + @emnapi/runtime
  entries that got dropped during the rebase — `npm ci` was failing on all
  CI jobs (build / audit / docs-build / bun-test / unit-test)
- docs/guide/getting-started.md: built-in list dropped `explore`, now
  reads (list, validate, verify, browser, doctor, plugin...)

* fix(ci): restore package-lock.json from main (unrelated lockfile churn)
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.

1 participant