agentHostReviewService.ts ×2

Frontier kind: Code frontier

unlabeled · c_993a44a73686

654 tests · 39824 LOC · 233 files · introduces 0 tests · 87 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges87 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3398 ranges39824 lines · 233 files · Browse complete extent
All tests (intent)
654 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 87 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/common/agentHostReviewService.ts 87 introduced LOC · 2 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- agentHostReviewService.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { URI } from '../../../base/common/uri.js';
7 > import type { URI as ProtocolURI } from './state/sessionState.js';
8 > import { createDecorator } from '../../instantiation/common/instantiation.js';
9 >
10 > export const IAgentHostReviewService = createDecorator<IAgentHostReviewService>('agentHostReviewService');
11 >
12 > /**
13 > * Returns the canonical name for a session's synthetic **reviewed** ref.
14 > * Lives under the same `refs/agents/<sid>/…` namespace as checkpoint refs so
15 > * the two coexist safely and never surface to the user as branches/tags.
16 > */
17 > export function buildReviewedRefName(sanitizedSessionId: string): string {
18 return `refs/agents/${sanitizedSessionId}/reviewed`;
19 }
21 > /**
22 > * Tracks which files in a session's **Branch Changes** the user has reviewed,
23 > * as a session-private synthetic git ref (`refs/agents/<sid>/reviewed`) whose
24 > * tree snapshots the reviewed content. A file is reviewed when its content in
25 > * the reviewed tree matches the current working tree; re-editing a reviewed
26 > * file therefore auto-unreviews it.
27 > *
28 > * All operations are keyed on the Branch Changes baseline (the merge-base of
29 > * `HEAD` and the session's base branch). The `baseBranch` argument is the
30 > * already-resolved base-branch **name** (see `resolveDiffBaseBranchName`),
31 > * shared with the changeset service so both agree on the baseline.
32 > *
33 > * Operations are no-ops when the working directory is not inside a git
34 > * repository; a future milestone will add a non-git fallback (see the
35 > * DB-backed reviewed-file store on `ISessionDatabase`).
36 > */
37 > export interface IAgentHostReviewService {
38 > readonly _serviceBrand: undefined;
39 >
40 > /**
41 > * Persists the review state for files in a local Branch Changes changeset.
42 > */
43 > setReviewState(channel: ProtocolURI, resources: readonly ProtocolURI[], reviewed: boolean): Promise<void>;
44 >
45 > /**
46 > * Marks a single file reviewed at its current working-tree content by
47 > * overlaying that content into the reviewed tree and advancing the
48 > * reviewed ref. No-op when the file is already reviewed at that content.
49 > */
50 > markFileReviewed(session: ProtocolURI, workingDirectory: URI, baseBranch: string | undefined, resource: URI): Promise<void>;
51 >
52 > /**
53 > * Marks a single file as unreviewed by resetting its entry in the
54 > * reviewed tree back to the baseline content and advancing the reviewed
55 > * ref. No-op when the file is not currently reviewed.
56 > */
57 > markFileUnreviewed(session: ProtocolURI, workingDirectory: URI, baseBranch: string | undefined, resource: URI): Promise<void>;
58 >
59 > /**
60 > * Returns the set of reviewed repo-relative paths within the current Branch
61 > * Changes: the changed files whose reviewed-tree content matches the
62 > * working tree. Empty when nothing is reviewed or the directory is not a
63 > * git work tree.
64 > */
65 > getReviewedPaths(session: ProtocolURI, workingDirectory: URI, baseBranch: string | undefined): Promise<ReadonlySet<string>>;
66 >
67 > /**
68 > * Copies the reviewed ref from `sourceSessionUri` to `targetSessionUri` so a
69 > * forked session starts with the parent's review progress. Points the
70 > * target's reviewed ref at the same commit as the source's (git objects are
71 > * shared within the repository). No-op when the source has no reviewed ref or
72 > * the directory is not a git work tree.
73 > */
74 > copyReviewedRef(sourceSession: ProtocolURI, targetSession: ProtocolURI, workingDirectory: URI): Promise<void>;
75 > }
76 >
77 > /**
78 > * A no-op {@link IAgentHostReviewService} used as the default for the optional
79 > * `_reviewService` parameter on `AgentService` so existing test callsites keep
80 > * compiling without forced fixture updates.
81 > */
82 > export const NULL_REVIEW_SERVICE: IAgentHostReviewService = {
83 > _serviceBrand: undefined,
84 > setReviewState: async () => { },
85 > markFileReviewed: async () => { },
86 > markFileUnreviewed: async () => { },
87 > getReviewedPaths: async () => new Set(),
88 > copyReviewedRef: async () => { },
89 > };