check-post 0.1.0 → 0.3.0

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 (40) hide show
  1. package/README.md +66 -60
  2. package/dist/cli.js +18 -18
  3. package/dist/commands/init.js +37 -36
  4. package/dist/commands/list.js +1 -1
  5. package/dist/commands/run.js +8 -8
  6. package/dist/commands/shared.js +2 -2
  7. package/dist/commands/status.js +3 -3
  8. package/dist/core/adapters/claude-code.js +12 -12
  9. package/dist/core/adapters/index.js +2 -2
  10. package/dist/core/discovery.js +8 -8
  11. package/dist/core/gate.js +13 -13
  12. package/dist/core/process.js +2 -2
  13. package/dist/core/project.js +5 -5
  14. package/dist/core/runners/ai.js +9 -9
  15. package/dist/core/runners/command.js +3 -3
  16. package/dist/core/scheduler.js +11 -10
  17. package/dist/core/stage-file.js +4 -4
  18. package/dist/core/types.js +4 -2
  19. package/dist/ui/format.js +1 -1
  20. package/dist/ui/plain.js +2 -2
  21. package/dist/ui/tui/App.js +112 -50
  22. package/package.json +2 -2
  23. package/presets/angular/04-security/01-secrets.md +12 -12
  24. package/presets/angular/04-security/02-xss-audit.md +9 -9
  25. package/presets/angular/04-security/03-env-audit.md +7 -7
  26. package/presets/angular/04-security/_group.md +1 -1
  27. package/presets/angular/05-code-standard.md +8 -8
  28. package/presets/angular/context.md +2 -2
  29. package/presets/nextjs/04-security/01-secrets.md +12 -12
  30. package/presets/nextjs/04-security/02-xss-audit.md +8 -8
  31. package/presets/nextjs/04-security/03-env-audit.md +7 -7
  32. package/presets/nextjs/04-security/_group.md +1 -1
  33. package/presets/nextjs/05-code-standard.md +8 -8
  34. package/presets/nextjs/context.md +1 -1
  35. package/presets/node/04-security/01-secrets.md +12 -12
  36. package/presets/node/04-security/02-injection-audit.md +7 -7
  37. package/presets/node/04-security/03-env-audit.md +7 -7
  38. package/presets/node/04-security/_group.md +1 -1
  39. package/presets/node/05-code-standard.md +8 -8
  40. package/presets/node/context.md +1 -1
