marunage

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT

README

marunage

An autonomous task-execution OSS that lets you "丸投げ" (delegate completely) the steady stream of tasks arriving from Slack, email, GitHub, calendars, and custom sources — while keeping observation, intervention, and rollback always within reach.

marunage runs an OODA loop on top of Claude Code sessions managed by cmux: a Discovery layer polls each configured source, an Orient/Decide layer triages and prioritises tasks in a local SQLite queue, and an Execution layer launches one interactive Claude session per task in an isolated cmux workspace.

Status

The CLI skeleton is in place: every Phase 1 subcommand from docs/requirement.md (init, doctor, setup, add, dispatch, web, config, daemon, …) is wired through cobra and listed in marunage --help. Implemented commands so far:

  • marunage config get|set — read / write ~/.marunage/config.toml (override the path with --config) with schema validation, a timestamped .bak snapshot before each write, and rollback on validation failure. Each successful set appends config.set + config.save audit entries.
  • marunage init, doctor, setup, add, list, show, done, fail, promote, reopen, rm, render, export, clean, status, discover, dispatch, reaper, web — see docs/pr_split_plan.md for the per-PR landing log.
  • marunage loop --once | --interval D — drives one OODA tick (discover → dispatch → render) or a recurring ticker until SIGINT/SIGTERM. With no flag the interval defaults to discovery.interval from config (10m default).
  • marunage daemon start|stop|status — pidfile-backed background loop control under ~/.marunage/daemon.pid. start spawns a detached marunage loop and redirects stdout/stderr to ~/.marunage/logs/daemon.log; stop sends SIGTERM and escalates to SIGKILL after 10s; status distinguishes running / stale-pidfile / no-pidfile.

Stubs that still print not yet implemented and exit non-zero: run-all, open, notify, review. Their implementations land in later PRs along the PR split plan.

Build

make build              # produce ./bin/marunage
./bin/marunage --version

The version string is taken from git describe --tags --always --dirty at build time and injected into internal/version.

Development

make test         # go test ./...
make fmt-check    # gofmt -l fails on diffs
make vet          # go vet ./...
make lint         # golangci-lint run ./...

CI (.github/workflows/ci.yml) runs the same set on every push to main and on every pull request.

Layout

