feat(plc): say when a native CODESYS project is not analysed (#165) #827

Merged
sharang merged 1 commits from feat/codesys-native-project-note into main 2026-11-04 09:13:00 +00:00
Owner

Part of #165, PR 1 of the plan: no silent gap. Tracker #167.

Why

The PLC scan reads Structured Text and PLCopen XML. A CODESYS project in its native format (the binary .project, including the one inside an uploaded .projectarchive) yields 0 POUs, with no note on the run. A target that has only a native project therefore read as "no control-logic findings".

What

  • plc::native_projects(tree) lists two kinds of file, as sorted, /-separated paths with .git skipped:
    • a .project that is not an XML export (a BOM and leading white space are allowed before <);
    • a .projectarchive that opens as a zip. A corrupt one already gets ArchiveUnreadable from the SBOM stage and is not listed twice.
  • run_plc_scan records them as a skipped stage plc_native_project (SkipCode::NativePlcProject, not informational). The reason says what to do: export the POUs as PLCopen XML (Project → Export PLCopenXML) and add the export. DE/EN texts and a stage label are included.
  • .project is parsed as PLCopen only when it looks like XML.
  • Nightly: plc-codesys-synthetic and plc-codesys-proemion (uploaded archives) gain plc_native_project in their baselines. plc-corrupt-archive is unchanged.
  • Docs: guide/plc and the table in guide/scanning.

Tests

  • Unit native_codesys_projects_are_listed_and_exports_are_not covers:
    • a binary and a non-XML .project;
    • a .project holding a PLCopen export with a BOM;
    • a readable and a corrupt .projectarchive;
    • .git skipped;
    • a single uploaded file;
    • analyze_tree yielding nothing and no error.
  • CI only.

🤖 Generated with Claude Code

Part of #165, PR 1 of the plan: no silent gap. Tracker #167. ## Why The PLC scan reads Structured Text and PLCopen XML. A CODESYS project in its native format (the binary `.project`, including the one inside an uploaded `.projectarchive`) yields 0 POUs, with no note on the run. A target that has only a native project therefore read as "no control-logic findings". ## What - `plc::native_projects(tree)` lists two kinds of file, as sorted, `/`-separated paths with `.git` skipped: - a `.project` that is not an XML export (a BOM and leading white space are allowed before `<`); - a `.projectarchive` that opens as a zip. A corrupt one already gets `ArchiveUnreadable` from the SBOM stage and is not listed twice. - `run_plc_scan` records them as a skipped stage `plc_native_project` (`SkipCode::NativePlcProject`, not informational). The reason says what to do: export the POUs as PLCopen XML (*Project → Export PLCopenXML*) and add the export. DE/EN texts and a stage label are included. - `.project` is parsed as PLCopen only when it looks like XML. - Nightly: `plc-codesys-synthetic` and `plc-codesys-proemion` (uploaded archives) gain `plc_native_project` in their baselines. `plc-corrupt-archive` is unchanged. - Docs: `guide/plc` and the table in `guide/scanning`. ## Tests - Unit `native_codesys_projects_are_listed_and_exports_are_not` covers: - a binary and a non-XML `.project`; - a `.project` holding a PLCopen export with a BOM; - a readable and a corrupt `.projectarchive`; - `.git` skipped; - a single uploaded file; - `analyze_tree` yielding nothing and no error. - CI only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-11-04 08:52:48 +00:00
feat(plc): say when a native CODESYS project is not analysed (#165)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 3m37s
CI / Check (pull_request) Successful in 19m57s
7cfea4dad2
A CODESYS project in its native format (the binary .project, also inside
an uploaded .projectarchive) yields no POUs, and the scan said nothing:
a target with only a native project read as clean control logic.

- plc::native_projects lists a .project that is not a PLCopen XML export
  and a readable .projectarchive (a corrupt one keeps its own
  ArchiveUnreadable note).
- The PLC scan records them as a skipped stage (plc_native_project,
  SkipCode::NativePlcProject, DE/EN) with the way out: export the POUs
  as PLCopen XML and add the export.
- A .project is parsed only when it looks like XML.
- The two CODESYS archive baselines of the nightly gain the stage; docs
  in guide/plc and guide/scanning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit b645769f67 into main 2026-11-04 09:13:00 +00:00
Sign in to join this conversation.