Skip to content

feat: PropertySpec.marking field + with_marking builder (LF-6 extension)#266

Merged
AdaWorldAPI merged 1 commit intomainfrom
claude/property-with-marking
Apr 25, 2026
Merged

feat: PropertySpec.marking field + with_marking builder (LF-6 extension)#266
AdaWorldAPI merged 1 commit intomainfrom
claude/property-with-marking

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Per SMB session REQUEST at bus 5c8543a (16:30, 2026-04-25):

Add marking: Marking field + with_marking(m) const builder to PropertySpec. Default Marking::Internal (GDPR-safe per LF-6). Matches the existing with_semantic_type pattern (PR #263).

Why: SMB ontology currently carries a side-table at smb-ontology::markings::SMB_MARKINGS mapping (entity, predicate, Marking). Two sources of truth (schema + side-table) can drift; typos silently default to Marking::Internal. With this PR, marking lives directly on PropertySpec. SMB dissolves the side-table; per-row marking fold becomes one line:

let row_markings: Vec<Marking> = schema.properties.iter().map(|p| p.marking).collect();
let row_classification = Marking::most_restrictive(&row_markings);  // W-2

Pattern: matches PR #263's with_semantic_type — chained, const, zero breaking change.

PropertySpec::required("iban")
    .with_semantic_type(SemanticType::Iban)
    .with_marking(Marking::Financial),

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 code
  • cargo check — full workspace clean
  • SMB session VERIFY: dissolve SMB_MARKINGS side-table into schema definitions; LF-6 fold becomes direct schema iteration

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh


Generated by Claude Code

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
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@AdaWorldAPI AdaWorldAPI merged commit f6f8ece into main Apr 25, 2026
0 of 5 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Apr 25, 2026
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.

2 participants