@hamp10/agentforge 0.2.44 → 0.2.45
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 +1 -1
- package/scripts/check-task-semantics.js +20 -0
- package/src/worker.js +17 -3
package/package.json
CHANGED
|
@@ -303,6 +303,16 @@ try {
|
|
|
303
303
|
'',
|
|
304
304
|
'new untracked scoped page files should count as touched UI targets'
|
|
305
305
|
);
|
|
306
|
+
git(fixture.repo, ['add', untrackedGammaRel]);
|
|
307
|
+
assert.equal(
|
|
308
|
+
worker._buildIncompleteScopedUiTargetsNudge(
|
|
309
|
+
[{ root: fixture.repo, head: fixture.head, initialDirtyPaths: [] }],
|
|
310
|
+
'Work on the Example.com listing pages for Alpha.ai, Beta.ai, and Gamma.ai. Make all three pages visually polished.'
|
|
311
|
+
),
|
|
312
|
+
'',
|
|
313
|
+
'new staged scoped page files should count as touched UI targets'
|
|
314
|
+
);
|
|
315
|
+
git(fixture.repo, ['restore', '--staged', untrackedGammaRel]);
|
|
306
316
|
rmSync(path.join(fixture.repo, untrackedGammaRel), { force: true });
|
|
307
317
|
const untrackedShallowGammaHtml = [
|
|
308
318
|
'<!doctype html>',
|
|
@@ -1327,6 +1337,16 @@ assert.match(
|
|
|
1327
1337
|
/const visualWarnings = \[\];[\s\S]*visualWarnings\.push\(`\$\{slug\}: \$\{visualWarning\}`\);[\s\S]*continue;[\s\S]*lastDirectVisualWarning = visualWarnings\.join\('\\n'\);/i,
|
|
1328
1338
|
'multi-target scoped verification should inspect every missing target before returning visual warnings'
|
|
1329
1339
|
);
|
|
1340
|
+
assert.match(
|
|
1341
|
+
workerSource,
|
|
1342
|
+
/diff', '--cached', '--numstat'/,
|
|
1343
|
+
'scoped UI target checks should count staged changes as touched targets'
|
|
1344
|
+
);
|
|
1345
|
+
assert.match(
|
|
1346
|
+
workerSource,
|
|
1347
|
+
/diff', '--cached', '--unified=0'/,
|
|
1348
|
+
'UI quality artifact checks should inspect staged source diffs before commit'
|
|
1349
|
+
);
|
|
1330
1350
|
assert.match(
|
|
1331
1351
|
openClawSource,
|
|
1332
1352
|
/Network\.setCacheDisabled[\s\S]*waitForRequestedDocument/i,
|
package/src/worker.js
CHANGED
|
@@ -562,8 +562,12 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
562
562
|
this._gitOutput(baseline.root, ['diff', '--numstat'], 10000),
|
|
563
563
|
'working tree'
|
|
564
564
|
);
|
|
565
|
+
const staged = this._parseNumstat(
|
|
566
|
+
this._gitOutput(baseline.root, ['diff', '--cached', '--numstat'], 10000),
|
|
567
|
+
'staged'
|
|
568
|
+
);
|
|
565
569
|
const byPath = new Map();
|
|
566
|
-
for (const stat of [...committed, ...working]) {
|
|
570
|
+
for (const stat of [...committed, ...staged, ...working]) {
|
|
567
571
|
const key = stat.path;
|
|
568
572
|
const current = byPath.get(key) || { additions: 0, deletions: 0, path: key, sources: new Set() };
|
|
569
573
|
current.additions += stat.additions;
|
|
@@ -1185,6 +1189,10 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
1185
1189
|
this._gitOutput(baseline.root, ['diff', '--numstat'], 10000),
|
|
1186
1190
|
'working tree'
|
|
1187
1191
|
);
|
|
1192
|
+
const staged = this._parseNumstat(
|
|
1193
|
+
this._gitOutput(baseline.root, ['diff', '--cached', '--numstat'], 10000),
|
|
1194
|
+
'staged'
|
|
1195
|
+
);
|
|
1188
1196
|
const untracked = this._listUntrackedUiFiles(baseline, userMessage, { scopedOnly: true })
|
|
1189
1197
|
.map(rel => {
|
|
1190
1198
|
let additions = 0;
|
|
@@ -1198,7 +1206,7 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
1198
1206
|
}
|
|
1199
1207
|
return { additions, deletions: 0, path: rel, source: 'untracked' };
|
|
1200
1208
|
});
|
|
1201
|
-
const combined = [...committed, ...working, ...untracked]
|
|
1209
|
+
const combined = [...committed, ...staged, ...working, ...untracked]
|
|
1202
1210
|
.filter(stat => /\.(html?|css|s[ac]ss|jsx?|tsx?|vue|svelte|astro|mdx?)$/i.test(stat.path));
|
|
1203
1211
|
if (combined.length === 0) continue;
|
|
1204
1212
|
|
|
@@ -1349,6 +1357,7 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
1349
1357
|
for (const baseline of repoBaselines) {
|
|
1350
1358
|
const byPath = new Map();
|
|
1351
1359
|
scanDiff(baseline, ['diff', '--unified=0', `${baseline.head}..HEAD`], 'committed', byPath);
|
|
1360
|
+
scanDiff(baseline, ['diff', '--cached', '--unified=0'], 'staged', byPath);
|
|
1352
1361
|
scanDiff(baseline, ['diff', '--unified=0'], 'working tree', byPath);
|
|
1353
1362
|
scanUntracked(baseline, byPath);
|
|
1354
1363
|
const changedFiles = [...byPath.values()];
|
|
@@ -1584,6 +1593,7 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
1584
1593
|
|
|
1585
1594
|
for (const baseline of repoBaselines) {
|
|
1586
1595
|
scanDiff(baseline, ['diff', '--unified=0', `${baseline.head}..HEAD`], 'committed');
|
|
1596
|
+
scanDiff(baseline, ['diff', '--cached', '--unified=0'], 'staged');
|
|
1587
1597
|
scanDiff(baseline, ['diff', '--unified=0'], 'working tree');
|
|
1588
1598
|
}
|
|
1589
1599
|
|
|
@@ -1635,6 +1645,10 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
1635
1645
|
this._gitOutput(baseline.root, ['diff', '--numstat'], 10000),
|
|
1636
1646
|
'working tree'
|
|
1637
1647
|
);
|
|
1648
|
+
const staged = this._parseNumstat(
|
|
1649
|
+
this._gitOutput(baseline.root, ['diff', '--cached', '--numstat'], 10000),
|
|
1650
|
+
'staged'
|
|
1651
|
+
);
|
|
1638
1652
|
const initialDirty = new Set(baseline.initialDirtyPaths || []);
|
|
1639
1653
|
const untracked = String(this._gitOutput(baseline.root, ['ls-files', '--others', '--exclude-standard'], 10000) || '')
|
|
1640
1654
|
.split('\n')
|
|
@@ -1643,7 +1657,7 @@ export class AgentForgeWorker extends EventEmitter {
|
|
|
1643
1657
|
.filter(rel => uiFileRe.test(rel))
|
|
1644
1658
|
.filter(rel => !initialDirty.has(rel))
|
|
1645
1659
|
.filter(rel => !this._isNestedProjectCopyRel(baseline.root, rel, baseline.head || 'HEAD'));
|
|
1646
|
-
const changedFiles = [...committed, ...working]
|
|
1660
|
+
const changedFiles = [...committed, ...staged, ...working]
|
|
1647
1661
|
.filter(stat => uiFileRe.test(stat.path))
|
|
1648
1662
|
.map(stat => stat.path)
|
|
1649
1663
|
.concat(untracked);
|