universal-dev-standards 5.7.2 β†’ 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,9 +59,48 @@ standard:
59
59
  definition: AC has no tests
60
60
  criteria: No test case references this AC
61
61
 
62
+ - status: not_implemented
63
+ symbol: "🚫"
64
+ definition: AC has no corresponding implementation (feature code does not exist)
65
+ criteria: |
66
+ No business logic in src/ corresponds to this AC.
67
+ Distinct from uncovered: uncovered = code exists but no test; not_implemented = code does not exist.
68
+ Typical signals: throw NotImplementedException(), empty stub body, FEATURE_STUB: marker.
69
+ decision_tree: |
70
+ Q1: Does the corresponding code exist in src/?
71
+ No β†’ not_implemented
72
+ Yes β†’ Q2: Does any test reference this AC?
73
+ No β†’ uncovered
74
+ Yes β†’ Q3: Are all conditions in the AC tested?
75
+ Yes β†’ covered
76
+ No β†’ partial
77
+
62
78
  calculation:
63
- formula: "AC Coverage % = (covered_count + partial_count Γ— 0.5) / total_ac_count Γ— 100"
64
- note: Partial counts as 0.5 for coverage calculation
79
+ formula: "AC Coverage % = (covered_count + partial_count Γ— 0.5) / (total_ac_count - not_implemented_count) Γ— 100"
80
+ note: |
81
+ not_implemented ACs are excluded from the coverage denominator (separate dimension).
82
+ Partial counts as 0.5 for coverage calculation.
83
+ Example: 20 ACs total, 3 not_implemented, 15 covered, 2 uncovered β†’
84
+ coverage = (15 + 0) / (20 - 3) Γ— 100 = 88.2%
85
+
86
+ ci_gate:
87
+ not_implemented_blocking: true
88
+ rule: "not_implemented_count > 0 β†’ CI fails with [AC-NOT-IMPL] before UAT gate"
89
+ report_format: |
90
+ AC Traceability Report
91
+ ──────────────────────
92
+ 🚫 NOT IMPLEMENTED (<count>) β€” BLOCKING
93
+ AC-007 OrderCancellation src/orders/ η„‘ε°ζ‡‰ε―¦δ½œ
94
+ AC-012 RefundCalculation src/payments/ η„‘ε°ζ‡‰ε―¦δ½œ
95
+
96
+ ❌ UNCOVERED (<count>) β€” WARNING
97
+ AC-003 BulkImport test/import/ 缺測試
98
+
99
+ βœ… COVERED (<count>)
100
+ ⚠️ PARTIAL (<count>)
101
+
102
+ AC Coverage: <pct>% (<covered>/<implemented_total> implemented ACs)
103
+ Status: BLOCKED by <not_impl_count> not_implemented AC(s)
65
104
 
66
105
  quality_thresholds:
67
106
  defaults:
@@ -147,7 +186,14 @@ standard:
147
186
 
148
187
  - id: honest-status
149
188
  trigger: reporting AC coverage
150
- instruction: Use honest status classification (covered/partial/uncovered); never inflate coverage
189
+ instruction: "Use honest status classification (covered/partial/uncovered/not_implemented); never inflate coverage"
190
+ priority: required
191
+
192
+ - id: not-implemented-gate
193
+ trigger: AC traceability matrix contains not_implemented status
194
+ instruction: |
195
+ Flag CI as BLOCKED with [AC-NOT-IMPL] message. List all not_implemented ACs.
196
+ not_implemented must be resolved before UAT. Exclude not_implemented from coverage denominator.
151
197
  priority: required
152
198
 
153
199
  - id: track-all-ac
