Skip to content

[Draft] test: 本机业务完整性复现(价格、SSE、订阅确认) - #711

Closed
LIghtJUNction wants to merge 1 commit into
wip/rust-core-go-extensionsfrom
audit/business-integrity-main-20261010
Closed

LIghtJUNction wants to merge 1 commit into
wip/rust-core-go-extensionsfrom
audit/business-integrity-main-20261010

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

开发主线交接(2026-10-12)

开发默认主线现为 wip/rust-core-go-extensions;旧单体 main 与 traditional 冻结于 3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。

主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore main。

本 PR 原目标为旧单体 main,现转向微服务主线。只修改审查目标,尚未完成移植或验收,不可直接合并;须解决跨架构差异/冲突并完成本地验证,保留其他任务的改动。

范围

按用户要求进行本机业务完整性检查,只提交测试和验证说明,不修改业务,不触发远程 CI,不发布、不部署、不访问生产或移动真实资金。

  • 源码审查基线:main@565b64e475419e073f55225e64d0718f7bf070b4。
  • 测试提交:c288ed6c7e8a05373d2948106011a36d695f4ac2。
  • 分支:audit/business-integrity-main-20261010;目标是 main,不是尚未合并的微内核 [WIP] 微内核重构:Rust 核心、Go 扩展、协议模板与独立分发 #675。
  • 仅新增三个文件:Go 定价回归、两个前端业务回归及正向对照、验证说明。

实际复现

  1. AUDIT-PRICE-01:接受 standard.long 为空、fast.long 存在的价格目录后,超过上下文阈值仍使用 fast 短上下文价格。合成配置测试实收计算为 6.52802400 USD,按已配置长上下文价格应为 13.05604800 USD。这不是线上官方价或生产损失估计。
  2. AUDIT-SSE-01:助手前端在没有最终空行的终态 SSE 上遇到 EOF,仍返回成功;完整终态事件的对照通过。
  3. AUDIT-SUB-01:现有订阅仅 amount_used 增加,就停止另一笔新订阅的确认轮询;没有新增权益也会清除 pending。

认证相关复现仅保留在用户的私有交接材料,未公开提交利用输入、未代发邮件或安全公告。

本机实际命令及结果

node --experimental-strip-types --test scripts/business-audit/regressions.test.ts
# Node 22.16.0:2 个正向对照通过,SSE/订阅 2 个正确行为断言失败。

cd apps/api-go/pkg/servicetier
GO111MODULE=off GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off \
  go test -race -count=1 -run TestBusinessAuditTierLocalLongContextPrice -v .
# Go 1.23.2:价格正确行为断言失败,保留错误金额证据。

已先运行有效的现有独立 Go 组件与前端函数测试,再添加这三个业务回归。断言失败是尚未修复的缺陷,不是通过;没有删除旧测试、反转预期、跳过失败项或添加生产兜底。Go 新测试已 gofmt。

必须保留的验证限制

本机未取得完整当前 main 检出,使用已有 7f09 源码档案中的选定组件,并单独读取当前认证文件。四个问题的生产源文件 Git blob 摘要与当前 main 完全一致;付款规则、并发准入、加速定价三个包的目录树也匹配。不是全 main 构建。

应用要求 Go >=1.25.1,本机仅 1.23.2;完整 model/controller/router/service 测试在版本门槛处未运行。PostgreSQL、缓存、Rust/Bun、前端应用依赖缺失;Chromium 访问本机回环测试页被管理员策略拒绝,未绕过。钱包/账本、支付回调入账、退款、奖励优惠券、订单交付、真实 MCP 和后台授权的数据库一致性仍未验证。OIDC 测试使用内存存储,不能当作正式登录数据库验收;一个可选互通 fixture 导出未运行。

用户要求禁止远程 CI,因此本提交包含 [skip ci],未调用 dispatch/rerun,未改工作流。请在隔离本机继续执行修复验证;业务修复另提交。此 PR 保持 Draft,未申请合并或上线。

Add test-only reproductions for accepted long-context pricing, unfinished assistant SSE events, and subscription checkout confirmation. Preserve failing desired-behavior assertions. Record exact local execution and environment limits; no full application or database acceptance claim. Security reproducer retained privately. No business, dependency, workflow or production changes.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Related to audit PR #711. Add positive compatibility checks for normalized local destinations, equivalent same-origin absolute URLs, encoded and repeated order parameters, and authentication handoff serialization.

Keep private security reproductions and raw logs in the user handoff, not the public repository. Local Node component tests passed; no browser, database, production, or remote CI run.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Validate the serialized destination after URL normalization, reject raw control characters before parsing, and preserve legal query/fragment data without decoding it. Validate the fallback in useAuthRedirect and await navigation completion.

Related to audit PR #711. Local verification: 13 repository compatibility tests, 21 private sanitizer tests, and 11 navigation-call unit tests passed. Private failure cases and raw logs remain outside the public repository.

Full TanStack/browser login, independent database authorization, real OAuth and TOTP verification, and the normal app build/lint/typecheck remain unverified. Managed Chromium blocks URLs and the container lacks a full checkout and app dependencies. No production access, remote CI, release, deployment, or merge.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…[skip ci]

Merge auth redirect validation and regression tests as separate commits.

Related to audit PR #711. Browser-level login, database permissions, and complete build checks remain unverified as documented in PR #712. No deployment or release.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Refs #711. Add success/failure evidence regressions for missing or mismatched execution paymentId. Supply the original payment ID in the existing positive provider fixture.

Only an extracted evidence-selector harness was executed locally; complete service and PostgreSQL validation remain blocked. Assertions intentionally fail before the separate fix commit.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…ip ci]

Refs #711. Query the documented execution paymentId and reject missing or mismatched ownership before constructing either success or failure evidence.

Keep the existing submit-once fence, original-charge amounts, proof hashes, and provider/local reconciliation paths unchanged. Isolated before/after regressions passed; full PostgreSQL and merchant qualification are still required.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…s [skip ci]

Related to audit #711. Based on main@2f4164978cf27f6e0e605b0589fbe631aef2c441.
Reuse the existing main executor and isolated database fixture. Add completed-response loss, settlement rollback/recovery, concurrent replay, and authorization boundary assertions.

Test-only change. The dependency-free fault injector was run locally; the application/database suite remains uncompiled and unexecuted in this environment. No production fix or full business acceptance is claimed.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…ip ci]

Baseline 2f41649; relates to #711.
Uses real model/service code and Kling adapter with local-only HTTP fixtures.
Execution blocked: Go 1.25.1 and dependencies unavailable in this offline runtime.
Only gofmt and syntax parsing completed; no business tests claimed passing.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…s [skip ci]

Related to audit PR #711, test commit c288ed6.
Keep the original AUDIT-PRICE-01 assertion unchanged. Add independent long-tier,
cache, snapshot, invalid-number and final-rounding checks plus an isolated
SQLite/mock-upstream test using the existing billing and consume-log path.

Before the fix: the original audit and new package regressions fail locally.
The service/database test is added but NOT executed: this local environment
has Go 1.23.2, a selective source workspace, and no application dependencies.
Do not treat package-level test results as wallet settlement acceptance.
No production access or remote CI.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…[skip ci]

Relates to #711. No production fix or passing integration result claimed.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Merge localized refund evidence binding fix and its regression tests.
BI-06 database and provider reconciliation acceptance remains open (refs #711).
[skip ci]
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Merge test-only audit scaffolding. Tests are not yet executed, funds/data isolation acceptance remains pending. Linked audit #711.

[skip ci]
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Only test fixtures and regression cases, no production behavior changes.
Related to audit #711. Existing provider tests and fault-injector self-test pass locally; app-level database/OAuth integration tests remain unexecuted due to unavailable Go 1.25.1 and dependencies. Merging does not constitute business acceptance.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Related to #711, RT14 partial work at 2f41649. Covers protocol structure only, not model injection resistance or executor authorization. Local selected-file baseline run reproduces 14 failing subcases. No remote CI.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…p ci]

Related to #711, RT14 partial work. Reuse the existing protocol validator for small contexts as well. Preserve valid conversations and existing compaction behavior. Selected-file offline regressions pass; full executor, confirmation, database and local-model testing remain unverified.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Refs #711 (AUDIT-SSE-01). Add local chunked HTTP regressions and Go decoder/controller boundary tests. Preserve all existing assertions; complete two successful stream fixtures with a framed terminator.

Local baseline: frontend lifecycle 18/18; audit 2/4; HTTP suite 29/43. The old decoder fails the new boundary cases. Full Go controller and database settlement integration were not run.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
… ci]

Refs #711 (AUDIT-SSE-01). Require a blank-line committed terminal, preserve CR/LF/UTF-8 boundaries, and require explicit boolean retry permission for assistant stream errors. Latch and cancel failed browser writes, and reject relay buffer resets after successful response bytes.

Local checks: existing frontend lifecycle 18/18, chunked HTTP suite 43/43, standalone production decoder race checks pass. Audit SSE regression passes; unrelated subscription regression remains failing. Full Go controller, real provider, independent database settlement and financial failure recovery remain unverified. No billing implementation is changed.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Retain AUDIT-SUB-01 from audit #711 (c288ed6) using explicit order references. Cover old usage/reset/expiry, concurrent and other-device orders, reload, timeout, cancellation, late and duplicate responses. Add isolated SQLite query fixtures and a Go model regression.

The Go regression requires the project toolchain and dependencies; it has not been executed in this environment.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…kip ci]

