Skip to content

fix: unify asset-management notification contract - #774

Draft
Pigbibi wants to merge 1 commit into
mainfrom
fix/notify-unify-1-shared-contract
Draft

Pigbibi wants to merge 1 commit into
mainfrom
fix/notify-unify-1-shared-contract

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

AI assistance

OpenAI Codex; configured worker model: gpt-6.1-sol.

What changed

Add the shared P10 asset-management notification boundary on the existing NotificationEvent/candidate contract. Normal facts, recovery, ordinary maintenance reminders and research signals require confirmed candidate persistence; unknown/error facts use the structured error path in every flag state. Add the fixed Chinese/English error formatter with approved display names and safe run links.

Expose an explicit asset-management adapter in the existing plugin Telegram publisher. It requires durable IncidentTracker CAS for errors, preserves uncertain sends across restart, clears a producer-confirmed recovered incident only after persistence, and propagates storage/state failures. Transport booleans remain pending rather than confirmed delivery. Public transport and non-asset legacy callers retain their behavior.

This notify-unify-1 Draft PR is the first shared implementation of the approved plan. Pin follow-up: QRS and broker PRs must pin this reviewed exact shared revision and explicitly bind real producer/run facts. No downstream pin is changed here. The existing routing-policy document records the additive contract; no competing schema, database, daily service or scheduler is introduced.

How verified

  • New adverse module against unchanged base: 38 expected failures (new APIs absent).
  • Focused safety and legacy compatibility: 270 passed.
  • Full suite: 3964 passed, 3 skipped; 1277 subtests passed.
  • Ruff, documentation check and diff whitespace check passed (one existing documentation advisory, zero blockers).
  • Four independent spawned writers plus restart exercise durable incident reservation; failure tests cover candidate writes, unknown state, recovery, redaction and a newer state appearing during transport.

The isolated test environment uses UTC, the actual base source revision and executable temporary storage. No real broker, cloud or Telegram operation was run; package-only installation tests use PyPI. No full-suite exception is used.

Why

The existing four routine routes are already deferred, but recovery/reminder/research facts have no shared asset-management boundary and immediate error bodies diverge. Consumers need a single additive contract without changing unrelated public transport uses.

Risk

Shared notification API; opt-in channel behavior only. No merge, deploy, label, governance workflow, dependency pin, trading, Kelly, stop-loss, Secret or IAM change. Consumer adoption and runtime P10 compliance remain unproved. The plugin transport has no receipt API and deliberately cannot automatically retry an uncertain attempt. Recovery requires authentic producer classification and the original incident identity. Existing generic callbacks remain responsible for durable incident ownership and receipts.

Publication check

Checker: publication-check/2.0-advisory; build 83d9d1130377; advisory mode; 1174 matches across 1169 matching lines in the complete tracked-tree scan. These are advisory existing-tree/fixture matches, not a credential-clearance claim. The changed production code contains no real credential or private runtime identity.

First 20 matches (masked by the central checker):

  • repo/.github/CODEOWNERS:2: /.github/CODEOWNERS @<PROJECT_ID>
  • repo/.github/CODEOWNERS:3: /src/quant_platform_kit/risk/ @<PROJECT_ID>
  • repo/.github/CODEOWNERS:4: /src/quant_platform_kit/binance/ @<PROJECT_ID>
  • repo/.github/CODEOWNERS:5: /src/quant_platform_kit/ibkr/ @<PROJECT_ID>
  • repo/.github/CODEOWNERS:6: /src/quant_platform_kit/longbridge/ @<PROJECT_ID>
  • repo/.github/CODEOWNERS:7: /src/quant_platform_kit/schwab/ @<PROJECT_ID>
  • repo/.github/CODEOWNERS:8: /src/quant_platform_kit/common/models.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:9: /src/quant_platform_kit/common/port_adapters.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:10: /src/quant_platform_kit/common/execution_translation.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:11: /src/quant_platform_kit/position_sizing.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:16: /scripts/verify_fractional_dca_execution.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:17: /src/quant_platform_kit/binance/execution.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:18: /src/quant_platform_kit/common/account_risk_budget.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:19: /src/quant_platform_kit/common/execution_capabilities.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:20: /src/quant_platform_kit/common/execution_commands.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:21: /src/quant_platform_kit/common/execution_fills.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:22: /src/quant_platform_kit/common/execution_outcomes.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:23: /src/quant_platform_kit/common/execution_receipts.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:24: /src/quant_platform_kit/common/execution_state.py @<PROJECT_ID>
  • repo/.github/CODEOWNERS:25: /src/quant_platform_kit/common/paper_execution_admission.py @<PROJECT_ID>

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