Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ uv run pytest --cov=ofw --cov-report=term-missing --cov-fail-under=90 -q
uvx --from radon radon cc -s -a src tests plugins/openflywheel/scripts/mcp_server.py
python3 ~/.codex/skills/.system/skill-creator/scripts/quick_validate.py plugins/openflywheel/skills/trace-query-planner
python3 ~/.codex/skills/.system/skill-creator/scripts/quick_validate.py plugins/openflywheel/skills/outcome-recorder
python3 ~/.codex/skills/.system/skill-creator/scripts/quick_validate.py plugins/openflywheel/skills/failure-miner
python3 ~/.codex/skills/.system/plugin-creator/scripts/validate_plugin.py plugins/openflywheel
```

Expand Down
8 changes: 4 additions & 4 deletions plugins/openflywheel/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openflywheel",
"version": "0.4.0",
"description": "Initialize ITSM-bench harness workspaces, query Langfuse trajectories, and record authoritative verifier outcomes.",
"version": "0.5.0",
"description": "Initialize ITSM-bench harness workspaces, query Langfuse trajectories, and record outcomes and compact failure diagnoses.",
"author": {
"name": "OpenFlyWheel"
},
Expand All @@ -10,8 +10,8 @@
"skills": "./skills/",
"interface": {
"displayName": "OpenFlyWheel",
"shortDescription": "Initialize ITSM workspaces and inspect traces",
"longDescription": "Initialize an ITSM-bench agent-harness optimization workspace, select and inspect bounded Langfuse trajectory evidence, and record authoritative external-verifier outcomes on exact traces.",
"shortDescription": "Prepare ITSM workspaces and mine failures",
"longDescription": "Initialize an ITSM-bench agent-harness optimization workspace, inspect bounded Langfuse trajectory evidence, record authoritative outcomes, and persist compact failure diagnoses in the prepared local workspace.",
"developerName": "OpenFlyWheel",
"category": "Productivity",
"capabilities": ["Read", "Write"],
Expand Down
2 changes: 1 addition & 1 deletion plugins/openflywheel/.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"command": "uvx",
"args": [
"--from",
"git+https://github.com/divo12/OpenFlyWheel.git@6319f24",
"git+https://github.com/divo12/OpenFlyWheel.git@0d4af6e0499c54765e2f7784b48b53baf96d1ad5",
"--with",
"mcp>=1.13,<2",
"openflywheel-mcp"
Expand Down
6 changes: 6 additions & 0 deletions plugins/openflywheel/program_templates/itsm.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Use the trace tools in the smallest sufficient sequence:
deterministic text filter.
4. `get_span_context` retrieves bounded raw context only for a selected span.

For every verifier-backed failed outcome, use `$failure-miner` to locate the earliest
unrecovered causal observation and call `record_failure`. Retain the returned compact artifact
under `.workspace/failures/` before forming a harness hypothesis. Record an inconclusive
diagnosis when the evidence is insufficient. Do not copy Langfuse trace payloads into the
workspace; Langfuse remains their source of truth.

An intermediate tool error is evidence, not an outcome failure, when the agent recovered
and the verifier passed. A technically clean trajectory is still a failure when the ITSM
verifier shows that the required environment state was not achieved.
Expand Down
59 changes: 59 additions & 0 deletions plugins/openflywheel/skills/failure-miner/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: failure-miner
description: Diagnose one authoritative failed agent outcome from bounded Langfuse evidence and record the supported or inconclusive result in the prepared harness workspace. Use after record_outcome returns a fail receipt; do not use for outcome judging, cross-trace pattern mining, or harness edits.
---

# Failure Miner

Diagnose why one verifier-backed task failed. The verifier establishes the failure; the
trajectory supplies causal evidence. Require the prepared workspace root, exact failed
outcome fields, and its `outcome_score_id`. Never infer or replace the outcome.

## Investigation

Use at most 20 trace-tool calls:

1. Ground the symptom from verifier evidence: state the expected and actual outcome.
2. Call `get_trace_schema` to skim the trace before reading content.
3. Call `query_spans` with the smallest useful selectors: entity or observation ID, tool,
span type, error flag, UTC range, or deterministic text filter.
4. Call `get_span_context` only for plausible causal observations. Work backward from the
terminal mismatch through finalization, state verification, mutations, tool results, and
the evidence that drove those actions.
5. Select the earliest unrecovered observation whose correction could plausibly change the
failed outcome. Earlier recovered errors remain evidence but are not the critical point.

Stop searching once the causal claim is supported. Do not fetch every page or load a complete
trace when bounded filters answer the question.

## Classification

For supported evidence, select exactly one type:

- `intent_plan_failure`: the task or constraints were misunderstood or planned incorrectly.
- `tool_interaction_failure`: tool choice, arguments, invocation, or recovery was defective.
- `evidence_grounding_failure`: evidence was invented, stale, omitted, or misinterpreted.
- `control_flow_failure`: execution looped, retried badly, lost state, or finalized early.
- `policy_failure`: an instruction, permission, approval, or safety boundary was violated.

Set `evidence_status=supported` only when the critical observation is among one to ten cited
observation IDs and the trace supports both a root cause and the action that should have
occurred there. A failed tool call alone is not causal if the agent recovered.

If the evidence cannot distinguish a causal explanation, set `evidence_status=inconclusive`,
leave `issue_type`, `critical_observation_id`, `root_cause`, and `counterfactual_action` empty,
and state the missing evidence in `inconclusive_reason`. Never force a category.

## Record

Call `record_failure` exactly once with the prepared worktree as `workspace_root`, the exact
Comment thread
divo12 marked this conversation as resolved.
failed outcome receipt, `evidence_status`, expected and actual outcomes, and cited observation
IDs. A supported diagnosis must also pass `issue_type`, `critical_observation_id`,
`root_cause`, and `counterfactual_action`; an inconclusive diagnosis passes only its
`inconclusive_reason` for those conditional fields. Retain the returned
`.workspace/failures/<artifact-id>.json` path. The artifact is compact diagnosis state;
Langfuse remains the source of trace content.

Do not call `record_outcome`, modify Langfuse, copy trace payloads locally, cluster failures,
generate datasets, recommend a harness component, edit the harness, or propose a repair while
following this skill. Those are later workflow phases.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "openflywheel"
version = "0.4.0"
version = "0.5.0"
description = "A governed self-improving agent harness"
requires-python = ">=3.11"
dependencies = [
Expand Down
Loading