|
1 | | -## 2026-07-29 — Mint `gen_iscc_id_v1` on the C++ surface |
| 1 | +## 2026-07-29 — Review of: Mint `gen_iscc_id_v1` on the C++ surface |
2 | 2 |
|
3 | | -**Done:** Added `iscc::gen_iscc_id_v1(uint64_t, uint16_t, uint8_t)` returning `IsccIdResult` to the |
4 | | -header-only C++ wrapper, delegating to the already-shipped `iscc_gen_iscc_id_v1` FFI symbol. |
5 | | -Advances cpp 32→33 Tier 1 symbols — the 11th and final minting surface of the #43 IDv1 fan-out. |
| 3 | +**Verdict:** PASS |
6 | 4 |
|
7 | | -**Files changed:** |
8 | | - |
9 | | -- `packages/cpp/include/iscc/iscc.hpp`: added `struct IsccIdResult { std::string iscc; }` (after |
10 | | - `IsccCodeResult`) + `gen_iscc_id_v1` wrapper in the Gen-functions section (mirrors |
11 | | - `gen_meta_code_v0`: `UniqueString` + `check_ptr` + return `IsccIdResult`; no default args, no |
12 | | - binding-side guard). |
13 | | -- `packages/cpp/tests/test_iscc.cpp`: added tests 36 (golden `MAIGHFECJMOPMIAB`), 37 (realm=2 throws |
14 | | - `IsccError`), 38 (decode round-trip `.version == 1`); renumbered Unicode section to 39. |
| 5 | +**Summary:** The header-only C++ wrapper now mints IDv1 via idiomatic |
| 6 | +`iscc::gen_iscc_id_v1(uint64_t, uint16_t, uint8_t)` + `IsccIdResult`, delegating to the |
| 7 | +already-shipped `iscc_gen_iscc_id_v1` FFI symbol. This is the 11th and final minting surface of the |
| 8 | +#43 fan-out. Purely additive (1 header + 1 test file), faithful to next.md, no scope creep, no gate |
| 9 | +weakening. |
15 | 10 |
|
16 | 11 | **Verification:** |
17 | 12 |
|
18 | | -- `cargo build -p iscc-ffi` then |
19 | | - `git diff --quiet -- crates/iscc-ffi/include/iscc.h packages/dotnet/Iscc.Lib/NativeMethods.g.cs` |
20 | | - → CLEAN (no FFI/P-Invoke change, as expected). |
21 | | -- `uv run --with cmake cmake -B packages/cpp/build -DFFI_LIB_DIR=target/debug packages/cpp` + |
22 | | - `cmake --build` succeed; `LD_LIBRARY_PATH=target/debug ./packages/cpp/build/tests/test_iscc` → |
23 | | - **72 passed, 0 failed**, exit 0 (build showed benign "Clock skew detected" warnings only). |
24 | | -- `grep -c gen_iscc_id_v1 …/iscc.hpp` = 3; `struct IsccIdResult` present. |
25 | | -- `mise run check` → all prek hooks Passed (hygiene, formatting, release/docs/CI-table/Ruby parity). |
26 | | - |
27 | | -**Next:** #43 fan-out minting is now complete on all 11 surfaces. Remaining #43 work is the deferred |
28 | | -repo-wide Tier-1 **32→33 doc/count sweep** (stale `32` counts in CLAUDE.md/README files, |
29 | | -`gen_iscc_id_v1` API-doc entries per issues.md first bullet). #43 stays open (v0.6.0 blocker) until |
30 | | -that sweep lands. |
31 | | - |
32 | | -**Notes:** Pure additive change, no scope creep — count text and cpp README left untouched per |
33 | | -Not-In-Scope. Exact-width unsigned args (`uint64_t`/`uint16_t`/`uint8_t`) mean callers cannot pass |
34 | | -out-of-width values, so no `checked()`/range guard is needed; core re-validates in ts→hub→realm |
35 | | -order and a no-guard passthrough cannot reorder (matches ffi/dotnet pattern). `DecodeResult.version` |
36 | | -is a raw `uint8_t`, so the round-trip needed no enum widening. |
| 13 | +- [x] `cargo build -p iscc-ffi` then `git diff --quiet` on `iscc.h` + `NativeMethods.g.cs` → CLEAN — |
| 14 | + no FFI/P-Invoke change, as expected (symbol shipped iter 182). |
| 15 | +- [x] cmake configure + build succeed (only benign "Clock skew detected" warnings). |
| 16 | +- [x] `LD_LIBRARY_PATH=target/debug ./…/test_iscc` → **72 passed, 0 failed**, exit 0. |
| 17 | +- [x] `grep -c gen_iscc_id_v1 …/iscc.hpp` = 3; `struct IsccIdResult` present (1 match). |
| 18 | +- [x] `mise run check` — all prek hooks Passed (hygiene, formatting, release/docs/CI-table/Ruby |
| 19 | + parity). Working tree clean after (only runner-owned `iterations.jsonl` dirty). |
| 20 | +- [x] (probe) Golden oracle: `iscc_core` 1.3.0 (`--python 3.13`) |
| 21 | + `gen_iscc_id_v1(1751831876325218, 1, 0)` → `ISCC:MAIGHFECJMOPMIAB`, byte-for-byte matches the |
| 22 | + C++ golden test. |
| 23 | +- [x] (probe) Gate circumvention: `@{upstream}..HEAD` scan of all 4 unpushed commits — source |
| 24 | + changes are cpp-only, no suppressions/skips/threshold or hook weakening, no API break. |
| 25 | + |
| 26 | +**Issues found:** |
| 27 | + |
| 28 | +- (none) — exact-width unsigned args (`uint64_t`/`uint16_t`/`uint8_t`) mean callers can't pass |
| 29 | + out-of-width values, so no binding guard is needed; core re-checks in ts→hub→realm order and a |
| 30 | + no-guard passthrough can't reorder (matches ffi/dotnet). `DecodeResult.version` is a raw |
| 31 | + `uint8_t`, so no enum-widening. No new issue warranted. |
| 32 | + |
| 33 | +**Codex review:** Clean — no findings. Confirms the wrapper matches the FFI signature and the |
| 34 | +established RAII/error-handling patterns; a clean ASAN-enabled build passed with all 72 assertions. |
| 35 | + |
| 36 | +**Next:** #43 minting fan-out is now complete on all 11 surfaces. Two #43 items remain (v0.6.0 |
| 37 | +blocker stays open): (1) the **decode enum-widening** — surfaces with their own version enum still |
| 38 | +reject V1 (Python `VS` IntEnum defines only `V0`, so `iscc_lib.iscc_decode(gen_iscc_id_v1(...))` |
| 39 | +raises `1 is not a valid VS`; each such surface needs the widening + a round-trip test); (2) the |
| 40 | +repo-wide **Tier-1 32→33 doc/count sweep** (stale `32` counts + `gen_iscc_id_v1` API-doc entries per |
| 41 | +issues.md #43). Either is a good next step; the enum-widening is the more functional gap. |
| 42 | + |
| 43 | +**Notes:** cpp is a pure passthrough over a fixed-width FFI, so it inherits core's ordered |
| 44 | +validation with no binding-side guard. Count text and cpp README left untouched per Not-In-Scope. |
| 45 | +Updated the #43 issue's minting bullet to record cpp as done (all 11 surfaces mint). |
0 commit comments