Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
396 commits
Select commit Hold shift + click to select a range
259c66a
Remove DEBUG_ACTIONS variable.
daztucker Jul 24, 2025
a8c0e5c
upstream: Help OpenSSH's PKCS#11 support kick its meth habit.
djmdjm Jul 24, 2025
1641ab8
upstream: factor out encoding of a raw ed25519 signature into its
djmdjm Jul 24, 2025
9f8ccc3
upstream: less stale reference to PKCS#1 1.5 hash OIDs; feedback
djmdjm Jul 24, 2025
bf33a73
upstream: this should include stdlib.h explicitly
djmdjm Jul 24, 2025
2f52699
remove vestigial stub
djmdjm Jul 25, 2025
03e9e99
include ssh-pkcs11-client.o as common dep
djmdjm Jul 25, 2025
33b4f05
update clang-16 -> clang-19
djmdjm Jul 25, 2025
203f5ac
upstream: test code now needs to link ssh-pkcs11-client.c any time
djmdjm Jul 24, 2025
eedab8d
unbreak !EC builds
djmdjm Jul 25, 2025
ed1e370
upstream: Don't snprintf a NULL since not all platforms support it.
daztucker Jul 25, 2025
550d2a4
another attempt at fixing !EC builds
djmdjm Jul 25, 2025
2b530cc
upstream: update our PKCS#11 API header to v3.0;
djmdjm Jul 25, 2025
361ff0c
upstream: Support ed25519 keys hosted on PKCS#11 tokens.
djmdjm Jul 26, 2025
a729163
upstream: regression tests for Ed25519 keys in PKCS#11 tokens
djmdjm Jul 26, 2025
2603098
repair build for libcrypto without ed25519 support
djmdjm Jul 26, 2025
5e4bfe6
more ec/ed25519 fixing
djmdjm Jul 26, 2025
a5bec2c
upstream: fix variable name in disabled code
djmdjm Jul 30, 2025
dc630e6
upstream: unbreak WITH_OPENSSL=no builds, also allowing ed25519
djmdjm Jul 30, 2025
284abbe
upstream: Plug leak in case where sigp is passed as NULL. Coverity CID
daztucker Jul 30, 2025
b1c4ced
Replace fbsd64ppc VM with physical host.
daztucker Aug 1, 2025
e85248d
Comment out atime restore test.
daztucker Aug 2, 2025
d1c6c67
Disable security key tests for bigendian interop
daztucker Aug 2, 2025
65909fa
upstream: Set default IPQoS for interactive sessions to Expedited
job Jul 31, 2025
ec3465f
upstream: Deprecate support for IPv4 type-of-service (TOS) IPQoS
job Jul 31, 2025
6ebd472
upstream: a bunch of the protocol extensions we support now have RFCs
djmdjm Aug 5, 2025
2a31009
upstream: Use the operating system default DSCP marking for
job Aug 5, 2025
9ffa981
upstream: when refusing a certificate for user authentication, log
djmdjm Aug 6, 2025
60b909f
upstream: Improve sentence. ok djm@
daztucker Aug 6, 2025
2ebc638
upstream: all state related to the ssh connection should live in
djmdjm Aug 6, 2025
0e1b8aa
upstream: ssh(1): add a warning when the connection negotiates a
djmdjm Aug 11, 2025
8b6c1f4
upstream: Handle localtime_r() failure by return "UNKNOWN-TIME"
Aug 11, 2025
ab5074d
upstream: fix typo, ok markus dtucker
sthen Aug 12, 2025
fde5a4d
upstream: Cast serial no for %lld to prevent compiler warnings on some
daztucker Aug 14, 2025
883886c
upstream: Cast serial no for %lld to prevent compiler warnings on some
daztucker Aug 14, 2025
32deb00
upstream: Cast serial no for %lld to prevent compiler warnings on some
daztucker Aug 14, 2025
a00f5b0
handle futex_time64 properly in seccomp sandbox
djmdjm Aug 18, 2025
3a03910
allow some socket syscalls in seccomp sandbox
djmdjm Aug 18, 2025
80b5ffd
upstream: make -E a no-op in sshd-auth. Redirecting logging to a
djmdjm Aug 18, 2025
9b61679
upstream: add channel_report_open() to report (to logs) open
djmdjm Aug 18, 2025
f807a59
upstream: SIGINFO handler for ssh(1) to dump active
djmdjm Aug 18, 2025
dc51470
upstream: SIGINFO handler for sshd(8) to dump active
djmdjm Aug 18, 2025
2892390
upstream: Make ssh(1) and sshd(8) set IP QoS (aka IP_TOS, IPV6_TCLASS)
djmdjm Aug 18, 2025
b7ee13f
wrap SIGINFO in ifdef
djmdjm Aug 18, 2025
0560222
depend
djmdjm Aug 18, 2025
c2c8bae
upstream: missing set_log_handler() call in ssh-auth.c, exposed after
djmdjm Aug 18, 2025
ae44cd7
upstream: cast
djmdjm Aug 18, 2025
9184fa3
check for setsockopt IP_TOS in OpenBSD pledge
djmdjm Aug 18, 2025
6c84609
depend
djmdjm Aug 18, 2025
5e9ca80
Match version instead of groups in connect-bigconf
djmdjm Aug 18, 2025
3ef1a87
Fix pledge(2) special casing
djmdjm Aug 18, 2025
ceca966
upstream: Delete unused accessor function
job Aug 18, 2025
908e9d5
upstream: ssh_config.5: say "post-quantum" instead of "post quantum
Aug 18, 2025
a9a3f02
upstream: remove experimental support for XMSS keys;
djmdjm Aug 29, 2025
683d0ab
upstream: Make MaxStartups and PerSourceNetBlockSize first-match-wins
djmdjm Sep 1, 2025
9313233
upstream: fix previous
djmdjm Sep 2, 2025
c357c4a
upstream: benchmark more diffie-hellman-group* KEXs
djmdjm Aug 21, 2025
19f7cb3
upstream: test MaxStatups idempotency; ok dtucker@
djmdjm Sep 1, 2025
a9b0b69
upstream: replace remaining cases where we manually included __func__
djmdjm Sep 2, 2025
23a2bb7
replace remaining manual logging of __func__
djmdjm Sep 2, 2025
a0b095f
upstream: grammar and typos in comments
djmdjm Sep 2, 2025
d94a9a8
portable-specific comment grammer/spelling fixes
djmdjm Sep 2, 2025
6fd9306
upstream: GssStrictAcceptor was missing from sshd -T output; fix
djmdjm Sep 2, 2025
2f369d3
upstream: fix comment on sshbuf_froms() - it *returns* an error
djmdjm Sep 2, 2025
8866d24
upstream: unit test for xextendf()
djmdjm Sep 2, 2025
cc4eb3d
upstream: simplify algorithm list functions using xextendf(); ok
djmdjm Sep 2, 2025
f38a552
missing header
djmdjm Sep 2, 2025
35d5917
upstream: Improve rules for %-expansion of username.
djmdjm Sep 4, 2025
43b3bff
upstream: don't allow \0 characters in url-encoded strings.
djmdjm Sep 4, 2025
8e85ad3
upstream: fix rtrim() function to not attempt to delete whitespace
djmdjm Sep 4, 2025
e3699ff
upstream: fix sshbuf_dtourlb64() to not choke on empty buffers;
djmdjm Sep 4, 2025
4be4451
upstream: unit tests for a bunch of misc.c functions; ok deraadt@
djmdjm Sep 4, 2025
4569866
upstream: unit tests for sshbuf_equals and sshbuf_dtourlb64; ok
djmdjm Sep 4, 2025
f64701c
upstream: repair test after changes to percent expansion of usernames
djmdjm Sep 4, 2025
9b2c5a2
Fill in missing system header files.
daztucker Sep 5, 2025
d45b17d
Create replacement poll.h if needed.
daztucker Sep 5, 2025
5f09983
Create replacement paths.h if needed.
daztucker Sep 5, 2025
53887d8
Create replacement util.h if needed.
daztucker Sep 5, 2025
82fed51
Create replacement ifaddrs.h if needed.
daztucker Sep 5, 2025
59b8070
Create replacement sys/time.h if needed.
daztucker Sep 5, 2025
ea586ed
Create replacement sys/stat.h if needed.
daztucker Sep 5, 2025
cd9ba06
Create replacement time.h if needed.
daztucker Sep 5, 2025
60334af
Reformat replacement header check one per line.
daztucker Sep 5, 2025
65dcdb5
Create replacement sys/un.h if needed.
daztucker Sep 5, 2025
4911f26
Create replacement libgen.h if needed.
daztucker Sep 5, 2025
7d30526
Remove stray #endif left from previous.
daztucker Sep 5, 2025
caa973d
Create replacement netgroup.h if needed.
daztucker Sep 5, 2025
c729a83
Move sys/time.h include to match upstream.
daztucker Sep 5, 2025
a60721c
Add /* WITH_OPENSSL */ comments.
daztucker Sep 5, 2025
6aac2be
Create replacement endian.h if needed.
daztucker Sep 5, 2025
f93de82
Create replacement nlist.h if needed.
daztucker Sep 5, 2025
932e9f2
upstream: Remove unused rmd160.h header. ripemd160 support was
daztucker Sep 5, 2025
19d6a7a
upstream: Order headers as per KNF. Also removes diff vs
daztucker Sep 5, 2025
441a8fa
upstream: Order headers as per KNF. Removes diff vs portable.
daztucker Sep 5, 2025
b34c16b
Reorder includes to match upstream.
daztucker Sep 5, 2025
22cfd2d
Move ssh-pkcs11.h include to match upstream.
daztucker Sep 5, 2025
aed6a95
Sync includes with upstream.
daztucker Sep 5, 2025
024b694
Resync header order with upstream.
daztucker Sep 5, 2025
bb8ac05
Resync header order with upstream.
daztucker Sep 5, 2025
e803222
upstream: Order headers as per KNF.
daztucker Sep 5, 2025
0ac179c
upstream: Order headers as per KNF. Removes diff vs portable.
daztucker Sep 5, 2025
ee32a36
upstream: Order includes as per KNF and add time.h. Removes diff
daztucker Sep 5, 2025
3ca274e
Check for nlist function.
daztucker Sep 5, 2025
67a8bf4
Use SSH_TUN_COMPAT_AF on FreeBSD.
mkhon Aug 18, 2025
54abadd
Accept OpenSSL 4.0.0-dev versions.
daztucker Sep 7, 2025
3d8ae7f
modified: regress/rekey.sh
Sep 8, 2025
d16b1b4
upstream: Tabs->spaces. Removes diff vs portable.
daztucker Sep 5, 2025
e9dcccc
upstream: remove unused 0-sized files; ok deraadt@
jonathangray Sep 8, 2025
0c719c6
upstream: When adding certificates to an agent, set the expiry to
djmdjm Sep 11, 2025
7a4738a
upstream: need time.h for time(3)
djmdjm Sep 11, 2025
c60153e
upstream: correct getopt() string
djmdjm Sep 11, 2025
edc6017
upstream: disable ssh-add autoexpiry of certificates when testing
djmdjm Sep 11, 2025
efed5da
upstream: fix memleak when applying certificate options; ok
djmdjm Sep 15, 2025
0387201
upstream: when merging auth options into the active set, don't
djmdjm Sep 15, 2025
fae8e41
upstream: fix memleak of channel forwarding permissions; ok
djmdjm Sep 15, 2025
67940cc
upstream: memleak of kex->server_sig_algs; ok dtucker@
djmdjm Sep 15, 2025
d68451a
upstream: memleak of KRL revoked certs struct; ok dtucker
djmdjm Sep 15, 2025
0088b3f
upstream: memleaks of request packet and hostkeys blob; ok
djmdjm Sep 15, 2025
ee77ab9
upstream: memleak of rfwd callback context; ok dtucker@
djmdjm Sep 15, 2025
bc60bd5
upstream: memleak of editline history; ok dtucker@
djmdjm Sep 15, 2025
42fc6b6
upstream: memleak of hostkey when downgrading host cert->key; ok
djmdjm Sep 15, 2025
ee99f6e
upstream: memleak of certificate path; ok dtucker@
djmdjm Sep 15, 2025
0bb3708
upstream: memleak of keys not used for authentication; ok
djmdjm Sep 15, 2025
b9464ce
upstream: leak of authentication options at exit; ok dtucker@
djmdjm Sep 15, 2025
52f38c7
upstream: leak of principals file lines; ok dtucker@
djmdjm Sep 15, 2025
6f59424
upstream: fix leaks of struct sftp_conn in scp; ok dtucker@
djmdjm Sep 15, 2025
a4aa090
upstream: memory leaks in unit tests
djmdjm Sep 15, 2025
7c32e09
Add VM test targets via vmaction on Github.
daztucker Sep 15, 2025
2202e5f
Use relative URLs for status
daztucker Sep 16, 2025
fc70405
Move Gihub VMs to their own status line.
daztucker Sep 17, 2025
8099339
Whitespace.
daztucker Sep 17, 2025
bc32814
upstream: log at level INFO when PerSourcePenalties actually blocks
djmdjm Sep 19, 2025
ca9ac11
Rerun tests if run_tests.sh changes.
daztucker Sep 20, 2025
1659d0a
Build OpenSSL with -j4 to speed it up.
daztucker Sep 20, 2025
c682c9f
Add tests for OpenSSL 3.4 and 3.5 versions.
daztucker Sep 20, 2025
67b3ed1
Add OpenSSL 3.x ABI cross-compatibility test.
daztucker Sep 20, 2025
2c1d38f
Exclude generated openbsd-compat/include directory.
daztucker Sep 22, 2025
83853aa
Factor out OpenSSL install and test more versions.
daztucker Sep 22, 2025
b94e725
Specify rpath when building OpenSSL.
daztucker Sep 23, 2025
31fce4f
Test openssl-3.6.0-beta1.
daztucker Sep 23, 2025
d00015d
Test openssl-3.6 branch not beta1.
daztucker Sep 23, 2025
eff3588
Merge VM tests into a single workflow file.
daztucker Sep 23, 2025
d858847
upstream: spelling; ok dtucker@
jonathangray Sep 24, 2025
ae62a16
upstream: remove prototype for removed ssh_packet_set_tos() ok
jonathangray Sep 25, 2025
0af7e5b
upstream: remove unneeded externs ok djm@
jonathangray Sep 25, 2025
6f28a93
upstream: consistently use NULL for null pointer constants found
jonathangray Sep 25, 2025
b62aa85
upstream: clarify intent and avoid (harmess, defined behaviour)
djmdjm Sep 25, 2025
d0c1e73
upstream: fix leaks of config objects in
djmdjm Sep 25, 2025
4fddebe
upstream: add some functions to free various structs, including
djmdjm Sep 25, 2025
a071af0
upstream: wait for the unprivileged sshd-auth process to exit
djmdjm Sep 25, 2025
a8a2702
upstream: fix some leaks; feedback/ok dtucker@
djmdjm Sep 25, 2025
a1a7df8
upstream: fix some leaks in ssh-add; feedback/ok dtucker@
djmdjm Sep 25, 2025
846987d
upstream: fix some one-off leaks in ssh-keygen; ok dtucker@
djmdjm Sep 25, 2025
8235dc3
upstream: fix some one-off leaks in ssh.c; ok dtucker@
djmdjm Sep 25, 2025
1362f6c
Add #ifdefs in pwfree to match those in pwcopy.
daztucker Sep 25, 2025
7ce3823
Merge all putty tests into a single test.
daztucker Sep 23, 2025
35f3e2a
Update pledge() interface to match current OpenBSD.
daztucker Sep 25, 2025
e914e61
Remove status bits from OpenSSL >=3 version check.
daztucker Sep 25, 2025
6c3c9f0
Replace hand-rolled modulo with arc4random_uniform.
daztucker Sep 25, 2025
37d996b
upstream: Check return codes of sshbuf functions.
daztucker Sep 25, 2025
9824ec5
Update link to oss-fuzz bug tracker.
daztucker Sep 26, 2025
b4ceca9
Shorten workflow names to fit in a single line.
daztucker Sep 26, 2025
97b32fa
upstream: Use $OBJ for temp file in maxstartups idempotence test.
daztucker Sep 26, 2025
b06a150
Stop testing OpenBSD ubsan until fixed upstream.
daztucker Sep 27, 2025
b1c4bf5
upstream: avoid use-after-free in update_krl_from_file() found with
jonathangray Sep 25, 2025
bcd88de
upstream: kbd-interactive device names should be matched against
djmdjm Sep 29, 2025
fda31e1
upstream: avoid spurious error message when loading certificates
djmdjm Sep 29, 2025
c82f4dd
upstream: Null out keys after freeing in tests in the case where we
daztucker Sep 29, 2025
dfb991b
upstream: Sort headers as per KNF. Removes diff vs portable.
daztucker Sep 29, 2025
2f71b44
upstream: Include misc.h. Removes diff vs portable.
daztucker Sep 29, 2025
90f49a1
upstream: Move ifdef to start of file. Removes diff vs portable.
daztucker Sep 29, 2025
893a579
upstream: Add explicit check for array overflow.
daztucker Sep 29, 2025
d343df4
ensure struct passwd fields are non-NULL in pwcopy
Aug 22, 2025
e5055ef
Don't log audit messages with UNKNOWN hostname
allisonkarlitskaya Sep 3, 2025
42b14ff
upstream: fix memory leak in mux_client_request_stdio_fwd GHPR#575
djmdjm Sep 30, 2025
1f75567
upstream: avoid a fatal() when sftp tab-completes filenames that
djmdjm Sep 30, 2025
2c504a7
upstream: during sftp uploads, avoid a condition where a failed write
djmdjm Sep 30, 2025
d478e25
Update OpenSSL & LibreSSL versions we test against.
daztucker Oct 1, 2025
eb30a0d
upstream: Get rid of utf8 droppings in commment since it confuses
daztucker Oct 1, 2025
aceabd6
upstream: Set keys to NULL after freeing in tests where the
daztucker Oct 1, 2025
5c50ddb
Remove compat "include" dir during distclean.
daztucker Oct 1, 2025
047e022
Pass new "compat includes" path via AC_SUBST.
daztucker Oct 1, 2025
b9f6a84
Pass COMPATINCLUDES down to openbsd-compat too.
daztucker Oct 2, 2025
6a239b0
upstream: backout r1.243 (fix for fatal during tab-completion with
djmdjm Oct 2, 2025
3957cc2
upstream: Relax array check slightly. Prevents compiler warnings
daztucker Oct 2, 2025
a9cbe10
upstream: include openssl/bn.h explicitly in files where we use BN_*
djmdjm Oct 3, 2025
ade92f5
upstream: stray newline
djmdjm Oct 3, 2025
a0e5446
upstream: typos: a ssh* -> an ssh*
Oct 4, 2025
b9a640a
upstream: If write() returned short, the subsequent write would restart
daztucker Oct 3, 2025
981bb32
upstream: openssh-10.1
djmdjm Oct 6, 2025
2fd0945
sync ssh-copy-id to upstream version 527be673f4d
djmdjm Oct 6, 2025
af95657
update versions
djmdjm Oct 6, 2025
476bab6
depend
djmdjm Oct 6, 2025
1dfb2c1
autogenerated files for release
djmdjm Oct 6, 2025
d41503a
add GitHub Copilot files
tgauth Jan 9, 2026
1053ed3
update instructions to branch off of current branch instead of latest…
tgauth Jan 9, 2026
2955382
remove direct references to scripts for mcp tools
tgauth Jan 9, 2026
36c4826
fix default log location in tool
tgauth Jan 9, 2026
2ffcb0e
create tool for merge process prerequisites
tgauth Jan 9, 2026
4984b21
replace more direct scripts references to mcp tool references
tgauth Jan 9, 2026
63ac1ac
update mcp server name
tgauth Jan 9, 2026
644bbf5
fix merge prereq tool
tgauth Jan 9, 2026
1d8b201
update merge prereq tool
tgauth Jan 9, 2026
aa02282
update instructions
tgauth Jan 9, 2026
2bbb98e
update instructions
tgauth Jan 9, 2026
123f8e2
refactor tool to workaround io/buffer issues when invoked via MCP
tgauth Jan 15, 2026
09f0fd6
update instructions to use mcp tool to read build logs
tgauth Jan 15, 2026
59178e8
update build verfication script to check correct location for artifacts
tgauth Jan 15, 2026
2985579
fix typo
tgauth Jan 15, 2026
76775b2
fix tool to parse build log for success/failure and update instructions
tgauth Jan 23, 2026
e379310
add merge prompt file
tgauth Jan 23, 2026
5b55ec2
update tools
tgauth Jan 23, 2026
950bb1b
update instructions to build only after batch of commits with a CI run
tgauth Jan 23, 2026
ead71d7
update prereq tool to use start-job with git cmd
tgauth Jan 23, 2026
071bfba
update build instructions with paths.targets info
tgauth Jan 23, 2026
332176b
refine instructions
tgauth Jan 23, 2026
0bb51cd
tweak instructions
tgauth Jan 23, 2026
29ad116
update tool
tgauth Jan 23, 2026
a1072a6
fix bug in tool
tgauth Jan 30, 2026
c19ad3f
update instructions
tgauth Jan 30, 2026
2d2368c
add instructions for communication expectations and examples
tgauth Feb 20, 2026
179d41e
update instructions and tools to clarify end commit expectations
tgauth Feb 20, 2026
7e1ea03
add instructions around addressing compiler warnings
tgauth Feb 20, 2026
c19afda
add tool to wrap GH commands to check exit code
tgauth Mar 6, 2026
8a16638
add tool to get context during complex conflicts
tgauth Mar 6, 2026
7801561
Merge branch 'PowerShell:latestw_all' into latestw_all_copilot
tgauth Mar 9, 2026
5f24965
add scratch branch instructions
tgauth Mar 17, 2026
232775d
refine instructions
tgauth Apr 15, 2026
f06d9c8
add tool to invoke E2E CI
tgauth Apr 16, 2026
aca3117
add vcpkg tools
tgauth May 7, 2026
c2355be
Merge branch 'latestw_all_copilot' of https://github.com/tgauth/opens…
tgauth May 15, 2026
56478f0
add readme
tgauth May 15, 2026
eb7fc88
remove entra instructions
tgauth May 15, 2026
cc402d8
refine instructions
tgauth May 15, 2026
5644ae5
clarify scratch branch instructions
tgauth May 15, 2026
7864920
add mcp.json
tgauth May 27, 2026
12747fd
Document Invoke-Git Log Range constraint
tgauth May 27, 2026
da1fa70
update invoke-git instructions
tgauth May 27, 2026
8979cb5
Merge instructions: disable rerere, default to smoke test per batch
tgauth May 27, 2026
93d58ee
revert unnecessary change
tgauth May 27, 2026
18ab9d5
revert unnecessary change
tgauth May 27, 2026
98c7700
Delete test user profile folder during cleanup
tgauth Jun 29, 2026
536ce53
Fix Get-CommitGroups: fail hard on GitHub API rate-limit exhaustion
tgauth Jun 29, 2026
231ab92
Merge pull request #14 from tgauth/tgauth-cleanup-local-user-folder
tgauth Jun 29, 2026
c5e7861
Merge branch 'latestw_all_copilot' of https://github.com/tgauth/opens…
tgauth Jun 29, 2026
9f38aa9
Add merge guidance for upstream changes to Windows-adapted regress tests
tgauth Jun 29, 2026
23a90d9
refine merge agent/tools/instructions
tgauth Jul 31, 2026
8286dbd
add token for mcp input to prevent throttling
tgauth Aug 3, 2026
2570ffc
Merge upstream OpenSSH V_10_1_P1
tgauth Aug 18, 2026
0a1ae0f
Apply Windows build fixes for V_10_1_P1 merge
tgauth Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 9 additions & 16 deletions .depend

Large diffs are not rendered by default.

266 changes: 266 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
# `.github/` — AI-Assisted Development for OpenSSH-Portable (Windows Fork)

This folder contains everything needed to work on the PowerShell team's
Windows fork of OpenSSH-Portable with AI assistance in VS Code (GitHub
Copilot Chat / agent mode). It bundles together **agents**, **prompts**,
**instructions**, **skills**, and a set of PowerShell **tools** exposed as
an **MCP server** so that complex workflows (especially upstream merges)
can be driven mostly by an AI agent with a human reviewer in the loop.

If you are new here, read the [Overview](#overview) first, set up the
[MCP server](#mcp-server-setup-vscodemcpjson), then jump to
[Merging from upstream](#merging-from-upstream) for the most common
workflow.

---

## Overview

### What lives in `.github/`

| Folder | Purpose |
|---|---|
| [`agents/`](./agents/) | Custom Copilot **agent modes** — pre-configured personas with curated tool access for specific workflows. |
| [`prompts/`](./prompts/) | Reusable **prompt templates** that kick off a workflow with the right inputs and context. |
| [`instructions/`](./instructions/) | **Instructions** auto-loaded into agent context (via `applyTo` globs) describing repo conventions, build process, merge strategy, testing, etc. |
| [`skills/`](./skills/) | Self-contained **skill packages** the agent can invoke for narrow, repeatable tasks (e.g. bumping a vcpkg port). |
| [`tools/`](./tools/) | PowerShell scripts exposed through the MCP server as callable tools (build, test, git, merge orchestration, vcpkg). |
| [`workflows/`](./workflows/) | GitHub Actions workflows (CI). Not AI-related. |

### How the pieces fit together

```
┌────────────────────────────────────────────────────────────────┐
│ VS Code + GitHub Copilot (chat / agent mode) │
│ │
│ ├─ loads instructions/*.md (auto, by applyTo) │
│ ├─ can switch into an agent from agents/*.agent.md │
│ ├─ can be launched via a prompt from prompts/*.prompt.md │
│ ├─ can invoke skills from skills/*/SKILL.md │
│ └─ can call MCP tools ──────────────────┐ │
└───────────────────────────────────────────┼────────────────────┘
┌─────────────────────────────┐
│ MCP server (openssh-server)│
│ defined in .vscode/mcp.json│
│ runs PowerShell from │
│ .github/tools/*.ps1 │
└─────────────────────────────┘
```

---

## Repository setup

Follow [instructions/setup.instructions.md](./instructions/setup.instructions.md)
end-to-end. It covers cloning the fork, configuring the `upstream` and
`upstream-pwsh` remotes, prerequisites (Visual Studio + Windows SDK), and
cloning + bootstrapping vcpkg via
[Install-VcpkgDependencies.ps1](./tools/Install-VcpkgDependencies.ps1).
For the vendored dependency model itself, see
[instructions/vcpkg.instructions.md](./instructions/vcpkg.instructions.md).
Once setup is complete, do a baseline build per
[instructions/build.instructions.md](./instructions/build.instructions.md).

---

## MCP server setup (`.vscode/mcp.json`)

The PowerShell scripts in [`tools/`](./tools/) are exposed to Copilot via
a small MCP (Model Context Protocol) server so the agent can call them as
first-class tools (`mcp_openssh-server_Start_OpenSSHBuild`,
`mcp_openssh-server_Invoke_Git`, etc.).

### 1. Install the MCP host module

The server is hosted by the `MCPServerPS` PowerShell module, which wraps
each `.ps1` in `-ScriptRoot` as an MCP tool. See the linked package page
for installation details: https://github.com/daxian-dbw/MCPServerPS/pkgs/nuget/MCPServerPS

### 2. Configure VS Code

Create `.vscode/mcp.json` at the repo root (already present in this repo
— adjust the path if your clone lives elsewhere):

```json
{
"servers": {
"openssh-server": {
"type": "stdio",
"command": "pwsh",
"args": [
"-noprofile",
"-c",
"MCPServerPS\\Start-MyMCP -ScriptRoot C:\\repos\\openssh-portable\\.github\\tools"
]
}
},
"inputs": []
}
```

> **Path note:** Update `C:\repos\openssh-portable\.github\tools` to the
> absolute path of `.github/tools` in your clone.

### 3. Start the server in VS Code

- Open the **MCP: List Servers** command (Command Palette).
- Start `openssh-server`. You should see the tools become available to
Copilot Chat (their names are prefixed with
`mcp_openssh-server_`, e.g. `mcp_openssh-server_Invoke_Git`).
- In agent mode, the agent will discover and call them automatically.

### 4. Available MCP tools

All tools are PowerShell scripts under [`tools/`](./tools/). They are
documented in detail inside their respective instruction files; here's a
quick map:

| Tool (MCP name) | Script | What it does |
|---|---|---|
| `mcp_openssh-server_Test_MergePrerequisites` | [Test-MergePrerequisites.ps1](./tools/Test-MergePrerequisites.ps1) | Verify environment + remotes are ready for a merge. |
| `mcp_openssh-server_Get_CommitGroups` | [Get-CommitGroups.ps1](./tools/Get-CommitGroups.ps1) | Group upstream commits into mergeable batches by CI presence/success. |
| `mcp_openssh-server_Get_RemainingCommitCount` | [Get-RemainingCommitCount.ps1](./tools/Get-RemainingCommitCount.ps1) | Count commits remaining between a start ref and the end tag/HEAD (merge progress). |
| `mcp_openssh-server_Invoke_Git` | [Invoke-Git.ps1](./tools/Invoke-Git.ps1) | Structured wrapper around git operations (Status, Merge, Diff, Checkout, …). |
| `mcp_openssh-server_Get_ConflictContext` | [Get-ConflictContext.ps1](./tools/Get-ConflictContext.ps1) | Three-way diff context for high-complexity merge conflicts. |
| `mcp_openssh-server_Test_MergeConflictMarkers` | [Test-MergeConflictMarkers.ps1](./tools/Test-MergeConflictMarkers.ps1) | Scan the working tree for leftover conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`) and unmerged paths. |
| `mcp_openssh-server_Sync_VersionResource` | [Sync-VersionResource.ps1](./tools/Sync-VersionResource.ps1) | Sync `contrib/win32/openssh/version.rc` numbers to `version.h` after a version bump. |
| `mcp_openssh-server_Start_OpenSSHBuild` | [Start-OpenSSHBuild.ps1](./tools/Start-OpenSSHBuild.ps1) | Build the Win32-OpenSSH solution. Defaults to the host architecture. |
| `mcp_openssh-server_Test_OpenSSHBuild` | [Test-OpenSSHBuild.ps1](./tools/Test-OpenSSHBuild.ps1) | Parse the most recent build log for errors and warnings. |
| `mcp_openssh-server_Test_OpenSSHFunctionality` | [Test-OpenSSHFunctionality.ps1](./tools/Test-OpenSSHFunctionality.ps1) | End-to-end smoke test (install service, connect, cleanup). |
| `mcp_openssh-server_Invoke_OpenSSHTests` | [Invoke-OpenSSHTests.ps1](./tools/Invoke-OpenSSHTests.ps1) | Full CI suite (unit + bash + Pester E2E). |
| `mcp_openssh-server_Install_VcpkgDependencies` | [Install-VcpkgDependencies.ps1](./tools/Install-VcpkgDependencies.ps1) | Bootstrap vcpkg and install vendored deps. Also runnable directly from a terminal for first-time setup. |
| `mcp_openssh-server_Update_VcpkgPort` | [Update-VcpkgPort.ps1](./tools/Update-VcpkgPort.ps1) | Bump a vendored vcpkg port. Orchestrated by the `update-vcpkg-port` skill. |

---

## Instructions, agents, prompts, and skills

### Instructions ([`instructions/`](./instructions/))

Markdown files with YAML frontmatter that the agent loads automatically
based on `applyTo` globs. They encode the conventions and workflows of
this repo so you don't need to repeat them in every prompt.

General:
- [getting-started.instructions.md](./instructions/getting-started.instructions.md) — index of all instruction files
- [repository-overview.instructions.md](./instructions/repository-overview.instructions.md) — repo layout + Windows compatibility layer
- [setup.instructions.md](./instructions/setup.instructions.md) — clone, remotes, prerequisites, vcpkg
- [build.instructions.md](./instructions/build.instructions.md) — building on Windows + warning policy
- [testing.instructions.md](./instructions/testing.instructions.md) — functional + full CI testing
- [vcpkg.instructions.md](./instructions/vcpkg.instructions.md) — vendored dependency reference
- [agent-communication.instructions.md](./instructions/agent-communication.instructions.md) — how the agent should talk to you

Merge-specific (under [`instructions/merge/`](./instructions/merge/)):
- [merge-process-overview.instructions.md](./instructions/merge/merge-process-overview.instructions.md) — the two-phase workflow end-to-end
- [merge-details.instructions.md](./instructions/merge/merge-details.instructions.md) — conflict resolution patterns + decision trees
- [research.instructions.md](./instructions/merge/research.instructions.md) — what to read before merging (release notes, prior PRs)
- [agent-communication-merge.instructions.md](./instructions/merge/agent-communication-merge.instructions.md) — communication templates for batches

### Agents ([`agents/`](./agents/))

Custom Copilot agent modes with curated tool sets and a system prompt
tuned to a workflow.

- [merge-upstream.agent.md](./agents/merge-upstream.agent.md) — drives
the upstream merge workflow end-to-end (analysis → batch merges →
build → test → PR prep). Switch to it from the Copilot Chat agent
picker.
- [conflict-review.agent.md](./agents/conflict-review.agent.md) —
review-only subagent the merge agent delegates to after resolving a
batch's conflicts. Audits resolutions for leftover markers, prefer-
upstream bias, balanced Windows guards, silently auto-merged changes
needing Windows follow-up, and version sync; returns APPROVE or
CHANGES-REQUIRED.

### Prompts ([`prompts/`](./prompts/))

Reusable prompt templates with documented inputs.

- [merge.prompt.md](./prompts/merge.prompt.md) — kicks off a merge with
the right context. Provide a start ref (and optionally end ref,
remotes, validation scenario), and the agent handles the rest.

### Skills ([`skills/`](./skills/))

Self-contained workflow skills the agent reads on demand.

- [update-vcpkg-port](./skills/update-vcpkg-port/SKILL.md) — bump a
vendored vcpkg dependency (LibreSSL, libfido2, libcbor, zlib) with
all the side effects (overlay portfile SHA512, LibreSSL resource
patch) handled correctly.
- [resolve-merge-conflict](./skills/resolve-merge-conflict/SKILL.md) —
conflict-resolution procedure for upstream merges (prefer-upstream +
adapt for Windows, strategy preference order, silent auto-merge
hunting, regress-test and version-resource sync) plus how to summarize
the resolutions for the pull request.
- [merge-retrospective](./skills/merge-retrospective/SKILL.md) — run
after a merge PR lands to capture new conflict-resolution patterns and
feed lessons back into the instructions, skills, agents, and tools.

---

## Merging from upstream

Merging from `openssh/openssh-portable` is the headline workflow this
folder is built around. It uses a **two-phase approach** (all incremental
merges, conflict resolution, build fixes, and validation happen on a
scratch branch; then a real merge branch is created from the same
starting commit, a single `git merge` of the upstream target is
performed, and any conflicts are resolved by copying the resolved files
from the scratch branch). This preserves upstream commit history
exactly. The full workflow lives in
[instructions/merge/merge-process-overview.instructions.md](./instructions/merge/merge-process-overview.instructions.md);
conflict-resolution patterns are in
[merge-details.instructions.md](./instructions/merge/merge-details.instructions.md);
background reading is in
[research.instructions.md](./instructions/merge/research.instructions.md).

### Driving the merge with AI (recommended)

1. Make sure the [MCP server is running](#mcp-server-setup-vscodemcpjson).
2. In Copilot Chat, switch to the **`merge-upstream`** agent
([agents/merge-upstream.agent.md](./agents/merge-upstream.agent.md)).
3. Invoke the merge prompt
([prompts/merge.prompt.md](./prompts/merge.prompt.md)) with at minimum
a start ref — see that file for the full input list and examples.
4. Approve each batch summary the agent presents; at the end, push the
real branch and open the PR.

### Driving the merge manually

Follow
[merge-process-overview.instructions.md](./instructions/merge/merge-process-overview.instructions.md)
step by step.

### Validation

Default validation is end-to-end via
`mcp_openssh-server_Test_OpenSSHFunctionality`. The full CI suite is
documented in
[instructions/testing.instructions.md](./instructions/testing.instructions.md).

---

## Other AI-assisted workflows

### Bumping a vendored vcpkg dependency

Use the [`update-vcpkg-port`](./skills/update-vcpkg-port/SKILL.md) skill.
Ask Copilot something like *"Bump LibreSSL to 4.1.1 using the
update-vcpkg-port skill."* The skill orchestrates
[Update-VcpkgPort.ps1](./tools/Update-VcpkgPort.ps1) (manifest, overlay
portfile SHA512, LibreSSL resource patch), validates via
[Install-VcpkgDependencies.ps1](./tools/Install-VcpkgDependencies.ps1),
then builds to confirm.

### Building / testing / debugging

Even outside a merge, the MCP tools are useful day-to-day. See
[build.instructions.md](./instructions/build.instructions.md) and
[testing.instructions.md](./instructions/testing.instructions.md) for
the full parameter reference of `Start-OpenSSHBuild`,
`Test-OpenSSHBuild`, `Test-OpenSSHFunctionality`, and
`Invoke-OpenSSHTests`.


Loading