Skip to content

superseded release prep draft#1

Closed
sting8k wants to merge 1 commit into
mainfrom
public-candidate/20260524
Closed

superseded release prep draft#1
sting8k wants to merge 1 commit into
mainfrom
public-candidate/20260524

Conversation

@sting8k
Copy link
Copy Markdown
Owner

@sting8k sting8k commented May 24, 2026

Superseded by #2.

@sting8k sting8k force-pushed the public-candidate/20260524 branch 2 times, most recently from 9c77e4d to cb38f50 Compare May 24, 2026 16:05
@sting8k sting8k changed the title publicize premium updates update srcwalk public snapshot May 24, 2026
@sting8k sting8k force-pushed the public-candidate/20260524 branch from cb38f50 to a24fafe Compare May 24, 2026 16:07
@sting8k sting8k changed the title update srcwalk public snapshot chore: update public snapshot May 24, 2026
@sting8k sting8k force-pushed the public-candidate/20260524 branch from a24fafe to a0db687 Compare May 24, 2026 16:09
@sting8k sting8k changed the title chore: update public snapshot feat: prepare v1.0.0 public update May 24, 2026
@sting8k
Copy link
Copy Markdown
Owner Author

sting8k commented May 24, 2026

@greptileai

@sting8k sting8k closed this May 24, 2026
@sting8k sting8k deleted the public-candidate/20260524 branch May 24, 2026 16:13
@sting8k sting8k changed the title feat: prepare v1.0.0 public update superseded release prep draft May 24, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 24, 2026

Greptile Summary

This PR prepares the v1.0.0 public snapshot of srcwalk, replacing the legacy flag-based CLI with an intent-first subcommand design (discover, show, review, compare, trace, overview, assess) and adding several new analysis capabilities.

  • New commands: review (git diff + flow-map evidence), compare (structural AST diff between two targets), diff (change-set metadata), and access search (read/write/reset pattern grouping across a codebase).
  • CLI restructuring: legacy root-level flags (--callers, --flow, --map, etc.) are removed in favour of explicit subcommands; scope normalisation now handles file scopes, glob scopes, and file:line-range syntax with clear error messages.
  • Evidence system: new EvidenceAtom, EvidenceKind, EvidenceRole, and NextAction types formalise how confidence and navigation hints are communicated to agents.

Confidence Score: 4/5

Safe to merge for the large majority of use cases; one path in the new access search accumulates all matches into memory before output is bounded.

The CLI restructure, diff parser, review flow-map pipeline, and compare command are all well-guarded with explicit caps and fallback paths. The only live defect is in search_access: when a user omits --limit, every matched hit is cloned into a single vector and fully formatted before the budget truncation runs, which can cause significant memory pressure for common identifiers in large repos. Every comparable command in this PR applies a default limit before formatting; this one does not.

src/search/access.rs — the default page_size path; src/commands/diff.rs — quoted-path parsing edge case in parse_diff_git_paths

Important Files Changed

