Start-editing packet for one function
get_function_briefGet one function's start-editing packet from the newest trusted run, including its score, uncovered lines, and refresh, test, gate, and verify command lines.
Instructions
Returns one function's start-editing packet from the newest trusted run: scored row, uncovered lines and the refresh, test, gate and verify command lines, none of them run. Use it once a function is chosen. Skip it for picking what to fix, that is get_next_item, and for a score across runs, get_function_history. Twins come from the run's stored index, whose first build takes seconds. name must live in path. A miss is a tool error (isError true, the exit-1 error object) whose message lists the file's functions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | the long_name get_next_item printed (classify( score , late )), the bare identifier (classify, or route for a Rust `route cmd : & Cmd`), a fragment of either, the line the function starts on, or a handle such as NAME#2 for a twin or (anonymous)#2; exact match first | |
| path | Yes | source file, repo-relative or absolute inside the repo; a backslash separates folders on Windows only | |
| repo | No | path to the scored repo's root (default: the repo the server was started in); a leading ~ is the home directory |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lane | No | the lane whose artifact produced cov and uncovered_lines, verbatim from the config; null when no lane covers the scope | |
| path | No | the resolved file, repo-relative | |
| churn | No | the file's churn, or null when it had no commits in the window | |
| notes | No | prose the config carries for whoever edits here | |
| stale | No | true when the run's commit is not HEAD. It judges the commit, not the files: an amend or a commit that touched no scored file sets it, and an uncommitted edit leaves it false; scored_changes counts the files whose content moved. Schema 2 redefines it as that content difference | |
| commit | No | that run's commit, full sha | |
| handle | No | short name form: the bare identifier or (anonymous)#N, the same value get_next_item prints | |
| params | No | parameters in declaration order, so a test can call the function without opening the file | |
| remedy | No | decompose, split-lines, add-tests or ok: the branch the session takes; scored.remedy carries the same value | |
| run_id | No | id of the run these numbers come from: the newest trusted run (a coverage run, or a verify run whose verdict passed) | |
| schema | No | payload schema version, 1 | |
| scored | No | the whole scored row from the run | |
| source | No | the function's own text, start to end inclusive, newlines intact: editable without reading the file | |
| target | No | this scope's effective ceiling: the highest CRAP a function may carry, and so also the highest ccn; the same value as gate_rule.ceiling | |
| shallow | No | true when this checkout is a shallow clone: churn and gate_rule.mark_age_days count only the commits the clone holds; set fetch-depth: 0 on the checkout or run git fetch --unshallow for the real counts | |
| attempts | No | every claim ever taken on this function, oldest first; [] on a first attempt, and a row with closed null is a claim still open | |
| commands | No | the rest of the loop as whole command lines for this file and scope; run them as given | |
| coupling | No | up to 5 change-coupling partners at support 5 and confidence 0.5, strongest first; empty when none qualify; list_coupled_files has the repo-wide list | |
| function | No | the resolved lizard long name, whichever name form was asked with | |
| regrowth | No | did this get fixed before | |
| versions | No | what produced these numbers | |
| gate_rule | No | what check_gate will judge this edit by | |
| truncated | No | present only when the whole answer was longer than one tool result the server sends (7,500 characters): each list, string or object field it cut, at any depth, keeps its start, and full is the CLI command that prints the whole answer | |
| est_splits | No | 0 when ccn <= target, else ceil(ccn / target) | |
| unmeasured | No | true when no measurement stands behind cov: flag no-lane (no lane covers the scope) or cc-only (the scope asks for no coverage). cov 0.0 and est_uncovered_paths are then stand-ins, not a count of paths no test walks | |
| file_totals | No | the file rolled up | |
| ratchet_mark | No | the committed ratchet mark, or null when the function carries none or the repo has no ratchet file | |
| file_functions | No | every scored function in the same file: where an extracted helper lands, and which names are taken | |
| scored_changes | No | how many files the run scored hold other content now than the run recorded, deleted files included; 0 means the numbers describe the files on disk; null when crapkit cannot compare: the run recorded no content (crapkit 0.8.0 or older wrote it) or git failed reading the tree; treat null like any count above 0 and run commands.refresh | |
| uncovered_lines | No | line numbers no test ran; [] when the span is fully covered; null when no artifact could answer, then uncovered_lines_note says why | |
| duplication_twins | No | up to 10 near-duplicate functions at similarity 0.8, best first; empty is normal; list_duplicate_functions has the repo-wide pairs | |
| est_uncovered_paths | No | (1 - cov) x ccn rounded half to even, so 2.5 reads 2 | |
| uncovered_lines_note | No | present only when uncovered_lines is null: the reason and the move (stale artifact, no test imports the file, coverage_optional scope) |