<commit_before># Ensure

## Problem

Applications want to ensure that some functionality (=global plugin)
is present in Elektra.

## Constraints

- keep notifications and highlevel API as-is

## Assumptions

## Considered Alternatives

- integrate in kdbOpen

## Decision

Keep kdbEnsure but:

- reduce for only global plugins, as the partial other functionality is confusing
  and not needed
- find solution that list plugin is not needed
- only as implementation detail below libraries (e.g. like done for notification)

## Rationale

- allows interfaces that let the user do `kdbOpen`

## Implications

- gopts needs a nice wrapper library (low-prior)

## Related Decisions

- [Global Plugins](global_plugins.md)

## Notes<commit_msg>decisions: ensure<commit_after># Ensure

## Problem

Applications want to ensure that some functionality (=global plugin)
is present in Elektra.

## Constraints

- keep notifications and highlevel API as-is

## Assumptions

## Considered Alternatives

- integrate in kdbOpen:
  + can immediately build up correct plugin positioning
  - cannot be called later easily (needs `kdbClose` and `kdbOpen` again)
  - cannot be integrated with some APIs, e.g. `kdbDup` or current notification API
- specific APIs per plugin
  - difficult for application developers
  - every plugin would need to design new APIs

## Decision

Keep `kdbEnsure` but:

- reduce for only global plugins, as the partial other functionality is confusing
  and not needed
- find solution that list plugin is not needed
- only as implementation detail below libraries (e.g. like done for notification)

## Rationale

- allows APIs (that call `kdbEnsure`) while the user still calls `kdbOpen`, like done in the notification API:
  `kdb = kdbOpen(); APIcallDoingKdbEnsure (kdb)`
  (`APIcallDoingKdbEnsure` would not be possible if the functionality would be integrated in `kdbOpen`)
- allows applications to continue even if `kdbEnsure` failed
- is already implemented
- is already used by notification and high-level library
- gopts would continue to work as is but also a nice wrapper library could be added (low-prior)

## Implications

## Related Decisions

- [Global Plugins](global_plugins.md)

## Notes
{'fraction_non_alphanumeric': 0.067420814479638, 'fraction_numerical': 0.0, 'mean_word_length': 4.366504854368932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4297135', 'n_tokens_mistral': 612, 'n_tokens_neox': 603, 'n_words': 280}