-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathtemplates.js
More file actions
114 lines (107 loc) · 3.64 KB
/
Copy pathtemplates.js
File metadata and controls
114 lines (107 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env node
'use strict';
const { createLoopContract } = require('./contract');
const LOOP_TEMPLATES = Object.freeze({
'pr-review-repair': {
title: 'PR review and repair',
type: 'pr-watch',
triggerKind: 'scheduled',
cadence: 'every 15 minutes',
goal: 'Monitor a pull request, inspect review/CI feedback, apply targeted fixes, and stop at review or green checks.',
verifierProfile: 'pr-checks',
maxAttempts: 3,
stopConditions: ['verifier-passed', 'needs-human-review', 'attempt-limit', 'unsafe-to-continue'],
},
'issue-triage': {
title: 'Issue triage',
type: 'triage',
triggerKind: 'scheduled',
cadence: 'daily',
goal: 'Inspect new issues, classify them, and write a reviewable triage summary.',
verifierProfile: 'triage-report',
maxAttempts: 1,
stopConditions: ['done', 'blocked', 'needs-human-review'],
},
'dependency-refresh': {
title: 'Dependency refresh',
type: 'maintenance',
triggerKind: 'manual',
goal: 'Check dependency drift, apply safe updates, and verify with the project test profile.',
verifierProfile: 'project-tests',
maxAttempts: 2,
stopConditions: ['verifier-passed', 'verifier-failed', 'needs-human-review'],
},
'docs-drift-check': {
title: 'Docs drift check',
type: 'schedule',
triggerKind: 'scheduled',
cadence: 'weekly',
goal: 'Check whether docs still match current scripts, commands, and public claims.',
verifierCommand: 'npm run docs:check',
verifierProfile: 'docs',
maxAttempts: 1,
stopConditions: ['verifier-passed', 'verifier-failed', 'needs-human-review'],
},
'nightly-health': {
title: 'Nightly health',
type: 'schedule',
triggerKind: 'scheduled',
cadence: 'daily',
goal: 'Run the safest project health checks and report blockers.',
verifierProfile: 'project-health',
maxAttempts: 1,
stopConditions: ['verifier-passed', 'verifier-failed', 'blocked'],
},
'visual-qa': {
title: 'Visual QA',
type: 'qa',
triggerKind: 'manual',
goal: 'Exercise the target UI route, capture evidence, and stop for human review on visual uncertainty.',
verifierProfile: 'visual',
maxAttempts: 2,
stopConditions: ['verifier-passed', 'needs-human-review', 'attempt-limit'],
},
'security-scan': {
title: 'Security scan',
type: 'security',
triggerKind: 'manual',
goal: 'Run bounded security checks, report actionable findings, and avoid autonomous risky changes.',
verifierProfile: 'security',
maxAttempts: 1,
stopConditions: ['done', 'needs-human-review', 'unsafe-to-continue'],
},
'demo-proof-refresh': {
title: 'Demo proof refresh',
type: 'verification',
triggerKind: 'manual',
goal: 'Refresh operating-loop proof artifacts and verify public demo claims.',
verifierCommand: 'node scripts/operating-proof.js --write',
verifierProfile: 'operating-proof',
maxAttempts: 1,
stopConditions: ['verifier-passed', 'verifier-failed', 'blocked'],
},
});
function listLoopTemplates() {
return Object.entries(LOOP_TEMPLATES).map(([id, template]) => ({ id, ...template }));
}
function getLoopTemplate(id) {
return LOOP_TEMPLATES[id] || null;
}
function instantiateLoopTemplate(id, options = {}) {
const template = getLoopTemplate(id);
if (!template) throw new Error(`Unknown loop template: ${id}`);
return createLoopContract({
...template,
...options,
template: id,
title: options.title || template.title,
type: options.type || template.type,
goal: options.goal || template.goal,
});
}
module.exports = Object.freeze({
LOOP_TEMPLATES,
getLoopTemplate,
instantiateLoopTemplate,
listLoopTemplates,
});