REPRODUCTION GUIDE — CURRENT SOURCE REVIEW
Run commands from the package root containing source/ and analysis/.
Prerequisites: Linux, Python3, g++; pandas/numpy only for the original analyzer
probe. No camera, CUDA runtime, Jetson, Lynsyn device, sudo or real sysfs is used.
“PASS” in defect probes means the reported behavior was reproduced, not fixed.
Keep source/ unchanged. Rebuild probes locally rather than trusting bundled
executables. Use a fresh temporary directory for probe binaries and outputs:

  review_tmp=/tmp/erl_review_reproduction_$$
  mkdir -p "$review_tmp"

1. Inventory and provenance
  python3 analysis/make_inventory.py --output-dir "$review_tmp/inventory"

This regenerates all 91 byte/SHA/physical-line records and include classifications.
Without the earlier snapshot, comparison is explicitly not_compared. Recorded
analysis/source_inventory.csv and inventory_summary.json retain the original
verified 61-identical / 30-added result. To repeat the archive comparison, supply
an extracted Stage_01.zip and the two original ZIPs (not inferable from source/):

  python3 analysis/make_inventory.py --old-snapshot /path/to/old_extraction \
    --archive-dir /path/to/original_zips --output-dir "$review_tmp/inventory_delta"

The archive filenames must be Stage_01.zip and SampleTestIntegrationCode_v35.zip.
Source/include graph analysis is lexical; conditional macros are recorded rather
than completely preprocessed. Unconfigured -I candidates are not resolved flags.

2. Synthetic source-formula checks — not original C++ execution
  python3 analysis/algorithm_formula_checks.py
  python3 analysis/metrics_formula_checks.py \
    --source source/Stage_01/Concretes/LynsynMonitorConcrete_new.h \
    --output analysis/metrics_formula_results.json

Expected: 3 algorithm checks and 2 meter-arithmetic checks pass. Algorithm checks
mirror CPU/CUDA formulas and GPU halo index coverage on the host; no CUDA kernel
or uninitialized device value is executed. Meter checks guard specific original
source expressions/line numbers, then mirror arithmetic after raw filtering.
PowerSanity.h IS present in this archive; its gate is deliberately not modeled
by this test. Candidate arithmetic therefore does not prove a real row was
admitted/emitted. Results: algorithm_formula_checks_results.json and
metrics_formula_results.json; recorded rerun logs have *_reproduction.log names.

3. Extracted production member with stub surrounding types
  python3 analysis/evolution_scalar_repro.py

This extracts the verbatim calculateScalarizedFitness member from the unchanged
GA header, compiles it with g++ C++17 inside minimal stub types, and reproduces
negative-fitness age inversion. Result: evolution_scalar_repro_result.json.
It does not compile the whole GA/selector header or run evolution end to end.

4. Actual unchanged surrogate header; logging-only stubs
  g++ -std=c++14 -O2 -Wall -Wextra -pedantic \
    -I analysis/surrogate_test_stubs analysis/surrogate_focused_test.cpp \
    -o "$review_tmp/surrogate"
  "$review_tmp/surrogate"

Expected: partial-target support, workload retention, distant-kNN support and
quantized bucket pooling assertions pass. Only spdlog logging is stubbed; model
logic comes from source/Module/SurrogateModel.h. Recorded stdout is
analysis/surrogate_focused_test_output.txt.

5. Actual unchanged Scheduler/ThermalGovernor/AWM; fake I/O
  g++ -std=c++17 -O0 -I analysis/actuation_tests/stubs -I source/Module \
    analysis/actuation_tests/test_actuation.cpp -o "$review_tmp/actuation"
  "$review_tmp/actuation" "$review_tmp/actuation_tests/fake_sysfs"

Expected: seven PASS groups. HRL_SYSFS_TEST redirects paths into temporary regular
files; system() and sched_setaffinity() are compile-time suppressed; spdlog is a
no-op stub. This tests C++ policy/cache/publication behavior. It does not emulate
kernel cpufreq rounding, hardware thermals, real permissions, frequency residency
or physical affinity. Never omit the test defines/hooks when adapting this probe.
Recorded stdout: analysis/actuation_tests/test_output.txt.