@@ -0,0 +1,168 @@
1
+ # Behavior Snapshot Standard - AI Optimized
2
+ # Source: core/behavior-snapshot.md
3
+
4
+ standard:
5
+ id: behavior-snapshot
6
+ name: Behavior Snapshot Standard
7
+ description: HTTP request/response golden file format for migration parity verification and refactoring characterization; defines snapshot schema, parity gate, and Gate 0 protocol
8
+
9
+ meta:
10
+ version: "1.0.0"
11
+ updated: "2026-05-12"
12
+ source: core/behavior-snapshot.md
13
+ references:
14
+ - "XSPEC-201: Refactor/Migration Completeness Protocol"
15
+ - "Michael Feathers: Working Effectively with Legacy Code (characterization tests)"
16
+ - "Golden Master Testing pattern"
17
+
18
+ snapshot_schema:
19
+ description: Format of a single snapshot JSON file in .snapshots/<feature-id>/<scenario>.json
20
+ required_fields:
21
+ - name: feature_id
22
+ type: string
23
+ description: FM-NNN from feature-manifest.yaml
24
+ - name: scenario
25
+ type: string
26
+ description: "Scenario name (snake_case): happy_path, not_found, invalid_credentials, etc."
27
+ - name: request
28
+ type: object
29
+ fields:
30
+ method: "HTTP method (GET|POST|PUT|PATCH|DELETE)"
31
+ path: "URL path (no base URL)"
32
+ headers: "Optional request headers (omit auth tokens β€” use placeholder)"
33
+ body: "Optional request body (JSON)"
34
+ - name: response
35
+ type: object
36
+ fields:
37
+ status: "HTTP status code (integer)"
38
+ body: "Response body (JSON object)"
39
+ - name: ignore_fields
40
+ type: list
41
+ description: |
42
+ Fields to skip during parity comparison.
43
+ Use for legitimately non-deterministic values: timestamps, tokens, IDs.
44
+ Do NOT use to hide business logic differences.
45
+
46
+ example: |
47
+ {
48
+ "feature_id": "FM-007",
49
+ "scenario": "happy_path",
50
+ "request": {
51
+ "method": "POST",
52
+ "path": "/api/orders/123/cancel",
53
+ "headers": { "Content-Type": "application/json" },
54
+ "body": { "reason": "customer_request" }
55
+ },
56
+ "response": {
57
+ "status": 200,
58
+ "body": {
59
+ "success": true,
60
+ "order_status": "cancelled",
61
+ "refund_initiated": true
62
+ }
63
+ },
64
+ "ignore_fields": ["refund_id", "cancelled_at"]
65
+ }
66
+
67
+ directory_structure:
68
+ root: ".snapshots/"
69
+ layout: ".snapshots/<feature-id>/<scenario>.json"
70
+ example: |
71
+ .snapshots/
72
+ FM-001-UserLogin/
73
+ happy_path.json
74
+ invalid_credentials.json
75
+ FM-007-OrderCancellation/
76
+ happy_path.json
77
+ order_not_found.json
78
+ MANUAL-refund_webhook.json
79
+ manual_prefix:
80
+ description: "Files prefixed MANUAL- contain manually authored snapshots (cannot be auto-recorded)"
81
+ examples:
82
+ - webhook endpoints triggered by third parties
83
+ - scenarios requiring specific database state
84
+ - background job/queue-triggered flows
85
+
86
+ ignore_fields_guidance:
87
+ always_ignore:
88
+ - created_at, updated_at, timestamp, recorded_at
89
+ - token, session_id, csrf_token, access_token, refresh_token
90
+ - request_id, trace_id, correlation_id
91
+ always_compare:
92
+ - status, code, message, error_code
93
+ - user_id, order_id (when using fixed test data)
94
+ - amount, quantity, price (business calculation results)
95
+ - "success, refunded, cancelled (boolean business outcomes)"
96
+
97
+ parity_gate:
98
+ description: CI gate comparing new system responses against recorded snapshots
99
+ tool: "npx tsx scripts/parity-check.ts --url <target-url> --snapshots .snapshots [--env <uat|staging>]"
100
+ pass_criteria: "100% of non-MANUAL snapshots must match (status + non-ignored body fields)"
101
+ failure_behavior:
102
+ uat_or_production: "Exit 1 β€” deployment blocked with [PARITY-BLOCK] message"
103
+ staging: "Exit 2 β€” warning only with [PARITY-WARN] message"
104
+ report_format: |
105
+ Parity Results: <passed>/<total> passed (<pct>%)
106
+ βœ… FM-001 / happy_path
107
+ βœ… FM-001 / invalid_credentials
108
+ ❌ [PARITY-FAIL] FM-007 / happy_path
109
+ body.order_status: expected "cancelled", got "pending"
110
+
111
+ gate_zero_protocol:
112
+ description: Characterization test gate for refactoring (XSPEC-201 Phase 1)
113
+ when: "--variant refactor in /vo-pipeline"
114
+ requirement: |
115
+ Characterization tests must exist and ALL pass before refactoring begins.
116
+ Characterization tests lock existing behavior β€” they do not test correctness,
117
+ they test that the behavior does not change during refactoring.
118
+ test_annotation: "@characterization or describe('characterization')"
119
+ enforcement: |
120
+ Gate 0: Run characterization tests before first refactoring commit.
121
+ Any failure during refactoring triggers immediate warning.
122
+ Gate 2: All characterization tests must pass before refactoring is considered complete.
123
+ anti_pattern: "Do NOT start refactoring without Gate 0 β€” behavior drift becomes undetectable"
124
+
125
+ rules:
126
+ - id: snapshot-before-migration
127
+ trigger: starting --variant migration pipeline
128
+ instruction: |
129
+ .snapshots/ must exist with at least one snapshot per feature before pipeline starts.
130
+ This is Gate 1b in the pre-flight check.
131
+ priority: required
132
+
133
+ - id: characterization-before-refactor
134
+ trigger: starting --variant refactor pipeline
135
+ instruction: |
136
+ Characterization tests must exist and pass before any refactoring begins.
137
+ If characterization tests don't exist, halt and prompt developer to write them.
138
+ priority: required
139
+
140
+ - id: ignore-fields-discipline
141
+ trigger: creating or reviewing snapshot ignore_fields
142
+ instruction: |
143
+ Only add fields to ignore_fields if they are legitimately non-deterministic
144
+ (timestamps, tokens, random IDs). Business logic fields must always be compared.
145
+ Overuse of ignore_fields defeats the purpose of parity testing.
146
+ priority: required
147
+
148
+ - id: manual-snapshots
149
+ trigger: snapshot cannot be auto-recorded
150
+ instruction: |
151
+ Prefix filename with MANUAL- and note why auto-recording is not possible.
152
+ MANUAL- snapshots must be authored by a human with full business knowledge.
153
+ They are excluded from auto-replay but count toward coverage reporting.
154
+ priority: recommended
155
+
156
+ - id: parity-100-before-uat
157
+ trigger: before UAT deployment in migration pipeline
158
+ instruction: |
159
+ Run parity check against all non-MANUAL snapshots.
160
+ 100% pass rate required. Any failure blocks UAT deployment.
161
+ Fix parity failures before promoting β€” they represent behavioral divergence.
162
+ priority: required
163
+
164
+ related_standards:
165
+ - feature-manifest-standard.ai.yaml
166
+ - acceptance-criteria-traceability.ai.yaml
167
+ - refactoring-standards.ai.yaml
168
+ - testing.ai.yaml
@@ -0,0 +1,146 @@
1
+ # Feature Manifest Standard - AI Optimized
2
+ # Source: core/feature-manifest-standard.md
3
+
4
+ standard:
5
+ id: feature-manifest-standard
6
+ name: Feature Manifest Standard
7
+ description: Machine-readable feature inventory format for migration and refactoring projects; defines FM-NNN schema, confidence scoring, and FEATURE_STUB hook protocol
8
+
9
+ meta:
10
+ version: "1.0.0"
11
+ updated: "2026-05-12"
12
+ source: core/feature-manifest-standard.md
13
+ references:
14
+ - "XSPEC-200: Migration Feature Inventory and Completeness Gate"
15
+ - "XSPEC-201: Refactor/Migration Completeness Protocol"
16
+ - "XSPEC-199: AC not_implemented status"
17
+
18
+ manifest_schema:
19
+ description: Structure of feature-manifest.yaml for a migration or refactoring project
20
+ required_fields:
21
+ - name: manifest_version
22
+ type: string
23
+ value: "1.0"
24
+ - name: source_system
25
+ type: object
26
+ fields:
27
+ - language: source language (php, python, java, etc.)
28
+ - framework: source framework (laravel, django, spring, etc.)
29
+ - scan_date: ISO 8601 date
30
+ - scan_coverage: "<N>/<total> routes (100%)"
31
+ - name: features
32
+ type: list
33
+ item_schema:
34
+ - id: "FM-NNN (zero-padded 3 digits)"
35
+ - name: "PascalCase feature name"
36
+ - description: "Plain language description of business purpose"
37
+ - http_method: "GET|POST|PUT|PATCH|DELETE (null for non-HTTP)"
38
+ - route: "URL path or null for CLI/background"
39
+ - controller: "ClassName::methodName"
40
+ - confidence: "0.0–1.0 (see confidence_scoring)"
41
+ - side_effects: "list of DB_READ|DB_WRITE|EMAIL|QUEUE|HTTP_CALL|FILE"
42
+ - migration_risks: "list of risk labels (see migration_risks)"
43
+ - ac_id: "null initially; set by Planner"
44
+ - status: "not_implemented (initial value for all migration features)"
45
+
46
+ confidence_scoring:
47
+ description: How to assign confidence values during inventory
48
+ levels:
49
+ - value: 1.0
50
+ meaning: Feature name and business purpose are unambiguous from code
51
+ example: "UserLogin method in AuthController with clear JWT response"
52
+ - value: 0.8
53
+ meaning: Feature name is reasonable but business purpose requires inference
54
+ example: "process() method with database write β€” likely a form submission"
55
+ - value: 0.5
56
+ meaning: Likely an infrastructure/utility method, not a primary business feature
57
+ example: "HealthCheck, CorsMiddleware, LoggingFilter"
58
+ - value: 0.3
59
+ meaning: Unclear β€” requires human confirmation before generating AC
60
+ example: "handle() method with no context, generic catch-all route"
61
+ human_review_threshold: 0.5
62
+ human_review_rule: "All features with confidence < 0.5 MUST be reviewed by a human before AC generation"
63
+
64
+ migration_risks:
65
+ description: Risk labels for migration to target language
66
+ php_to_csharp:
67
+ - label: SESSION_HANDLING
68
+ description: PHP session β†’ ASP.NET Core Session/Cookie middleware
69
+ - label: ORM_DIFFERENCES
70
+ description: Eloquent ORM β†’ Entity Framework behavioral differences
71
+ - label: TIMEZONE_HANDLING
72
+ description: PHP timezone functions β†’ .NET DateTimeOffset
73
+ - label: FILE_UPLOAD_PATH
74
+ description: PHP $_FILES superglobal β†’ ASP.NET Core IFormFile
75
+ - label: REGEX_DIFFERENCES
76
+ description: PHP PCRE syntax vs .NET Regex syntax differences
77
+ - label: ARRAY_FUNCTIONS
78
+ description: PHP array_* functions β†’ LINQ equivalents
79
+ - label: EXCEPTION_HIERARCHY
80
+ description: PHP exception hierarchy vs .NET exception hierarchy differences
81
+ generic:
82
+ - label: ASYNC_MODEL
83
+ description: Sync code β†’ async/await migration required
84
+ - label: NULL_SEMANTICS
85
+ description: Null handling differences between source and target language
86
+ - label: STRING_ENCODING
87
+ description: String encoding/collation differences
88
+
89
+ feature_stub_protocol:
90
+ description: How to use FEATURE_STUB markers in target codebase (XSPEC-200)
91
+ format: "// FEATURE_STUB: <FM-ID> <FeatureName> β€” <AC-ID> pending"
92
+ example: |
93
+ // FEATURE_STUB: FM-007 OrderCancellation β€” AC-007 pending
94
+ public async Task<Result> CancelOrderAsync(string orderId) {
95
+ throw new NotImplementedException();
96
+ }
97
+ rules:
98
+ - "One FEATURE_STUB per FM-ID in the target codebase"
99
+ - "FEATURE_STUB is removed when implementation is complete and AC status updated"
100
+ - "FEATURE_STUB blocks CI gate (same as WARNING:STUB) β€” blocks main branch push and UAT/prod deploy"
101
+ - "FEATURE_STUB is distinct from WARNING:STUB: FEATURE_STUB = code never existed; WARNING:STUB = temp fake logic"
102
+
103
+ completeness_gate:
104
+ description: Pipeline gates enforced by this manifest (XSPEC-200)
105
+ gate_1:
106
+ name: Manifest Existence Gate
107
+ trigger: Before /vo-pipeline --variant migration starts
108
+ rule: "artifacts/feature-manifest.yaml must exist and .snapshots/ must exist"
109
+ failure_message: "Run /vo-inventory and /vo-snapshot before starting migration pipeline"
110
+ gate_not_implemented:
111
+ name: Feature Completeness Gate
112
+ trigger: CI before UAT deployment
113
+ rule: "No features in manifest may have status: not_implemented AND corresponding FEATURE_STUB in codebase"
114
+ failure_message: "[FEATURE-INCOMPLETE] N features still not implemented. See feature-manifest.yaml."
115
+
116
+ rules:
117
+ - id: manifest-before-migration
118
+ trigger: starting a migration pipeline
119
+ instruction: |
120
+ Require feature-manifest.yaml before generating AC or writing code.
121
+ All features start with status: not_implemented.
122
+ Planner generates AC from manifest entries.
123
+ priority: required
124
+
125
+ - id: confidence-review
126
+ trigger: feature-manifest.yaml has features with confidence < 0.5
127
+ instruction: |
128
+ Halt AC generation for low-confidence features.
129
+ Present list to human for review before proceeding.
130
+ Human must confirm feature name, purpose, and whether it's in scope.
131
+ priority: required
132
+
133
+ - id: stub-lifecycle
134
+ trigger: implementing a feature from manifest
135
+ instruction: |
136
+ When implementation is complete:
137
+ 1. Remove FEATURE_STUB: marker from code
138
+ 2. Update manifest status from not_implemented to implemented
139
+ 3. Update AC traceability status from not_implemented to uncovered or covered
140
+ priority: required
141
+
142
+ related_standards:
143
+ - acceptance-criteria-traceability.ai.yaml
144
+ - behavior-snapshot.ai.yaml
145
+ - spec-driven-development.ai.yaml
146
+ - refactoring-standards.ai.yaml
@@ -83,28 +83,60 @@ Scenario: User login with valid credentials
83
83
  | **Covered** | βœ… | AC is fully tested | All conditions in AC have corresponding test assertions |
