@fermindi/pwn-cli 0.9.11 → 0.9.13
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.
- package/cli/backlog.js +21 -2
- package/package.json +1 -1
- package/src/services/batch-runner.js +5 -5
package/cli/backlog.js
CHANGED
|
@@ -30,6 +30,20 @@ export default async function backlogCommand(args = []) {
|
|
|
30
30
|
stories = stories.filter(s => re.test(s.id) || re.test(s.title));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// Parse --status
|
|
34
|
+
const statusIdx = args.findIndex(a => a === '--status');
|
|
35
|
+
const status = statusIdx !== -1 ? args[statusIdx + 1]?.toLowerCase() : null;
|
|
36
|
+
if (status) {
|
|
37
|
+
if (status === 'done' || status === 'passed') {
|
|
38
|
+
stories = stories.filter(s => s.passes);
|
|
39
|
+
} else if (status === 'pending' || status === 'todo') {
|
|
40
|
+
stories = stories.filter(s => !s.passes);
|
|
41
|
+
} else if (status === 'failed') {
|
|
42
|
+
const failedIds = new Set(taskFiles.filter(t => t.status === 'failed').map(t => t.id));
|
|
43
|
+
stories = stories.filter(s => failedIds.has(s.id));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
// Read project name from prd.json
|
|
34
48
|
let project = 'project';
|
|
35
49
|
const prdPath = join(cwd, '.ai', 'tasks', 'prd.json');
|
|
@@ -41,7 +55,8 @@ export default async function backlogCommand(args = []) {
|
|
|
41
55
|
}
|
|
42
56
|
|
|
43
57
|
const noInteractive = args.includes('--no-interactive') || !process.stdout.isTTY;
|
|
44
|
-
const
|
|
58
|
+
const filters = [filter, status].filter(Boolean);
|
|
59
|
+
const label = filters.length > 0 ? `${project} (${filters.join(', ')})` : project;
|
|
45
60
|
|
|
46
61
|
if (noInteractive) {
|
|
47
62
|
printPlain({ project: label, stories, taskFiles });
|
|
@@ -55,11 +70,15 @@ function showHelp() {
|
|
|
55
70
|
console.log('Usage: pwn backlog [options]\n');
|
|
56
71
|
console.log('Options:');
|
|
57
72
|
console.log(' --filter <pattern> Filter stories by ID or title (regex, case-insensitive)');
|
|
73
|
+
console.log(' --status <status> Filter by status: done, pending, failed');
|
|
58
74
|
console.log(' --no-interactive Plain text output (for CI/piping)');
|
|
59
75
|
console.log(' --help, -h Show this help\n');
|
|
60
76
|
console.log('Examples:');
|
|
61
77
|
console.log(' pwn backlog --filter SEC # Only SEC-* stories');
|
|
62
|
-
console.log(' pwn backlog --filter "API|AUTH" # Stories matching API or AUTH
|
|
78
|
+
console.log(' pwn backlog --filter "API|AUTH" # Stories matching API or AUTH');
|
|
79
|
+
console.log(' pwn backlog --status pending # Only incomplete stories');
|
|
80
|
+
console.log(' pwn backlog --status failed # Only failed stories');
|
|
81
|
+
console.log(' pwn backlog --filter DIV --status pending # Pending DIV-* stories\n');
|
|
63
82
|
console.log('Keybindings (list view):');
|
|
64
83
|
console.log(' ↑/k Move up');
|
|
65
84
|
console.log(' ↓/j Move down');
|
package/package.json
CHANGED
|
@@ -47,9 +47,9 @@ const MIN_TIMEOUT_MS = 300_000; // 5 minutes minimum (claude init ~30-40s +
|
|
|
47
47
|
// Complexity → timeout mapping (based on real-world execution data)
|
|
48
48
|
// AI is bad at estimating seconds but decent at classifying complexity
|
|
49
49
|
const COMPLEXITY_TIMEOUT = {
|
|
50
|
-
low: { seconds:
|
|
51
|
-
medium: { seconds:
|
|
52
|
-
high: { seconds:
|
|
50
|
+
low: { seconds: 420, label: '7m' }, // config change, small fix
|
|
51
|
+
medium: { seconds: 780, label: '13m' }, // new function, 1-3 files
|
|
52
|
+
high: { seconds: 1200, label: '20m' }, // new module, multi-file refactor
|
|
53
53
|
};
|
|
54
54
|
const PLAN_TIMEOUT_MS = 120_000; // 2 minutes for planning phase (claude init ~30s)
|
|
55
55
|
const DEFAULT_RATE_LIMIT_WAIT = 1800; // 30 minutes (seconds)
|
|
@@ -234,7 +234,7 @@ async function planTask(task, batchWorktreePath, replanContext = null) {
|
|
|
234
234
|
|
|
235
235
|
function computeTimeout(estimatedSeconds) {
|
|
236
236
|
if (!estimatedSeconds || estimatedSeconds <= 0) return DEFAULT_TIMEOUT_MS;
|
|
237
|
-
return Math.max(Math.ceil(estimatedSeconds * 1.
|
|
237
|
+
return Math.max(Math.ceil(estimatedSeconds * 1.30) * 1000, MIN_TIMEOUT_MS);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/**
|
|
@@ -450,7 +450,7 @@ export async function runBatch(options = {}, cwd = process.cwd()) {
|
|
|
450
450
|
const complexity = planResult.complexity || 'medium';
|
|
451
451
|
const tier = COMPLEXITY_TIMEOUT[complexity] || COMPLEXITY_TIMEOUT.medium;
|
|
452
452
|
const estimatedSeconds = tier.seconds;
|
|
453
|
-
const timeoutSeconds = Math.ceil(estimatedSeconds * 1.
|
|
453
|
+
const timeoutSeconds = Math.ceil(estimatedSeconds * 1.30);
|
|
454
454
|
taskTimeoutMs = timeoutSeconds * 1000;
|
|
455
455
|
|
|
456
456
|
const recommendedModel = planResult.recommended_model || 'sonnet';
|