Skip to content

Commit 545d4eb

Browse files
committed
docs(site): address Copilot review on conformance page
- conformance.mdx "Run it yourself": wrap each per-suite command in a subshell so `cd sdk/go` no longer leaks into the next line; the snippet is now runnable top-to-bottom from the repo root. - cross-sdk-tests/README: the surrounding commands run from cross-sdk-tests/, so point the count.py invocation at ../scripts/... and note the script resolves the repo root itself. - count.py: read vector JSON with explicit encoding="utf-8" for reproducible, locale-independent counts, and catch UnicodeDecodeError in main() so a non-UTF-8 file exits 1 (documented) instead of tracing back. Counts unchanged (total 69).
1 parent 40cee32 commit 545d4eb

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

cross-sdk-tests/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ All vector files use the same Ed25519 keypair so any SDK can verify receipts sig
3131

3232
## Vector counts
3333

34-
The per-set vector counts published on the Conformance page are generated from these files by [`scripts/conformance_matrix/count.py`](../scripts/conformance_matrix/count.py), so the numbers stay reproducible:
34+
The per-set vector counts published on the Conformance page are generated from these files by [`scripts/conformance_matrix/count.py`](../scripts/conformance_matrix/count.py), so the numbers stay reproducible. Run from this directory (the script resolves the repository root itself, so the output is the same from anywhere):
3535

3636
```sh
37-
python3 scripts/conformance_matrix/count.py # human-readable table
38-
python3 scripts/conformance_matrix/count.py --format md # Markdown for the page
37+
python3 ../scripts/conformance_matrix/count.py # human-readable table
38+
python3 ../scripts/conformance_matrix/count.py --format md # Markdown for the page
3939
```
4040

4141
## Running

scripts/conformance_matrix/count.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class VectorSet:
8888
counter: Callable[[dict[str, Any]], int]
8989

9090
def count(self) -> int:
91-
doc = json.loads((_REPO_ROOT / self.path).read_text())
91+
doc = json.loads((_REPO_ROOT / self.path).read_text(encoding="utf-8"))
9292
return self.counter(doc)
9393

9494

@@ -239,7 +239,7 @@ def main(argv: list[str] | None = None) -> int:
239239

240240
try:
241241
rows = collect()
242-
except (OSError, json.JSONDecodeError, KeyError) as err:
242+
except (OSError, UnicodeDecodeError, json.JSONDecodeError, KeyError) as err:
243243
print(f"error: could not count vectors: {err}", file=sys.stderr)
244244
return 1
245245

site/src/content/docs/conformance.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ Path filtering scopes each run to the changed surface: a change to the shared ve
5353

5454
## Run it yourself
5555

56-
The frozen vectors and the suites that consume them live in the repository. From a clone:
56+
The frozen vectors and the suites that consume them live in the repository. Run each line from the repository root; the per-suite commands use a subshell so the directory change does not leak into the next line:
5757

5858
```sh
5959
# Go: verify TS- and Python-signed receipts, reject the malformed corpus
60-
cd sdk/go && go test -tags=integration -v -run CrossLanguage
60+
(cd sdk/go && go test -tags=integration -v -run CrossLanguage)
6161

6262
# Python: verify Go- and TS-signed receipts
63-
cd sdk/py && uv run pytest tests/test_cross_language_go.py tests/test_cross_language_ts.py -v
63+
(cd sdk/py && uv run pytest tests/test_cross_language_go.py tests/test_cross_language_ts.py -v)
6464

6565
# TypeScript: verify Go- and Python-signed receipts
66-
cd sdk/ts && pnpm test -- cross-language
66+
(cd sdk/ts && pnpm test -- cross-language)
6767

6868
# Shared spec-example and version-pinned vector checks
69-
cd cross-sdk-tests && go test -tags=integration -v
69+
(cd cross-sdk-tests && go test -tags=integration -v)
7070

7171
# Regenerate the vector counts in the matrix above
7272
python3 scripts/conformance_matrix/count.py --format md

0 commit comments

Comments
 (0)