feat(deslop-shared-libs): route every Git read through bin/gstack-safe-git

The skill made the model retype a long safe-Git prefix on each call and a
dropped flag failed shared-libs-read-only. bin/gstack-safe-git applies the
fixed env + flag prefix, adds --no-ext-diff --no-textconv to log/show/diff,
allows diff only between two explicit object IDs and ls-files only in the
NUL-delimited overlay form, and refuses every other shape with one line
naming the allowed forms. The template now points at the installed helper
(host global runtime via {{SAFE_GIT}}) and drops the prose it enforces.

Fixtures resolve the helper to this checkout, the git shim records the safety
environment, and isGuardedGitRequest requires the complete prefix (env
included) for every repository read.
This commit is contained in:
garrytan committed 2026-09-30 17:59:23 +00:00
1 parent 157a5ff520
commit a367a1f265
13 files changed
+511 -77

No files matched your search

+4
View File
@@ -1,4 +1,8 @@
import type { ResolverFn } from './types';
import { getHostConfig } from '../../hosts/index';
/** The installed read-only Git helper. Always the trusted global runtime, never a repo-local root. */
export const generateSafeGitPath: ResolverFn = (ctx) => `~/${getHostConfig(ctx.host).globalRoot}/bin/gstack-safe-git`;
/** Shared criteria only: the caller owns scope, output, and permission to act. */
export const generateSharedLibsRubric: ResolverFn = () => `### Shared-code evaluation rubric