Filename Overview
src/search/access.rs New file: parallel access-pattern search. Unbounded default page size (usize::MAX when --limit is omitted) violates the bounded-agent-output rule; every other search command uses an explicit default cap.
src/commands/diff.rs New file: git diff parsing, hunk/symbol attachment, working/staged/range modes. Core parsing looks solid; quoted-path edge case in parse_diff_git_paths can misidentify the split point for paths containing b/.
src/commands/review.rs New file: local and change-review modes with flow-map integration. MAX_FLOW_MAPS (5) and DEFAULT_CHANGED_FILE_LIMIT (20) bound output well; apply_review_budget correctly preserves the footer section.
src/cli_run.rs Major restructuring: new scope normalisation, line-range parsing, glob splitting, and mode routing. Windows drive-letter edge cases handled correctly; multi-scope validation guards are in place.
src/commands/compare.rs New file: structural comparison between two targets using AST features. Constants MAX_SHARED_PER_GROUP and MAX_ONLY_FEATURES bound output; caveat label correctly communicates heuristic-only confidence.
src/commands/find.rs Text-OR and access search paths added; per-term cap (DEFAULT_TEXT_OR_TERM_LIMIT = 10) and rollup file limit (TEXT_OR_ROLLUP_FILE_LIMIT = 8) prevent runaway output for multi-term queries.
src/cli.rs CLI surface replaced from legacy flag-based to intent-first subcommand design; old flags removed, new Discover/Show/Review/Compare commands added with well-structured RunConfig derivation.
.github/workflows/ci.yml Added --locked to cargo test calls and CC/CXX=clang-cl env for Windows build stability.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CLI input] --> B{subcommand?}
    B --> C[show / root path]
    B --> D[discover]
    B --> E[review]
    B --> F[compare]
    B --> G[trace callers/callees]
    B --> H[deps / assess / overview]

    D --> D1{--as / --match}
    D1 --> D2[symbol search]
    D1 --> D3[text search]
    D1 --> D4[text-OR multi-term]
    D1 --> D5[file glob]
    D1 --> D6[access pattern search]

    E --> E1{target type}
    E1 --> E2[local review run_local_review]
    E1 --> E3[change review run_change_review]
    E3 --> E4[collect_diff_evidence git diff / ls-files]
    E4 --> E5[attach_symbols outline + tree-sitter]
    E3 --> E6[append_change_flow_maps render_flow_map x MAX_FLOW_MAPS=5]

    F --> F1[resolve_compare_target x 2]
    F1 --> F2[compare_features AST walk]

    D6 --> D6a[collect_access_hits parallel walker]
    D6a --> D6b[format_access_result page_size = limit OR usize::MAX]
Loading

Reviews (1): Last reviewed commit: "feat: prepare v1.0.0 public update" | Re-trigger Greptile

Comment thread src/search/access.rs
Comment on lines +168 to +170
});

let total_found = hits.len();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unbounded default output

When --limit is omitted, page_size becomes usize::MAX and every matched AccessHit is cloned into shown_hits, then fully formatted into a single String before any budget truncation is applied. For a frequently-used identifier in a large codebase (e.g. count, err, result) this can allocate hundreds of megabytes of intermediate data. Every comparable command in this PR has a sensible default — run_diff defaults to 20, text-OR caps per-term results at DEFAULT_TEXT_OR_TERM_LIMIT (10) — but search_access has none, violating the bounded-agent-output custom rule. A default cap (e.g. 50 or 100) should be used when no --limit is provided.

Rule Used: CLI output shown to users or agents should be boun... (source)

