Skip to content

feat(analysis): split interpAllowedSymbols into per-mode lists [PR C]#528

Merged
julesmcrt merged 1 commit into
mainfrom
jules.macret/symbols-interp-per-mode
Jun 16, 2026
Merged

feat(analysis): split interpAllowedSymbols into per-mode lists [PR C]#528
julesmcrt merged 1 commit into
mainfrom
jules.macret/symbols-interp-per-mode

Conversation

@julesmcrt

@julesmcrt julesmcrt commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Please review carefully, this PR impacts the analysis of symbols in the interpreter

Summary

Splits the interp symbol allowlist into a two-layer per-mode system, modelled on how builtins/ already works.

  • interpAllowedSymbols — unchanged, becomes the global ceiling
  • interpPerModeSymbols["read-only"] — all current symbols; enforced on every interp/ file
  • interpPerModeSymbols["remediation"] — empty for now; grows as write features land in *_remediation.go files

Files are partitioned by name suffix (_remediation.go) rather than subdirectory. Remediation files are checked against the union of both mode lists; read-only files against "read-only" only. The five checks mirror checkPerBuiltinAllowedSymbols.

Test plan

  • go test ./analysis/... -timeout 60s — all existing tests pass
  • 9 new tests: TestInterpPerModeSymbols + 8 TestVerificationInterpPerMode* covering each of the five checks

🤖 Generated with Claude Code

Add interpPerModeSymbols with "read-only" (all current interp symbols)
and "remediation" (empty). Wire up checkInterpPerModeSymbols with five
checks mirroring checkPerBuiltinAllowedSymbols, partitioning files by
the _remediation.go suffix instead of subdirectory.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@datadog-datadog-prod-us1-2

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Static Analysis Verification | Static Analysis Label Check   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 29c6c47 | Docs | Datadog PR Page | Give us feedback!

@julesmcrt
julesmcrt marked this pull request as ready for review June 16, 2026 09:58
"mvdan.cc/sh/v3/syntax.WordIter", // 🟢 AST node for word iteration (for-in); pure type.
"mvdan.cc/sh/v3/syntax.WordPart", // 🟢 AST interface for word components; pure interface.
},
"remediation": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👋 I think that's a good starting point and could be enough. But if the remediation symbols list grows, we might want to consider splitting by shell features/files.

@julesmcrt julesmcrt added the verified/analysis Human-reviewed static analysis changes label Jun 16, 2026
@julesmcrt
julesmcrt added this pull request to the merge queue Jun 16, 2026
Merged via the queue into main with commit 7e49319 Jun 16, 2026
40 of 41 checks passed
@julesmcrt
julesmcrt deleted the jules.macret/symbols-interp-per-mode branch June 16, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

verified/analysis Human-reviewed static analysis changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants