jattac.libs.web.zest-button 1.2.9 → 1.4.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.
@@ -0,0 +1,595 @@
1
+ # AI_GIT_WORKFLOW.md
2
+
3
+ # Purpose
4
+
5
+ This document defines the mandatory Git workflow for this repository.
6
+
7
+ Its objectives are:
8
+
9
+ * Protect repository history.
10
+ * Prevent accidental work on protected branches.
11
+ * Keep commits small and reviewable.
12
+ * Ensure every change is reproducible.
13
+ * Ensure repository protections remain enabled.
14
+
15
+ The terms **MUST**, **MUST NOT**, **SHALL**, **SHALL NOT**, **SHOULD**, and **MAY** are interpreted according to RFC 2119.
16
+
17
+ ---
18
+
19
+ # Workflow
20
+
21
+ Every implementation SHALL follow this exact sequence.
22
+
23
+ ```
24
+ Understand Request
25
+ ↓
26
+ Analyse Existing Code
27
+ ↓
28
+ Determine Blast Radius
29
+ ↓
30
+ Write / Extend Tests
31
+ ↓
32
+ Verify Tests Fail (when applicable)
33
+ ↓
34
+ Implement
35
+ ↓
36
+ Run All Required Tests
37
+ ↓
38
+ Build
39
+ ↓
40
+ Update ai-knowledge.md
41
+ ↓
42
+ Update decision-log.md
43
+ ↓
44
+ Self Review
45
+ ↓
46
+ Complete
47
+ ```
48
+
49
+ Do not skip steps.
50
+
51
+ Do not reorder steps.
52
+
53
+ ---
54
+
55
+ # Repository Safety
56
+
57
+ Repository history is a critical project asset.
58
+
59
+ Protecting repository history SHALL always take priority over implementation speed.
60
+
61
+ AI agents SHALL NEVER weaken repository protections.
62
+
63
+ ---
64
+
65
+ # Protected Branches
66
+
67
+ The following branches SHALL be considered protected unless explicitly configured otherwise.
68
+
69
+ * master
70
+ * main
71
+ * trunk
72
+ * production
73
+ * release
74
+
75
+ Protected branches SHALL NEVER be used for implementation work.
76
+
77
+ ---
78
+
79
+ # Absolute Prohibitions
80
+
81
+ AI agents SHALL NEVER:
82
+
83
+ * Commit directly to a protected branch.
84
+ * Push directly to a protected branch.
85
+ * Merge directly into a protected branch.
86
+ * Force push a protected branch.
87
+ * Delete a protected branch.
88
+ * Rewrite protected branch history.
89
+ * Disable Git hooks.
90
+ * Remove repository protections.
91
+ * Recommend `--no-verify`.
92
+ * Bypass repository safety mechanisms without explicit user instruction.
93
+
94
+ ---
95
+
96
+ # Working Branches
97
+
98
+ All implementation SHALL occur on a working branch.
99
+
100
+ Recommended names:
101
+
102
+ ```
103
+ feature/<description>
104
+
105
+ bugfix/<description>
106
+
107
+ refactor/<description>
108
+
109
+ hotfix/<description>
110
+
111
+ experiment/<description>
112
+ ```
113
+
114
+ Examples:
115
+
116
+ ```
117
+ feature/payment-import
118
+
119
+ bugfix/invoice-rounding
120
+
121
+ refactor/order-service
122
+ ```
123
+
124
+ ---
125
+
126
+ # Beginning Work
127
+
128
+ Before modifying code the AI SHALL determine:
129
+
130
+ Current branch
131
+
132
+ ↓
133
+
134
+ Protected?
135
+
136
+ If YES:
137
+
138
+ Create a working branch.
139
+
140
+ Switch to it.
141
+
142
+ Only then begin implementation.
143
+
144
+ ---
145
+
146
+ # Pull Requests
147
+
148
+ Protected branches SHALL receive code through Pull Requests.
149
+
150
+ AI agents SHALL NOT merge Pull Requests.
151
+
152
+ AI agents SHALL prepare changes for review.
153
+
154
+ ---
155
+
156
+ # Repository Bootstrap
157
+
158
+ Before implementation the AI SHALL verify that repository safety exists.
159
+
160
+ Required checks:
161
+
162
+ ✓ `.githooks/` exists
163
+
164
+ ✓ `core.hooksPath` points to `.githooks`
165
+
166
+ ✓ Required hooks exist
167
+
168
+ ✓ Bootstrap script exists
169
+
170
+ ✓ Branch protections documented
171
+
172
+ If any item is missing:
173
+
174
+ Bootstrap the repository.
175
+
176
+ ---
177
+
178
+ # Version Controlled Hooks
179
+
180
+ Repository hooks SHALL be version controlled.
181
+
182
+ Do NOT use:
183
+
184
+ ```
185
+ .git/hooks
186
+ ```
187
+
188
+ Instead use:
189
+
190
+ ```
191
+ .githooks/
192
+
193
+ pre-commit
194
+
195
+ pre-push
196
+
197
+ pre-merge-commit
198
+
199
+ commit-msg
200
+ ```
201
+
202
+ Repository setup SHALL execute:
203
+
204
+ ```
205
+ git config core.hooksPath .githooks
206
+ ```
207
+
208
+ ---
209
+
210
+ # Bootstrap Script
211
+
212
+ If no bootstrap exists the AI SHALL create:
213
+
214
+ ```
215
+ scripts/bootstrap.sh
216
+ ```
217
+
218
+ The bootstrap SHALL:
219
+
220
+ Configure Git hooks
221
+
222
+ ↓
223
+
224
+ Configure core.hooksPath
225
+
226
+ ↓
227
+
228
+ Verify required tooling
229
+
230
+ ↓
231
+
232
+ Restore dependencies
233
+
234
+ ↓
235
+
236
+ Verify build
237
+
238
+ ↓
239
+
240
+ Verify tests
241
+
242
+ ↓
243
+
244
+ Print success summary
245
+
246
+ The bootstrap MUST be idempotent.
247
+
248
+ Running it multiple times SHALL NOT damage an existing repository.
249
+
250
+ ---
251
+
252
+ # Hook Responsibilities
253
+
254
+ ## pre-commit
255
+
256
+ Responsible for:
257
+
258
+ * formatting
259
+ * linting
260
+ * fast validation
261
+ * accidental generated files
262
+ * obvious mistakes
263
+
264
+ Must remain fast.
265
+
266
+ ---
267
+
268
+ ## commit-msg
269
+
270
+ Responsible for:
271
+
272
+ * commit message validation
273
+ * optional Conventional Commit enforcement
274
+
275
+ ---
276
+
277
+ ## pre-push
278
+
279
+ Responsible for:
280
+
281
+ Rejecting pushes to:
282
+
283
+ ```
284
+ master
285
+
286
+ main
287
+
288
+ trunk
289
+
290
+ production
291
+
292
+ release
293
+ ```
294
+
295
+ unless the administrator override is explicitly enabled.
296
+
297
+ The hook SHOULD also verify:
298
+
299
+ * build passes
300
+ * tests pass
301
+ * branch naming
302
+ * clean working tree
303
+
304
+ ---
305
+
306
+ ## pre-merge-commit
307
+
308
+ Responsible for validating merges before completion.
309
+
310
+ ---
311
+
312
+ # Administrator Override
313
+
314
+ Repository protections intentionally include a human override.
315
+
316
+ The override exists for:
317
+
318
+ * emergency production fixes
319
+ * repository maintenance
320
+ * administrator initiated pushes
321
+
322
+ The override SHALL NOT activate automatically.
323
+
324
+ The override SHALL require explicit human intent.
325
+
326
+ AI agents SHALL NEVER invoke the override unless explicitly instructed by the user.
327
+
328
+ ---
329
+
330
+ # Standard Override Command
331
+
332
+ The repository SHALL provide:
333
+
334
+ ```
335
+ git push-master
336
+ ```
337
+
338
+ Bootstrap SHALL configure:
339
+
340
+ ```
341
+ git config alias.push-master \
342
+ '!ALLOW_PROTECTED_BRANCH_PUSH=1 git push'
343
+ ```
344
+
345
+ This alias is the ONLY approved local override mechanism.
346
+
347
+ AI agents SHALL NOT invent alternative bypass methods.
348
+
349
+ AI agents SHALL NOT recommend:
350
+
351
+ ```
352
+ git push --no-verify
353
+ ```
354
+
355
+ or disabling hooks.
356
+
357
+ ---
358
+
359
+ # pre-push Override Behaviour
360
+
361
+ The repository pre-push hook SHALL implement the following logic.
362
+
363
+ ```
364
+ Current Branch
365
+
366
+ ↓
367
+
368
+ Protected?
369
+
370
+ ↓
371
+
372
+ NO
373
+
374
+ ↓
375
+
376
+ Allow Push
377
+
378
+ ---------------------
379
+
380
+ YES
381
+
382
+ ↓
383
+
384
+ ALLOW_PROTECTED_BRANCH_PUSH == 1 ?
385
+
386
+ ↓
387
+
388
+ YES
389
+
390
+ ↓
391
+
392
+ Allow Push
393
+
394
+ ↓
395
+
396
+ Display Warning
397
+
398
+ ---------------------
399
+
400
+ NO
401
+
402
+ ↓
403
+
404
+ Reject Push
405
+ ```
406
+
407
+ Example warning:
408
+
409
+ ```
410
+ ====================================
411
+
412
+ Protected Branch Override Enabled
413
+
414
+ You are intentionally pushing directly to a protected branch.
415
+
416
+ Proceeding because administrator override was explicitly requested.
417
+
418
+ ====================================
419
+ ```
420
+
421
+ ---
422
+
423
+ # Existing Hooks
424
+
425
+ If hooks already exist:
426
+
427
+ Inspect them.
428
+
429
+ Preserve repository-specific behaviour.
430
+
431
+ Extend them if necessary.
432
+
433
+ Never overwrite customized hooks without explicit instruction.
434
+
435
+ ---
436
+
437
+ # Existing Bootstrap
438
+
439
+ If the repository already contains:
440
+
441
+ ```
442
+ bootstrap.sh
443
+
444
+ setup.sh
445
+
446
+ setup-repository.sh
447
+
448
+ install.sh
449
+ ```
450
+
451
+ Reuse it.
452
+
453
+ Do not create competing bootstrap mechanisms.
454
+
455
+ ---
456
+
457
+ # CI
458
+
459
+ Git hooks are convenience.
460
+
461
+ CI is enforcement.
462
+
463
+ If CI does not exist the AI SHOULD recommend creating it.
464
+
465
+ CI SHOULD verify:
466
+
467
+ * Build
468
+ * Unit Tests
469
+ * Service Tests
470
+ * API Integration Tests
471
+ * API Contract Tests
472
+ * UI End-to-End Tests
473
+ * Static Analysis
474
+ * Formatting
475
+
476
+ ---
477
+
478
+ # E2E Merge Gate
479
+
480
+ E2E tests are expensive. They are NOT run on every commit.
481
+
482
+ E2E tests SHALL run before merge to master.
483
+
484
+ This applies to:
485
+
486
+ * Local merges to master
487
+
488
+ * Pull Requests targeting master
489
+
490
+ ---
491
+
492
+ ## Local Merge Workflow
493
+
494
+ Before merging to master, the developer (or AI agent) SHALL:
495
+
496
+ 1. Ensure the API server is running
497
+
498
+ 2. Run e2e tests: `dotnet test --filter Category=E2E`
499
+
500
+ 3. Verify all e2e tests pass
501
+
502
+ 4. Create marker: `touch .e2e-passed`
503
+
504
+ 5. Complete the merge
505
+
506
+ 6. Push to remote
507
+
508
+ 7. Delete marker: `rm .e2e-passed`
509
+
510
+ ---
511
+
512
+ ## CI Workflow
513
+
514
+ If CI exists, e2e tests SHALL be a required check for Pull Requests targeting master.
515
+
516
+ ---
517
+
518
+ ## Enforcement
519
+
520
+ The pre-push hook rejects pushes to master if `.e2e-passed` does not exist —
521
+ but only once the project actually has an E2E suite (a non-empty `e2e/` or
522
+ `e2e-tests/` directory). Until then, the gate does not apply.
523
+
524
+ Where the gate applies, it is a hard block. No override exists for the e2e requirement.
525
+
526
+ AI agents SHALL NOT bypass this mechanism.
527
+
528
+ AI agents SHALL NOT create the marker without running tests.
529
+
530
+ AI agents SHALL NOT recommend skipping e2e tests.
531
+
532
+ ---
533
+
534
+ # Atomic Changes
535
+
536
+ Each branch SHOULD represent one logical change.
537
+
538
+ Never combine:
539
+
540
+ * features
541
+ * bug fixes
542
+ * formatting
543
+ * refactoring
544
+ * dependency upgrades
545
+
546
+ unless explicitly instructed.
547
+
548
+ ---
549
+
550
+ # Commit Discipline
551
+
552
+ Commits SHOULD be:
553
+
554
+ * small
555
+ * reviewable
556
+ * cohesive
557
+ * reversible
558
+
559
+ Avoid repository-wide formatting changes.
560
+
561
+ Avoid unrelated edits.
562
+
563
+ Avoid opportunistic cleanup.
564
+
565
+ ---
566
+
567
+ # Repository Validation Checklist
568
+
569
+ Before considering work complete verify:
570
+
571
+ ✓ Working branch used
572
+
573
+ ✓ Protected branches untouched
574
+
575
+ ✓ Hooks installed
576
+
577
+ ✓ Bootstrap exists
578
+
579
+ ✓ Build succeeds
580
+
581
+ ✓ All required tests pass
582
+
583
+ ✓ No unrelated files modified
584
+
585
+ ✓ ai-knowledge.md updated
586
+
587
+ ✓ decision-log.md updated
588
+
589
+ ✓ Repository protections preserved
590
+
591
+ ✓ E2E critical path tests pass
592
+
593
+ ✓ .e2e-passed marker exists (before push to master)
594
+
595
+ Only then is implementation considered complete.