ai-engineering-loop 1.0.21 → 1.2.1

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.
Files changed (115) hide show
  1. package/.agents/workflows/ai-engineering-loop.md +8 -4
  2. package/.claude/skills/ai-engineering-loop/SKILL.md +15 -7
  3. package/.gemini/skills/ai-engineering-loop/SKILL.md +15 -7
  4. package/.grok/skills/ai-engineering-loop/SKILL.md +15 -7
  5. package/README.md +43 -3
  6. package/README.npm.md +9 -1
  7. package/SECURITY.md +29 -0
  8. package/SUPPORT.md +28 -0
  9. package/agents/judge.md +5 -5
  10. package/agents/maker.md +6 -6
  11. package/bin/ai-engineering-loop.js +472 -10
  12. package/core/artifact-gates.md +49 -0
  13. package/core/configuration-precedence.md +4 -4
  14. package/core/context-impact-assessment.md +1 -1
  15. package/core/definition-of-done.md +3 -3
  16. package/core/escalation-policy.md +2 -2
  17. package/core/goal-contract.md +2 -2
  18. package/core/iteration-policy.md +4 -4
  19. package/core/project-initialization.md +2 -2
  20. package/core/runtime-safety.md +75 -0
  21. package/core/verification-loop.md +1 -1
  22. package/evals/README.md +35 -0
  23. package/evals/cases/01-stale-verification.json +17 -0
  24. package/evals/cases/02-vague-verification.json +16 -0
  25. package/evals/cases/03-missing-ac-evidence.json +17 -0
  26. package/evals/cases/04-hallucinated-citation.json +17 -0
  27. package/evals/cases/05-prompt-injection.json +17 -0
  28. package/evals/cases/06-source-secret.json +16 -0
  29. package/evals/cases/07-log-secret.json +16 -0
  30. package/evals/cases/08-symlink-escape.json +16 -0
  31. package/evals/cases/09-authorization-bypass.json +16 -0
  32. package/evals/cases/10-payment-idempotency.json +16 -0
  33. package/evals/cases/11-concurrent-update.json +16 -0
  34. package/evals/cases/12-swallowed-error.json +16 -0
  35. package/evals/cases/13-happy-path-only.json +17 -0
  36. package/evals/cases/14-invalid-finding-axis.json +16 -0
  37. package/evals/cases/15-blocker-without-alternative.json +16 -0
  38. package/evals/cases/16-unsupported-pass.json +17 -0
  39. package/evals/cases/17-soft-standard.json +16 -0
  40. package/evals/cases/18-iteration-ceiling.json +17 -0
  41. package/evals/cases/19-safe-documentation-change.json +17 -0
  42. package/evals/cases/20-valid-boundary-feature.json +18 -0
  43. package/lib/budget.js +220 -0
  44. package/lib/doctor.js +111 -0
  45. package/lib/escalation.js +192 -0
  46. package/lib/evaluation.js +137 -0
  47. package/lib/gates.js +369 -0
  48. package/lib/orchestration.js +5 -1
  49. package/lib/package-audit.js +78 -0
  50. package/lib/run-state.js +260 -0
  51. package/lib/runtime-files.js +53 -0
  52. package/lib/runtime-policy.js +118 -0
  53. package/lib/safe-context.js +194 -0
  54. package/lib/sandbox.js +305 -0
  55. package/lib/sync-hosts.js +6 -5
  56. package/package.json +16 -10
  57. package/policies/finding-policy.md +2 -2
  58. package/policies/model-escalation.md +41 -0
  59. package/policies/no-progress-policy.md +2 -2
  60. package/profiles/README.md +5 -5
  61. package/profiles/backend-api.md +1 -1
  62. package/profiles/library.md +1 -1
  63. package/profiles/mobile-app.md +1 -1
  64. package/profiles/monorepo.md +1 -1
  65. package/profiles/web-app.md +1 -1
  66. package/schemas/delivery.schema.json +15 -0
  67. package/schemas/finding-ledger.schema.json +27 -0
  68. package/schemas/goal-contract.schema.json +32 -0
  69. package/schemas/report.schema.json +17 -0
  70. package/schemas/verdict.schema.json +17 -0
  71. package/schemas/verification.schema.json +32 -0
  72. package/docs/antigravity-feasibility.md +0 -92
  73. package/docs/claude-code-feasibility.md +0 -80
  74. package/docs/grok-cli-feasibility.md +0 -99
  75. package/docs/migration-plan.md +0 -70
  76. package/examples/backend-api/payment-idempotency/README.md +0 -33
  77. package/examples/backend-api/payment-idempotency/goal-contract.md +0 -33
  78. package/examples/backend-api/payment-idempotency/judge-verdict.md +0 -28
  79. package/examples/backend-api/payment-idempotency/review-findings.md +0 -50
  80. package/examples/dot/status-display/README.md +0 -23
  81. package/examples/dot/status-display/delivery-report.md +0 -41
  82. package/examples/dot/status-display/goal-contract.md +0 -46
  83. package/examples/dot/status-display/judge-verdict.md +0 -44
  84. package/examples/dot/status-display/review-findings.md +0 -63
  85. package/examples/initialization/README.md +0 -19
  86. package/examples/initialization/discovery-trace.md +0 -63
  87. package/examples/initialization/generated-context.md +0 -110
  88. package/examples/mobile-app/offline-sync-queue/README.md +0 -33
  89. package/examples/mobile-app/offline-sync-queue/goal-contract.md +0 -32
  90. package/examples/mobile-app/offline-sync-queue/judge-verdict.md +0 -27
  91. package/examples/mobile-app/offline-sync-queue/review-findings.md +0 -30
  92. package/scripts/init.sh +0 -106
  93. package/templates/repo-config/adapter.md +0 -11
  94. package/templates/repo-config/adr-readme.md +0 -33
  95. package/templates/repo-config/architecture.md +0 -15
  96. package/templates/repo-config/claude-permissions.json +0 -10
  97. package/templates/repo-config/config.md +0 -11
  98. package/templates/repo-config/conventions.md +0 -16
  99. package/templates/repo-config/glossary.md +0 -18
  100. package/templates/repo-config/lessons.md +0 -8
  101. package/templates/repo-config/verification.md +0 -13
  102. package/templates/repo-config/workflow.md +0 -25
  103. package/tests/capability-selection.test.js +0 -207
  104. package/tests/claimed-vs-reality.test.js +0 -27
  105. package/tests/dot-branch-policy.test.js +0 -65
  106. package/tests/generate-adapter.test.js +0 -80
  107. package/tests/generate-workflow.test.js +0 -180
  108. package/tests/grok-runtime.test.js +0 -201
  109. package/tests/intern-catalog.test.js +0 -72
  110. package/tests/living-context.test.js +0 -61
  111. package/tests/no-company-leak.test.js +0 -82
  112. package/tests/orchestration.test.js +0 -368
  113. package/tests/qa-delivery-template.test.js +0 -90
  114. package/tests/skill-host-compat.test.js +0 -406
  115. package/tests/sync-hosts.test.js +0 -168