Comment thread src/commands/diff.rs
Comment on lines +353 to +359
if let Some(rest) = rest.strip_prefix("\"a/") {
let (old_path, new_path) = rest.rsplit_once("\" \"b/")?;
return Some((
Some(clean_patch_path(old_path)),
clean_patch_path(new_path.trim_end_matches('"')),
));
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 rsplit_once misparses diff --git header for quoted paths containing b/

parse_diff_git_paths handles the quoted-path form ("a/..." "b/...") but if the filename contains the literal substring " "b/, the split point will be wrong. This can silently produce an incorrect path for the resulting DiffFile, causing the scope filter to skip the file entirely.

Suggested change
if let Some(rest) = rest.strip_prefix("\"a/") {
let (old_path, new_path) = rest.rsplit_once("\" \"b/")?;
return Some((
Some(clean_patch_path(old_path)),
clean_patch_path(new_path.trim_end_matches('"')),
));
}
if let Some(rest) = rest.strip_prefix("\"a/") {
// Split on the last `" "b/` to correctly handle paths that themselves contain ` b/`
let (old_path, new_path) = rest.rsplit_once("\" \"b/")?;
let old_path = clean_patch_path(old_path.trim_end_matches('\\'));
let new_path = clean_patch_path(new_path.trim_end_matches('"'));
return Some((Some(old_path), new_path));
}

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 24, 2026

Greptile Summary

This PR prepares the v1.0.0 public snapshot of srcwalk by introducing an intent-first CLI surface (discover, show, context, trace, review, compare, assess, overview) that replaces the legacy action-flag API, along with new diff/review/compare commands backed by a new decision-flow engine, evidence module, CSS/HTML language support, and a capability facade for the public build.

  • New commands: review (local + change-set with Flow Map evidence), compare (structural A/B comparison), diff (git diff evidence), all bounded by budget/limit guards and honest caveat labeling.
  • CLI refactor: legacy root flags replaced by subcommands; scope parsing extended with line-range splitting and glob inference; output::emit_result simplified to println!.
  • Infrastructure: Windows CI gains CC/CXX=clang-cl for the new tree-sitter CSS/SCSS/Less grammars; cargo test --locked enforced on both platforms.

Confidence Score: 4/5

Safe to merge; the two findings are maintenance concerns in newly added code, not regressions in existing behavior.

The fallback detection in run_local_review ties correctness to the exact wording of two error messages in decision_flow.rs, so a future message edit could silently break the graceful fallback. The untracked-file line-count reads entire files into memory, which could be expensive on large repos. Both are confined to new code paths; the validated test suite and CI matrix give reasonable confidence.

src/commands/review.rs (fallback error detection), src/commands/diff.rs (untracked file line-count)

Important Files Changed

Filename Overview
src/commands/review.rs New review command with local and change-set review modes; fallback error detection uses fragile substring matching against internal error messages.
src/commands/diff.rs New diff evidence collector; untracked_files reads full file content just to count lines.
src/commands/compare.rs New structural comparison command; well-bounded with MAX_SHARED_PER_GROUP, MAX_ONLY_FEATURES, and MAX_SNIPPET_CHARS.
src/cli_run.rs Significant rework routing intent-first CLI commands; scope parsing refactored to support line-ranges and globs.
src/cli.rs Intent-first command surface replacing legacy action-flags; added Discover, Show, Trace, Review, Compare, and Diff subcommands.
src/output.rs Simplified from print+explicit-flush to println; removes JSON wrapper.
.github/workflows/ci.yml Added CC/CXX=clang-cl env for Windows CI and --locked flag to cargo test.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    CLI[srcwalk CLI input] --> Router{cli_run::run}
    Router -->|show path:range| Show[run_show]
    Router -->|discover query| Discover{Mode?}
    Router -->|context target| Flow[run_flow_with_artifact]
    Router -->|trace callers/callees| Trace[run_callers/callees]
    Router -->|review range| Review{Review type?}
    Router -->|compare A B| Compare[run_compare]
    Router -->|overview| Overview[run_map]
    Discover -->|symbol| Symbol[run_filtered]
    Discover -->|text| Text[run_text_filtered]
    Discover -->|file| Files[run_files]
    Discover -->|access| Access[run_access_filtered]
    Review -->|local target| LocalReview[run_local_review]
    Review -->|rev range/staged| ChangeReview[run_change_review]
    LocalReview --> Budget[apply_review_budget]
    ChangeReview --> Budget
    Budget --> Output[emit_result]
Loading

Reviews (1): Last reviewed commit: "feat: prepare v1.0.0 public update" | Re-trigger Greptile

Comment thread src/commands/review.rs
Comment on lines +184 to +191
fn is_flow_map_fallback_error(err: &SrcwalkError) -> bool {
matches!(
err,
SrcwalkError::InvalidQuery { reason, .. }
if reason.contains("requires tree-sitter source support")
|| reason.contains("currently supports Rust")
)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 is_flow_map_fallback_error couples review.rs to the exact wording of error messages in decision_flow.rs via substring matching. The check reason.contains("currently supports Rust") would silently stop matching if the supported-language list is reworded or reordered, causing run_local_review to propagate a hard error instead of falling back to file-level evidence.

Suggested change
fn is_flow_map_fallback_error(err: &SrcwalkError) -> bool {
matches!(
err,
SrcwalkError::InvalidQuery { reason, .. }
if reason.contains("requires tree-sitter source support")
|| reason.contains("currently supports Rust")
)
}
fn is_flow_map_fallback_error(err: &SrcwalkError) -> bool {
matches!(
err,
SrcwalkError::InvalidQuery { reason, .. }
if reason.contains("requires tree-sitter source support")
|| reason.contains("currently supports")
)
}

Comment thread src/commands/diff.rs
Comment on lines +408 to +409
let line_count =
std::fs::read_to_string(&full_path).map_or(0, |content| content.lines().count() as u32);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 untracked_files reads the entire file content just to count newlines. For large untracked text files this is O(file size) in memory and time; a byte-buffer scan or sentinel value would avoid pulling large files into memory.

Suggested change
let line_count =
std::fs::read_to_string(&full_path).map_or(0, |content| content.lines().count() as u32);
let line_count = count_lines_cheap(&full_path);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant