Refine guide contract and context reads#6
Conversation
Greptile SummaryThis PR extends
Confidence Score: 5/5Safe to merge; the single/multi-target clamping split is cleanly implemented at both dispatch layers, footer routing is consistent across all search paths, and the new behaviors are fully covered by integration tests. The clamping logic correctly separates the single-target fast path (unclamped) from the multi-target loop (clamped) in cli_run.rs, and read_multi_section in section.rs independently enforces the same cap for comma-separated --section targets. The with_artifact_note needle is updated in lockstep with the footer text change in find.rs. The append_context_next_targets bool return is used correctly to branch footer guidance. Four new integration tests in path_line.rs directly exercise the boundary between capped and uncapped contexts, and the existing footer_tips and intent_first_cli tests are updated to match the new hint wording. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["srcwalk show target -C N"] --> B{target contains comma?}
B -- No --> C["fast path: context_lines = N unclamped"]
B -- Yes --> D["multi-target loop: per_target_context = min(N, 10)"]
C --> F{section type?}
D --> F
F -- single line --> G["expand_range(line, line, ctx)"]
F -- range --> H["expand_range(start, end, ctx)"]
F -- symbol --> I["expand_range(start, end, ctx)"]
F -- heading --> J["expand_range(start, end, ctx)"]
F -- comma sections --> K["read_multi_section: capped_context_lines min(ctx, 10)"]
G & H & I & J & K --> M["read lines from file, clamp at EOF"]
Reviews (1): Last reviewed commit: "feat: refine guide contract and context ..." | Re-trigger Greptile |
Summary
srcwalk guideas an agent evidence contract: srcwalk before broad grep, bounded evidence, and explicit discovery-to-context/show routing.show -C/--context-linesto line ranges, resolved sections, and comma-separated show/section targets.-C, multi targets clamp each target to 10.contexttargets when structural candidates exist and rawshow <path>:<line> -C 10reads for text/raw hits.Validation
git diff --cached --checkcargo fmt --checkcargo clippy --locked -- -D warningscargo test --locked --test footer_tipscargo test --locked --test intent_first_clicargo test --locked --test path_linecargo test --locked --test subcommand_aliasesshow --help, structuraldiscoverfooter, embeddedguideRelease note
Parking this PR for a later public release batch. No version bump, tag, release, npm publish, or crates publish is included here.