@@ -17,7 +17,6 @@ export function App({ pipeline, header, execute, initialNodes }) {
17
17
  const [selected, setSelected] = useState(0);
18
18
  const [follow, setFollow] = useState(true);
19
19
  const [view, setView] = useState('list');
20
- const [detailOffset, setDetailOffset] = useState(0);
21
20
  const [running, setRunning] = useState(false);
22
21
  const [gate, setGate] = useState(null);
23
22
  const [notice, setNotice] = useState(null);
@@ -97,24 +96,15 @@ export function App({ pipeline, header, execute, initialNodes }) {
97
96
  if (input === 'q' || (key.ctrl && input === 'c')) {
98
97
  if (running && controller.current) {
99
98
  quitting.current = true;
100
- setNotice('Membatalkan stage yang sedang berjalan…');
99
+ setNotice('Cancelling running stages…');
101
100
  controller.current.abort();
102
101
  }
103
102
  else
104
103
  exit();
105
104
  return;
106
105
  }
107
- if (view === 'detail') {
108
- if (key.escape || key.leftArrow || key.return) {
109
- setView('list');
110
- setDetailOffset(0);
111
- }
112
- else if (key.upArrow)
113
- setDetailOffset((o) => Math.max(0, o - 1));
114
- else if (key.downArrow)
115
- setDetailOffset((o) => o + 1);
116
- return;
117
- }
106
+ if (view === 'detail')
107
+ return; // the Detail component handles its own keys
118
108
  if (key.upArrow) {
119
109
  setFollow(false);
120
110
  setSelected((i) => Math.max(0, i - 1));
@@ -128,7 +118,7 @@ export function App({ pipeline, header, execute, initialNodes }) {
128
118
  }
129
119
  else if (input === 'r' && current) {
130
120
  if (running)
131
- setNotice('Tunggu pipeline selesai sebelum rerun.');
121
+ setNotice('Wait for the pipeline to finish before rerunning.');
132
122
  else
133
123
  start([current]);
134
124
  }
@@ -138,15 +128,13 @@ export function App({ pipeline, header, execute, initialNodes }) {
138
128
  }
139
129
  else if (input === 'o' && current) {
140
130
  const target = current.kind === 'stage' ? current.file : current.dir;
141
- const editor = process.env.CHECKPOST_EDITOR || 'code';
142
- const child = spawn(editor, [target], { detached: true, stdio: 'ignore' });
143
- child.on('error', () => setNotice(`Tidak bisa membuka editor "${editor}". Set CHECKPOST_EDITOR.`));
144
- child.unref();
145
- setNotice(`Membuka ${path.relative(pipeline.root, target)} di ${editor}`);
131
+ const { editor, child } = openInEditor(target);
132
+ child.on('error', () => setNotice(`Could not open editor "${editor}". Set CHECKPOST_EDITOR.`));
133
+ setNotice(`Opening ${path.relative(pipeline.root, target)} in ${editor}`);
146
134
  }
147
135
  });
148
136
  if (view === 'detail' && current) {
149
- return _jsx(Detail, { node: current, state: states[current.id], log: logs[current.id] ?? [], offset: detailOffset, rows: rows, pipeline: pipeline });
137
+ return (_jsx(Detail, { node: current, state: states[current.id], log: logs[current.id] ?? [], pipeline: pipeline, onBack: () => setView('list') }, current.id));
150
138
  }
151
139
  const logLines = current ? (logs[current.id] ?? []) : [];
152
140
  const logHeight = Math.max(4, Math.min(12, rows - rowsList.length - 10));
@@ -162,46 +150,120 @@ export function App({ pipeline, header, execute, initialNodes }) {
162
150
  : '';
163
151
  const findings = st.result?.findings ?? [];
164
152
  const blocking = node.kind === 'stage' ? findings.filter((f) => isBlocking(f, node.config.fail_on)).length : 0;
165
- const tag = node.kind === 'group' ? (node.config.parallel ? '(paralel)' : '') : node.type === 'command' ? '' : `[${typeLabel(node)}]`;
153
+ const tag = node.kind === 'group' ? (node.config.parallel ? '(parallel)' : '') : node.type === 'command' ? '' : `[${typeLabel(node)}]`;
166
154
  const prefix = depth > 0 ? ' '.repeat(depth - 1) + '├ ' : '';
167
- return (_jsxs(Text, { inverse: isSel, children: [' ', prefix, _jsx(Text, { color: STATUS_COLOR[st.status], children: icon }), " ", node.name.padEnd(Math.max(1, 22 - prefix.length)), _jsx(Text, { color: "cyan", children: tag.padEnd(10) }), _jsx(Text, { color: "gray", children: elapsed.padStart(8) }), findings.length > 0 && (_jsxs(Text, { color: blocking ? 'red' : 'yellow', children: [' ', findings.length, " temuan", blocking ? ` (${blocking} blokir)` : ''] })), st.result?.allowFailure && (st.status === 'failed' || st.status === 'error') && _jsx(Text, { color: "yellow", children: " allow_failure" }), st.status === 'skipped' && st.result?.summary && _jsxs(Text, { color: "gray", children: [" ", st.result.summary] })] }, node.id));
168
- }), _jsx(Text, { color: "gray", children: '─'.repeat(60) }), current && (_jsxs(Box, { flexDirection: "column", height: logHeight + 1, children: [_jsxs(Text, { color: "gray", children: [current.name, " \u203A log"] }), logLines.slice(-logHeight).map((line, i) => (_jsxs(Text, { wrap: "truncate-end", color: line.startsWith('[AI]') ? 'cyan' : undefined, children: [' ', line] }, i)))] })), _jsx(Text, { color: "gray", children: '─'.repeat(60) }), gate && _jsx(GateBox, { gate: gate }), notice && _jsxs(Text, { color: "yellow", children: [" ", notice] }), _jsxs(Text, { color: "gray", children: [' ', "\u2191\u2193 pilih enter detail r rerun stage R rerun semua o buka .md q keluar"] })] }));
155
+ return (_jsxs(Text, { inverse: isSel, children: [' ', prefix, _jsx(Text, { color: STATUS_COLOR[st.status], children: icon }), " ", node.name.padEnd(Math.max(1, 22 - prefix.length)), _jsx(Text, { color: "cyan", children: tag.padEnd(10) }), _jsx(Text, { color: "gray", children: elapsed.padStart(8) }), findings.length > 0 && (_jsxs(Text, { color: blocking ? 'red' : 'yellow', children: [' ', findings.length, " finding", findings.length === 1 ? '' : 's', blocking ? ` (${blocking} blocking)` : ''] })), st.result?.allowFailure && (st.status === 'failed' || st.status === 'error') && _jsx(Text, { color: "yellow", children: " allow_failure" }), st.status === 'skipped' && st.result?.summary && _jsxs(Text, { color: "gray", children: [" ", st.result.summary] })] }, node.id));
156
+ }), _jsx(Text, { color: "gray", children: '─'.repeat(60) }), current && (_jsxs(Box, { flexDirection: "column", height: logHeight + 1, children: [_jsxs(Text, { color: "gray", children: [current.name, " \u203A log"] }), logLines.slice(-logHeight).map((line, i) => (_jsxs(Text, { wrap: "truncate-end", color: line.startsWith('[AI]') ? 'cyan' : undefined, children: [' ', line] }, i)))] })), _jsx(Text, { color: "gray", children: '─'.repeat(60) }), gate && _jsx(GateBox, { gate: gate }), notice && _jsxs(Text, { color: "yellow", children: [" ", notice] }), _jsxs(Text, { color: "gray", children: [' ', "\u2191\u2193 select enter details r rerun stage R rerun all o open .md q quit"] })] }));
169
157
  }
