E3:S02:T12 — Planning: Spec, Tests, Implementation Plan (IPW)
Host Task: T12-implement-task-touch-semver-mapping-mode.md (E3:S02:T12)
Cross-Task Interaction: T46-rw-semver-tag-task-touch-mode.md (E5:S01:T46)
Planning for: BR-061, FR-046
Status: Draft
1. Specification
1.1 Goal
Eliminate high-frequency task-touch SemVer collisions by making conversion idempotent for read-only calls and constraining counter mutation to a single release-finalization pathway, while aligning RW tag behavior and docs via E5:S01:T46.
1.2 Functional requirements
- F1: Introduce a strict separation between SemVer derivation (read-only) and SemVer allocation/finalization (state mutation).
- F2: Guarantee that repeated conversion for the same internal version does not increment PATCH repeatedly.
- F3: Preserve monotonic, collision-free SemVer generation across real release sequences, including perpetual tasks.
- F4: Update RW integration so tag creation and release naming consume finalized SemVer once per release.
- F5: Update FR-046/T46 documentation to reflect actual authoritative behavior after T12 fix.
- F6: Add explicit guardrails for duplicate finalize attempts in the same release flow.
1.3 Non-functional requirements
- N1: Backward compatibility for existing registry data and historical tags.
- N2: Deterministic behavior under retries and partial RW failures.
- N3: Clear diagnostics when a call attempts mutation in a read-only context.
- N4: No silent semantic drift between version policy docs and implementation.
1.4 Out of scope
- Redesigning the entire RC/EPIC/STORY/TASK schema.
- Rewriting all release tooling from scratch.
- Auto-migrating external repositories that copied legacy converter behavior.
1.5 Interaction contract with E5:S01:T46
T12owns converter semantics and collision hardening.T46remains FR-repo anchor for RW SemVer tag behavior, but must be updated to reference the finalizedT12behavior and constraints.- Plan explicitly allows updates to
T46task text/AC wording so documentation matches implementation reality.
2. Test design
- T1 — Read-only idempotency: Converting the same internal version N times leaves registry/counter unchanged.
- T2 — Finalize-once semantics: Finalization increments counter exactly once for a release and returns stable value on repeated finalize attempts.
- T3 — Collision prevention: Simulated multi-task/multi-build sequences produce unique SemVer tags.
- T4 — Retry safety: Re-running failed RW steps does not burn additional PATCH values.
- T5 — Legacy compatibility: Existing registry history still resolves deterministic SemVer for historical versions.
- T6 — RW integration: Tag/release steps use the finalized SemVer and avoid "tag already exists" churn.
- T7 — Doc parity: FR-046/T46 text and task references reflect post-fix behavior and ownership boundaries.
3. Implementation plan
- Action: Audit current
semver_converter.pycall graph and identify all mutating read paths.
Deliverable: Mutation map and single-source finalize strategy. - Action: Implement API split (
deriveread-only vsfinalizemutating) and registry lock semantics.
Deliverable: Converter changes + migration-safe registry updates. - Action: Update RW call sites to use read-only derivation except at one explicit finalize boundary.
Deliverable: RW step integration with deterministic finalize timing. - Action: Add collision/idempotency/retry tests and fixtures against BR-061 scenarios.
Deliverable: Automated regression suite proving no high-frequency PATCH drift. - Action: Update T46 and FR-046 documentation to match implemented semantics and ownership split.
Deliverable: T46 text/AC updates cross-linked to T12 and BR-061. - Action: Validate end-to-end with dry-run release simulation and tag uniqueness checks.
Deliverable: Reproducible verification evidence for T12 ACs.
3.1 Files to create or modify
packages/frameworks/workflow mgt/scripts/version/semver_converter.pysemver-registry.yaml(schema-safe evolution if required)packages/frameworks/workflow mgt/scripts/validation/validate_version_bump.py(if finalize boundary checks required)docs/project-management/kanban/epics/Epic-3/Story-002-versioning-cookbook-and-examples/T12-implement-task-touch-semver-mapping-mode.mddocs/project-management/kanban/epics/Epic-5/Story-001-fr-repo/T46-rw-semver-tag-task-touch-mode.mddocs/project-management/kanban/fr-br/FR-046-rw-semver-tag-task-touch-mode.md- Versioning/RW docs under
packages/frameworks/workflow mgt/docs/as needed
3.2 Dependency order
- Converter semantics split.
- Registry compatibility.
- RW call-site update.
- Regression tests.
- T46/FR-046 doc alignment.
- End-to-end verification.
4. Success / verification criteria
- BR-061 behavior is eliminated: no PATCH inflation from repeated read-only conversions.
- Task-touch SemVer allocation is deterministic and collision-resistant under retries.
- RW tag/release behavior consumes finalized SemVer once per release flow.
-
T46andFR-046accurately describe the implemented behavior and dependencies. - Evidence includes focused tests and a replayable dry-run scenario.