@forgeax/engine-rhi-debug 0.1.23 → 0.1.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/engine-rhi-debug",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -26,19 +26,19 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "dependencies": {
29
- "@forgeax/engine-rhi": "0.1.23",
30
- "@forgeax/engine-types": "0.1.23",
29
+ "@forgeax/engine-rhi": "0.1.25",
30
+ "@forgeax/engine-types": "0.1.25",
31
31
  "@noble/hashes": "^2.2.0",
32
32
  "pako": "^1.0.11"
33
33
  },
34
34
  "devDependencies": {
35
- "@forgeax/engine-rhi-null": "0.1.23",
35
+ "@forgeax/engine-rhi-null": "0.1.25",
36
36
  "@types/node": "^20.14.0",
37
37
  "@webgpu/types": "^0.1.71"
38
38
  },
39
39
  "peerDependencies": {
40
- "@forgeax/engine-rhi-webgpu": "0.1.23",
41
- "@forgeax/engine-rhi-wgpu": "0.1.23"
40
+ "@forgeax/engine-rhi-webgpu": "0.1.25",
41
+ "@forgeax/engine-rhi-wgpu": "0.1.25"
42
42
  },
43
43
  "forgeax": {
44
44
  "metrics": {
@@ -18,8 +18,53 @@ import { describe, expect, it } from 'vitest';
18
18
 
19
19
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
20
20
  const ENGINE_ROOT = path.resolve(__dirname, '..', '..', '..', '..');
21
+ const FLAG_DRIFT_SELF = path.relative(ENGINE_ROOT, fileURLToPath(import.meta.url));
22
+
23
+ function normalizeRepoPath(value: string): string {
24
+ return value.split(path.sep).join('/');
25
+ }
26
+
27
+ function gitFlagDriftHits(root: string): string[] | null {
28
+ const relativeRoot = normalizeRepoPath(path.relative(ENGINE_ROOT, root));
29
+ const result = spawnSync(
30
+ 'git',
31
+ [
32
+ '-C',
33
+ ENGINE_ROOT,
34
+ 'grep',
35
+ '--name-only',
36
+ '-z',
37
+ '-e',
38
+ '--runId',
39
+ '-e',
40
+ '--ws-url',
41
+ '--',
42
+ `${relativeRoot}/**/*.ts`,
43
+ `${relativeRoot}/**/*.mjs`,
44
+ ],
45
+ { encoding: 'buffer', maxBuffer: 4 * 1024 * 1024 },
46
+ );
47
+
48
+ // A source snapshot (for example, the public SDK archive) has no Git
49
+ // metadata. Keep the filesystem fallback for that mode, and also avoid
50
+ // turning an unavailable Git binary into a false-positive guard result.
51
+ if (result.error || (result.status !== 0 && result.status !== 1)) return null;
52
+
53
+ return result.stdout
54
+ .toString('utf8')
55
+ .split('\0')
56
+ .filter(Boolean)
57
+ .map(normalizeRepoPath)
58
+ .filter((relativePath) => relativePath !== normalizeRepoPath(FLAG_DRIFT_SELF))
59
+ .filter((relativePath) => !relativePath.split('/').includes('dist'))
60
+ .filter((relativePath) => !relativePath.split('/').includes('node_modules'))
61
+ .sort();
62
+ }
21
63
 
22
64
  function flagDriftHits(root: string): string[] {
65
+ const gitHits = gitFlagDriftHits(root);
66
+ if (gitHits !== null) return gitHits;
67
+
23
68
  const hits: string[] = [];
24
69
  const visit = (directory: string): void => {
25
70
  for (const entry of readdirSync(directory, { withFileTypes: true })) {
@@ -44,7 +89,9 @@ function flagDriftHits(root: string): string[] {
44
89
  }
45
90
 
46
91
  describe('AC-07: flag drift grep gate', () => {
47
- it('zero hits for --runId / --ws-url across apps/ packages/ (excluding dist, node_modules, self)', () => {
92
+ it('zero hits for --runId / --ws-url across apps/ packages/ (excluding dist, node_modules, self)', {
93
+ timeout: 30_000,
94
+ }, () => {
48
95
  expect([
49
96
  ...flagDriftHits(path.join(ENGINE_ROOT, 'apps')),
50
97
  ...flagDriftHits(path.join(ENGINE_ROOT, 'packages')),