Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

test(harness): canonize scenario metadata layout

cyh5b6be0c04243
diff --git a/AGENTS.md b/AGENTS.md
index 2588f27e0..0e66b9470 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -204,9 +204,9 @@ Testing guidance:
- use pytest-style tests (`test_<feature>.py`) colocated or under `tests/`
- for IM integrations, stub/mock platform clients and validate outbound payload/schema behavior
-- for reusable capability-first testing guidance, use `standards/scenario-testing/AGENTS.md` as the entrypoint; project-specific scenario coverage should follow that standard
+- for reusable capability-first testing guidance, use `standards/scenario-testing/AGENTS.md` as the entrypoint; project-specific scenario metadata lives under `tests/scenarios/`
- when a scenario catalog exists, make the scenario ID visible in the automated test and in the PR description
-- for multi-step auth/setup flows, add or update a closed-loop scenario harness case under `tests/test_agent_auth_setup_scenarios.py`; keep provider-specific parsing and heuristics in focused unit tests
+- for multi-step auth/setup flows, update `tests/scenarios/auth_setup/catalog.yaml` and add or update a closed-loop scenario harness case under `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`; keep provider-specific parsing and heuristics in focused unit tests
- for UI changes, run `npm run build` in `ui/`
- for cross-platform or user-facing verification, use the Docker regression workflow
- until CI fully covers a flow, do a manual sanity check for the affected workflow when practical
diff --git a/docs/regression/AUTH_SETUP_SCENARIOS.md b/docs/regression/AUTH_SETUP_SCENARIOS.md
index 5d38e230e..638bb43ad 100644
--- a/docs/regression/AUTH_SETUP_SCENARIOS.md
+++ b/docs/regression/AUTH_SETUP_SCENARIOS.md
@@ -1,141 +1,46 @@
# Auth Setup Scenario Harness
-This document defines the lightweight closed-loop regression pattern for IM-driven backend auth/setup flows.
+This document is now a human-facing guide for the auth/setup capability.
-It complements existing unit tests and manual Docker regression:
+The canonical scenario assets are no longer stored in `docs/regression/`.
+They live next to the executable tests:
-- unit tests still own parsing, heuristics, and narrow edge cases
-- scenario harness tests own the multi-step setup flow inside the service boundary
-- manual regression still owns real IM adapters, real OAuth pages, and real provider accounts
+- `tests/scenarios/INDEX.yaml`
+- `tests/scenarios/auth_setup/catalog.yaml`
+- `tests/scenarios/auth_setup/observations.yaml`
+- `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
+- `tests/scenario_harness/auth_setup.py`
-## Goal
+## Why This Capability Uses Scenario Tests
-Catch regressions where each individual helper still passes, but the full setup flow no longer closes correctly.
-
-Typical failures in this category:
-
-- setup starts, but no completion waiter is attached
-- the user reply is no longer consumed by the active setup flow
-- runtime refresh is skipped after successful verification
-- the final success/failure message is never emitted
-- one backend-specific branch accidentally steals another backend's follow-up input
-
-## Keep It Lightweight
-
-Do not build a generic workflow engine first.
-
-The preferred pattern is:
-
-1. keep production code changes small
-2. add a focused scenario test under `tests/test_agent_auth_setup_scenarios.py`
-3. reuse shared test primitives from `tests/scenario_harness/` before creating new one-off fakes
-4. use fake process / fake control client / fake IM client transcripts
-5. drive the real public service methods (`start_setup`, `maybe_consume_setup_reply`, `submit_code`) whenever practical
-
-If a new helper is only needed by one scenario, keep it local to the test file.
-
-## Required Coverage
-
-When changing auth/setup behavior, add or update at least one closed-loop scenario that covers:
+`AUTH-SETUP` is a multi-step user journey:
1. setup starts
-2. the user-facing login instruction is emitted
-3. the external follow-up is simulated
- - CLI text transcript
- - plain IM reply
- - control-channel completion
-4. login verification runs
-5. backend runtime refresh happens
-6. a terminal user-visible message is emitted
-
-For any backend-specific auth flow, the default target is one happy-path scenario plus unit tests for branchy edge cases.
-
-## Current Project Mapping
-
-Reference implementation currently lives in:
-
-- `tests/scenario_harness/`
-- `tests/test_agent_auth_setup_scenarios.py`
-- `docs/regression/AUTH_SETUP_SCENARIOS.md`
-- `docs/regression/AUTH_SETUP_SCENARIO_CATALOG.md`
-
-## Current Scenario Matrix
-
-- Codex device auth:
- - start setup
- - emit device URL and code
- - complete process
- - verify login
- - refresh runtime
- - emit success
- - prove the next user turn sees refreshed runtime instead of stale auth state
-- Claude manual callback:
- - start control-channel auth
- - emit manual URL
- - accept plain `authorizationCode#state` reply
- - treat plain reply and `/setup code ...` fallback as one logical submission, not two
- - reject malformed callback values while keeping the flow recoverable
- - wait for completion
- - time out into a recoverable terminal state if completion never arrives
- - verify login
- - refresh runtime
- - emit success
- - reject wrong-user callback submission without stealing the flow
- - treat assistant auth-failure runtime events as OAuth recovery, even without deprecated metadata flags
-- OpenCode direct key:
- - start setup
- - emit auth URL
- - accept plain credential reply
- - reject invalid-looking replies without killing the flow
- - allow a later valid retry to complete the flow
- - install key
- - refresh runtime
- - clear stale sessions
- - emit success
- - prove the next user turn sees refreshed runtime and cleared sessions
-- Shared multi-flow routing:
- - keep Claude and OpenCode flows active in one channel
- - route callback-shaped input to Claude
- - route credential-shaped input to OpenCode
- - avoid cross-flow stealing
-- Shared teardown and restart:
- - let a flow timeout into a recoverable terminal state
- - start setup again immediately
- - prove the new attempt gets a fresh flow and fresh instructions
- - prove a failed attempt does not leak stale runtime state into the next retry
-
-The detailed capability matrix now lives in:
-
-- `docs/regression/AUTH_SETUP_SCENARIO_CATALOG.md`
-
-Use the catalog when deciding:
-
-- which backend/path needs the next scenario
-- whether a new bug is already covered by an existing scenario ID
-- whether the gap is scenario-worthy or should stay unit/contract/manual
-
-## What Stays in Unit Tests
-
-Keep these as small focused tests instead of scenario tests:
-
-- callback/code parsing
-- credential-shape heuristics
-- auth-error classification
-- flow lookup priority
-- single cleanup invariants
-
-Scenario tests should assert the user journey, not every internal branch.
-
-## What Still Needs Manual Regression
-
-Keep manual regression for:
-
-- real IM transport behavior
-- real OAuth/account/provider interactions
-- CLI or SDK behavior that cannot be deterministically simulated at the service boundary
-
-When a bug is first discovered manually, the follow-up rule is:
-
-1. fix the root cause
-2. add the narrow unit test if needed
-3. add or update the nearest closed-loop scenario so the same journey cannot silently regress again
+2. the user sees login instructions
+3. the user or external system sends a follow-up
+4. verification runs
+5. runtime refresh happens
+6. the user sees a terminal success or failure message
+
+This is exactly the class of flow that can pass unit tests while still breaking as a user-visible journey.
+
+## Where To Look
+
+If you are an agent starting from zero context:
+
+1. start with `tests/scenarios/INDEX.yaml`
+2. open `tests/scenarios/auth_setup/catalog.yaml`
+3. open `tests/scenarios/auth_setup/observations.yaml`
+4. read `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
+5. only then inspect `tests/scenario_harness/auth_setup.py` or production code
+
+## Boundary Rule
+
+- `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
+ owns the closed-loop service-boundary scenarios
+- `tests/test_agent_auth_service.py`
+ owns focused auth/setup unit coverage
+- `tests/test_claude_agent_sessions.py`
+ owns runtime-specific Claude regression evidence such as `AUTH-SETUP-902`
+- manual Docker regression
+ still owns real IM transports, real OAuth pages, and real provider accounts
diff --git a/docs/regression/AUTH_SETUP_SCENARIO_CATALOG.md b/docs/regression/AUTH_SETUP_SCENARIO_CATALOG.md
index 640570f1c..94d836583 100644
--- a/docs/regression/AUTH_SETUP_SCENARIO_CATALOG.md
+++ b/docs/regression/AUTH_SETUP_SCENARIO_CATALOG.md
@@ -1,294 +1,43 @@
# Auth Setup Scenario Catalog
-## Capability
-
-`IM-driven backend auth recovery`
-
-## Scenarios
-
-### `AUTH-SETUP-001 Codex device auth happy path`
-
-- Type: happy path
-- Layer: scenario
-- Given:
- An IM user starts Codex setup.
-- When:
- Codex emits the device URL and code, the external login completes, and verification succeeds.
-- Then:
- The user sees the login instructions, runtime refresh runs, and the user gets a success message.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_codex_device_auth_scenario_reaches_terminal_success`
-
-### `AUTH-SETUP-002 Claude manual callback happy path`
-
-- Type: happy path
-- Layer: scenario
-- Given:
- An IM user starts Claude setup in manual callback mode.
-- When:
- The user replies with `authorizationCode#state` and Claude completion succeeds.
-- Then:
- The user sees the callback instructions, runtime refresh runs, and the user gets a success message.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_claude_manual_callback_scenario_accepts_plain_reply_and_completes`
-
-### `AUTH-SETUP-003 OpenCode direct key happy path`
-
-- Type: happy path
-- Layer: scenario
-- Given:
- An IM user starts OpenCode direct-key setup.
-- When:
- The user replies with a valid credential.
-- Then:
- The key is installed, runtime refresh runs, stale sessions are cleared, and the user gets a success message.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_opencode_direct_key_scenario_installs_key_and_refreshes_runtime`
-
-### `AUTH-SETUP-101 OpenCode plain chat is ignored while waiting for a credential`
-
-- Type: negative path
-- Layer: scenario
-- Given:
- OpenCode setup is waiting for a credential reply.
-- When:
- The user sends a normal chat message instead of a credential.
-- Then:
- The message is not consumed as setup input and the flow keeps waiting.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_opencode_waiting_key_scenario_ignores_plain_chat`
-
-### `AUTH-SETUP-201 Re-entering setup replaces the active flow`
-
-- Type: recovery / retry
-- Layer: scenario
-- Given:
- A setup flow is already active for the same user and backend.
-- When:
- The user starts setup again.
-- Then:
- The old flow is canceled and terminated, and a fresh flow replaces it.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_codex_reentry_scenario_replaces_existing_flow`
-
-### `AUTH-SETUP-202 Failed verification emits the reset path`
-
-- Type: recovery / retry
-- Layer: scenario
-- Given:
- The setup process exits but login verification fails.
-- When:
- The service evaluates the failed verification result.
-- Then:
- The user gets a failure message with the reset/auth-setup action.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_codex_failure_scenario_emits_reset_path`
-
-### `AUTH-SETUP-103 Wrong user cannot submit into another user's active flow`
-
-- Type: negative path
-- Layer: scenario
-- Given:
- A setup flow is active in a shared channel for one user.
-- When:
- Another user tries to submit the follow-up callback/code into that flow.
-- Then:
- The reply is not consumed, the user gets an ownership error, and the original flow remains active.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_claude_wrong_user_cannot_submit_callback_into_active_flow`
-
-### `AUTH-SETUP-102 Malformed Claude callback keeps the flow recoverable`
-
-- Type: negative path
-- Layer: scenario
-- Given:
- Claude setup is waiting for the browser callback value.
-- When:
- The user submits a malformed value that is not `authorizationCode#state`.
-- Then:
- The callback is rejected, the flow stays active, and the user gets retry guidance.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_claude_malformed_callback_keeps_flow_active_and_instructs_retry`
-
-### `AUTH-SETUP-204 Successful setup refreshes runtime before the next user turn`
-
-- Type: recovery / post-success readiness
-- Layer: scenario
-- Given:
- A setup flow completes successfully.
-- When:
- The next user turn happens immediately after the success message.
-- Then:
- Runtime refresh and stale-session cleanup have already happened, so the next turn sees the refreshed backend state.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_successful_setup_refreshes_runtime_before_the_next_turn`
+This file is now a human-facing index.
-### `AUTH-SETUP-203 Setup timeout emits a recoverable terminal state`
+The canonical scenario metadata for this capability lives in:
-- Type: recovery / timeout
-- Layer: scenario
-- Given:
- A setup flow starts but external completion never arrives.
-- When:
- The flow hits its deadline.
-- Then:
- The flow terminates into a recoverable failure, emits a retry/reset path, and cleans up the active flow.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_claude_timeout_emits_recoverable_terminal_state`
+- `tests/scenarios/auth_setup/catalog.yaml`
+- `tests/scenarios/auth_setup/observations.yaml`
+- `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
-### `AUTH-SETUP-205 Concurrent backend flows do not steal each other's replies`
+Use the canonical files when you need deterministic answers to:
-- Type: concurrency / routing
-- Layer: scenario
-- Given:
- Multiple backend setup flows are active in the same channel.
-- When:
- The user sends backend-specific follow-up replies.
-- Then:
- Each reply is consumed by the matching backend flow and the other flow remains intact until its own reply arrives.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_concurrent_setup_flows_route_replies_to_the_matching_backend`
+- which `AUTH-SETUP-*` IDs exist
+- which ones are covered or still gaps
+- which historical regressions were observed in reality
+- which scenario tests are the current executable evidence
-### `AUTH-SETUP-104 Invalid OpenCode credential reply stays recoverable until a valid retry`
+Use this document only as a shortcut summary.
-- Type: negative path
-- Layer: scenario
-- Given:
- OpenCode direct-key setup is waiting for a credential reply.
-- When:
- The user first sends an invalid-looking value, then retries with a valid credential.
-- Then:
- The invalid reply is ignored, the flow stays active, and the valid retry still completes the flow successfully.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_opencode_invalid_reply_keeps_flow_recoverable_until_valid_retry`
-
-### `AUTH-SETUP-206 Terminal teardown leaves the next setup attempt clean`
-
-- Type: recovery / teardown
-- Layer: scenario
-- Given:
- A setup flow reaches a terminal timeout/failure state.
-- When:
- The user starts setup again immediately afterward.
-- Then:
- The old flow no longer owns the channel state, a new flow starts cleanly, and fresh instructions are emitted for the new attempt.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_timed_out_flow_allows_clean_restart_without_stale_state`
-
-### `AUTH-SETUP-105 Plain callback submission and command fallback do not double-consume the same flow`
-
-- Type: negative path / input deduplication
-- Layer: scenario
-- Given:
- A setup flow accepts plain-text follow-up input in the chat.
-- When:
- The user first submits the plain reply, then repeats the old `/setup code ...` fallback after the flow already completed.
-- Then:
- The flow is consumed exactly once and the fallback sees no active flow instead of replaying the submission.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_callback_submission_and_fallback_command_do_not_double_consume_claude_flow`
-
-### `AUTH-SETUP-901 Codex setup success refreshes runtime before the next turn`
-
-- Type: historical regression / post-success readiness
-- Layer: scenario
-- Given:
- Codex setup completes successfully.
-- When:
- The next user turn starts immediately afterward.
-- Then:
- Codex runtime refresh has already completed, so the next turn does not reuse stale auth state.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_codex_successful_setup_refreshes_runtime_before_the_next_turn`
-
-### `AUTH-SETUP-902 Claude assistant auth-failure event triggers recovery even without the deprecated API-error flag`
-
-- Type: historical regression / auth recovery
-- Layer: scenario-backed runtime regression
-- Given:
- Claude runtime receives an assistant auth-failure event.
-- When:
- The event carries `error=\"authentication_failed\"` but does not expose the older `isApiErrorMessage` flag.
-- Then:
- OAuth recovery still triggers and the stale runtime session is cleaned up instead of leaking the failure as plain text.
-- Current test:
- `tests/test_claude_agent_sessions.py::test_assistant_auth_error_without_is_api_error_flag_still_triggers_recovery`
-
-### `AUTH-SETUP-207 Recoverable failure leaves the next attempt free of stale runtime state`
-
-- Type: recovery / clean retry
-- Layer: scenario
-- Given:
- A setup attempt ends in a recoverable failure.
-- When:
- The user starts setup again immediately afterward.
-- Then:
- The failed flow no longer owns the channel state, runtime refresh does not leak from the failed attempt, and the next attempt can complete cleanly.
-- Current test:
- `tests/test_agent_auth_setup_scenarios.py::test_failed_codex_setup_does_not_leave_stale_runtime_for_next_attempt`
-
-## Coverage Matrix
-
-This matrix tracks the current `AUTH-SETUP` capability by:
-
-- backend
-- user-visible phase
-- dominant risk
-- current evidence layer
-- next action
-
-Status legend:
-
-- `covered`
- scenario coverage exists
-- `partial`
- only unit/contract coverage exists, or only one backend branch is covered
-- `manual`
- currently depends on manual regression
-- `gap`
- not covered yet
-
-| Scenario band | Backend | User-visible phase | Dominant risk | Status | Current evidence | Next action |
-| --- | --- | --- | --- | --- | --- | --- |
-| `AUTH-SETUP-001` | Codex | start -> device URL/code -> verify success | waiter missing, success never emitted | covered | scenario + unit | keep as happy-path baseline |
-| `AUTH-SETUP-002` | Claude | start -> manual callback -> verify success | callback reply not consumed, completion never closes | covered | scenario + unit | keep as happy-path baseline |
-| `AUTH-SETUP-003` | OpenCode | start -> direct key reply -> refresh success | credential reply not installed, stale session survives | covered | scenario + unit | keep as happy-path baseline |
-| `AUTH-SETUP-101` | OpenCode | waiting for credential reply | normal chat stolen by setup flow | covered | scenario + unit | extend the same pattern to Claude/Codex waiting replies |
-| `AUTH-SETUP-201` | Codex | re-enter setup while active flow exists | duplicate flows, stale process survives | covered | scenario + unit | add cross-backend re-entry coverage |
-| `AUTH-SETUP-202` | Codex | process exits but verify fails | user gets no recovery path | covered | scenario + unit | add equivalent Claude/OpenCode recovery failures |
-| `AUTH-SETUP-102` | Claude | callback reply accepted | malformed `authorizationCode#state` is consumed or flow dies | covered | scenario + unit | preserve as callback-shape guardrail |
-| `AUTH-SETUP-103` | shared | waiting for user reply | wrong user can submit into another user's flow | covered | scenario + unit | keep as shared ownership guardrail |
-| `AUTH-SETUP-104` | OpenCode | waiting for credential reply | invalid-looking credential consumed or separator-only reply swallowed | covered | scenario + unit + heuristic tests | preserve as invalid-retry guardrail |
-| `AUTH-SETUP-105` | shared | fallback input handling | plain reply and fallback command both consume the same flow | covered | scenario | preserve as input-dedup guardrail |
-| `AUTH-SETUP-203` | shared | long-running active flow | timeout leaves non-terminal or unrecoverable state | covered | scenario | preserve as timeout recovery baseline |
-| `AUTH-SETUP-204` | shared | immediately after successful setup | success emitted before runtime is truly usable | covered | scenario + historical manual bug | preserve as post-success readiness guardrail |
-| `AUTH-SETUP-205` | shared | concurrent replies in one channel | one backend flow steals another backend's reply | covered | scenario | preserve as concurrency routing guardrail |
-| `AUTH-SETUP-206` | shared | success / failure teardown | stale sessions, pending requests, or old runtime survive | covered | scenario + unit fragments | preserve as clean-restart teardown baseline |
-| `AUTH-SETUP-901` | Codex | post-OAuth usability | login completes but runtime is not refreshed | covered | scenario + historical bug fix | preserve as observed regression guardrail |
-| `AUTH-SETUP-902` | Claude | auth failure detection | assistant auth failure is treated as plain text | covered | runtime regression test + historical bug fix | preserve as observed recovery guardrail |
-
-## Priority Queue
-
-The next scenario wave should focus on the gaps that most directly affect user trust:
-
-1. `AUTH-SETUP-204`
- now covered; keep extending it beyond OpenCode when more backends need post-success readiness checks
-2. `AUTH-SETUP-103`
- now covered; keep it as the shared ownership baseline
-3. `AUTH-SETUP-205`
- now covered; keep it as the multi-flow routing baseline
-4. `AUTH-SETUP-106`
- callback buttons should not allow stale button presses to restart the wrong backend flow after channel state changed
-5. `AUTH-SETUP-208`
- cross-user concurrent setup attempts should not cross-contaminate runtime cleanup
+## Capability
-## Coverage Notes
+`IM-driven backend auth recovery`
-- `Codex`
- happy path, re-entry, failed verification, and post-success runtime usability are covered
-- `Claude`
- happy path, malformed callback, wrong-user ownership, timeout recovery, and assistant auth-failure recovery are covered
-- `OpenCode`
- happy path, plain-chat protection, invalid-retry recovery, and post-success readiness are covered
-- `shared lifecycle`
- cross-user ownership, timeout, concurrency, input deduplication, post-success usability, and clean-restart teardown now have scenario baselines
+## Covered Scenario Bands
+
+- Happy paths
+ - `AUTH-SETUP-001` Codex device auth
+ - `AUTH-SETUP-002` Claude manual callback
+ - `AUTH-SETUP-003` OpenCode direct key
+- Negative / validation paths
+ - `AUTH-SETUP-101/102/103/104/105`
+- Recovery / retry / teardown
+ - `AUTH-SETUP-201/202/203/204/205/206/207`
+- Historical regressions
+ - `AUTH-SETUP-901/902`
+
+## Fast Navigation
+
+1. Read `tests/scenarios/INDEX.yaml`
+2. Open `tests/scenarios/auth_setup/catalog.yaml`
+3. Open `tests/scenarios/auth_setup/observations.yaml`
+4. Read `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
+5. Read `tests/test_claude_agent_sessions.py` for the runtime-specific `AUTH-SETUP-902` regression
diff --git a/docs/regression/MESSAGE_DELIVERY_SCENARIO_CATALOG.md b/docs/regression/MESSAGE_DELIVERY_SCENARIO_CATALOG.md
index bfd28fbe7..d5555feb3 100644
--- a/docs/regression/MESSAGE_DELIVERY_SCENARIO_CATALOG.md
+++ b/docs/regression/MESSAGE_DELIVERY_SCENARIO_CATALOG.md
@@ -1,36 +1,23 @@
# Message Delivery Scenario Catalog
+This file is now a human-facing index.
+
+The canonical scenario metadata for this capability lives in:
+
+- `tests/scenarios/message_delivery/catalog.yaml`
+- `tests/scenarios/message_delivery/observations.yaml`
+- `tests/scenarios/message_delivery/test_message_delivery_scenarios.py`
+
## Capability
`scheduled result delivery`
-## Scenarios
-
-### `MESSAGE-DELIVERY-001 Scheduled result finalizes its delivery anchor`
-
-- Type: happy path
-- Layer: scenario
-- Given:
- A scheduled turn emits a normal result into its target channel.
-- When:
- The dispatcher sends the result.
-- Then:
- The sent message becomes the finalized scheduled anchor.
-- Current test:
- `tests/test_message_delivery_scenarios.py::test_scheduled_result_delivery_scenario_finalizes_anchor`
-
-### `MESSAGE-DELIVERY-002 Delivery override sends to the parent target but finalizes the source thread`
-
-- Type: happy path
-- Layer: scenario
-- Given:
- A scheduled result is configured to deliver into the parent channel from a thread-scoped source context.
-- When:
- The dispatcher sends the result.
-- Then:
- The message is delivered to the override target while finalizing the original source-thread anchor metadata.
-- Current test:
- `tests/test_message_delivery_scenarios.py::test_scheduled_result_delivery_override_scenario_uses_parent_channel_target`
+## Covered Scenario Bands
+
+- `MESSAGE-DELIVERY-001`
+ Scheduled result finalizes its delivery anchor
+- `MESSAGE-DELIVERY-002`
+ Delivery override sends to the parent target but finalizes the source thread
## Next High-Priority Gaps
diff --git a/docs/regression/README.md b/docs/regression/README.md
index 2987ec0ea..c18e1a5c7 100644
--- a/docs/regression/README.md
+++ b/docs/regression/README.md
@@ -7,10 +7,22 @@ The container state is persistent by default. Changes you make through the UI or
It complements the existing automated `E2E` flow instead of replacing it:
- `E2E testing` keeps using scripts and pytest for automatable scenarios.
-- multi-step auth/setup journeys should add a focused scenario harness case; see `AUTH_SETUP_SCENARIOS.md`
-- capability scenario IDs and current catalog coverage live next to regression docs, for example `AUTH_SETUP_SCENARIO_CATALOG.md` and `MESSAGE_DELIVERY_SCENARIO_CATALOG.md`
+- capability scenario metadata now lives under `tests/scenarios/`
+- multi-step auth/setup journeys should add or update `tests/scenarios/auth_setup/catalog.yaml` and `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
+- `docs/regression/` is now a human-facing entry layer, not the canonical source of truth for scenario metadata
- `Regression testing` is for human-triggered checks on real IM platforms.
+## Scenario Metadata Navigation
+
+Start here only if you are doing manual regression or need the human-readable index.
+
+For deterministic scenario metadata, read:
+
+1. `tests/scenarios/INDEX.yaml`
+2. `tests/scenarios/<capability>/catalog.yaml`
+3. `tests/scenarios/<capability>/observations.yaml`
+4. `tests/scenarios/<capability>/test_*.py`
+
## Setup
1. Copy the local template:
diff --git a/standards/scenario-testing/ADOPTION.md b/standards/scenario-testing/ADOPTION.md
index b25b0100a..a9c80b741 100644
--- a/standards/scenario-testing/ADOPTION.md
+++ b/standards/scenario-testing/ADOPTION.md
@@ -21,6 +21,7 @@ Its job is to:
An adoption pass should normally leave behind:
+- a deterministic scenario asset layout rooted at `tests/scenarios/`
- a capability map
- at least one capability spec
- at least one scenario catalog with stable IDs
@@ -72,6 +73,7 @@ Examples of poor starting points:
Primary output:
- a capability map with rough priority and risk
+- a project-level `tests/scenarios/INDEX.yaml`
## Phase 3: Build The Scenario Catalog
@@ -95,7 +97,7 @@ Scenario definitions should use:
Primary output:
-- a scenario catalog with stable IDs
+- a scenario catalog with stable IDs, stored in a fixed capability directory such as `tests/scenarios/<capability>/catalog.yaml`
## Phase 4: Define The Boundary Model
@@ -162,6 +164,7 @@ Examples:
Primary output:
- an updated dependency observation log plus changed tests and scenarios
+- with the observation stored beside the capability, for example `tests/scenarios/<capability>/observations.yaml`
## Fake Maturity Model
@@ -204,6 +207,7 @@ Adoption is complete enough to be useful when:
- the project has a capability map
- at least one high-risk capability has a scenario catalog
+- the project has a deterministic `tests/scenarios/` entry structure
- at least one reusable harness layer exists
- reality feedback can be recorded and replayed into tests
- PR authors can point to scenario IDs and evidence layers
diff --git a/standards/scenario-testing/AGENTS.md b/standards/scenario-testing/AGENTS.md
index ef961eb6c..a7040e305 100644
--- a/standards/scenario-testing/AGENTS.md
+++ b/standards/scenario-testing/AGENTS.md
@@ -44,6 +44,27 @@ The goal is to add a reusable middle layer that answers:
- `examples/`
Concrete project mappings. These explain how one repo applies the standard without redefining the standard itself.
+## Deterministic Navigation Rule
+
+Assume the next agent starts from zero memory and only has this file as its prompt.
+
+That agent must be able to find the project's scenario assets through fixed locations, not through guesswork.
+
+Preferred project layout:
+
+- `tests/scenarios/INDEX.yaml`
+ Project capability index. Read this first.
+- `tests/scenarios/<capability>/catalog.yaml`
+ Canonical scenario IDs and coverage state for that capability.
+- `tests/scenarios/<capability>/observations.yaml`
+ Historical dependency observations and reality-feedback notes for that capability.
+- `tests/scenarios/<capability>/test_*.py`
+ Executable scenario evidence.
+- `tests/scenario_harness/`
+ Shared harness primitives.
+
+Human-facing docs may still exist elsewhere, but the project should make one location canonical for scenario metadata.
+
## Expected Outputs
For a project adopting this standard, the normal outputs are:
@@ -64,6 +85,14 @@ When adopting this standard in a new repository, start with `ADOPTION.md` before
Use `WORKFLOW.md` only after the adoption baseline exists.
+When working inside an already-adopted repository:
+
+1. read the project's `tests/scenarios/INDEX.yaml`
+2. open the target capability's `catalog.yaml`
+3. open the same capability's `observations.yaml`
+4. read the listed scenario test files
+5. only then change production code, harness primitives, or docs
+
## Non-Goals
- inventing a heavy generic workflow engine up front
diff --git a/standards/scenario-testing/README.md b/standards/scenario-testing/README.md
index e762fdacf..61a279a5b 100644
--- a/standards/scenario-testing/README.md
+++ b/standards/scenario-testing/README.md
@@ -53,6 +53,23 @@ Each capability owns:
- `examples/`
Project-specific mappings and reference implementations.
+## Canonical Project Layout
+
+Projects adopting this standard should give agents one deterministic place to look for scenario assets.
+
+Recommended layout:
+
+- `tests/scenarios/INDEX.yaml`
+- `tests/scenarios/<capability>/catalog.yaml`
+- `tests/scenarios/<capability>/observations.yaml`
+- `tests/scenarios/<capability>/test_*.py`
+- `tests/scenario_harness/`
+
+This is intentionally different from long-form docs:
+
+- structured files under `tests/scenarios/` are the canonical source of truth
+- explanatory docs can exist elsewhere, but they should point back to the canonical files
+
## How To Adopt It In A Project
1. Understand the product and summarize its core capabilities in user-visible terms.
diff --git a/standards/scenario-testing/STANDARD.md b/standards/scenario-testing/STANDARD.md
index 2f6a18453..56d979351 100644
--- a/standards/scenario-testing/STANDARD.md
+++ b/standards/scenario-testing/STANDARD.md
@@ -146,6 +146,15 @@ Recommended layering:
Each capability must maintain a scenario catalog.
+Projects should also maintain a project-level capability index.
+
+Recommended canonical files:
+
+- `tests/scenarios/INDEX.yaml`
+- `tests/scenarios/<capability>/catalog.yaml`
+- `tests/scenarios/<capability>/observations.yaml`
+- `tests/scenarios/<capability>/test_*.py`
+
Scenario IDs should be stable and human-usable:
- `AUTH-SETUP-001`
@@ -208,6 +217,12 @@ When runtime behavior disproves the current fake or scenario model:
This is how scenario tests become more trustworthy over time instead of drifting away from real behavior.
+Reality feedback should live next to the capability it changes.
+
+Preferred location:
+
+- `tests/scenarios/<capability>/observations.yaml`
+
## 7. Delivery Standard
Every feature or bug fix that changes a capability must update the relevant testing evidence.
diff --git a/standards/scenario-testing/WORKFLOW.md b/standards/scenario-testing/WORKFLOW.md
index 81392fe32..3e3ecf96e 100644
--- a/standards/scenario-testing/WORKFLOW.md
+++ b/standards/scenario-testing/WORKFLOW.md
@@ -8,9 +8,10 @@ Start with `ADOPTION.md`, then establish:
1. a product and capability summary
2. a capability map
-3. at least one scenario catalog with stable IDs
-4. a harness boundary inventory
-5. a dependency observation log
+3. a deterministic `tests/scenarios/INDEX.yaml`
+4. at least one scenario catalog with stable IDs
+5. a harness boundary inventory
+6. a dependency observation log
Only after that baseline exists should feature and bug-fix workflows rely on scenario coverage as a delivery rule.
@@ -20,22 +21,24 @@ When adding a feature:
1. Identify the capability being introduced or changed.
2. Update or create the capability spec.
-3. Update or create the scenario catalog.
-4. Implement the smallest relevant unit and contract tests.
-5. Add or update at least one closed-loop scenario.
-6. Record any residual manual checks.
-7. Update the dependency observation log if the change was driven by real-world behavior not previously modeled.
+3. Update or create the capability entry under `tests/scenarios/`.
+4. Update or create the scenario catalog.
+5. Implement the smallest relevant unit and contract tests.
+6. Add or update at least one closed-loop scenario.
+7. Record any residual manual checks.
+8. Update the dependency observation log if the change was driven by real-world behavior not previously modeled.
## Bug Fix Workflow
When fixing a bug:
1. Identify the capability that failed.
-2. Map the bug to an existing scenario ID, or create a new regression scenario ID.
-3. Add the narrow unit/contract test if the root cause is local.
-4. Add or update the scenario test that proves the user journey now closes.
-5. Record whether the fix required updating an observed fake, contract fixture, or dependency assumption.
-6. Document why the previous test layers did not catch it.
+2. Open the capability's `catalog.yaml` and `observations.yaml`.
+3. Map the bug to an existing scenario ID, or create a new regression scenario ID.
+4. Add the narrow unit/contract test if the root cause is local.
+5. Add or update the scenario test that proves the user journey now closes.
+6. Record whether the fix required updating an observed fake, contract fixture, or dependency assumption.
+7. Document why the previous test layers did not catch it.
## Review Workflow
@@ -99,7 +102,9 @@ Do not hide scenario knowledge only in PR comments or issue threads.
By the time a change is merged, the durable artifacts should live in:
+- the project capability index
- the capability spec
- the scenario catalog
+- the dependency observation log
- the scenario tests
- the PR/testing checklist
diff --git a/standards/scenario-testing/examples/vibe-remote-auth-setup.md b/standards/scenario-testing/examples/vibe-remote-auth-setup.md
index abedceb25..eb16213c1 100644
--- a/standards/scenario-testing/examples/vibe-remote-auth-setup.md
+++ b/standards/scenario-testing/examples/vibe-remote-auth-setup.md
@@ -26,14 +26,16 @@ It is exactly the kind of cross-cutting flow that can pass unit tests while stil
- `AUTH-SETUP-002` Claude manual callback happy path
- `AUTH-SETUP-003` OpenCode direct key happy path
- `AUTH-SETUP-101` plain chat must not be consumed as setup input
-- `AUTH-SETUP-201` expired auth recovery must emit the reset path
-- `AUTH-SETUP-901` setup starts but never emits terminal completion
+- `AUTH-SETUP-202` failed verification must emit the reset path
+- `AUTH-SETUP-901` Codex success must refresh runtime before the next turn
## Current Project Mapping
Reference implementation currently lives in:
-- `tests/test_agent_auth_setup_scenarios.py`
+- `tests/scenarios/auth_setup/catalog.yaml`
+- `tests/scenarios/auth_setup/observations.yaml`
+- `tests/scenarios/auth_setup/test_auth_setup_scenarios.py`
- `docs/regression/AUTH_SETUP_SCENARIOS.md`
These are project artifacts, not the reusable standard package itself.
diff --git a/standards/scenario-testing/templates/dependency-observation.yaml b/standards/scenario-testing/templates/dependency-observation.yaml
new file mode 100644
index 000000000..76e370f21
--- /dev/null
+++ b/standards/scenario-testing/templates/dependency-observation.yaml
@@ -0,0 +1,14 @@
+version: 1
+capability: example_capability
+observations:
+ - id: OBS-EXAMPLE-001
+ source: manual_regression
+ related_scenarios:
+ - EXAMPLE-101
+ summary: Short description of what reality contradicted.
+ previous_assumption: What the harness or team assumed before observing the behavior.
+ observed_behavior: What the dependency or platform actually did.
+ required_updates:
+ - catalog update
+ - fake or contract update
+ - regression coverage
diff --git a/standards/scenario-testing/templates/scenario-catalog.yaml b/standards/scenario-testing/templates/scenario-catalog.yaml
new file mode 100644
index 000000000..4ff9e5c43
--- /dev/null
+++ b/standards/scenario-testing/templates/scenario-catalog.yaml
@@ -0,0 +1,28 @@
+version: 1
+capability:
+ id: example_capability
+ name: Example capability
+ canonical_tests:
+ - tests/scenarios/example_capability/test_example_capability_scenarios.py
+ shared_harness:
+ - tests/scenario_harness/core.py
+status_legend:
+ covered: scenario coverage exists
+ partial: unit or contract coverage exists but the closed loop is incomplete
+ manual: currently validated only by human regression
+ gap: not covered yet
+scenarios:
+ - id: EXAMPLE-001
+ name: Happy path
+ status: covered
+ kind: happy_path
+ layer: scenario
+ test: tests/scenarios/example_capability/test_example_capability_scenarios.py::test_happy_path
+ - id: EXAMPLE-101
+ name: Negative path
+ status: gap
+ kind: negative_path
+ layer: scenario
+ test: tests/scenarios/example_capability/test_example_capability_scenarios.py::test_negative_path
+next_priority:
+ - EXAMPLE-101
diff --git a/standards/scenario-testing/templates/scenario-index.yaml b/standards/scenario-testing/templates/scenario-index.yaml
new file mode 100644
index 000000000..c72b7f2c0
--- /dev/null
+++ b/standards/scenario-testing/templates/scenario-index.yaml
@@ -0,0 +1,17 @@
+version: 1
+canonical: true
+shared_harness: tests/scenario_harness
+navigation:
+ - Read this file first.
+ - Open the target capability's catalog.yaml.
+ - Open the same capability's observations.yaml.
+ - Read the listed scenario tests before changing code.
+capabilities:
+ - id: example_capability
+ name: Example capability
+ catalog: tests/scenarios/example_capability/catalog.yaml
+ observations: tests/scenarios/example_capability/observations.yaml
+ scenario_tests:
+ - tests/scenarios/example_capability/test_example_capability_scenarios.py
+ unit_or_contract_tests: []
+ human_docs: []
diff --git a/tests/scenario_harness/README.md b/tests/scenario_harness/README.md
index d2a232570..c1826ecd6 100644
--- a/tests/scenario_harness/README.md
+++ b/tests/scenario_harness/README.md
@@ -24,5 +24,5 @@ Recommended layering:
The reusable layer every capability can share.
2. `<capability>.py`
Capability-specific harness or fixtures.
-3. `tests/test_<capability>_scenarios.py`
+3. `tests/scenarios/<capability>/test_<capability>_scenarios.py`
The scenario transcript itself.
diff --git a/tests/scenarios/INDEX.yaml b/tests/scenarios/INDEX.yaml
new file mode 100644
index 000000000..41db511d5
--- /dev/null
+++ b/tests/scenarios/INDEX.yaml
@@ -0,0 +1,33 @@
+version: 1
+canonical: true
+shared_harness: tests/scenario_harness
+navigation:
+ - Read this file first.
+ - Pick the target capability.
+ - Read that capability's catalog.yaml.
+ - Read that capability's observations.yaml.
+ - Read the listed scenario test files before changing production code.
+capabilities:
+ - id: auth_setup
+ name: IM-driven backend auth recovery
+ status: active
+ catalog: tests/scenarios/auth_setup/catalog.yaml
+ observations: tests/scenarios/auth_setup/observations.yaml
+ scenario_tests:
+ - tests/scenarios/auth_setup/test_auth_setup_scenarios.py
+ - tests/test_claude_agent_sessions.py
+ unit_or_contract_tests:
+ - tests/test_agent_auth_service.py
+ human_docs:
+ - docs/regression/AUTH_SETUP_SCENARIOS.md
+ - id: message_delivery
+ name: scheduled result delivery
+ status: active
+ catalog: tests/scenarios/message_delivery/catalog.yaml
+ observations: tests/scenarios/message_delivery/observations.yaml
+ scenario_tests:
+ - tests/scenarios/message_delivery/test_message_delivery_scenarios.py
+ unit_or_contract_tests:
+ - tests/test_message_dispatcher_scheduled.py
+ human_docs:
+ - docs/regression/README.md
diff --git a/tests/scenarios/README.md b/tests/scenarios/README.md
new file mode 100644
index 000000000..6e93e022c
--- /dev/null
+++ b/tests/scenarios/README.md
@@ -0,0 +1,25 @@
+# Scenario Catalogs
+
+This directory is the project-level source of truth for capability scenario metadata.
+
+If you are starting from zero context:
+
+1. read `INDEX.yaml`
+2. open the target capability's `catalog.yaml`
+3. open the same capability's `observations.yaml`
+4. read the listed scenario test files
+5. only then change production code or the shared harness
+
+Directory rules:
+
+- `tests/scenarios/INDEX.yaml`
+ Project capability index
+- `tests/scenarios/<capability>/catalog.yaml`
+ Stable scenario IDs and current coverage state
+- `tests/scenarios/<capability>/observations.yaml`
+ Historical reality-feedback notes and dependency observations
+- `tests/scenarios/<capability>/test_*.py`
+ The executable scenario evidence
+
+`docs/regression/` is now a human-facing index for manual regression and explanation.
+It is no longer the canonical location for scenario metadata.
diff --git a/tests/scenarios/auth_setup/catalog.yaml b/tests/scenarios/auth_setup/catalog.yaml
new file mode 100644
index 000000000..1e5defc6c
--- /dev/null
+++ b/tests/scenarios/auth_setup/catalog.yaml
@@ -0,0 +1,139 @@
+version: 1
+capability:
+ id: auth_setup
+ name: IM-driven backend auth recovery
+ canonical_tests:
+ - tests/scenarios/auth_setup/test_auth_setup_scenarios.py
+ - tests/test_claude_agent_sessions.py
+ shared_harness:
+ - tests/scenario_harness/core.py
+ - tests/scenario_harness/auth_setup.py
+status_legend:
+ covered: scenario coverage exists
+ partial: unit or contract coverage exists but the closed loop is incomplete
+ manual: currently validated only by human regression
+ gap: not covered yet
+scenarios:
+ - id: AUTH-SETUP-001
+ name: Codex device auth happy path
+ status: covered
+ kind: happy_path
+ layer: scenario
+ backend: codex
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_codex_device_auth_scenario_reaches_terminal_success
+ - id: AUTH-SETUP-002
+ name: Claude manual callback happy path
+ status: covered
+ kind: happy_path
+ layer: scenario
+ backend: claude
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_claude_manual_callback_scenario_accepts_plain_reply_and_completes
+ - id: AUTH-SETUP-003
+ name: OpenCode direct key happy path
+ status: covered
+ kind: happy_path
+ layer: scenario
+ backend: opencode
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_opencode_direct_key_scenario_installs_key_and_refreshes_runtime
+ - id: AUTH-SETUP-101
+ name: OpenCode plain chat is ignored while waiting for a credential
+ status: covered
+ kind: negative_path
+ layer: scenario
+ backend: opencode
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_opencode_waiting_key_scenario_ignores_plain_chat
+ - id: AUTH-SETUP-102
+ name: Malformed Claude callback keeps the flow recoverable
+ status: covered
+ kind: negative_path
+ layer: scenario
+ backend: claude
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_claude_malformed_callback_keeps_flow_active_and_instructs_retry
+ - id: AUTH-SETUP-103
+ name: Wrong user cannot submit into another user's active flow
+ status: covered
+ kind: negative_path
+ layer: scenario
+ backend: shared
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_claude_wrong_user_cannot_submit_callback_into_active_flow
+ - id: AUTH-SETUP-104
+ name: Invalid OpenCode credential reply stays recoverable until a valid retry
+ status: covered
+ kind: negative_path
+ layer: scenario
+ backend: opencode
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_opencode_invalid_reply_keeps_flow_recoverable_until_valid_retry
+ - id: AUTH-SETUP-105
+ name: Plain callback submission and command fallback do not double-consume the same flow
+ status: covered
+ kind: negative_path
+ layer: scenario
+ backend: claude
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_callback_submission_and_fallback_command_do_not_double_consume_claude_flow
+ - id: AUTH-SETUP-201
+ name: Re-entering setup replaces the active flow
+ status: covered
+ kind: retry
+ layer: scenario
+ backend: codex
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_codex_reentry_scenario_replaces_existing_flow
+ - id: AUTH-SETUP-202
+ name: Failed verification emits the reset path
+ status: covered
+ kind: retry
+ layer: scenario
+ backend: codex
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_codex_failure_scenario_emits_reset_path
+ - id: AUTH-SETUP-203
+ name: Setup timeout emits a recoverable terminal state
+ status: covered
+ kind: timeout
+ layer: scenario
+ backend: shared
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_claude_timeout_emits_recoverable_terminal_state
+ - id: AUTH-SETUP-204
+ name: Successful setup refreshes runtime before the next user turn
+ status: covered
+ kind: readiness
+ layer: scenario
+ backend: shared
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_successful_setup_refreshes_runtime_before_the_next_turn
+ - id: AUTH-SETUP-205
+ name: Concurrent backend flows do not steal each other's replies
+ status: covered
+ kind: concurrency
+ layer: scenario
+ backend: shared
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_concurrent_setup_flows_route_replies_to_the_matching_backend
+ - id: AUTH-SETUP-206
+ name: Terminal teardown leaves the next setup attempt clean
+ status: covered
+ kind: teardown
+ layer: scenario
+ backend: shared
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_timed_out_flow_allows_clean_restart_without_stale_state
+ - id: AUTH-SETUP-207
+ name: Recoverable failure leaves the next attempt free of stale runtime state
+ status: covered
+ kind: teardown
+ layer: scenario
+ backend: codex
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_failed_codex_setup_does_not_leave_stale_runtime_for_next_attempt
+ - id: AUTH-SETUP-901
+ name: Codex setup success refreshes runtime before the next turn
+ status: covered
+ kind: historical_regression
+ layer: scenario
+ backend: codex
+ test: tests/scenarios/auth_setup/test_auth_setup_scenarios.py::test_codex_successful_setup_refreshes_runtime_before_the_next_turn
+ - id: AUTH-SETUP-902
+ name: Claude assistant auth-failure event triggers recovery without the deprecated API-error flag
+ status: covered
+ kind: historical_regression
+ layer: scenario_backed_runtime
+ backend: claude
+ test: tests/test_claude_agent_sessions.py::test_assistant_auth_error_without_is_api_error_flag_still_triggers_recovery
+next_priority:
+ - AUTH-SETUP-106
+ - AUTH-SETUP-208
+ - AUTH-SETUP-301
diff --git a/tests/scenarios/auth_setup/observations.yaml b/tests/scenarios/auth_setup/observations.yaml
new file mode 100644
index 000000000..4493975bc
--- /dev/null
+++ b/tests/scenarios/auth_setup/observations.yaml
@@ -0,0 +1,23 @@
+version: 1
+capability: auth_setup
+observations:
+ - id: OBS-AUTH-001
+ source: manual_regression
+ related_scenarios:
+ - AUTH-SETUP-901
+ summary: Codex OAuth completion was not enough to make the next turn usable.
+ previous_assumption: Successful OAuth immediately left Codex ready for the next user turn.
+ observed_behavior: Codex still needed the setup completion waiter and runtime refresh to finish before the next turn.
+ required_updates:
+ - restore the setup completion waiter
+ - lock the behavior with a post-success readiness scenario
+ - id: OBS-AUTH-002
+ source: manual_regression
+ related_scenarios:
+ - AUTH-SETUP-902
+ summary: Claude auth failures arrived as assistant events without the deprecated API-error marker.
+ previous_assumption: Claude auth-recovery detection could rely on the older API-error flag.
+ observed_behavior: Recovery must trigger from the explicit authentication failure subtype even when the older marker is absent.
+ required_updates:
+ - update the Claude auth-failure detector
+ - keep a regression test in the runtime-specific suite
diff --git a/tests/test_agent_auth_setup_scenarios.py b/tests/scenarios/auth_setup/test_auth_setup_scenarios.py
similarity index 99%
rename from tests/test_agent_auth_setup_scenarios.py
rename to tests/scenarios/auth_setup/test_auth_setup_scenarios.py
index dc780f66d..0a5c38581 100644
--- a/tests/test_agent_auth_setup_scenarios.py
+++ b/tests/scenarios/auth_setup/test_auth_setup_scenarios.py
@@ -5,7 +5,7 @@ from pathlib import Path
from types import SimpleNamespace
from unittest.mock import AsyncMock
-ROOT = Path(__file__).resolve().parents[1]
+ROOT = Path(__file__).resolve().parents[3]
sys.path.insert(0, str(ROOT))
from tests.scenario_harness.auth_setup import AuthSetupScenarioHarness, FakeProcess
diff --git a/tests/scenarios/message_delivery/catalog.yaml b/tests/scenarios/message_delivery/catalog.yaml
new file mode 100644
index 000000000..71fd4955b
--- /dev/null
+++ b/tests/scenarios/message_delivery/catalog.yaml
@@ -0,0 +1,32 @@
+version: 1
+capability:
+ id: message_delivery
+ name: scheduled result delivery
+ canonical_tests:
+ - tests/scenarios/message_delivery/test_message_delivery_scenarios.py
+ shared_harness:
+ - tests/scenario_harness/core.py
+ - tests/scenario_harness/message_delivery.py
+status_legend:
+ covered: scenario coverage exists
+ partial: unit or contract coverage exists but the closed loop is incomplete
+ manual: currently validated only by human regression
+ gap: not covered yet
+scenarios:
+ - id: MESSAGE-DELIVERY-001
+ name: Scheduled result finalizes its delivery anchor
+ status: covered
+ kind: happy_path
+ layer: scenario
+ test: tests/scenarios/message_delivery/test_message_delivery_scenarios.py::test_scheduled_result_delivery_scenario_finalizes_anchor
+ - id: MESSAGE-DELIVERY-002
+ name: Delivery override sends to the parent target but finalizes the source thread
+ status: covered
+ kind: happy_path
+ layer: scenario
+ test: tests/scenarios/message_delivery/test_message_delivery_scenarios.py::test_scheduled_result_delivery_override_scenario_uses_parent_channel_target
+next_priority:
+ - MESSAGE-DELIVERY-101
+ - MESSAGE-DELIVERY-102
+ - MESSAGE-DELIVERY-201
+ - MESSAGE-DELIVERY-202
diff --git a/tests/scenarios/message_delivery/observations.yaml b/tests/scenarios/message_delivery/observations.yaml
new file mode 100644
index 000000000..f43e64262
--- /dev/null
+++ b/tests/scenarios/message_delivery/observations.yaml
@@ -0,0 +1,3 @@
+version: 1
+capability: message_delivery
+observations: []
diff --git a/tests/test_message_delivery_scenarios.py b/tests/scenarios/message_delivery/test_message_delivery_scenarios.py
similarity index 98%
rename from tests/test_message_delivery_scenarios.py
rename to tests/scenarios/message_delivery/test_message_delivery_scenarios.py
index 174cb8bd9..b1f8e7baa 100644
--- a/tests/test_message_delivery_scenarios.py
+++ b/tests/scenarios/message_delivery/test_message_delivery_scenarios.py
@@ -4,7 +4,7 @@ import sys
import unittest
from pathlib import Path
-ROOT = Path(__file__).resolve().parents[1]
+ROOT = Path(__file__).resolve().parents[3]
sys.path.insert(0, str(ROOT))
from tests.scenario_harness.core import ScenarioExpect, ScenarioRunner, ScenarioStep