Skip to content

feat(engine): ouroboros takes - goal ambiguity gate, failover escalation, stagnation surfacing - #111

Merged
BaaRai merged 2 commits into
mainfrom
feat/ouroboros-takes
Oct 21, 2026
Merged

BaaRai merged 2 commits into
mainfrom
feat/ouroboros-takes

Conversation

@BaaRai

@BaaRai BaaRai commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Implements the three takes from the Q00/ouroboros evaluation ticket.

1. Goal ambiguity gate (create-time, server). A task goal must name a target (URL, bare domain, IPv4, localhost:port or absolute path) and be at least 80 chars, else POST /api/tasks returns 400 with a message naming what is missing. Genuinely target-less analysis tasks opt out with the literal marker [targetless]. Rationale: the live benchmark failure where a goal naming no target passed silently and every worker went to an unrelated asset. Pure function + table test.

2. Consecutive-failure escalation (task LLM chain). Quota exhaustion already advances the chain; this adds: 3 consecutive non-quota call failures on the same chain profile advance the chain through the same transition path, recording the true reason (bad key, persistent 5xx). Streak resets on success and when it fires. Escalation-only: no auto-downgrade (mid-task model swap-down risks behavior drift and flapping; manual chain reset stays). Streaming path escalates only when nothing was committed to the caller. Unit-tested with a failing fake provider through completeTaskLLM.

3. Stagnation surfacing (planner overview). graph_overview fingerprints finished intents (case-folded, digits collapsed); any direction dispatched 3+ times with zero findings since its first attempt is surfaced in a self-describing stagnation_warning payload (directions + instruction) that tells the planner to diversify or judge the goal instead of grinding. Key absent when nothing stagnates; no prompt-template change needed on deployed installs. Pure detectStagnation + unit test.

Closes #99

…ion, stagnation surfacing

Three orchestration mechanisms from the Q00/ouroboros evaluation (#99):

- Goal ambiguity gate at task creation: a goal must name a target (URL,
  domain, IPv4, localhost:port or absolute path) and reach a length floor,
  else the API returns 400 before any token is spent. Deliberately
  target-less goals opt out with the literal marker [targetless]. Guards
  against the live failure where a goal naming no target sent every worker
  to an unrelated asset.

- Consecutive-failure escalation on the task LLM chain: quota exhaustion
  already advances the chain; now 3 consecutive non-quota call failures on
  the same chain profile advance it too, with the true reason recorded.
  Escalation-only by design (no auto-downgrade: mid-task model swaps risk
  behavior drift; the operator keeps the manual chain reset).

- Stagnation surfacing in the planner overview: finished intents are
  fingerprinted (case-folded, digits collapsed); a direction dispatched 3+
  times with zero findings since its first attempt is flagged in a
  self-describing stagnation_warning payload that instructs the planner to
  diversify instead of grinding. Absent when nothing stagnates.

Closes #99
- resetLLMFailStreaksForTest helper: the package-global streak is in-memory
  state, so the no-switch-on-ordinary-error subtests now reset it before each
  case (accumulation across subtests sharing task/profile keys made the third
  case escalate, breaking the contract the test guards)
- core lifecycle and credentials fixtures: goals now name the lab target, per
  the ambiguity gate (these tests exercise lifecycle/credentials, not the gate)
- canonical reset helper moved into task_llm.go next to the counter it resets
@BaaRai
BaaRai merged commit 6b93b10 into main Oct 21, 2026
2 checks passed
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
HTTP/工具响应含裸 NUL 字节时,json.Marshal 将其编码为 \u0000 转义,
PostgreSQL jsonb 列拒绝并抛 SQLSTATE 22P05,导致 SaveSideSnapshot 的
INSERT 每秒失败数十次刷屏。新增 jsonbClean 在 marshal 后剥除真正的
\u0000 转义(按前置反斜杠奇偶判断,避免误伤字面 \\u0000),并订正
exploration.go 中 "json.Marshal already sanitizes" 的错误注释。

Closes BaaRai#111, Closes BaaRai#112
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
feat(engine): ouroboros takes - goal ambiguity gate, failover escalation, stagnation surfacing
murilosoave pushed a commit to murilosoave/ARTEX that referenced this pull request Oct 25, 2026
Seam fix after merging BaaRai#111 (escalation) with BaaRai#114 (ctx-threaded
hooks.current): the escalation test predates the signature change and kept
compiling on its own branch, so the merge left main red.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orchestration takes from Q00/ouroboros (ambiguity gate, cost-tier router, stagnation detection)

1 participant