jonah-fleet 1.5.0 → 1.6.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.
@@ -25,6 +25,21 @@ export declare function readDaemonState(repoRoot: string): DaemonState | null;
25
25
  export declare function writeDaemonState(repoRoot: string, state: DaemonState): void;
26
26
  export declare function clearDaemonState(repoRoot: string): void;
27
27
  export declare function isDaemonRunning(repoRoot: string): boolean;
28
+ export interface ReviewablePR {
29
+ number: number;
30
+ headRefName: string;
31
+ title: string;
32
+ }
33
+ /**
34
+ * Filters a list of pull requests to include only reviewable PRs,
35
+ * excluding automated release-please branches and release PR titles.
36
+ */
37
+ export declare function filterReviewablePRs(prs: ReviewablePR[]): ReviewablePR[];
38
+ /**
39
+ * Fast pre-flight check to query open ready PRs in ~100ms with 0 token cost,
40
+ * excluding drafts, automated release-please branches, and release PR titles.
41
+ */
42
+ export declare function getOpenReviewablePRs(repoRoot: string): Promise<ReviewablePR[]>;
28
43
  /**
29
44
  * Fast pre-flight check to query number of open ready PRs in ~100ms with 0 token cost.
30
45
  */
@@ -37,6 +52,24 @@ export declare function startBackgroundDaemon(repoRoot: string, options?: Daemon
37
52
  * Stops a running daemon process.
38
53
  */
39
54
  export declare function stopDaemon(repoRoot: string): Promise<boolean>;
55
+ export interface DrainReviewQueueOptions {
56
+ repoRoot: string;
57
+ state?: DaemonState;
58
+ options?: DaemonOptions;
59
+ isStopping?: () => boolean;
60
+ clearTicker?: () => void;
61
+ getPRs?: (repoRoot: string) => Promise<ReviewablePR[]>;
62
+ runRoutine?: (opts: any) => Promise<{
63
+ success: boolean;
64
+ exitCode?: number;
65
+ }>;
66
+ onAttempted?: (prNumber: number) => void;
67
+ }
68
+ /**
69
+ * Sequentially drains all open reviewable PRs by executing peer-review in isolated worktrees.
70
+ * Tracks attempted PRs per pass to prevent infinite loops on stalled or repeatedly unmerged PRs.
71
+ */
72
+ export declare function drainReviewQueue(drainOptions: DrainReviewQueueOptions): Promise<void>;
40
73
  /**
41
74
  * Runs the multi-cadence polling daemon loop in the current process.
42
75
  */
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../src/lib/daemon.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAQpE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAI3E;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CASvD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAY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,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACvD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2G3F;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6LhG"}
@@ -3,7 +3,7 @@ export interface SyntheticLogOptions {
3
3
  routine: 'autowork' | 'peer-review' | 'optimizer' | 'issues-housekeeping' | 'dependency-check' | 'product-planning' | 'analytics-review';
4
4
  timestamp: string;
5
5
  result: 'SUCCESS' | 'FAILURE';
6
- errorCategory?: 'prompt_unclear' | 'token_limit' | 'data_issue' | 'infeasible_task' | 'merge_conflict' | 'orchestration_collision' | 'telemetry_rabbit_hole' | 'intent_vs_defect';
6
+ errorCategory?: 'prompt_unclear' | 'token_limit' | 'data_issue' | 'infeasible_task' | 'merge_conflict' | 'orchestration_collision' | 'telemetry_rabbit_hole' | 'intent_vs_defect' | 'ambiguous_spec';
7
7
  errorReason?: string;
8
8
  inputTokens?: number;
9
9
  outputTokens?: number;
@@ -13,6 +13,37 @@ export interface SyntheticLogOptions {
13
13
  isGenericPattern?: boolean;
14
14
  suggestedOptimization?: string;
15
15
  }
16
+ export interface BenchmarkIssue {
17
+ id: string;
18
+ title: string;
19
+ body: string;
20
+ labels?: string[];
21
+ expectedAction: 'ASK_QUESTIONS' | 'PROCEED_TO_IMPLEMENT';
22
+ rationale: string;
23
+ origin?: 'synthetic' | 'optimizer_extracted' | 'human_authored';
24
+ sourceLogTimestamp?: string;
25
+ }
26
+ export interface BenchmarkEvaluationResult {
27
+ issueId: string;
28
+ decision: 'ASK_QUESTIONS' | 'PROCEED_TO_IMPLEMENT';
29
+ expectedAction: 'ASK_QUESTIONS' | 'PROCEED_TO_IMPLEMENT';
30
+ isCorrect: boolean;
31
+ confidence: number;
32
+ missingCriteria: string[];
33
+ generatedQuestions: string[];
34
+ rationale: string;
35
+ }
36
+ export interface BenchmarkRunSummary {
37
+ totalEvaluated: number;
38
+ passedCount: number;
39
+ failedCount: number;
40
+ accuracy: number;
41
+ falseComplianceCount: number;
42
+ falseComplianceRate: number;
43
+ falseObstructionCount: number;
44
+ falseObstructionRate: number;
45
+ itemizedResults: BenchmarkEvaluationResult[];
46
+ }
16
47
  export interface ContributionProposal {
17
48
  id: string;
18
49
  scope: 'generic' | 'local';
@@ -69,4 +100,28 @@ export declare function analyzeOptimizerSignals(logs: string[]): OptimizationAna
69
100
  * Simulate consumer repository downstream sync and verify drift & PR generation
70
101
  */
71
102
  export declare function simulateDownstreamSyncWorkflow(options: DownstreamSyncSimulationOptions): DownstreamSyncSimulationResult;
103
+ /**
104
+ * Evaluate whether an issue is ambiguous or ready for immediate autonomous implementation
105
+ */
106
+ export declare function evaluateIssueAmbiguity(issue: BenchmarkIssue): BenchmarkEvaluationResult;
107
+ /**
108
+ * Execute an automated benchmark run over a dataset of candidate issues
109
+ */
110
+ export declare function runAmbiguityBenchmark(dataset: BenchmarkIssue[]): BenchmarkRunSummary;
111
+ /**
112
+ * Extract an ambiguous benchmark fixture from an agent failure log or review ping-pong run
113
+ */
114
+ export declare function extractBenchmarkCaseFromLog(rawLog: string, issueDetails?: {
115
+ title?: string;
116
+ body?: string;
117
+ id?: string;
118
+ }): BenchmarkIssue | null;
119
+ /**
120
+ * Dynamically feed an optimizer-extracted issue into a benchmark dataset
121
+ */
122
+ export declare function feedOptimizerCaseToBenchmark(dataset: BenchmarkIssue[], newCase: BenchmarkIssue): BenchmarkIssue[];
123
+ /**
124
+ * Load the baseline ambiguity benchmark dataset
125
+ */
126
+ export declare function getBaselineAmbiguityBenchmarkDataset(): BenchmarkIssue[];
72
127
  //# sourceMappingURL=evals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evals.d.ts","sourceRoot":"","sources":["../../src/lib/evals.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAKzD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;IACzI,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,yBAAyB,GAAG,uBAAuB,GAAG,kBAAkB,CAAC;IAClL,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACz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AAc,GACtB,cAAc,EAAE,CAQlB;AAED;;GAEG;AACH,wBAAgB,oCAAoC,IAAI,cAAc,EAAE,CA6BvE"}
@@ -47,6 +47,6 @@ export declare const PRESET_CONFIGS: Record<Exclude<PresetName, 'custom'>, {
47
47
  }>;
48
48
  export declare const ROUTINE_TO_WORKFLOW_MAP: Record<keyof FleetManifest['routines'], string[]>;
49
49
  export declare const WORKFLOW_TO_ROUTINE_MAP: Record<string, keyof FleetManifest['routines'] | 'sync-fleet'>;
50
- export declare const FLEET_VERSION = "1.5.0";
50
+ export declare const FLEET_VERSION = "1.6.0";
51
51
  export declare const SCHEMA_URL = "https://raw.githubusercontent.com/juliendurandeu/jonah-fleet/main/schema.json";
52
52
  //# sourceMappingURL=presets.d.ts.map
@@ -19,6 +19,9 @@ export interface RoutineTelemetrySummary {
19
19
  maxIterations?: number;
20
20
  reviewLoops?: number;
21
21
  promptSha?: string;
22
+ ambiguityGateTriggered?: boolean;
23
+ questionsAskedCount?: number;
24
+ needsInfoApplied?: boolean;
22
25
  }
23
26
  export interface WeeklyBudgetStatus {
24
27
  weeklyCeilingTokens: number;
@@ -41,6 +44,9 @@ export interface RoutineMetricBreakdown {
41
44
  bouncedCount: number;
42
45
  avgDurationSeconds: number;
43
46
  avgIterationsUsed: number;
47
+ ambiguityGatesTriggered: number;
48
+ questionsAskedCount: number;
49
+ needsInfoAppliedCount: number;
44
50
  }
45
51
  export interface RepositoryMetricBreakdown {
46
52
  repository: string;
@@ -50,6 +56,12 @@ export interface RepositoryMetricBreakdown {
50
56
  successCount: number;
51
57
  failureCount: number;
52
58
  }
59
+ export interface AmbiguityMetrics {
60
+ totalAmbiguityGatesTriggered: number;
61
+ totalQuestionsAsked: number;
62
+ needsInfoAppliedCount: number;
63
+ estimatedTokensSaved: number;
64
+ }
53
65
  export interface AggregatedTelemetry {
54
66
  timestamp: string;
55
67
  totalRuns: number;
@@ -64,6 +76,7 @@ export interface AggregatedTelemetry {
64
76
  byRoutine: Record<string, RoutineMetricBreakdown>;
65
77
  byRepository: Record<string, RepositoryMetricBreakdown>;
66
78
  failureCategories: Record<string, number>;
79
+ ambiguity: AmbiguityMetrics;
67
80
  events: RoutineTelemetrySummary[];
68
81
  }
69
82
  export declare function parseLogToTelemetry(content: string, options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AAEjE,eAAO,MAAM,0BAA0B,UAAY,CAAC;AAEpD,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,kBAAkB,GAAG,MAAM,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU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B,MAAM,CAsFR"}
@@ -4,6 +4,7 @@ export interface SummaryCardOptions {
4
4
  repoRoot?: string;
5
5
  issue?: string | number;
6
6
  pr?: string | number;
7
+ title?: string;
7
8
  durationMs?: number;
8
9
  }
9
10
  export interface ErrorCardOptions {
@@ -18,6 +19,7 @@ export interface ErrorCardOptions {
18
19
  export interface ParsedRunSummary {
19
20
  routine?: string;
20
21
  target?: string;
22
+ title?: string;
21
23
  decision?: string;
22
24
  result?: string;
23
25
  duration?: string;
@@ -29,6 +31,18 @@ export interface ParsedRunSummary {
29
31
  actions?: string[];
30
32
  logPath?: string;
31
33
  }
34
+ /**
35
+ * Strips ANSI color codes to accurately measure visual string length.
36
+ */
37
+ export declare function stripAnsi(text: string): string;
38
+ /**
39
+ * Wraps text into multiple lines bounded by maxWidth without cropping.
40
+ */
41
+ export declare function wrapText(text: string, maxWidth: number): string[];
42
+ /**
43
+ * Fetches PR or issue title using GitHub CLI with a tight timeout.
44
+ */
45
+ export declare function fetchTargetTitle(repoRoot: string, target: string): string | null;
32
46
  /**
33
47
  * Strips temporary worktree roots and converts absolute worktree paths to clean relative paths.
34
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-card.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-card.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;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AC,KAAK,EAAE,MAAM,EAAE,YAAY,GAAE,MAA4B,GAAG,MAAM,CA6BnG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkB/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkB5D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CA4QrE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAqDjE;AAED;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,KAAK,CAAU;IAEvB,cAEC;IAEM,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAazC;IAEM,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAKtC;IAED,OAAO,CAAC,MAAM;IAeP,IAAI,IAAI,IAAI,CAYlB;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jonah-fleet",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Standalone autonomous agent fleet with Symphony orchestration, claim protocols, and continuous improvement loops",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "dev": "tsup --watch",
14
14
  "lint": "eslint src tests",
15
15
  "type-check": "tsc --noEmit",
16
- "test": "vitest run",
17
- "test:evals": "vitest run tests/evals.test.ts tests/contribute.test.ts tests/sync-workflow.test.ts",
16
+ "test": "vitest run --exclude '**/node_modules/**' --exclude '**/.jonah-fleet/**'",
17
+ "test:evals": "vitest run tests/evals.test.ts tests/contribute.test.ts tests/sync-workflow.test.ts --exclude '**/.jonah-fleet/**'",
18
18
  "test:watch": "vitest",
19
19
  "format": "prettier --write \"**/*.{ts,json,md,yml}\""
20
20
  },
@@ -44,7 +44,7 @@
44
44
  "@types/node": "^26.4.0",
45
45
  "tsup": "^8.3.5",
46
46
  "typescript": "^7.0.2",
47
- "vitest": "^4.1.11"
47
+ "vitest": "^5.0.0"
48
48
  },
49
49
  "overrides": {
50
50
  "esbuild": "^0.28.2"
@@ -0,0 +1,92 @@
1
+ [
2
+ {
3
+ "id": "eval-ambiguous-01",
4
+ "title": "Improve telemetry export speed",
5
+ "body": "The telemetry export is feeling sluggish lately. Please optimize it to make it faster.",
6
+ "labels": ["enhancement"],
7
+ "expectedAction": "ASK_QUESTIONS",
8
+ "rationale": "Lacks baseline metrics, target latency thresholds, profiling data, or specific code bottlenecks.",
9
+ "origin": "synthetic"
10
+ },
11
+ {
12
+ "id": "eval-ambiguous-02",
13
+ "title": "Add role-based permissions",
14
+ "body": "We need role-based permissions in the system so only authorized users can access certain routes.",
15
+ "labels": ["feat"],
16
+ "expectedAction": "ASK_QUESTIONS",
17
+ "rationale": "Does not specify what roles exist, which routes/mutations require auth, or how permissions are stored/checked.",
18
+ "origin": "synthetic"
19
+ },
20
+ {
21
+ "id": "eval-ambiguous-03",
22
+ "title": "Fix the layout on mobile devices",
23
+ "body": "The UI looks broken on phones. Please clean up the styles.",
24
+ "labels": ["bug"],
25
+ "expectedAction": "ASK_QUESTIONS",
26
+ "rationale": "No specific viewport sizes, reproduction steps, screenshots, or target components identified.",
27
+ "origin": "synthetic"
28
+ },
29
+ {
30
+ "id": "eval-ambiguous-04",
31
+ "title": "Refactor database queries",
32
+ "body": "Database queries need to be cleaned up and refactored for better architecture.",
33
+ "labels": ["refactor"],
34
+ "expectedAction": "ASK_QUESTIONS",
35
+ "rationale": "Unbounded scope with no target tables, architectural patterns, or verifiable acceptance criteria.",
36
+ "origin": "synthetic"
37
+ },
38
+ {
39
+ "id": "eval-ambiguous-05",
40
+ "title": "Clean up stale code",
41
+ "body": "There are some old unused functions in the codebase. Let's delete them.",
42
+ "labels": ["chore"],
43
+ "expectedAction": "ASK_QUESTIONS",
44
+ "rationale": "Vague premise without naming files, modules, or defining what criteria determines staleness.",
45
+ "origin": "synthetic"
46
+ },
47
+ {
48
+ "id": "eval-specified-01",
49
+ "title": "Fix CLI flag parsing for --budget in telemetry command",
50
+ "body": "When running `jonah-fleet telemetry --budget 5000000`, the budget is ignored because the option parser expects a number.\n\n## Tasks\n- [ ] Parse `options.budget` string to integer in `src/commands/telemetry.ts`\n- [ ] Fall back to manifest `weeklyTokenBudget` if omitted\n- [ ] Add unit test in `tests/telemetry-cli.test.ts` verifying flag override\n\nVerification: `npm test tests/telemetry-cli.test.ts`",
51
+ "labels": ["bug", "priority/P1"],
52
+ "expectedAction": "PROCEED_TO_IMPLEMENT",
53
+ "rationale": "Carries reproduction path, explicit file locations, task checklist, and test verification command.",
54
+ "origin": "synthetic"
55
+ },
56
+ {
57
+ "id": "eval-specified-02",
58
+ "title": "Add --json output flag to jonah-fleet status command",
59
+ "body": "Support structured machine-readable output for `jonah-fleet status`.\n\n## Tasks\n- [ ] Add `-j, --json` option to `src/index.ts` status command definition\n- [ ] Update `src/commands/status.ts` to output `JSON.stringify(statusReport, null, 2)` when `options.json` is true\n- [ ] Verify unit test passes via `npm test tests/status.test.ts`",
60
+ "labels": ["enhancement", "priority/P2"],
61
+ "expectedAction": "PROCEED_TO_IMPLEMENT",
62
+ "rationale": "Defines explicit CLI interface, component files, output contract, and unit test command.",
63
+ "origin": "synthetic"
64
+ },
65
+ {
66
+ "id": "eval-specified-03",
67
+ "title": "Strict TypeScript compilation failure in src/lib/worktree.ts on Node 22",
68
+ "body": "`tsc --noEmit` fails on `src/lib/worktree.ts:42` with `TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'`.\n\n## Tasks\n- [ ] Add null check for `process.env.GIT_WORK_TREE` before path resolution\n- [ ] Run `npm run type-check` to verify 0 errors",
69
+ "labels": ["bug", "priority/P0"],
70
+ "expectedAction": "PROCEED_TO_IMPLEMENT",
71
+ "rationale": "Exact compiler error code, line number, fix directive, and verification command provided.",
72
+ "origin": "synthetic"
73
+ },
74
+ {
75
+ "id": "eval-specified-04",
76
+ "title": "Add missing grill-me skill validation assertion to tests/installer.test.ts",
77
+ "body": "Ensure `installFleet` verifies `.agents/skills/grill-me/SKILL.md` is installed in standard preset.\n\n## Tasks\n- [ ] Add `expect(fs.existsSync(path.join(tempDir, '.agents/skills/grill-me/SKILL.md'))).toBe(true)` to `tests/installer.test.ts`\n- [ ] Verify test passes with `npm test tests/installer.test.ts`",
78
+ "labels": ["test", "size/S"],
79
+ "expectedAction": "PROCEED_TO_IMPLEMENT",
80
+ "rationale": "Exact code assertion, file path, and verification command specified.",
81
+ "origin": "synthetic"
82
+ },
83
+ {
84
+ "id": "eval-specified-05",
85
+ "title": "Export AmbiguityMetrics interface from src/lib/telemetry.ts",
86
+ "body": "External consumers and tests need direct access to `AmbiguityMetrics`.\n\n## Tasks\n- [ ] Add `export` keyword to `AmbiguityMetrics` interface in `src/lib/telemetry.ts`\n- [ ] Export from `src/index.ts`\n- [ ] Run `npm run type-check` to verify export integrity",
87
+ "labels": ["enhancement", "size/S"],
88
+ "expectedAction": "PROCEED_TO_IMPLEMENT",
89
+ "rationale": "Fully specified type export with exact interface name, target files, and verification steps.",
90
+ "origin": "synthetic"
91
+ }
92
+ ]
@@ -27,8 +27,8 @@ Autowork triggers pass the target issue via environment variables (`TARGET_ISSUE
27
27
 
28
28
  Invariants deliberately upheld from this spec:
29
29
 
30
- - **Single-flight per issue** — at most one run works an issue at a time, enforced by the autowork claim protocol (assign → read-back → earliest-timestamp tiebreak). For **umbrella** issues, single-flight is maintained at the *child-issue* level so slices progress cleanly.
31
- - **Recover dead-run claims** — a crashed run's orphaned claim is released back to the pool rather than starving the issue, both opportunistically during candidate selection and periodically via issues housekeeping.
30
+ - **Single-flight per issue and PR convergence** — at most one run works an issue or pull request at a time, enforced by the autowork claim protocol (assign → read-back → earliest-timestamp tiebreak). For **umbrella** issues, single-flight is maintained at the *child-issue* level so slices progress cleanly.
31
+ - **Recover dead-run claims** — a crashed run's orphaned claim is released back to the pool rather than starving the issue or PR, both opportunistically during candidate selection and periodically via issues housekeeping.
32
32
  - **Reader/writer separation** — the routine that authors a PR never merges it; the Peer Review routine is the sole merge authority for **product** PRs. (Operational log-only PRs are exempt; see Log delivery fallback.)
33
33
  - **Warm-Context Review Synchronization** — Autowork maintains an active warm session during implementation, polling for Peer Review's verdict. When Peer Review bounces a PR to draft with findings, Autowork immediately detects the draft state in-session, applies fixes directly to its warm working tree, and re-marks the PR ready—re-firing Peer Review for Round N+1 without cold-start overhead.
34
34
 
@@ -48,6 +48,16 @@ Single source of truth for both autowork candidate reclamation and housekeeping
48
48
 
49
49
  ---
50
50
 
51
+ ## PR Stale-Claim Definition (Phase 1 Convergence)
52
+
53
+ Single source of truth for Autowork Phase 1 pull request convergence. An assigned pull request or draft PR with unaddressed review comments is a *stale claim* (safe to reclaim and reassign by another runner) only when **all** of these hold:
54
+
55
+ 1. **It carries an autowork claim comment**: The PR thread contains `🔒 Addressing review findings by autowork run …` or `🔒 Addressing review findings by local autowork session …`.
56
+ 2. **The claim is old**: The most recent claim comment's `created_at` is **more than 2 hours** ago. (2 hours instead of 6 hours because PR review convergence is a rapid turnaround loop).
57
+ 3. **No active commits or review activity**: No new commit has been pushed to the PR branch within the last 2 hours.
58
+
59
+ ---
60
+
51
61
  ## Routine Matching & Invocation
52
62
 
53
63
  **Identify the applicable routine at the start of every conversation, before doing any work:**
@@ -98,9 +108,11 @@ The routines invoke specialized engineering skills at key workflow checkpoints:
98
108
  ## Log Delivery Fallback
99
109
 
100
110
  Single source of truth for every routine's Logging section:
101
- 1. **Direct commit to `main` is default**: For operational run logs under `.github/prompts/logs/**`, commit directly to `main` via GitHub API or git push.
102
- 2. **Draft PR fallback**: If direct push fails, commit the log to a dedicated, fresh branch and open a draft PR carrying only the log files.
103
- 3. **Automated landing**: `auto-merge-log-prs.yml` or `issues-housekeeping.md` lands accumulated log PRs. Draft log PRs are never reviewed by Peer Review and do not count toward Autowork's backpressure limits.
111
+ 1. **Direct commit to `main` is default**: For operational run logs under `.github/prompts/logs/**`, commit directly to `main` via GitHub API or git push. Never commit logs to an active feature branch.
112
+ 2. **Mandatory `[skip ci]`**: All log commits MUST include `[skip ci]` in the commit message (e.g. `docs(log): record {routine-name} run {timestamp} [skip ci]`) to prevent unnecessary CI executions or approval blocks.
113
+ 3. **Draft PR fallback**: If direct push fails, commit the log to a dedicated, fresh branch and open a draft PR carrying only the log files.
114
+ 4. **Automated landing**: `auto-merge-log-prs.yml` or `issues-housekeeping.md` lands accumulated log PRs. Draft log PRs are never reviewed by Peer Review and do not count toward Autowork's backpressure limits.
115
+
104
116
 
105
117
  ---
106
118
 
@@ -115,7 +127,9 @@ How token spend, runaway loops, and budget anomalies are detected, triaged, and
115
127
  - **Iteration Ceiling Exhaustion**: >20% of runs in a routine terminate at the `token_limit` / max iteration cap. Trigger: tasks too complex for single-flight execution or unbounded looping. Remediation: enforce vertical slicing / umbrella decomposition, tighten pre-ready self-audits, or refine termination bounds.
116
128
  - **Review Loop Burn**: Pull requests experiencing $\ge 3$ bounce rounds between autowork and peer-review. Trigger: ambiguous reviewer feedback, pedantic non-blocking findings, or brittle test assertions. Remediation: tighten reviewer trust/noise rules, calibrate reviewer severity thresholds, and engage human escalation via ping-pong caps.
117
129
  - **Feedback Loop Stagnation**: A downstream processing routine (e.g. measurement loop, verification, triage) records 0 intake (`filed: 0`) across $\ge 2$ consecutive runs while upstream PRs merge or roadmap/feature issues close in the same window. Trigger: overly broad or qualitative discovery sweeps that falsely claim all items are covered. Remediation: mandate deterministic per-issue matching tables and itemized reconciliation against upstream closed issues/PRs.
118
- 3. **Automated Remediation PRs**: The optimizer automatically drafts targeted PRs—locally for repo-specific rules/configs, or upstream via `npx jonah-fleet contribute` for fleet-wide prompt/workflow improvements.
130
+ - **Passive Order-Taking Anomaly ("Yes-Man Blindspot")**: The Ambiguity Gate trigger rate across intake runs in `autowork` or `triage` is <5% despite elevated PR review bounces ($\ge 2$) or high iteration usage ($\ge 35$), indicating agents are silently guessing requirements and building flawed implementations rather than interrogating underspecified issues. Trigger: agents defaulting to compliance over inquiry. Remediation: tighten Step 12 criteria in `autowork.md` and `triage.md` to force explicit questions on ambiguous terms, and feed problem cases into the automated ambiguity benchmark eval suite.
131
+ - **Speculative Runaway Waste**: An agent run consumed >50k tokens on an underspecified issue with 0 clarifying questions asked, and subsequently failed, bounced, or required post-merge rework. Remediation: tighten ambiguity gate checks and export the failing issue into the automated benchmark eval dataset.
132
+ 3. **Automated Remediation PRs & Benchmark Evals**: The optimizer automatically drafts targeted PRs—locally for repo-specific rules/configs, or upstream via `npx jonah-fleet contribute` for fleet-wide prompt/workflow improvements—and appends failure fixtures to the automated benchmark eval suite.
119
133
 
120
134
  ---
121
135
 
@@ -152,7 +166,8 @@ How the fleet guarantees continuous review throughput, recovers from transient A
152
166
  1. **Failure Trapping & Transparency**: When a peer-review workflow session encounters an execution failure (e.g. LLM API rate limit / quota exhaustion or runner timeout), `trigger-review-routine.yml` traps the failure and posts an informational status notice on the PR. Failures are made immediately visible on the PR timeline rather than silently failing in the background.
153
167
  2. **Periodic Scan Sweep (Watchdog)**: `trigger-review-routine.yml` runs a scheduled 2-hour cron sweep (`cron: '45 */2 * * *'`) in Scan mode. Any open PR in `ready_for_review` state that was orphaned due to a transient API rate limit or missed event trigger is automatically picked up, evaluated, and resolved.
154
168
  3. **Interactive Re-triggering**: Any team member or author can immediately re-dispatch review by commenting `/review`, `/peer-review`, `/retrigger`, or `/re-review` on any open pull request, or manually triggering `trigger-review-routine.yml` via `workflow_dispatch`.
155
- 4. **Autowork Phase 1 Watchdog**: During Phase 1 convergence, Autowork actively identifies open ready PRs that have received no review feedback for $>2$ hours, re-triggering review via draft toggle or `/review` comment before picking up new work.
169
+ 4. **Autowork Phase 1 Watchdog**: During Phase 1 convergence, Autowork actively identifies open ready PRs that have received no review feedback for $>2$ hours, re-triggering review via draft toggle or `/review` comment before picking up new work. Review re-triggering is strictly conditioned on all CI checks having passed (`conclusion: SUCCESS`, `mergeStateStatus: CLEAN`) and is strictly prohibited if checks are in-progress or awaiting approval (`ACTION_REQUIRED`).
170
+
156
171
 
157
172
  ---
158
173
 
@@ -194,7 +209,8 @@ How agent routines are partitioned between cloud GitHub Actions (24/7 cloud runn
194
209
  2. **PR Priority Mirroring**: When Autowork opens a PR, it automatically mirrors the parent issue's priority labels (`priority/P0`..`P3`) onto the pull request so downstream review workflows can filter triggers without extra API overhead.
195
210
  3. **Workspace Isolation via Git Worktrees**: Local agents execute inside ephemeral worktrees (`.jonah-fleet/worktrees/<routine>-<issue>`) off `origin/main`, ensuring active editor sessions, uncommitted changes, and local branches are never modified or disturbed.
196
211
  4. **Local Claim Protocol**:
197
- - Local agent claims post: `🔒 Claimed by local autowork session (host: <hostname>) <timestamp>`.
212
+ - Local agent issue claims post: `🔒 Claimed by local autowork session (host: <hostname>) <timestamp>`.
213
+ - Local agent PR convergence claims post: `🔒 Addressing review findings by local autowork session (host: <hostname>) <timestamp>`.
198
214
  - Local processes trap `SIGINT`/`SIGTERM` to unassign claims and remove worktrees cleanly on exit.
199
- - Standard 6-hour stale-claim rule safely reclaims orphaned local claims if a machine powers down unexpectedly.
215
+ - Standard stale-claim rules (6h for issues, 2h for PRs) safely reclaim orphaned local claims if a machine powers down unexpectedly.
200
216
 
@@ -40,4 +40,16 @@ After completing (SUCCESS or FAILURE), write a log file to `.github/prompts/logs
40
40
  - Full execution trace with tool calls
41
41
  - If FAILURE: root cause, category, and suggested fix
42
42
 
43
- **Important**: Commit the log file directly to `main` and push — explicitly permitted for files under `.github/prompts/logs/**`. Follow the Log delivery fallback in `ORCHESTRATION.md` if direct push fails.
43
+ **Log Delivery Protocol & Invariants**:
44
+ - **Negative Rule**: NEVER commit or push run logs to a feature branch or open PR branch. Doing so emits a `pull_request: synchronize` event under bot credentials, triggering GitHub Actions workflow approval gates (`action_required`) that stall CI.
45
+ - **Mandatory `[skip ci]`**: Always append `[skip ci]` to any log commit message (e.g. `docs(log): record {routine-name} run {timestamp} [skip ci]`).
46
+ - **Direct Push to `main`**: Commit the log file directly to `main` and push — explicitly permitted for files under `.github/prompts/logs/**`:
47
+ ```bash
48
+ git checkout main
49
+ git pull origin main
50
+ git add .github/prompts/logs/{routine-name}/{timestamp}.md
51
+ git commit -m "docs(log): record {routine-name} run {timestamp} [skip ci]"
52
+ git push origin main
53
+ ```
54
+ Follow the Log delivery fallback in `ORCHESTRATION.md` if direct push fails.
55
+
@@ -10,12 +10,12 @@ This routine runs in two modes (Step 0): **Targeted** (a fire named an issue) an
10
10
 
11
11
  In **Scan mode**, the run is SUCCESS only if ALL of these are true:
12
12
 
13
- - [ ] Checked all open PRs for unresolved or unaddressed review comments and pushed fixes for any that are actionable
13
+ - [ ] Checked all open PRs for unresolved or unaddressed review comments; if actionable findings were found, claimed the PR before writing fixes (see the Phase 1 PR Claim protocol), confirmed sole ownership, and pushed fixes
14
14
  - [ ] Closed any issues whose corresponding PRs are all merged
15
15
  - [ ] If no open PRs needed attention: picked the highest-priority *unclaimed* issue (P1 > P2 > P3); if it turned out to be already-done (step 10 — all its PRs merged), closed it and moved on to the next-priority candidate rather than stopping there; otherwise **claimed it before starting work** (see the Claim protocol), and either implemented a fix and **opened a draft pull request on GitHub via `gh pr create --draft`** or left a comment explaining why autonomous completion is blocked and released the claim, then repeated candidate selection for the next-priority issue per step 12's infeasible-continuation cap
16
16
  - [ ] If an issue was implemented: successfully opened a draft pull request on GitHub via `gh pr create --draft` referencing the issue (`Closes #N`) in its body, verified the PR exists (a returned PR URL is mandatory), updated the issue's `## Tasks` checkboxes (`- [ ]` → `- [x]`) for every deliverable the PR ships, marked the PR ready for review (`gh pr ready <PR>`), and executed step 15's in-session review wait (never stop at merely pushing the branch or editing the issue; a pushed branch with no open PR on GitHub is a fatal invariant violation and must be logged as FAILURE)
17
17
  - [ ] Did not open a new PR while any existing PR by this routine has unaddressed review comments (a finding you have replied to with a rationale counts as *addressed*, even if the thread is still technically unresolved) — **Targeted mode is exempt**
18
- - [ ] Never worked an issue that was already actively claimed (assigned) by another live run, and confirmed sole ownership of the claim before writing any code — reclaiming a *stale* claim (a dead run's orphaned assignment, per step 10a) is permitted
18
+ - [ ] Never worked an issue or PR that was already actively claimed (assigned) by another live run, and confirmed sole ownership of the claim before writing any code — reclaiming a *stale* claim (a dead run's orphaned assignment, per step 10a / `ORCHESTRATION.md`) is permitted
19
19
  - [ ] If work was an umbrella slice/batch (step 12a): the child issue created for it carries the required Summary/Tasks/Why/Complexity template and exactly one type/size/priority label, and the `🧭 Decomposition plan` markers were left `🔍 in review` until the child PR merges
20
20
 
21
21
  If any criterion cannot be met, stop immediately and log FAILURE with the reason.
@@ -26,7 +26,7 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
26
26
  - **Max scope**: at most one issue may be **implemented** per run. Do not pick up a second, unrelated issue to implement after finishing (or abandoning mid-implementation) the first. (Umbrella slice batching up to 3 slices per step 12a is allowed).
27
27
  - **No mid-run context switch**: priorities are evaluated ONCE, at the start of the run (Phase 1 → Phase 2). Finish the issue you started; the next run's Phase 1 will pick up newly surfaced work.
28
28
  - **No speculative work**: only take actions directly required by the Definition of Done. Do not refactor adjacent code, open bonus issues, or add improvements not requested by the issue.
29
- - **Single-flight per issue**: multiple autowork runs can execute concurrently. An issue is a shared resource — never begin implementing one without first claiming it (see the Claim protocol in Phase 2).
29
+ - **Single-flight per issue & PR**: multiple autowork runs can execute concurrently. Both issues and pull requests are shared resources — never begin implementing an issue without first claiming it (see Claim protocol in Phase 2), and never begin addressing findings on an open PR without first claiming it (see PR Claim protocol in Phase 1).
30
30
  - **Language Requirement**: All GitHub issue titles, descriptions, task checklists, and comments MUST be written in **English**.
31
31
  - **Session link footer**: sign every GitHub post (issue comments, PR comments, PR descriptions) with the Antigravity run footer (`_Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})_`). Inline review-thread line comments are exempt.
32
32
 
@@ -34,6 +34,7 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
34
34
 
35
35
  - Do not address a subset of review findings and stop — handle ALL findings in one run before stopping or marking the PR as ready.
36
36
  - Do not mark a PR as ready for review without first re-fetching review threads *and PR-level comments* and confirming every finding matching step 2's trust & noise rules has been handled.
37
+ - Do not start addressing review findings on a PR before claiming it (both PR assignment AND claim comment).
37
38
  - Do not strand a PR in draft because you disagree with a finding — reply with your rationale, mark the PR ready, and let peer-review re-evaluate.
38
39
  - Do not push a branch and stop without running `gh pr create --draft` to actually open the pull request — a pushed branch with no open PR cannot be picked up by the peer-review routine.
39
40
  - Do not open a new PR if you already have 3+ open PRs — converge before creating more (**Scan mode only**; Targeted mode is exempt).
@@ -66,7 +67,15 @@ b. **Eligible → claim, then implement.** Call `get_me` once to learn your own
66
67
  ### Phase 1: Converge on open work (Scan mode; skipped in Targeted mode)
67
68
 
68
69
  1. List all open PRs authored by this routine.
69
- 2. For each open PR, fetch ALL review threads and PR-level comments. Filter for actionable findings matching trust & noise rules (author login matching `get_me`, non-noise). Address every single one in this run — push fixes for actionable findings, reply to clarifying questions, and comment on deferred items.
70
+ 1a. **PR Claim Protocol (Single-Flight PR Convergence)**:
71
+ - For each open PR needing attention (bounced to draft with actionable findings, or open with unaddressed review comments):
72
+ - **Check eligibility**: re-read candidate PR (`gh pr view <PR> --json assignees,comments`). Skip PRs currently assigned to another live runner or carrying an active claim comment posted within the last 2 hours (unless stale claim per `ORCHESTRATION.md`).
73
+ - Call `get_me` once to learn your own login if not already known.
74
+ - **Claim atomically**: assign yourself to the PR (`gh pr edit <PR> --add-assignee <login>`) AND post a claim comment on the PR:
75
+ - In **Cloud Actions**: `🔒 Addressing review findings by autowork run {run_url} {timestamp}`
76
+ - In **Local Agent**: `🔒 Addressing review findings by local autowork session (host: {hostname}) {timestamp}`
77
+ - **Confirm sole ownership**: fetch comments on the PR. Earliest `created_at` among competing claim comments in this round wins. If you lost the race, unassign yourself (`gh pr edit <PR> --remove-assignee <login>`), annotate your comment, and evaluate the next PR (or proceed to Phase 2 if none left).
78
+ 2. For the claimed PR, fetch ALL review threads and PR-level comments. Filter for actionable findings matching trust & noise rules (author login matching `get_me`, non-noise). Address every single one in this run — push fixes for actionable findings, reply to clarifying questions, and comment on deferred items.
70
79
  3. For PRs where you have addressed all findings:
71
80
  3a. **Pre-ready self-audit** (run before marking ready):
72
81
  - **Automated review passes**: run `/code-review` (evaluating along Standards in `AGENTS.md` and Spec in the issue's `## Tasks`) and security review over the diff. Fix what they flag.
@@ -75,10 +84,14 @@ b. **Eligible → claim, then implement.** Call `get_me` once to learn your own
75
84
  - **Documentation accuracy**: update relevant docs (`ARCHITECTURE.md`, `CODEMAP.md`, `API.md`, `CHANGELOG.md` if maintained by repo).
76
85
  - **Build & type-check verification**: run the repository's test, type-check, and lint commands from `AGENTS.md` (e.g. `npm test`, `npm run type-check`, `npm run lint`, `pytest`, `cargo test`). Confirm zero errors and zero test failures.
77
86
  - **Clean-merge gate**: verify `git merge-tree origin/main HEAD` reports no conflicts.
87
+ - **Release claim on ready**: mark the PR ready (`gh pr ready <PR>`) and unassign yourself (`gh pr edit <PR> --remove-assignee <login>`) so Peer Review can evaluate without holding stale agent reservation locks.
78
88
  Only mark the PR ready after passing every check above.
79
89
  3b. **Ping-pong cap**: If this same PR has bounced between draft and ready 3 or more times over the same substantive finding, stop re-marking it ready. Post a comment summarizing the disagreement for human resolution and leave the PR in draft.
80
90
  3c. **Orphaned Ready PR Recovery**: If an open PR authored by this routine is `ready_for_review`, has passing CI, no unaddressed review comments, and has received no review activity for over 2 hours (e.g. because peer review crashed or encountered quota limits), kickstart the review routine by posting `/review` comment or toggling draft and ready (`gh pr ready <PR> --undo && gh pr ready <PR>`).
91
+ - **Passing CI Verification Gate**: Verify via `gh pr view <PR> --json statusCheckRollup,mergeStateStatus` that all required and existing checks have completed with `conclusion: "SUCCESS"` and `mergeStateStatus` is `CLEAN` (neither `UNSTABLE`, `BLOCKED`, nor `DIRTY`).
92
+ - **Unapproved/Pending Workflow Invariant**: NEVER post `/review` or toggle draft state if checks are in-progress, failing, or awaiting approval (`conclusion: "ACTION_REQUIRED"`). Doing so creates an infinite comment storm while workflows remain paused awaiting human permissions.
81
93
  4. Check open issues that have linked merged PRs — close them.
94
+
82
95
  5. If any PR was updated in this phase, STOP — run is SUCCESS.
83
96
 
84
97
  ### Phase 2: New work (only if Phase 1 had nothing to do)
@@ -126,13 +139,14 @@ b. **Eligible → claim, then implement.** Call `get_me` once to learn your own
126
139
  - Open draft PR via `gh pr create --draft --head <branch> --base main --title "<title>" --body "<body referencing Closes #N>"`.
127
140
  - **PR Priority Label Mirroring**: If the issue carried a priority label (`priority/P0`, `priority/P1`, `priority/P2`, `priority/P3`), add the identical priority label to the PR (`gh pr edit <PR> --add-label "<label>"` or via `--label` in create) so downstream review workflows can filter triggers immediately.
128
141
  - Verify PR URL returned. Update issue `## Tasks` checkboxes.
142
+ - **Warm Context Assignment**: Assign yourself to the newly opened PR (`gh pr edit <PR> --add-assignee <login>`) to hold the reservation across Step 15's in-session review wait so parallel Scan routines recognise the PR as actively held by a live session.
129
143
  - Mark PR ready (`gh pr ready <PR>`).
130
144
  14. If run aborts before opening PR, release claim (unassign).
131
145
  15. **In-Session Peer Review Wait & Immediate Convergence (Warm Context):**
132
146
  - Poll PR status for up to 10–12 minutes.
133
- - If merged: record terminal SUCCESS and exit cleanly.
147
+ - If merged: unassign yourself, record terminal SUCCESS and exit cleanly.
134
148
  - If bounced to draft with findings: fetch review comments, apply fixes in active worktree, run tests, push fix commit, re-mark ready (`gh pr ready <PR>`), and complete run.
135
- - If timeout (>12m): exit cleanly; scheduled cron will handle subsequent rounds.
149
+ - If timeout (>12m): unassign yourself from the PR (`gh pr edit <PR> --remove-assignee <login>`) and exit cleanly; scheduled cron will handle subsequent rounds.
136
150
 
137
151
  ## Logging
138
152
 
@@ -142,4 +156,16 @@ After completing (SUCCESS or FAILURE), write a log file to `.github/prompts/logs
142
156
  - Full execution trace with tool calls
143
157
  - If FAILURE: root cause, category, and suggested fix
144
158
 
145
- **Important**: Commit the log file directly to `main` and push — explicitly permitted for files under `.github/prompts/logs/**`. Follow the Log delivery fallback in `ORCHESTRATION.md` if direct push fails.
159
+ **Log Delivery Protocol & Invariants**:
160
+ - **Negative Rule**: NEVER commit or push run logs to a feature branch or open PR branch. Doing so emits a `pull_request: synchronize` event under bot credentials, triggering GitHub Actions workflow approval gates (`action_required`) that stall CI.
161
+ - **Mandatory `[skip ci]`**: Always append `[skip ci]` to any log commit message.
162
+ - **Direct Push to `main`**: Commit the log file directly to `main` and push — explicitly permitted for files under `.github/prompts/logs/**`:
163
+ ```bash
164
+ git checkout main
165
+ git pull origin main
166
+ git add .github/prompts/logs/autowork/{timestamp}.md
167
+ git commit -m "docs(log): record autowork run {timestamp} [skip ci]"
168
+ git push origin main
169
+ ```
170
+ Follow the Log delivery fallback in `ORCHESTRATION.md` if direct push fails.
171
+
@@ -59,6 +59,8 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
59
59
  - **Iteration Ceiling Exhaustion**: >20% of runs in a routine terminate at the `token_limit` / max iteration cap.
60
60
  - **Review Loop Burn**: Pull requests experiencing >= 3 bounce rounds between autowork and peer-review over unresolved or recurring findings.
61
61
  - **Feedback Loop Stagnation**: A downstream processing routine (e.g. impact measurement, verification, or triage) records 0 intake (`filed: 0` or 0 new items processed) across $\ge 2$ consecutive runs while upstream PRs merge or roadmap/feature issues close in the same window. Flags that discovery sweeps have stalled or become overly coarse.
62
+ - **Passive Order-Taking Anomaly ("Yes-Man Blindspot")**: The Ambiguity Gate trigger rate across intake runs in `autowork` or `triage` is <5% despite elevated PR review bounces ($\ge 2$) or high iteration usage ($\ge 35$), indicating agents are silently guessing requirements and building flawed implementations rather than interrogating underspecified issues.
63
+ - **Speculative Runaway Waste**: An agent run consumed >50k tokens on an underspecified issue with 0 clarifying questions asked, and subsequently failed, bounced, or required post-merge rework.
62
64
  6. **Analyze resolved bugs & review comments**: Examine closed bug issues, merged bug-fix PRs, and review feedback for missing checks in authoring (`autowork.md`) or review (`peer-review.md`).
63
65
 
64
66
  ### 2. Formulate preventative improvements
@@ -69,6 +71,7 @@ Translate findings into concrete preventative improvements and remediation trigg
69
71
  - **Iteration Ceiling & Self-Audit Tuning**: For Iteration Ceiling Exhaustion, adjust max iteration bounds or tighten pre-ready self-audits in `autowork.md` to catch defects before review cycles start.
70
72
  - **Ping-Pong Convergence**: For Review Loop Burn, tighten reviewer trust & noise filtering, enforce clean-merge gates, and apply ping-pong caps to prevent endless bounce cycles.
71
73
  - **Loop Discovery Mechanical Audits**: For Feedback Loop Stagnation, tighten discovery sweeps by mandating deterministic per-issue matching tables and itemized reconciliation against upstream closed issues/PRs rather than allowing un-itemized generic summary assertions.
74
+ - **Ambiguity Gate & Benchmark Eval Feeding**: For Passive Order-Taking and Speculative Runaway Waste, tighten Step 12 criteria in `autowork.md` and `triage.md` to mandate clarifying questions, and automatically extract the problem issue into a `BenchmarkIssue` test case to feed the automated ambiguity benchmark eval suite (`tests/evals.test.ts`), ensuring future agent prompts are continuously tested against real failure cases.
72
75
  - **Verification & Invariant Tests**: Add automated test cases in `tests/` verifying prompt invariant preservation and schema conformity.
73
76
 
74
77
  ### 3. Open Fix PR (Local or Upstream Bridge)