Skip to content

Conversation

@hughtroeger
Copy link
Contributor

@hughtroeger hughtroeger commented Sep 16, 2025

This adds an experimental optional classification field to the instrument context. For use in categorizing different types of financial instruments.

Fixes #1615

Describe your change

Related Issue

Contributor License Agreement

  • I acknowledge that a contributor license agreement is required and that I have one in place or will seek to put one in place ASAP.

Review Checklist

  • Issue: If a change was made to the FDC3 Standard, was an issue linked above?
  • CHANGELOG: Is a CHANGELOG.md entry included?
  • API changes: Does this PR include changes to any of the FDC3 APIs (DesktopAgent, Channel, PrivateChannel, Listener, Bridging)?
    • Docs & Sources: If yes, were both documentation (/docs) and sources updated?

      JSDoc comments on interfaces and types should be matched to the main documentation in /docs
    • Conformance tests: If yes, are conformance test definitions (/toolbox/fdc3-conformance) still correct and complete?

      Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined
    • Schemas: If yes, were changes applied to the Bridging and FDC3 for Web protocol schemas?

      The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other
      • If yes, was code generation (npm run build) run and the results checked in?

        Generated code will be found at /src/api/BrowserTypes.ts and/or /src/bridging/BridgingTypes.ts
  • Context types: Were new Context type schemas created or modified in this PR?
    • Were the field type conventions adhered to?
    • Was the BaseContext schema applied via allOf (as it is in existing types)?
    • Was a title and description provided for all properties defined in the schema?
    • Was at least one example provided?
    • Was code generation (npm run build) run and the results checked in?

      Generated code will be found at /src/context/ContextTypes.ts
  • Intents: Were new Intents created in this PR?

@hughtroeger hughtroeger requested a review from a team as a code owner September 16, 2025 20:35
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 16, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@netlify
Copy link

netlify bot commented Sep 16, 2025

Deploy Preview for fdc3 ready!

Name Link
🔨 Latest commit e4e2024
🔍 Latest deploy log https://app.netlify.com/projects/fdc3/deploys/69398b09249c4e0008a88d00
😎 Deploy Preview https://deploy-preview-1665.preview-fdc3.finos.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

544 passed

@github-actions
Copy link

github-actions bot commented Sep 16, 2025

Coverage Report

Commit: e4e2024
Base: main@ab4e2ba

