From d55aa68bcb7d48e84616f7566955a3646d9f2848 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Thu, 15 Oct 2026 12:56:09 +0800 Subject: [PATCH 1/2] test: use placeholder account IDs and portable paths Co-Authored-By: Codex --- python/scripts/daily_digest_notify.py | 12 ++--- .../tests/test_daily_digest_delivery_axes.py | 2 +- schemas/qsl-digest-candidates.v1.schema.json | 4 +- tests/account_facts_validation.mjs | 20 ++++---- tests/console_presentation_validation.mjs | 48 +++++++++---------- tests/console_runtime_state_validation.mjs | 8 ++-- ...untime_lifecycle_inspection_validation.mjs | 2 +- tests/longbridge_financing_validation.mjs | 4 +- 8 files changed, 50 insertions(+), 50 deletions(-) diff --git a/python/scripts/daily_digest_notify.py b/python/scripts/daily_digest_notify.py index 30a79a8b..4e08036f 100644 --- a/python/scripts/daily_digest_notify.py +++ b/python/scripts/daily_digest_notify.py @@ -824,9 +824,9 @@ def _block_title(entry: DigestRunEntry, locale: DigestLocale) -> str: _SCOPE_TAG_ALLOWED = frozenset({"live", "paper", "shadow", "research"}) _HEX_HINT_RE = re.compile(r"^[0-9a-fA-F]{12,}$") -# Broker account ids like IBKR ``U15998061`` / ``u15998061``. +# Broker account ids like IBKR ``U00000008`` / ``u00000008``. _BROKER_ACCOUNT_ID_RE = re.compile(r"^[Uu]\d{5,}$") -# Scope forms that embed the broker id: ``live-u15998061``, ``paper_U16608560``. +# Scope forms that embed the broker id: ``live-u00000008``, ``paper_U00000009``. _SCOPE_EMBEDDED_ACCOUNT_RE = re.compile( r"^(?:live|paper|shadow|research)[_-]([Uu]\d{5,})$", re.IGNORECASE, @@ -870,7 +870,7 @@ def _human_account_hint(raw: str) -> str: """Return account_hint when it is already a good human label. Reject empty values and opaque hex hashes (those are not display tags). - IBKR-style ids such as ``U16608560`` are kept (normalized to ``U######``). + IBKR-style ids such as ``U00000009`` are kept (normalized to ``U######``). """ hint = str(raw or "").strip() @@ -888,8 +888,8 @@ def _account_label(entry: DigestRunEntry) -> str: """Resolve the account half of ``[{platform_id} {account_label}]``. Preference (universal): - 1. human ``account_hint`` / broker id (e.g. IBKR ``U15998061``) - 2. broker id embedded in ``account_scope`` (``live-u15998061``) + 1. human ``account_hint`` / broker id (e.g. IBKR ``U00000008``) + 2. broker id embedded in ``account_scope`` (``live-u00000008``) 3. broker id on ``opaque_account_uid`` when it is already ``U######`` 4. normalized scope ``live|paper|shadow|research`` 5. short ``opaque_account_uid`` / ``target_id`` last resorts @@ -920,7 +920,7 @@ def _account_label(entry: DigestRunEntry) -> str: def account_block_tag(entry: DigestRunEntry) -> str: """Account tag body for ``[tag]`` block titles. - Universal form: ``{platform_id} {account_label}`` — e.g. ``ibkr U15998061``, + Universal form: ``{platform_id} {account_label}`` — e.g. ``ibkr U00000008``, ``schwab live``, ``firstrade paper``. Never hard-code a single venue. Returns empty string when nothing usable is present. """ diff --git a/python/tests/test_daily_digest_delivery_axes.py b/python/tests/test_daily_digest_delivery_axes.py index 20f28d08..033e856e 100644 --- a/python/tests/test_daily_digest_delivery_axes.py +++ b/python/tests/test_daily_digest_delivery_axes.py @@ -307,7 +307,7 @@ def test_explicit_producer_execution_status_passthrough(self): "business_day": "2026-10-09", "strategy_profile": "tqqq_growth_income", "actually_ran": True, - "account_hint": "U16608560", + "account_hint": "U00000009", "fill_count": 0, "execution_status": "ok_no_order", "evidence_persistence_status": "persisted", diff --git a/schemas/qsl-digest-candidates.v1.schema.json b/schemas/qsl-digest-candidates.v1.schema.json index 8cb32e2a..5f465cbc 100644 --- a/schemas/qsl-digest-candidates.v1.schema.json +++ b/schemas/qsl-digest-candidates.v1.schema.json @@ -162,12 +162,12 @@ "account_hint": { "type": "string", "maxLength": 64, - "description": "Human display account label when already safe (e.g. IBKR U15998061)." + "description": "Human display account label when already safe (e.g. IBKR U00000008)." }, "account_scope": { "type": "string", "maxLength": 64, - "description": "Runtime account_scope / mode token (e.g. live, paper, live-u15998061)." + "description": "Runtime account_scope / mode token (e.g. live, paper, live-u00000008)." }, "execution_mode": { "type": "string", diff --git a/tests/account_facts_validation.mjs b/tests/account_facts_validation.mjs index 4a7db862..f9ff14f7 100644 --- a/tests/account_facts_validation.mjs +++ b/tests/account_facts_validation.mjs @@ -76,8 +76,8 @@ assert.equal(accountFactsScopesMatch("hk", "HK"), false); assert.equal(accountFactsScopesMatch("HK", "PAPER"), false); assert.equal(accountFactsScopesMatch("sg", "HK"), false); assert.deepEqual([...ACCOUNT_FACTS_PLATFORMS], ["longbridge", "ibkr"]); -assert.equal(accountFactsScopesMatchForPlatform("ibkr", "live-u16608560", "live-u16608560"), true); -assert.equal(accountFactsScopesMatchForPlatform("ibkr", "live-u16608560", "U16608560"), false); +assert.equal(accountFactsScopesMatchForPlatform("ibkr", "live-u00000009", "live-u00000009"), true); +assert.equal(accountFactsScopesMatchForPlatform("ibkr", "live-u00000009", "U00000009"), false); const account = { key: "lb-paper", @@ -981,10 +981,10 @@ const ibkrAccount = { key: "tqqq", label: "tqqq", target_name: "tqqq", - service_name: "interactive-brokers-quant-live-u16608560-service", - deployment_selector: "live-u16608560", - account_scope: "live-u16608560", - account_selector: "U16608560", + service_name: "interactive-brokers-quant-live-u00000009-service", + deployment_selector: "live-u00000009", + account_scope: "live-u00000009", + account_selector: "U00000009", supported_domains: ["us_equity"], }; const ibkrBinding = { @@ -995,7 +995,7 @@ const ibkrBinding = { service_name: ibkrAccount.service_name, deployment_selector: ibkrAccount.deployment_selector, account_selector: ibkrAccount.account_selector, - target_id: "ibkr-u16608560", + target_id: "ibkr-u00000009", source_binding: { kind: IBKR_ACCOUNT_FACTS_SOURCE_KIND, id: "e".repeat(64) }, }; function ibkrHistory(patch = {}) { @@ -1184,7 +1184,7 @@ assert.throws(() => normalizeAccountFactsHistoryPayload({ ...ibkrHistory(), snapshot_schema_version: ACCOUNT_FACTS_SNAPSHOT_SCHEMA, }), /invalid_account_facts_history/); -assert.throws(() => normalizeAccountFactsHistoryPayload(ibkrHistory({ account_ids: ["DU123", "U16608560"] })), /account_facts_identity_mismatch/); +assert.throws(() => normalizeAccountFactsHistoryPayload(ibkrHistory({ account_ids: ["DU123", "U00000009"] })), /account_facts_identity_mismatch/); assert.throws(() => normalizeAccountFactsHistoryPayload(ibkrHistory({ account_ids: ["DU123"] }), { expectedPlatform: IBKR_ACCOUNT_FACTS_PLATFORM, expectedAccountSelector: ibkrBinding.account_selector, @@ -1213,7 +1213,7 @@ const normalizedIbkrHistory = normalizeAccountFactsHistoryPayload(acceptedIbkrHi expectedAccountSelector: ibkrBinding.account_selector, }); assert.equal(normalizedIbkrHistory.broker_reported_balances[0].net_assets, null); -assert.deepEqual(normalizedIbkrHistory.account_ids, ["U16608560"]); +assert.deepEqual(normalizedIbkrHistory.account_ids, ["U00000009"]); // Optional broker-reported positions (read-only holdings panel). assert.equal(Object.hasOwn(normalizedIbkrHistory, "broker_reported_positions"), false, "history without positions stays readable"); @@ -1353,7 +1353,7 @@ const mixedIbkrSchema = ibkrHistory({ snapshot_schema_version: ACCOUNT_FACTS_SNA assert.equal((await post(mixedIbkrSchema, ibkrAuth, env)).status, 400); const wrongIbkrIdentity = await post(ibkrHistory({ account_ids: ["DU123"] }), ibkrAuth, env); assert.equal(wrongIbkrIdentity.status, 409); -const wrongIbkrScope = await post(ibkrHistory({ account_scope: "U16608560" }), ibkrAuth, env); +const wrongIbkrScope = await post(ibkrHistory({ account_scope: "U00000009" }), ibkrAuth, env); assert.equal(wrongIbkrScope.status, 409, "native ID is not an account-scope substitute"); const ibkrFortyMinuteStarted = new Date(Date.now() - 41 * 60 * 1000).toISOString(); const ibkrFortyMinuteFinished = new Date(Date.now() - 40 * 60 * 1000).toISOString(); diff --git a/tests/console_presentation_validation.mjs b/tests/console_presentation_validation.mjs index 806766d6..ced8de49 100644 --- a/tests/console_presentation_validation.mjs +++ b/tests/console_presentation_validation.mjs @@ -147,14 +147,14 @@ assert.equal(accountDisplayTitle(binanceRoute, "Binance", "", occupied), "账户 assert.equal(binanceRoute.key, "crypto_combo"); assert.equal(binanceRoute.target_name, "crypto_combo"); assert.equal(accountDisplayTitle({ key: "crypto_combo" }, "Firstrade", "", occupied), "账户 · crypto_combo"); -assert.equal(accountDisplayTitle({ label: "soxl", account_selector: "U12345678" }, "IBKR", "", occupied), "U12345678"); +assert.equal(accountDisplayTitle({ label: "soxl", account_selector: "U00000007" }, "IBKR", "", occupied), "U00000007"); assert.equal(accountDisplayTitle({ label: "soxl", key: "hk", account_selector: "" }, "IBKR", "", occupied), "账户 · hk"); -assert.equal(accountDisplayTitle({ label: "soxl", key: "hk", account_selector: "U12345678, U87654321" }, "IBKR", "", occupied), "账户 · hk"); -assert.equal(accountDisplayTitle({ account_selector: "U12345678, U87654321" }, "IBKR", "").includes("5678"), false); -assert.equal(accountIdentity({ account_selector: "U12345678, U87654321" }, "IBKR", "").kind, "generic"); +assert.equal(accountDisplayTitle({ label: "soxl", key: "hk", account_selector: "U00000007, U00000010" }, "IBKR", "", occupied), "账户 · hk"); +assert.equal(accountDisplayTitle({ account_selector: "U00000007, U00000010" }, "IBKR", "").includes("5678"), false); +assert.equal(accountIdentity({ account_selector: "U00000007, U00000010" }, "IBKR", "").kind, "generic"); const english = (key, values) => translate(key, "en", values || {}); assert.equal(formatAccountIdentity(accountIdentity({ label: "SOXL", key: "live" }, "Binance", "", occupied), english), "Account · live"); -assert.equal(formatAccountIdentity(accountIdentity({ account_selector: "U12345678", label: "soxl" }, "IBKR", "", occupied), english), "U12345678"); +assert.equal(formatAccountIdentity(accountIdentity({ account_selector: "U00000007", label: "soxl" }, "IBKR", "", occupied), english), "U00000007"); assert.equal(formatAccountIdentity(accountIdentity({ label: "我的港股" }, "Longbridge", "", occupied), english), "我的港股"); assert.equal(formatAccountIdentity(accountIdentity({ key: "internal-key" }, "Longbridge", "", occupied), english), "Account"); const catalogWithoutShortNames = strategyOccupiedNames([ @@ -165,20 +165,20 @@ const catalogWithoutShortNames = strategyOccupiedNames([ ]); assert.equal(catalogWithoutShortNames.some(name => ["soxl", "tqqq", "global etf", "russell top 50"].includes(name.toLowerCase())), false); for (const label of ["soxl", "tqqq", "Global ETF", "Russell Top 50"]) { - assert.equal(accountDisplayTitle({ label, account_selector: "U12345678" }, "IBKR", "", catalogWithoutShortNames), "U12345678"); - assert.equal(accountDisplayTitle({ label, account_selector: "U12345678" }, "IBKR", "", catalogWithoutShortNames).includes("U12345678"), true); + assert.equal(accountDisplayTitle({ label, account_selector: "U00000007" }, "IBKR", "", catalogWithoutShortNames), "U00000007"); + assert.equal(accountDisplayTitle({ label, account_selector: "U00000007" }, "IBKR", "", catalogWithoutShortNames).includes("U00000007"), true); } -assert.equal(accountDisplayTitle({ label: "退休账户", account_selector: "U12345678" }, "IBKR", "", catalogWithoutShortNames), "退休账户"); -assert.equal(accountDisplayTitle({ label: "Global ETF Rotation", account_selector: "U12345678" }, "IBKR", "", []), "Global ETF Rotation"); +assert.equal(accountDisplayTitle({ label: "退休账户", account_selector: "U00000007" }, "IBKR", "", catalogWithoutShortNames), "退休账户"); +assert.equal(accountDisplayTitle({ label: "Global ETF Rotation", account_selector: "U00000007" }, "IBKR", "", []), "Global ETF Rotation"); assert.equal(accountDisplayTitle({ label: "soxl" }, "IBKR", "", catalogWithoutShortNames), "soxl"); -assert.equal(accountDisplayTitle({ label: "退休账户", account_selector: "U12345678" }, "IBKR", ""), "退休账户"); -assert.equal(formatAccountIdentity(accountIdentity({ label: "退休账户", account_selector: "U12345678" }, "IBKR", ""), english), "退休账户"); -assert.equal(accountDisplayTitle({ label: "soxl", account_selector: "U12345678" }, "Binance", "", occupied), "账户"); -assert.equal(accountDisplayTitle({ label: "U12345678", account_selector: "U12345678" }, "IBKR", ""), "U12345678"); -assert.equal(accountDisplayTitle({ label: "U12345678" }, "IBKR", "").includes("U12345678"), false); -assert.equal(accountDisplayTitle({ label: "U12345678", account_selector: "U12345678" }, "Longbridge", ""), "账户"); -assert.equal(accountDisplayTitle({ label: "U12345678", account_selector: "U12345678" }, "Longbridge", "").includes("12345678"), false); -assert.equal(accountDisplayTitle({ label: "U12345678", account_selector: "U12345678, U87654321" }, "IBKR", "").includes("5678"), false); +assert.equal(accountDisplayTitle({ label: "退休账户", account_selector: "U00000007" }, "IBKR", ""), "退休账户"); +assert.equal(formatAccountIdentity(accountIdentity({ label: "退休账户", account_selector: "U00000007" }, "IBKR", ""), english), "退休账户"); +assert.equal(accountDisplayTitle({ label: "soxl", account_selector: "U00000007" }, "Binance", "", occupied), "账户"); +assert.equal(accountDisplayTitle({ label: "U00000007", account_selector: "U00000007" }, "IBKR", ""), "U00000007"); +assert.equal(accountDisplayTitle({ label: "U00000007" }, "IBKR", "").includes("U00000007"), false); +assert.equal(accountDisplayTitle({ label: "U00000007", account_selector: "U00000007" }, "Longbridge", ""), "账户"); +assert.equal(accountDisplayTitle({ label: "U00000007", account_selector: "U00000007" }, "Longbridge", "").includes("00000007"), false); +assert.equal(accountDisplayTitle({ label: "U00000007", account_selector: "U00000007, U00000010" }, "IBKR", "").includes("5678"), false); assert.deepEqual(CHART_RANGE_OPTIONS.map(item => item.id), ["3m", "6m", "1y", "3y", "5y", "10y", "all"]); assert.deepEqual(CHART_RANGE_OPTIONS.map(item => item.label), ["3个月", "半年", "1年", "3年", "5年", "10年", "至今"]); assert.equal(DEFAULT_CHART_RANGE, "1y"); @@ -359,8 +359,8 @@ assert.equal(paperApplicationActionable(rejectedReady), true); assert.equal(paperApplicationUnresolved(rejectedReady), false); const adminProfiles = [{ profile: "soxl_trend", label: "SOXL趋势", label_zh: "SOXL趋势", label_en: "SOXL Trend" }]; const adminOccupied = strategyOccupiedNames(adminProfiles, "soxl_trend"); -const maskedAdmin = formatAccountIdentity(accountIdentity({ label: "SOXL趋势", key: "internal-key", account_selector: "U12345678" }, "IBKR", "", adminOccupied), english); -assert.equal(maskedAdmin, "U12345678"); +const maskedAdmin = formatAccountIdentity(accountIdentity({ label: "SOXL趋势", key: "internal-key", account_selector: "U00000007" }, "IBKR", "", adminOccupied), english); +assert.equal(maskedAdmin, "U00000007"); assert.equal(maskedAdmin.includes("internal-key"), false); assert.deepEqual(environmentEditState("paper", "paper", "live"), { value: "live", conflict: false }); assert.deepEqual(environmentEditState("paper", "live", "paper"), { value: "live", conflict: false }); @@ -406,12 +406,12 @@ assert.equal(app.includes("EnvironmentControl"), false); assert.equal(app.includes("request_retirement"), false); assert.equal(app.includes("模拟账户应用记录"), false); const directoryOccupied = strategyOccupiedNames([{ profile: "soxl", label: "SOXL" }], "soxl"); -const ibkrNumber = { account_selector: "U12345678", label: "soxl" }; -assert.equal(adminDirectoryTitle(ibkrNumber, "IBKR", directoryOccupied), "IBKR · U12345678"); +const ibkrNumber = { account_selector: "U00000007", label: "soxl" }; +assert.equal(adminDirectoryTitle(ibkrNumber, "IBKR", directoryOccupied), "IBKR · U00000007"); assert.equal(adminDirectoryTitle(ibkrNumber, "IBKR", directoryOccupied).includes("账户 ·"), false); -const severalNumbers = { account_selector: "U12345678, U10000001", label: "主账户" }; +const severalNumbers = { account_selector: "U00000007, U00000005", label: "主账户" }; assert.equal(adminDirectoryTitle(severalNumbers, "IBKR", []), "IBKR · 主账户"); -assert.equal(adminDirectoryTitle(severalNumbers, "IBKR", []).includes("U12345678"), false); +assert.equal(adminDirectoryTitle(severalNumbers, "IBKR", []).includes("U00000007"), false); const binance = { key: "crypto_combo", target_name: "crypto_combo" }; assert.equal(adminDirectoryTitle(binance, "Binance", []), "Binance · live"); assert.equal(adminDirectoryTitle(binance, "Binance", []).includes("账户 ·"), false); @@ -471,7 +471,7 @@ assert.equal(latestSave[0].target, "账户"); assert.equal(JSON.stringify(latestSave[0]).includes("sync_"), false); assert.equal(JSON.stringify(latestSave[0]).includes("已应用"), false); const changeOccupied = strategyOccupiedNames([{ profile: "SOXL_TQQQ", label: "SOXL" }], "SOXL_TQQQ"); -assert.equal(changeAccountName({ account_selector: "U12345678", label: "SOXL", key: "ib-key" }, "IBKR", changeOccupied), "U12345678"); +assert.equal(changeAccountName({ account_selector: "U00000007", label: "SOXL", key: "ib-key" }, "IBKR", changeOccupied), "U00000007"); assert.equal(changeAccountName({ key: "crypto_combo", target_name: "crypto_combo" }, "Binance", []), "live"); assert.equal(changeAccountName({ key: "internal-key" }, "LongBridge", changeOccupied), ""); assert.equal(changeAccountName(null, "LongBridge", []), ""); diff --git a/tests/console_runtime_state_validation.mjs b/tests/console_runtime_state_validation.mjs index 0d58b893..54f0f747 100644 --- a/tests/console_runtime_state_validation.mjs +++ b/tests/console_runtime_state_validation.mjs @@ -108,17 +108,17 @@ test("frontend account normalization and display preserve broker identity and al label: "主账户", target_name: "example", supported_domains: ["us_equity"], - account_selector: "U10000001, U10000002", + account_selector: "U00000005, U00000006", broker_environment: "live", }], }); - assert.equal(normalized.ibkr[0].account_selector, "U10000001, U10000002"); + assert.equal(normalized.ibkr[0].account_selector, "U00000005, U00000006"); assert.equal(normalized.ibkr[0].broker_environment, "live"); assert.equal(accountDisplayTitle(normalized.ibkr[0], "IBKR", "实盘"), "主账户"); assert.equal(accountDisplayTitle({ key: "internal-key" }, "IBKR", "实盘"), "账户"); assert.equal(accountDisplayTitle(normalized.ibkr[0], "IBKR", "实盘").includes("0001"), false); - assert.equal(accountDisplayTitle({ label: "soxl", account_selector: "U10000001" }, "IBKR", "实盘"), "U10000001"); - assert.equal(accountDisplayTitle({ key: "hk", account_selector: "U10000001, U10000002" }, "IBKR", "实盘"), "账户 · hk"); + assert.equal(accountDisplayTitle({ label: "soxl", account_selector: "U00000005" }, "IBKR", "实盘"), "U00000005"); + assert.equal(accountDisplayTitle({ key: "hk", account_selector: "U00000005, U00000006" }, "IBKR", "实盘"), "账户 · hk"); const binance = { key: "crypto_combo", target_name: "crypto_combo" }; assert.equal(accountDisplayTitle(binance, "Binance", ""), "账户 · live"); assert.equal(binance.key, "crypto_combo"); diff --git a/tests/ibkr_runtime_lifecycle_inspection_validation.mjs b/tests/ibkr_runtime_lifecycle_inspection_validation.mjs index 64ea3da8..5adc7b67 100644 --- a/tests/ibkr_runtime_lifecycle_inspection_validation.mjs +++ b/tests/ibkr_runtime_lifecycle_inspection_validation.mjs @@ -21,7 +21,7 @@ const sourceKey = "runtime_target_lifecycle_source:synthetic-source"; const factsBinding = { platform: "ibkr", account_key: accountId, account_scope: "live-primary", target_name: "synthetic-account", service_name: "synthetic-service", - deployment_selector: "synthetic-deployment", account_selector: "U12345678", + deployment_selector: "synthetic-deployment", account_selector: "U00000007", target_id: "primary-live", source_binding: { kind: "deployment_runtime_account", id: "a".repeat(64) }, }; const bindingPayload = (bindings = [factsBinding]) => ({ schema_version: "qsl_account_facts_bindings.v1", bindings }); diff --git a/tests/longbridge_financing_validation.mjs b/tests/longbridge_financing_validation.mjs index 643558f2..62d9c0cd 100644 --- a/tests/longbridge_financing_validation.mjs +++ b/tests/longbridge_financing_validation.mjs @@ -73,7 +73,7 @@ function ibkrHistory(patch = {}) { return { schema_version: IBKR_ACCOUNT_FACTS_HISTORY_SCHEMA, snapshot_schema_version: IBKR_ACCOUNT_FACTS_SNAPSHOT_SCHEMA, - account_scope: "U16608560", + account_scope: "U00000009", target_id: "ibkr-paper", source_binding: { kind: IBKR_ACCOUNT_FACTS_SOURCE_KIND, @@ -81,7 +81,7 @@ function ibkrHistory(patch = {}) { id: bindingId, }, snapshot_atomic: false, - account_ids: ["U16608560"], + account_ids: ["U00000009"], broker_reported_balances: [{ currency: "USD", net_assets: "10" }], cash: [{ currency: "USD", cash_balance: "1", source_tag: "CashBalance" }], ...patch, From b852fc40ef8658316db683764b7a7a0da59d76ab Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Thu, 15 Oct 2026 13:20:13 +0800 Subject: [PATCH 2/2] test: replace full account hashes with synthetic hexadecimal fixtures Co-Authored-By: Codex --- python/tests/test_daily_digest_notify.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/python/tests/test_daily_digest_notify.py b/python/tests/test_daily_digest_notify.py index e2e1e577..30982916 100644 --- a/python/tests/test_daily_digest_notify.py +++ b/python/tests/test_daily_digest_notify.py @@ -383,7 +383,7 @@ def test_omits_missing_observation_fields(self): rebalance_kind="no_rebalance", target_id="schwab-primary", opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), ), ) @@ -392,7 +392,7 @@ def test_omits_missing_observation_fields(self): business_day="2026-10-08", locale="zh", runs=runs ) ) - self.assertIn("[schwab bf2e6691] 💓 【心跳检测】", text) # no scope → platform + short uid + self.assertIn("[schwab 000000a1] 💓 【心跳检测】", text) # no scope → platform + short uid self.assertNotIn("[schwab-primary]", text) self.assertIn("半导体趋势收益", text) self.assertIn("✅ 无需调仓", text) @@ -411,7 +411,7 @@ def test_single_schwab_omits_window_and_channel(self): equity=989.34, rebalance_kind="no_rebalance", opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), target_id="schwab-primary", account_scope="live", @@ -449,7 +449,7 @@ def test_multi_platform_observation_blocks_separated(self): equity=989.34, rebalance_kind="no_rebalance", opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), target_id="schwab-primary", account_scope="live", @@ -553,7 +553,7 @@ def test_account_block_tag_preference_order(self): hex_hint = daily_digest_notify.DigestRunEntry( platform_id="schwab", strategy_profile="soxl_soxx_trend_income", - account_hint="bf2e669106f029a4", + account_hint="000000a100000000", account_scope="live", ) self.assertEqual( @@ -571,7 +571,7 @@ def test_account_block_tag_preference_order(self): strategy_profile="any_strategy", account_scope=scope, opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), target_id=f"{platform}-primary", ) @@ -591,12 +591,12 @@ def test_account_block_tag_preference_order(self): platform_id="schwab", strategy_profile="soxl_soxx_trend_income", opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), target_id="schwab-primary", ) self.assertEqual( - daily_digest_notify.account_block_tag(uid_beats_target), "schwab bf2e6691" + daily_digest_notify.account_block_tag(uid_beats_target), "schwab 000000a1" ) target_last = daily_digest_notify.DigestRunEntry( platform_id="schwab", @@ -668,7 +668,7 @@ def test_trade_success_default_fills_conclusion(self): strategy_label="半导体趋势收益", target_id="schwab-primary", opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), account_scope="live", fill_count=2, @@ -701,7 +701,7 @@ def test_multi_heartbeat_plus_fills_uses_digest_title(self): strategy_label="半导体趋势收益", target_id="schwab-primary", opaque_account_uid=( - "bf2e669106f029a41e6f36dc18f704906ad6078d1f16a171ec0001e992d39b7d" + "000000a100000000000000000000000000000000000000000000000000000000" ), account_scope="live", fill_count=None, @@ -793,7 +793,7 @@ def test_multi_platform_scope_tags_universal(self): self.assertIn("[schwab live] 💓 【心跳检测】", text) self.assertIn("[ibkr live] 💓 【心跳检测】", text) self.assertIn("[firstrade paper] 💓 【心跳检测】", text) - self.assertNotIn("[bf2e6691]", text) + self.assertNotIn("[000000a1]", text) self.assertNotIn("[schwab-primary]", text) self.assertNotIn("[live]", text) # bare scope alone is not the tag