cmd/marunage/       CLI entrypoint (the marunage binary)
internal/cli/       cobra command tree
internal/config/    typed config schema, Load/Save, Get/Set primitives
internal/dispatch/  Dispatcher.Run — pending → cmux workspace + Claude session
internal/loop/      RunOnce / Run — discover → dispatch → render orchestrator
internal/logging/   JSON-Lines logger, rotating daemon.log writer, append-only audit.log
internal/version/   build-time version string
pkg/                public library packages (reserved for future phases)
web/                Web UI assets (reserved for PR-62 onwards)

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
marunage command
Command marunage is the entrypoint for the marunage CLI.
Command marunage is the entrypoint for the marunage CLI.
internal
autoreply
Package autoreply implements the permission boundary and configuration for the marunage-autoreply skill.
Package autoreply implements the permission boundary and configuration for the marunage-autoreply skill.
cli
Package cli builds the marunage CLI surface using spf13/cobra.
Package cli builds the marunage CLI surface using spf13/cobra.
cmux
Package cmux is marunage's wrapper around the external `cmux` CLI.
Package cmux is marunage's wrapper around the external `cmux` CLI.
completion
Package completion is the atomic-sentinel completion detector marunage promises in docs/requirement.md "Crash safety" (invariant #5) and "atomic sentinel による完了検知".
Package completion is the atomic-sentinel completion detector marunage promises in docs/requirement.md "Crash safety" (invariant #5) and "atomic sentinel による完了検知".
config
Package config defines marunage's typed configuration tree, schema validation, and the Load/Save primitives that back `marunage config` (see docs/requirement.md "設定ファイル `config.toml`").
Package config defines marunage's typed configuration tree, schema validation, and the Load/Save primitives that back `marunage config` (see docs/requirement.md "設定ファイル `config.toml`").
dispatch
Package dispatch is the execution-layer dispatcher (PR-42).
Package dispatch is the execution-layer dispatcher (PR-42).
doctor
Package doctor implements `marunage doctor`: it probes the small set of external tools marunage depends on (claude, cmux, sqlite3, python, plus the source-conditional gh / gws / jq) and reports a single boolean "ready or not" answer along with per-tool detail.
Package doctor implements `marunage doctor`: it probes the small set of external tools marunage depends on (claude, cmux, sqlite3, python, plus the source-conditional gh / gws / jq) and reports a single boolean "ready or not" answer along with per-tool detail.
initialize
Package initialize creates the ~/.marunage/ on-disk layout that `marunage init` (PR-33) is responsible for.
Package initialize creates the ~/.marunage/ on-disk layout that `marunage init` (PR-33) is responsible for.
journal
Package journal implements the PR-103 work journal: it collects activity from git, marunage tasks, GitHub, and other sources on a configurable interval and appends timestamped Markdown entries to ~/.marunage/journal/YYYY-MM-DD.md.
Package journal implements the PR-103 work journal: it collects activity from git, marunage tasks, GitHub, and other sources on a configurable interval and appends timestamped Markdown entries to ~/.marunage/journal/YYYY-MM-DD.md.
logging
Package logging owns marunage's structured log writers.
Package logging owns marunage's structured log writers.
loop
Package loop is the PR-71 orchestrator that connects the Discovery, Dispatch, and Render layers into one tick:
Package loop is the PR-71 orchestrator that connects the Discovery, Dispatch, and Render layers into one tick:
permission
Package permission implements the auto-accept allowlist matcher for the non-bypass permission modes.
Package permission implements the auto-accept allowlist matcher for the non-bypass permission modes.
project
Package project implements the Project Mode for marunage (PR-101).
Package project implements the Project Mode for marunage (PR-101).
reaper
Package reaper implements PR-44's orphan / 24h-stuck recovery sweep over the tasks table.
Package reaper implements PR-44's orphan / 24h-stuck recovery sweep over the tasks table.
render
Package render builds the Markdown body that `marunage render` writes to ~/.marunage/view.md so the cmux markdown viewer can show every task on a single screen (docs/pr_split_plan.md PR-60).
Package render builds the Markdown body that `marunage render` writes to ~/.marunage/view.md so the cmux markdown viewer can show every task on a single screen (docs/pr_split_plan.md PR-60).
secrets
Package secrets owns marunage's per-source token storage.
Package secrets owns marunage's per-source token storage.
skills
Package skills installs and validates the SKILL.md bundle that the marunage triage / execute / reflect Claude flows depend on.
Package skills installs and validates the SKILL.md bundle that the marunage triage / execute / reflect Claude flows depend on.
skills/registry
Package registry implements the HTTPS-based shared skill registry that PR-203 layers on top of the //go:embed bundle owned by PR-34.
Package registry implements the HTTPS-based shared skill registry that PR-203 layers on top of the //go:embed bundle owned by PR-34.
source
Package source defines the Discovery plugin contract that PR-70 introduces.
Package source defines the Discovery plugin contract that PR-70 introduces.
source/browser
adapter.go bridges *Plugin to the generic source.Plugin contract from internal/source.
adapter.go bridges *Plugin to the generic source.Plugin contract from internal/source.
source/calendar
adapter.go bridges the Plugin Go API to the generic source.Plugin contract.
adapter.go bridges the Plugin Go API to the generic source.Plugin contract.
source/github
Package github's adapter.go bridges the inner Plugin to the generic source.Plugin contract that PR-70 introduces.
Package github's adapter.go bridges the inner Plugin to the generic source.Plugin contract that PR-70 introduces.
source/gmail
Package gmail's adapter.go bridges the gmail.Plugin Go API to the generic source.Plugin contract introduced in PR-70.
Package gmail's adapter.go bridges the gmail.Plugin Go API to the generic source.Plugin contract introduced in PR-70.
source/googletasks
Package googletasks's client.go declares the narrow seam between the Plugin and the upstream Google Tasks API.
Package googletasks's client.go declares the narrow seam between the Plugin and the upstream Google Tasks API.
source/markdown
Package markdown's adapter.go bridges the existing markdown.Plugin Go API to the generic source.Plugin contract that PR-70 introduces.
Package markdown's adapter.go bridges the existing markdown.Plugin Go API to the generic source.Plugin contract that PR-70 introduces.
source/notion
Package notion implements the Notion Discovery source plugin promised in PR-201 of docs/pr_split_plan.md.
Package notion implements the Notion Discovery source plugin promised in PR-201 of docs/pr_split_plan.md.
source/slack
Package slack implements the Slack Discovery source plugin promised in docs/pr_split_plan.md PR-82.
Package slack implements the Slack Discovery source plugin promised in docs/pr_split_plan.md PR-82.
source/slack/reaction
adapter.go bridges *Plugin to the source.Plugin contract used by the Discovery dispatcher (PR-70).
adapter.go bridges *Plugin to the source.Plugin contract used by the Discovery dispatcher (PR-70).
store
Package store owns marunage's SQLite-backed persistence.
Package store owns marunage's SQLite-backed persistence.
triage
Package triage records the OODA Orient verdicts the embedded marunage-triage skill produces against discovered rows.
Package triage records the OODA Orient verdicts the embedded marunage-triage skill produces against discovered rows.
web
Package web hosts the `marunage web` HTTP server: chi-style router (built on net/http with Go 1.22 pattern matching), html/template-driven SSR pages, an SSE hub, and the CSRF + security-header middlewares.
Package web hosts the `marunage web` HTTP server: chi-style router (built on net/http with Go 1.22 pattern matching), html/template-driven SSR pages, an SSE hub, and the CSRF + security-header middlewares.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL