-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGEMINI.html
More file actions
7032 lines (7027 loc) · 442 KB
/
Copy pathGEMINI.html
File metadata and controls
7032 lines (7027 loc) · 442 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc 3.10" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>GEMINI</title>
<style>
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: 1.5em;}
div.column{flex: auto;}
@media screen {
div.columns{gap: min(4vw, 1.5em);}
div.column{overflow-x: auto;}
}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; }
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.at { color: #7d9029; }
code span.bn { color: #40a070; }
code span.bu { color: #008000; }
code span.cf { color: #007020; font-weight: bold; }
code span.ch { color: #4070a0; }
code span.cn { color: #880000; }
code span.co { color: #60a0b0; font-style: italic; }
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.do { color: #ba2121; font-style: italic; }
code span.dt { color: #902000; }
code span.dv { color: #40a070; }
code span.er { color: #ff0000; font-weight: bold; }
code span.ex { }
code span.fl { color: #40a070; }
code span.fu { color: #06287e; }
code span.im { color: #008000; font-weight: bold; }
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.kw { color: #007020; font-weight: bold; }
code span.op { color: #666666; }
code span.ot { color: #007020; }
code span.pp { color: #bc7a00; }
code span.sc { color: #4070a0; }
code span.ss { color: #bb6688; }
code span.st { color: #4070a0; }
code span.va { color: #19177c; }
code span.vs { color: #4070a0; }
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; }
</style>
<style type="text/css">
table {
border-collapse: collapse;
}
table td,
table th {
border: 1px solid #cccccc;
padding: 4px 8px;
vertical-align: top;
}
tr.cell-status-obsolete > td {
background-color: #E0E0E0;
}
tr.cell-status-obsolete > td:nth-child(2),
tr.cell-status-obsolete > td:last-child {
text-decoration: line-through;
}
</style>
</head>
<body>
<header id="title-block-header">
<h1 class="title">GEMINI</h1>
</header>
<h1 id="helixcode---distributed-ai-development-platform-gemini.md-gemini-cli-agent-manual">HelixCode
- Distributed AI Development Platform (GEMINI.md — Gemini CLI agent
manual)</h1>
<h2 id="inherited-from-constitutionclaude.md-helixconstitution-submodule">INHERITED
FROM constitution/CLAUDE.md (HelixConstitution submodule)</h2>
<p>All rules in <code>constitution/CLAUDE.md</code> (and the
<code>constitution/Constitution.md</code> it references) apply
unconditionally to HelixCode. This <code>GEMINI.md</code> is the
Gemini-CLI sibling of <code>CLAUDE.md</code> / <code>AGENTS.md</code> /
<code>QWEN.md</code> and is maintained in five-carrier lockstep with
them per §11.4.157. Project-specific rules below <strong>extend</strong>
the constitution root — they do NOT and MAY NOT weaken any universal
clause. When this file disagrees with the constitution submodule, the
constitution wins.</p>
<p><code>@constitution/CLAUDE.md</code></p>
<hr />
<h2 id="constitutional-anchors-cascaded-from-constitution.md">Constitutional
anchors (cascaded from <code>CONSTITUTION.md</code>)</h2>
<h3 id="article-xi-11.9-anti-bluff-forensic-anchor">Article XI §11.9 —
Anti-Bluff Forensic Anchor</h3>
<blockquote>
<p>Verbatim user mandate: <em>“We had been in position that all tests do
execute with success and all Challenges as well, but in reality the most
of the features does not work and can’t be used! This MUST NOT be the
case and execution of tests and Challenges MUST guarantee the quality,
the completion and full usability by end users of the product!”</em></p>
<p>Operative rule: every PASS in this codebase MUST carry positive
runtime evidence captured during execution. Metadata-only /
configuration-only / absence-of-error / grep-based PASS without runtime
evidence are critical defects regardless of how green the summary line
looks. No false-success results are tolerable.</p>
</blockquote>
<h3 id="article-xii-12.1-const-042-no-secret-leak">Article XII §12.1
(CONST-042) — No-Secret-Leak</h3>
<p>No API key, token, password, certificate, or other credential may be
committed to any repository owned by HelixDevelopment or vasic-digital.
All secrets live in <code>.env</code> files (mode 0600) listed in
<code>.gitignore</code>. Any leak is a release blocker until rotated and
post-mortemed.</p>
<h3 id="article-xii-12.2-const-043-no-force-push">Article XII §12.2
(CONST-043) — No-Force-Push</h3>
<p>No force push, force-with-lease push, history rewrite, branch
deletion of <code>main</code>/<code>master</code>, or
upstream-overwriting operation may be performed without explicit,
in-conversation user approval per operation. Authorization for one push
does not extend further. Bypassing hooks / signing / protected-branch
rules also requires explicit approval.</p>
<h3 id="const-048-full-automation-coverage-mandate-cascaded-from-constitution-submodule-11.4.25">CONST-048
— Full-Automation-Coverage Mandate (cascaded from constitution submodule
§11.4.25)</h3>
<p>No feature/functionality/flow/use-case/edge-case/service/application
on any supported platform of HelixCode is deliverable until covered by
automation tests proving six invariants: anti-bluff posture, proof of
working capability end-to-end, working implementation matching
documented promise, no open issues/bugs, full documentation in sync,
four-layer test floor. See constitution submodule
<code>Constitution.md</code> §11.4.25 for the full mandate.</p>
<h3 id="const-049-constitution-submodule-update-workflow-mandate-cascaded-from-constitution-submodule-11.4.26">CONST-049
— Constitution-Submodule Update Workflow Mandate (cascaded from
constitution submodule §11.4.26)</h3>
<p>Before any modification to
<code>constitution/{Constitution,CLAUDE,AGENTS}.md</code>: fetch+pull
first → apply with §11.4.17 classification → validate → commit+push to
EVERY upstream → careful conflict resolution (no force-push) → cascade
verification (CONST-047) → bump <code>.gitmodules</code> pointer in SAME
commit. See constitution submodule <code>Constitution.md</code> §11.4.26
for the full mandate.</p>
<h3 id="const-050-no-fakes-beyond-unit-tests-100-test-type-coverage-mandate-cascaded-from-constitution-submodule-11.4.27">CONST-050
— No-Fakes-Beyond-Unit-Tests + 100%-Test-Type-Coverage Mandate (cascaded
from constitution submodule §11.4.27)</h3>
<p><strong>(A)</strong> Mocks/stubs/fakes/placeholders/TODOs/FIXMEs/“for
now” patterns PERMITTED only in unit-test sources; non-unit tests MUST
exercise the real, fully implemented system. Production code MUST NOT
import mock paths. <strong>(B)</strong> 100% test-type coverage: unit +
integration + E2E + full-automation + security + DDoS + scaling + chaos
+ stress + performance + benchmarking + UI + UX + Challenges
(<code>./challenges/</code>) + helix_qa (<code>./helix_qa/</code>, with
full autonomous QA sessions). See constitution submodule
<code>Constitution.md</code> §11.4.27 for the full mandate.</p>
<h3 id="const-051-submodules-as-equal-codebase-decoupling-dependency-layout-mandate-cascaded-from-constitution-submodule-11.4.28">CONST-051
— Submodules-As-Equal-Codebase + Decoupling + Dependency-Layout Mandate
(cascaded from constitution submodule §11.4.28)</h3>
<p><strong>(A)</strong> Every owned-by-us submodule (orgs:
vasic-digital, HelixDevelopment, red-elf, ATMOSphere1234321, Bear-Suite,
BoatOS123456, Helix-Flow, Helix-Track, Server-Factory — dynamically
discoverable via gh/glab) is an EQUAL part of HelixCode’s codebase. Same
engineering attention as main (analysis, tests, gap-fill, bug-fix,
docs/diagrams/SQL/website materials). <strong>(B)</strong> Submodules
MUST stay fully decoupled — NEVER inject HelixCode-specific context; use
configuration injection when needed. <strong>(C)</strong> Dependencies
of owned submodules MUST live at HelixCode root
(<code><root>/<name>/</code> or
<code><root>/submodules/<name>/</code>); nested own-org
submodule chains FORBIDDEN. Third-party submodules exempt. See
constitution submodule <code>Constitution.md</code> §11.4.28 for the
full mandate.</p>
<h2 id="project-overview">Project Overview</h2>
<p>HelixCode is an enterprise-grade distributed AI development platform
that enables intelligent task division, work preservation, and
cross-platform development workflows. Built with Go and designed for
scalability, HelixCode provides a robust foundation for distributed
computing with automatic checkpointing, rollback functionality, and
real-time monitoring.</p>
<p>The project is fully completed with 5 implementation phases: -
<strong>Phase 1</strong>: Foundation (Database schema, authentication,
worker management) - <strong>Phase 2</strong>: Core Services (Task
division, LLM integration, MCP protocol) - <strong>Phase 3</strong>:
Workflows (Project management, development workflows) - <strong>Phase
4</strong>: LLM Integration (Hardware detection, model management, CLI)
- <strong>Phase 5</strong>: Advanced Features (SSH worker pool, advanced
LLM tooling)</p>
<p>Key technologies include Go 1.24+, PostgreSQL, Redis, Gin framework,
and multiple LLM providers integration (Llama.cpp, Ollama, OpenAI).</p>
<h2 id="architecture">Architecture</h2>
<p>The platform consists of: - <strong>API Layer</strong>: REST +
WebSocket + MCP - <strong>Core Services</strong>: Authentication, worker
management, task management, LLM providers - <strong>Database
Layer</strong>: PostgreSQL + Redis - <strong>Distributed
Workers</strong>: Cross-platform support - <strong>Multi-Client
Interfaces</strong>: CLI, TUI, REST, Mobile</p>
<h2 id="building-and-running">Building and Running</h2>
<h3 id="prerequisites">Prerequisites</h3>
<ul>
<li>Go 1.24.0+</li>
<li>PostgreSQL 15+</li>
<li>Redis 7+ (optional)</li>
</ul>
<h3 id="build-commands">Build Commands</h3>
<div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> HelixCode</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="co"># Setup dependencies</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> setup-deps</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="co"># Generate logo assets</span></span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> logo-assets</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Build the application</span></span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> build</span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a><span class="co"># Run all tests</span></span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> test</span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a><span class="co"># Format code</span></span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> fmt</span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a><span class="co"># Lint code</span></span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> lint</span>
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a><span class="co"># Clean build artifacts</span></span>
<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clean</span>
<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a><span class="co"># Build for production with cross-platform support</span></span>
<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> prod</span>
<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a><span class="co"># Run development server</span></span>
<span id="cb1-28"><a href="#cb1-28" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> dev</span></code></pre></div>
<h3 id="manual-build-and-execution">Manual Build and Execution</h3>
<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Build server</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">go</span> build <span class="at">-o</span> bin/helixcode ./cmd/server</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Build CLI</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="ex">go</span> build <span class="at">-o</span> bin/helixcode-cli ./cmd/cli</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="co"># Run server</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a><span class="co"># Run with specific config</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode</span> <span class="at">--config</span> config/prod/config.yaml</span></code></pre></div>
<h3 id="environment-variables">Environment Variables</h3>
<p>The application uses environment variables with <code>HELIX_</code>
prefix: - <code>HELIX_DATABASE_PASSWORD</code> - Database password -
<code>HELIX_REDIS_PASSWORD</code> - Redis password -
<code>HELIX_AUTH_JWT_SECRET</code> - JWT secret -
<code>HELIX_CONFIG</code> - Custom config file path</p>
<h3 id="cli-usage">CLI Usage</h3>
<div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Interactive mode</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode-cli</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="co"># List workers</span></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode-cli</span> <span class="at">--list-workers</span></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a><span class="co"># Add a worker</span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode-cli</span> <span class="at">--worker</span> worker-host <span class="at">--user</span> helix <span class="at">--key</span> ~/.ssh/id_rsa</span>
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a><span class="co"># Generate with LLM</span></span>
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode-cli</span> <span class="at">--prompt</span> <span class="st">"Hello world"</span> <span class="at">--model</span> llama-3-8b</span>
<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a><span class="co"># Health check</span></span>
<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a><span class="ex">./bin/helixcode-cli</span> <span class="at">--health</span></span></code></pre></div>
<h2 id="development-conventions">Development Conventions</h2>
<h3 id="go-code-structure">Go Code Structure</h3>
<p>The codebase follows Go best practices with a well-organized internal
structure:</p>
<ul>
<li><code>cmd/</code> - Main applications (server and CLI)</li>
<li><code>internal/</code> - Private application code organized by
domain:
<ul>
<li><code>auth/</code> - Authentication system</li>
<li><code>config/</code> - Configuration management</li>
<li><code>database/</code> - Database layer</li>
<li><code>hardware/</code> - Hardware detection</li>
<li><code>llm/</code> - LLM providers and reasoning</li>
<li><code>logo/</code> - Logo processing & assets</li>
<li><code>mcp/</code> - MCP protocol implementation</li>
<li><code>notification/</code> - Multi-channel notifications</li>
<li><code>project/</code> - Project management</li>
<li><code>redis/</code> - Redis utilities</li>
<li><code>server/</code> - HTTP server & API</li>
<li><code>session/</code> - Session management</li>
<li><code>task/</code> - Task management & checkpoints</li>
<li><code>theme/</code> - Theme management</li>
<li><code>worker/</code> - Worker pool management</li>
<li><code>workflow/</code> - Workflow execution</li>
</ul></li>
<li><code>pkg/</code> - Shared libraries (public)</li>
<li><code>shared/</code> - Shared code for mobile bindings</li>
<li><code>scripts/</code> - Build and utility scripts</li>
<li><code>test/</code> - Test-specific code</li>
</ul>
<h3 id="code-style">Code Style</h3>
<ul>
<li>Go idiomatic code with clear function and variable names</li>
<li>Structured configuration using Viper for environment and file
configuration</li>
<li>Proper error handling with descriptive error messages</li>
<li>Comprehensive logging with structured logging approach</li>
<li>Dependency injection for better testability</li>
</ul>
<h3 id="testing-practices">Testing Practices</h3>
<ul>
<li>Test files follow Go convention with <code>_test.go</code>
suffix</li>
<li>Uses <code>testify</code> package for assertions and require
functions</li>
<li>Comprehensive test coverage with unit, integration, and end-to-end
tests</li>
<li>Test helpers for temporary directories and environment setup</li>
<li>Table-driven tests for multiple scenarios</li>
<li>Mock implementations where needed for testing</li>
</ul>
<h3 id="configuration-management">Configuration Management</h3>
<ul>
<li>Centralized configuration using Viper</li>
<li>Environment variable support with <code>HELIX_</code> prefix</li>
<li>YAML configuration files with validation</li>
<li>Default values for all configuration options</li>
<li>Secure defaults (e.g., requires non-default JWT secret)</li>
</ul>
<h3 id="database-schema">Database Schema</h3>
<ul>
<li>PostgreSQL database with 11 core tables:
<ul>
<li><code>users</code>: User accounts and authentication</li>
<li><code>workers</code>: Distributed worker nodes with SSH config</li>
<li><code>tasks</code>: Task management with checkpoints and
dependencies</li>
<li><code>projects</code>: Project lifecycle management</li>
<li><code>sessions</code>: Development sessions and context</li>
<li><code>llm_providers</code>: Configured LLM provider instances</li>
<li><code>notifications</code>: Multi-channel notification
management</li>
</ul></li>
</ul>
<h3 id="api-endpoints">API Endpoints</h3>
<ul>
<li>REST API with versioning (v1)</li>
<li>Standard HTTP status codes</li>
<li>JSON request/response format</li>
<li>Authentication via JWT tokens</li>
<li>Comprehensive error responses with error codes</li>
</ul>
<h2 id="mobile-support">Mobile Support</h2>
<ul>
<li>iOS framework generation using gomobile</li>
<li>Android AAR generation using gomobile</li>
<li>Shared code in <code>pkg/mobile-core</code> for cross-platform
functionality</li>
</ul>
<h2 id="os-support">OS Support</h2>
<ul>
<li>Linux, macOS, Windows</li>
<li>Aurora OS and Symphony OS clients</li>
<li>Cross-platform SSH worker management</li>
</ul>
<h2 id="documentation-files">Documentation Files</h2>
<ul>
<li>Architecture Overview</li>
<li>Development Guide<br />
</li>
<li>User Guide</li>
<li>API Documentation</li>
<li>Phase implementation summaries (2, 4, 5)</li>
</ul>
<h3 id="const-052-lowercase-snake_case-naming-mandate-cascaded-from-constitution-submodule-11.4.29">CONST-052
— Lowercase-Snake_Case-Naming Mandate (cascaded from constitution
submodule §11.4.29)</h3>
<p>Every directory/submodule/file MUST use lowercase snake_case names.
Existing non-compliant names MUST be renamed atomically with updates to
all references (configs, docs, source-code imports, governance files).
Common-sense exceptions: language-mandated case
(Java/Kotlin/Android/Apple/C#/Swift) inside language-root, vendor
third-party submodules, build artefacts. <code>upstreams/</code> →
<code>upstreams/</code> transition: <code>install_upstreams.sh</code>
supports BOTH directory names during migration. Phased execution; each
rename batch ships with (i) reference-resolution regression test, (ii)
full CONST-050(B) test-type matrix run, (iii) anti-bluff wire-evidence.
See root <code>CONSTITUTION.md</code> §CONST-052 and constitution
submodule <code>Constitution.md</code> §11.4.29 for the full
mandate.</p>
<h2 id="const-053-.gitignore-no-versioned-build-artifacts-mandate-cascaded-from-constitution-submodule-11.4.30">CONST-053:
.gitignore + No-Versioned-Build-Artifacts Mandate (cascaded from
constitution submodule §11.4.30)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-15): <em>“every project module, every
Submodule, every servcie and apolication MUST HAVE proper .gitignore
file! We MUST NOT git version build artifacts, cache files, tmp files,
main .env file(s) or any files containing sensitive data, API keys or
token! Any build derivate which we can recreate by executing proper
mechanism for generating MUST NOT be versioned! We MUST pay attention
what is going to be commited every time we are preparing to execute
commit! If any violetion is detected it MUST be fixed before commit is
executed!”</em></p>
</blockquote>
<p>Every project module, owned-by-us submodule, service, and application
MUST ship a proper <code>.gitignore</code>.
Forbidden-from-version-control classes:</p>
<ol type="1">
<li><strong>Build artefacts</strong>: <code>/bin/</code>,
<code>/build/</code>, <code>/dist/</code>, <code>/out/</code>,
<code>target/</code>, <code>*.exe</code>, <code>*.dll</code>,
<code>*.so</code>, <code>*.dylib</code>, <code>*.a</code>,
<code>*.o</code>, <code>*.class</code>, <code>*.pyc</code>,
generator-produced files when the generator is committed.</li>
<li><strong>Cache files</strong>: <code>__pycache__/</code>,
<code>.pytest_cache/</code>, <code>.mypy_cache/</code>,
<code>.ruff_cache/</code>, <code>node_modules/</code>,
<code>.next/</code>, <code>.cache/</code>, <code>.gradle/</code>,
<code>.terraform/</code>, language-server caches.</li>
<li><strong>Temp files</strong>: <code>*.tmp</code>, <code>*.swp</code>,
<code>*~</code>, <code>.DS_Store</code>, <code>Thumbs.db</code>,
<code>*.orig</code>, <code>*.rej</code>.</li>
<li><strong>Sensitive-data files</strong>: <code>.env</code>,
<code>.env.*</code> (allow <code>.env.example</code> placeholder only —
no real secrets even as examples), <code>*.pem</code>,
<code>*.key</code>, <code>*.crt</code>, <code>id_rsa*</code>,
<code>id_ed25519*</code>, <code>.netrc</code>, <code>secrets/</code>,
<code>api_keys.sh</code>.</li>
<li><strong>Generated reports/logs</strong>: <code>*.log</code>,
<code>coverage.out</code>, <code>htmlcov/</code>, runtime captures
unless reference assets.</li>
<li><strong>OS/IDE personal state</strong>: <code>.idea/</code>,
<code>.history/</code>, <code>.vscode/</code> (except shared
settings).</li>
</ol>
<p><strong>Anti-bluff invariant</strong>: <code>.gitignore</code> line
alone is not sufficient — no file matching the forbidden patterns may be
CURRENTLY TRACKED. A tracked <code>*.log</code> despite the ignore-line
is a violation of equal severity to no ignore-line at all.</p>
<p><strong>Pre-commit attention</strong>: every commit author (human OR
agent) MUST inspect <code>git diff --staged</code> +
<code>git status</code> BEFORE executing the commit. Forbidden-class
hits abort the commit until fixed (un-stage, add to
<code>.gitignore</code>, scrub if already-tracked). Gate
<code>CM-GITIGNORE-PRECOMMIT-AUDIT</code> + paired mutation.</p>
<p><strong>Secret-leak intersection (CONST-042 / §11.4.10):</strong> a
<code>.env</code> leak is BOTH a CONST-053 and a CONST-042 violation;
rotation + post-mortem required.</p>
<p><strong>Recreatable-content test</strong>: if a documented mechanism
regenerates the file from sources, it is a build derivative and MUST be
ignored. The committed sources MUST include the generator.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-053</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a §11.4 PASS-bluff at the
repository-hygiene layer. See constitution submodule
<code>Constitution.md</code> §11.4.30 for the full mandate.</p>
<h2 id="const-054-submodule-dependency-manifest-mandate-cascaded-from-constitution-submodule-11.4.31">CONST-054:
Submodule-Dependency-Manifest Mandate (cascaded from constitution
submodule §11.4.31)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-15): <em>“We MUST HAVE mechanism for
each Submodule to determine / know what are its Submodule dependencies
so new projects or palces we are incorporate them can add these
Submodules to the project root and make them available! Suggested idea
is configuration file with expected Submodules Git ssh urls perhaps? New
project can read it, and recursively add each Submodule to the root of
the project and install / expose it to veryone.”</em></p>
</blockquote>
<p>Every owned-by-us submodule MUST ship <code>helix-deps.yaml</code> at
its root declaring its own-org dependencies. Schema:
<code>schema_version</code>,
<code>deps: [{name, ssh_url, ref, why, layout: flat|grouped}]</code>,
<code>transitive_handling.{recursive,conflict_resolution}</code>,
<code>language_specific_subtree</code>. Tooling:
<code>incorporate-submodule <ssh-url></code> adds the submodule at
the parent project’s canonical path (CONST-051(C)), reads
<code>helix-deps.yaml</code>, recurses for each declared dep, aborts on
conflicting refs, emits <code><root>/.helix-manifest.yaml</code>
audit record.</p>
<p>Anti-bluff guarantee: every manifest paired with a Challenge that
bootstraps a throwaway consuming project, runs
<code>incorporate-submodule</code>, asserts produced layout matches the
manifest, runs the submodule’s own tests against the bootstrapped
layout, captures wire evidence per §11.4.2. A manifest without this
proof is a CONST-054 violation.</p>
<p>§11.4.31 / CONST-054 is the <strong>operational complement</strong>
of CONST-051(C): nested own-org submodule chains are FORBIDDEN —
manifests are the bridge that lets consumers reconstruct the dependency
graph at the parent root.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-054</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to §11.4 PASS-bluff at the
dependency-graph layer. See constitution submodule
<code>Constitution.md</code> §11.4.31 for the full mandate.</p>
<h2 id="const-055-post-constitution-pull-validation-mandate-cascaded-from-constitution-submodule-11.4.32">CONST-055:
Post-Constitution-Pull Validation Mandate (cascaded from constitution
submodule §11.4.32)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-15): <em>“Every time we fetch and pull
new changes on constitution Submodule we MUST process the whole project
and all Submodule (deep recursively) for validation and verification
taht every single rule or mandatory constraint is followed and
respected! If it is not, IT MUST BE!”</em></p>
</blockquote>
<p>Whenever a project’s constitution submodule is fetched + pulled with
any content change, the project MUST run
<code>scripts/verify-all-constitution-rules.sh</code> BEFORE the new
constitution HEAD is treated as canonical for any other work. The sweep
re-runs the governance-cascade verifier AND every implementable rule
gate (CONST-053 <code>.gitignore</code> audit, CONST-051(C)
nested-own-org-chain audit, CONST-052 case audit, CONST-050(A)
mock-from-production audit, CONST-035 anti-bluff smoke, etc.) against
the post-pull tree. Failures populate the project’s Issues tracker per
§11.4.15 (Status: <code>Reopened</code>, Type: <code>Bug</code>);
closure requires positive-evidence per §11.4.</p>
<p>Pull-time invocation:
<code>git submodule update --remote constitution</code> triggers the
sweep automatically (post-update hook OR commit-wrapper invocation).
Operator-explicit manual invocation also available.</p>
<p>Anti-bluff: the sweep’s own meta-test (paired mutation per §1.1)
plants a known violation of each enforced gate and asserts the sweep
reports FAIL for the planted gate. A sweep that exits PASS without
running every implementable gate is a CONST-055 violation.</p>
<p>CONST-055 is the <strong>enforcement engine</strong> for every other
§11.4.x and CONST-NNN rule — without it, new rules cascade as anchors
but never get enforced.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-055</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to §11.4 PASS-bluff at the
constitutional-enforcement layer. See constitution submodule
<code>Constitution.md</code> §11.4.32 for the full mandate.</p>
<h2 id="const-056-mandatory-install_upstreams-on-cloneadd-mandate-cascaded-from-constitution-submodule-11.4.36">CONST-056:
Mandatory install_upstreams on clone/add Mandate (cascaded from
constitution submodule §11.4.36)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-15): <em>“Every Submodule or Git
repository we add or clone MUST BE upstreams installed using
Upstreamable utility which MUST BE available through exported paths of
the host system (in .bashrc or .zhrc) using install_upstreams command
executed from the root of the cloned (added) repository - only if in it
is Upstreams or upstreams directory present with bash script files
(recipes) for all repository’s upstreams!”</em></p>
</blockquote>
<p>Every clone / add of a Git repository under HelixCode MUST be
followed by <code>install_upstreams</code> invocation from the
repository’s root IF its tree contains <code>upstreams/</code> (or
legacy <code>upstreams/</code> per CONST-052 transition) populated with
<code>*.sh</code> recipe files. The utility (installed on operator’s
<code>PATH</code> via <code>.bashrc</code>/<code>.zshrc</code>;
implementation in the constitution submodule’s
<code>install_upstreams.sh</code> — already supports BOTH directory
names since constitution commit <code>45d3678</code>) reads the recipe
files, configures every declared upstream as a named git remote, and
fans out <code>origin</code> push URLs.</p>
<p>Skipping the invocation when <code>upstreams/</code> is present
silently breaks §2.1 (multi-upstream push is the norm) — the next push
lands on only one upstream. Gate
<code>CM-INSTALL-UPSTREAMS-ON-CLONE</code> + paired mutation.
Automation: the future <code>incorporate-submodule</code> per CONST-054
auto-invokes; manual invocation supported. Pre-commit check:
<code>git remote -v | grep -c push</code> reports expected count.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-056</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. See constitution submodule
<code>Constitution.md</code> §11.4.36 for the full mandate.</p>
<h2 id="const-057-type-aware-closure-status-vocabulary-cascaded-from-constitution-submodule-11.4.33">CONST-057:
Type-aware Closure-Status Vocabulary (cascaded from constitution
submodule §11.4.33)</h2>
<p>Every project tracking work items by Type per §11.4.16 MUST close
them with the Type-appropriate terminal <code>**Status:**</code> value,
drawn from this 3-element closed map:</p>
<table>
<thead>
<tr>
<th>Item <code>**Type:**</code></th>
<th>Closure <code>**Status:**</code> value</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Bug</code></td>
<td><code>Fixed (→ Fixed.md)</code></td>
</tr>
<tr>
<td><code>Feature</code></td>
<td><code>Implemented (→ Fixed.md)</code></td>
</tr>
<tr>
<td><code>Task</code></td>
<td><code>Completed (→ Fixed.md)</code></td>
</tr>
</tbody>
</table>
<p>The <code>(→ Fixed.md)</code> suffix is preserved across all three so
the existing migration-discipline tooling (atomic Issues.md → Fixed.md
move per §11.4.19) keeps working without per-Type branching. Generators
(in HelixCode: the §11.4.93 <code>workable-items export</code> DB
exporter — which SUPERSEDES the markdown-derived
<code>generate_issues_summary.sh</code> /
<code>generate_fixed_summary.sh</code>, both of which now REFUSE to run
— and the §11.4.23 colorizer) MUST treat the three terminal values as
semantically equivalent (all “closed, positive evidence captured”) while
preserving the literal in the emitted document.</p>
<p>Closing a <code>Feature</code> with <code>Fixed (→ Fixed.md)</code>
or a <code>Task</code> with <code>Implemented (→ Fixed.md)</code> is a
CONST-057 violation. Gate <code>CM-CLOSURE-VOCAB-TYPE-AWARE</code> walks
every Fixed.md heading + every Issues.md heading whose
<code>**Status:**</code> is one of the three terminal values and asserts
the Status-Type match. Composes with §11.4.15 / §11.4.16 / §11.4.19 /
§11.4.23.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-057</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. See constitution submodule
<code>Constitution.md</code> §11.4.33 for the full mandate.</p>
<h2 id="const-058-reopened-source-attribution-mandate-cascaded-from-constitution-submodule-11.4.34">CONST-058:
Reopened-Source Attribution Mandate (cascaded from constitution
submodule §11.4.34)</h2>
<p>Every Issues.md (or equivalent project tracker) heading whose
<code>**Status:**</code> is <code>Reopened</code> MUST carry, within 8
non-blank lines of the heading, a <code>**Reopened-Details:**</code>
line capturing four sub-facts:</p>
<ul>
<li><strong>By:</strong> <code>AI</code> or <code>User</code>
(source-of-truth observer who flipped the status). <code>AI</code>
covers in-loop reopens (test failure, gate regression, captured-evidence
retrospect). <code>User</code> covers operator-side observations (manual
testing, end-user report, design reconsideration).</li>
<li><strong>On:</strong> ISO date (<code>YYYY-MM-DD</code>).</li>
<li><strong>Reason:</strong> one-line cause classification — chosen from
the closed vocabulary
<code>{ test-failed | manual-testing-detected | captured-evidence-contradicts | end-user-report | cycle-re-discovered | design-reconsidered }</code>.
Other values permitted with explicit
<code>Reason: <free text></code> annotation but the closed list
MUST be tried first.</li>
<li><strong>Evidence:</strong> path to or short description of the
captured artefact justifying the reopen — log file, recording, gate
failure ID, operator quote, etc. Reopens without evidence are §11.4.6 /
§11.4.7 violations (demotion from Fixed requires captured evidence under
the conditions that re-exposed the defect).</li>
</ul>
<p>The Issues_Summary.md Status column MUST distinguish the four
<code>Reopened</code> sub-states by source so a sweep query for “reopens
by AI in the last 30 days” is mechanically possible. Suggested column
rendering: <code>Reopened (AI: test-failed)</code> vs
<code>Reopened (User: manual-testing)</code>. Gate
<code>CM-ITEM-REOPENED-DETAILS</code> mirrors
<code>CM-ITEM-OPERATOR-BLOCKED-DETAILS</code> (§11.4.21 walk pattern).
Composes with §11.4.6 / §11.4.7 / §11.4.15 / §11.4.21.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-058</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. See constitution submodule
<code>Constitution.md</code> §11.4.34 for the full mandate.</p>
<h2 id="const-059-canonical-root-inheritance-clarity-cascaded-from-constitution-submodule-11.4.35">CONST-059:
Canonical-Root Inheritance Clarity (cascaded from constitution submodule
§11.4.35)</h2>
<p>The <strong>constitution submodule’s</strong> three files
(<code>constitution/Constitution.md</code>,
<code>constitution/CLAUDE.md</code>,
<code>constitution/AGENTS.md</code>) ARE the <strong>canonical
root</strong> (also called the <strong>parent</strong> files). They
contain only universal rules per §11.4.17.</p>
<p>The consuming project’s <strong>repository-root files</strong>
(<code><project-root>/CLAUDE.md</code>,
<code><project-root>/AGENTS.md</code>, optionally
<code><project-root>/Constitution.md</code>) are <strong>consumer
extensions</strong>. They MUST start with the inheritance pointer
(either the Claude-Code native <code>@constitution/CLAUDE.md</code>
import or the portable
<code>## INHERITED FROM constitution/CLAUDE.md</code> heading). They
contain only project-specific rules per §11.4.17.</p>
<p><strong>When in doubt about which file to edit:</strong> universal
rule → constitution submodule’s file; project-specific rule → consumer’s
file. Default consumer-side when uncertain (§11.4.17 — narrower scope is
cheap to widen).</p>
<p><strong>Terminology:</strong> “the parent CLAUDE.md” / “the root
Constitution” → constitution-submodule file at
<code>constitution/<filename></code>; “the project CLAUDE.md” /
“this project’s AGENTS.md” → consumer-side file at
<code><project-root>/<filename></code>.</p>
<p><strong>No silent demotion or silent promotion.</strong> Moving a
rule between layers MUST be a visible commit — <code>git mv</code> of a
section if it’s a clean clone, or explicit
<code>Lifted from <project> to constitution per §11.4.35</code> /
<code>Demoted from constitution to <project> per §11.4.35</code>
commit-message annotation.</p>
<p>Gate <code>CM-CANONICAL-ROOT-CLARITY</code> verifies (a) consumer’s
<code>CLAUDE.md</code> opens with the inheritance pointer, (b)
constitution submodule’s three files are present at the expected path,
(c) no <code>## INHERITED FROM</code> block in the constitution
submodule’s own files (those ARE the source-of-truth, not consumers).
Composes with §11.4.17.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>CONST-059</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. See constitution submodule
<code>Constitution.md</code> §11.4.35 for the full mandate.</p>
<h2 id="const-060-fetch-before-edit-mandate-cascaded-from-constitution-submodule-11.4.37">CONST-060:
Fetch-before-edit Mandate (cascaded from constitution submodule
§11.4.37)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-15): <em>“Make sure that
feedback_fetch_before_edit memory rule is part of our constitution
Submodule - the root Consitution, AGENTS.MD and CLAUDE.MD. Validate and
verify that Proejct-Toolkit and all Submodules do inherit all of them!
Follow the constitution Submodule documentation for details.”</em></p>
</blockquote>
<p>The FIRST git-touching action of every session, on every consuming
project (owned or third-party), MUST be:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> fetch <span class="at">--all</span> <span class="at">--prune</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> log <span class="at">--oneline</span> HEAD..@{u}</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> submodule foreach <span class="at">--recursive</span> <span class="st">'git fetch --all --prune --quiet'</span></span></code></pre></div>
<p>If <code>HEAD..@{u}</code> is non-empty, integrate the upstream
changes BEFORE any local edit. Acting on stale local state produces
three failure modes documented in the originating §11.4.37 incident
(multi-agent / parallel-session work): (1) <strong>redundant
work</strong> — the agent re-does what a parallel session already
finished, (2) <strong>false confidence</strong> — completion reports for
already-done work, (3) <strong>divergent history</strong> — duplicate
sibling commits that double the conflict surface on next push.</p>
<p><strong>Anti-bluff invariant</strong>: the fetch+log check MUST
produce captured evidence — the actual <code>HEAD..@{u}</code> output,
even if empty. Skipping the check on the basis of “I just fetched” or
“nothing could have changed in the last N minutes” is a §11.4.6
(no-guessing) violation: the remote state is not knowable without a
fetch.</p>
<p><strong>Cascade requirement</strong>: This anchor (verbatim or by
<code>CONST-060</code> ID reference) MUST appear in every owned
submodule’s <code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to §11.4 PASS-bluff at the
parallel-session-coordination layer. See constitution submodule
<code>Constitution.md</code> §11.4.37 for the full mandate.</p>
<h2 id="positive-sink-side-downstream-evidence-mandate-cascaded-from-constitution-submodule-11.4.68">§11.4.68
— Positive Sink-Side / Downstream Evidence Mandate (cascaded from
constitution submodule §11.4.68)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“We still do not hear any
audio played from D3 device! Arvus Web Dashboard when we play music from
D3 shows nothing for Codec In Use! This MUST BE investigated and fixed!
How come we passed the tests with Arvus validation? What were values for
the Codec In Use field? Empty means nothing! This is not working! It
MUST BE FIXED, TESTED AND VERIFIED WITH FULL AUTOMATION TESTING
ASAP!!!”</em></p>
</blockquote>
<p>A test that asserts audio or video routing PASS MUST capture and
verify <strong>positive sink-side or downstream evidence</strong> —
never config-only, never metadata-only, never PCM-open-state-only. At
least one of the closed enumeration MUST be captured for every
audio/video routing PASS: (1) sink-side codec-state with non-empty
Codec-In-Use matching the expected codec regex; (2) strictly-positive
PCM frames-written delta from
<code>/proc/asound/.../status hw_ptr</code>; (3) ALSA ELD/EDID-Like-Data
showing negotiated channel count + format; (4) ffprobe-on-captured-mp4
with non-zero frame count + expected codec/resolution/fps; (5)
recording-analyzer event match per §11.4.2/§11.4.5; (6) tinycap RMS
amplitude above the line-level floor. Empty /
<code><unreachable></code> / <code><N.E.></code> /
<code><None></code> placeholders are NOT positive evidence; a
missing-but-required sink is <code>OPERATOR-BLOCKED</code>
(release-blocker), never SKIP, never PASS. No escape hatch — no
<code>--skip-sink-evidence</code>, <code>--allow-empty-codec</code>,
<code>--sink-unreachable-is-pass</code>,
<code>--metadata-only-suffices</code> flag exists.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>§11.4.68</code> reference) MUST appear in every owned submodule’s
<code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a §11.4 PASS-bluff at the
sink-side-evidence layer. <strong>Canonical authority:</strong>
constitution submodule <code>Constitution.md</code> §11.4.68 for the
full mandate.</p>
<h2 id="subagent-driven-execution-is-the-default-cascaded-from-constitution-submodule-11.4.70">§11.4.70
— Subagent-Driven Execution Is The Default (cascaded from constitution
submodule §11.4.70)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“Always do if possible
Subagent-driven! Add this into our root (constitution Submodule)
Constitution.md, CLAUDE.md and AGENTS.md. This should be the default
choice ALWAYS!”</em></p>
</blockquote>
<p>When executing implementation plans (or any task-decomposed execution
flow), the <strong>default execution model is subagent-driven</strong>
per <code>superpowers:subagent-driven-development</code>. Inline
execution is permitted ONLY when (a) the task is trivial AND fits a
single sub-300-line edit, OR (b) the operator explicitly requests inline
at brainstorm-handoff time. Subagent-driven is the default because it
gives isolated context per task, naturally enforces two-stage review, is
parallel-PWU compatible (§11.4.58), creates an anti-bluff seam (§11.4),
and survives operator absence. No escape hatch —
<code>--inline-execution-required</code>, <code>--no-subagents</code>,
<code>--monolithic-execution</code> are NOT permitted flags. Skipping
subagent-driven for non-trivial work without recorded operator
authorisation is itself a §11.4 PASS-bluff.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>§11.4.70</code> reference) MUST appear in every owned submodule’s
<code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a §11.4 PASS-bluff at the
execution-model layer. <strong>Canonical authority:</strong>
constitution submodule <code>Constitution.md</code> §11.4.70 for the
full mandate.</p>
<h2 id="pre-push-fetch-investigate-integrate-mandate-cascaded-from-constitution-submodule-11.4.71">§11.4.71
— Pre-Push Fetch + Investigate + Integrate Mandate (cascaded from
constitution submodule §11.4.71)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“before pushing changes to
any upstream for any repository - main repo or Submodule, we MUST fetch
and pull all changes. Once these are obtained WE MUST investigate what
is different compared to head position we were on last time before
fetching and pulling new changes! We MUST understand what is done and
for what purpose, easpecially how that does affect our project and our
System in general! Any mandatory changes or improvements required by
fresh changes we just have brough in MUST BE incorporated, covered with
all supported types of the tests which will produce as a result of its
success execution REAL PROOFS of working for all componetns and
functionalities covered and work fully in anti-bluff manner!”</em></p>
</blockquote>
<p>The everyday-push variant of §11.4.41. EVERY push (every repository —
main + every submodule) MUST follow the 5-step cycle: (1) fetch all
remotes (<code>git fetch --all --prune --tags</code>, capture stdout);
(2) pull all upstream branches whose tip differs, resolving conflicts
per consumer judgment (never
auto-<code>--ours</code>/<code>--theirs</code>); (3) investigate the
diff vs OUR previous HEAD — read EVERY foreign commit’s body, understand
what/why/how-it-affects-our-system; (4) integrate mandatory changes with
§11.4.4(b) four-layer coverage + §11.4.43 TDD-fix discipline, every PASS
carrying §11.4.5 captured-evidence (REAL PROOFS, not metadata-only); (5)
only then push, verifying with <code>git ls-remote</code> post-push. No
escape hatch — no <code>--skip-fetch</code>,
<code>--no-investigate</code>, <code>--fast-push</code>,
<code>--trust-upstream</code> flag.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>§11.4.71</code> reference) MUST appear in every owned submodule’s
<code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a §11.4 PASS-bluff at the
push-discipline layer. <strong>Canonical authority:</strong>
constitution submodule <code>Constitution.md</code> §11.4.71 for the
full mandate.</p>
<h2 id="audio-top-priority-mandate-cascaded-from-constitution-submodule-11.4.72">§11.4.72
— Audio Top-Priority Mandate (cascaded from constitution submodule
§11.4.72)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“Make sure all fixes for
audio are always top priority in main working stream!”</em></p>
</blockquote>
<p>The conductor (main working stream — Claude Code session, AI agent,
or human operator) MUST treat audio fixes as the highest-priority class
on the serial dispatch queue. Any time the conductor faces a choice
between dispatching an audio task vs a non-audio task on the SAME serial
resource, the audio task wins. Parallel BACKGROUND subagents (research,
refactors, infrastructure documentation) MAY run concurrently with audio
work but do NOT preempt audio on the main-stream serial dispatch queue.
No escape hatch — there is no “but this non-audio task is faster” or
“but this research is more interesting” override; audio-stack
regressions are user-perceptible and high-impact while research and
refactors can wait.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>§11.4.72</code> reference) MUST appear in every owned submodule’s
<code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a process violation at
the dispatch-priority layer. <strong>Canonical authority:</strong>
constitution submodule <code>Constitution.md</code> §11.4.72 for the
full mandate.</p>
<h2 id="main-specification-document-versioning-revision-discipline-cascaded-from-constitution-submodule-11.4.73">§11.4.73
— Main-Specification Document Versioning + Revision Discipline (cascaded
from constitution submodule §11.4.73)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“Make sure everything we add
now in previous and upcoming requests IS ALWAYS applied to the main
specification — if we have one. Since all these are not major changes we
could increase Specification version per change for secondary version
instead of the primary. Primary version MUST BE increased for much
bigger levels of changes! Add this into root (constitution Submodule)
Constitution.md, CLAUDE.md and AGENTS.md as mandatory rule / constraint
applicable ONLY IF we have something like the main specification
document or we do recognize something like the main specification
document. Document MUST BE updated ALWAYS to follow the versioning rules
we are appling here + revision and other properties we have!”</em></p>
</blockquote>
<p>Applies <strong>only when a project recognises a main specification
document</strong>. When it does: (1) every additive operator
requirement, refinement, or accepted recommendation MUST be applied to
the spec before or as part of the implementing work; (2) spec versioning
has two axes — <em>primary</em> (V1/V2/V3, bumped for major rewrites by
explicit operator decision, old versions archived) and
<em>secondary</em> (the §11.4.61 metadata-table <code>Revision</code>
integer, bumped for every other change); (3) the metadata table MUST
stay current (<code>Revision</code>, <code>Last modified</code>,
<code>Status summary</code>, <code>Fixed</code>); (4) propagated copies
of the rule MUST reference the active
<code>specification.V<primary>.md</code>, not a stale archive; (5)
on primary bump the old file moves to
<code><spec-dir>/archive/</code> with
<code>Status: superseded</code>. Classification: universal, applicable
conditionally per the scope condition.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>§11.4.73</code> reference) MUST appear in every owned submodule’s
<code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a release blocker when a
project has a main spec and lets it drift. <strong>Canonical
authority:</strong> constitution submodule <code>Constitution.md</code>
§11.4.73 for the full mandate.</p>
<h2 id="submodule-catalogue-first-discovery-extend-dont-reimplement-cascaded-from-constitution-submodule-11.4.74">§11.4.74
— Submodule-Catalogue-First Discovery + Extend-Don’t-Reimplement
(cascaded from constitution submodule §11.4.74)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“We MUST ALWAYS check which
already developed features / functionalities do exist as a part of our
comprehensive Submodules catalogue located in vasic-digital and
HelixDevelopment organizations on GitHub and GitLab both! Project MUST
BE aware of all its existence so we do not implement same things
multiple times if they are already done as some of existing universal,
reusable general development purpose Submodules! For any missing
features that some Submodules we incorporate may be missing we MUST
IMPLEMENT the properly and extend those Submodules furter! We do control
all of the and we CAN and MUST maintain and extend the regularly! All
development cycle rules we have MUST BE applied to them and fully
respected!”</em></p>
</blockquote>
<p>Before scaffolding ANY new module, package, helper, or utility, the
contributor (human or AI agent) MUST: (1) survey the canonical Submodule
catalogue — <code>vasic-digital</code> and <code>HelixDevelopment</code>
on both GitHub AND GitLab; (2) inventory existing Submodules; (3) reuse
before reimplement — if a Submodule provides the functionality (or 80%+
of it), add it as a Git submodule rather than write fresh; (4) extend
in-place when 80%+ matches but features are missing — add the missing
features TO THAT SUBMODULE (PR upstream + bump pointer), never as a
duplicating consuming-project helper; (5) apply all development-cycle
rules to those Submodules; (6) document the survey result in the
feature’s tracker entry with a <code>Catalogue-Check:</code> field
(<code>reuse <org/repo>@<sha></code> /
<code>extend <org/repo>@<sha></code> /
<code>no-match <date></code>). Classification: universal.</p>
<p><strong>Cascade requirement:</strong> This anchor (verbatim or by
<code>§11.4.74</code> reference) MUST appear in every owned submodule’s
<code>CONSTITUTION.md</code>, <code>CLAUDE.md</code>, and
<code>AGENTS.md</code>. Severity-equivalent to a process violation;
duplicate implementations landed without catalogue check are release
blockers. <strong>Canonical authority:</strong> constitution submodule
<code>Constitution.md</code> §11.4.74 for the full mandate.</p>
<hr />
<h2 id="universal-sink-side-positive-evidence-taxonomy-mechanical-enforcement-cascaded-from-constitution-submodule-11.4.69">§11.4.69
— Universal Sink-Side Positive-Evidence Taxonomy + Mechanical
Enforcement (cascaded from constitution submodule §11.4.69)</h2>
<blockquote>
<p>Verbatim user mandate (2026-05-20): <em>“THIS MUST HAPPEN NEVER
AGAIN!!! We MUST HAVE this all working! Not just for audio but for every
single piece of the System!!! Proper full automation when executed with
success MUST MEAN that manual testing will be as much positive at least
regarding the success results! … Solution MUST BE universal, generic
that solves working flows for all System components and for all future
and all existing projects! … Everything we do MUST BE validated and
verified with rock-solid proofs and anti-bluff policy enforcement and
fulfillment!”</em></p>
</blockquote>
<p>Universal generalisation of §11.4.68 (audio-specific) across every
user-visible feature class. Every user-visible feature MUST map to one
entry in the closed-set §11.4.69 sink-side evidence taxonomy
(<code>audio_output</code>, <code>audio_input</code>,
<code>video_display</code>, <code>network_throughput</code>,