Skip to content

Fix design-decision must-fix review findings (ComStub, EventManager, CmdSequencer, ValidateFile, FileHandlingCfdp BASE_ID) - #5710

Merged
LeStarch merged 1 commit into
nasa:develfrom
JPL-Devin:devin/1787004245-design-decision-fixes
Aug 17, 2026
Merged

LeStarch merged 1 commit into
nasa:develfrom
JPL-Devin:devin/1787004245-design-decision-fixes

Conversation

@lestarch-autobot

Copy link
Copy Markdown
Collaborator
Related Issue(s)
Has Unit Tests (y/n) n (existing UTs pass)
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) AI

Change Description

Fixes six must-fix findings from an AI full-codebase review that required design decisions (reviewed and decided with @LeStarch):

  1. Svc/ComStub/ComStub.cpp (finding 5678543bc488): on SEND_RETRY exhaustion (both the synchronous send loop and handleAsyncRetry), set m_reinitialize = true so a driver reconnect emits the recovery SUCCESS required by the Communication Adapter Protocol. Previously retry exhaustion emitted FAILURE with no recovery path, pausing Svc::ComQueue permanently.
  2. Svc/EventManager/EventManager.cpp:36 (5019873bcde7): replace the FW_ASSERT(severity.isValid()) in LogRecv_handler with validate-and-drop (log via Fw::Logger, return), matching the existing serialize-failure drop path. Events may arrive from external sources (e.g. a hub bridging another address space), so a corrupted severity byte should not reboot the flight computer.
  3. Svc/CmdSequencer/CmdSequencerImpl.cpp CS_STEP_cmdHandler (800033fbf000): guard on MANUAL == m_stepMode in addition to RUNNING; in AUTO mode emit CS_InvalidMode and respond EXECUTION_ERROR. Matches the documented "Valid only if CmdSequencer is in MANUAL run mode" contract and prevents two sequence commands being outstanding at once.
  4. Svc/CmdSequencer/CmdSequencerImpl.cpp CS_RUN_cmdHandler (5c998a1ed755): on loadFile failure, reset m_blockState/m_opCode/m_cmdSeq before responding EXECUTION_ERROR, so a stale BLOCK cannot cause a later port-driven run to emit a duplicate cmdResponse_out for the already-answered command.
  5. Os/ValidateFileCommon.cpp translateStatus (6157b569613d): return ValidateFile::OTHER_ERROR in the two default: cases instead of asserting. POSIX open/read legitimately produce unlisted statuses (e.g. NOT_SUPPORTED/ENOSYS, INVALID_ARGUMENT/EINVAL), and ValidateFile::validate runs on ground-commanded files.
  6. Svc/Subtopologies/FileHandlingCfdp/FileHandlingCfdpConfig/FileHandlingCfdpConfig.fpp:3 (a231ff188910): change BASE_ID from 0x06000000 (collides with ComCcsdsSdlsConfig.BASE_ID) to 0x07000000, the next unused base in the subtopology family.

Rationale

These findings were held out of the earlier batch PRs (#5705, #5706, #5707) because each required a design/policy decision; each resolution above was reviewed and approved by the project maintainer before implementation.

Testing/Review Recommendations

  • fprime-util generate && fprime-util build passes.
  • Unit tests pass for the affected modules: Svc_ComStub_ut_exe, Svc_EventManager_ut_exe, Svc_CmdSequencer_ut_exe, Os_ut_exe.
  • Review focus: the ComStub recovery semantics (retry exhaustion now requires a driver reconnect before downlink resumes) and the CS_STEP MANUAL-mode guard.

Future Work

A separate PR will address DpCatalog fillBinaryTree directory-listing capacity handling (finding 31e3a5a5ecfb) via chunked re-listing.

AI Usage (see policy)

Findings originate from an AI full-codebase review; fixes were implemented by an AI agent under maintainer direction, with each resolution explicitly approved by the maintainer. IAMAI


This PR was written by Devin 👼
Requested by: michael.d.starch@jpl.nasa.gov (michael.d.starch)

…ager severity drop, CmdSequencer CS_STEP guard and CS_RUN state reset, ValidateFile status handling, FileHandlingCfdp BASE_ID

Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report — base devel

Overall (line): 83.55% → 83.54% (-0.01)
Regression threshold: 0.50% (line).

Regressions

Module Line Δ Function Δ Branch Δ
Svc/EventManager 89.36 -2.95 88.89 +0.00 87.72 -3.02
Fw/DataStructures 97.87 -0.53 97.14 +0.00 82.48 -0.73

Modules changed

Module Line Δ Function Δ Branch Δ
Svc/EventManager 89.36 -2.95 88.89 +0.00 87.72 -3.02
Fw/DataStructures 97.87 -0.53 97.14 +0.00 82.48 -0.73
Svc/CmdSequencer 92.93 -0.30 98.08 +0.00 82.93 -0.52
Os 19.55 +0.01 22.48 +0.00 17.34 +0.00
Svc/ComStub 98.57 +0.04 100.00 +0.00 85.19 +0.00
Os/Posix 64.56 +0.40 85.26 +0.00 45.92 +0.23

New modules

Module Line Function Branch
Fw/Prm 0.00 0.00 0.00

Modules without UTs

CFDP/Checksum/GTest, Drv/LinuxGpioDriver, Drv/LinuxI2cDriver, Drv/LinuxSpiDriver, Drv/LinuxUartDriver, Drv/Ports/DataTypes, FppTestProject/FppTest/topology/async, FppTestProject/FppTest/topology/components/Comp, FppTestProject/FppTest/topology/components/Framework, FppTestProject/FppTest/topology/components/Receiver, FppTestProject/FppTest/topology/components/Sender, FppTestProject/FppTest/topology/guarded, FppTestProject/FppTest/topology/sync, FppTestProject/FppTest/topology/top_ports, FppTestProject/FppTest/topology/types, Fw/Com, Fw/Comp, Fw/FilePacket/GTest, Fw/Fpy, Fw/Obj, Fw/Port, Fw/Sm, Fw/Test, Fw/Types/GTest, Os/Models, Svc/Ccsds/Types, Svc/FatalHandler, Svc/Subtopologies/CdhCore, Svc/Subtopologies/ComCcsds, Svc/Subtopologies/ComCcsdsSdls, Svc/Subtopologies/ComFprime, Svc/Subtopologies/ComLoggerTee, Svc/Subtopologies/DataProducts, Svc/Subtopologies/DpCompression, Svc/Subtopologies/FileHandling, Svc/Subtopologies/FileHandlingCfdp, Svc/Subtopologies/FileHandlingCfdp/FileHandlingCfdpConfig, TestDeploymentsProject/Ref/DpDemo, TestDeploymentsProject/Ref/PingReceiver, TestDeploymentsProject/Ref/RecvBuffApp, TestDeploymentsProject/Ref/SendBuffApp, TestDeploymentsProject/Ref/Top, TestDeploymentsProject/Ref/TypeDemo, cmake/test/data/TestConfigDeployment, cmake/test/data/TestDeployment/TestBuildAutocoder, cmake/test/data/TestDeployment/TestHeaderAutocoder, cmake/test/data/TestDeployment/TestLinkDepends, cmake/test/data/TestDeployment/TestRelative, cmake/test/data/test-fprime-library/TestLibrary/TestComponent, cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent

Comment thread Svc/EventManager/EventManager.cpp Resolved
@LeStarch
LeStarch merged commit e3c8e1f into nasa:devel Aug 17, 2026
72 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants