Enforce autonomous canonical handoffs and dependency-aware concurrent task orchestration #628
Open
opened 2026-07-10 11:57:35 -05:00 by jcwalker3
·
3 comments
No Branch/Tag Specified
master
fix/issue-709-decision-lock-cross-profile
fix/issue-695-native-transport-quarantine
fix/issue-698-report-validator-schema
fix/issue-702-stale-binding-lease-recovery
fix/issue-699-structured-auth-mcp-errors
fix/issue-695-native-quarantine-v2
fix/issue-693-review-decision-lock-recovery
fix/issue-691-obsolete-reviewer-lease-cleanup
feat/issue-687-reconciler-branch-delete
fix/issue-683-workflow-guard-hardening
chore/issue-681-preserve-review-session-wip
feat/issue-604-anti-stomp-preflight
feat/issue-606-sentry-observability
fix/issue-671-block-stable-branch-push
fix/issue-675-residual-preflight-remediation
fix/issue-673-remediate-regressions-part2
fix/issue-673-remediate-regressions
feat/issue-603-lifecycle-labels
fix/issue-627-set-issue-labels-pagination
feat/issue-601-first-class-leases
feat/issue-612-incident-bridge
feat/issue-600-controller-allocator-api
fix/issue-620-head-scoped-review-locks
feat/issue-613-allocator-db-substrate
docs/mcp-stable-control-runtime-policy
feat/issue-609-prepared-review-verdict-resume
feat/issue-610-live-remote-parity
feat/issue-503-reviewer-active-worktree
feat/issue-470-preflight-contract
feat/issue-440-lock-recovery
feat/issue-440-branch-recovery
feat/issue-458-queue-fail-closed-copy
feat/issue-400-early-duplicate-work-gate
feat/issue-308-reconcile-inventory-pagination
feat/issue-308-reconcile-pagination-proof
docs/issue-261-agent-temp-artifact-cleanup
feat/issue-262-map-commit-files
fix/infra-stop-conflict-marker-false-positive
feat/issue-139-role-aware-task-routing
feat/issue-188-continuation-selection-wall
feat/issue-189-continuation-mode-proofs
feat/issue-232-refresh-wiki-proof-heads
feat/issue-210-block-workspace-edits
feat/issue-204-exact-issue-lock
docs/issue-80-label-taxonomy
docs/issue-79-safety-boundary-updates
v1.1.0
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#628
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The workflow still depends on humans to copy ready-to-paste prompts, transfer reports between LLM sessions, restate scope, choose the next role, watch dependencies, and resume blocked work.
Even when stages produce detailed handoffs, those artifacts often land only in chat-facing reports. The next worker does not automatically retrieve a validated canonical handoff through the task router/allocator. Concurrent workers can still collide, and blocked tasks can stall without structured dependency tracking or automatic resumption.
Evidence lifecycle (example only, not sole scope): Issue #601 / PR #625 — author handoff → reviewer approval → merger transition → merge → remaining reconciliation → reconciliation blocked by label-pagination defect (#627) → need for durable defect linking and later automatic resumption without user babysitting.
Impact
Desired end state
An autonomous, model-agnostic workflow that:
Ready-to-paste prompts remain allowed for debugging, recovery, one-off intake, or unsupported manual transitions — not as the normal continuation mechanism.
User-facing response policy
Visible final responses should normally contain only:
Full evidence, decisions, mutation ledger, dependencies, and continuation instructions belong in the canonical Gitea record only.
Umbrella ownership (do not duplicate components)
This is an integration umbrella. Implement by wiring and extending existing components; do not re-own sibling issues wholesale.
Component / related issues
Scope
1. Canonical issue specification (durable task definition)
Issue body remains the authoritative task definition:
Stage responses must not recopy the full specification.
2. Canonical stage handoff (automatic store)
Every non-terminal stage automatically stores a validated handoff with at least:
Continuation instructions may internally contain a complete prompt, but the workflow must deliver it to the next actor automatically.
3. Automatic handoff retrieval
At startup, a worker requests/receives the next assigned task and:
Workers must not depend on the previous LLM’s visible final response.
4. Concurrent work and exclusive task units
Multiple LLM instances may work concurrently when independent or dependency paths are clear.
At most one active worker may own the same exclusive task unit:
Prevent independent simultaneous performance of the same unit.
5. Assignment and lease requirements
Each active assignment must include repository, issue, PR when applicable, operation/stage, pinned head/version, role, session, namespace, worktree, lease owner, lease state, expiry/renewal.
Allocator must enforce:
Different issues/unrelated PRs continue concurrently.
6. Dependency graph (durable structured state)
Represent dependencies explicitly (not prose-only):
Each dependency: source, target, type, blocking condition, completion condition, current state, evidence.
7. Automatic blocking and resumption
Unresolved dependency → automatic blocked/waiting:
Dependency satisfied → reevaluate dependents, requeue runnable work, revalidate live state before continuing (no stale assumptions).
Examples: requested changes pushed → reviewer runnable; approval at current head → merger runnable; tooling-fix merged + runtime refreshed → blocked reconciliation runnable; infra restored → validation resumes; controller requests more work → author runnable.
8. Runnable task selection
Allocator policy considers state, role requirements, dependency readiness, lease availability, priority, age, repo policy, worker capability, namespace/worktree availability.
Raw monitoring incidents/unclassified observations are not automatically assignable. Only durable classified work items enter the queue.
9. Separate workflow defects
When a worker discovers out-of-scope tooling/process defect:
User may see short notice + issue link; no manual defect-prompt transfer under normal operation.
10. User-attention boundary
Request user only for:
Routine author/reviewer/merger/reconciler/allocator/dependency/retry transitions are automatic.
11. Terminal completion
Terminal only when acceptance criteria satisfied; required review/merge complete; reconciliation/cleanup complete; dependencies resolved; canonical state current; controller acceptance recorded when required.
Terminal handoff shape:
User-facing response remains brief.
Architecture investigation (authoritative ownership)
Current components to integrate:
role_session_router.py,task_capability_map.py,gitea_resolve_task_capabilityallocator_service.py(allocate_next_work), control-plane assignment APIscontrol_plane_db.py(assign_and_lease),issue_lock_store.py,pr_work_lease.pynamespace_workspace_binding.py,role_namespace_gate.pyissue_workflow_labels.py, #603canonical_thread_handoff.py,canonical_state_comments.py,canonical_comment_validator.pystate_handoff_ledger.py,thread_state_ledger_validator.pyfinal_report_validator.py, role final-report schemasissue_acceptance_gate.py, #500merged_cleanup_reconcile.py, reconciler workflowsAuthority model (target)
Rule of thumb: DB coordinates concurrency; Gitea records durable truth; handoff schema carries continuation; controller owns final acceptance; allocator delivers work without chat paste.
Where automatic continuation should occur
Safety and architectural constraints
Non-goals
Acceptance criteria
Implementation investigation notes
allocate_next_work+ control-plane assignment to return handoff reference + machine continuation package.Canonical Issue State
STATE:
needs-controller-triage
WHO_IS_NEXT:
controller
NEXT_ACTION:
Review scope, identify existing component issues, define architecture ownership, and establish implementation order
CONTINUATION:
Stored automatically in canonical workflow state for controller retrieval. Normal operation must not require the user to paste this prompt.
NEXT_PROMPT:
WHAT_HAPPENED:
Created durable umbrella issue #628 for automatic handoff retrieval, dependency-aware scheduling, concurrent workers, exclusive leases, and minimal user-facing reports. Duplicate search found no exact owner; #626 owns handoff enforcement through controller closure as a component, not full autonomy/orchestration.
WHY:
The workflow must advance safely without requiring the user to transfer prompts or continuously direct each stage.
RELATED_ISSUES:
RELATED_PRS:
BLOCKERS:
none for intake; architectural implementation order requires controller triage before author claim
VALIDATION:
Duplicate search across open/closed issues completed; component scope comparison completed; architecture ownership table recorded in issue body; no implementation begun
LAST_UPDATED_BY:
jcwalker3 / prgs-author / author / 2026-07-10T issue-intake
Canonical Issue State
STATE:
needs-controller-triage
WHO_IS_NEXT:
controller
NEXT_ACTION:
Continue implementation-order triage using soft-vs-hard dependency rules validated on issues 606 and 607; do not invent hard blocks from pairs-with prose.
NEXT_PROMPT:
WHAT_HAPPENED:
Controller validated allocator selection of issue 607 while issue 606 remained open. Not a hard-dependency defect. Clarification posted on issue 607 (comment 10436). No status:blocked mutation. Dry-run allocate_next_work role=author limit=50 selected issue 607 (valid). Issues-only limit=100 selected issue 604 (older ready wins; inventory completeness note). Soft dogfood order 606 then 607 is advisory only.
WHY:
This umbrella owns durable dependency orchestration; prose pairs-with must not be over-inferred as a hard block. Hard deps need durable signals the allocator already understands until the structured dependency graph lands.
RELATED_PRS:
no open PR for this validation slice
BLOCKERS:
none
VALIDATION:
LAST_UPDATED_BY:
jcwalker3 / prgs-author / controller session / 2026-07-12
Canonical Issue State
STATE:
ready-for-author
WHO_IS_NEXT:
author
NEXT_ACTION:
Author claims the allocator-selected next work item (issue 604) and implements only that scope; leave issues 606 and 607 unblocked and parallel-eligible.
NEXT_PROMPT:
WHAT_HAPPENED:
Controller finished 606/607 dependency validation. Durable clarification on issue 607 (comment 10436). Validation record on this issue (comment 10439). Post-correction allocator dry-run selected issue 604 as next valid author work.
WHY:
607 selection while 606 open is valid soft-relatedness; hard block was not warranted. Global author queue then returns oldest equal-priority ready issue (604) when inventory limit is adequate.
RELATED_PRS:
no open PR for this handoff
BLOCKERS:
none
VALIDATION:
22698c1LAST_UPDATED_BY:
jcwalker3 / prgs-author / controller session / 2026-07-12