Golden Path issue-task failure envelope and requeue policy
Current Verified State (2026-06-03)
Live V-B-A refreshed #9920 against current source and issue state:
- The original concern remains valid: autonomous Golden Path issue execution must not fail silently, crash the process without a durable record, or create an uncontrolled retry loop.
- The original wording is stale. Current daemon task execution is owned by
ai/daemons/orchestrator/Orchestrator.mjs, TaskStateService, and HealthService.recordTaskOutcome().
- Current daemon tasks already have generic task lifecycle telemetry:
running, completed, failed, and skipped.
- REM/Sandman cycles already have durable phase/run-state envelopes via
RemRunStateStore.
AgentOrchestrator still injects system:golden-path directives into Neo.ai.Agent, catches top-level failures, then rethrows. It does not define a stable per-issue outcome record or requeue policy.
AgentOrchestrator is not currently listed as an orchestrator daemon task in TaskDefinitions.mjs; any daemon-task integration must be explicit rather than assumed.
- No direct successor PR or issue was found for #9920.
Problem
Current substrate can tell operators that a daemon task failed, and REM runs can describe pipeline phase failures. It still lacks the contract for an autonomous issue directive failure:
- Which
issueId failed?
- Did the agent complete, block, trip the failure loop, hit a context/turn limit, crash, or exhaust the queue?
- Should the issue remain urgent, be demoted, become blocked, or require human/peer handoff?
- Where does the next Sandman/Golden Path cycle read that outcome?
Without that contract, any "requeue" implementation risks either silent suppression or retry storms.
Accepted Scope
Define and implement a durable Golden Path issue-task outcome envelope for AgentOrchestrator directives, plus a conservative requeue policy.
This ticket does not add automatic retries. It records the outcome and projects it into existing observability/handoff surfaces so the next cycle can reason from evidence.
Contract Ledger
| Surface |
Contract |
| Primary owner |
AgentOrchestrator.execute() owns per-directive outcome recording for system:golden-path work it schedules into Neo.ai.Agent. |
| Durable outcome record |
Write append-only JSONL records under a configured local path, defaulting to .neo-ai-data/agent-orchestrator/golden-path-outcomes.jsonl. Each record must include runId, issueId, description, startedAt, completedAt, status, reasonCode, retryPolicy, error, and handoffMessageId when applicable. |
| Status vocabulary |
Allowed statuses: completed, failed, blocked, expired, exhausted, crashed. Do not invent free-form statuses. |
| Reason codes |
Minimum required reason codes: agent-uncaught-error, productive-failure-tripwire, turn-limit, context-limit, tool-failure, blocked-task-state, queue-exhausted, unknown. |
| Requeue policy |
Allowed values: preserve-urgency, demote-next-cycle, blocked-handoff, no-retry. Default for unknown failures is preserve-urgency; automatic immediate retry is forbidden in V1. |
| Health projection |
If HealthService is available, call recordTaskOutcome('agent-orchestrator', status, details) with the same stable outcome fields. If unavailable, the JSONL outcome record remains the source of truth. |
| A2A / handoff |
For blocked, expired, crashed, and repeated failed outcomes, emit a peer-visible handoff via the existing A2A/task-state path and include the resulting stable identifier in handoffMessageId where available. |
| Golden Path boundary |
Do not mutate Golden Path scoring directly in V1. Golden Path remains mathematically computed from graph state. The outcome record may be rendered as a visibility section or consumed by a later explicit policy ticket, but this ticket must not silently suppress an issue from future Golden Path output. |
| Daemon-task boundary |
Do not assume AgentOrchestrator is an orchestrator daemon task. If implementation adds it to TaskDefinitions.mjs, the PR must document that as an explicit scope addition and wire TaskStateService failure handling in the same PR. |
| Evidence |
Add focused tests for outcome schema, top-level catch/failure recording, queue-exhaustion recording, no-immediate-retry behavior, and health projection fallback when HealthService is unavailable. |
Acceptance Criteria
Out of Scope
- Automatic retry loops.
- Golden Path scoring suppression/demotion without a separate explicit policy.
- Adding a new daemon task unless the PR explicitly expands scope and wires
TaskDefinitions.mjs / TaskStateService.
- Human-owned merge/retry decisions.
- Retrofitting historical failure records.
Related
- Current task-state substrate:
TaskStateService, HealthService.recordTaskOutcome(), Orchestrator.mjs
- Current issue directive substrate:
AgentOrchestrator.parseGoldenPath() / AgentOrchestrator.execute()
- REM failure precedent:
RemRunStateStore, learn/agentos/rem-state-model.md, learn/agentos/sandman-silent-failure-forensics.md
Origin Session ID: 95bf4a2b-d84e-4f70-945b-f558ba924d3a
Retrieval Hint: "AgentOrchestrator Golden Path issue outcome envelope requeue policy no retry storm"
Golden Path issue-task failure envelope and requeue policy
Current Verified State (2026-06-03)
Live V-B-A refreshed #9920 against current source and issue state:
ai/daemons/orchestrator/Orchestrator.mjs,TaskStateService, andHealthService.recordTaskOutcome().running,completed,failed, andskipped.RemRunStateStore.AgentOrchestratorstill injectssystem:golden-pathdirectives intoNeo.ai.Agent, catches top-level failures, then rethrows. It does not define a stable per-issue outcome record or requeue policy.AgentOrchestratoris not currently listed as an orchestrator daemon task inTaskDefinitions.mjs; any daemon-task integration must be explicit rather than assumed.Problem
Current substrate can tell operators that a daemon task failed, and REM runs can describe pipeline phase failures. It still lacks the contract for an autonomous issue directive failure:
issueIdfailed?Without that contract, any "requeue" implementation risks either silent suppression or retry storms.
Accepted Scope
Define and implement a durable Golden Path issue-task outcome envelope for
AgentOrchestratordirectives, plus a conservative requeue policy.This ticket does not add automatic retries. It records the outcome and projects it into existing observability/handoff surfaces so the next cycle can reason from evidence.
Contract Ledger
AgentOrchestrator.execute()owns per-directive outcome recording forsystem:golden-pathwork it schedules intoNeo.ai.Agent..neo-ai-data/agent-orchestrator/golden-path-outcomes.jsonl. Each record must includerunId,issueId,description,startedAt,completedAt,status,reasonCode,retryPolicy,error, andhandoffMessageIdwhen applicable.completed,failed,blocked,expired,exhausted,crashed. Do not invent free-form statuses.agent-uncaught-error,productive-failure-tripwire,turn-limit,context-limit,tool-failure,blocked-task-state,queue-exhausted,unknown.preserve-urgency,demote-next-cycle,blocked-handoff,no-retry. Default for unknown failures ispreserve-urgency; automatic immediate retry is forbidden in V1.HealthServiceis available, callrecordTaskOutcome('agent-orchestrator', status, details)with the same stable outcome fields. If unavailable, the JSONL outcome record remains the source of truth.blocked,expired,crashed, and repeatedfailedoutcomes, emit a peer-visible handoff via the existing A2A/task-state path and include the resulting stable identifier inhandoffMessageIdwhere available.AgentOrchestratoris an orchestrator daemon task. If implementation adds it toTaskDefinitions.mjs, the PR must document that as an explicit scope addition and wireTaskStateServicefailure handling in the same PR.HealthServiceis unavailable.Acceptance Criteria
AgentOrchestratorrecords a durable per-issue outcome for every scheduled Golden Path directive.failedorcrashedoutcome instead of only rethrowing without issue context.exhaustedorcompletedoutcome with issue context.HealthService.recordTaskOutcome('agent-orchestrator', ...)when available, with JSONL fallback as source of truth.Out of Scope
TaskDefinitions.mjs/TaskStateService.Related
TaskStateService,HealthService.recordTaskOutcome(),Orchestrator.mjsAgentOrchestrator.parseGoldenPath()/AgentOrchestrator.execute()RemRunStateStore,learn/agentos/rem-state-model.md,learn/agentos/sandman-silent-failure-forensics.mdOrigin Session ID: 95bf4a2b-d84e-4f70-945b-f558ba924d3a
Retrieval Hint:
"AgentOrchestrator Golden Path issue outcome envelope requeue policy no retry storm"