170
158
  function GateBox({ gate }) {
171
159
  const sha = gate.git.sha ? `${gate.git.branch}@${gate.git.sha.slice(0, 7)}` : '';
172
160
  if (gate.green) {
173
- return (_jsxs(Box, { borderStyle: "round", borderColor: "green", paddingX: 1, flexDirection: "column", children: [_jsx(Text, { color: "green", bold: true, children: "\u2714 GATE GREEN \u00B7 boleh deploy" }), _jsx(Text, { color: "gray", children: sha })] }));
161
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "green", paddingX: 1, flexDirection: "column", children: [_jsx(Text, { color: "green", bold: true, children: "\u2714 GATE GREEN \u00B7 ok to deploy" }), _jsx(Text, { color: "gray", children: sha })] }));
174
162
  }
175
- return (_jsxs(Box, { borderStyle: "round", borderColor: "red", paddingX: 1, flexDirection: "column", children: [_jsx(Text, { color: "red", bold: true, children: "\u2716 GATE RED \u00B7 belum boleh deploy" }), gate.reasons.slice(0, 6).map((r, i) => (_jsxs(Text, { color: "gray", children: ["\u2022 ", r] }, i)))] }));
163
+ return (_jsxs(Box, { borderStyle: "round", borderColor: "red", paddingX: 1, flexDirection: "column", children: [_jsx(Text, { color: "red", bold: true, children: "\u2716 GATE RED \u00B7 not ready to deploy" }), gate.reasons.slice(0, 6).map((r, i) => (_jsxs(Text, { color: "gray", children: ["\u2022 ", r] }, i)))] }));
164
+ }
165
+ const SEVERITY_ORDER = ['critical', 'high', 'medium', 'low', 'info'];
166
+ const GUI_EDITORS = new Set(['code', 'code-insiders', 'cursor', 'windsurf', 'codium']);
167
+ /** Open a file (optionally at a line) in the configured editor, detached from the TUI. */
168
+ export function openInEditor(file, line) {
169
+ const editor = process.env.CHECKPOST_EDITOR || 'code';
170
+ const args = line && GUI_EDITORS.has(path.basename(editor)) ? ['-g', `${file}:${line}`] : [file];
171
+ const child = spawn(editor, args, { detached: true, stdio: 'ignore' });
172
+ child.unref();
173
+ return { editor, child };
176
174
  }
177
- function Detail({ node, state, log, offset, rows, pipeline, }) {
175
+ /** Rough number of terminal rows a finding takes, used to keep the selection on screen. */
176
+ function findingHeight(f, width) {
177
+ const rowsFor = (text) => Math.max(1, Math.ceil(text.length / Math.max(20, width)));
178
+ return 1 + rowsFor(f.message) + (f.suggestion ? rowsFor('→ ' + f.suggestion) : 0) + 1;
179
+ }
180
+ function Detail({ node, state, log, pipeline, onBack, }) {
181
+ const { rows, columns } = useWindowSize();
178
182
  const result = state?.result;
179
- const lines = [];
183
+ const findings = result?.findings ?? [];
184
+ const [selected, setSelected] = useState(0);
185
+ const [logOffset, setLogOffset] = useState(0);
186
+ const [notice, setNotice] = useState(null);
187
+ const top = useRef(0);
188
+ const failOn = node.kind === 'stage' ? node.config.fail_on : 'high';
189
+ const numWidth = String(findings.length).length;
190
+ const bodyIndent = 2 + 2 * numWidth + 1 + 2; // "❯ " + "n/N" + gap
191
+ const bodyWidth = columns - bodyIndent - 2;
192
+ useInput((input, key) => {
193
+ if (key.escape || key.leftArrow || key.backspace)
194
+ return onBack();
195
+ if (findings.length) {
196
+ if (key.upArrow)
197
+ setSelected((i) => Math.max(0, i - 1));
198
+ else if (key.downArrow)
199
+ setSelected((i) => Math.min(findings.length - 1, i + 1));
200
+ else if (key.pageUp)
201
+ setSelected((i) => Math.max(0, i - 5));
202
+ else if (key.pageDown)
203
+ setSelected((i) => Math.min(findings.length - 1, i + 5));
204
+ else if (input === 'g')
205
+ setSelected(0);
206
+ else if (input === 'G')
207
+ setSelected(findings.length - 1);
208
+ else if (input === 'o' || key.return) {
209
+ const f = findings[selected];
210
+ if (!f?.file)
211
+ return setNotice('This finding has no file location.');
212
+ const { editor, child } = openInEditor(path.resolve(pipeline.root, f.file), f.line);
213
+ child.on('error', () => setNotice(`Could not open editor "${editor}". Set CHECKPOST_EDITOR.`));
214
+ setNotice(`Opening ${findingLocation(f)} in ${editor}`);
215
+ }
216
+ }
217
+ else if (key.upArrow)
218
+ setLogOffset((o) => Math.max(0, o - 1));
219
+ else if (key.downArrow)
220
+ setLogOffset((o) => Math.min(Math.max(0, log.length - 1), o + 1));
221
+ });
222
+ const status = state?.status ?? 'pending';
223
+ const header = node.kind === 'stage'
224
+ ? `${node.name} · ${typeLabel(node)}${node.type !== 'command' ? ` · fail_on: ${node.config.fail_on}` : ''}`
225
+ : node.name;
226
+ const counts = SEVERITY_ORDER.map((sev) => [sev, findings.filter((f) => f.severity === sev).length]).filter(([, n]) => n > 0);
227
+ const blockingCount = findings.filter((f) => isBlocking(f, failOn)).length;
228
+ // Fixed chrome: header, rule, summary (estimated), counts, rule, ..., rule, footer, notice.
229
+ const summaryRows = result?.summary ? Math.ceil(result.summary.length / Math.max(20, columns - 2)) : 0;
230
+ const available = Math.max(4, rows - 7 - summaryRows - (result?.error ? 1 : 0));
231
+ let body;
232
+ let position = '';
180
233
  if (node.kind === 'group') {
181
- lines.push(_jsxs(Text, { children: ["Grup berisi ", node.children.length, " item. Pilih stage di dalamnya untuk melihat detail."] }, "g"));
234
+ body = _jsxs(Text, { children: ["Group with ", node.children.length, " items. Select a stage inside it to see details."] });
235
+ }
236
+ else if (findings.length) {
237
+ // Keep the selected finding visible: scroll the window only when the selection leaves it.
238
+ const heights = findings.map((f) => findingHeight(f, bodyWidth));
239
+ const fits = (from, to) => heights.slice(from, to + 1).reduce((a, b) => a + b, 0) <= available;
240
+ if (selected < top.current)
241
+ top.current = selected;
242
+ while (top.current < selected && !fits(top.current, selected))
243
+ top.current++;
244
+ let end = top.current;
245
+ while (end + 1 < findings.length && fits(top.current, end + 1))
246
+ end++;
247
+ const hiddenAbove = top.current;
248
+ const hiddenBelow = findings.length - 1 - end;
249
+ position = `${selected + 1}/${findings.length}`;
250
+ body = (_jsxs(Box, { flexDirection: "column", children: [hiddenAbove > 0 && _jsxs(Text, { color: "gray", children: [" \u2191 ", hiddenAbove, " more above"] }), findings.slice(top.current, end + 1).map((f, i) => {
251
+ const index = top.current + i;
252
+ const isSel = index === selected;
253
+ const blocking = isBlocking(f, failOn);
254
+ const num = `${String(index + 1).padStart(numWidth)}/${findings.length}`;
255
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: "cyan", bold: true, children: isSel ? '❯ ' : ' ' }), _jsx(Text, { inverse: isSel, bold: isSel, color: isSel ? undefined : 'gray', children: num }), ' ', _jsx(Text, { backgroundColor: SEVERITY_COLOR[f.severity], color: "black", bold: true, children: ` ${f.severity.toUpperCase()} `.padEnd(10) }), blocking ? _jsx(Text, { color: "red", bold: true, children: " \u25CF blocking" }) : _jsx(Text, { color: "gray", children: ' ' }), ' ', _jsx(Text, { underline: isSel, bold: isSel, children: findingLocation(f) || '(no location)' })] }), _jsx(Box, { paddingLeft: bodyIndent, children: _jsx(Text, { color: isSel ? undefined : 'gray', children: f.message }) }), f.suggestion && (_jsx(Box, { paddingLeft: bodyIndent, children: _jsxs(Text, { color: isSel ? 'green' : 'gray', children: ["\u2192 ", f.suggestion] }) }))] }, index));
256
+ }), hiddenBelow > 0 && _jsxs(Text, { color: "gray", children: [" \u2193 ", hiddenBelow, " more below"] })] }));
182
257
  }
