Skip to content

[c87fbc0d] Wedge ledger core: status-transition counting, reset rule, threshold blocking + CEO payload - #1364

Open
roboco-app[bot] wants to merge 5 commits into
feature/backend/c79ba38e--6966e3d8from
feature/backend/c79ba38e--6966e3d8--c87fbc0d
Open

roboco-app[bot] wants to merge 5 commits into
feature/backend/c79ba38e--6966e3d8from
feature/backend/c79ba38e--6966e3d8--c87fbc0d

Conversation

@roboco-app

@roboco-app roboco-app Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Generalize the #685 strike-breaker into a task-scoped wedge ledger in roboco/services: (1) at every status transition, regardless of actor or verb, compare the #685 progress fingerprint (commit count, revision_count, terminal children — extend it task-scoped and verb-agnostic; do NOT invent a second fingerprint) and record a strike when a task returns to a status it previously held with no fingerprint movement; counting is status-keyed, not actor-keyed, per the intake's "across any actor"; (2) reset rule — any of the three fingerprint signals moving clears the wedge counter; (3) past a configurable threshold N (default aligned with the #685 strike threshold — record the resolved default in your journal), transition the task to blocked-for-human and emit a CEO notification carrying the full cycle — actors, verbs, timestamps — so the CEO sees the shape of the loop, not just that one exists. Routes stay thin. Context: the September mixed-verb loop (unblock-OK → complete not_authorized → escalate bounce → pool reclaim) accumulated zero strikes under the per-unblock counter; that is the shape this must catch.

rennf93 and others added 2 commits November 2, 2026 20:00
…e--6966e3d8--c87fbc0d

