Skip to content

fix: Unify Firstrade operational error notifications - #518

Draft
Pigbibi wants to merge 1 commit into
mainfrom
fix/unify-firstrade-notifications
Draft

Pigbibi wants to merge 1 commit into
mainfrom
fix/unify-firstrade-notifications

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

AI assistance

OpenAI Codex; model identifier is not exposed by this execution interface.

What changed

Use one fixed P10 error body for Firstrade cycle errors, HTTP failures, receipt checks (flag on/off), candidate coverage failures and runtime guard errors. Stop rendering errors as healthy heartbeats or no-rebalance results. Retain unknown submission/pending state, preserve the structured fractional-disclosure action, and exclude raw aliases, provider diagnostics and untrusted links.

Normal cycles still persist through the existing digest-candidate path. Existing incident reservations, restart/uncertain-delivery handling, broker calls and execution protections are preserved. Notification-only fake snapshots cover both languages; the historical broker/state golden remains exact. The golden test now replaces the missing GCS store explicitly, avoiding credential discovery.

How verified

  • Fail-before regression: 11 failed / 2 passed; the regressions now pass.
  • Full frozen-environment suite: 1830 passed and 118 subtests passed, one upstream calendar deprecation warning.
  • Focused notification selection: 151 passed; entrypoint/snapshot/redaction selection: 71 passed.
  • Ruff, whitespace check, installed-lock provenance (3 tests), consumer-lock QPK pin consistency, offline lock check and offline sdist/wheel build passed.
  • Documentation style: 0 blocking, 1 existing README advisory.
  • Self-review: redaction and fail-closed presentation apply and have adverse regressions. Concurrency/restart and stale-state algorithms are unchanged, with their existing full-suite regressions retained.

Why

Step 6 of the owner-approved eight-repository notification plan requires real errors to share the fixed format without turning HTTP 503, missing evidence or unknown orders into health claims.

Risk

Notification presentation only. No workflow, dependency, vendor snapshot, execution gate, protected switch or production configuration change. No merge, deploy, labels or real notifications. Runtime/deployed acceptance and authentic delivery remain NOT_PROVEN.

Step-1 pin follow-up: the notification-unification QPK Draft PR was not yet published at implementation/readback time. This consumer implements the approved plan's presentation contract using its existing shared redaction dependency. Replace the local presentation implementation with the published shared formatter and pin its reviewed revision when available; this PR does not claim shared-formatter deployment/adoption. Arbitrary strategy aliases remain unverified rather than echoed.

Central publication check

publication-check/2.0-advisory, build 83d9d1130377: 1169 matches across 115 files; 1164 matching lines; advisory exit 0.
The scanner is advisory under the owner rule. Matches include existing tracked references and <PROJECT_ID> test inputs; this patch does not perform a repository-wide cleanup. First 20 masked locations/texts:

.<PROJECT_ID>/CODEOWNERS:4: /.env.example @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:5: /.github/CODEOWNERS @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:6: /.github/workflows/ @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:7: /application/execution_receipt_adapter.py @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:8: /application/execution_service.py @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:9: /application/paper_execution_admission.py @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:10: /application/paper_execution_command_consumer.py @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:11: /runtime_execution_policy.py @<PROJECT_ID>
.<PROJECT_ID>/CODEOWNERS:12: /scripts/execution_report_heartbeat.py @<PROJECT_ID>
.<PROJECT_ID>/dot-review/review.cjs:106:   const token = <REDACTED> core.getIDToken(audienceText); // Exact bytes; URL normalization may change an audience.
.<PROJECT_ID>/dot-review/review.cjs:190:   const <PROJECT_ID> = {...pr,head:{...pr.head,sha:pair.target},base:{...pr.base,sha:pair.base}};
.<PROJECT_ID>/dot-review/review.cjs:191:   const binding = {...b.binding({repository:trust.repo.full_name,pr:<PROJECT_ID>,policyCommit:trust.commit,files},trust.policySha),
.<PROJECT_ID>/dot-review/test-review.cjs:81:   const content='<PROJECT_ID> source\n', sourceSHA='d'.repeat(40);
.<PROJECT_ID>/dot-review/test-review.cjs:82:   const pr={number:7,changed_files:1,commits:1,title:'<PROJECT_ID> change',body:'<PROJECT_ID> body',
.<PROJECT_ID>/dot-review/test-review.cjs:100:     assert.equal(audience,'https://audience.example.test');return '<PROJECT_ID>-only';},summary};
.<PROJECT_ID>/dot-review/test-review.cjs:111:         task={id:'<PROJECT_ID>-task',owner:'example/repo',provider:'dot',revision:1,status:'running',request,output:null,artifacts:[]};
.<PROJECT_ID>/workflows/diagnose-cached-stage-failure.yml:52:   GCP_PROJECT_ID: <PROJECT_ID>
.<PROJECT_ID>/workflows/diagnose-cached-stage-failure.yml:53:   GCP_WORKLOAD_IDENTITY_PROVIDER: projects/<PROJECT_NUMBER>/locations/global/workloadIdentityPools/<PROJECT_ID>-actions/providers/<PROJECT_ID>-main
.<PROJECT_ID>/workflows/diagnose-cached-stage-failure.yml:54:   GCP_WORKLOAD_IDENTITY_SERVICE_ACCOUNT: firstrade-platform-deploy@<PROJECT_ID>.iam.gserviceaccount.com
.<PROJECT_ID>/workflows/diagnose-cached-stage-failure.yml:69:       id-token: <REDACTED>

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.

2 participants