183
258
  else {
184
- if (result?.summary)
185
- lines.push(_jsx(Text, { children: result.summary }, "s"));
186
- if (result?.error)
187
- lines.push(_jsxs(Text, { color: "red", children: ["Error: ", result.error] }, "e"));
188
- if (result?.findings.length) {
189
- result.findings.forEach((f, i) => {
190
- const blocking = isBlocking(f, node.config.fail_on);
191
- lines.push(_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: SEVERITY_COLOR[f.severity], bold: true, children: f.severity.toUpperCase().padEnd(9) }), _jsx(Text, { underline: true, children: findingLocation(f) }), blocking && _jsx(Text, { color: "red", children: " (blokir)" })] }), _jsxs(Text, { children: [' ', f.message] }), f.suggestion && _jsxs(Text, { color: "gray", children: [' ', "\u2192 ", f.suggestion] })] }, `f${i}`));
192
- });
193
- }
194
- else if (node.type === 'command' || !result) {
195
- lines.push(_jsx(Text, { color: "gray", children: "Log:" }, "lt"));
196
- log.forEach((line, i) => lines.push(_jsxs(Text, { children: [" ", line] }, `l${i}`)));
197
- }
198
- if (result?.logFile)
199
- lines.push(_jsxs(Text, { color: "gray", children: ["Log lengkap: ", path.relative(pipeline.root, result.logFile)] }, "lf"));
259
+ const visible = Math.max(4, available);
260
+ const start = Math.min(logOffset, Math.max(0, log.length - visible));
261
+ if (log.length)
262
+ position = `lines ${start + 1}-${Math.min(log.length, start + visible)}/${log.length}`;
263
+ body = (_jsxs(Box, { flexDirection: "column", children: [result?.status === 'passed' && node.type !== 'command' && _jsx(Text, { color: "green", children: "No findings." }), log.slice(start, start + visible).map((line, i) => (_jsxs(Text, { wrap: "truncate-end", children: [' ', line] }, i))), result?.logFile && _jsxs(Text, { color: "gray", children: ["Full log: ", path.relative(pipeline.root, result.logFile)] })] }));
200
264
  }