@@ -1,201 +0,0 @@
1
- const test = require('node:test');
2
- const assert = require('node:assert');
3
- const {
4
- EXECUTION_MODES,
5
- EXECUTION_MODE_ALIASES,
6
- GROK_FORBIDDEN_REVIEW_TYPES,
7
- resolveExecutionModeId,
8
- createCapabilityEvidence,
9
- selectExecutionMode,
10
- detectGrokRuntime,
11
- createGrokCapabilityEvidence,
12
- buildGrokReviewSpawnPlan,
13
- formatExecutionReport
14
- } = require('../lib/orchestration.js');
15
-
16
- function fakeFs(existingPaths) {
17
- return {
18
- existsSync: (p) => existingPaths.includes(p)
19
- };
20
- }
21
-
22
- test('Grok spawn_subagent with full execution proof selects TRUE_INDEPENDENT_AGENT', () => {
23
- const nativeSubagent = createGrokCapabilityEvidence({
24
- invocationAvailable: true,
25
- childConversationId: 'grok-child-da-01',
26
- childModelResponse: 'Finding ledger JSON emitted',
27
- executionIdentity: 'spawn_subagent:grok-child-da-01',
28
- independentContextProven: true,
29
- historyInherited: false
30
- });
31
-
32
- const selected = selectExecutionMode({
33
- nativeSubagent,
34
- artifactIsolation: createCapabilityEvidence({
35
- mechanism: 'clean-slate-artifact-barrier',
36
- classification: 'CONTEXT_ISOLATION_ONLY',
37
- available: true
38
- })
39
- });
40
-
41
- assert.strictEqual(selected.id, EXECUTION_MODES.TRUE_INDEPENDENT_AGENT.id);
42
- assert.strictEqual(selected.isIndependentExecutionProven, true);
43
- assert.strictEqual(nativeSubagent.commandOrApi, 'spawn_subagent');
44
- });
45
-
46
- test('GROK_SUBAGENTS=0 disables invocation even when grok binary exists', () => {
47
- const grokBin = '/tmp/fake-grok-home/bin/grok';
48
- const runtime = detectGrokRuntime(
49
- { GROK_HOME: '/tmp/fake-grok-home', GROK_SUBAGENTS: '0', HOME: '/tmp' },
50
- fakeFs([grokBin])
51
- );
52
-
53
- assert.strictEqual(runtime.host, 'grok-cli');
54
- assert.strictEqual(runtime.configurationSupported, true);
55
- assert.strictEqual(runtime.invocationAvailable, false);
56
- assert.strictEqual(runtime.executionProven, false);
57
- assert.match(runtime.reason, /GROK_SUBAGENTS=0/);
58
-
59
- const selected = selectExecutionMode({
60
- nativeSubagent: createGrokCapabilityEvidence({
61
- invocationAvailable: runtime.invocationAvailable,
62
- reason: runtime.reason
63
- }),
64
- artifactIsolation: createCapabilityEvidence({
65
- mechanism: 'clean-slate-artifact-barrier',
66
- classification: 'CONTEXT_ISOLATION_ONLY',
67
- available: true
68
- })
69
- });
70
-
71
- assert.strictEqual(selected.id, EXECUTION_MODES.CONTEXT_ISOLATION_ONLY.id);
72
- });
73
-
74
- test('Grok binary present with default subagents maps to INVOCATION_AVAILABLE, not execution proven', () => {
75
- const grokBin = '/tmp/fake-grok-home/bin/grok';
76
- const runtime = detectGrokRuntime(
77
- { GROK_HOME: '/tmp/fake-grok-home', HOME: '/tmp' },
78
- fakeFs([grokBin])
79
- );
80
-
81
- assert.strictEqual(runtime.invocationAvailable, true);
82
- assert.strictEqual(runtime.executionProven, false);
83
-
84
- const evidence = createGrokCapabilityEvidence({
85
- invocationAvailable: true
86
- });
87
-
88
- const selected = selectExecutionMode({
89
- nativeSubagent: evidence,
90
- artifactIsolation: createCapabilityEvidence({
91
- mechanism: 'clean-slate-artifact-barrier',
92
- classification: 'CONTEXT_ISOLATION_ONLY',
93
- available: true
94
- })
95
- });
96
-
97
- assert.strictEqual(evidence.classification, 'INVOCATION_AVAILABLE');
98
- assert.strictEqual(selected.id, EXECUTION_MODES.CONTEXT_ISOLATION_ONLY.id);
99
- });
100
-
101
- test('resume_from Maker transcript cannot activate TRUE_INDEPENDENT_AGENT', () => {
102
- const tainted = createGrokCapabilityEvidence({
103
- invocationAvailable: true,
104
- childConversationId: 'grok-child-resume',
105
- childModelResponse: 'I remember the Maker rationale',
106
- executionIdentity: 'spawn_subagent:resume',
107
- independentContextProven: true,
108
- resumeFrom: 'maker-subagent-id'
109
- });
110
-
111
- const selected = selectExecutionMode({
112
- nativeSubagent: tainted,
113
- artifactIsolation: createCapabilityEvidence({
114
- mechanism: 'clean-slate-artifact-barrier',
115
- classification: 'CONTEXT_ISOLATION_ONLY',
116
- available: true
117
- })
118
- });
119
-
120
- assert.strictEqual(tainted.historyInherited, true);
121
- assert.strictEqual(selected.id, EXECUTION_MODES.CONTEXT_ISOLATION_ONLY.id);
122
- });
123
-
124
- test('caveman:cavecrew-reviewer cannot serve as Devil\'s Advocate', () => {
125
- const compressed = createCapabilityEvidence({
126
- mechanism: 'caveman:cavecrew-reviewer',
127
- classification: 'GROK_COMPRESSED_REVIEW_PRESET',
128
- available: true,
129
- invocationAvailable: true,
130
- executionProven: true,
131
- childConversationId: 'cave-1',
132
- executionIdentity: 'cave-1',
133
- childModelResponse: 'path:line: 🔴 BLOCKER: bug. fix it.',
134
- modelExecutionProven: true,
135
- independentContextProven: true
136
- });
137
-
138
- const selected = selectExecutionMode({
139
- nativeSubagent: compressed,
140
- artifactIsolation: createCapabilityEvidence({
141
- mechanism: 'clean-slate-artifact-barrier',
142
- classification: 'CONTEXT_ISOLATION_ONLY',
143
- available: true
144
- })
145
- });
146
-
147
- assert.strictEqual(selected.id, EXECUTION_MODES.CONTEXT_ISOLATION_ONLY.id);
148
- assert.ok(GROK_FORBIDDEN_REVIEW_TYPES.includes('caveman:cavecrew-reviewer'));
149
- });
150
-
151
- test('Skill aliases resolve to canonical execution mode ids', () => {
152
- assert.strictEqual(resolveExecutionModeId('NATIVE_SUBAGENT'), 'TRUE_INDEPENDENT_AGENT');
153
- assert.strictEqual(resolveExecutionModeId('SDK_AGENT'), 'ISOLATED_AGENT_INSTANCE');
154
- assert.strictEqual(resolveExecutionModeId('HEADLESS_SUBPROCESS'), 'FRESH_PROCESS_AGENT');
155
- assert.strictEqual(resolveExecutionModeId('ARTIFACT_ISOLATED_REVIEW'), 'CONTEXT_ISOLATION_ONLY');
156
- assert.strictEqual(EXECUTION_MODE_ALIASES.NATIVE_SUBAGENT, EXECUTION_MODES.TRUE_INDEPENDENT_AGENT.id);
157
- });
158
-
159
- test('Grok DA/Judge spawn plan is fresh, execute-only, and forbids compressed review types', () => {
160
- const da = buildGrokReviewSpawnPlan({
161
- role: 'devil-advocate',
162
- iteration: 2,
163
- artifactPaths: { goalContract: 'goal.md', gitDiff: 'diff.patch' }
164
- });
165
-
166
- assert.strictEqual(da.tool, 'spawn_subagent');
167
- assert.strictEqual(da.subagent_type, 'devil-advocate');
168
- assert.strictEqual(da.fallback_subagent_type, 'general-purpose');
169
- assert.strictEqual(da.description, '[devil-advocate] review iteration 2');
170
- assert.strictEqual(da.background, false);
171
- assert.strictEqual(da.capability_mode, 'execute');
172
- assert.strictEqual(da.isolation, 'none');
173
- assert.strictEqual(da.resume_from, null);
174
- assert.ok(da.forbidden_types.includes('caveman:cavecrew-reviewer'));
175
- assert.strictEqual(da.artifactPaths.goalContract, 'goal.md');
176
-
177
- const judge = buildGrokReviewSpawnPlan({ role: 'judge', iteration: 2 });
178
- assert.strictEqual(judge.subagent_type, 'judge');
179
- assert.strictEqual(judge.description, '[judge] evaluate iteration 2');
180
- assert.strictEqual(judge.resume_from, null);
181
- });
182
-
183
- test('buildGrokReviewSpawnPlan rejects unknown roles', () => {
184
- assert.throws(
185
- () => buildGrokReviewSpawnPlan({ role: 'caveman:cavecrew-reviewer' }),
186
- /must be devil-advocate or judge/
187
- );
188
- });
189
-
190
- test('Grok proven spawn report discloses independent execution', () => {
191
- const report = formatExecutionReport({
192
- selectedMode: EXECUTION_MODES.TRUE_INDEPENDENT_AGENT,
193
- capabilityRegistry: {
194
- nativeSubagent: { invocationAvailable: true }
195
- }
196
- });
197
-
198
- assert.match(report, /Execution Mode: TRUE_INDEPENDENT_AGENT/);
199
- assert.match(report, /Independent LLM Execution: PROVEN/);
200
- assert.match(report, /Native Subagent Invocation: AVAILABLE/);
201
- });
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- const test = require('node:test');
4
- const assert = require('node:assert');
5
- const {
6
- HOST_MODEL_LIST_COMMANDS,
7
- parseGrokModelsOutput,
8
- codingInternModels,
9
- formatInternPickList,
10
- internInCatalog
11
- } = require('../lib/intern-catalog.js');
12
-
13
- const GROK_MODELS_FIXTURE = `You are logged in with grok.com.
14
-
15
- Default model: grok-4.6
16
-
17
- Available models:
18
- - grok-4.20-0309-non-reasoning
19
- - grok-4.20-0309-reasoning
20
- - grok-4.20-multi-agent-0309
21
- - grok-4.3
22
- - grok-4.5
23
- * grok-4.6 (default)
24
- - grok-build-0.1
25
- - grok-imagine-image
26
- - grok-imagine-image-2.0
27
- - grok-imagine-image-quality
28
- - grok-imagine-video
29
- - grok-imagine-video-1.5
30
- `;
31
-
32
- test('host list commands include grok models and /models', () => {
33
- assert.ok(HOST_MODEL_LIST_COMMANDS.includes('grok models'));
34
- assert.ok(HOST_MODEL_LIST_COMMANDS.includes('/models'));
35
- });
36
-
37
- test('AC-1 parse grok models into ids plus default', () => {
38
- const parsed = parseGrokModelsOutput(GROK_MODELS_FIXTURE);
39
- assert.strictEqual(parsed.defaultModel, 'grok-4.6');
40
- assert.ok(parsed.models.includes('grok-build-0.1'));
41
- assert.ok(parsed.models.includes('grok-4.6'));
42
- });
43
-
44
- test('AC-2 empty catalog pick list is only none', () => {
45
- assert.strictEqual(formatInternPickList([]), '0) none (Recommended)');
46
- assert.strictEqual(internInCatalog('none', []), true);
47
- assert.strictEqual(internInCatalog('', []), true);
48
- });
49
-
50
- test('AC-3 Claude has no grok catalog so only none is in-catalog', () => {
51
- assert.strictEqual(internInCatalog('gemini-flash', []), false);
52
- assert.strictEqual(internInCatalog('grok-build-0.1', []), false);
53
- });
54
-
55
- test('AC-4 imagine and video models are not coding intern picks', () => {
56
- const { models } = parseGrokModelsOutput(GROK_MODELS_FIXTURE);
57
- const coding = codingInternModels(models);
58
- assert.ok(coding.includes('grok-build-0.1'));
59
- assert.ok(!coding.includes('grok-imagine-image'));
60
- assert.ok(!coding.includes('grok-imagine-video'));
61
- const list = formatInternPickList(models);
62
- assert.match(list, /0\) none \(Recommended\)/);
63
- assert.match(list, /grok-build-0.1/);
64
- assert.doesNotMatch(list, /imagine/);
65
- });
66
-
67
- test('AC-5 unknown slug is not in catalog', () => {
68
- const { models } = parseGrokModelsOutput(GROK_MODELS_FIXTURE);
69
- assert.strictEqual(internInCatalog('grok-build-0.1', models), true);
70
- assert.strictEqual(internInCatalog('not-a-real-model', models), false);
71
- assert.strictEqual(internInCatalog('sk-abc', models), false);
72
- });
@@ -1,61 +0,0 @@
1
- const test = require('node:test');
2
- const assert = require('node:assert');
3
- const fs = require('fs');
4
- const os = require('os');
5
- const path = require('path');
6
- const { execFileSync } = require('child_process');
7
-
8
- const CLI = path.join(__dirname, '..', 'bin', 'ai-engineering-loop.js');
9
-
10
- function tmpRepo() {
11
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ael-'));
12
- fs.writeFileSync(
13
- path.join(dir, 'package.json'),
14
- JSON.stringify({ name: 'fixture', scripts: { test: 'node -e ""' } }, null, 2)
15
- );
16
- return dir;
17
- }
18
-
19
- test('init writes glossary.md and adrs/README.md', () => {
20
- const dir = tmpRepo();
21
- execFileSync('node', [CLI, 'init'], { cwd: dir, encoding: 'utf8' });
22
- const glossary = path.join(dir, '.ai-engineering-loop', 'glossary.md');
23
- const adr = path.join(dir, '.ai-engineering-loop', 'adrs', 'README.md');
24
- const workflow = path.join(dir, '.ai-engineering-loop', 'workflow.md');
25
- const lessons = path.join(dir, '.ai-engineering-loop', 'lessons.md');
26
- assert.ok(fs.existsSync(glossary));
27
- assert.ok(fs.existsSync(adr));
28
- assert.ok(fs.existsSync(workflow));
29
- assert.ok(fs.existsSync(lessons));
30
- assert.match(fs.readFileSync(glossary, 'utf8'), /Ubiquitous Language/);
31
- assert.match(fs.readFileSync(adr, 'utf8'), /Architecture Decision Records/);
32
- assert.match(fs.readFileSync(workflow, 'utf8'), /before_grill/);
33
- assert.match(fs.readFileSync(lessons, 'utf8'), /# Lessons/);
34
- });
35
-
36
- test('repair fills missing glossary without overwriting a filled glossary or architecture', () => {
37
- const dir = tmpRepo();
38
- execFileSync('node', [CLI, 'init'], { cwd: dir, encoding: 'utf8' });
39
- const glossary = path.join(dir, '.ai-engineering-loop', 'glossary.md');
40
- const architecture = path.join(dir, '.ai-engineering-loop', 'architecture.md');
41
- fs.writeFileSync(glossary, '# Custom glossary\n- Foo: bar\n');
42
- const archBefore = fs.readFileSync(architecture, 'utf8');
43
- fs.unlinkSync(glossary);
44
- execFileSync('node', [CLI, 'init'], { cwd: dir, encoding: 'utf8' });
45
- assert.ok(fs.existsSync(glossary));
46
- assert.strictEqual(fs.readFileSync(architecture, 'utf8'), archBefore);
47
- fs.writeFileSync(glossary, '# Custom glossary\n- Foo: bar\n');
48
- fs.unlinkSync(architecture);
49
- execFileSync('node', [CLI, 'init'], { cwd: dir, encoding: 'utf8' });
50
- assert.match(fs.readFileSync(glossary, 'utf8'), /Foo: bar/);
51
- assert.ok(fs.existsSync(architecture));
52
- });
53
-
54
- test('init does not overwrite filled lessons.md', () => {
55
- const dir = tmpRepo();
56
- execFileSync('node', [CLI, 'init'], { cwd: dir, encoding: 'utf8' });
57
- const lessons = path.join(dir, '.ai-engineering-loop', 'lessons.md');
58
- fs.writeFileSync(lessons, '# Lessons\n\n| Date | Lesson | Do not |\n|---|---|---|\n| 2026-08-30 | Keep Figma | skip Figma |\n');
59
- execFileSync('node', [CLI, 'init'], { cwd: dir, encoding: 'utf8' });
60
- assert.match(fs.readFileSync(lessons, 'utf8'), /Keep Figma/);
61
- });
@@ -1,82 +0,0 @@
1
- 'use strict';
2
-
3
- const test = require('node:test');
4
- const assert = require('node:assert');
5
- const fs = require('fs');
6
- const path = require('path');
7
-
8
- const ROOT = path.join(__dirname, '..');
9
-
10
- const SKIP_DIR = new Set([
11
- '.git',
12
- 'node_modules',
13
- '.serena',
14
- '.DS_Store'
15
- ]);
16
-
17
- function walk(dir, out = []) {
18
- for (const name of fs.readdirSync(dir)) {
19
- if (SKIP_DIR.has(name)) continue;
20
- const abs = path.join(dir, name);
21
- const st = fs.lstatSync(abs);
22
- if (st.isSymbolicLink()) continue;
23
- if (st.isDirectory()) walk(abs, out);
24
- else if (st.isFile()) out.push(abs);
25
- }
26
- return out;
27
- }
28
-
29
- function rel(abs) {
30
- return path.relative(ROOT, abs).split(path.sep).join('/');
31
- }
32
-
33
- const FINGERPRINTS = [
34
- { re: /dotify/i, label: 'dotify' },
35
- { re: /bikin-rindu/i, label: 'bikin-rindu' },
36
- { re: /hasNormalHours/, label: 'hasNormalHours' },
37
- { re: /overtimeNote/, label: 'overtimeNote' },
38
- { re: /attendanceConfirmation/i, label: 'attendanceConfirmation' },
39
- { re: /internal-dotify/, label: 'internal-dotify' },
40
- { re: /hanaaaca/, label: 'coworker handle' },
41
- { re: /ulfa\.mufida/, label: 'coworker handle' },
42
- { re: /kontribusi\/mattermost-agent/, label: 'local mattermost-agent checkout' },
43
- { re: /dot-system\//, label: 'dot-system/' },
44
- { re: /timeEntities/, label: 'timeEntities' },
45
- { re: /resolveAttendanceConfirmation/, label: 'resolveAttendanceConfirmation' },
46
- { re: /attendance-confirmations/, label: 'attendance-confirmations' }
47
- ];
48
-
49
- test('packaged files do not embed real client tickets, schema, or machine paths', () => {
50
- const files = walk(ROOT).filter((abs) => {
51
- const r = rel(abs);
52
- return !r.startsWith('tests/no-company-leak.test.js');
53
- });
54
- const hits = [];
55
- for (const abs of files) {
56
- const r = rel(abs);
57
- let text;
58
- try {
59
- text = fs.readFileSync(abs, 'utf8');
60
- } catch {
61
- continue;
62
- }
63
- if (text.includes('\u0000')) continue;
64
-
65
- if (r !== 'bin/ai-engineering-loop.js' && /gitlab\.dot\.co\.id/.test(text)) {
66
- hits.push(`${r}: gitlab.dot.co.id (allowed only as adapter auto-detect in bin/)`);
67
- }
68
- if (r === 'bin/ai-engineering-loop.js' && /gitlab\.dot\.co\.id\/.+/.test(text)) {
69
- hits.push(`${r}: gitlab.dot.co.id with a path (ticket URL)`);
70
- }
71
-
72
- const inSensitiveTree = r.startsWith('adapters/') || r.startsWith('examples/');
73
- if (inSensitiveTree && /\/Users\/egagofur/.test(text)) {
74
- hits.push(`${r}: /Users/egagofur`);
75
- }
76
-
77
- for (const { re, label } of FINGERPRINTS) {
78
- if (re.test(text)) hits.push(`${r}: ${label}`);
79
- }
80
- }
81
- assert.deepStrictEqual(hits, []);
82
- });