From 1f24ccbd595609d56fca5b2df947ddb9bdf50046 Mon Sep 17 00:00:00 2001 From: mkadinti <101405874+mkadinti@users.noreply.github.com> Date: Wed, 17 Jun 2026 15:27:23 +0530 Subject: [PATCH 01/13] RDKEMW-9150:[SECVULN] - HTTPS support for firmware download-OpenSpec Integration (#249) * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download * Update project.md * Update project.md * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- Spec generation for this user story with openspec * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- Adding RFC feature gate * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- XConf URL path branching and Codebig bypass * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- XConf URL path branching and Codebig bypass * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- XConf URL path branching and Codebig bypass * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- XConf URL path branching and Codebig bypass - unittests fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- XConf URL path branching and Codebig bypass - update on task.md * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- Per-Artifact Download Orchestration * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- Per-Artifact Download Orchestration * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- Per-artifact selective retry (max 3) * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download - upated with directCDN daigram * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download - L1 failure fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download - L1 failure fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download - L1 * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download-CI build failure fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- addressing HIGH impact copilot review comments * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- addressing HIGH impact copilot review comments * Update rdkv_main.c * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- addressing HIGH impact copilot review comments * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- after addressing comments, L1 fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download-OpenSpec Integration-peripheral issue * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download-OpenSpec Integration-peripheral issue * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- statered Fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- statered Fix * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download- PR cleanedup * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update rdkv_upgrade.c * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update rdkv_upgrade.c * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update rdkv_main.c * Update rdkv_upgrade.c * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * RDKEMW-9150:[SECVULN] - HTTPS support for firmware download-Legacy StateRed Fix * Revert "RDKEMW-9150:[SECVULN] - HTTPS support for firmware download-Legacy StateRed Fix" This reverts commit 4357d6d7d7c356909370580d26656b01aa53a7dd. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/prompts/opsx-apply.prompt.md | 149 + .github/prompts/opsx-archive.prompt.md | 154 + .github/prompts/opsx-bulk-archive.prompt.md | 239 + .github/prompts/opsx-continue.prompt.md | 111 + .github/prompts/opsx-explore.prompt.md | 170 + .github/prompts/opsx-ff.prompt.md | 94 + .github/prompts/opsx-new.prompt.md | 66 + .github/prompts/opsx-onboard.prompt.md | 547 +++ .github/prompts/opsx-propose.prompt.md | 103 + .github/prompts/opsx-sync.prompt.md | 131 + .github/prompts/opsx-verify.prompt.md | 161 + .github/skills/openspec-apply-change/SKILL.md | 156 + .../skills/openspec-archive-change/SKILL.md | 114 + .../openspec-bulk-archive-change/SKILL.md | 246 + .../skills/openspec-continue-change/SKILL.md | 118 + .github/skills/openspec-explore/SKILL.md | 288 ++ .github/skills/openspec-ff-change/SKILL.md | 101 + .github/skills/openspec-new-change/SKILL.md | 74 + .github/skills/openspec-onboard/SKILL.md | 554 +++ .github/skills/openspec-propose/SKILL.md | 110 + .github/skills/openspec-sync-specs/SKILL.md | 138 + .../skills/openspec-verify-change/SKILL.md | 168 + Makefile.am | 2 + .../.openspec.yaml | 2 + .../2026-06-04-direct-cdn-adoption/design.md | 673 +++ .../proposal.md | 37 + .../specs/direct-cdn-download/spec.md | 147 + .../specs/download-engine/spec.md | 19 + .../specs/firmware-validation/spec.md | 34 + .../specs/retry-recovery/spec.md | 53 + .../specs/updater-execution/spec.md | 42 + .../2026-06-04-direct-cdn-adoption/tasks.md | 62 + .../.openspec.yaml | 2 + .../design.md | 151 + .../proposal.md | 29 + .../specs/download-engine/spec.md | 16 + .../specs/firmware-validation/spec.md | 20 + .../specs/retry-recovery/spec.md | 17 + .../tasks.md | 23 + .../.openspec.yaml | 2 + .../design.md | 46 + .../proposal.md | 26 + .../specs/test-mock-isolation/spec.md | 23 + .../tasks.md | 23 + .../design.md | 78 + .../proposal.md | 24 + .../specs/operational-safety/spec.md | 16 + .../specs/retry-recovery/spec.md | 23 + .../fix-state-red-dual-instance-race/tasks.md | 27 + openspec/config.yaml | 20 + openspec/dbus/dbus-architecture.md | 271 ++ openspec/diagrams/architecture-diagrams.md | 354 ++ openspec/diagrams/subsystem-architecture.md | 1020 ++++ openspec/gaps-and-unknowns.md | 115 + openspec/project.md | 269 ++ openspec/runtime/client-daemon-interaction.md | 387 ++ openspec/runtime/daemon-threading-model.md | 314 ++ openspec/runtime/firmware-update-flows.md | 231 + openspec/runtime/rdkFwupdateMgr-lifecycle.md | 206 + openspec/runtime/rdkFwupdateMgr-sequence.md | 431 ++ openspec/runtime/rdkvfwupgrader-lifecycle.md | 160 + openspec/runtime/rdkvfwupgrader-sequence.md | 347 ++ openspec/specs/client-sdk/spec.md | 466 ++ openspec/specs/daemon-runtime/spec.md | 344 ++ openspec/specs/dbus-ipc/spec.md | 487 ++ openspec/specs/direct-cdn-download/spec.md | 75 + openspec/specs/download-engine/spec.md | 444 ++ openspec/specs/firmware-validation/spec.md | 476 ++ openspec/specs/operational-safety/spec.md | 444 ++ openspec/specs/retry-recovery/spec.md | 423 ++ openspec/specs/test-mock-isolation/spec.md | 38 + openspec/specs/updater-execution/spec.md | 415 ++ openspec/subsystems/client-library.md | 215 + openspec/subsystems/spec-boundaries.md | 137 + openspec/subsystems/subsystem-inventory.md | 605 +++ openspec/subsystems/subsystem-map.md | 199 + src/dbus/rdkFwupdateMgr_handlers.c | 3 +- src/dbus/rdkv_dbus_server.c | 27 +- src/device_status_helper.c | 4 + src/deviceutils/device_api.c | 32 +- src/deviceutils/deviceutils.c | 17 + src/deviceutils/deviceutils.h | 2 + src/directcdn.c | 221 + src/include/json_process.h | 3 + src/include/rdkv_cdl.h | 7 +- src/include/rdkv_upgrade.h | 2 + src/include/rfcinterface.h | 3 + src/json_process.c | 29 +- src/rdkFwupdateMgr.c | 4 +- src/rdkv_main.c | 162 +- src/rdkv_upgrade.c | 28 +- src/rfcInterface/rfcinterface.c | 27 + unittest/Makefile.am | 1 + unittest/basic_rdkv_main_gtest.cpp | 4240 +++++++++++------ unittest/device_status_helper_gtest.cpp | 9 + unittest/deviceutils/device_api_gtest.cpp | 147 + unittest/fwdl_interface_gtest.cpp | 29 +- unittest/mocks/dbus_handlers_gmock.cpp | 10 + unittest/mocks/dbus_handlers_gmock.h | 1 + unittest/mocks/device_status_helper_mock.cpp | 17 +- unittest/mocks/device_status_helper_mock.h | 12 +- unittest/mocks/deviceutils_mock.cpp | 19 + unittest/mocks/deviceutils_mock.h | 2 + unittest/mocks/rdkFwupdateMgr_mock.cpp | 8 + unittest/mocks/rdkFwupdateMgr_mock.h | 2 + unittest/rdkFwupdateMgr_handlers_gtest.cpp | 104 + 106 files changed, 18134 insertions(+), 1540 deletions(-) create mode 100755 .github/prompts/opsx-apply.prompt.md create mode 100755 .github/prompts/opsx-archive.prompt.md create mode 100755 .github/prompts/opsx-bulk-archive.prompt.md create mode 100755 .github/prompts/opsx-continue.prompt.md create mode 100755 .github/prompts/opsx-explore.prompt.md create mode 100755 .github/prompts/opsx-ff.prompt.md create mode 100755 .github/prompts/opsx-new.prompt.md create mode 100755 .github/prompts/opsx-onboard.prompt.md create mode 100755 .github/prompts/opsx-propose.prompt.md create mode 100755 .github/prompts/opsx-sync.prompt.md create mode 100755 .github/prompts/opsx-verify.prompt.md create mode 100755 .github/skills/openspec-apply-change/SKILL.md create mode 100755 .github/skills/openspec-archive-change/SKILL.md create mode 100755 .github/skills/openspec-bulk-archive-change/SKILL.md create mode 100755 .github/skills/openspec-continue-change/SKILL.md create mode 100755 .github/skills/openspec-explore/SKILL.md create mode 100755 .github/skills/openspec-ff-change/SKILL.md create mode 100755 .github/skills/openspec-new-change/SKILL.md create mode 100755 .github/skills/openspec-onboard/SKILL.md create mode 100755 .github/skills/openspec-propose/SKILL.md create mode 100755 .github/skills/openspec-sync-specs/SKILL.md create mode 100755 .github/skills/openspec-verify-change/SKILL.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/.openspec.yaml create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/design.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/proposal.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/specs/direct-cdn-download/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/specs/download-engine/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/specs/firmware-validation/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/specs/retry-recovery/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/specs/updater-execution/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-adoption/tasks.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/.openspec.yaml create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/design.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/proposal.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/specs/download-engine/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/specs/firmware-validation/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/specs/retry-recovery/spec.md create mode 100755 openspec/changes/archive/2026-06-04-direct-cdn-parity-guards/tasks.md create mode 100755 openspec/changes/archive/2026-06-04-fix-l1-dangling-mock-segfault/.openspec.yaml create mode 100755 openspec/changes/archive/2026-06-04-fix-l1-dangling-mock-segfault/design.md create mode 100755 openspec/changes/archive/2026-06-04-fix-l1-dangling-mock-segfault/proposal.md create mode 100755 openspec/changes/archive/2026-06-04-fix-l1-dangling-mock-segfault/specs/test-mock-isolation/spec.md create mode 100755 openspec/changes/archive/2026-06-04-fix-l1-dangling-mock-segfault/tasks.md create mode 100755 openspec/changes/fix-state-red-dual-instance-race/design.md create mode 100755 openspec/changes/fix-state-red-dual-instance-race/proposal.md create mode 100755 openspec/changes/fix-state-red-dual-instance-race/specs/operational-safety/spec.md create mode 100755 openspec/changes/fix-state-red-dual-instance-race/specs/retry-recovery/spec.md create mode 100755 openspec/changes/fix-state-red-dual-instance-race/tasks.md create mode 100755 openspec/config.yaml create mode 100755 openspec/dbus/dbus-architecture.md create mode 100755 openspec/diagrams/architecture-diagrams.md create mode 100755 openspec/diagrams/subsystem-architecture.md create mode 100755 openspec/gaps-and-unknowns.md create mode 100755 openspec/project.md create mode 100755 openspec/runtime/client-daemon-interaction.md create mode 100755 openspec/runtime/daemon-threading-model.md create mode 100755 openspec/runtime/firmware-update-flows.md create mode 100755 openspec/runtime/rdkFwupdateMgr-lifecycle.md create mode 100755 openspec/runtime/rdkFwupdateMgr-sequence.md create mode 100755 openspec/runtime/rdkvfwupgrader-lifecycle.md create mode 100755 openspec/runtime/rdkvfwupgrader-sequence.md create mode 100755 openspec/specs/client-sdk/spec.md create mode 100755 openspec/specs/daemon-runtime/spec.md create mode 100755 openspec/specs/dbus-ipc/spec.md create mode 100755 openspec/specs/direct-cdn-download/spec.md create mode 100755 openspec/specs/download-engine/spec.md create mode 100755 openspec/specs/firmware-validation/spec.md create mode 100755 openspec/specs/operational-safety/spec.md create mode 100755 openspec/specs/retry-recovery/spec.md create mode 100755 openspec/specs/test-mock-isolation/spec.md create mode 100755 openspec/specs/updater-execution/spec.md create mode 100755 openspec/subsystems/client-library.md create mode 100755 openspec/subsystems/spec-boundaries.md create mode 100755 openspec/subsystems/subsystem-inventory.md create mode 100755 openspec/subsystems/subsystem-map.md create mode 100644 src/directcdn.c mode change 100644 => 100755 unittest/basic_rdkv_main_gtest.cpp diff --git a/.github/prompts/opsx-apply.prompt.md b/.github/prompts/opsx-apply.prompt.md new file mode 100755 index 00000000..e23ec64d --- /dev/null +++ b/.github/prompts/opsx-apply.prompt.md @@ -0,0 +1,149 @@ +--- +description: Implement tasks from an OpenSpec change (Experimental) +--- + +Implement tasks from an OpenSpec change. + +**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. + +**Steps** + +1. **Select the change** + + If a name is provided, use it. Otherwise: + - Infer from conversation context if the user mentioned a change + - Auto-select if only one active change exists + - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select + + Always announce: "Using change: " and how to override (e.g., `/opsx:apply `). + +2. **Check status to understand the schema** + ```bash + openspec status --change "" --json + ``` + Parse the JSON to understand: + - `schemaName`: The workflow being used (e.g., "spec-driven") + - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others) + +3. **Get apply instructions** + + ```bash + openspec instructions apply --change "" --json + ``` + + This returns: + - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema) + - Progress (total, complete, remaining) + - Task list with status + - Dynamic instruction based on current state + + **Handle states:** + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` + - If `state: "all_done"`: congratulate, suggest archive + - Otherwise: proceed to implementation + +4. **Read context files** + + Read every file path listed under `contextFiles` from the apply instructions output. + The files depend on the schema being used: + - **spec-driven**: proposal, specs, design, tasks + - Other schemas: follow the contextFiles from CLI output + +5. **Show current progress** + + Display: + - Schema being used + - Progress: "N/M tasks complete" + - Remaining tasks overview + - Dynamic instruction from CLI + +6. **Implement tasks (loop until done or blocked)** + + For each pending task: + - Show which task is being worked on + - Make the code changes required + - Keep changes minimal and focused + - Mark task complete in the tasks file: `- [ ]` → `- [x]` + - Continue to next task + + **Pause if:** + - Task is unclear → ask for clarification + - Implementation reveals a design issue → suggest updating artifacts + - Error or blocker encountered → report and wait for guidance + - User interrupts + +7. **On completion or pause, show status** + + Display: + - Tasks completed this session + - Overall progress: "N/M tasks complete" + - If all done: suggest archive + - If paused: explain why and wait for guidance + +**Output During Implementation** + +``` +## Implementing: (schema: ) + +Working on task 3/7: +[...implementation happening...] +✓ Task complete + +Working on task 4/7: +[...implementation happening...] +✓ Task complete +``` + +**Output On Completion** + +``` +## Implementation Complete + +**Change:** +**Schema:** +**Progress:** 7/7 tasks complete ✓ + +### Completed This Session +- [x] Task 1 +- [x] Task 2 +... + +All tasks complete! You can archive this change with `/opsx:archive`. +``` + +**Output On Pause (Issue Encountered)** + +``` +## Implementation Paused + +**Change:** +**Schema:** +**Progress:** 4/7 tasks complete + +### Issue Encountered + + +**Options:** +1.