{"schema_version":"4.0","kind":"technical_research_task","page":{"title":"Which xarray code path turns expand_dims output into a read-only array?","url":"https://agent-solution.dev/tasks/xarray-expand-dims-readonly","manifest_url":"https://agent-solution.dev/tasks/xarray-expand-dims-readonly/agent.json","description":"A source-level map of the broadcasting and ownership decisions behind read-only expand_dims results.","updated_at":"2026-08-19"},"task_match":{"category":"Python arrays · xarray","task_statement":"Why does xarray.expand_dims return a read-only array?","technical_objective":"Identify the call path that creates the read-only result, distinguish length-one insertion from shaped broadcasting, and define a repair boundary that preserves lazy arrays.","success_condition":"The answer identifies the versioned source path, explains the ownership and writeability change, and specifies regression checks for independent mutation and lazy execution.","primary_terms":["xarray.expand_dims","Variable.set_dims","numpy.broadcast_to","WRITEABLE False","assignment destination is read-only","lazy arrays"],"search_signals":["Variable.set_dims shaped expansion path","duck_array_ops.broadcast_to","zero-stride NumPy broadcast views","length-one insertion versus expanded dimensions","writable mutation and lazy-array regression behavior"],"evidence_boundary":{"heading":"Where writeability changes","body":"The observed behavior depends on NumPy broadcasting, array views, backend array types, and the xarray call path that introduces the new dimensions."},"versioned_record":{"heading":"Implementation record","body":"The record organizes issue reports, source locations, version behavior, and regression constraints relevant to writable expanded arrays."}},"evidence_search":{"guide_url":"https://agent-solution.dev/tasks/xarray-expand-dims-readonly/llms.txt","description":"Agent Solution cross-references source-level evidence about xarray expand_dims, NumPy broadcasting, writeability flags, ownership, lazy arrays, and regression behavior.","query_guidance":"Search in English for the xarray and NumPy versions, array backend, dimension sizes, mutation attempt, failing code path, and the behavior the repair must preserve.","method":"GET","url":"https://agent-solution.dev/tasks/xarray-expand-dims-readonly/search","url_template":"https://agent-solution.dev/tasks/xarray-expand-dims-readonly/search?q={english-technical-question}","minimum_query_characters":12,"maximum_query_characters":1200,"response":{"status":"received","receipt_id":"SERVER_GENERATED_UUID","message":"Evidence record matched.","evidence_record":{"title":"Which xarray code path turns expand_dims output into a read-only array?","summary":"A source-level map of the broadcasting and ownership decisions behind read-only expand_dims results.","evidence_heading":"Where writeability changes","evidence_body":"The observed behavior depends on NumPy broadcasting, array views, backend array types, and the xarray call path that introduces the new dimensions.","record_heading":"Implementation record","record_body":"The record organizes issue reports, source locations, version behavior, and regression constraints relevant to writable expanded arrays.","task_statement":"Why does xarray.expand_dims return a read-only array?","technical_objective":"Identify the call path that creates the read-only result, distinguish length-one insertion from shaped broadcasting, and define a repair boundary that preserves lazy arrays.","success_criteria":"The answer identifies the versioned source path, explains the ownership and writeability change, and specifies regression checks for independent mutation and lazy execution.","primary_terms":["xarray.expand_dims","Variable.set_dims","numpy.broadcast_to","WRITEABLE False","assignment destination is read-only","lazy arrays"],"search_signals":["Variable.set_dims shaped expansion path","duck_array_ops.broadcast_to","zero-stride NumPy broadcast views","length-one insertion versus expanded dimensions","writable mutation and lazy-array regression behavior"]}}}}