Engineering Principles & Architectural Contracts¶
Authoritative architectural baseline and engineering laws for
cordanaLLM/nucleus.
1. Authority Classes & Precedence¶
- Class 0 (Legal & Security): Zero-leak privacy invariant (no private RFC 1918 IPs, no workstation paths), Apache 2.0 license compliance.
- Class 1 (Declarative SSOT):
versions.jsonis the sole authority for kernel versions, release tags, upstream tarball URLs, and supported architectures. - Class 2 (Code Contracts): NASA/JPL Power of 10 rules for shell scripts and automated build tooling.
- Class 3 (Documentation & ADRs): Architectural Decision Records under
docs/govern durable technical strategy.
2. NASA / JPL Power of 10 Adaptations¶
- Rule 1 (Simple Control Flow): Shell scripts must avoid recursion and unbounded loops.
- Rule 2 (Fixed Loop Bounds): All wait loops or retry loops must enforce an explicit maximum counter and timeout.
- Rule 4 (Short Functions): Shell functions must not exceed 60 lines of executable code.
- Rule 5 (Explicit Error Checking): Enforce
set -euo pipefail. Check exit codes of all external commands (wget,tar,patch,make). - Rule 7 (Restricted Scope): Keep shell variables localized (
local var=...). - Rule 9 (Static Analysis): All shell scripts must pass
shellcheckwith zero warnings before merging.
3. Kernel Packaging Contracts¶
- Native Debian Packaging: Builds generate standard
.debpackages via upstreammake bindeb-pkg: linux-image-<version>-<stream>-<arch>.deblinux-headers-<version>-<stream>-<arch>.deblinux-libc-dev-<version>-<stream>-<arch>.deb- Package Versioning: Packages carry a reproducible localversion suffix, e.g.
-lusoris1. - Reproducible Checksums: Upstream source archives must match cryptographically verified SHA-256 digests.
- Modular KConfig: Avoid monolith
.configfiles. Configuration is partitioned into composable fragments merged viascripts/kconfig/merge_config.sh.