84
84
  | **Partial** | ⚠️ | AC is partially tested | Some conditions tested, but edge cases or paths missing |
85
85
  | **Uncovered** | ❌ | AC has no tests | No test case references this AC |
86
+ | **Not Implemented** | 🚫 | AC has no corresponding implementation | Feature code does not exist (not a test gap β€” a code gap) |
87
+
88
+ ### `not_implemented` vs `uncovered` Decision Tree
89
+
90
+ ```
91
+ Q1: Does the corresponding code exist in src/?
92
+ No β†’ 🚫 not_implemented
93
+ Yes β†’ Q2: Does any test reference this AC?
94
+ No β†’ ❌ uncovered
95
+ Yes β†’ Q3: Are all conditions in the AC tested?
96
+ Yes β†’ βœ… covered
97
+ No β†’ ⚠️ partial
98
+ ```
99
+
100
+ Typical signals of `not_implemented`: `throw new NotImplementedException()`, empty stub body, `// FEATURE_STUB:` marker.
86
101
 
87
102
  ### Coverage Calculation
88
103
 
89
104
  ```
90
- AC Coverage % = (covered_count / total_ac_count) Γ— 100
105
+ AC Coverage % = (covered_count + partial_count Γ— 0.5) / (total_ac_count - not_implemented_count) Γ— 100
91
106
 
92
107
  Where:
93
108
  covered_count = count of AC with status "covered"
94
109
  total_ac_count = total number of AC in specification
110
+ not_implemented_count = count of AC with status "not_implemented" (excluded from denominator)
95
111
  partial counts as 0.5 for coverage calculation
96
112
  ```
