Repository navigation
Remember approved property examples so definition edits expose alignment regressions. - #1178
Conversation
…ent regressions. Signed-off-by: Virtue039 <virtue039@qq.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thank you for this. It follows the scope we agreed on #1103, and the core is right: the table, cases written with adoption in one commit, one Editor API, and a result recorded when a binding decision commits, with human_bound stated in it.
Four changes before it can land, all toward making it smaller:
- Take the example ids from the pass that already reads the examples.
propose_lockednow callsexample_statementsonce per signature, up to 120 queries a round, each scanning open statements through the phrase normalisation, which no index covers.phrase_bindings::signaturesalready collectsexamplesandquotesin one pass; please return the statement ids from there. #1108 removed the same per-group scans for a base with 36,000 open statements. - Drop the quote fallback for older proposals. A proposal made before this change writes no cases when adopted. That removes the second half of
example_statementsand its tests. - Keep the tests to what the change introduces. About 1,400 of the 1,900 lines are tests. One per behaviour is enough: adoption writes its cases in the same commit; the API adds a case and refuses the wrong role or another base's statement; a decision records pass, mismatch and
human_bound. The concurrency, rollback, model-failure and cross-base cases go beyond this change. - Housekeeping. Migration 0107 is promised to #1097 and 0108 is in use on #1131, so please take 0109. The design note fits in the dated note you already added to 0061, without a separate file under
docs/design/, which holds one file per domain.
I will look again as soon as it is updated. Thanks again for the careful work.
Signed-off-by: Virtue039 <virtue039@qq.com>
…expensive. Signed-off-by: Virtue039 <virtue039@qq.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thank you for turning this around so quickly. All four points are addressed: the example ids come from the signatures pass, the quote fallback is gone, the tests are down to one per behaviour, and the migration is 0109 with the note folded into 0061. I ran the store, API and agent tests against a fresh database here and they pass, as does CI. Merging now; the workbench view is welcome as the second PR. Thanks again.
Why
An approved property has no saved example expectations, so later alignment changes cannot be compared with what the person accepted. This implements the first slice of ADR 0061 cut 2, with the scope agreed in #1103.
What changes
adoption/personorigin.human_bound: true. Store both check time and actual decision time.Refs #1103.
How it was checked
cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warningspass.cargo test --workspacewithUTOPIA_TEST_REQUIRE_DB=1andUTOPIA_TEST_REQUIRE_PDFTOTEXT=1, against an initialized isolated PostgreSQL 16.15 / pgvector 0.8.7 database and Poppler 26.10.0.The comparisons observe existing alignment; they are not a live-model semantic accuracy benchmark.
Before review
git commit -s)cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepasscrates/utopia-store/was tested withUTOPIA_DATABASE_URLsetCURRENT_SCHEMA_VERSIONis 98, matching the migration file count on this branch