happy-path-in-session
Scenario for Refine Plan.
Codeowner approves the refined plan inside the session
Latest run: PASS — 2026-05-10 22:59:33Z
Spec: .abtree/trees/refine-plan/TEST__happy-path-in-session.yaml
Report: .abtree/trees/refine-plan/REPORT__happy-path-in-session__20260510T225933Z.md
Test spec
yaml
feature: Refine_Plan refines a change request into an approved plan
tree: refine-plan
description: |
Happy path — the agent is interactive, a codeowner is present in the
session, and they approve the refined plan in-place. The MR fallback
branch is never reached.
background:
initial:
local:
change_request: "Add structured logging to the ingestion service so we can correlate request traces in Grafana."
environment:
interactive: true
codeowner_in_session: true
scenario:
name: Codeowner approves the refined plan inside the session
given:
- $LOCAL.change_request is set to a non-empty request string
- the agent is running interactively with a codeowner available
when:
- Understand_Intent evaluate → true ($LOCAL.change_request is set)
- Understand_Intent writes a terse bullet analysis to $LOCAL.intent_analysis
- Write_Draft evaluate → true ($LOCAL.intent_analysis is set)
- Write_Draft creates plans/drafts/<execution-id>.md and stores its path at $LOCAL.draft_path
- Critique_Draft evaluate → true ($LOCAL.draft_path is set)
- Critique_Draft edits the draft file in place — no new state keys, $LOCAL.draft_path unchanged
- Save_Plan evaluate → true ($LOCAL.draft_path is set)
- Save_Plan moves the draft to plans/<kebab-case-title>.md and stores the new path at $LOCAL.plan_path
- Save_Plan updates the plan frontmatter status to "refined"
- Save_Plan evaluate → true ($LOCAL.plan_path is set and status is "refined")
- Approve_In_Session evaluate → true ($LOCAL.plan_path is set)
- Approve_In_Session evaluate → true (session is interactive)
- Approve_In_Session asks the codeowner; they edit reviewed_by and run `abtree local write … codeowner_approved true`
- Approve_In_Session evaluate → true ($LOCAL.codeowner_approved is true)
then:
local:
change_request: non-empty
intent_analysis: non-empty terse bullets
draft_path: null # draft was moved by Save_Plan and is no longer valid
plan_path: matches "plans/.+\\.md"
codeowner_approved: true
mr_url: null
files:
plan_path:
exists: true
frontmatter:
status: refined
reviewed_by: non-empty (matches a CODEOWNERS identifier)
status: doneLatest report
Tree: refine-plan (v4.2.0) Spec: .abtree/trees/refine-plan/TEST__happy-path-in-session.yaml Target execution: test-tree-run-structured-logging-happy-p__refine-plan__1 Overall: PASS
Final $LOCAL
| key | value |
|---|---|
| change_request | "Add structured logging to the ingestion service so we can correlate request traces in Grafana." |
| intent_analysis | (terse 5-bullet analysis) |
| draft_path | null |
| plan_path | "plans/structured-logging-for-the-ingestion-service.md" |
| codeowner_approved | true |
| mr_url | null |
Assertions
| Name | Expected | Actual | Pass |
|---|---|---|---|
| status | done | done | ✓ |
| local.change_request | non-empty | non-empty (94 chars) | ✓ |
| local.intent_analysis | non-empty terse bullets | non-empty (5 bullets) | ✓ |
| local.draft_path | null | null | ✓ |
| local.plan_path | matches plans/.+\.md | "plans/structured-logging-for-the-ingestion-service.md" | ✓ |
| local.codeowner_approved | true | true | ✓ |
| local.mr_url | null | null | ✓ |
| files.plan_path.exists | true | true | ✓ |
| files.plan_path.frontmatter.status | refined | refined | ✓ |
| files.plan_path.frontmatter.reviewed_by | non-empty (CODEOWNERS id) | "Jonathan Turnock" | ✓ |
Note vs prior run: The earlier run on [email protected] failed the draft_path: null assertion because the tree only narrated the staleness. The v4.2.0 bump turned that into an explicit write null to $LOCAL.draft_path step, which this run exercised — all ten assertions now green.
Trace
mermaid
---
title: "test-tree run: structured logging happy path under v4.2.0 (complete)"
---
flowchart TD
Refine_Plan_Workflow{{"Refine Plan Workflow\n[sequence]"}}
0_Understand_Intent["Understand Intent\n[action]"]
Refine_Plan_Workflow --> 0_Understand_Intent
style 0_Understand_Intent fill:#4ade80,stroke:#16a34a,color:#052e16
0_Write_Draft["Write Draft\n[action]"]
Refine_Plan_Workflow --> 0_Write_Draft
style 0_Write_Draft fill:#4ade80,stroke:#16a34a,color:#052e16
0_Critique_Draft["Critique Draft\n[action]"]
Refine_Plan_Workflow --> 0_Critique_Draft
style 0_Critique_Draft fill:#4ade80,stroke:#16a34a,color:#052e16
0_Save_Plan["Save Plan\n[action]"]
Refine_Plan_Workflow --> 0_Save_Plan
style 0_Save_Plan fill:#4ade80,stroke:#16a34a,color:#052e16
0_Codeowner_Approval{{"Codeowner Approval\n[selector]"}}
Refine_Plan_Workflow --> 0_Codeowner_Approval
style 0_Codeowner_Approval fill:#4ade80,stroke:#16a34a,color:#052e16
0_4_Approve_In_Session["Approve In Session\n[action]"]
0_Codeowner_Approval --> 0_4_Approve_In_Session
style 0_4_Approve_In_Session fill:#4ade80,stroke:#16a34a,color:#052e16
0_4_Open_MR_For_Codeowner["Open MR For Codeowner\n[action]"]
0_Codeowner_Approval --> 0_4_Open_MR_For_Codeowner