Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

929 B
Raw Blame
/** Publish board-derived badge endpoint documents in any Pullboard project [B3,V1]. */
import { badgeCounts } from '../badge.js';
import { writeBadges } from '../badge.js';
import { context } from '../cli.js';
import { withBoardRead } from '../cli.js';
import { Refused } from '../refused.js';

/** Run `pullboard badge` without modifying the board or contacting a badge service. */
export function run(io, { first }) {
  if (first) throw new Refused('USAGE', 'pullboard badge takes no arguments');
  const ctx = context(io);
  const counts = withBoardRead(ctx, badgeCounts);
  const changed = writeBadges(ctx.info.root, counts);
  io.result?.({ ...counts, changed });
  if (!counts.items) io.say('No finished items yet; no badge files were written.');
  else io.say(`${counts.items} items; ${counts.percent}% agent-verified. ${changed.length ? `Wrote ${changed.join(' and ')}.` : 'Badge files are unchanged.'}`);
  return 0;
}