97
113
 
98
114
  ### Example Calculation
99
115
 
100
116
  ```
101
- SPEC-001: 8 AC total
102
- - 5 covered (βœ…)
103
- - 2 partial (⚠️)
104
- - 1 uncovered (❌)
117
+ SPEC-001: 20 AC total
118
+ - 15 covered (βœ…)
119
+ - 0 partial (⚠️)
120
+ - 2 uncovered (❌)
121
+ - 3 not_implemented (🚫)
122
+
123
+ Coverage = (15 + 0) / (20 - 3) Γ— 100 = 88.2%
124
+ Status: BLOCKED by 3 not_implemented AC(s)
125
+ ```
126
+
127
+ ### CI Gate for `not_implemented`
128
+
129
+ `not_implemented` ACs trigger a **blocking** CI gate independent of the coverage percentage gate:
105
130
 
106
- Coverage = (5 + 2Γ—0.5) / 8 = 6/8 = 75%
107
131
  ```
132
+ [AC-NOT-IMPL] 3 AC(s) marked not_implemented:
133
+ 🚫 AC-007 OrderCancellation
134
+ 🚫 AC-012 RefundCalculation
135
+ 🚫 AC-019 ExportToPDF
136
+ All not_implemented ACs must be resolved before UAT.
137
+ ```
138
+
139
+ The gate clears only when all `not_implemented` ACs are updated to `uncovered`, `partial`, or `covered`.
108
140
 
109
141
  ---
110
142
 
@@ -273,6 +305,8 @@ Generated spec MUST include:
273
305
  | Ignoring uncovered AC | Gaps in verification | Track and plan coverage for all AC |
274
306
  | AC without testability | Cannot be verified | Ensure all AC are testable |
275
307
  | Coverage without assertions | Tests run but verify nothing | Check for meaningful assertions |
308
+ | Using `uncovered` for missing code | Hides functional completeness gap | Use `not_implemented` when code doesn't exist |
309
+ | Including `not_implemented` in denominator | Inflates coverage metric | Exclude `not_implemented` from denominator |
276
310
 
277
311
  ---
278
312
 
@@ -291,3 +325,4 @@ Generated spec MUST include:
291
325
  | Version | Date | Changes |
292
326
  |---------|------|---------|
293
327
  | 1.0.0 | 2026-03-18 | Initial version β€” traceability matrix, coverage calculation, spec generation rules |
328
+ | 1.1.0 | 2026-05-12 | Add `not_implemented` 4th status; update CI gate formula; add decision tree (XSPEC-199) |