<!-- SPDX-License-Identifier: MIT -->
<!-- SPDX-FileCopyrightText: 2025-2026 Marcus Quinn -->

# t1660.2: .aidevops/testing.json Schema Definition

**Task ID:** t1660.2
**Parent:** t1660 Runtime testing setup
**Status:** in-progress
**Estimate:** ~2h
**Logged:** 2026-03-25
**GitHub Issue:** GH#6487

## Session Origin

Spawned from t1660 (GH#4197) — the parent task defining the full runtime testing setup system. t1660.2 is the schema definition subtask, providing the machine-readable contract that all other t1660.x tasks depend on.

## What

Define the JSON Schema for `.aidevops/testing.json` — the per-repo testing configuration file that the aidevops framework reads to understand how to start, test, and smoke-check a project's development environment.

**Deliverables:**
- `.agents/configs/testing.schema.json` — JSON Schema (draft/2020-12) for `.aidevops/testing.json`
- `.agents/configs/testing.defaults.json` — Example configurations for all 8 supported environments

## Why

The full-loop runtime testing gate (t1660.7) needs a structured config to know:
- How to start the dev environment (`dev_command`)
- How to run tests (`test_command`)
- What URLs to smoke-check (`smoke_urls`)
- What testing level is required (`required_level`)

Without a schema, each sibling task (t1660.1, t1660.4, t1660.7) would independently invent field names, leading to incompatible implementations. The schema is the single source of truth.

## How

1. Design schema covering all 8 environments: npm, docker, localwp, expo, xcode, tauri, binary, manual
2. Include top-level fields read by t1660.7 gate: `dev_command`, `test_command`, `smoke_urls`, `required_level`
3. Include environment-specific sub-configs under `environment_config.<env>`
4. Include `proof_log` config for t1660.5 integration
5. Write example configs for each environment in `testing.defaults.json`
6. Schema lives in `.agents/configs/` (deployed to `~/.aidevops/agents/configs/`) — not in the project root

**Schema location:** `.agents/configs/testing.schema.json`
**User file location:** `.aidevops/testing.json` (per-repo, in project root, gitignored by default)

## Acceptance Criteria

- [ ] Schema validates all 8 environment types: npm, docker, localwp, expo, xcode, tauri, binary, manual
- [ ] Top-level fields match what t1660.7 gate reads: `dev_command`, `test_command`, `smoke_urls`, `required_level`
- [ ] `environment_config` sub-objects cover environment-specific settings without polluting the top level
- [ ] `required_level` enum matches the three levels defined in t1660.7: self-assessed, unit-tested, runtime-verified
- [ ] `testing.defaults.json` provides a working example for each of the 8 environments
- [ ] Schema uses JSON Schema draft/2020-12 (consistent with `bundle.schema.json` and `aidevops-config.schema.json`)
- [ ] `$id` is `https://aidevops.sh/schemas/testing.json` (consistent with other schemas)
- [ ] `additionalProperties: false` on all objects (prevents silent typos in user configs)

## Context

- t1660.7 (full-loop gate) already implemented and reads: `test_command`, `dev_command`, `smoke_urls`, `required_level`
- t1660.4 (verify-brief.sh) will also read this file for runtime verification method
- t1660.5 (task-complete-helper.sh) will read `proof_log` config
- t1660.1 (/testing-setup command) will write this file interactively
- Sibling tasks are blocked-by t1660.2 — schema must be stable before they implement
- Existing schema style reference: `.agents/bundles/schema.json`, `.agents/configs/aidevops-config.schema.json`
