René's URL Explorer Experiment


Title: fix(knowledge): align document tag provenance selections with the serialized request by waleedlatif1 · Pull Request #6332 · simstudioai/sim · GitHub

Open Graph Title: fix(knowledge): align document tag provenance selections with the serialized request by waleedlatif1 · Pull Request #6332 · simstudioai/sim

X Title: fix(knowledge): align document tag provenance selections with the serialized request by waleedlatif1 · Pull Request #6332 · simstudioai/sim

Description: Problem Same bug class as the selectTableRowSecretProvenance outage fixed in #6325: a private-provenance producer counting pre-serialization semantics while the consumer counts post-serialization. Knowledge document writes (knowledge_create_document, knowledge_upsert_document): Producer — selectKnowledgeDocumentWriteSecretProvenance counted one name/value selection pair per parseDocumentTags entry. parseDocumentTags keeps an entry whose value is merely truthy, then coerces value: String(entry.value). Consumer — parseKnowledgeDocumentTagProvenanceTargets builds targets from the serialized documentTagsData and drops entries where value === ''. resolveKnowledgeWriteSecretProvenance rejects the write with HTTP 400 when bundle.selections.length !== selectionKeys.length. So any tag value that is truthy before coercion but stringifies to empty — [], [null], [undefined], an object whose toString() returns '' — was counted by the tool and dropped by the route. Reproduced by executing both parsers against [{ tagName: 'kept', value: 'value' }, { tagName: 'dropped', value: [] }]: the tool emitted 6 selection keys, the route derived 4. Not observed in production logs — found by code-level audit. Semantics Drop, matching the route. The functional write path agrees already: resolveDocumentTags skips any tag whose value fails its hasValue check, so an empty-stringifying tag never persists a value and has nothing to attribute provenance to. Fix Following the update_chunk pattern (its selector mirrors its own body builder exactly), the producer now describes exactly what goes on the wire: it runs the same formatDocumentTagsForAPI(parseDocumentTags(...)) the body builder runs, then feeds the resulting documentTagsData through the same target parser the route uses. parseKnowledgeDocumentTagProvenanceTargets moved from lib/knowledge/secret-provenance.ts (which pulls in @sim/db) to the db-free lib/knowledge/secret-provenance-selection.ts both sides already import, so there is one parser, not two rules that can drift. Tests apps/sim/tools/knowledge/secret-provenance.test.ts asserts the tool's selection keys equal the route-derived target keys for each divergent value, plus a non-divergent case. Verified red before the fix (expected 6 keys to equal 4), green after. Audit of the other provenance producer/consumer pairs Pair Status knowledge document tags fixed here table rows (selectTableRowSecretProvenance ↔ createTableWriteProvenanceTargets) Aligned since #6325. Residual theoretical gap: the producer filters only undefined, but JSON.stringify also drops function- and symbol-valued keys, which the consumer's Object.entries over the parsed row would then not see. Not reachable from JSON-sourced tool params — left alone. workspace files (file_write, file_append) Fixed arity ['content'] on both sides. memory (memory_add) Fixed arity 1 on both sides. knowledge chunks (upload_chunk, update_chunk) Fixed arity; update_chunk's conditional producer mirrors both its body builder and the route's validatedData.content === undefined check. workflow executor Fixed arity 1 on both sides. Checks bunx tsc --noEmit -p tsconfig.json — clean bun run lint — clean (9 pre-existing unrelated warnings) app/api/knowledge/secret-provenance.test.ts + new test — 14 passed tools/knowledge/knowledge.test.ts fails identically on a clean checkout (postcss/tailwind env issue), unrelated

Open Graph Description: Problem Same bug class as the selectTableRowSecretProvenance outage fixed in #6325: a private-provenance producer counting pre-serialization semantics while the consumer counts post-serialization. ...

X Description: Problem Same bug class as the selectTableRowSecretProvenance outage fixed in #6325: a private-provenance producer counting pre-serialization semantics while the consumer counts post-serialization. ...

