From 34f101c1666e40df6f65454eaf9454f602d96744 Mon Sep 17 00:00:00 2001 From: Christian Nennemann Date: Sat, 4 Apr 2026 07:33:59 +0200 Subject: [PATCH] feat: specify confidence gate parsing and mini-Explorer spawning in run skill --- skills/artifact-routing/SKILL.md | 6 ++- skills/run/SKILL.md | 73 +++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 8 deletions(-) diff --git a/skills/artifact-routing/SKILL.md b/skills/artifact-routing/SKILL.md index db7b9aa..5530752 100644 --- a/skills/artifact-routing/SKILL.md +++ b/skills/artifact-routing/SKILL.md @@ -46,6 +46,7 @@ Artifacts follow the pattern: `-.` |-------|-------|----------|--------| | plan | explorer | `plan-explorer.md` | Markdown research report | | plan | creator | `plan-creator.md` | Markdown proposal with confidence scores | +| plan | mini-explorer | `plan-mini-explorer.md` | Focused risk research (only if confidence gate triggers) | | do | maker | `do-maker.md` | Markdown implementation summary | | do | maker | `do-maker-files.txt` | Plain text, one file path per line | | check | guardian | `check-guardian.md` | Markdown verdict + findings table | @@ -89,8 +90,8 @@ Note: Address each unresolved issue listed above. Explain how your revised propo | Agent | Receives | Does NOT receive | |-------|----------|-----------------| -| **Maker** (cycle 1) | `plan-creator.md` (the proposal) | `plan-explorer.md`, reviewer outputs, raw task description | -| **Maker** (cycle 2+) | `plan-creator.md`, Maker-routed findings from `act-feedback.md` | Explorer research, Guardian/Skeptic findings (those went to Creator) | +| **Maker** (cycle 1) | `plan-creator.md` (the proposal), `plan-mini-explorer.md` (if exists) | `plan-explorer.md`, reviewer outputs, raw task description | +| **Maker** (cycle 2+) | `plan-creator.md`, `plan-mini-explorer.md` (if exists), Maker-routed findings from `act-feedback.md` | Explorer research, Guardian/Skeptic findings (those went to Creator) | **Maker context injection template (cycle 2+):** ```markdown @@ -254,6 +255,7 @@ Before injecting an artifact into an agent's context, always check if the file e | Artifact | Missing when | |----------|-------------| | `plan-explorer.md` | Fast workflow (no Explorer) | +| `plan-mini-explorer.md` | Confidence gate did not trigger for risk coverage | | `check-skeptic.md` | Fast workflow, or A2 fast-path taken | | `check-sage.md` | Fast workflow, or A2 fast-path taken | | `check-trickster.md` | Non-thorough workflow, or A2 fast-path taken | diff --git a/skills/run/SKILL.md b/skills/run/SKILL.md index 651c7dd..44fdce0 100644 --- a/skills/run/SKILL.md +++ b/skills/run/SKILL.md @@ -126,17 +126,78 @@ After Creator returns: #### 1c. Confidence Gate (Adaptation Rule A3) -Read Creator's confidence scores from `plan-creator.md`. Apply A3 per `archeflow:orchestration`: -- Task understanding < 0.5 → **Pause**, ask user -- Solution completeness < 0.5 → **Upgrade** to standard, spawn Explorer -- Risk coverage < 0.5 → **Spawn mini-Explorer** for risky area (parallel, 5 min max) +**Parsing instructions:** + +Read `plan-creator.md`, locate the `### Confidence` table. Extract scores for each axis as floats: + +```bash +CONF_FILE=".archeflow/artifacts/${RUN_ID}/plan-creator.md" + +# Extract confidence scores (expects format: "| Task understanding | 0.8 |") +TASK_UNDERSTANDING=$(grep -i "task understanding" "$CONF_FILE" | grep -oE '[0-9]+\.[0-9]+' | head -1) +SOLUTION_COMPLETENESS=$(grep -i "solution completeness" "$CONF_FILE" | grep -oE '[0-9]+\.[0-9]+' | head -1) +RISK_COVERAGE=$(grep -i "risk coverage" "$CONF_FILE" | grep -oE '[0-9]+\.[0-9]+' | head -1) + +# Fallback: if unparseable, treat as 0.7 (safe default — proceed but not overconfident) +TASK_UNDERSTANDING="${TASK_UNDERSTANDING:-0.7}" +SOLUTION_COMPLETENESS="${SOLUTION_COMPLETENESS:-0.7}" +RISK_COVERAGE="${RISK_COVERAGE:-0.7}" +``` + +**Pause branch** (Task understanding < 0.5): + +The Creator does not sufficiently understand the task. Do not spawn Maker. + +1. Emit decision event with `"chosen":"pause"` +2. Display message to user: "Creator rated task understanding at . Clarification needed before proceeding." +3. Block until the user provides clarification +4. Re-run Creator with the clarification appended to the task description -If A3 triggers, emit a `decision` event: ```bash ./lib/archeflow-event.sh "$RUN_ID" decision plan "" \ - '{"what":"confidence_gate","chosen":"","rationale":" scored "}' "$SEQ_CREATOR_COMPLETE" + '{"what":"confidence_gate","chosen":"pause","rationale":"task_understanding scored '"$TASK_UNDERSTANDING"'"}' "$SEQ_CREATOR_COMPLETE" ``` +**Upgrade branch** (Solution completeness < 0.5): + +The Creator's proposal is incomplete — more research is needed. + +1. If fast workflow: upgrade to standard, spawn Explorer, then re-run Creator with Explorer output +2. If already standard/thorough: re-run Explorer with a focused prompt targeting the incomplete areas + +```bash +./lib/archeflow-event.sh "$RUN_ID" decision plan "" \ + '{"what":"confidence_gate","chosen":"upgrade","rationale":"solution_completeness scored '"$SOLUTION_COMPLETENESS"'"}' "$SEQ_CREATOR_COMPLETE" + +# If fast → standard upgrade: +WORKFLOW="standard" +# Spawn Explorer, then re-run Creator with Explorer findings +``` + +**Mini-Explorer branch** (Risk coverage < 0.5): + +The Creator identified risks but lacks confidence in their assessment. Spawn a focused Explorer to investigate. + +``` +Agent( + description: "Mini-Explorer: investigate risk area for ", + prompt: "You are the EXPLORER archetype. The Creator rated risk coverage at . + Identified risks: + Research ONLY the risky areas. Answer: Is the risk real? What mitigations exist? What tests/guards would help? + Limit: focused output only.", + subagent_type: "Explore" +) +``` + +Save output to `.archeflow/artifacts/${RUN_ID}/plan-mini-explorer.md`. The Maker receives both `plan-creator.md` and `plan-mini-explorer.md` as context. + +```bash +./lib/archeflow-event.sh "$RUN_ID" decision plan "" \ + '{"what":"confidence_gate","chosen":"mini_explorer","rationale":"risk_coverage scored '"$RISK_COVERAGE"'"}' "$SEQ_CREATOR_COMPLETE" +``` + +**Note:** The mini-Explorer runs in parallel with Do phase preparation (5 min max). The Maker can proceed once both `plan-creator.md` and `plan-mini-explorer.md` are available. + #### 1d. Phase Transition: Plan to Do ```bash