Skip to content

fix(copilot): catch up to v0.43.0 (description frontmatter field) - #761

Merged
avifenesh merged 2 commits into
mainfrom
chore/triage-copilot-0-43-0
Apr 23, 2026
Merged

fix(copilot): catch up to v0.43.0 (description frontmatter field)#761
avifenesh merged 2 commits into
mainfrom
chore/triage-copilot-0-43-0

Conversation

@avifenesh

Copy link
Copy Markdown
Collaborator

Summary

Triage of microsoft/vscode-copilot-chat v0.42.2 -> v0.43.0 (issue #748). Auto-extracted release notes were empty in the issue body, so used gh release view and the v0.42.2...v0.43.0 commit/PR diff to identify schema-affecting changes.

The fix

PR microsoft/vscode-copilot-chat#4964 (in v0.43.0) makes the description frontmatter field on .instructions.md files a user-visible feature in the VS Code Chat Customizations UI. Without this PR, agnix would false-positive COP-004 (unknown frontmatter key) AND offer an auto-fix to delete the line on every v0.43.0+ user that follows the docs.

Added "description" to KNOWN_KEYS and a typed description: Option<String> field on CopilotScopedSchema in crates/agnix-core/src/schemas/copilot.rs. Two regression tests:

  • test_parse_description (parses description field correctly)
  • test_description_not_unknown_key (does not trigger COP-004)

Other v0.43.0 changes inspected — NO agnix change needed

PR Change Why no impact
#4952 Wire hooks through CLI customization provider UI/UX only; COP-017 hooks schema unchanged
#4962 Wire plugins through CLI customization provider UI/UX only; COP-019/020 plugin manifest unchanged
#4974 Fix: emit agent instructions in CLI provider Bug fix; no schema change
#4942 Move internal docs/prompts.md -> .instructions.md Internal vscode-copilot-chat reorganization
#4989 Fix: AGENTS.md/CLAUDE.md multi-root workspace discovery Bug fix; no schema change
All NES/session/telemetry/summarization commits Internal pipeline No user-facing config format affected

Cross-checked PromptHeaderAttributes in promptFileParser.ts at v0.42.2 vs v0.43.0 — field list identical, but v0.43.0 makes description actively read and displayed (was previously a no-op accept).

Test fixture update (in same commit)

test_fix_copilot_scoped_missing_applyto in agnix-cli/tests/cli_integration.rs was using description: TypeScript rules as the "unknown frontmatter key" that triggers COP-004's auto-fix-delete path. Now that description is recognized, that fixture no longer triggers a fixable issue. Updated the fixture to use someUnknownKey: ... instead, preserving the test's intent (regression coverage for COP-004 fix availability).

Doc bumps

  • knowledge-base/rules.json and crates/agnix-rules/rules.json: bumped verified_on to 2026-04-22 for all 25 COP-* rules
  • knowledge-base/RESEARCH-TRACKING.md: GitHub Copilot "Last Reviewed" 2026-02-05 -> 2026-04-22
  • Regenerated website/docs/rules/generated/*.md

ToolVersions

ToolVersions::copilot is Option<String> (user-supplied version). Nothing to bump.

Source verified

  • gh release view v0.43.0 -R microsoft/vscode-copilot-chat
  • gh api repos/microsoft/vscode-copilot-chat/compare/v0.42.2...v0.43.0 (~100 commits)
  • 5 PR bodies (#4942, #4952, #4962, #4964, #4974, #4989)
  • promptFileParser.ts at both tags (PromptHeaderAttributes diff)

Test plan

  • cargo build --workspace clean
  • cargo test -p agnix-core --lib: 3448 passed (+2 new)
  • cargo test -p agnix-cli --test cli_integration test_fix_copilot_scoped_missing_applyto: passes with updated fixture
  • cargo test -p agnix-rules --tests: 47 + 4 parity tests pass
  • cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • cargo fmt --all clean
  • Pre-push hook passes
  • CI: Verify Changelog
  • CI: Security Audit
  • CI: Tests (ubuntu, macos, windows)
  • CI: claude-review
  • Address all reviewer comments

Closes #748.

Closes #748.

Triage of microsoft/vscode-copilot-chat v0.42.2 -> v0.43.0. Auto-extracted
release notes were empty in the issue body, so used `gh release view` and
the v0.42.2...v0.43.0 commit/PR diff to identify schema-affecting changes.

ONE structural change: PR microsoft/vscode-copilot-chat#4964 (in v0.43.0)
makes the `description` frontmatter field on `.instructions.md` files a
user-visible feature in the VS Code Chat Customizations UI. Without this
fix, agnix would false-positive COP-004 (unknown frontmatter key) and
offer an auto-fix to delete the line on every v0.43.0+ user that follows
the docs.

Added `"description"` to KNOWN_KEYS and a typed `description: Option<String>`
field on CopilotScopedSchema in crates/agnix-core/src/schemas/copilot.rs.
Plus two regression tests:
  - test_parse_description (parses description field correctly)
  - test_description_not_unknown_key (does not trigger COP-004)

Other v0.43.0 changes inspected and verified to need NO agnix change:
  - PR #4952 / #4962: hooks/plugins UI wiring through CLI customization
    provider (UI/UX only; COP-017 hooks schema unchanged; COP-019/020
    plugin manifest schema unchanged)
  - PR #4974: agent instructions emission bug fix (no schema change)
  - PR #4942: internal docs/prompts.md -> .instructions.md move
    (vscode-copilot-chat repo internal reorganization)
  - PR #4989: AGENTS.md/CLAUDE.md multi-root workspace discovery fix
  - All NES/session/telemetry/summarization commits: internal pipeline

Cross-checked PromptHeaderAttributes in promptFileParser.ts at v0.42.2 vs
v0.43.0 - field list identical, but v0.43.0 makes `description` actively
read and displayed (was previously a no-op accept).

Documentation:
  - Bumped verified_on to 2026-04-22 for all 25 COP-* rules in
    knowledge-base/rules.json and synced crates/agnix-rules/rules.json
  - Bumped RESEARCH-TRACKING.md \"Last Reviewed\" for GitHub Copilot
    from 2026-02-05 to 2026-04-22
  - Regenerated website/docs/rules/generated/*.md

Verified locally:
  - cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  - cargo test -p agnix-core --lib: 3448 passed (+2 new regression tests)
  - cargo test -p agnix-rules --tests: 47 + 4 parity tests pass
  - cargo fmt --all clean
Copilot AI review requested due to automatic review settings April 23, 2026 02:23

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request implements support for the description frontmatter field in GitHub Copilot instructions, aligning with the v0.43.0 update. The changes include modifying the CopilotScopedSchema struct, updating the list of known keys, and refreshing verification dates in the rules database and documentation. Review feedback highlights a potential deserialization issue due to a naming mismatch between camelCase frontmatter keys and snake_case struct fields, recommending the use of Serde's rename_all attribute. Additionally, suggestions were made to strengthen regression tests by asserting successful parsing of all fields and checking for the absence of parse errors.


/// Known valid keys for scoped instruction frontmatter
const KNOWN_KEYS: &[&str] = &["applyTo", "excludeAgent"];
const KNOWN_KEYS: &[&str] = &["applyTo", "description", "excludeAgent"];

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.

high

The KNOWN_KEYS list acts as a duplicate source of truth for the field names in CopilotScopedSchema, which increases maintenance overhead. Furthermore, there is a naming mismatch: the keys in KNOWN_KEYS use camelCase (applyTo, excludeAgent), while the struct fields use snake_case (apply_to, exclude_agent). Without a #[serde(rename_all = "camelCase")] attribute on the CopilotScopedSchema struct, these fields will not be correctly populated during deserialization. While description works because the names are identical, the other fields are likely failing to parse silently.

References
  1. Instead of merging and deduplicating data from multiple sources, refactor the code to have a single source of truth to avoid duplication in the first place.

Comment on lines +432 to +435
assert_eq!(
schema.description,
Some("TypeScript style rules".to_string())
);

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.

medium

It is recommended to also assert that apply_to is correctly parsed. This helps verify that the field mapping (camelCase to snake_case) is working as expected, which is particularly important given the discrepancy between KNOWN_KEYS and the struct definition.

Suggested change
assert_eq!(
schema.description,
Some("TypeScript style rules".to_string())
);
assert_eq!(schema.apply_to, Some("**/*.ts".to_string()));
assert_eq!(
schema.description,
Some("TypeScript style rules".to_string())
);

Comment on lines +452 to +456
assert!(
result.unknown_keys.is_empty(),
"description should not be reported as unknown key (Copilot v0.43.0+), got: {:?}",
result.unknown_keys
);

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.

medium

Adding a check for result.parse_error.is_none() ensures that the frontmatter was successfully deserialized into the schema. Without this, the test might pass even if the schema failed to populate correctly due to field name mismatches.

        assert!(result.parse_error.is_none(), "Should not have parse errors, got: {:?}", result.parse_error);
        assert!(
            result.unknown_keys.is_empty(),
            "description should not be reported as unknown key (Copilot v0.43.0+), got: {:?}",
            result.unknown_keys
        );

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

Updates agnix’s GitHub Copilot scoped-instructions frontmatter schema to align with microsoft/vscode-copilot-chat v0.43.0, specifically recognizing the newly user-visible description field and refreshing related rule metadata/docs.

Changes:

  • Add description to the known frontmatter keys and to CopilotScopedSchema, plus regression tests to ensure it parses and does not trigger COP-004.
  • Update CLI integration fixture to use a truly-unknown key so COP-004’s fix path remains exercised.
  • Refresh COP-* rule “verified_on / last reviewed” metadata and regenerate the corresponding generated website docs and changelog entry.

Reviewed changes

Copilot reviewed 6 out of 31 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/agnix-core/src/schemas/copilot.rs Recognizes and deserializes description in scoped .instructions.md frontmatter; adds unit tests.
crates/agnix-cli/tests/cli_integration.rs Updates COP-004 fixable-fixture to use an actually unknown key now that description is supported.
knowledge-base/rules.json Bumps verified_on dates for COP-* rules to reflect the new review.
crates/agnix-rules/rules.json Mirrors COP-* verified_on bump in the packaged rules JSON.
knowledge-base/RESEARCH-TRACKING.md Updates GitHub Copilot “Last Reviewed” date to 2026-04-22.
CHANGELOG.md Documents the Copilot v0.43.0 catch-up and the description frontmatter support.
website/docs/rules/generated/cop-001.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-002.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-003.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-004.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-005.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-006.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-007.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-008.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-009.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-010.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-011.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-012.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-013.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-014.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-015.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-017.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-018.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-019.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-020.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-022.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-023.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-024.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-025.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-026.md Regenerated rule doc with updated “Verified On” date.
website/docs/rules/generated/cop-027.md Regenerated rule doc with updated “Verified On” date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 26 to 30
| Tool | Config Format | Documentation URL | Monitoring | Frequency | Last Reviewed | Rule Prefix |
|------|---------------|-------------------|------------|-----------|---------------|-------------|
| GitHub Copilot | `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md` | https://docs.github.com/en/copilot/customizing-copilot | Automated (spec-drift.yml + tool-release-watch.yml via microsoft/vscode-copilot-chat) | Monthly | 2026-02-05 | COP |
| GitHub Copilot | `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md` | https://docs.github.com/en/copilot/customizing-copilot | Automated (spec-drift.yml + tool-release-watch.yml via microsoft/vscode-copilot-chat) | Monthly | 2026-04-22 | COP |
| Cline | `.clinerules`, `.cline/rules/*.md` | https://docs.cline.bot/features/cline-rules/overview | Automated (spec-drift.yml + tool-release-watch.yml) | Monthly | 2026-02-05 | -- |
| Cursor | `.cursor/rules/*.mdc`, `.cursorrules` | https://cursor.com/docs/context/rules | Automated (spec-drift.yml + tool-release-watch.yml via api2.cursor.sh stable update endpoint) | Monthly | 2026-02-26 | CUR |

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

RESEARCH-TRACKING.md has a Last Updated header at the top that still reads 2026-02-05, but this PR updates the GitHub Copilot row’s Last Reviewed date. Please bump the document’s Last Updated value as well so the metadata stays accurate (e.g., to 2026-04-22).

Copilot uses AI. Check for mistakes.
@avifenesh

Copy link
Copy Markdown
Collaborator Author

Per-comment reply table for round 1

# Reviewer File Status Resolution
1 Gemini HIGH copilot.rs:14 (KNOWN_KEYS duplicates struct) Won't fix (intentional pattern) The naming mismatch is intentional and correct: `KNOWN_KEYS` holds the actual JSON/YAML key strings that users write in their frontmatter (camelCase: `applyTo`, `description`, `excludeAgent`); the struct's snake_case field names are Rust-side only and serialized as camelCase via `#[serde(rename_all = "camelCase")]`. The `KNOWN_KEYS` array is what `find_unknown_keys()` line-scans against — it can't read serde-renamed field names from the struct without code generation or a build-time macro. This is also the established project-wide pattern: the same `KNOWN_KEYS const` + struct duo exists in `schemas/claude_rules.rs`, `schemas/output_style.rs`, `schemas/codex.rs` (`KNOWN_TOP_LEVEL_KEYS`), `schemas/opencode.rs` (`KNOWN_TUI_KEYS`), `schemas/kiro_*.rs`, etc. Refactoring the pattern is out of scope for a triage PR. `#[serde(deny_unknown_fields)]` would change error reporting (a single deserialization error instead of per-key diagnostics with line numbers), losing information CC-004 needs to point at the specific bad line.
2 Gemini MEDIUM copilot.rs:435 (test_parse_description should also assert apply_to) Fixed Added `assert_eq!(schema.apply_to, Some("**/*.ts".to_string()))` to verify the camelCase -> snake_case rename works in the same test.
3 Gemini MEDIUM copilot.rs:456 (test_description_not_unknown_key should assert no parse_error) Fixed Added `assert!(result.parse_error.is_none(), "frontmatter should parse cleanly, got error: {:?}", result.parse_error)` before the unknown-keys assertion.
4 Copilot RESEARCH-TRACKING.md:5 (header Last Updated stale at 2026-02-05) Fixed Bumped header to 2026-04-22. Good catch — this header had been stale for 5 PRs (#756, #758, #759, #760 and current). Going forward I'll bump it on every triage PR that touches RESEARCH-TRACKING.md.

Pushing now.

Reviewer feedback (PR #761 round 1):

- Gemini MEDIUM: test_parse_description now also asserts apply_to to
  verify the camelCase -> snake_case rename works (not just the new
  description field).
- Gemini MEDIUM: test_description_not_unknown_key now asserts
  parse_error.is_none() before checking unknown_keys, so the test
  doesn't silently pass when the schema fails to deserialize.
- Copilot: RESEARCH-TRACKING.md 'Last Updated' header was stale at
  2026-02-05 (had been stale across 5 prior PRs). Bumped to 2026-04-22.

Reply-with-reason on Gemini HIGH (KNOWN_KEYS duplicates struct fields):
this is the project-wide pattern (claude_rules, output_style, codex,
opencode, kiro_*). KNOWN_KEYS holds the actual JSON/YAML key strings
that line-scanning checks against - it can't read serde-renamed struct
fields without a macro. #[serde(deny_unknown_fields)] would lose the
per-key line-number information CC-004 needs. Refactor out of scope.
@avifenesh
avifenesh merged commit 960345b into main Apr 23, 2026
8 checks passed
@avifenesh
avifenesh deleted the chore/triage-copilot-0-43-0 branch April 23, 2026 02:36
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.

Tool release: GitHub Copilot v0.43.0 (was v0.42.2)

2 participants