Repository navigation
fix(finance): use frozen currency basis for fixed request costs - #807
LIghtJUNction wants to merge 60 commits into
Conversation
…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.
…ence [skip ci] Pin source review to main@2f4164978cf27f6e0e605b0589fbe631aef2c441. Add a loopback-only component runner, real Markdown observation entry, URL-classification checks and runner-input tests. Keep private probes out. Actual local evidence: URL classification 16 passed on the pinned function excerpt; runner input validation 3 passed; TSX syntax transpilation passed. Chromium localhost preflight was blocked by administrator policy (exit 2). All four authenticated persisted-content paths remain NOT_RUN. No production code changes or vulnerability-fix claim. No workflow dispatch, release, deployment or merge. Refs #711.
Preserve manual deployment and exact Sigstore identity. Parse checksums and archives only after verification, bind the exact published asset tuple and resolved tag revision, and reject noncanonical checksums or duplicate members. Add 14 offline tests executing actual workflow gate bodies with synthetic artifacts and explicit GitHub/cosign doubles. These are not real signature, PostgreSQL, systemd or production qualification. Related #751. Native format1 to format2 migration in #757 remains unresolved.
* chore: export isolated refactor source for offline local validation * chore: prepare public Go dependencies for offline local checks * chore: export test tools for isolated local deployment verification * chore: stage hash-bound locally tested refactor payload (1/3) * chore: stage hash-bound locally tested refactor payload (2/3) * chore: stage hash-bound locally tested refactor payload (3/3) * chore: publish exact locally validated deployment refactor on isolated branch * chore: normalize temporary gzip transport header without changing tested bytes * refactor(deploy): remove embedded Go operator and ship separate signed deployment tool Move deployment implementation/tests out of API linkage; bind separate backend and tool hashes across scripts, releases, packages and retained recovery. Local Go tests, race/vet, all-package compile, real executable smoke and Python regression checks completed. No release or production deployment. Remove all temporary transport workflows and payloads. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ed-ancestry-20261011 chore(release): record scoped OpenRouter hotfix source ancestry
…alect (#795) Remove the startup-only commonGroupCol dependency from the public market and routing visibility query. Add isolated SQLite regression coverage for empty or stale legacy column metadata, bound group values, and availability filters. Local evidence: gofmt and whitespace checks passed; SQL-only SQLite probe passed. Go/GORM and application tests were not run: the local environment has Go 1.23.2, no Bun/dependency cache, and no working network checkout. This is a partial prerequisite fix, not the requested full public-relay lifecycle/UI implementation. Keep the PR draft pending full local verification.
…e-20261011 fix(tool-market): guide setup prerequisites and next actions
…y-interaction fix(web): 修复系统设置首次进入时目录误打开的初始化问题
…on-20261011 chore(web): stabilize generated route ordering
…ition test(wallet): add RT-11 opt-in money composition scenarios (unverified)
…dance-ancestry-20261011 chore(release): qualify scoped tool market guidance source
…e-identity-20261012 fix(deploy): verify split tool holders with signed engine identity
…l-identity-20261012 fix(deploy): qualify per-start checker as the signed deployment engine
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
当前 head 由该 SHA 源码推导:Q=K、group=1 时,3 张 × $0.04 在财务投影中会成为 40,000 micros,而非 120,000,且 priced=true。这是财务估算修复尚缺数量维度,不是另一次钱包扣费或已证实生产损失。 建议补充图片结算日志到财务汇总的 n=1/n=3 回归,使用冻结的实际结算数量;历史记录缺少数量依据时保留 unpriced,避免默认一单位。本次只核对同一 SHA 源码,未独立执行测试。 |
|
根据开发主线交接策略,旧单体 main / traditional 已冻结,相关财务/计费/测试/工具逻辑已由 wip/rust-core-go-extensions 对应微服务组件承接。关闭旧单体历史 PR,避免堆积。 |
开发主线交接(2026-10-12)
开发默认主线现为
wip/rust-core-go-extensions;旧单体main与traditional冻结于3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore
main。本 PR 原目标为旧单体
main,现转向微服务主线。只修改审查目标,尚未完成移植或验收,不可直接合并;须解决跨架构差异/冲突并完成本地验证,保留其他任务的改动。变更说明 / Summary
The finance overview treated a fixed per-call
model_priceas a token rate whenever a consume log contained token counters. A charged call priced at USD 0.02 with 1,500 tokens produced 30 USD micros instead of 20,000. Tokenless calls also assumed that the raw historical price was already USD.Estimate fixed prices once per charged request, independently of token counters. Accept explicit schema 2 USD prices or convert legacy prices with the log's frozen
pricing_unit_credits_per_unit(Q) andpricing_credits_per_usd(K):price * Q / K. Use decimal arithmetic, round once to USD micros, and reject values outside int64. Unknown currency evidence, invalid modes, and ratio/tiered pricing remainunpriced; current FX and current credit anchors never fill missing historical evidence.This changes the read-only finance estimate. Original logs, quota integers, wallet balances, payment settlement, and billing behavior are preserved. Expense/profit estimates can change where the previous projection used the wrong units. This focused repair does not add ratio/tiered cost reconstruction or resolve pre-existing aggregate accumulator overflow risks.
与上游的关系 / Upstream relationship
上游参考 / Upstream reference: N/A; this repairs the project's finance projection against its existing fixed-price settlement and frozen pricing metadata contracts.
关联 Issue / Related issue
N/A. Related finance/frozen currency issues and PRs were searched before opening this focused repair.
变更类型 / Type of change
验证 / Verification
All checks ran locally on signed commit
8003a8909aa848b309044f61662630625904dacd, with a clean source tree before and after. Fromapps/api-go:Changed-file
gofmt -landgit diff --check HEAD^ HEADalso passed. Independent read-only source review passed.Regression cases cover fixed prices with and without tokens; frozen old/current and fractional Q/K; missing or malformed currency evidence; unsupported or malformed billing modes; non-finite and overflowing values; half-micro rounding; zero/negative quota; independence from current K/Q/FX and an uninitialized current anchor; matching overview/user/daily expense totals; and unchanged historical logs and wallet credits. Existing finance export, payment-method filtering, refund, and subscription finance tests also passed.
Tests use local SQLite fixtures. Full repository/Web/deployment suites and CI were not rerun because the only changes are the finance controller's read-only projection and its tests. This PR does not claim PostgreSQL, browser, or production acceptance, and contains no production migration or write.
截图或日志 / Screenshots or logs
N/A; no UI or response schema changes. Local test results are recorded above.
提交检查 / Checklist