Repository navigation
WIP(A04): authorized history reads and bounded finance ZIP — 47 scoped checks passing - #875
LIghtJUNction wants to merge 6 commits into
Conversation
Add source-only A04 read projection helpers, synthetic test fixtures, PostgreSQL snapshot test definitions and allowlisted JSON output. Pending S11 module wiring, dependencies, real source integration, authorization, complete finance export and executable test evidence.
…finance ZIP Use existing stored credential checks inside one read-only snapshot for scope, counts, pages, totals and all export documents. Refuse missing, writable or duplicate offline sources; preserve unknown historical money and raw quota. Add real PostgreSQL restricted-role and HTTP integration tests, plus a scoped read-only CI runner that retains resolved lockfile and exact tested input. The offline A03 source-view provider and catalog integration remain required; synthetic fixtures are not historical import or production readiness evidence.
|
补充 c3fa657 的实际验收进展:专用 job已有 10+6+16 项通过,history_repository 为 9 通过、1 失败。 值得先检查 archive.rs 的错误映射: 组合 CI另外仍受 Cargo.lock 的 |
Keep byte limits through JSON and ZIP layers instead of converting them into missing-source errors. Retain real IO/source failures and poison incomplete usage exports. Follow up on PR #875 failing PG limit case.
…eipts Check column grants on both source views and qualification receipts. Add real PostgreSQL regressions for column grants, duplicate receipts, ZIP footer bounds and malformed usage, plus typed sink IO tests. Freeze the S11 lock integration patch in the isolated acceptance runner instead of resolving a different dependency graph on each CI run.
Preserve the concurrent A04 PostgreSQL/HTTP/ZIP implementation. Add native-only settled charge reads with strict account/key scope and synthetic PG regressions. Add allowlisted CSV output with spreadsheet formula protection and metadata/row validation. Bound historical aggregate metadata processing without reporting partial money totals. A03 legacy source completeness and full integration remain blocked.
Allow safe JSON escaping of control characters as before. Reject NUL only for CSV, where spreadsheet readers may truncate input. Verify the separate format policies with regression cases from the A04 CI failure.
A04 v2 已推送并完成本次专项验证(2026-10-12)提交: 专项验收:PASS。 A04 history and finance acceptance #38241490901,Rust 1.99 与合成 PostgreSQL 环境执行 A04 关联测试,工作流最终 整个项目尚未通过: |
|
本轮按固定 head 目前最先可收口的两项是原始 head 的交付完整性:
已有 A04 专项 PostgreSQL 记录只证明其明确输入和合成来源合同,不能补齐真实历史迁移。与 #884 / S11 的下一道接口请固定为 自动 workflow 与仓库拓扑规则的差异交给 S11 按现有治理处理,不以放宽测试/工作流保护换取绿色。请优先完成上述锁文件和格式交付,再在本机验证固定提交。Draft/未集成状态保持,#895 不据此关闭。 |
|
补充按新主线 d001227 的核验,避免继续沿用“history/export 模块未进入主线”的旧描述。 94c5c63 已加入较窄的历史日志读取及管理员 JSON/CSV usage 导出,且明确 还需保留当前逐作用域来源映射的验收缺口: 保留 Draft;剩余 A04 来源证明、完整导出和实际业务接线继续在 #895 跟踪。 |
|
补充实际 CI 证据:此前对当前历史读取实现的静态保留意见,现已在 run 39147278374 得到可执行验证。该运行验证的是集成分支 head
两者实际收到 因此,当前较窄的历史读取/用量导出实现仍不能替代完整验收:需要先区分“权威证明范围为空”和“范围映射尚未证明”,再完成原生 HTTP 及全量归档合同验证。本 PR 继续保留未完成状态。整个 CI 最终被取消,也不能据此声明完整通过。 |
Current WIP verification (2026-10-25)The two lineage regressions previously reported against the history-read implementation now pass on current WIP HEAD The tests used SQLx's disposable database setup against the local PostgreSQL management database. This verifies that missing user/account and native-key historical mappings return |
Extend the existing textual-cell prefix guard over Unicode whitespace, control characters and BOM while retaining complete original cell content. Keep JSON values, typed numbers and financial status semantics unchanged. Include independent encoder regression coverage. Extracted from the CSV guard proposal in #875 by @LIghtJUNction. Refs #875; the full A04 financial ZIP contract remains incomplete. The frozen combined tree passed 309 directed tests, strict all-target Clippy and docs validation. One preexisting opt-in benchmark remains unrun. No production deployment or CI rerun.
|
以 superseded / migrated 关闭此旧布局 PR。实现进入 原候选 完整接口与验收要求见 迁移合同,13 项待办已实际写入 #895。关联的未完成 issue 保持开放。保留本 PR 正文、原始候选与历史通过/失败证据;未将本 PR 源码直接合回配方项目。 |
开发主线交接(2026-10-12)
开发默认主线现为
wip/rust-core-go-extensions;旧单体main与traditional冻结于3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore
main。本 PR 的候选实现和已有验证范围保持原样;不因主线交接自动合并或标记验收完成。
A04 当前状态
任务范围。最新提交
0d2aaa2f766c77f15890f2a2b6c17aaeca84a4fa。已完成本轮源码修复与隔离定向验收:47 项通过,0 失败、0 跳过,其中 22 项使用真实 PostgreSQL。保留 Draft;没有声称完整 A04、真实历史迁移或最终组合验收完成。
本 PR 已不是最初的 7 文件未接线版本。现有实现包含 Core 模块和 HTTP 接线、统一鉴权读取、历史金额投影、统计与分组、15 个 JSON 文档组成的财务 ZIP。完整历史来源视图仍由 A03/S11 提供;测试中的来源提供方是合成数据,不能用于生产导入。
本轮修改
2fe4626:修复 ZIP/JSON 多层写入把限额误报为来源不可用的问题。文件上限、空间/配额不足保留限额类别;一般 IO、格式和数据错误不混为限额。中途失败的 writer 仍禁止输出貌似完整的部分结果。0d2aaa2:只读资格检查同时检查整表与单列 INSERT/UPDATE 权限,以及来源回执的写权限。缺失、重复或互相矛盾的来源回执一律拒绝。本轮只改变 7 个 A04 源码/测试叶文件;保留先前提交的公共接线,不回写共享 WIP、生产库或其他任务域。
实际验证
最新专用 CI · 结果及精确输入归档
实际工具:rustc
1.99.0 (b940084d7 2026-09-28);cargo1.99.0 (5f94df478 2026-08-27);专属 PostgreSQL 17 服务。cargo test --locked --test history_read --test finance_export \ --test history_repository --test financial_profile --no-fail-fast证据范围:isolated-tested。 CI 从合并候选
abef1340db8cb9b25918ddc39d6db7335f0e9a75检出,在一次性环境应用固定的 S11 锁文件补丁并运行 A04 文件的 rustfmt,再编译和测试。不是未修改源码树上的全仓 CI,也不是浏览器或真实历史数据验收。checked-source.tar.gzSHA-256:030fd6db0ab2d1a08b83d09d5ef51164c45b014fe67a7bdd4ec4d6e61d5e0dce31a6c92b24e5f3bc2de49eb09bd2423fd2596dc0943a70bbfba89c669fa4fe11test-exit-code.txt为0;所有 47 项均无 skip/ignore。测试使用实际持久化的 Core 会话、Key、用户/团队角色及受限数据库角色;HTTP 测试调用真实路由处理函数。来源视图及其中业务材料是合成 fixture,未执行真实服务进程/浏览器联合验收。
历史失败保留:
c3fa657为 41 通过、1 个导出限额用例失败;2fe4626专用 CI 全部 42 项通过。没有将旧提交结果当作新输入结果。S11 精确接入
services/core/tests/history_read/cargo-lock.patch是锁文件的最小候选补丁。它将 Git blobe571b17a29f201e321f005eba20c2b4fa0bf3bf0转为b54ce5875919b916743171f6ce9b72a1d08449a7,只补所需依赖,不更新原有依赖版本。最新 CI 归档的
generated.patch包含相同锁文件变更和仍需落地的 A04 格式变更。S11 应先核对输入并git apply --check,选择应用该完整补丁一次;不要再重复应用 lock-only 补丁。基线改变须重新核对,不强推或覆盖其他任务。共享
Cargo.lock尚未直接修改。组合 CI 的格式、锁定依赖步骤仍失败,不能用专用验收成功覆盖这些失败。最终组合仍须重新编译、检查和测试。来源合同与未完成验收
运行时只读取
core_history.source_contract_v1、log_records_v1、quota_data_v1、finance_records_v1、finance_options_v1。精确列类型见tests/fixtures/history_source_v1.sql,该文件仅为合成提供方,不是生产 DDL 或导入证明。每个 dataset 必须且只能有一条有效 v1/complete 回执;哈希格式合法不等于来源真实性已获证明。A03/S11 仍需提供并核验真实归属/ID 映射、历史与 native 的去重、退款/作废规则、逐条计价基准及全部财务数据集。非零 opening 的金额证明、累计用量和每条日志美元金额不可互换;缺来源不能伪造 complete 或用空数组/零补齐。Go 不取得 Core DSN,运行时不导入或重写来源。
A10/S11 仍需验证当前前端的会话传递、分页/DTO 兼容及浏览器流程,并完成最终组合和真实历史只读对账。在这些条件满足前,不关闭 A04,不标记 MIGRATED,不合并为已完成版,不发布或部署。
Current independent review — remaining contract (2026-10-27 batch 2)
Independent current-base review keeps the complete A04 PR on HOLD. The current implementation provides bounded historical-usage JSON/CSV with
complete_financial_export=false; it does not implement the old candidate's complete 15-document finance ZIP or its five versioned source-view contracts. Keep current per-source account/key lineage proofs, admin gating, native ledger/money semantics, and unknown-versus-zero behavior. A separately reviewed Unicode/BOM/control-prefix CSV text guard is being extracted as a small contribution; that does not complete or close this PR/A04/#895. Native/full-source mapping, all-family same-snapshot HTTP ZIP, ACL/negative cases and financial unit reconciliation still need current-input implementation and verification. Old passing counts and lineage results remain evidence for their original versions only.This disposition records current code review only. Original descriptions, failures and unmerged work are retained; no CI rerun, deployment or full-project acceptance is implied.