Opengraph URL: https://github.com/simstudioai/sim/pull/6332

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:3e7bce20-6201-4fca-9b96-86bf82857f32
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE406:3FAE84:A8A6FD:E7CCA0:6AFB50AF
html-safe-nonce876132df73b210807a18ce0fd21860ec17a4fdc4c993b7c06a645703a4923e00
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDA2OjNGQUU4NDpBOEE2RkQ6RTdDQ0EwOjZBRkI1MEFGIiwidmlzaXRvcl9pZCI6IjcxNjI1NjEwMzY4NDEzNDExMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac43e3c2ca16b4bcd7c85bc1fedfd9b00147e2cf0c8ded1d8d6ae9478059718c9c
hovercard-subject-tagpull_request:4223266325
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6332/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altProblem Same bug class as the selectTableRowSecretProvenance outage fixed in #6325: a private-provenance producer counting pre-serialization semantics while the consumer counts post-serialization. ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6332/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6332%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6332%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6332/files
Reloadhttps://github.com/simstudioai/sim/pull/6332/files
Reloadhttps://github.com/simstudioai/sim/pull/6332/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/knowledge-tag-provenance-count-divergencehttps://github.com/simstudioai/sim/tree/fix/knowledge-tag-provenance-count-divergence
Conversation 7 https://github.com/simstudioai/sim/pull/6332
Commits 2 https://github.com/simstudioai/sim/pull/6332/commits
Checks 4 https://github.com/simstudioai/sim/pull/6332/checks
Files changed https://github.com/simstudioai/sim/pull/6332/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6332/files
fix(knowledge): align document tag provenance selections with the serialized request https://github.com/simstudioai/sim/pull/6332/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/6332/files
60df2df fix(knowledge): align document tag provenance selections with the ser… waleedlatif1 Aug 6, 2026 https://github.com/simstudioai/sim/pull/6332/commits/60df2dfca7a4a78e132d439669a70bb3a3777bc2
6e07db1 test(knowledge): use as const for the empty-stringifying tag fixture waleedlatif1 Aug 6, 2026 https://github.com/simstudioai/sim/pull/6332/commits/6e07db148e8b294ece7058d4f39283253117568a
Clear filters https://github.com/simstudioai/sim/pull/6332/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6332/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6332/files
secret-provenance.ts https://github.com/simstudioai/sim/pull/6332/files#diff-dfcbaa28d08a77beddf8aea9db1924dd742c6ec3a1868f11b7dd5936940b54d9
secret-provenance-selection.ts https://github.com/simstudioai/sim/pull/6332/files#diff-966315b985f04dc4ec1844027be7d5c6a9d7e226b7f47977ab902a5299501149
secret-provenance.ts https://github.com/simstudioai/sim/pull/6332/files#diff-79668df40a7e0c39ee6c4f5ac7eb3945da1a3752940303c36ebb6d76e70e13d7
secret-provenance.test.ts https://github.com/simstudioai/sim/pull/6332/files#diff-4d7838b37ce0e5a76009471ef47d5aa82f79d39ac5f8cd19502faf1b7735f8b7
secret-provenance.ts https://github.com/simstudioai/sim/pull/6332/files#diff-486d69912a530561dd20d42f1126aee244880e765938176a6da0950789b047a6
apps/sim/app/api/knowledge/secret-provenance.tshttps://github.com/simstudioai/sim/pull/6332/files#diff-dfcbaa28d08a77beddf8aea9db1924dd742c6ec3a1868f11b7dd5936940b54d9
View file https://github.com/simstudioai/sim/blob/6e07db148e8b294ece7058d4f39283253117568a/apps/sim/app/api/knowledge/secret-provenance.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6332/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6332/files#diff-dfcbaa28d08a77beddf8aea9db1924dd742c6ec3a1868f11b7dd5936940b54d9
https://github.com/simstudioai/sim/pull/6332/files#diff-dfcbaa28d08a77beddf8aea9db1924dd742c6ec3a1868f11b7dd5936940b54d9
apps/sim/lib/knowledge/secret-provenance-selection.tshttps://github.com/simstudioai/sim/pull/6332/files#diff-966315b985f04dc4ec1844027be7d5c6a9d7e226b7f47977ab902a5299501149
View file https://github.com/simstudioai/sim/blob/6e07db148e8b294ece7058d4f39283253117568a/apps/sim/lib/knowledge/secret-provenance-selection.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6332/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6332/files#diff-966315b985f04dc4ec1844027be7d5c6a9d7e226b7f47977ab902a5299501149
apps/sim/lib/knowledge/secret-provenance.tshttps://github.com/simstudioai/sim/pull/6332/files#diff-79668df40a7e0c39ee6c4f5ac7eb3945da1a3752940303c36ebb6d76e70e13d7
View file https://github.com/simstudioai/sim/blob/6e07db148e8b294ece7058d4f39283253117568a/apps/sim/lib/knowledge/secret-provenance.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6332/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6332/files#diff-79668df40a7e0c39ee6c4f5ac7eb3945da1a3752940303c36ebb6d76e70e13d7
https://github.com/simstudioai/sim/pull/6332/files#diff-79668df40a7e0c39ee6c4f5ac7eb3945da1a3752940303c36ebb6d76e70e13d7
apps/sim/tools/knowledge/secret-provenance.test.tshttps://github.com/simstudioai/sim/pull/6332/files#diff-4d7838b37ce0e5a76009471ef47d5aa82f79d39ac5f8cd19502faf1b7735f8b7
View file https://github.com/simstudioai/sim/blob/6e07db148e8b294ece7058d4f39283253117568a/apps/sim/tools/knowledge/secret-provenance.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6332/{{ revealButtonHref }}
apps/sim/tools/knowledge/secret-provenance.tshttps://github.com/simstudioai/sim/pull/6332/files#diff-486d69912a530561dd20d42f1126aee244880e765938176a6da0950789b047a6
View file https://github.com/simstudioai/sim/blob/6e07db148e8b294ece7058d4f39283253117568a/apps/sim/tools/knowledge/secret-provenance.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6332/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6332/files#diff-486d69912a530561dd20d42f1126aee244880e765938176a6da0950789b047a6
https://github.com/simstudioai/sim/pull/6332/files#diff-486d69912a530561dd20d42f1126aee244880e765938176a6da0950789b047a6
https://github.com/simstudioai/sim/pull/6332/files#diff-486d69912a530561dd20d42f1126aee244880e765938176a6da0950789b047a6
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.