Add strict Rust Ossie import parity - #332
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d20ab3cb54
ℹ️ 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".
| .filter_map(Value::as_str) | ||
| .filter_map(|name| field_names.get(&normalize_identifier(name)).cloned()) | ||
| .collect::<Vec<_>>() |
There was a problem hiding this comment.
Reject unresolved declared-key columns
When a declared primary or unique key contains an unknown field, this filter silently removes that component instead of producing a diagnostic. For example, primary_key: [tenant_id, typo] compiles as [tenant_id], falsely changing a composite key into a single-column key and potentially corrupting distinct-count or symmetric-aggregation results. The strict importer should reject unknown, duplicate, or empty declared-key columns rather than lowering a modified key.
Useful? React with 👍 / 👎.
| let is_query = source_is_query(&source, target); | ||
| let model = Model { | ||
| name: name.clone(), | ||
| table: (!is_query).then_some(source.clone()), |
There was a problem hiding this comment.
Reject sources that are neither queries nor table references
Any source that is not recognized as a query is assigned directly as a table, even when it is invalid SQL or another statement type. Thus inputs such as source: DROP TABLE orders pass inspection and compile as executable scopes, only producing malformed or unsafe FROM clauses later. Source classification needs a separate validated-table outcome and must diagnose values that are neither table references nor supported queries.
Useful? React with 👍 / 👎.
| &[ | ||
| "version", | ||
| "name", | ||
| "description", | ||
| "ai_context", | ||
| "ontology", | ||
| "ontology_mappings", | ||
| ], |
There was a problem hiding this comment.
Include
requires in allowed ontology fields
The pinned Ossie 0.2.0.dev0 ontology schema defines requires as a valid root property, but this allowlist omits it. Consequently, a schema-valid ontology document that declares dependencies is rejected with ossie.schema.additional_properties, preventing the new validator from accepting supported upstream documents.
Useful? React with 👍 / 👎.
Stack created with GitHub Stacks CLI • Give Feedback 💬