Repository navigation
CodeQL: eleven component-checklist queries, FprimeGuards library, and checklist review skill - #6336
lestarch-autobot wants to merge 2 commits into
Conversation
Coverage report — base
|
| Module | Line | Δ | Function | Δ | Branch | Δ |
|---|---|---|---|---|---|---|
Os/Generic |
90.08 | -0.20 | 89.13 | +0.00 | 74.90 | -0.58 |
Fw/DataStructures |
97.60 | -0.09 | 96.95 | -0.19 | 82.12 | -0.18 |
Os/Posix |
71.03 | +0.39 | 87.50 | +0.00 | 50.89 | +0.22 |
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/Ports/DataTypes, Drv/PosixUartDriver, 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/Ccsds/Utils, 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/TestDuplicateDirective, 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
…-checklist review skill Adds F Prime CodeQL rules for the remaining source-checkable items of the Component Development Checklist v1.2.0: float-equality (3.9), float-narrowing (3.10), uninitialized-member (3.11), global-mutable-variable (3.7), unthrottled-cyclic-event (3.4), assert-on-untrusted-input (3.18), isr-complexity (3.20), float-division-guard (3.27), unchecked-array-index (3.28), signed-overflow (3.31), define-constant (3.34), each with a unit test under fprime-queries-tests. FprimeGuards.qll shares the condition/FW_ASSERT guard-precedes logic. uninitialized-member runs in the known-autocode-issues leg only. Adds the fprime-component-checklist-review skill mapping all 72 checklist items to CodeQL rule, component-checks script, review rule CL-1..CL-8, or human. Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
8c81541 to
78dfb76
Compare
Change Description
Eleven new F Prime CodeQL rules in
.github/codeql/fprime-queries, each with afprime-queries-testsunit test, covering the source-level items of the Component Development Checklist that had no rule yet:cpp/fprime/)unthrottled-cyclic-eventglobal-mutable-variablefloat-equality==/!=on floating operands (NaN self-compare exempt)float-narrowinguninitialized-memberassert-on-untrusted-inputFW_ASSERTon data flowing from command args orparamGet_*isr-complexityfloat-division-guardunchecked-array-indexFW_ASSERTsigned-overflow+ - *that range analysis says may overflow, unguardeddefine-constant#defineoutside config/FprimeGuards.qllfactors the "a condition orFW_ASSERTon this variable precedes the use" logic shared by the division/index/overflow rules.uninitialized-memberis excluded fromjpl-standard-pack-1and run fromjpl-standard-known-autocode-issues(autocoded component bases defer parameter members toloadParameters()).Also adds the skill
.github/skills/fprime-component-checklist-reviewthat maps all 73 checklist items to their CodeQL rule /component-checksscript / review rule (CL-1..CL-8 for the residual judgements: ISR state-before-enable, interrupt enables at init, units in names, implementation-vs-SDD, boundary tests, float precision, requirement and design-prose quality) / human (5.3 hardware run), and registers it inAGENTS.md.Rationale
Lets the component checklist be filled from CI evidence instead of by hand; only the physical hardware run remains a human step.
Testing/Review Recommendations
codeql test run fprime-queries-tests/Fprime{FloatEquality,...,SignedOverflow} --additional-packs=.: 11/11 pass.develdatabase (CodeQL 2.26.1): array-index 45, uninitialized-member 31 (hence the autocode leg), mutable static 20, signed-overflow 19, define-constant 16, assert-on-input 6 (TlmPacketizer, Version), float-equality 4, float-division 1 (FpySequencerDirectives), unthrottled event 1 (TlmChanRun_handler). Review focus: whethersigned-overflowandunchecked-array-indexheuristics are too noisy for pack-1 (warning severity).Future Work
Triage the devel findings above into fixes or per-rule refinements; companion scripts in nasa/fprime-actions#55.
Contributor Checklist
AI Usage (see policy)
Queries, tests, skill and this description were written by an AI agent (Devin) at the request of @LeStarch, who reviewed the checklist split; the agent ran the CodeQL tests and the full-database analysis.
AGENTS.md).IAMAI