## Summary
Completes the remaining M1-008 evidence gaps and drafts the owner pass
record (requirement **M1-008**; heap/stack instrumentation also closes
the M1-006 soak heap-integrity note "internal_free not evaluable").
### Firmware: `metrics` console command (console_service.{cc,hh})
- Machine-parseable `heap internal|psram free=<u> largest=<u>
min_ever=<u>` (heap_caps 8-bit pools) and `task <name>
stack_hwm_bytes=<u>` per FreeRTOS task via `uxTaskGetSystemState` (all
tasks: frame-sd/board/display/prov-mon/console_repl/IDLE/ipc/Tmr
Svc/esp_timer/wifi/tcpip/sys_evt).
- ESP-IDF Xtensa reports the high-water mark directly in bytes
(`StackType_t` = uint8_t), so the unit is documented in the field name
itself.
- Companion one-line sdkconfig change:
`CONFIG_FREERTOS_USE_TRACE_FACILITY=y` (required for
`uxTaskGetSystemState`; necessary build-config companion to the mandated
API).
- No JSONL/display/snapshot changes; no new files; partitions untouched;
clang-format 18.1.8 clean; build 0 warnings.
### Evidence (poc/evidence/m1-20260831/)
- `build/m1_frame_m1_hardware.map` — linker map of the instrumented
build (binary sha256 a0e937ba… pinned in the manifest note).
- `build/m1_size_components.txt` — `idf.py size` summary + `idf.py
size-components` breakdown.
- `build/m1_metrics_samples.txt` — three on-device samples (t≈14 s
boot-ish / post-selftest / post-60 s-idle) + selftest + status --json.
Highlights: internal heap min_ever 123295 B (largest block 53248 B),
PSRAM min_ever 8362016 B, smallest task stack HWM ipc0 552 B,
console_repl 2652 B free of 6144 B, idle drift ~36 B/min.
- `M1-PASS-RECORD.md` — completeness table for every M1-008 artifact
(path+sha256), M1-001..007 one-line acceptance summary, known
limitations; **ships PENDING owner confirmation, does not record Pass**.
- manifest.json: 3 artifact entries (+notes); .gitignore: re-include
`poc/evidence/**/build/` (map/size/metrics), same mechanism as the
existing `!poc/evidence/**/*.log`.
## Requirement refs
- M1-008 (pass-record artifacts: linker map, size-components, heap/stack
metrics, owner record draft)
- M1-006 (heap-integrity: heap free/largest/min-ever + per-task stack
HWM now instrumented)
## Gates
Build 0 warnings (clean rebuild, evidence-logged); ruff format/check,
pyright (0 errors), pytest 31 passed 1 skipped, frame-evidence validated
(1 manifest, 47 artifacts).
Co-authored-by: ania-lain <[email protected]>
Frame
Draft / PoC: the v4.2 architecture and hardware gates are not signed off. Green cloud CI does not mean M1, PoC-A through PoC-E, power-cut durability, or production security has passed.
Frame is an ESP32-S3 firmware project exploring an embedded plugin architecture. The repository contains the product firmware skeleton, isolated architecture proofs of concept, host-side contract tests, and repository validation tools.
The firmware currently targets the Waveshare ESP32-S3-RLCD-4.2 (N16R8) with ESP-IDF v6.0.2
and requires a toolchain that provides C++26 mode. The custom 16 MiB flash layout contains two
OTA slots, core-dump storage, encrypted NVS, internal plugin storage, and system storage. Signed
plugin resources live on a dedicated FAT32 TF card; dynamic plugins do not start without it.
Repository Layout
main/contains the firmware entry point.components/contains product firmware components.poc/contains isolated architecture proofs of concept and host contract tests.plugins/is reserved for plugin build inputs; installed code is content-addressed at runtime.tools/frame_tools/contains local repository gate commands.
Firmware Build
Install CMake 3.25 or newer and Ninja, then export an ESP-IDF checkout at the exact v6.0.2 tag.
The checked-in presets target esp32s3 and keep generated configuration under .build/.
. "$IDF_PATH/export.sh"
cmake --preset dev
cmake --build --preset dev
Use the production defaults with:
. "$IDF_PATH/export.sh"
cmake --preset prod
cmake --build --preset prod
Production builds are build artifacts, not release attestations. Hardware validation and signing remain separate release concerns.
Host Tests
The host project is a plain CMake/CTest suite. It does not build ESP32 firmware.
cmake -S poc/host -B .build/poc-host -DENABLE_SANITIZERS=ON
cmake --build .build/poc-host
ctest --test-dir .build/poc-host --output-on-failure
Repository Gates
Python 3.11 or newer and uv are required.
uv sync --frozen
uv run ruff format --check tools tests
uv run ruff check tools tests
uv run pyright
uv run pytest
uv run frame-partitions
uv run frame-evidence
uv run frame-doc-links
uv run frame-sbom --output .build/reports/sbom.cdx.json
CI also runs an independent ThreadSanitizer build and enforces at least 90% LLVM branch coverage for the shared ABI, handle, and lifecycle contract headers.
Evidence manifests placed in poc/evidence/ are validated against the existing
poc/evidence/schema.json. The schema itself is always checked, including when no manifests have
been collected yet.
Contributing And Security
Read CONTRIBUTING.md before submitting a change. Report security issues through GitHub private vulnerability reporting as described in SECURITY.md. Community participation is governed by CODE_OF_CONDUCT.md.
License
Except where a file or third-party component states otherwise, this project is licensed under the GNU General Public License, version 3 or later. See LICENSE and NOTICE.