d4e1219577e01f270aca90e2706cfdcd523100cd
38 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0db0a15dad |
feat(controller): RUN_CI_LOCAL verdict source, ci-not-ready outcome, escalation hardening
Adds RUN_CI_LOCAL — an on-demand local-CI verdict source for when the cluster's Forgejo CI is broken — plus robustness fixes, the telemetry Live-tab rewrite, and PR-level cost attribution. Controller: - RUN_CI_LOCAL: the master swaps its Forgejo CI callbacks for local `forgejo-runner exec` runs (tools/run-ci-full-local.sh + local_ci.py). Async per-(owner,repo,SHA) on-disk job cache; preflights the forgejo-runner binary + Docker daemon at startup (fail loud, not a red verdict on every PR); GCs finished run dirs + per-run actcache. - ci-not-ready implementer outcome + implementer_ci_not_ready event: an implementer that runs before the on-demand verdict exists parks in AWAITING_CI instead of dead-ending at STUCK; capped against ci_red ping-pong. - ci_poll_exhaustion skips its sweep while a local CI run is in flight, so AWAITING_CI workflows queued behind on-demand CI are not STUCK'd by the remote-CI-sized timeout. - Escalate the workflow after repeated worker-internal-error at a tier instead of retrying to pickup-exhaustion -> STUCK. - forgejo_http: normalise Forgejo's per-gate `status` key to `state` so failing gates are actually counted (they previously all read as pending). - Per-tier worker timeouts bumped +15 min; a timed-out attempt's dirty-worktree residue is preserved on auto-scratch/pr-<N> before the next attempt's reset. - Implementer agents now verify only the CI-flagged gate(s) via a targeted re-run rather than the full local battery before claiming resolved/noop. Re-running the whole suite CI will run anyway was the #1 cause of implementer timeouts; CI remains the real gate and re-dispatches the implementer on red. Telemetry: - Live tab rebuilt on /api/live (controller DB run state + the live OpenCode session forest) after the live_log_writer sidecar was retired with the legacy dispatchers. - Durable per-attempt input/output payloads surfaced in the Live drill-down, archived-session detail, and Workflows timeline. - PR-level cost attribution: worker session tags carry -pr-<n>; backfill_llm_activity_pr.py repairs rows written before the fix. Shared: - tools/controller/session_tag.py — one canonical controller-tag parser shared by the telemetry server and the backfill. Tests: new coverage for local_ci (state machine, log parsing, _summarize_run, GC, in-flight probe, preflight), the ci-not-ready path, the escalation/ci-not-ready SQL counters, the ci_poll in-flight skip, and CI-status payload parsing across both sources. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
a6986008ee |
feat(controller): trial-5 batch — dispute path, merge pipeline split, conflict-resolver hardening
T5-1 reviewer feedback rendered full-body to the implementer
T5-4/9 implementer dispute path — dispute-at-any-tier with per-tier cap,
OPERATOR_ATTENTION state on stalemate, pr-review-worker-dispute agent
T5-5 reviewer BLOCKING ISSUE EVIDENCE RULE + 5-step validation
T5-7 merge step split into a singleton process — impl/review masters write
APPROVED and stop; merge_drive owns APPROVED -> MERGING -> MERGED
T5-10 merge process is fully deterministic; base conflicts bounce to the
controller's CONFLICT_RESOLVING (LLM); conflict_drive sidecar retired
T5-11 implementer fast success path — verified-clean outcome so a no-op
after conflict resolution doesn't force busywork
T5-12 conflict-resolver permissions fixed across all paths (/tmp/** glob)
T5-13 conflict-resolver PR-intent prehydration (title/body/comments)
Adds tools/_controller_db_bridge.py so merge_drive reads the controller DB
directly (Option B), plus APPROVED + OPERATOR_ATTENTION states, the
dispute/verified-clean events, and the V1 contract fields backing them.
Reviewer model: baseline -> sonnet, dispute -> opus.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
||
|
|
a10758177c |
feat(controller): Phase 0 foundation — V1 contracts + CI gate enumeration
Lays the foundation for the planned controller + DB-owned PR state machine rewrite (see .drew/controller_state_machine.md). Phase 0a — Pydantic V1 worker I/O contracts (tools/controller/contracts/): - v1.py: ImplementerInputV1/OutputV1, ReviewerInputV1/OutputV1, EstimatorOutputV1, IssueImplementerOutputV1, ConflictResolverInputV1/OutputV1, SummarizerInputV1/OutputV1. Plus CISummary / CIFailure / GateResult / FailedAssertion / FileLocation. All models use extra="forbid" + required output_version Literal discriminator (no defaults). - parse.py: strict_parse() + strict_parse_with_retry() helpers. Corrective prompt template quotes the Pydantic ValidationError + the JSON schema. TTL guard skips retry when remaining time too short. Defense-in-depth around the response-builder MCPs that arrive in Phase 1a. Phase 0b — Static CI parser-coverage discovery: - NOX_SESSION_TO_PARSER map in tools/controller/ci_summary_parsers/. Derived from .forgejo/workflows/*.yml + noxfile.py. Covers ruff, pyright, behave, robot_framework, slipcover, vulture, radon, bandit, semgrep, build. Cron-only sessions (benchmark, benchmark_regression) are in NOX_SESSIONS_SKIP_COVERAGE. - scripts/enumerate-ci-gates.py: reads the workflow YAML, joins against the map, exits non-zero on coverage gaps. Wired into tests so the actual .forgejo/ is regression-guarded. 63 new tests; full auto_agents suite still passes (2424). |
||
|
|
a6610a022c |
feat(auto-agents): launcher sidecars for conflict-drive + merge-drive
Two new long-lived sidecars folded into the dispatcher launcher, each gated by an env var for safe enable/disable: **Conflict driver** (``DISPATCHERS_DISABLE_CONFLICT_DRIVE``, default enabled). Watches Forgejo for ``auto/needs-conflict-resolution`` labels, dispatches ``conflict-resolver-worker`` (the new agent; bound to ``local-claude/claude-opus-4-6`` for high-quality rebases) to rebase + resolve conflicts, force-with-leases the result, and clears the label. Decoupled from approval — keeps PRs mergeable so the merge driver doesn't have to wait at approval time. **Merge driver** (``DISPATCHERS_DISABLE_MERGE_DRIVE``, default DISABLED in this test launcher to avoid accidental merges during validation runs). Watches Forgejo for APPROVED PRs without blocking labels, rebases against current master, runs the local CI gate, merges via squash with force-with-lease semantics. Terminal stage of the pipeline. Both sidecars follow the existing warmer pattern: best-effort respawn on failure, no contribution to the dispatcher crash-loop budget, clean shutdown on launcher exit. PRs that get ``auto/needs-conflict-resolution`` would sit forever without the conflict-driver sidecar — the implementer and reviewer don't act on that label. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
2658deee94 |
feat(auto-agents): PR State Warmer substrate + supporting infra
Adds a long-lived sidecar (pr_state_warmer.py) that polls Forgejo's /pulls endpoint every 30s and writes the full PR snapshot to a shared SQLite store, eliminating the dispatcher's per-cycle cold-cache stalls (24-30s rebuilds on flaky cycles) and the silent 50-PR pagination cap on the legacy single-page fetch. Substrate - tools/_pr_state_cache.py — SQLite store with (owner, repo) PK, WAL mode, additive v2→v3 migration (comments_refreshed_updated_at), bounded fcntl.flock migration lock, threading.Lock for per-process init, @_with_reheal decorator (catches OperationalError no-such- table + DatabaseError corruption with file quarantine), atomic TEMP-table chunking for >32k seen-set, _normalize_updated_at to canonicalize Forgejo tz-marker drift - tools/pr_state_warmer.py — poll/upsert/vanish/comments-refresh loop with fcntl.flock singleton (rejects second warmer), bounded comments-refresh cap, persistent deferral via SQL pending query, PermissionError-tolerant lock setup, cold-start log suppression - tools/_pr_classification_cache.py — three-layer fall-through (warmer cache → list cache → live fetch) with staleness gate (PR_STATE_WARMER_STALE_AFTER_S floored at 30s in prod) Comments cache hardening - Bot-filter at write time drops bot status/claim/release/sentinel while preserving **Implementation Attempt** markers (94.6% reduction on bot-heavy PRs like #30's 19k-comment thread) - _normalize_since_cursor strips microsecond precision before building ?since= query (fixes the live-observed Forgejo HTTP 422 bug on PRs #25 + #28); handles uppercase Z, lowercase z, ±HH:MM offsets (including non-zero like +05:30), naive ISO - Lazy migration of legacy null-key by_author entries on _read_cache - _newest_cursor walks tail-back skipping malformed entries Supporting infrastructure (cumulative dmpipeline-v2 work) - Telemetry server: SSE live tail, run-sessions enumeration, cost/token tracking, app.js UI rewrite with collapsible sections - MCP servers (mcp_ci_server, mcp_forgejo_server, mcp_git_server, mcp_handoff_server, mcp_graphify_server) for opencode worker context access - Live log writer (tools/live_log_writer.py) — SSE-streaming dispatcher event log - Tier-dispatcher escalation flow with prompts trimmed for budget - Shared bot-logins resolver (tools/_bot_logins.py) replacing two drift-prone copies - token_usage_audit.py for opencode cost analysis Tests - 2259 passing across 65 changed/new files - New suites: test_pr_state_cache, test_pr_state_warmer, test_pr_state_warmer_integration, test_pr_classification_cache, test_pr_list_cache_backoff, test_mcp_* (5 servers), test_live_log_writer_sse, test_telemetry_run_sessions, test_review_post_ready_label - Test_pr_comments_cache expanded with bot-filter coverage, cursor-normalization regression pins, format-drift, atomicity, failed-comments-not-stamped (silent-data-loss class) - Parametrized @_with_reheal coverage across 7 wrapped APIs - Real fault-inject atomicity test for chunked mark_vanished path via Connection wrapper class - Subprocess-based singleton flock test (cross-process contract) - Event-driven SIGTERM-mid-poll test (no fixed-sleep flake) Architecture notes - Schema v3 migration is additive (ALTER ADD COLUMN); v0/v1 still need destructive rebuild because pre-v2 column shape lacks owner/repo. Cross-process drop-table-ping-pong prevented by the fcntl migration lock + per-process _initialized flag. - Comments-refresh deferral is persistent via comments_refreshed_updated_at column — survives warmer restart, picks up next cycle even if PR didn't change again. Replaces in-memory changed_numbers list. - Rollback path: PR_STATE_WARMER_PREFER=0 bypasses the warmer cache and reverts to live-fetch behavior. PR_STATE_CACHE_DISABLE=1 short-circuits the warmer process at startup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
7890af4a5e |
fix(auto-agents): run-6 deep-inspection findings + sidecar/launcher hardening
Several of these were silent failures the worker could not recover from.
- N2: OpenCode's permission resolver is LAST-match-wins (findLast), not
first-match-wins. A prior reorder put `"*": deny` AFTER the /tmp allows
in task-implementor.md's edit/write/external_directory blocks, so the
leaf could not even read its own pre-cloned worktree. Reordered
`"*": deny` first; added an ordering-pin test.
- N1: task-implementor.md never told the leaf to emit the terminal
{"outcome","files_touched"} JSON, so a prose-only ending dropped the
dispatcher into its UNKNOWN bucket. Added the Terminal output contract
+ a CRITICAL rule + a content pin.
- N3: piping the gate wrapper through head/tail is denied (neither is
allowlisted). Documented "run it bare" in the quality-gates skill and
the task-implementor bash comment.
- N5: the launcher reap loop respawned the live-writer sidecar (and
dispatchers) during shutdown. Added a SHUTTING_DOWN guard.
- N6: documented the events.jsonl record schema in-repo (optional-field
absence is intentional, not an inconsistency).
- Sidecar: _load_offset returned byte 0 on cold start, re-emitting the
whole log backlog. Now returns EOF; resolution hoisted to __init__ so
it is deterministic vs. thread startup.
- Auto-fix push: push_branch ran git without GIT_ASKPASS and failed
rc=128. It now takes a credential-bearing git_env from the caller;
added apply-phase logging before the push.
N4 assessed and not a bug: data_complete=False was caused by
pr_comments:partial + diff_truncated, not the 404 linked issue.
Full suite: 1559 passed, 3 skipped (+11 new regression tests).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
179b420270 |
feat(telemetry): live dispatcher-run observability subsystem
A sidecar + web UI that turns a running 4-hour dispatcher test from
"tail three logs and guess" into a real-time status grid.
tools/live_log_writer.py — sidecar. Tails the implementer + review
dispatcher logs, watches OpenCode session archives + Phase-4
telemetry JSONL, polls host process state, and emits two artifacts:
<run_dir>/events.jsonl — append-only event stream, closed event set
<run_dir>/snapshot.json — rolling status grid, atomically replaced
Restart-safe: replays events.jsonl to rebuild counters, resumes each
tailer from a per-tailer offset file. Offsets are saved BEFORE the
line is handled, so an unclean crash can drop <=1 event but never
double-count.
.opencode/telemetry/{server.py,app.js,index.html,style.css} — the
"Live" tab. server.py serves /runs + /snapshot + /events (the last
with a byte-offset cache so a 3s UI poll is O(new events), not
O(file size)); app.js renders the process/service grids, the
implementer/reviewer cards, and a bounded event feed.
scripts/dispatchers-launcher.sh — wires the sidecar in as a
best-effort child: respawned outside the dispatcher crash-loop
budget, its exit never propagates to the launcher's, with a
rapid-crash backoff floor so a writer that crashes on boot can't
tight-loop.
Hardened through three review rounds (23 fixes) before landing:
partial-read race in the dir watchers, a shared offset-temp-file
race, replay/offset double-count, dead event types, the /events
O(n)-per-poll scan, the app.js↔snapshot field-contract drift, a
respawn tight-loop, and more.
Tests: tests/auto_agents/test_live_log_writer.py — 46 tests covering
every log-pattern handler, replay↔handler counter agreement, atomic
snapshot write, idempotent restart, partial-read resilience, the
/events offset cache, a cross-language app.js↔snapshot contract test,
a schema-doc consistency test, and two end-to-end smoke tests that
run the actual sidecar process. Full tests/auto_agents/ suite: 1548
passed, 3 skipped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
8ed4b96b1a |
feat(auto-agents): perf + observability + persistent comment cache
Folds B1-B4 + C2-C5 from the post-live-test plan into one commit:
B1 — npx tsx pre-warm in dispatchers-launcher.sh closes the cold-cache
30s AbortSignal timeout that killed both dispatchers' first cycle.
B2 — per-tier worker timeout
(IMPLEMENTER_DISPATCHER_WORKER_TIMEOUT_TIER_{N}_SECONDS) lets Tier 1
(qwen-large) and Tier 2 (kimi) get more wallclock than gpt-5-mini;
floor 60s.
B3 — _rebuild_prompt_from_cached_result skips the full prefetch on
tier transitions (worktree-reset puts everything back at the
prefetched head_sha, so the prefetch result + det_sections don't
change). Saves ~7 min per tier transition on comment-heavy PRs.
B4 — git-commit-util.md documents the FORBIDDEN naive recovery
pattern (git fetch && git reset --hard) that lost PR #30 attempt
3's real fix in the live test. Two correct paths now spelled out:
--force-with-lease=<branch>:<old-remote-sha> or stash+rebase+pop.
C2 — _pr_clone._refresh_mirror_with_retry adds one retry on git
fetch failure and force-reclones the bare mirror if both attempts
fail. Previously a single exit 128 logged WARN and continued with
stale data forever.
C3 — in-flight turn markers (asterisk suffix on input/output token
counts) in the per-turn log when completed=False. The archived
turn dict's completed field was already there; the log now surfaces
it. Sub-agent timeout archiving was already correct via
_archive_subagent_tree.
C4 — new module _recent_push_cache.py records per-PR push events
(head_sha + timestamp + cycle metadata). Prefetch surfaces in the
sentinel under recent_implementer_push (with --field accessor)
when the cached push matches the PR's current head_sha within
1h. Prevents the "dispatcher re-cycles right after pushing,
worker re-does the same compliance work" failure mode from
PR #28 cycle 2 in the live test.
C5 (replaces C1) — new module _pr_comments_cache.py wraps
_review_fetch.fetch_pr_comments with disk-backed delta-fetch
semantics. PR #30's 1340+ comment fetch (which previously took
~30s and hit the 20-page pagination cap) now becomes a 5-10 item
delta. Cache is per-PR, shared between reviewer + implementer
dispatchers, has 24h staleness bound, kill-switch via
IMPLEMENTER_DISPATCHER_COMMENT_CACHE_DISABLE=1.
Tests: 1484 passed, 3 skipped (+20 from
|
||
|
|
2cbe62a70c |
fix(auto-agents): F1+F2+F3 telemetry liveness, reviewer perf (A+C), bash rules
Bundles a long-overdue set of fixes that surfaced while watching the single-PR pipeline test against PR #30 the morning of 2026-05-07. # F1 — long-worker liveness contract The dispatcher heartbeat was only refreshed *between* worker sessions. On a 30-minute review the heartbeat file went stale, and any heartbeat-watchdog (dispatchers-launcher.sh / cleveragents-dispatchers.service) would SIGTERM a perfectly-healthy worker mid-cycle, orphaning the OpenCode session and the auto/claimed-* lock. ``_opencode_worker.run_session_blocking`` now accepts an ``on_poll`` callback fired once per status-poll iteration; ``_dispatch_runtime.dispatch_one`` and ``conflict_drive.py`` wire it to ``write_heartbeat(cfg.heartbeat_path)``. Callback exceptions are logged and swallowed so a transient EROFS on the heartbeat path can never mask a successful worker completion. # F2 — in-flight cycle visibility (schema v5) The ``dispatch_*_cycles`` tables previously only recorded a row at cycle *end*. While a worker was running, the operator's only signal was the heartbeat file — and even that became stale (see F1). Schema bumped to v5: ``ended_at`` is now nullable and ``cycle_id`` carries a UNIQUE index. ``begin_cycle`` writes the in-flight row at start; ``finish_cycle`` updates it at end. ``run_one_cycle``'s try/finally guarantees ``finish_cycle`` runs even when ``collect_candidates`` / ``dispatch_one`` raises, so an orphan ``ended_at IS NULL`` can no longer be stuck forever after a crash. The v4→v5 migration is now defined in ONE place — a set of helpers in ``_forgejo_cache.py`` (``DISPATCH_CYCLE_TABLES``, ``_dispatch_cycle_create_sql``, ``_dispatch_cycle_index_sqls``, ``migrate_dispatch_cycle_table_to_v5``, ``ensure_dispatch_cycle_schema``). Both ``ForgejoCache._migrate_to_v5_in_flight_rows`` and ``_dispatch_runtime.ensure_cycle_table`` import from there, eliminating the drift risk of the previous duplicated DDL. Pre-existing rows are preserved verbatim across the migration. # F3 — telemetry surface for the new state ``/api/health`` now returns ``in_flight_cycle: {cycle_id, started_at, session_id, candidates_count, elapsed_s}`` per dispatcher daemon and a ``running_long_worker: bool`` flag (heartbeat older than 600s AND a matching pid alive — should never fire under healthy F1 operation, so when it does it points at a real bug). The Drivers and Overview tabs in ``.opencode/telemetry/{index.html,app.js,style.css}`` render in-flight rows with a tinted background + "in flight" pill, daemon tiles get a dashed border for the long-worker state, and each tile shows the running cycle's id + elapsed time inline. # Fix A — reasoningEffort high → medium for pr-review-worker On its own that change alone would not have been enough, but combined with Fix C below it dropped a representative cycle from "timed out at 30:00" to a target ~2-3min. Pure config change in ``.opencode/agents/pr-review-worker.md``; no code path touched. # Fix C — pre-fetch PR diff in dispatch_review and embed in prompt The reviewer used to spawn a ``git-isolator-util`` subagent, which shelled out to ``git clone``, ``git fetch``, and ``git diff master...HEAD``. That subagent burned 90+ seconds and several token budgets per cycle. ``dispatch_review.py`` now fetches the unified diff via the Forgejo ``/pulls/{n}.diff`` endpoint and embeds it into the worker prompt under an ``UNTRUSTED CONTENT`` fence with explicit BEGIN_PR_DIFF / END_PR_DIFF markers, head_sha pinning, character-count metadata, and END marker redaction to defeat patch-text injection. The worker is instructed to use the embedded diff and skip the isolator subagent entirely when it is present. Falls back to the old path on fetch failure or via the ``REVIEW_DISPATCHER_EMBED_DIFF=0`` env switch. # Cross-cutting bash rules The ``pr-review-worker``'s shell tool calls kept hitting ``permission denied`` because OpenCode's permission engine matches the *raw, unexpanded* command string against allow-globs. Chained commands (``&&``, ``||``, ``;``, ``|``), command substitution (``$(...)``), bare variable assignments, multi-line continuations (``\\\n``), heredocs, and inline ``python3 -c "..."`` strings all contain characters the permission glob cannot span, and were silently denied. Added ``.opencode/instructions/bash-commands.md`` (wired into ``opencode.json`` via the ``instructions`` array so it appends to EVERY agent's system prompt globally), with hard rules + recovery recipes (``printf > /tmp/file`` instead of heredocs; ``printf > /tmp/script.py`` + ``python3 /tmp/script.py`` instead of ``python3 -c``; ``curl -d @/tmp/body.json`` instead of multi-line ``-d '{...}'``). # Pre-commit polish (architect/dev/test review) Surfaced during a chief-architect / principal-developer / senior-test-engineer code review of the uncommitted change: - Schema DDL deduplication (described above under F2). - ``finish_cycle`` INSERT-fallback now preserves ``started_at`` / ``driver_name`` when caller provides them; otherwise stamps a ``synthetic_started_at: true`` flag in the raw blob so cycle-time analytics can exclude rows whose duration was synthesised. - ``bytes=`` → ``chars=`` in the embedded-diff header. The value is ``len(diff_text)`` after ``decode("utf-8")`` — a UTF-8 character count, not a byte count. Off-by-multibyte for non-ASCII patches. - ``scripts/opencode-builder.sh`` mode 644 → 755. - ``.gitignore`` entries for ``.parked-prs.json`` (runtime state for ``tools/park_other_prs.py --restore``) and ``.dispatcher-logs/`` (append-only local pipeline log directory). # Tests (381 passed, 1 skipped) - ``test_opencode_worker.py``: 3 new tests for ``on_poll`` cadence, error swallowing, and backwards-compatible default. - ``test_dispatch_runtime.py``: 7 new tests for ``begin_cycle`` / ``finish_cycle`` semantics, the v4→v5 migration with row preservation, the crash-safe try/finally path, the ``dispatch_one`` → ``run_session_blocking`` ``on_poll`` wiring, and the new ``started_at`` / ``driver_name`` plumbing through the INSERT-fallback branch. - ``test_telemetry_server.py``: 4 new tests for ``in_flight_cycle`` in ``/api/health``, the elapsed-seconds computation, and the ``running_long_worker`` flag. - ``test_telemetry_schema.py``: assertion bumped from v4 → v5 and a new test confirming the cycle tables now allow ``ended_at IS NULL``. - ``test_dispatch_review.py`` (new file): 14 tests for diff fetch (happy path, truncation, HTTP/URL errors, END_PR_DIFF redaction, Forgejo auth scheme), ``_build_diff_section`` (dry-run, env toggle, embedding, fallback), and end-to-end prompt embedding. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
f89d275650 |
chore(dispatchers): apply pre-push critique fixes + ship production launcher
Layered polish on top of
|
||
|
|
593d142f6f |
feat(auto-agents): Tier 2 deterministic review/implementer dispatchers
Replaces the long-running pr-review-supervisor / implementation-
supervisor LLM polling loops with host-level Python dispatchers that
own queueing, claim ownership, watchdogs, and SQLite telemetry. The
LLM workers retain sole responsibility for review judgment and code
generation; Python owns only orchestration. The hard merge invariant
is unaffected — these dispatchers do not touch master.
Driver surface
- _opencode_worker.run_session_blocking — outcome-agnostic OpenCode
session lifecycle (completed / timeout / transport-error). Used
directly by reviewer / implementer dispatchers whose workers do
not emit the conflict-driver JSON exit schema.
run_worker_blocking is now a thin wrapper that adds the
conflict-specific JSON-outcome classification.
- _dispatch_runtime — shared Python runtime (work-group polling,
claim helpers, dispatch loop, telemetry). Pre-checks issue labels
before claiming and refuses when any auto/claimed-* is already
present, distinguishing already-claimed vs labels-fetch-failed
vs claim-failed terminal states. Frozen DispatchConfig.
- dispatch_review.py / dispatch_implementer.py — per-pipeline work
groups, prompts, and CLIs. Each refuses startup when a competing
AUTO-REV-SUP / AUTO-IMP-SUP legacy supervisor is live on the
same OpenCode server (override:
{REVIEW,IMPLEMENTER}_DISPATCHER_ALLOW_SUPERVISOR_COEXIST=1).
- _loader.py — shared sibling-module loader; replaces the three
duplicated copies in the dispatcher entry points.
Operational hardening
- run_outer_loop tracks consecutive cycle exceptions against
cycle_failure_budget (default 5, env-tunable per driver) and
exits 2 on exhaustion for supervisor-driven restart.
- _sanitize_release_detail strips control bytes and neutralises
triple-backtick fences before quoting worker raw_response in
Forgejo claim-release comments.
- scripts/opencode-builder.sh: OPENCODE_BUILDER_SERVER_ONLY=1 keeps
only the OpenCode HTTP API up so the Python dispatchers own
queue orchestration without auto-agents running concurrently.
Telemetry
- _forgejo_cache.py schema v4: dispatch_review_cycles,
dispatch_implementer_cycles. One row per cycle with cycle_id,
driver, candidates_count, claims_acquired, swept_count,
processed_count, terminal_state, worker_outcome, session_id,
worker_wallclock_seconds, raw.
- .opencode/telemetry/server.py wires the new tables into
/api/cycles?driver=dispatch_review|dispatch_implementer and
surfaces a composite terminal_state/worker_outcome 24h breakdown
so dashboards can distinguish session-level vs work-level
outcomes.
Tests
- 31 new tests in tests/auto_agents/test_dispatch_runtime.py
covering: candidate priority/dedup, claim/release labels,
foreign-claim refusal, same-kind-claim refusal,
labels-fetch-failed terminal state, sanitization, supervisor
coexistence guard (pass/refuse/override/unreachable-server),
session timeout / transport-error propagation,
JSON-vs-no-JSON worker exits, cycle failure budget exit and
reset, heartbeat cadence, end-to-end --once --dry-run /
--status CLI smoke, and full prompt-snapshot tests for
_review_prompt and _implementation_prompt (PR-fix + issue-impl).
- test_telemetry_schema.py asserts schema v4 and the presence of
the two new dispatcher cycle tables.
338 auto_agents tests pass (was 322 before Tier 2). Conflict driver
regression suite unchanged. Dispatchers run cleanly under
--status / --once --dry-run with no Forgejo or OpenCode HTTP traffic.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
||
|
|
97ea5a26d8 |
script: reinforced auto-agent scripts
CI / status-check (push) Blocked by required conditions
CI / benchmark-publish (push) Waiting to run
CI / push-validation (push) Successful in 40s
CI / helm (push) Successful in 53s
CI / build (push) Successful in 1m7s
CI / quality (push) Successful in 1m31s
CI / lint (push) Successful in 1m37s
CI / typecheck (push) Successful in 1m39s
CI / security (push) Successful in 1m46s
CI / integration_tests (push) Successful in 4m40s
CI / e2e_tests (push) Successful in 5m10s
CI / unit_tests (push) Successful in 7m10s
CI / docker (push) Waiting to run
CI / coverage (push) Has started running
|
||
|
|
514d61c63c |
build: fixed script to work with agent changes
CI / helm (push) Successful in 36s
CI / push-validation (push) Successful in 27s
CI / benchmark-publish (push) Failing after 59s
CI / lint (push) Successful in 57s
CI / build (push) Successful in 54s
CI / quality (push) Successful in 1m21s
CI / security (push) Successful in 1m37s
CI / typecheck (push) Successful in 1m37s
CI / integration_tests (push) Failing after 3m37s
CI / e2e_tests (push) Successful in 3m45s
CI / unit_tests (push) Failing after 4m48s
CI / docker (push) Has been skipped
CI / coverage (push) Successful in 11m2s
CI / status-check (push) Failing after 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 39s
CI / helm (pull_request) Successful in 42s
CI / build (pull_request) Successful in 1m1s
CI / lint (pull_request) Successful in 1m34s
CI / security (pull_request) Successful in 1m43s
CI / typecheck (pull_request) Successful in 1m46s
CI / quality (pull_request) Successful in 1m45s
CI / integration_tests (pull_request) Failing after 3m53s
CI / e2e_tests (pull_request) Successful in 4m46s
CI / unit_tests (pull_request) Failing after 4m58s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m32s
CI / status-check (pull_request) Failing after 3s
|
||
|
|
fe30961990 |
build: Updated script to match the new agent code
CI / docker (push) Blocked by required conditions
CI / helm (push) Waiting to run
CI / push-validation (push) Waiting to run
CI / status-check (push) Blocked by required conditions
CI / unit_tests (push) Has started running
CI / benchmark-publish (push) Failing after 39s
CI / lint (push) Successful in 1m6s
CI / typecheck (push) Successful in 1m17s
CI / quality (push) Successful in 1m45s
CI / security (push) Successful in 2m27s
CI / coverage (push) Waiting to run
CI / build (push) Successful in 36s
CI / integration_tests (push) Failing after 7m7s
CI / e2e_tests (push) Successful in 8m2s
|
||
|
|
f829e68911 |
fix(actor): resolve registry.add() rejection of spec-compliant actor YAML
CI / benchmark-regression (push) Has been skipped
CI / helm (push) Successful in 29s
CI / build (push) Successful in 50s
CI / lint (push) Successful in 1m3s
CI / typecheck (push) Successful in 1m23s
CI / quality (push) Successful in 1m38s
CI / security (push) Successful in 1m43s
CI / push-validation (push) Successful in 27s
CI / integration_tests (push) Successful in 3m36s
CI / e2e_tests (push) Successful in 4m6s
CI / unit_tests (push) Successful in 4m53s
CI / docker (push) Successful in 1m29s
CI / coverage (push) Successful in 11m4s
CI / status-check (push) Successful in 4s
CI / benchmark-publish (push) Successful in 1h23m24s
CI / lint (pull_request) Successful in 1m10s
CI / typecheck (pull_request) Successful in 1m16s
CI / security (pull_request) Successful in 1m15s
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 36s
CI / helm (pull_request) Successful in 39s
CI / build (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 1m37s
CI / integration_tests (pull_request) Successful in 3m57s
CI / e2e_tests (pull_request) Successful in 4m13s
CI / unit_tests (pull_request) Successful in 4m27s
CI / docker (pull_request) Successful in 1m30s
CI / coverage (pull_request) Successful in 10m39s
CI / status-check (pull_request) Successful in 3s
CI / benchmark-regression (pull_request) Successful in 1h4m37s
The ActorRegistry.add() method rejected spec-compliant YAML that uses the
actors: map format with nested config: blocks because it only looked for
provider/model at the top level of the blob. Four changes fix this:
1. _extract_v2_actor() now handles both the spec-canonical actors: key and
the legacy agents: key, with actors: taking precedence. It also supports
the combined actor field format (e.g. "openai/gpt-4") from the spec.
2. _extract_v2_options() mirrors the same actors:/agents: support.
3. registry.add() now unconditionally calls _extract_v2_actor() so that
nested unsafe flags and graph descriptors are always captured — even
when top-level provider/model are present. This eliminates the
behavioural asymmetry with from_blob().
4. The unsafe confirmation gate now runs before the duplicate-actor check,
and the graph_descriptor resolution uses explicit is-not-None checks
to distinguish "not set" from "set to empty dict".
Review fixes (cycle 4):
- Added 9 new Behave scenarios: _extract_v2_options edge cases (empty map,
None, list, missing options key), _extract_v2_actor with unsafe=True,
add() with missing name field, top-level unsafe: true (rejection +
acceptance), and multi-actor unsafe limitation documentation.
- Added graph descriptor assertions to all _extract_v2_actor direct
scenarios that were missing them.
- Fixed unsafe field coercion to use explicit boolean check (is True or
== 1) instead of bool() to prevent truthy non-boolean values like
"no" from being treated as unsafe.
- Added legacy graph key fallback (blob.get("graph")) in add() for
consistency with from_blob().
- Fixed _StubActorService.upsert_actor to handle set_default parameter
and pass non-None config_blob to Actor.compute_hash().
- Updated stale CLI comment about registry.add() capabilities.
- Applied ruff format to step definitions.
Review fixes (cycle 5 — external review):
- T1/T2/T3: Added unsafe coercion edge-case tests for 1.0 (float→True),
2 (int>1→False), and 0 (int zero→False).
- T4/T5/T6: Added _extract_v2_options tests for non-dict first entry,
missing config block, and actors: preference over agents:.
- T7: Added integration test for top-level graph_descriptor key.
- T8: Added integration tests for top-level provider_type/model_id aliases.
- T9: Added integration tests for top-level unsafe string coercion ("yes"/"no").
- S1: effective_unsafe now includes unsafe/allow_unsafe params to match
from_blob() and spec rule.
- S2: CHANGELOG entry expanded with multi-actor rejection, options
preservation, and coercion fix.
- B1: Changed v2_options guard from truthiness to is-not-None check.
- P1: _extract_v2_options() now returns a shallow copy.
- P2: Nested options overwrite non-dict top-level options values.
- Q3: Fixed comment variable name (unsafe_raw → top_unsafe_raw).
- S3: Added spec-extension comment for provider_type/model_id aliases.
- S4/B3: Cached actors_raw in multi-actor guard; added cross-ref comment.
- Q5: Added TODO(#10832) to _StubActorService duplicate.
- Q6: Replaced misleading (M2) label with (unsafe coercion).
Review fixes (cycle 6 — agent review):
- MAJ-1: Removed allow_unsafe from effective_unsafe computation.
allow_unsafe is a permission flag, not an assertion; it should not
mark a non-unsafe actor as unsafe. Updated docstring to clarify
the semantic difference between unsafe and allow_unsafe.
- MIN-1: Changed provider/model alias resolution in _extract_v2_actor()
from or-based to is-not-None checks for consistency with
_resolve_actors_map() and add().
- MIN-2: Added test scenario for allow_unsafe=True on non-unsafe YAML.
- MIN-3: Added test scenarios for top-level unsafe: 1 (integer)
rejection without flag and acceptance with flag.
- MIN-4: Added test scenario for graph descriptor additional keys loop
(routes key propagation).
- MIN-5: Added test scenario for non-dict top-level options with nested
options.
- MIN-9: Applied ruff format to step file (removed unnecessary parens).
- NIT-1: Differentiated redundant scenario to test graph descriptor
agent key value instead of duplicating assertions.
- NIT-2: Added test scenario verifying config_blob source: "yaml" default.
- NIT-5: Changed _resolve_actors_map() return type to use
Literal["actors", "agents"] for stronger type safety.
Includes 78 Behave scenarios covering spec-compliant actors: map,
legacy agents: map, top-level fields, rejection of missing provider/model,
combined actor field edge cases, update=True path, schema_version and
compiled_metadata forwarding, actors-as-list edge case, empty actors dict
blocking agents fallback, malformed actor field parts, reverse precedence
for the combined actor field, _extract_v2_options edge cases, unsafe=True
detection, missing name rejection, top-level unsafe, multi-actor
rejection, unsafe coercion edge cases (1.0, 2, 0, "yes", "no"),
top-level graph_descriptor, provider_type/model_id aliases,
_extract_v2_options structural parity with _extract_v2_actor,
allow_unsafe on non-unsafe YAML, top-level unsafe: 1 (integer),
graph descriptor additional keys, non-dict top-level options,
and config_blob source default.
ISSUES CLOSED: #4466
|
||
|
|
0c5b140d29 |
fix(database): include alembic files in package distribution
CI / push-validation (pull_request) Successful in 18s
CI / lint (pull_request) Successful in 26s
CI / helm (pull_request) Successful in 38s
CI / build (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 54s
CI / security (pull_request) Successful in 55s
CI / typecheck (pull_request) Successful in 57s
CI / e2e_tests (pull_request) Successful in 4m48s
CI / unit_tests (pull_request) Successful in 8m5s
CI / integration_tests (pull_request) Successful in 9m23s
CI / docker (pull_request) Successful in 1m23s
CI / coverage (pull_request) Successful in 12m29s
CI / benchmark-regression (push) Failing after 0s
CI / benchmark-publish (push) Failing after 0s
CI / status-check (pull_request) Successful in 1s
CI / push-validation (push) Successful in 12s
CI / helm (push) Successful in 29s
CI / build (push) Successful in 3m23s
CI / lint (push) Successful in 3m38s
CI / quality (push) Successful in 3m40s
CI / security (push) Successful in 4m3s
CI / typecheck (push) Successful in 4m5s
CI / e2e_tests (push) Successful in 6m42s
CI / unit_tests (push) Successful in 10m7s
CI / integration_tests (push) Successful in 10m13s
CI / docker (push) Successful in 1m46s
CI / coverage (push) Successful in 10m58s
CI / status-check (push) Successful in 2s
Move alembic configuration and migration files from repository root into the Python package structure to ensure they are included in the wheel distribution. This fix resolves the FileNotFoundError when running `agents init` in Docker containers or any environment using the built wheel distribution. Changes: - Move alembic/ directory from repo root to src/cleveragents/infrastructure/database/migrations/ - Move alembic.ini to the same new location and update script_location setting - Update MigrationRunner._find_alembic_ini() to search from the new canonical location within the package - Update create_template_db.py to point to the new alembic.ini location - Update documentation references to reflect new migration file locations - Create __init__.py for migrations package - The env.py file is imported when running tests that verify all modules can be imported without errors. However, context.config is only available when alembic is actually running migrations, not during normal module imports. This caused an AttributeError when the test tried to import the migrations.env module. - Fix by using getattr() with a default value to safely access context.config, and guard all code that uses config with None checks. This allows the module to be safely imported while still functioning correctly during migrations. Testing: - Verified MigrationRunner can locate alembic.ini in new location - Tested agents init succeeds in creating project with database - Template database creation works correctly - All migration tests should pass without changes Alembic files now follow standard Python packaging conventions, making them automatically included in wheel distributions without special configuration. ISSUES CLOSED: #4180 |
||
|
|
449c33b752 |
style(tests): apply ruff format to run_behave_parallel.py
CI / lint (pull_request) Successful in 19s
CI / quality (pull_request) Successful in 20s
CI / security (pull_request) Successful in 43s
CI / typecheck (pull_request) Successful in 53s
CI / build (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 23s
CI / push-validation (pull_request) Successful in 20s
CI / e2e_tests (pull_request) Successful in 3m43s
CI / unit_tests (pull_request) Successful in 7m32s
CI / docker (pull_request) Successful in 13s
CI / integration_tests (pull_request) Successful in 7m35s
CI / coverage (pull_request) Successful in 13m33s
CI / benchmark-regression (push) Failing after 0s
CI / benchmark-publish (push) Failing after 0s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 27s
CI / typecheck (push) Successful in 1m19s
CI / quality (push) Successful in 29s
CI / security (push) Successful in 1m25s
CI / build (push) Successful in 24s
CI / push-validation (push) Successful in 20s
CI / helm (push) Successful in 30s
CI / e2e_tests (push) Successful in 3m35s
CI / unit_tests (push) Successful in 6m6s
CI / integration_tests (push) Successful in 6m18s
CI / docker (push) Successful in 26s
CI / coverage (push) Successful in 12m18s
CI / status-check (push) Successful in 2s
Fix formatting of conditional expression in _is_btrfs_or_overlayfs() that was flagged by ruff format --check in CI. |
||
|
|
4fc4d7863c |
fix(tests): prevent behave-parallel multiprocessing deadlock on btrfs/overlayfs
Detect btrfs and overlayfs filesystems and automatically fall back to sequential mode to prevent deadlocks caused by SQLite WAL file locking and btrfs COW copy-up locks when multiple forked workers try to access the same files simultaneously. The fix adds a _is_btrfs_or_overlayfs() function that: 1. Attempts to detect the filesystem type using stat command 2. Falls back to reading /proc/mounts if stat fails 3. Returns True if the filesystem is btrfs or overlayfs The sequential mode condition is updated to include this check, ensuring that on affected filesystems, all features run in a single process instead of being split across multiple forked workers. ISSUES CLOSED: #9390 |
||
|
|
b8732dfc6f |
fix(tests): resolve nox unit_tests timeout for agent_skills_loader and skill_search features
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 17s
CI / push-validation (pull_request) Successful in 10s
CI / lint (pull_request) Successful in 39s
CI / quality (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 52s
CI / security (pull_request) Successful in 53s
CI / e2e_tests (pull_request) Successful in 2m13s
CI / coverage (pull_request) Successful in 5m35s
CI / integration_tests (pull_request) Successful in 6m40s
CI / unit_tests (pull_request) Successful in 7m38s
CI / docker (pull_request) Successful in 1m45s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 16s
CI / quality (push) Successful in 17s
CI / build (push) Successful in 23s
CI / helm (push) Successful in 24s
CI / typecheck (push) Successful in 53s
CI / security (push) Successful in 53s
CI / push-validation (push) Successful in 38s
CI / e2e_tests (push) Successful in 3m14s
CI / unit_tests (push) Successful in 6m37s
CI / integration_tests (push) Successful in 6m39s
CI / docker (push) Successful in 12s
CI / coverage (push) Successful in 10m53s
CI / status-check (push) Successful in 1s
Adjusted test running and file-detection logic to stabilize unit tests in overlayfs environments and improve target feature handling. - Modified scripts/run_behave_parallel.py to run sequentially when there are 2 or fewer feature files, avoiding fork deadlocks on overlayfs and reducing nox-based unit test timeouts for agent_skills_loader and skill_search features. - Updated noxfile.py to correctly detect feature files in posargs, fixing the prior logic that appended the "features/" directory when specific feature files were provided. This ensures precise test selection and avoids unnecessary path expansion. Rationale: These changes address the root causes of flaky unit test timeouts by preventing problematic forking behavior with small feature sets and by ensuring nox respects explicitly provided feature file paths. ISSUES CLOSED: #9374 |
||
|
|
8b2e0c81c5 |
fix(testing): print behave-parallel worker logs only for failed chunks
CI / lint (pull_request) Successful in 20s
CI / helm (pull_request) Successful in 33s
CI / push-validation (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 3m36s
CI / build (pull_request) Successful in 3m44s
CI / typecheck (pull_request) Successful in 4m30s
CI / security (pull_request) Successful in 4m37s
CI / e2e_tests (pull_request) Successful in 6m54s
CI / unit_tests (pull_request) Successful in 9m46s
CI / integration_tests (pull_request) Successful in 9m51s
CI / docker (pull_request) Successful in 1m33s
CI / coverage (pull_request) Successful in 10m53s
CI / status-check (pull_request) Successful in 0s
CI / security (push) Successful in 41s
CI / helm (push) Successful in 31s
CI / push-validation (push) Successful in 33s
CI / lint (push) Successful in 3m17s
CI / build (push) Successful in 3m16s
CI / quality (push) Successful in 3m38s
CI / typecheck (push) Successful in 4m16s
CI / e2e_tests (push) Successful in 6m35s
CI / unit_tests (push) Successful in 10m18s
CI / integration_tests (push) Successful in 10m21s
CI / docker (push) Successful in 1m36s
CI / coverage (push) Successful in 10m47s
CI / status-check (push) Successful in 0s
In parallel mode, the behave runner previously replayed captured stdout/stderr for every worker chunk, creating noisy output that obscured failure diagnostics in CI and local runs. Changes to scripts/run_behave_parallel.py: - Added _chunk_has_failures() and _chunk_no_scenarios_ran() helpers to evaluate individual chunk summaries for failure/error/crash conditions. - Updated the aggregation loop in main() to conditionally replay captured stdout/stderr only for chunks whose summary indicates failures, errors, or no scenarios ran (crash detection). Passing chunks now suppress their output entirely. - Added robust exception handling in _worker_run_features() so that worker crashes produce a full traceback in stderr and return a crash summary with features.errors = 1, enabling the parent to detect the crash via _chunk_has_failures (and also _chunk_no_scenarios_ran, since no scenarios reached a terminal state) and replay the diagnostics. - The conditional replay uses summary-based checks rather than the raw runner.run() boolean, consistent with the existing exit-code logic. This avoids spurious log replay for @tdd_expected_fail scenarios whose runner.run() returns True even though the TDD inversion handler has corrected the scenario status to passed. - Existing summary merge, exit semantics, and the no-scenarios safety net are fully preserved. New Behave unit tests (17 scenarios) cover the chunk-level helpers, the conditional aggregation loop, the pure no-scenarios-ran path, stderr replay for non-crash failed chunks, and the worker crash path. New Robot integration tests (6 test cases) verify the same behavior end-to-end via the helper_behave_parallel_log_filtering.py script. Also updated: - CHANGELOG.md: add unreleased entry for this behavioral change. - features/steps/behave_parallel_log_filtering_steps.py: use contextlib.redirect_stdout/redirect_stderr instead of manual sys.stdout assignment; register module in sys.modules; document CWD requirement in _load_runner_module(). - robot/helper_behave_parallel_log_filtering.py: move import io to top-level; remove redundant inline imports; use contextlib for output capture; register module in sys.modules; document CWD requirement. Branch note: the canonical branch for this fix is bugfix/m3-behave-parallel-failed-chunk-logs. The PR head branch (bugfix/mX-behave-parallel-failed-chunk-logs) cannot be renamed via the Forgejo API; both branches are kept in sync at the same SHA. ISSUES CLOSED: #8351 |
||
|
|
4c0f3e1da9 |
fix(tests): fix create_template_db.py to create writable SQLite template database
CI / push-validation (push) Successful in 17s
CI / helm (push) Successful in 23s
CI / build (push) Successful in 30s
CI / lint (push) Successful in 43s
CI / quality (push) Successful in 48s
CI / typecheck (push) Successful in 53s
CI / security (push) Successful in 53s
CI / e2e_tests (push) Successful in 3m22s
CI / integration_tests (push) Successful in 6m42s
CI / unit_tests (push) Successful in 7m47s
CI / docker (push) Successful in 1m31s
CI / coverage (push) Successful in 12m9s
CI / status-check (push) Successful in 1s
CI / push-validation (pull_request) Successful in 13s
CI / helm (pull_request) Successful in 26s
CI / lint (pull_request) Successful in 33s
CI / build (pull_request) Successful in 38s
CI / quality (pull_request) Successful in 45s
CI / typecheck (pull_request) Successful in 49s
CI / security (pull_request) Successful in 55s
CI / e2e_tests (pull_request) Successful in 3m38s
CI / integration_tests (pull_request) Successful in 6m40s
CI / unit_tests (pull_request) Successful in 7m44s
CI / docker (pull_request) Successful in 10s
CI / coverage (pull_request) Successful in 12m9s
CI / status-check (pull_request) Successful in 3s
Added os.chmod(db_path, 0o664) after database creation to ensure the template database has writable permissions. This prevents sqlite3.OperationalError: attempt to write a readonly database when tests copy and modify the template during test setup. The template database is now created with rw-rw-r-- (664) permissions instead of the default rw-r--r-- (644), allowing the test runner process to write to it. ISSUES CLOSED: #9372 |
||
|
|
6559a0e9df |
docs: integrate docs-writer automation tracking workflows
CI / lint (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 49s
CI / typecheck (pull_request) Successful in 58s
CI / security (pull_request) Successful in 53s
CI / build (pull_request) Successful in 24s
CI / push-validation (pull_request) Successful in 20s
CI / helm (pull_request) Successful in 23s
CI / e2e_tests (pull_request) Successful in 4m3s
CI / integration_tests (pull_request) Successful in 8m37s
CI / unit_tests (pull_request) Successful in 11m26s
CI / coverage (pull_request) Successful in 14m48s
CI / docker (pull_request) Successful in 11s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 19s
CI / quality (push) Successful in 45s
CI / security (push) Successful in 1m0s
CI / typecheck (push) Successful in 1m29s
CI / build (push) Successful in 39s
CI / helm (push) Successful in 25s
CI / push-validation (push) Successful in 18s
CI / e2e_tests (push) Successful in 4m42s
CI / integration_tests (push) Successful in 7m12s
CI / unit_tests (push) Successful in 8m52s
CI / coverage (push) Successful in 13m35s
CI / docker (push) Successful in 16s
CI / status-check (push) Successful in 1s
- document docs-writer responsibilities and automation tracking requirements\n- enforce automation tracking label validation and clean coverage regression tags\n\nISSUES CLOSED: #7616 # Conflicts: # CHANGELOG.md # docs/development/automation-tracking.md # docs/development/docs-writer.md # mkdocs.yml |
||
|
|
0bd8fbb296 |
fix(ci): resolve lint errors and remove stale tdd_expected_fail tag (#5264)
CI / benchmark-publish (push) Waiting to run
CI / lint (push) Successful in 27s
CI / quality (push) Successful in 41s
CI / typecheck (push) Successful in 54s
CI / security (push) Successful in 1m2s
CI / benchmark-regression (push) Waiting to run
CI / build (push) Successful in 43s
CI / helm (push) Successful in 41s
CI / push-validation (push) Successful in 28s
CI / integration_tests (push) Successful in 3m59s
CI / e2e_tests (push) Successful in 4m6s
CI / unit_tests (push) Successful in 6m5s
CI / docker (push) Successful in 12s
CI / coverage (push) Successful in 12m17s
CI / status-check (push) Successful in 1s
## Summary The `lint` and `integration_tests` CI jobs on `master` are currently failing. This PR fixes both: 1. **Lint (`nox -e lint`)** — 51 ruff violations in `scripts/validate_automation_tracking.py`: - Sorted imports per isort convention - Replaced deprecated `typing.List`/`Dict`/`Tuple`/`Optional` with builtin equivalents (`list`, `dict`, `tuple`) - Removed unused `Optional` import and unused local variable `issues` - Fixed trailing whitespace, blank-line whitespace, and 6 lines exceeding 88-char limit - Replaced `dict.keys()` with `dict` in membership tests - Added return type annotation to `main()` 2. **Integration tests (`nox -e integration_tests`)** — 1 failure in `robot/coverage_threshold.robot`: - Removed `tdd_expected_fail`, `tdd_issue`, and `tdd_issue_4305` tags from the `Noxfile Contains Coverage Threshold Constant` test - The bug this TDD tag tracked (issue #4305) is now fixed — `COVERAGE_THRESHOLD = 97` exists in `noxfile.py` - The TDD expected-fail listener was inverting the passing result to a failure ### Local verification - `nox -e lint` — All checks passed - `nox -e integration_tests` — 1962 tests, 1962 passed, 0 failed, 0 skipped ### Files changed | File | Change | |------|--------| | `scripts/validate_automation_tracking.py` | Fixed all 51 lint violations | | `robot/coverage_threshold.robot` | Removed stale `tdd_expected_fail` tag | Closes #5266 Reviewed-on: #5264 Co-authored-by: Rui Hu <rui.hu@cleverthis.com> Co-committed-by: Rui Hu <rui.hu@cleverthis.com> |
||
|
|
f2fc8f771e |
feat: add port checking to opencode-builder script
CI / build (push) Successful in 18s
CI / push-validation (push) Successful in 19s
CI / lint (push) Failing after 24s
CI / helm (push) Successful in 23s
CI / quality (push) Successful in 32s
CI / security (push) Successful in 59s
CI / typecheck (push) Successful in 1m7s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / e2e_tests (push) Successful in 3m4s
CI / integration_tests (push) Failing after 4m4s
CI / unit_tests (push) Successful in 5m9s
CI / docker (push) Has been skipped
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Has been cancelled
- Add check_opencode_running() function to detect existing OpenCode server - Skip server startup if OpenCode already running on target port - Display prominent warning when connecting to existing server - Only manage server lifecycle when script starts its own server - Add OWN_SERVER flag to track server ownership - Update cleanup logic to leave existing servers running This enables multiple developers and automation scripts to safely run in parallel without conflicting server management. |
||
|
|
a323f07783 |
feat: implement new automation tracking system for agent supervision
CI / push-validation (push) Successful in 16s
CI / build (push) Successful in 19s
CI / helm (push) Successful in 23s
CI / lint (push) Failing after 35s
CI / quality (push) Successful in 43s
CI / security (push) Successful in 52s
CI / typecheck (push) Successful in 1m3s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Failing after 4m4s
CI / unit_tests (push) Successful in 4m58s
CI / docker (push) Has been skipped
CI / e2e_tests (push) Successful in 6m24s
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Has been cancelled
Replace shared session state issue tracking with individual tracking issues per agent to reduce noise and improve searchability. **Agent Updates:** - session-persister: [AUTO-SESSION] prefix with cycle management - implementation-orchestrator: [AUTO-IMP-POOL] prefix for health reports - system-watchdog: [AUTO-WATCHDOG] prefix for system health - backlog-groomer: [AUTO-GROOMER] prefix + backup cleanup functionality - human-liaison: [AUTO-LIAISON] prefix for status updates **New Features:** - Standardized issue title format: [AUTO-<PREFIX>] <TYPE> (Cycle <N>) - Announcement format: [AUTO-<PREFIX>] Announce: <message> - Automatic cleanup to prevent issue accumulation - Required 'Automation Tracking' label for filtering - Validation script for format compliance **Documentation:** - Complete system documentation at docs/development/automation-tracking.md - Added to mkdocs.yml navigation - Validation script at scripts/validate_automation_tracking.py **Benefits:** - Reduced noise from shared tracking issue - Better searchability with agent-specific prefixes - Cleaner history per agent type - Easier debugging with focused issue threads - Automatic cleanup prevents accumulation Closes automation tracking system implementation requirements. |
||
|
|
73afe58cfe
|
build: runner for opencode project-builder
CI / benchmark-publish (push) Waiting to run
CI / lint (push) Successful in 34s
CI / quality (push) Successful in 41s
CI / typecheck (push) Successful in 48s
CI / security (push) Successful in 1m5s
CI / benchmark-regression (push) Waiting to run
CI / build (push) Successful in 24s
CI / helm (push) Successful in 22s
CI / unit_tests (push) Successful in 7m6s
CI / docker (push) Successful in 20s
CI / coverage (push) Successful in 10m0s
CI / e2e_tests (push) Successful in 16m13s
CI / integration_tests (push) Successful in 22m44s
CI / status-check (push) Successful in 1s
|
||
|
|
02250473ad |
fix(ci): restore all CI quality gates to passing on master
Fix all failing CI quality gates (lint, unit_tests, format) without suppressing any quality enforcement. Root causes and fixes: 1. Format: features/steps/plan_namespaced_name_tdd_steps.py had trailing whitespace; fixed by running ruff format. 2. Unit tests - A2A JSON-RPC 2.0 migration (commit |
||
|
|
70e2ce4386 |
Merge pull request 'fix(infra): resolve TLS handshake failure on git.dev.cleveragents.com' (#1865) from fix/infra-tls-handshake-failure-git-dev into master
CI / lint (push) Failing after 26s
CI / security (push) Failing after 53s
CI / typecheck (push) Failing after 1m8s
CI / helm (push) Successful in 36s
CI / build (push) Has been cancelled
CI / quality (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / unit_tests (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / status-check (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / benchmark-regression (push) Has been cancelled
|
||
|
|
8c81f13758 |
fix(infra): resolve TLS handshake failure on git.dev.cleveragents.com
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / helm (pull_request) Successful in 24s
CI / lint (pull_request) Failing after 28s
CI / quality (pull_request) Successful in 35s
CI / security (pull_request) Failing after 48s
CI / typecheck (pull_request) Failing after 50s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m46s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Failing after 13m19s
CI / integration_tests (pull_request) Failing after 21m9s
CI / status-check (pull_request) Failing after 1s
The TLS handshake failure on git.dev.cleveragents.com was caused by the hostname being absent from the certificate's Subject Alternative Names (SANs), or by SNI virtual-host misconfiguration on the server side. This commit delivers the repository-side remediation: - scripts/check-tls-cert.py: New TLS certificate health-check script. Connects to a hostname, verifies the certificate's SANs include the target hostname, checks expiry, and reports errors/warnings. Accepts an injectable SSLContext for unit testing without real network access. Supports wildcard SAN matching and configurable expiry warning threshold. - docs/development/ops-runbook.md: New ops runbook documenting the full certificate renewal procedure (Let's Encrypt/certbot and manual CA), SNI misconfiguration diagnosis steps, expiry monitoring with cron, and recommended alert thresholds (30/14/7/0 days). - features/tls_certificate_check.feature: 14 Behave scenarios tagged @tdd_issue @tdd_issue_1543 covering: missing SAN detection, valid SAN acceptance, expired certificate detection, expiry warning threshold, TLS handshake errors, connection timeouts, connection refused, wildcard SAN matching, and _hostname_matches_san unit tests. - features/steps/tls_certificate_check_steps.py: Step definitions for the above feature, using unittest.mock to inject SSL contexts and socket connections so no real network calls are made. - mkdocs.yml: Added Ops Runbook to the Development section navigation. The actual server-side certificate renewal (adding git.dev.cleveragents.com as a SAN and reloading the web server) must be performed by the server administrator following the procedure in docs/development/ops-runbook.md. Closes #1543 ISSUES CLOSED: #1543 |
||
|
|
37586882b3 |
chore(ci): extract behave-parallel runner script from noxfile.py into scripts/
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 17s
CI / build (pull_request) Successful in 21s
CI / helm (pull_request) Successful in 23s
CI / security (pull_request) Failing after 46s
CI / typecheck (pull_request) Failing after 49s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m48s
CI / docker (pull_request) Has been skipped
CI / quality (pull_request) Successful in 3m41s
CI / e2e_tests (pull_request) Failing after 16m17s
CI / integration_tests (pull_request) Failing after 21m20s
CI / status-check (pull_request) Failing after 1s
Move the large embedded `_BEHAVE_PARALLEL_CLI_SOURCE` string constant out of noxfile.py and into a standalone `scripts/run_behave_parallel.py` module. The `_install_behave_parallel()` helper now reads the script from disk via `Path(__file__).parent / 'scripts' / 'run_behave_parallel.py'` instead of embedding the source as a raw string literal. This allows ruff to lint and type-check the runner independently, and makes noxfile.py significantly shorter and easier to read. No functional changes: the installed `behave-parallel` entry point is identical to the previous embedded version. Parallel and sequential modes, coverage integration, and the multiprocessing fork model are all preserved. Fixed two SIM105 lint violations in the extracted script (replaced try/except/pass with contextlib.suppress). ISSUES CLOSED: #1538 |
||
|
|
a8f7ed57cb |
perf(tests): reduce per-feature startup cost with shared fixtures and lazy imports
Created scripts/create_template_db.py that builds a pre-migrated SQLite template database using Base.metadata.create_all() + alembic stamp (~5ms for 34 tables, vs ~0.5-3s x 25 Alembic migrations per scenario). Nox unit_tests and coverage_report sessions generate the template before test execution and propagate CLEVERAGENTS_TEMPLATE_DB env var to all workers. features/environment.py before_all() installs a monkey-patch on MigrationRunner.init_or_upgrade that copies the template for fresh scenario temp DBs, falling through to real migrations for :memory:, existing files, and migration-runner unit tests. Quick wins: sleep(0.5) -> sleep(0.05) in cli_streaming wait step; removed redundant Background re-declaration in cli_streaming.feature scenario 7. ISSUES CLOSED: #483 |
||
|
|
761db2518c |
test: harden code sandbox, add path traversal protection, and fix test mocks
CI / lint (pull_request) Failing after 3s
CI / typecheck (pull_request) Failing after 3s
CI / coverage (pull_request) Has been skipped
CI / quality (pull_request) Failing after 5s
CI / security (pull_request) Failing after 6s
CI / behave (3.11) (pull_request) Failing after 2s
CI / behave (3.12) (pull_request) Failing after 2s
CI / behave (3.13) (pull_request) Failing after 3s
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Has been skipped
CI / build (pull_request) Failing after 3s
|
||
|
|
7caac2714e |
refactor: changes requested by Rui
Removed `run-semgrep.sh` and automatically run setup-dev.sh |
||
|
|
7ef5ebb695 |
feat: Add Q0: Pre-commit hooks setup.
This should automatically check for problems on build. |
||
|
|
1486aa9de7
|
Removed sync and install scripts | ||
|
|
9008f1a99d
|
Tentatively finishing phase 1 | ||
|
|
b941ef9a1a
|
Significantly revamped the base project to use more robust static checking including benchmarks and integration test support | ||
|
|
f7a5d26c41
|
Modernized build tooling |