ADR 0006 — Exclusive write paths for parallel agents
Status: accepted
Date: 2026-09-19
Context
ADRs 0001 through 0005 cut the product. Later agents will implement features in parallel. Shared files (EndpointUri, Account, Appointment) will collide if each agent owns a whole Stitch module.
Stitch screens were still unread in this session. The pack must stay at capability level.
Decision
The unit of later implementation is a work package in ai-agent/tasks/, indexed by docs/work-packages.md and manifest/work-packages.tsv.
Rules:
- One agent writes one package's paths. Paths live in
manifest/owned-paths.tsv. - WP-00 lands reserved HTTP constants and persistence rules before G1.
- G1 packages (identity, two profiles, admin) may run in parallel after WP-00.
- Appointment has one table. WP-05 owns both the patient booking HTTP and the clinician agenda HTTP.
- Imaging and lab stay in
diagnosticswithkind. WP-07 owns that package. WP-08 only projects reads to the patient. - Admin does not create a second user table.
- Screen names wait for WP-10 after an in-repo Stitch export.
python3 ai-agent/scripts/check-agent-pack.py is the gate. A pack edit that fails the script does not land.
Consequences
- Parallel work is possible on G1 and on G2 booking-versus-diagnostics.
- Encounter and patient results stay sequential.
- A missing HTTP path is a WP-00 change, not a feature-package invention.
- Consult (F-01) stays blocked until WP-10.