Skip to content

Every rewrite of an open statement keeps it a statement - #38

Merged
gedaiu merged 1 commit into
re-devfrom
fix/rewrites-keep-statement-layer
Oct 24, 2026
Merged

gedaiu merged 1 commit into
re-devfrom
fix/rewrites-keep-statement-layer

Conversation

@gedaiu

@gedaiu gedaiu commented Oct 24, 2026

Copy link
Copy Markdown

RC-004 found that rewrite_end_tx copied an open statement without its layer and phrase, so the copy became a typed row with no predicate that materialize never read again, and fixed that one insert. Two more rewrites had the same gap: rehome_tx (used when a merge is undone, resolution.rs) and correct_interval (PATCH /kbs/{kb}/facts/{id}). Both now copy layer and phrase. They were the last inserts into facts that copy an existing row: insert_fact_on, insert_open_statement and the known_as insert in resolution.rs write new rows with their layer set. RC-004 gets a dated note.

Tests: a_statement_with_a_corrected_start_stays_open_and_its_typed_row_follows and a_statement_rehomed_to_bea_stays_open_and_its_typed_row_follows (both failed first with ("typed", None, None)); cargo test -p utopia-store and cargo test --bin utopia-server green on a fresh migrated database; fmt and clippy -D warnings clean.

Left as they are: rehome_tx also drops valid_from_grade and attested_by and correct_interval drops attested_by, compared with rewrite_end_tx; and PATCH /facts/{id} queues no typed recompute after correcting an open statement.

🤖 Generated with Claude Code

rehome_tx (a merge undone) and correct_interval (PATCH /facts/{id}) copied
an open statement without its layer and phrase, as rewrite_end_tx did
before RC-004, so the copy became a typed row with no predicate that
materialize never read again. Both now copy them; RC-004 gets a dated note.
@gedaiu
gedaiu merged commit 897b0fc into re-dev Oct 24, 2026
6 checks passed
gedaiu added a commit to re-cinq/lore that referenced this pull request Oct 24, 2026
Bumps `utopia_image_tag` to `0.1.0-re.23` and `utopia_image_digest` to
`sha256:86591a57...`, the multi-arch index digest checked against ghcr.
re.23 judges a typed fact as confirmed while the statement it was built
from is still stated (re-cinq/utopia#37, RC-005): a re-push gives only
the statement its new evidence, so typed rows kept a stale copy and
looked unconfirmed, 71,025 of them in lore's base. It also keeps every
rewrite of an open statement a statement (re-cinq/utopia#38: a merge
undone and a corrected interval). No new migration since re.22.

After merge: `terraform apply` from main.

Related: #3413.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant