fix(copilot): catch up to v0.43.0 (description frontmatter field) - #761
Conversation
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
There was a problem hiding this comment.
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"]; |
There was a problem hiding this comment.
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
- 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.
| assert_eq!( | ||
| schema.description, | ||
| Some("TypeScript style rules".to_string()) | ||
| ); |
There was a problem hiding this comment.
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.
| 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()) | |
| ); |
| assert!( | ||
| result.unknown_keys.is_empty(), | ||
| "description should not be reported as unknown key (Copilot v0.43.0+), got: {:?}", | ||
| result.unknown_keys | ||
| ); |
There was a problem hiding this comment.
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
);There was a problem hiding this comment.
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
descriptionto the known frontmatter keys and toCopilotScopedSchema, 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.
| | 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 | |
There was a problem hiding this comment.
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).
|
Per-comment reply table for round 1
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.
Summary
Triage of
microsoft/vscode-copilot-chatv0.42.2 -> v0.43.0 (issue #748). Auto-extracted release notes were empty in the issue body, so usedgh release viewand 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 thedescriptionfrontmatter field on.instructions.mdfiles 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"toKNOWN_KEYSand a typeddescription: Option<String>field onCopilotScopedSchemaincrates/agnix-core/src/schemas/copilot.rs. Two regression tests:test_parse_description(parsesdescriptionfield correctly)test_description_not_unknown_key(does not trigger COP-004)Other v0.43.0 changes inspected — NO agnix change needed
Cross-checked
PromptHeaderAttributesinpromptFileParser.tsat v0.42.2 vs v0.43.0 — field list identical, but v0.43.0 makesdescriptionactively read and displayed (was previously a no-op accept).Test fixture update (in same commit)
test_fix_copilot_scoped_missing_applytoinagnix-cli/tests/cli_integration.rswas usingdescription: TypeScript rulesas the "unknown frontmatter key" that triggers COP-004's auto-fix-delete path. Now thatdescriptionis recognized, that fixture no longer triggers a fixable issue. Updated the fixture to usesomeUnknownKey: ...instead, preserving the test's intent (regression coverage for COP-004 fix availability).Doc bumps
knowledge-base/rules.jsonandcrates/agnix-rules/rules.json: bumpedverified_onto2026-04-22for all 25 COP-* rulesknowledge-base/RESEARCH-TRACKING.md: GitHub Copilot "Last Reviewed" 2026-02-05 -> 2026-04-22website/docs/rules/generated/*.mdToolVersions
ToolVersions::copilotisOption<String>(user-supplied version). Nothing to bump.Source verified
gh release view v0.43.0 -R microsoft/vscode-copilot-chatgh api repos/microsoft/vscode-copilot-chat/compare/v0.42.2...v0.43.0(~100 commits)promptFileParser.tsat both tags (PromptHeaderAttributes diff)Test plan
cargo build --workspacecleancargo 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 fixturecargo test -p agnix-rules --tests: 47 + 4 parity tests passcargo clippy --workspace --all-targets --all-features -- -D warningscleancargo fmt --allcleanCloses #748.