Repository navigation
docs(stack): unwrap the OidcFederationStrategy Result in the README example - #1342
Conversation
…xample OidcFederationStrategy.create() returns a Result<OidcFederationStrategy, AuthFailure>, not the strategy. The README's Authentication example passed that envelope straight to config.authStrategy, so Encryption() failed with "[encryption]: Credential error: opts.strategy.getToken is missing". Reproduced against @cipherstash/stack 1.2.1. Unwrap it the way the Encryption() JSDoc and the stash-auth skill already do: check .failure, then pass .data. Fixed in the root README, its copy in the stack package, and the LockContext JSDoc example, which had the same mistake.
🦋 Changeset detectedLatest commit: 4b14ee6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation: /code-review medium followed by company-skills:cross-check-review-findings, run on head 4b14ee6.
Findings: none. No critical or blocking issues.
- The unwrap matches
create()returningResult<…, AuthFailure>(packages/auth/index.d.ts), andfailure.error.messageexists on everyAuthFailurevariant. - The root and package READMEs and the
LockContextJSDoc agree with theEncryption()andwasm-inlineJSDoc and thestash-auth/stash-encryptionskills. - No other
OidcFederationStrategy.create(...)example underREADME.md,skills/orstack/srcstill passes the unwrapped Result. - No skill change needed, and the patch changeset for
@cipherstash/stackis present. - No existing review threads or reviews to cross-check; the bot comments contain no findings.
Static review only. I did not run the example against a live CTS or ZeroKMS.
Generated by Claude Code
cipherstash-bot
left a comment
There was a problem hiding this comment.
Recommendation: 🟢 merge as it is
Nothing must change before merging. This pull request changes only documentation (two README copies, one JSDoc example) and adds a changeset. The new example unwraps the Result correctly. One follow-up is listed below.
Other findings not posted as comments
- Fix in a follow-up:
languages/typescript/packages/stack/__tests__/lock-context.test.ts:41passes theResultfromOidcFederationStrategy.create()straight toconfig.authStrategy. This is the same mistake this pull request fixes. WhenUSER_JWTis set, the tests fail withopts.strategy.getToken is missing. No workflow setsUSER_JWT, andtsconfig.typecheck.jsonchecks only*.test-d.tsfiles, so CI does not report it. This line is not in the diff. Fix: unwrap theResultwithif (strategy.failure) throw new Error(strategy.failure.error.message)and passstrategy.data.
How this review was made
| Agent | Model | Review type | Result |
|---|---|---|---|
| claude | claude-opus-5-5 | test-gap | 0 found, 0 posted |
| claude | claude-opus-5-5 | typescript | 0 found, 0 posted |
| codex | gpt-5.6-terra | test-gap | 0 found, 0 posted |
| codex | gpt-5.6-terra | typescript | 0 found, 0 posted |
Synthesis: claude-sonnet-5-5 merged the findings, removed duplicates and dropped findings it could not confirm in the code. 0 posted finding(s) were raised by two or more models.
Plain language: claude-sonnet-5-5 read every comment as a new reader would. No comment had a problem that stopped the reader acting, so none was rewritten.
Stack: not part of a stack.
Context loaded: the description, 0 linked issue(s) and 4 discussion entries.
The Authentication example in the README passes
OidcFederationStrategy.create(...)straight toconfig.authStrategy.create()returns aResult<OidcFederationStrategy, AuthFailure>({ data } | { failure }), not the strategy, soEncryption()fails with:Reproduced against published
@cipherstash/stack@1.2.1with Bun.The fix unwraps the Result before passing it, the same way the
Encryption()JSDoc and thestash-authskill already do:This version was checked end to end against a real CTS + ZeroKMS.
It's applied to the root
README.md, its copy atlanguages/typescript/packages/stack/README.md(the one that ships to npm), and theLockContextJSDoc example instack/src/identity/index.ts, which had the same mistake.There's a patch changeset for
@cipherstash/stackso the npm README gets the fix.Summary by CodeRabbit