Repository navigation
A row a rule implies is attested by the statements it read, not by the moment it was computed - #1012
Conversation
…e moment it was computed Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Approving. Thanks @Maya-Kid.
Reviewed at 1c599d9. The change closes the gap the table in the description shows: a rule's row now reads its statements' attestation through implied_fact_sources, the sync runs after imply_in_tx, and a person's row that a conclusion merged into is left alone because it is neither implied nor materialised from a statement. The migration follows 0100's shape (every base, invalidated rows too). The test that attests a statement afterwards, the way time resolution does, is the one that pins the behaviour that mattered.
Migration number. 0101 is also taken by #1015 (the Ark OCR reader), which is waiting on a contributor's verification with a real key. This one lands first and keeps 0101; #1015 will move to 0102 and a schema version of 93.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com>
…e Ark vision model read in one pass (#1015) * The OCR reader chooses its provider: MinerU as before, or a Volcengine Ark vision model read in one pass Scans and images can now be read by an Ark vision model beside the MinerU service. llm_settings gains ocr_provider (default mineru) and ocr_model; a key stays with its provider and is cleared when the provider changes, in one SQL statement. The Ark path sends an image whole, renders a PDF page by page with Poppler, asks the model for the written text of each page as JSON, retries a page that hit a rate limit, a timeout or a server error three times inside the pass, and builds the same Reading as MinerU. Nothing is remembered between passes: a failed pass re-reads every page on the document's ordinary retry. ADR 0065. The prompt, the probe image, the URL rules and the Poppler subprocess handling come from Fonna's implementation in #1007, which this narrows. Co-authored-by: Fonna <jiangpeng274@outlook.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com> * The Ark OCR migration moves to 0102: 0101 landed with #1012 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com> * 补齐方舟 OCR 的响应上限、配置兼容与验收 (#1016) * 修复方舟 OCR 的响应读取上限与旧客户端配置兼容 在读取响应时执行大小上限,复用现有代理规则。省略供应商的旧请求保留已有配置,显式切换仍隔离密钥。补充整篇重读、空白页页码和真实接口验收,并更新 Agent Plan 地址提示与设计说明。 Signed-off-by: Fonna <jiangpeng274@outlook.com> * 补强扫描原文验收并处理测试替身的部分读取 Signed-off-by: Fonna <jiangpeng274@outlook.com> --------- Signed-off-by: Fonna <jiangpeng274@outlook.com> * The README says which readers scans, images and recordings go to Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com> --------- Signed-off-by: Wayland Yang <wayland0916@gmail.com> Signed-off-by: Fonna <jiangpeng274@outlook.com> Co-authored-by: Fonna <jiangpeng274@outlook.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Fonna <35397279+Fonna@users.noreply.github.com>
Follows #995. A row that an approved rule implies (0073) takes the moment it was computed as its attestation. Since #995, a fact with no time holds at every moment (0064 decision 5), and a row materialised from a statement follows that statement's attestation. A rule's row does neither.
Problem
imply_in_txwrites a rule's row throughinsert_fact_on, which storesCOALESCE(attested_at, now()). That fallback is meant for a fact a person writes.NULL, with the same result.sync_typed_attestationputs a typed row back on its statements' attestation, but it has two gaps:typed_fact_sources.materialize_in_txit runs beforeimply_in_tx.attested_byalso stays empty. This happens two ways:attest_statementthen moves the attestation earlier.attested_fromChange
crates/utopia-store/src/materialize.rs:sync_typed_attestationtakes a row's source statements from bothtyped_fact_sourcesandimplied_fact_sources. A kind-word rule's source is an entity, so it adds no attestation.implied).attest_earlieralready moved it earlier at the merge.materialize_in_txthe sync now runs afterimply_in_tx.migrations/0101_a_row_a_rule_implies_follows_its_statements.sqlapplies the same rule to rows written before. Like 0100, it covers every base and invalidated rows too.CURRENT_SCHEMA_VERSIONbecomes 92.graph::attest_statementandtime_resolution::attest_statements) now mention rule rows.#1007 also adds a 0101. Whichever lands second moves to 0102 and a schema version of 93.
Verification
Run in containers on a Linux host: Rust 1.98.1 and PostgreSQL 16 with pgvector.
a_row_a_rule_implies_follows_the_statement_it_read(store tests):attest_statement, thensync_typed_attestation):a_row_a_rule_implied_follows_its_statementsis a top-level binary, like the 0096 and 0099 tests, because the migration is not filtered by base.2026-09-30T04:09:11Z), not left empty.2026-09-04(签约日 2026年9月4日), and null.cargo fmt --all --checkandcargo clippy --locked --workspace --all-targets -- -D warningsare clean.UTOPIA_TEST_REQUIRE_PDFTOTEXT=1 cargo test --locked --workspacepasses: 1306 passed, 0 failed.