Skip to content

Add fuzzing for wta#17

Open
PankajBhojwani wants to merge 14 commits into
mainfrom
pabhojwa/intelligent/wta_fuzzing
Open

Add fuzzing for wta#17
PankajBhojwani wants to merge 14 commits into
mainfrom
pabhojwa/intelligent/wta_fuzzing

Conversation

@PankajBhojwani

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

  • Extracted the commandline builder from shell_manager.rs into a shared shell_fuzz.rs module for fuzzing (also
    fixed a quoting bug: embedded " in args was not escaped)
  • Added a [lib] target to WTA so cargo-fuzz can link against it
  • Created a cargo-fuzz fuzz target (cmdline_builder)
  • Updated the fuzzing pipeline with a parallel Rust fuzzer build stage (ms-nightly + cargo-fuzz) and OneFuzz
    submission

Validation Steps Performed

  • wta still builds normally
  • Ran the fuzzer for 10 seconds (~132K executions, 0 crashes)

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

Copilot AI review requested due to automatic review settings May 19, 2026 18:03
Comment thread build/pipelines/fuzz.yml Fixed
Comment thread tools/wta/fuzz/Cargo.toml Fixed
Comment thread tools/wta/fuzz/fuzz_targets/cmdline_builder.rs Fixed
Comment thread tools/wta/src/lib.rs Fixed
Comment thread tools/wta/src/shell_fuzz.rs Fixed
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

tools/wta/src/shell_fuzz.rs:29

  • The quoting/escaping here is not compatible with the Windows command-line parsing rules used by CreateProcess/CommandLineToArgvW: doubling embedded " (producing "") does not reliably round-trip, and backslash cases (e.g. trailing \, or \" sequences) are not handled. Please switch to a Windows-style quoting algorithm that escapes quotes by prefixing backslashes and correctly handles runs of backslashes (see QuoteAndEscapeCommandlineArg in src/cascadia/WinRTUtils/inc/WtExeUtils.h:123-147 for an existing implementation to mirror).
        // Quote args containing spaces or double quotes
        if arg.contains(' ') || arg.contains('"') {
            cmdline.push('"');
            // Escape embedded double quotes by doubling them
            for ch in arg.chars() {
                if ch == '"' {
                    cmdline.push('"');
                }
                cmdline.push(ch);
            }
            cmdline.push('"');

Comment thread tools/wta/src/shell/shell_manager.rs Outdated
Comment thread tools/wta/src/shell_fuzz.rs Outdated
Comment thread tools/wta/src/shell_fuzz.rs Outdated
Comment thread build/pipelines/fuzz.yml Outdated
Copilot AI review requested due to automatic review settings May 20, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

tools/wta/src/shell/shell_manager.rs:13

  • Using #[path = "../shell_fuzz.rs"] mod shell_fuzz; compiles the same source twice (once in the lib target and once in the bin target) and relies on a relative path from a submodule. Now that the package has a proper lib.rs re-exporting build_wt_commandline, the binary can import it from the wta library crate instead, avoiding duplication and making the sharing mechanism more robust.

/// Configuration for creating a new terminal.
pub struct TerminalConfig {
    pub command: String,

Comment thread tools/wta/fuzz/fuzz_targets/cmdline_builder.rs Outdated
Comment thread tools/wta/src/shell_fuzz.rs Outdated
@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings May 20, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Comment thread tools/wta/src/shell/shell_manager.rs
Comment thread tools/wta/src/shell_fuzz.rs Outdated
Comment thread tools/wta/src/shell_fuzz.rs Outdated
Comment thread build/pipelines/fuzz.yml Outdated
Comment thread build/pipelines/fuzz.yml Outdated
Comment thread tools/wta/fuzz_output.txt Outdated
Comment thread tools/wta/fuzz/fuzz_targets/cmdline_builder.rs Fixed
Comment thread tools/wta/fuzz/fuzz_targets/cmdline_builder.rs Fixed
Comment thread tools/wta/fuzz/fuzz_targets/cmdline_builder.rs Fixed
Comment thread tools/wta/fuzz/fuzz_targets/cmdline_builder.rs Fixed
Comment thread tools/wta/fuzz_output.txt Fixed
Comment thread tools/wta/fuzz_output.txt Fixed
Comment thread tools/wta/fuzz_output.txt Fixed
Comment thread tools/wta/fuzz_output.txt Fixed
@github-actions

This comment has been minimized.

@PankajBhojwani PankajBhojwani force-pushed the pabhojwa/intelligent/wta_fuzzing branch from d1218fa to 14760ed Compare May 20, 2026 20:32
@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings May 20, 2026 20:50
Comment thread build/pipelines/fuzz.yml Fixed
Comment thread build/pipelines/fuzz.yml Fixed
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Comment thread tools/wta/src/shell_fuzz.rs Outdated
Comment thread build/pipelines/fuzz.yml
@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings May 20, 2026 21:32
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 4 comments.

Comment thread tools/wta/src/shell_fuzz.rs
Comment thread tools/wta/src/shell_fuzz.rs Outdated
Comment thread tools/wta/Cargo.toml
Comment thread build/pipelines/fuzz.yml
@github-actions

Copy link
Copy Markdown

@check-spelling-bot Report

⚠️ Dictionary not found

Problems were encountered retrieving check dictionaries (cspell:cpp/src/lang-jargon.txt cspell:html/dict/html.txt cspell:css/dict/css.txt cspell:typescript/dict/typescript.txt cspell:cpp/src/compiler-gcc.txt cspell:public-licenses/src/additional-licenses.txt cspell:python/src/additional_words.txt cspell:docker/src/docker-words.txt cspell:cpp/src/compiler-msvc.txt cspell:scala/dict/scala.txt cspell:cpp/src/stdlib-cpp.txt cspell:java/src/java.txt cspell:public-licenses/src/generated/public-licenses.txt cspell:ada/dict/ada.txt cspell:java/src/java-terms.txt cspell:latex/dict/latex.txt cspell:lua/dict/lua.txt cspell:cpp/src/stdlib-cmath.txt cspell:elixir/dict/elixir.txt cspell:python/src/common/extra.txt cspell:software-terms/dict/webServices.txt cspell:sql/src/tsql.txt cspell:powershell/dict/powershell.txt cspell:software-terms/dict/softwareTerms.txt cspell:python/src/python/python.txt cspell:django/dict/django.txt cspell:rust/dict/rust.txt cspell:python/src/python/python-lib.txt cspell:dotnet/dict/dotnet.txt cspell:cpp/src/people.txt cspell:cpp/src/lang-keywords.txt cspell:shell/dict/shell-all-words.txt cspell:ruby/dict/ruby.txt cspell:monkeyc/src/monkeyc_keywords.txt cspell:cpp/src/compiler-clang-attributes.txt cspell:sql/src/sql.txt cspell:fullstack/dict/fullstack.txt cspell:clojure/src/clojure.txt cspell:k8s/dict/k8s.txt cspell:node/dict/node.txt cspell:dart/src/dart.txt cspell:cpp/src/template-strings.txt cspell:haskell/dict/haskell.txt cspell:redis/dict/redis.txt cspell:php/dict/php.txt cspell:cpp/src/stdlib-cerrno.txt cspell:svelte/dict/svelte.txt cspell:golang/dict/go.txt cspell:r/src/r.txt cspell:cpp/src/stdlib-c.txt cspell:swift/src/swift.txt cspell:cpp/src/ecosystem.txt cspell:gaming-terms/dict/gaming-terms.txt cspell:npm/dict/npm.txt).

⚠️ For more information, see check-dictionary-not-found.

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (361)
adbea
Agendiga
agenta
agente
agentea
Agentearekin
agentem
agenten
Agentga
agenti
agentic
Agentni
agento
agentom
agentovi
agentti
Agenttia
agenttiin
agentul
Agentverbinding
Agjenti
agjentin
Aldatu
all'agente
Allillanchu
allinchu
almashtirish
amalga
Anslutningen
Arac
arget
asiant
asid
askuser
Atharraich
Athraigh
atopou
atrasts
atvyk
aurkitu
axente
azmcp
bei
Bem
Benvido
benvinguda
bestpractices
Bienvenido
bij
ble
blev
bspace
bulunamad
Byt
Bytt
caac
CACHEDIR
Cambiar
Canvia
capturep
cbe
cdfabe
ceangal
chanfuwyd
cheangal
checkmarks
chpwd
Chuy
chysylltu
Cim
claude
CLAUDECODE
clippy
clis
cmdkey
conectar
Conectarea
connectar
Connessione
Croeso
crossterm
customises
CWDs
czenie
DACLs
dans
datang
deach
demotable
desync
DFX
diffed
ditemui
ditemukan
donem
dotent
doy
drx
dtx
dzam
eef
egin
ejen
ekki
eku
encontrado
entrancy
ents
entu
epnout
ession
etorri
extened
Falha
falliet
fannst
fehlgeschlagen
Figma
focusp
fonnt
foob
fooba
footgun
Forbindelsen
formedness
fost
fundet
funnen
funnet
gagal
Ganti
gefunden
geldiniz
gescheitert
gevind
gevonden
Ghostty
githubnext
gjet
gpt
greenfield
greppable
haikus
Hinnant
hittades
hononga
Huri
Ibdel
ikke
ikkje
ilo
inputbox
installable
inte
introuvable
IOCP
ipfs
izveidot
kaitao
kelibsiz
keyspace
killp
kitea
kok
Koneksi
koneksyon
konektatzeak
konnessjoni
Laipni
leitud
Lidhja
llm
lmad
lmisiniz
loomine
lorg
lrx
LSBs
lsp
lsw
ltx
mai
Maligayang
MBM
mcp
meproj
Methwyd
misluk
mislukkast
mislukt
mislykkedes
mislyktes
misslyckades
MMdd
mojibake
mpsc
MRT
mtimes
myproj
Nabigo
nafter
nahanap
najti
ncwd
Ndrysho
neach
nem
Nepavyko
nepoda
nepodarilo
nerastas
Newid
neww
nezda
nie
niet
nije
NOAGGREGATION
noname
nopath
normaliser
normalises
noshortcuts
notacommand
nrx
nstabx
nsummary
ntx
nuk
nurjus
Nushell
obra
Oids
oldu
Ongi
oobe
ools
openai
oshmadi
pagdating
Pakeisti
Palitan
parallelizable
pogut
Povezava
Povezivanje
Prereq
Pripojenie
PRIs
prisijungti
proactively
Promeni
Promijeni
prona
prx
psobject
ptx
pudo
puido
pytest
qdk
qqqqq
quz
rahua
Rasterize
ratatui
recognises
regen
reparses
replacen
reprioritized
respawning
respawns
retryable
riuscita
rmcp
rrx
rtx
rustc
RUSTFLAGS
Sambungan
savienojumu
Schimb
Selamat
serde
sideload
SIGKILLs
signtool
sikertelen
Skipta
splitn
splitw
Spremeni
submittable
Sveiki
synthesises
t'ikray
t'inkiynin
tarikusqachu
taskkill
Tenging
Tere
Terminal'e
Terminali
Terminaliin
Tervetuloa
Theip
THH
tidak
Tilkoblingen
Tilkoplinga
tir
tokio
toolpath
topilmadi
trn
trobat
trovato
Tukar
tulemast
uat
ulanish
undercounted
undercounting
Uninstalls
unrecognised
ursuz
uspela
uspelo
uspjelo
Vaheta
Vaihda
vart
vcxprojs
Velkomen
Velkomin
Velkommen
vendored
venit
Verbinding
Verbindung
vindo
vini
Vitajte
Vos
wechseln
Wez
wiesselen
Willkommen
wisselen
Witamy
wlen
wtcli
xush
yeelam
Yhteys
ZDOTDIR
zlyhalo
znaleziono
zum
zzzzz
These words are not needed and should be removed Bspace Ccc cplusplus ctl Debian dotnet drv endptr evt Fullwidth gitlab hdr idl IME inbox intelligentterminal Ioctl KOK KVM lbl lld lsb NONINFRINGEMENT notif oss outdir pri prioritization PSobject QUZ rcv segfault Signtool sourced SWP Tbl testname transitioning unk unparseable Virt VMs webpage websites wta xsi

Some files were automatically ignored 🙈

These sample patterns would exclude them:

^\.dotnet\/\.dotnet\/TelemetryStorageService/
^\Q.dotnet/.dotnet/.workloadAdvertisingManifestSentinel10.0.200\E$
^\Q.dotnet/.dotnet/10.0.201.aspNetCertificateSentinel\E$
^\Q.dotnet/.dotnet/10.0.201.dotnetFirstUseSentinel\E$
^\Q.dotnet/.dotnet/10.0.201.toolpath.sentinel\E$
^\Qinstaller/bootstrap/target/.rustc_info.json\E$
^copilot-version\.err$
^copilot-version\.out$

You should consider excluding directory paths (e.g. (?:^|/)vendor/), filenames (e.g. (?:^|/)yarn\.lock$), or file extensions (e.g. \.gz$)

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/intelligent-terminal.git repository
on the pabhojwa/intelligent/wta_fuzzing branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/intelligent-terminal/actions/runs/26192747281/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (2051) from .github/actions/spelling/expect/alphabet.txt .github/actions/spelling/expect/expect.txt .github/actions/spelling/expect/web.txt and unrecognized words (361)

Dictionary Entries Covers Uniquely
cspell:csharp/csharp.txt 32 1 1
cspell:aws/aws.txt 232 1 1
cspell:fonts/fonts.txt 536 1 1

Consider adding to the extra_dictionaries array (in the .github/actions/spelling/config.json file):

    "cspell:csharp/csharp.txt",
    "cspell:aws/aws.txt",
    "cspell:fonts/fonts.txt",

To stop checking additional dictionaries, put (in the .github/actions/spelling/config.json file):

"check_extra_dictionaries": []
Forbidden patterns 🙅 (14)

In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves.

These forbidden patterns matched content:

Homoglyph (Turkish) should be i
[ı](?=[A-Za-z]{2,})|(?<=[A-Za-z]{2})[ı]|(?<=[A-Za-z])[ı](?=[A-Za-z])
Should be nonexistent
\b[Nn]o[nt][- ]existent\b
Should be preexisting
[Pp]re[- ]existing
Should be a
\san (?=(?:[b-dgjkpqtvwz]|f(?!f|d\b)|h(?!onest|onou?r|our|s[lv]|tml|ttp|ref)|l(?!cov)|n(?!ginx|grok|pm)|r(?!c)|s(?!s[ho]|log|vg))[a-z]|x(?!\b|[-\d]|ml))
Should be an
(?<!(?:\b[Ii]|git) )(?<![-.])(?<!\d\s?)\bam\b(?!/pm|[:")]| I\b)
Should be ; otherwise or . Otherwise

https://study.com/learn/lesson/otherwise-in-a-sentence.html

, [Oo]therwise\b
Should probably be Otherwise,
(?<=\. )Otherwise\s
Complete sentences in parentheticals should not have a space before the period.
\s\.\)(?!.*\}\})
Should be an
(?<=\s)a(?= (?:a(?!nd\s|s\s)|e(?!u)|i(?![ns]\s)|o(?!f\b|nc?e)|u(?!\d|biquitous|int|kr|n[ai]|r[ael]|s[aeiu]|short|tf\d*|t_|til|topia|uid|vula|v\b)|y(?!aml|arn|e|ie|oga|oung|y)))
Should be set up (setup is a noun / set up is a verb)
\b[Ss]etup(?= (?:an?|the|to)\b)
Should be reentrancy
[Rr]e[- ]entrancy
Should be reentrant
[Rr]e[- ]entrant
Should be whether or not ...
(?i)\b(?:whe|ra)ther(?:\s\w+)+ or not\.
Should be WinGet
\bWinget\b

Pattern suggestions ✂️ (1)

You could add these patterns to .github/actions/spelling/patterns/a65eb465d66737678eb336a2625928d78fd92e83.txt:

# Automatically suggested patterns

# hit-count: 1 file-count: 1
# python
\b(?i)py(?!gment|gmy|lon|ramid|ro|th)(?=[a-z]{2,})

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Errors, Warnings, and Notices ❌ (8)

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

❌ Errors, Warnings, and Notices Count
⚠️ binary-file 6
ℹ️ candidate-pattern 1
⚠️ check-dictionary-not-found 54
❌ check-file-path 46
❌ forbidden-pattern 32
⚠️ noisy-file 7
⚠️ single-line-file 1
⚠️ token-is-substring 3

See ❌ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@yeelam-gordon

Copy link
Copy Markdown
Collaborator

Thanks Pankaj for the PR.

Fuzzing adds CI cost without proportional value here — the input is internal-only (wt => wta, not user-facing)

I will create a seperate PR even:

  • Moving to JSON-encoded --agent-config arg so the escaping surface reduces to one correctly-quoted boundary

@PankajBhojwani

Copy link
Copy Markdown
Contributor Author

the input is internal-only (wt => wta, not user-facing)

The input is coming from the LLM and then getting injected into wt (via the commandline builder). I don't think we can assume that what the LLM produces is "safe" or internal, hence the fuzzing.

yeelam-gordon added a commit that referenced this pull request Jun 8, 2026
r4-human-only verifier caught a real semantic bug: the previous
"any comment by us in the last 100" semantic miscounted threads
where Copilot **re-raises** after our reply — last=copilot but the
script saw our older reply and reported "not awaiting" even though
the ball was clearly back in our court.

Fix: count threads where the LAST comment is NOT from the
authenticated user. This is the "ball-in-court" model:
- Copilot/human posts a finding → last=them → awaiting our reply.
- We reply → last=us → ball passes back → not awaiting.
- Copilot re-raises after our reply → last=them again → awaiting.

Empirically verified on yeelam-gordon/ABCSkillTest:
- PR #17 baseline 38/38, after 1 reply-NoResolve r3 showed 38/37
  earlier; current measurement is 37/36 (we resolved 1 thread
  since, matching the math exactly).
- PR #18 (human-only fresh) Mode=human-only correctly reported.
  awaiting=0 in that single-account test setup because the agent's
  gh user is also the human reviewer — an unavoidable identity-
  conflation limitation of the test, NOT a script bug. In real
  production usage the agent's gh user is distinct from the
  reviewer's identity (Copilot bot OR a separate human).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants