show-me-the-env 0.96.2 → 0.96.3

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenv",
3
- "version": "0.96.2",
3
+ "version": "0.96.3",
4
4
  "description": "Save and restore your whole agent and coding environment as one versioned .agenv repository.",
5
5
  "skills": [
6
6
  "./skills/init",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "show-me-the-env",
3
- "version": "0.96.2",
3
+ "version": "0.96.3",
4
4
  "description": "Save and restore your whole agent and coding environment as one versioned .agenv repository.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -13,12 +13,26 @@ export function verifySource(source) {
13
13
  // git names the top level by its long path, so an 8.3 alias in the source (a Windows TEMP like RUNNER~1) is resolved first.
14
14
  const relative = path.relative(root, realpathSync.native(source)).split(path.sep).join('/');
15
15
  const files = git('ls-tree', '-r', '--name-only', '-z', remote, '--', relative || '.').split('\0');
16
- const missing = files.filter(file => (file === 'SKILL.md' || file.endsWith('/SKILL.md')) && !existsSync(path.dirname(path.join(root, file))));
17
- if (!missing.length) return [];
16
+ const skills = files.filter(file => file === 'SKILL.md' || file.endsWith('/SKILL.md')).map(file => path.posix.dirname(file));
17
+ const missing = skills.filter(skill => !existsSync(path.join(root, skill)));
18
+ // A skill the default branch changed after this checkout left it stays old in every agent home, though its folder is there.
19
+ const changed = behind ? git('diff', '--name-only', '-z', `HEAD...${remote}`, '--', relative || '.').split('\0').filter(Boolean) : [];
20
+ const stale = skills.filter(skill => !missing.includes(skill) && changed.some(file => skill === '.' || file.startsWith(`${skill}/`)));
21
+ // A detached HEAD follows no branch, so nothing moves it to a newer default branch and its skills age without a word.
22
+ let branch = '';
23
+ try { branch = git('symbolic-ref', '--quiet', '--short', 'HEAD'); } catch { branch = ''; }
24
+ const failures = [];
25
+ if (!branch) failures.push(`${root}: HEAD is detached at ${git('rev-parse', '--short', 'HEAD')}, so nothing moves it past ${remote}; switch it to a branch that tracks ${remote}`);
26
+ if (!missing.length && !stale.length) return failures;
18
27
  const log = path.join(root, '.re0', 'catchup.log');
19
28
  const lines = existsSync(log) ? readFileSync(log, 'utf8').split(/\r?\n/) : [];
20
29
  const refusal = lines.filter(line => /옮기지 않|원격에 없는 내용/.test(line)).at(-1);
21
- return missing.map(file => `${path.basename(path.dirname(file))}: ${root} is ${behind} commits behind ${remote}${refusal ? `; ${refusal}` : ''}`);
30
+ const why = `${root} is ${behind} commits behind ${remote}${refusal ? `; ${refusal}` : ''}`;
31
+ return [
32
+ ...failures,
33
+ ...missing.map(skill => `${path.posix.basename(skill)}: ${why}`),
34
+ ...stale.map(skill => `${path.posix.basename(skill)}: changed on ${remote}; ${why}`),
35
+ ];
22
36
  }
23
37
 
24
38
  if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
@@ -26,6 +40,6 @@ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.me
26
40
  const failures = process.argv.slice(2).flatMap(verifySource);
27
41
  for (const failure of failures) console.error(failure);
28
42
  if (failures.length) process.exitCode = 1;
29
- else console.log('Skill sources contain every skill in their fetched default branch');
43
+ else console.log('Skill sources sit on a branch and contain every skill of their fetched default branch as it stands there');
30
44
  } catch (error) { console.error(`Cannot verify skill source: ${error.message}`); process.exitCode = 1; }
31
45
  }
@@ -320,7 +320,7 @@ if ($Mode -eq 'Live') {
320
320
  $skillSources = @($manifest.skillLinks.sources | ForEach-Object { Expand-Token $_ $manifest })
321
321
  if ($skillSources.Count -gt 0) {
322
322
  & node (Join-Path $PSScriptRoot 'verify-skill-sources.mjs') @skillSources 2>&1 | ForEach-Object { Write-Info "$_" }
323
- Test-Check ($LASTEXITCODE -eq 0) 'skill sources contain every skill in their fetched default branch'
323
+ Test-Check ($LASTEXITCODE -eq 0) 'skill sources sit on a branch and contain every skill of their fetched default branch as it stands there'
324
324
  }
325
325
 
326
326
  Write-Step 'Live parity (repo snapshot vs installed machine)'