Repository navigation
fix(workflow-code): release review follow-ups for the knowledge download cap, regex hardening and skill docs - #10304
Merged
Conversation
…oad cap, regex hardening and skill docs - v2 knowledge document download serves originals up to the 100 MiB stored-document limit instead of the 25 MiB text-extraction cap; parsing reads keep the 25 MiB default - rewrite three polynomial-backtracking regexes linearly: the CLI path filter's trailing slashes (stripTrailingSlashes), suggestBuilder's verb split, and referencedBuilders' call scan (the `(` is checked after a greedy chain match) - escape the core declaration name interpolated into a RegExp - add-column-type skill and workflow-code rule: apps/sim/ path prefix, valueType() name - record why publish-sim-cli does not watch bun.lock - sim-cli and workflow-sdk depend on @sim/testing for expectLinearGrowth; sim-cli tests adopt its jsonResponse helper and utils-helpers mock
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] This PR appears safe to merge, with no actionable issues found. SummaryThis PR lets raw knowledge-document downloads use the 100 MiB stored-file limit while keeping the lower default for parsing reads.
Explicitly acknowledged by
Reviews (1) · Last reviewed commit: "fix(workflow-code): release review follo..." · Reviewed by Greptile |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups for the review threads on #10299 that cover workflows-as-code code.
Fixed
GET /api/v2/knowledge/{kb}/documents/{doc}/contentinherited the 25 MiB text-extraction cap, so originals between 25 and 100 MiB answered 413. The route now passesMAX_KNOWLEDGE_DOCUMENT_FILE_SIZE(100 MiB, the stored-document limit and the shared buffered-read ceiling).readOriginalKnowledgeDocumentaccepts up to that limit but keeps the 25 MiB default, which the parsing caller (files readin the agent CLI) relies on.add-column-typenow namesapps/sim/lib/workspace-source/.../codec.test.tsandvalueType(). The same stalecolumnType()in.claude/rules/sim-workflow-code.mdis fixed, and the Cursor projection was regenerated.filterForms(sim-cli): trailing slashes are now stripped withstripTrailingSlashes.splitVerb(workflow-code): matches/^[a-z]*/and slices the rest, where the old/^([a-z]+)(.*)$/failed on a newline.referencedBuilders(workflow-sdk): matches the dotted chain greedily and then checks for(with a sticky regex. The old\s*\(tail made every character of a call-less chain a retry point, so a long string literal in a workflow file cost seconds to minutes.escapeRegExp. The name is always an SDK core export or special builder, so this was not exploitable; escaping just makes the pattern literal by construction.Declined
bun.lockin the publish trigger (cubic): recorded in the workflow comment. 10 of the last 100 staging merges touched the lockfile, and almost none of those moved a package the CLI bundles. Watched packages change about 5 times a day, so a bundle-relevant lock bump ships with the next one anyway. An audit runs on PRs and can only fail them; it cannot cause a publish.backoffWithJitteralready supplies the jitter, and the flagged division and rounding isMath.ceil(waitMs / 1000)in a stderr notice.Tests
expectLinearGrowthcases insim-cli/.../source-status.test.ts,workflow-code/.../compile/scaling.test.tsandworkflow-sdk/.../codegen/generate.test.ts. On the pre-fix code they fail at 55x–66x growth against a 20x bound.apps/sim/lib/knowledge/__integration__/original-download.integration.tsruns the real route with a real workspace API key, Postgres and storage. It serves a 26 MiB original byte-for-byte, and still answers 413 past 100 MiB. On the pre-fix code it fails: reverting the route gives 413, reverting the use case gives 400.@sim/testing. That brings sim-cli undercheck:test-patterns, so four sim-cli tests now use itsjsonResponseandutils-helpersmock instead of local copies.Follow-up: the download still buffers the whole original. Streaming it through
downloadFileStreamwould bound memory per request.