feat(docs): add opt-in mask-pii setting for Ask AI#17040
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
AI Review Summary
The PR threads a new opt-in mask-pii setting from docs.yml through to the FDR write config. There's a mismatch between the zod schema (which uses the raw YAML key mask-pii) and the resolver code that reads a camelCased maskPii, which likely breaks the feature at runtime.
- 🔴 1 critical issue(s)
- 🔵 1 suggestion(s)
| })) | ||
| } as DocsV1Write.DocsConfig["aiChatConfig"]) | ||
| })), | ||
| maskPii: this.parsedDocsConfig.aiChatConfig.maskPii |
There was a problem hiding this comment.
🔴 critical
this.parsedDocsConfig.aiChatConfig originates from the zod AIChatConfig schema, where the field is "mask-pii", not maskPii. Unless there's a serialization step between the zod-parsed config and parsedDocsConfig that converts to camelCase (the generated SDK serialization does, but the zod schema doesn't), this.parsedDocsConfig.aiChatConfig.maskPii will always be undefined and the setting will silently never propagate. Verify which type parsedDocsConfig.aiChatConfig actually is and use the matching key.
| # yaml-language-server: $schema=../../../../../fern-changes-yml.schema.json | ||
|
|
||
| - summary: | | ||
| Add an opt-in `mask-pii` setting under `ai-chat` in docs.yml. When enabled, personally |
There was a problem hiding this comment.
🔵 suggestion
Changelog says the setting is under ai-chat, but the PR description says it applies to ai-search (with ai-chat deprecated). Point users at the current block name to avoid confusion.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Docs Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on
Docs generation runs |
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Description
Linear ticket: Refs
Adds an explicit, opt-in
mask-piisetting to the Ask AI (ai-search/ deprecatedai-chat) block indocs.yml. PII masking is off by default; it is only enabled when a customer setsmask-pii: true. The masking itself happens client-side in the docs bundle (separate fern-platform PR) — this PR only threads the new setting fromdocs.ymlthrough the CLI into the docs config sent to FDR.Config flow:
Changes Made
"mask-pii": optional<boolean>to the docs-yml source definition (fern/apis/docs-yml/definition/docs.yml)."mask-pii"to theAIChatConfigzod schema inDocsYmlSchemas.ts.pnpm docs:generate,pnpm jsonschema):AiChatConfignow carriesmaskPiimapped to/from themask-piiYAML key.maskPiithroughDocsDefinitionResolverinto the FDR write config.undefined(off by default), explicittrue/falsepreserved.feat).Testing
@fern-api/configuration(DocsYmlSchemas.test.ts) passing.pnpm docs:generate+pnpm jsonschemaproduce no unexpected diffs; hand-written generated types match codegen output.pnpm format:checkandturbo compile(configuration, configuration-loader, docs-resolver) + docs-resolver tests passing.Link to Devin session: https://app.devin.ai/sessions/7c9f531bc08b4a7f8c7eb1282d1aa4a8