Module: Carson

Defined in:
lib/carson/branch.rb,
lib/carson.rb,
lib/carson/cli.rb,
lib/carson/config.rb,
lib/carson/ledger.rb,
lib/carson/parcel.rb,
lib/carson/courier.rb,
lib/carson/runtime.rb,
lib/carson/runtime.rb,
lib/carson/version.rb,
lib/carson/waybill.rb,
lib/carson/delivery.rb,
lib/carson/revision.rb,
lib/carson/worktree.rb,
lib/carson/warehouse.rb,
lib/carson/repository.rb,
lib/carson/adapters/git.rb,
lib/carson/runtime/list.rb,
lib/carson/runtime/audit.rb,
lib/carson/runtime/local.rb,
lib/carson/runtime/setup.rb,
lib/carson/adapters/agent.rb,
lib/carson/adapters/codex.rb,
lib/carson/runtime/review.rb,
lib/carson/runtime/status.rb,
lib/carson/adapters/claude.rb,
lib/carson/adapters/github.rb,
lib/carson/adapters/prompt.rb,
lib/carson/runtime/abandon.rb,
lib/carson/runtime/deliver.rb,
lib/carson/runtime/receive.rb,
lib/carson/runtime/recover.rb,
lib/carson/runtime/housekeep.rb,
lib/carson/runtime/local/sync.rb,
lib/carson/runtime/local/hooks.rb,
lib/carson/runtime/local/prune.rb,
lib/carson/runtime/loop_runner.rb,
lib/carson/runtime/local/onboard.rb,
lib/carson/runtime/local/template.rb,
lib/carson/runtime/local/worktree.rb,
lib/carson/runtime/review/utility.rb,
lib/carson/runtime/local/merge_proof.rb,
lib/carson/runtime/review/query_text.rb,
lib/carson/runtime/review/data_access.rb,
lib/carson/runtime/review/gate_support.rb,
lib/carson/runtime/review/sweep_support.rb

Overview

Review sweep: late-event detection, tracking issue management, and sweep reporting.

Defined Under Namespace

Modules: Adapters Classes: Branch, CLI, Config, ConfigError, Courier, Delivery, Ledger, Parcel, Repository, Revision, Runtime, Warehouse, Waybill, Worktree

Constant Summary collapse

BADGE =

⧓ BLACK BOWTIE (U+29D3)

"\u29D3".freeze
VERSION =
File.file?( version_path ) ? File.read( version_path ).strip : "0.0.0"

Class Method Summary collapse

Class Method Details

.report(result, format: :json, output: $stdout) ⇒ Object

The company renders results for whoever is listening. JSON is the primary format (agents consume it). Human-readable is secondary. Domain objects return result hashes — Carson decides how to present them.



10
11
12
13
14
15
16
17
18
# File 'lib/carson.rb', line 10

def self.report( result, format: :json, output: $stdout )
	case format
	when :json
		require "json"
		output.puts JSON.pretty_generate( result )
	when :human
		report_human( result, output: output )
	end
end

.translate_hold(reason, remote_main: "origin/main") ⇒ Object

Translate internal hold reasons to agent-actionable output. Returns [ diagnosis, *recovery_steps ]. The diagnosis says what happened. Each recovery step is a command the agent can execute.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/carson.rb', line 54

def self.translate_hold( reason, remote_main: "origin/main" )
	case reason
	when "draft"
		[ "PR is still a draft." ]
	when "pending_at_registry"
		[ "Waiting for CI checks.", "carson status" ]
	when "failed_at_registry"
		[ "CI checks failed.", "carson deliver" ]
	when "error_at_registry"
		[ "Unable to assess CI checks.", "carson status" ]
	when "merge_conflict"
		[ "Merge conflict with #{remote_main}.", "git rebase #{remote_main}", "carson deliver" ]
	when "behind_registry"
		[ "Branch is behind #{remote_main}.", "git rebase #{remote_main}", "carson deliver" ]
	when "policy_block"
		[ "Blocked by branch protection rules." ]
	when "mergeability_pending"
		[ "GitHub is calculating mergeability.", "carson status" ]
	else
		[ "Waiting for merge readiness.", "carson status" ]
	end
end