{"record":{"id":"052668e5e0b50233","repo":"larksuite/cli","slug":"missing-row-count-column-count-for-sheet-sheet-ti","errorCode":null,"errorMessage":"Missing row_count/column_count for sheet {sheet_title(sheet)!r}","messagePattern":"Missing row_count/column_count for sheet (.+?)","errorType":"exception","errorClass":"LarkCliError","httpStatus":null,"severity":"error","filePath":"skills/lark-sheets/scripts/lark_chart_layout_check.py","lineNumber":275,"sourceCode":"            for column_offset, cell in enumerate(row):\n                if not _has_content(cell):\n                    continue\n                count += 1\n                if len(samples) < sample_limit:\n                    column = columns[column_offset] if isinstance(columns, list) and column_offset < len(columns) else index_to_column(column_offset)\n                    samples.append(f\"{column}{row_number}\")\n    return count, samples, truncated\n\n\ndef _locator(target: str) -> dict[str, str]:\n    return {\"url\": target} if target.startswith((\"http://\", \"https://\")) else {\"spreadsheet_token\": target}\n\n\ndef _sheet_counts(sheet: dict[str, Any]) -> tuple[int, int]:\n    row_count = int(sheet.get(\"row_count\") or sheet.get(\"rowCount\") or 0)\n    column_count = int(sheet.get(\"column_count\") or sheet.get(\"columnCount\") or 0)\n    if row_count <= 0 or column_count <= 0:\n        raise LarkCliError(f\"Missing row_count/column_count for sheet {sheet_title(sheet)!r}\")\n    return row_count, column_count\n\n\ndef check_sheet(\n    locator: dict[str, str], sheet: dict[str, Any], *, timeout: int, sample_limit: int\n) -> dict[str, Any]:\n    sheet_id = sheet_identifier(sheet)\n    title = sheet_title(sheet)\n    row_count, column_count = _sheet_counts(sheet)\n    if not sheet_id:\n        raise LarkCliError(f\"Missing sheet_id for sheet {title!r}\")\n\n    structure_data = envelope_data(\n        run_sheets(\n            \"+sheet-info\",\n            **locator,\n            sheet_id=sheet_id,\n            flags={\"include\": \"row_heights,col_widths\"},","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/skills/lark-sheets/scripts/lark_chart_layout_check.py#L257-L293","documentation":"Explicit remap targets are build-integrity declarations and must exist in the composed skill tree. skillref.New probes the target reference in the content FS and rejects the whole resolver if the target file is absent (unlike unmapped canonical references, which may be absent at resolve time).","triggerScenarios":"Calling skillref.New with a Mapping whose To reference points to a skill path that does not exist in the supplied content fs.FS — e.g. target skill name misspelled, or the target skill file not included in the embedded/composed tree.","commonSituations":"Remapping to a skill that was renamed or removed in a newer CLI version; typos in the target skill/path in overlay configs; building against a fallback/empty embedded metadata that omits the skill; forgetting to add a new skill's files to the embed.","solutions":["Verify the target exists: run skillref probe semantics yourself (fs.FS open of the target path) or list the composed skill tree and correct the target string.","Update stale remap targets to current skill names after a CLI upgrade (check `lark-cli` skill catalog/skills list).","If authoring skills, ensure the target skill file is present in the embedded content and included in the composed tree before declaring a remap to it.","Fix typos in the target skill name or path in the overlay config."],"exampleFix":"// before\n{From: mustParse(\"deploy/rollout.md\"), To: mustParse(\"deploy/rollout-v2.md\")} // target never existed\n// after: point at the real target in the composed tree\n{From: mustParse(\"deploy/rollout.md\"), To: mustParse(\"deployment/rollout.md\")}","handlingStrategy":"validation","validationCode":"func targetExists(content fs.FS, ref skillref.Ref) error {\n    path, err := skillref.RefPath(ref) // whatever path probe uses; or open via the skill tree\n    if err != nil { return err }\n    if _, err := fs.Stat(content, path); err != nil {\n        return fmt.Errorf(\"remap target %q missing from composed tree\", ref.String())\n    }\n    return nil\n}","typeGuard":"func refExists(content fs.FS, r skillref.Ref) bool {\n    res, err := skillref.New(content, []skillref.Mapping{})\n    if err != nil { return false }\n    _, ok := res.Resolve(r)\n    return ok\n}","tryCatchPattern":"r, err := skillref.New(content, mappings)\nif err != nil {\n    if errors.Is(err, skillref.ErrInvalidRemap) && strings.Contains(err.Error(), \"does not exist\") {\n        // fall back to identity resolution or surface a config-validation error\n    }\n    return err\n}","preventionTips":["Generate remap targets from the actual skill catalog rather than hand-typing them.","Re-validate remaps after every CLI/skill-catalog upgrade.","Keep a test that constructs the Resolver from production content so dangling targets fail at build/CI time."],"tags":["go","validation","skill-reference","config"],"backgroundTag":"missing-skill-target","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"}