6. Actual unchanged collector/hooks/PowerSanity/histogram headers
  g++ -std=c++11 -Wall -Wextra -Wpedantic -Werror -pthread -I source/Module \
    analysis/collector_checks/probe.cpp -o "$review_tmp/collector"
  for mode in standard quoted evict race full; do
    "$review_tmp/collector" "$mode" "$review_tmp/collector_$mode"
  done
  rm -f "$review_tmp/collector_full/events.jsonl"

The full mode creates a symlink to Linux /dev/full solely to inject a failed
file write; remove that symlink as shown. It is not device telemetry. Other modes
exercise normal query logging, unescaped quotes, open-query eviction and two
concurrent producer streams. Race inversion counts are scheduling-dependent;
recorded 395 inversions are one run, not a required invariant. See packaged
analysis/collector_checks/results.json for outputs, CRC/SHA checks and observed
manifest outcomes. Recheck the packaged records without generating new probes:
  python3 analysis/collector_checks/verify_recorded_events.py

The probe reproduces runtime behavior; it is not an external
semantic verifier or historical source-to-binary binding.

  g++ -std=c++20 -I analysis/collector_checks/stubs -I source/Module \
    analysis/collector_checks/buffer_probe.cpp -o "$review_tmp/buffer"
  "$review_tmp/buffer"

This includes actual MemoryOptimizedMetricsBuffer.h. The harness supplies its
missing vector/cstdint includes and an empty unused spdlog include. Expected:
8 W valid + invalid row reports 4 W; full timestamps 100/200/300 report oldest 200.
The helper is dormant in the production include graph. C++20 accommodates its
designated initializers; this is not evidence of full-application C++17 validity.

7. Other small-header, syntax and analyzer checks
  g++ -std=c++17 -pedantic-errors analysis/latency_inventory_probe.cpp \
    -o "$review_tmp/histogram"
  "$review_tmp/histogram"
  g++ -std=c++17 -pedantic-errors -fsyntax-only -x c++ \
    -include source/Module/IScheduler.h /dev/null
  bash -n source/Stage_01/Config/reset_lynsyn_usb.sh

Expected: one 20 ms histogram sample has erroneous P95 = .5 ms; IScheduler syntax passes.
Only bash -n is used: do not execute the recursive reset script.

  python3 - <<'PY'
from pathlib import Path
import runpy
import pandas as pd
p=Path('source/Module/Analysis/metrics_analyzer.py')
compile(p.read_text(),str(p),'exec')
m=runpy.run_path(str(p))
try:
    m['MetricsCalculator'].calculate_power_stats(pd.DataFrame({f'p{i}':[1.,2.] for i in range(7)}))
except ValueError as e:
    print('Expected Enum failure:',e)
print(m['MetricsCalculator'].calculate_thermal_stats(pd.DataFrame({'SoC_CPU_Util':[40,80]})))
PY

Expected: Enum ValueError and wrongly labeled mean_c = 60. Current Lynsyn schema
incompatibility (time_s versus device_time_s) was established by writer/parser
inspection; this synthetic dataframe check bypasses that earlier parsing failure.

8. Expected compile failures and complete-build limits
  g++ -std=c++17 -pedantic-errors -fsyntax-only -x c++ \
    -include source/Module/ModuleFactory.h /dev/null
  g++ -std=c++17 -pedantic-errors -fsyntax-only analysis/filesystem_alias_probe.cpp
  g++ -std=c++17 -fsyntax-only source/SampleTestIntegrationCode_v35.cpp

These are expected-failure commands; do not interpret nonzero exits as setup
failure alone. Factory lacks direct stdexcept; existing main include order masks
it. The alias probe contains exact source declarations: global fs names both
std::experimental::filesystem and std::filesystem, an active C++17 integration
conflict. Full-main syntax first stopped at missing spdlog in the review host.
The archive also lacks a build manifest, vendored JSON/fmt/SDL2/CUDA/libusb,
config.json and a lynsyn_reset_device definition; two active internal includes
need corrected paths or documented include directories. nvcc was unavailable.
No full application compile/link, hardware run, sanitizer campaign or evidence
binding to the historical experiment executable was performed.