Replace global subscription fingerprints with per-order pending records and read-only settlement/grant evidence. Keep reload recovery, independent retries, and guards for stale sessions and attempts. Save local order IDs before payment navigation and return Stripe's existing order ID.

Related to audit #711 / AUDIT-SUB-01. No provider callback changes, migration, remote CI, release, deployment, or merge. Full Go/React/browser checks remain unverified; local state tests and isolated production-SQL fixtures passed.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Merge isolated resource-admission test, local bounded runner, and measured component evidence.

Scope: admission component only. Full main integration, authenticated A/B fairness, queue recovery, and billing remain NOT_RUN or not measured.

Related to #711. No business-code change, release, deployment or CI dispatch. [skip ci]
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…fix [skip ci]

User explicitly authorized merging PR #724 on 2026-10-10 after receiving the documented validation limits.

Preserve the separate test and fix commits. Relates to #711; the audit remains open.

Real-browser cross-origin requests, authenticated WebSocket handshakes, and database writes remain unverified. This merge does not claim full security acceptance and does not authorize CI dispatch, release, or deployment.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
关联审计 #711;只合并原始请求测试及审计记录。尚未完成应用级 Go 1.25.1、代理和资金链路验收,不能视为安全修复或验收通过。未运行远程 CI、发布或部署。
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Retain AUDIT-SUB-01 from audit #711 (c288ed6) using explicit order references. Cover old usage/reset/expiry, concurrent and other-device orders, reload, timeout, cancellation, late and duplicate responses. Add isolated SQLite query fixtures and a Go model regression.

Rebase onto main@ff9b2e77f after concurrent Pancake product changes. Go regression authored but not executed: required toolchain/dependencies unavailable.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…kip ci]

Replace global subscription fingerprints with per-order pending records and read-only settlement/grant evidence. Keep reload recovery, independent retries, and guards for stale sessions and attempts. Save local order IDs before payment navigation and return Stripe's existing order ID.

Preserve main@ff9b2e77f Pancake one-time/recurring product selection. Related to #711 / AUDIT-SUB-01. No provider callback changes, migrations, remote CI, releases, deployments, or merges. Full Go/React/browser checks remain unverified; 12 local state/SQL/wiring tests passed after rebasing.

Copy link
Copy Markdown
Member Author

RT18 tracking: Draft PR #730 now holds a separate regression-test commit (fec73674) and candidate fix commit (8a86150c) against main. Two different valid JPEGs share the old cache-key input (length/MIME/first 128 Base64 chars), but the full production LoadFileSource → Ollama → local upstream test has not been executed. Go 1.25.1/modules are unavailable locally; no remote CI was run. Same-request concurrency remains unverified and requires race testing. PR #730 is intentionally unmerged until those checks pass. No cross-account disclosure or billing impact is claimed.

LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
… ci]

Confirm subscription checkout only after matching paid order and entitlement are recorded.

Related to audit #711. Keep Waffo Pancake dual-product support; scoped local tests passed. Full backend/frontend and PostgreSQL/browser checks were not run. No deployment or release.

[skip ci]
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
Refs #711. Pure-rule tests only; Go model/DB integration and business fixes remain pending. Local extracted-function tests, sensitivity, go vet, gofmt and 386 compilation passed. No CI, production access or deployment.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…ssions [skip ci]

Add actual router and GORM tests for owner boundaries, PAT/session expiry and cache/database failure paths. Prepared but not executed: Go 1.25.1 and full local dependencies unavailable. Related #711.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
… [skip ci]

Fail closed for update, status update, single delete and batch delete. Roll back the batch transaction if cache invalidation fails. Related #711.

Local runtime tests not executed; prepared regression tests are in the parent commit.
LIghtJUNction added a commit that referenced this pull request Oct 10, 2026
…ing [skip ci]

Preserve distinct test and fix commits. Related to audit #711. Local integration/DB authorization acceptance remains unverified.
@LIghtJUNction
LIghtJUNction marked this pull request as ready for review October 11, 2026 12:40
Copilot AI balanced review requested due to automatic review settings October 11, 2026 12:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-11T12:44:08.850407Z c288ed6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction
LIghtJUNction changed the base branch from main to wip/rust-core-go-extensions October 12, 2026 11:04
@LIghtJUNction
LIghtJUNction marked this pull request as draft October 12, 2026 11:04
@LIghtJUNction

Copy link
Copy Markdown
Member Author

根据开发主线交接策略,旧单体 main / traditional 已冻结,相关财务/计费/测试/工具逻辑已由 wip/rust-core-go-extensions 对应微服务组件承接。关闭旧单体历史 PR,避免堆积。

@LIghtJUNction
LIghtJUNction deleted the audit/business-integrity-main-20261010 branch November 5, 2026 07:31
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