Type Base This PR
Total Statements Coverage  97.16%  97.16% (+0%)
Total Branches Coverage  86%  86% (+0%)
Total Functions Coverage  96.13%  96.13% (+0%)
Total Lines Coverage  97.32%  97.32% (+0%)
Details (changed files)
FileStatementsBranchesFunctionsLines
Details (all files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 62.5% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 88% 50% 100% 88%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 78.94% 77.77% 71.42% 78.94%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 98.71% 100% 94.44% 100%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 97.5% 66.66% 100% 97.5%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 100% 60% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 90% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 77.77% 100% 100%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 93.33% 72.72% 100% 93.33%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 94.59% 100% 80% 94.59%
packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts 100% 94.11% 100% 100%
packages/fdc3-agent-proxy/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/index.ts 100% 100% 28.57% 100%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 97.43% 86.66% 100% 97.43%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 97.36% 89.47% 100% 97.36%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 77.77% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 76.47% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 94% 81.25% 100% 94%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 95.65% 73.33% 100% 95.65%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.48% 86.95% 100% 98.46%
packages/fdc3-get-agent/src/strategies/Timeouts.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 97.14% 71.42% 100% 97.01%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 75% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-get-agent/src/ui/NullChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/NullIntentResolver.ts 100% 100% 66.66% 100%
packages/fdc3-get-agent/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/util/Uuid.ts 100% 100% 100% 100%
packages/fdc3-standard/src/index.ts 91.3% 70.83% 60% 95%
packages/fdc3-standard/src/api/AppIdentifier.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppIntent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/AppMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Channel.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/ContextMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/DesktopAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/DisplayMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Errors.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Events.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Icon.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Image.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/ImplementationMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/IntentMetadata.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/IntentResolution.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Listener.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.18% 84.28% 96.29% 95.23%
packages/fdc3-standard/src/api/PrivateChannel.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Types.ts 100% 100% 100% 100%
packages/fdc3-standard/src/context/ContextType.ts 100% 100% 100% 100%
packages/fdc3-standard/src/intents/Intents.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/typeHelpers.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/ChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/Connectable.ts 100% 100% 100% 100%
packages/fdc3-standard/src/ui/IntentResolver.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 96.87% 84.21% 100% 96.55%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 96.38% 86.41% 100% 96.12%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 88.23% 71.87% 86.66% 90%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 98.08% 91.66% 100% 97.82%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 97.14% 86.84% 100% 97.14%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%

@hughtroeger hughtroeger force-pushed the instrument-classification branch from 9683c0b to c67cc8e Compare September 17, 2025 20:27
Comment on lines 670 to 672
* @experimental classification of the instrument by type or category. SHOULD be one of the
* standardized values, although other string values are permitted.
*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like something may have gone wrong with the generation here? I'm not sure why this was added in so many places and seems to be associated with interactionType

Copy link
Contributor

Choose a reason for hiding this comment

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

I think its been merged with interactionType by quick type as they are both reducing to string.

However, I'm also really confused as to why we're getting multiple /** */ comment blocks with no type code under them... The two things maybe related - perhaps its just not able/willing to generate a type representing just a string but is still outputting the comment??

We should check if this is happening in the initial generation or the post-processing @Roaders developed to apply to it - I suspect in the generation. Its already going on prior to your PR (as your comments are getting added to existing orphaned blocks) @hughtroeger, but I think is something we need to investigate!

Copy link
Contributor

Choose a reason for hiding this comment

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

If you look down at the end of the file it seems to think its created types and refers to them, e.g. PurpleInstrumentClassification, TentacledInstrumentClassification etc., but I don't seem them actually created!

Copy link
Contributor

Choose a reason for hiding this comment

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

post-processing I mentioned doesn't run on the content types, so issue is definitely in the generation

Copy link
Contributor

Choose a reason for hiding this comment

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

I had a poke at whether there is a simple resolution (e.g. adding a title can sometimes help) but without any success. If QuickType was more willing to replicate the structure of the schemas exactly I think we'd be much happier with its output - but without working on quicktype directly (which is not easy!) I think our best option might be to simplify and remove enums and comments on strings and just have the values in the description fields for now (will at least make it into typedocs). It will not make any different to the results of schema validation nor type checks (as it all reduces to string)

I've raised #1667 to demonstrate what that cleans up in the generated code. It doesn't fix the descriptions however.

WDYT @hughtroeger

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fine with me @kriswest, I will update this PR to just use type string with the values in the description field.

@github-actions
Copy link

544 passed

@github-actions
Copy link

544 passed

1 similar comment
@github-actions
Copy link

544 passed

Comment on lines 174 to 202
<details>
<summary><code>classification</code></summary>

**Any of:**

- **type**: `string` with values:
- `commodity`,
- `commodityIndex`,
- `corporateDebt`,
- `creditDefaultSwapIndex`,
- `deal`,
- `debt`,
- `debtIndex`,
- `etf`,
- `fixedIncome`,
- `future`,
- `governmentBenchmarkDebt`,
- `loan`,
- `mortgageBackedSecurity`,
- `municipalDebt`,
- `mutualFund`,
- `mutualFundIndex`,
- `option`,
- `otherDebt`,
- `ownershipPrivateCompany`,
- `pevcFirm`,
- `pevcFund`,
- `privateCompany`,
- `publicCompany`,
- `publicCompanyIndex`,
- `sovereignDebt`,
- `structuredProduct`,
- `unknown`
- **type**: `string`

[@experimental](/docs/fdc3-compliance#experimental-features) classification of the instrument by type or category. SHOULD be one of the standardized values, although other string values are permitted.

</details>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kriswest it seems like this file is generated from the schemas by the docs build. I'm assuming I should remove the changes I made manually?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, its best left to the generator (which will overwrite it when preparing the website). You should cd website; npm run start at least once, which will generate the file and let you proof it locally then check in the generated result.

Our review checklist should really be covering that and isn't. I'll knock up a quick adjustment to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I pushed the generated files.

@github-actions
Copy link

544 passed

2 similar comments
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

544 passed

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

544 passed

@hughtroeger hughtroeger force-pushed the instrument-classification branch from e56a548 to c626d52 Compare October 7, 2025 18:23
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

544 passed

@kriswest
Copy link
Contributor

kriswest commented Oct 9, 2025

As we've moved to an object type rather than a single field, the enum could come back - certainly for FDS_TYPE, but also for name. If someone wanted to use a different set they can give the set a name and use whatever they like... Just thinking out loud

@kriswest
Copy link
Contributor

kriswest commented Nov 6, 2025

I'm not entirely happy with how the intrument classificaiton is being combined with the organisation classification in the generated Browser types. Looking at why they are getting combined.

1 similar comment
@kriswest
Copy link
Contributor

kriswest commented Nov 6, 2025

I'm not entirely happy with how the intrument classificaiton is being combined with the organisation classification in the generated Browser types. Looking at why they are getting combined.

@hughtroeger hughtroeger force-pushed the instrument-classification branch from c626d52 to 1e3e1f8 Compare November 6, 2025 16:30
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

544 passed

@hughtroeger
Copy link
Contributor Author

@kriswest I added the enum for FDS_TYPE. I wasn't sure if we wanted to add it in for the generic name field since we had intended that to be more extensible.


**type**: `string`

classification of the instrument by type or category. SHOULD be one of the following values, although other string values are permitted: '`commodity`', '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
classification of the instrument by type or category. SHOULD be one of the following values, although other string values are permitted: '`commodity`', '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
Optional human-readable classification, to be used if no specific data classification is available.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is more in line with how we describe name in other objects. It's specifically not an id...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @openfin-johans, just to confirm, you think we should leave out the enumerated recommended values here? Because those are more appropriate with the other sub fields like FDS_TYPE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@openfin-johans I've updated the files with your suggestion.

@hughtroeger hughtroeger force-pushed the instrument-classification branch from 74c0667 to e4e2024 Compare December 10, 2025 15:00
@github-actions
Copy link

544 passed

1 similar comment
@github-actions
Copy link

544 passed

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.

Classification field to refine 'type' for contexts

4 participants