Repository navigation
lance-graph-r2il: production alias views for the polyfill lens (D-DT64-7 L4) - #1902
Conversation
…4-7 L4) Each POLYFILL word now records which alias is its SQL and which its Quack name (sql_at, quack_at index into the existing aliases, so no name is spelled twice). FrozenWord gains name_of, name_in and is_alias. PolyfillView is a ClassView answering 0xFFFF with one label per position in R2IL, SQL or Quack; the predicate IRI names the word, the label the language. WithPolyfill puts it over a consumer's view, answering 0xFFFF and delegating every other concept. The binding path and the 0xC401 reading are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aac42f7053
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| impl<V: ClassView + ?Sized> ClassView for WithPolyfill<'_, V> { | ||
| fn fields(&self, class: ClassId) -> &[FieldRef] { |
There was a problem hiding this comment.
Delegate the remaining ClassView metadata to the consumer
When the consumer overrides optional ClassView methods, wrapping it in WithPolyfill silently replaces those answers with trait defaults even for concepts other than HARDCODED. For example, compute_dag becomes empty, is_a_parent becomes None, and epistemic_reading becomes undeclared; consequently, recomputation can be skipped, inherited rendering loses its ancestor lookup, and epistemic projection can refuse previously valid data. These defaults are defined in crates/lance-graph-contract/src/class_view.rs and are not derived from the three methods forwarded here. Delegate the remaining metadata methods for non-polyfill concepts so adding the polyfill view preserves the consumer's existing class behavior.
Useful? React with 👍 / 👎.
Step 1 of the execution order recorded in plan §1d (decisions in #1901). This PR adds the R2IL, SQL and Quack views of the polyfill lens as library code; until now they existed only as test-local helpers.
What changed in
lance_graph_r2il::polyfillPOLYFILLword gainssql_at/quack_at: the index of its existing alias that is its SQL name or its Quack name.contains("::")check is not used here.FrozenWordmethods:name_of(lang) -> Option<&str>: the word's name in that language, if it has one.name_in(lang) -> &str: same, but falls back to the R2IL name, so a view always has one label per position.is_alias(label): whether a label is one of the word's aliases.PolyfillView::new(AliasLanguage::{R2il, Sql, Quack}): aClassViewthat answers concept0xFFFFwith one label per position and returns nothing for any other concept.predicate_iriidentifies the word (lg:polyfill:f000/<R2IL name>). Only the label changes per language.SUM,MIN,MAXorALL, so those positions carry their R2IL name. SQL returnsNULLon an empty selection where these words return a value.WithPolyfill::new(&consumer_view, &polyfill_view): answers0xFFFFfrom the polyfill view. Every other concept, its template and its DOLCE category come from the consumer's view.Unchanged:
binding.rs, the name-bound0xC401reading, theFnIndexcontract, and the 9 existing polyfill tests.Tests and disable runs
New tests are in
tests/integration/polyfill_views.rs(6 tests). They were written first and did not compile (10 errors) until the API existed. They check:IntSLess/</Cmp::LtI32);R2ILVocabulary, SQL and Quack names are among the word's aliases, and the fallback applies only where a language has no name;0xFFFFlabels are refused when the consumer view is used alone, and are hidden when wrapped inWithPolyfill.Each guard was disabled once to check that a test fails; all seven went red:
0xFFFFThe "one wrong index" disable first failed to apply because
cargo fmthad reflowed the line. It was re-run on the formatted text, so that row is a real result.Local gates:
cargo test -p lance-graph-r2il: 46 integration tests pass, plus the other suites.clippy --all-targets -D warningsandfmtare clean.entries_index,citation_decayandappend_only_gatepass.Board entry:
.claude/board/entries/2026-10-31-polyfill-alias-views-l4.md. The STATUS_BOARD row for L4 arrives with #1901.Generated by Claude Code