Onboarding & Scope Bootstrap
Relevant source files
The following files were used as context for generating this wiki page:
Onboarding and Scope Bootstrap within the flext-target-ldap project refers to the systematic process of initializing the LDAP target environment, validating configurations, and establishing the operational boundaries for data loading. This phase ensures that the target application adheres to the "Universal Agent Law" and the "FLEXT" ecosystem standards, focusing on a zero-debt baseline and strict technical contracts.
The bootstrap process involves parsing Singer-compatible settings, initializing Dependency Injection (DI) containers, and setting up the orchestrator required for LDAP directory loading. It establishes the "Scope" by defining which LDAP streams (Users, Groups, Organizational Units) are active and how they map to the target directory schema.
Sources: README.md:14-25, AGENTS.md:12-25, src/flext_target_ldap/api.py:73-86
Operational Core & Governance
The foundation of any task within this repository is governed by the Universal Agent Law. This law is an inviolable core of engineering conduct that applies to both human users and AI agents. It mandates a "Zero-Tolerance" approach to workarounds, "Fix-Forward-Only" version control strategies, and a strict "Stay In Scope" directive.
Universal Engineering Principles
The project adheres to several core principles during the bootstrap phase:
- SSOT (Single Source of Truth): One authoritative source per fact, failing loudly if absent.
- SOLID: Respecting object-oriented design principles, specifically preventing "God Objects."
- YAGNI (You Ain't Gonna Need It): Building only what is requested by the current task.
- DI / DIP (Dependency Inversion): Depending on abstractions and injecting collaborators.
Sources: AGENTS.md:12-45, AGENTS.md:92-105
Bootstrap Sequence
The bootstrap sequence is triggered when the FlextTargetLdap facade is initialized. It transitions the application from raw configuration to a validated, connected state.
The diagram shows the initialization flow from configuration loading to a ready state.
Sources: src/flext_target_ldap/api.py:73-95, src/flext_target_ldap/api.py:109-122
Configuration Normalization
One of the primary bootstrap tasks is the normalization of flat Singer settings into a canonical nested shape required by the flext-core and flext-ldap layers. This includes extracting connection parameters (host, port, SSL) into a specific connection sub-block.
| Setting | Type | Description |
|---|---|---|
host | String | LDAP server hostname |
base_dn | String | Base Distinguished Name for operations |
use_ssl | Boolean | Whether to use LDAPS (default: False) |
attribute_mapping | Map | Source field to LDAP attribute mapping |
Sources: src/flext_target_ldap/settings.py:30-74, src/flext_target_ldap/settings.py:126-155
Scope & Sink Resolution
Defining the scope involves determining which "Sink" class will handle incoming data streams. The bootstrap process maps Singer stream names to specific LDAP object handlers.
Sink Mapping Strategy
The target resolves the scope of a stream by looking up a specialized sink class. If no specific sink is found, it falls back to a base sink to ensure operation continues without failure, albeit with generic logic.
The diagram illustrates the inheritance hierarchy used to resolve stream-specific logic.
Sources: src/flext_target_ldap/_models/sinks.py:17-45, src/flext_target_ldap/api.py:60-71
Development Environment Setup
Onboarding for developers requires adhering to the managed pyproject.toml standards. The project uses hatchling as the build backend and defines a robust set of development dependencies for quality gates.
Quality Gate Verbs
The bootstrap process for a development session involves using the following make contract:
make check: Runs static analysis and linting.make test: Executes the test suite (unit and integration).make val: Validates the project against the zero-debt baseline.make docs: Generates technical documentation.
Sources: README.md:37-41, pyproject.toml:1-15, pyproject.toml:44-60
Conclusion
Onboarding & Scope Bootstrap in flext-target-ldap serves as the critical bridge between raw input and managed LDAP operations. By enforcing strict normalization, validating configurations against Pydantic models, and utilizing a hierarchical sink resolution system, the project ensures that data loading occurs within a well-defined, predictable scope while adhering to the rigorous engineering standards of the FLEXT ecosystem.