Reconcile with slave: the stale base carried two xenon rank C
functions that slave has since fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unting, fingerprint reset rule, threshold blocking + CEO cycle payload (#1127)

* [334e1f04] feat(services): task-scoped wedge ledger — status-keyed strike counting, #685 fingerprint reset rule, threshold block + CEO cycle payload

Generalize the #685 per-unblock oscillation breaker into a task-scoped wedge
ledger that counts re-arrivals at a status across ANY actor and verb (the
September mixed-verb loop accrued zero strikes per-verb). Reuses the exact
#685 progress fingerprint [commits, revision_count, terminal_children]; any
signal moving clears every counter. Past Settings.wedge_ledger_threshold
(default 5, aligned with _OSCILLATION_TRIP_THRESHOLD) the task force-blocks
for a human and the CEO gets the full transition cycle (actor, role,
transition, timestamp) rebuilt from the audit log. Hooked as a best-effort
fresh-session background check from the _emit_status_transition_audit
chokepoint (coroner pattern). Unit tests include the September mixed-verb
loop shape.

* [334e1f04] regenerate generated artifacts

* [334e1f04] feat(services): wedge ledger reader surface — last_progress_at on fingerprint movement + public WedgeLedgerService.wedge_cycle read

Reader contract for the stuck-state payload (be-dev-1, 11a83407): the reset
path stamps last_progress_at (ISO) so active_time_since_progress needs no
audit replay; wedge_cycle(task_id) exposes the rebuilt actor/role/transition/
timestamp cycle without re-deriving the audit query. get_wedge_state carries
the new key.

* [334e1f04] fix(wedge-ledger): document trip-above-N semantics, regenerate artifacts from worktree sources

* [334e1f04] test(wedge): replace lambda side_effect with typed async capture helper

* [334e1f04] docs(services): document task-scoped wedge ledger, threshold and CEO cycle payload

* [334e1f04] regenerate generated artifacts

---------

Co-authored-by: Backend Developer 2 <be-dev-2@roboco.tech>
Co-authored-by: Renn F <rennf93@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Backend Documenter <be-doc@roboco.tech>
@github-project-automation github-project-automation Bot moved this to Backlog in RoboCo Kanban Nov 3, 2026
@github-actions github-actions Bot added documentation Docs, README, CHANGELOG, governance files area: panel Touches panel/ (Next.js control panel) area: services Touches roboco/services/ (business logic, side effects) tests Test suite changes area: agents Touches agents/ (prompts, role config) labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request on RoboCo!

Quick checklist before review (most of these are enforced by CI, but worth a glance):

  • make quality — ruff format check, ruff check, mypy, pytest (≥80% coverage), and the rest of the gate
  • Panel changes pass pnpm lint and pnpm exec tsc --noEmit (run from panel/)
  • No # noqa / # type: ignore shortcuts; pre-existing violations in touched files are fixed
  • Added an entry under ## [Unreleased] in CHANGELOG.md
  • Signed the CLA (the bot will prompt you on this PR)
  • Signed your commits — master requires verified signatures (SSH signing setup)
  • Updated any affected docs under docs/

See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow.

Welcome aboard — a maintainer will review shortly.

@roboco-app roboco-app Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In-path PR-review gate — CHANGES REQUESTED 🔴

Reviewed by pr_reviewer (RoboCo PR reviewer). Posted by the project bot account; the gate verdict is authoritative in RoboCo.

[F-dbe52f00] roboco/services/task.py:13984 (blocker) — Exactly one wedge-ledger check scheduled per status transition, so one arrival adds one strike → _emit_status_transition_audit calls _maybe_schedule_wedge_ledger_check twice (lines 13948 and 13984): two strikes per arrival, so the default N=5 trips on the 3rd static arrival → Delete one of the two calls and add a test that runs the real _emit_status_transition_audit and asserts exactly one run_wedge_ledger_check task is scheduled
[F-d0ac020c] panel/lib/lifecycle.json (blocker) — Generated artifacts stay byte-identical to what the branch's lifecycle.py and role_config produce; this task has no lifecycle changes → Diff deletes cancel_leaf, the devops role and its verbs, and task_time, and drops 'start' from i_will_plan/i_will_work_on composes, although lifecycle.py still defines cancel_leaf and DEVOPS → Rebase onto the current root branch and regenerate (scripts/regenerate_verb_tables.py and the lifecycle export), or revert these files; the diff should then touch none of them
[F-a5795a7f] roboco/services/notification.py:312 (major) — CEO notification names actor, VERB and timestamp for each step of the cycle → Each line renders only timestamp, actor, role and from->to; the audit event (the verb proxy, e.g. task.pr_fail or task.request_changes) is collected in _transition_cycle but never shown → Include the event/verb in each rendered line. If the transition verb is not recoverable from the audit row, record it in the audit details at the chokepoint
[F-360d8ebe] roboco/services/task.py:14000 (major) — The ledger check runs after the transition commits, and its marker write cannot be clobbered by the caller's transaction → The check is scheduled with asyncio.create_task mid-transaction on a fresh session. It can read pre-commit state, force BLOCKED before the caller commits its own status, or have its wedge_ledger marker overwritten when the caller later flushes task.markers → Run the check post-commit (an after-commit hook or the outbox), or do the ledger fold in the caller's session and only defer the trip
[F-36f665f3] roboco/services/notification.py:318 (minor) — Body ordering label matches the data → Body says 'Full cycle (oldest last)', but _transition_cycle reverses a DESC query, so rows come oldest FIRST → Change the label to 'oldest first' (also in the _transition_cycle and wedge_cycle docstrings)

PR 1376 (leaf 4eb71d9f) failed verify_codebase_map.py with
unmapped-module roboco/services/wedge_ledger.py; the same error already
fails this branch's tip 8eb74a1. Added the Files-table row, ran map
--fix, fixed the remaining prose line numbers by hand and rebuilt the
concat map (0 errors, 0 warnings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR 1376 (leaf 4eb71d9f): after the map fix, this branch's tip fails
make foundation-check ("Lifecycle artifacts are out of date", devops
role missing from pr_pass/claim/pr_fail rows). Ran make lifecycle and
scripts/regenerate_verb_tables.py; the output is byte-identical to what
the leaf PR already carries for these 15 files, so the merge is clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed area: panel Touches panel/ (Next.js control panel) area: agents Touches agents/ (prompts, role config) labels Nov 5, 2026
…k, verb in cycle, artifacts (#1376)

* [4eb71d9f] fix(wedge-ledger): single post-commit check, verb in CEO cycle, restore artifacts

* [4eb71d9f] restore generated artifacts to base-branch content

The automatic codegen ran with the clone root's old code (the worktree
import hook missed .venv-<digest>, fixed in #1524) and committed drift
to these 15 files. They now match the base branch byte for byte, as
finding e17ca419 asks; be-dev-2 could not read the base content itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [4eb71d9f] regenerate generated artifacts

* [4eb71d9f] docs(wedge-ledger): document post-commit single check and verb in CEO cycle

---------

Co-authored-by: Backend Developer 1 <be-dev-1@roboco.tech>
Co-authored-by: Renn F <rennf93@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Backend Developer 2 <be-dev-2@roboco.tech>
Co-authored-by: Renzo Franceschini <45401804+rennf93@users.noreply.github.com>
Co-authored-by: Backend Documenter <be-doc@roboco.tech>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: services Touches roboco/services/ (business logic, side effects) cell/backend documentation Docs, README, CHANGELOG, governance files tests Test suite changes to feature/backend/c79ba38e--6966e3d8

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant