simiancraft/simiancraft-skills / skills/burn-down-github-issues
burn-down-github-issues
UnverifiedRun an unattended burndown of a GitHub issue backlog as cards on a per-operator GitHub Projects board whose lanes are an explicit state machine: appraise and size the inbox, carve what is over the ceiling, fix the ready ones in parallel git worktrees, prove each fix on a draft pull request, have an isolated second-engine reviewer judge it, land one branch at a time with freshness checks, and dead-letter per phase whatever a machine cannot finish. Use when the task is "work the backlog unattended", "triage and fix recent issues", "run the issue loop", "burn down issues", or "where is issue N on the board". Requires a per-repository burn-down-github-issues.config.ts at the target repo's root (the loop refuses to start without it), the prove-work-on-github skill, the codex and claude CLIs for the default seats, and a gh token with the project scope for the board. Skip for one-off fixes to a known issue you are already working interactively, and for backlogs whose issues are mostly product decisions rather than code.
lib/simulate.test.ts
View on GitHubimport { describe, expect, it } from 'bun:test';
import { LANES } from './lanes.ts';
import { MACHINE, transitions, walk } from './machine.ts';
import { atoms, fire, laneKey, laneState, Leak, settle, successors } from './simulate.ts';
/**
* Lane sequences the real driver wrote to its logs, per issue, from real runs; issue numbers are
* renumbered. They were recorded while one worker turn both coded and proved, so the driver logged
* Coding or Sent back and then Ready for review; D2 is written in where the prover's own turn now sits.
*/
const RECORDED: Array<{ run: string; issue: number; lanes: string }> = [
{ run: 'stage 1, one issue', issue: 101, lanes: 'D1 D2 E1 E2 F1 F3 F4 F5 T1' },
{ run: 'stage 2, loop', issue: 102, lanes: 'D1 D2 E1 E2 F1 F3 F4 F5 T1' },
{ run: 'stage 2, fix.ts, boundary park', issue: 103, lanes: 'A1 D1 D2 E1 E2 F1 H3' },
{ run: 'stage 3, boundary park', issue: 104, lanes: 'D1 D2 E1 E2 F1 H3' },
{ run: 'stage 3, base moved into the work', issue: 105, lanes: 'D1 D2 E1 E2 F1 F2 E1 E2 F1 F3 F4 F5 T1' },
{ run: 'stage 3, appraised then worked', issue: 106, lanes: 'A2 B1 D1 D2 E1 E2 F1 F3 F4 F5 T1' },
{ run: 'redrive from the review dead letters', issue: 107, lanes: 'Q4 D4 D2 E1 E2 F1 F2 E1 E2 F1 F3 F4 F5 T1' },
{ run: 'redrive from parked, base moved', issue: 104, lanes: 'H3 F2 D4 D2 E1 E2 F1 F3 F4 F5 T1' },
];
describe('the machine leaks no card', () => {
it('settles every transition under the facts that enable it', () => {
const leaks: string[] = [];
for (const { from, event, transition } of transitions()) {
const enabling = new Set(atoms(transition.guard));
try {
settle(transition.target, enabling);
} catch (error) {
if (error instanceof Leak) leaks.push(`${from} on ${event}: ${error.message}`);
else throw error;
}
}
expect(leaks).toEqual([]);
});
it('rests every card in a lane or the final state, never in a compound or transient state', () => {
const lanes = new Set(LANES.map((l) => l.state));
const strays: string[] = [];
for (const { from, event, transition } of transitions()) {
const rest = settle(transition.target, new Set(atoms(transition.guard))).state;
if (!lanes.has(rest) && rest !== 'ticket.offBoard' && !rest.startsWith('line.')) strays.push(`${from} on ${event} rests in ${rest}`);
}
expect(strays).toEqual([]);
});
it('has no orphan lane: every lane is some lane\'s successor, or a reconcile placement', () => {
const reached = new Set<string>();
for (const lane of LANES) for (const next of successors(lane.state).keys()) reached.add(next);
const orphans = LANES.filter((l) => !reached.has(l.state)).map((l) => l.key);
expect(orphans).toEqual([]);
});
});
describe('every event, in every lane, under every combination of facts', () => {
const NODES = new Map(walk(MACHINE));
// Facts a transient state reads while a target settles; tried all false and all true.
const settling = [...NODES.values()].flatMap((node) => (node.always ?? []).flatMap((t) => atoms(t.guard)));
/** The events a lane answers, itself or through an ancestor, with every fact their guards read. */
const eventsOf = (state: string) => {
const events = new Map<string, Set<string>>();
const parts = state.split('.');
for (let depth = parts.length; depth >= 1; depth--) {
for (const [event, raw] of Object.entries(NODES.get(parts.slice(0, depth).join('.'))?.on ?? {})) {
const names = events.get(event) ?? new Set<string>();
for (const t of Array.isArray(raw) ? raw : [raw]) for (const name of atoms(t.guard)) names.add(name);
events.set(event, names);
}
}
return events;
};
const valuations = (names: string[]) => Array.from({ length: 1 << names.length }, (_, mask) => names.filter((_, i) => mask & (1 << i)));
it('never leaks a card', () => {
const leaks: string[] = [];
let fired = 0;
for (const lane of LANES) {
for (const [event, names] of eventsOf(lane.state)) {
for (const facts of valuations([...names])) {
for (const extra of [[], settling]) {
fired += 1;
try {
fire(lane.state, event, new Set([...facts, ...extra]));
} catch (error) {
if (!(error instanceof Leak)) throw error;
leaks.push(`${lane.key} on ${event} [${facts.join(', ')}]: ${error.message}`);
}
}
}
}
}
expect(leaks).toEqual([]);
expect(fired).toBeGreaterThan(2000);
});
it('never drops what a machine reports: a result or a failure always moves the card or rests it on purpose', () => {
// A dispatch may be refused (the line is paused) and the card waits where it is. A report
// may not: an agent's verdict, a gate's result, and a failure each have a last branch with no
// guard, so an answer nobody anticipated is settled as a failure instead of stranding the card.
const REPORTS = ['APPRAISED', 'CONFIRMED', 'KNIFE_VERDICT', 'CUT_DISPUTED', 'REVISITED', 'WORKER_VERDICT', 'REVIEWED', 'CAUGHT_UP', 'CHECKS', 'SMOKE', 'BASE_MOVED_WHILE_WAITING', 'TRIAGED', 'AGENT_FAILED'];
const dropped: string[] = [];
for (const lane of LANES) {
for (const [event, names] of eventsOf(lane.state)) {
if (!REPORTS.includes(event)) continue;
for (const facts of valuations([...names])) {
if (fire(lane.state, event, new Set(facts)) === null) dropped.push(`${lane.key} drops ${event} under [${facts.join(', ')}]`);
}
}
}
expect(dropped).toEqual([]);
});
});
describe('the landing is single file and checks upstream', () => {
const predecessors = (key: string) =>
LANES.filter((l) => l.key !== key && successors(l.state, { ownEventsOnly: true }).has(laneState(key)))
.map((l) => l.key)
.sort();
it('reaches Merging only from Checks pending or Smoke', () => {
expect(predecessors('F5')).toEqual(['F3', 'F4']);
});
it('reaches Checks pending only from Approved or Catching up', () => {
expect(predecessors('F3')).toEqual(['F1', 'F2']);
});
it('starts a review only from Ready for review, and only on a lane that holds the base', () => {
expect(predecessors('E2')).toEqual(['E1']);
expect(laneKey(fire(laneState('E1'), 'REVIEWER_DISPATCHED', new Set(['behindBase']))?.state ?? '')).toBe('F2');
expect(laneKey(fire(laneState('E1'), 'REVIEWER_DISPATCHED', new Set())?.state ?? '')).toBe('E2');
});
it('never takes an approved card to the merge while it is behind the base', () => {
expect(laneKey(fire(laneState('F1'), 'FRONT_OF_QUEUE', new Set(['behindBase']))?.state ?? '')).toBe('F2');
});
});
describe('the driver only makes moves the machine allows', () => {
it('never takes a card from Coding or Sent back to review without a proving turn between', () => {
for (const from of ['D1', 'D4']) expect(successors(laneState(from), { ownEventsOnly: true }).has(laneState('E1'))).toBe(false);
});
for (const { run, issue, lanes } of RECORDED) {
it(`#${issue}, ${run}: ${lanes}`, () => {
const keys = lanes.split(' ');
const illegal: string[] = [];
for (let i = 0; i + 1 < keys.length; i++) {
const next = successors(laneState(keys[i]), { ownEventsOnly: true });
if (!next.has(laneState(keys[i + 1]))) illegal.push(`${keys[i]} -> ${keys[i + 1]}`);
}
expect(illegal).toEqual([]);
});
}
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |