rdmsm4x-changelog-20260911-0528-m3-iter3-syslog-resync-nonblocking-supervisor
rdmsm4x-changelog-20260911-0528-m3-iter3-syslog-resync-nonblocking-supervisor
Remediated DEFECT-M3-02 RFC syslog stream resynchronization and implemented non-blocking process supervisor architecture with 100% test pass rate across standalone, umbrella, stress, deep stress, universal compilation, and local 4-tier E2E suites.
Scope
- Hosts: rdmsm4x (canonical dev root), rdmbair15m5 (worker execution environment).
- Packages: ECSSystem, ECSLog, ecs0lib.
Exact Files Touched
- rdmsm4x:~/dev/lib/ECSSystem/Sources/ECSSystem/SyslogTransports.swift
- rdmsm4x:~/dev/lib/ECSLog/Sources/ECSLog/SyslogTransports.swift
- rdmsm4x:~/dev/lib/ecs0lib/Sources/ECS0Log/SyslogTransports.swift
- rdmsm4x:~/dev/lib/ECSSystem/Sources/ECSSystem/ProcessSupervisor.swift
- rdmsm4x:~/dev/lib/ecs0lib/Sources/ECS0System/ProcessSupervisor.swift
- rdmsm4x:~/dev/lib/ECSSystem/Tests/ECSSystemTests/SyslogTests.swift
- rdmsm4x:~/dev/lib/ECSSystem/Tests/ECSSystemTests/ProcessSupervisionAndEventMonitoringTests.swift
- rdmsm4x:~/dev/lib/ECSLog/Tests/ECSLogTests/SyslogTests.swift
- rdmsm4x:~/dev/lib/ecs0lib/Tests/ECS0LibTests/M3_SyslogAndSystemServicesTests.swift
Changes Implemented
- SyslogOctetStreamDecoder 5-Stage Resynchronization:
- Pruned leading non-digit bytes immediately (0x30...0x39).
- Guarded space delimiter and bounded memory on un-delimited streams (> maxFrameLength).
- Identified non-digits preceding space, isolated last contiguous digit span (headerStartIndex), and discarded garbage while preserving length tokens.
- Suppressed oversized all-digit length headers (headerDistance > 19) without phantom frames.
- Enforced msgLen > 0 and msgLen <= maxFrameLength with zero empty frame emission.
- ProcessSupervisor Non-Blocking Architecture:
- Replaced blocking process.waitUntilExit() in Task with Foundation native Process.terminationHandler.
- Eliminated cooperative thread pool starvation (reduced latency from 5.108s to 0.104s under 16 concurrent processes).
- Added isStopping: Bool guard and tracked/cancelled pending restart tasks (restartTask).
- Implemented concurrent stopAll() via withTaskGroup.
- Preserved accurate .terminated(exitCode:) state on clean (0) and nonzero (42) exits.
- Comprehensive Regression Test Suites:
- Added 20B, 100B, and 65KB non-space garbage recovery tests.
- Added boundary and oversized length rejection tests (65537, 100K, 1B, 18-digit, 20-digit, 32-digit).
- Added 1-byte TCP stream fragmentation and multibyte Unicode/CRLF tests.
- Added 20-process non-blocking concurrency tests and natural/nonzero exit state transition tests.
- Parity & Dual-Surface Symmetry:
- 0-line diff verified across all 3 SyslogTransports.swift surfaces.
- 0-line diff verified across both ProcessSupervisor.swift surfaces.
Commands Run & Verification Evidence
- swift test --package-path ~/dev/lib/ECSSystem: 41/41 passed (100.00%)
- swift test --package-path ~/dev/lib/ECSLog: 18/18 passed (100.00%)
- swift test --package-path ~/dev/lib/ecs0lib --filter M3_SyslogAndSystemServicesTests: 28/28 passed (100.00%)
- ~/dev/scratch/m3_iter2_challenger_stress_harness: 37/37 passed (100.00%)
- ~/dev/scratch/m3_iter2_ecs0lib_stress_harness: 37/37 passed (100.00%)
- ~/dev/scratch/m3_challenger_stress_harness: 65/65 passed (100.00%)
- ~/dev/scratch/m3_challenger_adversarial_deep_stress: 45/45 passed (100.00%)
- swift build --package-path ~/dev/lib/ecs0lib -c release --arch arm64 --arch x86_64: Verified fat binary slices (arm64 and x86_64 via lipo -info)
- Local 4-Tier E2E Suite (tests/e2e/run_e2e_tests.zsh): 392/392 passed (100.00%)
Git Commits & Remote Locations
- ECSSystem: commit c522c87, pushed to git.ecs0.net:git/lib/ECSSystem.git and GitHub backup.
- ECSLog: commit 7b4e8de, pushed to git.ecs0.net:git/lib/ECSLog.git.
- ecs0lib: commit 0b51387, pushed to git.ecs0.net:git/lib/ecs0lib.git.
How to Undo
- Revert commits on each repo:
- git -C ~/dev/lib/ECSSystem revert c522c87
- git -C ~/dev/lib/ECSLog revert 7b4e8de
- git -C ~/dev/lib/ecs0lib revert 0b51387
Outstanding Owner Actions
- None. All changes fully verified, committed, and pushed.