- Replace env-file inter-step handoff with JSON (jq) to safely handle
multi-line body content across steps
- Add branch creation, git commit, and git push in write-draft step
(AD-003: worktree destroyed after completion — unpushed work is lost)
- Create PR in notify-human step and signal PHASE:awaiting_ci instead
of PHASE:done so orchestrator manages the PR lifecycle
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add run-rent-a-human formula that lets any agent dispatch a human action
(post on Reddit, comment on HN, sign up for a service, etc.). Claude
drafts copy-paste-ready content to vault/outreach/{platform}/drafts/
and notifies the human via Matrix for one-click execution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add lib/tea-helpers.sh with tea_file_issue, tea_relabel, tea_comment,
tea_close — thin wrappers preserving secret scanning on write ops
- Add tea 0.9.2 binary to docker/agents/Dockerfile
- Configure tea login in docker/agents/entrypoint.sh from FORGE_TOKEN/FORGE_URL
- Derive TEA_LOGIN in lib/env.sh (codeberg vs local forgejo)
- Source tea-helpers.sh conditionally when tea binary is available
- Migrate predictor formula from inline curl to tea CLI commands
- Register tea-helpers.sh in smoke test function resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add auto-cleanup to supervisor/preflight.sh: PHASE:escalate files whose
parent issue/PR is confirmed closed (via Forge API) are deleted after a
24h grace period. Cleanup results appear in the preflight output for
journal logging by the supervisor formula.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add lib/build-graph.py that builds a NetworkX DiGraph from project docs
and forge API, runs structural analyses (orphans, cycles, disconnected
clusters, thin objectives, bottlenecks), and outputs a JSON report.
Predictor and reviewer agents now call build-graph.py before launching
their Claude sessions and inject the report as context.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add stale-pr-recycle step to the gardener formula that detects open PRs
with failed CI older than 24 hours and no active tmux session. Stale PRs
are closed with a comment, and the linked issue is relabeled from
in-progress to backlog so dev-poll picks it up for a fresh attempt.
Also adds close_pr manifest action to the gardener executor.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a re-evaluate-backlog step to the predictor formula between
collect-signals and analyze-and-predict. For each open prediction/backlog
issue, the predictor now reads the original context and planner comments,
extracts the assumptions that made it "watch, don't act", and re-checks
those conditions against current system state.
Three outcomes:
- CONDITIONS_CHANGED → file new prediction/unreviewed, close old as superseded
- STALE (30+ days, conditions stable) → close as prediction/actioned
- UNCHANGED_RECENT → skip (existing behavior)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a new `dispatch-idle-formulas` step between `file-at-constraints` and
`journal-and-memory`. This step scans available formulas, checks for stale
or missing data, and files action issues to dispatch idle formulas.
Key changes:
- New step runs after constraint filing, independent of the 3-issue budget
- Excludes nervous-system formulas (AD-001: cron, not action issues)
- Checks open action issues, recently closed issues, and evidence timestamps
to determine staleness (7-day window)
- Journal format updated to log dispatched idle formulas
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace $FACTORY_ROOT/planner/ and $FACTORY_ROOT/vault/ references with
$PROJECT_REPO_ROOT/planner/ and $PROJECT_REPO_ROOT/vault/ in the planner
formula and planner-run.sh. Planner artifacts (journal, memory, prerequisite
tree) and vault state are per-project, not factory-owned. The old paths
caused cross-repo contamination when the planner ran for non-disinto projects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: the gardener quality gate strips the `backlog` label from
issues missing "## Acceptance criteria" checkboxes and "## Affected
files" sections. The planner formula never instructed including these
sections, so every planner-created issue lost its label on the next
gardener run.
Three changes to formulas/run-planner.toml:
1. Require issue bodies to include acceptance criteria and affected
files sections (matching the issue template format the gardener
quality gate enforces).
2. Add post-creation label verification via separate API call as a
belt-and-suspenders defense against Codeberg silently dropping
labels during issue creation.
3. Make label ID resolution unconditional in prediction-triage (was
skippable when no predictions existed, starving file-at-constraints
of the backlog label ID).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update the agents-update step in run-gardener.toml to enforce the ~200-line
size limit on root AGENTS.md. When exceeded, the gardener now splits
per-directory sections into {dir}/AGENTS.md files with watermarks,
replacing verbose sections in root with a summary table of pointers.
Root keeps: overview, directory map, architecture decisions, key conventions.
Per-directory files get: role, trigger, key files, env vars, lifecycle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the orphaned post-session dust accumulator from gardener-agent.sh
(no longer reached after #367 moved gardener-poll.sh to action issues).
Add a dedicated dust-bundling formula step to run-gardener.toml that
handles the full lifecycle: dedup, timestamps, 30-day TTL expiry, and
bundling groups with 3+ items into backlog issues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the unreliable escalation JSONL system (supervisor/escalations-*.jsonl
consumed by gardener) with direct blocked label + diagnostic comment on the
original issue.
When a dev-agent or action-agent session fails (PHASE:failed, idle timeout,
crash, CI exhausted):
- Capture last 50 lines from tmux pane via tmux capture-pane
- Post a structured diagnostic comment on the issue (exit reason, timestamp,
PR number, tmux output)
- Label the issue "blocked" (instead of restoring "backlog")
- Remove in-progress label
Removed:
- Escalation JSONL write paths in dev-agent.sh, phase-handler.sh, dev-poll.sh,
action-agent.sh
- is_escalated() helper in dev-poll.sh
- Escalation triage (P2f section) in supervisor-poll.sh
- Escalation processing + recipe engine in gardener-poll.sh
- ci-escalation-recipes step from run-gardener.toml formula
- escalations*.jsonl from .gitignore
Added:
- post_blocked_diagnostic() shared helper in phase-handler.sh
- ensure_blocked_label_id() helper (creates label via API if not exists)
- is_blocked() helper in dev-poll.sh (replaces is_escalated)
- Blocked issues listing in supervisor/preflight.sh
Kept:
- Matrix notifications on failure (unchanged)
- CI fix counter logic (still tracks attempts)
- needs_human injection in supervisor/gardener (not escalation-related)
- Gardener grooming (gardener-agent.sh still invoked)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix critical: use double quotes for $PHASE_FILE in formula phase signal
- Fix low: use limit=50 for backlog/in-progress/blocked issue counts
- Fix nit: correct misleading comment about escalation reply timing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename planner-poll.sh → planner-run.sh: direct cron executor that
creates a tmux session with Claude (opus), injects the formula as
context, monitors phase file, handles crash recovery and cleanup.
No action issues, no action-poll dependency.
- Source disinto project config explicitly (projects/disinto.toml)
instead of defaulting to harb via env.sh.
- Update formulas/run-planner.toml (v2): remove agents-update step
(now handled by gardener per #246), add journal-and-memory step
(daily journal entries committed to git + local MEMORY.md update),
add commit-and-pr step (one commit, one PR per run).
- Create planner/journal/ directory for daily raw logs.
- Update crontab: weekly Sunday 6AM call to planner-run.sh.
- Update AGENTS.md to reflect new architecture.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add --recipes-only flag to gardener-poll.sh to skip grooming call when
invoked by the formula's ci-escalation-recipes step (prevents double-run)
- Update formula step to pass --recipes-only
- Add lib/file-action-issue.sh to AGENTS.md shared helpers table
- Clarify TOML arg scope in gardener trigger description
- Fix log prefixes in gardener-run.sh (poll: → run:)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes#363
## Changes
Created formulas/run-gardener.toml with 7 steps: preflight (pull latest), agents-update (AGENTS.md watermark check), stale-pr-cleanup (ping/close inactive PRs), dust-bundling (group trivial issues into bundles of 3+), ci-health (detect systemic CI failures), blocked-review (triage blocked issues per #352), and commit-and-pr (single commit with all file changes). No memory, no journal. All git writes collected in the final commit-and-pr step; API calls happen during the run. Steps follow the established formula TOML format with needs dependencies.
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/366
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
- Rename <backlog_label_id> in WATCH path to <prediction_backlog_label_id>
to avoid collision with the plain backlog label in strategic-planning
- Add prediction/actioned relabeling before close for PROMOTE and DISMISS
paths so closed predictions are distinguishable from unprocessed ones
- Make step 4 comment format consistent with step 5: "Actioned as #NNN —
<reasoning>" everywhere
- Add step 3b for explicit label ID resolution with create-if-missing for
the new prediction/actioned label
- Document prediction/* and action labels in AGENTS.md label table
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expand the triage-predictions step in run-planner.toml with four explicit
triage actions (PROMOTE_ACTION, PROMOTE_BACKLOG, WATCH, DISMISS), each
with API execution details and mandatory reasoning comments. Promoted
predictions now close the original with "Actioned as #NNN" and compete
with vision gaps for the per-cycle 5-issue limit in strategic-planning.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TOML declares model = "opus". planner-poll.sh includes model: opus in
the issue YAML front matter. action-agent.sh extracts it and exports
CLAUDE_MODEL. create_agent_session passes --model to claude if set.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Persist DEPLOY_SHA and TARGET to temp files for cross-step reads
- Use ln -s + mv -T for truly atomic symlink swap
- Guard against empty title extraction in verify step
- Add repo_root var instead of hardcoded path
- Append deploy history before pruning old deploys
- Add prune-old-deploys to verify step needs for unambiguous ordering
- Explicit no-op early exit via NOOP sentinel
- Follow redirects with curl -L in verify step
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>