Files
secs-gem/.gitea/workflows/ci.yml
T
raphael 2fce2fad0c verify: secs4j cross-validation (independent Java implementation)
20 cross-validation checks PASS against [secs4java8] (Apache 2.0,
kenta-shimizu) — an independent SECS/HSMS implementation in Java by
a different author from a different language ecosystem.  Distinct
implementer = independent spec interpretation.  Two libraries
agreeing on wire bytes is much stronger evidence of spec-correctness
than either alone.

Coverage targets the gap the secsgem-py interop deliberately skipped
(secsgem-py's SFDL grammar couldn't easily express GEM 300 bodies
with variable lists of named scalars):

  - S1F1/F13/F17/F19/F21/F23 — establish comms + namelists
  - S2F17 — clock
  - S2F23 — trace init (5-field body)
  - S2F49 — enhanced remote command (DATAID + OBJSPEC + RCMD + params)
  - S3F17/F19/F25/F27 — full E87 carrier surface (action, slot map
                        verify, transfer with port pair, cancel)
  - S5F13/F17 — exception recovery (EXID + EXRECVRA)
  - S14F9/F11 — E94 CJ create with prjobids list, CJ delete
  - S16F5/F27 — E40 PJ command, E94 CJ command
  - S1F15 — offline cleanup

20/20 PASS against the demo equipment.  Reply S/F matches the spec
for every transaction; specific ACK values vary by equipment state
(CarrierIDUnknown for an unknown carrier is just as valid as Accept
for a known one) so we assert on the wire shape, not the result.

Ship layout:
  interop/secs4j/Dockerfile          — eclipse-temurin:21-jdk + clone
                                       + build of secs4java8 → Export.jar
  interop/secs4j/Secs4jHostHarness.java
                                     — 20 round_trip assertions; uses
                                       Secs2.list/uint4/ascii to build
                                       full GEM 300 bodies; comm.send()
                                       for arbitrary S/F pairs
  interop/secs4j_validate.sh         — orchestrator: builds image,
                                       compiles harness, starts compose
                                       server, runs Java container on
                                       the secs network against it
  .gitea/workflows/ci.yml            — secs4j-interop job in CI
  README.md                          — proof table grows to 7 commands
  .gitignore                         — *.class

After this commit our proof chain has:
  - SEMI E5 KAT          (standards body's own arithmetic)
  - tshark dissector     (Wireshark's HSMS impl)
  - secsgem-py interop   (Python reference impl)
  - **secs4j interop**   (independent Java impl)
  + 426 unit tests, 47 conformance harness checks, 100k random ops,
    YAML validation

Four independent external proofs, three of them on overlapping wire
surface from independent angles.

Plan: VERIFICATION.md §3.

[secs4java8]: https://github.com/kenta-shimizu/secs4java8

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 16:12:44 +02:00

145 lines
4.4 KiB
YAML

name: tests
on:
push:
branches: [main]
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
# actions/checkout@v4 is a Node-based action; the bare ubuntu:24.04
# runner image has no node, so checkout fails with
# `exitcode '127': command not found`. Install node + git BEFORE
# checkout, then install the rest of the toolchain after.
- name: Bootstrap (node + git for actions/checkout)
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
git \
ca-certificates \
nodejs
- uses: actions/checkout@v4
- name: Install C++ toolchain
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends \
build-essential \
cmake \
ninja-build \
libasio-dev \
libyaml-cpp-dev \
python3 \
python3-yaml
- name: Configure (Release)
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: Build (Release)
run: cmake --build build
- name: Unit tests (Release)
run: build/secsgem_tests
thread-sanitizer:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
- name: Bootstrap (node + git for actions/checkout)
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
git ca-certificates nodejs
- uses: actions/checkout@v4
- name: Install C++ toolchain
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends \
build-essential cmake ninja-build \
libasio-dev libyaml-cpp-dev \
python3 python3-yaml
# Debug + -fsanitize=thread. Catches data races in the
# io_context strand contract documented in INTEGRATION.md §3.
# halt_on_error=1 makes TSan-flagged races fail the job, not
# just print a warning.
- name: Configure (TSan)
run: cmake -S . -B build-tsan -G Ninja
-DCMAKE_BUILD_TYPE=Debug
-DSECSGEM_TSAN=ON
- name: Build (TSan)
run: cmake --build build-tsan
- name: Unit tests (TSan)
env:
TSAN_OPTIONS: halt_on_error=1
run: build-tsan/secsgem_tests
tshark-dissector:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
- name: Bootstrap (node + git for actions/checkout)
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
git ca-certificates nodejs
- uses: actions/checkout@v4
- name: Install C++ toolchain + tshark
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends \
build-essential cmake ninja-build \
libasio-dev libyaml-cpp-dev \
python3 python3-yaml \
tshark tcpdump
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
# Capture pcap of the demo flow, dissect with Wireshark's HSMS
# dissector (independent third codec), assert no malformed
# packets and that every expected control + data frame parses.
- name: tshark HSMS dissector validation
run: bash interop/tshark_validate.sh
env:
PORT: "5099"
secs4j-interop:
runs-on: ubuntu-latest
# secs4j-interop builds its own docker image (with JDK) and starts
# secs_server via docker compose; needs the docker socket.
steps:
- name: Bootstrap (node + git)
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
git ca-certificates nodejs docker.io docker-compose-plugin
- uses: actions/checkout@v4
# Cross-validate against secs4java8 (Apache 2.0, kenta-shimizu) —
# an independent SECS implementation in Java. 20 checks
# covering S1/S2/S3/S5/S14/S16 with full-body GEM 300 shapes
# that secsgem-py couldn't easily drive.
- name: secs4j cross-validation
run: bash interop/secs4j_validate.sh