feat: PropertySpec.marking field + with_marking builder (LF-6 extension)#266
feat: PropertySpec.marking field + with_marking builder (LF-6 extension)#266AdaWorldAPI merged 1 commit intomainfrom
Conversation
Per SMB session REQUEST at bus 5c8543a (16:30). Additive — every PropertySpec gains a `marking: Marking` field initialised to Marking::Internal (GDPR-safe baseline) by all 3 const constructors. New const builder method `.with_marking(m)` chains with the existing .with_semantic_type/.with_nars_floor/.with_codec_route pattern. Why: Before: SMB carried a side-table of (entity, predicate, Marking) tuples in smb-ontology::markings::SMB_MARKINGS. Two sources of truth (schema + side-table) could drift; typos silently fell back to Marking::Internal. After: marking lives directly on PropertySpec. SMB ontology dissolves the side-table; per-row fold becomes `schema.properties.iter().map(|p| p.marking).collect()`. Pattern matches with_semantic_type from PR #263 (commit 76a7237). Zero breaking change: existing PropertySpec construction sites inherit Marking::Internal default. New tests verify the default, override per-predicate, chained construction with_semantic_type + with_marking, and the W-2 most_restrictive fold over a row's markings. 243 contract lib tests pass (3 new). Clippy clean on new code. https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3569269b7
ℹ️ 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".
| /// GDPR / data-protection classification (LF-6 marking). | ||
| /// Default = `Marking::Internal` (GDPR-safe baseline). | ||
| /// Override per-predicate via `.with_marking(...)`. | ||
| pub marking: Marking, |
There was a problem hiding this comment.
Avoid breaking
PropertySpec struct literal initializers
Adding a new required public field to PropertySpec is a source-breaking API change for downstream crates that construct this type with struct literals (PropertySpec { ... }), which is likely in scope here because this crate is explicitly a shared contract for external consumers. Those callers will now fail to compile with a missing marking field, so this is not a zero-breaking change and should be gated by a compatibility strategy (e.g., avoid exposing required new fields directly in the public struct shape).
Useful? React with 👍 / 👎.
… session_01GDZ7W6k75paRxBznbZXV4t
Summary
Per SMB session REQUEST at bus
5c8543a(16:30, 2026-04-25):Add
marking: Markingfield +with_marking(m)const builder toPropertySpec. DefaultMarking::Internal(GDPR-safe per LF-6). Matches the existingwith_semantic_typepattern (PR #263).Why: SMB ontology currently carries a side-table at
smb-ontology::markings::SMB_MARKINGSmapping(entity, predicate, Marking). Two sources of truth (schema + side-table) can drift; typos silently default toMarking::Internal. With this PR, marking lives directly onPropertySpec. SMB dissolves the side-table; per-row marking fold becomes one line:Pattern: matches PR #263's
with_semantic_type— chained, const, zero breaking change.Test plan
cargo test -p lance-graph-contract --lib— 243 passed (3 new)cargo clippy -p lance-graph-contract -- -A unused -A dead_code— clean on new codecargo check— full workspace cleanSMB_MARKINGSside-table into schema definitions; LF-6 fold becomes direct schema iterationhttps://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
Generated by Claude Code