Add policy source tracking with metadata #283647
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Policies configured on a user's machine now track their origin (account, device, or file) and associated metadata for UX purposes.
Changes
Core Infrastructure
PolicySourceenum (Account/Device/File) andPolicyMetadatatype with source, accountSessionId, orgName, and details fieldsIPolicyServicewithgetPolicyMetadata(name: PolicyName)methodAbstractPolicyServiceto store and expose metadata alongside policy valuesPolicy Service Implementations
Developer Diagnostics
Example Usage
Testing
Original prompt
Start implementation
The user has attached the following file paths as relevant context:
- .github/instructions/learnings.instructions.md
- .github/copilot-instructions.md
- AGENTS.md
[Chronological Review: The conversation began with the user expressing a need to track how policies are set on a user's machine, specifically mentioning the defaultAccount and device policy. The user then requested to start the implementation of this tracking feature.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: All necessary context for continuing the implementation of the policy tracking feature is captured.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: User requested to track how policies are set on a user's machine, specifically mentioning, "When a policy is configured on a user's machine, we want to track WHO/HOW it was set." - Session Context: The conversation flowed from outlining the requirements for tracking policy settings to initiating the implementation phase. - User Intent Evolution: The user transitioned from discussing requirements to actively starting the implementation.- Technical Foundation:
- TypeScript: Used for coding the VS Code extension.
- VS Code Extension Architecture: Focus on policy management and user account handling.
- Codebase Status:
- File Name: /Users/jospicer/dev/vscode/src/vs/base/common/policy.ts
- Purpose: Defines the IPolicy interface for managing policy values.
- Current State: Relevant lines discussed include the method for retrieving values based on an account.
- Key Code Segments: The interface includes a method that takes an account parameter.
- Dependencies: This file is integral to the policy management system.
- File Name: /Users/jospicer/dev/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.ts
- Purpose: Active file for implementing the tracking feature.
- Current State: User is currently working on this file.
- Problem Resolution:
- Issues Encountered: None explicitly mentioned; focus is on implementation.
- Solutions Implemented: Not applicable yet as implementation has just started.
- Debugging Context: No ongoing troubleshooting mentioned.
- Lessons Learned: Insights will emerge as implementation progresses.
- Progress Tracking:
- Completed Tasks: Requirements for tracking policy settings have been outlined.
- Partially Complete Work: Implementation in mainThreadChatSessions.ts is pending.
- Validated Outcomes: None yet, as implementation has just begun.
- Active Work State:
- Current Focus: User is working on implementing the policy tracking feature in mainThreadChatSessions.ts.
- Recent Context: User requested to "Start implementation," indicating readiness to proceed.
- Working Code: No specific code snippets were modified recently as the focus was on starting the implementation.
- Immediate Context: User was preparing to implement the tracking feature when the summary was triggered.
- Recent Operations:
- Last Agent Commands: User requested to start the implementation.
- Tool Results Summary: No specific results were returned as the focus was on initiating the implementation.
- Pre-Summary State: The agent was actively working on the implementation in mainThreadChatSessions.ts.
- Operation Context: The recent commands were executed to...
Created from VS Code.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.