Skip to content

PROP-88 - Use Semantic Definition Format (SDF) for Data and Interactions of Things#182

Open
JeffMboya wants to merge 2 commits intoabsmach:mainfrom
JeffMboya:PROP-88
Open

PROP-88 - Use Semantic Definition Format (SDF) for Data and Interactions of Things#182
JeffMboya wants to merge 2 commits intoabsmach:mainfrom
JeffMboya:PROP-88

Conversation

@JeffMboya
Copy link
Copy Markdown
Contributor

@JeffMboya JeffMboya commented Apr 8, 2026

What type of PR is this?

This is a feature because it adds SDF (Semantic Definition Format) support for describing proplet data and interactions.

What does this do?

Introduces a new pkg/sdf package that implements the Semantic Definition Format (SDF) for describing proplet data and interactions as standardized Thing descriptions.

  • Adds pkg/sdf with Document and affordance types (PropertyAfford, ActionAfford, EventAfford, ObjectAfford, ThingAfford, DataAfford) following the SDF spec
  • Adds PropletDocument(p proplet.Proplet) sdf.Document which builds a full SDF Thing description for a proplet, including properties (id, name, alive, task_count, metadata), actions (start_task, stop_task), events (heartbeat, task_result), and data schemas (PropletMetadata, TaskDispatch, HeartbeatPayload, TaskResult)
  • Wires GetPropletSDF through the full manager stack: service interface, implementation, endpoint, HTTP transport (GET /proplets/{id}/sdf), logging/metrics/tracing middleware, and mock
  • Exposes GetPropletSDF(id string) (sdf.Document, error) on the SDK interface

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes. pkg/sdf/proplet_test.go contains table-driven tests covering:

  • Correct Info fields (title contains proplet ID, non-empty version)
  • All expected sdfProperty, sdfAction, sdfEvent, and sdfData keys on the Proplet thing
  • TaskResult.state enum completeness (Completed, Failed, Skipped, Interrupted)
  • Minimum pointer aliasing safety across DataAfford fields

Did you document any new/modified features?

The new GET /proplets/{id}/sdf endpoint and GetPropletSDF SDK method follow the existing patterns in the codebase. The SDK interface entry includes an inline usage example consistent with all other SDK methods.

Notes

The SDF document is returned as a flat JSON object (fields of sdf.Document directly at the top level), consistent with how other response types embed their domain structs. The shape matches what the SDK GetPropletSDF unmarshals.

Adds pkg/sdf with Document types and PropletDocument builder, wires
GET /proplets/{id}/sdf through the full manager stack (endpoint,
response, transport, service, middleware, mock), and exposes
GetPropletSDF on the SDK interface.
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.

Feature: Use Semantic Definition Format (SDF) for Data and Interactions of Things

1 participant