0.1.1: the reviewer has no built-in name

- Board text, timelines, the sign-in page and notifications use the name in
  reviewer.json; nothing says Pandu any more.
- Examples and docs use the brand: reviewer "Labuh", bot "labuh-bot",
  mentions "@labuh".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 19:52:49 +07:00
parent 112923640d
commit b8986003c9
14 changed files with 45 additions and 44 deletions

View File

@@ -205,7 +205,7 @@ export function createBoard(store: Store, cfg: BoardConfig, projects: string[],
const viewer = viewerOf(req);
if (!viewer) {
if (url.pathname.startsWith('/api/')) return json(res, 401, { error: 'sign in' });
return page(res, 401, 'Labuh', 'Antrean deploy dan review Pandu. Masuk dengan akun GitLab yang punya akses ke repo-nya.', '<a class="btn" href="/auth/login">Masuk dengan GitLab</a>');
return page(res, 401, 'Labuh', `Antrean deploy dan review ${reviewer.name}. Masuk dengan akun GitLab yang punya akses ke repo-nya.`, '<a class="btn" href="/auth/login">Masuk dengan GitLab</a>');
}
if (url.pathname === '/') return send(res, 200, TYPES['.html'], readFileSync(path.join(STATIC, 'index.html')));
if (url.pathname === '/rubric') return send(res, 200, TYPES['.html'], rubricPage(readFileSync(path.resolve(HOME, reviewer.rubric), 'utf8')));
@@ -214,7 +214,7 @@ export function createBoard(store: Store, cfg: BoardConfig, projects: string[],
const ajuan = store
.allAjuan()
.filter((a) => visible(a, cfg, viewer, now))
.map((a) => viewAjuan(a, store.events(a.id), cfg, viewer, actionState(a), a.deploy_state === 'awaiting_release' && a.target_branch ? store.openRelease(a.project, a.target_branch) ?? null : null));
.map((a) => viewAjuan(a, store.events(a.id), cfg, viewer, actionState(a), a.deploy_state === 'awaiting_release' && a.target_branch ? store.openRelease(a.project, a.target_branch) ?? null : null, reviewer.name));
return json(res, 200, { viewer: { username: viewer.username, name: viewer.name, approver: viewer.approver }, reviewer: reviewer.name, lanes: [...cfg.lanes.map((l) => l.name), 'Lainnya'], ajuan, at: new Date(now).toISOString() });
}
const act = url.pathname.match(/^\/api\/ajuan\/(\d+)\/action$/);

View File

@@ -113,11 +113,11 @@ const STATUS: Record<Ajuan['status'], BoardStatus> = {
closed: 'done',
};
const REASON: Record<BoardStatus, string> = {
checking: 'Pandu lagi baca perubahannya.',
const reasons = (reviewer: string): Record<BoardStatus, string> => ({
checking: `${reviewer} lagi baca perubahannya.`,
fix: '',
blocked: '',
manual: 'Pandu nggak bisa kasih hasil yang valid. Perlu dicek manual.',
manual: `${reviewer} nggak bisa kasih hasil yang valid. Perlu dicek manual.`,
ready: '',
gas: '',
parked: '',
@@ -125,7 +125,7 @@ const REASON: Record<BoardStatus, string> = {
sailing: 'Sudah di-merge. Pipeline deploy lagi jalan.',
failed: 'Sudah di-merge, tapi pipeline deploy-nya gagal.',
done: 'Sudah di-merge.',
};
});
const ZONE: Record<BoardStatus, Zone> = {
checking: 'cek', fix: 'cek', blocked: 'cek', manual: 'cek', parked: 'cek',
@@ -133,7 +133,7 @@ const ZONE: Record<BoardStatus, Zone> = {
rejected: 'beres', sailing: 'beres', failed: 'beres', done: 'beres',
};
// Decisions and deploys sit on top of Pandu's verdict.
// Decisions and deploys sit on top of the reviewer's verdict.
export function boardStatus(a: Ajuan): BoardStatus {
if (a.status === 'closed') {
if (a.closed_state !== 'merged') return 'done';
@@ -173,14 +173,14 @@ function publicEvidence(e: Evidence): Evidence {
const VERDICT_WORD: Record<string, string> = { go: 'aman', no_go: 'tahan', waiting: 'nunggu' };
function timelineText(kind: string, result: string | null, author: string | null): string {
function timelineText(kind: string, result: string | null, author: string | null, reviewer: string): string {
const r = result ?? '';
const verdict = r.match(/^(go|no_go|waiting) di (\w+)/);
if (kind === 'opened') return verdict ? `Diajukan${author ? ` ${author}` : ''}; Pandu: ${VERDICT_WORD[verdict[1]]}` : `Diajukan${author ? ` ${author}` : ''}`;
if (kind === 'new_commit') return verdict ? `Commit baru ${verdict[2].slice(0, 8)}; Pandu: ${VERDICT_WORD[verdict[1]]}` : 'Commit baru';
if (kind === 'mention') return r === 'dijawab' ? 'Ditanya; Pandu jawab di MR' : 'Ditanya';
if (kind === 'opened') return verdict ? `Diajukan${author ? ` ${author}` : ''}; ${reviewer}: ${VERDICT_WORD[verdict[1]]}` : `Diajukan${author ? ` ${author}` : ''}`;
if (kind === 'new_commit') return verdict ? `Commit baru ${verdict[2].slice(0, 8)}; ${reviewer}: ${VERDICT_WORD[verdict[1]]}` : 'Commit baru';
if (kind === 'mention') return r === 'dijawab' ? `Ditanya; ${reviewer} jawab di MR` : 'Ditanya';
if (kind === 'closed') return r === 'label dilepas' ? 'Label labuh dilepas' : r === 'MR merged' ? 'Di-merge' : 'MR ditutup';
if (kind === 'recheck') return verdict ? `Rubrik berubah; Pandu: ${VERDICT_WORD[verdict[1]]}` : 'Rubrik berubah, dicek ulang';
if (kind === 'recheck') return verdict ? `Rubrik berubah; ${reviewer}: ${VERDICT_WORD[verdict[1]]}` : 'Rubrik berubah, dicek ulang';
if (kind === 'gas') return r.startsWith('di-merge') ? 'Gas; di-merge' : r.startsWith('uji coba') ? 'Gas (uji coba)' : r.startsWith('dibatalkan') ? 'Gas dibatalkan' : r ? `Gas tidak jalan: ${r.replace(/^(ditolak|failed): /, '')}` : 'Gas';
if (kind === 'close') return r === 'MR ditutup' ? 'MR ditutup' : r.startsWith('dibatalkan') ? 'Tutup MR dibatalkan' : r.startsWith('uji coba') ? 'Tutup MR (uji coba)' : r ? `MR tidak ditutup: ${r.replace(/^(dilewati|failed): /, '')}` : 'Tutup MR';
if (kind === 'decided') return r.startsWith('dibatalkan') ? 'Keputusan dibatalkan' : r === 'diumumkan: tunda' ? 'Ditunda' : r === 'diumumkan: tolak' ? 'Ditolak' : r === 'diumumkan: undo' ? 'Keputusan dibatalkan' : 'Keputusan';
@@ -194,6 +194,7 @@ export function viewAjuan(
viewer: Viewer,
act: ActionState = { taken: false, gasQueuedAt: null, graceSeconds: 15, allowed: [], dry: false },
release: Release | null = null,
reviewer = 'Labuh',
): AjuanView {
const verdict: Checked | null = a.verdict_json ? JSON.parse(a.verdict_json) : null;
const status = boardStatus(a);
@@ -217,7 +218,7 @@ export function viewAjuan(
lane: laneOf(a.target_branch, cfg),
zone,
status,
reason: (rel && releaseReason(rel, act.dry)) ?? decisionReason(a, status, dry, gasAt !== null) ?? verdictReason ?? REASON[status],
reason: (rel && releaseReason(rel, act.dry)) ?? decisionReason(a, status, dry, gasAt !== null) ?? verdictReason ?? reasons(reviewer)[status],
findings: showVerdict ? verdict!.findings.map((f) => ({ kind: f.kind, text: f.text, evidence: f.evidence.map(publicEvidence) })) : [],
postDeploy: showVerdict ? verdict!.postDeploy.map((p) => ({ text: p.text, evidence: p.evidence.map(publicEvidence) })) : [],
overrides: showVerdict ? verdict!.overrides : [],
@@ -226,7 +227,7 @@ export function viewAjuan(
tokens: a.tokens,
since: a.created_at,
dockedAt: (a.status !== 'closed' && a.decision === 'tolak' ? a.decision_at : a.status_at) ?? a.updated_at,
timeline: events.filter((e) => e.done_at || e.kind === 'opened').map((e) => ({ at: e.done_at ?? e.created_at, text: timelineText(e.kind, e.result, a.author) })),
timeline: events.filter((e) => e.done_at || e.kind === 'opened').map((e) => ({ at: e.done_at ?? e.created_at, text: timelineText(e.kind, e.result, a.author, reviewer) })),
mine,
needsYou: viewer.approver ? status === 'ready' || status === 'failed' || rel?.state === 'proposed' : mine && (status === 'fix' || status === 'manual' || status === 'rejected'),
decision: a.decision ? { kind: a.decision, by: a.decision_by ?? '', at: a.decision_at ?? '', note: a.decision_note } : null,

View File

@@ -162,7 +162,7 @@ export class CodexClient {
async initialize() {
await this.request('initialize', {
clientInfo: { name: 'labuh', title: 'Labuh', version: '0.1.0' },
clientInfo: { name: 'labuh', title: 'Labuh', version: '0.1.1' },
capabilities: { experimentalApi: false, requestAttestation: false },
});
this.send({ method: 'initialized' });

View File

@@ -177,7 +177,7 @@ export class Hub {
private newCommitClearsDecision(a: Ajuan) {
if (!a.decision || !this.store.cancelActions(a.id, 'dibatalkan: commit baru')) return;
this.store.update(a.id, { decision: null, decision_by: null, decision_at: null, decision_note: null, deploy_state: a.deploy_state === 'dry' ? null : a.deploy_state });
if (a.decision === 'gas') this.notify(`gas-dropped:${a.id}:${a.decision_at}`, a, `↩️ Gas ${this.label(a)} batal: ada commit baru, Pandu review ulang.`);
if (a.decision === 'gas') this.notify(`gas-dropped:${a.id}:${a.decision_at}`, a, `↩️ Gas ${this.label(a)} batal: ada commit baru, ${this.reviewer.name} review ulang.`);
this.log(`${a.project} !${a.iid}: keputusan ${a.decision} gugur karena commit baru`);
}

View File

@@ -72,7 +72,7 @@ function knowledgeFor(r: Reviewer, projectPath: string): string[] {
return [own, ...shared].filter((p) => existsSync(p));
}
// Pandu gets its own CODEX_HOME so the operator's personal Codex config (MCP servers,
// The reviewer gets its own CODEX_HOME so the operator's personal Codex config (MCP servers,
// instructions, skills) never leaks into reviews. Locally it borrows the operator's login.
function codexHome(): string {
const dir = path.join(HOME, '.codex-home');