Skip to content

Commit 3e92065

Browse files
committed
Adding Context metadata details to Context and API specs
1 parent 107130a commit 3e92065

2 files changed

Lines changed: 57 additions & 28 deletions

File tree

website/docs/api/spec.md

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ An FDC3 Standard compliant Desktop Agent implementation **MUST**:
122122
- Provide details of whether they implement optional features of the Desktop Agent API in the `optionalFeatures` property of the [`ImplementationMetadata`](ref/Metadata#implementationmetadata) object returned by the [`fdc3.getInfo()`](ref/DesktopAgent#getinfo) function.
123123
- Allow, by default, at least a 15 second timeout for an application, launched via [`fdc3.open`](../api/ref/DesktopAgent#open), [`fdc3.raiseIntent`](../api/ref/DesktopAgent#raiseintent) or [`fdc3.raiseIntentForContext`](../api/ref/DesktopAgent#raiseintentforcontext) to add any context listener (via [`fdc3.addContextListener`](../api/ref/DesktopAgent#addcontextlistener)) or intent listener (via [`fdc3.addIntentListener`](../api/ref/DesktopAgent#addintentlistener)) necessary to deliver context or intent and context to it on launch. This timeout only applies to listeners needed to receive context on launch; further intent and context listeners not required on launch MAY be added later.
124124
- For web applications: All public methods of FDC3 interface objects (e.g. `DesktopAgent`, `Channel`, `PrivateChannel`, `IntentResolution`) **MUST** be bound to their respective instances (e.g. using `.bind(this)` in constructors) to support correct behavior when methods are destructured in JavaScript. See [DesktopAgentProxy implementation](../../FDC3/packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts) for a reference.
125+
- Make metadata about each context message or intent and context message received (including the app that originated the message and any supported metadata provided by that application) available to the receiving application.
125126

126127
An FDC3 Standard compliant Desktop Agent implementation **SHOULD**:
127128

@@ -130,7 +131,6 @@ An FDC3 Standard compliant Desktop Agent implementation **SHOULD**:
130131
- Allow applications to register an [`IntentHandler`](ref/Types#intenthandler) for particular Intent and Context type pairs by providing `interop.intents.listensFor` metadata in their AppD record.
131132
- Adopt the [recommended set of User channel definitions](#recommended-user-channel-set).
132133
- Ensure that context messages broadcast by an application on a channel are not delivered back to that same application if they are joined to the channel.
133-
- Make metadata about each context message or intent and context message received (including the app that originated the message) available to the receiving application.
134134
- Prevent external apps from listening or publishing on a [`PrivateChannel`](ref/PrivateChannel) that they did not request or provide.
135135
- Enforce compliance with the expected behavior of intents (where Intents specify a contract that is enforceable by schema, for example, return object types) and return an error if the interface is not met.
136136

@@ -247,6 +247,10 @@ If no exact match is found then a fully-qualified `appId` provided should be spl
247247

248248
The matching of an unqualified `appId` value against a set of fully-qualified appIds may result in multiple matches. In such cases, Desktop Agents SHOULD attempt additional resolution via any suitable procedure. For API calls such as [`raiseIntent`](./ref/DesktopAgent#raiseintent) or [`raiseIntentForContext`](./ref/DesktopAgent#raiseintentforcontext) Desktop Agents SHOULD use the same approach as they do for resolving ambiguous intents, for example by displaying an Intent Resolver UI and allowing the user to select the desired application. Alternatively, Desktop Agents MAY apply an alternative procedure such as selecting the first matching `appId` or, in the case of `findInstances`, by returning results for all matching fully-qualified `appId` values. Each of the API calls accepting an [`AppIdentifier`](ref/Types#appidentifier) as input, returns details of the `appId` in its results (i.e. [`AppIdentifier`](ref/Types#appidentifier), [`AppMetadata`](ref/Metadata#appmetadata), [IntentResolution](ref/Metadata#intentresolution)), where the fully-qualified appId matched MUST be used.
249249

250+
### Receive metadata about a Broadcast or Raised Intent
251+
252+
Applications often need both the business data (Context) and delivery-related information (ContextMetadata) such as origin, timestamp, or trace identifiers. To keep Context definitions clean and focused on data, FDC3 delivers metadata separately. Handlers receive two arguments: Context and ContextMetadata, enabling apps to process data and optionally use metadata for provenance, security, or correlation. See the [Context Overview](../context/spec#context-metadata) for more details on the separation of COntext and Context Metadata.
253+
250254
## Raising Intents
251255

252256
Raising an Intent is a method for an application to request functionality from another application and, if desired, defer the discovery and launching of the destination app to the Desktop Agent.
@@ -552,7 +556,7 @@ A single handler can be added for each specific intent. If the application attem
552556

553557
### Metadata
554558

555-
See [[#Context_Metadata]]
559+
See [Context Metadata](#context-metadata).
556560

557561
### Compliance with Intent Standards
558562

@@ -861,28 +865,38 @@ Channel interface provides the ability to [`clearContext`](ref/Channel.md#clearc
861865

862866
### Metadata
863867

864-
See [[#Context_Metadata]]
868+
See [Context Metadata](#context-metadata).
865869

866870
## Context Metadata
867871

868-
Optional metadata about each context or intent message received SHOULD be provided by the desktop agent implementation to registered intent handlers. As this metadata is optional, apps making use of it MUST handle cases where it is not provided.
872+
FDC3 separates **Context** (business data) from **ContextMetadata** (delivery and provenance information) to maintain clarity and interoperability. Metadata is optional and SHOULD be provided by the Desktop Agent to registered listeners, but apps MUST handle cases where it is absent.
873+
874+
For the rationale for separating `Context` and `ContextMetadata`, see the [Context Specification](../context/spec#context-metadata).
875+
876+
### Metadata properties
877+
878+
Registered listeners MUST receive:
869879

870-
Registered listeners SHOULD receive the following properties:
871-
* traceId
872-
* timestamp
873-
* source
880+
* `timestamp` – Indicates when the message was delivered.
881+
* `source` – Identifies the originating app (`AppIdentifier`).
874882

875-
Registered listeners MAY receive the following properties:
876-
* custom
877-
<!-- * signature -->
883+
Registered listeners MAY receive:
878884

879-
### Trace information
885+
* `traceId` – Correlates related actions and messages.
886+
* `custom` – Implementation-specific metadata.
880887

881-
The Desktop Agent SHOULD provide a `traceId` to intent handlers. If the originating app provides `traceId` information, the Desktop Agent SHOULD use provide the `traceId` from the app. If the originating app does not provide `traceId` information, the Desktop Agent SHOULD generate a uuid.,
888+
<!-- TODO insert security/signature field names here -->
882889

883-
If an app receives a context (from a broadcast or raised intent), and then performs an action *as a result of*, the app MAY forward the `traceId`. The Desktop Agent MAY collect the use of trace information and timestamp information for observability features.
890+
### Trace Information
884891

885-
Here is example code run by an app. It listens for Contact information to be broadcast. Once that Contact information is received, it starts a call to that Contact. Since the app is placing an action *as a result of* another FDC3 action, the app passes along the received traceId.
892+
The Desktop Agent MAY provide a `traceId` to intent handlers.
893+
894+
* If the originating app provides a `traceId`, the Desktop Agent MUST forward it.
895+
* If not, the Desktop Agent MAY generate a UUID.
896+
897+
Apps MAY propagate `traceId` when performing actions as a result of another FDC3 action. This supports observability and correlation across workflows.
898+
899+
**Example:**
886900

887901
```js
888902
fdc3.addIntentListener("ViewContact", (contactContext, metadata) => {
@@ -891,33 +905,32 @@ fdc3.addIntentListener("ViewContact", (contactContext, metadata) => {
891905
{
892906
type: "fdc3.contact",
893907
name: "Jane Doe",
894-
id: {
895-
email: 'jane@mail.com'
896-
}
908+
id: { email: 'jane@mail.com' }
897909
}
898910
899911
Received metadata:
900912
{
901913
traceId: generated uuid,
902-
source: {...}
914+
source: {...},
903915
timestamp: ...
904916
}
905917
*/
906918

907-
fdc3.raiseIntent("Start Call", contactContext, {
908-
traceId: metadata.traceId
909-
})
910-
})
919+
// Forward traceId when raising a related intent
920+
fdc3.raiseIntent("StartCall", contactContext, {
921+
traceId: metadata.traceId
922+
});
923+
});
911924
```
912925

913926
### Timestamp
914927

915-
The Desktop Agent MAY provide timestamp information to intent handlers.
916-
917-
Apps SHOULD NOT provide timestamp information. If an app provides a timestamp, the Desktop Agent MUST ignore the timestamp.
928+
The Desktop Agent MUST provide timestamp information.
929+
Apps SHOULD NOT provide timestamps; if they do, the Desktop Agent MUST ignore them.
918930

919931
### Source
920932

921-
The Desktop Agent MAY provide source information to intent handlers. If the source information is provided, it MUST be in the form of an [[AppIdentifier]].
933+
The Desktop Agent MUST provide source information in the form of an `AppIdentifier`.
934+
Apps SHOULD NOT provide source; if they do, the Desktop Agent MUST ignore it.
922935

923-
Apps SHOULD NOT provide source information. If an app provides a source, the Desktop Agent MUST ignore it.
936+
<!-- TODO insert security/signature field overviews here -->

website/docs/context/spec.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,22 @@ E.g. `"CURRENCY_ISOCODE": "GBP"`
232232
ISO 4217 only includes major currency codes, conversions to minor currencies is the responsibility of the consuming system (where required).
233233
:::
234234

235+
### Context Metadata
236+
237+
FDC3 Context is intended to provide a common _data_ format that is used for messaging between applications. Context object definitions should avoid including fields that represent metadata.
238+
239+
Metadata such as the originating application, timestamps, digital signatures, or trace identifiers are important for routing, auditing, and linking related interactions, but they do not form part of the business data that the Context represents. Mixing metadata with core data can lead to ambiguity, increase complexity for developers, and reduce interoperability between implementations.
240+
241+
To maintain clarity and consistency, FDC3 separates metadata from Context objects. This ensures that:
242+
243+
- Context remains focused on the business data being shared, making it easier to define, validate, and reuse across different workflows.
244+
- Metadata can evolve independently to support advanced features such as provenance, security, and correlation without impacting the core data model.
245+
- Handlers receive both `Context` and `ContextMetadata` explicitly, allowing applications to process data and metadata according to their respective concerns.
246+
247+
This separation provides a cleaner architecture, improves interoperability, and supports future enhancements without breaking existing Context definitions.
248+
249+
For more details on `ContextMetadata` please see the [FDC3 API overview](../api/spec#receive-metadata-about-a-broadcast-or-raised-intent) and [`ContextMetadata` reference](../api/ref/Metadata#contextmetadata).
250+
235251
## Context Data Standard Compliance
236252

237253
An FDC3 Standard compliant application that supports the use of context data **MUST**:

0 commit comments

Comments
 (0)