Skip to content

fix(analyzer): index variable shell-flag scopes once per window - #790

Open
yashrajp22 wants to merge 8 commits into
mainfrom
yashraj/cache-shell-flag-scope-analysis
Open

yashrajp22 wants to merge 8 commits into
mainfrom
yashraj/cache-shell-flag-scope-analysis

Conversation

@yashrajp22

@yashrajp22 yashrajp22 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

The AST-reparse fix is superseded by #577, which has landed on main. The remaining runtime and source-line safeguards are included in #741, with a regression confirming that 100 shell-flag candidates use one AST parse and one scope index.

This branch should not be merged over the newer implementation. It remains open for tracking.

yashrajp22 and others added 7 commits October 7, 2026 12:43
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
Resolve the conflicts with #577 (5ee48ef) in
static_patterns_tool_misuse.py.

#577 replaced the per-match reparse with a single AST index
(_build_variable_shell_ast_index) and moved variable reconciliation
into postprocess_path_findings. That supersedes this branch's
_VariableShellScopeIndex, so the resolution keeps main's variable-shell
design and drops the index class, its _index_scope method and the
deque import.

Kept from this branch:
- USES_RUNTIME_CHECK and the check_runtime keyword, alongside main's
  defer_variable_reconciliation keyword.
- runtime_check() calls in the TM1-TM4 loops, the Perl helper and the
  non-deferred reconciliation block.
- SourceLocationIndex and get_context_from_lines for TM1-TM4 line and
  context lookups.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yashrajp22

Copy link
Copy Markdown
Collaborator Author

Thanks! The newer shell-flow fix in #577 has landed on main and supersedes the AST-reparse change here. I kept that implementation and carried the remaining line-index and runtime safeguards into #741. Its regression confirms that 100 shell-flag matches use one AST parse and one scope index. This PR should not be merged over the newer implementation; I have left it open for tracking.

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.

3 participants