feat(pq-oid/ts): phase 3 - add migration compatibility layer (ENG-1916)#28
feat(pq-oid/ts): phase 3 - add migration compatibility layer (ENG-1916)#28
Conversation
Greptile SummaryThis PR introduces a migration compatibility layer for the Key changes:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Consumer["Consumer code"]
subgraph pq-oid ["pq-oid (compatibility path)"]
OID_toJOSE["OID.toJOSE() ⚠️ deprecated"]
OID_fromJOSE["OID.fromJOSE() ⚠️ deprecated"]
OID_toCOSE["OID.toCOSE() ⚠️ deprecated"]
OID_fromCOSE["OID.fromCOSE() ⚠️ deprecated"]
end
subgraph pq-algorithm-id ["pq-algorithm-id (canonical)"]
toJose["toJose()"]
fromJose["fromJose()"]
toCose["toCose()"]
fromCose["fromCose()"]
toOid["toOid()"]
fromOid["fromOid()"]
toX509["toX509AlgorithmIdentifier()"]
fromX509["fromX509AlgorithmIdentifier()"]
end
Consumer -->|"legacy / compat"| pq-oid
Consumer -->|"new code (migrate here)"| pq-algorithm-id
OID_toJOSE -.->|"replace with"| toJose
OID_fromJOSE -.->|"replace with"| fromJose
OID_toCOSE -.->|"replace with"| toCose
OID_fromCOSE -.->|"replace with"| fromCose
|
There was a problem hiding this comment.
LGTM — straightforward deprecation annotations and documentation updates.
Extended reasoning...
Overview
This PR adds a migration compatibility layer for pq-oid/ts as phase 3 of the pq-algorithm-id rollout. It touches three files: pq-oid/ts/src/index.ts (import aliasing + @deprecated JSDoc tags on JOSE/COSE exports), pq-oid/ts/README.md (migration note + new pq-algorithm-id usage example), and pq-algorithm-id/ts/README.md (comprehensive API documentation).
Security risks
None. The code changes are purely mechanical — renaming imports to add aliased re-exports with deprecation annotations. No runtime behavior changes. The packages deal with post-quantum algorithm identifiers (OIDs, COSE/JOSE mappings), but this PR does not modify any mapping logic or cryptographic code.
Level of scrutiny
Low scrutiny is appropriate. The index.ts changes are a textbook deprecation pattern: alias the internal import, re-export with a @deprecated JSDoc tag. The README changes are documentation only. No tests need updating since the exports are functionally identical.
Other factors
The inline bug comment identifies a pre-existing documentation error in pq-oid/ts/README.md where the COSE value for ML-DSA-65 is shown as -48 (should be -49). This error predates this PR — the PR merely makes it more visible by adding a correct example (toCose("ML-DSA-65"); // -49) alongside the old incorrect one. The bug is worth fixing but is not a blocker for this PR since it is in a code comment (README example), not executable code, and was not introduced by these changes.

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