Repository navigation
A rewritten open statement stays an open statement, with its phrase and the dates its sections speak from - #1469
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
…corrected interval keeps its phrase and the dates its sections speak from Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Nash Aschenbath <wwh86696@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happens
The three temporal rewrites insert a new row and invalidate the old one:
rehome_tx(moving facts back when a merge is undone),correct_interval(a person corrects the interval) andrewrite_end_tx(the timeline writes an end). None of them copieslayerorphrase. So a rewritten open statement lands as atypedrow with a NULL predicate and a NULL phrase.facts_open_statement_shapeonly checkslayer = 'open'rows, so nothing refuses it, and what the document said is gone from the row.Two smaller losses on the same paths:
rehome_txandcorrect_intervaldon't copyfacts.attested_by, so the witness loses the name of its date.rewrite_end_txalready copies it.copy_evidencedoesn't copyfact_evidence.attested_at/attested_by(0104). If a document is deleted after the rewrite,documents::reattest_txreads the evidence that remains, finds no chapter date on it, and falls back to the document's own date. The merge path already copies these columns since A merge keeps the identity evidence of the name it dedupes #1466.The change
layerandphrase;rehome_txandcorrect_intervalalso copyattested_by.copy_evidencecopiesattested_atandattested_by. Typed rows carry NULL there (0104: typed rows follow their source statement), so copying them changes nothing for typed rows.a_rewritten_statement_keeps_its_section_dates. A statement with evidence in two documents, each with its own chapter date, is rehomed, and another is corrected. The test checks that both new rows are still open statements with their phrase and the earliest chapter date with its name. Then it deletes the earlier document and checks that the witness moves to the remaining chapter date, not to that document's own date. Ondevit fails at the first check, because the rewritten row has noattested_by.Records
This doesn't implement or overturn an ADR. It makes the rewrite paths keep what 0061 (the open layer) and 0104 (evidence dates) already say a row carries, so no status line changes.
Checks
cargo fmt --check,clippy -D warnings, migrate andcargo test --workspaceall pass locally, exceptreal_postgres_backup_and_restore_require_force_and_preserve_files_on_sql_failure, which needspg_dump, and my local image doesn't have it.Not changed, noticed
rehome_txandcorrect_intervalalso don't copyvalid_from_grade. For a person's correction, an empty grade may be intended. For a rehome it looks like the same kind of loss, because the timeline reads the grade when it decides whether a row can close its predecessor. I've left it out so you can decide.🤖 Generated with Claude Code