Skip to content

Commit 169793c

Browse files
author
CID Agent
committed
cid(review): PASS — cpp gen_iscc_id_v1 mints IDv1, fan-out complete on all 11 surfaces
1 parent 148ffe8 commit 169793c

3 files changed

Lines changed: 47 additions & 36 deletions

File tree

.claude/context/handoff.md

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,45 @@
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
22

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
64

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.
1510

1611
**Verification:**
1712

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).

.claude/context/issues.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ drop-in-compatibility gap is **per-surface enum wrappers** that predate V1: the
5454
`iscc_lib.iscc_decode` raises `1 is not a valid VS`. Every surface with its own version enum needs
5555
the same widening plus a round-trip test (`iscc_decode(gen_iscc_id_v1(...)["iscc"])`).
5656

57-
Separately, the minting function `gen_iscc_id_v1` is missing on **cpp only** (Go, Python, napi,
58-
wasm, ffi, jni, rb, uniffi=Swift+Kotlin and dotnet now expose the canonical shape). `iscc-core` has
59-
no IDv1 decoder, so no surface gets one — the generic decode path covers it.
57+
The minting function `gen_iscc_id_v1` now exists on **all 11 surfaces** (Go, Python, napi, wasm,
58+
ffi, jni, rb, uniffi=Swift+Kotlin, dotnet, cpp — cpp landed iter 188), so the minting fan-out is
59+
complete. `iscc-core` has no IDv1 decoder, so no surface gets one — the generic decode path covers
60+
it.
6061

6162
Canonical definition, validation rules, codec changes, the `#[non_exhaustive]` requirement, the IDv0
6263
exclusion, test placement and the full "Verified when" list are in

.claude/context/learnings.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ maintains this file — append, prune, and archive completed-phase entries to `l
2727
out-of-narrowing values → delegate ordering to core safely; only wide-input surfaces need
2828
in-order binding checks. **Ruby (185) narrows Integer→`i64` in Magnus marshalling BEFORE the fn
2929
body**`RangeError` order break for `> i64::MAX` only (issues.md; fix: validate in Ruby)
30-
- **IDv1 fan-out** (done: 179 Go, 180 napi, 182 ffi, 184 jni, 185 rb, 186 uniffi=Swift+Kotlin, 187
31-
dotnet C# `GenIsccIdV1(ulong,ushort,byte)`; owed cpp): exact-width **unsigned** args mean
30+
- **IDv1 minting fan-out COMPLETE at 188** (179 Go, 180 napi, 181 wasm, 182 ffi, 184 jni, 185 rb,
31+
186 uniffi=Swift+Kotlin, 187 dotnet C# `GenIsccIdV1(ulong,ushort,byte)`, 188 cpp header-only
32+
`gen_iscc_id_v1(uint64_t,uint16_t,uint8_t)``IsccIdResult`): exact-width **unsigned** args mean
3233
callers can't overflow → no Ruby-style marshalling gap, no binding guard; surface fn mirrors
3334
`gen_text_code_v0`/`GenMetaCodeV0`; decode round-trips via each surface's `iscc_decode`
3435
returning a bare int/`byte` `version` (NO enum-widening, no result-type change), then bit-math

0 commit comments

Comments
 (0)