@@ -12,7 +12,7 @@ import { join } from "node:path";
1212import type { ToolCall } from "@intx/types/runtime" ;
1313import {
1414 createPermissionGate ,
15- isRequestCoveredByGrant ,
15+ isRequestCoveredByApproval ,
1616 preGrantGuardReason ,
1717} from "./gate.js" ;
1818import { createPathRestriction } from "./path-restriction.js" ;
@@ -27,7 +27,7 @@ const shellCall = (command: string): ToolCall => ({
2727} ) ;
2828
2929// Every pre-grant guard, keyed to a command that trips it.
30- // isRequestCoveredByGrant must refuse to cover each of these even when a
30+ // isRequestCoveredByApproval must refuse to cover each of these even when a
3131// grant would otherwise match verbatim. The secret/restricted-path cases
3232// queue and could be auto-approved by reconciliation once a broad grant
3333// lands; the shell-authz hard-denies are unreachable today (evaluate()
@@ -44,7 +44,7 @@ const GUARD_CASES: { name: string; command: string }[] = [
4444 { name : "restricted path target" , command : "cat /etc/passwd" } ,
4545] ;
4646
47- describe ( "preGrantGuardReason / isRequestCoveredByGrant guard parity" , ( ) => {
47+ describe ( "preGrantGuardReason / isRequestCoveredByApproval guard parity" , ( ) => {
4848 const cwd = mkdtempSync ( join ( tmpdir ( ) , "gate-guard-" ) ) ;
4949 const isRestricted = createPathRestriction (
5050 cwd ,
@@ -63,7 +63,7 @@ describe("preGrantGuardReason / isRequestCoveredByGrant guard parity", () => {
6363 expect ( preGrantGuardReason ( request , isRestricted ) ) . not . toBeUndefined ( ) ;
6464 } ) ;
6565
66- test ( `${ name } : isRequestCoveredByGrant refuses an otherwise-matching grant` , ( ) => {
66+ test ( `${ name } : isRequestCoveredByApproval refuses an otherwise-matching grant` , ( ) => {
6767 const request : PermissionRequest = {
6868 tool : "run_shell" ,
6969 action : "Run" ,
@@ -73,7 +73,7 @@ describe("preGrantGuardReason / isRequestCoveredByGrant guard parity", () => {
7373 } ;
7474 const grant : Approval = { tool : "run_shell" , pattern : command } ;
7575 expect (
76- isRequestCoveredByGrant ( request , grant , undefined , isRestricted , {
76+ isRequestCoveredByApproval ( request , grant , undefined , isRestricted , {
7777 resolvedCwd : cwd ,
7878 roots : [ ] ,
7979 } ) ,
@@ -104,7 +104,7 @@ describe("preGrantGuardReason / isRequestCoveredByGrant guard parity", () => {
104104 expect ( preGrantGuardReason ( request , isRestricted ) ) . toBeUndefined ( ) ;
105105 const grant : Approval = { tool : "run_shell" , pattern : "npm test" } ;
106106 expect (
107- isRequestCoveredByGrant ( request , grant , undefined , isRestricted , {
107+ isRequestCoveredByApproval ( request , grant , undefined , isRestricted , {
108108 resolvedCwd : cwd ,
109109 roots : [ ] ,
110110 } ) ,
@@ -265,7 +265,7 @@ describe("lone-& bypass at the gate (CL-7781)", () => {
265265 const workspace = { resolvedCwd : cwd , roots : [ ] as string [ ] } ;
266266 const grant : Approval = { tool : "run_shell" , pattern : "bun test *" } ;
267267 const covered = ( subject : string ) : boolean =>
268- isRequestCoveredByGrant (
268+ isRequestCoveredByApproval (
269269 { tool : "run_shell" , action : "Run" , subject, scopes : [ ] , cwd } ,
270270 grant ,
271271 undefined ,
@@ -319,7 +319,7 @@ describe("grant coverage rebinds relative paths to the request process cwd", ()
319319 } ;
320320 const grant : Approval = { tool : "run_shell" , pattern : "cat *" } ;
321321 expect (
322- isRequestCoveredByGrant ( request , grant , undefined , sessionRestricted , {
322+ isRequestCoveredByApproval ( request , grant , undefined , sessionRestricted , {
323323 resolvedCwd : sessionCwd ,
324324 roots : [ ] ,
325325 } ) ,
@@ -337,7 +337,7 @@ describe("grant coverage rebinds relative paths to the request process cwd", ()
337337 } ;
338338 const grant : Approval = { tool : "run_shell" , pattern : "cat *" } ;
339339 expect (
340- isRequestCoveredByGrant ( request , grant , undefined , sessionRestricted , {
340+ isRequestCoveredByApproval ( request , grant , undefined , sessionRestricted , {
341341 resolvedCwd : sessionCwd ,
342342 roots : [ ] ,
343343 } ) ,
0 commit comments