Repository navigation
Conversation
jbonofre
left a comment
There was a problem hiding this comment.
Can you please clarify between behavior-layer.schema.json and osi-schema.json?
| "required": ["vendor_name", "data"], | ||
| "additionalProperties": false | ||
| }, | ||
| "Behavior": { |
There was a problem hiding this comment.
I'm a bit confused here: it seems we have two behavior type definition:
- in
behavior-layer.schema.jsonwith standalone schema - in
osi-schema.jsoninline as$defs/Behavior,$defs/BehaviorAction,$defs/BehaviorEffect,$defs/BehaviorRule
I see already some differences before the two definitions.
Why not having osi-schema.json reference behavior-layer.schema.json via $ref.
I guess that having two schemas that must kept in sync manually will drift.
| "properties": { | ||
| "entity": { "type": "string", "enum": ["dataset", "field", "metric", "relationship"] }, | ||
| "mode": { "type": "string", "enum": ["read", "write", "derive"] }, | ||
| "impact_type": { "type": "string" }, |
There was a problem hiding this comment.
impact_type is a string here, but an implicit enum in spec.yaml.
|
@zljie any update? Thanks! |
|
Thanks for following up, and apologies for the delay. I’ve narrowed the follow-up to:
I’ll reuse the existing local schema resolver and keep this focused on the schema contract. The branch update and CI run are still pending; I’ll post the commit and results once those are complete. |
|
@jbonofre Updated in 622a22f (latest head: 3688717).
Local checks passed: 334 validation/Python tests, 53 standalone validator tests, six examples, schema checks, spec/type synchronization, and Apache RAT. GitHub Actions are awaiting maintainer approval. Could you please approve the workflows and take another look? Thanks! |
There was a problem hiding this comment.
🟡 Changes recommended
The Python SDK currently accepts and serializes behavior payloads that violate the canonical schema.
1 open finding
What changed in this PR
Adds optional behavior metadata—actions, rules, and effects—to the core specification and Python SDK.
Changes:
- Introduces the canonical behavior schema and documentation.
- Adds SDK round-trip preservation and validation tests.
- Adds a P2P example and CI validation.
| File | Description |
|---|---|
core-spec/behavior-layer.schema.json |
Defines behavior validation. |
core-spec/behavior-layer.md |
Documents the behavior layer. |
core-spec/ossie-schema.json |
References the behavior schema. |
core-spec/spec.md |
Documents root-level behavior. |
core-spec/spec.yaml |
Adds descriptive behavior structures. |
examples/p2p_behavior_effects_minimal.yaml |
Demonstrates behavior annotations. |
python/src/ossie/models.py |
Preserves behavior in SDK models. |
python/tests/test_models.py |
Tests behavior serialization. |
validation/tests/test_validate.py |
Tests behavior constraints and aliases. |
.github/workflows/validation-ci.yml |
Validates the new example. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Behavior field constraints are defined by the canonical JSON Schema. | ||
| behavior: Optional[dict[str, Any]] = None |
There was a problem hiding this comment.
Implemented in d07d8dc. The SDK keeps the dictionary API but validates declared Behavior/action/effect/rule fields with strict Pydantic types before accepting them, including required fields, aliases, enums, and present-but-null values. Valid extensions and JSON/YAML round trips are preserved without adding a runtime dependency. Tests derive mutations and expected acceptance from the canonical schema for both OssieDocument and OssieSemanticModel; the full SDK/validation suite passes, and focused Behavior tests also pass on Pydantic 2.0.
jbonofre
left a comment
There was a problem hiding this comment.
Requesting changes for the $ref resolution problem.
The spec.yaml is minor.
| "description": "Quantifiable measures spanning datasets" | ||
| }, | ||
| "behavior": { | ||
| "$ref": "behavior-layer.schema.json" |
There was a problem hiding this comment.
The new "$ref": "behavior-layer.schema.json" points at a sibling file, but only validation/validate.py has been updated to resolve it. Other consumers bundle just ossie-schema.json:
- Salesforce converter:
pom.xmlcopies onlyossie-schema.jsoninto/schemas/, andSchemaValidatorhas no way to locate the sibling. A model withbehaviorwill likely fail to load or validate. - OrionBelt converter:
pyproject.tomlvendors onlyossie-schema.json, andDraft202012Validatoris created without a registry. The$refis unresolvable, so validation would either crash or be skipped, depending onvalidation.py.
Could we either bundle behavior-layer.schema.json in those consumers with a retriever or registry, or inline the schema into ossie-schema.json? A test in each converter that validates a model containing behavior would also catch this.
There was a problem hiding this comment.
Fixed in d07d8dc by making the main schema self-contained. behavior-layer.schema.json remains canonical; a standard-library generator embeds the complete resource (including its $id/$schema/$defs) in ossie-schema.json, and CI --check prevents drift. Existing single-file packaging needs no resolver change. Added offline positive/negative tests in both converters (including aliases, required fields, and invalid effects). Java 21 mvn verify passed, and the packaged Salesforce JAR and installed OrionBelt wheel both validate outside the checkout with only the bundled main schema.
| metrics: [] | ||
|
|
||
| # Optional: Behavior metadata; canonical contract: behavior-layer.schema.json | ||
| behavior: {} |
There was a problem hiding this comment.
The root template adds behavior: {}, but an empty object fails the schema. It requires namespace, behavior_layer_version, rules, and one of actions or action_types. Anyone copying the template gets a document that doesn't validate.
Could we fill in minimal valid placeholders, or drop behavior from the template and document it separately?
We should also have a [VOTE] on the dev@ mailing list.
There was a problem hiding this comment.
Fixed in d07d8dc: the root template now omits the optional behavior placeholder. The separate Behavior reference includes the required fields and valid empty actions/rules lists; a regression test checks this block against the canonical schema. I also agree this specification addition needs the dev@ vote. A vote proposal draft is prepared, but no mailing-list vote has been opened yet; that community decision and maintainer approval remain outstanding.
|
@jbonofre Updated in d07d8dc, after syncing latest main (2b1f9bf). All three current findings are addressed:
Local verification passed: 434 validation/Python tests, 53 duplicate-key validator tests, OrionBelt 339 passed/1 optional DuckDB skip, and Java 21 Salesforce Maven verify (386 cases/16 existing skips; all 36 new Behavior cases passed). Both installed wheels and the packaged Salesforce JAR were checked outside the checkout; all six examples, schema metaschemas/synchronization, RAT, and PR whitespace checks passed. The new-head workflows require maintainer approval (action_required). I have also prepared the dev@ vote proposal; no vote is completed yet. Could you please approve the workflows, review the updated implementation, and advise on initiating the project vote? Thanks! |

Adds optional root-level
behaviormetadata with actions, rules, and intended read/write/derive effects for planning and attribution.core-spec/behavior-layer.schema.jsonremains the canonical contract.ossie-schema.jsonembeds a generated resource, including its$id, so consumers can validate offline with just the main schema.scripts/generate-behavior-schema.py --checkruns in CI to prevent drift; use--applyafter changing the canonical source.impact_typeenforces the five documented values. Known fields are validated, open extensions and the legacyaction_typesalias are preserved, and empty action/rule lists remain valid.0.2.0.dev0.Local validation:
mvn verifypassed (386 cases, 16 existing skips; all 36 new offline Behavior cases passed). The packaged JAR passed 12 acceptance/rejection cases outside the checkout using only its bundled main schema.Behavior annotations describe intended effects; they do not execute actions or enforce business policies. The maintainer has also requested a dev@ vote on adopting this addition.