@deftai/directive-runtime 0.129.5 → 0.129.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Taskfile.yml +316 -0
- package/UPGRADING.md +1 -0
- package/commands.md +5 -3
- package/contracts/design-critique.md +1 -1
- package/contracts/path-write-fence.md +6 -0
- package/dist/applying-host-release.d.ts +16 -0
- package/dist/applying-host-release.js +98 -0
- package/dist/authz.d.ts +1 -1
- package/dist/authz.js +1 -1
- package/dist/check.d.ts +1 -0
- package/dist/check.js +27 -4
- package/dist/design-critique-ensure-arc-dest.d.ts +16 -0
- package/dist/design-critique-ensure-arc-dest.js +168 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +8 -0
- package/dist/hook-dispatch.js +3 -2
- package/dist/human-presence-mint.d.ts +6 -1
- package/dist/human-presence-mint.js +20 -6
- package/dist/session-start.d.ts +8 -2
- package/dist/session-start.js +70 -15
- package/dist/setup-wiring.d.ts +36 -0
- package/dist/setup-wiring.js +169 -14
- package/dist/vbrief-preflight.d.ts +4 -0
- package/dist/vbrief-preflight.js +34 -0
- package/dist/verify-scope-provenance.d.ts +13 -1
- package/dist/verify-scope-provenance.js +44 -1
- package/dist/verify-source-cli/verify-deposit-closure.js +5 -5
- package/dist/windows-bin-ps1.d.ts +2 -2
- package/dist/windows-bin-ps1.js +5 -11
- package/docs/deft-directive-disable.md +3 -3
- package/docs/getting-started.md +2 -0
- package/docs/scope-provenance.md +15 -1
- package/package.json +2 -3
- package/packs/lessons/lessons-pack-0.1.json +15 -0
- package/packs/skills/skills-pack-0.1.json +3 -3
- package/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/skills/deft-directive-release/SKILL.md +31 -1
- package/skills/deft-directive-review-cycle/SKILL.md +15 -6
- package/skills/deft-directive-swarm/references/host-grok-build.md +3 -2
- package/vendor/directive-content/Taskfile.yml +316 -0
- package/vendor/directive-content/UPGRADING.md +1 -0
- package/vendor/directive-content/commands.md +5 -3
- package/vendor/directive-content/contracts/design-critique.md +1 -1
- package/vendor/directive-content/contracts/path-write-fence.md +6 -0
- package/vendor/directive-content/docs/deft-directive-disable.md +3 -3
- package/vendor/directive-content/docs/getting-started.md +2 -0
- package/vendor/directive-content/docs/scope-provenance.md +15 -1
- package/vendor/directive-content/packs/lessons/lessons-pack-0.1.json +15 -0
- package/vendor/directive-content/packs/skills/skills-pack-0.1.json +3 -3
- package/vendor/directive-content/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/vendor/directive-content/skills/deft-directive-release/SKILL.md +31 -1
- package/vendor/directive-content/skills/deft-directive-review-cycle/SKILL.md +15 -6
- package/vendor/directive-content/skills/deft-directive-swarm/references/host-grok-build.md +3 -2
- package/vendor/directive-core/dist/.tsbuildinfo +1 -1
- package/vendor/directive-core/dist/authz/classify.d.ts +12 -0
- package/vendor/directive-core/dist/authz/classify.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/classify.js +40 -12
- package/vendor/directive-core/dist/authz/classify.js.map +1 -1
- package/vendor/directive-core/dist/authz/templates.d.ts +2 -2
- package/vendor/directive-core/dist/authz/templates.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/templates.js +1 -0
- package/vendor/directive-core/dist/authz/templates.js.map +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/types.js +2 -0
- package/vendor/directive-core/dist/authz/types.js.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.js +30 -3
- package/vendor/directive-core/dist/authz/verb-classification.js.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.d.ts.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.js +50 -4
- package/vendor/directive-core/dist/cache/fetch.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts +22 -5
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.js +61 -0
- package/vendor/directive-core/dist/design-critique/arc-dest.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts +7 -2
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js +6 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js.map +1 -1
- package/vendor/directive-core/dist/fs/contained-write.d.ts +8 -2
- package/vendor/directive-core/dist/fs/contained-write.d.ts.map +1 -1
- package/vendor/directive-core/dist/fs/contained-write.js +22 -6
- package/vendor/directive-core/dist/fs/contained-write.js.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.d.ts +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.js +290 -16
- package/vendor/directive-core/dist/hooks/dispatcher.js.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts +5 -0
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js +18 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/agent-hooks.d.ts +26 -1
- package/vendor/directive-core/dist/init-deposit/agent-hooks.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/agent-hooks.js +52 -3
- package/vendor/directive-core/dist/init-deposit/agent-hooks.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts +48 -0
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js +170 -9
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts +8 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.js +38 -4
- package/vendor/directive-core/dist/init-deposit/scaffold.js.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts +2 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.js +4 -3
- package/vendor/directive-core/dist/install-health/cheap.js.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.d.ts +18 -2
- package/vendor/directive-core/dist/install-health/constants.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.js +18 -2
- package/vendor/directive-core/dist/install-health/constants.js.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts +42 -5
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.js +71 -41
- package/vendor/directive-core/dist/policy/deft-directive-disable.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts +6 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js +24 -12
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts +68 -14
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js +278 -47
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.d.ts +10 -5
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.js +41 -18
- package/vendor/directive-core/dist/pr-merge-readiness/slizard-gate.js.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts +3 -2
- package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.js +19 -18
- package/vendor/directive-core/dist/preflight-gh/pre-push.js.map +1 -1
- package/vendor/directive-core/dist/release/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/gh.js +2 -1
- package/vendor/directive-core/dist/release/gh.js.map +1 -1
- package/vendor/directive-core/dist/release/version.d.ts +4 -2
- package/vendor/directive-core/dist/release/version.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/version.js +4 -2
- package/vendor/directive-core/dist/release/version.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.js +4 -2
- package/vendor/directive-core/dist/release-publish/gh-api.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.js +15 -4
- package/vendor/directive-core/dist/release-publish/main.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts +11 -0
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.js +143 -2
- package/vendor/directive-core/dist/release-publish/pipeline.js.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.js +2 -1
- package/vendor/directive-core/dist/release-rollback/gh.js.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts +202 -19
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.js +948 -107
- package/vendor/directive-core/dist/scope/delivery-evidence.js.map +1 -1
- package/vendor/directive-core/dist/scope/transition.d.ts +4 -1
- package/vendor/directive-core/dist/scope/transition.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/transition.js +2 -2
- package/vendor/directive-core/dist/scope/transition.js.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/base-fence.d.ts +11 -2
- package/vendor/directive-core/dist/scope-provenance/base-fence.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/base-fence.js +16 -1
- package/vendor/directive-core/dist/scope-provenance/base-fence.js.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/evaluate.d.ts +12 -0
- package/vendor/directive-core/dist/scope-provenance/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/evaluate.js +41 -5
- package/vendor/directive-core/dist/scope-provenance/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/scope-provenance/forge-approval.d.ts +106 -0
- package/vendor/directive-core/dist/scope-provenance/forge-approval.d.ts.map +1 -0
- package/vendor/directive-core/dist/scope-provenance/forge-approval.js +382 -0
- package/vendor/directive-core/dist/scope-provenance/forge-approval.js.map +1 -0
- package/vendor/directive-core/dist/session/git.d.ts +21 -2
- package/vendor/directive-core/dist/session/git.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/git.js +21 -4
- package/vendor/directive-core/dist/session/git.js.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.d.ts +93 -6
- package/vendor/directive-core/dist/session/occupancy.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.js +215 -52
- package/vendor/directive-core/dist/session/occupancy.js.map +1 -1
- package/vendor/directive-core/dist/session/orientation-compression.d.ts +18 -2
- package/vendor/directive-core/dist/session/orientation-compression.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/orientation-compression.js +38 -5
- package/vendor/directive-core/dist/session/orientation-compression.js.map +1 -1
- package/vendor/directive-core/dist/session/session-start.d.ts +47 -2
- package/vendor/directive-core/dist/session/session-start.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/session-start.js +154 -3
- package/vendor/directive-core/dist/session/session-start.js.map +1 -1
- package/vendor/directive-core/dist/swarm/approach1-babysitter.d.ts +18 -4
- package/vendor/directive-core/dist/swarm/approach1-babysitter.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/approach1-babysitter.js +28 -4
- package/vendor/directive-core/dist/swarm/approach1-babysitter.js.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.js +36 -41
- package/vendor/directive-core/dist/swarm/dest-place.js.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-cohort.d.ts +29 -0
- package/vendor/directive-core/dist/swarm/finalize-cohort.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-cohort.js +122 -11
- package/vendor/directive-core/dist/swarm/finalize-cohort.js.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts +14 -0
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.js +214 -48
- package/vendor/directive-core/dist/swarm/finalize-owed.js.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.js +15 -4
- package/vendor/directive-core/dist/swarm/launch.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts +49 -2
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js +207 -12
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts +6 -0
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.js +79 -2
- package/vendor/directive-core/dist/swarm/worktrees-cli.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts +12 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.js +34 -26
- package/vendor/directive-core/dist/swarm/worktrees.js.map +1 -1
- package/vendor/directive-core/dist/triage/evaluate/worktrees.d.ts.map +1 -1
- package/vendor/directive-core/dist/triage/evaluate/worktrees.js +219 -60
- package/vendor/directive-core/dist/triage/evaluate/worktrees.js.map +1 -1
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
import { classifyMcpTool, classifyShellCommand, listShellOps } from "../policy/runtime-authority.js";
|
|
15
15
|
import type { AuthzOperation } from "./types.js";
|
|
16
16
|
export type AuthzClassifiedOp = AuthzOperation | "test" | "evidence" | "unknown" | "protected_store";
|
|
17
|
+
/** Kill-switch / permanent opt-out basenames agents must not plant (#3186 / #3039 / #6136). */
|
|
18
|
+
export declare const KILL_SWITCH_BASENAMES: readonly [".deft-directive-disable", ".no-deft-directive"];
|
|
19
|
+
/** True when a path basename is a kill-switch / permanent opt-out plant target (#6136). */
|
|
20
|
+
export declare function isKillSwitchPlantPath(pathish: string): boolean;
|
|
17
21
|
/** True when a recovered dest literal is a payload-relative protected path. */
|
|
18
22
|
export declare function destLiteralIsRelativeProtected(dest: string): boolean;
|
|
19
23
|
/**
|
|
@@ -23,6 +27,12 @@ export declare function destLiteralIsRelativeProtected(dest: string): boolean;
|
|
|
23
27
|
* symlink dest can still be realpath-resolved.
|
|
24
28
|
*/
|
|
25
29
|
export declare function harvestDestsOfWriteForRealpath(command: string): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Shell write targeting `.deft-directive-disable` / `.no-deft-directive` (#3186 / #3039 / #3213 / #6136).
|
|
32
|
+
* Always-on grant-gated plant deny (not UAT-only). Includes symlink plant bins
|
|
33
|
+
* (`ln`/`link`/`mklink`) and quote-split-resistant basename checks.
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasKillSwitchShellWrite(command: string, tokens?: readonly string[]): boolean;
|
|
26
36
|
/** Best-effort shell classification for UAT-sensitive ops beyond push/merge. */
|
|
27
37
|
export declare function classifyShellAuthzOps(command: string): AuthzClassifiedOp[];
|
|
28
38
|
/** Map a PreToolUse tool name + optional shell command to authz ops. */
|
|
@@ -33,6 +43,8 @@ export declare function classifyHookAuthzOps(input: {
|
|
|
33
43
|
readonly mcpArgsText?: string | null;
|
|
34
44
|
/** Payload root for #4188 harvest realpath. Blank/omitted skips harvest. */
|
|
35
45
|
readonly projectRoot?: string | null;
|
|
46
|
+
/** Direct Write/Edit target path for always-on kill-switch plant classify (#6136). */
|
|
47
|
+
readonly writePath?: string | null;
|
|
36
48
|
}): AuthzClassifiedOp[];
|
|
37
49
|
/**
|
|
38
50
|
* Public pin for #4709: Shell write targeting `.deft/authz/` or `.deft/approved-scope/`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/authz/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,YAAY,EAEb,MAAM,gCAAgC,CAAC;AAKxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,MAAM,GACN,UAAU,GACV,SAAS,GACT,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/authz/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,YAAY,EAEb,MAAM,gCAAgC,CAAC;AAKxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,MAAM,GACN,UAAU,GACV,SAAS,GACT,iBAAiB,CAAC;AA6KtB,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,4DAA6D,CAAC;AAEhG,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQ9D;AA61FD,+EAA+E;AAC/E,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIpE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BxE;AAuaD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAK5F;AAo/BD,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAiH1E;AA+OD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,sFAAsF;IACtF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC,GAAG,iBAAiB,EAAE,CA2DtB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI9D;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAYvE;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAC1B,MAAM,GAAG,IAAI,CAkEf;AAED,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -185,8 +185,20 @@ const POLICY_AUTHORITY_MUTATORS = new Set([
|
|
|
185
185
|
"disable-directive",
|
|
186
186
|
"enable-directive",
|
|
187
187
|
]);
|
|
188
|
-
/** Kill-switch / permanent opt-out basenames agents must not plant
|
|
189
|
-
const KILL_SWITCH_BASENAMES = [".deft-directive-disable", ".no-deft-directive"];
|
|
188
|
+
/** Kill-switch / permanent opt-out basenames agents must not plant (#3186 / #3039 / #6136). */
|
|
189
|
+
export const KILL_SWITCH_BASENAMES = [".deft-directive-disable", ".no-deft-directive"];
|
|
190
|
+
/** True when a path basename is a kill-switch / permanent opt-out plant target (#6136). */
|
|
191
|
+
export function isKillSwitchPlantPath(pathish) {
|
|
192
|
+
// Lowercase so Windows / case-insensitive plants (`.DEFT-DIRECTIVE-DISABLE`) match.
|
|
193
|
+
const p = canonicalizePathish(pathish).toLowerCase();
|
|
194
|
+
if (p.length === 0)
|
|
195
|
+
return false;
|
|
196
|
+
for (const name of KILL_SWITCH_BASENAMES) {
|
|
197
|
+
if (p === name || p.endsWith(`/${name}`))
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
190
202
|
/**
|
|
191
203
|
* Dest-form writers #3529 harvest missed (#3545). Shared across downloader,
|
|
192
204
|
* archive-alt, positional, and indirect-write membership so a named-peer
|
|
@@ -3522,7 +3534,7 @@ function sqlite3MetaDest(raw, next) {
|
|
|
3522
3534
|
return null;
|
|
3523
3535
|
}
|
|
3524
3536
|
function pathishMentionsKillSwitch(pathish) {
|
|
3525
|
-
const p = canonicalizePathish(pathish);
|
|
3537
|
+
const p = canonicalizePathish(pathish).toLowerCase();
|
|
3526
3538
|
for (const name of KILL_SWITCH_BASENAMES) {
|
|
3527
3539
|
if (p === name || p.endsWith(`/${name}`) || p.includes(name)) {
|
|
3528
3540
|
return true;
|
|
@@ -3531,11 +3543,18 @@ function pathishMentionsKillSwitch(pathish) {
|
|
|
3531
3543
|
return false;
|
|
3532
3544
|
}
|
|
3533
3545
|
/**
|
|
3534
|
-
* Shell write targeting `.deft-directive-disable` / `.no-deft-directive` (#3186 / #3039 / #3213).
|
|
3535
|
-
*
|
|
3536
|
-
*
|
|
3546
|
+
* Shell write targeting `.deft-directive-disable` / `.no-deft-directive` (#3186 / #3039 / #3213 / #6136).
|
|
3547
|
+
* Always-on grant-gated plant deny (not UAT-only). Includes symlink plant bins
|
|
3548
|
+
* (`ln`/`link`/`mklink`) and quote-split-resistant basename checks.
|
|
3537
3549
|
*/
|
|
3538
|
-
function hasKillSwitchShellWrite(command, tokens) {
|
|
3550
|
+
export function hasKillSwitchShellWrite(command, tokens) {
|
|
3551
|
+
const cmd = command.trim();
|
|
3552
|
+
if (cmd.length === 0)
|
|
3553
|
+
return false;
|
|
3554
|
+
const resolvedTokens = tokens ?? shellTokens(cmd);
|
|
3555
|
+
return hasKillSwitchShellWriteInner(cmd, resolvedTokens);
|
|
3556
|
+
}
|
|
3557
|
+
function hasKillSwitchShellWriteInner(command, tokens) {
|
|
3539
3558
|
const lower = command.toLowerCase().replace(/\\/g, "/");
|
|
3540
3559
|
// Quote-stripped form so `'.deft'-directive-disable`-class splits still match (#3213).
|
|
3541
3560
|
const stripped = lower.replace(/['"]/g, "");
|
|
@@ -3575,6 +3594,8 @@ function hasKillSwitchShellWrite(command, tokens) {
|
|
|
3575
3594
|
}
|
|
3576
3595
|
// Write/destructive + symlink plant + archive/alt-write bins with a kill-switch path
|
|
3577
3596
|
// argument (#3213 ln/link/mklink; #3245 tar/axel/rclone/socat residual).
|
|
3597
|
+
// echo/printf/type are stdout-only without a redirect; redirect dests are handled
|
|
3598
|
+
// above so bare `echo .deft-directive-disable` stays non-plant (#6136 Greptile P2).
|
|
3578
3599
|
const killWriteBins = new Set([
|
|
3579
3600
|
...INDIRECT_WRITE_BINS,
|
|
3580
3601
|
...SYMLINK_PLANT_BINS,
|
|
@@ -3582,9 +3603,6 @@ function hasKillSwitchShellWrite(command, tokens) {
|
|
|
3582
3603
|
"touch",
|
|
3583
3604
|
"new-item",
|
|
3584
3605
|
"ni",
|
|
3585
|
-
"echo",
|
|
3586
|
-
"printf",
|
|
3587
|
-
"type",
|
|
3588
3606
|
]);
|
|
3589
3607
|
for (let ti = 0; ti < tokens.length; ti++) {
|
|
3590
3608
|
const binTok = normalizeToken(tokens[ti]);
|
|
@@ -4582,7 +4600,8 @@ export function classifyShellAuthzOps(command) {
|
|
|
4582
4600
|
found.add("settings");
|
|
4583
4601
|
if (commandHasAuthzDirShellWrite(cmd, tokens))
|
|
4584
4602
|
found.add("settings");
|
|
4585
|
-
// #3186: kill-switch plant + policy authority mutators → settings
|
|
4603
|
+
// #3186 / #6136: kill-switch plant + policy authority mutators → settings
|
|
4604
|
+
// (always-on grant-gated via dispatcher; not UAT-only).
|
|
4586
4605
|
if (hasKillSwitchShellWrite(cmd, tokens))
|
|
4587
4606
|
found.add("settings");
|
|
4588
4607
|
if (hasPolicyAuthorityMutator(tokens))
|
|
@@ -4887,8 +4906,17 @@ function hasWriteShapedProtectedSettingsDest(command, tokens) {
|
|
|
4887
4906
|
/** Map a PreToolUse tool name + optional shell command to authz ops. */
|
|
4888
4907
|
export function classifyHookAuthzOps(input) {
|
|
4889
4908
|
const { toolName, shellCommand, isDirectWrite } = input;
|
|
4890
|
-
if (isDirectWrite)
|
|
4909
|
+
if (isDirectWrite) {
|
|
4910
|
+
// Prefer-A Bound #6136: kill-switch Write/Edit is `settings` (always-on grant
|
|
4911
|
+
// gate). Keep off bare `edit` — isProtectedStoreEditDest treats the flag
|
|
4912
|
+
// basenames themselves as protected and would deny before the grant check.
|
|
4913
|
+
// Symlink plants into `.deft/authz/` are denied in dispatcher via realpath
|
|
4914
|
+
// (not this op class alone).
|
|
4915
|
+
const writePath = (input.writePath ?? "").trim();
|
|
4916
|
+
if (writePath.length > 0 && isKillSwitchPlantPath(writePath))
|
|
4917
|
+
return ["settings"];
|
|
4891
4918
|
return ["edit"];
|
|
4919
|
+
}
|
|
4892
4920
|
const lower = toolName.toLowerCase();
|
|
4893
4921
|
// Shared catalog (#4041 / #3987). A second name list missed Grok monitor.
|
|
4894
4922
|
if (isShellTool(toolName)) {
|