Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 20, 2025

  • Review current copilot-instructions.md and identify gaps based on best practices
  • Add project overview and technology stack section
  • Add project structure section
  • Add build commands and dependencies section
  • Add testing commands section
  • Add linting and formatting commands section
  • Reorganize content to follow GitHub Copilot best practices
  • Maintain all original domain-specific security guidance
  • Verify no build or test issues - all formatting checks pass
  • Address PR feedback:
    • Clarify cross-compilation limitations and correct documentation reference
    • Add cargo doc to required checks before commit
    • Clarify that default test commands won't run anything and mention nextest config
    • Better clarify trust boundaries between OpenVMM, OpenHCL, root, and VTL0 guest
Original prompt

This section details on the original issue you should resolve

<issue_title>✨Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository. There may already be instructions that were previously set up, but the best practices have likely changed since then.

</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #2220


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Configure Copilot instructions for repository ✨ Enhance Copilot instructions with comprehensive best practices Oct 20, 2025
@Copilot Copilot AI requested a review from benhillis October 20, 2025 23:04
Copilot finished work on behalf of benhillis October 20, 2025 23:04
@benhillis benhillis marked this pull request as ready for review October 20, 2025 23:04
@benhillis benhillis requested a review from a team as a code owner October 20, 2025 23:04
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 23:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the GitHub Copilot instructions file to provide comprehensive context and guidance for the OpenVMM repository, expanding it from 29 to 104 lines following GitHub's best practices for Copilot coding agents.

Key Changes:

  • Added structured sections for project overview, technology stack, and project structure to provide better repository context
  • Expanded build, test, and formatting sections with concrete commands and examples
  • Reorganized existing domain-specific security guidelines into a clearer structure

Comment on lines 42 to 43
### Cross-compilation
The project supports cross-compilation for `x86_64` and `aarch64` architectures on both Windows and Linux. See `cargo xflowey restore-packages --help` for cross-compilation package options.
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. You can't build certain components from Windows (even if you're targeting Linux), you must use Linux. WSL counts as linux.
  2. restore-packages --help doesn't help with cross-compile. Look at the Guide (and see references for . ./build_support/setup_windows_cross.sh as an example)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated cross-compilation section to clarify that some components like OpenHCL can only be built from Linux (WSL2 counts as Linux), and corrected the reference to point to the Guide and the setup_windows_cross.sh script. (commit c5b3738)

Comment on lines 64 to 66
### Required Before Each Commit
Always run formatting before committing:
```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

You also want to run cargo doc before committing, to catch any errors in the rustdocs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added cargo doc to the required checks before committing to catch rustdoc errors. (commit c5b3738)

Comment on lines 49 to 54
```bash
# Recommended - install with: cargo install cargo-nextest --locked
cargo nextest run

# Or use standard cargo test
cargo test
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the default won't actually run anything. You should run the tests in the packages that you are modifying. vmm-tests is a special case and requires additional setup.

Copy link
Contributor

Choose a reason for hiding this comment

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

You likely also want to use the /.config/nextest.toml file to configure how you run tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated testing section to clarify that default won't run anything and users should specify packages with -p <package-name>. Also added a note about using .config/nextest.toml for test configuration. (commit c5b3738)

Comment on lines 92 to 98
### Domain-specific Guidelines
Both OpenVMM and OpenHCL process data from untrusted sources. OpenHCL runs in a constrained environment.

When possible:
1. Avoid `unsafe` code
2. Avoid taking new external dependencies, especially those that significantly increase binary size
3. Ensure code doesn't panic across trust boundaries (critical for security)
Copy link
Contributor

Choose a reason for hiding this comment

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

This has tripped me up with copilot-generated and copilot-reviewed code. We should better clarify the trust boundary:

  • OpenVMM does not trust the VTL0 guest.
  • OpenHCL does not trust the root.
  • OpenHCL does not trust the VTL0 guest, but this is less critical than OpenVMM not trusting the VTL0 guest. (the attack surface is subtle, so needs human review).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added explicit trust boundary clarifications:

  • OpenVMM does not trust the VTL0 guest
  • OpenHCL does not trust the root
  • OpenHCL does not trust the VTL0 guest (less critical, subtle attack surface needs human review)

This should help Copilot better understand and respect these critical security boundaries. (commit c5b3738)

@mattkur
Copy link
Contributor

mattkur commented Oct 20, 2025

@copilot, I left some comments for you.

…ries, and add cargo doc

Co-authored-by: mattkur <13772048+mattkur@users.noreply.github.com>
@Copilot Copilot AI requested a review from mattkur October 20, 2025 23:53
Copilot finished work on behalf of mattkur October 20, 2025 23:53
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.

✨Set up Copilot instructions

3 participants