Skip to content

docs(pq-key-fingerprint/ts): phase 3 - add package documentation (ENG-1762)#24

Merged
eacet merged 1 commit intomainfrom
feature/eng-1762
Mar 10, 2026
Merged

docs(pq-key-fingerprint/ts): phase 3 - add package documentation (ENG-1762)#24
eacet merged 1 commit intomainfrom
feature/eng-1762

Conversation

@eacet
Copy link
Copy Markdown
Member

@eacet eacet commented Mar 4, 2026

Summary

Package(s)

Languages

  • TypeScript
  • Rust

Checklist

  • Tests pass for all modified packages
  • Linting/formatting passes (biome check, cargo fmt)
  • Both language implementations are consistent (or noted as follow-up)
  • Package README updated if public API changed
  • No unnecessary dependencies added

Related Issues

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR adds comprehensive documentation for the pq-key-fingerprint TypeScript package with usage examples, API reference, and a compatibility note. The documentation is accurate and reflects the actual implementation.

Key observations:

  • Usage examples are correct and consistent with the actual source code (fingerprint.ts, types.ts, errors.ts).
  • The API section correctly documents FingerprintDigest, FingerprintEncoding, FingerprintOptions, FingerprintResult, and all five exported functions.
  • The API section could be enhanced by defining the referenced types (PublicKeyInput, AlgorithmName, PQJwk) to improve self-containedness and reduce the need for readers to cross-reference external packages.
  • The four exported error subclasses (InvalidFingerprintInputError, InvalidKeyTypeError, UnsupportedDigestError, RuntimeCapabilityError) are not documented, which limits developers' ability to write fine-grained error handling.
  • FingerprintOptions is documented as an interface, but the project convention prefers type for simple option bags without inheritance.

Confidence Score: 4/5

  • Safe to merge — documentation-only change with no runtime impact; minor completeness and style improvements are suggested.
  • This PR only modifies a README file and introduces no code changes. All documented behaviours match the actual implementation. Three comments suggest documentation completeness and style improvements: adding type definitions for better self-containedness, documenting exported error classes for fine-grained error handling, and using type instead of interface to align with project convention. None of these affect correctness or safety—they are enhancements to documentation quality.
  • No files require special attention. All feedback targets documentation completeness and style consistency.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Caller] -->|bytes + alg| B[fingerprintPublicKeyBytes]
    A -->|PublicKeyInput| C[fingerprintPublicKey]
    A -->|SPKI DER Uint8Array| D[fingerprintSPKI]
    A -->|PEM string| E[fingerprintPEM]
    A -->|PQJwk| F[fingerprintJWK]

    B --> G[normalizePublicKeyInput / build KeyData]
    C --> G
    D -->|fromSPKI - pq-key-encoder| G
    E -->|fromPEM - pq-key-encoder| G
    F -->|fromJWK - pq-key-encoder| G

    G --> H{type === 'public'?}
    H -->|No| ERR1[InvalidKeyTypeError]
    H -->|Yes| I[digestBytes via WebCrypto subtle.digest]
    I -->|unavailable| ERR2[RuntimeCapabilityError]
    I -->|digest result Uint8Array| J[encodeFingerprint]

    J -->|hex default| K[string - hex]
    J -->|base64| L[string - base64]
    J -->|base64url| M[string - base64url]
    J -->|bytes| N[Uint8Array]

    subgraph ErrorBoundary [withErrorBoundary]
        G
        H
        I
        J
    end

    ERR1 --> OUT[FingerprintError thrown to caller]
    ERR2 --> OUT
Loading

Last reviewed commit: cf30961

Copy link
Copy Markdown
Member Author

eacet commented Mar 10, 2026

Merge activity

  • Mar 10, 4:45 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 10, 4:49 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 10, 4:50 PM UTC: @eacet merged this pull request with Graphite.

@eacet eacet changed the base branch from feature/eng-1761 to graphite-base/24 March 10, 2026 16:46
@eacet eacet changed the base branch from graphite-base/24 to main March 10, 2026 16:47
@eacet eacet force-pushed the feature/eng-1762 branch from cf30961 to 569c465 Compare March 10, 2026 16:48
@eacet eacet merged commit c8e30e0 into main Mar 10, 2026
6 checks passed
@eacet eacet deleted the feature/eng-1762 branch March 10, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant