Files
OmniRoute/docs/sessions/20260714-issue-agent-executable-triage/02_SPECIFICATIONS.md
Diego Rodrigues de Sa e Souza 04683029a6 fix(build): exec native esbuild binary directly in prepublish (dast-smoke base-red) (#9558)
* fix(build): exec native tool binaries directly in runBuildTool

#8858 routed every resolved local bin through process.execPath to avoid
Windows .cmd shims — but esbuild >=0.25 ships bin/esbuild as the NATIVE
platform executable (ELF on Linux), so Node parsed machine code as JS and
build:cli died with 'SyntaxError: Invalid or unexpected token', turning
dast-smoke red for every PR.

runBuildTool now sniffs the entry's magic bytes (ELF / Mach-O / PE) and
execs native binaries directly; JS entries keep going through this Node
binary (the .cmd-shim avoidance #8858 wanted).

Validation (RED->GREEN on this box):
- RED: node node_modules/esbuild/bin/esbuild --version -> SyntaxError (ELF)
- GREEN: the exact failing CI step reproduced via the new logic bundles
  open-sse/mcp-server/server.ts successfully (4.2MB output, 1.3s).

* fix(docs): add MDX frontmatter to the 20 remaining docs without it

Same failure class as AGENTROUTER_WAF (#9503) and DOCKER_RELEASE_CHANNELS
(this run's dast-smoke red): any doc without frontmatter breaks the
fumadocs MDX loader during next build, killing build:cli/dast-smoke for
every PR. Swept ALL of docs/ (i18n mirrors excluded) in one pass so this
class cannot recur one file at a time.

* docs(env): document OMNIROUTE_INTERNAL_SERVICE_TOKEN(+_FILE), OPENROUTER_PROVIDER_STATS_* and embedded-Redis binding vars

Pre-existing env/docs contract drift from recently merged features made
check:env-doc-sync red for any docs-touching PR. Values and defaults read
from the defining modules (internalServiceAuth.ts, openrouterProviderStats.ts).

* fix(build): resolve bundled npm-cli.js in the standard Unix layout + safe npm fallback off-Windows

The opencode-plugin step hard-failed on GitHub runners because
resolveBundledNpmEntry only looked next to the node binary (Windows zip
layout); hostedtoolcache Node keeps npm at <prefix>/lib/node_modules/npm.
Added that candidate, and when neither exists on non-Windows the step now
falls back to plain 'npm' — the .cmd-shim hazard #8858 avoids is
Windows-only.

* test(mutation): register xai-agent-tools-passthrough.test.ts in stryker tap.testFiles

The test landed on release/v3.8.50 covering
open-sse/handlers/chatCore/passthroughHelpers.ts without the stryker
registration, so Fast Quality Gates' drift detection reds any PR that
carries it. Mechanical registration so its mutant kills count.

---------

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
2026-08-06 02:19:57 -03:00

5.5 KiB

title, version, lastUpdated
title version lastUpdated
Issue-Agent Executable Triage: Specifications 3.8.50 2026-08-06

Issue-Agent Executable Triage: Specifications

Machine status: in_progress

Acceptance Contract

ac_id requirement acceptance evidence status
AC1 Non-dry recorded triage executes through normal chat routing with selected provider, model, and policy actual issue-agent route reaches chat POST; provider-boundary mock observes selected target; policy is proven consumed by routing implemented_pending_acceptance
AC2 Persist accepted, running, and terminal state plus sanitized request/prompt, model output, usage, cost, runtime, and terminal error durable queryable record contains each field for success and failures pending
AC3 API returns a useful, structured triage result derived from model output response has stable triage schema and is not a raw opaque provider payload pending
AC4 Tests cover success, provider/model failure, timeout, and budget stop each outcome asserts HTTP response and persisted terminal record pending

API Contract (Target)

field rule
mode must be recorded-triage
execution selection accepts configured provider, model, routingPolicy, and bounded timeoutMs
runId stable execution identifier returned for every accepted run
result includes structured triage decision/summary/actions and execution metadata
errors return sanitized terminal error with explicit terminal status; never leak provider credentials or unredacted issue content

Persistence Contract (Target)

field group required values
identity run ID, issue URL/repository/number, mode, timestamps
lifecycle accepted, running, succeeded, failed, timed_out, or budget_stopped with transition timestamps
input redacted recorded context and rendered prompt fingerprint/content according to retention policy
routing requested provider/model/policy and resolved execution target
output sanitized model output and structured triage result
accounting input/output/total tokens, cost, and runtime when available
terminal error normalized code/message for failure, timeout, and budget stop

Assumptions, Risks, Uncertainties

aru_id type statement mitigation status
ARU-001 risk X-OmniRoute-Mode may not be a consumed routing-policy input in the chat route trace the policy contract and test an observable policy effect open
ARU-002 risk current catch maps all thrown execution errors to HTTP 400 and does not persist them introduce typed terminal outcomes and persistence before response mapping open
ARU-003 risk current audit row is emitted before execution and cannot represent final execution state replace/extend with append-only lifecycle records or durable run storage open
ARU-004 uncertainty provider response metadata may differ by adapter normalize accounting fields and preserve unknowns explicitly open