Repository navigation
Conversation
|
@anhnt256 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
🤖 auto-maintain reviewAutomated, advisory triage for
Review panel: 🔴 high highest severity just-bash maintainer code review: 🟡 medium
General code review: 🟡 medium
Adversarial security: 🔴 high
Adversarial security (second opinion): 🔴 high
Standard Bash and host portability: 🔴 high
Posted by auto-maintain. This automated code review is advisory; a human maintainer makes the call. |
privatenumber
left a comment
There was a problem hiding this comment.
Pushed follow-ups covering edge cases found in review:
- Enforce work and recursion depth limits across
Paren,Pipe,Field,Index, andIterateinupdateRecursive. - Preserve special object keys (such as
constructor) safely onIterateupdates. - Evaluate dynamic
Indexexpressions against pipe-stage input, support multi-index updates, and avoid creating missing parent containers when an index selection is empty. - Align
=RHS evaluation,null/primitive container handling, compound assignment limits/arithmetic (+= null,/= 0),yqcurrentPathpropagation, and multi-documentyq -ioutput.
All 845 jq/yq/query-engine tests, 262 xan tests, typecheck, and lint pass. Looks good to merge.
| (current, _selected, currentCtx) => { | ||
| const results = evaluate(current, valueExpr, currentCtx); | ||
| if (results.length > 0) return results[0]; | ||
| markDeletion(currentCtx.updatePath); | ||
| return noSelection; |
Fixes #783
Problem
(.rows[] | select(.id == "a")).s = "y"silently wrote"s": "y"at thedocument root (exit 0) instead of updating the selected element. The same
happened for
|=, forgetpath(...) |= ..., and even for static pathsthrough a parenthesized pipe such as
(.a | .b) = 1.Root cause:
updateRecursiveinpackages/just-bash/src/commands/query-engine/evaluator.tshad no
Parencase, so a parenthesized path fell intodefault: return transform(val)and applied the update to the current value; and the
Pipecase applied theright-hand update at the root instead of inside the left-hand selection.
Fix
Parennodes inupdateRecursive.Pipecase to apply the right-hand update inside the value theleft-hand path selects.
Invalid path expression in assignment: ... is not supported(exitcode 5) for path nodes that cannot be resolved to static paths yet
(
select(),map(),first(),getpath(), ...), instead of silentlywriting to the wrong location — the interim the issue asks for until full
path-through-filter support lands.
Verification
packages/just-bash/src/commands/jq/jq.update-path.test.ts(9 tests):the three repro cases from jq: assignment through select() writes to the root instead of the selected element #783 now fail with exit 5, parenthesized
static pipes now update in place, plain nested assignment unchanged.
src/commands/jq/— 377 passed;src/spec-tests/jq/— 768 passed.tsc --noEmitclean,biome checkclean.