-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAGENTS.html
More file actions
3383 lines (3382 loc) · 183 KB
/
AGENTS.html
File metadata and controls
3383 lines (3382 loc) · 183 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" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>AGENTS</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
*/
html {
color: #1a1a1a;
background-color: #fdfdfd;
}
body {
margin: 0 auto;
max-width: 36em;
padding-left: 50px;
padding-right: 50px;
padding-top: 50px;
padding-bottom: 50px;
hyphens: auto;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media (max-width: 600px) {
body {
font-size: 0.9em;
padding: 12px;
}
h1 {
font-size: 1.8em;
}
}
@media print {
html {
background-color: white;
}
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
svg {
height: auto;
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;
font-size: 85%;
margin: 0;
hyphens: manual;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
border: none;
border-top: 1px solid #1a1a1a;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC ul {
padding-left: 1.3em;
}
#TOC > ul {
padding-left: 0;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
/* The extra [class] is a hack that increases specificity enough to
override a similar rule in reveal.js */
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;}
/* CSS for syntax highlighting */
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; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
</head>
<body>
<header id="title-block-header">
<h1 class="title">AGENTS</h1>
</header>
<h2 id="inherited-from-helix-constitution">INHERITED FROM Helix
Constitution</h2>
<blockquote>
<p>Base agent rules live in the Helix Constitution submodule at the
parent project's <code>constitution/AGENTS.md</code> and the universal
<code>constitution/Constitution.md</code> it references. <strong>READ
THOSE FIRST.</strong> The base file is authoritative for any topic not
covered here. Module-specific rules below extend them; they never weaken
them.</p>
</blockquote>
<p>Critical universal rules every CLI agent (Claude Code, Cursor, Aider,
Codex, Gemini CLI) MUST honour while working in this module:</p>
<ul>
<li><strong>No bluffing.</strong> Every PASS carries positive evidence.
Constitution §11.4.</li>
<li><strong>Mutation-paired gates.</strong> Every new gate has a paired
mutation proving it catches regressions. Constitution §1.1.</li>
<li><strong>No guessing language</strong> (<code>likely</code>,
<code>probably</code>, <code>maybe</code>, <code>seems</code>).
Constitution §11.4.6.</li>
<li><strong>Credentials never tracked.</strong> <code>.env</code>
patterns git-ignored; runtime-load only. Constitution §11.4.10.</li>
<li><strong>Never force-push.</strong> Force-push requires explicit
per-session authorization AND a green §9.1.5 post-op gate. Constitution
§9.</li>
<li><strong>CONTINUATION.md kept in sync</strong> in every non-trivial
commit. Constitution §12.10.</li>
<li><strong>60% RAM cap.</strong> Heavy work wrapped in bounded
execution scope. Constitution §12.6.</li>
</ul>
<p>Canonical reference: <a
href="https://github.com/HelixDevelopment/HelixConstitution">https://github.com/HelixDevelopment/HelixConstitution</a></p>
<hr />
<h1 id="agentsmd--helixcode-authoritative-agent-guide">AGENTS.md —
HelixCode Authoritative Agent Guide</h1>
<h2 id="helixcode-agent-guidelines">HelixCode Agent Guidelines</h2>
<p><strong>Version</strong>: 3.0.0 (Updated with full architecture
audit) <strong>Date</strong>: 2026-04-30 <strong>Scope</strong>: All AI
agents, human contributors, and automated processes working on HelixCode
<strong>Authority</strong>: Derived from HelixAgent AGENTS.md with
HelixCode-specific enhancements</p>
<hr />
<h2 id="project-overview">Project Overview</h2>
<p>HelixCode is an enterprise-grade distributed AI development platform
built in Go. It enables intelligent task division, work preservation,
cross-platform development workflows, and multi-provider LLM integration
through a unified REST API, CLI, Terminal UI, Desktop, and Mobile client
architecture.</p>
<p><strong>Current Status</strong>: The <code>internal/</code>
foundation is largely solid (auth, database, server, worker, task,
workflow, tools, editor, notification, MCP, <strong>verifier</strong>
are real implementations). Critical bluff and stub areas remain in
select entry points and peripheral packages. All agents MUST prioritize
zero-bluff implementation.</p>
<p><strong>LLMsVerifier Integration Status</strong>:
<code>internal/verifier/</code> package is now implemented with REST API
client, two-tier cache, circuit breaker health monitor, background
poller, score adapter, and event publisher. BLUFF-002 (hardcoded CLI
models) and BLUFF-004 (hardcoded external models) are FIXED. BLUFF-005
(scoring ignores verifier data) is FIXED in
<code>ModelManager.SelectOptimalModel()</code>.</p>
<p><strong>Key Features</strong>:</p>
<ul>
<li><strong>Distributed Computing</strong>: SSH-based worker pools with
health monitoring, auto-installation, and consensus</li>
<li><strong>Multi-Provider LLM Integration</strong>: 15+ providers
(OpenAI, Anthropic, Gemini, Ollama, Azure, Bedrock, Groq, Mistral,
Cohere, xAI, DeepSeek, Qwen, OpenRouter, HuggingFace, Llama.cpp)</li>
<li><strong>Development Workflows</strong>: Automated planning,
building, testing, refactoring with real shell execution</li>
<li><strong>Task Management</strong>: Intelligent task division with
priorities, dependencies, checkpointing, and Redis caching</li>
<li><strong>MCP Protocol</strong>: Full Model Context Protocol server
over WebSocket with tool dispatch</li>
<li><strong>Multi-Client Architecture</strong>: REST API (Gin), Cobra
CLI, Terminal UI (tview), Desktop (Fyne), Mobile (gomobile),
WebSocket</li>
<li><strong>Memory Systems</strong>: In-memory, filesystem, Redis,
Memcached, Cognee, ChromaDB, Qdrant, Weaviate integrations</li>
<li><strong>Advanced Editor</strong>: Multi-format code editing (diff,
whole-file, search/replace, line-based) with backups</li>
<li><strong>Tools Ecosystem</strong>: 40+ tools across filesystem,
shell, web, browser, mapping, multiedit, confirmation, notebook,
git</li>
<li><strong>Notifications</strong>: Multi-channel support (Slack, Email,
Telegram, Discord, Yandex Messenger, Max)</li>
</ul>
<hr />
<h2 id="technology-stack">Technology Stack</h2>
<p><strong>Core Technologies</strong>:</p>
<ul>
<li><strong>Language</strong>: Go 1.24.0 with toolchain go1.24.9</li>
<li><strong>Module</strong>: <code>dev.helix.code</code></li>
<li><strong>HTTP Framework</strong>: Gin v1.11.0</li>
<li><strong>Authentication</strong>: JWT v4.5.2, bcrypt + argon2</li>
<li><strong>Database</strong>: PostgreSQL 15+ via pgx/v5 (optional)</li>
<li><strong>Cache</strong>: Redis 7+ via go-redis/v9 (optional)</li>
<li><strong>Configuration</strong>: Viper v1.21.0</li>
<li><strong>CLI Framework</strong>: Cobra v1.8.0</li>
<li><strong>Testing</strong>: Testify v1.11.1</li>
</ul>
<p><strong>UI Technologies</strong>:</p>
<ul>
<li><strong>Desktop</strong>: Fyne v2.7.0</li>
<li><strong>Terminal UI</strong>: tview v0.42.0</li>
<li><strong>Mobile</strong>: gomobile bindings</li>
</ul>
<p><strong>External Integrations</strong>:</p>
<ul>
<li><strong>Browser Automation</strong>: chromedp v0.14.2</li>
<li><strong>Web Scraping</strong>: goquery v1.10.3</li>
<li><strong>Tree-sitter</strong>: go-tree-sitter</li>
<li><strong>Identity</strong>: Azure SDK, AWS SDK v2</li>
<li><strong>Vector/Memory</strong>: Cognee, ChromaDB, Qdrant, Weaviate
clients</li>
<li><strong>Container Orchestration</strong>: digital.vasic.containers
(vasic-digital/Containers submodule)</li>
</ul>
<hr />
<h2 id="working-directory--build-system">Working Directory & Build
System</h2>
<p><strong>CRITICAL</strong>: All build and test commands must be run
from the <code>helix_code/</code> subdirectory, not the repository
root.</p>
<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></code></pre></div>
<h3 id="build-commands">Build Commands</h3>
<table>
<thead>
<tr>
<th>Command</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>make build</code></td>
<td>Build server binary to <code>bin/helixcode</code></td>
</tr>
<tr>
<td><code>make test</code></td>
<td>Run <code>go test -v ./...</code></td>
</tr>
<tr>
<td><code>make test-all</code></td>
<td>Run tests + coverage + benchmarks + docs</td>
</tr>
<tr>
<td><code>make test-coverage</code></td>
<td>Generate coverage report</td>
</tr>
<tr>
<td><code>make test-benchmark</code></td>
<td>Run Go benchmarks</td>
</tr>
<tr>
<td><code>make logo-assets</code></td>
<td>Generate logo assets (required before first build)</td>
</tr>
<tr>
<td><code>make setup-deps</code></td>
<td>Run <code>go mod tidy</code></td>
</tr>
<tr>
<td><code>make fmt</code></td>
<td>Run <code>go fmt ./...</code></td>
</tr>
<tr>
<td><code>make lint</code></td>
<td>Run <code>golangci-lint run ./...</code></td>
</tr>
<tr>
<td><code>make clean</code></td>
<td>Clean build artifacts</td>
</tr>
<tr>
<td><code>make dev</code></td>
<td>Start development server</td>
</tr>
<tr>
<td><code>make prod</code></td>
<td>Cross-platform production build</td>
</tr>
<tr>
<td><code>make mobile</code></td>
<td>Build iOS + Android targets</td>
</tr>
<tr>
<td><code>make aurora-os</code></td>
<td>Build Aurora OS target</td>
</tr>
<tr>
<td><code>make harmony-os</code></td>
<td>Build Harmony OS target</td>
</tr>
</tbody>
</table>
<h3 id="full-infrastructure-test-commands">Full Infrastructure Test
Commands</h3>
<table>
<thead>
<tr>
<th>Command</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>make test-infra-up</code></td>
<td>Start full Docker test infrastructure</td>
</tr>
<tr>
<td><code>make test-infra-down</code></td>
<td>Stop full Docker test infrastructure</td>
</tr>
<tr>
<td><code>make test-full</code></td>
<td>ALL tests with real infrastructure (zero skips)</td>
</tr>
<tr>
<td><code>make test-unit-full</code></td>
<td>Unit tests with real services</td>
</tr>
<tr>
<td><code>make test-integration-full</code></td>
<td>Integration tests with <code>-tags=integration</code></td>
</tr>
<tr>
<td><code>make test-e2e-full</code></td>
<td>E2E challenge tests via runner</td>
</tr>
<tr>
<td><code>make test-security-full</code></td>
<td>Security test suite</td>
</tr>
<tr>
<td><code>make test-load-full</code></td>
<td>Load tests</td>
</tr>
<tr>
<td><code>make test-complete</code></td>
<td>Sequential run of all full test types</td>
</tr>
<tr>
<td><code>make coverage-full</code></td>
<td>Coverage with full infrastructure</td>
</tr>
</tbody>
</table>
<h3 id="containerized-builds-no-host-dependencies">Containerized Builds
(NO Host Dependencies)</h3>
<table>
<thead>
<tr>
<th>Command</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>make container-builder-image</code></td>
<td>Build the builder container image</td>
</tr>
<tr>
<td><code>make container-build</code></td>
<td>Build application inside container</td>
</tr>
<tr>
<td><code>make container-test</code></td>
<td>Run tests inside container</td>
</tr>
<tr>
<td><code>make container-lint</code></td>
<td>Run linter inside container</td>
</tr>
<tr>
<td><code>make container-shell</code></td>
<td>Interactive shell in builder container</td>
</tr>
<tr>
<td><code>make container-dev-up</code></td>
<td>Start containerized dev environment</td>
</tr>
<tr>
<td><code>make container-dev-down</code></td>
<td>Stop containerized dev environment</td>
</tr>
<tr>
<td><code>make container-release</code></td>
<td>Full release build in container</td>
</tr>
<tr>
<td><code>./scripts/containers/build-in-container.sh</code></td>
<td>Convenience wrapper script</td>
</tr>
</tbody>
</table>
<p>The builder container includes: Go 1.24, gcc, postgresql-client,
redis, docker-cli, golangci-lint, and all build tools. The only host
requirement is Docker/Podman.</p>
<h3 id="standalone-test-scripts">Standalone Test Scripts</h3>
<table>
<thead>
<tr>
<th>Script</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>./run_tests.sh --unit</code></td>
<td>Unit tests</td>
</tr>
<tr>
<td><code>./run_tests.sh --integration</code></td>
<td>Integration tests</td>
</tr>
<tr>
<td><code>./run_tests.sh --e2e</code></td>
<td>E2E tests</td>
</tr>
<tr>
<td><code>./run_tests.sh --coverage</code></td>
<td>Coverage analysis</td>
</tr>
<tr>
<td><code>./run_tests.sh --security</code></td>
<td>Security tests</td>
</tr>
<tr>
<td><code>./run_all_tests.sh</code></td>
<td>Orchestrates ALL suites sequentially</td>
</tr>
<tr>
<td><code>./run_integration_tests.sh</code></td>
<td>DB integration tests with Docker</td>
</tr>
</tbody>
</table>
<h3 id="single-test-execution">Single Test 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="ex">go</span> test <span class="at">-v</span> <span class="at">-run</span> TestName ./path/to/package</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">go</span> test <span class="at">-v</span> <span class="at">-tags</span><span class="op">=</span>integration ./internal/database</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> tests/e2e/challenges <span class="kw">&&</span> <span class="ex">go</span> run cmd/runner/main.go <span class="at">-challenge</span> ascii-art-generator-001 <span class="at">-providers</span> ollama</span></code></pre></div>
<hr />
<h2 id="architecture--code-organization">Architecture & Code
Organization</h2>
<pre><code>helix_code/
├── cmd/ # Application entry points
│ ├── server/main.go # HTTP server entry point
│ ├── cli/main.go # Legacy flag-based CLI client
│ ├── root.go # Cobra root command (`helix`)
│ ├── main_commands.go # `helix start`, `helix auto`
│ ├── other_commands.go # `helix server`, `helix version`, etc.
│ ├── local-llm.go # `helix local-llm` command tree
│ ├── local-llm-advanced.go # Advanced local-llm commands
│ ├── helix-config/main.go # Dedicated config management CLI
│ ├── security-test/main.go # Simulated security test runner
│ ├── security-fix/main.go # Security fix wrapper
│ ├── security-fix-standalone/main.go # Standalone security scanner
│ ├── performance-optimization/main.go # Performance optimizer
│ ├── performance-optimization-standalone/main.go # Standalone perf simulator
│ └── config-test/main.go # Config hot-reload test utility
│
├── internal/ # Internal packages (~40 packages)
│ ├── auth/ # JWT authentication, bcrypt/argon2, sessions
│ ├── llm/ # LLM provider implementations (15+ providers)
│ │ ├── providers/ # Per-provider HTTP clients
│ │ ├── compression/ # Context compression
│ │ └── vision/ # Vision/multimodal support
│ ├── provider/ # Provider abstractions
│ ├── providers/ # Provider management
│ ├── worker/ # SSH-based worker pool, health checks
│ ├── task/ # Task queues, dependencies, checkpoints
│ ├── server/ # Gin HTTP server, routes, middleware
│ ├── database/ # PostgreSQL pgx pool, schema initialization
│ ├── redis/ # go-redis wrapper with graceful degradation
│ ├── tools/ # 40+ tool ecosystem registry
│ │ ├── filesystem/ # fs_read, fs_write, fs_edit, glob, grep
│ │ ├── shell/ # shell, shell_background with sandbox
│ │ ├── web/ # web_fetch, web_search
│ │ ├── browser/ # browser_launch, browser_navigate, browser_screenshot
│ │ ├── multiedit/ # Transactional multi-file editing
│ │ └── git/ # Git automation
│ ├── editor/ # Multi-format code editing with backups
│ ├── memory/ # Memory providers (in-mem, filesystem, Redis, etc.)
│ ├── cognee/ # Cognee.ai memory integration
│ ├── context/ # Hierarchical context management with TTL
│ ├── notification/ # Multi-channel notification engine
│ ├── mcp/ # Model Context Protocol WebSocket server
│ ├── workflow/ # Development workflow execution
│ ├── config/ # Viper-based configuration management
│ ├── event/ # Pub/sub event bus
│ ├── logging/ # Structured logging wrapper
│ ├── monitoring/ # Metric collection framework
│ ├── security/ # Security scanning (stubbed)
│ ├── session/ # Development session management
│ ├── agent/ # Agent orchestration
│ ├── project/ # Project management
│ ├── rules/ # Rules engine
│ ├── hooks/ # Hook system
│ ├── focus/ # Focus chain management
│ ├── template/ # Template system
│ ├── persistence/ # State persistence
│ ├── deployment/ # Deployment management
│ ├── discovery/ # Service/model discovery
│ ├── hardware/ # Hardware abstraction
│ ├── repomap/ # Repository mapping
│ ├── version/ # Version management
│ ├── fix/ # Security fix engine
│ ├── performance/ # Performance optimization
│ ├── testutil/ # Test utilities
│ └── mocks/ # Shared mocks
│
├── applications/ # Platform-specific applications
│ ├── desktop/ # Fyne desktop app
│ ├── terminal-ui/ # tview terminal UI
│ ├── android/ # Android app
│ ├── ios/ # iOS app
│ ├── aurora-os/ # Aurora OS client
│ └── harmony-os/ # Harmony OS client
│
├── api/ # OpenAPI specification
│ └── openapi.yaml # Full REST API spec (OpenAPI 3.0.3)
│
├── config/ # Configuration files
│ ├── config.yaml # Primary application config
│ ├── production-config.yaml # Enterprise production config
│ ├── minimal-config.yaml # Minimal test config (DB/Redis disabled)
│ ├── test-config.yaml # Test-specific config
│ ├── working-config.yaml # Working variant
│ ├── azure_example.yaml # Azure-specific example
│ └── model-aliases.example.yaml# Model alias examples
│
├── tests/ # New test framework
│ ├── e2e/challenges/ # Challenge-based E2E tests
│ └── automation/ # Hardware automation tests
│
├── test/ # Legacy/parallel test suites
│ ├── integration/ # Integration tests
│ ├── e2e/ # Legacy E2E tests
│ ├── automation/ # Provider automation tests
│ └── load/ # Load tests
│
├── benchmarks/ # Performance benchmarks
├── security/ # Security tests
├── standalone_tests/ # Standalone CLI tests
├── docker/ # Docker assets and extended compose
├── scripts/ # Build and deployment scripts
└── assets/ # Logo and image assets</code></pre>
<hr />
<h2 id="verified-real-implementations">Verified Real
Implementations</h2>
<h3 id="auth-001-authentication-system-verified-real">AUTH-001:
Authentication System (VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/auth/auth.go</code> (~470
lines) <strong>Assessment</strong>: Production-ready</p>
<ul>
<li>User registration with validation</li>
<li>Password hashing with bcrypt + argon2 fallback</li>
<li>JWT token generation and verification (JWT v4)</li>
<li>Session management with crypto-random tokens</li>
<li>Constant-time comparison for timing attack prevention</li>
<li>Full test coverage in <code>internal/auth/auth_test.go</code> (~777
lines)</li>
</ul>
<h3 id="db-001-database-layer-verified-real">DB-001: Database Layer
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/database/database.go</code>
<strong>Assessment</strong>: Production-ready</p>
<ul>
<li>PostgreSQL connection pool via pgx/v5</li>
<li>Full schema initialization (users, workers, tasks, projects,
sessions, LLM providers, MCP servers, notifications, audit logs)</li>
<li><code>DatabaseInterface</code> for testability</li>
<li>Graceful degradation when host is empty</li>
</ul>
<h3 id="srv-001-http-server-verified-real">SRV-001: HTTP Server
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/server/server.go</code>
<strong>Assessment</strong>: Production-ready</p>
<ul>
<li>Gin-based server with 50+ routes across <code>/api/v1/</code></li>
<li>JWT auth middleware, CORS, security headers</li>
<li>WebSocket endpoint for MCP</li>
<li>Health check with DB + Redis validation</li>
<li>Graceful shutdown (30s timeout)</li>
</ul>
<h3 id="llm-001-llm-providers-verified-real">LLM-001: LLM Providers
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/llm/</code> (~5000+ lines
across providers) <strong>Assessment</strong>: Real HTTP clients</p>
<ul>
<li><code>AnthropicProvider</code> (~752 lines): Full SSE streaming,
prompt caching, extended thinking, tool calls</li>
<li><code>OpenAIProvider</code> (~431+ lines): Full HTTP API client</li>
<li><code>ModelManager</code>: Multi-provider orchestration, selection
strategy, fallback chain</li>
<li>16 provider subdirectories with real HTTP implementations</li>
<li><strong>Note</strong>: The <code>internal/llm/</code> package is
genuine. Bluff areas are at <code>cmd/cli/main.go</code> only.</li>
</ul>
<h3 id="wrk-001-worker-pool-verified-real">WRK-001: Worker Pool
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/worker/</code> (~800+ lines)
<strong>Assessment</strong>: Real distributed worker management</p>
<ul>
<li><code>WorkerManager</code>: Register, heartbeat, assign tasks,
complete tasks</li>
<li>SSH config parsing, capability matching, resource tracking</li>
<li>Health checks with TTL</li>
</ul>
<h3 id="tsk-001-task-management-verified-real">TSK-001: Task Management
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/task/</code> (~1000+ lines)
<strong>Assessment</strong>: Real task lifecycle</p>
<ul>
<li>Priority queues, dependency validation, checkpointing</li>
<li>Redis caching with graceful degradation</li>
<li>Retry logic and cleanup</li>
</ul>
<h3 id="wfl-001-workflow-engine-verified-real">WFL-001: Workflow Engine
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/workflow/</code> (~1100+ lines)
<strong>Assessment</strong>: Real shell execution</p>
<ul>
<li><code>Executor</code> dispatches to real
<code>exec.CommandContext()</code> calls</li>
<li>Security filtering via <code>isDangerousCommand()</code> (rm, dd,
mkfs, fork bombs, etc.)</li>
<li>LLM integration with real <code>LLMRequest</code></li>
<li>Supports Go, Node, Python, Rust project types</li>
</ul>
<h3 id="too-001-tools-ecosystem-verified-real">TOO-001: Tools Ecosystem
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/tools/</code> (~2000+ lines)
<strong>Assessment</strong>: Real tool registry</p>
<ul>
<li>8 categories: filesystem, shell, web, browser, mapping, multiedit,
confirmation, notebook</li>
<li>Real chromedp browser automation</li>
<li>Transactional multi-file editing</li>
</ul>
<h3 id="edt-001-code-editor-verified-real">EDT-001: Code Editor
(VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/editor/</code> (~600+ lines)
<strong>Assessment</strong>: Real file I/O</p>
<ul>
<li>Diff, whole-file, search/replace, line-based editors</li>
<li>Automatic file backup with <code>io.Copy</code></li>
<li><code>EditApplier</code> / <code>EditValidator</code>
interfaces</li>
</ul>
<h3 id="not-001-notification-engine-verified-real">NOT-001: Notification
Engine (VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/notification/</code> (~800+
lines) <strong>Assessment</strong>: Real HTTP/SMTP calls</p>
<ul>
<li>Slack (webhook HTTP POST), Email (SMTP via <code>net/smtp</code>),
Telegram (Bot API), Discord (webhook)</li>
<li>Yandex Messenger (OAuth API), Max (enterprise API)</li>
<li>Rate limiting, retry, queue, metrics</li>
</ul>
<h3 id="mcp-001-mcp-protocol-server-verified-real">MCP-001: MCP Protocol
Server (VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/mcp/</code> (~400+ lines)
<strong>Assessment</strong>: Real WebSocket server</p>
<ul>
<li>gorilla/websocket concurrent session handling</li>
<li>JSON-RPC-like message format</li>
<li>Tool execution dispatch</li>
</ul>
<h3 id="cfg-001-configuration-management-verified-real">CFG-001:
Configuration Management (VERIFIED REAL)</h3>
<p><strong>File</strong>: <code>internal/config/</code> (~1700+ lines)
<strong>Assessment</strong>: Full Viper integration</p>
<ul>
<li>Environment variable binding (<code>HELIX_*</code>)</li>
<li>Config file search (<code>.</code>, <code>$HOME/.helixcode</code>,
<code>/etc/helixcode</code>)</li>
<li>Validation rules, default config creation</li>
<li><code>ConfigManager</code> for load/save/merge</li>
</ul>
<h3 id="qa-001-helixqa-integration-verified-real">QA-001: HelixQA
Integration (VERIFIED REAL)</h3>
<p><strong>Files</strong>: <code>internal/helixqa/</code>,
<code>internal/server/qa_handlers.go</code>,
<code>applications/terminal-ui/main.go</code>
<strong>Assessment</strong>: Full embedded QA engine with real session
lifecycle</p>
<ul>
<li><code>Engine</code> struct manages QA sessions with map +
sync.RWMutex</li>
<li><code>StartSession()</code>, <code>CancelSession()</code>,
<code>GetSession()</code>, <code>ListSessions()</code> with real state
tracking</li>
<li>REST API: <code>POST /api/v1/qa/session</code>,
<code>GET /api/v1/qa/session/:id/status</code>,
<code>GET /api/v1/qa/session/:id/report</code>,
<code>GET /api/v1/qa/session/:id/screenshot/:name</code>,
<code>DELETE /api/v1/qa/session/:id</code></li>
<li>CLI flags: <code>--qa-run</code>, <code>--qa-list</code>,
<code>--qa-report</code>, <code>--qa-screenshot</code>,
<code>--qa-cancel</code></li>
<li>TUI dashboard with session table, stats panel, refresh/cancel
actions</li>
<li>Screenshot pipeline: 8 platform engines (Linux, Web, iOS, Android,
CLI, TUI, macOS, Windows)</li>
<li>Tests: <code>internal/helixqa/wrapper_test.go</code>,
<code>internal/server/qa_handlers_test.go</code>,
<code>pkg/screenshot/*_test.go</code></li>
</ul>
<hr />
<h2 id="verified-bluff--stub-areas-must-fix">Verified Bluff & Stub
Areas (MUST FIX)</h2>
<h3
id="bluff-001-llm-generation-is-simulated-in-legacy-cli-critical--fixed">BLUFF-001:
LLM Generation is Simulated in Legacy CLI (CRITICAL) — FIXED</h3>
<p><strong>File</strong>: <code>cmd/cli/main.go</code> lines ~236-284
<strong>Evidence</strong>: Previously returned
<code>fmt.Sprintf("Generated response for: %s...", prompt)</code>
without calling any provider. <strong>Fix</strong>:
<code>handleGenerate()</code> now constructs a real
<code>llm.LLMRequest</code> with user messages and calls
<code>provider.Generate()</code> /
<code>provider.GenerateStream()</code>. Errors are propagated to the
user if the provider is unavailable. <strong>Verification</strong>:
<code>go build -tags nogui ./cmd/cli/</code> compiles; provider call is
real (returns error if Ollama/etc. is not running). <strong>Fix
Priority</strong>: P0 — RESOLVED</p>
<h3
id="bluff-002-model-listing-is-hardcoded-in-legacy-cli-critical--fixed">BLUFF-002:
Model Listing is Hardcoded in Legacy CLI (CRITICAL) — FIXED</h3>
<p><strong>File</strong>: <code>cmd/cli/main.go</code> lines ~101-128
<strong>Evidence</strong>: Previously only 3 hardcoded models. No
dynamic discovery. <strong>Fix</strong>: Replaced with verifier-aware
<code>handleListModels()</code> that queries LLMsVerifier adapter first,
falls back to provider discovery, then to constitutional
<code>FallbackModels</code> (7 models with scores and verification
status). <strong>Verification</strong>:
<code>go test -v ./internal/verifier/...</code> passes;
<code>go build ./cmd/cli/...</code> compiles. <strong>Fix
Priority</strong>: P0 — RESOLVED</p>
<h3
id="bluff-003-command-execution-is-simulated-in-legacy-cli-high--fixed">BLUFF-003:
Command Execution is Simulated in Legacy CLI (HIGH) — FIXED</h3>
<p><strong>File</strong>: <code>cmd/cli/main.go</code> lines ~310-324
<strong>Evidence</strong>: Previously printed the command and slept for
1 second without executing anything. <strong>Fix</strong>:
<code>handleCommand()</code> uses
<code>exec.CommandContext(ctx, "sh", "-c", command)</code> with real
<code>os.Stdout</code>/<code>os.Stderr</code> redirection. Exit codes
are reported. <strong>Verification</strong>:
<code>go build -tags nogui ./cmd/cli/</code> compiles. <strong>Fix
Priority</strong>: P0 — RESOLVED</p>
<h3 id="stub-001-security-scanning-is-simulated">STUB-001: Security
Scanning is Simulated</h3>
<p><strong>File</strong>: <code>internal/security/security.go</code>
(~132 lines) <strong>Evidence</strong>: <code>ScanFeature()</code>
contains explicit "Simulate security scanning logic" comment. Always
returns <code>Success=true, Score=95</code> with empty issues.
<strong>Fix Priority</strong>: P1</p>
<h3
id="stub-002-memory-redismemcached-providers-store-locally">STUB-002:
Memory Redis/Memcached Providers Store Locally</h3>
<p><strong>File</strong>: <code>internal/memory/</code> (~1800+ lines)
<strong>Evidence</strong>: <code>RedisMemoryProvider</code> and
<code>MemcachedMemoryProvider</code> store data in local maps with
comments like "Redis client would be used in production." Connection
config is parsed but not used. <strong>Fix Priority</strong>: P2</p>
<h3
id="stub-003-security-test-entry-point-is-entirely-simulated">STUB-003:
Security-Test Entry Point is Entirely Simulated</h3>
<p><strong>File</strong>: <code>cmd/security-test/main.go</code>
<strong>Evidence</strong>: Hardcoded list of 12 simulated security
tests. <code>simulateSecurityScan()</code> returns pre-canned issue
lists per category. <strong>Fix Priority</strong>: P2</p>
<h3 id="stub-004-several-helix-subcommands-are-print-only">STUB-004:
Several <code>helix</code> Subcommands are Print-Only</h3>
<p><strong>File</strong>: <code>cmd/other_commands.go</code>
<strong>Evidence</strong>: <code>server</code>, <code>generate</code>,
<code>test</code>, <code>worker</code>, <code>notify</code> commands are
stubbed (print placeholder messages). <strong>Fix Priority</strong>:
P2</p>
<h3
id="stub-005-several-helix-config-subcommands-are-placeholders">STUB-005:
Several <code>helix-config</code> Subcommands are Placeholders</h3>
<p><strong>File</strong>: <code>cmd/helix-config/main.go</code>
<strong>Evidence</strong>: Many template/history/schema subcommands
print placeholder messages. <strong>Fix Priority</strong>: P3</p>
<h3
id="bluff-004-llmsverifier-integration-is-stubbed-or-bypassed-critical">BLUFF-004:
LLMsVerifier Integration is Stubbed or Bypassed (CRITICAL)</h3>
<p><strong>File Pattern</strong>: <code>internal/verifier/*.go</code>
containing empty structs, <code>// TODO</code>, or methods that return
hardcoded data instead of calling the verifier.
<strong>Evidence</strong>:</p>
<ul>
<li><code>VerificationService</code> methods return hardcoded
<code>VerificationResult{OverallScore: 8.5}</code> instead of querying
the verifier database</li>
<li><code>ModelDiscoveryService</code> returns an empty slice instead of
calling provider APIs</li>
<li>The verifier client returns fallback models without attempting a
real HTTP call <strong>Fix Priority</strong>: P0 - Immediate
<strong>Verification Command</strong>:</li>
</ul>
<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">make</span> test-verifier-integration</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="co"># This MUST pass with real verifier data, not mocked scores</span></span></code></pre></div>
<h3
id="bluff-005-provider-discovery-uses-hardcoded-env-var-names-high">BLUFF-005:
Provider Discovery Uses Hardcoded Env Var Names (HIGH)</h3>
<p><strong>File Pattern</strong>:
<code>internal/verifier/startup.go</code> or provider adapter files
containing hardcoded strings like <code>"OPENAI_API_KEY"</code> without
checking <code>SupportedProviders[provider].EnvVars</code>. <strong>Fix
Priority</strong>: P1 - High</p>
<h3 id="bluff-006-model-capabilities-are-hardcoded-high">BLUFF-006:
Model Capabilities Are Hardcoded (HIGH)</h3>
<p><strong>File Pattern</strong>: <code>internal/llm/*.go</code>
containing <code>SupportsToolUse: true</code> as a struct literal for
specific models, or <code>Provider.GetCapabilities()</code> returning a
static slice. <strong>Fix Priority</strong>: P1 - High
<strong>Constitutional Impact</strong>: Violates CONST-041
(MCP/LSP/ACP/Embedding/RAG/Skills/Plugins Integration Mandate).</p>
<h3
id="bluff-007-test-claims-integration-but-uses-mocked-verifier-critical">BLUFF-007:
Test Claims Integration But Uses Mocked Verifier (CRITICAL)</h3>
<p><strong>File Pattern</strong>: <code>*_test.go</code> files with
<code>testify/mock</code> or <code>testMode: true</code> in non-unit
test files. <strong>Fix Priority</strong>: P0 - Immediate
<strong>Constitutional Impact</strong>: Violates CONST-038 (Model
Provider Anti-Bluff Guarantee) and CONST-035 (Zero-Bluff Testing).</p>
<h3 id="bluff-008-scoring-weights-do-not-sum-to-10-medium">BLUFF-008:
Scoring Weights Do Not Sum to 1.0 (MEDIUM)</h3>
<p><strong>File Pattern</strong>: <code>configs/verifier.yaml</code> or
<code>internal/verifier/config.go</code> where scoring weights are
misconfigured. <strong>Fix Priority</strong>: P2 - Medium</p>
<h3
id="bluff-009-metrics-endpoint-returns-hardcoded-zeros-critical--fixed">BLUFF-009:
<code>/metrics</code> Endpoint Returns Hardcoded Zeros (CRITICAL) —
FIXED</h3>
<p><strong>File</strong>: <code>internal/server/handlers.go</code> lines
~834-855 <strong>Evidence</strong>: All dynamic metrics (goroutines,
memory, database connections) were hardcoded to <code>0</code>.
<strong>Fix</strong>: <code>getMetrics()</code> now calls
<code>runtime.ReadMemStats()</code>,
<code>runtime.NumGoroutine()</code>, and <code>s.db.Pool.Stat()</code>
to return real values. <strong>Fix Priority</strong>: P0 — RESOLVED</p>
<h3
id="bluff-010-multi-edit-conflict-detection-is-a-no-op-high--fixed">BLUFF-010:
Multi-Edit Conflict Detection is a No-Op (HIGH) — FIXED</h3>
<p><strong>File</strong>:
<code>internal/tools/multiedit/transaction.go</code> lines ~352-369
<strong>Evidence</strong>: <code>detectFileConflict()</code> always
returned <code>nil, nil</code> with comment "For now, we'll assume no
conflicts." <strong>Fix</strong>: Implemented real conflict detection —