Home /Modules/sleela-terminal/M5-HARDENING.md

M5-HARDENING.md

sleela-terminal/M5-HARDENING.md · 126 line(s) · markdown

SLeeLa Terminal — M5 Hardening and Validation Record

Scope: M1–M5 closeout review Status: Development-grade hardening complete; validation infrastructure in place Engineering classification: BETTER+

1. Purpose

This document records the changes made during the M5 hardening review. The goal was not simply to add shell features, but to make the feature boundaries safer, more explicit, and easier to validate.

The review follows the engineering priority:

semantic correctness > security > resource correctness > performance > micro-optimization

2. Changes implemented

Multi-segment pathname globbing

This closes the most important code/data-boundary concern identified in the M5 review.

Process substitution

Remaining hardening work includes explicit lifecycle/cleanup tests and broader failure/status conformance testing.

Quoted assignment handling

External-command assignment scope

Shell-function and special-builtin assignment semantics remain an area for broader POSIX conformance work.

Redirection error handling

3. Validation infrastructure

The M5 workflow now performs the following sequence on relevant changes:

  1. clean build;
  2. full smoke/regression suite;
  3. AddressSanitizer and UndefinedBehaviorSanitizer validation;
  4. Clang installation;
  5. libFuzzer target compilation.

The fuzz harness is bounded to 64 KiB input and exercises lexer input, parser input when lexing succeeds, and word expansion in a fresh environment with command execution disabled.

Important: the presence of these workflow gates is evidence of repeatable validation infrastructure, not evidence that every future workflow run has passed. GitHub Actions results must be inspected separately.

Expansion and process failure hardening (follow-up review)

Quote provenance is still flattened by the current lexer/expansion interface. Full POSIX-compatible quoted field splitting (including "$@", empty quoted arguments, and preserving quoted whitespace) needs a token/word representation that retains quote metadata; it is not claimed as solved by this patch.

4. Regression baseline

The M5 smoke suite covers:

The main test target now includes the M5 integration suite.

5. Remaining gates toward GREAT

The current classification remains BETTER+ because the following evidence is still required:

6. Engineering conclusion

The M5 implementation has moved from feature addition toward explicit hardening and repeatable validation. The most important architectural improvement is that shell syntax and filesystem data remain separate: filesystem results are produced as data by the expansion layer rather than being converted back into shell source.

The current engineering judgment is:

SLeeLa Terminal M1–M5: BETTER+.

Target: advance to GREAT only after the remaining behavioral, portability, resource, fuzzing, and performance gates are demonstrated by repeatable evidence.

This is an engineering classification, not a formal security certification.