test(pq-jws/ts): phase 4 - testing docs and package polish (ENG-1643)#21
test(pq-jws/ts): phase 4 - testing docs and package polish (ENG-1643)#21eacet wants to merge 1 commit intofeature/eng-1642from
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1bcc49099
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
| }; | ||
|
|
||
| const scriptDir = dirname(new URL(import.meta.url).pathname); |
There was a problem hiding this comment.
Use fileURLToPath for script directory resolution
Building scriptDir from new URL(import.meta.url).pathname is not path-safe: file URLs keep percent-encoding and Windows drive formatting, so running this script from a path containing spaces/unicode (or on Windows) can resolve sourcePath/output paths incorrectly and fail to read or write fixtures. Converting with fileURLToPath(import.meta.url) before dirname(...) avoids those environment-dependent failures.
Useful? React with 👍 / 👎.
|
|
||
| describe('fixture manifest integrity', () => { | ||
| it('matches fixture content hash', () => { | ||
| expect(sha256(fixtureText)).toBe(manifest.fixtureSha256); |
There was a problem hiding this comment.
Avoid line-ending-sensitive fixture hash checks
This integrity assertion hashes raw file text, which makes it sensitive to checkout newline conversion (for example core.autocrlf=true on Windows): semantically identical JSON with \r\n line endings produces a different digest than the committed manifest value, causing false test failures. Hashing a canonicalized representation (or enforcing LF via attributes) would keep the check stable across developer environments.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR completes Phase 4 of the pq-jws TypeScript implementation by adding comprehensive testing infrastructure, documentation, and package polish. Key Changes
Testing ApproachThe testing strategy uses a template-replay model for deterministic reproducibility since ML-DSA key generation and signing are randomized in OQS OpenSSL. The fixture generator ensures canonical ordering and generates a manifest with SHA256 hash for integrity verification in CI. Code QualityAll code follows proper TypeScript patterns with well-defined types, appropriate error handling, and clear separation of concerns. The fixture-driven tests validate parsing, serialization, round-trip consistency, and signature verification logic for both positive and negative cases. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: f1bcc49 |

Summary
Package(s)
Languages
Checklist
biome check,cargo fmt)Related Issues