|
| 1 | +# ATM phase and sprint naming conventions |
| 2 | + |
| 3 | +Status: canonical Synaptic Canvas naming contract |
| 4 | + |
| 5 | +This document is the single source of truth for phase, sprint, plan, branch, |
| 6 | +worktree, and retained-evidence identifiers shared by Synaptic Canvas and |
| 7 | +consuming repositories such as ATM Core. Consumer repositories should link to |
| 8 | +this document and should not copy these rules into their own plan documents. |
| 9 | + |
| 10 | +## Canonical identifiers |
| 11 | + |
| 12 | +### Phase |
| 13 | + |
| 14 | +The comparison and persistence key for a phase is an uppercase ASCII token: |
| 15 | + |
| 16 | +```text |
| 17 | +<PHASE> := [A-Z][A-Z0-9]* |
| 18 | +``` |
| 19 | + |
| 20 | +Examples: `AN`, `AL`, `AI`. |
| 21 | + |
| 22 | +The filesystem form is lowercase and prefixed with `phase-`: `phase-an`, |
| 23 | +`phase-al`, and `phase-ai`. A phase token is never encoded as `Phase AN`, |
| 24 | +`phase_AN`, or a mixed-case value in persisted metadata. |
| 25 | + |
| 26 | +### Sprint |
| 27 | + |
| 28 | +The canonical sprint identifier is the phase key, a dot, and a positive |
| 29 | +decimal number: |
| 30 | + |
| 31 | +```text |
| 32 | +<SPRINT> := <PHASE>.<number> |
| 33 | +``` |
| 34 | + |
| 35 | +For example, `AN.1` and `AN.8` are canonical. The same canonical string is |
| 36 | +used in Synaptic Canvas `sprint_id`, ATM plan frontmatter, `aich_sprint`, and |
| 37 | +TTL/report fields such as `triage:foundIn`. |
| 38 | + |
| 39 | +The following are historical input spellings, not persisted values: |
| 40 | + |
| 41 | +| Historical input | Canonical value | Diagnostic | |
| 42 | +| --- | --- | --- | |
| 43 | +| `AN-S1` | `AN.1` | `TTL.QA_RUN_KEY_MISMATCH` | |
| 44 | +| `AN1` | `AN.1` | `NAMING.LEGACY_IDENTIFIER` | |
| 45 | +| `an.1` | `AN.1` | `NAMING.NON_CANONICAL` | |
| 46 | +| `Phase AN / Sprint 1` | `AN.1` | `NAMING.UNKNOWN_SPRINT_FORMAT` until explicitly mapped | |
| 47 | + |
| 48 | +Ingestion may compare phase and sprint keys case-insensitively after trimming |
| 49 | +surrounding whitespace. It must retain the raw value in a diagnostic and |
| 50 | +persist only the canonical value. A case-insensitive match is not permission |
| 51 | +to silently accept a legacy separator or an ambiguous format. |
| 52 | + |
| 53 | +## Plan and evidence paths |
| 54 | + |
| 55 | +Phase directories use the lowercase filesystem phase form: |
| 56 | + |
| 57 | +```text |
| 58 | +docs/plans/phase-an/ |
| 59 | +``` |
| 60 | + |
| 61 | +Sprint plan filenames use the canonical sprint ID followed by a stable, |
| 62 | +lowercase kebab slug: |
| 63 | + |
| 64 | +```text |
| 65 | +docs/plans/phase-an/sprint-AN.8-validation-evidence.md |
| 66 | +``` |
| 67 | + |
| 68 | +The plan frontmatter carries the canonical `sprint: AN.8` value when a sprint |
| 69 | +is represented outside the filename. Its `branch` and `worktree` fields are |
| 70 | +the actual implementation locations; consumers must not infer the sprint ID |
| 71 | +from either field. |
| 72 | + |
| 73 | +Retained QA, report, and TTL evidence carries the same canonical sprint value. |
| 74 | +For example: |
| 75 | + |
| 76 | +```turtle |
| 77 | +triage:QA-RUN-001 |
| 78 | + a triage:Finding ; |
| 79 | + triage:foundIn triage:AN.8 ; |
| 80 | + triage:aich_sprint "AN.8" . |
| 81 | +``` |
| 82 | + |
| 83 | +`AN-S1`, `AN1`, and lowercase equivalents in a new record are validation |
| 84 | +errors. Existing records may remain temporarily only when listed in the |
| 85 | +historical inventory and accompanied by a migration note. |
| 86 | + |
| 87 | +## Branch and worktree names |
| 88 | + |
| 89 | +The sprint ID and implementation branch are related metadata, not aliases. |
| 90 | +The recommended branch form is: |
| 91 | + |
| 92 | +```text |
| 93 | +<kind>/p<phase-lower>-s<number>-<slug> |
| 94 | +``` |
| 95 | + |
| 96 | +where `<kind>` is one of `feature`, `fix`, `docs`, `plan`, `test`, or |
| 97 | +`integrate`. For example: |
| 98 | + |
| 99 | +```text |
| 100 | +feature/pan-s8-validation-evidence |
| 101 | +``` |
| 102 | + |
| 103 | +The branch may use a more descriptive suffix when a fix round or integration |
| 104 | +line needs it. The sprint plan must still retain `sprint: AN.8` and the |
| 105 | +actual `branch` value. A worktree mirrors its branch below the repository's |
| 106 | +worktree root: |
| 107 | + |
| 108 | +```text |
| 109 | +../atm-core-worktrees/feature/pan-s8-validation-evidence |
| 110 | +``` |
| 111 | + |
| 112 | +Absolute worktree paths are tolerated for historical records, but new |
| 113 | +frontmatter should use the repository-relative form above. A branch or |
| 114 | +worktree mismatch is a diagnostic against the metadata, not a reason to rename |
| 115 | +an already-published commit history. |
| 116 | + |
| 117 | +## Validation and migration |
| 118 | + |
| 119 | +Every ingestion boundary follows this sequence: |
| 120 | + |
| 121 | +1. trim the incoming identifier; |
| 122 | +2. compare case-insensitively against the canonical grammar; |
| 123 | +3. map an explicitly supported legacy spelling to its canonical value; |
| 124 | +4. persist the canonical value and retain the original in the diagnostic; and |
| 125 | +5. reject ambiguous or unknown forms with an actionable diagnostic. |
| 126 | + |
| 127 | +The minimum diagnostics are: |
| 128 | + |
| 129 | +- `TTL.QA_RUN_KEY_MISMATCH` — a TTL/report run key does not equal the |
| 130 | + canonical sprint key (for example `AN-S1` versus `AN.1`); |
| 131 | +- `NAMING.NON_CANONICAL` — a supported value differs only by case or |
| 132 | + filesystem casing; |
| 133 | +- `NAMING.LEGACY_IDENTIFIER` — a recognized historical separator/compact form |
| 134 | + needs migration; and |
| 135 | +- `NAMING.UNKNOWN_SPRINT_FORMAT` — the value cannot be mapped without human |
| 136 | + confirmation. |
| 137 | + |
| 138 | +Diagnostics must identify the file, field, raw value, canonical candidate (when |
| 139 | +known), and the migration action. Validation must fail the new record or run; |
| 140 | +it must not silently treat a missing canonical key as a missing QA run. |
| 141 | + |
| 142 | +The migration inventory is maintained with the consuming repository's |
| 143 | +validation evidence. Each historical exception records its raw spelling, |
| 144 | +canonical replacement, owning file, migration status, and the commit that |
| 145 | +performed the migration. Once all references in an inventory entry are |
| 146 | +canonical, the entry may be retained as historical documentation but must no |
| 147 | +longer be accepted for new ingestion. |
| 148 | + |
| 149 | +## Consumer links |
| 150 | + |
| 151 | +- [ATM Core naming/validation integration](https://github.com/randlee/atm-core/blob/develop/docs/canonical-naming-conventions.md) |
| 152 | +- [Synaptic Canvas project conventions](https://github.com/randlee/synaptic-canvas/tree/develop/docs) |
| 153 | + |
0 commit comments