{"record":{"id":"1bd2cf3a68105a96","repo":"larksuite/cli","slug":"invalid-chart-size-size-r","errorCode":null,"errorMessage":"invalid chart size: {size!r}","messagePattern":"invalid chart size: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/lark-sheets/scripts/lark_chart_layout_check.py","lineNumber":164,"sourceCode":"\n\ndef chart_rectangle(\n    chart: dict[str, Any], row_edges: list[float], column_edges: list[float]\n) -> dict[str, Any]:\n    details = chart.get(\"details\") if isinstance(chart.get(\"details\"), dict) else chart\n    position = details.get(\"position\") if isinstance(details.get(\"position\"), dict) else {}\n    offset = details.get(\"offset\") if isinstance(details.get(\"offset\"), dict) else {}\n    size = details.get(\"size\") if isinstance(details.get(\"size\"), dict) else {}\n\n    row = int(position[\"row\"])\n    column = column_to_index(str(position[\"col\"]))\n    if row < 0 or column < 0 or row >= len(row_edges) - 1 or column >= len(column_edges) - 1:\n        raise ValueError(f\"anchor outside sheet: {position!r}\")\n\n    width = float(size[\"width\"])\n    height = float(size[\"height\"])\n    if width <= 0 or height <= 0:\n        raise ValueError(f\"invalid chart size: {size!r}\")\n\n    left = column_edges[column] + float(offset.get(\"col_offset\", 0) or 0)\n    top = row_edges[row] + float(offset.get(\"row_offset\", 0) or 0)\n    return {\n        \"chart_id\": str(chart.get(\"chart_id\") or chart.get(\"id\") or \"\"),\n        \"anchor_cell\": f\"{index_to_column(column)}{row + 1}\",\n        \"left\": left,\n        \"top\": top,\n        \"right\": left + width,\n        \"bottom\": top + height,\n        \"width\": width,\n        \"height\": height,\n    }\n\n\ndef intersection(first: dict[str, Any], second: dict[str, Any]) -> dict[str, float] | None:\n    left = max(float(first[\"left\"]), float(second[\"left\"]))\n    top = max(float(first[\"top\"]), float(second[\"top\"]))","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/skills/lark-sheets/scripts/lark_chart_layout_check.py#L146-L182","documentation":"skillref.New verifies each mapping target exists in the composed skill tree by probing the fs.FS content. If the probe itself fails (I/O error, nil filesystem, fs errors) rather than reporting absence, this error wraps ErrInvalidRemap with the underlying cause.","triggerScenarios":"Calling skillref.New with a content fs.FS whose probe(content, to) returns an error — e.g. an fs.FS implementation whose Open fails with a real I/O error instead of fs.ErrNotExist, or a corrupted/broken embedded FS.","commonSituations":"A custom or mocked fs.FS returning non-NotExist errors; filesystem permission problems when content is backed by a real directory FS; a broken embed.FS in a mis-built binary.","solutions":["Inspect the wrapped cause (%w chain) to find the actual filesystem error and fix it (permissions, disk, FS implementation bug).","Ensure the fs.FS passed to New returns fs.ErrNotExist (not a generic error) for missing paths so absence is reported as error 4 instead.","Rebuild/reinstall the CLI if the embedded skill content is corrupted; verify the embed includes the target skill file."],"exampleFix":"// before: custom FS returns generic error for missing files\nfunc (f *myFS) Open(name string) (fs.File, error) { return nil, errors.New(\"no such file\") }\n// after\nfunc (f *myFS) Open(name string) (fs.File, error) {\n    if _, ok := f.files[name]; !ok { return nil, fs.ErrNotExist }\n    return f.files[name].open()\n}","handlingStrategy":"type-guard","validationCode":"// Ensure the FS reports fs.ErrNotExist (not generic errors) for missing paths\nfunc sanityCheckFS(content fs.FS) error {\n    _, err := fs.Stat(content, \"probe-nonexistent\")\n    if err != nil && !errors.Is(err, fs.ErrNotExist) {\n        return fmt.Errorf(\"FS must return fs.ErrNotExist for missing paths: %w\", err)\n    }\n    return nil\n}","typeGuard":"func usableFS(c fs.FS) bool { return c != nil }","tryCatchPattern":"r, err := skillref.New(content, mappings)\nif err != nil {\n    var remapErr = skillref.ErrInvalidRemap\n    if errors.Is(err, remapErr) && strings.Contains(err.Error(), \"cannot inspect target\") {\n        // filesystem-level problem: log cause, check FS implementation/permissions\n    }\n    return err\n}","preventionTips":["Use embed.FS or a well-behaved os.DirFS-backed FS as content.","Make custom fs.FS implementations return fs.ErrNotExist for missing paths.","Check filesystem health/permissions before invoking resolver construction in portable environments."],"tags":["go","filesystem","skill-reference","io"],"backgroundTag":"filesystem-inspection-failed","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}