Repository navigation
feat(engine): ouroboros takes - goal ambiguity gate, failover escalation, stagnation surfacing - #111
Merged
Merged
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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