* test(#3547): failing-first regression for collapsed global install shape * fix(#3547): exercise the real global config-home shape in the install harness * test(#3547): align ripple suites with the real global install shape * test(#3547): update stale collapsed-shape pins in provenance and migration suites * fix(#3547): bump emitted-baseline schema version for the real install shape --------- Co-authored-by: sim <sim@local>
This commit is contained in:
@@ -47,8 +47,14 @@ const BASELINE_ENV = 'GSD_EMITTED_BASELINE';
|
||||
/** Default on-disk cache location, relative to the repo root. */
|
||||
const DEFAULT_CACHE_PATH = '.gsd-cache/emitted-baseline.json';
|
||||
|
||||
/** Baseline artifact schema version — pinned so a format change fails loudly. */
|
||||
const BASELINE_VERSION = 1;
|
||||
/** Baseline artifact schema version — pinned so a format change fails loudly.
|
||||
* v2 (#3547): the harness now measures every global family in the REAL
|
||||
* config-home shape (<root>/<globalSuffix> instead of the collapsed
|
||||
* <root>), so manifests from a v1 baseline — built with the collapsed
|
||||
* harness — are not comparable (HOME-level paths present, prefix bytes
|
||||
* absent). Bumping refuses v1 caches and forces the same-schema fallback
|
||||
* build; the push-to-next job republishes at v2 when this merges. */
|
||||
const BASELINE_VERSION = 2;
|
||||
|
||||
/**
|
||||
* Validate a baseline artifact's shape and freshness.
|
||||
|
||||
@@ -530,13 +530,17 @@ const PROVENANCE_RULES = [
|
||||
pattern: /^(gsd\.md|hooks\/PreToolUse)$/,
|
||||
sources: () => [CLINE_BODY_SRC],
|
||||
},
|
||||
{
|
||||
id: 'agents-md-code-derived',
|
||||
kind: 'code-derived',
|
||||
roots: ['.agents'],
|
||||
pattern: /^AGENTS\.md$/,
|
||||
sources: () => [CLINE_BODY_SRC],
|
||||
},
|
||||
// #3547 removed `agents-md-code-derived` (roots: ['.agents'],
|
||||
// ^AGENTS\.md$) and `synthesized-gsd-defaults` (^\.gsd/defaults\.json$):
|
||||
// both paths only appeared in a manifest while the harness collapsed
|
||||
// configDir onto the sandbox HOME, walking HOME-level siblings
|
||||
// (cline's ~/.agents/AGENTS.md, every non-Claude runtime's
|
||||
// ~/.gsd/defaults.json). With the harness installing into each runtime's
|
||||
// real global subdirectory those files sit outside the walked configDir,
|
||||
// the rules matched nothing, and the totality guard's dead-rule arm fired
|
||||
// — exactly as designed. The files are still written, still covered by the
|
||||
// existence/config suites (kimi-upgrades, codex-config, install suites);
|
||||
// they are simply no longer manifest members to attribute.
|
||||
{
|
||||
id: 'hermes-category-description',
|
||||
kind: 'code-derived',
|
||||
@@ -568,13 +572,6 @@ const PROVENANCE_RULES = [
|
||||
pattern: /^(\.gsd-profile|package\.json|\.kimi(-code)?\/package\.json|gsd-core\/VERSION|gsd-core\/\.gsd-runtime)$/,
|
||||
sources: () => [],
|
||||
},
|
||||
{
|
||||
id: 'synthesized-gsd-defaults',
|
||||
kind: 'synthesized',
|
||||
roots: null,
|
||||
pattern: /^\.gsd\/defaults\.json$/,
|
||||
sources: () => [],
|
||||
},
|
||||
{
|
||||
id: 'synthesized-host-config',
|
||||
kind: 'synthesized',
|
||||
|
||||
@@ -191,18 +191,22 @@ const HOOK_CONFIG_FILES = new Set(['settings.json', 'settings.local.json', 'hook
|
||||
// platform-stable `[features] hooks = true` flag — the real hook commands
|
||||
// live in Codex's separate hooks.json, already excluded above). Blanket-
|
||||
// excluding the 'config.toml' basename would silently blind Codex's fixture
|
||||
// to any future regression there. Kimi's config.toml instead lives OUTSIDE
|
||||
// its GSD configDir at runtime (resolveKimiHooksTomlDir resolves ~/.kimi, a
|
||||
// sibling of the configDir ~/.config/agents) — it only appears inside this
|
||||
// harness's walked tree at all because runMinimalInstall sets HOME to the
|
||||
// same temp root used as --config-dir, collapsing the two into one directory
|
||||
// for the isolated test run. So it is excluded by its exact relative path
|
||||
// under that collapsed root, not by basename.
|
||||
// Both Kimi products' native config.toml embeds a platform-varying node-runner
|
||||
// command, so neither belongs in the golden-tracked emitted manifest. kimi-code
|
||||
// resolves its own root since #2755 — listing only `.kimi/config.toml` here made
|
||||
// kimi-code's config.toml newly manifest-visible and unattributable.
|
||||
const HOOK_CONFIG_RELATIVE_PATHS = new Set(['.kimi/config.toml', '.kimi-code/config.toml']);
|
||||
// to any future regression there — and it would blind kimi-code's too: since
|
||||
// #3547 the harness installs into each runtime's REAL global subdirectory, so
|
||||
// kimi-code's hooks config.toml sits at its configDir root (rel `config.toml`)
|
||||
// and is legitimately manifest-visible. Tracking it is safe now: the
|
||||
// install-tree fixture carries paths only, and the ADR-2719 differential
|
||||
// compares base-vs-current on the same machine, so the platform-varying
|
||||
// node-runner command embedded in the TOML never crosses platforms inside a
|
||||
// gate (that was a golden-content-era hazard, and the goldens are gone).
|
||||
// Kimi CLI's config.toml (KIMI_SHARE_DIR root ~/.kimi) lives OUTSIDE its GSD
|
||||
// configDir (~/.config/agents) and never enters the walk. The pre-#3547
|
||||
// relative-path exclusions ('.kimi/config.toml', '.kimi-code/config.toml')
|
||||
// existed only for the collapsed shape — where the walked root was the HOME
|
||||
// itself and those HOME-level siblings were inside it; with no walker rooting
|
||||
// at HOME anymore they matched nothing and were removed (#3547). kimi-code
|
||||
// resolves its own root since #2755.
|
||||
const HOOK_CONFIG_RELATIVE_PATHS = new Set();
|
||||
|
||||
// Path prefixes excluded from the parity manifest. `gsd-core/bin/lib/` holds the
|
||||
// tsc-built runtime artifacts (compiled from src/*.cts) that the install COPIES
|
||||
@@ -570,8 +574,31 @@ function runMinimalInstall({ runtime, scope, extraArgs = [], installScript = INS
|
||||
let cwd = process.cwd();
|
||||
const args = [installScript, `--${runtime}`];
|
||||
if (scope === 'global') {
|
||||
args.push('--global', '--config-dir', root);
|
||||
configDir = root;
|
||||
// #3547 — install into the runtime's REAL global config home: the strict
|
||||
// subdirectory of the sandbox HOME a genuine global install resolves
|
||||
// (RUNTIME_META.globalSuffix mirrors the registry's getGlobalConfigDir
|
||||
// for every runtime). The previous `--config-dir <root>` collapsed
|
||||
// configDir onto HOME, so computePathPrefix emitted bare `$HOME/`
|
||||
// prefixes and the emitted bytes referenced `$HOME/gsd-core/…` — a path
|
||||
// no real install produces — leaving every emitted-artifact gate
|
||||
// (ADR-2719 differential, install-tree fixtures, the 19-family baseline)
|
||||
// blind to drift confined to the real global shape (#3544 evidence: 54
|
||||
// includes rewritten on live installs, zero manifest/fixture diffs). The
|
||||
// explicit flag stays: hermeticity-by-override is immune to ambient
|
||||
// redirect envs (CI runners export XDG_CONFIG_HOME, which redefines the
|
||||
// opencode/kilo XDG descriptors' resolution when no explicit dir wins).
|
||||
const globalMeta = RUNTIME_META[runtime];
|
||||
if (!globalMeta || !globalMeta.globalSuffix) {
|
||||
// #3023 lesson: a silent `path.join(root, undefined)` here throws a
|
||||
// bare TypeError naming neither the runtime nor the map at fault; a
|
||||
// runtime without a known global home must fail loudly before any
|
||||
// install spawns.
|
||||
throw new Error(
|
||||
`runMinimalInstall: no RUNTIME_META.globalSuffix for runtime "${runtime}" — refusing to guess a global config dir (#3547)`,
|
||||
);
|
||||
}
|
||||
configDir = path.join(root, globalMeta.globalSuffix);
|
||||
args.push('--global', '--config-dir', configDir);
|
||||
} else {
|
||||
args.push('--local');
|
||||
cwd = root;
|
||||
|
||||
Reference in New Issue
Block a user