|
1 | 1 | # t27 / Trinity Agent Experience Log |
2 | 2 |
|
| 3 | +## 2026-07-05 — Wave Loop 419 (Variant C fallback: VCD/CSV hardening, PVT monotonicity, standalone lake workflow) |
| 4 | + |
| 5 | +### What worked |
| 6 | +- Hardening the VCD `$comment` parser with an **exact-token terminator** closed a |
| 7 | + real regression vector: vendor comments that contain the substring `$end` no |
| 8 | + longer confuse the signal dictionary. A single regression test with an embedded |
| 9 | + `$end`-like token prevents future heuristic drift. |
| 10 | +- Adding `--csv-channel <name>` and extending header-name auto-detection to |
| 11 | + `cclk`, `vccint`, `vccaux`, `ain`, `a0`, `channel0` makes multi-channel |
| 12 | + instrument exports first-class. The explicit selector is simpler than trying to |
| 13 | + guess every vendor dialect. |
| 14 | +- Proving PVT envelope **monotonicity in temperature** and **antitonicity in |
| 15 | + VCCINT** in both Lean 4 and Rust guards the shape of the placeholder envelope |
| 16 | + independently of the exact coefficients. The symbolic Lean proofs and the |
| 17 | + numeric Rust tests reinforce each other. |
| 18 | +- Documenting the full `measured-to-lean --standalone` lake-package workflow in |
| 19 | + `fpga/HARDWARE_SSOT.md` turned a "works in tests" feature into a reproducible |
| 20 | + user protocol. |
| 21 | +- Catching the invalid `import Trinity.BitstreamConfig` in the `--standalone` |
| 22 | + output showed that **string assertions are not enough** for generated-code |
| 23 | + tests: the integration test that runs `lake build` on the generated file is |
| 24 | + what found the bug. |
| 25 | + |
| 26 | +### What changed behavior |
| 27 | +- `cli/tri/src/fpga.rs`: VCD `$comment` exact-terminator parsing; |
| 28 | + `--csv-channel` option and multi-channel header detection; |
| 29 | + `test_pvt_half_ns_monotone_in_temp` / `test_pvt_half_ns_antitone_in_vccint`; |
| 30 | + `test_parse_cclk_csv_explicit_channel_select`; |
| 31 | + `--standalone` template now imports only `Trinity.TernaryFPGABoot`. |
| 32 | +- `proofs/lean4/Trinity/TernaryFPGABoot.lean`: added |
| 33 | + `pvt_half_ns_monotone_in_temp` and `pvt_half_ns_antitone_in_vccint`. |
| 34 | +- `fpga/HARDWARE_SSOT.md`: added §3.6.16 standalone lake-package workflow. |
| 35 | +- `docs/NOW.md`: W419 close-out and W420 setup. |
| 36 | +- Close-out artifacts: `docs/reports/WAVE_LOOP_419_REPORT.md`, |
| 37 | + `docs/reports/FPGA_LOOP_EVIDENCE_W419_2026-07-05.md`, and |
| 38 | + `docs/reports/FPGA_LOOP_COOPERATION_W420_2026-07-05.md`. |
| 39 | + |
| 40 | +### Patterns to reuse |
| 41 | +- For section-skipping parsers, match the **exact delimiter token** and clear |
| 42 | + state immediately when the delimiter appears on the same line; do not use |
| 43 | + substring heuristics. |
| 44 | +- When adding user-facing selectors to instrument parsers, also add a |
| 45 | + regression test that would fail if the selector is ignored or the fallback |
| 46 | + overrides it. |
| 47 | +- For placeholder model coefficients, prove the **shape** (monotonicity, |
| 48 | + bounds) symbolically and add a numeric operating-rectangle regression. This |
| 49 | + combination survives coefficient updates as long as the shape constraints |
| 50 | + remain. |
| 51 | +- For generated-code deliverables, the canonical integration test is to |
| 52 | + **type-check the generated artifact in a fresh package** that depends on the |
| 53 | + real library via a local path. String snapshots catch regressions; package |
| 54 | + builds catch invalid imports and namespaces. |
| 55 | + |
| 56 | +### Anti-patterns to avoid |
| 57 | +- Do not assert only string contents for generated source files; always exercise |
| 58 | + the downstream compiler/package build. |
| 59 | +- Do not import a Lean 4 **namespace** as if it were a module. Names inside a |
| 60 | + file are reached through the file's module name, then opened with `open` if |
| 61 | + needed. |
| 62 | +- Do not let a parser heuristic silently override an explicit user option; |
| 63 | + resolve precedence clearly (explicit option > named header > numeric fallback). |
| 64 | + |
3 | 65 | ## 2026-07-04 — Wave Loop 418 (Variant C fallback: PVT regression, instrument import, standalone Lean integration) |
4 | 66 |
|
5 | 67 | ### What worked |
|
0 commit comments