201
- const visible = Math.max(5, rows - 6);
202
- const start = Math.min(offset, Math.max(0, lines.length - visible));
203
- const header = node.kind === 'stage'
204
- ? `${node.name} · ${typeLabel(node)}${node.kind === 'stage' && node.type !== 'command' ? ` · fail_on: ${node.config.fail_on}` : ''}`
205
- : node.name;
206
- return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { bold: true, children: [' ', _jsx(Text, { color: STATUS_COLOR[state?.status ?? 'pending'], children: STATUS_ICON[state?.status ?? 'pending'] }), " ", header, result?.costUsd ? _jsxs(Text, { color: "gray", children: [" \u00B7 $", result.costUsd.toFixed(3)] }) : null] }), _jsx(Text, { color: "gray", children: '─'.repeat(60) }), lines.slice(start, start + visible), _jsx(Text, { color: "gray", children: '─'.repeat(60) }), _jsx(Text, { color: "gray", children: " \u2191\u2193 gulir esc kembali q keluar" })] }));
265
+ const rule = _jsx(Text, { color: "gray", children: '─'.repeat(Math.max(20, Math.min(columns - 1, 100))) });
266
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { bold: true, children: [' ', _jsx(Text, { color: STATUS_COLOR[status], children: STATUS_ICON[status] }), " ", header, result?.costUsd ? _jsxs(Text, { color: "gray", children: [" \u00B7 $", result.costUsd.toFixed(3)] }) : null] }), rule, result?.summary && (_jsx(Box, { paddingLeft: 1, children: _jsx(Text, { color: "gray", children: result.summary }) })), result?.error && (_jsx(Box, { paddingLeft: 1, children: _jsxs(Text, { color: "red", children: ["Error: ", result.error] }) })), findings.length > 0 && (_jsxs(Text, { children: [' ', _jsxs(Text, { bold: true, children: [findings.length, " finding", findings.length === 1 ? '' : 's'] }), counts.map(([sev, n]) => (_jsxs(Text, { children: [' ', _jsx(Text, { color: SEVERITY_COLOR[sev], children: "\u25A0" }), " ", n, " ", sev] }, sev))), _jsxs(Text, { color: blockingCount ? 'red' : 'green', children: [' · ', blockingCount ? `${blockingCount} blocking (fail_on: ${failOn})` : `none blocking (fail_on: ${failOn})`] })] })), rule, body, rule, notice && _jsxs(Text, { color: "yellow", children: [" ", notice] }), _jsxs(Text, { color: "gray", children: [findings.length
267
+ ? ' ↑↓ select PgUp/PgDn jump g/G first/last enter/o open in editor esc back q quit'
268
+ : ' ↑↓ scroll esc back q quit', position && _jsxs(Text, { color: "cyan", children: [' ', position] })] })] }));
207
269
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "check-post",
3
- "version": "0.1.0",
4
- "description": "Pipeline CI/CD lokal: stage dari file Markdown, dijalankan oleh AI CLI (Claude Code). Gate GREEN = boleh deploy.",
3
+ "version": "0.3.0",
4
+ "description": "Local CI/CD pipeline whose stages are Markdown files, run by an AI CLI (Claude Code). A green gate means ready to deploy.",
5
5
  "keywords": [
6
6
  "ci",
7
7
  "cd",
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  fail_on: high
3
3
  ---
4
- # Secrets & API key
4
+ # Secrets & API keys
5
5
 
6
- Cari kredensial yang di-hardcode di source code yang ikut di-commit:
7
- - API key, token, password, private key, connection string berisi password
8
- - URL yang menyertakan kredensial (`https://user:pass@...`)
9
- - Token JWT atau bearer token yang ditulis langsung
6
+ Look for credentials hardcoded in committed source code:
7
+ - API keys, tokens, passwords, private keys, connection strings containing passwords
8
+ - URLs with embedded credentials (`https://user:pass@...`)
9
+ - JWTs or bearer tokens written inline
10
10
 
11
- Cara kerja:
12
- 1. Pakai Grep dengan pola seperti `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
- 2. Baca konteks setiap hasil untuk memastikan nilainya benar-benar rahasia.
11
+ How to work:
12
+ 1. Use Grep with patterns such as `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
+ 2. Read the context of every match to confirm the value is actually secret.
14
14
 
15
15
  Severity:
16
- - critical: secret asli yang terlihat aktif
17
- - high: kemungkinan besar secret asli
18
- - low: placeholder atau contoh (mis. `xxx`, `changeme`, `your-api-key`)
19
- Abaikan file test, mock, dan fixture kecuali isinya terlihat seperti secret asli.
16
+ - critical: a real secret that looks active
17
+ - high: very likely a real secret
18
+ - low: placeholder or example (e.g. `xxx`, `changeme`, `your-api-key`)
19
+ Ignore test, mock, and fixture files unless the value looks like a real secret.
@@ -4,14 +4,14 @@ fail_on: high
4
4
  ---
5
5
  # XSS audit (Angular)
6
6
 
7
- Angular sudah melakukan sanitasi otomatis, jadi fokus pada celah yang melewatinya:
8
- - Pemakaian `DomSanitizer.bypassSecurityTrustHtml/Url/ResourceUrl/Script/Style` dengan data yang bisa dikontrol user atau API
9
- - Binding `[innerHTML]`, `[outerHTML]`, `[srcdoc]` berisi data dari user, query param, atau API tanpa sanitasi yang jelas
10
- - Manipulasi DOM langsung: `ElementRef.nativeElement.innerHTML`, `Renderer2.setProperty(..., 'innerHTML', ...)`, `document.write`, `insertAdjacentHTML`
11
- - `[href]`/`[src]` yang dibangun dari input user (risiko `javascript:` URL)
12
- - `eval`, `new Function`, `setTimeout` dengan string
7
+ Angular sanitizes automatically, so focus on the gaps that bypass it:
8
+ - `DomSanitizer.bypassSecurityTrustHtml/Url/ResourceUrl/Script/Style` with data that users or an API can control
9
+ - `[innerHTML]`, `[outerHTML]`, `[srcdoc]` bindings with data from users, query params, or an API without clear sanitization
10
+ - Direct DOM manipulation: `ElementRef.nativeElement.innerHTML`, `Renderer2.setProperty(..., 'innerHTML', ...)`, `document.write`, `insertAdjacentHTML`
11
+ - `[href]`/`[src]` built from user input (risk of `javascript:` URLs)
12
+ - `eval`, `new Function`, `setTimeout` with a string
13
13
 
14
14
  Severity:
15
- - high: data dari user/query param/API mengalir ke salah satu sink di atas tanpa sanitasi
16
- - medium: sumber data tidak jelas
17
- - low: data statis/terkontrol penuh
15
+ - high: data from users/query params/an API flows into one of the sinks above without sanitization
16
+ - medium: the data source is unclear
17
+ - low: static or fully controlled data
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  fail_on: high
3
3
  ---
4
- # Audit konfigurasi environment
4
+ # Environment configuration audit
5
5
 
6
- Jangan pernah membaca isi file env atau file rahasia; cukup gunakan nama variabel.
7
- Periksa:
8
- 1. File konfigurasi environment yang berisi rahasia tercantum di `.gitignore`.
9
- 2. Tidak ada nilai rahasia (key, token, password) yang di-hardcode sebagai fallback, mis. `process.env.X || "nilai-asli"`.
10
- 3. Variabel yang terekspos ke browser (bundle client) tidak berisi rahasia.
11
- 4. Bila ada file contoh (`.env.example` dsb.), bandingkan nama variabelnya dengan yang dipakai di kode.
6
+ Never read the contents of env files or other secret files; work with variable NAMES only.
7
+ Check that:
8
+ 1. Environment config files that hold secrets are listed in `.gitignore`.
9
+ 2. No secret value (key, token, password) is hardcoded as a fallback, e.g. `process.env.X || "real-value"`.
10
+ 3. Variables exposed to the browser (client bundle) contain no secrets.
11
+ 4. If an example file exists (`.env.example` etc.), its variable names match the ones used in code.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  parallel: true
3
3
  ---
4
- Fokus pada keamanan. Laporkan hanya masalah yang benar-benar ada di kode, sertakan file dan baris.
4
+ Focus on security. Report only problems that actually exist in the code, with file and line.
@@ -3,13 +3,13 @@ fail_on: medium
3
3
  ---
4
4
  # Code standard
5
5
 
6
- Baca dokumen konvensi project bila ada (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
- lalu periksa kode di `src/` terhadap konvensi tersebut.
6
+ Read the project's convention documents if present (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
+ then check the code in `src/` against those conventions.
8
8
 
9
- Tambahan aturan umum:
10
- - Tidak ada tipe `any` yang tidak perlu
11
- - Tidak ada `console.log` tertinggal di kode produksi
12
- - Tidak ada kode yang dikomentari dalam blok besar
9
+ General rules on top of that:
10
+ - No unnecessary `any` types
11
+ - No leftover `console.log` in production code
12
+ - No large blocks of commented-out code
13
13
 
14
- Laporkan maksimal 15 temuan paling penting. Gunakan medium untuk pelanggaran konvensi yang tertulis eksplisit,
15
- low untuk saran gaya.
14
+ Report at most the 15 most important findings. Use medium for violations of explicitly written conventions,
15
+ low for style suggestions.
@@ -1,2 +1,2 @@
1
- Project ini adalah aplikasi Angular (standalone components, TypeScript). Template ada di file `*.html`
2
- atau properti `template`, logika di `*.ts`. Abaikan folder `node_modules/`, `dist/`, `coverage/`, dan `.angular/`.
1
+ This project is an Angular application (standalone components, TypeScript). Templates live in `*.html`
2
+ files or the `template` property, logic in `*.ts`. Ignore `node_modules/`, `dist/`, `coverage/`, and `.angular/`.
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  fail_on: high
3
3
  ---
4
- # Secrets & API key
4
+ # Secrets & API keys
5
5
 
6
- Cari kredensial yang di-hardcode di source code yang ikut di-commit:
7
- - API key, token, password, private key, connection string berisi password
8
- - URL yang menyertakan kredensial (`https://user:pass@...`)
9
- - Token JWT atau bearer token yang ditulis langsung
6
+ Look for credentials hardcoded in committed source code:
7
+ - API keys, tokens, passwords, private keys, connection strings containing passwords
8
+ - URLs with embedded credentials (`https://user:pass@...`)
9
+ - JWTs or bearer tokens written inline
10
10
 
11
- Cara kerja:
12
- 1. Pakai Grep dengan pola seperti `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
- 2. Baca konteks setiap hasil untuk memastikan nilainya benar-benar rahasia.
11
+ How to work:
12
+ 1. Use Grep with patterns such as `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
+ 2. Read the context of every match to confirm the value is actually secret.
14
14
 
15
15
  Severity:
16
- - critical: secret asli yang terlihat aktif
17
- - high: kemungkinan besar secret asli
18
- - low: placeholder atau contoh (mis. `xxx`, `changeme`, `your-api-key`)
19
- Abaikan file test, mock, dan fixture kecuali isinya terlihat seperti secret asli.
16
+ - critical: a real secret that looks active
17
+ - high: very likely a real secret
18
+ - low: placeholder or example (e.g. `xxx`, `changeme`, `your-api-key`)
19
+ Ignore test, mock, and fixture files unless the value looks like a real secret.
@@ -4,13 +4,13 @@ fail_on: high
4
4
  ---
5
5
  # XSS audit (React/Next.js)
6
6
 
7
- Periksa:
8
- - `dangerouslySetInnerHTML` berisi data dari user, query string, CMS, atau API tanpa sanitasi (mis. DOMPurify)
9
- - `href`/`src` yang dibangun dari input user (risiko `javascript:` URL)
10
- - Data `searchParams`/`params` yang dirender atau dipakai di redirect tanpa validasi
11
- - `eval`, `new Function`, manipulasi `innerHTML` langsung
7
+ Check for:
8
+ - `dangerouslySetInnerHTML` with data from users, query strings, a CMS, or an API without sanitization (e.g. DOMPurify)
9
+ - `href`/`src` built from user input (risk of `javascript:` URLs)
10
+ - `searchParams`/`params` data rendered or used in redirects without validation
11
+ - `eval`, `new Function`, direct `innerHTML` manipulation
12
12
 
13
13
  Severity:
14
- - high: data tidak tepercaya mengalir ke sink tanpa sanitasi
15
- - medium: sumber data tidak jelas
16
- - low: data statis/terkontrol penuh
14
+ - high: untrusted data flows into a sink without sanitization
15
+ - medium: the data source is unclear
16
+ - low: static or fully controlled data
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  fail_on: high
3
3
  ---
4
- # Audit konfigurasi environment
4
+ # Environment configuration audit
5
5
 
6
- Jangan pernah membaca isi file env atau file rahasia; cukup gunakan nama variabel.
7
- Periksa:
8
- 1. File konfigurasi environment yang berisi rahasia tercantum di `.gitignore`.
9
- 2. Tidak ada nilai rahasia (key, token, password) yang di-hardcode sebagai fallback, mis. `process.env.X || "nilai-asli"`.
10
- 3. Variabel yang terekspos ke browser (bundle client) tidak berisi rahasia.
11
- 4. Bila ada file contoh (`.env.example` dsb.), bandingkan nama variabelnya dengan yang dipakai di kode.
6
+ Never read the contents of env files or other secret files; work with variable NAMES only.
7
+ Check that:
8
+ 1. Environment config files that hold secrets are listed in `.gitignore`.
9
+ 2. No secret value (key, token, password) is hardcoded as a fallback, e.g. `process.env.X || "real-value"`.
10
+ 3. Variables exposed to the browser (client bundle) contain no secrets.
11
+ 4. If an example file exists (`.env.example` etc.), its variable names match the ones used in code.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  parallel: true
3
3
  ---
4
- Fokus pada keamanan. Laporkan hanya masalah yang benar-benar ada di kode, sertakan file dan baris.
4
+ Focus on security. Report only problems that actually exist in the code, with file and line.
@@ -3,13 +3,13 @@ fail_on: medium
3
3
  ---
4
4
  # Code standard
5
5
 
6
- Baca dokumen konvensi project bila ada (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
- lalu periksa kode di `src/` terhadap konvensi tersebut.
6
+ Read the project's convention documents if present (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
+ then check the code in `src/` against those conventions.
8
8
 
9
- Tambahan aturan umum:
10
- - Tidak ada tipe `any` yang tidak perlu
11
- - Tidak ada `console.log` tertinggal di kode produksi
12
- - Tidak ada kode yang dikomentari dalam blok besar
9
+ General rules on top of that:
10
+ - No unnecessary `any` types
11
+ - No leftover `console.log` in production code
12
+ - No large blocks of commented-out code
13
13
 
14
- Laporkan maksimal 15 temuan paling penting. Gunakan medium untuk pelanggaran konvensi yang tertulis eksplisit,
15
- low untuk saran gaya.
14
+ Report at most the 15 most important findings. Use medium for violations of explicitly written conventions,
15
+ low for style suggestions.
@@ -1 +1 @@
1
- Project ini adalah aplikasi Next.js (React, TypeScript). Abaikan folder `node_modules/`, `.next/`, `out/`, dan `coverage/`.
1
+ This project is a Next.js application (React, TypeScript). Ignore `node_modules/`, `.next/`, `out/`, and `coverage/`.
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  fail_on: high
3
3
  ---
4
- # Secrets & API key
4
+ # Secrets & API keys
5
5
 
6
- Cari kredensial yang di-hardcode di source code yang ikut di-commit:
7
- - API key, token, password, private key, connection string berisi password
8
- - URL yang menyertakan kredensial (`https://user:pass@...`)
9
- - Token JWT atau bearer token yang ditulis langsung
6
+ Look for credentials hardcoded in committed source code:
7
+ - API keys, tokens, passwords, private keys, connection strings containing passwords
8
+ - URLs with embedded credentials (`https://user:pass@...`)
9
+ - JWTs or bearer tokens written inline
10
10
 
11
- Cara kerja:
12
- 1. Pakai Grep dengan pola seperti `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
- 2. Baca konteks setiap hasil untuk memastikan nilainya benar-benar rahasia.
11
+ How to work:
12
+ 1. Use Grep with patterns such as `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
+ 2. Read the context of every match to confirm the value is actually secret.
14
14
 
15
15
  Severity:
16
- - critical: secret asli yang terlihat aktif
17
- - high: kemungkinan besar secret asli
18
- - low: placeholder atau contoh (mis. `xxx`, `changeme`, `your-api-key`)
19
- Abaikan file test, mock, dan fixture kecuali isinya terlihat seperti secret asli.
16
+ - critical: a real secret that looks active
17
+ - high: very likely a real secret
18
+ - low: placeholder or example (e.g. `xxx`, `changeme`, `your-api-key`)
19
+ Ignore test, mock, and fixture files unless the value looks like a real secret.
@@ -3,13 +3,13 @@ fail_on: high
3
3
  ---
4
4
  # Injection audit
5
5
 
6
- Periksa:
7
- - Query SQL/NoSQL yang dibangun dengan string concatenation atau template literal dari input request
8
- - `child_process.exec`/`execSync` dengan input request
9
- - Path file dari input request tanpa normalisasi (path traversal)
10
- - Endpoint tanpa validasi input atau tanpa pemeriksaan otorisasi pada data milik user lain
6
+ Check for:
7
+ - SQL/NoSQL queries built by string concatenation or template literals from request input
8
+ - `child_process.exec`/`execSync` with request input
9
+ - File paths from request input without normalization (path traversal)
10
+ - Endpoints without input validation or without authorization checks on other users' data
11
11
 
12
12
  Severity:
13
- - critical/high: input request mengalir ke sink tanpa validasi
14
- - medium: validasi ada tetapi lemah
13
+ - critical/high: request input flows into a sink without validation
14
+ - medium: validation exists but is weak
15
15
  - low: hardening
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  fail_on: high
3
3
  ---
4
- # Audit konfigurasi environment
4
+ # Environment configuration audit
5
5
 
6
- Jangan pernah membaca isi file env atau file rahasia; cukup gunakan nama variabel.
7
- Periksa:
8
- 1. File konfigurasi environment yang berisi rahasia tercantum di `.gitignore`.
9
- 2. Tidak ada nilai rahasia (key, token, password) yang di-hardcode sebagai fallback, mis. `process.env.X || "nilai-asli"`.
10
- 3. Variabel yang terekspos ke browser (bundle client) tidak berisi rahasia.
11
- 4. Bila ada file contoh (`.env.example` dsb.), bandingkan nama variabelnya dengan yang dipakai di kode.
6
+ Never read the contents of env files or other secret files; work with variable NAMES only.
7
+ Check that:
8
+ 1. Environment config files that hold secrets are listed in `.gitignore`.
9
+ 2. No secret value (key, token, password) is hardcoded as a fallback, e.g. `process.env.X || "real-value"`.
10
+ 3. Variables exposed to the browser (client bundle) contain no secrets.
11
+ 4. If an example file exists (`.env.example` etc.), its variable names match the ones used in code.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  parallel: true
3
3
  ---
4
- Fokus pada keamanan. Laporkan hanya masalah yang benar-benar ada di kode, sertakan file dan baris.
4
+ Focus on security. Report only problems that actually exist in the code, with file and line.
@@ -3,13 +3,13 @@ fail_on: medium
3
3
  ---
4
4
  # Code standard
5
5
 
6
- Baca dokumen konvensi project bila ada (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
- lalu periksa kode di `src/` terhadap konvensi tersebut.
6
+ Read the project's convention documents if present (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
+ then check the code in `src/` against those conventions.
8
8
 
9
- Tambahan aturan umum:
10
- - Tidak ada tipe `any` yang tidak perlu
11
- - Tidak ada `console.log` tertinggal di kode produksi
12
- - Tidak ada kode yang dikomentari dalam blok besar
9
+ General rules on top of that:
10
+ - No unnecessary `any` types
11
+ - No leftover `console.log` in production code
12
+ - No large blocks of commented-out code
13
13
 
14
- Laporkan maksimal 15 temuan paling penting. Gunakan medium untuk pelanggaran konvensi yang tertulis eksplisit,
15
- low untuk saran gaya.
14
+ Report at most the 15 most important findings. Use medium for violations of explicitly written conventions,
15
+ low for style suggestions.
@@ -1 +1 @@
1
- Project ini adalah aplikasi/API Node.js. Abaikan folder `node_modules/`, `dist/`, `build/`, dan `coverage/`.
1
+ This project is a Node.js application/API. Ignore `node_modules/`, `dist/`, `build/`, and `coverage/`.