From 11ccc9efccf74f1a3071b11c7e7836964fcca34f Mon Sep 17 00:00:00 2001 From: berrux_dev Date: Wed, 23 Sep 2026 13:02:36 +0200 Subject: [PATCH] Merge prompt --- .../merge-basis-modules-branches.prompt.md | 383 ++++++++++++++++++ 1 file changed, 383 insertions(+) create mode 100644 prompts/merge-basis-modules-branches.prompt.md diff --git a/prompts/merge-basis-modules-branches.prompt.md b/prompts/merge-basis-modules-branches.prompt.md new file mode 100644 index 000000000..8227600b6 --- /dev/null +++ b/prompts/merge-basis-modules-branches.prompt.md @@ -0,0 +1,383 @@ +# Strict Qt6 Migration Prompt: Merge of the two basis-modules branches + +This prompt is binding task context. Keep changes minimal, scoped, and reproducible. +The only allowed outcome is a merge commit on `feature/qt6-migration-basis-modules-merge` +that contains the full work of both source branches and preserves the legacy code +behavior of every migrated file. + +## Required base prompts + +Before making changes, read and apply: + +- ./prompts/combined-migration-subfolder-rti-compact.prompt.md +- ./prompts/commit-policy.prompt.md (repository mapping, pre-commit checks, per-repo commits) + +If a base prompt is stricter, follow it. This prompt overrides it only for: + +- build variants: use ON variants only, never OFF +- commit message format: max 2 lines, single author, no co-author lines (see "Commits") + +## Task + +Merge these two branches and resolve every conflict without changing code behavior: + +- **ours (merge target base):** `feature/qt6-migration-basis-modules` + remote tip at prompt writing: `ed9fc51e7` ("Migrates ./Lts/Viewer successfully to Qt6") +- **theirs (branch to merge in):** `feature/qt6-migration-basis-modules-services` + remote tip at prompt writing: `881d44f4d` ("Migrates residual Lts sources to generated rtiddsgen API") +- **merge base:** `9e3858378` ("Adds functionality and with already migrated components integration test to cmake targets unter ./Z") +- **result branch:** `feature/qt6-migration-basis-modules-merge` (already created from `origin/feature/qt6-migration-basis-modules`) + +All work happens in the repository `./qt-migration-legatus` (it is a separate git +repository; never commit its changes into the workspace root or the legacy repository). + +## Branches and trees + +Working repository: + +- `./qt-migration-legatus` + +Trees: + +- Legacy Qt5 source tree (read-only reference, never modify): + `./qt-migration-legatus/qt5-before/qt5-legatus-legacy` +- Qt6 target tree (the only tree that is modified): + `./qt-migration-legatus/qt6-after/qt6-migrated-legatus` + +Before starting: + +1. `git fetch origin` in `./qt-migration-legatus`. +2. Verify both remote tips still match the hashes above (`git rev-parse origin/feature/qt6-migration-basis-modules` and `git rev-parse origin/feature/qt6-migration-basis-modules-services`). +3. If either tip moved, recompute the merge base and re-run the dry-run merge (step 4 of the procedure) before resolving anything. +4. Verify the working tree of `./qt-migration-legatus` is clean (`git status --short`). Do not overwrite uncommitted user changes; if they block safe work, report the blocker. + +## What each side contains + +Understand both sides before resolving anything. The merge must keep the work of BOTH sides. + +**basis-modules side (ours, 9 commits after the merge base, ~121 files):** + +- `./Lts/Viewer` migrated to Qt6 (LtsFileDialog et al.), GROUP5 build configuration and CTest registration +- DDS migration completion and LTS/Proxies migration reports +- merge of `origin/feature/migrate-and-test-DDS-targets` into this branch +- ktexttemplate added as apt package to `new_docker_build.sh` +- `./Z` and `./Lts/Proxies` made production ready +- modifications to the stub headers under `include/` (see modify/delete conflicts) + +**services side (theirs, 44 commits after the merge base, ~1203 files):** + +- migration of the residual services, proxies, plugins, `Lts/Common` and `Lts/DDS` sources to the generated rtiddsgen 7.7 API: `Xxx_def::EnumValue` → `Xxx::EnumValue`, accessor calls → plain member access (e.g. `m_data.id()` → `m_data.id`), renamed enumerators where the generated name collides (e.g. `PdmEventType::Hit` → `PdmEventType::EventType_Hit`) +- NmeaManagement enabled in the build plus `tests/test_nme_dtc.cpp`, `tests/test_nme_enums.cpp`, `tests/test_nmea_handler.cpp` +- Qt6::SerialPort manual IMPORTED target in the root `CMakeLists.txt` +- codegen template include-prefix fixes (`svc_db_structs.h.grantlee`, `svc_translation.h.grantlee`, `svc_dts_impl.cpp.grantlee`, `svc_ftc_impl.cpp.grantlee`, `svc_record_replay_plugin.cpp.grantlee`) +- deletion of the stale stub headers under `include/` and of `tests/test_migration_stubs.cpp` (real generated headers from the build tree replaced them) + +## Known conflict surface (dry run 2026-09-23) + +A dry-run merge (`git worktree` + `git merge --no-commit --no-ff`) found 17 conflicts. +Re-run the dry run after the fetch and treat its output as authoritative; the list +below is the expected starting point. + +Content conflicts (12): + +1. `qt6-after/qt6-migrated-legatus/CMakeLists.txt` +2. `qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dts_impl.cpp.grantlee` +3. `qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_ftc_impl.cpp.grantlee` +4. `qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee` +5. `qt6-after/qt6-migrated-legatus/Lts/DDS/Core/CMakeLists.txt` +6. `qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp` +7. `qt6-after/qt6-migrated-legatus/Lts/DDS/Core/topic_lock_master.cpp` +8. `qt6-after/qt6-migrated-legatus/Lts/DDS/Core/topic_lock_master.h` +9. `qt6-after/qt6-migrated-legatus/Lts/DDS/FTC/generic_ftc_impl.h` +10. `qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/generic_fts_impl.h` +11. `qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/CMakeLists.txt` +12. `qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.h` + +Modify/delete conflicts (5; deleted on the services side, modified on the basis-modules side): + +13. `qt6-after/qt6-migrated-legatus/include/Core/core_dtc.h` +14. `qt6-after/qt6-migrated-legatus/include/DDS/DTC/generic_dtc.h` +15. `qt6-after/qt6-migrated-legatus/include/DDS/DTC/generic_dtc_impl.h` +16. `qt6-after/qt6-migrated-legatus/include/DDS/Generic/generic_data_reader.h` +17. `qt6-after/qt6-migrated-legatus/tests/test_migration_stubs.cpp` + +## Conflict resolution rules + +These rules exist to guarantee: the merged tree keeps both branches' functionality +and no file's behavior deviates from the legacy Qt5 behavior beyond the approved +Qt6/C++17/rtiddsgen adaptations. + +General: + +- Resolve semantically, never mechanically. For every conflicted hunk read four + versions: the merge-base version, ours, theirs, and the legacy Qt5 equivalent in + `./qt-migration-legatus/qt5-before/qt5-legatus-legacy` (same relative path, or the + closest legacy counterpart). The resolution must implement the legacy semantics + with both branches' approved adaptations applied. +- Never take `ours` or `theirs` wholesale unless you prove the losing side had no + unique changes: `git diff ..theirs -- ` (or `..ours`) must show + nothing that the kept version lacks. Record the proof in the final report. +- A merge commit must not drop functionality of either branch: every target, + dependency, test registration, docker build step, and code fix present on one + side must be present (or superseded by an equivalent) in the merged tree. +- No behavior-changing edits beyond the merge itself. No refactoring, no style + cleanup, no warning suppression, no new features. +- Generated API shape (rtiddsgen 7.7, `-language C++11 -stl`): plain public data + members (no getters/setters), no `*_def::type` wrappers, enums directly in the + service namespace, renamed enumerators on collision, `omg::types::optional` / + `omg::types::sequence` members. Where a conflict shows both API shapes, the + generated header in the build tree is the authority — read it, do not guess. +- Grantlee `*.grantlee` template conflicts: the template, not the generated output, + is the source of truth. Resolve the template so codegen produces code consistent + with both branches' consumers. Never hand-edit generated outputs. + +CMake conflicts (root `CMakeLists.txt`, `Lts/DDS/Core/CMakeLists.txt`, `Lts/Proxies/Buildings/BuildingControlUnit/VWM/CMakeLists.txt`): + +- Take the union of both sides' targets, dependencies, include directories, and + link libraries. Both sides' target additions must survive. +- Keep the Qt6::SerialPort manual IMPORTED target (services side) and the GROUP5 / + Viewer target wiring (basis-modules side) side by side. +- ON-variant-only rule: `BUILD_RTI=ON`, `BUILD_GRANTLEE=ON` are the only valid + variants. Do not add CMake logic, stubs, or fallbacks for OFF variants. +- After resolving, verify with a fresh configure that both sides' targets exist + (`cmake --build` list / `make help` or the docker script's group options). + +Modify/delete conflicts (the 5 files above): + +- The services side deleted these stale stubs because real generated headers from + the build tree replaced them. The basis-modules side modified them. +- For each file: inspect what the basis-modules modification added + (`git diff ..origin/feature/qt6-migration-basis-modules -- `), + then grep the merged tree for anything that still includes or references the + file's path (including the docker build scripts and CMake lists). + - If nothing references it after the merge: keep the deletion + (`git rm `), and if the basis-modules modification carried a needed fix, + port that fix into the file that now provides the same functionality (real + generated header consumer or the approved stub location). + - If something on the merged tree still references it: do not resurrect stale + stub content. Point the reference at the real generated header from the build + tree, or relocate the stub to an approved directory + (`forward-declarations/` or `.forward-declarations/include/`), preserving the + basis-modules modification. +- For `tests/test_migration_stubs.cpp`: the deletion is correct if no test + registration (CMake glob, explicit list, docker script) depends on it. If the + basis-modules side added test cases to it that are still meaningful, port those + cases into the current test convention under `qt6-after/qt6-migrated-legatus/tests/` + with policy-compatible names. + +## Mandatory build variants + +Only these variants are valid: + +- `BUILD_RTI=ON` +- `BUILD_GRANTLEE=ON` + +Forbidden: `BUILD_RTI=OFF`, `BUILD_GRANTLEE=OFF`. + +- Do not implement, fix, preserve, test, or validate OFF variants. +- Do not add CMake logic, tests, stubs, or fallbacks for OFF variants. +- Validation must use `BUILD_RTI=ON` and `BUILD_GRANTLEE=ON`. + +## Preservation rules + +Preserve module removals from commit `92ad7d468` ("remove all unneeded module listed from Niklas"): do not restore removed modules, files, targets, directories, or dependencies — on either side. + +Preserve LogViewer reinsert from commit `1fa789767` ("Added LogViewer again"): do not remove, disable, or break LogViewer integration. + +Preserve prior IDL warning fixes from commit `be912de9d`: do not reintroduce multiple enum definitions, duplicate enumerators, or builtin type/keyword collisions. + +Preserve the ON-variant-only decisions already made on both branches. + +## Stubs and forward declarations + +Any required existing stub, compatibility declaration, or forward declaration must live only under: + +- `./qt-migration-legatus/qt6-after/qt6-migrated-legatus/forward-declarations/` +- `./qt-migration-legatus/qt6-after/qt6-migrated-legatus/.forward-declarations/include/` + +- Do not leave such files in service directories unless they are real service source files. +- Do not create or keep stubs for forbidden OFF variants. +- Do not use stubs as replacements for real RTI, ndsgen, KTextTemplate, or Grantlee outputs in ON builds. +- Report every moved, removed, or newly referenced stub/forward declaration, including the 5 modify/delete files above. + +## Qt link rules + +No active target in the merged tree may link Qt5 imported targets. + +Search the merged tree for and fix active uses of: `Qt5::`, `find_package(Qt5`, `QT5_`, `Qt5Core`, `Qt5Widgets`, `Qt5Network`. + +A regression check specific to this merge: the services side removed Qt5 references in files the basis-modules side also touched. After the merge, re-run the search over ALL conflicted files, not just the hunks you edited. + +## Legacy comparison (required validation step) + +This step proves the merge did not change code behavior. + +For every one of the 17 conflicted files (and for any other file you edit during +conflict resolution): + +1. Read the legacy Qt5 source at the same relative path in + `./qt-migration-legatus/qt5-before/qt5-legatus-legacy`. If the file does not + exist there (pure Qt6 build machinery), say so and compare against the merge + base instead. +2. Produce three diffs: merge-base vs legacy, ours vs legacy, theirs vs legacy. +3. Produce the audit diff: merged result vs legacy. +4. Classify every hunk of the audit diff into exactly one category: + - `qt6-api`: mandatory Qt5→Qt6 API adaptation (module includes, QRegExp, signal/slot, QDesktopWidget, QMetaType, Qt6 links) + - `rtiddsgen-api`: generated-API adaptation (plain members, no `*_def`, renamed enumerators, omg::types) + - `build`: CMake/docker/test-infra change with no runtime semantics + - `merge-union`: line present because both branches required it + - `semantic-change`: anything else +5. Every `semantic-change` hunk is a failure of this merge unless you can point to + the legacy source line that implements the same behavior. Fix it back to the + legacy semantics (with approved adaptations) or report it as a blocker. Do not + silently accept `semantic-change` hunks. +6. Record the per-file hunk classification (counts per category is sufficient; + list every `semantic-change` hunk explicitly) in the final report. + +Additional equivalence checks on the merged tree: + +- The enum switch/case sets and default branches in `Lts/DDS/Core/pacemaker.cpp`, `topic_lock_master.cpp`, `topic_lock_master.h` cover exactly the enumerators of the generated headers, matching the legacy control flow. +- The Grantlee template conflicts resolve to output that matches what both branches' consumers expect; verify by building, not by reading generated files. +- Test registrations: the union of both sides' CTest registrations is present; the tests the services side deleted are gone and no dangling references to them remain. +- Docker build scripts: every target group and apt package both sides added is present; the script still contains `set -eo pipefail` in the container script. + +## Tests + +- Both sides' test suites must build and run; this merge adds no new feature tests by default. +- If a conflict resolution changed C++ semantics (it should not), add CTest tests + under `./qt-migration-legatus/qt6-after/qt6-migrated-legatus/tests/` that pin the + legacy behavior, registered with CTest, running with `BUILD_RTI=ON` and + `BUILD_GRANTLEE=ON`, policy-compatible names (`test_.cpp`, ...). +- No OFF-variant tests. No host-local paths. + +## Docker and CI + +Authoritative migration Dockerfile: + +- `./app/Dockerfile` + +Authoritative validation scripts (both exist in the tree after the merge; run the +one(s) whose target groups cover the merged changes, and if in doubt run both): + +- `./qt-migration-legatus/qt6-after/qt6-migrated-legatus/docker_build.sh` +- `./qt-migration-legatus/qt6-after/qt6-migrated-legatus/new_docker_build.sh` + +Validation container expectations: + +- repository root at `/repo`, or the script's documented mount path +- external dependencies under `/repo/external` (including `external/rti_connext_dds-7.7.0`, `external/ArcGIS`, `external/GeographicLib` where the scripts expect them) +- `./rti_license.dat` mounted read-only if RTI requires it +- no developer-local paths + +Jenkins CI must be able to discover and run the merged test set. Inspect and minimally update only if needed: + +- `./qt-migration-legatus/ci/Dockerfile.*` +- `./qt-migration-legatus/ci/check_pr_policies.py` + +## Required procedure + +1. Read the base prompts. Run `git fetch origin` and verify both remote tips and the merge base. +2. Check out `feature/qt6-migration-basis-modules-merge` in `./qt-migration-legatus` (working tree must be clean). +3. Re-run the dry-run merge in a throwaway worktree; confirm the conflict list. +4. Run the real merge: `git merge --no-ff origin/feature/qt6-migration-basis-modules-services` (do not auto-commit; resolve first). +5. Resolve the conflicts one file at a time using the four-version method (merge base, ours, theirs, legacy) and the rules above. +6. Run the legacy comparison audit (previous section) over every resolved/edited file. +7. Run the regression checks: Qt5 links, removed modules, LogViewer, IDL warnings, stub locations, ON-variant-only CMake, docker script integrity, CTest registration union. +8. Validate in Docker with `BUILD_RTI=ON` and `BUILD_GRANTLEE=ON` (docker_build.sh and, where applicable, new_docker_build.sh). +9. Run CTest in the validated build directory. +10. Check Jenkins/policy compatibility. +11. Create the merge commit (see Commits). +12. Report factual status. + +Do not push. The merge result stays local on `feature/qt6-migration-basis-modules-merge` until the user says otherwise. + +## Required validation + +From `./qt-migration-legatus/qt6-after/qt6-migrated-legatus`, run: + +```bash +BUILD_RTI=ON BUILD_GRANTLEE=ON ./docker_build.sh +``` + +and, if its target groups do not cover all merged changes: + +```bash +BUILD_RTI=ON BUILD_GRANTLEE=ON ./new_docker_build.sh +``` + +CTest must run as part of validation. If a direct clean build is useful, use: + +```bash +cmake -S /repo/qt-migration-legatus/qt6-after/qt6-migrated-legatus -B /repo/build-merge-rti-on-grantlee-on -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_RTI=ON -DBUILD_GRANTLEE=ON +cmake --build /repo/build-merge-rti-on-grantlee-on --parallel +ctest --test-dir /repo/build-merge-rti-on-grantlee-on --output-on-failure +``` + +CTest baseline: ctest exits with code 8 when tests are "Not Run". A pre-existing set of Not Run tests (for example nglcomp_test, aes/avm/exm/scm/bld suites, GrantleeParserSmoke) belongs to sibling targets outside the docker build scripts' make list and existed before this migration series; that set is not a failure. Treat only `***Failed` entries as failures. Do not widen this exception to skip real failures, and do not add missing sibling targets to fix the exit code. If a previously passing test becomes Not Run or Failed after the merge, that is a merge regression: fix it or report it as a blocker. + +Do not run or validate OFF variants. + +## Commits + +- Single author: the user's git identity. The user is the only author; do not add any co-author, co-authored-by, or bot attribution lines of any kind. +- Commit message: maximum 2 lines (one subject line plus at most one short body line), no blank-line separators, no extra metadata. +- Merge commit subject example (2 lines max): + `Merge feature/qt6-migration-basis-modules-services into feature/qt6-migration-basis-modules` + body line: `Resolves 17 conflicts against legacy Qt5 semantics; validates with BUILD_RTI=ON BUILD_GRANTLEE=ON.` +- If a conflict resolution requires an additional fix commit on top of the merge commit, the same 2-line / single-author rules apply. +- Follow `./prompts/commit-policy.prompt.md` for repository mapping and pre-commit checks. If it requires signed commits and signing is not configured in this repository context, stop and report the exact reason instead of committing unsigned. + +## Success criteria + +Success requires: + +- `feature/qt6-migration-basis-modules-merge` contains a merge commit with both parents `origin/feature/qt6-migration-basis-modules` (or its verified successor tip) and `origin/feature/qt6-migration-basis-modules-services` (or its verified successor tip) +- all 17 conflicts resolved with the four-version method; resolution evidence recorded +- both branches' functionality preserved: Viewer/GROUP5 and DDS/Proxies/./Z work from the basis-modules side, and the full rtiddsgen services/proxies/plugins migration plus NMEA tests from the services side +- legacy comparison audit done for every resolved file; zero unexplained `semantic-change` hunks +- configure, build, and CTest pass with `BUILD_RTI=ON` and `BUILD_GRANTLEE=ON` +- the docker build script(s) run the merged test set and fail on test failure +- Jenkins/policy discovery accepts the merged test set +- no active Qt5 imported target links remain in the merged tree +- generated outputs are build-tree only, freshly produced, never committed or consumed from the source tree +- no fake generated files, dummy files, mocks, placeholders, or stubbed generated outputs +- required stubs/forward declarations only in allowed directories +- removed modules remain removed; LogViewer preserved +- no OFF-variant logic, tests, or stubs introduced +- no push performed + +## If blocked + +Do not fake success. Report: + +- failing command +- key error output +- affected file/branch +- category: project, path, merge, CMake, Qt API, codegen, Docker, RTI/license, Grantlee/KTextTemplate, test, CTest, Jenkins CI, stub relocation, or environment +- which side (ours/theirs) the problematic hunk came from +- what was resolved safely +- what remains blocked +- whether stale artifacts were ruled out +- whether generated files were involved +- exact missing files, targets, or generator step +- whether tests and CTest integration succeeded +- whether Docker validation and Jenkins discovery succeeded +- the legacy comparison status for the unresolved files + +## Final report + +Keep it short. Include: + +- status: validated, partially validated, or blocked +- merge commit hash, both parents, branch name +- per-conflicted-file resolution: file, method (union / four-version semantic / keep-deletion / port-modification), and the one-line reason +- modify/delete outcomes for the 5 stub/test files (kept deleted or relocated, and where the basis-modules modification went) +- legacy comparison audit summary: per-file hunk counts by category, and every `semantic-change` hunk with its justification or fix +- files changed beyond the conflicted set +- CTest registration union check result +- Docker and Jenkins CI changes +- Qt5 references removed or remaining +- confirmation that removed modules were not restored and LogViewer was preserved +- confirmation that both branches' target sets are present after the merge +- exact validation commands and results +- remaining blockers or risks