# Role & Objective You are a senior systems architect, C++/Qt desktop engineer, Astra Linux and ALD Pro administrator, Windows infrastructure engineer, and migration verification engineer. Build **ALD Transition Console**, a Russian-language desktop application that runs on the Astra Linux machine that is, or will become, an ALD Pro domain controller. It assists with discovery, supported initial deployment, Microsoft Active Directory migration, operational configuration, policy management, and subsequent hardening. This is an operational administration application. Implement real supported integrations and explicit, useful workflows for capabilities that cannot be automated. Do not produce a decorative dashboard with simulated success states. The owner's agreed requirements are: 1. Target ALD Pro **3.1.0** and the Astra Linux SE **1.7.x** family, using an explicit tested compatibility matrix. 2. Preserve the domain name **corp.local** and the existing IP network. Do not substitute a differently named target domain or require a different subnet as an unapproved workaround. 3. Ultimately remove Microsoft AD. The intended user experience preserves existing logins, passwords, profiles, data, permissions, application access, and policy outcomes. Treat these as separate acceptance requirements, not as an assumed consequence of copying directory objects. 4. Inventory and migrate everything for which a supported, verified migration path exists. Every other discovered dependency must remain visible with its impact and unresolved status. 5. Support Windows 10, Windows Server 2019, and Windows Server 2025 as explicitly versioned source/managed-host targets. Management connectivity, directory migration, and Windows domain integration are separate capabilities. 6. The initial laboratory has one AD forest, one AD domain, and one AD DC. It also needs the Astra target and suitable test clients. Do not assume a second source DC exists. 7. A planned interruption is acceptable only after its scope and recovery plan are shown and the operator authorizes that particular change window. 8. Deliver initial deployment and migration first. Deliver general configuration and policies next, then hardening. 9. The application and its temporary executor run on the ALD node. When the operator finishes and closes the application, its own processes stop. Existing domain services and persistent client settings continue. 10. Prefer vendor-supported/native tools. Explain prerequisite access changes and how to restore them, so temporary administrative access is not accidentally left open. 11. Internet access is optional. Explain precisely which operations are unavailable without internet or local installation media. 12. The operator selects the batch error policy. Final validation is an instructional checklist with explicit human checkmarks and separately recorded automatic evidence. 13. Use the **dedsec-motion** skill's visual language, adapted for a readable administration interface. ## Non-negotiable feasibility rule The requested end state is an objective, not an established product capability. Do not claim that ALD Pro 3.1.0 is an AD DS replica, that it can receive FSMO roles, or that reusing corp.local preserves domain identity, SIDs, computer trust, Windows profiles, or GPO behavior. Before allowing a migration plan to change production state, establish a documented, version-specific path for the same-name transition and all mandatory retained behavior. If a mandatory path is unsupported or unverified, return a **blocked migration plan**, explain the exact dependency, and continue building useful discovery, planning, configuration, and checklist functionality. Do not silently weaken the owner's requirements. Do not implement an unsupported replacement protocol to make the UI appear complete. No undocumented feature, placeholder integration, successful process exit, or manual checkbox may satisfy this feasibility gate. A deliberate change to the owner's target requirements creates a new version of the plan; it is not an ordinary exception checkbox. # Constraints & Tech Stack ## Desktop and runtime Use the following stack: | Layer | Required choice | |---|---| | Application language | C++17 | | GUI framework | Qt 5.15, using the Qt 5.15.2 API baseline and compatible Astra-maintained package revisions | | Qt modules | Core, Gui, Widgets, Network, Sql; Test for tests | | Build system | CMake, minimum language version 3.13; pin the actual tested build-tool package revision | | Local state | SQLite through Qt SQL, transactions, explicit schema migrations, no database server | | Data interchange | UTF-8 JSON, schema version 1, explicit validation of required fields and enums | | Linux/native execution | QProcess with executable and argument arrays; no interpolated shell command strings | | Default remote transport | System OpenSSH client, when supported and explicitly prepared on the target | | Windows execution | Fixed, reviewed native PowerShell tasks over OpenSSH command execution; Windows PowerShell 5.1-compatible syntax | | Additional transport | Optional WinRM adapter only through a verified existing implementation with locked dependencies; do not invent a WinRM implementation | | Packaging | Debian package built against the supported Astra baseline; no installation-time execution of migration or hardening | | Interface language | Russian; developer documentation and identifiers in English | | Distribution mode | Local desktop application; no mandatory web server, browser, cloud backend, or telemetry | Do not replace this with Electron, Qt WebEngine, a React application, Kubernetes, AWX, or an always-on Astra Automation Controller. Do not install Node.js, Chromium, ffmpeg, or the motion-rendering toolchain on the domain controller for decorative effects. Qt 5.15 packages appear in Astra's published package information, but the exact package revisions for the target installation must still be inspected. Before producing a deployable package, create `docs/compatibility-lock.json` containing the actual OS release/update, kernel, architecture, compiler, CMake, Qt package revisions, SQLite driver, transport executables, and ALD packages used in validation. Never put an invented package revision or digest in that file. Use **ALD Pro 3.1.0 + ALSE 1.7.7 UU2**, with the kernel and protection level required by the matching vendor installation procedure, as the first laboratory baseline. The vendor course uses 6.1-generic and Smolensk for that example. This does not prove support for every ALSE 1.7.x release. Separate: - ability to run the GUI; - support for installing/running the ALD controller; - support for managing a client; - support for each migration and hardening action. Never upgrade Astra, ALD Pro, the system Python, Qt, or security components automatically to satisfy this application's dependencies. Do not treat dependency isolation as proof of vendor support for additional software on a DC. Identify that deployment constraint explicitly in the compatibility report. Windows transport discovery must record OS edition, build, role, PowerShell version, and available optional features. Microsoft's in-box OpenSSH guidance covers Windows 10 build 1809 and later and Server 2019 onward; verify the actual feature and servicing prerequisites on each machine. This is not evidence that ALD Pro 3.1.0 supports every Windows domain-integration scenario. Use native OpenSSH command execution to launch Windows PowerShell tasks. Do not confuse that with the PowerShell SSH-remoting subsystem, whose prerequisites differ. Do not globally change the Windows default shell unless the validated adapter requires it and the change is recorded for restoration. ## Privilege and lifecycle constraints The GUI is not a root process. Use a small, temporary, separately authorized native executor for allowlisted operations that genuinely need elevated privileges. Validate peer identity, operation IDs, typed parameters, target binding, and plan authorization at the privilege boundary. A user-editable rule file must never grant arbitrary root execution. Do not create an always-on service, cron entry, persistent OS timer, Windows scheduled task, or custom persistent agent. Ordinary in-process Qt timers are allowed while the application is running. Use per-session private IPC; do not expose an application listening port on the LAN. Avoid `startDetached` for operations owned by the application. Installed application files and protected logs remain between sessions. Passwords and private credentials do not belong in the project database, command arguments, process environment dumps, logs, screenshots, or exported checklists. Where persistent secrets are operationally unavoidable, use an explicitly selected native credential mechanism and document its lifetime; do not implement custom cryptography. The prompt author has not authorized changes to any real infrastructure. Build and test locally. Real infrastructure mutation requires the operator's explicit approval of a concrete plan inside the application or an explicit instruction in the development session. # SECTION 1: ASSETS & DATA ## 1.1 Existing project material The current project root is `/home/scandalist/ALD_pro`. Read these if present: - `ALD-PRO-GUI-ARCHITECTURE.md`; - `ALD-PRO-GUI-FSTEC-REQUIREMENTS.md`; - `MS-AD-LAB-MANUAL.md`; - `ald-pro-deploy-migrate/SKILL.md` and its referenced research; - `research/module02.md` and `research/module03-migration.md`. These are research and design inputs, not proof that a command is valid for ALD Pro 3.1.0. Several research documents discuss newer product versions. Never copy a 3.2/3.3-only command or capability into the 3.1 adapter without independent 3.1 evidence. If earlier design notes conflict with this prompt, use the owner's latest requirements represented here. In particular, temporary application-created access must have an explicit restoration workflow; an existing unrelated SSH or WinRM deployment must be preserved. ## 1.2 Source catalog Create a versioned source catalog. The following are exact starting URLs, not permission to scrape an entire domain or infer unpublished APIs: | Source ID | URL | Intended use | |---|---|---| | ALD31_ROOT | [ALD 3.1 documentation](https://www.aldpro.ru/materials/3.1.0/) | Find the documentation matching the installed delivery | | ALD_DEPLOY_COURSE | [Deployment course](https://www.aldpro.ru/professional/ALD_Pro_Module_02/ALD_Pro_deployment.html) | Deployment explanation and initial laboratory baseline | | ALD_DIRECTORY_COURSE | [Directory course](https://www.aldpro.ru/professional/ALD_Pro_Module_04/ALD_directory_services.html) | Directory concepts and documented administration | | ALD_POLICIES_COURSE | [Policy course](https://www.aldpro.ru/professional/ALD_Pro_Module_06b/ALD_Pro_group_policy.html) | Policy lifecycle and diagnostic concepts | | ALD_MIGRATION_COURSE | [Migration course](https://www.aldpro.ru/professional/ALD_Pro_Module_09/ALD_Pro_migration_hybrid_deployment.html) | Migration scenarios and application dependencies | | ALD_BACKUP_COURSE | [Backup course](https://www.aldpro.ru/professional/ALD_Pro_Module_10/ALD_Pro_backup.html) | Backup and recovery research | | FSTEC_LINUX_2022 | [Original publication](https://fstec.ru/dokumenty/vse-dokumenty/spetsialnye-normativnye-dokumenty/metodicheskij-dokument-ot-25-dekabrya-2022-g) | Original Linux hardening recommendations | | FSTEC_TEXT_MIRROR | [Text reproduction](https://legalacts.ru/doc/metodicheskii-dokument-rekomendatsii-po-bezopasnoi-nastroike-operatsionnykh-sistem-linux/) | Provisional text reproduction, not a verified original artifact | | ASTRA_HARDENING | [Role documentation](https://docs.astra-automation.ru/2.1/solutions/protection/fstec/) | Optional role research, not an ALSE 1.7 compatibility guarantee | | ASTRA_ROLE_INTRODUCTION | [Role release notes](https://docs.astra-automation.ru/1.2/releases/release-1.2/upd2/) | Original role scope and preview status | | ASTRA_QT_PACKAGES | [Astra package information](https://wiki.astralinux.ru/spaces/flyingpdf/pdfpageexport.action?pageId=153490669) | Evidence of the Qt 5.15 package family, not the current target package lock | | MS_OPENSSH | [Native OpenSSH guidance](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse) | Native Windows transport prerequisites | | MS_SCT | [Security Compliance Toolkit](https://learn.microsoft.com/en-us/windows/security/operating-system-security/device-management/windows-security-configuration-framework/security-compliance-toolkit-10) | LGPO and policy comparison tools | | MS_SID | [Security identifiers](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers) | Identity and ACL semantics | | QT_PROCESS | [Qt QProcess](https://doc.qt.io/archives/qt-5.15/qprocess.html) | Process execution API; use only APIs available in the selected baseline | | KERNEL_YAMA | [Kernel Yama documentation](https://docs.kernel.org/admin-guide/LSM/Yama.html) | Example of a setting with restricted runtime reversibility | The original FSTEC page could not be fetched during specification research. Record the original artifact hash as `null`, with verification state `pending_original`. Never manufacture a hash, publication status, or claim that an inaccessible page was reviewed. For each source store `id`, `url`, `title`, `product_version`, `section`, `retrieved_at`, `artifact_sha256`, `verification_state`, and `notes`. Retrieval time is not publication time. Course pages are mutable; freeze the relevant evidence for a released adapter. Download software only from the approved vendor distribution channel. Resolve release assets, versions, signatures, and digests before use. Do not use `latest` release URLs, unsigned arbitrary binaries, or `curl | sh` installation patterns. ## 1.3 Visual assets Use the installed skill at `/home/scandalist/.codex/skills/dedsec-motion/SKILL.md`. Read its `references/style-bible.md` and relevant interface guidance. When the path is absent, discover the installed skill; the complete visual specification below is still sufficient to implement the application without the skill runtime. Create original decorative geometry with QPainter: 4-pixel stepped corners, short diagonal torn-label edges, simple pixel node/network motifs, and a four-tile application mark. No 3D is required. Do not import Ubisoft/Watch Dogs logos or restricted fan-kit stickers into this administration product. Use system DejaVu Sans for functional text and DejaVu Sans Mono for logs. Optional Onest and JetBrains Mono are permitted only when their real font files, Cyrillic coverage, redistribution licenses, versions, and hashes have been checked and bundled. No runtime font CDN. Fall back deterministically to the system fonts. No network-downloaded images are required. Native task payloads, schemas, icons, and checklists are application assets with an installed manifest and integrity checks. ## 1.4 Data model Use explicit C++ domain types and validated JSON representations. Create schema files before UI forms. At minimum implement: | Entity | Required fields | |---|---| | Project | id, schema_version, target_domain, source_domain, desired_outcomes, lab_mode, created_at, updated_at, version | | Host | id, fqdn, addresses, os_family, os_release, os_build, kernel, architecture, detected_roles, observed_at, evidence_ids | | Capability | id, operation, supported_versions, state, evidence_ids, limitations, manual_alternative | | InventoryObject | source_system_id, object_guid, sid, dn, object_type, attributes, memberships, observed_at | | IdentityMapping | source_guid, source_sid, source_dn, target_id, target_sid, target_uid_gid, mapping_method, verification_state | | MigrationItem | id, category, source_ref, target_ref, disposition, dependencies, acceptance_ids, blockers, evidence_ids | | Plan | id, revision, inventory_digest, policy_digest, affected_hosts, graph, error_policy, downtime, authorization_state | | Operation | id, adapter_id, adapter_version, target_id, typed_parameters, preconditions, effects, cancellation_class, recovery_class, postconditions | | Run | id, plan_id, plan_revision, state, started_at, finished_at, per_host_results, cleanup_state | | AccessChange | id, run_id, target_id, resource_type, resource_id, previous_state, applied_state, owner_marker, restoration_steps, verification_state | | PolicyProfile | id, revision, os_constraints, role_constraints, settings, management_owner, exceptions, source_refs | | ChecklistItem | id, phase, title_ru, purpose_ru, host_scope, prerequisites, steps_ru, expected_result_ru, failure_guidance_ru, evidence_ids | | ChecklistObservation | item_id, host_id, result, checked_by, checked_at, method, note, plan_revision, profile_revision | | LogEvent | sequence, timestamp_utc, run_id, host_id, operation_id, severity, stream, message_ru, redacted_detail, source_ref | Use stable source GUID/SID mappings. Never merge identities by display name, transliterated name, or login alone. Preserve unmapped attributes in inventory without assuming they can be applied to ALD. Allow unknown attributes in imported inventories as data, but reject unknown executable operation IDs and parameters. Validate lengths, nesting depth, file size, object counts, UUIDs, addresses, FQDNs, DN serialization, paths, and enums. Use explicit Unicode handling; do not silently alter usernames. Keep applicability, support, run status, and compliance as independent fields: ```text CapabilityState = VERIFIED | DOCUMENTED_NOT_TESTED | UNKNOWN | UNSUPPORTED Applicability = APPLICABLE | NOT_APPLICABLE_WITH_REASON | UNKNOWN ObservationResult = PASS | FAIL | PARTIAL | NOT_CHECKED | ERROR | STALE RunState = DRAFT | PREFLIGHT | BLOCKED | READY | RUNNING | PAUSE_REQUESTED | PAUSED | STOP_REQUESTED | VERIFYING | CLEANUP | COMPLETED | COMPLETED_WITH_GAPS | FAILED | RECOVERY_REQUIRED Disposition = AUTOMATED_NATIVE | GUIDED_NATIVE | MANUAL_RECONFIGURATION | UNSUPPORTED | UNKNOWN ``` A waiver is a separate record with scope, owner, reason, and review date. It never changes FAIL into PASS or overrides a mandatory unsupported migration capability. ## 1.5 Demonstration data Provide an explicitly selected offline demo mode, never an automatic substitute for a failed live connection. Use reserved documentation addresses such as `192.0.2.10` and `192.0.2.20`; never default live execution to them. Include synthetic corp.local examples corresponding to the existing manual lab guide when available: an ALD-LAB OU, ordinary/privileged/disabled users, nested groups, a test share, a DNS alias, a service identity, and linked/filtered/unlinked policy examples. Check the actual manual before reusing names. Provide fixtures for duplicate names, orphan SID references, an offline host, incomplete deployment, unknown Windows 2025 integration, missing media, same-name DNS conflict, and cleanup failure. Label all fixture observations as synthetic; do not present them as tested product capabilities. # SECTION 2: STYLES & LAYOUT ## 2.1 Design tokens Use a restrained DedSec/ctOS aesthetic while preserving administrative clarity: | Token | Value | |---|---| | Window background | `#0A0A0A` | | Panel background | `#141617` | | Elevated panel | `#1C1F20` | | Main text | `#F2F2EE` | | Secondary text | `#B9B9B9` | | Borders | `#454A4C` | | Primary decorative accent | `#B0E010` | | Error | `#FF5C6C` | | Warning | `#F4C95D` | | Informational status | `#70CFE8` | | Focus indicator | 2 px `#B0E010` | | Spacing scale | 4, 8, 12, 16, 24, 32 logical pixels | | Base text | 14 px; scale with user font/DPI settings | | Section title | 20 px, semibold | | Page title | 28 px, bold | | Log text | 13 px, monospaced | | Control height | Minimum 36 px | | Table row | Minimum 36 px, expanded details as needed | Semantic warning/error colors are not decorative second accents. Every status has a text label and icon, not color alone. Keep functional text antialiased and selectable; do not pixelate logs, commands, hostnames, data tables, passwords, or error instructions. Implement styling with Qt Style Sheets and QPainter, not browser CSS. Example QSS rules: ```css QMainWindow, QWidget#workspace { background: #0A0A0A; color: #F2F2EE; } QFrame[panel="true"] { background: #141617; border: 1px solid #454A4C; } QPushButton { min-height: 34px; padding: 0 14px; border: 1px solid #454A4C; } QPushButton[role="primary"] { background: #B0E010; color: #0A0A0A; border-color: #B0E010; } QPushButton:focus, QLineEdit:focus { border: 2px solid #B0E010; } QLineEdit { background: #1C1F20; color: #F2F2EE; padding: 8px; } QPlainTextEdit#logView { background: #0A0A0A; color: #F2F2EE; font-family: "DejaVu Sans Mono"; } ``` Do not rely on unsupported CSS variables, transforms, or web animation APIs in QSS. Store tokens centrally and build QSS from validated application constants. ## 2.2 Main window Design at 1440×900 logical pixels and support 1024×768 without hiding primary actions. Use a splitter-based layout and scrolling detail forms. Sidebar width: 232 px normally, collapsible. Top bar: approximately 56 px. Main content padding: 24 px. The log drawer is collapsible and resizable, initially 220 px when opened. Sidebar pages, in this order: 1. Обзор 2. Проверка окружения 3. Подготовка доступа 4. Инициализация ALD Pro 5. Миграция 6. Настройки домена 7. Политики и харденинг 8. Проверки 9. Журнал 10. Завершение и восстановление доступа The top bar shows project, actual detected node role, domain, mode (live/demo), and information freshness. Place major blockers in a persistent content banner with an explanation link. Never make a harmless decorative icon look like an error badge. Use a three-part workflow page: current facts, proposed changes, verification/recovery instructions. Advanced commands and package details belong in expandable diagnostics, not in the basic operator path. ## 2.3 Motion and accessibility Use short stepped decorative transitions of 120–180 ms on page headers or original pixel motifs. Optional startup decoration is nonblocking, no longer than 600 ms, and skippable. No audio, full-window flashing, popup storms, idle video, permanent animated backgrounds, fake terminal output, or text scrambling on real data. Provide a persistent reduced-motion switch. With reduced motion enabled, all decorative movement stops; progress information remains readable and accurate. Pause decoration during mutation, error handling, and confirmation dialogs. Render static pages without continuous redraw loops. Support keyboard navigation, visible focus, readable Cyrillic, 100/150/200% scaling, and screen-reader names for controls. Do not move focused buttons when asynchronous results arrive. Preserve selection and scroll position in tables. User data must never be used as rich text without escaping. # SECTION 3: APPLICATION SHELL, PROJECTS & FRESHNESS Implement `AppController`, `ProjectRepository`, `CapabilityRegistry`, and page controllers independent of widgets. Widgets render models and dispatch typed intents; they do not run privileged commands. On startup: ```text openProjectOrCreate() acquireSingleWriterLockForProject() loadSchemaAndMigrateDatabaseTransactionally() loadInterruptedRunsWithoutResumingThem() markPreviousObservationsStaleWhenContextChanged() loadInstalledAdaptersAndRuleManifests() probeLocalEnvironmentReadOnly() showCurrentStateAndPendingCleanup() ``` Never auto-connect to every previously known host or start changes merely because the application reopened. A refresh is explicit and cancellable. Prevent conflicting live runs from separate projects targeting the same local controller. Persist database and log data with restrictive permissions in an administrator-owned application data location. Use QStandardPaths for ordinary UI preferences, and an explicitly selected/provisioned protected project directory for infrastructure data. Do not silently use world-readable shared folders. # SECTION 4: DISCOVERY & COMPATIBILITY Classify the local node using multiple independent observations: ```text CLEAN_ASTRA ALD_PACKAGES_NOT_INITIALIZED AD_CLIENT ALD_CLIENT ALD_DC_HEALTHY ALD_DC_DEGRADED PARTIAL_OR_UNKNOWN ``` Inspect package metadata, hostname/FQDN, configured domains, service state, relevant configuration presence, and documented health indicators. An installed package or a stopped service alone does not prove a role. A degraded or partially installed controller must not be reinitialized automatically. Check OS/update/kernel/protection level against the selected ALD 3.1 delivery; resources; storage; time; resolvers; direct/reverse DNS; relevant domain discovery; trusted certificate paths; package sources; pending reboot; and package-manager locks. Probe only configured targets and required endpoints, not arbitrary subnet scans. Render each finding with actual value, expected value, evidence time, why it matters, supported fix path, and manual verification instructions. Do not present discovery results as editable text fields that directly rewrite files. Version support is per operation. A Windows 2025 host can be reachable for native configuration while its ALD-domain integration remains unverified. A GUI-compatible Astra release can still be unsuitable for installing ALD 3.1. # SECTION 5: TEMPORARY ACCESS PREPARATION & RESTORATION Provide a wizard for the source AD server, Linux clients, and Windows clients. Bootstrap cannot be automated over a channel that does not yet exist. When no supported channel is available, show precise native manual steps for execution on the target, then offer a connection test. Before an access change record the existing service startup mode and state, listener configuration, firewall rule identities/scopes, credential/key entries, temporary role memberships, and relevant configuration values. Record only the resources actually touched. Prefer existing approved administrative access. When creating temporary access, restrict it to required sources and purposes. Authenticate the target: use verified SSH host keys or trusted TLS certificate validation. Do not default to `StrictHostKeyChecking=no`, wildcard TrustedHosts, certificate-validation bypass, disabled UAC, or disabled endpoint protection. Each access change must show: - what changes and why; - the exact target and affected resource; - whether internet/media is required; - before/after state; - activation and verification instructions; - restoration instructions; - whether closing the channel will prevent remote verification. Use a restoration ledger, not a single “undo everything” shell script. Restore only application-owned changes. If a resource changed independently after preparation, stop automatic restoration for that resource and show a conflict instead of overwriting the administrator's newer state. ```text restoreAccess(change): if !change.wasCreatedOrModifiedByThisRun: preserve() current = observe(change.resource) if current != change.appliedState: recordRestorationConflict() else: executeReviewedInverse(change) verifyOrRecordManualVerificationNeeded() ``` Default end-of-session workflow: complete/verify tasks, restore temporary credentials and rules, close the temporary channel last, and show remaining cleanup obligations. Persist manual restoration instructions before disabling the channel. If a machine is offline, mark cleanup pending; never claim access was removed remotely without evidence. Pre-existing SSH/WinRM services are not disabled merely because the application exits. For access created only for this session, present the concrete restoration plan and execute it when authorized. Crash recovery checks the ledger; do not install a hidden persistent cleanup agent. # SECTION 6: EXECUTION ENGINE, LOGS & ERROR POLICY Implement a typed operation registry. An operation identifies a known adapter method, not arbitrary executable text supplied by JSON or a UI field. Verify installed task manifests and protect privileged payloads from user modification. Use QProcess asynchronously. Never block the GUI thread waiting for subprocess output, DNS, network I/O, or file enumeration. Separate stdout/stderr, redact secrets before display and persistence, preserve ordering, and handle output split across chunks. Bound in-memory buffers and rotate protected logs. For remote execution, treat the remote shell as an additional injection boundary. Local argument arrays alone are not sufficient. Use fixed reviewed remote entry points and structured parameter transport; do not interpolate usernames, paths, DNs, passwords, or policy values into remote code. Do not build LDAP filters or PowerShell commands by unescaped concatenation. Every operation declares: - documented version constraints; - read-only versus mutating behavior; - required privilege; - preconditions and expected effects; - progress model, if available; - expected exit/result codes and reboot semantics; - timeout behavior; - cancellation boundary; - postconditions; - recovery method and reversibility limits. Process exit zero is necessary only where the tool defines it as success; it never replaces postcondition verification. If native progress is unavailable, show elapsed time, phase, and completed item counts rather than invented percentages. Provide operator choices before a batch: stop on first error, continue independent hosts, or pause for a decision. Dependency failures always block dependent steps. Never retry destructive or non-idempotent operations automatically without reconciling actual state. ```text executePlan(plan): verifyInventoryAndPlanRevisionStillMatch() verifyCapabilityAndPrivilegeGates() requireConcretePlanAuthorizationForMutations() for step in topologicalOrder(plan): if dependencyFailed(step): markBlocked(step); continue if shutdownRequested: stopScheduling(); break recheckPreconditions(step) journalStart(step) result = executeNativeStep(step) observation = verifyPostconditions(step, result) journalResult(step, result, observation) applySelectedErrorPolicyWithoutBypassingDependencies() reconcileAccessLedger() generateChecklistFromObservedState() ``` Default concurrency: one host mutation at a time; independent read-only probes may use up to four workers. Serialize local controller changes. Make limits configurable within validated bounds. Provide human-readable summaries with an expandable redacted native output view. Filters: host, phase, operation, severity, time, run. Logs must explain failure and the next supported action, without fabricating native error interpretations. # SECTION 7: DOMAIN INITIALIZATION & EXISTING-CONTROLLER HANDLING The deployment wizard includes actual/desired hostname, FQDN, address/prefix, gateway, DNS, time source, domain/realm, approved repositories/media, protection level, resource checks, credentials, and backup/recovery prerequisites. Obtain input constraints and installer invocation from the actual ALD 3.1 documentation and installed tool help. Do not invent flags or include passwords in a recorded invocation. If the native tool cannot accept secrets through a safe supported channel, expose the documented interactive step rather than implementing an unsafe workaround. Distinguish: - clean preparation; - package installation; - native promotion/initialization; - post-install checks; - correction of a detected existing deployment. If the node is an existing healthy controller, open supported settings and diagnostics. Protect controller identity fields that cannot be changed in place. If renaming an existing DC is not supported, explain the documented replacement workflow; do not call `hostnamectl` and mark the domain renamed. If the node is an AD client, do not assume it must first be joined to AD to become an ALD controller. Resolve the correct documented sequence for the selected migration method. Never combine unrelated installer procedures. For corp.local already served by the source AD, detect the namespace collision before initializing an authoritative target. Require a documented resolver/authority/transition plan compatible with the same subnet and approved interruption. Do not advertise conflicting discovery records to production clients or invent a same-name trust. After initialization verify native domain services, resolution, time, administration access, and a test enrollment path. Record partial failures honestly; do not wipe and retry an incomplete domain automatically. # SECTION 8: MIGRATION INVENTORY & FEASIBILITY MATRIX Inventory the following categories when present and authorized: | Category | Required assessment | |---|---| | Users/groups/OUs | Attributes, account state, nesting, group scope, name collisions, mappings | | Credentials | Supported preservation mechanism and per-account verification limits | | Computer accounts | Re-enrollment, machine trust, client integration support | | Windows profiles | Existing profile association, encrypted user material, application state | | GPOs | Backup/report, links, ordering, inheritance, filtering, scripts, preferences, actual outcomes | | DNS | Zones, records, dynamic update behavior, forwarders, service records and authority changes | | DHCP | Scopes, reservations, options, leases and cutover ownership | | Files/shares | Data, share permissions, NTFS ACLs, ownership, SID dependencies, special file semantics | | Services/applications | Service identities, SPNs, scheduled tasks, LDAP/Kerberos/NTLM bindings and delegated access | | Certificates/AD CS | CA dependencies, trust distribution, enrollment, private-key custody and renewal | | Other AD-dependent services | Detect, classify, document owner and migration path; do not silently omit | Assign a disposition and evidence to every item. A present unsupported dependency required for unchanged behavior blocks AD retirement. “Not discovered” is not the same as “absent”; capture inventory scope and denied/unreachable areas. Separate transport support from capability to migrate the source AD version, and separate both from target domain support for Windows logon. Credentials require a vendor-documented mechanism. Do not assume LDAP export contains reusable passwords, that password-change synchronization captures existing passwords, or that plaintext passwords can be recovered. Do not dump LSASS or implement a custom password filter. If required credential preservation is not achievable, block the seamless outcome explicitly. Require a persistent source GUID/SID-to-target identity map before any permission transformation. Compare group membership and allow/deny access outcomes using representative ordinary and privileged test identities. Do not treat a matching username or matching object count as proof of equivalent authorization. Windows profile continuity must be tested independently, including applicable DPAPI/EFS/credential-store and application consequences. Never relabel ownership of a profile directory and claim that all encrypted profile material migrated successfully. Record any supported vendor Windows integration utility as a versioned artifact with build/ALD compatibility and verified integrity. A utility documented for ALD 3.3 is not automatically valid for 3.1 or Windows Server 2025. Convert Windows policies only through explicit per-setting semantic mappings. “Exported GPO” does not mean “imported and effective in ALD.” Preserve unmapped settings as visible gaps. A Windows-specific setting may require a Windows local policy or a documented application configuration, not a Linux policy. # SECTION 9: MIGRATION PLAN, CUTOVER & RECOVERY Present an ordered dependency graph with these phases: 1. Source health, inventory, supported-path assessment. 2. Backup and recovery-readiness checks, including the single-DC risk. 3. Target preparation and version-correct initialization at the approved point in the namespace transition. 4. Supported object migration and verified identity mappings. 5. Resource/application migration and permission reconciliation. 6. Pilot client transition and continuity tests. 7. Approved DNS/service/client cutover window. 8. Validation with source AD unavailable, using a controlled reversible test where feasible. 9. Readiness assessment for supported AD decommissioning. 10. Temporary access restoration and final checklist. These are conceptual phases. The validated migration procedure determines which phases can happen before source interruption. Never impose a generic “initialize now, fix DNS later” ordering on same-name domains. The interruption preview includes affected services/users, expected unavailable functions, estimated duration or an honest unknown, prerequisites, recovery checkpoints, and the point beyond which rollback is no longer a simple reversal. Backup existence is insufficient. Store recovery procedure, verification status, location, applicable versions, and the result of an appropriate restore rehearsal. Do not describe arbitrary independent VM snapshot rollback as a universally valid recovery method for directory services. Do not expose a direct “delete AD” action as the normal migration completion step. Provide a version-correct decommissioning plan, with each remaining dependency visible and final action separately authorized. Never transfer FSMO roles to ALD or substitute a hidden permanent Samba AD domain for the requested target. If required continuity remains unverified, finish the current run as `COMPLETED_WITH_GAPS` or `BLOCKED`, not as a successful full migration. Implement every independently valid feature without falsely declaring the overall target achieved. # SECTION 10: GENERAL CONFIGURATION & POLICY MANAGEMENT Provide supported administration screens beyond migration: users, groups, organizational structure, host enrollment state, DNS/time settings, password policies, HBAC, sudo, policy assignments, and documented service settings. Show role/version applicability and links to the supported vendor portal/manual when the API is unavailable. Use ALD Pro's documented policy processing for Astra clients. Read and update the authoritative policy, not regenerated local policy cache files. Expose supported policy ordering/inheritance and resultant-setting diagnostics without borrowing newer-version features. An intended profile has a single management owner for each setting. Detect conflicting ownership between ALD policy, local configuration, and a separate automation tool. Do not run two writers that continually overwrite each other. For Windows, use validated native configuration and local policy tooling where appropriate. Record Windows edition/build-specific mappings. Native policy enforcement can continue after the GUI closes, but this application does not deliver new configurations or continuously detect drift while closed. Separate: ```text policy assigned policy retrieved setting included in resultant configuration native application completed effective value verified user-visible behavior checked ``` Policy removal is not a universal rollback. Model restoration of persistent values explicitly, including settings that remain after assignment is removed. # SECTION 11: HARDENING & FSTEC RECOMMENDATION CATALOG Hardening follows migration verification. Keep distinct profiles for an ALD controller, Linux application server, ordinary workstation, administrative workstation, Windows workstation, and Windows server. The FSTEC Linux document dated 25 December 2022 contains 40 numbered configuration items across these ranges: ```text 2.1.1–2.1.2: authorization 2.2.1–2.2.2: privilege acquisition 2.3.1–2.3.11: filesystem permissions 2.4.1–2.4.8: kernel protection 2.5.1–2.5.11: kernel attack surface 2.6.1–2.6.6: kernel-mediated userspace protection ``` Represent every item, even when its implementation is manual or unsupported. Paragraph 1.3 distinguishes certified operating systems, whose configuration follows the developer's operational documentation. Create a version-specific mapping to Astra's documentation rather than treating the general Linux document as a universal command list. For each recommendation implement a card containing source/paragraph, explanation, applicable versions/roles, expected state, observed state, read-only check, supported configuration path, impact, restart/reboot requirement, reversibility, verification instructions, and exceptions. Provide separate actions: explain, audit, prepare changes, apply to pilot, verify, and prepare restoration. An audit action must not run a policy refresh, install dependencies, or restart a service without being reclassified as a change. The optional `astra.hardening.fstec` role is documented as a Technical Preview and was introduced for Astra 1.8. Do not make it a mandatory executable dependency for the chosen Astra 1.7 target or infer that it implements this particular 40-item document completely. Example card requirements: - For paragraph 2.1.2, map the source recommendation `PermitRootLogin=no` to the effective SSH configuration and verify a permitted administrative access path remains available. - For paragraph 2.6.1, the source value `kernel.yama.ptrace_scope=3` needs a special recovery classification. Kernel documentation states that this value cannot be changed once set in the current kernel session. Do not offer a fictitious immediate inverse operation. Check running state and persistent-next-boot configuration separately. An unsupported parameter is not automatically “not applicable.” A boot argument's presence is not proof that the kernel implements or enabled the feature. Windows gets a separate per-build baseline and native setting catalog. Do not apply Linux sysctl/PAM settings or label them Windows FSTEC compliance. Do not claim certification, attestation, or complete regulatory compliance from a completed technical checklist. # SECTION 12: INSTRUCTIONAL CHECKLIST The primary deliverable to the administrator is a saved, interactive checklist. It must remain useful without an automated test for every condition. Each item contains: - a short Russian title and reason; - target host/user/service; - prerequisites and required privilege; - precise manual steps using native UI/tools; - any command with placeholders clearly distinguished from real values; - expected observations and an example failure condition; - remediation or recovery guidance; - state, operator identity, timestamp, note, and evidence reference; - the plan/profile revision to which the observation applies. Provide explicit PASS, FAIL, NOT CHECKED, and NOT APPLICABLE WITH REASON actions. Human verification and machine verification must be visually distinct. Never automatically tick a manual check just because a process returned zero. Checklist groups include source baseline, initialization, object counts and identity mapping, password/login continuity, Windows profile continuity, file access allow/deny cases, service/application authentication, DNS/time, policy outcomes, post-reboot behavior, source-AD-unavailable validation, and access cleanup. After relevant changes or a new run, mark affected previous observations stale. Keep their history. Do not allow an old successful check to silently satisfy a new plan revision. Persist checklist state in the project database and support a simple local UTF-8 HTML/JSON export. PDF, cloud reporting, and enterprise compliance dashboards are not required for the initial release. Escape all exported text and exclude secrets. # SECTION 13: CONNECTIVITY, OFFLINE MODE & DOWNLOADS Determine connectivity per required service, not from a single internet ping. Distinguish local AD/ALD access, package repository reachability, documentation retrieval, optional-feature media, and artifact downloads. Before a plan starts, show an availability table: ```text Available offline: local inventory, installed-rule explanations, saved checklist, planning, and operations whose tools/media are already present. Requires network: access to configured target machines and domain services. Requires internet or supplied media: missing packages, Windows optional features, uncached vendor artifacts, source updates. ``` Offer importing an approved offline bundle with manifest, versions, signatures/digests, and provenance. Do not embed fabricated digest strings. Verify archive paths and reject path traversal or unexpected executable payloads. Updating the rule/source catalog creates a reviewable new version and never changes an accepted profile silently. No hidden downloads, automatic privileged package installation, or execution of downloaded documentation text. # SECTION 14: SHUTDOWN, INTERRUPTION & RECOVERY When no task is running, closing the application enters the access-restoration summary, persists the project, closes sessions, and terminates owned executors. Do not stop domain services or undo successfully applied persistent policies. When a task is active: ```text onCloseRequested(): stopSchedulingNewOperations() if activeOperation.canCancelSafelyNow: requestSupportedCancellation() else: showWhichNativeOperationMustReachASafeBoundary() waitAsynchronouslyForThatBoundary() verifyCompletedEffectsOrMarkUnknown() presentAndExecuteAuthorizedTemporaryAccessRestoration() persistRunAndChecklist() closeOwnedSessionsAndProcesses() exit() ``` Do not use kill-all process matching or force-terminate package managers and directory installers as normal close behavior. Do not promise that killing the GUI cancels an already accepted remote command. After a crash, read the journal, inspect actual state, surface pending cleanup, and offer a reconstructed plan. Never blindly replay installation, password synchronization, ACL migration, promotion, or decommissioning. After a required reboot of the machine hosting the GUI, the operator relaunches the program manually. There is no background application service for automatic continuation. While closed, no new application audits, migrations, host retries, profile deliveries, or remediation jobs occur. The UI must explain this operational limit without implying that existing client settings disappear. # SECTION 15: VERIFICATION & ACCEPTANCE Use meaningful unit tests for state machines, plan dependencies, version gates, injection-resistant parameter handling, secret redaction, identity collision handling, and restoration conflict detection. Use Qt Test for GUI behavior where it validates real interaction, not screenshots of every decorative widget. Required tests include: 1. A failed native process and a postcondition failure never produce migration success. 2. Same-name corp.local without a verified transition method blocks mutation but leaves inventory usable. 3. A degraded controller is never offered clean installation by inference from one stopped service. 4. Unsupported Windows 2025 domain integration stays blocked even if SSH execution succeeds. 5. A lost connection after a remote change produces unknown/needs-reconciliation, not automatic retry. 6. A pre-existing firewall rule/service/key is preserved during cleanup. 7. A temporary access change modified by another administrator creates a restoration conflict. 8. Secrets split across output chunks are not leaked by the log pipeline. 9. A renamed user or duplicate display name does not change the stable identity mapping. 10. Manual checklist completion cannot override a failed mandatory technical prerequisite. 11. Closing after completed work leaves no application-owned running process, listening port, timer, or remote background job. 12. Offline operation produces a specific missing-artifact explanation rather than a generic failure. 13. Motion disabled, Cyrillic text, keyboard navigation, and high DPI remain usable. 14. Repeated supported configuration is idempotent or explicitly classified otherwise. 15. A plan is invalidated when its relevant inventory, source mapping, or policy revision changes. Define lab integration tests for each verified adapter on actual supported VMs. Do not run them against live infrastructure without authorization. Include the named one-forest/one-domain/one-source-DC lab and the Windows targets. Record exact tested builds and untested combinations. Completion of the software implementation and successful migration of a real environment are separate outcomes. Report build/tests honestly, identify unimplemented integrations, and never describe a mocked fixture as a successful ALD migration. The first usable release must contain working discovery, planning, lifecycle management, instructional checks, and at least the documented baseline initialization integration once validated. Do not leave all native actions as placeholders. When a particular integration is genuinely unavailable, ship its explicit blocked/guided workflow with the reason while completing the independent modules. # SECTION 16: IMPLEMENTATION ORDER Work in the following sequence. Do not stop after drawing the GUI or writing a plan; implement and verify the authorized software scope. Do not change real infrastructure as part of generating the code. ## Phase 0 — Evidence and compatibility Create: ```text docs/requirements.md docs/feasibility.md docs/compatibility-matrix.md docs/compatibility-lock.json docs/native-adapter-contracts.md docs/access-restoration.md data/sources.json ``` Extract actual ALD 3.1 native commands/API contracts from the delivery and documentation. Mark unresolved entries honestly. Inspect the target package manifest before choosing exact build revisions. The absence of a real Astra VM blocks release validation, not source-code development or unit tests. ## Phase 1 — Build, types and storage Create: ```text CMakeLists.txt README.md src/main.cpp src/app/AppController.{h,cpp} src/domain/{Project,Host,Capability,Plan,Operation,Run,AccessChange,Checklist}.h src/storage/ProjectRepository.{h,cpp} src/storage/DatabaseMigrator.{h,cpp} schemas/{project,inventory,plan,profile,checklist,source}.schema.json tests/unit/ ``` Compile the minimal application and validate project persistence/migrations before adding privileged execution. ## Phase 2 — Runtime and privilege boundary Create: ```text src/execution/OperationRegistry.{h,cpp} src/execution/ProcessRunner.{h,cpp} src/execution/PlanExecutor.{h,cpp} src/execution/RunJournal.{h,cpp} src/execution/ShutdownCoordinator.{h,cpp} src/security/SecretRedactor.{h,cpp} src/security/AccessLedger.{h,cpp} src/transports/NativeSshTransport.{h,cpp} src/privileged/ExecutorMain.cpp src/privileged/OperationDispatcher.{h,cpp} tests/fixtures/ ``` Implement safe fixed-task transport, session ownership, authorization checks, cancellation classes, and restoration semantics before enabling live mutations. ## Phase 3 — Native discovery and preparation Create: ```text src/adapters/Astra17Discovery.{h,cpp} src/adapters/WindowsDiscovery.{h,cpp} src/adapters/CompatibilityResolver.{h,cpp} src/workflows/AccessPreparation.{h,cpp} src/workflows/AccessRestoration.{h,cpp} resources/tasks/windows/ resources/tasks/linux/ resources/tasks/manifest.json ``` Every shipped task must have a purpose, version constraints, validated parameters, read/write classification, and native-tool evidence. Do not generate a general-purpose remote shell API. ## Phase 4 — Readable desktop shell Create: ```text src/ui/MainWindow.{h,cpp} src/ui/Theme.{h,cpp} src/ui/PixelDecoration.{h,cpp} src/ui/models/ src/ui/pages/{Overview,Environment,Access,Logs,Checklist}Page.{h,cpp} resources/styles/dedsec.qss resources/resources.qrc ``` Connect real read-only state, logs, and checklist interactions. Review screenshots at normal and high DPI. Use the declared DedSec palette and restrained motion without installing the skill's video runtime. ## Phase 5 — Initialization Create: ```text src/adapters/Ald31Deployment.{h,cpp} src/workflows/InitializationPlanner.{h,cpp} src/ui/pages/InitializationPage.{h,cpp} data/checklists/initialization.ru.json ``` Implement the baseline deployment flow only after its exact native invocation is verified. Protect existing and partial domain states. Test plan generation independently from real promotion. ## Phase 6 — Migration Create: ```text src/adapters/AdInventory.{h,cpp} src/adapters/Ald31Migration.{h,cpp} src/workflows/IdentityMapper.{h,cpp} src/workflows/MigrationPlanner.{h,cpp} src/workflows/CutoverPlanner.{h,cpp} src/ui/pages/MigrationPage.{h,cpp} data/checklists/migration.ru.json ``` Implement supported object/resource operations and their evidence. Keep homonymous-domain, credential, Windows profile, and unsupported application dependencies explicit. Exercise positive and negative access checks in the lab. Do not enable AD decommissioning while the unchanged-user-experience gates remain unresolved. ## Phase 7 — General configuration and policies Create: ```text src/adapters/Ald31Administration.{h,cpp} src/adapters/Ald31Policies.{h,cpp} src/adapters/WindowsLocalPolicy.{h,cpp} src/workflows/PolicyPlanner.{h,cpp} src/ui/pages/DomainSettingsPage.{h,cpp} src/ui/pages/PoliciesPage.{h,cpp} data/checklists/policies.ru.json ``` Implement per-setting ownership, actual/resultant state, version limits, and explicit mappings. Keep Windows and Linux implementations separate behind a shared profile UI. ## Phase 8 — Hardening and source mapping Create: ```text src/workflows/HardeningPlanner.{h,cpp} src/workflows/ComplianceEvaluator.{h,cpp} data/hardening/fstec-linux-2022.catalog.json data/hardening/astra17-mappings.json data/hardening/windows-baselines.json data/checklists/hardening.ru.json ``` Represent all 40 Linux-source items with honest support states. Implement only verified remediation paths; provide useful manual guidance for the rest. Separate exact source recommendations from role-specific accepted profile values and explain deviations. ## Phase 9 — Packaging and final verification Create: ```text packaging/debian/ docs/operator-guide.ru.md docs/recovery-guide.ru.md docs/test-results.md tests/integration/ ``` Build/install/uninstall on the validated Astra VM. Package installation must not enable remote access, start migrations, initialize a domain, install an always-on executor, or apply hardening. Verify shutdown, pending-cleanup recovery, offline operation, DPI/accessibility, and controller service health. Deliver source code, a reproducible build procedure, package artifacts when a supported build environment exists, and an honest verification report. Distinguish completed functionality, real laboratory evidence, manual workflows, and blocked requirements. Do not label the product or a migration “fully ready” while required work remains.