Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
949457689c
|
||
|
|
0cb035555f
|
||
|
|
a5974d0ea0
|
||
|
|
1ea15462c0
|
||
|
|
9d8f364af1
|
||
|
|
c87b0c31e1 | ||
|
|
c5802cf86d | ||
|
|
4f2338810b | ||
|
|
f8da67348c | ||
|
|
003771ca48 | ||
|
|
f7926cde15 | ||
|
|
3a05b3ecd0 | ||
|
|
6031a7a14b | ||
|
|
ad9ec16844 | ||
|
|
3977eaad68 | ||
|
|
3b6de96782 | ||
|
|
decc86fd08 | ||
|
|
5485dc4690 | ||
|
|
57865b51f4 | ||
|
|
0a1aa8b3c2 | ||
|
|
7c8114bc55 | ||
|
|
aa57377c7f | ||
|
|
8aa65bc7b4 | ||
|
|
a781fde566 | ||
|
|
3b372b4a91 | ||
|
|
066522cf5d | ||
|
|
ec9bf5feb2 | ||
|
|
dfb37fb4f2 | ||
|
|
86c2909a57 | ||
|
|
b5482857f8 | ||
|
|
0c137d9319 | ||
|
|
59827b19bd | ||
|
|
34179f0f9f | ||
|
|
9c193aeebb | ||
|
|
1cd8955d23 | ||
|
|
004e38b8eb | ||
|
|
c5991a560e | ||
|
|
04ce0f9056 | ||
|
|
e5cb0ac00b | ||
|
|
abe4c488cf | ||
|
|
973541f344 | ||
|
|
3c4b7b5877 | ||
|
|
8fbfb3c99f | ||
|
|
3b33d164c7 | ||
|
|
292597660f | ||
|
|
ba3a26af3c | ||
|
|
4bb473c0b0 | ||
|
|
c3d49cbc6c | ||
|
|
e831edb005 | ||
|
|
3db2654188 | ||
|
|
afdb4b203f | ||
|
|
6f57d38669 | ||
|
|
d60995af43 | ||
|
|
472d9d8b10 | ||
|
|
11b89354a6 | ||
|
|
8150df8d81 | ||
|
|
b8e080301c | ||
|
|
2d87e9f587 | ||
|
|
749baa3e5d | ||
|
|
90deba8472 | ||
|
|
9498fad064 | ||
|
|
6ca5c7f851 | ||
|
|
dfce3360b2 | ||
|
|
58629ea03a | ||
|
|
5b3b88ed3d | ||
|
|
62dbac9247 | ||
|
|
a8aad28239 | ||
|
|
9d633855f4 | ||
|
|
56ac50931e | ||
|
|
3e437d4275 | ||
|
|
c9951c085c | ||
|
|
59c6f0e4c0 | ||
|
|
9460f51e07 | ||
|
|
3ac5b97706 | ||
|
|
1add0fca32 | ||
|
|
0d8c48cbf4 | ||
|
|
e41b7606d6 | ||
|
|
ad2ceaaec2 | ||
|
|
c3b636bf72 | ||
|
|
98acd6aad0 | ||
|
|
8f7743c73d | ||
|
|
60a19ab15e | ||
|
|
dc1e45ff82 | ||
|
|
5fefd1902f | ||
|
|
45ed5b2faf | ||
|
|
f0fac7899f | ||
|
|
c7e12b56d0 | ||
|
|
087aa45349 | ||
|
|
4cc22ac5e0 | ||
|
|
7f0ecaa192 | ||
|
|
a203cbc03b | ||
|
|
17c07a31fe | ||
|
|
87100c4aba | ||
|
|
5498c97e3d | ||
|
|
3ff6867e84 | ||
|
|
7c050eef14 | ||
|
|
d98abad8bb | ||
|
|
9e92beb4cc | ||
|
|
ca597c3678 | ||
|
|
63476393d7 | ||
|
|
9d930436c5 | ||
|
|
be0f6f5ab7 | ||
|
|
66daa071a5 | ||
|
|
ca44b9e6bb | ||
|
|
da7efa3f4e | ||
|
|
4de8882ef5 | ||
|
|
c00a90c9ca | ||
|
|
c4c50ea70d | ||
|
|
c578c8e954 | ||
|
|
e85719f2d2 | ||
|
|
4dca007003 | ||
|
|
d7d1bd4556 | ||
|
|
dc26daeebe | ||
|
|
f727d54d75 | ||
|
|
6f8371a7bf | ||
|
|
fff689312d | ||
|
|
b701f60a99 | ||
|
|
6ba6a595b8 | ||
|
|
6cd9c4a7d8 | ||
|
|
816ce2e1f8 | ||
|
|
19570ad4bb | ||
|
|
5212a4d913 | ||
|
|
46f0643cf5 | ||
|
|
656feab2a4 | ||
|
|
0611e00330 | ||
|
|
128d5e0a82 | ||
|
|
c6187b7c23 | ||
|
|
afd6669877 | ||
|
|
7bf007bb58 | ||
|
|
92a74e4b7d | ||
|
|
0880e6a01c | ||
|
|
4a889991bd | ||
|
|
89bb4eb46b | ||
|
|
f3c7555195 | ||
|
|
79f3895923 | ||
|
|
837cd91501 | ||
|
|
5112ce896b | ||
|
|
7715d6b23b | ||
|
|
373032e330 | ||
|
|
6a69fb760a | ||
|
|
4cc7573b27 | ||
|
|
1d7fd6aab3 | ||
|
|
c04a18d387 | ||
|
|
abf485b9ef | ||
|
|
0245c4e455 | ||
|
|
fa00f74af5 | ||
|
|
2f9ed7adca | ||
|
|
4f2e1c3687 | ||
|
|
2d2ca156d8 | ||
|
|
f8c3dbedf2 | ||
|
|
17354de8fe | ||
|
|
7066a6fd46 | ||
|
|
20595a70b4 | ||
|
|
568f7adf52 | ||
|
|
74e34fb07a | ||
|
|
e6d765d233 | ||
|
|
4250a31ff9 | ||
|
|
ad19271c6c | ||
|
|
b774b68ed4 | ||
|
|
8eaf7b00c3 | ||
|
|
59eecd956d | ||
|
|
e2f9388071 | ||
|
|
6c095e5ac6 | ||
|
|
274acfe6f5 | ||
|
|
f1eda629a8 | ||
|
|
5602534ba9 | ||
|
|
bc9b9952cd | ||
|
|
7f5a73d97d | ||
|
|
02a4ac0629 | ||
|
|
ab78f5c909 | ||
|
|
c9c552a1bd | ||
|
|
c24b055cf3 | ||
|
|
72052fe186 | ||
|
|
0f14378363 | ||
|
|
551220eccc | ||
|
|
287f8d71dd | ||
|
|
390e89aefb | ||
|
|
18e21661b2 | ||
|
|
8af19c79f4 | ||
|
|
b7cda2b2fe | ||
|
|
c86b8659e5 | ||
|
|
de3b41b70d | ||
|
|
5aa0aead4d | ||
|
|
0dae907dad | ||
|
|
59e3de62db | ||
|
|
6c2ab54f65 | ||
|
|
be47311883 | ||
|
|
1e9659c7a2 | ||
|
|
ca73d02804 | ||
|
|
5f827b6e19 | ||
|
|
7d9c40d79d | ||
|
|
33da08bce5 | ||
|
|
f2b8681611 | ||
|
|
fc609171ca | ||
|
|
2399da1f8d | ||
|
|
d699b9afba | ||
|
|
7a03e003a1 | ||
|
|
340223de2e | ||
|
|
54697c6e17 | ||
|
|
18eed1fb96 | ||
|
|
55c201e7c1 | ||
|
|
54a78175b4 | ||
|
|
cae19ca42e | ||
|
|
d4558c15d3 | ||
|
|
75c1dbf83c | ||
|
|
536155752c | ||
|
|
958561d255 | ||
|
|
7cd62232ef | ||
|
|
32b73c3a28 | ||
|
|
b0137d6181 | ||
|
|
a776de8b8f | ||
|
|
b577b02eb6 | ||
|
|
b006b1c943 | ||
|
|
4241dbf817 | ||
|
|
0ccd1793e3 | ||
|
|
29aad11bed | ||
|
|
6e33004ef2 | ||
|
|
afca2c164f | ||
|
|
c7e2160582 | ||
|
|
849e24757d | ||
|
|
e143362479 | ||
|
|
4146600579 | ||
|
|
a04afe8d4e | ||
|
|
550bb60691 | ||
|
|
df54db239d | ||
|
|
de532ca299 | ||
|
|
d7fc4e1fe9 | ||
|
|
e8a60c4abd | ||
|
|
1f8a9964c1 | ||
|
|
aabe8f7a80 | ||
|
|
fe9bdefc62 | ||
|
|
205d0ec976 | ||
|
|
e9ecc84064 | ||
|
|
3b7193c207 | ||
|
|
84cb0eb3fd | ||
|
|
d9fda2338f | ||
|
|
64acc0e97a | ||
|
|
8d2307d12d | ||
|
|
8c128592bd | ||
|
|
39430d78ae | ||
|
|
9c9aefd296 | ||
|
|
e63489829e | ||
|
|
87bc53c278 | ||
|
|
5bdf68594d | ||
|
|
f6988916d8 | ||
|
|
aaccbcf984 | ||
|
|
f9e3c4eaa4 | ||
|
|
97195bf2ac | ||
|
|
c787db7e07 | ||
|
|
12b5022a4f | ||
|
|
8c98f20f0e | ||
|
|
9e334c3627 | ||
|
|
66f06a1878 | ||
|
|
6d7f341de5 | ||
|
|
7973feceb0 | ||
|
|
8ccac46fc9 | ||
|
|
b70e791fed | ||
|
|
1a57aa7216 | ||
|
|
102355aba5 | ||
|
|
9a08048744 | ||
|
|
793569f6e1 | ||
|
|
ffafc3a989 | ||
|
|
951acb8088 | ||
|
|
afc0c0319b | ||
|
|
522dfa5703 | ||
|
|
332e444397 | ||
|
|
959e1e0520 | ||
|
|
d8572e17e6 | ||
|
|
b2f720cc2b | ||
|
|
c7fc55a0ef | ||
|
|
e84dd0f7e2 | ||
|
|
1624353b2b | ||
|
|
5e7b51710c | ||
|
|
97466ad27d | ||
|
|
90c5f5075a | ||
|
|
4e97975862 | ||
|
|
64e398112f | ||
|
|
2a5b50346c | ||
|
|
6ff09f92a5 | ||
|
|
07c8bf310d | ||
|
|
dc6c4826bc | ||
|
|
d915a24f4d | ||
|
|
267528efba | ||
|
|
ad827e34bb | ||
|
|
69b8c482c1 | ||
|
|
aac77950f2 | ||
|
|
614ab1e6fa | ||
|
|
2e6c493487 | ||
|
|
2ca7c9b2b9 | ||
|
|
b395eec893 | ||
|
|
5675284b08 | ||
|
|
cbe998b598 | ||
|
|
fc0dd41092 | ||
|
|
2f8d375692 | ||
|
|
8ed814cbf7 | ||
|
|
852dd4f6c7 | ||
|
|
88514a444b | ||
|
|
e33adbb12f | ||
|
|
ae178f1be0 | ||
|
|
d1b7a21b9b | ||
|
|
bf4fde5f7d | ||
|
|
6194a51ed0 | ||
|
|
4847fb0b77 | ||
|
|
fd241a59cc | ||
|
|
0f0f048380 | ||
|
|
974c93498a | ||
|
|
92bc0f692f | ||
|
|
7b2af3348d | ||
|
|
89cbbfc871 | ||
|
|
e955c45ba8 | ||
|
|
1ed8d4f543 | ||
|
|
19e5dcd9d0 | ||
|
|
caafdb266f | ||
|
|
412d73e7e1 | ||
|
|
76c0e4dd1b | ||
|
|
b8b223c87c | ||
|
|
9d3ea208ef | ||
|
|
5a55196572 | ||
|
|
35e9d5d64e | ||
|
|
b47f768076 | ||
|
|
6630b0c9bf | ||
|
|
1b2a8eec7c | ||
|
|
31da6dc7c2 | ||
|
|
d873cb5476 | ||
|
|
5179bc81b7 | ||
|
|
26e3d2bff2 | ||
|
|
61ee5fd3a7 | ||
|
|
0eecc95aac | ||
|
|
3bb8f73c6a | ||
|
|
890361468d | ||
|
|
889856aa81 | ||
|
|
63adbc71ef | ||
|
|
d876c150eb | ||
|
|
3202386eaa | ||
|
|
eade816ee0 | ||
|
|
f9861d3ea5 | ||
|
|
580108dd7f | ||
|
|
30105666e2 | ||
|
|
8d0d707d3e | ||
|
|
c94a943854 | ||
|
|
12685e264d | ||
|
|
1e56219bbe | ||
|
|
ab43c4e337 | ||
|
|
02d4e162b8 | ||
|
|
cc4f20ce30 | ||
|
|
10e1207242 | ||
|
|
24c3f7e857 | ||
|
|
a76c54d1ac | ||
|
|
9fea68815e | ||
|
|
9ff62f2cc4 | ||
|
|
3f0fd7409d | ||
|
|
bb8f716abd | ||
|
|
4201512912 | ||
|
|
409b5e6e54 | ||
|
|
490532643e | ||
|
|
b6f4481038 | ||
|
|
227a991388 | ||
|
|
18bb7b7dcb | ||
|
|
d40ba948e9 | ||
|
|
7f5fbe4135 | ||
|
|
86d4066084 | ||
|
|
912f5e99ff | ||
|
|
1d4278c5d2 | ||
|
|
3871b820d9 | ||
|
|
18d36b00bc | ||
|
|
5e62f8311f | ||
|
|
8e0614436b | ||
|
|
68b8e5d00a | ||
|
|
a202c280d8 | ||
|
|
ff5cab992b | ||
|
|
46f3c881ec | ||
|
|
a54fec0b43 | ||
|
|
f2a1aedbc2 | ||
|
|
fbe0742ef6 | ||
|
|
a0524c0cf3 | ||
|
|
bc7f4390b1 | ||
|
|
e5520ae4e5 | ||
|
|
06014f4a39 | ||
|
|
addd9b8f14 | ||
|
|
0d78e26e8d | ||
|
|
bc291255e8 | ||
|
|
5aba9b8707 | ||
|
|
6c555adb79 | ||
|
|
3eca2ef5df | ||
|
|
491c1fa683 | ||
|
|
4fe217ef0e | ||
|
|
872958127a | ||
|
|
32735a2ab1 | ||
|
|
f300b96251 | ||
|
|
b1d38bb7b7 | ||
|
|
0af9ac496e | ||
|
|
fd30a24079 | ||
|
|
0749f45054 | ||
|
|
168ddde0dd | ||
|
|
0d6d5e7dd3 | ||
|
|
27c70d8e24 | ||
|
|
0275e9e75f | ||
|
|
c618b30013 | ||
|
|
cbb2e823da | ||
|
|
113da1cd4b | ||
|
|
a9ae4ab3f1 | ||
|
|
3be983c650 | ||
|
|
7b680f8ac6 | ||
|
|
b6057a0a11 | ||
|
|
3bebdb2af7 | ||
|
|
dd80fcb337 | ||
|
|
2b523fe7e0 | ||
|
|
39e33e75a3 | ||
|
|
991b40047a | ||
|
|
39e44e9da9 | ||
|
|
499898a4fc | ||
|
|
de7571f91e | ||
|
|
fd8d2c1941 | ||
|
|
e953fc8891 | ||
|
|
b9d28418e8 | ||
|
|
3f46d2ec33 | ||
|
|
81f1be388e | ||
|
|
4b921227c5 | ||
|
|
c0bd7bb6a3 | ||
|
|
0cec2ec16d | ||
|
|
7120cf52a2 | ||
|
|
cc9151425f | ||
|
|
c744928e07 | ||
|
|
6529613496 | ||
|
|
010c8b28dd | ||
|
|
198702010f | ||
|
|
ffffaa9fe6 | ||
|
|
90b7d28627 | ||
|
|
d8b4e04861 | ||
|
|
8c1756d312 | ||
|
|
5989f0b45f | ||
|
|
846626fabf | ||
|
|
7768fa808d | ||
|
|
39c3c47ea2 | ||
|
|
f5770fdc6e | ||
|
|
b4595bf8bb | ||
|
|
8e3711b73c | ||
|
|
55deeaa88c | ||
|
|
f10199f0b6 | ||
|
|
eb6aaca1f5 | ||
|
|
9167c861d6 | ||
|
|
2d1bbb6e6a | ||
|
|
d82e316f9b | ||
|
|
33f5290015 | ||
|
|
aa1e2ca660 | ||
|
|
86600c3884 | ||
|
|
c6c7a44c5b | ||
|
|
0652ded616 | ||
|
|
2d3b6d0d87 | ||
|
|
b25263308b | ||
|
|
1410fbc565 | ||
|
|
c72c443090 | ||
|
|
6f29790b76 | ||
|
|
d936609188 | ||
|
|
8aa59bdb51 | ||
|
|
f0eee80ab7 | ||
|
|
7f9486fff1 | ||
|
|
e9f45eeb8b | ||
|
|
127e5e70a0 | ||
|
|
334787c140 | ||
|
|
2cdf3b2c85 | ||
|
|
bf14695eab | ||
|
|
a4da914994 | ||
|
|
fefbe19011 | ||
|
|
a2ade2ee42 | ||
|
|
2e7158a760 | ||
|
|
1cd0ed22f5 | ||
|
|
db982f2d93 | ||
|
|
44a10943c3 | ||
|
|
055e0250bd | ||
|
|
48dc39a3d5 | ||
|
|
f45ea9e0aa | ||
|
|
ab16bc673d | ||
|
|
7b504f9ed6 | ||
|
|
9d7287c647 | ||
|
|
c80d4750a8 | ||
|
|
e579b908f3 | ||
|
|
01acb97f96 | ||
|
|
7986ccb3f7 | ||
|
|
e452451926 | ||
|
|
9b7e7fc221 | ||
|
|
42ba637935 | ||
|
|
6aced84146 | ||
|
|
05987f04e2 | ||
|
|
32642af4a9 | ||
|
|
62ee8a0381 | ||
|
|
30216dd367 | ||
|
|
cbc4cf309d | ||
|
|
4217a50874 | ||
|
|
a8a27eb4a4 | ||
|
|
8410271fdb | ||
|
|
fe97e92dd2 | ||
|
|
9ab0121af0 | ||
|
|
6132c12835 | ||
|
|
cb48a27d16 | ||
|
|
3953a3a06c | ||
|
|
139338cf34 | ||
|
|
41cd938748 | ||
|
|
3229de9b3b | ||
|
|
dcc201e7bb | ||
|
|
1b8abd3509 | ||
|
|
7ebf842c5c | ||
|
|
74699fcd21 | ||
|
|
f8b061c314 | ||
|
|
c5158edb6c | ||
|
|
9ad270b9a4 | ||
|
|
51328c9585 | ||
|
|
aa1ca9e653 | ||
|
|
cb29967e7b | ||
|
|
474fd59759 | ||
|
|
40ee9ffafa | ||
|
|
939b912889 | ||
|
|
83aa17cf8b | ||
|
|
9cdae5642e | ||
|
|
dcf2972f26 | ||
|
|
f96c44d092 | ||
|
|
f537d5f8cd | ||
|
|
c833b651a9 | ||
|
|
062f5332a0 | ||
|
|
d9fe384fd9 | ||
|
|
8a7220f5e9 | ||
|
|
5b9ff6fa47 | ||
|
|
66b22f4833 | ||
|
|
acec5d392d | ||
|
|
59be81c7f6 | ||
|
|
c0ac39b8da | ||
|
|
7b19935a14 | ||
|
|
fa7d0d83c1 | ||
|
|
7542e3b15e | ||
|
|
6412e6d116 | ||
|
|
b1dbe519b0 | ||
|
|
3103f87b71 | ||
|
|
8664e8cd97 | ||
|
|
9e566e7278 | ||
|
|
f02a3b6d02 | ||
|
|
bf6f3512b1 | ||
|
|
00112ae205 | ||
|
|
8001c893bd | ||
|
|
0e25291d47 | ||
|
|
68fb3a7e19 | ||
|
|
541575a073 | ||
|
|
d4d24cb1db | ||
|
|
20cb2fd99d | ||
|
|
4fd6efb7f0 | ||
|
|
9eabc624ee | ||
|
|
01418b7e81 | ||
|
|
cac763a339 | ||
|
|
0dde93e57e | ||
|
|
7435b6efe5 | ||
|
|
796c7a711b | ||
|
|
4ac9fd852f | ||
|
|
06d6293a9d | ||
|
|
0c904fb9ef | ||
|
|
59645969ee | ||
|
|
acacdfdab5 | ||
|
|
2090c41960 | ||
|
|
e5a67b8ff0 | ||
|
|
8e6dfd785f | ||
|
|
b9547b01a8 | ||
|
|
0720e9629c | ||
|
|
bb67bd77f1 | ||
|
|
8ecda341e0 | ||
|
|
dee78a876a | ||
|
|
33ccfb2505 | ||
|
|
0330a65054 | ||
|
|
4eb9c20c0c | ||
|
|
1f4910a651 | ||
|
|
150bfd4605 | ||
|
|
3bf64933b0 | ||
|
|
94d2f98cc0 | ||
|
|
2df2f72fc2 | ||
|
|
8a3ba32c5a | ||
|
|
f34f60f9c7 | ||
|
|
8540c9f7c8 | ||
|
|
3014db85e7 | ||
|
|
aea7c5c9f1 | ||
|
|
c792c552cf | ||
|
|
a71f1e0817 | ||
|
|
76905c8ec6 | ||
|
|
85d8b771f0 | ||
|
|
d31a950daa | ||
|
|
f765e23812 | ||
|
|
d66dca44e0 | ||
|
|
b8f8f9a272 | ||
|
|
e128f82e11 | ||
|
|
daab5732e8 | ||
|
|
eb5703b7dd | ||
|
|
ce5fc3e226 | ||
|
|
c2a649ded4 | ||
|
|
1b0a89ca2e | ||
|
|
1441585e06 | ||
|
|
f3576342b6 | ||
|
|
ede2102c60 | ||
|
|
16d98dd47c | ||
|
|
7aca31b18f | ||
|
|
e97f1fa609 | ||
|
|
62f0baba36 | ||
|
|
40fa6f9d7d | ||
|
|
6ce605d6ea | ||
|
|
feba855326 | ||
|
|
47f75f71a7 | ||
|
|
4e060ce5ef |
No files matched your search
@@ -1,89 +0,0 @@
|
||||
# Dolt database (managed by Dolt, not git)
|
||||
dolt/
|
||||
embeddeddolt/
|
||||
proxieddb/
|
||||
|
||||
# Runtime files
|
||||
bd.sock
|
||||
bd.sock.startlock
|
||||
sync-state.json
|
||||
last-touched
|
||||
.exclusive-lock
|
||||
|
||||
# Daemon runtime (lock, log, pid)
|
||||
daemon.*
|
||||
|
||||
# Push state (runtime, per-machine)
|
||||
push-state.json
|
||||
|
||||
# Lock files (various runtime locks)
|
||||
*.lock
|
||||
|
||||
# Credential key (encryption key for federation peer auth — never commit)
|
||||
.beads-credential-key
|
||||
|
||||
# Local version tracking (prevents upgrade notification spam after git ops)
|
||||
.local_version
|
||||
|
||||
proxied_server_client_info.json
|
||||
|
||||
# Worktree redirect file (contains relative path to main repo's .beads/)
|
||||
# Must not be committed as paths would be wrong in other clones
|
||||
redirect
|
||||
|
||||
# Sync state (local-only, per-machine)
|
||||
# These files are machine-specific and should not be shared across clones
|
||||
.sync.lock
|
||||
|
||||
# Workspace operation gate (internal/workspacegate): physical-root gate
|
||||
# files live beside the guarded root inside .beads (e.g. dolt.gate.lock)
|
||||
*.gate.lock*
|
||||
export-state/
|
||||
export-state.json
|
||||
last_pull
|
||||
|
||||
# Ephemeral store (SQLite - wisps/molecules, intentionally not versioned)
|
||||
ephemeral.sqlite3
|
||||
ephemeral.sqlite3-journal
|
||||
ephemeral.sqlite3-wal
|
||||
ephemeral.sqlite3-shm
|
||||
|
||||
# Dolt server management (auto-started by bd)
|
||||
dolt-server.pid
|
||||
dolt-server.log
|
||||
dolt-server.lock
|
||||
dolt-server.port
|
||||
dolt-server.activity
|
||||
|
||||
# Debug-mode pprof artifacts (written when dolt.debug: true in config.yaml)
|
||||
dolt-pprof/
|
||||
|
||||
# Corrupt backup directories (created by bd doctor --fix recovery)
|
||||
*.corrupt.backup/
|
||||
|
||||
# issues.jsonl is deliberately TRACKED (see export.git-add in config.yaml).
|
||||
# Dolt remains the authoritative store and GitHub the external issue surface;
|
||||
# the tracked export exists so issue state is readable and recoverable from a
|
||||
# plain git clone, without a Dolt server. Removing it from this file is what
|
||||
# tracks it -- do NOT add a "!issues.jsonl" negation, which would override the
|
||||
# fork protection in .git/info/exclude (see the note at the end of this file).
|
||||
#
|
||||
# Backups stay local: they are point-in-time copies of the same data.
|
||||
backup/
|
||||
|
||||
# Per-project environment file (Dolt connection config, GH#2520)
|
||||
.env
|
||||
|
||||
# Legacy files (from pre-Dolt versions)
|
||||
*.db
|
||||
*.db?*
|
||||
*.db-journal
|
||||
*.db-wal
|
||||
*.db-shm
|
||||
db.sqlite
|
||||
bd.db
|
||||
# NOTE: Do NOT add negation patterns here.
|
||||
# They would override fork protection in .git/info/exclude.
|
||||
# Config files (metadata.json, config.yaml) are tracked by git by default
|
||||
# since no pattern above ignores them.
|
||||
# config.yaml
|
||||
@@ -1,85 +0,0 @@
|
||||
# Beads - AI-Native Issue Tracking
|
||||
|
||||
Welcome to Beads! This repository uses **Beads** for issue tracking - a modern, AI-native tool designed to live directly in your codebase alongside your code.
|
||||
|
||||
## What is Beads?
|
||||
|
||||
Beads is issue tracking that lives in your repo, making it perfect for AI coding agents and developers who want their issues close to their code. No web UI required - everything works through the CLI and integrates seamlessly with git.
|
||||
|
||||
**Learn more:** [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Essential Commands
|
||||
|
||||
```bash
|
||||
# Create new issues
|
||||
bd create "Add user authentication"
|
||||
|
||||
# View all issues
|
||||
bd list
|
||||
|
||||
# View issue details
|
||||
bd show <issue-id>
|
||||
|
||||
# Update issue status
|
||||
bd update <issue-id> --claim
|
||||
bd update <issue-id> --status done
|
||||
|
||||
# Sync with Dolt remote
|
||||
bd dolt push
|
||||
```
|
||||
|
||||
### Working with Issues
|
||||
|
||||
Issues in Beads are:
|
||||
|
||||
- **Git-native**: Stored in Dolt database with version control and branching
|
||||
- **AI-friendly**: CLI-first design works perfectly with AI coding agents
|
||||
- **Branch-aware**: Issues can follow your branch workflow
|
||||
- **Sync-ready**: Uses Dolt remotes for backup and team sharing
|
||||
|
||||
## Why Beads?
|
||||
|
||||
✨ **AI-Native Design**
|
||||
|
||||
- Built specifically for AI-assisted development workflows
|
||||
- CLI-first interface works seamlessly with AI coding agents
|
||||
- No context switching to web UIs
|
||||
|
||||
🚀 **Developer Focused**
|
||||
|
||||
- Issues live in your repo, right next to your code
|
||||
- Works offline, syncs when you push
|
||||
- Fast, lightweight, and stays out of your way
|
||||
|
||||
🔧 **Git Integration**
|
||||
|
||||
- Dolt-native sync via bd dolt push / bd dolt pull
|
||||
- Branch-aware issue tracking
|
||||
- Dolt-native three-way merge resolution
|
||||
|
||||
## Get Started with Beads
|
||||
|
||||
Try Beads in your own projects:
|
||||
|
||||
```bash
|
||||
# Install Beads
|
||||
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
|
||||
|
||||
# Initialize in your repo
|
||||
bd init
|
||||
|
||||
# Create your first issue
|
||||
bd create "Try out Beads"
|
||||
```
|
||||
|
||||
## Learn More
|
||||
|
||||
- **Documentation**: [github.com/steveyegge/beads/docs](https://github.com/steveyegge/beads/tree/main/docs)
|
||||
- **Quick Start Guide**: Run `bd quickstart`
|
||||
- **Examples**: [github.com/steveyegge/beads/examples](https://github.com/steveyegge/beads/tree/main/examples)
|
||||
|
||||
---
|
||||
|
||||
_Beads: Issue tracking that moves at the speed of thought_ ⚡
|
||||
@@ -1,80 +0,0 @@
|
||||
# Beads Configuration File
|
||||
# This file configures default behavior for all bd commands in this repository
|
||||
# All settings can also be set via environment variables (BD_* prefix)
|
||||
# or overridden with command-line flags
|
||||
|
||||
# Issue prefix for this repository (used by bd init)
|
||||
# If not set, bd init will auto-detect from directory name
|
||||
# Example: issue-prefix: "myproject" creates issues like "myproject-1", "myproject-2", etc.
|
||||
# issue-prefix: ""
|
||||
|
||||
# Use no-db mode: JSONL-only, no Dolt database
|
||||
# When true, .beads/issues.jsonl is the only local store
|
||||
# no-db: false
|
||||
|
||||
# Enable JSON output by default
|
||||
# json: false
|
||||
|
||||
# Feedback title formatting for mutating commands (create/update/close/dep/edit)
|
||||
# 0 = hide titles, N > 0 = truncate to N characters
|
||||
# output:
|
||||
# title-length: 255
|
||||
|
||||
# Default actor for audit trails (overridden by BEADS_ACTOR or --actor)
|
||||
# actor: ""
|
||||
|
||||
# Optional JSONL sidecar for explicit agent/tool interaction audit records.
|
||||
# Issue history is always recorded in the database and is visible with
|
||||
# bd history <id> --events; this only controls .beads/interactions.jsonl.
|
||||
# audit:
|
||||
# enabled: false
|
||||
|
||||
# Export events (audit trail) to .beads/events.jsonl on each flush/sync
|
||||
# When enabled, new events are appended incrementally using a high-water mark.
|
||||
# Use 'bd export --events' to trigger manually regardless of this setting.
|
||||
# events-export: false
|
||||
|
||||
# Multi-repo configuration (experimental - bd-307)
|
||||
# Allows hydrating from multiple repositories and routing writes to the correct database
|
||||
# repos:
|
||||
# primary: "." # Primary repo (where this database lives)
|
||||
# additional: # Additional repos to hydrate from (read-only)
|
||||
# - ~/beads-planning # Personal planning repo
|
||||
# - ~/work-planning # Work planning repo
|
||||
|
||||
# Dolt-native backup (periodic backup for off-machine recovery)
|
||||
# This is full database backup only. Cross-machine sync uses Dolt remotes.
|
||||
# backup:
|
||||
# enabled: false # Disable auto-backup entirely
|
||||
# interval: 15m # Minimum time between auto-backups
|
||||
# git-push: false # Disable git push (backup locally only)
|
||||
# git-repo: "" # Separate git repo for backups (default: project repo)
|
||||
|
||||
# Optional JSONL auto-export for viewers, interchange, and issue-level migration.
|
||||
# Disabled by default; enable only when an integration needs fresh .beads/issues.jsonl.
|
||||
# Use relative paths under .beads/ for JSONL import/export filenames.
|
||||
export:
|
||||
auto: false
|
||||
path: issues.jsonl
|
||||
interval: 60s
|
||||
# issues.jsonl/interactions.jsonl are .gitignore'd local-only files --
|
||||
# Dolt (synced via sync.remote) is the source of truth. Leave auto off
|
||||
# and git-add off; do not re-track these in git.
|
||||
git-add: false
|
||||
import:
|
||||
path: issues.jsonl
|
||||
# Integration settings (access with 'bd config get/set')
|
||||
# Non-secret keys (stored in the database):
|
||||
# - jira.url, jira.project
|
||||
# - linear.team_id
|
||||
# - github.org, github.repo
|
||||
#
|
||||
# Secret keys (stored in this file but prefer env vars to avoid git exposure):
|
||||
# - linear.api_key → use LINEAR_API_KEY env var instead
|
||||
# - github.token → use GITHUB_TOKEN env var instead
|
||||
sync.remote: "git+https://github.com/samcharles93/archie-core.git"
|
||||
dolt:
|
||||
shared-server: false
|
||||
auto-commit: "on"
|
||||
audit:
|
||||
enabled: true
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
|
||||
# This section is managed by beads. Do not remove these markers.
|
||||
if command -v bd >/dev/null 2>&1; then
|
||||
export BD_GIT_HOOK=1
|
||||
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
||||
_bd_used_perl=0
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout "$_bd_timeout" bd hooks run post-checkout "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v gtimeout >/dev/null 2>&1; then
|
||||
gtimeout "$_bd_timeout" bd hooks run post-checkout "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v perl >/dev/null 2>&1; then
|
||||
_bd_used_perl=1
|
||||
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run post-checkout "$@"
|
||||
_bd_exit=$?
|
||||
else
|
||||
echo >&2 "beads: hook 'post-checkout' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
|
||||
bd hooks run post-checkout "$@"
|
||||
_bd_exit=$?
|
||||
fi
|
||||
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
|
||||
echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -eq 3 ]; then
|
||||
echo >&2 "beads: database not initialized — skipping hook 'post-checkout'"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
||||
fi
|
||||
# --- END BEADS INTEGRATION v1.2.2 ---
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
|
||||
# This section is managed by beads. Do not remove these markers.
|
||||
if command -v bd >/dev/null 2>&1; then
|
||||
export BD_GIT_HOOK=1
|
||||
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
||||
_bd_used_perl=0
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout "$_bd_timeout" bd hooks run post-merge "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v gtimeout >/dev/null 2>&1; then
|
||||
gtimeout "$_bd_timeout" bd hooks run post-merge "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v perl >/dev/null 2>&1; then
|
||||
_bd_used_perl=1
|
||||
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run post-merge "$@"
|
||||
_bd_exit=$?
|
||||
else
|
||||
echo >&2 "beads: hook 'post-merge' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
|
||||
bd hooks run post-merge "$@"
|
||||
_bd_exit=$?
|
||||
fi
|
||||
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
|
||||
echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -eq 3 ]; then
|
||||
echo >&2 "beads: database not initialized — skipping hook 'post-merge'"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
||||
fi
|
||||
# --- END BEADS INTEGRATION v1.2.2 ---
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
|
||||
# This section is managed by beads. Do not remove these markers.
|
||||
if command -v bd >/dev/null 2>&1; then
|
||||
export BD_GIT_HOOK=1
|
||||
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
||||
_bd_used_perl=0
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout "$_bd_timeout" bd hooks run pre-commit "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v gtimeout >/dev/null 2>&1; then
|
||||
gtimeout "$_bd_timeout" bd hooks run pre-commit "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v perl >/dev/null 2>&1; then
|
||||
_bd_used_perl=1
|
||||
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run pre-commit "$@"
|
||||
_bd_exit=$?
|
||||
else
|
||||
echo >&2 "beads: hook 'pre-commit' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
|
||||
bd hooks run pre-commit "$@"
|
||||
_bd_exit=$?
|
||||
fi
|
||||
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
|
||||
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -eq 3 ]; then
|
||||
echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
||||
fi
|
||||
# --- END BEADS INTEGRATION v1.2.2 ---
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
|
||||
# This section is managed by beads. Do not remove these markers.
|
||||
if command -v bd >/dev/null 2>&1; then
|
||||
export BD_GIT_HOOK=1
|
||||
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
||||
_bd_used_perl=0
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout "$_bd_timeout" bd hooks run pre-push "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v gtimeout >/dev/null 2>&1; then
|
||||
gtimeout "$_bd_timeout" bd hooks run pre-push "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v perl >/dev/null 2>&1; then
|
||||
_bd_used_perl=1
|
||||
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run pre-push "$@"
|
||||
_bd_exit=$?
|
||||
else
|
||||
echo >&2 "beads: hook 'pre-push' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
|
||||
bd hooks run pre-push "$@"
|
||||
_bd_exit=$?
|
||||
fi
|
||||
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
|
||||
echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -eq 3 ]; then
|
||||
echo >&2 "beads: database not initialized — skipping hook 'pre-push'"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
||||
fi
|
||||
# --- END BEADS INTEGRATION v1.2.2 ---
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# --- BEGIN BEADS INTEGRATION v1.2.2 ---
|
||||
# This section is managed by beads. Do not remove these markers.
|
||||
if command -v bd >/dev/null 2>&1; then
|
||||
export BD_GIT_HOOK=1
|
||||
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
||||
_bd_used_perl=0
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v gtimeout >/dev/null 2>&1; then
|
||||
gtimeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
|
||||
_bd_exit=$?
|
||||
elif command -v perl >/dev/null 2>&1; then
|
||||
_bd_used_perl=1
|
||||
perl -e 'alarm shift; exec @ARGV' "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
|
||||
_bd_exit=$?
|
||||
else
|
||||
echo >&2 "beads: hook 'prepare-commit-msg' running without timeout; install coreutils or perl to enable BEADS_HOOK_TIMEOUT"
|
||||
bd hooks run prepare-commit-msg "$@"
|
||||
_bd_exit=$?
|
||||
fi
|
||||
if [ $_bd_exit -eq 124 ] || { [ $_bd_used_perl -eq 1 ] && [ $_bd_exit -eq 142 ]; }; then
|
||||
echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -eq 3 ]; then
|
||||
echo >&2 "beads: database not initialized — skipping hook 'prepare-commit-msg'"
|
||||
_bd_exit=0
|
||||
fi
|
||||
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
||||
fi
|
||||
# --- END BEADS INTEGRATION v1.2.2 ---
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"database": "dolt",
|
||||
"backend": "dolt",
|
||||
"dolt_mode": "embedded",
|
||||
"dolt_database": "archie_core",
|
||||
"project_id": "e8a66150-1f5f-42d2-8653-dcf8463cef74",
|
||||
"last_bd_version": "1.2.2"
|
||||
}
|
||||
+6
-1
@@ -10,7 +10,12 @@
|
||||
bin/
|
||||
dist/
|
||||
docs/
|
||||
node_modules/
|
||||
tmp/
|
||||
.playwright-mcp/
|
||||
# A trailing-slash pattern matches only the context root, so this is written to
|
||||
# match a node_modules at any depth: ui/node_modules alone is 200MB and the
|
||||
# agent image compiles Go, which needs none of it.
|
||||
**/node_modules/
|
||||
|
||||
# Stray host-built binaries committed at the repo root.
|
||||
/archied
|
||||
|
||||
+105
-147
@@ -1,12 +1,13 @@
|
||||
# Builds and pushes the archied and archie-agent images to GHCR on every
|
||||
# merge to main. Mirrors .gitea/workflows/deploy.yml, which remains the
|
||||
# production build path against git.catlow.cloud until that's cut over.
|
||||
# Builds and pushes the archied and archie-agent images to the Gitea
|
||||
# registry on every merge to main, and publishes the distribution zip as a
|
||||
# release on this repository. Gitea Actions reads this .github/workflows/
|
||||
# directory.
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["archied/v*", "archie/v*", "v*"]
|
||||
tags: ["v*"]
|
||||
|
||||
# Rapid successive pushes to main (a release commit right after its
|
||||
# preceding fix, say) previously queued a full gate+build for each one,
|
||||
@@ -30,7 +31,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
gate:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
outputs:
|
||||
archied_version: ${{ steps.release_tag.outputs.archied_version }}
|
||||
steps:
|
||||
@@ -46,7 +47,7 @@ jobs:
|
||||
- name: Resolve archied tag at HEAD
|
||||
id: release_tag
|
||||
run: |
|
||||
version="$(git tag --points-at HEAD --list 'archied/v*' --list 'v*' | sed -e 's|^archied/v||' -e 's|^v||' | sort -V | tail -1)"
|
||||
version="$(git tag --points-at HEAD --list 'v*' | sed -e 's|^v||' | sort -V | tail -1)"
|
||||
echo "archied_version=$version" >> "$GITHUB_OUTPUT"
|
||||
if [ -n "$version" ]; then
|
||||
echo "archied release at HEAD: $version"
|
||||
@@ -59,6 +60,10 @@ jobs:
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: ui/package.json
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
@@ -73,35 +78,17 @@ jobs:
|
||||
- name: Install protobuf tools
|
||||
run: bash tools/proto.sh install
|
||||
|
||||
# The backup/restore tests shell out to pg_dump/pg_restore against a
|
||||
# postgres:18 testcontainer; the runner's stock client is older and
|
||||
# refuses the server version.
|
||||
- name: Install PostgreSQL 18 client
|
||||
run: |
|
||||
sudo install -d /usr/share/postgresql-common/pgdg
|
||||
sudo curl --fail --silent --show-error --location \
|
||||
https://www.postgresql.org/media/keys/ACCC4CF8.asc \
|
||||
--output /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc
|
||||
. /etc/os-release
|
||||
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \
|
||||
| sudo tee /etc/apt/sources.list.d/pgdg.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends postgresql-client-18
|
||||
echo "/usr/lib/postgresql/18/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Ensure contract baseline ref
|
||||
run: |
|
||||
if ! git show-ref --verify --quiet refs/heads/main; then
|
||||
git branch main origin/main
|
||||
fi
|
||||
|
||||
- name: Install ripgrep
|
||||
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends ripgrep
|
||||
|
||||
# Extensions run in an unprivileged user and network namespace, which
|
||||
# Ubuntu 24.04 runners forbid through AppArmor by default.
|
||||
- name: Allow unprivileged user namespaces
|
||||
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
# ripgrep and the unprivileged-userns sysctl are provisioned on the host.
|
||||
# A self-hosted runner should not need sudo, and installing a package on
|
||||
# every run is not the gate's job.
|
||||
- name: Verify unprivileged user namespaces
|
||||
run: unshare --user --map-root-user --net true
|
||||
|
||||
# The gate's uncached `go test ./...` runs the Docker-backed tests that
|
||||
# -short skips, and those start a container from alpine:3. A fresh runner
|
||||
@@ -109,35 +96,25 @@ jobs:
|
||||
- name: Pull test container images
|
||||
run: docker pull alpine:3
|
||||
|
||||
# One definition of the gate, in the Taskfile. This step used to inline
|
||||
# its own list, which drifted weaker than `task check`: it ran no
|
||||
# db:check, news:check or ui:check, so a release could ship stale
|
||||
# generated SQL, a stale ui/dist, or release notes that disagree with
|
||||
# CHANGELOG.md. It also ran the dashboard suite here rather than in the
|
||||
# gate, where test:ui runs it with the type check. TEST_FLAGS is the one
|
||||
# difference -- the release runs the whole suite, uncached and including
|
||||
# the Docker-backed tests -short skips. The diff after it asserts
|
||||
# `task fmt` changed nothing.
|
||||
- name: Quality gate
|
||||
run: |
|
||||
# The formatter sequence has one owner: task fmt, which drives go fix
|
||||
# to a fixpoint and then the configured lint formatters. This step
|
||||
# used to inline its own single `go fix ./...`, which leaves the
|
||||
# redundant loop-variable copy that copyloopvar rejects -- the hazard
|
||||
# of archie-core-wwho, surfacing here as a spurious git-diff failure
|
||||
# (archie-core-6kda).
|
||||
task fmt
|
||||
task check TEST_FLAGS=-count=1
|
||||
git diff --exit-code
|
||||
bash tools/proto.sh lint
|
||||
bash tools/proto.sh check
|
||||
go vet ./...
|
||||
golangci-lint run ./...
|
||||
go build ./...
|
||||
go test ./... -count=1
|
||||
|
||||
- name: Vulnerability scan
|
||||
run: |
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
govulncheck ./...
|
||||
|
||||
# The dashboard suite runs in CI too, or it only ever runs when
|
||||
# someone remembers to; the Go steps above never touch it.
|
||||
- name: Dashboard tests
|
||||
run: |
|
||||
npm ci --prefix ui || npm install --prefix ui
|
||||
npm test --prefix ui
|
||||
|
||||
- name: Release tags must match changelogs
|
||||
run: |
|
||||
set -e
|
||||
@@ -152,17 +129,6 @@ jobs:
|
||||
fail=1
|
||||
}
|
||||
;;
|
||||
archied/v* | archie/v*)
|
||||
# Legacy per-component tags. History is not re-tagged, and the
|
||||
# merged CHANGELOG.md carries every component's versions, so the
|
||||
# section is found there rather than in a component file.
|
||||
ver="${tag#*/v}"
|
||||
echo " legacy tag $tag -> looking for [$ver] in CHANGELOG.md"
|
||||
grep -q "^## \\[$ver\\]" CHANGELOG.md || {
|
||||
echo " FAIL: CHANGELOG.md has no [$ver] section"
|
||||
fail=1
|
||||
}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ $fail -ne 0 ]; then
|
||||
@@ -172,13 +138,13 @@ jobs:
|
||||
echo "edit the generated notes, then: task release VERSION=<ver>"
|
||||
exit 1
|
||||
fi
|
||||
if ! git tag --points-at HEAD | grep -qE '^(v[0-9]|archied/v|archie/v)' ; then
|
||||
if ! git tag --points-at HEAD | grep -qE '^v[0-9]' ; then
|
||||
echo "This commit is not a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest release."
|
||||
fi
|
||||
|
||||
archied-image:
|
||||
needs: gate
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -186,11 +152,8 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
# Deliberately NOT `github.sha`. On a tag push that is the ref's OBJECT id,
|
||||
# and every release tag in this repo is annotated — measured, 80 of 80
|
||||
# `archied/v*` and `archie/v*` tags are tag objects — so it names something
|
||||
# that cannot be checked out. `archied/v1.36.0` is an instance: it points at
|
||||
# 6720bc42 (a tag object) and dereferences to commit c25f8d39. The producer
|
||||
# is right to create annotated tags; the consumer stops guessing.
|
||||
# and every release tag in this repo is annotated, so it names a tag object
|
||||
# that cannot be checked out. Dereference it to the commit.
|
||||
- name: Resolve the commit this ref points at
|
||||
id: commit
|
||||
run: |
|
||||
@@ -201,22 +164,16 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GHCR
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
|
||||
- name: Log in to the Gitea registry
|
||||
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Resolve component versions
|
||||
id: versions
|
||||
run: |
|
||||
GATEWAY_TAG="$(git tag --points-at HEAD --list 'archied/v*' | sort -V | tail -1)"
|
||||
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
|
||||
# One release stream: a `v*` tag covers the whole release, so it names
|
||||
# both components' versions. Legacy per-component tags still win where
|
||||
# they exist, because history is not re-tagged.
|
||||
# One release stream: a `v*` tag names both components' versions.
|
||||
RELEASE_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -1)"
|
||||
GATEWAY_VERSION="${GATEWAY_TAG#archied/}"
|
||||
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
|
||||
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION="${RELEASE_TAG#v}"
|
||||
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION="${RELEASE_TAG#v}"
|
||||
GATEWAY_VERSION="${RELEASE_TAG#v}"
|
||||
RUNTIME_VERSION="${RELEASE_TAG#v}"
|
||||
# `dev+<sha>` is what a build that is NOT a release reports, and it is
|
||||
# honest now that such a build no longer publishes :latest: the version
|
||||
# names the commit it came from, and the sha-<sha> tag makes it
|
||||
@@ -226,13 +183,6 @@ jobs:
|
||||
# the tag case is handled by the dereference above.)
|
||||
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION="dev+${GITHUB_SHA:0:12}"
|
||||
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION="dev+${GITHUB_SHA:0:12}"
|
||||
# Keep the raw tag presence separate from the version fallback: a
|
||||
# LEGACY gateway-only release (archied/v* and no archie/v*) must not
|
||||
# rebuild the runtime image as dev. A one-stream `v*` release is not
|
||||
# gateway-only -- one version covers the runtime too -- so it does
|
||||
# rebuild it, and release_tag is what tells the two apart.
|
||||
echo "gateway_tag=$GATEWAY_TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "runtime_tag=$RUNTIME_TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "gateway=$GATEWAY_VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "runtime=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
|
||||
@@ -248,10 +198,10 @@ jobs:
|
||||
{
|
||||
echo "archied_tags<<EOF"
|
||||
if [ -n "$RELEASE_TAG" ]; then
|
||||
echo "ghcr.io/samcharles93/archied:latest"
|
||||
echo "git.catlow.cloud/sam/archied:latest"
|
||||
fi
|
||||
echo "ghcr.io/samcharles93/archied:edge"
|
||||
echo "ghcr.io/samcharles93/archied:sha-${{ steps.commit.outputs.sha }}"
|
||||
echo "git.catlow.cloud/sam/archied:edge"
|
||||
echo "git.catlow.cloud/sam/archied:sha-${{ steps.commit.outputs.sha }}"
|
||||
echo "EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -273,7 +223,7 @@ jobs:
|
||||
outputs:
|
||||
agent_digest: ${{ steps.agent.outputs.digest }}
|
||||
needs: gate
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -291,31 +241,28 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GHCR
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
|
||||
- name: Log in to the Gitea registry
|
||||
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Resolve runtime version
|
||||
id: versions
|
||||
run: |
|
||||
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
|
||||
RELEASE_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -1)"
|
||||
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
|
||||
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION="${RELEASE_TAG#v}"
|
||||
echo "runtime_tag=$RUNTIME_TAG" >> "$GITHUB_OUTPUT"
|
||||
RUNTIME_VERSION="${RELEASE_TAG#v}"
|
||||
echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "runtime=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and push archie-agent
|
||||
id: agent
|
||||
if: steps.versions.outputs.runtime_tag != '' || steps.versions.outputs.release_tag != ''
|
||||
if: steps.versions.outputs.release_tag != ''
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/samcharles93/archie-agent:latest
|
||||
ghcr.io/samcharles93/archie-agent:sha-${{ steps.commit.outputs.sha }}
|
||||
git.catlow.cloud/sam/archie-agent:latest
|
||||
git.catlow.cloud/sam/archie-agent:sha-${{ steps.commit.outputs.sha }}
|
||||
build-args: |
|
||||
RUNTIME_VERSION=${{ steps.versions.outputs.runtime }}
|
||||
cache-from: type=gha,scope=archie-agent
|
||||
@@ -324,8 +271,10 @@ jobs:
|
||||
# Packages every host-run binary (archied, archie-gateway,
|
||||
# archie-state-store, archie-ui, archie-messaging) as a
|
||||
# linux/amd64 zip for a
|
||||
# non-Docker install. It waits only for the agent image, whose digest
|
||||
# release.json pins; archie-agent itself never ships as a host binary.
|
||||
# non-Docker install, plus archie-agent: it has no unit, but a Kit run
|
||||
# mounts it from archied's directory, so a host without it parks them.
|
||||
# It waits only for the agent image, whose digest
|
||||
# release.json pins.
|
||||
dist-zip:
|
||||
needs: [gate, agent-image]
|
||||
# Not gated on github.ref. A release is pushed as main plus both tags at
|
||||
@@ -336,11 +285,7 @@ jobs:
|
||||
# the ref that won the race, and skip only when there is genuinely no
|
||||
# archied tag at HEAD.
|
||||
if: needs.gate.outputs.archied_version != ''
|
||||
runs-on: ubuntu-latest
|
||||
# Least privilege: the workflow default is contents:read, and only this
|
||||
# job needs to write, to create the Release and attach the zip to it.
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -372,9 +317,12 @@ jobs:
|
||||
# ran on with a dead Telegram bot and no error anywhere
|
||||
# (archie-core-1c01). TestDistZipShipsEveryHostCommand fails if this
|
||||
# list and the copy list below stop matching the commands in cmd/.
|
||||
ldflags="-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary -X github.com/samcharles93/archie-core/internal/buildinfo.Version=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=${{ steps.version.outputs.version }}"
|
||||
ldflags="-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary -X github.com/samcharles93/archie-core/internal/buildinfo.Version=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/app/agentworker.version=${{ steps.version.outputs.version }}"
|
||||
mkdir -p dist
|
||||
for cmd in $(jq -r '.required_topology.units[]' release.json); do
|
||||
# Units first, then the binaries that run beside them without one.
|
||||
# The agentworker stamp only lands in archie-agent; the linker
|
||||
# ignores -X for a symbol a binary does not import.
|
||||
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
|
||||
go build -ldflags "$ldflags" -o "dist/$cmd" "./cmd/$cmd"
|
||||
done
|
||||
|
||||
@@ -384,56 +332,56 @@ jobs:
|
||||
set -e
|
||||
name="archie-core-archied-v${{ steps.version.outputs.version }}-linux-amd64"
|
||||
mkdir -p "$name"
|
||||
for cmd in $(jq -r '.required_topology.units[]' release.json); do
|
||||
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
|
||||
cp "dist/$cmd" "$name/"
|
||||
done
|
||||
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$name/"
|
||||
cp scripts/archie-update-* "$name/"
|
||||
digest='${{ needs.agent-image.outputs.agent_digest }}'
|
||||
test -n "$digest"
|
||||
jq --arg image "ghcr.io/samcharles93/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
|
||||
jq --arg image "git.catlow.cloud/sam/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
|
||||
# README.md doesn't exist yet in this repo; include it once it does
|
||||
# rather than fail the release on its absence.
|
||||
[ -f README.md ] && cp README.md "$name/"
|
||||
zip -r "$name.zip" "$name"
|
||||
sha256sum "$name.zip" > SHA256SUMS
|
||||
echo "name=$name" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Upload distribution zip
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.zip.outputs.name }}
|
||||
path: |
|
||||
${{ steps.zip.outputs.name }}.zip
|
||||
SHA256SUMS
|
||||
path: ${{ steps.zip.outputs.name }}.zip
|
||||
retention-days: 90
|
||||
|
||||
# A Release is what an operator can actually download from; the
|
||||
# artifact above is reachable only from the run's page, behind an
|
||||
# Actions login, and expires after 90 days. Until this step existed the
|
||||
# zip was produced and then stranded -- the only Release on this repo
|
||||
# (archied/v1.22.0) was created by hand and carries no asset at all.
|
||||
#
|
||||
# Attached to the release's v* tag, or the archied tag for a release
|
||||
# cut before the single release stream.
|
||||
# --generate-notes is deliberately not used: the changelog section is
|
||||
# the release's own reviewed prose, and the tag/changelog gate above
|
||||
# already guarantees it describes this version.
|
||||
- name: Publish GitHub Release with the distribution zip
|
||||
# Installs and updates take a release from the signed artifact in the
|
||||
# registry, so this is what publishes it: the statement signed with
|
||||
# RELEASE_SIGNING_KEY and the zip, tagged v<version>, next, and stable
|
||||
# unless it is a prerelease.
|
||||
- name: Log in to the Gitea registry
|
||||
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Publish the signed release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ARCHIE_RELEASE_SEED: ${{ secrets.RELEASE_SIGNING_KEY }}
|
||||
run: |
|
||||
set -e
|
||||
version="${{ steps.version.outputs.version }}"
|
||||
prerelease=false
|
||||
case "$version" in *-*) prerelease=true ;; esac
|
||||
./dist/archied release publish -source git.catlow.cloud/sam/archie \
|
||||
-version "$version" -prerelease="$prerelease" \
|
||||
-zip "${{ steps.zip.outputs.name }}.zip" \
|
||||
-agent-image "git.catlow.cloud/sam/archie-agent@${{ needs.agent-image.outputs.agent_digest }}" \
|
||||
-changelog "https://git.catlow.cloud/sam/archie/releases/tag/v$version"
|
||||
|
||||
# The release page carries this version's changelog section, the
|
||||
# release's own reviewed prose; the signed statement links to it.
|
||||
- name: Publish the Gitea release notes
|
||||
env:
|
||||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
run: |
|
||||
set -e
|
||||
tag="v${{ steps.version.outputs.version }}"
|
||||
if ! git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then
|
||||
tag="archied/v${{ steps.version.outputs.version }}"
|
||||
fi
|
||||
version="${{ steps.version.outputs.version }}"
|
||||
# The release body is this version's changelog section, not the whole
|
||||
# file: from its "## [x.y.z]" heading to the next "## [" heading.
|
||||
# Extracting rather than inlining keeps the changelog the single
|
||||
# source of truth, and the tag/changelog gate above has already
|
||||
# proven that section exists.
|
||||
notes="$(mktemp)"
|
||||
awk -v hdr="## [$version]" '
|
||||
index($0, hdr) == 1 { printing = 1 }
|
||||
@@ -444,15 +392,25 @@ jobs:
|
||||
echo "no [$version] section extracted from CHANGELOG.md" >&2
|
||||
exit 1
|
||||
fi
|
||||
# Idempotent: --clobber replaces the asset and leaves the notes
|
||||
# alone, so a re-run of this job (a retried or superseded deploy)
|
||||
# cannot fail on an existing Release or duplicate the zip.
|
||||
if gh release view "$tag" >/dev/null 2>&1; then
|
||||
gh release upload "$tag" "${{ steps.zip.outputs.name }}.zip" SHA256SUMS --clobber
|
||||
else
|
||||
gh release create "$tag" \
|
||||
--title "archied v$version" \
|
||||
--notes-file "$notes" \
|
||||
"${{ steps.zip.outputs.name }}.zip" SHA256SUMS
|
||||
fi
|
||||
echo "published $tag with ${{ steps.zip.outputs.name }}.zip"
|
||||
api="https://git.catlow.cloud/api/v1"
|
||||
repo="sam/archie"
|
||||
auth="Authorization: token $DEPLOY_TOKEN"
|
||||
# Idempotent: a re-run replaces the release on the tag.
|
||||
curl -sf -X DELETE -H "$auth" "$api/repos/$repo/releases/tags/$tag" >/dev/null || true
|
||||
curl -sf -X POST -H "$auth" -H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg tag "$tag" --arg name "Archie v$version" --arg body "$(cat "$notes")" \
|
||||
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')" \
|
||||
"$api/repos/$repo/releases" >/dev/null
|
||||
echo "published release notes for $tag"
|
||||
|
||||
# A Gitea package belongs to its owner, not a repository, so the ones this
|
||||
# workflow publishes are linked here. Linking is per package and a no-op
|
||||
# once done, so an already linked package is not an error.
|
||||
- name: Link the packages to this repository
|
||||
env:
|
||||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
run: |
|
||||
for name in archied archie-agent archie; do
|
||||
curl -sS -o /dev/null -X POST -H "Authorization: token $DEPLOY_TOKEN" \
|
||||
"https://git.catlow.cloud/api/v1/packages/sam/container/$name/-/link/archie" || true
|
||||
done
|
||||
@@ -14,21 +14,30 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: archie-quality
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Verify extension namespace support
|
||||
run: |
|
||||
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
|
||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
fi
|
||||
unshare --user --map-root-user --net true
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: ui/package.json
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: npm
|
||||
cache-dependency-path: ui/package-lock.json
|
||||
|
||||
- name: Install quality tools
|
||||
run: |
|
||||
@@ -39,22 +48,6 @@ jobs:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends ripgrep
|
||||
sudo install -d /usr/share/postgresql-common/pgdg
|
||||
sudo curl --fail --silent --show-error --location \
|
||||
https://www.postgresql.org/media/keys/ACCC4CF8.asc \
|
||||
--output /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc
|
||||
|
||||
. /etc/os-release
|
||||
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${VERSION_CODENAME}-pgdg main" \
|
||||
| sudo tee /etc/apt/sources.list.d/pgdg.list
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends postgresql-client-18
|
||||
|
||||
echo "/usr/lib/postgresql/18/bin" >> $GITHUB_PATH
|
||||
|
||||
pg_dump --version
|
||||
pg_restore --version
|
||||
|
||||
- name: Ensure contract baseline ref
|
||||
run: |
|
||||
@@ -62,12 +55,7 @@ jobs:
|
||||
git branch main origin/main
|
||||
fi
|
||||
|
||||
# Extensions run in an unprivileged user and network namespace, which
|
||||
# Ubuntu 24.04 runners forbid through AppArmor by default.
|
||||
- name: Allow unprivileged user namespaces
|
||||
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
|
||||
- name: Run definitive gate
|
||||
run: |
|
||||
task check
|
||||
task --concurrency 1 check
|
||||
git diff --exit-code
|
||||
@@ -31,13 +31,8 @@ config.production.toml
|
||||
/.air/
|
||||
/tmp/
|
||||
|
||||
# Beads / Dolt files (added by bd init)
|
||||
.dolt/
|
||||
.beads-credential-key
|
||||
.beads/proxieddb/
|
||||
*.gate.lock*
|
||||
.beads/issues.jsonl
|
||||
.beads/interactions.jsonl
|
||||
.mcp.json
|
||||
|
||||
# gh CLI state (~/.local/state/gh) mistakenly created inside the tree
|
||||
|
||||
@@ -120,6 +120,7 @@ linters:
|
||||
sloglint:
|
||||
no-mixed-args: true
|
||||
key-naming-case: snake
|
||||
context: scope
|
||||
|
||||
exclusions:
|
||||
generated: lax
|
||||
|
||||
@@ -5,6 +5,90 @@ release's per-component sections are labelled beneath its heading.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.56.0] - 2026-10-31
|
||||
|
||||
### archied
|
||||
|
||||
- **Install once by hand.** Releases are now signed and published to `git.catlow.cloud/sam/archie`. A host on 1.55.0 or earlier still looks for releases on GitHub, so it finds this one only by running the new installer once: `curl -fsSL https://offloaded.dev/install.sh | bash`. Updates after that come from Settings → Status as before.
|
||||
- Releases are signed. Updates and `install.sh` refuse a release the release key did not sign, a zip that is not the one signed, and a channel moved back to an older release. Where releases and the extension catalogue come from is a setting (update settings and extension settings, or `[distribution]` in `config.toml` for a new instance), and `archied release keygen` and `archied release publish` publish signed releases to your own registry.
|
||||
- Organisations: forge connections, schedules, alerts, chat channels and audit are per organisation. A member acts in the organisation they select, the setup checklist follows it, and the instance's own forge is its root connection.
|
||||
- Workflows are edited as a draft and reach the running workflow only when published. Build a workflow with Archie from the canvas: chat writes the draft into the editor for review, and the editor locks while it does.
|
||||
- Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules.
|
||||
- A parked task links to the page that fixes its blocker (repository, credential, model or forge extension), and a parked task can be retried on the current workflow definition.
|
||||
- Shipped workflows run as a seeded agent identity with narrow grants instead of the root identity. Credential services are granted to dashboard identities from pickers, and personal API tokens have a name, a lifetime and a last-used time.
|
||||
- An org-scoped audit page with filters, a live tail, export and a retention setting; recorded access denials are kept for a set time and listed on their own page.
|
||||
- Instructions replace SOUL: instance, organisation, workflow and repository instructions are layered into every agent stage.
|
||||
- Chat docks at the bottom of every page and stays open across navigation. Tool calls show where they happened in a reply, with arguments (secrets masked) and durations, and `ask_questions` asks several questions at once.
|
||||
- Run more than one instance side by side: `ARCHIE_INSTANCE` names an instance, and the installer installs and updates a named one.
|
||||
- Pull request reviews submit REQUEST_CHANGES on blocking findings, list findings outside the diff in the review body, and repost without inline comments when the forge refuses their placement.
|
||||
- A workflow installs a repository's declared tooling before its gate, and tasks clone from a shared per-repository mirror.
|
||||
- Traces: services, model and tool calls and task containers export OpenTelemetry spans, and log lines carry the trace id.
|
||||
- Telegram runs as an archipelago channel extension, enabled from the Extensions page.
|
||||
- The Extensions page groups the marketplace by surface, is searchable, shows install state, and offers an update only when the catalogue has one.
|
||||
- The dashboard is rebuilt on shared components: a new Archie mark, a theme that follows the OS, task logs as a table, and layouts that fit a phone.
|
||||
|
||||
### archie-agent
|
||||
|
||||
- Released with archied 1.56.0; task containers export trace spans and install a repository's declared tooling before its gate.
|
||||
|
||||
## [1.55.0] - 2026-10-16
|
||||
|
||||
### archied
|
||||
|
||||
- Personas are gone: the Personas settings page, the chat Personality selector and `/personality`. A selected persona never changed what the model was told; SOUL (Settings → SOUL) is the one place to set Archie's identity and style. Stored persona settings are deleted on upgrade.
|
||||
- The shipped SOUL describes Archie as the assistant for an event-driven automation system rather than a coding assistant. A SOUL you have saved is kept as it is.
|
||||
|
||||
## [1.54.3] - 2026-10-16
|
||||
|
||||
### archied
|
||||
|
||||
- Chat can help write a workflow: it reads your workflows and the step catalog, writes a definition, and checks it the same way saving does, fixing what the check reports. It does not save; paste the YAML it gives you into the editor's YAML view and save there.
|
||||
|
||||
## [1.54.2] - 2026-10-16
|
||||
|
||||
### archied
|
||||
|
||||
- Tool calls from Gemini models (Interactions API) receive their arguments intact. Any tool that takes arguments, such as `dashboard_navigate` in chat, failed with "invalid character '{' after top-level value".
|
||||
|
||||
### archie-agent
|
||||
|
||||
- Agent steps on Gemini models (Interactions API) pass tools their arguments intact instead of failing to decode them.
|
||||
|
||||
## [1.54.1] - 2026-10-16
|
||||
|
||||
### archied
|
||||
|
||||
- Update checks, `archied update install` and `install.sh` find releases at `github.com/samcharles93/archie-releases`, so a host can update again. A host on 1.54.0 or earlier still looks in the old place and has to be upgraded to 1.54.1 by hand once.
|
||||
|
||||
## [1.54.0] - 2026-10-16
|
||||
|
||||
**Upgrade note:** services now authenticate each other with TLS certificates from your own CA instead of shared tokens. Before upgrading a host whose services listen on anything but loopback (any host running agent containers), issue a certificate per service (`archied`, `archie-gateway`, `archie-messaging`, `archie-state-store`, `archie-ui`, each with its name as the DNS SAN and both server and client auth), add `[tls] ca_file` and `cert_dir` to `config.toml`, and remove every `target_token`, the `*_TOKEN` service variables and the `--token`/`--*-token` flags, including archie-ui's `-token` and `-token-file`. A unit that still passes a removed flag fails to start. See `config.example.toml`.
|
||||
|
||||
### archied
|
||||
|
||||
- Services authenticate each other with mutual TLS. Each process presents `<cert_dir>/<service>.pem`, peers must chain to `ca_file`, and a caller is identified by its certificate rather than by what it claims. Renewed certificates are picked up without a restart. Without `[tls]`, services listen on and dial loopback only. The harness setup terminal requires `[tls]`.
|
||||
- Every gRPC service caps the streams a connection holds, times out stalled handshakes, releases a dead client's streams, and drains for at most 10 seconds on shutdown. Messaging exits when its listener fails instead of staying up without delivering.
|
||||
- The dashboard has user accounts. First run opens browser setup for the organisation, workspace and first administrator; people then sign in with a password, a passkey or your identity provider, and account administration lives under Access. The shared dashboard token is gone; reach the dashboard remotely through an HTTPS reverse proxy.
|
||||
- `archied update install` updates a host in one transaction: it verifies the release, stages every binary, pulls the agent image by digest and backs up the database, then restarts the services in order and rolls everything back if archied is not healthy for two minutes.
|
||||
- Each workflow runs as the identity it declares, checked on every attempt along with the identity that started it. A workflow that declares none is refused, a called workflow runs as its caller's declared identity, and shipped workflows run as the instance root.
|
||||
- Test-run a workflow draft before saving it, with forge and push writes suppressed and recorded per step. The History tab lists a workflow's revisions, diffs them as YAML and on the canvas, restores one into the editor, and shows which revision each run used.
|
||||
- Start a task from the dashboard. The dashboard home shows activity and setup, and a running task has a read-only Sandbox tab that follows its container.
|
||||
- The topbar's Jump to is a command palette, settings lists open as accordions that wait for a new item to be saved, and history restores land as a draft applied from the save bar.
|
||||
- Labels, hints, alerts and empty states say what is wrong and what to do, without tutorial or marketing prose.
|
||||
- Org isolation is tighter: harness secrets, identity writes, principals, playbook dispatch and model selections in chat stay in the caller's org, instance settings are written by the system org only, and creating a source or reloading a channel is authorized against the target.
|
||||
- Binding dispatch claims its capture and enqueues the task atomically, so a capture cannot start two runs, and the run-time workflow check sees the binding event's signature and address.
|
||||
- Service-unhealthy alerts count their grace from the last report and also cover a service that went silent, and a restart no longer clears an alert still inside its grace. An invalid stored access policy raises an alert until it validates.
|
||||
- A failed cancel of a called workflow no longer leaves the caller running, retention spares captures still waiting to be dispatched, and EDA playbooks load and report at start instead of on first dispatch.
|
||||
- Chat model selection works again for provider models.
|
||||
|
||||
### archie-agent
|
||||
|
||||
- Each run acts as its workflow's declared identity.
|
||||
- A task snapshot carries only the model limits its aliases resolve to.
|
||||
- A build step's "no changes" result comes from its writable stages and clears once a commit lands.
|
||||
- Test runs suppress forge and push writes and record what they would have done.
|
||||
- The default persona is a reporting-focused identity prompt, without the one-question limit in chat.
|
||||
|
||||
## [1.53.0] - 2026-10-11
|
||||
|
||||
### archied
|
||||
|
||||
@@ -9,12 +9,34 @@ here changes a decision. If a rule stops changing decisions, delete it.
|
||||
webhook, schedule, chat message) is matched to a workflow, the workflow runs an
|
||||
agent or tool in an isolated container, and the result lands somewhere for
|
||||
review or action. A repository is an optional input to a workflow, not the point
|
||||
of the product.
|
||||
of the product. A forge is one of many inputs or outputs; core code never
|
||||
assumes one.
|
||||
|
||||
<temporary - this statement must be removed on 2026-10-20"> The product is
|
||||
unfinished. Many features are half-built, and the codebase carries far more
|
||||
code, binaries, docs and tooling than it delivers. The job right now is to
|
||||
finish features and shrink the codebase, not to extend it. </temporary>
|
||||
<temporary - remove on 2026-12-01> The goal until 1 December is a
|
||||
production-ready archie-core, including the features the maintainer is still
|
||||
adding. Speak up when a request competes with something more urgent: a bug that
|
||||
loses work, a failure that shows nothing, a security gap, a broken setup path.
|
||||
Give the trade-off in a sentence or two and suggest whether the request belongs
|
||||
in the backlog. Don't hold work back on your own judgement. </temporary>
|
||||
|
||||
## Services and layout
|
||||
|
||||
Each service is a gRPC contract in `proto/<service>/v1`, generated into
|
||||
`internal/contracts/<service>/v1`, and one binary in `cmd/` that parses flags
|
||||
and calls its composition root in `internal/app/<service>`.
|
||||
|
||||
| Binary | Serves | Dials |
|
||||
| --- | --- | --- |
|
||||
| `archie-state-store` | State Store and Control Plane contracts; owns the task and control-plane PostgreSQL tables | PostgreSQL |
|
||||
| `archie-gateway` | Chat, conversation state, task tools | State Store |
|
||||
| `archied` | Scheduling, workflow runs, harness, Daemon contract | State Store, Gateway, Messaging |
|
||||
| `archie-messaging` | External channel frontends | Gateway |
|
||||
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, daemon, harness |
|
||||
| `archie-agent` | The worker inside each task container | NATS |
|
||||
|
||||
`internal/domain` holds behaviour and interfaces; `internal/infrastructure`
|
||||
implements them. Dashboard work follows `ui/CLAUDE.md`. Workflow YAML and its
|
||||
step vocabulary are in `WORKFLOWS.md`; the server catalogue is authoritative.
|
||||
|
||||
## Authority
|
||||
|
||||
@@ -23,7 +45,7 @@ When sources disagree, the higher one wins:
|
||||
1. The maintainer's instruction in this session.
|
||||
2. This file.
|
||||
3. The code as it is in the tree.
|
||||
4. Beads issues (`bd show <id>`): the plan for a piece of work.
|
||||
4. Gitea issues (`tea issues view <n>`): the plan for a piece of work.
|
||||
5. Everything else (memories, comments, old docs) is a hint. Verify it against
|
||||
the code before acting on it.
|
||||
|
||||
@@ -78,6 +100,8 @@ When sources disagree, the higher one wins:
|
||||
`infrastructure` implements `domain` interfaces, `domain` imports neither.
|
||||
`cmd/` parses flags and calls `app`, nothing else.
|
||||
- Fix invalid state where it is produced, not with checks where it is consumed.
|
||||
- Log through the service's injected `*slog.Logger` with the `...Context`
|
||||
methods, so lines carry the OpenTelemetry trace id. Never the global `slog`.
|
||||
- If a fix fails twice, throw the block away and rewrite it simply.
|
||||
- Comments say why, briefly. No migration history, phase names or issue
|
||||
narration in code.
|
||||
@@ -97,7 +121,8 @@ The default for a change is no new test. Write one only when:
|
||||
|
||||
A test that exists must catch a real regression, survive refactoring, run fast,
|
||||
and be cheap to keep. Never test wiring, constants, defaults, struct shapes,
|
||||
fakes, or call order. One table-driven test per behaviour; extend the table
|
||||
fakes, or call order. No test opens a real database or needs Docker; test
|
||||
SQL semantics at the interceptor or domain level with fakes. One table-driven test per behaviour; extend the table
|
||||
instead of adding a second test. Prefer making an invalid state unrepresentable
|
||||
to testing that it is rejected. Test helpers live in `_test.go` files only.
|
||||
|
||||
@@ -126,9 +151,18 @@ task build # binaries into bin/
|
||||
task test # go test -short ./...
|
||||
task ui # dashboard into ui/dist
|
||||
task check # the gate
|
||||
|
||||
go test -short ./internal/domain/workflow -run TestName # one test
|
||||
task dev # every service + Vite at http://localhost:5173, from deployments/dev.toml
|
||||
task e2e:up # seeded local stack; task e2e:check -- all runs the browser checks
|
||||
```
|
||||
|
||||
Requires Go 1.27, Task, golangci-lint, Node/npm and Docker. Adopt `task fmt` and
|
||||
`task proto:generate` and `task db:generate` write the committed generated
|
||||
output for `proto/` and `internal/infrastructure/postgres/`; `task check` runs
|
||||
their check variants and rejects stale output. The e2e stack is not part of the
|
||||
gate.
|
||||
|
||||
Requires Go 1.27, Task, golangci-lint, Node, pnpm and Docker. Adopt `task fmt` and
|
||||
`go fix` output as-is.
|
||||
|
||||
- `task check` gates the commit: `task check && git commit ...`. Never claim a
|
||||
@@ -143,21 +177,32 @@ Requires Go 1.27, Task, golangci-lint, Node/npm and Docker. Adopt `task fmt` and
|
||||
Nothing in the working tree is read at runtime. Systemd is optional.
|
||||
- Releases: `RELEASING.md`.
|
||||
|
||||
## Issues (beads)
|
||||
## Issues (Gitea)
|
||||
|
||||
Work is tracked in `bd`, never in Markdown TODO files.
|
||||
Work is tracked as issues on the primary remote, never in Markdown TODO files.
|
||||
GitHub is a read-only mirror; do not open, close or comment there.
|
||||
|
||||
```bash
|
||||
bd ready | bd show <id> | bd update <id> --claim | bd close <id>
|
||||
tea issues list -r sam/archie --state open --labels priority::critical
|
||||
tea issues list -r sam/archie --labels epic/<slug> --state open
|
||||
tea issues view 497
|
||||
tea issues edit 497 --add-labels status::in_progress --add-assignees sam
|
||||
tea comment 497 "what changed, and what was run"
|
||||
tea issues close 497
|
||||
```
|
||||
|
||||
- An issue is the plan: what is wrong or wanted, and how you know it is done.
|
||||
Keep it to that.
|
||||
- Bead state syncs through Dolt (`bd dolt push/pull`, only when told), not git.
|
||||
Never commit `.beads/` exports.
|
||||
- No host names, IPs, paths, PIDs or credentials in any bead: they are
|
||||
published.
|
||||
- File follow-up work you find as a bead. Do not fix it in passing.
|
||||
- Labels carry state: `type::`, `priority::`, `status::in_progress` and
|
||||
`status::deferred`. Open/closed is the issue state, not a label.
|
||||
`epic/<slug>` says which epic an issue belongs to.
|
||||
- Cite the issue number in commits and comments.
|
||||
- `tea issues list --labels` silently ignores an unknown name and returns every
|
||||
issue. Check the count is plausible before trusting a filtered list.
|
||||
- The API caps `limit` at 50 regardless of what you pass.
|
||||
- No host names, IPs, paths, PIDs or credentials in an issue: the text outlives
|
||||
the change that wrote it.
|
||||
- File follow-up work you find as an issue. Do not fix it in passing.
|
||||
|
||||
## Changing this file
|
||||
|
||||
|
||||
+3
-2
@@ -2,7 +2,8 @@
|
||||
# Pre-installs system tools agents can't install themselves (no apt, no sudo).
|
||||
# Language packages are installed at runtime via uv/npm/go.
|
||||
#
|
||||
# Build: docker build -t archie-agent:latest .
|
||||
# Build: task image:agent (or docker build --build-arg RUNTIME_VERSION=<ver>)
|
||||
# A build that names no version stamps none, and the agent reports dev.
|
||||
|
||||
# ── builder ──
|
||||
FROM golang:1.27-trixie AS builder
|
||||
@@ -54,7 +55,7 @@ ENV GOPATH="/go"
|
||||
# /go/bin must be on PATH or anything `go install` puts there is unreachable.
|
||||
ENV PATH="/usr/local/go/bin:/go/bin:${PATH}"
|
||||
|
||||
ARG GOLANGCI_LINT_VERSION=2.13.2
|
||||
ARG GOLANGCI_LINT_VERSION=2.14.0
|
||||
ARG GOFUMPT_VERSION=0.11.0
|
||||
ARG BUF_VERSION=1.72.0
|
||||
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
NOTICE
|
||||
|
||||
This product includes software derived from PR-AF
|
||||
(https://github.com/Agent-Field/pr-af), Copyright AgentField,
|
||||
licensed under the Apache License, Version 2.0.
|
||||
|
||||
Derived portions: internal/domain/workflow/prreview -- the unified diff
|
||||
parser, change clustering, blast radius, evidence extraction, scoring,
|
||||
deduplication, line mapping and review-event selection.
|
||||
|
||||
PR-AF declares the Apache License, Version 2.0 in its pyproject.toml and
|
||||
ships no license file. A copy of the License is available at
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
This product includes software from the Cedar project
|
||||
(https://github.com/cedar-policy/cedar), Copyright Amazon.com, Inc. or its
|
||||
affiliates, licensed under the Apache License, Version 2.0, as implemented by
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
[](https://github.com/samcharles93/archie-core/actions/workflows/quality.yml)
|
||||
|
||||
# Archie
|
||||
|
||||
**Event-driven Agentic Automation**
|
||||
@@ -103,7 +101,7 @@ or a hosted provider API key.
|
||||
1. **Install.**
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/samcharles93/archie-core/main/install.sh | bash
|
||||
curl -fsSL https://offloaded.dev/install.sh | bash
|
||||
```
|
||||
|
||||
It downloads the latest release, verifies its checksum, installs the five
|
||||
|
||||
+20
-8
@@ -60,6 +60,13 @@ task release VERSION=1.3.0 # commit + annotated tag
|
||||
git push --atomic origin main v1.3.0 # both refs or neither
|
||||
```
|
||||
|
||||
Pushing the tag is the release. The deploy workflow builds the images and the
|
||||
zip, then `archied release publish` signs the release with the
|
||||
`RELEASE_SIGNING_KEY` Actions secret and pushes it to
|
||||
`git.catlow.cloud/sam/archie` as `v1.3.0`, `next`, and `stable` unless the
|
||||
version is a prerelease. `install.sh` and the updater install only what that
|
||||
key signed.
|
||||
|
||||
`release:prepare` emits bare commit subjects; they are a starting point. Rewrite
|
||||
them to say what a reader gets, per "What the notes are for" above.
|
||||
|
||||
@@ -94,10 +101,13 @@ move nothing, which looks like success.
|
||||
|
||||
Tagging one version produces, from a single `deploy` run:
|
||||
|
||||
- **Container images** — `ghcr.io/samcharles93/archied:latest` and
|
||||
`ghcr.io/samcharles93/archie-agent:latest`. The runtime image is rebuilt by
|
||||
the release, so runtime commits merged to `main` do not reach a running
|
||||
sandbox until the host pulls the new image.
|
||||
- **Container images** — `git.catlow.cloud/sam/archied:latest` and, on a
|
||||
release tag, `git.catlow.cloud/sam/archie-agent:latest`. The runtime image is
|
||||
rebuilt by the release, so runtime commits merged to `main` do not reach a
|
||||
running sandbox until the host pulls the new image. The hand-run
|
||||
`tools/publish.sh` publishes the same two images to
|
||||
`git.catlow.cloud/sam` instead, which is the registry the binary's default
|
||||
`[containers].image` names.
|
||||
- **`:latest` names the newest release, not the newest commit.** A push to
|
||||
`main` that is not a release publishes `archied:edge` (mutable, tracking
|
||||
`main`) and `archied:sha-<commit>` (immutable) instead, so a release's
|
||||
@@ -117,10 +127,12 @@ Release asset is the durable, operator-reachable one.
|
||||
|
||||
## Gate
|
||||
|
||||
CI (`deploy.yml`) runs `task check` before building images, then verifies any
|
||||
release tag at `HEAD` has a matching `[version]` section in `CHANGELOG.md`. A
|
||||
tag with no changelog entry is a hard failure. No tags at `HEAD` is a warning,
|
||||
not a failure — images get stamped `dev`.
|
||||
CI (`deploy.yml`) runs `task check TEST_FLAGS=-count=1` before building images,
|
||||
then verifies any release tag at `HEAD` has a matching `[version]` section in
|
||||
`CHANGELOG.md`. The gate has one definition, in the Taskfile: the release runs
|
||||
it with the uncached suite, including the Docker-backed tests `-short` skips.
|
||||
A tag with no changelog entry is a hard failure. No tags at `HEAD` is a
|
||||
warning, not a failure -- images get stamped `dev`.
|
||||
|
||||
One consequence worth knowing when a release commit needs amending: GitHub
|
||||
Actions runs the workflow **from the commit that triggered it**, so a fix to
|
||||
|
||||
+82
-130
@@ -2,42 +2,13 @@ version: "3"
|
||||
|
||||
vars:
|
||||
BIN_DIR: "bin"
|
||||
# The version a build reports: the nearest tag with the distance and commit,
|
||||
# or a bare commit when the checkout has no tags (a shallow clone). A build
|
||||
# should not answer "dev" only because the caller did not name a version.
|
||||
VERSION:
|
||||
sh: git describe --tags --always --dirty 2>/dev/null | sed 's/^v//' || echo dev
|
||||
|
||||
tasks:
|
||||
default:
|
||||
desc: List available tasks
|
||||
cmds:
|
||||
- task --list
|
||||
|
||||
setup:
|
||||
desc: Install the pinned tooling and dependencies a checkout needs
|
||||
cmds:
|
||||
# Report what this task cannot install for you, so a missing Go, Node or
|
||||
# Docker fails here by name rather than somewhere inside the gate.
|
||||
- |
|
||||
set -eu
|
||||
missing=
|
||||
for tool in go task node npm docker; do
|
||||
command -v "$tool" >/dev/null 2>&1 || missing="$missing $tool"
|
||||
done
|
||||
if [ -n "$missing" ]; then
|
||||
echo "warning: not installed (AGENTS.md, Build and gate):$missing" >&2
|
||||
fi
|
||||
# The pin is one file, read here and by .github/workflows, so the linter
|
||||
# running locally and the one running the gate cannot drift apart.
|
||||
- |
|
||||
set -eu
|
||||
want=$(cat {{.ROOT_DIR}}/.golangci-version)
|
||||
have=$(golangci-lint --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
|
||||
if [ "$have" = "${want#v}" ]; then
|
||||
echo "golangci-lint $want already installed"
|
||||
else
|
||||
echo "installing golangci-lint $want (have: ${have:-none})"
|
||||
GOBIN="$(go env GOPATH)/bin" go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$want"
|
||||
fi
|
||||
- task: proto:install
|
||||
- task: ui:deps
|
||||
|
||||
fmt:
|
||||
desc: Fix and format Go source with the gate's configured formatters
|
||||
cmds:
|
||||
@@ -117,23 +88,7 @@ tasks:
|
||||
desc: Run golangci-lint
|
||||
cmds:
|
||||
- golangci-lint run ./...
|
||||
- task: lint:tools
|
||||
|
||||
lint:tools:
|
||||
desc: Run golangci-lint over the tools module
|
||||
dir: tools
|
||||
cmds:
|
||||
- golangci-lint run ./...
|
||||
|
||||
vuln:
|
||||
desc: Scan for known vulnerabilities (requires network access)
|
||||
cmds:
|
||||
- govulncheck ./...
|
||||
|
||||
deadcode:
|
||||
desc: Report unreachable production functions (advisory)
|
||||
cmds:
|
||||
- go run golang.org/x/tools/cmd/deadcode@latest -test=false ./cmd/...
|
||||
- cd tools && golangci-lint run ./...
|
||||
|
||||
ui:deps:
|
||||
desc: Install dashboard dependencies
|
||||
@@ -142,14 +97,14 @@ tasks:
|
||||
run: once
|
||||
dir: ui
|
||||
cmds:
|
||||
- npm install --no-audit --no-fund
|
||||
- pnpm install --frozen-lockfile
|
||||
|
||||
ui:
|
||||
desc: Build the dashboard into ui/dist (committed; the Go build embeds it)
|
||||
dir: ui
|
||||
deps: [ui:deps]
|
||||
cmds:
|
||||
- npm run build
|
||||
- pnpm run build
|
||||
|
||||
ui:check:
|
||||
desc: Rebuild the dashboard into a temporary directory and reject a stale ui/dist
|
||||
@@ -162,13 +117,8 @@ tasks:
|
||||
dir: ui
|
||||
deps: [ui:deps]
|
||||
cmds:
|
||||
- npm test
|
||||
- npm run typecheck
|
||||
|
||||
webhook:send:
|
||||
desc: Send a test event to the dashboard's capture intake (--help for kinds)
|
||||
cmds:
|
||||
- bash tools/webhook-send.sh {{.CLI_ARGS}}
|
||||
- pnpm test
|
||||
- pnpm run typecheck
|
||||
|
||||
bench:prreview:
|
||||
desc: Run the PR review benchmark on the configured models and write docs/benchmarks/pr-review-*.md (-- -model ALIAS -judge-model REF; --help for flags)
|
||||
@@ -179,6 +129,25 @@ tasks:
|
||||
desc: Run development services and Vite at http://localhost:5173
|
||||
deps: [dev:daemon, dev:gateway, dev:messaging, dev:state-store, dev:dashboard, dev:ui]
|
||||
|
||||
dev:tls:
|
||||
desc: Issue the development CA and service certificates deployments/dev.toml names
|
||||
status:
|
||||
- test -f tmp/dev-tls/archie-ui.pem
|
||||
cmds:
|
||||
- |
|
||||
# Task containers reach the State Store over the Docker bridge, which
|
||||
# services may only do over TLS.
|
||||
set -eu
|
||||
d=tmp/dev-tls
|
||||
mkdir -p "$d"
|
||||
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 \
|
||||
-subj /CN=archie-dev-ca -keyout "$d/ca-key.pem" -out "$d/ca.pem" 2>/dev/null
|
||||
for s in archied archie-gateway archie-messaging archie-state-store archie-ui; do
|
||||
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 3650 \
|
||||
-subj "/CN=$s" -addext "subjectAltName=DNS:$s" -addext extendedKeyUsage=serverAuth,clientAuth \
|
||||
-CA "$d/ca.pem" -CAkey "$d/ca-key.pem" -keyout "$d/$s-key.pem" -out "$d/$s.pem" 2>/dev/null
|
||||
done
|
||||
|
||||
dev:postgres:
|
||||
desc: Start PostgreSQL and wait for readiness
|
||||
cmds:
|
||||
@@ -195,17 +164,21 @@ tasks:
|
||||
echo "postgres did not become healthy within 60s" >&2
|
||||
exit 1
|
||||
|
||||
dev:daemon:
|
||||
desc: Run archied with live reload
|
||||
dev:wait-state:
|
||||
internal: true
|
||||
cmds:
|
||||
- |
|
||||
# The daemon and Gateway read their settings from the State Store at
|
||||
# boot and exit if it is not up yet; it starts only once PostgreSQL
|
||||
# is healthy, so wait for its port ([services.state] in
|
||||
# deployments/dev.toml) first.
|
||||
# Services read their settings from the State Store at boot and exit
|
||||
# if it is not up yet, so wait for its port ([services.state] in
|
||||
# deployments/dev.toml).
|
||||
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
||||
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
||||
exit 1
|
||||
|
||||
dev:daemon:
|
||||
desc: Run archied with live reload
|
||||
cmds:
|
||||
- task: dev:wait-state
|
||||
- air -build.args_bin="-config-overlay,deployments/dev.toml"
|
||||
|
||||
dev:dashboard:
|
||||
@@ -215,65 +188,63 @@ tasks:
|
||||
|
||||
dev:state-store:
|
||||
desc: Run the State Store with development PostgreSQL
|
||||
deps: [dev:postgres]
|
||||
deps: [dev:postgres, dev:tls]
|
||||
cmds:
|
||||
- go run ./cmd/archie-state-store -config-overlay deployments/dev.toml
|
||||
|
||||
dev:gateway:
|
||||
desc: Run the development Gateway
|
||||
cmds:
|
||||
- |
|
||||
# The daemon and Gateway read their settings from the State Store at
|
||||
# boot and exit if it is not up yet; it starts only once PostgreSQL
|
||||
# is healthy, so wait for its port ([services.state] in
|
||||
# deployments/dev.toml) first.
|
||||
for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done
|
||||
echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2
|
||||
exit 1
|
||||
- task: dev:wait-state
|
||||
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
|
||||
|
||||
dev:messaging:
|
||||
desc: Run the development Messaging Service
|
||||
cmds:
|
||||
- for _ in $(seq 1 120); do nc -z 127.0.0.1 9091 && exit 0; sleep 1; done; echo "state store did not come up on 127.0.0.1:9091 within 120s" >&2; exit 1
|
||||
- task: dev:wait-state
|
||||
- go run ./cmd/archie-messaging -config-overlay deployments/dev.toml
|
||||
|
||||
dev:ui:
|
||||
desc: Run Vite (requires the dashboard backend)
|
||||
dir: ui
|
||||
cmds:
|
||||
- npm install --no-audit --no-fund
|
||||
- npm run dev
|
||||
- pnpm install
|
||||
- pnpm run dev
|
||||
|
||||
dev:mobile:
|
||||
desc: Serve the dashboard on your LAN (token-protected) for phone viewing
|
||||
deps:
|
||||
- ui
|
||||
e2e:up:
|
||||
desc: Start the local stack without Docker (PostgreSQL 18, services, Vite) and seed it
|
||||
cmds:
|
||||
- cmd: |
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
TOKEN_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/archie/web-token"
|
||||
go run ./cmd/archie-ui -listen 0.0.0.0:8484 -token-file "$TOKEN_FILE" &
|
||||
UI_PID=$!
|
||||
sleep 2
|
||||
TOKEN=$(cat "$TOKEN_FILE" 2>/dev/null)
|
||||
URL="http://$IP:8484/?t=$TOKEN"
|
||||
echo "Phone URL: $URL"
|
||||
echo "$URL" | qrencode -t ANSIUTF8
|
||||
trap "kill $UI_PID 2>/dev/null" EXIT
|
||||
wait $UI_PID
|
||||
- bash e2e/stack.sh start
|
||||
- bash e2e/seed.sh
|
||||
|
||||
e2e:down:
|
||||
desc: Stop the local e2e stack
|
||||
cmds:
|
||||
- bash e2e/stack.sh stop
|
||||
|
||||
e2e:check:
|
||||
desc: List browser checks; use -- all or -- CHECK to run, add --headed to watch
|
||||
cmds:
|
||||
- node e2e/run.cjs {{.CLI_ARGS}}
|
||||
|
||||
build:
|
||||
desc: Build archie services and agent binaries
|
||||
vars:
|
||||
GATEWAY_VERSION: '{{.GATEWAY_VERSION | default "dev"}}'
|
||||
RUNTIME_VERSION: '{{.RUNTIME_VERSION | default "dev"}}'
|
||||
GATEWAY_VERSION: '{{.GATEWAY_VERSION | default .VERSION}}'
|
||||
RUNTIME_VERSION: '{{.RUNTIME_VERSION | default .VERSION}}'
|
||||
SERVICE_LDFLAGS: >-
|
||||
-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary
|
||||
-X github.com/samcharles93/archie-core/internal/buildinfo.Version={{.GATEWAY_VERSION}}
|
||||
-X github.com/samcharles93/archie-core/internal/buildinfo.Runtime={{.RUNTIME_VERSION}}
|
||||
sources:
|
||||
- Taskfile.yml
|
||||
- "**/*.go"
|
||||
# Files the binaries embed.
|
||||
- "internal/**/*.sql"
|
||||
- "internal/**/*.yaml"
|
||||
- "internal/**/*.json"
|
||||
- "internal/**/*.tpl"
|
||||
- "internal/**/*.md"
|
||||
- go.mod
|
||||
- go.sum
|
||||
- "ui/dist/**"
|
||||
@@ -285,21 +256,23 @@ tasks:
|
||||
- "{{.BIN_DIR}}/archie-messaging"
|
||||
- "{{.BIN_DIR}}/archie-agent"
|
||||
cmds:
|
||||
# One flag set for every service, matching scripts/archie-update-install
|
||||
# and the release workflow, so each binary reports the same version.
|
||||
# One flag set for every service, matching the release workflow, so each
|
||||
# binary reports the same version.
|
||||
- for: [archied, archie-gateway, archie-state-store, archie-ui, archie-messaging]
|
||||
cmd: go build -ldflags "{{.SERVICE_LDFLAGS}}" -o {{.BIN_DIR}}/{{.ITEM}} ./cmd/{{.ITEM}}
|
||||
- go build -ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.RUNTIME_VERSION}} -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" -o {{.BIN_DIR}}/archie-agent ./cmd/archie-agent
|
||||
cmd: go build -trimpath -ldflags "{{.SERVICE_LDFLAGS}}" -o {{.BIN_DIR}}/{{.ITEM}} ./cmd/{{.ITEM}}
|
||||
- go build -trimpath -ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.RUNTIME_VERSION}} -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" -o {{.BIN_DIR}}/archie-agent ./cmd/archie-agent
|
||||
|
||||
test:
|
||||
desc: Run short Go tests with caching
|
||||
desc: Run Go tests; the release gate passes TEST_FLAGS=-count=1
|
||||
cmds:
|
||||
- go test -short ./...
|
||||
- go test {{.TEST_FLAGS | default "-short"}} ./...
|
||||
|
||||
test:full:
|
||||
desc: Run the whole Go test suite uncached, including the wall-clock-bound tests
|
||||
image:agent:
|
||||
desc: Build the agent image stamped with this checkout's version
|
||||
# Compose owns the image build; this only supplies the version, which a
|
||||
# plain `docker build` has no way to learn from a context that excludes .git.
|
||||
cmds:
|
||||
- go test ./... -count=1
|
||||
- RUNTIME_VERSION={{.VERSION}} docker compose build agent
|
||||
|
||||
check:
|
||||
desc: Run the full quality gate
|
||||
@@ -308,6 +281,10 @@ tasks:
|
||||
- task: fmt
|
||||
- task: proto:check
|
||||
- task: db:check
|
||||
# Node packages land under ui/, which `go test ./...` walks: installing
|
||||
# them while the parallel checks scan the tree makes a lockfile update
|
||||
# delete Go sources mid-walk. Install first, then fan out.
|
||||
- task: ui:deps
|
||||
- task: check:readonly
|
||||
|
||||
check:readonly:
|
||||
@@ -342,28 +319,3 @@ tasks:
|
||||
- tools/release.sh --version {{.VERSION}} --tag
|
||||
requires:
|
||||
vars: [VERSION]
|
||||
|
||||
clean:
|
||||
desc: Remove build artifacts
|
||||
cmds:
|
||||
- rm -rf {{.BIN_DIR}}
|
||||
|
||||
docker-build:
|
||||
desc: Build the archie-agent sandbox image
|
||||
cmds:
|
||||
- docker compose build agent
|
||||
|
||||
docker-up:
|
||||
desc: Start the optional external NATS service via docker compose
|
||||
cmds:
|
||||
- docker compose up -d nats
|
||||
|
||||
docker-down:
|
||||
desc: Stop the docker compose stack
|
||||
cmds:
|
||||
- docker compose down
|
||||
|
||||
docker-logs:
|
||||
desc: Follow the NATS container logs
|
||||
cmds:
|
||||
- docker compose logs -f nats
|
||||
+40
-12
@@ -71,7 +71,7 @@ Any string setting may contain `{{ path }}`, replaced when the step runs:
|
||||
| `task.repository` | `owner/name`. |
|
||||
| `task.kind` | What the task came from, as prose: `GitHub issue` or `chat-originated task`. |
|
||||
| `task.issue`, `task.pr` | Issue and pull request numbers. |
|
||||
| `task.plan` | The plan a `human.approve` step handed over (an approved PRD). |
|
||||
| `task.plan` | The plan a `workflow.approve` step handed over (an approved PRD). |
|
||||
| `task.review` | The review comments a remediation round addresses. |
|
||||
| `inputs.<name>` | A declared input; an undeclared one is refused at save. |
|
||||
| `steps.<id>.summary` | What an earlier step reported, e.g. an agent's finish summary or a gate's output. |
|
||||
@@ -108,7 +108,7 @@ it. Parallel steps do not nest, and need at least two branches.
|
||||
### How a run ends
|
||||
|
||||
A run ends at the first step that sets an outcome: `workflow.finish`,
|
||||
`workflow.handoff`, `human.approve`, `repo.open-pr`, `repo.commit` with
|
||||
`workflow.handoff`, `workflow.approve`, `repo.open-pr`, `repo.commit` with
|
||||
`if_empty: complete`, or `review.reply`. A run that reaches the end of its steps
|
||||
completes, with the last step's summary as its detail. A step that fails parks
|
||||
the run unless it continues on failure.
|
||||
@@ -173,6 +173,18 @@ _needs a repository._
|
||||
|---|---|---|
|
||||
| `branch` | `fresh` \| `task` | fresh starts a new branch from the base; task resumes the branch this task pushed. |
|
||||
|
||||
### `repo.tooling`
|
||||
|
||||
_needs a repository._
|
||||
|
||||
No settings. It runs the repository policy's `tooling` commands, in order, in
|
||||
the task worktree — the installs a gate needs and the container does not ship
|
||||
(protoc plugins, linters, generators). A repository that declares none installs
|
||||
nothing and the step succeeds. Place it after `repo.prepare` and before any
|
||||
`gate.*` step: a failing install fails the step with the command and its output
|
||||
and says the gate did not run, so a missing toolchain is not read as a red
|
||||
repository.
|
||||
|
||||
### `gate.diff-rules`
|
||||
|
||||
_needs a repository._
|
||||
@@ -181,12 +193,6 @@ _needs a repository._
|
||||
|---|---|---|
|
||||
| `rules` | list of mapping | Patterns the change must not match. |
|
||||
|
||||
### `gate.diff-size`
|
||||
|
||||
_needs a repository._
|
||||
|
||||
No settings.
|
||||
|
||||
### `gate.repository`
|
||||
|
||||
_needs a repository._
|
||||
@@ -211,13 +217,30 @@ _runs without a repository._
|
||||
| `body` | text | The comment text. |
|
||||
| `on` | `issue` \| `pr` | Comment on the issue or the pull request. Empty means issue. |
|
||||
|
||||
### `human.approve`
|
||||
### `message.send`
|
||||
|
||||
_runs without a repository._
|
||||
|
||||
Sends text to one chat on a messaging channel the workflow's organisation owns,
|
||||
and a package's workflow may not send. A test run records the message instead
|
||||
of sending it.
|
||||
|
||||
| Setting | Type | Meaning |
|
||||
|---|---|---|
|
||||
| `channel` | text | The messaging channel to send through. |
|
||||
| `chat_id` | text | The channel's identifier for the chat. |
|
||||
| `text` | text | The message. References are filled in. |
|
||||
|
||||
A scheduled message is a schedule bound to a workflow whose only step is
|
||||
`message.send`.
|
||||
|
||||
### `workflow.approve`
|
||||
|
||||
_runs without a repository._
|
||||
|
||||
| Setting | Type | Meaning |
|
||||
|---|---|---|
|
||||
| `plan` | text | What the human decides on; the next workflow reads it as task.plan. |
|
||||
| `plan` | text | What the operator decides on; the next workflow reads it as task.plan. |
|
||||
| `then` | text | The workflow the task runs once approved. |
|
||||
|
||||
### `review.pr`
|
||||
@@ -262,7 +285,7 @@ _runs without a repository._
|
||||
| Setting | Type | Meaning |
|
||||
|---|---|---|
|
||||
| `detail` | text | What the operator reads about the outcome. |
|
||||
| `status` | `completed` \| `parked` \| `waiting_human` \| `declined` | How the run ends. Empty means completed. |
|
||||
| `status` | `completed` \| `parked` \| `waiting_approval` \| `declined` | How the run ends. Empty means completed. |
|
||||
|
||||
### `workflow.handoff`
|
||||
|
||||
@@ -287,10 +310,15 @@ expressions that limit which files the rule applies to.
|
||||
else runs `triage`, which classifies it and hands off.
|
||||
- **Event bindings**: a webhook source mapped onto a workflow and its inputs
|
||||
(Events page).
|
||||
- **Schedules**: each firing is captured on the reserved `schedule` source as
|
||||
a `Schedule fired` event (`schedule_id`, `name`, `scheduled_for`,
|
||||
`fired_at`). A schedule trigger is a binding on that source using the
|
||||
`schedule-fired` mapping, filtered to one `schedule_id`. A firing starts at
|
||||
most one task per binding.
|
||||
- **Playbooks**: a trigger (issue kind and labels) and actions that dispatch
|
||||
workflows.
|
||||
- **Other workflows**: `workflow.call` (a child run), `workflow.handoff` (the
|
||||
same task, requeued), `human.approve` (once approved).
|
||||
same task, requeued), `workflow.approve` (once approved).
|
||||
- **By hand**: the New task form, or Run on the Workflows page.
|
||||
|
||||
The canvas Start node lists the triggers of each workflow.
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/app/agentworker"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/egress"
|
||||
"github.com/samcharles93/archie-core/internal/logging"
|
||||
)
|
||||
|
||||
type workerRunner func(context.Context, agentworker.Settings, *slog.Logger) error
|
||||
@@ -54,12 +55,19 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
|
||||
natsURLFlag := flags.String("nats-url", "", "NATS server URL (defaults to NATS_URL)")
|
||||
stateStoreURLFlag := flags.String("state-store-url", "", "State Store gRPC target (defaults to STATE_STORE_URL; required -- the legacy NATS storerpc path is deleted)")
|
||||
stateStoreTokenFlag := flags.String("state-store-token", "", "State Store bearer token (defaults to STATE_STORE_TOKEN)")
|
||||
showVersion := flags.Bool("version", false, "print the version and exit")
|
||||
if err := flags.Parse(args); err != nil {
|
||||
if errors.Is(err, flag.ErrHelp) {
|
||||
return 0
|
||||
}
|
||||
return 2
|
||||
}
|
||||
// The release and its updater read this line to prove a shipped
|
||||
// archie-agent belongs to the release being installed.
|
||||
if *showVersion {
|
||||
fmt.Printf("archie-agent %s\n", agentworker.Version())
|
||||
return 0
|
||||
}
|
||||
|
||||
natsURL, natsToken := natsConnectionSettings(*natsURLFlag, getenv)
|
||||
if natsURL == "" {
|
||||
@@ -68,7 +76,7 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
|
||||
return 1
|
||||
}
|
||||
|
||||
log := slog.New(slog.NewJSONHandler(stderr, nil))
|
||||
log := slog.New(logging.WithTrace(slog.NewJSONHandler(stderr, nil)))
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer stop()
|
||||
|
||||
@@ -91,6 +99,7 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run
|
||||
NATSToken: natsToken,
|
||||
StateStoreTarget: stateStoreURL,
|
||||
StateStoreToken: stateStoreToken,
|
||||
StateStoreCA: []byte(getenv("STATE_STORE_CA")),
|
||||
ModelProxy: getenv(egress.ModelProxyEnv),
|
||||
ModelProxyHosts: egress.ParseHosts(getenv(egress.ModelProxyHostsEnv)),
|
||||
ModelProxyCA: getenv(egress.ModelProxyCAEnv),
|
||||
|
||||
@@ -22,7 +22,6 @@ func run() int {
|
||||
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory")
|
||||
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
|
||||
flag.StringVar(&options.Listen, "listen", "", "gateway gRPC listen address (defaults to [services.gateway].listen, else 127.0.0.1:8585)")
|
||||
flag.StringVar(&options.Token, "token", "", "Bearer [REDACTED] required for a non-loopback listener (defaults to [services.gateway].target_token)")
|
||||
flag.Parse()
|
||||
showVersion()
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// The Messaging Service reaches the State Store and the workflow engine only
|
||||
// through their contracts. Go imports are atomic, so one reference relinks a
|
||||
// runtime, and the boundary holds only while something re-measures it.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestMessagingDoesNotLinkStoreOrWorkflowRuntime(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
out, err := exec.CommandContext(ctx, "go", "list", "-deps", ".").Output()
|
||||
if err != nil {
|
||||
t.Fatalf("go list -deps .: %v", err)
|
||||
}
|
||||
linked := map[string]bool{}
|
||||
for line := range strings.SplitSeq(strings.TrimSpace(string(out)), "\n") {
|
||||
linked[line] = true
|
||||
}
|
||||
for _, pkg := range []string{
|
||||
"github.com/jackc/pgx/v5/pgxpool",
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/postgres",
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/controlplanestore",
|
||||
"github.com/samcharles93/archie-core/internal/domain/workflow",
|
||||
"github.com/samcharles93/archie-core/internal/agentexec",
|
||||
} {
|
||||
t.Run(pkg, func(t *testing.T) {
|
||||
if linked[pkg] {
|
||||
t.Errorf("cmd/archie-messaging links %s: services reach each other only through contracts", pkg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,8 @@ func run() int {
|
||||
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory")
|
||||
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
|
||||
flag.StringVar(&options.Gateway.Target, "gateway-target", "", "archie-gateway gRPC address (defaults to [services.gateway].target, else 127.0.0.1:8585)")
|
||||
flag.StringVar(&options.Gateway.Token, "gateway-token", "", "bearer token presented to archie-gateway")
|
||||
flag.StringVar(&options.StateStore.Target, "state-store-target", "", "archie-state-store gRPC address (defaults to [services.state].target)")
|
||||
flag.StringVar(&options.StateStore.Token, "state-store-token", "", "bearer token presented to archie-state-store")
|
||||
flag.StringVar(&options.Listen, "listen", "", "MessagingService gRPC listen address (defaults to [services.messaging].listen)")
|
||||
flag.StringVar(&options.Token, "token", "", "bearer token required from MessagingService callers on a non-loopback listener")
|
||||
flag.DurationVar(&options.DependencyTimeout, "dependency-timeout", 0, "readiness probe timeout (default 5s)")
|
||||
flag.DurationVar(&options.ShutdownTimeout, "shutdown-timeout", 0, "shutdown timeout (default 5s)")
|
||||
flag.Parse()
|
||||
|
||||
@@ -34,7 +34,6 @@ func run() int {
|
||||
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory")
|
||||
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
|
||||
flag.StringVar(&options.Listen, "listen", "", "state store gRPC listen address (defaults to [services.state].listen, else 127.0.0.1:9090)")
|
||||
flag.StringVar(&options.Token, "token", "", "bearer token required for a non-loopback listener (defaults to [services.state].target_token)")
|
||||
flag.StringVar(&options.ReadyAddr, "ready-addr", "", "optional readiness HTTP listen address (e.g. 127.0.0.1:9091)")
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(flag.CommandLine.Output(), "usage: archie-state-store [flags] # serve the State Store gRPC contract\n\noffline recovery: archie-state-store <backup|restore|validate|rollback> -h | access reset -h\n\n")
|
||||
|
||||
@@ -27,19 +27,13 @@ func run() int {
|
||||
flag.StringVar(&options.Config, "config", configuration.DefaultConfigPath(), "configuration file or directory (only [services.*] targets and [web] are read)")
|
||||
flag.StringVar(&options.Overlay, "config-overlay", "", "configuration overlay file or directory")
|
||||
flag.StringVar(&options.Listen, "listen", "", "dashboard HTTP listen address (defaults to [web].listen, else 127.0.0.1:8484)")
|
||||
flag.StringVar(&options.Token, "token", "", "dashboard token; required for a non-loopback listener")
|
||||
flag.StringVar(&options.TokenFile, "token-file", "", "file holding the dashboard token, minted on first use")
|
||||
flag.StringVar(&options.OidcIssuer, "oidc-issuer", "", "identity provider issuer URL; requests must then carry a token it signed")
|
||||
flag.StringVar(&options.OidcAudience, "oidc-audience", "", "audience (resource identifier) this dashboard accepts tokens for; required with -oidc-issuer")
|
||||
flag.StringVar(&options.OidcClientID, "oidc-client-id", "", "provider client id for browser sign-in; omitted means no sign-in flow")
|
||||
flag.StringVar(&options.OidcClientSecretEnv, "oidc-client-secret-env", "", "name of the environment variable holding the sign-in client secret")
|
||||
flag.StringVar(&options.OidcRedirectURL, "oidc-redirect-url", "", "callback URL registered at the provider (path must be /oauth2/callback)")
|
||||
flag.StringVar(&options.Gateway.Target, "gateway-target", "", "archie-gateway gRPC address (defaults to [services.gateway].target)")
|
||||
flag.StringVar(&options.Gateway.Token, "gateway-token", "", "bearer token presented to archie-gateway")
|
||||
flag.StringVar(&options.State.Target, "state-target", "", "archie-state-store gRPC address (defaults to [services.state].target)")
|
||||
flag.StringVar(&options.State.Token, "state-token", "", "bearer token presented to archie-state-store")
|
||||
flag.StringVar(&options.Harness.Target, "harness-target", "", "archied harness session gRPC address (defaults to [services.harness].target); empty leaves the setup terminal unwired")
|
||||
flag.StringVar(&options.Harness.Token, "harness-token", "", "bearer token presented to the daemon's harness contract")
|
||||
flag.DurationVar(&options.DependencyTimeout, "dependency-timeout", 0, "per-dependency readiness probe timeout (default 5s)")
|
||||
flag.DurationVar(&options.EventPollInterval, "event-poll-interval", 0, "how often the activity feed polls the State Store for new events (default 1s)")
|
||||
// BoolFunc rather than BoolVar so an unset flag stays distinguishable
|
||||
|
||||
+31
-20
@@ -2,38 +2,49 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/app/archied"
|
||||
"github.com/samcharles93/archie-core/internal/app/archieplaybooks"
|
||||
"github.com/samcharles93/archie-core/internal/app/prbench"
|
||||
)
|
||||
|
||||
const commandUsage = "usage: archied [flags] # run the daemon; archied -h lists the flags\n" +
|
||||
"subcommands: setup, update, release, status, prbench, playbooks"
|
||||
|
||||
func main() {
|
||||
args := os.Args[1:]
|
||||
os.Exit(run(os.Args[1:]))
|
||||
}
|
||||
|
||||
func run(args []string) int {
|
||||
// The setup generator is dispatched before the daemon's flags are
|
||||
// parsed: it writes a first-run config.toml and must not touch the
|
||||
// store, NATS, or the running daemon's configuration.
|
||||
if archied.IsSetupArgs(args) {
|
||||
os.Exit(archied.RunSetup(args[1:], os.Stdin, os.Stdout, os.Stderr))
|
||||
return archied.RunSetup(args[1:], os.Stdin, os.Stdout, os.Stderr)
|
||||
}
|
||||
if len(args) > 0 && args[0] == "update" {
|
||||
os.Exit(archied.RunUpdate(args[1:], os.Stdout, os.Stderr))
|
||||
if len(args) > 0 {
|
||||
switch args[0] {
|
||||
case "update":
|
||||
return archied.RunUpdate(args[1:], os.Stdout, os.Stderr)
|
||||
case "release":
|
||||
return archied.RunRelease(args[1:], os.Stdout, os.Stderr)
|
||||
case "status":
|
||||
return archied.RunStatus(args[1:], os.Stdout, os.Stderr)
|
||||
case "prbench":
|
||||
return prbench.Main(args[1:], os.Stdout, os.Stderr)
|
||||
case "playbooks":
|
||||
return archieplaybooks.Run(args[1:], os.Stderr)
|
||||
}
|
||||
// A word that is not a subcommand is refused rather than ignored: a
|
||||
// stale `archied update-topology` would otherwise start a second
|
||||
// daemon under the running one's feet.
|
||||
if !strings.HasPrefix(args[0], "-") {
|
||||
fmt.Fprintf(os.Stderr, "archied: unknown command %q\n%s\n", args[0], commandUsage)
|
||||
return 2
|
||||
}
|
||||
}
|
||||
if len(args) > 0 && args[0] == "update-image" {
|
||||
os.Exit(archied.RunUpdateImage(args[1:], os.Stderr))
|
||||
}
|
||||
if len(args) > 0 && args[0] == "update-topology" {
|
||||
os.Exit(archied.RunUpdateTopology(args[1:], os.Stdout, os.Stderr))
|
||||
}
|
||||
if len(args) > 0 && args[0] == "status" {
|
||||
os.Exit(archied.RunStatus(args[1:], os.Stdout, os.Stderr))
|
||||
}
|
||||
if len(args) > 0 && args[0] == "prbench" {
|
||||
os.Exit(prbench.Main(args[1:], os.Stdout, os.Stderr))
|
||||
}
|
||||
if len(args) > 0 && args[0] == "playbooks" {
|
||||
os.Exit(archieplaybooks.Run(args[1:], os.Stderr))
|
||||
}
|
||||
os.Exit(archied.Run())
|
||||
return archied.Run()
|
||||
}
|
||||
+57
-467
@@ -1,506 +1,96 @@
|
||||
# archie configuration
|
||||
#
|
||||
# archied configuration
|
||||
# This file starts the services. Everything else (forge connections, models,
|
||||
# providers, chat, tools, containers, repositories, policies) is edited in the
|
||||
# dashboard, and a saved value there overrides the same setting here.
|
||||
#
|
||||
# Secrets are NOT stored here: each one is a {engine, key}
|
||||
# reference resolved through a secrets engine at startup.
|
||||
# The built-in "env" engine reads key as an environment variable name.
|
||||
# Every other engine (bws, sops, vault, age) is an extension installed from
|
||||
# the archipelago marketplace and enabled through the control plane.
|
||||
# Secrets are never written here: each is a {engine, key} reference. The
|
||||
# built-in "env" engine reads key as an environment variable.
|
||||
|
||||
# work_dir = "~/.local/share/archie/work" # default
|
||||
# state_dir = "~/.local/share/archie" # default; embedded NATS store, task logs, disk probe
|
||||
|
||||
# The PostgreSQL connection archie-state-store, archied and archie-gateway
|
||||
# serve from. Required: each fails closed without it.
|
||||
# `docker compose up -d postgres` starts a matching local postgres:18 with this
|
||||
# default URL.
|
||||
# database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
|
||||
|
||||
# skills_dir = "~/.local/share/archie/skills" # SKILL.md search path; defaults under work_dir when unset
|
||||
# database_url = "postgres://archie:archie@localhost:5432/archie?sslmode=disable"
|
||||
# work_dir = "~/.local/share/archie/work"
|
||||
# state_dir = "~/.local/share/archie"
|
||||
|
||||
poll_interval = "60s"
|
||||
label = "archie"
|
||||
bot_user = "vectis-labs-archie"
|
||||
# 0 switches the cap off; omit the key to take the built-in default (400).
|
||||
diff_cap_lines = 400
|
||||
# org = "acme" # empty means the default org (a single-operator install's one identity)
|
||||
# granted_credentials = ["openai"] # credential@1 services the root identity may resolve (see [containers.credentials])
|
||||
|
||||
# how many operator-triggered retries a parked task gets
|
||||
# before it moves to dead (global default; set per-repo to
|
||||
# override). Enforced by the dashboard's retry action.
|
||||
# max_retries = 3
|
||||
|
||||
[forge]
|
||||
# The name of an installed, enabled forge package (archipelago: forge/github, forge/gitea), or "none".
|
||||
# Install and enable it from the Extensions page, then restart archied.
|
||||
type = "github"
|
||||
host = "https://github.com"
|
||||
token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN" }
|
||||
# How forge issues become work:
|
||||
# "poll" – re-discover issues each poll_interval (default)
|
||||
# "webhook" – react to GitHub webhook events the moment they arrive
|
||||
# "both" – webhook plus the poll as a backstop
|
||||
# intake = "poll"
|
||||
# Required when intake is "webhook" or "both": the shared secret configured
|
||||
# on the GitHub webhook, and the host:port the receiver listens on. On
|
||||
# GitHub, set the webhook's Content type to application/json (the UI
|
||||
# default) -- the alternate form-encoded delivery is not supported.
|
||||
# Webhook intake is single-identity, and that is enforced: with [[identities]]
|
||||
# configured this combination is REJECTED at startup rather than silently
|
||||
# downgraded to polling. The receiver binds one secret and one dispatch
|
||||
# predicate, so it could only judge another identity's events by the wrong
|
||||
# rules. Either drop the [[identities]] blocks, or keep intake = "poll" and
|
||||
# let each identity poll.
|
||||
# intake = "poll" # "poll", "webhook" or "both"
|
||||
# webhook_secret = { engine = "env", key = "ARCHIE_WEBHOOK_SECRET" }
|
||||
# webhook_addr = "0.0.0.0:8645"
|
||||
# intake, webhook_secret and webhook_addr exist only here. Set on a
|
||||
# [identities.forge] entry they are REJECTED for the same reason: nothing
|
||||
# reads them, so the identity would silently keep polling. Serving webhook
|
||||
# intake per identity is a pending migration, not a setting.
|
||||
|
||||
# [[identities]] runs more than one bot identity from a single daemon, each
|
||||
# with its own forge account and repository membership. Runtime settings
|
||||
# are shared and edited through the control plane. Intake
|
||||
# settings are rejected per identity, and [forge].intake = "webhook"/"both"
|
||||
# is rejected alongside [[identities]]. Minimal shape:
|
||||
# [[identities]]
|
||||
# name = "personal" # required; namespaces logs/events/NATS subjects
|
||||
# bot_user = "your-bot" # required
|
||||
# forge = { type = "github", host = "https://github.com", token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN_PERSONAL" } }
|
||||
# org = "acme" # empty inherits the shared org (empty = default)
|
||||
# granted_credentials = ["openai"] # credential@1 services this identity may resolve (see [containers.credentials])
|
||||
|
||||
[dispatch]
|
||||
# Can be of "assignee", "label", or "either"
|
||||
# this sets the method archie uses to pick up tasks.
|
||||
trigger = "assignee"
|
||||
trigger = "assignee" # "assignee", "label" or "either"
|
||||
ack_reaction = "eyes" # "off" for none
|
||||
|
||||
# Optionally set a reaction to show that archie has picked up a task.
|
||||
# setting this to "off" disables the pickup reactions.
|
||||
ack_reaction = "eyes"
|
||||
|
||||
[models] # role -> ai-sdk runtime ref (used by agent workflows)
|
||||
[models]
|
||||
triage = "openai/gpt-5.4"
|
||||
planner = "openai/gpt-5.4"
|
||||
builder = "openai/gpt-5.4"
|
||||
# `reviewer` runs the adversarial self-review stage and operator-triggered PR
|
||||
# reviews. Omitted, it falls back to `builder`.
|
||||
# reviewer = "openai/gpt-5.4"
|
||||
# `embedding` is optional: it powers in-process embedding consumers
|
||||
# (curators first). Unset, or a credential that fails to resolve, degrades
|
||||
# to the capability reporting unavailable -- archied still starts.
|
||||
# embedding = "openai/text-embedding-3-small"
|
||||
# `transcription` is optional: it turns Telegram voice notes into text before
|
||||
# the turn is dispatched, behind a "[voice transcription]" marker. Read by
|
||||
# archie-messaging. Unset, or a provider that does not resolve, leaves the
|
||||
# voice note as its media placeholder -- the turn still runs.
|
||||
# transcription = "openai/whisper-1"
|
||||
|
||||
# [providers.openai]
|
||||
# class = "openai"
|
||||
# api_key = { engine = "env", key = "OPENAI_API_KEY" }
|
||||
|
||||
[providers.ollama]
|
||||
class = "ollama"
|
||||
|
||||
# [chat]
|
||||
# `operator` is the display name of user. It is
|
||||
# passed to the chat agent as runtime metadata, which means it is sent to the
|
||||
# configured model provider on every turn -- leave it unset to tell the agent
|
||||
# nothing about who is running it.
|
||||
# operator = "John Smith"
|
||||
|
||||
# `workspace` roots the chat agent's file and shell tools (read, write, edit,
|
||||
# shell, grep, find). If unser, the tools aren't registered.
|
||||
# Set it to let the agent read, modify and execute inside that directory
|
||||
# choose it deliberately
|
||||
# workspace = "~/.local/share/archie/workspace"
|
||||
|
||||
# `max_steps` caps the model/tool round-trips in a single chat turn
|
||||
# (default 100). This is a task budget, not a safety limit.
|
||||
# max_steps = 100
|
||||
|
||||
# Let read/write/edit/find/grep tools reach absolute paths outside the
|
||||
# workspace jail. Relative paths still resolve against workspace.
|
||||
# The shell tool is never confined, so a jail only pushes the agent into
|
||||
# using shell for everything, losing truncation, line numbering, and
|
||||
# read-before-write protection. Enable when the agent needs to work
|
||||
# cross-filesystem (disk ops, system edits, etc.). Grant deliberately.
|
||||
# unrestricted_filesystem = true
|
||||
|
||||
# Render each completed tool call inline in the reply, naming the tool and one
|
||||
# line of its result, before the answer built from them. Off by default: it is
|
||||
# there to make a wrong tool choice visible from the chat, at the cost of
|
||||
# narrating every internal step. Applies to every chat channel -- Telegram
|
||||
# and the web dashboard both read this one setting.
|
||||
# show_tool_calls = true
|
||||
|
||||
# Optional interactive-chat catalog. /provider groups these references by
|
||||
# their first path segment, and /model shows only the selected provider's
|
||||
# entries. When omitted, Archie uses the distinct refs in [models].
|
||||
# models = [
|
||||
# "openai/gpt-5.6-sol",
|
||||
# "openrouter/openai/gpt-5.6-sol",
|
||||
# ]
|
||||
|
||||
# [chat.telegram]
|
||||
# The bot token from @BotFather, resolved through a configured secret engine.
|
||||
# token = { engine = "bws", key = "TELEGRAM_BOT_TOKEN" }
|
||||
|
||||
# Email and the generic inbound webhook are archipelago channel extensions
|
||||
# (channels/email, channels/webhook): install, accept and enable them from the
|
||||
# Extensions page, with their settings there.
|
||||
|
||||
# Per-(channel, sender) inbound rate limiting, shared by every chat channel:
|
||||
# Telegram keys by numeric user ID, email by SMTP from address, webhook by
|
||||
# its configured route path -- a source, not a person, so it reaches the
|
||||
# limiter as a transport-only budget key rather than as an identity. Off by
|
||||
# default -- both fields must be set to a positive value.
|
||||
#
|
||||
# This section is the seed for the Channel settings resource. The Web UI owns
|
||||
# the value a running deployment limits with (restart-required), so edit it
|
||||
# there rather than here; a stored value is not overwritten by this file.
|
||||
# [chat.rate_limit]
|
||||
# window = "1m"
|
||||
# max_requests = 20
|
||||
|
||||
# External MCP tools are launched and managed by Archie's MCP client. A
|
||||
# command of "npx" gets a persistent package cache under work_dir
|
||||
# (top of this file) automatically, so a daemon restart reuses it instead
|
||||
# of re-resolving and re-downloading the package from the npm registry
|
||||
# every time. This does not cover a package's own separate downloads (e.g.
|
||||
# a Playwright/Puppeteer-based server fetching a browser binary from a CDN
|
||||
# via its postinstall script) -- consult that package's own env vars for
|
||||
# those.
|
||||
# Most MCP servers are single-threaded and get one tools/call at a time.
|
||||
# parallel_tool_calls = true (default false) drops that serialization for
|
||||
# this server only, for a server whose own implementation handles
|
||||
# concurrent requests. It never affects another configured server.
|
||||
# [[tools.mcp_servers]]
|
||||
# name = "desktop-commander"
|
||||
# transport = "stdio"
|
||||
# command = "npx"
|
||||
# args = ["-y", "@wonderwhy-er/desktop-commander@0.2.46", "--no-onboarding"]
|
||||
# work_dir = "/path/to/workspace"
|
||||
# parallel_tool_calls = false
|
||||
|
||||
# archied's own liveness surface, always on. GET /healthz and /health answer
|
||||
# 200 once the daemon is serving (503 while it is still booting), and
|
||||
# /health/detailed reports the readiness probes. This is what the update
|
||||
# watchdog polls after restarting archied to decide whether the release came
|
||||
# up or has to be rolled back, so it stays separate from the dashboard's
|
||||
# /healthz: the dashboard can be switched off, and it runs as its own process
|
||||
# in the extracted UI topology.
|
||||
[health]
|
||||
listen = "127.0.0.1:8485"
|
||||
# Bounds one readiness probe's call into a service the daemon depends on but
|
||||
# does not own (the Gateway), so a hung dependency degrades that probe instead
|
||||
# of stalling the whole report. Omit for the default; a negative value leaves
|
||||
# only the caller's own deadline in force.
|
||||
# dependency_timeout = "5s"
|
||||
|
||||
# Web dashboard and API: task board, activity stream, chat, config,
|
||||
# memory, SSE events. Served as an embedded SPA with a full REST
|
||||
# and streaming API. Auth is token-based for non-loopback addresses;
|
||||
# loopback binds (127.0.0.1, ::1, localhost) skip auth automatically.
|
||||
#
|
||||
# The dashboard is served by the
|
||||
# standalone archie-ui process, not by archied: this listen address is what
|
||||
# archie-ui binds, and archied runs no dashboard listener at all. Run
|
||||
# `archie-ui -config <same config.toml>` alongside the other services.
|
||||
[web]
|
||||
listen = "127.0.0.1:8484"
|
||||
# Trust X-Forwarded-Proto and X-Forwarded-Host headers when validating Origin
|
||||
# on mutating requests (CSRF protection).
|
||||
#
|
||||
# Off by default. When false, the expected Origin scheme is derived directly
|
||||
# from the daemon's own network connection (http unless TLS is terminated by
|
||||
# archied directly). Setting this to true causes archied to respect the
|
||||
# X-Forwarded-Proto header sent by a reverse proxy (e.g. Traefik, Caddy, Nginx).
|
||||
#
|
||||
# SECURITY WARNING: Enable ONLY when archied is deployed behind a trusted
|
||||
# reverse proxy that strips or overwrites any client-supplied X-Forwarded-*
|
||||
# headers. Enabling this on a directly exposed daemon allows untrusted
|
||||
# clients to spoof the Origin scheme and bypass CSRF protection.
|
||||
# trust_forwarded_headers = false
|
||||
|
||||
# Where archied writes its logs. Without file set, output goes only to
|
||||
# stderr -- which under systemd means journald holds the sole copy, and
|
||||
# running by hand leaves no record at all. Setting file gives a durable
|
||||
# copy independent of the supervisor, and is what lets the dashboard show
|
||||
# history from before it connected. Both stderr and the file get output
|
||||
# unless quiet is set.
|
||||
# [log]
|
||||
# file = "~/.local/share/archie/logs/archied.log"
|
||||
# max_size_mb = 20 # rotate once the file exceeds this; 0 uses the default (20)
|
||||
# keep = 5 # rotated files to retain; 0 uses the default (5)
|
||||
# level = "info" # "debug" | "info" | "warn" | "error"
|
||||
# quiet = false # true suppresses stderr once a file is configured
|
||||
|
||||
# The built-in file-backed memory engine (internal/domain/memory +
|
||||
# internal/infrastructure/memory) is always on -- nothing here is required
|
||||
# to get memory at all. engine selects among the domain/memory engine
|
||||
# family; "builtin" (the default, same as leaving it unset) is the only
|
||||
# one implemented so far.
|
||||
# [memory]
|
||||
# engine = "builtin" # "builtin" is the only engine implemented so far
|
||||
|
||||
# Notifications for human-in-the-loop moments
|
||||
# (approval requests, gate failures, parked tasks).
|
||||
# Archie POSTs a JSON payload to the webhook
|
||||
# wire it to n8n, email, Slack, or any HTTP endpoint.
|
||||
[notify]
|
||||
# webhook = "https://n8n.example.com/webhook/archie"
|
||||
|
||||
[budgets]
|
||||
max_steps = 60
|
||||
wall_clock = "30m" # one agent call
|
||||
wall_clock = "30m" # one agent call
|
||||
gate_max_failures = 5
|
||||
task_wall_clock = "4h" # a whole task run; keep containers.max_uptime at or above it
|
||||
task_wall_clock = "4h" # a whole task run
|
||||
|
||||
[health]
|
||||
listen = "127.0.0.1:8485"
|
||||
# dependency_timeout = "5s"
|
||||
|
||||
# Trace export. Without an endpoint nothing is exported.
|
||||
# [telemetry]
|
||||
# endpoint = "127.0.0.1:4317" # OTLP/gRPC collector
|
||||
# insecure = false # plaintext to the collector
|
||||
# ca_file = "" # PEM bundle verifying the collector
|
||||
# sample_ratio = 1.0 # share of new traces recorded
|
||||
# headers = { authorization = "Bearer ..." }
|
||||
|
||||
[web]
|
||||
listen = "127.0.0.1:8484" # "off" disables the dashboard
|
||||
# trust_forwarded_headers = false # only behind a proxy you control
|
||||
|
||||
# Services selects contract adapters at composition time.
|
||||
[services.gateway]
|
||||
target = "127.0.0.1:8585" # archie-gateway's gRPC address (always remote once set)
|
||||
# listen = "127.0.0.1:8585" # The address archie-gateway BINDS. Read only by the
|
||||
# # archie-gateway process; every client ignores it. Defaults
|
||||
# # to the target above, so a default deployment's client and
|
||||
# # server cannot drift onto different ports. Set it when the
|
||||
# # host already owns that port.
|
||||
# target_token = "..." # Bearer [REDACTED] for a NON-loopback listener. A loopback listener
|
||||
# # (127.0.0.1/::1/localhost) needs no token. A non-loopback
|
||||
# # listener without a token fails closed, as does a
|
||||
# # non-loopback dial without one. The same token is
|
||||
# # presented as GATEWAY_TOKEN by remote consumers.
|
||||
target = "127.0.0.1:8585"
|
||||
# listen = "127.0.0.1:8585"
|
||||
|
||||
[services.state]
|
||||
target = "127.0.0.1:9090" # REQUIRED. The State Store gRPC address archied and
|
||||
# # archie-gateway dial. They own no task data
|
||||
# # in-process: the standalone archie-state-store process
|
||||
# # owns it in PostgreSQL. An empty target is a startup error.
|
||||
# listen = "127.0.0.1:9090" # The address archie-state-store BINDS. Read only by that
|
||||
# # process; every client ignores it. Defaults to the target
|
||||
# # above, so a default deployment's client and server cannot
|
||||
# # drift onto different ports. Move it when a port is already
|
||||
# # taken on the host.
|
||||
# target_token = "..." # bearer token for a NON-loopback target. A loopback target
|
||||
# # (127.0.0.1/::1/localhost) needs no token. A non-loopback
|
||||
# # target without a token fails closed. The same token is injected as STATE_STORE_TOKEN into
|
||||
# # archie-agent containers so the agent authenticates to the
|
||||
# # same remote store. See deployments/README.md for how to
|
||||
# # start archie-state-store.
|
||||
target = "127.0.0.1:9090"
|
||||
# listen = "127.0.0.1:9090"
|
||||
|
||||
# The daemon's harness session contract: the dashboard's setup terminal opens
|
||||
# a PTY into an ephemeral Kit container over it. Both ends are optional and
|
||||
# the dashboard's setup terminal degrades to 503 without them: the daemon
|
||||
# serves the contract only when target_token (or HARNESS_TOKEN) is set, and
|
||||
# archie-ui dials it only when a target is set.
|
||||
# [services.harness]
|
||||
# target = "127.0.0.1:8587" # The address archie-ui dials. Empty leaves the
|
||||
# # setup terminal unwired.
|
||||
# target_token = "..." # REQUIRED, even on loopback: a session is a
|
||||
# # shell in a container that holds an org credential.
|
||||
# # The daemon reads the same value to authenticate its
|
||||
# # clients. Leave unset to disable the listener.
|
||||
# [tls]
|
||||
# ca_file = "/etc/archie/tls/ca.pem"
|
||||
# cert_dir = "/etc/archie/tls"
|
||||
|
||||
# NATS is the sole autonomous workflow handoff. mode changes only where the
|
||||
# broker runs; every workflow still runs in a managed task container:
|
||||
# "embedded" – in-process nats-server (the default; no external server)
|
||||
# "external" – connect to url
|
||||
# Leave the section absent to run embedded.
|
||||
# [nats]
|
||||
# mode = "embedded" # "embedded" | "external"
|
||||
# url = "nats://localhost:4222" # required when mode = "external"
|
||||
# token_env = "NATS_TOKEN" # optional external-server credential; embedded generates one per start
|
||||
# mode = "embedded" # or "external" with url
|
||||
# url = "nats://localhost:4222"
|
||||
# token_env = "NATS_TOKEN"
|
||||
|
||||
# Unbound webhook capture: POST /webhooks/capture/{source} accepts and
|
||||
# stores any inbound payload archie doesn't yet have a binding for, so it can
|
||||
# be inspected and mapped later.
|
||||
# Stored in the same PostgreSQL database as tasks, not NATS -- capture has one
|
||||
# writer and one (human, dashboard) reader, so it doesn't need JetStream's
|
||||
# fan-out/replay machinery. All fields default when the section is absent;
|
||||
# capture is on by default.
|
||||
#
|
||||
# The receiver is mounted by the
|
||||
# archie-ui process, which projects these same values from this file; the
|
||||
# daemon's binding-dispatch loop consumes captures from the shared State
|
||||
# Store. Leave this section here even if you do not edit it: both processes
|
||||
# read it.
|
||||
# [capture]
|
||||
# retention = "168h" # 7 days; prune-on-write deletes anything older
|
||||
# max_events = 5000 # row cap, pruned on every insert regardless of age
|
||||
# max_body_bytes = 262144 # 256 KiB; larger POSTs are rejected with 413
|
||||
# rate_per_second = 1.0 # per-remote-address token bucket
|
||||
# rate_burst = 5
|
||||
# [log]
|
||||
# file = "~/.local/share/archie/logs/archied.log"
|
||||
# level = "info"
|
||||
|
||||
# The cron/scheduling ticker engine: how often scheduled jobs are checked,
|
||||
# how many may run at once, and how long one may run. The engine polls a job
|
||||
# store for what is due and dispatches each due job to the delivery it names
|
||||
# -- so nothing here schedules anything by itself, it only tunes the timing.
|
||||
# Absent is valid: every field defaults independently, and a section naming
|
||||
# only one of them still gets the defaults for the other two.
|
||||
#
|
||||
# Zero (or absent) takes the default named below. A NEGATIVE value is a
|
||||
# startup error, not a clamp: running something other than what was written
|
||||
# is how a misconfiguration stays invisible. Zero cannot mean "off" here for
|
||||
# the same reason it cannot in [tools.tool_policy] -- it is indistinguishable
|
||||
# from an unset key.
|
||||
# [scheduling]
|
||||
# interval = "60s" # tick cadence: how often due jobs are checked.
|
||||
# # Absent/zero means 1m. The finest granularity a
|
||||
# # cron-style schedule needs, and polling a local
|
||||
# # job store that often costs nothing.
|
||||
# max_parallel = 4 # caps simultaneous parallel-pool runs, so a store
|
||||
# # reporting many jobs due at once (the first tick
|
||||
# # after long downtime, typically) cannot launch an
|
||||
# # unbounded fan-out. Absent/zero means 4. It does
|
||||
# # not bound the sequential pool, which is one by
|
||||
# # definition.
|
||||
# job_timeout = "1h" # bounds one run. Absent/zero means 1h. A job that
|
||||
# # has not finished in an hour is stuck, and leaving
|
||||
# # it in flight would suppress every later run of the
|
||||
# # same job forever.
|
||||
# events_sink = "none" # "bus" publishes each run and failure on the event
|
||||
# # stream, which is what the dashboard timeline reads;
|
||||
# # "none" (the default, same as leaving it unset)
|
||||
# # leaves the engine unobservable -- a scheduled run
|
||||
# # has no task or chat turn behind it, so with no
|
||||
# # sink nothing anywhere records that it fired.
|
||||
# # Any other value is a startup error, so a typo
|
||||
# # cannot silently turn observability off.
|
||||
|
||||
# Playbook-binding at-rest encryption: [bindings].encryption_key resolves a
|
||||
# 32-byte high-entropy key through the secret registry (engine + key) and seals
|
||||
# each binding's HMAC secret in the bindings.secret column with AES-256-
|
||||
# GCM. When the key is absent,
|
||||
# binding secrets are stored as plaintext (the pre-t2db.7 behaviour) -- enabling
|
||||
# encryption does not retroactively encrypt existing rows, which stay plaintext
|
||||
# until they are edited. Rotation: after changing encryption_key, retain the
|
||||
# previous material in previous_encryption_keys so rows sealed under the old
|
||||
# key still decrypt, then drop it once no row references it. A reload that
|
||||
# changes these keys requires a daemon restart.
|
||||
# [bindings]
|
||||
# encryption_key = { engine = "env", key = "ARCHIE_BINDING_KEY" }
|
||||
# previous_encryption_keys = [ { engine = "env", key = "ARCHIE_BINDING_KEY_OLD" } ]
|
||||
# encryption_key = { engine = "env", key = "ARCHIE_BINDING_KEY" }
|
||||
|
||||
# Docker sandbox execution of archie-agent is mandatory for autonomous
|
||||
# workflows. Omit this section to use the default image, lifetimes, and pull
|
||||
# policy; the options below show the available overrides. If Docker or
|
||||
# the image is unavailable, chat and the dashboard still start while tasks
|
||||
# park explicitly; archied never falls back to a host agent loop.
|
||||
# [containers]
|
||||
# image = "ghcr.io/samcharles93/archie-agent:latest"
|
||||
# max_concurrency = 4 # optional cap; 0/absent means no global cap
|
||||
# max_uptime = "60m" # container lifetime cap
|
||||
# volume_ttl = "72h" # max age for persistent repo volumes and Git clone caches
|
||||
# pull_policy = "missing" # "missing" or "always"
|
||||
#
|
||||
# A private registry needs a credential the daemon sends on pull (an
|
||||
# anonymous pull always answers 401 there, whatever the policy). The value is
|
||||
# a Docker registry.AuthConfig JSON document -- {"username":"bot","password":"..."}
|
||||
# ("identitytoken"/"registrytoken" are alternatives; "serveraddress" is
|
||||
# optional and defaults to the image's registry). Unset means anonymous pulls,
|
||||
# exactly as before this key existed; a reference that cannot be resolved
|
||||
# warns and pulls anonymously rather than failing the daemon.
|
||||
# registry_auth = { engine = "env", key = "ARCHIE_REGISTRY_AUTH" }
|
||||
#
|
||||
# Agent profiles a workflow selects with `profile: <name>`. A workflow that
|
||||
# names none runs under [containers].image with every tool.
|
||||
# Once the State Store holds container policies, edit profiles in the
|
||||
# dashboard (Settings, Advanced); a stored set replaces the file's.
|
||||
# [containers.profiles.network-investigator]
|
||||
# image = "archie-agent-net:local" # docker compose build agent-net; empty uses [containers].image
|
||||
# tools = [] # allowlist over MCP, script and plugin tools; empty allows all
|
||||
# A Kit profile runs every agent stage on an external CLI packaged as a Kit v3
|
||||
# image: one workload Kit or published Kit set (which merges a workload with
|
||||
# its mixins), pinned by digest.
|
||||
# [containers.profiles.claude]
|
||||
# kit = "docker/claude-code-kit@sha256:<digest>"
|
||||
# adapter = "claude-code" # claude-code, codex, pi, omp or copilot; empty runs without capture tools or usage
|
||||
#
|
||||
# Credential bindings map a Kit's credential@1 service name to a secret. A
|
||||
# binding alone grants nothing -- an identity resolves it only when its own
|
||||
# org matches and the service is in its granted_credentials
|
||||
# ([[identities]] above). Once the State Store holds it, edit bindings in the
|
||||
# dashboard (Settings, Advanced); a stored set replaces the file's.
|
||||
# [[containers.credentials]]
|
||||
# service = "openai"
|
||||
# org = "acme" # empty means the default org
|
||||
# secret = {engine = "env", key = "OPENAI_API_KEY"}
|
||||
# Access records: how long a recorded access denial is kept before the State
|
||||
# Store's sweep deletes it. Zero means 90 days.
|
||||
# [access]
|
||||
# denial_retention = "2160h"
|
||||
|
||||
# At least one [[repos]] entry is required before archied will poll
|
||||
# anything -- it is deliberately left commented rather than shipped active:
|
||||
# an active example here validates as a normal, working repo (owner/name are
|
||||
# only checked for non-empty), so archied would silently start polling a
|
||||
# repository that doesn't exist. archied setup does not write this section
|
||||
# ([[repos]] is an array of tables, which the text-patching setup uses
|
||||
# cannot target) -- add at least one entry by hand.
|
||||
#
|
||||
# [[repos]]
|
||||
# owner = "your-github-username"
|
||||
# name = "todo"
|
||||
# base = "main"
|
||||
# ecosystem = "go" # "go", "python", "node", "rust", or "custom"
|
||||
# # Override the ecosystem defaults when needed:
|
||||
# # preflight = [["go", "version"]]
|
||||
# # test_glob = "*_test.go"
|
||||
# protect = ["_templ.go"]
|
||||
# gate = [
|
||||
# ["templ", "generate", "./components/"],
|
||||
# ["go", "vet", "./..."],
|
||||
# ["go", "build", "./..."],
|
||||
# ["golangci-lint", "run"],
|
||||
# ["go", "test", "./...", "-count=1"],
|
||||
# ]
|
||||
# # allow_concurrent = true # let the daemon run multiple tasks for this repo at once instead of
|
||||
# # FIFO-serializing them; only safe when concurrent worktrees won't collide
|
||||
# # (e.g. different base branches or packages per task). Still bounded by
|
||||
# # [containers].max_concurrency globally.
|
||||
# # persistent_storage = true # reuse a per-repo Docker volume and Git object cache until volume_ttl
|
||||
# # max_retries = 5 # per-repo override of the global max_retries above
|
||||
|
||||
# ── Tools ───────────────────────────────────────────────────────────────────
|
||||
# Limits on what a tool may return. These bound how much of the context window
|
||||
# one tool call can spend: the workspace file tools truncate themselves, but
|
||||
# skill bodies and MCP server results otherwise arrive whole.
|
||||
#
|
||||
# Zero (or absent) takes the default. A NEGATIVE value disables the limit --
|
||||
# zero cannot mean "off" because it is indistinguishable from an unset key.
|
||||
# [tools.tool_policy]
|
||||
# max_result_chars = 50000 # cap on one tool result; -1 for no cap
|
||||
# spill_dir = "" # unset by default, which truncates oversized results
|
||||
# # inline. When set, a result over the cap is written
|
||||
# # here in full and the model is handed the path.
|
||||
# # It MUST be inside chat.workspace: the read tool
|
||||
# # refuses paths outside it, so a spill anywhere else
|
||||
# # is a reference the model cannot open -- worse than
|
||||
# # truncating. Startup warns if it is outside.
|
||||
# # Task agents work in their own worktree and cannot
|
||||
# # read it at all; they always truncate.
|
||||
|
||||
# The web_fetch tool: retrieve a URL and return readable text.
|
||||
# [tools.web_fetch]
|
||||
# enabled = true # set false to withdraw the tool entirely
|
||||
# timeout = "30s"
|
||||
# max_bytes = 2000000
|
||||
# allow_private_networks = false
|
||||
# # Off by default, and worth leaving off. archied's own dashboard, NATS and
|
||||
# # the Docker API answer on loopback and private addresses, and the URL to
|
||||
# # fetch arrives through chat -- an untrusted path, since a forge issue body
|
||||
# # or an inbound email can be quoted into a turn. The address is checked at
|
||||
# # dial time rather than on the URL string, so a public name that resolves to
|
||||
# # a private address is refused too. Turn this on only for a homelab endpoint
|
||||
# # you intend Archie to reach.
|
||||
|
||||
# The generate_video tool: text-to-video via MiniMax's API. Off by default,
|
||||
# unlike web_fetch -- this spends real API credits per call, so it needs an
|
||||
# explicit opt-in and a working key before it is registered at all.
|
||||
# [tools.minimax]
|
||||
# enabled = true
|
||||
# api_key = { engine = "env", key = "MINIMAX_API_KEY" }
|
||||
# base_url = "" # override the API host; leave unset in normal operation
|
||||
# # Generation is synchronous from the model's point of view: the tool call
|
||||
# # blocks until MiniMax reports the video ready or failed, which can take
|
||||
# # several minutes. The result is a hosted URL delivered through whatever
|
||||
# # channel supports gateway.MediaSender (Telegram today); channels without
|
||||
# # that support get the URL as a plain link in the reply text instead.
|
||||
# Where releases and the extension catalogue come from on a new instance: an
|
||||
# OCI repository and the base64 ed25519 key it signs with. Blank is the
|
||||
# official source. Once stored, change them in the dashboard settings.
|
||||
# [distribution]
|
||||
# releases = "registry.example/owner/archie"
|
||||
# releases_key = "base64 public key"
|
||||
# catalogue = "registry.example/owner/archipelago/catalogue"
|
||||
# catalogue_key = "base64 public key"
|
||||
+44
-40
@@ -19,18 +19,22 @@ daemon, and `archied playbooks serve` is its language server for editors.
|
||||
Without `archie-messaging` the channels are simply absent, so it needs a unit
|
||||
of its own (`deployments/systemd-user-service.md`).
|
||||
|
||||
`archie-agent` (the per-task sandboxed runtime) is **not** in this archive —
|
||||
it only ever runs inside the Docker container `archied` spawns per task, never
|
||||
as a host binary. Pull it from GHCR: `ghcr.io/samcharles93/archie-agent`.
|
||||
`archie-agent` (the per-task sandboxed runtime) has no unit of its own: it
|
||||
ships beside `archied` because a Kit run mounts it from that directory. The
|
||||
agent image is a separate thing, pulled for the containers `archied` spawns
|
||||
per task: `[containers].image` defaults to
|
||||
`git.catlow.cloud/sam/archie-agent:latest`, while this archive's `release.json`
|
||||
pins the digest the release published. Set `[containers].registry_auth` when
|
||||
that reference is on a registry that needs a login -- see
|
||||
`deployments/systemd-user-service.md#6-pinning-the-archie-agent-image`.
|
||||
|
||||
## Quickstart
|
||||
|
||||
1. Pick a starting configuration. The full set of annotated templates lives
|
||||
in this repository's `deployments/` directory on GitHub
|
||||
(<https://github.com/samcharles93/archie-core/tree/main/deployments>) —
|
||||
(<https://offloaded.dev>) —
|
||||
`standalone.toml` (no forge, the simplest start),
|
||||
`single-forge-github.toml`, `multi-forge-github-gitea.toml` and
|
||||
`docker-nats-stack.toml` cover the common cases. Every one needs
|
||||
`single-forge-github.toml` and `docker-nats-stack.toml` cover the common cases. Every one needs
|
||||
PostgreSQL 18 at `database_url`. Copy whichever fits to:
|
||||
|
||||
```bash
|
||||
@@ -55,18 +59,13 @@ as a host binary. Pull it from GHCR: `ghcr.io/samcharles93/archie-agent`.
|
||||
./archied -config ~/.config/archie/config.toml
|
||||
```
|
||||
|
||||
Dashboard reachability comes from `[web].listen` (default
|
||||
`127.0.0.1:8484`, which needs no dashboard token). For a non-loopback
|
||||
bind pass `-listen` with `-token` or `-token-file` to mint and persist
|
||||
one. `archie-ui` reads `GATEWAY_TOKEN` / `STATE_STORE_TOKEN` from its
|
||||
process environment only — it has no secret registry, so when those
|
||||
tokens live in a secret manager, whatever starts `archie-ui` must export
|
||||
them into its environment (the `[services.*].target_token` values in
|
||||
`config.toml` are the other supported source).
|
||||
Open `[web].listen` (default `127.0.0.1:8484`) to configure the organisation,
|
||||
workspace and first administrator account. Remote access requires an HTTPS
|
||||
reverse proxy. Complete setup before exposing the dashboard publicly.
|
||||
|
||||
4. For a persistent, 24/7 deployment instead of a foreground run, follow the
|
||||
systemd user-unit runbook:
|
||||
<https://github.com/samcharles93/archie-core/blob/main/deployments/systemd-user-service.md>.
|
||||
<https://offloaded.dev>.
|
||||
|
||||
## Verifying an install
|
||||
|
||||
@@ -90,12 +89,15 @@ an install (or an upgrade across v1.30.0) needs its unit as well -- see
|
||||
|
||||
### Native self-update
|
||||
|
||||
`archie-update-install` downloads the approved release's Linux/amd64 archive
|
||||
and verifies its `SHA256SUMS` entry before executing or installing it. Releases
|
||||
must include `release.json`, all host binaries, and the two updater scripts.
|
||||
Older releases without this contract cannot be installed through the artifact
|
||||
path. `--from-source` (or `ARCHIE_UPDATE_SOURCE_BUILD=1`) explicitly clones and
|
||||
builds the selected release instead.
|
||||
Install on Settings → Status runs `archied update install -version X` against
|
||||
the release source in the update settings. It fetches release `vX`, refuses it
|
||||
unless the source's key signed its statement, and downloads the Linux/amd64 zip
|
||||
only if it hashes to the digest that statement names. Every host binary in the
|
||||
zip must report `X`. It then pulls the agent image the statement pins by digest, backs up the database to
|
||||
`db.pre-update.dump` in the state directory, stages the new binaries beside the
|
||||
live ones and hands the transaction to `archied update watchdog` in a process of
|
||||
its own (a transient systemd user unit). Nothing that runs changes until the
|
||||
watchdog takes over.
|
||||
|
||||
`archied update check` finds the newest GitHub release with a linux-amd64 zip on
|
||||
the channel chosen under Settings → Status → Updates: stable, next (includes
|
||||
@@ -103,30 +105,32 @@ prereleases) or a pinned version. From a shell it reads
|
||||
`ARCHIE_UPDATE_RELEASE_CHANNEL` and `ARCHIE_UPDATE_PIN`, or `-channel` and `-pin`.
|
||||
The notification destination remains separate from the release channel.
|
||||
|
||||
For scheduled, unattended runs, `archie-update-install --auto` discovers the
|
||||
selected release and refuses if the daemon reports work in flight. It checks
|
||||
again immediately before promotion. A scheduler can set
|
||||
`ARCHIE_UPDATE_RELEASE_CHANNEL` and `ARCHIE_UPDATE_PIN`; nothing schedules updates
|
||||
by default. All services stop through their ordinary graceful shutdown path.
|
||||
|
||||
`release.json` supplies the service order and required config sections to both
|
||||
first-install and self-update. A missing unit or config section produces an
|
||||
ordered migration plan and refuses installation. Apply that plan before retrying.
|
||||
Automatic topology edits are intentionally unsupported.
|
||||
|
||||
The watchdog switches staged executables by rename, restarts services, and
|
||||
requires the candidate daemon's existing readiness registry to remain healthy
|
||||
for 120 seconds. Agent images come from the release manifest by digest. The
|
||||
image switch updates the control-plane policy, preserving other settings;
|
||||
rollback restores the prior image policy with conflict detection. Source builds
|
||||
use the built image's immutable image ID.
|
||||
The watchdog stops the units in reverse `release.json` order, switches the
|
||||
staged executables by rename, switches the control-plane image policy (only the
|
||||
image field, with conflict detection), and restarts the units in order through
|
||||
`systemctl --user`. archied must report the new version and stay healthy for
|
||||
120 seconds. Otherwise the watchdog restores the previous binaries and image
|
||||
policy. Data is not rolled back unless the new release migrated the database:
|
||||
then the previous binaries cannot serve it, so the pre-update backup is restored
|
||||
and the outcome report says that every write since the update began is gone.
|
||||
Without a systemd user manager the watchdog switches binaries and image policy
|
||||
but restarts nothing, and the install reports that the services need a manual
|
||||
restart.
|
||||
|
||||
Transactions live in `${XDG_STATE_HOME:-~/.local/state}/archie/update`, outside
|
||||
the binary directory. `phase`, `environment`, `image.json` (when applicable),
|
||||
and `previous/` describe the transaction. A lock reports the owning process.
|
||||
On daemon boot, an interrupted transaction schedules independent recovery before
|
||||
normal startup. To recover manually, run `transaction/watchdog --recover` from
|
||||
that state directory. A failed recovery keeps the journal for another attempt.
|
||||
the binary directory: `transaction/journal.json`, `transaction/previous/`, and
|
||||
`transaction/archied`, the frozen copy of the archied that wrote the journal. On
|
||||
daemon boot, an interrupted transaction is
|
||||
handed to that frozen watchdog with `-recover` before normal startup: a
|
||||
transaction that never started is discarded, one that was switching or observing
|
||||
is rolled back, and a decided one is finished. To recover manually, run
|
||||
`transaction/archied update watchdog -recover -bin-dir ~/.local/bin` from that
|
||||
state directory. A failed recovery keeps the journal for another attempt.
|
||||
|
||||
Database snapshots remain available for manual recovery. Schema migrations and
|
||||
PostgreSQL data are never automatically reversed.
|
||||
The database backup stays in the state directory after a committed update for
|
||||
manual recovery with `archie-state-store restore`.
|
||||
+10
-16
@@ -7,9 +7,6 @@ This directory contains configuration templates and guides for different deploym
|
||||
- **[`single-forge-github.toml`](./single-forge-github.toml)**:
|
||||
Standard single-forge deployment managing multiple GitHub repositories under a single bot account and GitHub token.
|
||||
|
||||
- **[`multi-forge-github-gitea.toml`](./multi-forge-github-gitea.toml)**:
|
||||
Multi-identity deployment running GitHub and a self-hosted Gitea instance simultaneously with distinct bot accounts, tokens, and repository sets.
|
||||
|
||||
- **[`standalone.toml`](./standalone.toml)**: start here. Event-driven
|
||||
automation with no forge or repositories, local Ollama models, loopback
|
||||
services and no tokens.
|
||||
@@ -52,10 +49,10 @@ PostgreSQL database `database_url` names and serves the `StateStore` gRPC
|
||||
contract. BOTH `archied` and `archie-gateway` dial it via
|
||||
`[services.state].target` and never open the task tables themselves. The templates set
|
||||
`[services.state]` accordingly: a host-only agent reaches a loopback bind
|
||||
(`127.0.0.1:9090`) with no token, while a container-mode agent needs the
|
||||
Docker bridge gateway address plus a matching bearer token (`target_token` /
|
||||
`--token` / `STATE_STORE_TOKEN`), because a container cannot reach the host's
|
||||
loopback.
|
||||
(`127.0.0.1:9090`), while a container-mode agent needs the Docker bridge
|
||||
gateway address, because a container cannot reach the host's loopback. A
|
||||
non-loopback address needs `[tls]` certificates from your own CA; see
|
||||
`config.example.toml`.
|
||||
|
||||
## Running the dashboard
|
||||
|
||||
@@ -69,8 +66,8 @@ default). Start it after the Gateway and the State Store:
|
||||
archie-ui -config ~/.config/archie/config.toml
|
||||
```
|
||||
|
||||
A non-loopback `[web].listen` requires a dashboard token (`-token`, or
|
||||
`-token-file` to mint and persist one); a loopback bind needs none.
|
||||
Open the dashboard to configure the organisation, workspace and first administrator account.
|
||||
Use HTTPS through a reverse proxy for remote access, and complete setup before exposing it publicly.
|
||||
`archied` runs no dashboard listener at all, so webhook capture
|
||||
(`POST /webhooks/capture/{source}`) is received by archie-ui and the
|
||||
binding-dispatch loop in `archied` consumes what arrives from the shared
|
||||
@@ -84,17 +81,14 @@ archie-ui warns about exactly that at startup. Terminate TLS in front of it
|
||||
warning; leaving it off while exposing the port directly is the case the
|
||||
warning names.
|
||||
|
||||
Auth note: unlike `archied`, archie-ui has no secret registry --
|
||||
`GATEWAY_TOKEN`/`STATE_STORE_TOKEN` resolve from its process environment
|
||||
only (or from `[services.*].target_token` in `config.toml`), so whatever
|
||||
starts archie-ui must export those tokens into its environment. See the UI
|
||||
Service unit in `systemd-user-service.md` for the worked example.
|
||||
Auth note: archie-ui authenticates to its dependencies with its `[tls]`
|
||||
certificate (`archie-ui.pem`).
|
||||
|
||||
```bash
|
||||
# loopback (host-only agent)
|
||||
archie-state-store -config ~/.config/archie/config.toml -listen 127.0.0.1:9090
|
||||
# or container-mode: bind the bridge gateway with a token
|
||||
archie-state-store -config ~/.config/archie/config.toml -listen 172.17.0.1:9090 -token <token>
|
||||
# or container-mode: bind the bridge gateway ([tls] required)
|
||||
archie-state-store -config ~/.config/archie/config.toml -listen 172.17.0.1:9090
|
||||
```
|
||||
|
||||
## Verifying the daemon
|
||||
|
||||
+13
-3
@@ -25,13 +25,23 @@ listen = "127.0.0.1:8484"
|
||||
# when a port is already taken on the host -- before the
|
||||
# listen key existed the collision could only be worked around by hand-writing
|
||||
# a matching target and passing -listen, and it read as a code fault.
|
||||
#
|
||||
# Task containers dial the target over the Docker bridge gateway, so the store
|
||||
# listens on every interface and [tls] (issued by `task dev:tls`) is required.
|
||||
[services.state]
|
||||
target = "127.0.0.1:9091"
|
||||
listen = "127.0.0.1:9091"
|
||||
target = "172.17.0.1:9091"
|
||||
listen = "0.0.0.0:9091"
|
||||
|
||||
[tls]
|
||||
ca_file = "tmp/dev-tls/ca.pem"
|
||||
cert_dir = "tmp/dev-tls"
|
||||
|
||||
# `task dev` runs archie-gateway via dev:gateway, which also passes no -listen:
|
||||
# the listen below is what it binds. Stated explicitly so the value archie-ui
|
||||
# dials is visible next to the State Store one.
|
||||
[services.gateway]
|
||||
target = "127.0.0.1:8585"
|
||||
listen = "127.0.0.1:8585"
|
||||
listen = "127.0.0.1:8585"
|
||||
[services.daemon]
|
||||
target = "127.0.0.1:8587"
|
||||
listen = "127.0.0.1:8587"
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
poll_interval = "60s"
|
||||
bot_user = "archie"
|
||||
diff_cap_lines = 0
|
||||
work_dir = "~/.local/share/archie/work"
|
||||
state_dir = "~/.local/share/archie" # NATS store, task logs
|
||||
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
|
||||
@@ -26,13 +25,15 @@ target = "127.0.0.1:8585"
|
||||
|
||||
# The State Store gRPC service owns the PostgreSQL task data; archied and
|
||||
# archie-gateway dial it and never open those tables themselves.
|
||||
# This deployment runs the agent in containers, so target is the Docker bridge
|
||||
# gateway (172.17.0.1) the container can reach, with a matching target_token
|
||||
# that archie-state-store validates. Host-only agent: use 127.0.0.1:9090 with
|
||||
# no token.
|
||||
# This deployment runs the agent in containers, so the target is the Docker
|
||||
# bridge gateway (172.17.0.1) the container can reach. A non-loopback address
|
||||
# needs [tls]; see config.example.toml.
|
||||
[services.state]
|
||||
target = "172.17.0.1:9090"
|
||||
target_token = "change-me-state-store-token"
|
||||
|
||||
[tls]
|
||||
ca_file = "/etc/archie/tls/ca.pem"
|
||||
cert_dir = "/etc/archie/tls"
|
||||
|
||||
[forge]
|
||||
type = "gitea"
|
||||
@@ -60,11 +61,13 @@ url = "nats://172.19.0.1:4222"
|
||||
network = "archie-core_default"
|
||||
# Pin your own registry's tag/digest -- never deploy against a bare
|
||||
# ":latest" reference, which can change under a running deployment with no
|
||||
# warning. See deployments/systemd-user-service.md#pinning-the-archie-agent-image
|
||||
# for the pinning convention this repo follows for its own GHCR image.
|
||||
# warning. See deployments/systemd-user-service.md#6-pinning-the-archie-agent-image
|
||||
# for the pinning convention this repo follows for its own agent image.
|
||||
image = "git.example.com/you/archie-agent:v1.21.0" # or "@sha256:..." for a production digest pin
|
||||
max_concurrency = 4
|
||||
max_uptime = "60m"
|
||||
# Must outlast the whole-task limit (default 4h), or the reaper ends a run the
|
||||
# task budget would have parked.
|
||||
max_uptime = "5h"
|
||||
# "missing": pull only when the image is absent locally. "always" against a
|
||||
# private registry answers 401 because the daemon sends no credentials, so
|
||||
# refresh the agent by hand: docker compose pull agent
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
# ==============================================================================
|
||||
# Multi-Forge (GitHub + Gitea) Deployment Example
|
||||
#
|
||||
# Runs GitHub and a self-hosted Gitea instance simultaneously.
|
||||
# Each [[identities]] entry defines its own forge, token, and repository list.
|
||||
# Each identity runs in an isolated background goroutine and worktree directory.
|
||||
# ==============================================================================
|
||||
|
||||
work_dir = "~/.local/share/archie/work"
|
||||
state_dir = "~/.local/share/archie" # NATS store, task logs
|
||||
# The State Store's PostgreSQL connection (PostgreSQL 18, required).
|
||||
# `docker compose up -d postgres` provides this local default; point it at
|
||||
# your own Postgres 18 server otherwise.
|
||||
database_url = "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable"
|
||||
|
||||
[services.gateway]
|
||||
target = "127.0.0.1:8585"
|
||||
|
||||
# The State Store gRPC service owns the PostgreSQL task data; archied and
|
||||
# archie-gateway dial it and never open those tables themselves.
|
||||
# This deployment runs the agent in containers, so target is the Docker bridge
|
||||
# gateway (172.17.0.1) the container can reach, with a matching target_token
|
||||
# that archie-state-store validates. Host-only agent: use 127.0.0.1:9090 with
|
||||
# no token.
|
||||
[services.state]
|
||||
target = "172.17.0.1:9090"
|
||||
target_token = "change-me-state-store-token"
|
||||
|
||||
[models]
|
||||
triage = "openai/gpt-6-luna"
|
||||
planner = "openai/gpt-6-luna"
|
||||
builder = "openai/gpt-6-luna"
|
||||
|
||||
[providers.openai]
|
||||
class = "openai"
|
||||
api_key_env = "OPENAI_API_KEY"
|
||||
|
||||
[nats]
|
||||
mode = "embedded"
|
||||
|
||||
[containers]
|
||||
# Pinned to a verified digest -- archie-agent has no published semver tag
|
||||
# yet (CI only pushes :latest). See
|
||||
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
|
||||
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
|
||||
pull_policy = "missing"
|
||||
|
||||
[budgets]
|
||||
max_steps = 60
|
||||
wall_clock = "30m"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Identity 1: GitHub Bot
|
||||
# ------------------------------------------------------------------------------
|
||||
[[identities]]
|
||||
name = "github-bot"
|
||||
bot_user = "archie-github"
|
||||
bot_email = "archie-github@users.noreply.github.com"
|
||||
|
||||
[identities.forge]
|
||||
type = "github"
|
||||
host = "https://github.com"
|
||||
token = { engine = "env", key = "ARCHIE_GITHUB_TOKEN" }
|
||||
|
||||
[identities.dispatch]
|
||||
trigger = "assignee"
|
||||
ack_reaction = "eyes"
|
||||
|
||||
[[identities.repos]]
|
||||
owner = "my-org"
|
||||
name = "github-repo-one"
|
||||
ecosystem = "go"
|
||||
|
||||
[[identities.repos]]
|
||||
owner = "my-org"
|
||||
name = "github-repo-two"
|
||||
ecosystem = "node"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Identity 2: Self-Hosted Gitea Bot
|
||||
# ------------------------------------------------------------------------------
|
||||
[[identities]]
|
||||
name = "gitea-bot"
|
||||
bot_user = "archie-gitea"
|
||||
bot_email = "archie-gitea@example.com"
|
||||
|
||||
[identities.forge]
|
||||
type = "gitea"
|
||||
host = "https://gitea.example.com"
|
||||
token = { engine = "env", key = "ARCHIE_GITEA_TOKEN" }
|
||||
|
||||
[identities.dispatch]
|
||||
trigger = "label"
|
||||
ack_reaction = "eyes"
|
||||
|
||||
[[identities.repos]]
|
||||
owner = "internal-team"
|
||||
name = "gitea-repo-alpha"
|
||||
ecosystem = "go"
|
||||
|
||||
[[identities.repos]]
|
||||
owner = "internal-team"
|
||||
name = "gitea-repo-beta"
|
||||
ecosystem = "python"
|
||||
@@ -15,7 +15,6 @@ poll_interval = "60s"
|
||||
label = "archie"
|
||||
bot_user = "archie-bot"
|
||||
bot_email = "archie-bot@users.noreply.github.com"
|
||||
diff_cap_lines = 400
|
||||
|
||||
# The Gateway Service owns conversational state and serves ChatContract over
|
||||
# gRPC. Run archie-gateway alongside archied and archie-ui (the dashboard
|
||||
@@ -25,16 +24,11 @@ target = "127.0.0.1:8585"
|
||||
|
||||
# The State Store gRPC service owns the PostgreSQL task data. archied and
|
||||
# archie-gateway dial it here and never open those tables themselves.
|
||||
# This deployment runs the
|
||||
# agent in containers, so the target must be the Docker bridge gateway address
|
||||
# (172.17.0.1) that the container can reach, and a non-loopback target requires
|
||||
# a matching target_token that archie-state-store validates -- start it with the
|
||||
# same token (e.g. `archie-state-store ... -listen 172.17.0.1:9090 -token
|
||||
# change-me-state-store-token`). For a host-only agent (no [containers]) use the
|
||||
# loopback target 127.0.0.1:9090 with no token.
|
||||
# This deployment runs the agent in containers, so the target is the Docker
|
||||
# bridge gateway (172.17.0.1) the container can reach. A non-loopback address
|
||||
# needs [tls]; see config.example.toml.
|
||||
[services.state]
|
||||
target = "172.17.0.1:9090"
|
||||
target_token = "change-me-state-store-token"
|
||||
|
||||
[forge]
|
||||
type = "github"
|
||||
@@ -59,9 +53,9 @@ mode = "embedded"
|
||||
|
||||
[containers]
|
||||
# Pinned to a verified digest -- archie-agent has no published semver tag
|
||||
# yet (CI only pushes :latest). See
|
||||
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
|
||||
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
|
||||
# yet (a release publishes :latest and :sha-<commit>). See
|
||||
# deployments/systemd-user-service.md#6-pinning-the-archie-agent-image.
|
||||
image = "git.catlow.cloud/sam/archie-agent@sha256:<digest>"
|
||||
pull_policy = "missing"
|
||||
|
||||
[budgets]
|
||||
|
||||
@@ -20,10 +20,9 @@ The State Store unit is `archie-state-store.service`. It owns the task data in
|
||||
PostgreSQL and serves the `StateStore` gRPC contract. BOTH `archied` and
|
||||
`archie-gateway` dial it via `[services.state].target` (see the `archied`
|
||||
config below) and never open the task tables themselves. A
|
||||
host-only agent uses the loopback bind with no token below; a container-mode
|
||||
agent needs the Docker bridge gateway address plus a bearer token via
|
||||
`--token`/`STATE_STORE_TOKEN` or `[services.state].target_token`, and a
|
||||
non-loopback bind fails closed without one:
|
||||
host-only agent uses the loopback bind below; a container-mode agent needs the
|
||||
Docker bridge gateway address, and a non-loopback bind needs `[tls]` (see
|
||||
`config.example.toml`):
|
||||
|
||||
`install.sh` writes `archie-state-store.service` with that loopback bind.
|
||||
|
||||
@@ -36,14 +35,12 @@ by `archied`, since the v1.30.0 extraction. `archied` starts no gateway for them
|
||||
and logs nothing when one is absent, so a host that updates across v1.30.0
|
||||
without this unit runs on with dead channels and a daemon that looks perfectly
|
||||
healthy. `install.sh` writes this unit on a fresh install;
|
||||
`scripts/archie-update-install` refuses an
|
||||
`archied update install` refuses an
|
||||
update when a host is missing a unit and names what is missing, which now fires
|
||||
for a host that drifted or predates this release rather than the normal path.
|
||||
|
||||
It dials the Gateway for the chat contract and the State Store for the stored
|
||||
channel settings, and reads the same `config.toml`. Like `archie-ui` it resolves
|
||||
`GATEWAY_TOKEN` and `STATE_STORE_TOKEN` from its process environment, hence the
|
||||
`EnvironmentFile`:
|
||||
channel settings, and reads the same `config.toml`, including `[tls]`.
|
||||
|
||||
`install.sh` writes `archie-messaging.service`. Its `After=` and `Wants=`
|
||||
lines only tidy the start sequence: nothing depends on that order, because
|
||||
@@ -53,46 +50,26 @@ each service waits for the peers it needs.
|
||||
|
||||
The dashboard is served by the standalone UI Service, not by `archied`. It reads the same `config.toml`, dials
|
||||
the Gateway and State Store targets already in it, and binds `[web].listen`.
|
||||
A non-loopback bind requires a dashboard token (`-token`, or `-token-file` to
|
||||
mint and persist one);
|
||||
Open the dashboard to configure the organisation, workspace and first administrator account.
|
||||
Complete setup before exposing it publicly; remote access requires an HTTPS reverse proxy.
|
||||
|
||||
**Auth note:** unlike `archied`,
|
||||
`archie-ui` has no secret registry — it resolves `GATEWAY_TOKEN` and
|
||||
`STATE_STORE_TOKEN` from its **process environment only** (or from the
|
||||
`target_token` values in `config.toml`). Whatever starts `archie-ui` is
|
||||
therefore responsible for exporting those tokens into its environment: keep
|
||||
them in `~/.config/archie/env` (loaded by the `EnvironmentFile` line below),
|
||||
not only in a secret manager. A deployment that authenticates `archied`
|
||||
through bws/Vault but exports nothing for `archie-ui` leaves the dashboard
|
||||
unable to dial its dependencies.
|
||||
**Auth note:** `archie-ui` authenticates to the Gateway, State Store and
|
||||
harness with its `[tls]` certificate (`archie-ui.pem`) from `config.toml`.
|
||||
|
||||
For supervision, `GET /healthz` on `[web].listen` is the process's liveness
|
||||
probe (token-free by design); the authenticated readiness surface lives at
|
||||
the dashboard's health endpoint behind the token. A watchdog can curl
|
||||
the dashboard's health endpoint behind account authentication. A watchdog can curl
|
||||
`/healthz` without credentials.
|
||||
|
||||
`install.sh` writes `archie-ui.service`. It has no secret registry of its own,
|
||||
so its token handling is the `EnvironmentFile` note above.
|
||||
|
||||
Concretely, for a deployment whose dependency tokens live outside
|
||||
`config.toml`, `~/.config/archie/env` carries the two names and the unit
|
||||
loads it; the dashboard token itself comes from `-token-file` (there is no
|
||||
environment variable for it):
|
||||
|
||||
```bash
|
||||
# ~/.config/archie/env
|
||||
GATEWAY_TOKEN=... # presented to archie-gateway
|
||||
STATE_STORE_TOKEN=... # presented to archie-state-store
|
||||
```
|
||||
`install.sh` writes `archie-ui.service`. Browser accounts are configured through the dashboard.
|
||||
|
||||
`After=` orders the start, it does not wait for the store to bind. The UI
|
||||
process closes that gap itself: its event pump retries priming with backoff
|
||||
until the State Store answers, so the activity feed goes live once the store
|
||||
is up rather than staying history-only until the next restart.
|
||||
|
||||
For a non-loopback bind, override the installed unit's `ExecStart` with
|
||||
`-token-file %h/.local/share/archie/web-token` (or `-token`) in a drop-in rather
|
||||
than editing the installer's copy in place.
|
||||
For remote access, configure a TLS reverse proxy and the instance public URL in
|
||||
Access → Authentication. Enrol passkeys from Your account on HTTPS or localhost.
|
||||
|
||||
---
|
||||
|
||||
@@ -157,9 +134,10 @@ Compose service or host `archie-agent` binary is required.
|
||||
|
||||
Docker must be installed and reachable by the service user. With no explicit
|
||||
broker or container settings, Archie defaults `containers.image` to
|
||||
`ghcr.io/samcharles93/archie-agent:latest`. Every profile shipped in
|
||||
`deployments/` overrides that default with a pinned reference -- see
|
||||
[Pinning the archie-agent image](#pinning-the-archie-agent-image) below. An
|
||||
`git.catlow.cloud/sam/archie-agent:latest`. `single-forge-github.toml` and
|
||||
`docker-nats-stack.toml` override that default with a pinned reference
|
||||
(`standalone.toml` and `dev.toml` leave it) -- see
|
||||
[Pinning the archie-agent image](#6-pinning-the-archie-agent-image) below. An
|
||||
explicit equivalent, pinned the same way, is:
|
||||
|
||||
```toml
|
||||
@@ -167,7 +145,7 @@ explicit equivalent, pinned the same way, is:
|
||||
mode = "embedded"
|
||||
|
||||
[containers]
|
||||
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
|
||||
image = "git.catlow.cloud/sam/archie-agent@sha256:<digest>"
|
||||
pull_policy = "missing"
|
||||
```
|
||||
|
||||
@@ -191,37 +169,66 @@ fall back to a host model loop.
|
||||
|
||||
## 6. Pinning the archie-agent Image
|
||||
|
||||
`ghcr.io/samcharles93/archie-agent:latest` is a moving target: every push to
|
||||
`main` that touches the runtime's package closure re-publishes it
|
||||
(`.github/workflows/deploy.yml`), so `latest` can change under a running
|
||||
deployment with no warning and no way to reproduce a prior build.
|
||||
`archie-agent:latest` is a moving target: every release re-publishes it, so it
|
||||
can change under a running deployment with no warning and no way to reproduce a
|
||||
prior build. Two paths publish it, to different references:
|
||||
|
||||
As of this writing, `archie-agent` has **no published semantic-version tag**
|
||||
-- CI only pushes `:latest` to GHCR (`archied` is versioned independently per
|
||||
`RELEASING.md`, but that versioning is not yet reflected as a registry tag for
|
||||
the agent image). Until CI publishes one, the only reproducible reference is
|
||||
a content digest, resolved once and pinned explicitly:
|
||||
- `.github/workflows/deploy.yml` publishes `git.catlow.cloud/sam/archie-agent`
|
||||
as `:latest` and `:sha-<commit>` when the commit carries a release tag; an
|
||||
ordinary push to `main` publishes nothing for the agent image.
|
||||
- `tools/publish.sh`, run by hand for a release, publishes
|
||||
`git.catlow.cloud/sam/archie-agent` as `:latest` and `:sha-<commit>`, which is
|
||||
the registry the shipped default above names.
|
||||
|
||||
A distribution zip pins whichever one its own release published, by digest, in
|
||||
`release.json`; `archied update install` then pulls exactly that.
|
||||
|
||||
As of this writing, `archie-agent` has **no published semantic-version tag** --
|
||||
both paths publish only `:latest` and an immutable `:sha-<commit>` (`archied`
|
||||
is versioned independently per `RELEASING.md`, but that versioning is not yet
|
||||
reflected as a registry tag for the agent image). Until one publishes it, the
|
||||
only reproducible reference is a content digest, resolved once and pinned
|
||||
explicitly:
|
||||
|
||||
```toml
|
||||
[containers]
|
||||
image = "ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090"
|
||||
image = "git.catlow.cloud/sam/archie-agent@sha256:<digest>"
|
||||
```
|
||||
|
||||
This is the digest `latest` resolved to on 2026-09-05. Digest pinning is the
|
||||
strongest option for production: it is immutable and independently
|
||||
verifiable (`docker manifest inspect ghcr.io/samcharles93/archie-agent@sha256:...`),
|
||||
verifiable (`docker manifest inspect git.catlow.cloud/sam/archie-agent@sha256:...`),
|
||||
at the cost of being opaque in a config file a human is meant to edit --
|
||||
resolve a fresh digest deliberately (`docker pull ...:latest` followed by
|
||||
`docker inspect --format '{{index .RepoDigests 0}}'`) rather than editing this
|
||||
one in place expecting it to track new releases.
|
||||
|
||||
If/when CI starts publishing a semantic-version tag for `archie-agent`
|
||||
(e.g. `ghcr.io/samcharles93/archie-agent:v1.21.0`), prefer that tag for
|
||||
(e.g. `git.catlow.cloud/sam/archie-agent:v1.21.0`), prefer that tag for
|
||||
day-to-day config readability, and reserve digest pinning for deployments
|
||||
that need byte-for-byte reproducibility guarantees a tag alone cannot give
|
||||
(tags are mutable pointers; a compromised or accidentally-overwritten tag
|
||||
still resolves, a digest cannot).
|
||||
|
||||
A reference on a registry that needs a login needs the credential in
|
||||
`[containers].registry_auth` -- the release's own
|
||||
`git.catlow.cloud/sam/archie-agent` digest is one, since an anonymous pull
|
||||
cannot reach it:
|
||||
|
||||
```toml
|
||||
[containers]
|
||||
registry_auth = {engine = "env", key = "ARCHIE_REGISTRY_AUTH"}
|
||||
```
|
||||
|
||||
The secret resolves to a Docker `AuthConfig` JSON document: the object
|
||||
`docker login` stores under `auths`, without the surrounding map, and with a
|
||||
personal access token that can read the package as the password --
|
||||
`{"username":"<user>","password":"<token>"}`. Put it in
|
||||
`~/.config/archie/env` as `ARCHIE_REGISTRY_AUTH` so it stays out of
|
||||
`config.toml`. The field is file-owned and settled at boot, so a change takes
|
||||
effect on restart; a value that cannot be read logs a warning and pulls
|
||||
anonymously, which is the failure the task reports as a capability error.
|
||||
|
||||
The bundled update adapter snapshots the configured `[containers].image` before
|
||||
rebuilding it and restores that image if the restarted daemon fails its health
|
||||
check. A custom image reference is therefore supported directly in
|
||||
|
||||
+22
-8
@@ -8,7 +8,7 @@
|
||||
# Embedded NATS is the normal deployment and needs no Compose service.
|
||||
# State Store DB: docker compose up -d postgres
|
||||
# External broker: docker compose up -d nats
|
||||
# Build worker: docker compose build agent
|
||||
# Build worker: task image:agent (stamps this checkout's version)
|
||||
# Profile image: docker compose build agent-net
|
||||
# Stop external: docker compose down
|
||||
# Logs: journalctl --user -u archied -f (the daemon)
|
||||
@@ -44,10 +44,18 @@ services:
|
||||
# ── NATS JetStream ────────────────────────────────────────────────
|
||||
nats:
|
||||
image: nats:2.14-alpine3.22
|
||||
command: -js -m 8222
|
||||
# The client port is published on every interface (agent containers reach
|
||||
# it over the bridge), so it refuses to start without a token. Set
|
||||
# NATS_TOKEN here and name the same value in [nats] token_env.
|
||||
entrypoint:
|
||||
- sh
|
||||
- -c
|
||||
- '[ -n "$$NATS_TOKEN" ] || { echo "NATS_TOKEN is required" >&2; exit 1; }; exec nats-server -js -m 8222 --auth "$$NATS_TOKEN"'
|
||||
environment:
|
||||
NATS_TOKEN: ${NATS_TOKEN:-}
|
||||
ports:
|
||||
- "4222:4222" # client
|
||||
- "8222:8222" # monitoring (http://localhost:8222)
|
||||
- "127.0.0.1:8222:8222" # monitoring (http://localhost:8222)
|
||||
volumes:
|
||||
- nats_data:/data
|
||||
restart: unless-stopped
|
||||
@@ -67,7 +75,7 @@ services:
|
||||
# "Started", which reads like a crash loop. Naming the service explicitly
|
||||
# still works without activating the profile:
|
||||
#
|
||||
# docker compose build agent (also: task docker-build)
|
||||
# docker compose build agent
|
||||
# docker compose pull agent -- plain `pull` skips profiled services
|
||||
#
|
||||
# Routine freshness is handled by the daemon, which pulls this image per
|
||||
@@ -78,10 +86,16 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
# Pinned to a verified digest -- archie-agent has no published semver
|
||||
# tag yet (CI only pushes :latest). See
|
||||
# deployments/systemd-user-service.md#pinning-the-archie-agent-image.
|
||||
image: ghcr.io/samcharles93/archie-agent@sha256:870f1b1357979cfea23fccacb24166ebeb9ab321708ef2c2b218a763ed99b090
|
||||
# Stamped into the agent so the version it reports is the one the rest of
|
||||
# the install reports. `task image:agent` passes this checkout's version;
|
||||
# a bare `docker build` passes nothing and the agent answers dev.
|
||||
args:
|
||||
RUNTIME_VERSION: ${RUNTIME_VERSION:-dev}
|
||||
# A tag, not the digest: Compose refuses to build an image it is told to
|
||||
# name by digest. The digest a task container actually runs is pinned in
|
||||
# the daemon's own [containers] image, so nothing here decides it. See
|
||||
# deployments/systemd-user-service.md#6-pinning-the-archie-agent-image.
|
||||
image: git.catlow.cloud/sam/archie-agent:latest
|
||||
|
||||
# ── example agent profile image ─────────────────────────────────────
|
||||
# The agent image plus network lookup tools, for a workflow that names
|
||||
|
||||
+19
-9
@@ -1,8 +1,12 @@
|
||||
# Generating a GitHub Token for Archie Core
|
||||
|
||||
This guide walks you through creating a GitHub Personal Access Token (PAT) for Archie Core.
|
||||
This guide walks you through creating a GitHub Personal Access Token (PAT) for
|
||||
Archie Core.
|
||||
|
||||
> **Important**: Archie Core requires a **Classic Personal Access Token** (starts with `ghp_...`). Fine-grained PATs currently lack necessary scope permissions for Git HTTP push operations, repository invitation acceptance, and cross-repository operations needed by the orchestrator.
|
||||
> **Important**: Archie Core requires a **Classic Personal Access Token**
|
||||
> (starts with `ghp_...`). Fine-grained PATs currently lack necessary scope
|
||||
> permissions for Git HTTP push operations, repository invitation acceptance,
|
||||
> and cross-repository operations needed by the orchestrator.
|
||||
|
||||
---
|
||||
|
||||
@@ -11,23 +15,29 @@ This guide walks you through creating a GitHub Personal Access Token (PAT) for A
|
||||
Archie Core uses the GitHub API to:
|
||||
|
||||
1. Poll assigned or labelled issues (`archie:queued`).
|
||||
2. Update issue labels as tasks transition (`archie:working`, `archie:pr`, `archie:parked`).
|
||||
2. Update issue labels as tasks transition (`archie:working`, `archie:pr`,
|
||||
`archie:parked`).
|
||||
3. Post status comments and emoji reactions.
|
||||
4. Create branches, commit code changes, and open Pull Requests for human review.
|
||||
4. Create branches, commit code changes, and open Pull Requests for review.
|
||||
|
||||
---
|
||||
|
||||
## Step-by-Step Instructions: Creating a Classic Token
|
||||
|
||||
1. Navigate to [GitHub Settings → Developer Settings → Tokens (classic)](https://github.com/settings/tokens).
|
||||
1. Navigate to
|
||||
[GitHub Settings → Developer Settings → Tokens (classic)](https://github.com/settings/tokens).
|
||||
2. Click **Generate new token** → **Generate new token (classic)**.
|
||||
3. Set the **Note**: `Archie Core` (or your bot's name).
|
||||
4. Choose an **Expiration** (e.g. 90 days, 1 year, or No expiration for dedicated bot accounts).
|
||||
4. Choose an **Expiration** (e.g. 90 days, 1 year, or No expiration for
|
||||
dedicated bot accounts).
|
||||
5. Select the required scope:
|
||||
- **`repo`** (Full control of private repositories — required for polling, commenting, pushing branches, and opening PRs).
|
||||
- **`workflow`** (Optional — required if Archie needs to update GitHub Actions workflows).
|
||||
- **`repo`** (Full control of private repositories — required for polling,
|
||||
commenting, pushing branches, and opening PRs).
|
||||
- **`workflow`** (Optional — required if Archie needs to update GitHub
|
||||
Actions workflows).
|
||||
6. Scroll to the bottom and click **Generate token**.
|
||||
7. **Copy your token immediately** (starts with `ghp_...`). You won't be able to see it again!
|
||||
7. **Copy your token immediately** (starts with `ghp_...`). You won't be able to
|
||||
see it again!
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
# Building your first playbook binding
|
||||
|
||||
This walks through the whole no-code path the event-capture epic promises:
|
||||
point an external app's webhook at archie, see the real payload it sends,
|
||||
map the fields you care about, bind them to a workflow, and watch the next
|
||||
matching event turn into a task -- no code, no redeploy, no restart.
|
||||
This walks through the whole no-code path the event-capture epic promises: point
|
||||
an external app's webhook at archie, see the real payload it sends, map the
|
||||
fields you care about, bind them to a workflow, and watch the next matching
|
||||
event turn into a task -- no code, no redeploy, no restart.
|
||||
|
||||
## 1. Create a source and send a test event
|
||||
|
||||
Open **Events → Inspector** and click **New source**. Archie shows the
|
||||
source's URL and signing secret once; copy both. Point the external app's
|
||||
webhook at that URL. Send one real
|
||||
event however is easiest for a first test, e.g.:
|
||||
Open **Events → Inspector** and click **New source**. Archie shows the source's
|
||||
URL and signing secret once; copy both. Point the external app's webhook at that
|
||||
URL. Send one real event however is easiest for a first test, e.g.:
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:8484/webhooks/capture/sentry \
|
||||
@@ -18,25 +17,25 @@ curl -X POST http://localhost:8484/webhooks/capture/sentry \
|
||||
-d '{"issue": {"title": "NullPointerException in checkout"}, "level": "error"}'
|
||||
```
|
||||
|
||||
This event isn't signed yet, so it's captured but marked **unauthenticated**
|
||||
-- visible for you to design against, but incapable of triggering anything: an unauthenticated event can never match a binding.
|
||||
This event isn't signed yet, so it's captured but marked **unauthenticated** --
|
||||
visible for you to design against, but incapable of triggering anything: an
|
||||
unauthenticated event can never match a binding.
|
||||
|
||||
## 2. Inspect the captured payload
|
||||
|
||||
Open the dashboard's **Event inspector** (`/captures`). Your test event
|
||||
appears there with its real body -- this is schema-by-example: you're
|
||||
looking at an actual payload from the actual sender, not guessing at a
|
||||
schema in advance.
|
||||
Open the dashboard's **Event inspector** (`/captures`). Your test event appears
|
||||
there with its real body -- this is schema-by-example: you're looking at an
|
||||
actual payload from the actual sender, not guessing at a schema in advance.
|
||||
|
||||
## 3. Map the fields you care about
|
||||
|
||||
Open **Field mappings** (`/mappings`) → **New mapping**. Pick your captured
|
||||
event from the dropdown, then click through its payload tree on the right --
|
||||
every key and value is clickable. Clicking a value binds it as a field
|
||||
(name, JSON path, and an inferred type you can change). Add whichever fields
|
||||
your workflow needs (e.g. the issue title), mark the ones that must be
|
||||
present as **Required**, hit **Preview** to confirm they resolve correctly
|
||||
against the real payload, then **Save**.
|
||||
every key and value is clickable. Clicking a value binds it as a field (name,
|
||||
JSON path, and an inferred type you can change). Add whichever fields your
|
||||
workflow needs (e.g. the issue title), mark the ones that must be present as
|
||||
**Required**, hit **Preview** to confirm they resolve correctly against the real
|
||||
payload, then **Save**.
|
||||
|
||||
## 4. Create the binding
|
||||
|
||||
@@ -46,20 +45,20 @@ Open **Playbook bindings** (`/bindings`) → **New binding**:
|
||||
- **Source** -- the same `<source>` segment from step 1 (e.g. `sentry`).
|
||||
- **Field mapping** -- the one you just saved.
|
||||
- **Workflow** -- which registered workflow should run on a match.
|
||||
- **Repo pin** (optional) -- leave both blank to use the single configured
|
||||
repo; set owner/repo explicitly if you run a multi-repo deployment.
|
||||
- **Shared secret** -- a real secret (16+ bytes), never `test1234`. The
|
||||
sender signs every request body with this via HMAC-SHA256 so archie can
|
||||
tell a genuine event from anyone who finds the URL.
|
||||
- **Repo pin** (optional) -- leave both blank to use the single configured repo;
|
||||
set owner/repo explicitly if you run a multi-repo deployment.
|
||||
- **Shared secret** -- a real secret (16+ bytes), never `test1234`. The sender
|
||||
signs every request body with this via HMAC-SHA256 so archie can tell a
|
||||
genuine event from anyone who finds the URL.
|
||||
|
||||
Save. The binding starts in **draft** -- nothing fires yet.
|
||||
|
||||
## 5. Approve it
|
||||
|
||||
A **draft** or freshly-**edited** binding needs an explicit human approval
|
||||
before it can ever match a live event -- this is deliberate, not a missing
|
||||
step: an operator authoring a binding is a considered act, an event arriving
|
||||
is not, and nothing should self-arm. Click **Approve**. Status becomes **armed**.
|
||||
A **draft** or freshly-**edited** binding needs explicit approval
|
||||
before it can ever match a live event -- this is deliberate, not a missing step:
|
||||
an operator authoring a binding is a considered act, an event arriving is not,
|
||||
and nothing should self-arm. Click **Approve**. Status becomes **armed**.
|
||||
|
||||
## 6. Fire it for real
|
||||
|
||||
@@ -77,16 +76,14 @@ curl -X POST http://localhost:8484/webhooks/capture/sentry \
|
||||
-d "$BODY"
|
||||
```
|
||||
|
||||
This event is captured as **authenticated**, matched against your armed
|
||||
binding, and dispatched into a new task through the exact same
|
||||
gate/worktree/sandbox pipeline every other task goes through. Check
|
||||
the **Tasks** page; a new task should appear, its body built from the fields
|
||||
your mapping resolved.
|
||||
This event is captured as **authenticated**, matched against your armed binding,
|
||||
and dispatched into a new task through the exact same gate/worktree/sandbox
|
||||
pipeline every other task goes through. Check the **Tasks** page; a new task
|
||||
should appear, its body built from the fields your mapping resolved.
|
||||
|
||||
## Editing a live binding
|
||||
|
||||
Any edit to an armed binding -- even a typo fix -- drops it back to
|
||||
**pending_approval** automatically. This can't be bypassed by editing; it
|
||||
has to be re-approved. When editing, leave the **Shared secret** field blank
|
||||
to keep the existing secret; only fill it in if you're deliberately
|
||||
rotating it.
|
||||
**pending_approval** automatically. This can't be bypassed by editing; it has to
|
||||
be re-approved. When editing, leave the **Shared secret** field blank to keep
|
||||
the existing secret; only fill it in if you're deliberately rotating it.
|
||||
@@ -4,9 +4,9 @@
|
||||
task bench:prreview
|
||||
```
|
||||
|
||||
Reviews the 38 runnable Martian pull requests once each at `deep` depth with
|
||||
the production pipeline, judges the posted comments against the golden
|
||||
comments in `internal/app/prbench/martian.json`, and writes
|
||||
Reviews the 38 runnable Martian pull requests once each at `deep` depth with the
|
||||
production pipeline, judges the posted comments against the golden comments in
|
||||
`internal/app/prbench/martian.json`, and writes
|
||||
`docs/benchmarks/pr-review-<timestamp>.md` (recall per PR, overall recall,
|
||||
precision, models, archie version). Commit that file with the run.
|
||||
|
||||
@@ -14,8 +14,8 @@ precision, models, archie version). Commit that file with the run.
|
||||
and judge both default to its `default` alias. Override with
|
||||
`task bench:prreview -- -model ALIAS_OR_PROVIDER/MODEL -judge-model ALIAS_OR_PROVIDER/MODEL`.
|
||||
Pick a judge other than the reviewer's model for an independent judgement.
|
||||
Aliases set only in the dashboard are not in the file; pass a
|
||||
`provider/model` ref instead.
|
||||
Aliases set only in the dashboard are not in the file; pass a `provider/model`
|
||||
ref instead.
|
||||
- Pull requests are public, so no credential is needed. `GH_TOKEN` or
|
||||
`GITHUB_TOKEN`, if set, only raises the GitHub API rate limit.
|
||||
- `-problems ID,ID` runs a partial smoke run; its report says it is not the
|
||||
|
||||
@@ -79,6 +79,12 @@
|
||||
"/news/archie/1.51.1/": "/news/1.51.1/",
|
||||
"/news/archie/1.52.0/": "/news/1.52.0/",
|
||||
"/news/archie/1.53.0/": "/news/1.53.0/",
|
||||
"/news/archie/1.54.0/": "/news/1.54.0/",
|
||||
"/news/archie/1.54.1/": "/news/1.54.1/",
|
||||
"/news/archie/1.54.2/": "/news/1.54.2/",
|
||||
"/news/archie/1.54.3/": "/news/1.54.3/",
|
||||
"/news/archie/1.55.0/": "/news/1.55.0/",
|
||||
"/news/archie/1.56.0/": "/news/1.56.0/",
|
||||
"/news/archie/1.6.0/": "/news/1.6.0/",
|
||||
"/news/archie/1.7.0/": "/news/1.7.0/",
|
||||
"/news/archie/1.8.0/": "/news/1.8.0/",
|
||||
@@ -174,6 +180,12 @@
|
||||
"/news/archied/1.51.1/": "/news/1.51.1/",
|
||||
"/news/archied/1.52.0/": "/news/1.52.0/",
|
||||
"/news/archied/1.53.0/": "/news/1.53.0/",
|
||||
"/news/archied/1.54.0/": "/news/1.54.0/",
|
||||
"/news/archied/1.54.1/": "/news/1.54.1/",
|
||||
"/news/archied/1.54.2/": "/news/1.54.2/",
|
||||
"/news/archied/1.54.3/": "/news/1.54.3/",
|
||||
"/news/archied/1.55.0/": "/news/1.55.0/",
|
||||
"/news/archied/1.56.0/": "/news/1.56.0/",
|
||||
"/news/archied/1.6.0/": "/news/1.6.0/",
|
||||
"/news/archied/1.7.0/": "/news/1.7.0/",
|
||||
"/news/archied/1.8.0/": "/news/1.8.0/",
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
[
|
||||
{
|
||||
"version": "1.56.0",
|
||||
"date": "2026-10-31",
|
||||
"body": "### archied\n\n- **Install once by hand.** Releases are now signed and published to `git.catlow.cloud/sam/archie`. A host on 1.55.0 or earlier still looks for releases on GitHub, so it finds this one only by running the new installer once: `curl -fsSL https://offloaded.dev/install.sh | bash`. Updates after that come from Settings → Status as before.\n- Releases are signed. Updates and `install.sh` refuse a release the release key did not sign, a zip that is not the one signed, and a channel moved back to an older release. Where releases and the extension catalogue come from is a setting (update settings and extension settings, or `[distribution]` in `config.toml` for a new instance), and `archied release keygen` and `archied release publish` publish signed releases to your own registry.\n- Organisations: forge connections, schedules, alerts, chat channels and audit are per organisation. A member acts in the organisation they select, the setup checklist follows it, and the instance's own forge is its root connection.\n- Workflows are edited as a draft and reach the running workflow only when published. Build a workflow with Archie from the canvas: chat writes the draft into the editor for review, and the editor locks while it does.\n- Schedules run from the State Store with run history, fire into their own organisation, and can trigger workflows. Daemon maintenance runs as built-in schedules.\n- A parked task links to the page that fixes its blocker (repository, credential, model or forge extension), and a parked task can be retried on the current workflow definition.\n- Shipped workflows run as a seeded agent identity with narrow grants instead of the root identity. Credential services are granted to dashboard identities from pickers, and personal API tokens have a name, a lifetime and a last-used time.\n- An org-scoped audit page with filters, a live tail, export and a retention setting; recorded access denials are kept for a set time and listed on their own page.\n- Instructions replace SOUL: instance, organisation, workflow and repository instructions are layered into every agent stage.\n- Chat docks at the bottom of every page and stays open across navigation. Tool calls show where they happened in a reply, with arguments (secrets masked) and durations, and `ask_questions` asks several questions at once.\n- Run more than one instance side by side: `ARCHIE_INSTANCE` names an instance, and the installer installs and updates a named one.\n- Pull request reviews submit REQUEST_CHANGES on blocking findings, list findings outside the diff in the review body, and repost without inline comments when the forge refuses their placement.\n- A workflow installs a repository's declared tooling before its gate, and tasks clone from a shared per-repository mirror.\n- Traces: services, model and tool calls and task containers export OpenTelemetry spans, and log lines carry the trace id.\n- Telegram runs as an archipelago channel extension, enabled from the Extensions page.\n- The Extensions page groups the marketplace by surface, is searchable, shows install state, and offers an update only when the catalogue has one.\n- The dashboard is rebuilt on shared components: a new Archie mark, a theme that follows the OS, task logs as a table, and layouts that fit a phone.\n\n### archie-agent\n\n- Released with archied 1.56.0; task containers export trace spans and install a repository's declared tooling before its gate."
|
||||
},
|
||||
{
|
||||
"version": "1.55.0",
|
||||
"date": "2026-10-16",
|
||||
"body": "### archied\n\n- Personas are gone: the Personas settings page, the chat Personality selector and `/personality`. A selected persona never changed what the model was told; SOUL (Settings → SOUL) is the one place to set Archie's identity and style. Stored persona settings are deleted on upgrade.\n- The shipped SOUL describes Archie as the assistant for an event-driven automation system rather than a coding assistant. A SOUL you have saved is kept as it is."
|
||||
},
|
||||
{
|
||||
"version": "1.54.3",
|
||||
"date": "2026-10-16",
|
||||
"body": "### archied\n\n- Chat can help write a workflow: it reads your workflows and the step catalog, writes a definition, and checks it the same way saving does, fixing what the check reports. It does not save; paste the YAML it gives you into the editor's YAML view and save there."
|
||||
},
|
||||
{
|
||||
"version": "1.54.2",
|
||||
"date": "2026-10-16",
|
||||
"body": "### archied\n\n- Tool calls from Gemini models (Interactions API) receive their arguments intact. Any tool that takes arguments, such as `dashboard_navigate` in chat, failed with \"invalid character '{' after top-level value\".\n\n### archie-agent\n\n- Agent steps on Gemini models (Interactions API) pass tools their arguments intact instead of failing to decode them."
|
||||
},
|
||||
{
|
||||
"version": "1.54.1",
|
||||
"date": "2026-10-16",
|
||||
"body": "### archied\n\n- Update checks, `archied update install` and `install.sh` find releases at `github.com/samcharles93/archie-releases`, so a host can update again. A host on 1.54.0 or earlier still looks in the old place and has to be upgraded to 1.54.1 by hand once."
|
||||
},
|
||||
{
|
||||
"version": "1.54.0",
|
||||
"date": "2026-10-16",
|
||||
"body": "**Upgrade note:** services now authenticate each other with TLS certificates from your own CA instead of shared tokens. Before upgrading a host whose services listen on anything but loopback (any host running agent containers), issue a certificate per service (`archied`, `archie-gateway`, `archie-messaging`, `archie-state-store`, `archie-ui`, each with its name as the DNS SAN and both server and client auth), add `[tls] ca_file` and `cert_dir` to `config.toml`, and remove every `target_token`, the `*_TOKEN` service variables and the `--token`/`--*-token` flags, including archie-ui's `-token` and `-token-file`. A unit that still passes a removed flag fails to start. See `config.example.toml`.\n\n### archied\n\n- Services authenticate each other with mutual TLS. Each process presents `<cert_dir>/<service>.pem`, peers must chain to `ca_file`, and a caller is identified by its certificate rather than by what it claims. Renewed certificates are picked up without a restart. Without `[tls]`, services listen on and dial loopback only. The harness setup terminal requires `[tls]`.\n- Every gRPC service caps the streams a connection holds, times out stalled handshakes, releases a dead client's streams, and drains for at most 10 seconds on shutdown. Messaging exits when its listener fails instead of staying up without delivering.\n- The dashboard has user accounts. First run opens browser setup for the organisation, workspace and first administrator; people then sign in with a password, a passkey or your identity provider, and account administration lives under Access. The shared dashboard token is gone; reach the dashboard remotely through an HTTPS reverse proxy.\n- `archied update install` updates a host in one transaction: it verifies the release, stages every binary, pulls the agent image by digest and backs up the database, then restarts the services in order and rolls everything back if archied is not healthy for two minutes.\n- Each workflow runs as the identity it declares, checked on every attempt along with the identity that started it. A workflow that declares none is refused, a called workflow runs as its caller's declared identity, and shipped workflows run as the instance root.\n- Test-run a workflow draft before saving it, with forge and push writes suppressed and recorded per step. The History tab lists a workflow's revisions, diffs them as YAML and on the canvas, restores one into the editor, and shows which revision each run used.\n- Start a task from the dashboard. The dashboard home shows activity and setup, and a running task has a read-only Sandbox tab that follows its container.\n- The topbar's Jump to is a command palette, settings lists open as accordions that wait for a new item to be saved, and history restores land as a draft applied from the save bar.\n- Labels, hints, alerts and empty states say what is wrong and what to do, without tutorial or marketing prose.\n- Org isolation is tighter: harness secrets, identity writes, principals, playbook dispatch and model selections in chat stay in the caller's org, instance settings are written by the system org only, and creating a source or reloading a channel is authorized against the target.\n- Binding dispatch claims its capture and enqueues the task atomically, so a capture cannot start two runs, and the run-time workflow check sees the binding event's signature and address.\n- Service-unhealthy alerts count their grace from the last report and also cover a service that went silent, and a restart no longer clears an alert still inside its grace. An invalid stored access policy raises an alert until it validates.\n- A failed cancel of a called workflow no longer leaves the caller running, retention spares captures still waiting to be dispatched, and EDA playbooks load and report at start instead of on first dispatch.\n- Chat model selection works again for provider models.\n\n### archie-agent\n\n- Each run acts as its workflow's declared identity.\n- A task snapshot carries only the model limits its aliases resolve to.\n- A build step's \"no changes\" result comes from its writable stages and clears once a commit lands.\n- Test runs suppress forge and push writes and record what they would have done.\n- The default persona is a reporting-focused identity prompt, without the one-question limit in chat."
|
||||
},
|
||||
{
|
||||
"version": "1.53.0",
|
||||
"date": "2026-10-11",
|
||||
|
||||
+256
-196
@@ -1,18 +1,17 @@
|
||||
# External agent harnesses
|
||||
|
||||
**Status:** Approved
|
||||
**Scope:** the harness model and, in "Session contract", the duplex session
|
||||
that the setup terminal and the run-scoped live view both use. Code cites
|
||||
this file for both (`ui/src/harness/SetupTerminal.vue`,
|
||||
**Status:** Approved **Scope:** the harness model and, in "Session contract",
|
||||
the duplex session that the setup terminal and the run-scoped live view both
|
||||
use. Code cites this file for both (`ui/src/harness/SetupTerminal.vue`,
|
||||
`internal/infrastructure/postgres/queries/harness_secrets.sql`).
|
||||
|
||||
## Decision
|
||||
|
||||
A workflow stage can run on an external coding-agent CLI instead of the
|
||||
built-in agent loop: Claude Code, Codex, Pi, OMP, GitHub Copilot CLI, or any
|
||||
other CLI packaged as a Docker Sandbox Kit v3. Each authenticates with an API
|
||||
key or the operator's subscription login, and can carry the operator's own
|
||||
skills, plugins, subagents and instructions.
|
||||
A workflow stage can run on an external coding-agent CLI instead of the built-in
|
||||
agent loop: Claude Code, Codex, Pi, OMP, GitHub Copilot CLI, or any other CLI
|
||||
packaged as a Docker Sandbox Kit v3. Each authenticates with an API key or the
|
||||
operator's subscription login, and can carry the operator's own skills, plugins,
|
||||
subagents and instructions.
|
||||
|
||||
Two boundaries hold regardless of what the harness does:
|
||||
|
||||
@@ -28,101 +27,99 @@ Two boundaries hold regardless of what the harness does:
|
||||
A harness is packaged as a Kit v3 image: an OCI image whose
|
||||
`vnd.docker.sandbox.kit.descriptor` manifest annotation declares what the
|
||||
harness needs. Archie reads descriptors with the published
|
||||
`github.com/docker/sandbox-kit-spec/v3/spec` package and does not maintain
|
||||
its own descriptor format. Published Kits run unmodified.
|
||||
`github.com/docker/sandbox-kit-spec/v3/spec` package and does not maintain its
|
||||
own descriptor format. Published Kits run unmodified.
|
||||
|
||||
Archie is a partial Kit runtime. It implements these capability types:
|
||||
|
||||
| Type | Archie behaviour |
|
||||
| ------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| `credential@1` | Proxy-managed only, described below. |
|
||||
| `network-policy@1` | Enforced by the egress proxy. |
|
||||
| `volume@1` | A Docker volume keyed by WorkflowExecution, deleted with it. |
|
||||
| `lifecycle@1` | Install and startup hooks run on container create. |
|
||||
| `agent-sessions@1` | The headless `prompt` and `resume` invocations for the stage. |
|
||||
| `agent-skills@1` | The operator's skills store (`skills_dir`), mounted read-only whatever the Kit asks. |
|
||||
| `agent-context@1` | The workload's profile file beside the workspace, indexing each Kit's guidance. |
|
||||
| `resources@1` | Container CPU and memory limits. |
|
||||
| Type | Archie behaviour |
|
||||
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `credential@1` | Proxy-managed only, described below. |
|
||||
| `network-policy@1` | Enforced by the egress proxy. |
|
||||
| `volume@1` | A Docker volume keyed by WorkflowExecution, deleted with it. |
|
||||
| `lifecycle@1` | Install and startup hooks run on container create. |
|
||||
| `agent-sessions@1` | The headless `prompt` and `resume` invocations for the stage. |
|
||||
| `agent-skills@1` | Discovery paths for bundled skills and optional shared skills; host access is always read-only. |
|
||||
| `agent-skill@1` | Selected image-bundled skills copied into the declared discovery paths. |
|
||||
| `agent-context@1` | The resolved discovery directory, defaulting beside the workspace; preserve instructions outside Archie-managed sections. |
|
||||
| `resources@1` | Container CPU and memory limits. |
|
||||
|
||||
Every other type fails closed: a required entry refuses the launch, an
|
||||
optional one is skipped and recorded on the step. `credential@1` with
|
||||
`passthrough: true` and any credential for a forge service are refused.
|
||||
Every other type fails closed: a required entry refuses the launch, an optional
|
||||
one is skipped and recorded on the step. `credential@1` with `passthrough: true`
|
||||
and any credential for a forge service are refused.
|
||||
|
||||
The operator's own setup (plugins, subagents, instructions, settings) is a
|
||||
mixin Kit, published with the harness Kit as a Kit set: the set merges their
|
||||
layers into one image. It is versioned image content, rewritten on every
|
||||
create, never state a run can modify.
|
||||
The operator's own setup (plugins, subagents, instructions, settings) is a mixin
|
||||
Kit, published with the harness Kit as a Kit set: the set merges their layers
|
||||
into one image. It is versioned image content, rewritten on every create, never
|
||||
state a run can modify.
|
||||
|
||||
## Contract
|
||||
|
||||
A harness run is a second implementation of `agentexec.Runner`. It takes the
|
||||
same `Request` and returns the same `Result`, so workflows, the daemon and
|
||||
the State Store do not know which runner ran a stage.
|
||||
same `Request` and returns the same `Result`, so workflows, the daemon and the
|
||||
State Store do not know which runner ran a stage.
|
||||
|
||||
`agent-sessions@1` supplies the invocation. Archie supplies, per CLI, an
|
||||
output adapter that translates the CLI's JSON output stream into
|
||||
`ToolCallReporter` calls, `Usage` and a session ID. A CLI with no adapter can
|
||||
run stages with no capture tools, reporting no usage; its token budget falls
|
||||
back to wall clock.
|
||||
`agent-sessions@1` supplies the invocation. Archie supplies, per CLI, an output
|
||||
adapter that translates the CLI's JSON output stream into `ToolCallReporter`
|
||||
calls, `Usage` and a session ID. A CLI with no adapter can run stages with no
|
||||
capture tools, reporting no usage; its token budget falls back to wall clock.
|
||||
|
||||
Workflow definition validation rejects, at load time, a stage whose needs the
|
||||
selected harness cannot meet: capture tools without an adapter, or a gate
|
||||
retry without a `resume` verb.
|
||||
selected harness cannot meet: capture tools without an adapter, or a gate retry
|
||||
without a `resume` verb.
|
||||
|
||||
## Selection
|
||||
|
||||
A harness is an agent profile. `docs/prds/event-automation.md` defines a
|
||||
profile as the execution environment a workflow selects; a harness profile
|
||||
names one Kit pinned by digest, a workload Kit or a published Kit set, in
|
||||
place of a container image. Archie runs that Kit's image and composes no Kits
|
||||
itself; a bare mixin is refused. Everything else about profiles
|
||||
holds: a workflow names its profile, a stage may name a different one, and a
|
||||
profile holds no secrets.
|
||||
A harness is an agent profile. `docs/prds/event-automation.md` defines a profile
|
||||
as the execution environment a workflow selects; a harness profile names one Kit
|
||||
pinned by digest, a workload Kit or a published Kit set, in place of a container
|
||||
image. Archie runs that Kit's image and composes no Kits itself; a bare mixin is
|
||||
refused. Everything else about profiles holds: a workflow names its profile, a
|
||||
stage may name a different one, and a profile holds no secrets.
|
||||
|
||||
`archie-agent` builds the stage's runner from the stage's profile: the
|
||||
ai-sdk agent loop for an image profile, the harness runner for a Kit
|
||||
profile. Image profiles, and every workflow already written against them,
|
||||
are unchanged. A Kit profile named by no workflow is a validation error.
|
||||
`archie-agent` builds the stage's runner from the stage's profile: the ai-sdk
|
||||
agent loop for an image profile, the harness runner for a Kit profile. Image
|
||||
profiles, and every workflow already written against them, are unchanged. A Kit
|
||||
profile named by no workflow is a validation error.
|
||||
|
||||
A stage naming a different profile than its workflow's is a separate run,
|
||||
not a mid-container runner switch: a Kit task runs in one container
|
||||
provisioned for one profile (Container layout), so a stage that needs a
|
||||
different one is its own callee, started the way `workflow.call` already
|
||||
starts one (`docs/prds/event-automation.md` "Workflows call workflows"),
|
||||
with its own agent profile resolved off its own task row. This needs no
|
||||
mechanism beyond `workflow.call` plus per-task profile resolution
|
||||
(`daemon.pinTaskProfile`), both of which already treat every task's
|
||||
profile independently of any caller's -- see
|
||||
A stage naming a different profile than its workflow's is a separate run, not a
|
||||
mid-container runner switch: a Kit task runs in one container provisioned for
|
||||
one profile (Container layout), so a stage that needs a different one is its own
|
||||
callee, started the way `workflow.call` already starts one
|
||||
(`docs/prds/event-automation.md` "Workflows call workflows"), with its own agent
|
||||
profile resolved off its own task row. This needs no mechanism beyond
|
||||
`workflow.call` plus per-task profile resolution (`daemon.pinTaskProfile`), both
|
||||
of which already treat every task's profile independently of any caller's -- see
|
||||
`TestWorkflowCallerConformance` (staterpc) for the callee's independent
|
||||
`Workflow` field and `TestWorkflowCallGivesACalleeItsOwnProfile` (daemon)
|
||||
for the Kit-vs-image runner selection that independence produces.
|
||||
`Workflow` field and `TestWorkflowCallGivesACalleeItsOwnProfile` (daemon) for
|
||||
the Kit-vs-image runner selection that independence produces.
|
||||
|
||||
Profiles are org resources in the State Store, so a Kit profile belongs to
|
||||
one org, is granted to its workspaces like any profile, and applies without
|
||||
a restart.
|
||||
Profiles are org resources in the State Store, so a Kit profile belongs to one
|
||||
org, is granted to its workspaces like any profile, and applies without a
|
||||
restart.
|
||||
|
||||
## Organisations
|
||||
|
||||
`docs/prds/orgs-and-access.md` is the boundary; a harness adds nothing that
|
||||
crosses it.
|
||||
|
||||
- A Kit profile, its credential bindings and its OAuth tokens belong to one
|
||||
org. No record is shared between orgs.
|
||||
- A Kit profile, its credential bindings and its OAuth tokens belong to one org.
|
||||
No record is shared between orgs.
|
||||
- A harness run is a run like any other: it acts as the workflow's identity,
|
||||
under the run credential issued at dispatch.
|
||||
- The egress proxy injects a credential only when the run credential carries
|
||||
the secret the binding names. A Kit that declares a service the identity is
|
||||
not granted gets no credential: a required one refuses the launch, an
|
||||
optional one is skipped.
|
||||
- A Kit's network policy is what the Kit asks for; the identity's network
|
||||
grants are what the org allows. The proxy enforces the intersection.
|
||||
- The egress proxy injects a credential only when the run credential carries the
|
||||
secret the binding names. A Kit that declares a service the identity is not
|
||||
granted gets no credential: a required one refuses the launch, an optional one
|
||||
is skipped.
|
||||
- A Kit's network policy is what the Kit asks for; the identity's network grants
|
||||
are what the org allows. The proxy enforces the intersection.
|
||||
- Concurrency slots are counted per binding within its org.
|
||||
|
||||
## Credentials
|
||||
|
||||
A credential binding maps a Kit's `credential@1` `service` name to an org
|
||||
secret, which the org grants to identities like any secret. The secret holds
|
||||
one of:
|
||||
secret, which the org grants to identities like any secret. The secret holds one
|
||||
of:
|
||||
|
||||
- **API key:** a value in the org's secret store.
|
||||
- **OAuth:** tokens captured by the setup terminal, stored in the State Store
|
||||
@@ -131,26 +128,26 @@ one of:
|
||||
|
||||
The egress proxy resolves the binding for each request against the run
|
||||
credential. The container gets the Kit's sentinel in the named variable or
|
||||
credential file. OAuth refresh happens at the proxy, which intercepts the
|
||||
Kit's `tokenEndpoint`, so a refreshed token is written to the State Store and
|
||||
never returned to the container.
|
||||
credential file. OAuth refresh happens at the proxy, which intercepts the Kit's
|
||||
`tokenEndpoint`, so a refreshed token is written to the State Store and never
|
||||
returned to the container.
|
||||
|
||||
Runs sharing an OAuth binding share its subscription's rate limit.
|
||||
`max_concurrent` on the binding (default 1) caps its simultaneous runs. A
|
||||
stage waiting for a slot is `pending`, not `running`.
|
||||
`max_concurrent` on the binding (default 1) caps its simultaneous runs. A stage
|
||||
waiting for a slot is `pending`, not `running`.
|
||||
|
||||
## Session contract
|
||||
|
||||
A **session** is a duplex PTY into a Kit container the daemon owns. One
|
||||
concept covers both targets; only the address, the lifetime and the
|
||||
established egress phase differ.
|
||||
A **session** is a duplex PTY into a Kit container the daemon owns. One concept
|
||||
covers both targets; only the address, the lifetime and the established egress
|
||||
phase differ.
|
||||
|
||||
| | Setup session | Run session (deferred) |
|
||||
| --- | --- | --- |
|
||||
| Address | `{org, profile}` | `{org, task, attempt}` |
|
||||
| Container | ephemeral, from the profile's Kit | the task's running container |
|
||||
| Purpose | run the CLI's own login so the proxy captures the tokens | watch and optionally take over |
|
||||
| Lifetime | bounded by the session TTL; the container is removed on close | bounded by the task |
|
||||
| | Setup session | Run session (deferred) |
|
||||
| --------- | ------------------------------------------------------------- | ------------------------------ |
|
||||
| Address | `{org, profile}` | `{org, task, attempt}` |
|
||||
| Container | ephemeral, from the profile's Kit | the task's running container |
|
||||
| Purpose | run the CLI's own login so the proxy captures the tokens | watch and optionally take over |
|
||||
| Lifetime | bounded by the session TTL; the container is removed on close | bounded by the task |
|
||||
|
||||
- **Transport.** The daemon serves `harness.v1.HarnessService`, a bidi gRPC
|
||||
stream, and the dashboard implements its `HarnessTerminal` interface
|
||||
@@ -160,118 +157,174 @@ established egress phase differ.
|
||||
`internal/app/archied` or `internal/agentexec`.
|
||||
- **Authorisation.** Opening a session is the `update` action on the secret,
|
||||
decided by the dashboard's authorizer before the route runs
|
||||
(`internal/webui/authorize.go`). The dashboard then dials the daemon with
|
||||
the harness service token. The daemon does not re-authorise a human; it
|
||||
trusts the asserted `{org, profile}` exactly as the task-action RPC trusts
|
||||
an asserted actor. Because that authority is a shell in a container holding
|
||||
an org's credential, the harness listener requires `HARNESS_TOKEN` even on
|
||||
loopback, unlike the State Store's loopback convention.
|
||||
- **Egress phase.** Token interception is filtered by phase
|
||||
(`oauth.go`'s `rule.runtime == atRun`), and `EnterRuntime` is one-way. A
|
||||
setup session therefore follows a run's lifecycle exactly: install hooks at
|
||||
the install phase, `EnterRuntime` before the shell. A credential whose
|
||||
token endpoint must be captured declares `phase: runtime`; a credential
|
||||
capturing at install phase is captured by the install hooks that run before
|
||||
the switch.
|
||||
- **Credentials.** Capture is gated: the proxy intercepts a token endpoint
|
||||
only for a service the session is granted (`Proxy.granted`). A setup session
|
||||
has no task, so the daemon registers a session grant: its proxy token
|
||||
resolves to `{org, the Kit's declared credential services the org binds}`.
|
||||
That is the intersection the `update`-on-secret authorisation covers. The
|
||||
real token never enters the container: the response is sentinelized and
|
||||
stored as the org's harness secret.
|
||||
- **Container discipline.** The setup container runs a keepalive entrypoint
|
||||
with an empty `Config.Env`; the PTY is an exec as the Kit's harness user
|
||||
with the harness env and nothing inherited from any worker. No worktree is
|
||||
mounted. It is acquired through the container pool, so it carries the
|
||||
`archie-daemon` label, the concurrency cap and the max-uptime reaper; the
|
||||
session TTL is the smaller bound. Closing revokes the egress session,
|
||||
removes the sandbox network and the Kit volumes, then releases the
|
||||
container.
|
||||
(`internal/webui/authorize.go`). The dashboard then dials the daemon with the
|
||||
harness service token. The daemon does not re-authorise an operator; it trusts the
|
||||
asserted `{org, profile}` exactly as the task-action RPC trusts an asserted
|
||||
actor. Because that authority is a shell in a container holding an org's
|
||||
credential, the harness listener requires `HARNESS_TOKEN` even on loopback,
|
||||
unlike the State Store's loopback convention.
|
||||
- **Egress phase.** Token interception is filtered by phase (`oauth.go`'s
|
||||
`rule.runtime == atRun`), and `EnterRuntime` is one-way. A setup session
|
||||
therefore follows a run's lifecycle exactly: install hooks at the install
|
||||
phase, `EnterRuntime` before the shell. A credential whose token endpoint must
|
||||
be captured declares `phase: runtime`; a credential capturing at install phase
|
||||
is captured by the install hooks that run before the switch.
|
||||
- **Credentials.** Capture is gated: the proxy intercepts a token endpoint only
|
||||
for a service the session is granted (`Proxy.granted`). A setup session has no
|
||||
task, so the daemon registers a session grant: its proxy token resolves to
|
||||
`{org, the Kit's declared credential services the org binds}`. That is the
|
||||
intersection the `update`-on-secret authorisation covers. The real token never
|
||||
enters the container: the response is sentinelized and stored as the org's
|
||||
harness secret.
|
||||
- **Container discipline.** The setup container runs a keepalive entrypoint with
|
||||
an empty `Config.Env`; the PTY is an exec as the Kit's harness user with the
|
||||
harness env and nothing inherited from any worker. No worktree is mounted. It
|
||||
is acquired through the container pool, so it carries the `archie-daemon`
|
||||
label, the concurrency cap and the max-uptime reaper; the session TTL is the
|
||||
smaller bound. Closing revokes the egress session, removes the sandbox network
|
||||
and the Kit volumes, then releases the container.
|
||||
- **Kit unavailable.** The daemon serves the contract only when it has a
|
||||
container pool and a Kit launcher; otherwise there is no listener, and a
|
||||
client's refused connection is gRPC's `Unavailable`. The dashboard's
|
||||
existing failure surface is the honest degrade; `/api/harness`'s `terminal`
|
||||
field means "a client is configured", not "the daemon can run a Kit".
|
||||
- **Run target.** Deferred (`archie-core-qi91`). `Open` answers `Unimplemented`
|
||||
for it in the setup slice. A finished or absent attempt will be `NotFound`,
|
||||
not `Unavailable`.
|
||||
- **Audit.** Opening and closing a session and a successful capture are
|
||||
recorded with the asserted org and profile.
|
||||
client's refused connection is gRPC's `Unavailable`. The dashboard's existing
|
||||
failure surface is the honest degrade; `/api/harness`'s `terminal` field means
|
||||
"a client is configured", not "the daemon can run a Kit".
|
||||
- **Run target.** `RunTarget{task_id, attempt}` opens a read-only view of a
|
||||
running task's sandbox; it ships as the peek. The daemon resolves the pair
|
||||
itself, so the dashboard never learns a container name: the task store says
|
||||
whether the task is `running` and which attempt is current, and the Kit
|
||||
launcher names the container `kitrun.TaskContainer(task_id, attempt)` (one
|
||||
container per attempt, removed when the run ends; volumes remain task-scoped
|
||||
for retries). A finished or unknown task, a task that is not running, an
|
||||
attempt other than the running one, or a container that is gone is `NotFound`
|
||||
with the reason in the message; an unreachable task store or container engine
|
||||
is `Unavailable`. The view follows the container's stdout and stderr,
|
||||
including the harness output forwarded by the worker, carries no stdin and no
|
||||
exec, and ends when the task's container ends or the client leaves, so it
|
||||
confers no authority over the container. A read-only tail of the existing
|
||||
per-attempt logs was rejected: those refresh only on task state changes and
|
||||
are the daemon's account, not the sandbox's. Mid-stream failures are shown as
|
||||
a reason in the terminal before it closes.
|
||||
- **Authorisation.** The dashboard route `GET /api/tasks/{id}/sandbox` is
|
||||
decided as `read-logs` on the task before the handler runs, so a caller sees
|
||||
a sandbox exactly when they may read that task's log. The daemon checks that
|
||||
the task belongs to the asserted org before following output.
|
||||
- **Grants.** The view takes no grant of its own. The run's egress session
|
||||
(its proxy token, install then `EnterRuntime`) already belongs to the run
|
||||
and is revoked by `Launcher.Release` when the task ends; the view reads
|
||||
after that phase switch and dies with the container.
|
||||
- **Credentials.** The sandbox holds sentinels, never real credentials: API
|
||||
keys are `egress.Sentinel` (`credentials.go`), and an OAuth token set is
|
||||
sentinelised in the response and swapped back by the proxy only on a granted
|
||||
service's resource host in the matching phase (`oauth.go`, `injectOAuth`).
|
||||
The proxy runs in the daemon outside the container, so a shell in the
|
||||
container sees only sentinels.
|
||||
- **Takeover (interactive PTY into a running task) is out of scope for this
|
||||
issue.** It needs the dangerous-command authority (#1574) to
|
||||
gate it, and that authority is not wired for it: the harness listener has no
|
||||
approval step; `ToolSetOptions.Approval` in `internal/agentexec/modelloop`
|
||||
is never set by a caller, so task runs never build approval-required tools;
|
||||
approvals reach an operator only on the chat paths (dashboard ask, Telegram,
|
||||
Gateway). Takeover would also need an audit record naming the actor, task,
|
||||
attempt and open/close times, and revocation tied to task end (the exec is
|
||||
closed with the container). Those follow the setup session's shape
|
||||
(`harnesssession.Session`, `container.ExecPTY`) once the authority exists.
|
||||
- **Audit.** Opening and closing a session and a successful capture are recorded
|
||||
with the asserted org and profile. A run view's open and close are logged with
|
||||
the task and attempt; it reads output only, so it has no takeover record.
|
||||
|
||||
Each session is the only interactive path into a harness container.
|
||||
|
||||
## Egress
|
||||
|
||||
Only Kit profiles run on the egress path. An image profile keeps the network
|
||||
access its identity is granted, because workflows such as a network
|
||||
investigator need raw DNS, ICMP and arbitrary TCP that no HTTP proxy
|
||||
carries.
|
||||
access its identity is granted, because workflows such as a network investigator
|
||||
need raw DNS, ICMP and arbitrary TCP that no HTTP proxy carries.
|
||||
|
||||
- **Sandbox network.** Each Kit run gets its own internal Docker bridge on
|
||||
which the host holds no address. Host services, including those listening
|
||||
on every interface, are unreachable from it by any address.
|
||||
- **Sandbox network.** Each Kit run gets its own internal Docker bridge on which
|
||||
the host holds no address. Host services, including those listening on every
|
||||
interface, are unreachable from it by any address.
|
||||
- **Relay.** One relay container, `archie-agent relay`, sits on the sandbox
|
||||
networks under a fixed alias and on the host-reachable network. It
|
||||
forwards three fixed ports, to the proxy, NATS and the State Store, and can
|
||||
reach nothing else. It holds no secrets.
|
||||
- **Proxy.** The proxy runs inside `archied`, listening on the host gateway
|
||||
of the host-reachable network. It terminates TLS with a per-daemon CA
|
||||
installed into the container at create, identifies the container by a
|
||||
per-run proxy token, and applies that run's network policy and credential
|
||||
inject rules. Upstream dials refuse loopback, and refuse internal addresses
|
||||
unless the policy names the exact IP, so an allowed name cannot resolve
|
||||
back into the host.
|
||||
networks under a fixed alias and on the host-reachable network. It forwards
|
||||
three fixed ports, to the proxy, NATS and the State Store, and can reach
|
||||
nothing else. It holds no secrets.
|
||||
- **Proxy.** The proxy runs inside `archied`, listening on the host gateway of
|
||||
the host-reachable network. It terminates TLS with a per-daemon CA installed
|
||||
into the container at create, identifies the container by a per-run proxy
|
||||
password distinct from the worker's run grant, and applies that run's network
|
||||
policy and credential inject rules. Upstream dials refuse loopback, and refuse
|
||||
internal addresses unless the policy names the exact IP, so an allowed name
|
||||
cannot resolve back into the host.
|
||||
|
||||
## Container layout
|
||||
|
||||
A Kit task runs in one container, from the Kit composition's image, on the
|
||||
task's sandbox network. The worker and every harness invocation share it;
|
||||
they are separated by user, not by container, so a run's cost scales with
|
||||
the run and not with how many agents it fans out to.
|
||||
task's sandbox network. The worker and every harness invocation share it; they
|
||||
are separated by user, not by container, so a run's cost scales with the run and
|
||||
not with how many agents it fans out to.
|
||||
|
||||
- **Worker.** Archie mounts its own `archie-agent` binary read-only and runs
|
||||
it as the container's entrypoint, as root. It holds the task's NATS and
|
||||
State Store credentials in its own environment and in root-only files,
|
||||
runs the workflow, and serves `archie-agent mcp`. The Kit image's
|
||||
entrypoint is not PID 1.
|
||||
- **Worker.** Archie mounts its own `archie-agent` binary read-only and runs it
|
||||
as the container's entrypoint, as root. It holds the task's NATS and State
|
||||
Store credentials in its own environment and in root-only files, runs the
|
||||
workflow, and serves `archie-agent mcp`. The Kit image's entrypoint is not
|
||||
PID 1.
|
||||
- **Harness.** Every invocation runs as the Kit's user (the image's `User`,
|
||||
default uid 1000) with an explicit environment: the Kit's variables, the
|
||||
proxy environment and the credential sentinels, and nothing inherited from
|
||||
the worker. That user cannot read the worker's environment or files, or
|
||||
trace it. Sibling invocations in one run share the user and the worktree.
|
||||
default uid 1000) with an explicit environment: the Kit's variables, the proxy
|
||||
environment and the credential sentinels, and nothing inherited from the
|
||||
worker. That user cannot read the worker's environment or files, or trace it.
|
||||
Sibling invocations in one run share the user and the worktree.
|
||||
- **Hooks.** `lifecycle@1` install and startup hooks run as the user each
|
||||
declares, before the worker accepts work.
|
||||
- **Mounts.** The task worktree at the Kit's workspace directory, owned by the
|
||||
Kit's user, and the read-only skills store. Nothing else from the host.
|
||||
- **Network.** The relay forwards three fixed ports on the sandbox network:
|
||||
the egress proxy, NATS and the State Store. The worker reaches NATS and the
|
||||
State Store with its credentials; a harness can open those ports but holds
|
||||
no credential either accepts.
|
||||
- **Volumes.** `volume@1` paths persist for the life of the
|
||||
WorkflowExecution, which covers session resume across gate iterations and
|
||||
retries. They are not shared between executions.
|
||||
- **Network.** The relay forwards three fixed ports on the sandbox network: the
|
||||
egress proxy, NATS and the State Store. The worker reaches NATS and the State
|
||||
Store with its credentials; a harness can open those ports but holds no
|
||||
credential either accepts.
|
||||
- **Volumes.** `volume@1` paths persist for the life of the WorkflowExecution,
|
||||
which covers session resume across gate iterations and retries. They are not
|
||||
shared between executions.
|
||||
|
||||
## Archie tools inside the harness
|
||||
|
||||
Capture tools, which are how a stage returns structured results, are served
|
||||
by `archie-agent mcp`, a stdio MCP server registered through the Kit's MCP
|
||||
configuration or the adapter's flags. It serves the stage's `CaptureTools`
|
||||
and the central tools the agent profile's `AllowTools` permits, never the
|
||||
`workspace` toolset. The runner's `ToolLimits` bound its results; the
|
||||
harness's own built-in tools are outside archie's limits.
|
||||
Capture tools return a stage's structured results through `archie-agent mcp`, a
|
||||
stdio MCP server. The same command forwards central-tool discovery and calls
|
||||
over Streamable HTTP to `http://archie.tools/mcp` through the egress proxy.
|
||||
Claude Code, Codex, Pi, OMP and GitHub Copilot CLI register it using their
|
||||
native MCP configuration. Registration files are per-stage and outside the
|
||||
worktree; the Kit's bundled settings remain intact. A CLI that exits without
|
||||
initializing the required MCP server fails the stage.
|
||||
|
||||
`archied` handles that exact endpoint inside the authenticated task proxy; it is
|
||||
not a listener or an upstream network destination. It is available only during
|
||||
task runtime, never during install or a setup session. The harness supplies a
|
||||
sentinel, and the proxy injects a separate random gateway token held only on the
|
||||
host. Ending the proxy session revokes that token and cancels active calls.
|
||||
|
||||
The proxy reaches `archie-gateway` through its authenticated gRPC contract. The
|
||||
Gateway derives the task, execution principal and org from a live run grant on
|
||||
every request. Its tool list is bounded by the profile in that org and the
|
||||
package's accepted tool authority, checked again at invocation. Workspace tools,
|
||||
chat file delivery, conversation-only tools and tools that require an
|
||||
unavailable approver are not served. Tool result limits apply without exposing
|
||||
host spill paths; media is returned as MCP content.
|
||||
|
||||
Task MCP providers run in the Gateway with task-bound sessions and sampling.
|
||||
Sampling uses the task's model and credentials, records task usage and refuses
|
||||
revoked grants. It does not use the chat identity or chat model. The worker does
|
||||
not start another copy of those providers for Kit tasks. The harness's own
|
||||
built-in tools remain outside Archie's tool-result limits.
|
||||
|
||||
## Enforcement around the harness
|
||||
|
||||
| Property | Enforcement |
|
||||
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Property | Enforcement |
|
||||
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Model never runs git | No forge credential can be bound. Archie records `HEAD` and every ref before the run; any change fails the step (`failed`, policy class). The workflow commits the stage's changes. |
|
||||
| Protected paths | A diff touching a `Protection` path fails the step. |
|
||||
| Read-only stage | Any worktree diff fails the step. |
|
||||
| Gate | Archie runs the stage's gate after the harness exits. On failure it resumes the session with the gate output, up to the stage's iteration budget. |
|
||||
| Budget | Archie kills the process on wall-clock timeout, or when streamed usage passes the token budget. |
|
||||
| Cancellation | Cancelling the step kills the process group, then the container. |
|
||||
| Egress | Only the proxy is reachable; the Kit's network policy decides the rest. |
|
||||
| Protected paths | A diff touching a `Protection` path fails the step. |
|
||||
| Read-only stage | Any worktree diff fails the step. |
|
||||
| Gate | Archie runs the stage's gate after the harness exits. On failure it resumes the session with the gate output, up to the stage's iteration budget. |
|
||||
| Budget | Archie kills the process on wall-clock timeout, or when streamed usage passes the token budget. |
|
||||
| Cancellation | Cancelling the step kills the process group, then the container. |
|
||||
| Egress | Only the proxy is reachable; the Kit's network policy decides the rest. |
|
||||
|
||||
Harness settings that deny git or protected paths are added where the CLI
|
||||
supports them, to save wasted turns. They are never the enforcement.
|
||||
@@ -279,38 +332,34 @@ supports them, to save wasted turns. They are never the enforcement.
|
||||
## Execution tree
|
||||
|
||||
A harness run is one `agent` StepExecution. Subagents the harness spawns
|
||||
internally are not recorded as children. Their usage is included in the
|
||||
step's `tokens_used` when the adapter reports it.
|
||||
internally are not recorded as children. Their usage is included in the step's
|
||||
`tokens_used` when the adapter reports it.
|
||||
|
||||
## Agents never hold a harness
|
||||
|
||||
An Agent reaches a harness only by invoking a Workflow whose stage names it.
|
||||
No Agent tool, chat tool or capability exposes a harness, its setup terminal
|
||||
or its credential. The stage boundary is what carries the container, the git
|
||||
and path checks, the gate and the budget; a harness outside a stage has none
|
||||
of them.
|
||||
An Agent reaches a harness only by invoking a Workflow whose stage names it. No
|
||||
Agent tool, chat tool or capability exposes a harness, its setup terminal or its
|
||||
credential. The stage boundary is what carries the container, the git and path
|
||||
checks, the gate and the budget; a harness outside a stage has none of them.
|
||||
|
||||
## Out of scope
|
||||
|
||||
- Chat through a harness. The gateway chat loop stays on the built-in
|
||||
runtime.
|
||||
- `network-policy@2` HTTP method and path rules; a Kit requiring it is
|
||||
refused.
|
||||
- Chat through a harness. The gateway chat loop stays on the built-in runtime.
|
||||
- `network-policy@2` HTTP method and path rules; a Kit requiring it is refused.
|
||||
- Recording the harness's internal subagents as StepExecutions.
|
||||
- Cost in currency.
|
||||
- Choosing a harness automatically per task.
|
||||
|
||||
## Plan
|
||||
|
||||
1. Descriptor resolution with the Kit spec package; capability support
|
||||
table and fail-closed refusal.
|
||||
1. Descriptor resolution with the Kit spec package; capability support table and
|
||||
fail-closed refusal.
|
||||
2. Egress proxy: internal network, per-daemon CA, per-container token,
|
||||
`network-policy@1`.
|
||||
3. `credential@1`: API-key bindings, sentinel rendering, inject rules.
|
||||
4. Harness `Runner`: container create with worktree, volumes, lifecycle
|
||||
hooks and the mounted `archie-agent`; `agent-sessions@1` invocation;
|
||||
worktree checks for git, protected paths and read-only; budget and
|
||||
cancellation.
|
||||
4. Harness `Runner`: container create with worktree, volumes, lifecycle hooks
|
||||
and the mounted `archie-agent`; `agent-sessions@1` invocation; worktree
|
||||
checks for git, protected paths and read-only; budget and cancellation.
|
||||
5. Claude Code output adapter; `archie-agent mcp`; gate-and-resume loop.
|
||||
6. Kit profiles, runner selection from the stage's profile, and definition
|
||||
validation.
|
||||
@@ -320,8 +369,19 @@ of them.
|
||||
|
||||
## Verification
|
||||
|
||||
- The same workflow definition completes on `builtin` and on the Claude Code
|
||||
Kit with the same `Result` shape and captures.
|
||||
- Every named adapter discovers and calls a permitted central tool through the
|
||||
proxy and records a local capture. A guessed tool outside the profile or
|
||||
accepted package authority is refused.
|
||||
- The gateway token never appears in the container, generated MCP files,
|
||||
worktree, logs or events. It is not the container's proxy password.
|
||||
- A permission change after discovery takes effect at the next call; ending the
|
||||
proxy session cancels active calls, and a revoked grant cannot execute tools
|
||||
or sample a model.
|
||||
- Bundled skills remain visible with shared skills missing or disabled; shared
|
||||
mounts are per-skill and read-only. Explicit context directories preserve
|
||||
non-managed instructions and refuse symlinked staging paths.
|
||||
- The same workflow definition completes on `builtin` and on the Claude Code Kit
|
||||
with the same `Result` shape and captures.
|
||||
- After `/login` in the setup terminal, the container's credential file holds
|
||||
only sentinels, the State Store holds the encrypted token, and a task run
|
||||
authenticates.
|
||||
@@ -333,8 +393,8 @@ of them.
|
||||
unchanged.
|
||||
- A harness edit to a protected test file fails the step in a TDD fix stage.
|
||||
- A read-only feasibility stage that writes a file fails.
|
||||
- A file a run writes into a Kit-managed path such as the CLI's settings file
|
||||
is gone on the next execution.
|
||||
- A file a run writes into a Kit-managed path such as the CLI's settings file is
|
||||
gone on the next execution.
|
||||
- A Kit requiring an unsupported capability is refused at launch with the
|
||||
capability named.
|
||||
- A stage with a failing gate resumes the same session with the gate output,
|
||||
@@ -342,11 +402,11 @@ of them.
|
||||
- Two tasks sharing an OAuth binding with `max_concurrent = 1` run one at a
|
||||
time; the second waits as `pending`.
|
||||
- Stopping a run kills the harness process and removes the container.
|
||||
- A harness invocation cannot read the worker's NATS or State Store
|
||||
credential from its environment, its files or `/proc`.
|
||||
- A harness invocation cannot read the worker's NATS or State Store credential
|
||||
from its environment, its files or `/proc`.
|
||||
- A run fanning out to many agent invocations uses one container.
|
||||
- A Kit profile in org A cannot be selected, and its binding cannot be
|
||||
resolved, by a workflow in org B.
|
||||
- A Kit profile in org A cannot be selected, and its binding cannot be resolved,
|
||||
by a workflow in org B.
|
||||
- A harness run whose identity is not granted a Kit's required credential is
|
||||
refused at launch; the proxy never injects a secret outside the run
|
||||
credential.
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
# User authorization boundaries
|
||||
|
||||
Archie separates authentication (which person or service is calling) from
|
||||
permission to act on a resource. This inventory follows the
|
||||
[OWASP Authentication Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)
|
||||
and
|
||||
[Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html),
|
||||
including its guidance on attributes and relationships. It describes concrete
|
||||
enforcement points and their regression tests; it is not a compliance
|
||||
certification.
|
||||
|
||||
## Transport and authority
|
||||
|
||||
The browser uses HTTP/JSON and SSE to the UI service. The UI service calls State
|
||||
Store, Gateway, Messaging and Harness through their gRPC contracts. Only the
|
||||
State Store opens the task/control-plane/account database; Gateway owns
|
||||
conversation storage. Browser HTTP handlers never open either database.
|
||||
|
||||
Instance service credentials are administrative authority. They are not user
|
||||
sessions and must never reach a browser, model, or agent container. A service
|
||||
forwarding a principal preserves attribution and tenant scope; forwarding alone
|
||||
does not mean every internal RPC evaluates Cedar. Most internal RPCs trust the
|
||||
authenticated service and enforce their own resource scope. The public HTTP
|
||||
boundary evaluates Cedar before invoking them. Task credentials have a separate,
|
||||
explicit RPC allowlist and cannot call account or identity administration.
|
||||
|
||||
Local service listeners are trusted process boundaries. Loopback is not a
|
||||
substitute for authentication on a remotely reachable listener. OIDC
|
||||
credentials, local browser sessions, personal API tokens, service credentials,
|
||||
and task grants must remain distinct.
|
||||
|
||||
## Policy and relationship model
|
||||
|
||||
`internal/domain/access` defines actions, resources, principals and memberships.
|
||||
`internal/infrastructure/access` assembles Cedar entities and evaluates the
|
||||
instance → organization → workspace → object chain. A forbid wins; each
|
||||
applicable level must permit the operation. Missing or invalid policy chains
|
||||
fail closed.
|
||||
|
||||
The default policies grant actions through scoped roles. Policies can also
|
||||
restrict a named identity, workspace environment, owner, state, source address,
|
||||
signature, run or step. HTTP task decisions now include the stored initiating
|
||||
identity and task state; binding decisions include the stored binding state. The
|
||||
HTTP source address is the actual connection peer, not an unverified forwarded
|
||||
header. Membership and resource attributes must come from stored records or
|
||||
authenticated context, never a request's assertion about itself.
|
||||
|
||||
Cedar permission is not ownership of another person's private data. Conversation
|
||||
history, passkeys, recovery codes and personal tokens are bound to the person.
|
||||
An organization or instance admin role does not override those relationships.
|
||||
Account creation uses `manage_members` policy rather than a hard-coded admin
|
||||
role. Authenticating through OIDC does not automatically grant membership, link
|
||||
accounts by unverified email, or create an administrator.
|
||||
|
||||
## Enforcement inventory
|
||||
|
||||
| Location | Enforcement | Regression evidence |
|
||||
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Browser credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person when accounts are enabled. No API data before authentication. | `TestAccountBoundary`, `TestAccountSessionFailureIsClosed` |
|
||||
| Browser policy gate: `webui/authorize.go` | Resolve principal from stored identity; evaluate action against stored org/workspace and resource kind before handler. Missing chain refuses. | `TestHTTPPolicyCannotBeBypassed`, `TestAuthorizeRefusesWithoutAChain`, `TestAuthorizeRecord`, `TestTaskAuthorizationUsesStoredAttributes`, `TestAuthorizeCreateIn` |
|
||||
| Instance-only HTTP surfaces: `webui/instance_only.go`, server route registration | Hide instance-owned configuration and diagnostics from another org; policy still applies first. | `TestInstanceOnlyHidesTheInstanceFromOtherOrgs`, `TestInstanceAdminOrgs` |
|
||||
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organization, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
|
||||
| Account creation: `webui/accounts.go`, `staterpc/accounts.go`, `postgres/accounts.go` | Cedar `manage_members` at HTTP and RPC; target org is authenticated context. New local accounts cannot request owner role. | `TestAccountManagementUsesPolicy`, `TestAccountBoundary` |
|
||||
| Local passwords and sessions: `identity/password.go`, `postgres/accounts.go` | Argon2id, independent salts, length/common-password checks, generic login refusal, account throttling, session hashes and expiry, revocation on logout/password change/suspension. | `TestPasswordVerification`, `TestAccountBoundary`; disposable PostgreSQL session verification |
|
||||
| Transport and CSRF: `webui/accounts.go`, `api_tasks.go` | Password/account mutations require HTTPS or localhost development, JSON, custom CSRF header and same-origin requests. Forwarded headers require explicit trusted-proxy configuration. | `TestAuthenticationTransport`, existing mutation security tests |
|
||||
| Personal account routes: `webui/accounts.go` | Active signed-in person; principal supplied by server. Password change verifies current password. Sensitive authenticator changes require recent sign-in. No caller-supplied target identity. | `TestAccountBoundary` |
|
||||
| Recovery: `postgres/account_security.go`, `webui/accounts.go` | Fresh authenticated owner generates a hashed, one-use recovery secret. Redemption replaces password and revokes all sessions atomically. No email-existence disclosure. | Disposable PostgreSQL recovery verification |
|
||||
| Passkeys: `postgres/passkeys.go`, `webui/passkeys.go` | Configured RP origin, browser-bound one-use expiring challenge, verified credential signature and user verification. Enrollment/management belong to caller. Credential counters persist under a row lock. | Disposable browser virtual-authenticator verification; task-grant denial tests |
|
||||
| OIDC: `infrastructure/oidc`, `archieui/account_oidc.go`, `webui/auth.go` | Discovery and signed ID token with issuer/client audience/expiry, PKCE, state and nonce. Verified subject resolves to active identity. Browser-local session cannot outlive provider token, and provider credential remains checked. | `TestBrowserFlowVerifiesIDToken`, `TestProviderOutageIsUnavailableThenRecovers`, subject-claim tests; no external provider acceptance implied |
|
||||
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. Public URL cannot change while enrolled passkeys would be orphaned. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
|
||||
| Org membership/workspaces/agent assignment: `webui/api_orgs.go`, `staterpc/orgs.go`, `postgres/orgs.go` | Own org or instance-owner relationship, allowed role vocabulary, membership escalation/last-owner guards, tenant-scoped SQL. | `TestOrgRPCsActInTheCallersOrg`, `TestSetMembershipRefusesUnknownRole`, org HTTP tests |
|
||||
| Personal API tokens: `webui/api_personal_tokens.go`, `staterpc/personal_tokens.go`, `postgres/personal_tokens.go` | Token owner comes from principal; store only token hash; revoke only caller's binding. | `TestPersonalTokensWithoutPerson`, `TestPersonalTokenOwner` |
|
||||
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. Task grant metadata is stripped. | `TestCallerAttribution` |
|
||||
| Agent/task gRPC: `staterpc/task_grants.go` | Durable task-scoped grant, explicit allowed RPC and target task, no definition-pin replacement, no account RPCs. | `TestTaskCredentialsCannotManageAccounts`, `TestTaskCredentialCannotReplaceItsPin`, `TestRecordUsageAuthority`, `TestWorkerPresenceAuthority` |
|
||||
| Chat HTTP: `webui/api_chat.go` | Server stamps sender and person thread; lists/read/turns/cancel/persona verify session ownership. Browser cannot submit another sender identity. | `TestWebChatOwnership`, `TestWebChatSenderCannotBeSuppliedByBrowser`; HTTP deny matrix |
|
||||
| Chat history, slash commands and model session tools: `gateway/session_store_postgres.go` | Store filters `Get`, `List`, `GetByChannel`; shared read/write guards check person ownership as well as org. A saved session cannot change its conversation source to claim another person's history. Service curation runs without a person principal. | `TestSessionVisibility`; PostgreSQL smoke for history isolation |
|
||||
| Chat questions/approvals: `webui/api_chat_ask.go` | Waiting question is bound to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
|
||||
| Chat downloads: `webui/api_chat_files.go` | Offered file token expires and is bound to the initiating person; requests cannot supply a filesystem path. | `TestChatFileDownload` |
|
||||
| Per-person memory: `archiegateway/chat_identity.go`, gateway memory tools, `sessioncurator` | Verified web sender identity scopes reads/writes. Curator refuses unidentified or mixed participants instead of guessing a person. | Gateway memory and session-curator tests |
|
||||
| Workflow/task actions: `webui/api_tasks.go`, `domain/taskactions`, `staterpc` | Policy and stored workspace before action; domain transition, authority and durable dispatch guards remain in force. | HTTP deny matrix, task action/domain tests, task grant tests |
|
||||
| Incoming webhooks: `forge/webhook`, `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. No browser-user credential is inferred. | Webhook/capture tests, `TestAuthorizeDelivery` |
|
||||
| Control-plane configuration, secrets, harness and extensions | Browser policy and instance-only restrictions where registered; service contracts carry principal/org; task grants cannot invoke administrative RPCs. | HTTP deny matrix, `TestAdministrationRoutes`, `TestChannelReloadRoute`, `TestConfineHarnessOrg` |
|
||||
| Audit feed: `webui/api_audit.go`, `domain/audit` | `read_audit` on the `audit` resource; org scope and the instance-wide exception come from the authenticated principal, never the query string. Export carries the same grant, needs an explicit range of at most a year, and is rate-limited per identity, one at a time. Redaction runs in the State Store adapter before an entry crosses gRPC. | `TestReadAuditRoleBoundary`, `TestAuditRoutesFollowTheReadAuditRole`, `TestHTTPPolicyCannotBeBypassed`, `TestAuditErrorMapping`, `TestAuditCSVCellNeutralisesFormulas` |
|
||||
| Live HTTP/SSE and diagnostics | Authenticated policy gate applies before stream creation; org-scoped event reads; instance logs require administrative visibility. | HTTP deny matrix, instance-only tests, `TestServiceLogsRequireInstanceCredential` |
|
||||
| Background schedules, dispatch, curation | Service/agent authority, not an implicit browser user. Task-scoped grants and org scopes remain distinct from initiating operator attribution. | Existing dispatch, grant, memory and org-scope tests |
|
||||
|
||||
The policy HTTP matrix enumerates each registered protected route. It checks
|
||||
both anonymous refusal and refusal by an explicit Cedar forbid, using the real
|
||||
handler stack. Separate tests exercise allowed requests and personal ownership;
|
||||
a denied-request matrix alone is not proof that a workflow works end to end.
|
||||
|
||||
## Public and personal routes
|
||||
|
||||
Public protocol entry points are `GET /api/auth/status`, `POST /api/auth/setup`,
|
||||
`POST /api/auth/login`, `POST /api/auth/logout`, `POST /api/auth/recover`,
|
||||
`POST /api/auth/passkey/begin`, `POST /api/auth/passkey/finish`,
|
||||
`GET /oauth2/login`, `GET /oauth2/callback`, health probes and signed webhook
|
||||
intake. Each has its own protocol checks. Static embedded app assets are public;
|
||||
they do not contain user data. `/health/detailed` remains protected.
|
||||
|
||||
Personal routes under `/api/account/` require an active signed-in person and
|
||||
server-derived ownership: password change, recovery-secret generation, passkey
|
||||
begin/finish/list/delete. They do not require an organization administrator
|
||||
role. `POST /api/accounts` and `/api/authentication` are administrative policy
|
||||
routes.
|
||||
|
||||
## HTTP route inventory
|
||||
|
||||
The following routes are covered by `TestHTTPPolicyCannotBeBypassed` in
|
||||
`internal/webui/authorization_surfaces_test.go`. `authorize.go` maps each to its
|
||||
action/resource; the handler may impose a stricter record or instance boundary.
|
||||
|
||||
| Method | Route example |
|
||||
| ------ | ----------------------------------------------------- |
|
||||
| DELETE | `/api/access/policies` |
|
||||
| DELETE | `/api/bindings/7` |
|
||||
| DELETE | `/api/event-types/7` |
|
||||
| DELETE | `/api/extensions/sample` |
|
||||
| DELETE | `/api/mappings/7` |
|
||||
| DELETE | `/api/orgs/7/members/sample` |
|
||||
| DELETE | `/api/sources/sample` |
|
||||
| DELETE | `/api/tokens/7` |
|
||||
| GET | `/api/access/policies` |
|
||||
| GET | `/api/alerts` |
|
||||
| GET | `/api/audit` |
|
||||
| GET | `/api/audit/export` |
|
||||
| GET | `/api/authentication` |
|
||||
| GET | `/api/bindings` |
|
||||
| GET | `/api/bindings/7` |
|
||||
| GET | `/api/bindings/7/dispatches` |
|
||||
| GET | `/api/capabilities` |
|
||||
| GET | `/api/captures` |
|
||||
| GET | `/api/captures/7/dispatches` |
|
||||
| GET | `/api/channels` |
|
||||
| GET | `/api/chat/file/sample` |
|
||||
| GET | `/api/chat/sessions` |
|
||||
| GET | `/api/chat/sessions/7/messages` |
|
||||
| GET | `/api/chat/sessions/7/turns` |
|
||||
| GET | `/api/chat/update` |
|
||||
| GET | `/api/config` |
|
||||
| GET | `/api/control-plane/apply-status` |
|
||||
| GET | `/api/control-plane/catalog` |
|
||||
| GET | `/api/control-plane/resources/sample` |
|
||||
| GET | `/api/control-plane/resources/sample/history` |
|
||||
| GET | `/api/curators` |
|
||||
| GET | `/api/event-types` |
|
||||
| GET | `/api/extensions` |
|
||||
| GET | `/api/extensions/catalogue` |
|
||||
| GET | `/api/harness/bindings` |
|
||||
| GET | `/api/harness/terminal` |
|
||||
| GET | `/api/identities` |
|
||||
| GET | `/api/logs` |
|
||||
| GET | `/api/mappings` |
|
||||
| GET | `/api/mappings/7` |
|
||||
| GET | `/api/orgs` |
|
||||
| GET | `/api/orgs/7` |
|
||||
| GET | `/api/orgs/7/members` |
|
||||
| GET | `/api/orgs/7/workspaces` |
|
||||
| GET | `/api/secret-engines` |
|
||||
| GET | `/api/services` |
|
||||
| GET | `/api/setup` |
|
||||
| GET | `/api/skills` |
|
||||
| GET | `/api/sources` |
|
||||
| GET | `/api/stream` |
|
||||
| GET | `/api/summary` |
|
||||
| GET | `/api/task-meta` |
|
||||
| GET | `/api/tasks` |
|
||||
| GET | `/api/tasks/7` |
|
||||
| GET | `/api/tasks/7/attempts` |
|
||||
| GET | `/api/tasks/7/changes` |
|
||||
| GET | `/api/tasks/7/debug` |
|
||||
| GET | `/api/tasks/7/dispatches` |
|
||||
| GET | `/api/tasks/7/logs` |
|
||||
| GET | `/api/tasks/7/logs/download` |
|
||||
| GET | `/api/tasks/7/sandbox` |
|
||||
| GET | `/api/tokens` |
|
||||
| GET | `/api/version` |
|
||||
| GET | `/api/workflows` |
|
||||
| PATCH | `/api/bindings/7` |
|
||||
| PATCH | `/api/mappings/7` |
|
||||
| POST | `/api/accounts` |
|
||||
| POST | `/api/alerts/7/dismiss` |
|
||||
| POST | `/api/bindings` |
|
||||
| POST | `/api/bindings/7/approve` |
|
||||
| POST | `/api/bindings/7/pause` |
|
||||
| POST | `/api/bindings/7/resume` |
|
||||
| POST | `/api/channels/7/reload` |
|
||||
| POST | `/api/chat/answer` |
|
||||
| POST | `/api/chat/cancel` |
|
||||
| POST | `/api/chat/message` |
|
||||
| POST | `/api/chat/persona` |
|
||||
| POST | `/api/chat/stream` |
|
||||
| POST | `/api/chat/update/defer` |
|
||||
| POST | `/api/chat/update/install` |
|
||||
| POST | `/api/control-plane/resources/sample/commands/sample` |
|
||||
| POST | `/api/event-types` |
|
||||
| POST | `/api/extensions` |
|
||||
| POST | `/api/extensions/catalogue/sample/install` |
|
||||
| POST | `/api/extensions/sample/accept` |
|
||||
| POST | `/api/extensions/sample/approve-update` |
|
||||
| POST | `/api/extensions/sample/rollback` |
|
||||
| POST | `/api/extensions/sample/update` |
|
||||
| POST | `/api/identities` |
|
||||
| POST | `/api/identities/7/sample` |
|
||||
| POST | `/api/mappings` |
|
||||
| POST | `/api/mappings/preview` |
|
||||
| POST | `/api/orgs` |
|
||||
| POST | `/api/orgs/7/members` |
|
||||
| POST | `/api/orgs/7/workspaces` |
|
||||
| POST | `/api/secret-references/check` |
|
||||
| POST | `/api/sources` |
|
||||
| POST | `/api/sources/sample/approve-unsigned` |
|
||||
| POST | `/api/sources/sample/secret` |
|
||||
| POST | `/api/sources/sample/signing` |
|
||||
| POST | `/api/tasks/7/action` |
|
||||
| POST | `/api/tokens` |
|
||||
| POST | `/api/work-requests` |
|
||||
| PUT | `/api/access/policies` |
|
||||
| PUT | `/api/authentication` |
|
||||
| PUT | `/api/event-types/7` |
|
||||
| PUT | `/api/extensions/sample/enabled` |
|
||||
| PUT | `/api/extensions/sample/update-policy` |
|
||||
| PUT | `/api/orgs/7/agents/sample` |
|
||||
| PUT | `/api/orgs/7/members/sample` |
|
||||
| PUT | `/api/sources/sample/delivery-header` |
|
||||
| PUT | `/api/sources/sample/name` |
|
||||
| PUT | `/api/workflows/7/enabled` |
|
||||
|
||||
## Verification limits
|
||||
|
||||
A synthetic browser authenticator verifies protocol behavior, not a physical
|
||||
security key or every operating system. An OIDC unit test is not acceptance
|
||||
against a deployed provider. Disposable PostgreSQL smoke checks verify real SQL
|
||||
without putting database-dependent tests in the fast unit suite.
|
||||
|
||||
Existing anonymous conversations are retained but are not silently assigned to a
|
||||
new person. Existing service credentials remain privileged; this inventory does
|
||||
not claim that all internal gRPC methods have independent Cedar gates.
|
||||
|
||||
When changing a user-facing operation, update its inventory entry and its
|
||||
allow/deny behavior cases. Include another user in the same organization, a
|
||||
caller in another organization, a missing principal, unavailable policy storage,
|
||||
and the applicable owner/workspace/instance restrictions.
|
||||
|
||||
Bootstrap is unauthenticated until the first administrator is created. Complete
|
||||
setup before exposing a new installation to untrusted users. Last-active-owner
|
||||
protection for identity suspension/retirement is tracked separately as
|
||||
`archie-core-d7avc`; membership-policy guards are not that lifecycle guard.
|
||||
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
out/
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
# e2e
|
||||
|
||||
Validation of the whole stack, run by hand or by an agent, never by
|
||||
`task check` or CI. It needs PostgreSQL 18, five services, Vite and a browser,
|
||||
which the gate must not. Docker is not needed: without it tasks queue and
|
||||
park, which is useful data for the dashboard.
|
||||
|
||||
| File | What it does |
|
||||
| --- | --- |
|
||||
| `stack.sh` | Starts PostgreSQL 18 (port 55432) and the five services as local processes, then Vite on 5173 |
|
||||
| `seed.sh` | Seeds the stack through the dashboard API; safe to rerun |
|
||||
| `run.cjs` | Runs `checks/*.cjs` in Chromium; screenshots, manifest and `report.html` to `out/<stamp>/` |
|
||||
| `checks/` | One module per behaviour |
|
||||
| `results/` | One committed report per release |
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
task e2e:up # build, start everything, seed
|
||||
task e2e:check # list available checks (no stack needed)
|
||||
task e2e:check -- list # explicitly list checks
|
||||
task e2e:check -- audit-redirect # one check
|
||||
task e2e:check -- all # all checks
|
||||
task e2e:check -- --headed accessibility # watch a check in Chromium
|
||||
task e2e:check -- --headed all # watch every check
|
||||
task e2e:down # stop; e2e/stack.sh reset also deletes the data
|
||||
```
|
||||
|
||||
Headless is the default. `--headed` opens visible Chromium and slows browser
|
||||
actions to 150ms so you can follow them; assertions and saved evidence are the
|
||||
same in both modes. The terminal prints each check before it starts. Headed mode
|
||||
requires a graphical desktop.
|
||||
|
||||
Nothing reads the installed config: `stack.sh` points the XDG directories at
|
||||
`${ARCHIE_DEV_DIR:-~/.local/state/archie-dev}` and writes its overlay from
|
||||
`deployments/dev.toml`. Logs are in its `logs/`. `e2e/stack.sh restart archied`
|
||||
restarts one service. Run `task e2e:down` before starting again: startup refuses
|
||||
occupied service ports and checks that each launched process stays alive.
|
||||
|
||||
The seed creates a local test administrator: `operator@example.test`, password
|
||||
`archie-local-e2e-password`. Use it at `http://localhost:5173`; the browser
|
||||
checks sign in with the same account. These are test fixtures for this
|
||||
loopback-only stack. To use an existing test account, set `ARCHIE_E2E_EMAIL`
|
||||
and `ARCHIE_E2E_PASSWORD` for both seeding and browser checks. Seeding never
|
||||
resets an existing account or deletes test data.
|
||||
|
||||
The first run needs `pnpm install --dir e2e` and `pnpm --dir e2e exec playwright
|
||||
install chromium`. In the cloud environment, Chromium and Playwright are
|
||||
preinstalled; run with `NODE_PATH=$(pnpm root -g)`.
|
||||
|
||||
## Release evidence
|
||||
|
||||
```bash
|
||||
node e2e/run.cjs --record v1.54.0 all
|
||||
```
|
||||
|
||||
writes `results/v1.54.0.md`, the pass, fail or skip of every check for
|
||||
that release. Commit it with the release. Screenshots stay in `out/`.
|
||||
|
||||
## Writing a check
|
||||
|
||||
A module in `checks/` exports `async ({ page, go, shot, fail, skip, settled, attach, tolerate })`.
|
||||
|
||||
- `go(path)` loads a dashboard route: `waitUntil: 'load'` plus 1200ms.
|
||||
Wait for elements, never for `networkidle`: the event stream never goes idle.
|
||||
- `shot(label)` saves `<check>-<kebab>[-<w>x<h>].png` after a short settle,
|
||||
and records `{file, w, h, check}` in the manifest. The label is slugified,
|
||||
so `shot('/')` becomes `routes-home.png`; a viewport other than the
|
||||
1440x900 default adds a suffix (`-390x844`). Repeated labels get `-2`,
|
||||
`-3`, so every capture is kept.
|
||||
- `fail(msg)` records a problem without stopping.
|
||||
- `skip(reason)` stops the check and records a skip: a missing
|
||||
precondition, never a failure.
|
||||
- `tolerate(re)` ignores console errors matching `re`, for a response the page is designed to survive.
|
||||
- `attach(name, data)` saves a non-image artifact as `<check>-<name>`.
|
||||
- `settled(sel?)` waits for a selector or URL, then settles briefly.
|
||||
It is the harness-owned wait; checks need no capture wrapper or
|
||||
ad-hoc sleeps around screenshots.
|
||||
|
||||
Each check gets a fresh page at 1440x900 with the login `storageState`;
|
||||
a check that needs a phone viewport resizes it itself to 390x844.
|
||||
Those are the only two viewports in use. A throw, a `fail`, or any
|
||||
console or page error fails the check. One module covers one behaviour;
|
||||
families share a prefix: `audit-*` for the audit page (redirect,
|
||||
filters, revert, runtime, views-export, retention-live, phone),
|
||||
`workflow-*` for the canvas (loading, validation, phone-layout, logic),
|
||||
`chat-composer` for chat input.
|
||||
|
||||
`routes` loads every static route and flags text with stray leading,
|
||||
trailing or doubled spaces. `seeded` checks the seed is visible.
|
||||
`/logs` is visited but skipped by the whitespace lint: log lines are
|
||||
data, not copy.
|
||||
|
||||
## Output
|
||||
|
||||
Every run writes `out/<stamp>/` with the screenshots,
|
||||
`results.json` (the manifest: `{check, ok, ms, problems, artifacts[]}`,
|
||||
plus `skipped`/`skipReason` for skips) and `report.html`: a self-contained
|
||||
test record with the commit, totals and one row per check (status, time,
|
||||
message and that check's artifacts, screenshots inline). `attach(name, data)`
|
||||
adds a non-image artifact to the current check; a failed check also gets a
|
||||
`failure` screenshot.
|
||||
|
||||
Exits: 0 when every check passes or skips, 1 when any check fails,
|
||||
2 when the harness itself errors. `ARCHIE_E2E_URL` points the run at
|
||||
a dashboard other than `http://localhost:5173`.
|
||||
|
||||
## Pitfalls
|
||||
|
||||
| Symptom | Cause | Fix |
|
||||
| --- | --- | --- |
|
||||
| State Store exits: server is older than PostgreSQL 18 | another server answered | `stack.sh` uses port 55432; set `ARCHIE_DEV_PGPORT` if that is taken |
|
||||
| Startup says a port is in use | a stack or another process already owns it | Run `task e2e:down`, then `task e2e:up`; inspect any remaining listener with `ss -ltnp` |
|
||||
| Your own shell is killed (exit 144) | `pkill -f` matched its own command line | `stack.sh stop` or `restart`, which kill by PID |
|
||||
| Postgres aborts in the cloud | `/tmp/claude-0` is reset to mode 700 | `stack.sh` keeps the root cluster in `/var/lib/archie-dev` |
|
||||
@@ -0,0 +1,53 @@
|
||||
// Keyboard and phone access: the task dialog fits and tabs in order, pages
|
||||
// title correctly, the skip link and palette focus main content, and
|
||||
// query-only tab switches keep focus where it is.
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
module.exports = async ({ page, go, shot, settled }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await go('/tasks');
|
||||
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
|
||||
await page.getByRole('option', { name: 'New task', exact: true }).click();
|
||||
const dialog = page.getByRole('dialog');
|
||||
await dialog.waitFor();
|
||||
await settled();
|
||||
const bounds = await dialog.boundingBox();
|
||||
assert.ok(bounds.y >= 0 && bounds.y + bounds.height <= 844, 'New task dialog extends outside viewport');
|
||||
await shot('phone-task-dialog-top');
|
||||
const start = dialog.getByRole('button', { name: 'Start task', exact: true });
|
||||
await start.scrollIntoViewIfNeeded();
|
||||
const button = await start.boundingBox();
|
||||
assert.ok(button.y >= 0 && button.y + button.height <= 844, 'Start task cannot be reached by scrolling');
|
||||
await shot('phone-task-dialog');
|
||||
const close = dialog.getByRole('button', { name: 'Close', exact: true });
|
||||
await dialog.getByRole('button', { name: 'Cancel', exact: true }).focus();
|
||||
await page.keyboard.press('Tab');
|
||||
assert.ok(await close.evaluate(el => el === document.activeElement), 'Close is missing from keyboard tab order');
|
||||
const closeBounds = await close.boundingBox();
|
||||
assert.ok(closeBounds.y >= 0 && closeBounds.y + closeBounds.height <= 844, 'Close cannot be reached by keyboard');
|
||||
await page.keyboard.press('Escape');
|
||||
for (const [path, title] of [['/tasks', 'Tasks'], ['/events', 'Events'], ['/account', 'Your account'], ['/settings/models', 'Models | Instance'], ['/org/models', 'Models | Organisation']]) {
|
||||
await go(path);
|
||||
assert.equal(await page.title(), `${title} | Archie`);
|
||||
}
|
||||
await page.keyboard.press('Tab');
|
||||
const skip = page.getByRole('link', { name: 'Skip to main content', exact: true });
|
||||
assert.ok(await skip.evaluate(el => el === document.activeElement), 'Skip link is not the first keyboard stop');
|
||||
await page.keyboard.press('Enter');
|
||||
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content');
|
||||
await page.getByRole('button', { name: 'Sections', exact: true }).click();
|
||||
await page.getByRole('navigation', { name: 'Sections', exact: true }).getByRole('link', { name: 'Tasks', exact: true }).click();
|
||||
await page.waitForFunction(() => document.activeElement?.id === 'main-content', null, { timeout: 5000 }).catch(() => {});
|
||||
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content', 'route navigation did not focus main');
|
||||
await page.getByRole('button', { name: 'Jump to', exact: true }).click();
|
||||
await page.getByRole('option', { name: 'Events', exact: true }).click();
|
||||
await page.waitForFunction(() => document.activeElement?.id === 'main-content', null, { timeout: 5000 }).catch(() => {});
|
||||
assert.equal(await page.evaluate(() => document.activeElement?.id), 'main-content', 'palette navigation did not focus main');
|
||||
// The conversation panel is only open on some entries to this page; the
|
||||
// focus check below needs it closed either way.
|
||||
const hide = page.getByRole('button', { name: 'Hide conversation', exact: true });
|
||||
if (await hide.count()) await hide.click();
|
||||
const tab = page.getByRole('tab', { name: /^Map/ });
|
||||
await tab.click();
|
||||
assert.ok(await tab.evaluate(el => el === document.activeElement), 'query-only navigation stole focus');
|
||||
};
|
||||
@@ -0,0 +1,113 @@
|
||||
// Audit filters are server-evaluated through the URL contract: search,
|
||||
// category, time range, back/forward restore, denied, and the actor filter.
|
||||
const assert = require('node:assert/strict');
|
||||
const { trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, fail }) => {
|
||||
const { requestMatching, waitForUrl } = trackAudit(page);
|
||||
|
||||
await go('/org/audit');
|
||||
const status = await page.evaluate(async () => (await fetch('/api/auth/status')).json());
|
||||
const actor = status?.user?.id;
|
||||
assert.ok(actor, 'signed-in identity has no id');
|
||||
|
||||
const search = page.getByLabel('Search events', { exact: true });
|
||||
let request = await requestMatching(
|
||||
() => search.fill('repository'),
|
||||
(u) => u.searchParams.get('q') === 'repository',
|
||||
);
|
||||
assert.ok(request, 'search issued no matching /api/audit request');
|
||||
await waitForUrl((u) => u.searchParams.get('q') === 'repository');
|
||||
assert.equal((await search.inputValue()), 'repository');
|
||||
|
||||
await go('/org/audit');
|
||||
request = await requestMatching(
|
||||
() => page.getByRole('button', { name: 'Runtime', exact: true }).click(),
|
||||
(u) => u.searchParams.get('categories') === 'runtime',
|
||||
);
|
||||
assert.ok(request, 'category filter issued no matching /api/audit request');
|
||||
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
|
||||
assert.equal(
|
||||
await page.getByRole('button', { name: 'Runtime', exact: true }).getAttribute('aria-pressed'),
|
||||
'true',
|
||||
);
|
||||
|
||||
// Time: Any time drops the window from the request rather than guessing one.
|
||||
await page.getByRole('combobox', { name: 'Time range', exact: true }).click();
|
||||
request = await requestMatching(
|
||||
() => page.getByRole('option', { name: 'Any time', exact: true }).click(),
|
||||
(u) => u.searchParams.get('from') === null && u.searchParams.get('categories') === 'runtime',
|
||||
);
|
||||
assert.ok(request, 'Any time issued no matching /api/audit request');
|
||||
await waitForUrl((u) => u.searchParams.get('since') === 'any');
|
||||
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Any time');
|
||||
|
||||
// Back/forward restore the controls the URL describes.
|
||||
const backRequest = page.waitForRequest(
|
||||
(r) => {
|
||||
const u = new URL(r.url());
|
||||
return u.pathname === '/api/audit' && u.searchParams.get('categories') === 'runtime' && !!u.searchParams.get('from');
|
||||
},
|
||||
{ timeout: 8000 },
|
||||
);
|
||||
await page.goBack();
|
||||
await backRequest;
|
||||
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime' && u.searchParams.get('since') === null);
|
||||
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Last 30 days');
|
||||
assert.equal(
|
||||
await page.getByRole('button', { name: 'Runtime', exact: true }).getAttribute('aria-pressed'),
|
||||
'true',
|
||||
'back did not restore the category toggle',
|
||||
);
|
||||
const forwardRequest = page.waitForRequest(
|
||||
(r) => {
|
||||
const u = new URL(r.url());
|
||||
return u.pathname === '/api/audit' && u.searchParams.get('categories') === 'runtime' && u.searchParams.get('from') === null;
|
||||
},
|
||||
{ timeout: 8000 },
|
||||
);
|
||||
await page.goForward();
|
||||
await forwardRequest;
|
||||
await waitForUrl((u) => u.searchParams.get('since') === 'any');
|
||||
assert.equal(await page.getByRole('combobox', { name: 'Time range', exact: true }).innerText(), 'Any time');
|
||||
|
||||
// Denied reaches the server through the same URL contract as the other
|
||||
// filters. It must both update the URL and issue a request.
|
||||
await go('/org/audit');
|
||||
const denied = page.getByRole('button', { name: 'Denied', exact: true });
|
||||
request = await requestMatching(
|
||||
() => denied.click(),
|
||||
(u) => u.searchParams.get('outcome') === 'denied',
|
||||
3000,
|
||||
);
|
||||
const deniedUrl = new URL(page.url());
|
||||
if (!request || deniedUrl.searchParams.get('outcome') !== 'denied') {
|
||||
await shot('denied');
|
||||
fail(
|
||||
`Denied filter did not reach the server: URL ${page.url()} has outcome=${deniedUrl.searchParams.get('outcome') ?? 'absent'}, ` +
|
||||
`aria-pressed=${await denied.getAttribute('aria-pressed')}, no /api/audit request with outcome=denied`,
|
||||
);
|
||||
} else {
|
||||
assert.equal(await denied.getAttribute('aria-pressed'), 'true');
|
||||
}
|
||||
|
||||
// Advanced actor filter: server-evaluated, in the URL, shown as a chip.
|
||||
await go('/org/audit');
|
||||
await page.getByRole('button', { name: 'Filters', exact: true }).click();
|
||||
const actorInput = page.getByLabel('Actor', { exact: true });
|
||||
request = await requestMatching(
|
||||
async () => {
|
||||
await actorInput.fill(actor);
|
||||
await actorInput.press('Enter');
|
||||
},
|
||||
(u) => u.searchParams.get('actor') === actor,
|
||||
);
|
||||
assert.ok(request, 'advanced actor filter issued no matching /api/audit request');
|
||||
await waitForUrl((u) => u.searchParams.get('actor') === actor);
|
||||
assert.match(
|
||||
await page.locator('ul[aria-label="Active filters"] li', { hasText: 'Actor:' }).first().innerText(),
|
||||
new RegExp(actor),
|
||||
);
|
||||
await shot('filters');
|
||||
await page.keyboard.press('Escape');
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
// The audit page at phone width: secondary columns collapse, and the list,
|
||||
// an expanded row and the filters dialog fit without horizontal overflow.
|
||||
const assert = require('node:assert/strict');
|
||||
const { trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, fail, settled }) => {
|
||||
trackAudit(page);
|
||||
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await go('/org/audit');
|
||||
const assertNoOverflow = async (label) => {
|
||||
const { scrollWidth, innerWidth } = await page.evaluate(() => ({
|
||||
scrollWidth: document.documentElement.scrollWidth,
|
||||
innerWidth,
|
||||
}));
|
||||
if (scrollWidth > innerWidth) {
|
||||
fail(`${label} overflows 390px: documentElement.scrollWidth=${scrollWidth} > innerWidth=${innerWidth}`);
|
||||
}
|
||||
};
|
||||
await page.locator('[data-row-key]').first().waitFor();
|
||||
await assertNoOverflow('audit list');
|
||||
assert.equal(
|
||||
await page.locator('thead th', { hasText: 'Target' }).first().evaluate((el) => getComputedStyle(el).display),
|
||||
'none',
|
||||
'secondary columns are still rendered on the phone',
|
||||
);
|
||||
await shot('list');
|
||||
|
||||
const phoneRow = page.locator('[data-row-key]').first();
|
||||
await phoneRow.focus();
|
||||
await page.keyboard.press('Enter');
|
||||
await settled();
|
||||
assert.equal(await phoneRow.getAttribute('aria-expanded'), 'true', 'phone row did not expand');
|
||||
await assertNoOverflow('expanded change set');
|
||||
await shot('expanded');
|
||||
|
||||
await page.getByRole('button', { name: 'Filters', exact: true }).click();
|
||||
await page.getByRole('dialog').first().waitFor();
|
||||
await settled();
|
||||
await assertNoOverflow('advanced filters');
|
||||
await shot('filters');
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
// A deep link to the old history route redirects to the audit page keeping
|
||||
// section, actor, since and the hash, and the feed loads with filter chips.
|
||||
const assert = require('node:assert/strict');
|
||||
const { trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, fail }) => {
|
||||
const { lastRequest } = trackAudit(page);
|
||||
|
||||
await go('/org/audit');
|
||||
const status = await page.evaluate(async () => (await fetch('/api/auth/status')).json());
|
||||
const actor = status?.user?.id;
|
||||
assert.ok(actor, 'signed-in identity has no id');
|
||||
|
||||
const deepLink = `/settings/history?section=container-runtime-policies&actor=${encodeURIComponent(actor)}&since=30d#deep`;
|
||||
await go(deepLink);
|
||||
assert.match(page.url(), /\/org\/audit\?/, 'history did not redirect to the audit route');
|
||||
assert.match(page.url(), /section=container-runtime-policies/, 'redirect dropped section');
|
||||
assert.match(page.url(), new RegExp(`actor=${encodeURIComponent(actor)}`), 'redirect dropped actor');
|
||||
assert.match(page.url(), /since=30d/, 'redirect dropped since');
|
||||
assert.match(page.url(), /#deep$/, 'redirect dropped the hash');
|
||||
const redirected = lastRequest();
|
||||
assert.ok(redirected, 'the redirect issued no /api/audit request');
|
||||
assert.equal(redirected.searchParams.get('kind'), 'container-runtime-policies');
|
||||
assert.equal(redirected.searchParams.get('actor'), actor);
|
||||
|
||||
// The feed must be readable before anything below can mean anything. A 500
|
||||
// here is the whole page: say what the server answered instead of timing out.
|
||||
const probe = await page.evaluate(async () => {
|
||||
const response = await fetch('/api/audit?limit=1');
|
||||
return { status: response.status, body: await response.text() };
|
||||
});
|
||||
if (probe.status !== 200) {
|
||||
await shot('unavailable');
|
||||
fail(`GET /api/audit returned ${probe.status}: ${probe.body.slice(0, 200)}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const kindChip = page.locator('ul[aria-label="Active filters"] li', { hasText: 'Kind:' });
|
||||
await kindChip.first().waitFor({ timeout: 8000 });
|
||||
assert.match(await kindChip.first().innerText(), /Container runtime policies/, 'kind chip missing its catalog title');
|
||||
assert.match(
|
||||
await page.locator('ul[aria-label="Active filters"] li', { hasText: 'Actor:' }).first().innerText(),
|
||||
new RegExp(actor),
|
||||
'actor chip missing',
|
||||
);
|
||||
await shot('redirect');
|
||||
await go('/org/audit');
|
||||
await page.locator('[data-row-key]').first().waitFor();
|
||||
await shot('desktop');
|
||||
};
|
||||
@@ -0,0 +1,148 @@
|
||||
// Audit retention reads the stored resource, the live tail prepends new rows
|
||||
// without a reload and holds them behind a button while scrolled away, and a
|
||||
// retention save persists. The save stays last: it must not stop the rest.
|
||||
const assert = require('node:assert/strict');
|
||||
const { trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, fail, settled }) => {
|
||||
const { loadCount } = trackAudit(page);
|
||||
|
||||
await go('/org/audit');
|
||||
const resourceResponse = await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`);
|
||||
assert.equal(resourceResponse.status(), 200, 'audit-retention resource is unreadable');
|
||||
const retentionResource = await resourceResponse.json();
|
||||
const retentionHours = (value) => {
|
||||
const match = String(value || '').match(/^(\d+)h$/);
|
||||
return match ? Number(match[1]) : 0;
|
||||
};
|
||||
const originalHours = retentionHours(retentionResource.resource.value.runtime_event_retention);
|
||||
|
||||
const openRetention = async () => {
|
||||
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
|
||||
await page.getByRole('menuitem', { name: 'Retention', exact: true }).click();
|
||||
const dialog = page.getByRole('dialog');
|
||||
await dialog.waitFor();
|
||||
await dialog.getByLabel('Runtime event retention (hours)', { exact: true }).waitFor();
|
||||
return dialog;
|
||||
};
|
||||
|
||||
let retentionDialog = await openRetention();
|
||||
assert.match(await retentionDialog.innerText(), /Audit retention/);
|
||||
assert.equal(
|
||||
await retentionDialog.getByLabel('Runtime event retention (hours)', { exact: true }).inputValue(),
|
||||
String(originalHours),
|
||||
'retention dialog did not read the stored resource',
|
||||
);
|
||||
await retentionDialog.getByRole('button', { name: 'Cancel', exact: true }).click();
|
||||
await retentionDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
|
||||
assert.ok(!(await retentionDialog.isVisible().catch(() => false)), 'Cancel left the retention dialog open');
|
||||
|
||||
// ---- live tail -----------------------------------------------------------
|
||||
await go('/org/audit');
|
||||
await page.evaluate(() => window.scrollTo(0, 0));
|
||||
await settled();
|
||||
const topKey = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
|
||||
const loadsBeforeWrite = loadCount();
|
||||
let resource = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
|
||||
const toggleRetention = async () => {
|
||||
const current = retentionHours(resource.resource.value.runtime_event_retention);
|
||||
const next = current === 2160 ? 2161 : 2160;
|
||||
const written = await page.request.post(
|
||||
`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention/commands/replace`,
|
||||
{
|
||||
headers: { 'X-Archie-CSRF': '1', Origin: new URL(page.url()).origin },
|
||||
data: { value: { runtime_event_retention: `${next}h` }, expected_version: resource.resource.version },
|
||||
},
|
||||
);
|
||||
const body = await written.text();
|
||||
assert.equal(written.status(), 200, `retention write answered ${written.status()}: ${body.slice(0, 200)}`);
|
||||
resource = JSON.parse(body);
|
||||
};
|
||||
|
||||
await toggleRetention();
|
||||
let liveKey = null;
|
||||
for (let attempt = 0; attempt < 40; attempt += 1) {
|
||||
const key = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
|
||||
if (key !== topKey) {
|
||||
liveKey = key;
|
||||
break;
|
||||
}
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
if (!liveKey) {
|
||||
fail('live tail did not show a new row within 12s of a write');
|
||||
await shot('live');
|
||||
} else {
|
||||
assert.equal(loadCount(), loadsBeforeWrite, 'the live row required a page reload');
|
||||
assert.match(
|
||||
await page.locator(`[data-row-key="${liveKey}"]`).innerText(),
|
||||
/audit-retention/i,
|
||||
'the live row is not the write that caused it',
|
||||
);
|
||||
await shot('live');
|
||||
}
|
||||
|
||||
// Scrolled away, a new event is held behind a button instead of jumping the
|
||||
// list under the operator.
|
||||
await page.evaluate(() => window.scrollTo(0, 900));
|
||||
await settled();
|
||||
const scrolledTo = await page.evaluate(() => window.scrollY);
|
||||
assert.ok(scrolledTo > 80, 'the feed is too short to test held new events');
|
||||
const heldTop = await page.locator('[data-row-key]').first().getAttribute('data-row-key');
|
||||
await toggleRetention();
|
||||
const heldButton = page.getByRole('button', { name: /^\d+ new events?$/ }).first();
|
||||
let held = false;
|
||||
for (let attempt = 0; attempt < 40; attempt += 1) {
|
||||
if ((await heldButton.count()) && (await heldButton.isVisible().catch(() => false))) {
|
||||
held = true;
|
||||
break;
|
||||
}
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
if (!held) {
|
||||
fail('held new events did not appear while scrolled away');
|
||||
await shot('held');
|
||||
} else {
|
||||
assert.equal(
|
||||
await page.locator('[data-row-key]').first().getAttribute('data-row-key'),
|
||||
heldTop,
|
||||
'a new row was prepended while the operator was scrolled away',
|
||||
);
|
||||
await shot('held');
|
||||
await heldButton.click();
|
||||
await page.waitForFunction(
|
||||
(top) => document.querySelector('[data-row-key]')?.getAttribute('data-row-key') !== top,
|
||||
heldTop,
|
||||
{ timeout: 8000 },
|
||||
).catch(() => {});
|
||||
await settled();
|
||||
assert.notEqual(
|
||||
await page.locator('[data-row-key]').first().getAttribute('data-row-key'),
|
||||
heldTop,
|
||||
'showing held events did not prepend the new row',
|
||||
);
|
||||
assert.ok((await page.evaluate(() => window.scrollY)) < 10, 'showing held events did not return to the top');
|
||||
}
|
||||
|
||||
// ---- retention: save -----------------------------------------------------
|
||||
// Kept last: the page error this currently raises must not stop the rest.
|
||||
await go('/org/audit');
|
||||
retentionDialog = await openRetention();
|
||||
const hoursField = retentionDialog.getByLabel('Runtime event retention (hours)', { exact: true });
|
||||
const beforeSave = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
|
||||
const beforeHours = retentionHours(beforeSave.resource.value.runtime_event_retention);
|
||||
const wanted = beforeHours === 2160 ? 2161 : 2160;
|
||||
await hoursField.fill(String(wanted));
|
||||
await retentionDialog.getByRole('button', { name: 'Save', exact: true }).click();
|
||||
await retentionDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
|
||||
const stillOpen = await retentionDialog.isVisible().catch(() => false);
|
||||
const afterSave = await (await page.request.get(`${new URL(page.url()).origin}/api/control-plane/resources/audit-retention`)).json();
|
||||
const afterHours = retentionHours(afterSave.resource.value.runtime_event_retention);
|
||||
if (stillOpen || afterHours !== wanted) {
|
||||
await shot('retention-save');
|
||||
fail(
|
||||
`retention save did not complete: dialog ${stillOpen ? 'stayed open' : 'closed'}, ` +
|
||||
`stored retention is ${afterHours}h (wanted ${wanted}h), URL ${page.url()}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
// A revertable change set expands to its Before/After diff, offers one Revert
|
||||
// action whose dialog cancels cleanly, and toggles from the keyboard.
|
||||
const assert = require('node:assert/strict');
|
||||
const { DEFAULT_WINDOW_MS, trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, fail, settled }) => {
|
||||
trackAudit(page);
|
||||
|
||||
await go('/org/audit');
|
||||
await page.locator('[data-row-key]').first().waitFor();
|
||||
const from = new Date(Date.now() - DEFAULT_WINDOW_MS).toISOString();
|
||||
// The feed page size is 100: only rows in this response are rendered.
|
||||
const feed = await page.evaluate(
|
||||
async (iso) => (await fetch(`/api/audit?limit=100&from=${encodeURIComponent(iso)}`)).json(),
|
||||
from,
|
||||
);
|
||||
const records = feed.records || [];
|
||||
assert.ok(records.length, 'the seeded feed is empty');
|
||||
|
||||
const changeSet = records.find(
|
||||
(row) =>
|
||||
row.target?.kind === 'resource' &&
|
||||
(row.detail?.fields || []).length > 0 &&
|
||||
(row.detail?.version ?? 0) > 1,
|
||||
);
|
||||
if (!changeSet) {
|
||||
fail('no revertable settings change set in the feed; cannot exercise the diff or Revert');
|
||||
return;
|
||||
}
|
||||
|
||||
const row = page.locator(`[data-row-key="${changeSet.id}"]`);
|
||||
await row.waitFor();
|
||||
await row.scrollIntoViewIfNeeded();
|
||||
await row.locator('td').first().click();
|
||||
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'click did not expand the change set');
|
||||
const detail = row.locator('xpath=following-sibling::tr[1]');
|
||||
await detail.getByText('Before:', { exact: false }).first().waitFor();
|
||||
assert.match(await detail.innerText(), /After:/, 'expanded change set has no after value');
|
||||
assert.equal(
|
||||
await detail.getByRole('button', { name: /^Revert \S/ }).count(),
|
||||
0,
|
||||
'the audit diff offers a per-field revert',
|
||||
);
|
||||
const revertAll = page.getByRole('button', { name: 'Revert', exact: true });
|
||||
assert.ok((await revertAll.count()) > 0, 'no Revert action on a revertable change set');
|
||||
await shot('change-set');
|
||||
|
||||
await revertAll.first().click();
|
||||
const dialog = page.getByRole('alertdialog');
|
||||
await dialog.waitFor();
|
||||
assert.match(await dialog.innerText(), /Revert this change\?/);
|
||||
assert.match(await dialog.innerText(), /previous version opens for review/i);
|
||||
await dialog.getByRole('button', { name: 'Cancel', exact: true }).click();
|
||||
await dialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
|
||||
assert.ok(!(await dialog.isVisible().catch(() => false)), 'Cancel left the revert dialog open');
|
||||
assert.equal(
|
||||
await page.getByRole('region', { name: 'Unsaved changes' }).count(),
|
||||
0,
|
||||
'Cancel touched the save bar',
|
||||
);
|
||||
|
||||
// Enter is the keyboard equivalent of clicking the row.
|
||||
await row.click();
|
||||
assert.equal(await row.getAttribute('aria-expanded'), 'false', 'the row did not collapse');
|
||||
await row.focus();
|
||||
await page.keyboard.press('Enter');
|
||||
await settled();
|
||||
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'Enter did not expand the change set');
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
// A runtime event with a task target expands to its metadata and links to
|
||||
// the task. The seed's work requests park and record the event; the feed is
|
||||
// filtered to it so settings noise cannot push it off the page. Without it
|
||||
// there is nothing to exercise, so the check skips instead of failing.
|
||||
const assert = require('node:assert/strict');
|
||||
const { DEFAULT_WINDOW_MS, trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, skip }) => {
|
||||
trackAudit(page);
|
||||
|
||||
await go('/org/audit?kind=parked');
|
||||
await page.locator('[data-row-key]').first().waitFor();
|
||||
const from = new Date(Date.now() - DEFAULT_WINDOW_MS).toISOString();
|
||||
// The feed page size is 100: only rows in this response are rendered.
|
||||
const feed = await page.evaluate(
|
||||
async (iso) => (await fetch(`/api/audit?limit=100&kind=parked&from=${encodeURIComponent(iso)}`)).json(),
|
||||
from,
|
||||
);
|
||||
const records = feed.records || [];
|
||||
const runtime = records.find((row) => row.category === 'runtime' && row.target?.kind === 'task' && row.target?.id);
|
||||
if (!runtime) {
|
||||
skip('no runtime event with a task target in the feed');
|
||||
}
|
||||
|
||||
const row = page.locator(`[data-row-key="${runtime.id}"]`);
|
||||
await row.waitFor();
|
||||
await row.scrollIntoViewIfNeeded();
|
||||
await row.locator('td').first().click();
|
||||
assert.equal(await row.getAttribute('aria-expanded'), 'true', 'runtime row did not expand');
|
||||
const detail = row.locator('xpath=following-sibling::tr[1]');
|
||||
await detail.locator('dl dt', { hasText: 'Target' }).first().waitFor();
|
||||
assert.match(await detail.innerText(), /Table/, 'runtime metadata has no table row');
|
||||
const link = detail.getByRole('link', { name: runtime.target.label || runtime.target.id, exact: true });
|
||||
assert.equal(await link.count(), 1, 'runtime target is not a link');
|
||||
assert.equal(await link.getAttribute('href'), `/tasks/${runtime.target.id}`);
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
// Audit saved views round-trip through the URL, and CSV/JSON exports carry
|
||||
// the resolved window and arrive as attachments.
|
||||
const assert = require('node:assert/strict');
|
||||
const { trackAudit, exportOnce } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, fail, settled }) => {
|
||||
const { waitForUrl } = trackAudit(page);
|
||||
|
||||
await go('/org/audit');
|
||||
await page.getByRole('button', { name: 'Runtime', exact: true }).click();
|
||||
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
|
||||
|
||||
const viewName = `e2e-view-${Date.now()}`;
|
||||
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
|
||||
await page.getByRole('menuitem', { name: 'Save view…', exact: true }).click();
|
||||
const saveDialog = page.getByRole('dialog');
|
||||
await saveDialog.waitFor();
|
||||
await saveDialog.getByLabel('Name', { exact: true }).fill(viewName);
|
||||
await saveDialog.getByRole('button', { name: 'Save', exact: true }).click();
|
||||
await settled();
|
||||
await saveDialog.waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
|
||||
|
||||
const savedView = page.getByRole('combobox', { name: 'Saved view', exact: true });
|
||||
await savedView.waitFor();
|
||||
assert.equal((await savedView.innerText()).trim(), viewName);
|
||||
await shot('saved-view');
|
||||
|
||||
await page.getByRole('button', { name: 'Runtime', exact: true }).click();
|
||||
await waitForUrl((u) => u.searchParams.get('categories') === null);
|
||||
await savedView.click();
|
||||
await page.getByRole('option', { name: viewName, exact: true }).click();
|
||||
await waitForUrl((u) => u.searchParams.get('categories') === 'runtime');
|
||||
assert.equal((await savedView.innerText()).trim(), viewName, 'applying the saved view did not restore it');
|
||||
|
||||
await page.getByRole('button', { name: 'Audit actions', exact: true }).click();
|
||||
await page.getByRole('menuitem', { name: 'Delete view', exact: true }).click();
|
||||
await savedView.waitFor({ state: 'detached', timeout: 5000 }).catch(() => {});
|
||||
assert.equal(await savedView.count(), 0, 'deleting the saved view left it in the picker');
|
||||
|
||||
await go('/org/audit');
|
||||
await page.getByRole('button', { name: 'Export', exact: true }).click();
|
||||
await page.getByRole('menuitem', { name: 'CSV', exact: true }).waitFor();
|
||||
await shot('export');
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
const csvBody = await exportOnce(page, fail, 'CSV', 'csv');
|
||||
if (csvBody !== null) assert.ok(csvBody.split('\n')[0].trim().length > 0, 'CSV export is empty');
|
||||
const jsonBody = await exportOnce(page, fail, 'JSON', 'json');
|
||||
if (jsonBody !== null) assert.ok(jsonBody.trimStart().startsWith('['), 'JSON export is not an array');
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
// The chat composer: IME confirmation never submits the draft, Shift+Enter
|
||||
// inserts a newline, and ordinary Enter submits and clears.
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/events');
|
||||
const composer = page.getByRole('textbox', { name: 'Message Archie', exact: true });
|
||||
await composer.waitFor();
|
||||
await composer.fill('Composition in progress');
|
||||
const sent = [];
|
||||
await page.route('**/api/chat/stream', async route => {
|
||||
sent.push(route.request().postDataJSON().text);
|
||||
await route.fulfill({ contentType: 'text/event-stream', body: 'data: {"type":"done","text":"Test response"}\n\n' });
|
||||
});
|
||||
for (const event of [{ isComposing: true }, { keyCode: 229 }]) {
|
||||
await composer.dispatchEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true, ...event });
|
||||
assert.equal(await composer.inputValue(), 'Composition in progress', 'IME confirmation submitted the draft');
|
||||
}
|
||||
assert.equal(sent.length, 0);
|
||||
await composer.press('Shift+Enter');
|
||||
assert.ok((await composer.inputValue()).includes('\n'), 'Shift+Enter no longer inserts a newline');
|
||||
await composer.fill('Ordinary Enter submits');
|
||||
const request = page.waitForRequest('**/api/chat/stream');
|
||||
await composer.press('Enter');
|
||||
assert.equal((await request).postDataJSON().text, 'Ordinary Enter submits');
|
||||
assert.equal(await composer.inputValue(), '');
|
||||
await shot('chat-composition');
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
// Real local API records; workflow edits stay unsaved and the test agent retires.
|
||||
const assert = require('node:assert/strict');
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
const base = process.env.ARCHIE_E2E_URL || 'http://localhost:5173';
|
||||
const headers = { 'X-Archie-CSRF': '1', Origin: base };
|
||||
let agent;
|
||||
const command = async (name, display_name = '') => {
|
||||
const response = await page.request.post(`${base}/api/identities/${agent.id}/${name}`, {
|
||||
headers, data: { expected_version: agent.version, display_name },
|
||||
});
|
||||
assert.equal(response.ok(), true, await response.text());
|
||||
agent = await response.json();
|
||||
};
|
||||
const openSettings = async () => {
|
||||
await go('/workflows');
|
||||
await page.getByRole('button', { name: /^implement/ }).click();
|
||||
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
|
||||
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
|
||||
await page.locator('.vue-flow__node').filter({ hasText: 'Workflow' }).first().click();
|
||||
return page.getByRole('combobox', { name: 'Execution identity', exact: true });
|
||||
};
|
||||
try {
|
||||
const created = await page.request.post(`${base}/api/identities`, {
|
||||
headers, data: { display_name: `E2E execution agent ${Date.now()}`, kind: 'bot' },
|
||||
});
|
||||
assert.equal(created.ok(), true, await created.text());
|
||||
agent = await created.json();
|
||||
const trigger = await openSettings();
|
||||
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
|
||||
await trigger.click();
|
||||
await page.getByRole('option', { name: agent.display_name, exact: true }).click();
|
||||
assert.match(await trigger.innerText(), new RegExp(agent.display_name));
|
||||
await shot('named-execution-identity');
|
||||
await command('rename', agent.display_name + ' renamed');
|
||||
await page.reload();
|
||||
const renamed = await openSettings();
|
||||
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
|
||||
await renamed.click();
|
||||
await page.getByRole('option', { name: agent.display_name, exact: true }).waitFor();
|
||||
await page.keyboard.press('Escape');
|
||||
await command('suspend');
|
||||
await page.reload();
|
||||
const suspended = await openSettings();
|
||||
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
|
||||
await suspended.click();
|
||||
assert.equal(await page.getByRole('option', { name: agent.display_name, exact: true }).and(page.locator(':not([data-disabled])')).count(), 0);
|
||||
} finally {
|
||||
if (agent && agent.lifecycle !== 'retired') await command('retire');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,103 @@
|
||||
// Shared setup for the audit-* checks: feed request tracking, URL waits,
|
||||
// and the export download-or-popup accept. One behaviour per check module;
|
||||
// this file holds only what several of them need.
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
|
||||
const DEFAULT_WINDOW_MS = 30 * 24 * 60 * 60 * 1000;
|
||||
|
||||
function isAudit(u) {
|
||||
return u.pathname === '/api/audit';
|
||||
}
|
||||
|
||||
// Installs request tracking on a fresh check page. Returns the helpers the
|
||||
// audit checks share; a check destructures only what it uses.
|
||||
function trackAudit(page) {
|
||||
page.setDefaultTimeout(10000);
|
||||
const auditRequests = [];
|
||||
page.on('request', (request) => {
|
||||
try {
|
||||
const url = new URL(request.url());
|
||||
if (isAudit(url) || url.pathname === '/api/audit/export') auditRequests.push(url);
|
||||
} catch {
|
||||
// A non-URL request cannot be an audit call.
|
||||
}
|
||||
});
|
||||
let loads = 0;
|
||||
page.on('load', () => (loads += 1));
|
||||
|
||||
const requestMatching = async (action, predicate, timeout = 6000) => {
|
||||
const waiter = page
|
||||
.waitForRequest(
|
||||
(request) => {
|
||||
try {
|
||||
const url = new URL(request.url());
|
||||
return (isAudit(url) || url.pathname === '/api/audit/export') && predicate(url);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{ timeout },
|
||||
)
|
||||
.catch(() => null);
|
||||
await action();
|
||||
return waiter;
|
||||
};
|
||||
|
||||
const waitForUrl = (predicate, timeout = 8000) =>
|
||||
page.waitForURL((url) => predicate(new URL(url)), { timeout });
|
||||
|
||||
const lastRequest = () => auditRequests[auditRequests.length - 1] || null;
|
||||
const loadCount = () => loads;
|
||||
|
||||
return { requestMatching, waitForUrl, lastRequest, loadCount };
|
||||
}
|
||||
|
||||
// Export resolves its window at click time and opens a tab. A successful
|
||||
// export arrives as an attachment download; a failed one stays visible in
|
||||
// that tab, so the check accepts either and reads the response from it.
|
||||
async function exportOnce(page, fail, label, extension) {
|
||||
await page.getByRole('button', { name: 'Export', exact: true }).click();
|
||||
const item = page.getByRole('menuitem', { name: label, exact: true });
|
||||
await item.waitFor();
|
||||
const downloadP = page.waitForEvent('download', { timeout: 15000 }).then((download) => ({ download })).catch(() => null);
|
||||
const popupP = page.waitForEvent('popup', { timeout: 15000 }).then((popup) => ({ popup })).catch(() => null);
|
||||
await item.click();
|
||||
const settled = await Promise.race([downloadP, popupP]);
|
||||
if (!settled) {
|
||||
fail(`${label} export neither downloaded nor opened a tab`);
|
||||
return null;
|
||||
}
|
||||
if (settled.popup) {
|
||||
await settled.popup.waitForLoadState('load').catch(() => {});
|
||||
const url = new URL(settled.popup.url());
|
||||
assert.equal(url.pathname, '/api/audit/export', `${label} opened ${url.href}`);
|
||||
assert.equal(url.searchParams.get('format'), extension);
|
||||
assert.ok(url.searchParams.get('from'), `${label} export has no explicit start`);
|
||||
assert.ok(url.searchParams.get('to'), `${label} export has no explicit end`);
|
||||
const response = await page.request.get(url.href);
|
||||
const body = await response.text();
|
||||
if (response.status() !== 200) {
|
||||
fail(`${label} export failed (${response.status()}): ${body.slice(0, 200)}`);
|
||||
return null;
|
||||
}
|
||||
if (!new RegExp(`attachment;.*\\.${extension}`).test(response.headers()['content-disposition'] || '')) {
|
||||
fail(`${label} export opened a tab without an attachment filename`);
|
||||
return null;
|
||||
}
|
||||
return body;
|
||||
}
|
||||
if (!new RegExp(`\\.${extension}$`).test(settled.download.suggestedFilename())) {
|
||||
fail(`${label} export did not download a .${extension} file`);
|
||||
return null;
|
||||
}
|
||||
const failure = await settled.download.failure();
|
||||
if (failure) {
|
||||
fail(`${label} download failed: ${failure}`);
|
||||
return null;
|
||||
}
|
||||
const saved = await settled.download.path();
|
||||
return saved ? fs.readFileSync(saved, 'utf8') : '';
|
||||
}
|
||||
|
||||
module.exports = { DEFAULT_WINDOW_MS, isAudit, trackAudit, exportOnce };
|
||||
@@ -0,0 +1,18 @@
|
||||
// Shared by the org-* and setup checks: acting in a seeded org and the 404s a
|
||||
// fresh org's pages are built to survive.
|
||||
const ORG = { home: 'org-sys', beta: 'org-beta', outsider: 'org-gamma' };
|
||||
|
||||
// A new org has written no documents, and the instance-only reads answer
|
||||
// not found outside the system org.
|
||||
const ABSENT = /status of 404.*\/api\/(control-plane|schedules|identities)/;
|
||||
|
||||
// Selects an org the way the topbar does, over the page's own session.
|
||||
async function selectOrg(page, id) {
|
||||
const origin = new URL(page.url() === 'about:blank' ? 'http://localhost:5173' : page.url()).origin;
|
||||
return page.request.put(`${origin}/api/orgs/current`, {
|
||||
headers: { 'X-Archie-CSRF': '1', Origin: origin },
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { ORG, ABSENT, selectOrg };
|
||||
@@ -0,0 +1,19 @@
|
||||
const assert=require('node:assert/strict');
|
||||
module.exports=async({page,go,shot})=>{
|
||||
await page.route('**/api/access/policies',async route=>{await new Promise(r=>setTimeout(r,2200));await route.continue()});
|
||||
await go('/access/policies');
|
||||
assert.equal(await page.getByText('No policies yet.',{exact:true}).count(),0);
|
||||
await page.getByText('Loading policies…',{exact:true}).waitFor({state:'hidden'});
|
||||
await page.route('**/api/tasks?**',async route=>{
|
||||
if(new URL(route.request().url()).searchParams.has('workflow')) await route.fulfill({status:200,contentType:'application/json',body:'unreadable response'});
|
||||
else await route.continue();
|
||||
});
|
||||
await go('/workflows');
|
||||
await page.getByRole('alert').filter({hasText:'Could not load recent runs'}).waitFor();
|
||||
await page.getByRole('tab',{name:/^Runs/}).click();
|
||||
assert.equal(await page.getByText('No runs yet',{exact:true}).count(),0);
|
||||
await page.unroute('**/api/tasks?**');
|
||||
await page.getByRole('button',{name:'Retry runs',exact:true}).click();
|
||||
await page.getByRole('alert').filter({hasText:'Could not load recent runs'}).waitFor({state:'hidden'});
|
||||
await shot('recovered');
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
// The save response is mocked; this checks the page's save path without changing models.
|
||||
const assert=require('node:assert/strict');
|
||||
module.exports=async({page,go,shot})=>{
|
||||
let submitted;
|
||||
await page.route('**/api/control-plane/resources/model-aliases/commands/replace',async route=>{
|
||||
submitted=route.request().postDataJSON();
|
||||
await route.fulfill({json:{resource:{kind:'model-aliases',version:submitted.expected_version+1,value:submitted.value}}});
|
||||
});
|
||||
await go('/access/models');
|
||||
await page.getByLabel('New alias',{exact:true}).fill('e2e-test');
|
||||
await page.getByRole('button',{name:'Add alias',exact:true}).click();
|
||||
await page.getByLabel('e2e-test',{exact:true}).fill('test/model');
|
||||
await page.getByRole('button',{name:'Review and save',exact:true}).click();
|
||||
await page.getByRole('button',{name:'Save',exact:true}).click();
|
||||
await page.getByRole('heading',{name:/^Review \d/}).waitFor({state:'hidden'});
|
||||
assert.equal(submitted?.value['e2e-test'],'test/model');
|
||||
await shot('saved');
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
// The organisation pages: each loads its form in the selected org, and the old
|
||||
// settings audit route lands on the organisation's audit page.
|
||||
const assert = require('node:assert/strict');
|
||||
const { trackAudit } = require('./helpers/audit-helpers.cjs');
|
||||
|
||||
const PAGES = [
|
||||
{ path: '/org/channels', heading: 'Channels', text: 'Chat session defaults' },
|
||||
{ path: '/org/scheduling-policy', heading: 'Scheduling policy', text: 'Retries and polling' },
|
||||
{ path: '/org/alerts', heading: 'Alert webhook', text: 'Webhook severity' },
|
||||
];
|
||||
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
for (const { path, heading, text } of PAGES) {
|
||||
await go(path);
|
||||
await page.getByRole('heading', { name: heading, exact: true }).waitFor();
|
||||
await page.getByText(text, { exact: true }).first().waitFor();
|
||||
assert.equal(new URL(page.url()).pathname, path);
|
||||
await shot(path);
|
||||
}
|
||||
|
||||
trackAudit(page);
|
||||
await go('/org/audit');
|
||||
await page.getByRole('heading', { name: 'Audit', exact: true }).first().waitFor();
|
||||
await page.locator('[data-row-key]').first().waitFor();
|
||||
await shot('/org/audit');
|
||||
await go('/settings/audit?since=7d');
|
||||
assert.equal(new URL(page.url()).pathname, '/org/audit', '/settings/audit did not redirect');
|
||||
assert.equal(new URL(page.url()).searchParams.get('since'), '7d', 'redirect dropped the query');
|
||||
await page.locator('[data-row-key]').first().waitFor();
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
// A non-system org can arm a schedule trigger: the schedule source's built-in
|
||||
// mapping is readable there, so a binding on it is accepted. The editor's own
|
||||
// schedule list is instance-only, so the binding is written over the API.
|
||||
const assert = require('node:assert/strict');
|
||||
const { ORG, ABSENT, selectOrg } = require('./helpers/org-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, tolerate }) => {
|
||||
tolerate(ABSENT);
|
||||
await go('/');
|
||||
assert.equal((await selectOrg(page, ORG.beta)).status(), 204);
|
||||
await go('/workflows?workflow=feasibility');
|
||||
const origin = new URL(page.url()).origin;
|
||||
const headers = { 'X-Archie-CSRF': '1', Origin: origin };
|
||||
const created = await page.request.post(`${origin}/api/bindings`, {
|
||||
headers,
|
||||
data: {
|
||||
name: 'e2e schedule trigger', matcher: { source: 'schedule' }, mapping_id: 'schedule-fired',
|
||||
filter: 'schedule_id == "issue-discovery"', workflow: 'feasibility', repo_param: '', owner: '', repo: '', inputs: {},
|
||||
},
|
||||
});
|
||||
try {
|
||||
assert.equal(created.status(), 201, `binding on the built-in schedule mapping refused: ${await created.text()}`);
|
||||
const binding = await created.json();
|
||||
assert.equal(binding.org_id, ORG.beta);
|
||||
await go('/workflows?workflow=feasibility');
|
||||
await page.getByText('Starts when').first().waitFor();
|
||||
await shot('beta-trigger');
|
||||
} finally {
|
||||
if (created.ok()) await page.request.delete(`${origin}/api/bindings/${(await created.json()).id}`, { headers });
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
// The topbar org selector: choosing a member org reloads the dashboard into it,
|
||||
// Tasks and Workflows then show only that org's work, and the API refuses an
|
||||
// org the caller is not a member of.
|
||||
const assert = require('node:assert/strict');
|
||||
const { ORG, ABSENT, selectOrg } = require('./helpers/org-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, settled, tolerate }) => {
|
||||
tolerate(ABSENT);
|
||||
await go('/tasks');
|
||||
await page.getByText('Fix flaky login test').first().waitFor();
|
||||
const picker = page.getByRole('combobox', { name: 'Organisation' });
|
||||
await picker.waitFor();
|
||||
const offered = await (async () => {
|
||||
await picker.click();
|
||||
const names = await page.getByRole('option').allInnerTexts();
|
||||
await page.keyboard.press('Escape');
|
||||
return names;
|
||||
})();
|
||||
assert.deepEqual(offered.sort(), ['Beta', 'E2E'], 'selector must offer exactly the orgs the caller belongs to');
|
||||
await go('/workflows');
|
||||
await page.getByText('Parked', { exact: true }).first().waitFor();
|
||||
await shot('home-org-workflows');
|
||||
|
||||
await picker.click();
|
||||
await Promise.all([page.waitForEvent('load'), page.getByRole('option', { name: 'Beta', exact: true }).click()]);
|
||||
await settled('/workflows');
|
||||
await page.getByRole('combobox', { name: 'Organisation' }).waitFor();
|
||||
assert.equal(await page.getByText('Parked', { exact: true }).count(), 0, 'workflow run counts leaked across orgs');
|
||||
await shot('beta-workflows');
|
||||
await go('/tasks');
|
||||
await page.getByText('No tasks yet').waitFor();
|
||||
assert.equal(await page.getByText('Fix flaky login test').count(), 0, 'tasks leaked across orgs');
|
||||
await shot('beta-tasks');
|
||||
|
||||
// The selector never writes an org the caller is outside of; the server decides.
|
||||
const refused = await selectOrg(page, ORG.outsider);
|
||||
assert.equal(refused.status(), 403, 'selecting a non-member org must be forbidden');
|
||||
await go('/tasks');
|
||||
await page.getByText('No tasks yet').waitFor();
|
||||
assert.equal((await selectOrg(page, ORG.home)).status(), 204);
|
||||
await go('/tasks');
|
||||
await page.getByText('Fix flaky login test').first().waitFor();
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// Repositories and connections say what stops them serving work: the seeded
|
||||
// repository has no connection, and the seeded connection's forge is not enabled.
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/org/repositories');
|
||||
await page.getByText('acme/widgets', { exact: true }).first().waitFor();
|
||||
await page.getByText('No connection', { exact: true }).waitFor();
|
||||
await shot('repositories');
|
||||
|
||||
await go('/org/connections');
|
||||
await page.getByText('github.com', { exact: true }).first().waitFor();
|
||||
await page.getByText('Forge not enabled', { exact: true }).waitFor();
|
||||
await shot('connections');
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
// Every static route loads without errors, renders, and shows no text with
|
||||
// stray leading, trailing or doubled spaces.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function routes() {
|
||||
const src = fs.readFileSync(path.join(__dirname, '../../ui/src/router/index.ts'), 'utf8');
|
||||
const out = [];
|
||||
for (const line of src.split('\n')) {
|
||||
if (/redirect:/.test(line)) continue;
|
||||
const m = line.match(/path: "([^"]*)"/);
|
||||
if (!m || m[1].includes(':')) continue;
|
||||
if (m[1].startsWith('/')) out.push(m[1]);
|
||||
else if (m[1]) out.push('/org/' + m[1]);
|
||||
}
|
||||
return [...new Set(out)];
|
||||
}
|
||||
|
||||
module.exports = async ({ page, go, shot, fail }) => {
|
||||
const stray = new Map();
|
||||
for (const r of routes()) {
|
||||
await go(r);
|
||||
await shot(r);
|
||||
// Log lines are data, not copy.
|
||||
if (r === '/logs') continue;
|
||||
const bad = await page.evaluate(() => [...document.querySelectorAll('body *')]
|
||||
.filter((el) => !el.children.length && !el.closest('pre,code,textarea,.xterm') && el.getClientRects().length && !getComputedStyle(el).whiteSpace.startsWith('pre'))
|
||||
.map((el) => el.textContent)
|
||||
.filter((t) => t.trim() && (t !== t.trim() || / /.test(t.trim()))));
|
||||
for (const t of bad) {
|
||||
const key = JSON.stringify(t.length > 60 ? t.slice(0, 60) + '…' : t);
|
||||
stray.set(key, (stray.get(key) || new Set()).add(r));
|
||||
}
|
||||
}
|
||||
for (const [text, where] of stray) fail(`stray whitespace ${text} on ${[...where].join(', ')}`);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
// The seed (e2e/seed.sh) is visible where an operator would look for it.
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/tasks');
|
||||
await page.getByText('Fix flaky login test').first().waitFor({ timeout: 10000 });
|
||||
await shot('tasks');
|
||||
await go('/events');
|
||||
await page.getByText('e2e-hook').first().waitFor({ timeout: 10000 });
|
||||
await shot('events');
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
// Draft edits only: no saved configuration is changed.
|
||||
const assert = require('node:assert/strict');
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/settings/channels');
|
||||
const workspace = page.getByLabel('Workspace', { exact: true });
|
||||
assert.equal(await page.getByRole('region', { name: 'Unsaved changes' }).count(), 0, 'unsaved bar before any edit');
|
||||
await workspace.fill('/srv/e2e-workspace');
|
||||
await page.getByRole('link', { name: 'Models', exact: true }).click();
|
||||
await page.getByRole('heading', { name: 'Models' }).waitFor();
|
||||
await page.getByRole('link', { name: 'Channels', exact: true }).click();
|
||||
assert.equal(await page.getByLabel('Workspace', { exact: true }).inputValue(), '/srv/e2e-workspace', 'edit lost on navigation');
|
||||
const form = await page.getByText('Chat session defaults', { exact: true }).evaluate(el => el.closest('[data-slot="card"]').getBoundingClientRect().width);
|
||||
assert.ok(form <= 850, `settings form stretched to ${form}px`);
|
||||
const review = page.getByRole('button', { name: 'Review and save', exact: true });
|
||||
await review.scrollIntoViewIfNeeded();
|
||||
const unobscured = await review.evaluate(el => { const r=el.getBoundingClientRect(); const hit=document.elementFromPoint(r.x+r.width/2,r.y+r.height/2); return hit && el.contains(hit); });
|
||||
assert.ok(unobscured, 'Review and save is covered');
|
||||
await review.click();
|
||||
await page.getByRole('heading', { name: /^Review \d/ }).waitFor();
|
||||
await page.getByText('/srv/e2e-workspace', { exact: false }).last().waitFor();
|
||||
await shot('review');
|
||||
await page.getByRole('button', { name: 'Discard all', exact: true }).click();
|
||||
assert.equal(await page.getByRole('region', { name: 'Unsaved changes' }).count(), 0);
|
||||
assert.equal(await page.getByLabel('Workspace', { exact: true }).inputValue(), '', 'discard kept the edit');
|
||||
await page.setViewportSize({width:390,height:844});
|
||||
await page.getByLabel('Workspace', { exact: true }).fill('/srv/e2e-workspace');
|
||||
const mobileReview=page.getByRole('button',{name:'Review and save',exact:true});
|
||||
await mobileReview.scrollIntoViewIfNeeded();
|
||||
assert.ok(await mobileReview.evaluate(el=>{const r=el.getBoundingClientRect();return el.contains(document.elementFromPoint(r.x+r.width/2,r.y+r.height/2))}), 'mobile save action covered');
|
||||
await shot('mobile');
|
||||
await page.getByRole('button',{name:'Discard',exact:true}).click();
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
// The setup checklist reads the selected org: an org with no model to run gets a
|
||||
// Model step that leads to the page that fixes it.
|
||||
const assert = require('node:assert/strict');
|
||||
const { ORG, ABSENT, selectOrg } = require('./helpers/org-helpers.cjs');
|
||||
|
||||
module.exports = async ({ page, go, shot, settled, tolerate }) => {
|
||||
tolerate(ABSENT);
|
||||
await go('/');
|
||||
await page.getByPlaceholder('Describe a task').waitFor();
|
||||
assert.equal(await page.getByRole('link', { name: 'Model', exact: true }).count(), 0, 'an org with a model got a Model step');
|
||||
assert.equal((await selectOrg(page, ORG.beta)).status(), 204);
|
||||
await go('/');
|
||||
await page.getByText('Setup', { exact: true }).waitFor();
|
||||
const model = page.getByRole('link', { name: 'Model', exact: true });
|
||||
await model.waitFor();
|
||||
assert.equal(await model.getAttribute('href'), '/org/models');
|
||||
await shot('beta-dashboard');
|
||||
await model.click();
|
||||
await settled('/org/models');
|
||||
await shot('model-page');
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
const assert=require('node:assert/strict');
|
||||
module.exports=async({page,go,shot})=>{
|
||||
await go('/tasks');
|
||||
const base=new URL(page.url()).origin;
|
||||
const tasks=await (await page.request.get(base+'/api/tasks')).json();
|
||||
const task=tasks.find(t=>t.status==='parked' && t.attempt>0);
|
||||
assert.ok(task,'seeded stack has no parked attempt to inspect');
|
||||
const state=await (await page.request.get(`${base}/api/tasks/${task.id}/attempts`)).json();
|
||||
assert.ok(state.attempts.some(a=>a.attempt===state.current_attempt),'claimed current attempt missing');
|
||||
await go(`/tasks/${task.id}`);
|
||||
assert.equal(await page.getByText(`Attempt ${state.current_attempt} is not recorded`,{exact:true}).count(),0);
|
||||
const logs=await (await page.request.get(`${base}/api/tasks/${task.id}/logs?attempt=${state.current_attempt}&level=ERROR&limit=1`)).json();
|
||||
await page.getByRole('button',{name:'Jump to log line',exact:true}).click();
|
||||
if(logs.entries?.[0]?.id){
|
||||
await page.locator(`[data-row-key="${logs.entries[0].id}"]`).waitFor();
|
||||
await page.waitForFunction(id=>document.activeElement?.getAttribute('data-row-key')===String(id),logs.entries[0].id);
|
||||
}else{
|
||||
await page.getByText('No error log line was recorded for this attempt.',{exact:true}).waitFor();
|
||||
}
|
||||
await shot('attempt');
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
// A parked task whose blocker has a fix links to the page that supplies it, from
|
||||
// Needs attention on the dashboard and from the Stage Rail on the task page.
|
||||
// The seed's work requests park for want of a repository connection.
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
module.exports = async ({ page, go, shot, settled, skip }) => {
|
||||
await go('/');
|
||||
const tasks = await page.evaluate(async () => (await fetch('/api/tasks?limit=100')).json());
|
||||
if (!tasks.some((task) => task.status === 'parked')) skip('no parked task');
|
||||
const parked = tasks.find((task) => task.status === 'parked' && task.recovery);
|
||||
assert.ok(parked, 'no parked task in the list carries a recovery link');
|
||||
const { label, link } = parked.recovery;
|
||||
|
||||
const row = page.getByRole('link', { name: parked.title, exact: true }).locator('xpath=ancestor::*[.//a[normalize-space()="' + label + '"]][1]');
|
||||
const fromDashboard = row.getByRole('link', { name: label, exact: true });
|
||||
await fromDashboard.waitFor();
|
||||
assert.equal(await fromDashboard.getAttribute('href'), link);
|
||||
await shot('needs-attention');
|
||||
await fromDashboard.click();
|
||||
await settled(link);
|
||||
|
||||
await go(`/tasks/${parked.id}`);
|
||||
const fromRail = page.getByRole('complementary', { name: 'Task details' }).getByRole('link', { name: label, exact: true });
|
||||
await fromRail.waitFor();
|
||||
assert.equal(await fromRail.getAttribute('href'), link);
|
||||
await shot('stage-rail');
|
||||
await fromRail.click();
|
||||
await settled(link);
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
const assert = require('node:assert/strict');
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await page.route('**/api/control-plane/resources/workflow-definitions', async route => {
|
||||
await new Promise(resolve => setTimeout(resolve, 2200));
|
||||
await route.continue();
|
||||
});
|
||||
await go('/workflows');
|
||||
assert.equal(await page.getByText('No workflows', { exact: true }).count(), 0, 'loading presented as empty');
|
||||
await page.getByText('Loading workflows…', { exact: true }).waitFor({ state: 'hidden' });
|
||||
await page.getByRole('button', { name: /^implement/ }).click();
|
||||
assert.equal(await page.getByText(/workflow implement has no steps/).count(), 0, 'late definition left an empty canvas');
|
||||
await page.locator('.vue-flow__node').filter({ hasText: 'Repository' }).first().waitFor();
|
||||
await shot('loaded');
|
||||
};
|
||||
@@ -0,0 +1,118 @@
|
||||
// Workflow definition behaviour at desktop width: legacy title IDs migrate
|
||||
// to slugs, invalid expressions flag the node and toolbar alike, a pinned
|
||||
// historical run keeps its original step IDs inspectable, and handoff
|
||||
// targets round-trip between the step form and YAML.
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
module.exports = async ({ page, go, shot, settled }) => {
|
||||
await page.route('**/api/control-plane/resources/workflow-drafts', async route => {
|
||||
const response = await route.fetch();
|
||||
const data = await response.json();
|
||||
data.resource.value = { drafts: [] };
|
||||
await route.fulfill({ json: data });
|
||||
});
|
||||
const panTo = async node => {
|
||||
const flow = page.locator('.vue-flow');
|
||||
await flow.hover();
|
||||
for (let adjustment = 0; adjustment < 3; adjustment++) {
|
||||
const target = await node.boundingBox(), viewport = await flow.boundingBox();
|
||||
const delta = target.y + target.height / 2 - viewport.y - viewport.height / 2;
|
||||
if (Math.abs(delta) < 30) break;
|
||||
await page.mouse.wheel(0, delta * 2);
|
||||
await settled();
|
||||
}
|
||||
};
|
||||
// Reproduce a previously stored title ID without changing the test server.
|
||||
await go('/workflows');
|
||||
const response = await page.request.get(new URL('/api/control-plane/resources/workflow-definitions', page.url()).href);
|
||||
const resource = await response.json();
|
||||
const definition = resource.resource.value.definitions.find(entry => entry.id === 'feasibility');
|
||||
definition.yaml = definition.yaml.replace(/\bid: assess\b/, 'id: Write a Product Requirement Document').replaceAll('steps.assess.', 'steps.Write a Product Requirement Document.');
|
||||
await page.route('**/api/control-plane/resources/workflow-definitions', route => route.fulfill({ json: resource }));
|
||||
await go('/workflows?workflow=feasibility');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
const yaml = await page.getByLabel('Workflow YAML', { exact: true }).inputValue();
|
||||
assert.ok(yaml.includes('id: write-a-product-requirement-document'));
|
||||
assert.ok(yaml.includes('steps.write-a-product-requirement-document.result'));
|
||||
assert.ok(!yaml.includes('steps.Write a Product Requirement Document'));
|
||||
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
|
||||
const approval = page.locator('.vue-flow__node').filter({ hasText: 'Approval' }).first();
|
||||
await panTo(approval);
|
||||
await approval.click();
|
||||
const chip = approval.getByRole('button', { name: 'write-a-product-requirement-document', exact: true });
|
||||
await chip.waitFor();
|
||||
await chip.click();
|
||||
await shot('legacy-reference');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
const field = page.getByLabel('Workflow YAML', { exact: true });
|
||||
await field.fill((await field.inputValue()).replace('type: repo.prepare', 'type: repo.prepare\n when: not-a-valid-expression'));
|
||||
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
|
||||
const problem = page.locator('.vue-flow__node').filter({ hasText: 'Prepare worktree' }).first().locator('svg.text-danger');
|
||||
await problem.waitFor();
|
||||
const toolbarProblem = page.getByRole('status').filter({ has: page.locator('svg') });
|
||||
assert.equal(await problem.evaluate(el => getComputedStyle(el).color), await toolbarProblem.evaluate(el => getComputedStyle(el).color));
|
||||
const invalidPage = await page.evaluate(() => ({
|
||||
scrollWidth: document.documentElement.scrollWidth, width: innerWidth,
|
||||
}));
|
||||
assert.equal(invalidPage.scrollWidth, invalidPage.width, 'invalid toolbar overflows');
|
||||
await shot('validation');
|
||||
// A pinned historical run keeps its original step IDs and remains inspectable.
|
||||
const snapshot = definition.yaml;
|
||||
await page.route('**/api/tasks?*', route => {
|
||||
const workflow = new URL(route.request().url()).searchParams.get('workflow');
|
||||
return workflow === 'feasibility'
|
||||
? route.fulfill({ json: [{ id: 999999, workflow, title: 'Historical run', status: 'failed', workflow_definition_yaml: snapshot }] })
|
||||
: route.continue();
|
||||
});
|
||||
await page.route('**/api/tasks/999999/*?*', route => route.fulfill({ json: {} }));
|
||||
await page.route('**/api/tasks/999999/debug', route => route.fulfill({ json: {} }));
|
||||
await page.route('**/api/tasks/999999/attempts', route => route.fulfill({ json: { attempts: [{ attempt: 1, stages: [{ name: 'Write a Product Requirement Document', status: 'failed', error: 'Historical failure' }] }] } }));
|
||||
await go('/workflows?workflow=feasibility');
|
||||
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
|
||||
await picker.waitFor();
|
||||
assert.match(await picker.innerText(), /Run #999999/);
|
||||
const root = await page.locator('.vue-flow__node[data-id="workflow"]').boundingBox();
|
||||
const pinnedCanvas = await page.locator('.workflow-canvas').boundingBox();
|
||||
assert.ok(root.y >= pinnedCanvas.y, 'historical workflow header clipped above canvas');
|
||||
await shot('run-picker');
|
||||
await page.locator('.vue-flow').hover();
|
||||
await page.mouse.wheel(0, 550);
|
||||
await settled();
|
||||
const historicalStep = page.locator('.vue-flow__node').filter({ hasText: 'Write a Product Requirement Document' }).first();
|
||||
await panTo(historicalStep);
|
||||
await historicalStep.click();
|
||||
await page.getByText('Historical failure', { exact: true }).first().waitFor();
|
||||
await shot('historical-run');
|
||||
await page.keyboard.press('Escape');
|
||||
await picker.click();
|
||||
await page.getByRole('option', { name: 'Definition', exact: true }).click();
|
||||
assert.equal(await picker.innerText(), 'Definition');
|
||||
await shot('definition-picker');
|
||||
await go('/workflows?workflow=triage');
|
||||
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
|
||||
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
|
||||
await page.locator('.vue-flow').hover();
|
||||
await page.mouse.wheel(0, 650);
|
||||
await settled();
|
||||
const handoff = page.locator('.vue-flow__node').filter({ hasText: 'Hand off' }).first();
|
||||
await panTo(handoff);
|
||||
await handoff.click();
|
||||
const target = handoff.getByLabel('Workflow', { exact: true });
|
||||
await target.waitFor();
|
||||
assert.equal(await target.inputValue(), '{{ steps.classify.result.workflow }}');
|
||||
await target.fill('{{ steps.classify.result.alternative }}');
|
||||
await target.press('Home');
|
||||
await shot('dynamic-handoff');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
assert.ok((await page.getByLabel('Workflow YAML', { exact: true }).inputValue()).includes('steps.classify.result.alternative'));
|
||||
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
|
||||
await panTo(handoff);
|
||||
await handoff.click();
|
||||
await target.fill('implement');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
assert.ok((await page.getByLabel('Workflow YAML', { exact: true }).inputValue()).includes('workflow: implement'));
|
||||
};
|
||||
@@ -0,0 +1,83 @@
|
||||
// The workflow canvas at phone width: no page scroll, a clean topbar, lanes
|
||||
// inside the canvas, zoom controls below the graph, step and run dialogs
|
||||
// that fit, YAML without page scroll, and a pinned run header that stays
|
||||
// visible.
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
module.exports = async ({ page, go, shot, settled }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
for (const workflow of ['implement', 'feasibility']) {
|
||||
await go(`/workflows?workflow=${workflow}`);
|
||||
const canvas = page.locator('.workflow-canvas');
|
||||
await canvas.waitFor();
|
||||
const dimensions = await page.evaluate(() => ({
|
||||
height: innerHeight, width: innerWidth,
|
||||
scrollHeight: document.documentElement.scrollHeight,
|
||||
scrollWidth: document.documentElement.scrollWidth,
|
||||
}));
|
||||
assert.equal(dimensions.scrollHeight, dimensions.height, 'workflow page scrolls vertically');
|
||||
assert.equal(dimensions.scrollWidth, dimensions.width, 'workflow page scrolls horizontally');
|
||||
const topbar = page.locator('header').first();
|
||||
const bar = await topbar.boundingBox();
|
||||
assert.equal(bar.y, 0, 'blank band above topbar');
|
||||
assert.equal(await topbar.evaluate(el => getComputedStyle(el).backdropFilter), 'none');
|
||||
assert.ok(!await canvas.getByText('Works on a repository', { exact: true }).count());
|
||||
const run = page.getByRole('button', { name: new RegExp(`^(Run|Test) ${workflow}$`) });
|
||||
assert.ok(await run.isVisible(), 'Run hidden on phone');
|
||||
const box = await canvas.boundingBox();
|
||||
const start = await page.locator('.vue-flow__node[data-id="start"]').boundingBox();
|
||||
assert.ok(start.y >= box.y && start.y < box.y + box.height, 'start is outside initial viewport');
|
||||
const nodes = await page.locator('.vue-flow__node').evaluateAll(elements => elements.map(el => ({
|
||||
left: el.getBoundingClientRect().left, right: el.getBoundingClientRect().right,
|
||||
})));
|
||||
assert.ok(nodes.every(node => node.left >= box.x && node.right <= box.x + box.width), 'branch lanes clipped horizontally');
|
||||
const controls = await page.getByRole('button', { name: 'Zoom in', exact: true }).boundingBox();
|
||||
const flow = await canvas.locator('.vue-flow').boundingBox();
|
||||
assert.ok(controls.y >= flow.y + flow.height, 'zoom control overlays graph');
|
||||
await shot(workflow);
|
||||
const step = page.locator('.vue-flow__node').filter({ hasText: 'Prepare worktree' }).first();
|
||||
assert.equal(await step.locator('[data-slot="badge"]').innerText(), 'Prepare worktree');
|
||||
await step.click();
|
||||
const dialog = page.getByRole('dialog');
|
||||
await dialog.waitFor();
|
||||
const dialogBox = await dialog.boundingBox();
|
||||
assert.ok(dialogBox.x >= 0 && dialogBox.x + dialogBox.width <= 390, 'step editor exceeds phone width');
|
||||
const input = dialog.getByRole('textbox').first();
|
||||
if (await input.count()) assert.ok(await input.evaluate(el => el.getBoundingClientRect().height) >= 24, 'step form scaled down');
|
||||
await shot(`${workflow}-step`);
|
||||
await page.keyboard.press('Escape');
|
||||
await run.click();
|
||||
await page.getByRole('dialog').waitFor();
|
||||
await shot(`${workflow}-run`);
|
||||
await page.keyboard.press('Escape');
|
||||
}
|
||||
// YAML must not make the page scroll at phone width.
|
||||
await go('/workflows?workflow=feasibility');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
await settled();
|
||||
const yamlPage = await page.evaluate(() => ({
|
||||
scrollHeight: document.documentElement.scrollHeight, height: innerHeight,
|
||||
}));
|
||||
assert.equal(yamlPage.scrollHeight, yamlPage.height, 'YAML causes page scroll');
|
||||
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
|
||||
// A pinned historical run keeps its header visible on the canvas.
|
||||
const response = await page.request.get(new URL('/api/control-plane/resources/workflow-definitions', page.url()).href);
|
||||
const resource = await response.json();
|
||||
const snapshot = resource.resource.value.definitions.find(entry => entry.id === 'feasibility').yaml;
|
||||
await page.route('**/api/tasks?*', route => {
|
||||
const workflow = new URL(route.request().url()).searchParams.get('workflow');
|
||||
return workflow === 'feasibility'
|
||||
? route.fulfill({ json: [{ id: 999999, workflow, title: 'Historical run', status: 'failed', workflow_definition_yaml: snapshot }] })
|
||||
: route.continue();
|
||||
});
|
||||
await page.route('**/api/tasks/999999/*?*', route => route.fulfill({ json: {} }));
|
||||
await page.route('**/api/tasks/999999/debug', route => route.fulfill({ json: {} }));
|
||||
await page.route('**/api/tasks/999999/attempts', route => route.fulfill({ json: { attempts: [{ attempt: 1, stages: [] }] } }));
|
||||
await go('/workflows?workflow=feasibility');
|
||||
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
|
||||
await picker.waitFor();
|
||||
assert.match(await picker.innerText(), /Run #999999/);
|
||||
const root = await page.locator('.vue-flow__node[data-id="workflow"]').boundingBox();
|
||||
const pinnedCanvas = await page.locator('.workflow-canvas').boundingBox();
|
||||
assert.ok(root.y >= pinnedCanvas.y, 'historical workflow header clipped above canvas');
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
const assert = require('node:assert/strict');
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/workflows');
|
||||
await page.getByRole('button', {name:/^implement/}).click();
|
||||
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
|
||||
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
|
||||
await page.locator('.vue-flow__node').filter({hasText:'Prepare worktree'}).first().click();
|
||||
const condition=page.getByLabel('Run only when', {exact:true});
|
||||
await condition.fill('what');
|
||||
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor();
|
||||
await condition.fill('task.title');
|
||||
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor({state:'hidden'});
|
||||
const backoff=page.getByLabel('Retry backoff',{exact:true});
|
||||
await backoff.fill('yes');
|
||||
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor();
|
||||
await backoff.fill('0.5');
|
||||
await page.getByLabel('Run only when',{exact:true}).focus();
|
||||
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor({state:'hidden'});
|
||||
await page.getByRole('combobox',{name:'Unit',exact:true}).selectOption('m');
|
||||
await page.getByRole('tab',{name:'YAML',exact:true}).click();
|
||||
assert.match(await page.getByLabel('Workflow YAML',{exact:true}).inputValue(), /backoff: 30s/);
|
||||
await shot('validated');
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "archie-e2e",
|
||||
"private": true,
|
||||
"description": "Validation of a running local stack; never part of the gate",
|
||||
"scripts": {
|
||||
"check": "node run.cjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"playwright": "1.64.0"
|
||||
},
|
||||
"packageManager": "pnpm@12.10.1"
|
||||
}
|
||||
Generated
+191
@@ -0,0 +1,191 @@
|
||||
---
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
configDependencies: {}
|
||||
packageManagerDependencies:
|
||||
pnpm:
|
||||
specifier: 12.10.1
|
||||
version: 12.10.1
|
||||
|
||||
packages:
|
||||
|
||||
'@pnpm/exe.android-arm64@12.10.1':
|
||||
resolution: {integrity: sha512-CVTlHPwNvadQCJD9bGSMzWIhFX8QpjtqC2c27dhdnn/9iKzEjZ3qL62o3gHpKbIuo6qn4WxTKRoaokgNdReBig==}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@pnpm/exe.android-x64@12.10.1':
|
||||
resolution: {integrity: sha512-NFiYLIaodY7da0XIebwcU3JoP7IK/lzF7zgKSSP+9H+QcFnQ1GDfBkuBKCYJzZ+Xu0WH54neIPLBBCaOjaaauA==}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@pnpm/exe.darwin-arm64@12.10.1':
|
||||
resolution: {integrity: sha512-0O8tdQ8ijlPJudXspLMTcitMkdBEz6uUflazL5uQE0WMs85oQIp0U+5hfEktMFB64QqEhjqlvvujTwbzdr9oMg==}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@pnpm/exe.darwin-x64@12.10.1':
|
||||
resolution: {integrity: sha512-ud+1/uZOKEo8P/AsPynOJc/LNwfI0j6WwCElibj71rU9l4nIBnsSn+wWTIPZPkZ4BBSH5+82azSnAARMyJ1lNA==}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@pnpm/exe.freebsd-x64@12.10.1':
|
||||
resolution: {integrity: sha512-mj9PE5rf8uAfQQ2K66HSATMSut+lNiB4eSqFd5+azFVCMnxNSy/32xpZQJT21PhnN3Y4qbK+iKHe5nWAxSuRhw==}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@pnpm/exe.linux-arm64-musl@12.10.1':
|
||||
resolution: {integrity: sha512-xba+00wZJ8Um6rBJJjWl88uJj0tydB8dtomvjlCLvi0uL32vpa9CRP8Vv26FIXvbiZ1bo2RCzYt/eChxJVV52w==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@pnpm/exe.linux-arm64@12.10.1':
|
||||
resolution: {integrity: sha512-oBdMp69ScC9UnniG4qZAQVr2fBDSXjm4yk/72vkEVyrlwS23yMxcRQl7Qdo3sgXPAygY6TWnPRKm4rXzjoyW7w==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/exe.linux-ppc64@12.10.1':
|
||||
resolution: {integrity: sha512-Yyb3wu09h3c7mLme270uHFiVaAIUHC411Ru9LIU2BKUIstrGlXa9OqqVWoXaRgYRdFdOFknkwG7GNn6ygwLbnw==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/exe.linux-riscv64@12.10.1':
|
||||
resolution: {integrity: sha512-PdkeUFFkybknnGkWP0H22eMpIiS4OZXL5BcQzF4lh+vmrW3IaC2HOkbANKgot/PKO0Kl77pzA/6PKFxgbgfXIQ==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/exe.linux-s390x@12.10.1':
|
||||
resolution: {integrity: sha512-1okKuHKJwJPAbofDxfhZWAUxEWtee4ZSf7Pah8kcvocaJkf2WxFJ5KVTiNIvDml5GLidDQsgf7Pcf/WHbCak7Q==}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/exe.linux-x64-musl@12.10.1':
|
||||
resolution: {integrity: sha512-e6IqzVNkPa7srFKJKnY23uWJ+qz0LaRWiTUo/sHfFXRRMRzB5uNOr6qWWip/jqhdGwU91n9J7LrEYZ6e0tRczw==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@pnpm/exe.linux-x64@12.10.1':
|
||||
resolution: {integrity: sha512-ZByV0DRgWzGaDSjT5ddRBASdwz+r/qPMYh7o6RGmPQjtRGNFbSl94xY2DcAM8mqCOZJUUDtAXQ+wpBXcdpKlkg==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/exe.win32-arm64@12.10.1':
|
||||
resolution: {integrity: sha512-I7QZHcjioG7orFeCRUFUHByJ1G0zFPnAlaGGyrUvb6MGkv5oeNwNPl7t+Gp+7zHfnMcgLGJ1a+Wfim0IDw3lOw==}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@pnpm/exe.win32-x64@12.10.1':
|
||||
resolution: {integrity: sha512-4WJFdp58EKlCj0zLobrXU0vpszSZIr4X/3y/uNbAQqGW0zE+VdruZB0gFc3L2kzsUzVwTYbaCn+XEhnCYSAlTg==}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
pnpm@12.10.1:
|
||||
resolution: {integrity: sha512-ukCjfrGjcNYP6oxM8dNkwTvMzvUY6YrSvO6VT1OdONo3RY5YJho/pV4GUjRQ6g//+fSXsTW+QfLBXBZCusrObA==}
|
||||
engines: {node: '>=18.*'}
|
||||
hasBin: true
|
||||
|
||||
snapshots:
|
||||
|
||||
'@pnpm/exe.android-arm64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.android-x64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.darwin-arm64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.darwin-x64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.freebsd-x64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-arm64-musl@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-arm64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-ppc64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-riscv64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-s390x@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-x64-musl@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.linux-x64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.win32-arm64@12.10.1':
|
||||
optional: true
|
||||
|
||||
'@pnpm/exe.win32-x64@12.10.1':
|
||||
optional: true
|
||||
|
||||
pnpm@12.10.1:
|
||||
optionalDependencies:
|
||||
'@pnpm/exe.android-arm64': 12.10.1
|
||||
'@pnpm/exe.android-x64': 12.10.1
|
||||
'@pnpm/exe.darwin-arm64': 12.10.1
|
||||
'@pnpm/exe.darwin-x64': 12.10.1
|
||||
'@pnpm/exe.freebsd-x64': 12.10.1
|
||||
'@pnpm/exe.linux-arm64': 12.10.1
|
||||
'@pnpm/exe.linux-arm64-musl': 12.10.1
|
||||
'@pnpm/exe.linux-ppc64': 12.10.1
|
||||
'@pnpm/exe.linux-riscv64': 12.10.1
|
||||
'@pnpm/exe.linux-s390x': 12.10.1
|
||||
'@pnpm/exe.linux-x64': 12.10.1
|
||||
'@pnpm/exe.linux-x64-musl': 12.10.1
|
||||
'@pnpm/exe.win32-arm64': 12.10.1
|
||||
'@pnpm/exe.win32-x64': 12.10.1
|
||||
|
||||
---
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
playwright:
|
||||
specifier: 1.64.0
|
||||
version: 1.64.0
|
||||
|
||||
packages:
|
||||
|
||||
playwright-core@1.64.0:
|
||||
resolution: {integrity: sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==}
|
||||
engines: {node: '>=20'}
|
||||
hasBin: true
|
||||
|
||||
playwright@1.64.0:
|
||||
resolution: {integrity: sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==}
|
||||
engines: {node: '>=20'}
|
||||
hasBin: true
|
||||
|
||||
snapshots:
|
||||
|
||||
playwright-core@1.64.0: {}
|
||||
|
||||
playwright@1.64.0:
|
||||
dependencies:
|
||||
playwright-core: 1.64.0
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
// Drive the dashboard of a running local stack (e2e/stack.sh) in Chromium. Each module in checks/ exports async ({ page, go, shot, fail, skip, settled }).
|
||||
// A check fails on a thrown error or any console or page error. skip(reason)
|
||||
// records a skip for a missing precondition and never fails.
|
||||
//
|
||||
// node e2e/run.cjs [--headed] [--record VERSION] [list | all | check ...]
|
||||
//
|
||||
// Screenshots, results.json (the manifest) and report.html (the run report) go to
|
||||
// e2e/out/<stamp>/. --record also writes e2e/results/VERSION.md, the committed
|
||||
// evidence for a release.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const DESKTOP = { width: 1440, height: 900 };
|
||||
|
||||
// Stable label naming: kebab-case, so a route like /org/members becomes
|
||||
// org-members and / becomes home.
|
||||
function slug(label) {
|
||||
return String(label).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'home';
|
||||
}
|
||||
|
||||
class SkipCheck extends Error {}
|
||||
|
||||
const base = process.env.ARCHIE_E2E_URL || 'http://localhost:5173';
|
||||
const args = process.argv.slice(2);
|
||||
const headed = args.includes('--headed');
|
||||
if (headed) args.splice(args.indexOf('--headed'), 1);
|
||||
let record = '';
|
||||
if (args[0] === '--record') {
|
||||
record = args[1];
|
||||
if (!record || record.startsWith('-')) {
|
||||
console.error('Usage: --record VERSION all|check ...');
|
||||
process.exit(1);
|
||||
}
|
||||
args.splice(0, 2);
|
||||
}
|
||||
const available = fs.readdirSync(path.join(__dirname, 'checks')).filter((f) => f.endsWith('.cjs')).map((f) => f.slice(0, -4)).sort();
|
||||
if (!args.length || (args.length === 1 && args[0] === 'list')) {
|
||||
console.log(`Available browser checks:\n${available.map(name => ` ${name}`).join('\n')}\n\nRun: task e2e:check -- <check ...>\nAll: task e2e:check -- all\nWatch: task e2e:check -- --headed <check ...>`);
|
||||
process.exit(0);
|
||||
}
|
||||
const names = args.length === 1 && args[0] === 'all' ? available : args;
|
||||
const unknown = names.filter(name => !available.includes(name));
|
||||
if (unknown.length) {
|
||||
console.error(`Unknown checks: ${unknown.join(', ')}. Run task e2e:check to list available checks.`);
|
||||
process.exit(1);
|
||||
}
|
||||
const { chromium } = require('playwright');
|
||||
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
||||
const out = path.join(__dirname, 'out', stamp);
|
||||
fs.mkdirSync(out, { recursive: true });
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch({ headless: !headed, slowMo: headed ? 150 : 0 });
|
||||
const context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
||||
const login = await context.request.post(base + '/api/auth/login', {
|
||||
headers: { 'X-Archie-CSRF': '1', Origin: base },
|
||||
data: { email: process.env.ARCHIE_E2E_EMAIL || 'operator@example.test', password: process.env.ARCHIE_E2E_PASSWORD || 'archie-local-e2e-password' },
|
||||
});
|
||||
if (!login.ok()) {
|
||||
const error = `Test account sign-in failed (${login.status()}): ${await login.text()}`;
|
||||
await browser.close();
|
||||
throw new Error(error);
|
||||
}
|
||||
const storageState = await context.storageState();
|
||||
await context.close();
|
||||
const results = [];
|
||||
for (const name of names) {
|
||||
console.log(`run ${name}`);
|
||||
const check = require(path.join(__dirname, 'checks', name + '.cjs'));
|
||||
// A fresh page per check: open event streams pile up across navigations.
|
||||
const page = await browser.newPage({ viewport: { width: 1440, height: 900 }, storageState });
|
||||
const errors = [];
|
||||
const notes = [];
|
||||
page.on('pageerror', (e) => errors.push(String(e)));
|
||||
page.on('console', (m) => {
|
||||
if (m.type() !== 'error') return;
|
||||
const url = m.location().url;
|
||||
errors.push(url ? `${m.text()} (${url})` : m.text());
|
||||
});
|
||||
// Wait for load, never networkidle: the event stream never goes idle.
|
||||
const go = async (p) => { await page.goto(base + p, { waitUntil: 'load' }); await page.waitForTimeout(1200); };
|
||||
// Harness-owned wait: wait for a selector or URL, then settle briefly.
|
||||
const settled = async (sel, timeout = 10000) => {
|
||||
if (sel) {
|
||||
if (/^https?:/.test(sel)) await page.waitForURL(sel, { timeout });
|
||||
else if (sel.startsWith('/')) await page.waitForURL('**' + sel, { timeout });
|
||||
else await page.locator(sel).first().waitFor({ timeout });
|
||||
}
|
||||
await page.waitForTimeout(150);
|
||||
};
|
||||
const artifacts = [];
|
||||
// <check>-<kebab>[-<w>x<h>].png; the viewport suffix marks non-desktop
|
||||
// shots. A short settle precedes every capture so checks need no capture
|
||||
// wrapper of their own. Every capture is kept: a repeated label gets -2, -3...
|
||||
const shot = async (label) => {
|
||||
await page.waitForTimeout(150);
|
||||
const vp = page.viewportSize() || DESKTOP;
|
||||
const suffix = (vp.width === DESKTOP.width && vp.height === DESKTOP.height) ? '' : `-${vp.width}x${vp.height}`;
|
||||
const stem = `${name}-${slug(label)}${suffix}`;
|
||||
let file = `${stem}.png`;
|
||||
for (let n = 2; fs.existsSync(path.join(out, file)); n++) file = `${stem}-${n}.png`;
|
||||
await page.screenshot({ path: path.join(out, file) });
|
||||
artifacts.push({ file });
|
||||
return file;
|
||||
};
|
||||
// Keep a non-image artifact for this case: written as <check>-<name>.
|
||||
const attach = (fileName, data) => {
|
||||
const file = `${name}-${fileName}`;
|
||||
fs.writeFileSync(path.join(out, file), data);
|
||||
artifacts.push({ file });
|
||||
};
|
||||
const fail = (msg) => notes.push(msg);
|
||||
// Drop console errors matching re: a response the page is designed to survive.
|
||||
const tolerated = [];
|
||||
const tolerate = (re) => tolerated.push(re);
|
||||
const skip = (reason) => { throw new SkipCheck(reason || 'precondition missing'); };
|
||||
const started = Date.now();
|
||||
let error = '';
|
||||
let skipped = '';
|
||||
try { await check({ page, go, shot, fail, skip, settled, attach, tolerate }); } catch (e) {
|
||||
if (e instanceof SkipCheck) skipped = e.message;
|
||||
else error = String(e && e.message || e);
|
||||
}
|
||||
if (error || notes.length) await shot('failure').catch(() => {});
|
||||
await page.close();
|
||||
const problems = skipped ? [] : [error, ...notes, ...errors.filter((e) => !tolerated.some((re) => re.test(e)))].filter(Boolean);
|
||||
const result = { check: name, ok: problems.length === 0, ms: Date.now() - started, problems, artifacts };
|
||||
if (skipped) { result.skipped = true; result.skipReason = skipped; }
|
||||
results.push(result);
|
||||
console.log(`${skipped ? 'SKIP' : problems.length ? 'FAIL' : 'ok '} ${name}${skipped ? ` (${skipped})` : problems.length ? '\n ' + problems.join('\n ') : ''}`);
|
||||
}
|
||||
await browser.close();
|
||||
fs.writeFileSync(path.join(out, 'results.json'), JSON.stringify(results, null, 2));
|
||||
const commit = require('child_process').execFileSync('git', ['rev-parse', '--short', 'HEAD'], { cwd: __dirname, encoding: 'utf8' }).trim();
|
||||
fs.writeFileSync(path.join(out, 'report.html'), report(results, { time: new Date().toISOString(), commit }));
|
||||
if (record) writeRecord(record, results);
|
||||
console.log(`evidence: ${out}`);
|
||||
process.exit(results.every((r) => r.ok) ? 0 : 1);
|
||||
})().catch((e) => { console.error(e); process.exit(2); });
|
||||
|
||||
function esc(s) {
|
||||
return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
// One self-contained page per run: a test plan and verification record. Each
|
||||
// case carries the artifacts its own run produced; images are inlined.
|
||||
function report(results, meta) {
|
||||
const status = (r) => (r.skipped ? 'SKIP' : r.ok ? 'ok' : 'FAIL');
|
||||
const count = (s) => results.filter((r) => status(r) === s).length;
|
||||
const artifact = (a) => {
|
||||
const data = fs.readFileSync(path.join(out, a.file));
|
||||
if (!a.file.endsWith('.png')) return `<a href="${esc(a.file)}">${esc(a.file)}</a>`;
|
||||
const src = `data:image/png;base64,${data.toString('base64')}`;
|
||||
return `<figure><img src="${src}" alt="${esc(a.file)}" title="${esc(a.file)}"></figure>`;
|
||||
};
|
||||
const rows = results.map((r) => {
|
||||
const s = status(r);
|
||||
const msg = r.skipped ? [r.skipReason] : r.problems;
|
||||
return `<tr class="${s}"><td>${esc(r.check)}</td><td class="st">${s}</td><td>${r.ms}ms</td>`
|
||||
+ `<td>${msg.map((m) => `<pre>${esc(m)}</pre>`).join('')}</td>`
|
||||
+ `<td class="art">${r.artifacts.map(artifact).join('')}</td></tr>`;
|
||||
}).join('\n');
|
||||
return `<!doctype html>
|
||||
<html><head><meta charset="utf-8"><title>e2e ${esc(meta.time)}</title>
|
||||
<style>body{font:14px system-ui,sans-serif;margin:1em}table{border-collapse:collapse;width:100%}td,th{border-top:1px solid #ccc;padding:.4em;vertical-align:top;text-align:left}pre{margin:0 0 .3em;white-space:pre-wrap;font-size:12px}.st{font-weight:600}.ok .st{color:#060}.FAIL .st{color:#a00}.SKIP .st{color:#668}.FAIL{background:#fff3f3}.art{display:flex;flex-wrap:wrap;gap:.5em;border:0}figure{margin:0}.art img{width:150px;border:1px solid #ccc;cursor:zoom-in}.art img.big{position:fixed;inset:2vh 2vw;width:96vw;height:96vh;object-fit:contain;background:#fff;z-index:9;cursor:zoom-out}</style>
|
||||
</head><body><h1>e2e ${esc(meta.time)}</h1>
|
||||
<p>commit ${esc(meta.commit)} against ${esc(base)}: ${results.length} cases, ${count('ok')} ok, ${count('FAIL')} FAIL, ${count('SKIP')} SKIP</p>
|
||||
<table><tr><th>Case</th><th>Status</th><th>Time</th><th>Message</th><th>Artifacts</th></tr>
|
||||
${rows}
|
||||
</table>
|
||||
<script>document.addEventListener('click',e=>{if(e.target.matches('.art img'))e.target.classList.toggle('big')})</script>
|
||||
</body></html>
|
||||
`;
|
||||
}
|
||||
|
||||
function writeRecord(version, results) {
|
||||
const dir = path.join(__dirname, 'results');
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
const rows = results.map((r) => `| ${r.check} | ${r.skipped ? 'skip' : r.ok ? 'pass' : 'fail'} | ${r.problems.join('<br>').replace(/\|/g, '\\|') || ''} |`);
|
||||
const passed = results.filter((r) => r.ok).length;
|
||||
fs.writeFileSync(path.join(dir, `${version}.md`), [
|
||||
`# ${version}`, '',
|
||||
`Run ${new Date().toISOString()} against ${base}: ${passed} of ${results.length} checks passed.`, '',
|
||||
'| Check | Result | Problems |', '| --- | --- | --- |', ...rows, '',
|
||||
].join('\n'));
|
||||
}
|
||||
Executable
+77
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env bash
|
||||
# Seed a running local stack (e2e/stack.sh) through the dashboard's own HTTP
|
||||
# API, so the seed exercises real validation. Safe to run again: each step
|
||||
# skips what already exists.
|
||||
set -euo pipefail
|
||||
|
||||
base=${ARCHIE_E2E_API:-http://localhost:8484}
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
cookie=$(mktemp)
|
||||
trap 'rm -f "$cookie"' EXIT
|
||||
H=(-b "$cookie" -c "$cookie" -H 'Content-Type: application/json' -H 'X-Archie-CSRF: 1' -H "Origin: $base")
|
||||
|
||||
get() { curl -fsS -b "$cookie" "$base$1"; }
|
||||
post() { curl -fsS -X POST "$base$1" "${H[@]}" -d "$2"; }
|
||||
# jq-free JSON reads: py EXPR, with the parsed body as d.
|
||||
py() { python3 -c "import sys, json; d = json.load(sys.stdin); print($1)"; }
|
||||
|
||||
# This account belongs only to the isolated local test stack.
|
||||
email=${ARCHIE_E2E_EMAIL:-operator@example.test}
|
||||
password=${ARCHIE_E2E_PASSWORD:-archie-local-e2e-password}
|
||||
account=$(python3 -c 'import json,sys; print(json.dumps(dict(email=sys.argv[1], password=sys.argv[2], display_name="E2E operator", organisation_name="E2E", workspace_name="Local test", public_url=sys.argv[3])))' "$email" "$password" "${ARCHIE_E2E_URL:-http://localhost:5173}")
|
||||
if [ "$(get /api/auth/status | py 'd["setup_required"]')" = "True" ]; then
|
||||
post /api/auth/setup "$account" >/dev/null
|
||||
else
|
||||
if ! post /api/auth/login "$account" >/dev/null; then
|
||||
echo "Test account sign-in failed. Set ARCHIE_E2E_EMAIL and ARCHIE_E2E_PASSWORD to this test stack's account credentials." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Repository policy. archied applies it live; the pause lets the watch publish it.
|
||||
if ! get /api/control-plane/resources/repository-policies | grep -q '"widgets"'; then
|
||||
version=$(get /api/control-plane/resources/repository-policies | py 'd["resource"]["version"]')
|
||||
post /api/control-plane/resources/repository-policies/commands/replace \
|
||||
"{\"value\":[{\"owner\":\"acme\",\"name\":\"widgets\",\"base\":\"main\"}],\"expected_version\":$version}" >/dev/null
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# Work requests. Without Docker they park within a minute, which fills
|
||||
# Needs you, Quality gates and the task pages.
|
||||
tasks=$(get /api/tasks)
|
||||
for t in "Fix flaky login test" "Add retry to webhook sender" "Document the gate" "Speed up the CI cache" "Recovery probe"; do
|
||||
grep -qF "\"$t\"" <<<"$tasks" && continue
|
||||
post /api/work-requests "{\"repository\":\"acme/widgets\",\"workflow\":\"triage\",\"title\":\"$t\",\"instructions\":\"Do it.\"}" >/dev/null
|
||||
done
|
||||
|
||||
# An unsigned capture source with one delivery, an event type, a mapping and
|
||||
# a binding left pending approval.
|
||||
src=e2e-hook
|
||||
if ! get /api/sources | grep -q "\"$src\""; then
|
||||
post /api/sources "{\"path\":\"$src\"}" >/dev/null
|
||||
post "/api/sources/$src/signing" '{"signed":false}' >/dev/null
|
||||
post "/api/sources/$src/approve-unsigned" '{}' >/dev/null
|
||||
bash "$here/../tools/webhook-send.sh" --url "$base" --source "$src" --kind github-issue --quiet >/dev/null
|
||||
fi
|
||||
et=$(get /api/event-types | py '"".join(t["id"] for t in (d.get("event_types", []) if isinstance(d, dict) else d) if t["name"] == "issue-opened")')
|
||||
if [ -z "$et" ]; then
|
||||
et=$(post /api/event-types "{\"source\":\"$src\",\"name\":\"issue-opened\",\"rule\":{\"headers\":[],\"payload\":[{\"path\":\"action\",\"op\":\"equals\",\"value\":\"opened\"}]},\"example\":{\"headers\":{},\"body\":\"{\\\"action\\\":\\\"opened\\\",\\\"issue\\\":{\\\"title\\\":\\\"x\\\"}}\"}}" | py 'd["id"]')
|
||||
fi
|
||||
if ! get /api/bindings | grep -q '"e2e-binding"'; then
|
||||
mapping=$(post /api/mappings "{\"name\":\"e2e-issue\",\"source_hint\":\"$src\",\"event_type_id\":\"$et\",\"fields\":[{\"name\":\"title\",\"path\":\"issue.title\",\"type\":\"string\",\"required\":true}]}" | py 'd["id"]')
|
||||
post /api/bindings "{\"name\":\"e2e-binding\",\"matcher\":{\"source\":\"$src\"},\"mapping_id\":\"$mapping\",\"workflow\":\"feasibility\",\"owner\":\"acme\",\"repo\":\"widgets\"}" >/dev/null
|
||||
fi
|
||||
|
||||
# Two more orgs: the operator owns Beta, so the org selector offers it; Gamma
|
||||
# belongs to an identity the operator is not a member of, so selecting it is refused.
|
||||
orgs=$(get /api/orgs)
|
||||
if ! grep -q '"org-beta"' <<<"$orgs"; then
|
||||
operator=$(get /api/identities | py '"".join(i["id"] for i in d["identities"] if i["display_name"] == "E2E operator")')
|
||||
post /api/orgs "{\"id\":\"org-beta\",\"name\":\"Beta\",\"owner_identity\":\"$operator\"}" >/dev/null
|
||||
fi
|
||||
if ! grep -q '"org-gamma"' <<<"$orgs"; then
|
||||
outsider=$(post /api/identities '{"display_name":"E2E outsider","kind":"user"}' | py 'd["id"]')
|
||||
post /api/orgs "{\"id\":\"org-gamma\",\"name\":\"Gamma\",\"owner_identity\":\"$outsider\"}" >/dev/null
|
||||
fi
|
||||
|
||||
echo "seeded: $(get /api/tasks | py 'len(d.get("tasks", d) if isinstance(d, dict) else d)') tasks"
|
||||
Executable
+176
@@ -0,0 +1,176 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the whole stack as local processes against a throwaway PostgreSQL 18,
|
||||
# for manual and scripted checks. Never part of the gate. Nothing here reads
|
||||
# the installed config: XDG paths point into the dev directory.
|
||||
#
|
||||
# e2e/stack.sh start | stop | restart <service> | status | reset
|
||||
set -Eeuo pipefail
|
||||
|
||||
repo=$(cd "$(dirname "$0")/.." && pwd)
|
||||
dir=${ARCHIE_DEV_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/archie-dev}
|
||||
pgport=${ARCHIE_DEV_PGPORT:-55432}
|
||||
services=(archie-state-store archie-gateway archied archie-messaging archie-ui)
|
||||
|
||||
# initdb refuses root, and postgres cannot traverse root's home.
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
pgdata=/var/lib/archie-dev/pg
|
||||
as_pg() { runuser -u postgres -- "$@"; }
|
||||
else
|
||||
pgdata=$dir/pg
|
||||
as_pg() { "$@"; }
|
||||
fi
|
||||
|
||||
export XDG_CONFIG_HOME=$dir/config XDG_DATA_HOME=$dir/data XDG_STATE_HOME=$dir/state
|
||||
|
||||
pgbin() {
|
||||
local d
|
||||
for d in /usr/lib/postgresql/18/bin "$(dirname "$(command -v postgres 2>/dev/null || echo /x/x)")"; do
|
||||
if [ -x "$d/postgres" ] && "$d/postgres" --version | grep -q ' 18\.'; then
|
||||
echo "$d"
|
||||
return
|
||||
fi
|
||||
done
|
||||
echo "PostgreSQL 18 server not found" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
check_process() {
|
||||
local pid
|
||||
if [ ! -f "$dir/pids/$1" ] || ! pid=$(cat "$dir/pids/$1") || ! kill -0 "$pid" 2>/dev/null; then
|
||||
echo "$1 exited; see $dir/logs/$1.log" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
wait_port() {
|
||||
for _ in $(seq 1 "${3:-60}"); do
|
||||
check_process "$2" || return 1
|
||||
(echo >"/dev/tcp/127.0.0.1/$1") 2>/dev/null && return 0
|
||||
sleep 1
|
||||
done
|
||||
echo "$2 did not listen on $1; see $dir/logs/$2.log" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
start_pg() {
|
||||
local bin
|
||||
bin=$(pgbin)
|
||||
if [ ! -f "$pgdata/PG_VERSION" ]; then
|
||||
mkdir -p "$pgdata"
|
||||
[ "$(id -u)" -ne 0 ] || chown postgres "$pgdata"
|
||||
as_pg "$bin/initdb" -D "$pgdata" -U archie --auth=trust >/dev/null
|
||||
fi
|
||||
if ! as_pg "$bin/pg_ctl" -D "$pgdata" status >/dev/null 2>&1; then
|
||||
as_pg "$bin/pg_ctl" -D "$pgdata" -w -l "$pgdata/server.log" \
|
||||
-o "-p $pgport -k $pgdata -c listen_addresses=127.0.0.1" start >/dev/null
|
||||
fi
|
||||
"$bin/psql" -h 127.0.0.1 -p "$pgport" -U archie -d postgres -qtAc \
|
||||
"SELECT 1 FROM pg_database WHERE datname = 'archie'" | grep -q 1 ||
|
||||
"$bin/createdb" -h 127.0.0.1 -p "$pgport" -U archie archie
|
||||
}
|
||||
|
||||
prepare() {
|
||||
mkdir -p "$dir"/{bin,logs,pids} "$XDG_CONFIG_HOME/archie" "$XDG_DATA_HOME" "$XDG_STATE_HOME"
|
||||
[ -f "$XDG_CONFIG_HOME/archie/config.toml" ] || cp "$repo/config.example.toml" "$XDG_CONFIG_HOME/archie/config.toml"
|
||||
sed "s#^database_url = .*#database_url = \"postgres://archie@127.0.0.1:$pgport/archie?sslmode=disable\"#" \
|
||||
"$repo/deployments/dev.toml" >"$dir/dev.toml"
|
||||
local version
|
||||
version=$(git -C "$repo" describe --tags --exact-match --match 'v[0-9]*' 2>/dev/null || true)
|
||||
version=${version#v}
|
||||
[ -n "$version" ] || version="dev+$(git -C "$repo" rev-parse --short=12 HEAD)"
|
||||
task --dir "$repo" dev:tls
|
||||
task --dir "$repo" --force build BIN_DIR="$dir/bin" GATEWAY_VERSION="$version" RUNTIME_VERSION="$version"
|
||||
}
|
||||
|
||||
# spawn NAME DIR CMD...: a detached session leader, so stop takes its children.
|
||||
spawn() {
|
||||
local name=$1 cwd=$2
|
||||
shift 2
|
||||
rm -f "$dir/pids/$name"
|
||||
setsid -f bash -c 'cd "$1" && echo $$ >"$2" && shift 2 && exec "$@"' _ "$cwd" "$dir/pids/$name" "$@" \
|
||||
</dev/null >"$dir/logs/$name.log" 2>&1 9>&-
|
||||
for _ in $(seq 1 50); do
|
||||
[ ! -f "$dir/pids/$name" ] || { check_process "$name"; return; }
|
||||
sleep 0.1
|
||||
done
|
||||
echo "$name did not start; see $dir/logs/$name.log" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
start_service() {
|
||||
spawn "$1" "$repo" "$dir/bin/$1" -config-overlay "$dir/dev.toml"
|
||||
}
|
||||
|
||||
stop_pid() {
|
||||
local f=$1 pid
|
||||
[ -f "$f" ] || return 0
|
||||
pid=$(cat "$f")
|
||||
if kill -- "-$pid" 2>/dev/null; then
|
||||
for _ in $(seq 1 20); do kill -0 "$pid" 2>/dev/null || break; sleep 0.5; done
|
||||
kill -9 -- "-$pid" 2>/dev/null || true
|
||||
fi
|
||||
rm -f "$f"
|
||||
}
|
||||
|
||||
start() {
|
||||
local port
|
||||
for port in 9091 8585 8586 8587 8485 8484 5173; do
|
||||
if (echo >"/dev/tcp/127.0.0.1/$port") 2>/dev/null; then
|
||||
echo "Port $port is already in use. Run task e2e:down before task e2e:up; if it stays occupied, inspect its owner with ss -ltnp." >&2
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
trap 'trap - ERR; stop' ERR
|
||||
prepare
|
||||
start_pg 9>&-
|
||||
start_service archie-state-store
|
||||
wait_port 9091 archie-state-store 90
|
||||
local s
|
||||
for s in archie-gateway archied archie-messaging archie-ui; do start_service "$s"; done
|
||||
wait_port 8585 archie-gateway
|
||||
wait_port 8586 archie-messaging
|
||||
wait_port 8485 archied
|
||||
wait_port 8484 archie-ui
|
||||
[ -d "$repo/ui/node_modules" ] || (cd "$repo/ui" && pnpm install --frozen-lockfile >/dev/null)
|
||||
spawn vite "$repo/ui" pnpm exec vite --host 127.0.0.1 --port 5173 --strictPort
|
||||
wait_port 5173 vite
|
||||
for s in "${services[@]}" vite; do check_process "$s"; done
|
||||
trap - ERR
|
||||
echo "dashboard: http://localhost:5173 logs: $dir/logs"
|
||||
}
|
||||
|
||||
stop() {
|
||||
local f
|
||||
for f in "$dir"/pids/*; do stop_pid "$f"; done
|
||||
if [ -f "$pgdata/PG_VERSION" ]; then
|
||||
as_pg "$(pgbin)/pg_ctl" -D "$pgdata" -m fast stop >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Keep concurrent invocations from replacing each other's process records.
|
||||
mkdir -p "$dir"
|
||||
exec 9>"$dir/stack.lock"
|
||||
flock -n 9 || { echo "Another e2e stack command is running" >&2; exit 1; }
|
||||
|
||||
case ${1:-} in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart)
|
||||
stop_pid "$dir/pids/${2:?service}"
|
||||
start_service "$2"
|
||||
;;
|
||||
status)
|
||||
for f in "$dir"/pids/*; do
|
||||
[ -f "$f" ] || continue
|
||||
if kill -0 "$(cat "$f")" 2>/dev/null; then echo "up $(basename "$f")"; else echo "down $(basename "$f")"; fi
|
||||
done
|
||||
;;
|
||||
reset)
|
||||
stop
|
||||
rm -rf "$dir" "$pgdata"
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 start | stop | restart <service> | status | reset" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
@@ -3,7 +3,7 @@
|
||||
# the network-investigator profile package (archipelago: profiles/network-investigator).
|
||||
#
|
||||
# Build: docker compose build agent-net
|
||||
ARG AGENT_IMAGE=ghcr.io/samcharles93/archie-agent:latest
|
||||
ARG AGENT_IMAGE=git.catlow.cloud/sam/archie-agent:latest
|
||||
FROM ${AGENT_IMAGE}
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
|
||||
@@ -1,104 +1,87 @@
|
||||
module github.com/samcharles93/archie-core
|
||||
|
||||
go 1.27.2
|
||||
go 1.27.3
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.25.3 // indirect
|
||||
dario.cat/mergo v1.0.2 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261008225312-e8a9660d7aea // indirect
|
||||
github.com/Microsoft/go-winio v0.6.3 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.4 // indirect
|
||||
github.com/ProtonMail/go-crypto v1.5.2 // indirect
|
||||
github.com/antithesishq/antithesis-sdk-go v0.8.0 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cloudflare/circl v1.6.5 // indirect
|
||||
github.com/containerd/errdefs v1.0.0 // indirect
|
||||
github.com/containerd/errdefs/pkg v0.3.0 // indirect
|
||||
github.com/containerd/log v0.2.0 // indirect
|
||||
github.com/containerd/platforms v1.0.0-rc.5 // indirect
|
||||
github.com/cpuguy83/dockercfg v0.3.2 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-connections v0.8.2 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/dustin/go-humanize v1.1.0 // indirect
|
||||
github.com/ebitengine/purego v0.11.1 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/fatih/color v1.19.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.1.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.6 // indirect
|
||||
github.com/go-git/gcfg/v2 v2.0.2 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.1.5 // indirect
|
||||
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect
|
||||
github.com/go-logr/logr v1.4.4 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
|
||||
github.com/go-webauthn/x v0.3.1 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/go-tpm v0.9.8 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0 // indirect
|
||||
github.com/hashicorp/yamux v0.1.2 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.3 // indirect
|
||||
github.com/kevinburke/ssh_config v1.6.0 // indirect
|
||||
github.com/klauspost/compress v1.20.1 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect
|
||||
github.com/magiconair/properties v1.18.12 // indirect
|
||||
github.com/klauspost/compress v1.20.3 // indirect
|
||||
github.com/mattn/go-colorable v0.1.16 // indirect
|
||||
github.com/mattn/go-isatty v0.0.24 // indirect
|
||||
github.com/mfridman/interpolate v0.0.2 // indirect
|
||||
github.com/minio/highwayhash v1.0.4 // indirect
|
||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||
github.com/moby/go-archive v0.3.3 // indirect
|
||||
github.com/moby/patternmatcher v0.6.1 // indirect
|
||||
github.com/moby/sys/sequential v0.7.0 // indirect
|
||||
github.com/moby/sys/user v0.4.1 // indirect
|
||||
github.com/moby/sys/userns v0.2.1 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/nats-io/jwt/v2 v2.8.2 // indirect
|
||||
github.com/nats-io/nkeys v0.4.16 // indirect
|
||||
github.com/nats-io/nuid v1.0.1 // indirect
|
||||
github.com/oklog/run v1.2.0 // indirect
|
||||
github.com/philhofer/fwd v1.2.1 // indirect
|
||||
github.com/pjbgf/sha1cd v0.7.0 // indirect
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 // indirect
|
||||
github.com/segmentio/asm v1.2.1 // indirect
|
||||
github.com/segmentio/encoding v0.5.4 // indirect
|
||||
github.com/sergi/go-diff v1.4.0 // indirect
|
||||
github.com/sethvargo/go-retry v0.5.0 // indirect
|
||||
github.com/shirou/gopsutil/v4 v4.26.9 // indirect
|
||||
github.com/sirupsen/logrus v1.10.2 // indirect
|
||||
github.com/stretchr/testify v1.12.1 // indirect
|
||||
github.com/tklauser/go-sysconf v0.4.0 // indirect
|
||||
github.com/tklauser/numcpus v0.12.0 // indirect
|
||||
github.com/tinylib/msgp v1.6.5 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 // indirect
|
||||
go.opentelemetry.io/otel v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/log v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.47.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.5 // indirect
|
||||
golang.org/x/crypto v0.57.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20261007192929-f45ad48fbe92 // indirect
|
||||
golang.org/x/sync v0.23.0 // indirect
|
||||
golang.org/x/text v0.42.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e // indirect
|
||||
golang.org/x/sync v0.24.0 // indirect
|
||||
golang.org/x/text v0.43.0 // indirect
|
||||
golang.org/x/time v0.16.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261005182115-fad411399dd8 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8 // indirect
|
||||
modernc.org/libc v1.77.1 // indirect
|
||||
modernc.org/sqlite v1.59.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/cel-go v0.32.0
|
||||
github.com/BurntSushi/toml v1.6.0
|
||||
github.com/cedar-policy/cedar-go v1.8.0
|
||||
github.com/containerd/errdefs v1.0.0
|
||||
github.com/coreos/go-oidc/v3 v3.21.0
|
||||
github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.8
|
||||
github.com/go-git/go-billy/v6 v6.0.0-beta.1
|
||||
github.com/go-git/go-git/v6 v6.0.0-beta.1
|
||||
github.com/go-jose/go-jose/v4 v4.1.6
|
||||
github.com/go-telegram/bot v1.27.0
|
||||
github.com/go-webauthn/webauthn v0.18.2
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/google/jsonschema-go v0.4.3
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/hashicorp/go-hclog v1.6.3
|
||||
@@ -107,24 +90,31 @@ require (
|
||||
github.com/moby/moby/api v1.56.1
|
||||
github.com/moby/moby/client v0.6.2
|
||||
github.com/modelcontextprotocol/go-sdk v1.8.0
|
||||
github.com/nats-io/nats-server/v2 v2.15.0
|
||||
github.com/nats-io/nats.go v1.54.0
|
||||
github.com/nats-io/nats-server/v2 v2.15.1
|
||||
github.com/nats-io/nats.go v1.55.0
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/image-spec v1.1.1
|
||||
github.com/pressly/goose/v3 v3.28.0
|
||||
github.com/samcharles93/ai-sdk v0.1.43
|
||||
github.com/testcontainers/testcontainers-go v0.44.0
|
||||
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0
|
||||
github.com/pressly/goose/v3 v3.29.0
|
||||
github.com/samcharles93/ai-sdk v0.6.0
|
||||
go.lsp.dev/jsonrpc2 v1.0.1
|
||||
go.lsp.dev/protocol v1.0.1
|
||||
go.lsp.dev/uri v1.0.1
|
||||
golang.org/x/mod v0.41.0
|
||||
golang.org/x/net v0.60.0
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0
|
||||
go.opentelemetry.io/otel v1.47.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0
|
||||
go.opentelemetry.io/otel/sdk v1.47.0
|
||||
go.opentelemetry.io/otel/trace v1.47.0
|
||||
go.opentelemetry.io/proto/otlp v1.11.1
|
||||
golang.org/x/crypto v0.58.0
|
||||
golang.org/x/mod v0.42.0
|
||||
golang.org/x/net v0.62.0
|
||||
golang.org/x/oauth2 v0.37.0
|
||||
golang.org/x/sys v0.48.0
|
||||
golang.org/x/term v0.46.0
|
||||
golang.org/x/sys v0.49.0
|
||||
golang.org/x/term v0.47.0
|
||||
google.golang.org/grpc v1.86.0-dev
|
||||
google.golang.org/protobuf v1.36.12
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
oras.land/oras-go/v2 v2.6.2
|
||||
oras.land/oras-go/v2 v2.7.0
|
||||
)
|
||||
@@ -2,16 +2,10 @@ cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk=
|
||||
cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU=
|
||||
cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0=
|
||||
cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
|
||||
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
|
||||
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261008225312-e8a9660d7aea h1:NdVLskj4PaItpD133shAdyHicndDbcDGpManoqR032g=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261008225312-e8a9660d7aea/go.mod h1:Ue4ymb+lBljb9NjkybMTsOYOSjH/cJTim9nrhvRJAUU=
|
||||
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
|
||||
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/Microsoft/go-winio v0.6.3 h1:M/52tsoyTfwaxajLnXZm7PqkbMGRH8iSWP+8fcg9MQ4=
|
||||
github.com/Microsoft/go-winio v0.6.3/go.mod h1:ma0QpxizD4fyyzJ1C7MIblymTD2Nxz5Mho/3CepwIZg=
|
||||
github.com/Microsoft/go-winio v0.6.4 h1:kJF2pamtYCWXf0xAT8sAkwKC0pMl2HYBrRPHAqyUc+g=
|
||||
github.com/Microsoft/go-winio v0.6.4/go.mod h1:1xl5JXG4ze/m74GH6Dc4Mwxfc3VL5siRVQjIAlHH07U=
|
||||
github.com/ProtonMail/go-crypto v1.5.2 h1:cucYnvqcY7UOXVD//mSyjeaPY0SSN3v5cDkYPxumINk=
|
||||
github.com/ProtonMail/go-crypto v1.5.2/go.mod h1:/RaSu30DaKO4RY+XdV/ACcCcZkGr7AhUIduq5sjzzCo=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
|
||||
@@ -26,8 +20,8 @@ github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/
|
||||
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
|
||||
github.com/cedar-policy/cedar-go v1.8.0 h1:9gcU7EHXwHC2RMdpph68yTAkdB3behTTssC+kt4GoS8=
|
||||
github.com/cedar-policy/cedar-go v1.8.0/go.mod h1:h5+3CVW1oI5LXVskJG+my9TFCYI5yjh/+Ul3EJie6MI=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cloudflare/circl v1.6.5 h1:O64F26HEqNhznd/hrC5KZXVKYuKM2rx4deZDTc4ihQA=
|
||||
@@ -42,10 +36,6 @@ github.com/containerd/platforms v1.0.0-rc.5 h1:vXd569rDrz8LeMXzAnBsy6LADV5YtsD8o
|
||||
github.com/containerd/platforms v1.0.0-rc.5/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A=
|
||||
github.com/coreos/go-oidc/v3 v3.21.0 h1:wZo4Q9Pum8dYEj0eMUPrqR+kvuGkeUplbLpNCkBqoWM=
|
||||
github.com/coreos/go-oidc/v3 v3.21.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4=
|
||||
github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
|
||||
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
|
||||
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
|
||||
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||
@@ -58,8 +48,6 @@ github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.8 h1:ay2XEj0yW3uzsNwN3KXS/c4nlneH
|
||||
github.com/docker/sandbox-kit-spec/v3 v3.0.0-m.8/go.mod h1:4G6VgFAp9eaQkwy7DbZbOfWRD/Mjvc/TnEtQBRRMEsA=
|
||||
github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg=
|
||||
github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI=
|
||||
github.com/ebitengine/purego v0.11.1 h1:2zpWRSQNVKN4eKsKO9eM1ILDgWfYMY9GwqRmK6XeQ/0=
|
||||
github.com/ebitengine/purego v0.11.1/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
@@ -67,6 +55,8 @@ github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w=
|
||||
github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE=
|
||||
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
|
||||
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
|
||||
github.com/fxamacker/cbor/v2 v2.9.6 h1:NHZPxuUjJXQjX9itA785y/5NKSlI4HQ+S7noZsmI7hs=
|
||||
github.com/fxamacker/cbor/v2 v2.9.6/go.mod h1:4EaZp6ClVunETjQ4GHmGNzysDK91Lr+r6Yz6tJqzVCw=
|
||||
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
|
||||
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
|
||||
github.com/go-git/gcfg/v2 v2.0.2 h1:MY5SIIfTGGEMhdA7d7JePuVVxtKL7Hp+ApGDJAJ7dpo=
|
||||
@@ -77,8 +67,8 @@ github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1 h1:gmqi2jvsreu0s8JMLylYDFq4s
|
||||
github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1/go.mod h1:ECf1MqJlBdYpKggBrOXjo/0EnvRZx6D++I86UYjPgAQ=
|
||||
github.com/go-git/go-git/v6 v6.0.0-beta.1 h1:1t+vJYGDBN6f9GRWskgWx5UjXPFUa7wfffZZZ2C5GtA=
|
||||
github.com/go-git/go-git/v6 v6.0.0-beta.1/go.mod h1:ugDlr38Wwc+fOw85J+Oluh5TNXQtJgYMcriOljg3l4s=
|
||||
github.com/go-jose/go-jose/v4 v4.1.5 h1:RjgjO2LOtWOJKUC5wpwY9LR3B3vwVAz6JS2YHfYU6eA=
|
||||
github.com/go-jose/go-jose/v4 v4.1.5/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
|
||||
github.com/go-jose/go-jose/v4 v4.1.6 h1:sNRkftxFJxwsILiQukqp5z83QBSmntVwmgRY7AqBDO4=
|
||||
github.com/go-jose/go-jose/v4 v4.1.6/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
|
||||
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 h1:UADEEmDKgfXbtnGJZ97beY5XLo9ZechG1nlU4KnRrkE=
|
||||
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
@@ -86,11 +76,14 @@ github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8=
|
||||
github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
|
||||
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
|
||||
github.com/go-telegram/bot v1.27.0 h1:PG9yBDzM8O26oUerE9SZwWlHon4RpH8WcNslZ7CEZmE=
|
||||
github.com/go-telegram/bot v1.27.0/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM=
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/go-webauthn/webauthn v0.18.2 h1:0BeftmEHU7i3Dv0VFwBtidy/ba37Vcdjvqst9EYu8Sk=
|
||||
github.com/go-webauthn/webauthn v0.18.2/go.mod h1:hEXaOuLxvZ3zG9miZe3ehlyeVso9AtklXG+kTn36k+A=
|
||||
github.com/go-webauthn/x v0.3.1 h1:1ff37z3XfmTTomkhlURgGizLIDyOvPgTt2t9nlzKLRo=
|
||||
github.com/go-webauthn/x v0.3.1/go.mod h1:ZInxAynYXfBPvvm5gzKZ7geBlL23K71xASMgohHl/Rg=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
@@ -99,10 +92,14 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=
|
||||
github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
|
||||
github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba h1:qJEJcuLzH5KDR0gKc0zcktin6KSAwL7+jWKBYceddTc=
|
||||
github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba/go.mod h1:EFYHy8/1y2KfgTAsx7Luu7NGhoxtuVHnNo8jE7FikKc=
|
||||
github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+DQPd0=
|
||||
github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0 h1:QMILzF8BA7xftE4zVORkRrlv08m12St3csK4RsyRgRs=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.32.0/go.mod h1:+ZQ6iUL8+ATyxGDQNuRKpNwJFdGDUi0e7E1QL9MvI7U=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-plugin v1.8.0 h1:ie8S6RRY8RvB2usYZv+AAZ/wBvx2AU5p5QeP5j/FORs=
|
||||
@@ -121,8 +118,8 @@ github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5Xum
|
||||
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
|
||||
github.com/kevinburke/ssh_config v1.6.0 h1:J1FBfmuVosPHf5GRdltRLhPJtJpTlMdKTBjRgTaQBFY=
|
||||
github.com/kevinburke/ssh_config v1.6.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M=
|
||||
github.com/klauspost/compress v1.20.1 h1:T7kKElXUMXrUJ2E9QhQhxFtcK5rPyLdsGZvdbLMPdiQ=
|
||||
github.com/klauspost/compress v1.20.1/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
|
||||
github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4=
|
||||
github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
@@ -130,12 +127,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 h1:eveIIGn4BGM3qknO74omf6HYr30/exH+eVUTuAgwjZ0=
|
||||
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
|
||||
github.com/magiconair/properties v1.18.12 h1:sT9zQpvTB3B4gzrX0tmZNTEaGyg8Zw55MFYRE32Mr9I=
|
||||
github.com/magiconair/properties v1.18.12/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A=
|
||||
@@ -144,69 +135,51 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
|
||||
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
|
||||
github.com/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI=
|
||||
github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o=
|
||||
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
|
||||
github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg=
|
||||
github.com/minio/highwayhash v1.0.4 h1:asJizugGgchQod2ja9NJlGOWq4s7KsAWr5XUc9Clgl4=
|
||||
github.com/minio/highwayhash v1.0.4/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ=
|
||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME=
|
||||
github.com/moby/go-archive v0.3.3/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE=
|
||||
github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c=
|
||||
github.com/moby/moby/api v1.56.1/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk=
|
||||
github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N4=
|
||||
github.com/moby/moby/client v0.6.2/go.mod h1:DGcnO7qmPJrqobx/ggQgQ/AUk+2wgVdQv7uxB0/mEsc=
|
||||
github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U=
|
||||
github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
||||
github.com/moby/sys/mount v0.3.5 h1:eS3fsZTjHaBihwjp4/+5Z3jxqLXYsbwxqpVSfFv3M00=
|
||||
github.com/moby/sys/mount v0.3.5/go.mod h1:WUQDO+/uCiCIkIztx8SrwIDVn2dtMFRBebRhpDFT71M=
|
||||
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
|
||||
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
|
||||
github.com/moby/sys/sequential v0.7.0 h1:ASQNGNROJSuOO6LL6bPHbKvuZu6NU8P4ldPWk31zj/8=
|
||||
github.com/moby/sys/sequential v0.7.0/go.mod h1:NfSTAp6V3fw4tmkD62PEcOKeZKquXT8VKCkf7aVR79o=
|
||||
github.com/moby/sys/user v0.4.1 h1:RgjRlaDKi/Xmyrz4t8lyzXT6v2ooFeO/7xtchmhVWE0=
|
||||
github.com/moby/sys/user v0.4.1/go.mod h1:E9QsW5WRe1kUAf7kW8hXKwu1uhsZEAdPLYHYSDudF4Y=
|
||||
github.com/moby/sys/userns v0.2.1 h1:4OvdM7BcPkASbuouHsbW3aeMJSFlYDldBRnXVZhaRk8=
|
||||
github.com/moby/sys/userns v0.2.1/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
|
||||
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
|
||||
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
|
||||
github.com/modelcontextprotocol/go-sdk v1.8.0 h1:KIvahhYqwtbeniWVPs3TcXEA7b8jEtwfBpOTAI+Urx4=
|
||||
github.com/modelcontextprotocol/go-sdk v1.8.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts=
|
||||
github.com/nats-io/jwt/v2 v2.8.2 h1:XXRgB60MSTnqsRwejQurVDs/hcv2dkt+86GjI+I/bMc=
|
||||
github.com/nats-io/jwt/v2 v2.8.2/go.mod h1:Ag/56sq9OblL4JgdYufDd16Egb17Kr/8WwwuO/forVc=
|
||||
github.com/nats-io/nats-server/v2 v2.15.0 h1:M99yf0y05rTr46/qc/Is6ZAowI58Ryp2SjufLCUeVJc=
|
||||
github.com/nats-io/nats-server/v2 v2.15.0/go.mod h1:5qLF4CDGzZVFt//3fUrY1ePpwbi05r7QHPNroSUtolk=
|
||||
github.com/nats-io/nats.go v1.54.0 h1:vsXoOxjHp/GmPUN+EcI7uOf/uB+iAP+kEsAFNQN0yzA=
|
||||
github.com/nats-io/nats.go v1.54.0/go.mod h1:y+DZoD1oBOYfZTU681eTUiUjI0vbqYGixNVFHcjHJ0k=
|
||||
github.com/nats-io/nats-server/v2 v2.15.1 h1:fK3AeYFIji1Smng60jB0hVoAPZezA/UzsaI3BqXFNEI=
|
||||
github.com/nats-io/nats-server/v2 v2.15.1/go.mod h1:yeuYRtKVKIFtmMz2/YPk+6hvmNBnk+WwTUzErBdH6IE=
|
||||
github.com/nats-io/nats.go v1.55.0 h1:Ng8QKHdvdHIWoaiq0+d/aH1BWkxvcJxWJ0Y/9BPKx3M=
|
||||
github.com/nats-io/nats.go v1.55.0/go.mod h1:y+DZoD1oBOYfZTU681eTUiUjI0vbqYGixNVFHcjHJ0k=
|
||||
github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg=
|
||||
github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=
|
||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
|
||||
github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g=
|
||||
github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E=
|
||||
github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
|
||||
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
|
||||
github.com/philhofer/fwd v1.2.1 h1:UtpS73q8bFgy/yH3gCq8LSNvj5gv/FowNOiWZa7uKwQ=
|
||||
github.com/philhofer/fwd v1.2.1/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
|
||||
github.com/pjbgf/sha1cd v0.7.0 h1:ZRNPKHj+gfkLBf0KJv/p1Hmz+7bqCT5o311YX0nq+DA=
|
||||
github.com/pjbgf/sha1cd v0.7.0/go.mod h1:pKR5Li+qTCo+ebqITZfwPlJGoCFCvSO00qxjbNtTUFQ=
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 h1:XA01Vk/wv9YikCi1V51yRzIHPMT5of9+cMpZoZvDn/M=
|
||||
github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
||||
github.com/pressly/goose/v3 v3.28.0 h1:D2M+iL31GmpZxSHOhX8mqyqAT3CXnokUmm0eKoSP+Vc=
|
||||
github.com/pressly/goose/v3 v3.28.0/go.mod h1:v26MOuB8bL3kzzrt3Vqhb3R0PRVsl8hFQKdrht/L6Rk=
|
||||
github.com/pressly/goose/v3 v3.29.0 h1:dtEnBCT7CqkHIUCdgrXsrmeisaN8gFkRU4Y5OEwif4o=
|
||||
github.com/pressly/goose/v3 v3.29.0/go.mod h1:plA4aP4+u+Q3FMTgbFbhF8TuAWpAdfWpoFGkJsIFWh0=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/samcharles93/ai-sdk v0.1.43 h1:u/OER6FuRv/KkS/5xnRttABPD2UNHR2BmcJeRe07hyw=
|
||||
github.com/samcharles93/ai-sdk v0.1.43/go.mod h1:u4zrQ9/Q58L5mNEut4bNQ1ks+RCKq71LN5EDz2N/0Zk=
|
||||
github.com/samcharles93/ai-sdk v0.6.0 h1:ANHutwvl/K233Dkflc2vKT48qsXRT1iRwjL5S1Dm+jY=
|
||||
github.com/samcharles93/ai-sdk v0.6.0/go.mod h1:NNkiUZ2qfezDHhmF8zHibKsPgpU8b5jphDQ0n2t1KL0=
|
||||
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
|
||||
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
|
||||
@@ -215,31 +188,21 @@ github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
|
||||
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
||||
github.com/sethvargo/go-retry v0.5.0 h1:JYfFKmVJ8ER06GReN1efzc5cm52BrVsFVzmcHiKJwfY=
|
||||
github.com/sethvargo/go-retry v0.5.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg=
|
||||
github.com/shirou/gopsutil/v4 v4.26.9 h1:CaBo/hBFqvlJoLvAQEKdHdf5GD97/MN2ACfyv63+2Ig=
|
||||
github.com/shirou/gopsutil/v4 v4.26.9/go.mod h1:nKH+8wX2zxr/mDbsR+AAy6Qd2z4ZOQ7wfQaEp+yrYmg=
|
||||
github.com/sirupsen/logrus v1.10.2 h1:G2SED73/qrAu6YwbdxOD6peLkCBI3z7L+ykJFTXJBBo=
|
||||
github.com/sirupsen/logrus v1.10.2/go.mod h1:SLEg8TqYulVKKfIGHldVp2K2aYz2DKSVBq4g/H5bR7Q=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
|
||||
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
|
||||
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
|
||||
github.com/testcontainers/testcontainers-go v0.44.0 h1:/Fwh6HY1mIikhnm9e7HwoxGycx0lzRAE0f5VQpjFxzI=
|
||||
github.com/testcontainers/testcontainers-go v0.44.0/go.mod h1:IcnwQrYTO86xHXu5bvMaBH7ATlbS3Qn1M1QWW3c66rE=
|
||||
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0 h1:8fdv/9y3JMxjQ+ULAcOG8RtgeNu5t9XF9LolSXDuTwM=
|
||||
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0/go.mod h1:CFr2LncGYokw+OKjXcr8ARCKG1SaC2UEnGxFBovE86g=
|
||||
github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU=
|
||||
github.com/tklauser/go-sysconf v0.4.0/go.mod h1:8mTNWyog7H+MpKijp4VmKJAd2bbYQ2zuUwkYRbUArPI=
|
||||
github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqob4=
|
||||
github.com/tklauser/numcpus v0.12.0/go.mod h1:ABHeXzJnr/qqwguhClkZKT1/8VABcYrsyUiUGobwWJg=
|
||||
github.com/tinylib/msgp v1.6.5 h1:iAH6XTP7BpzErjBZlujJQXxA+GmRi2YWs6M4KdLtNbE=
|
||||
github.com/tinylib/msgp v1.6.5/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
|
||||
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
|
||||
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
go.lsp.dev/jsonrpc2 v1.0.1 h1:JZAchpm6RcOuwEOnZ7kF3kA1EpEjdJZ/6rMSfOF3+F4=
|
||||
go.lsp.dev/jsonrpc2 v1.0.1/go.mod h1:WN+TesqrPumBmUdsuWyn9DHq3zl4i85L/qG0NLdj8qg=
|
||||
go.lsp.dev/protocol v1.0.1 h1:kLWUIk1v/deXxo1D0VO4avjZnfeuZ82mouJgJd/NbdU=
|
||||
@@ -248,10 +211,16 @@ go.lsp.dev/uri v1.0.1 h1:ywxJN1UXoQ+v0I9lkoQNMmsm7lub5G9ZG7KXT8YTx30=
|
||||
go.lsp.dev/uri v1.0.1/go.mod h1:06a0ghafs4PuqkLsJGUmlgPHw6+kH79edRXjOT/rA8s=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 h1:Tq+E65HaNbZTeqcLw6QUhsV+/EIWdkfUH2CQzcrlE5M=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0/go.mod h1:A+EVhDakAj1waJBPhmTszZaSr08ww8MRRKy1nB1rqck=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw=
|
||||
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
|
||||
go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 h1:UFpxOpYPmMNUtOWhdb+nC1WELIgVf8z9higURrbzYU4=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0/go.mod h1:YBGjxe3lt0jtXoEXxGrGhv/jM7oUBUDVK7zhAvNyEjc=
|
||||
go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI=
|
||||
go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw=
|
||||
go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY=
|
||||
@@ -262,47 +231,51 @@ go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV
|
||||
go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw=
|
||||
go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM=
|
||||
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 h1:SCrPqH9NE5CmBrOqpjNCiT0X5mGwMyGERXdogfR7Yjw=
|
||||
go.opentelemetry.io/proto/otlp v1.11.1/go.mod h1:wq8W4aSf6bOy8RZyESOeQFr9Pu7wydWX/TY4sgvrTPg=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
||||
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
|
||||
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
|
||||
golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M=
|
||||
golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA=
|
||||
golang.org/x/exp v0.0.0-20261007192929-f45ad48fbe92 h1:kc+Gi2MFkd0KWtdDlVxVwjw4KB98/77usJDFj+6YFQ8=
|
||||
golang.org/x/exp v0.0.0-20261007192929-f45ad48fbe92/go.mod h1:SRjTzy5WcYqRRqquLUvHeeovSwLO0CZ3xcltZNO4Fck=
|
||||
golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c=
|
||||
golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o=
|
||||
golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU=
|
||||
golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg=
|
||||
golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54=
|
||||
golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w=
|
||||
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e h1:HgI6W1OolKK6tcV74is+rl9SMT0njsHlp0TbQiGXI/A=
|
||||
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e/go.mod h1:DBoxwWhjaW8DJJw/YeM4zpeOKMC1FMXSblsYy+1mFSw=
|
||||
golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg=
|
||||
golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs=
|
||||
golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
|
||||
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
|
||||
golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98=
|
||||
golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58=
|
||||
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
|
||||
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
|
||||
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
|
||||
golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
|
||||
golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
|
||||
golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
|
||||
golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
|
||||
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
|
||||
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM=
|
||||
golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY=
|
||||
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
|
||||
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
|
||||
golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
|
||||
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
|
||||
golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI=
|
||||
golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA=
|
||||
golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
|
||||
golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
|
||||
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
|
||||
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261005182115-fad411399dd8 h1:cFbkNigDInw+wVTXc+CyhUsoHGJCw0BR6mlNoRVfre0=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261005182115-fad411399dd8/go.mod h1:QK6p7IgD7IZEZJBhhSUCib5X2vMOzlrGCGUw2XyVDh0=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8 h1:0SXBqli5dnuCKMjI/X3FM226zEaEa0GUcSCJtN1vL2o=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b h1:nB3spRIaSPtxJpxb0k41yljROvm2Jrwfs2pSNdKS5y8=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b/go.mod h1:9N4vtjEwvgQKEdlFVQO0M44ErhecQ9DCSQfGoZ51M6w=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b h1:6WNWHZk91dp4gZ25642OALkuG1UVNZbwENJD19DnB8k=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
|
||||
google.golang.org/grpc v1.86.0-dev h1:FLq7hcApuJeJ70J9+k0FvmXsNCwS8B2/MeAfYdy3GHY=
|
||||
google.golang.org/grpc v1.86.0-dev/go.mod h1:Ovl0ECo4xx5r4kn/6d4BPSNB7OIFuu6EAjOzjtVAKaM=
|
||||
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
|
||||
@@ -318,15 +291,15 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
|
||||
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
|
||||
modernc.org/libc v1.77.1 h1:Ct8j47QtiZ1Enj2DtFXQtUqrPCAjdCmPjtCuvrYQ0Hs=
|
||||
modernc.org/libc v1.77.1/go.mod h1:87/pZ4L6nD1zqW4nItuS12YO7hN1igAah34xjnQo/W0=
|
||||
modernc.org/libc v1.78.0 h1:Lpm+e9K6ruVYEGwWfuBO1xXtYEaXDouFOG1SuWjFDP4=
|
||||
modernc.org/libc v1.78.0/go.mod h1:wvxR55nOF2/66NkJoNV7/coXBTCvT3HR22rcqW6lOuA=
|
||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||
modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g=
|
||||
modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||
modernc.org/sqlite v1.59.0 h1:X1es1GpqBlS/5T+vbM4HLUdaa8OtQx468DF2vrx+38A=
|
||||
modernc.org/sqlite v1.59.0/go.mod h1:+paeT2A3iPRHkQDwG7oA6Tk0zQd5woMEI8q7orfry8k=
|
||||
oras.land/oras-go/v2 v2.6.2 h1:N04RXngAp1LJKTG6ifz3xHPipasEkWr+hFmInja5YKo=
|
||||
oras.land/oras-go/v2 v2.6.2/go.mod h1:PlTtg4JTDJkDe8yVHpM2wz7/YDc00GVas+i4jAW2TZ4=
|
||||
modernc.org/sqlite v1.60.1 h1:/blz53O951KWFOso4QQvEs/Fq6cDBKLtMVrYNSeJVKw=
|
||||
modernc.org/sqlite v1.60.1/go.mod h1:1dIoEagfDE72QytD5scH1lxARtaUgKgHC/NuApA27r0=
|
||||
oras.land/oras-go/v2 v2.7.0 h1:0bXRBBSqYgPSjZRrhJbT71Rb465c+rdlft2xdQPxLtQ=
|
||||
oras.land/oras-go/v2 v2.7.0/go.mod h1:imXEFiYkTZUVVYkfv/r5GVmWeiLkGtNQA8FU4F/sjKs=
|
||||
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
|
||||
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
|
||||
+185
-63
@@ -1,25 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# install.sh - installs Archie Core for the current user.
|
||||
#
|
||||
# curl -fsSL https://raw.githubusercontent.com/samcharles93/archie-core/main/install.sh | bash
|
||||
# curl -fsSL https://offloaded.dev/install.sh | bash
|
||||
#
|
||||
# Downloads the latest release, verifies it against SHA256SUMS, installs the
|
||||
# Downloads a release from its OCI registry, verifies the release key signed
|
||||
# it and that the zip is the one signed, installs the
|
||||
# five services to ${XDG_BIN_HOME:-~/.local/bin}, runs `archied setup`, starts
|
||||
# the bundled PostgreSQL and installs systemd user units.
|
||||
# Config: ${XDG_CONFIG_HOME:-~/.config}/archie Data: ${XDG_DATA_HOME:-~/.local/share}/archie
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO="samcharles93/archie-core"
|
||||
MODULE="github.com/samcharles93/archie-core"
|
||||
SOURCE_GIT="https://git.catlow.cloud/sam/archie.git"
|
||||
# Where releases come from: an OCI repository and the base64 ed25519 key that
|
||||
# must have signed them. A self-hosted source sets both.
|
||||
DEFAULT_RELEASES="git.catlow.cloud/sam/archie"
|
||||
DEFAULT_RELEASE_KEY="gIBqoQMwy+8WXmGfiuHtnUa50W0IqfzkTR6iF5q3dSM="
|
||||
ARCHIE_RELEASES="${ARCHIE_RELEASES:-${DEFAULT_RELEASES}}"
|
||||
ARCHIE_RELEASE_KEY="${ARCHIE_RELEASE_KEY:-${DEFAULT_RELEASE_KEY}}"
|
||||
ARCHIE_CHANNEL="${ARCHIE_CHANNEL:-stable}"
|
||||
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||
XDG_DATA_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}"
|
||||
XDG_BIN_HOME="${XDG_BIN_HOME:-${HOME}/.local/bin}"
|
||||
|
||||
ARCHIE_CONFIG_DIR="${XDG_CONFIG_HOME}/archie"
|
||||
ARCHIE_DATA_DIR="${XDG_DATA_HOME}/archie"
|
||||
ARCHIE_BIN_DIR="${XDG_BIN_HOME}"
|
||||
ENV_FILE="${ARCHIE_CONFIG_DIR}/env"
|
||||
INSTANCE=archie
|
||||
PORT_BASE=""
|
||||
|
||||
INSTALL_SYSTEMD=true
|
||||
ENABLE_LINGER=true
|
||||
@@ -33,12 +41,21 @@ if (: </dev/tty) 2>/dev/null; then INTERACTIVE=true; fi
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: install.sh [options]
|
||||
or: curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash -s -- [options]
|
||||
or: curl -fsSL https://offloaded.dev/install.sh | bash -s -- [options]
|
||||
|
||||
Environment:
|
||||
ARCHIE_RELEASES OCI repository to install from (default ${DEFAULT_RELEASES})
|
||||
ARCHIE_RELEASE_KEY base64 ed25519 key that source signs with
|
||||
ARCHIE_CHANNEL stable (default) or next
|
||||
|
||||
Options:
|
||||
--version X.Y.Z Install this release instead of the latest
|
||||
--from-source Build from a checkout (this one, or a fresh clone) instead
|
||||
of a release; needs Go, git and jq
|
||||
--instance NAME Install a named instance beside others: archie (default)
|
||||
or archie-X; its dirs are <xdg>/NAME and its units end in -X
|
||||
--port-base N Use ports N..N+6 for web, health, gateway, state store,
|
||||
state store readiness, messaging and daemon
|
||||
--no-systemd Skip systemd user units
|
||||
--no-linger Skip loginctl enable-linger
|
||||
--no-start Install the units but do not start them
|
||||
@@ -51,6 +68,8 @@ VERSION=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--version) VERSION="${2:?--version needs a value}"; shift ;;
|
||||
--instance) INSTANCE="${2:?--instance needs a value}"; shift ;;
|
||||
--port-base) PORT_BASE="${2:?--port-base needs a value}"; shift ;;
|
||||
--from-source) FROM_SOURCE=true ;;
|
||||
--no-systemd) INSTALL_SYSTEMD=false; AUTO_START=false ;;
|
||||
--no-linger) ENABLE_LINGER=false ;;
|
||||
@@ -62,12 +81,86 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
if ! [[ "${INSTANCE}" =~ ^archie(-[a-z0-9][a-z0-9-]{0,23})?$ ]]; then
|
||||
echo "Error: --instance '${INSTANCE}' must be archie or archie-<name>, e.g. archie-dev" >&2; exit 1
|
||||
fi
|
||||
if [ -n "${PORT_BASE}" ] && ! { [[ "${PORT_BASE}" =~ ^[0-9]+$ ]] && [ "${PORT_BASE}" -ge 1024 ] && [ "${PORT_BASE}" -le 65529 ]; }; then
|
||||
echo "Error: --port-base must be a number from 1024 to 65529" >&2; exit 1
|
||||
fi
|
||||
export ARCHIE_INSTANCE="${INSTANCE}"
|
||||
ARCHIE_CONFIG_DIR="${XDG_CONFIG_HOME}/${INSTANCE}"
|
||||
ARCHIE_DATA_DIR="${XDG_DATA_HOME}/${INSTANCE}"
|
||||
ENV_FILE="${ARCHIE_CONFIG_DIR}/env"
|
||||
|
||||
# unit maps a base unit name to this instance's: unchanged for the default
|
||||
# instance, suffixed with the name after archie- otherwise.
|
||||
unit() {
|
||||
if [ "${INSTANCE}" = archie ]; then echo "$1"; else echo "$1-${INSTANCE#archie-}"; fi
|
||||
}
|
||||
U_DAEMON="$(unit archied)"
|
||||
U_STATE="$(unit archie-state-store)"
|
||||
U_GATEWAY="$(unit archie-gateway)"
|
||||
U_UI="$(unit archie-ui)"
|
||||
U_MESSAGING="$(unit archie-messaging)"
|
||||
|
||||
# Ports in --port-base order; without it, today's defaults.
|
||||
if [ -n "${PORT_BASE}" ]; then
|
||||
P_WEB=${PORT_BASE}; P_HEALTH=$((PORT_BASE + 1)); P_GATEWAY=$((PORT_BASE + 2))
|
||||
P_STATE=$((PORT_BASE + 3)); P_READY=$((PORT_BASE + 4)); P_MESSAGING=$((PORT_BASE + 5)); P_DAEMON=$((PORT_BASE + 6))
|
||||
else
|
||||
P_WEB=8484; P_HEALTH=8485; P_GATEWAY=8585; P_STATE=9090; P_READY=9091; P_MESSAGING=8586; P_DAEMON=8587
|
||||
fi
|
||||
|
||||
need() {
|
||||
for cmd in "$@"; do
|
||||
command -v "$cmd" &>/dev/null || { echo "Error: '$cmd' is required but not installed." >&2; exit 1; }
|
||||
done
|
||||
}
|
||||
|
||||
# install_release fetches the release on ARCHIE_CHANNEL (or VERSION) from
|
||||
# ARCHIE_RELEASES and unpacks it into TMP: the statement must verify against
|
||||
# ARCHIE_RELEASE_KEY and the zip must hash to the digest the statement names.
|
||||
install_release() {
|
||||
local registry="${ARCHIE_RELEASES%%/*}" repo="${ARCHIE_RELEASES#*/}" scheme=https tag="${ARCHIE_CHANNEL}"
|
||||
case "${registry}" in localhost | localhost:* | 127.* | "[::1]"*) scheme=http ;; esac
|
||||
[ -n "${VERSION}" ] && tag="v${VERSION#v}"
|
||||
local base="${scheme}://${registry}/v2/${repo}" auth=()
|
||||
# Registries hand anonymous readers a pull token named by the challenge.
|
||||
local challenge
|
||||
challenge="$(curl -fsS -o /dev/null -D - "${base}/manifests/${tag}" 2>/dev/null | tr -d '\r' | sed -n 's/^[Ww][Ww][Ww]-[Aa]uthenticate: *Bearer *//p')" || true
|
||||
if [ -n "${challenge}" ]; then
|
||||
local realm service token
|
||||
realm="$(sed -n 's/.*realm="\([^"]*\)".*/\1/p' <<<"${challenge}")"
|
||||
service="$(sed -n 's/.*service="\([^"]*\)".*/\1/p' <<<"${challenge}")"
|
||||
token="$(curl -fsSL -G "${realm}" --data-urlencode "service=${service}" --data-urlencode "scope=repository:${repo}:pull" | jq -r '.token // .access_token')"
|
||||
auth=(-H "Authorization: Bearer ${token}")
|
||||
fi
|
||||
echo "==> Fetching ${ARCHIE_RELEASES}:${tag}..."
|
||||
curl -fsSL "${auth[@]}" -H "Accept: application/vnd.oci.image.manifest.v1+json" "${base}/manifests/${tag}" -o "${TMP}/manifest.json"
|
||||
blob() { curl -fsSL "${auth[@]}" "${base}/blobs/$1" -o "$2" && [ "sha256:$(sha256sum "$2" | cut -d' ' -f1)" = "$1" ]; }
|
||||
local statement_digest
|
||||
statement_digest="$(jq -er '.layers[0].digest' "${TMP}/manifest.json")"
|
||||
blob "${statement_digest}" "${TMP}/statement.json" || { echo "Error: the release statement does not match its digest." >&2; exit 1; }
|
||||
jq -er '.annotations["dev.archie.release.signature.v1"]' "${TMP}/manifest.json" | base64 -d >"${TMP}/statement.sig"
|
||||
# An ed25519 public key is its 32 bytes behind a fixed SubjectPublicKeyInfo header.
|
||||
{ printf '\x30\x2a\x30\x05\x06\x03\x2b\x65\x70\x03\x21\x00'; base64 -d <<<"${ARCHIE_RELEASE_KEY}"; } >"${TMP}/key.der"
|
||||
openssl pkeyutl -verify -pubin -inkey "${TMP}/key.der" -keyform DER -rawin \
|
||||
-in "${TMP}/statement.json" -sigfile "${TMP}/statement.sig" >/dev/null 2>&1 ||
|
||||
{ echo "Error: ${ARCHIE_RELEASES}:${tag} is not signed by the release key." >&2; exit 1; }
|
||||
local zip_name zip_digest
|
||||
VERSION="$(jq -er .version "${TMP}/statement.json")"
|
||||
[ "$(jq -r .platform "${TMP}/statement.json")" = linux-amd64 ] || { echo "Error: the release is not built for linux-amd64." >&2; exit 1; }
|
||||
[ -z "${VERSION}" ] || [ "${tag}" = "${ARCHIE_CHANNEL}" ] || [ "v${VERSION}" = "${tag}" ] ||
|
||||
{ echo "Error: ${tag} carries the statement for ${VERSION}." >&2; exit 1; }
|
||||
zip_name="$(jq -er .zip.name "${TMP}/statement.json")"
|
||||
zip_digest="$(jq -er .zip.digest "${TMP}/statement.json")"
|
||||
RELEASE_NAME="${zip_name%.zip}"
|
||||
case "${RELEASE_NAME}" in archie-core-archied-v*-linux-amd64) ;; *) echo "Error: unexpected release zip ${zip_name}." >&2; exit 1 ;; esac
|
||||
echo "==> Downloading Archie ${VERSION}..."
|
||||
blob "${zip_digest}" "${TMP}/${zip_name}" || { echo "Error: ${zip_name} does not match the signed digest." >&2; exit 1; }
|
||||
unzip -q "${TMP}/${zip_name}" -d "${TMP}"
|
||||
}
|
||||
|
||||
# 1. Prerequisites
|
||||
echo "==> Checking prerequisites..."
|
||||
# The installer depends on systemd user units and GNU tools.
|
||||
@@ -79,7 +172,7 @@ if [ "${FROM_SOURCE}" = true ]; then
|
||||
need git go jq
|
||||
else
|
||||
[ "$(uname -m)" = x86_64 ] || { echo "Error: releases are built for x86_64 only; use --from-source." >&2; exit 1; }
|
||||
need curl unzip sha256sum
|
||||
need curl unzip sha256sum openssl jq base64
|
||||
fi
|
||||
if command -v docker &>/dev/null; then
|
||||
echo " [OK] $(docker --version)"
|
||||
@@ -89,56 +182,51 @@ fi
|
||||
|
||||
mkdir -p "${ARCHIE_CONFIG_DIR}" "${ARCHIE_DATA_DIR}" "${ARCHIE_BIN_DIR}"
|
||||
|
||||
# 2. Binaries. STAGE ends up holding the binaries, release.json and the
|
||||
# updater scripts, whichever way they were obtained.
|
||||
# 2. Binaries. STAGE ends up holding the binaries and release.json, whichever
|
||||
# way they were obtained.
|
||||
TMP="$(mktemp -d)"
|
||||
trap 'rm -rf "${TMP}"' EXIT
|
||||
|
||||
if [ "${FROM_SOURCE}" = true ]; then
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
||||
if [ -f "${SCRIPT_DIR}/go.mod" ] && grep -q "github.com/${REPO}" "${SCRIPT_DIR}/go.mod"; then
|
||||
if [ -f "${SCRIPT_DIR}/go.mod" ] && grep -q "${MODULE}" "${SCRIPT_DIR}/go.mod"; then
|
||||
SRC_DIR="${SCRIPT_DIR}"
|
||||
else
|
||||
SRC_DIR="${TMP}/src"
|
||||
git clone --quiet --depth=1 "https://github.com/${REPO}.git" "${SRC_DIR}"
|
||||
git clone --quiet --depth=1 "${SOURCE_GIT}" "${SRC_DIR}"
|
||||
fi
|
||||
echo "==> Building from ${SRC_DIR}..."
|
||||
# Selects (and under the default GOTOOLCHAIN=auto, downloads) the toolchain
|
||||
# go.mod requires, so a missing one fails here rather than mid-build.
|
||||
required="$(sed -n 's/^go //p' "${SRC_DIR}/go.mod")"
|
||||
if ! out="$(cd "${SRC_DIR}" && go list -m 2>&1)"; then
|
||||
echo "Error: Archie needs Go ${required}, which is not available: ${out}" >&2
|
||||
echo "Install Go ${required} from https://go.dev/dl, or allow the download with GOTOOLCHAIN=auto and network access to proxy.golang.org." >&2
|
||||
exit 1
|
||||
fi
|
||||
STAGE="${TMP}/stage"
|
||||
mkdir -p "${STAGE}"
|
||||
# A source build is not a release: it says `dev`, and buildType=binary lets
|
||||
# it self-update.
|
||||
LDFLAGS="-X github.com/${REPO}/internal/buildinfo.Version=dev -X github.com/${REPO}/internal/buildinfo.Runtime=dev -X github.com/${REPO}/internal/installtype.buildType=binary"
|
||||
for cmd in $(jq -er '.required_topology.units | join(" ")' "${SRC_DIR}/release.json"); do
|
||||
# it self-update. The agentworker stamp only lands in archie-agent.
|
||||
LDFLAGS="-X ${MODULE}/internal/buildinfo.Version=dev -X ${MODULE}/internal/buildinfo.Runtime=dev -X ${MODULE}/internal/installtype.buildType=binary -X ${MODULE}/internal/app/agentworker.version=dev"
|
||||
for cmd in $(jq -er '[.required_topology.units[], .required_topology.binaries[]?] | join(" ")' "${SRC_DIR}/release.json"); do
|
||||
(cd "${SRC_DIR}" && go build -ldflags "${LDFLAGS}" -o "${STAGE}/${cmd}" "./cmd/${cmd}")
|
||||
done
|
||||
cp "${SRC_DIR}/release.json" "${SRC_DIR}"/scripts/archie-update-* "${STAGE}/"
|
||||
cp "${SRC_DIR}/release.json" "${STAGE}/"
|
||||
else
|
||||
if [ -z "${VERSION}" ]; then
|
||||
tag="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')"
|
||||
[ -n "${tag}" ] || { echo "Error: could not find the latest release." >&2; exit 1; }
|
||||
else
|
||||
tag="v${VERSION}"
|
||||
fi
|
||||
VERSION="${tag##*v}"
|
||||
name="archie-core-archied-v${VERSION}-linux-amd64"
|
||||
echo "==> Downloading Archie ${VERSION}..."
|
||||
base="https://github.com/${REPO}/releases/download/${tag}"
|
||||
curl -fsSL "${base}/${name}.zip" -o "${TMP}/${name}.zip"
|
||||
curl -fsSL "${base}/SHA256SUMS" -o "${TMP}/SHA256SUMS"
|
||||
expected="$(awk -v n="${name}.zip" '$2 == n {print $1}' "${TMP}/SHA256SUMS")"
|
||||
[[ "${expected}" =~ ^[a-f0-9]{64}$ ]] || { echo "Error: ${name}.zip is not in SHA256SUMS." >&2; exit 1; }
|
||||
printf '%s %s\n' "${expected}" "${TMP}/${name}.zip" | sha256sum --check --status ||
|
||||
{ echo "Error: checksum mismatch for ${name}.zip." >&2; exit 1; }
|
||||
unzip -q "${TMP}/${name}.zip" -d "${TMP}"
|
||||
STAGE="${TMP}/${name}"
|
||||
install_release
|
||||
STAGE="${TMP}/${RELEASE_NAME}"
|
||||
fi
|
||||
|
||||
TOPOLOGY_UNITS="$(tr -d '\n' <"${STAGE}/release.json" | sed -n 's/.*"units": *\[\([^]]*\)\].*/\1/p' | tr -d '" ' | tr , ' ')"
|
||||
for cmd in ${TOPOLOGY_UNITS}; do
|
||||
# Binaries that run beside the units without a service of their own: a Kit run
|
||||
# mounts archie-agent from archied's directory, so it must be installed with
|
||||
# them and replaced with them.
|
||||
TOPOLOGY_BINARIES="$(tr -d '\n' <"${STAGE}/release.json" | sed -n 's/.*"binaries": *\[\([^]]*\)\].*/\1/p' | tr -d '" ' | tr , ' ')"
|
||||
for cmd in ${TOPOLOGY_UNITS} ${TOPOLOGY_BINARIES}; do
|
||||
install -m755 "${STAGE}/${cmd}" "${ARCHIE_BIN_DIR}/${cmd}"
|
||||
done
|
||||
install -m755 "${STAGE}"/archie-update-* "${ARCHIE_BIN_DIR}/"
|
||||
echo " Installed ${TOPOLOGY_UNITS} and the updater to ${ARCHIE_BIN_DIR}/"
|
||||
echo " Installed ${TOPOLOGY_UNITS} ${TOPOLOGY_BINARIES} to ${ARCHIE_BIN_DIR}/"
|
||||
|
||||
# 3. Configuration. archied setup asks every question and writes config.toml
|
||||
# plus any secrets to the env file beside it; this script asks nothing itself.
|
||||
@@ -156,7 +244,25 @@ if [ ! -f "${ARCHIE_CONFIG_DIR}/config.toml" ]; then
|
||||
echo "ERROR: archied setup could not generate ${ARCHIE_CONFIG_DIR}/config.toml" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ "${ARCHIE_RELEASES}" != "${DEFAULT_RELEASES}" ] || [ "${ARCHIE_RELEASE_KEY}" != "${DEFAULT_RELEASE_KEY}" ]; then
|
||||
# The instance keeps updating from the source it was installed from.
|
||||
printf '\n[distribution]\nreleases = "%s"\nreleases_key = "%s"\n' "${ARCHIE_RELEASES}" "${ARCHIE_RELEASE_KEY}" >>"${ARCHIE_CONFIG_DIR}/config.toml"
|
||||
fi
|
||||
if [ -n "${PORT_BASE}" ]; then
|
||||
# The generated config names the default addresses; move them to this
|
||||
# instance's ports and pin the services the template leaves commented.
|
||||
sed -i -e "s/127\.0\.0\.1:8484/127.0.0.1:${P_WEB}/g" -e "s/127\.0\.0\.1:8485/127.0.0.1:${P_HEALTH}/g" \
|
||||
-e "s/127\.0\.0\.1:8585/127.0.0.1:${P_GATEWAY}/g" -e "s/127\.0\.0\.1:9090/127.0.0.1:${P_STATE}/g" \
|
||||
-e "s/127\.0\.0\.1:8586/127.0.0.1:${P_MESSAGING}/g" -e "s/127\.0\.0\.1:8587/127.0.0.1:${P_DAEMON}/g" \
|
||||
"${ARCHIE_CONFIG_DIR}/config.toml"
|
||||
for section in messaging:${P_MESSAGING} daemon:${P_DAEMON}; do
|
||||
name="${section%%:*}" port="${section#*:}"
|
||||
grep -q "^\[services\.${name}\]" "${ARCHIE_CONFIG_DIR}/config.toml" ||
|
||||
printf '\n[services.%s]\ntarget = "127.0.0.1:%s"\nlisten = "127.0.0.1:%s"\n' "${name}" "${port}" "${port}" >>"${ARCHIE_CONFIG_DIR}/config.toml"
|
||||
done
|
||||
fi
|
||||
else
|
||||
[ -n "${PORT_BASE}" ] && echo " [WARN] --port-base only applies to a new config; ${ARCHIE_CONFIG_DIR}/config.toml keeps its addresses." >&2
|
||||
echo " [SKIP] ${ARCHIE_CONFIG_DIR}/config.toml already exists. Re-run 'archied setup' to change it."
|
||||
fi
|
||||
|
||||
@@ -198,9 +304,9 @@ services:
|
||||
volumes:
|
||||
pg_data:
|
||||
EOF
|
||||
if ! docker compose -p archie --env-file "${ENV_FILE}" -f "${PG_COMPOSE}" up -d --wait; then
|
||||
if ! docker compose -p "${INSTANCE}" --env-file "${ENV_FILE}" -f "${PG_COMPOSE}" up -d --wait; then
|
||||
echo " [WARN] The bundled PostgreSQL did not start, so the services are installed but not started." >&2
|
||||
echo " Check: docker compose -p archie -f ${PG_COMPOSE} logs" >&2
|
||||
echo " Check: docker compose -p "${INSTANCE}" -f ${PG_COMPOSE} logs" >&2
|
||||
AUTO_START=false
|
||||
fi
|
||||
fi
|
||||
@@ -234,7 +340,7 @@ if [ "${INSTALL_SYSTEMD}" = true ] && command -v systemctl &>/dev/null && [ -d "
|
||||
# description now, not the mechanism: a fresh install must not need four
|
||||
# hand-written units before its own updater will run, and
|
||||
# the contents must not live in two places to drift apart.
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/archied.service"
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_DAEMON}.service"
|
||||
[Unit]
|
||||
Description=Archie Core Orchestrator Daemon
|
||||
After=network.target
|
||||
@@ -245,9 +351,13 @@ StartLimitIntervalSec=300
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Type=notify
|
||||
NotifyAccess=main
|
||||
# Beats only while the run loop is polling, so a wedged loop is restarted.
|
||||
WatchdogSec=30s
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archied -config ${ARCHIE_CONFIG_DIR}/config.toml
|
||||
EnvironmentFile=-${ENV_FILE}
|
||||
Environment=ARCHIE_INSTANCE=${INSTANCE}
|
||||
# archied reloads its configuration on SIGHUP. Without ExecReload,
|
||||
# 'systemctl --user reload archied' fails and the operator has to know
|
||||
# to run 'systemctl --user kill -s HUP' instead.
|
||||
@@ -261,15 +371,17 @@ EOF
|
||||
|
||||
# The State Store owns the task data and is the process everything else dials, so
|
||||
# its unit is the first dependency the others name.
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-state-store.service"
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_STATE}.service"
|
||||
[Unit]
|
||||
Description=Archie State Store Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archie-state-store -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:9090 -ready-addr 127.0.0.1:9091
|
||||
Type=notify
|
||||
NotifyAccess=main
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archie-state-store -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:${P_STATE} -ready-addr 127.0.0.1:${P_READY}
|
||||
EnvironmentFile=-${ENV_FILE}
|
||||
Environment=ARCHIE_INSTANCE=${INSTANCE}
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
@@ -277,15 +389,17 @@ RestartSec=5s
|
||||
WantedBy=default.target
|
||||
EOF
|
||||
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-gateway.service"
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_GATEWAY}.service"
|
||||
[Unit]
|
||||
Description=Archie Gateway Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archie-gateway -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:8585
|
||||
Type=notify
|
||||
NotifyAccess=main
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archie-gateway -config ${ARCHIE_CONFIG_DIR}/config.toml -listen 127.0.0.1:${P_GATEWAY}
|
||||
EnvironmentFile=-${ENV_FILE}
|
||||
Environment=ARCHIE_INSTANCE=${INSTANCE}
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
@@ -293,16 +407,17 @@ RestartSec=5s
|
||||
WantedBy=default.target
|
||||
EOF
|
||||
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-ui.service"
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_UI}.service"
|
||||
[Unit]
|
||||
Description=Archie UI Service
|
||||
After=network.target archie-state-store.service
|
||||
Wants=archie-state-store.service
|
||||
After=network.target ${U_STATE}.service
|
||||
Wants=${U_STATE}.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archie-ui -config ${ARCHIE_CONFIG_DIR}/config.toml
|
||||
EnvironmentFile=-${ENV_FILE}
|
||||
Environment=ARCHIE_INSTANCE=${INSTANCE}
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
@@ -312,16 +427,18 @@ EOF
|
||||
|
||||
# The Telegram, email and webhook channels run here, not in archied: without
|
||||
# this unit a host looks healthy while its channels are dead.
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/archie-messaging.service"
|
||||
cat <<EOF > "${SYSTEMD_USER_DIR}/${U_MESSAGING}.service"
|
||||
[Unit]
|
||||
Description=Archie Messaging Service
|
||||
After=network.target archie-gateway.service archie-state-store.service
|
||||
Wants=archie-gateway.service archie-state-store.service
|
||||
After=network.target ${U_GATEWAY}.service ${U_STATE}.service
|
||||
Wants=${U_GATEWAY}.service ${U_STATE}.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Type=notify
|
||||
NotifyAccess=main
|
||||
ExecStart=${ARCHIE_BIN_DIR}/archie-messaging -config ${ARCHIE_CONFIG_DIR}/config.toml
|
||||
EnvironmentFile=-${ENV_FILE}
|
||||
Environment=ARCHIE_INSTANCE=${INSTANCE}
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
@@ -329,9 +446,12 @@ RestartSec=5s
|
||||
WantedBy=default.target
|
||||
EOF
|
||||
|
||||
INSTANCE_UNITS=""
|
||||
for base in $TOPOLOGY_UNITS; do INSTANCE_UNITS="${INSTANCE_UNITS:+${INSTANCE_UNITS} }$(unit "${base}")"; done
|
||||
|
||||
systemctl --user daemon-reload || true
|
||||
SERVICE_INSTALLED=true
|
||||
for unit in $TOPOLOGY_UNITS; do
|
||||
for unit in $INSTANCE_UNITS; do
|
||||
test -f "${SYSTEMD_USER_DIR}/${unit}.service" || { echo "missing required unit: $unit" >&2; exit 1; }
|
||||
echo " Installed ${SYSTEMD_USER_DIR}/${unit}.service"
|
||||
done
|
||||
@@ -358,8 +478,8 @@ EOF
|
||||
# not race a dial it depends on.
|
||||
if [ "${AUTO_START}" = true ]; then
|
||||
echo "==> Enabling and starting Archie services..."
|
||||
systemctl --user enable --now $TOPOLOGY_UNITS ||
|
||||
echo " Notice: Could not start every service automatically. Check: systemctl --user status archied archie-state-store archie-gateway archie-ui archie-messaging"
|
||||
systemctl --user enable --now $INSTANCE_UNITS ||
|
||||
echo " Notice: Could not start every service automatically. Check: systemctl --user status ${INSTANCE_UNITS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -386,13 +506,15 @@ fi
|
||||
|
||||
if [ "${SERVICE_INSTALLED}" = true ] && [ "${AUTO_START}" = true ]; then
|
||||
echo "Service Management:"
|
||||
echo " - Units installed : archied archie-state-store archie-gateway archie-ui archie-messaging"
|
||||
echo " - View live logs : journalctl --user -u archied -f"
|
||||
echo " - Service status : systemctl --user status archied archie-state-store archie-gateway archie-ui archie-messaging"
|
||||
echo " - Restart daemon : systemctl --user restart archied"
|
||||
echo " - Units installed : ${INSTANCE_UNITS}"
|
||||
echo " - View live logs : journalctl --user -u ${U_DAEMON} -f"
|
||||
echo " - Service status : systemctl --user status ${INSTANCE_UNITS}"
|
||||
echo " - Restart daemon : systemctl --user restart ${U_DAEMON}"
|
||||
else
|
||||
echo "Manual Startup: start the five services as in https://github.com/${REPO}/blob/main/deployments/README.md"
|
||||
echo "Manual Startup: start the five services as in https://offloaded.dev"
|
||||
fi
|
||||
echo ""
|
||||
echo "Dashboard: http://127.0.0.1:8484 Change the config: archied setup"
|
||||
SETUP_HINT="archied setup"
|
||||
[ "${INSTANCE}" = archie ] || SETUP_HINT="ARCHIE_INSTANCE=${INSTANCE} archied setup"
|
||||
echo "Dashboard: http://127.0.0.1:${P_WEB} Change the config: ${SETUP_HINT}"
|
||||
echo ""
|
||||
@@ -46,6 +46,17 @@ func AcceptCapture(spec agentrun.CaptureTool, accepted int, value json.RawMessag
|
||||
// its rejection, so the agent can correct it, and is not recorded.
|
||||
func ServeCaptureMCP(ctx context.Context, specs []agentrun.CaptureTool, sink io.Writer, t mcp.Transport) error {
|
||||
server := mcp.NewServer(&mcp.Implementation{Name: "archie", Version: "1"}, nil)
|
||||
return serveHarnessMCP(ctx, specs, sink, t, server, false)
|
||||
}
|
||||
|
||||
func serveHarnessMCP(ctx context.Context, specs []agentrun.CaptureTool, sink io.Writer, t mcp.Transport, server *mcp.Server, central bool) error {
|
||||
if central {
|
||||
cleanup, err := addCentralTools(ctx, server, specs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer cleanup()
|
||||
}
|
||||
var mu sync.Mutex
|
||||
accepted := map[string]int{}
|
||||
for _, spec := range specs {
|
||||
@@ -121,8 +132,8 @@ func ServeCaptureFiles(ctx context.Context, specPath, capturesPath string, t mcp
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var specs []agentrun.CaptureTool
|
||||
if err := json.Unmarshal(raw, &specs); err != nil {
|
||||
var spec harnessMCPSpec
|
||||
if err := json.Unmarshal(raw, &spec); err != nil {
|
||||
return fmt.Errorf("capture tool spec: %w", err)
|
||||
}
|
||||
sink, err := os.OpenFile(capturesPath, os.O_WRONLY|os.O_APPEND, 0)
|
||||
@@ -130,5 +141,17 @@ func ServeCaptureFiles(ctx context.Context, specPath, capturesPath string, t mcp
|
||||
return err
|
||||
}
|
||||
defer sink.Close()
|
||||
return ServeCaptureMCP(ctx, specs, sink, t)
|
||||
server := mcp.NewServer(&mcp.Implementation{Name: "archie", Version: "1"}, nil)
|
||||
server.AddReceivingMiddleware(func(next mcp.MethodHandler) mcp.MethodHandler {
|
||||
return func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) {
|
||||
result, err := next(ctx, method, req)
|
||||
if err == nil && (method == "tools/list" || method == "tools/call") {
|
||||
if err := os.WriteFile(capturesPath+".ready", nil, 0o600); err != nil {
|
||||
return nil, fmt.Errorf("record MCP initialization: %w", err)
|
||||
}
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
})
|
||||
return serveHarnessMCP(ctx, spec.Captures, sink, t, server, spec.CentralTools)
|
||||
}
|
||||
@@ -29,12 +29,9 @@ var harnessAdapters = map[string]HarnessAdapter{
|
||||
NewOutput: func() HarnessOutput { return newClaudeCodeHarnessOutput() },
|
||||
MCPConfig: []string{"--mcp-config", mcpConfigPlaceholder},
|
||||
},
|
||||
// Codex takes MCP servers only as inline -c overrides, and Pi and OMP
|
||||
// read no MCP config file of this shape, so their stages serve no
|
||||
// capture tools.
|
||||
AdapterCodex: {NewOutput: func() HarnessOutput { return &codexHarnessOutput{} }},
|
||||
AdapterPi: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }},
|
||||
AdapterOMP: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }},
|
||||
AdapterCodex: {NewOutput: func() HarnessOutput { return &codexHarnessOutput{} }, MCPConfig: []string{"-c", mcpConfigPlaceholder}},
|
||||
AdapterPi: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }, MCPConfig: []string{"--extension", mcpConfigPlaceholder}},
|
||||
AdapterOMP: {NewOutput: func() HarnessOutput { return &piHarnessOutput{} }, MCPConfig: []string{"--extension", mcpConfigPlaceholder}},
|
||||
AdapterCopilot: {
|
||||
NewOutput: func() HarnessOutput { return newCopilotHarnessOutput() },
|
||||
MCPConfig: []string{"--additional-mcp-config", "@" + mcpConfigPlaceholder},
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
package agentexec
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/agentrun"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/tasktools"
|
||||
)
|
||||
|
||||
type harnessMCPSpec struct {
|
||||
Captures []agentrun.CaptureTool `json:"captures"`
|
||||
CentralTools bool `json:"central_tools"`
|
||||
}
|
||||
|
||||
// Each adapter registers one stdio bridge; it holds only proxy credentials
|
||||
// and sentinels, and never writes invocation configuration into the worktree.
|
||||
func harnessMCPRegistration(adapter, dir, configPath string, server map[string]any) (string, error) {
|
||||
switch adapter {
|
||||
case AdapterCodex:
|
||||
args, err := json.Marshal(server["args"])
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
command, ok := server["command"].(string)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("MCP command is missing")
|
||||
}
|
||||
return "mcp_servers.archie={command=" + strconv.Quote(command) + ",args=" + string(args) + ",env={HTTP_PROXY=" + strconv.Quote(harnessMCPEnvironmentValue(server)) + "},required=true}", nil
|
||||
case AdapterPi:
|
||||
server["exposure"] = "direct"
|
||||
definition, err := json.Marshal(server)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
path := filepath.Join(dir, "archie-mcp.ts")
|
||||
script := "export default function(pi) { if (typeof pi.registerMcpServer !== 'function') throw new Error('This Pi version does not support native MCP registration'); pi.registerMcpServer('archie', " + string(definition) + "); }\n"
|
||||
if err := os.WriteFile(path, []byte(script), 0o644); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return path, nil
|
||||
case AdapterOMP:
|
||||
// OMP discovers .mcp.json in an explicitly loaded extension package.
|
||||
path := filepath.Join(dir, "index.ts")
|
||||
if err := os.WriteFile(path, []byte("export default function() {}\n"), 0o644); err != nil {
|
||||
return "", err
|
||||
}
|
||||
data, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, ".mcp.json"), data, 0o644); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return dir, nil
|
||||
default:
|
||||
return configPath, nil
|
||||
}
|
||||
}
|
||||
|
||||
type centralTransport struct{ base http.RoundTripper }
|
||||
|
||||
func (t centralTransport) RoundTrip(r *http.Request) (*http.Response, error) {
|
||||
if r.URL.String() != tasktools.Endpoint {
|
||||
return nil, fmt.Errorf("central tool request names an unexpected endpoint")
|
||||
}
|
||||
r = r.Clone(r.Context())
|
||||
r.Header.Set("Authorization", "Bearer "+tasktools.Sentinel)
|
||||
return t.base.RoundTrip(r)
|
||||
}
|
||||
|
||||
func addCentralTools(ctx context.Context, server *mcp.Server, captures []agentrun.CaptureTool) (func(), error) {
|
||||
proxy, err := url.Parse(os.Getenv("HTTP_PROXY"))
|
||||
if err != nil || proxy.Host == "" {
|
||||
return nil, fmt.Errorf("central tools require the task egress proxy")
|
||||
}
|
||||
transport := &http.Transport{Proxy: http.ProxyURL(proxy)}
|
||||
client := mcp.NewClient(&mcp.Implementation{Name: "archie-harness", Version: "1"}, nil)
|
||||
session, err := client.Connect(ctx, &mcp.StreamableClientTransport{Endpoint: tasktools.Endpoint, HTTPClient: &http.Client{Transport: centralTransport{base: transport}, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}, DisableStandaloneSSE: true, MaxRetries: -1, MaxEventSize: -1}, nil)
|
||||
if err != nil {
|
||||
transport.CloseIdleConnections()
|
||||
return nil, fmt.Errorf("connect central tools: %w", err)
|
||||
}
|
||||
closeSession := func() { _ = session.Close(); transport.CloseIdleConnections() }
|
||||
names := map[string]bool{}
|
||||
for _, spec := range captures {
|
||||
names[spec.Name] = true
|
||||
}
|
||||
for tool, err := range session.Tools(ctx, nil) {
|
||||
if err != nil {
|
||||
closeSession()
|
||||
return nil, fmt.Errorf("list central tools: %w", err)
|
||||
}
|
||||
if names[tool.Name] {
|
||||
closeSession()
|
||||
return nil, fmt.Errorf("central tool %q collides with a capture tool", tool.Name)
|
||||
}
|
||||
server.AddTool(tool, func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
|
||||
return session.CallTool(ctx, &mcp.CallToolParams{Name: req.Params.Name, Arguments: req.Params.Arguments})
|
||||
})
|
||||
}
|
||||
return closeSession, nil
|
||||
}
|
||||
|
||||
func harnessMCPEnvironment(env []string) map[string]string {
|
||||
out := map[string]string{}
|
||||
for _, entry := range env {
|
||||
if value, ok := strings.CutPrefix(entry, "HTTP_PROXY="); ok {
|
||||
out["HTTP_PROXY"] = value
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func harnessMCPEnvironmentValue(server map[string]any) string {
|
||||
env, _ := server["env"].(map[string]string)
|
||||
return env["HTTP_PROXY"]
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
//go:build unix
|
||||
|
||||
package agentexec
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/agentrun"
|
||||
)
|
||||
|
||||
// Some CLIs log an unsupported MCP configuration but still exit successfully.
|
||||
func TestHarnessRequiresMCPInitialization(t *testing.T) {
|
||||
for _, central := range []bool{false, true} {
|
||||
t.Run(map[bool]string{false: "captures", true: "central tools"}[central], func(t *testing.T) {
|
||||
workspace, err := os.MkdirTemp("", "archie-mcp-regression-") //nolint:usetesting // The harness user cannot traverse testing's private parent directory.
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(workspace)
|
||||
for _, args := range [][]string{{"init", "-q"}, {"-c", "user.name=fixture", "-c", "user.email=fixture@example.invalid", "commit", "--allow-empty", "-q", "-m", "fixture"}} {
|
||||
cmd := exec.CommandContext(t.Context(), "git", append([]string{"-C", workspace}, args...)...)
|
||||
if raw, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("git fixture %v: %s", err, raw)
|
||||
}
|
||||
}
|
||||
h := &agentrun.HarnessSpec{Launch: []string{"sh", "-c", "exit 0", "harness"}, Prompt: []string{"{{.Prompt}}"}, MCPConfig: []string{"{{.MCPConfig}}"}, Env: []string{"PATH=/usr/bin:/bin"}, CentralTools: central}
|
||||
if os.Geteuid() == 0 {
|
||||
h.User = "65534"
|
||||
}
|
||||
req := agentrun.Request{Version: agentrun.ProtocolVersion, TaskID: 7, Attempt: 1, Stage: "test", Mission: "return a result", Model: "fixture/model", Harness: h}
|
||||
if !central {
|
||||
req.CaptureTools = []agentrun.CaptureTool{{Name: "capture_result", Parameters: json.RawMessage(`{"type":"object"}`)}}
|
||||
}
|
||||
result, err := NewHarnessRunner(nil).Run(t.Context(), workspace, req, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if result.Status == agentrun.StatusPassed || result.StopReason != StopExited {
|
||||
t.Fatalf("unsupported MCP silently passed: %+v", result)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,11 @@ func (r *HarnessRunner) Run(ctx context.Context, workspace string, req agentrun.
|
||||
defer cleanup()
|
||||
res, err := r.run(ctx, workspace, req, mcpConfig, report)
|
||||
if capturesPath != "" {
|
||||
if res.Status == agentrun.StatusPassed {
|
||||
if _, readyErr := os.Stat(capturesPath + ".ready"); readyErr != nil {
|
||||
return park(res, StopExited, "harness did not initialize Archie MCP; check CLI MCP support and startup errors"), err
|
||||
}
|
||||
}
|
||||
captures, readErr := readCaptures(capturesPath, req.CaptureTools)
|
||||
if readErr != nil {
|
||||
return res, errors.Join(err, fmt.Errorf("read captures: %w", readErr))
|
||||
@@ -195,8 +200,8 @@ func validateHarness(req agentrun.Request) error {
|
||||
if len(h.Resume) > 0 && !slices.ContainsFunc(h.Resume, func(s string) bool { return strings.Contains(s, sessionPlaceholder) }) {
|
||||
return fmt.Errorf("harness resume verb must carry %s", sessionPlaceholder)
|
||||
}
|
||||
if len(req.CaptureTools) > 0 && !slices.ContainsFunc(h.MCPConfig, func(s string) bool { return strings.Contains(s, mcpConfigPlaceholder) }) {
|
||||
return errors.New("stage has capture tools but the harness registers no MCP server; its results would be lost")
|
||||
if (len(req.CaptureTools) > 0 || h.CentralTools) && !slices.ContainsFunc(h.MCPConfig, func(s string) bool { return strings.Contains(s, mcpConfigPlaceholder) }) {
|
||||
return errors.New("stage needs Archie tools but the harness registers no MCP server; its results would be lost")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -254,16 +259,18 @@ func invoke(ctx context.Context, workspace string, h *agentrun.HarnessSpec, argv
|
||||
return err
|
||||
}
|
||||
var stderr tailBuffer
|
||||
cmd.Stderr = &stderr
|
||||
cmd.Stderr = io.MultiWriter(&stderr, os.Stderr)
|
||||
if err := cmd.Start(); err != nil {
|
||||
return fmt.Errorf("start harness: %w", err)
|
||||
}
|
||||
scanner := bufio.NewScanner(stdout)
|
||||
// Keep the raw harness activity visible in the container's live output.
|
||||
output := io.TeeReader(stdout, os.Stdout)
|
||||
scanner := bufio.NewScanner(output)
|
||||
scanner.Buffer(make([]byte, 64*1024), 16*1024*1024)
|
||||
for scanner.Scan() {
|
||||
out.Line(scanner.Bytes(), report)
|
||||
}
|
||||
_, _ = io.Copy(io.Discard, stdout)
|
||||
_, _ = io.Copy(io.Discard, output)
|
||||
if err := cmd.Wait(); err != nil {
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
@@ -483,7 +490,7 @@ func (t *tailBuffer) String() string { return t.buf.String() }
|
||||
// writes into it.
|
||||
func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures string, cleanup func(), err error) {
|
||||
cleanup = func() {}
|
||||
if len(req.CaptureTools) == 0 {
|
||||
if len(req.CaptureTools) == 0 && !req.Harness.CentralTools {
|
||||
return "", "", cleanup, nil
|
||||
}
|
||||
dir, err := os.MkdirTemp("", "archie-captures-")
|
||||
@@ -495,7 +502,7 @@ func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures
|
||||
cleanup()
|
||||
return "", "", func() {}, err
|
||||
}
|
||||
spec, err := json.Marshal(req.CaptureTools)
|
||||
spec, err := json.Marshal(harnessMCPSpec{Captures: req.CaptureTools, CentralTools: req.Harness.CentralTools})
|
||||
if err != nil {
|
||||
return fail(err)
|
||||
}
|
||||
@@ -509,6 +516,7 @@ func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures
|
||||
command = []string{self}
|
||||
}
|
||||
server := map[string]any{
|
||||
"env": harnessMCPEnvironment(req.Harness.Env),
|
||||
"command": command[0],
|
||||
"args": slices.Concat(command[1:], []string{"mcp", "-spec", specPath, "-captures", capturesPath}),
|
||||
}
|
||||
@@ -524,5 +532,9 @@ func (r *HarnessRunner) prepareCaptures(req agentrun.Request) (config, captures
|
||||
if err := ownForHarness(req.Harness.User, dir, specPath, configPath, capturesPath); err != nil {
|
||||
return fail(err)
|
||||
}
|
||||
return configPath, capturesPath, cleanup, nil
|
||||
registration, err := harnessMCPRegistration(req.Harness.Adapter, dir, configPath, server)
|
||||
if err != nil {
|
||||
return fail(err)
|
||||
}
|
||||
return registration, capturesPath, cleanup, nil
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
//go:build unix
|
||||
|
||||
package agentexec
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/domain/agentrun"
|
||||
)
|
||||
|
||||
func TestHarnessLiveOutput(t *testing.T) {
|
||||
if os.Getenv("ARCHIE_TEST_HARNESS_OUTPUT") == "1" {
|
||||
adapter := &codexHarnessOutput{}
|
||||
user := ""
|
||||
if os.Geteuid() == 0 {
|
||||
user = "65534"
|
||||
}
|
||||
err := invoke(t.Context(), "/tmp", &agentrun.HarnessSpec{User: user}, []string{"sh", "-c", `printf '%s\n' '{"type":"thread.started","thread_id":"live-thread"}'; printf '%s\n' 'live diagnostic' >&2`}, adapter, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if adapter.SessionID() != "live-thread" {
|
||||
t.Fatal("forwarding lost the adapter input")
|
||||
}
|
||||
return
|
||||
}
|
||||
cmd := exec.CommandContext(t.Context(), os.Args[0], "-test.run=^TestHarnessLiveOutput$")
|
||||
cmd.Env = append(os.Environ(), "ARCHIE_TEST_HARNESS_OUTPUT=1")
|
||||
got, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("harness: %v: %s", err, got)
|
||||
}
|
||||
for _, want := range []string{"live-thread", "live diagnostic"} {
|
||||
if !strings.Contains(string(got), want) {
|
||||
t.Errorf("worker output %q is missing %q", got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,14 +74,16 @@ func (r *LoopRunner) Run(ctx context.Context, workspace string, req agentrun.Req
|
||||
}
|
||||
captureTools := captureToolSet(req.CaptureTools, captures)
|
||||
res, err := r.run(ctx, agentloop.Config{
|
||||
Runtime: r.runtime,
|
||||
ModelRef: req.Model,
|
||||
WorkDir: workspace,
|
||||
Mission: req.Mission,
|
||||
ExtraRules: agentexec.ProjectScopedRules(workspace, req.ExtraRules),
|
||||
Notes: notes,
|
||||
Gate: toAgentGate(req.Gate),
|
||||
Preflight: toAgentCommands(req.Preflight),
|
||||
Runtime: r.runtime,
|
||||
ModelRef: req.Model,
|
||||
WorkDir: workspace,
|
||||
|
||||
MaxParallelToolCalls: MaxParallelToolCalls,
|
||||
Mission: req.Mission,
|
||||
ExtraRules: agentexec.ProjectScopedRules(workspace, req.ExtraRules),
|
||||
Notes: notes,
|
||||
Gate: toAgentGate(req.Gate),
|
||||
Preflight: toAgentCommands(req.Preflight),
|
||||
Budget: agentloop.Budget{
|
||||
MaxSteps: req.Budget.MaxSteps,
|
||||
WallClock: req.Budget.WallClock,
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package modelloop
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/samcharles93/ai-sdk/runtime"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/domain/agentrun"
|
||||
@@ -14,6 +16,18 @@ import (
|
||||
// "provider/model"; its Reasoning flag tells the runtime which models need
|
||||
// max_completion_tokens instead of max_tokens.
|
||||
func NewRuntime(providers map[string]agentrun.Provider, limits map[string]config.ModelLimits) *runtime.Runtime {
|
||||
return NewRuntimeWithKeys(providers, limits, nil)
|
||||
}
|
||||
|
||||
// NewRuntimeWithKeys binds host-resolved credentials to one runtime without
|
||||
// exporting them into the process environment or the task protocol.
|
||||
func NewRuntimeWithKeys(providers map[string]agentrun.Provider, limits map[string]config.ModelLimits, keys map[string]string) *runtime.Runtime {
|
||||
return NewRuntimeOver(nil, providers, limits, keys)
|
||||
}
|
||||
|
||||
// NewRuntimeOver is NewRuntimeWithKeys with base carrying the provider
|
||||
// requests, traced; nil means http.DefaultTransport.
|
||||
func NewRuntimeOver(base http.RoundTripper, providers map[string]agentrun.Provider, limits map[string]config.ModelLimits, keys map[string]string) *runtime.Runtime {
|
||||
if len(providers) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -21,14 +35,16 @@ func NewRuntime(providers map[string]agentrun.Provider, limits map[string]config
|
||||
catalog := make(map[string]runtime.ProviderConfig, len(providers))
|
||||
for name, provider := range providers {
|
||||
cfg := runtime.ProviderConfig{ID: name, Class: provider.Class, BaseURL: provider.BaseURL, Models: reasoningModels(name, limits)}
|
||||
if provider.APIKeyEnv == "" {
|
||||
if key, ok := keys[name]; ok {
|
||||
cfg.Auth = runtime.AuthConfig{APIKey: key}
|
||||
} else if provider.APIKeyEnv == "" {
|
||||
cfg.Auth = runtime.AuthConfig{Type: runtime.AuthTypeNone}
|
||||
} else {
|
||||
cfg.Auth = runtime.AuthConfig{APIKeyEnv: provider.APIKeyEnv}
|
||||
}
|
||||
catalog[name] = cfg
|
||||
}
|
||||
return runtime.NewRuntime(runtime.Config{Providers: catalog})
|
||||
return runtime.NewRuntime(runtime.Config{Providers: catalog, HTTPTransport: otelhttp.NewTransport(base)})
|
||||
}
|
||||
|
||||
func reasoningModels(provider string, limits map[string]config.ModelLimits) []runtime.ModelConfig {
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
||||
aicore "github.com/samcharles93/ai-sdk/core"
|
||||
@@ -65,7 +66,7 @@ type ToolSetOptions struct {
|
||||
// bypass the agent loop's read-only and protected-path enforcement.
|
||||
ExcludeToolsets []string
|
||||
|
||||
// Approval is the human-consent gate for tools marked RequiresApproval.
|
||||
// Approval is the operator-consent gate for tools marked RequiresApproval.
|
||||
// Nil means no approver is configured — such tools are omitted from the
|
||||
// built set rather than failing at call time.
|
||||
Approval tools.ApprovalRequester
|
||||
@@ -123,7 +124,7 @@ func BuildToolSetFrom(entries []tools.ToolEntry, opts ToolSetOptions) (aicore.To
|
||||
// A tool that requires approval must not appear in a set built without
|
||||
// an approver: the model would see a tool it can never invoke. With an
|
||||
// approver present the tool is built and the execute closure gates each
|
||||
// call on the human's decision.
|
||||
// call on the operator's decision.
|
||||
if entry.Classification.IsApprovalRequired() && opts.Approval == nil {
|
||||
continue
|
||||
}
|
||||
@@ -148,11 +149,45 @@ func BuildToolSetFrom(entries []tools.ToolEntry, opts ToolSetOptions) (aicore.To
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("tool %s schema: %w", entry.Name, err)
|
||||
}
|
||||
set[entry.Name] = aicore.NewTool(entry.Name, entry.Description, params, toolExecute(entry, opts))
|
||||
tool := aicore.NewTool(entry.Name, entry.Description, params, toolExecute(entry, opts))
|
||||
tool.Concurrency = concurrency(entry.Classification)
|
||||
set[entry.Name] = tool
|
||||
}
|
||||
return set, nil
|
||||
}
|
||||
|
||||
// MaxParallelToolCalls bounds how many of one model step's tool calls run at
|
||||
// once. Each tool's classification decides which calls may overlap.
|
||||
const MaxParallelToolCalls = 8
|
||||
|
||||
// concurrency maps a classification to how a call may overlap others.
|
||||
// Unclassified and approval-gated tools run alone: approvals are asked one
|
||||
// at a time, and an unknown tool is never assumed safe.
|
||||
func concurrency(class tools.ToolClassification) func(string) aicore.Concurrency {
|
||||
switch {
|
||||
case class.IsApprovalRequired():
|
||||
return nil
|
||||
case class.IsIdempotent():
|
||||
return func(input string) aicore.Concurrency { return pathKeyed(input, true) }
|
||||
case class.IsMutating():
|
||||
return func(input string) aicore.Concurrency { return pathKeyed(input, false) }
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// pathKeyed orders calls per path argument, so a read and a write of one
|
||||
// file keep the model's order. A call without a path runs in parallel when
|
||||
// pathless is set and alone otherwise.
|
||||
func pathKeyed(input string, pathless bool) aicore.Concurrency {
|
||||
var args struct {
|
||||
Path string `json:"path"`
|
||||
}
|
||||
if json.Unmarshal([]byte(input), &args) != nil || args.Path == "" {
|
||||
return aicore.Concurrency{Parallel: pathless}
|
||||
}
|
||||
return aicore.Concurrency{Parallel: true, Key: filepath.Clean(args.Path)}
|
||||
}
|
||||
|
||||
func safeToolAvailable(entry tools.ToolEntry) (available bool, err error) {
|
||||
defer func() {
|
||||
if recovered := recover(); recovered != nil {
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
@@ -20,6 +21,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/domain/workflow/task"
|
||||
"github.com/samcharles93/archie-core/internal/events"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/prsource"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/taskmcp"
|
||||
"github.com/samcharles93/archie-core/internal/installtype"
|
||||
"github.com/samcharles93/archie-core/internal/storage"
|
||||
"github.com/samcharles93/archie-core/internal/taskrun"
|
||||
@@ -96,10 +98,6 @@ func (h *hybridTrees) Snapshot(ctx context.Context, dir, destDir string) error {
|
||||
return h.local.Snapshot(ctx, dir, destDir)
|
||||
}
|
||||
|
||||
func (h *hybridTrees) ChangedLines(ctx context.Context, dir, base string) (int, error) {
|
||||
return h.local.ChangedLines(ctx, dir, base)
|
||||
}
|
||||
|
||||
// ChangedFileStats forwards to the local worktree manager.
|
||||
func (h *hybridTrees) ChangedFileStats(ctx context.Context, dir, base string) (task.ChangeStats, error) {
|
||||
return h.local.ChangedFileStats(ctx, dir, base)
|
||||
@@ -137,11 +135,12 @@ func worktreeOwnerID(env string) int {
|
||||
}
|
||||
|
||||
type taskDependencies struct {
|
||||
forge workflow.Forger
|
||||
store workflow.Store
|
||||
calls task.Caller
|
||||
trees remoteTrees
|
||||
events agentexec.EventPublisher
|
||||
forge workflow.Forger
|
||||
messenger workflow.Messenger
|
||||
store workflow.Store
|
||||
calls task.Caller
|
||||
trees remoteTrees
|
||||
events agentexec.EventPublisher
|
||||
// steps is the workflow step vocabulary pinned definitions are compiled
|
||||
// against, registered at the composition root and injected: this is the
|
||||
// executing half of the contract whose validating half is the control
|
||||
@@ -152,12 +151,18 @@ type taskDependencies struct {
|
||||
// runs in archie-agent, so the daemon's engine cannot reach it) and set on
|
||||
// every TaskContext; nil means guardrails are disabled.
|
||||
guardrails *tools.GuardrailEngine
|
||||
// modelTransport carries model requests: the egress proxy transport, or
|
||||
// nil to go direct.
|
||||
modelTransport http.RoundTripper
|
||||
}
|
||||
|
||||
type runnerFactory func(map[string]agentrun.Provider, map[string]config.ModelLimits, *slog.Logger) agentrun.Runner
|
||||
|
||||
func newTaskRunner(providers map[string]agentrun.Provider, limits map[string]config.ModelLimits, log *slog.Logger) agentrun.Runner {
|
||||
return modelloop.NewLoopRunner(modelloop.NewRuntime(providers, limits), log)
|
||||
// newTaskRunner builds runners whose model requests go over base.
|
||||
func newTaskRunner(base http.RoundTripper) runnerFactory {
|
||||
return func(providers map[string]agentrun.Provider, limits map[string]config.ModelLimits, log *slog.Logger) agentrun.Runner {
|
||||
return modelloop.NewLoopRunner(modelloop.NewRuntimeOver(base, providers, limits, nil), log)
|
||||
}
|
||||
}
|
||||
|
||||
// applyToolLimits sets the task's tool policy and allowlist on a
|
||||
@@ -177,14 +182,14 @@ func applyToolLimits(agent agentrun.Runner, policy config.ToolPolicy, allow []st
|
||||
// stageRunners builds the runner every agent stage uses. llm is the task's
|
||||
// shared model runtime (the one its MCP providers answer sampling from); the
|
||||
// registry path reuses it rather than building a second one.
|
||||
func stageRunners(req taskrun.Request, mcpSet *mcpProviderSet, newRunner runnerFactory, llm *runtime.Runtime, log *slog.Logger) (agentrun.Runner, error) {
|
||||
func stageRunners(req taskrun.Request, mcpSet *taskmcp.Set, newRunner runnerFactory, llm *runtime.Runtime, log *slog.Logger) (agentrun.Runner, error) {
|
||||
if req.Harness != nil {
|
||||
// The built-in loop has no route to a model from a Kit container.
|
||||
return agentexec.HarnessStages{Runner: agentexec.NewHarnessRunner(nil), Spec: *req.Harness}, nil
|
||||
}
|
||||
var agent agentrun.Runner
|
||||
if mcpSet != nil && mcpSet.registry != nil {
|
||||
agent = modelloop.NewLoopRunner(llm, log, mcpSet.registry)
|
||||
if mcpSet != nil && mcpSet.Registry != nil {
|
||||
agent = modelloop.NewLoopRunner(llm, log, mcpSet.Registry)
|
||||
} else {
|
||||
agent = newRunner(req.Providers, req.Cfg.ModelLimits, log)
|
||||
}
|
||||
@@ -224,19 +229,9 @@ func runTask(ctx context.Context, req taskrun.Request, dependencies taskDependen
|
||||
}
|
||||
defer restoreWorktreeOwnership(trees, workDir, log)()
|
||||
|
||||
// The MCP providers a task hosts share the same model runtime its agent
|
||||
// stages run on, so a server-initiated sampling request is answered from
|
||||
// the task's own model rather than a second provider client.
|
||||
var llm *runtime.Runtime
|
||||
if len(req.MCPServers) > 0 {
|
||||
llm = modelloop.NewRuntime(req.Providers, req.Cfg.ModelLimits)
|
||||
}
|
||||
mcpSet, mcpErr := startMCPProviders(ctx, req.MCPServers, taskSamplingHandler(llm, req.Cfg, samplingUsageRecorder(dependencies.store, req.Task, log)), log)
|
||||
llm, mcpSet := taskMCPProviders(ctx, req, dependencies, log)
|
||||
if mcpSet != nil {
|
||||
defer mcpSet.cleanup(ctx, log)
|
||||
}
|
||||
if mcpErr != nil {
|
||||
log.Warn("mcp providers had errors, continuing with available tools", "err", mcpErr)
|
||||
defer mcpSet.Close(ctx, log)
|
||||
}
|
||||
|
||||
agent, err := stageRunners(req, mcpSet, newRunner, llm, log)
|
||||
@@ -261,16 +256,15 @@ func runTask(ctx context.Context, req taskrun.Request, dependencies taskDependen
|
||||
Forge: dependencies.forge,
|
||||
Store: dependencies.store,
|
||||
Calls: dependencies.calls,
|
||||
Messenger: dependencies.messenger,
|
||||
Trees: trees,
|
||||
Agent: agent,
|
||||
Bus: bus,
|
||||
Log: log,
|
||||
Guardrails: dependencies.guardrails,
|
||||
}
|
||||
// pr-review reads the PR data the daemon prefetched into workDir.
|
||||
if req.Task.Workflow == "pr-review" {
|
||||
tc.PRSource = prsource.NewFromMount(filepath.Join(workDir, prsource.PrefetchDirName))
|
||||
}
|
||||
tc.Instructions = req.Instructions
|
||||
configureTaskContext(tc, workDir)
|
||||
|
||||
if req.Repo.PersistentStorage {
|
||||
memory, readErr := readProjectMemory(storage.MemoryPath)
|
||||
@@ -292,6 +286,18 @@ func runTask(ctx context.Context, req taskrun.Request, dependencies taskDependen
|
||||
}, nil
|
||||
}
|
||||
|
||||
// configureTaskContext applies what the task's kind changes about its context:
|
||||
// a test run records every outward delivery and performs none, and pr-review
|
||||
// reads the PR data the daemon prefetched into workDir.
|
||||
func configureTaskContext(tc *workflow.TaskContext, workDir string) {
|
||||
if tc.Task.IsTestRun() {
|
||||
workflow.RecordDeliveries(tc)
|
||||
}
|
||||
if tc.Task.Workflow == "pr-review" {
|
||||
tc.PRSource = prsource.NewFromMount(filepath.Join(workDir, prsource.PrefetchDirName))
|
||||
}
|
||||
}
|
||||
|
||||
// CompilePinnedWorkflow compiles the definition the request carries. With
|
||||
// none, it pins one from the shipped definitions onto req and req.Task.
|
||||
func CompilePinnedWorkflow(req *taskrun.Request, steps *workflow.Manager) (workflow.Workflow, error) {
|
||||
@@ -333,3 +339,15 @@ func CompilePinnedWorkflow(req *taskrun.Request, steps *workflow.Manager) (workf
|
||||
}
|
||||
return wf, nil
|
||||
}
|
||||
|
||||
func taskMCPProviders(ctx context.Context, req taskrun.Request, deps taskDependencies, log *slog.Logger) (*runtime.Runtime, *taskmcp.Set) {
|
||||
if req.Harness != nil || len(req.MCPServers) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
llm := modelloop.NewRuntimeOver(deps.modelTransport, req.Providers, req.Cfg.ModelLimits, nil)
|
||||
set, err := taskmcp.Start(ctx, req.MCPServers, taskmcp.SamplingHandler(llm, req.Cfg, taskmcp.UsageRecorder(deps.store, req.Task, log)), log, storage.MCPNPMCacheMountDir)
|
||||
if err != nil {
|
||||
log.WarnContext(ctx, "mcp providers had errors, continuing with available tools", "err", err)
|
||||
}
|
||||
return llm, set
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/readiness"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/workflowsteps"
|
||||
"github.com/samcharles93/archie-core/internal/installtype"
|
||||
"github.com/samcharles93/archie-core/internal/logging"
|
||||
"github.com/samcharles93/archie-core/internal/storage"
|
||||
"github.com/samcharles93/archie-core/internal/taskrun"
|
||||
"github.com/samcharles93/archie-core/internal/tools"
|
||||
@@ -50,6 +51,8 @@ type Settings struct {
|
||||
// NATS storerpc path is deleted.
|
||||
StateStoreTarget string
|
||||
StateStoreToken string
|
||||
// StateStoreCA is the PEM CA the State Store's certificate chains to.
|
||||
StateStoreCA []byte
|
||||
|
||||
// ModelProxy, ModelProxyHosts and ModelProxyCA route model provider
|
||||
// requests through the daemon's egress proxy, which holds the keys.
|
||||
@@ -98,7 +101,7 @@ func productionWorkerDependencies() (workerDependencies, error) {
|
||||
bootID: agentboot.TaskID,
|
||||
wait: func(ctx context.Context, log *slog.Logger) {
|
||||
<-ctx.Done()
|
||||
log.Info("archie-agent shutting down")
|
||||
log.InfoContext(ctx, "archie-agent shutting down")
|
||||
},
|
||||
steps: steps,
|
||||
guardrails: tools.NewGuardrailEngine(tools.DefaultGuardrailConfig()),
|
||||
@@ -124,14 +127,13 @@ func run(ctx context.Context, settings Settings, log *slog.Logger, dependencies
|
||||
workDir = storage.WorktreeMountDir
|
||||
}
|
||||
|
||||
var modelTransport http.RoundTripper
|
||||
if settings.ModelProxy != "" {
|
||||
transport, err := egress.ModelTransport(settings.ModelProxy, settings.ModelProxyHosts, settings.ModelProxyCA)
|
||||
var err error
|
||||
modelTransport, err = egress.ModelTransport(settings.ModelProxy, settings.ModelProxyHosts, settings.ModelProxyCA)
|
||||
if err != nil {
|
||||
return &StartupError{Operation: "model proxy", Err: err}
|
||||
}
|
||||
// The model SDK builds its clients on the default transport and takes
|
||||
// no client of its own, so the process-wide default is the seam.
|
||||
http.DefaultTransport = transport
|
||||
}
|
||||
dependencies.markSafe(ctx, workDir, log)
|
||||
|
||||
@@ -139,7 +141,7 @@ func run(ctx context.Context, settings Settings, log *slog.Logger, dependencies
|
||||
// worker logs in as its task, with its run credential.
|
||||
taskID, err := dependencies.bootID(workDir)
|
||||
if err != nil {
|
||||
log.Error("task boot failed", "err", err)
|
||||
log.ErrorContext(ctx, "task boot failed", "err", err)
|
||||
return &StartupError{Operation: "task boot failed", Err: err}
|
||||
}
|
||||
transport, err := dependencies.connect(ctx, agentnats.Config{
|
||||
@@ -148,26 +150,27 @@ func run(ctx context.Context, settings Settings, log *slog.Logger, dependencies
|
||||
TaskID: taskID,
|
||||
StateStoreURL: settings.StateStoreTarget,
|
||||
StateStoreToken: settings.StateStoreToken,
|
||||
StateStoreCA: settings.StateStoreCA,
|
||||
}, log)
|
||||
if err != nil {
|
||||
operation := "nats connect failed"
|
||||
log.Error(operation, "err", err)
|
||||
log.ErrorContext(ctx, operation, "err", err)
|
||||
return &StartupError{Operation: operation, Err: err}
|
||||
}
|
||||
defer transport.Close()
|
||||
log = slog.New(agentexec.NewSystemLogHandler(log.Handler(), transport.LogPublisher(), taskID))
|
||||
log.Info("system log publisher attached", "task", taskID)
|
||||
log = slog.New(logging.WithTrace(agentexec.NewSystemLogHandler(log.Handler(), transport.LogPublisher(), taskID)))
|
||||
log.InfoContext(ctx, "system log publisher attached", "task", taskID)
|
||||
|
||||
subscription, err := transport.SubscribeTasks(ctx, taskID, func(ctx context.Context, request taskrun.Request) (*taskrun.Response, error) {
|
||||
return executeTaskRequest(ctx, request, transport, workDir, log, dependencies.steps, dependencies.guardrails)
|
||||
return executeTaskRequest(ctx, request, transport, workDir, log, dependencies.steps, dependencies.guardrails, modelTransport)
|
||||
}, log)
|
||||
if err != nil {
|
||||
log.Error("taskrun subscribe failed", "err", err)
|
||||
log.ErrorContext(ctx, "taskrun subscribe failed", "err", err)
|
||||
return &StartupError{Operation: "taskrun subscribe failed", Err: err}
|
||||
}
|
||||
defer func() {
|
||||
if err := subscription.Close(); err != nil {
|
||||
log.Warn("task run unsubscribe failed", "err", err)
|
||||
log.WarnContext(ctx, "task run unsubscribe failed", "err", err)
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -178,35 +181,39 @@ func run(ctx context.Context, settings Settings, log *slog.Logger, dependencies
|
||||
return nil
|
||||
}))
|
||||
go presence.Run(ctx, presence.Agent, presence.Build{InstanceID: strconv.FormatInt(taskID, 10), Version: Version(), InstallType: installtype.Type()}, transport, registry, log)
|
||||
log.Info("archie-agent ready", "nats", settings.NATSURL)
|
||||
log.InfoContext(ctx, "archie-agent ready", "nats", settings.NATSURL)
|
||||
dependencies.wait(ctx, log)
|
||||
return nil
|
||||
}
|
||||
|
||||
type taskServiceTransport interface {
|
||||
Forger(identity, credential string, timeout time.Duration) workflow.Forger
|
||||
Messenger(identity, credential string, timeout time.Duration) workflow.Messenger
|
||||
Store(time.Duration) workflow.Store
|
||||
Calls(time.Duration) task.Caller
|
||||
Trees(string, string, time.Duration) agentnats.RemoteTrees
|
||||
EventPublisher() agentexec.EventPublisher
|
||||
}
|
||||
|
||||
func executeTaskRequest(ctx context.Context, request taskrun.Request, transport taskServiceTransport, workDir string, log *slog.Logger, steps *workflow.Manager, guardrails *tools.GuardrailEngine) (*taskrun.Response, error) {
|
||||
log.Info("running task", "task", request.Task.ID, "repo", request.Repo.FullName(), "issue", request.Task.IssueNumber)
|
||||
func executeTaskRequest(ctx context.Context, request taskrun.Request, transport taskServiceTransport, workDir string, log *slog.Logger, steps *workflow.Manager, guardrails *tools.GuardrailEngine, modelTransport http.RoundTripper) (*taskrun.Response, error) {
|
||||
log.InfoContext(ctx, "running task", "task", request.Task.ID, "repo", request.Repo.FullName(), "issue", request.Task.IssueNumber)
|
||||
dependencies := taskDependencies{
|
||||
forge: transport.Forger(request.Task.Identity, request.RunCredential, rpcTimeout),
|
||||
messenger: transport.Messenger(request.Task.Identity, request.RunCredential, rpcTimeout),
|
||||
store: transport.Store(rpcTimeout),
|
||||
calls: transport.Calls(rpcTimeout),
|
||||
trees: transport.Trees(request.Task.Identity, request.RunCredential, rpcTimeout),
|
||||
events: transport.EventPublisher(),
|
||||
steps: steps,
|
||||
guardrails: guardrails,
|
||||
|
||||
modelTransport: modelTransport,
|
||||
}
|
||||
response, err := runTask(ctx, request, dependencies, newTaskRunner, workDir, log)
|
||||
response, err := runTask(ctx, request, dependencies, newTaskRunner(modelTransport), workDir, log)
|
||||
if err != nil {
|
||||
log.Error("task run failed", "task", request.Task.ID, "err", err)
|
||||
log.ErrorContext(ctx, "task run failed", "task", request.Task.ID, "err", err)
|
||||
return nil, err
|
||||
}
|
||||
log.Info("task run complete", "task", request.Task.ID, "status", response.Status)
|
||||
log.InfoContext(ctx, "task run complete", "task", request.Task.ID, "status", response.Status)
|
||||
return response, nil
|
||||
}
|
||||
@@ -0,0 +1,449 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"net/http"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/domain/alert"
|
||||
"github.com/samcharles93/archie-core/internal/domain/org"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/alertwebhook"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/controlplanerpc"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/controlplanestore"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog"
|
||||
"github.com/samcharles93/archie-core/internal/releaseupdate"
|
||||
)
|
||||
|
||||
// notifyCredential is the credential binding service an org's alert webhook
|
||||
// is signed with.
|
||||
const notifyCredential = "notify"
|
||||
|
||||
const (
|
||||
// deliveryInterval is how often due webhook deliveries are claimed.
|
||||
deliveryInterval = 15 * time.Second
|
||||
// releaseCheckInterval is how often GitHub is asked for a newer release.
|
||||
releaseCheckInterval = 6 * time.Hour
|
||||
// alertCallTimeout bounds one check's calls to the State Store.
|
||||
alertCallTimeout = 20 * time.Second
|
||||
// credentialReportEvery is how long an unchanged credential state goes
|
||||
// unreported, so the egress path does not call the State Store per request.
|
||||
credentialReportEvery = 10 * time.Minute
|
||||
)
|
||||
|
||||
// alertChecks raises the alerts that have no transition to hang on: the
|
||||
// daemon's configuration and the release channel. Each check lists what it
|
||||
// owns, so alerts from before a restart are still cleared once fixed.
|
||||
type alertChecks struct {
|
||||
store alert.Store
|
||||
log func(msg string, args ...any)
|
||||
cfg func() config.Config
|
||||
// catalog is the models the providers currently offer.
|
||||
catalog func() modelcatalog.Snapshot
|
||||
// release is the newest release the update channel offers.
|
||||
release func(context.Context) (releaseupdate.Snapshot, error)
|
||||
}
|
||||
|
||||
func (c alertChecks) reporter() alert.Reporter {
|
||||
return alert.Reporter{Raiser: c.store, By: "archied"}
|
||||
}
|
||||
|
||||
// sync makes the open alerts of kind in orgID match active: it raises each
|
||||
// input and resolves the alerts, snoozed or open, whose condition cleared.
|
||||
func (c alertChecks) sync(ctx context.Context, orgID org.OrgID, kind string, active []alert.Input) {
|
||||
reporter := c.reporter()
|
||||
subjects := make([]string, 0, len(active))
|
||||
for _, in := range active {
|
||||
reporter.Raise(ctx, in)
|
||||
subjects = append(subjects, in.Subject)
|
||||
}
|
||||
existing, err := c.store.ListAlerts(ctx, orgID, alert.Filter{States: []alert.State{alert.StateOpen, alert.StateDismissed}, Limit: 500})
|
||||
if err != nil {
|
||||
c.log("alerts not checked", "kind", kind, "err", err)
|
||||
return
|
||||
}
|
||||
for _, a := range existing {
|
||||
if a.Kind == kind && a.Condition && !slices.Contains(subjects, a.Subject) {
|
||||
reporter.Resolve(ctx, a.Key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// checkConfig raises the alerts the effective configuration implies: a
|
||||
// missing or dangling model alias, and providers and granted services with no
|
||||
// usable credential.
|
||||
func (c alertChecks) checkConfig(ctx context.Context) {
|
||||
cfg := c.cfg()
|
||||
c.sync(ctx, org.DefaultOrgID, alert.KindModelAlias, modelAliasAlerts(cfg.Models, c.catalog()))
|
||||
c.sync(ctx, org.DefaultOrgID, alert.KindProviderNoKey, providerAlerts(cfg.Providers))
|
||||
c.sync(ctx, org.DefaultOrgID, alert.KindUptimeShort, uptimeAlerts(cfg))
|
||||
unbound := unboundAlerts(cfg)
|
||||
for _, orgID := range credentialOrgs(cfg) {
|
||||
c.sync(ctx, orgID, alert.KindToolNoBinding, unbound[orgID])
|
||||
}
|
||||
}
|
||||
|
||||
func modelAliasAlerts(aliases map[string]string, catalog modelcatalog.Snapshot) []alert.Input {
|
||||
var out []alert.Input
|
||||
input := func(alias, title, body string) alert.Input {
|
||||
return alert.Input{
|
||||
Org: org.DefaultOrgID, Kind: alert.KindModelAlias, Subject: "alias:" + alias,
|
||||
Severity: alert.SeverityAction, Condition: true, Title: title, Body: body, Link: "/settings/models",
|
||||
}
|
||||
}
|
||||
if strings.TrimSpace(aliases[config.DefaultModelAlias]) == "" {
|
||||
out = append(out, input(config.DefaultModelAlias, "No default model alias is set",
|
||||
"Set it to a model."))
|
||||
}
|
||||
chat := config.ChatAliases(aliases)
|
||||
for _, alias := range slices.Sorted(maps.Keys(aliases)) {
|
||||
// The catalogue lists tool-calling chat models only, so it cannot say
|
||||
// whether an embedding or transcription model still exists.
|
||||
if !slices.Contains(chat, alias) {
|
||||
continue
|
||||
}
|
||||
providerID, modelID, ok := strings.Cut(aliases[alias], "/")
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
offered := catalogModels(catalog, providerID)
|
||||
// A provider the catalogue does not list is a credential problem, not
|
||||
// a retired model.
|
||||
if len(offered) > 0 && !slices.Contains(offered, modelID) {
|
||||
out = append(out, input(alias, fmt.Sprintf("Model alias %q points at a retired model", alias),
|
||||
fmt.Sprintf("%s no longer offers %s. Choose another model.", providerID, modelID)))
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func catalogModels(catalog modelcatalog.Snapshot, providerID string) []string {
|
||||
for _, provider := range catalog.Providers {
|
||||
if provider.ID == providerID {
|
||||
ids := make([]string, len(provider.Models))
|
||||
for i, model := range provider.Models {
|
||||
ids[i] = model.ID
|
||||
}
|
||||
return ids
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// uptimeAlerts flags a container uptime shorter than the task time limit: the
|
||||
// container is killed before the task can reach its own limit.
|
||||
func uptimeAlerts(cfg config.Config) []alert.Input {
|
||||
uptime, limit := cfg.Containers.MaxUptime.Std(), cfg.Budgets.TaskWallClock.Std()
|
||||
if uptime <= 0 || (limit > 0 && limit <= uptime) {
|
||||
return nil
|
||||
}
|
||||
return []alert.Input{{
|
||||
Org: org.DefaultOrgID, Kind: alert.KindUptimeShort, Subject: "containers.max_uptime",
|
||||
Severity: alert.SeverityWarning, Condition: true,
|
||||
Title: "Container max uptime is shorter than the task time limit",
|
||||
Body: "Tasks are killed at the uptime before they reach their limit. Raise the max uptime.",
|
||||
Link: "/settings/container-runtime",
|
||||
}}
|
||||
}
|
||||
|
||||
func providerAlerts(providers map[string]config.Provider) []alert.Input {
|
||||
var out []alert.Input
|
||||
for _, name := range slices.Sorted(maps.Keys(providers)) {
|
||||
if !providers[name].Disabled {
|
||||
continue
|
||||
}
|
||||
out = append(out, alert.Input{
|
||||
Org: org.DefaultOrgID, Kind: alert.KindProviderNoKey, Subject: "provider:" + name,
|
||||
Severity: alert.SeverityAction, Condition: true,
|
||||
Title: fmt.Sprintf("Provider %q has no usable credential", name),
|
||||
Body: "Key unresolved; its models cannot run. Check the binding.",
|
||||
Link: "/settings/credential-bindings",
|
||||
})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// credentialOrgs are the orgs whose identities are granted credentials, the
|
||||
// instance org always among them.
|
||||
func credentialOrgs(cfg config.Config) []org.OrgID {
|
||||
orgs := []org.OrgID{org.DefaultOrgID}
|
||||
for _, name := range append([]string{""}, identityNames(cfg)...) {
|
||||
orgName, _ := cfg.CredentialAccess(name)
|
||||
if id := org.OrgID(credentialOrg(orgName)); !slices.Contains(orgs, id) {
|
||||
orgs = append(orgs, id)
|
||||
}
|
||||
}
|
||||
return orgs
|
||||
}
|
||||
|
||||
func identityNames(cfg config.Config) []string {
|
||||
names := make([]string, 0, len(cfg.Identities))
|
||||
for _, id := range cfg.Identities {
|
||||
names = append(names, id.Name)
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
func credentialOrg(name string) string {
|
||||
if name == "" {
|
||||
return string(org.DefaultOrgID)
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
// unboundAlerts are the granted services with no credential binding in the
|
||||
// granting identity's org, by org. A model provider needs no binding of its
|
||||
// own here: its key is the provider's.
|
||||
func unboundAlerts(cfg config.Config) map[org.OrgID][]alert.Input {
|
||||
out := map[org.OrgID][]alert.Input{}
|
||||
seen := map[alert.Key]bool{}
|
||||
for _, name := range append([]string{""}, identityNames(cfg)...) {
|
||||
orgName, granted := cfg.CredentialAccess(name)
|
||||
orgID := org.OrgID(credentialOrg(orgName))
|
||||
bound := cfg.Containers.BoundCredentials(orgName, granted, granted)
|
||||
for _, service := range granted {
|
||||
key := alert.Key{Org: orgID, Kind: alert.KindToolNoBinding, Subject: "service:" + service}
|
||||
if _, ok := cfg.Providers[service]; ok || bound[service].Service != "" || seen[key] {
|
||||
continue
|
||||
}
|
||||
seen[key] = true
|
||||
out[orgID] = append(out[orgID], alert.Input{
|
||||
Key: key, Severity: alert.SeverityAction, Condition: true,
|
||||
Title: fmt.Sprintf("%q is granted but has no credential binding", service),
|
||||
Body: "Runs cannot authenticate. Bind a credential.",
|
||||
Link: "/settings/credential-bindings",
|
||||
})
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// checkRelease raises an info alert while the update channel offers a newer
|
||||
// release. A failed check changes nothing: the next one decides.
|
||||
func (c alertChecks) checkRelease(ctx context.Context) {
|
||||
snapshot, err := c.release(ctx)
|
||||
if err != nil {
|
||||
c.log("release check failed", "err", err)
|
||||
return
|
||||
}
|
||||
var active []alert.Input
|
||||
if available := snapshot.Available(); len(available) > 0 {
|
||||
parts := make([]string, len(available))
|
||||
for i, component := range available {
|
||||
parts[i] = fmt.Sprintf("%s %s", component.Label, component.Available)
|
||||
}
|
||||
active = append(active, alert.Input{
|
||||
Org: org.DefaultOrgID, Kind: alert.KindReleaseAvailable, Subject: "release",
|
||||
Severity: alert.SeverityInfo, Condition: true,
|
||||
Title: "Newer release available", Body: strings.Join(parts, ", "),
|
||||
Link: "/settings/status",
|
||||
})
|
||||
}
|
||||
c.sync(ctx, org.DefaultOrgID, alert.KindReleaseAvailable, active)
|
||||
}
|
||||
|
||||
// every runs fn now and then each interval until ctx ends.
|
||||
func every(ctx context.Context, interval time.Duration, fn func(context.Context)) {
|
||||
ticker := time.NewTicker(interval)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
callCtx, cancel := context.WithTimeout(ctx, alertCallTimeout)
|
||||
fn(callCtx)
|
||||
cancel()
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-ticker.C:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// startAlerts starts the daemon's alert checks and the webhook delivery loop.
|
||||
// The State Store being away costs the checks a tick, nothing else.
|
||||
func (b *boot) startAlerts(ctx context.Context) {
|
||||
client, ok := b.stateStore.(alert.Store)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
reader := controlplanerpc.NewRPCClient(b.controlPlaneRPC)
|
||||
catalog := controlplanerpc.UpdateService(reader, "").Catalog
|
||||
checks := alertChecks{
|
||||
store: client, log: b.log.Warn, cfg: b.cfgHolder.Get, catalog: b.catalogState,
|
||||
release: func(ctx context.Context) (releaseupdate.Snapshot, error) { return catalog.Check(ctx) },
|
||||
}
|
||||
b.alertChecks = &checks
|
||||
go every(ctx, releaseCheckInterval, checks.checkRelease)
|
||||
go every(ctx, deliveryInterval, b.deliverAlerts(client))
|
||||
checks.checkConfig(ctx)
|
||||
}
|
||||
|
||||
// recheckAlerts re-evaluates the configuration alerts after the configuration
|
||||
// changed. It never blocks the change that caused it.
|
||||
func (b *boot) recheckAlerts(ctx context.Context) {
|
||||
checks := b.alertChecks
|
||||
if checks == nil {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
ctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), alertCallTimeout)
|
||||
defer cancel()
|
||||
checks.checkConfig(ctx)
|
||||
}()
|
||||
}
|
||||
|
||||
// deliverAlerts sends due webhook deliveries. A delivery the webhook is not
|
||||
// configured for, or whose alert is below the severity threshold, is closed
|
||||
// as skipped; one that fails is retried by the store on its schedule.
|
||||
func (b *boot) deliverAlerts(store alert.Deliverer) func(context.Context) {
|
||||
client := &http.Client{Timeout: 15 * time.Second}
|
||||
public := alertwebhook.PublicClient()
|
||||
// The system org's webhook may sit on the instance's own network; another
|
||||
// org's reaches the public internet only.
|
||||
clientFor := func(owner org.OrgID) *http.Client {
|
||||
if owner == "" || owner == org.DefaultOrgID {
|
||||
return client
|
||||
}
|
||||
return public
|
||||
}
|
||||
return func(ctx context.Context) {
|
||||
due, err := store.ClaimAlertDeliveries(ctx, 20)
|
||||
if err != nil {
|
||||
b.log.WarnContext(ctx, "alert deliveries not claimed", "err", err)
|
||||
return
|
||||
}
|
||||
outcomes := settleDeliveries(due, func(owner org.OrgID) (config.Notify, error) {
|
||||
notify, err := b.alertNotify(ctx, owner)
|
||||
if err != nil {
|
||||
b.log.WarnContext(ctx, "alert notification settings unavailable", "org", owner, "err", err)
|
||||
}
|
||||
return notify, err
|
||||
}, func(d alert.Due, notify config.Notify) alert.Outcome {
|
||||
return b.sendAlert(ctx, clientFor(d.Alert.Org), notify, d)
|
||||
})
|
||||
for _, outcome := range outcomes {
|
||||
if err := store.RecordAlertAttempt(ctx, outcome); err != nil {
|
||||
b.log.WarnContext(ctx, "alert delivery not recorded", "delivery", outcome.DeliveryID, "err", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// settleDeliveries decides each due delivery's outcome. Each org's settings
|
||||
// are looked up once per batch.
|
||||
func settleDeliveries(due []alert.Due, notifyFor func(org.OrgID) (config.Notify, error), send func(alert.Due, config.Notify) alert.Outcome) []alert.Outcome {
|
||||
type lookup struct {
|
||||
notify config.Notify
|
||||
err error
|
||||
}
|
||||
lookups := map[org.OrgID]lookup{}
|
||||
outcomes := make([]alert.Outcome, 0, len(due))
|
||||
for _, d := range due {
|
||||
found, ok := lookups[d.Alert.Org]
|
||||
if !ok {
|
||||
found.notify, found.err = notifyFor(d.Alert.Org)
|
||||
lookups[d.Alert.Org] = found
|
||||
}
|
||||
notify, err := found.notify, found.err
|
||||
if err != nil {
|
||||
outcomes = append(outcomes, alert.Outcome{DeliveryID: d.ID, Error: "notification settings unavailable"})
|
||||
continue
|
||||
}
|
||||
outcomes = append(outcomes, send(d, notify))
|
||||
}
|
||||
return outcomes
|
||||
}
|
||||
|
||||
// sendAlert posts one delivery to notify's webhook, or closes it as skipped
|
||||
// when there is none or the alert is below its severity threshold.
|
||||
func (b *boot) sendAlert(ctx context.Context, client *http.Client, notify config.Notify, d alert.Due) alert.Outcome {
|
||||
threshold := alert.Severity(notify.MinSeverity)
|
||||
if !threshold.Valid() {
|
||||
threshold = alert.SeverityWarning
|
||||
}
|
||||
if notify.Webhook == "" || d.Alert.Severity.Rank() < threshold.Rank() {
|
||||
return alert.Outcome{DeliveryID: d.ID, Skipped: true}
|
||||
}
|
||||
secret := ""
|
||||
if notify.Secret != (config.SecretRef{}) {
|
||||
var err error
|
||||
if secret, err = b.secrets.Resolve(notify.Secret); err != nil {
|
||||
return alert.Outcome{DeliveryID: d.ID, Error: "notify secret could not be resolved"}
|
||||
}
|
||||
}
|
||||
return alertwebhook.Send(ctx, client, notify.Webhook, secret, d)
|
||||
}
|
||||
|
||||
// alertNotify is the webhook an org's alerts go to: its own task policy,
|
||||
// signed with the org's credential binding named notify. The system org's is
|
||||
// the daemon's.
|
||||
func (b *boot) alertNotify(ctx context.Context, owner org.OrgID) (config.Notify, error) {
|
||||
cfg := b.cfgHolder.Get()
|
||||
if owner == "" || owner == org.DefaultOrgID {
|
||||
return cfg.Notify, nil
|
||||
}
|
||||
var notify config.Notify
|
||||
for _, o := range b.organisations(ctx) {
|
||||
if o.owner != owner {
|
||||
continue
|
||||
}
|
||||
_, _, err := b.controlPlane.Query(o.act(ctx), controlplanestore.TaskPolicyKind, func(value []byte) (err error) {
|
||||
notify, err = controlplanestore.OrgNotify(value)
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
return config.Notify{}, err
|
||||
}
|
||||
if binding, ok := cfg.Containers.BoundCredentials(string(owner), []string{notifyCredential}, []string{notifyCredential})[notifyCredential]; ok {
|
||||
notify.Secret = binding.Secret
|
||||
}
|
||||
return notify, nil
|
||||
}
|
||||
return config.Notify{}, nil
|
||||
}
|
||||
|
||||
// credentialWatch raises an alert when a bound credential cannot be resolved
|
||||
// and clears it once it can. The egress path calls observe per request, so an
|
||||
// unchanged state is reported at most every credentialReportEvery.
|
||||
type credentialWatch struct {
|
||||
reporter alert.Reporter
|
||||
mu sync.Mutex
|
||||
last map[alert.Key]credentialState
|
||||
}
|
||||
|
||||
type credentialState struct {
|
||||
rejected bool
|
||||
at time.Time
|
||||
}
|
||||
|
||||
func (w *credentialWatch) observe(ctx context.Context, orgName, service string, rejected bool) {
|
||||
if w == nil {
|
||||
return
|
||||
}
|
||||
key := alert.Key{Org: org.OrgID(credentialOrg(orgName)), Kind: alert.KindCredentialInvalid, Subject: "service:" + service}
|
||||
w.mu.Lock()
|
||||
if w.last == nil {
|
||||
w.last = map[alert.Key]credentialState{}
|
||||
}
|
||||
previous, known := w.last[key]
|
||||
if known && previous.rejected == rejected && time.Since(previous.at) < credentialReportEvery {
|
||||
w.mu.Unlock()
|
||||
return
|
||||
}
|
||||
w.last[key] = credentialState{rejected: rejected, at: time.Now()}
|
||||
w.mu.Unlock()
|
||||
go func() {
|
||||
ctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), alertCallTimeout)
|
||||
defer cancel()
|
||||
w.reporter.Sync(ctx, rejected, alert.Input{
|
||||
Key: key, Severity: alert.SeverityAction, Condition: true,
|
||||
Title: fmt.Sprintf("The credential bound to %q is not working", service),
|
||||
Body: "Secret unresolved; runs cannot authenticate. Check the binding.",
|
||||
Link: "/settings/credential-bindings",
|
||||
})
|
||||
}()
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/domain/alert"
|
||||
"github.com/samcharles93/archie-core/internal/domain/org"
|
||||
)
|
||||
|
||||
func TestSettleDeliveriesRetriesWhenSettingsAreUnavailable(t *testing.T) {
|
||||
due := []alert.Due{
|
||||
{ID: 1, Alert: alert.Alert{Key: alert.Key{Org: "acme"}}},
|
||||
{ID: 2, Alert: alert.Alert{Key: alert.Key{Org: "acme"}}},
|
||||
{ID: 3, Alert: alert.Alert{Key: alert.Key{Org: "beta"}}},
|
||||
}
|
||||
notifyFor := func(owner org.OrgID) (config.Notify, error) {
|
||||
if owner == "acme" {
|
||||
return config.Notify{}, errors.New("control plane unavailable")
|
||||
}
|
||||
return config.Notify{Webhook: "https://example.com"}, nil
|
||||
}
|
||||
send := func(d alert.Due, notify config.Notify) alert.Outcome {
|
||||
return alert.Outcome{DeliveryID: d.ID, Skipped: notify.Webhook == ""}
|
||||
}
|
||||
outcomes := settleDeliveries(due, notifyFor, send)
|
||||
for i, outcome := range outcomes {
|
||||
failed := due[i].Alert.Org == "acme"
|
||||
if outcome.Skipped || (outcome.Error != "") != failed {
|
||||
t.Fatalf("delivery %d: outcome %+v, want a retryable failure only for acme", outcome.DeliveryID, outcome)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package archied
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog"
|
||||
)
|
||||
|
||||
func TestModelAliasAlerts(t *testing.T) {
|
||||
catalog := modelcatalog.Snapshot{Providers: []modelcatalog.Provider{
|
||||
{ID: "openai", Models: []modelcatalog.Model{{ID: "gpt-5"}}},
|
||||
}}
|
||||
tests := []struct {
|
||||
name string
|
||||
aliases map[string]string
|
||||
want int
|
||||
}{
|
||||
{"offered chat model", map[string]string{"default": "openai/gpt-5"}, 0},
|
||||
{"retired chat model", map[string]string{"default": "openai/gpt-4"}, 1},
|
||||
// The catalogue lists tool-calling chat models only, so an embedding or
|
||||
// transcription model is never in it and must not read as retired.
|
||||
{"embedding model", map[string]string{"default": "openai/gpt-5", "embedding": "openai/text-embedding-3-small"}, 0},
|
||||
{"transcription model", map[string]string{"default": "openai/gpt-5", "transcription": "openai/whisper-1"}, 0},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := len(modelAliasAlerts(tt.aliases, catalog)); got != tt.want {
|
||||
t.Fatalf("alerts = %d, want %d", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/app/chattask"
|
||||
"github.com/samcharles93/archie-core/internal/app/controlplane"
|
||||
"github.com/samcharles93/archie-core/internal/app/servicekit"
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/container"
|
||||
@@ -32,9 +31,11 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/daemon"
|
||||
"github.com/samcharles93/archie-core/internal/domain/access"
|
||||
"github.com/samcharles93/archie-core/internal/domain/agent"
|
||||
"github.com/samcharles93/archie-core/internal/domain/alert"
|
||||
"github.com/samcharles93/archie-core/internal/domain/applystatus"
|
||||
"github.com/samcharles93/archie-core/internal/domain/health"
|
||||
"github.com/samcharles93/archie-core/internal/domain/identity"
|
||||
"github.com/samcharles93/archie-core/internal/domain/org"
|
||||
"github.com/samcharles93/archie-core/internal/domain/presence"
|
||||
"github.com/samcharles93/archie-core/internal/domain/scheduling"
|
||||
"github.com/samcharles93/archie-core/internal/domain/storecontract"
|
||||
@@ -46,6 +47,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/gateway"
|
||||
infraaccess "github.com/samcharles93/archie-core/internal/infrastructure/access"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/configuration"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/controlplanestore"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/eventbus/nats"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/extension"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/kitrun"
|
||||
@@ -66,9 +68,10 @@ import (
|
||||
// reverse at shutdown, matching the LIFO ordering of the deferred calls
|
||||
// they replace.
|
||||
type boot struct {
|
||||
catalog *modelcatalog.Catalog
|
||||
cfg config.Config
|
||||
log *slog.Logger
|
||||
catalog *modelcatalog.Catalog
|
||||
cfg config.Config
|
||||
log *slog.Logger
|
||||
playbooks *controlplanestore.LivePlaybooks
|
||||
|
||||
// stderrLog keeps setupLogging on stderr, never touching cfg.Log.File. An
|
||||
// offline command reads the bootstrap config but is not the daemon: creating
|
||||
@@ -95,8 +98,9 @@ type boot struct {
|
||||
// dialed to the standalone archie-state-store gRPC service at
|
||||
// [services.state].target. It is set by openStateStoreAdapter, which
|
||||
// requires [services.state].target to be set.
|
||||
stateStore storecontract.TaskStore
|
||||
taskModels daemon.TaskModels
|
||||
stateStore storecontract.TaskStore
|
||||
taskModels daemon.TaskModels
|
||||
taskInstructions daemon.TaskInstructions
|
||||
// accessChain is the daemon's policy engine, built once from the stored
|
||||
// policies (openAccessChain); accessProblems is what the readiness
|
||||
// surface reports. Both are nil when no policy store is wired.
|
||||
@@ -106,8 +110,7 @@ type boot struct {
|
||||
// (daemon.RunCredentialIssuer), wrapping the same *staterpc.Client as
|
||||
// stateStore, which also verifies a credential for a worktree push.
|
||||
stateStoreGrants *staterpc.GrantIssuer
|
||||
stateStoreToken string
|
||||
controlPlane *controlplane.Client
|
||||
controlPlane *controlplanestore.Client
|
||||
// controlPlaneRPC is the State Store's control-plane transport, kept so the
|
||||
// daemon root can build its workflow-definitions client from it
|
||||
// (openDaemonWorkflowDefinitions). The gateway root never builds that client:
|
||||
@@ -116,7 +119,7 @@ type boot struct {
|
||||
// workflowDefinitions is the one control-plane surface that resolves
|
||||
// workflow step types. It is separate from controlPlane because it is the
|
||||
// only surface that needs the process's step vocabulary.
|
||||
workflowDefinitions *controlplane.WorkflowDefinitionsClient
|
||||
workflowDefinitions *controlplanestore.WorkflowDefinitionsClient
|
||||
// executionSettings is the last workflow execution settings the control
|
||||
// plane published. They arrive on a watch rather than in the file
|
||||
// document, so reloadConfig re-applies them from here.
|
||||
@@ -180,10 +183,9 @@ type boot struct {
|
||||
// messaging delivers outbound chat messages through the Messaging Service.
|
||||
messaging *messagingrpc.Client
|
||||
|
||||
startGateways []func()
|
||||
trees *worktree.Manager
|
||||
identityRunners []*daemon.IdentityRunner
|
||||
d *daemon.Daemon
|
||||
startGateways []func()
|
||||
trees *worktree.Manager
|
||||
d *daemon.Daemon
|
||||
// schedulingEngine is the cron/scheduling ticker engine (setupScheduling).
|
||||
schedulingEngine *scheduling.Engine
|
||||
|
||||
@@ -201,6 +203,13 @@ type boot struct {
|
||||
// signal path rather than inventing a new one.
|
||||
shutdown context.CancelFunc
|
||||
|
||||
// alertChecks re-evaluates the configuration alerts when the configuration
|
||||
// changes. Nil until the daemon's run loop starts them.
|
||||
alertChecks *alertChecks
|
||||
// credentialWatch reports bound credentials that stop resolving. Nil
|
||||
// when the State Store has no alert surface.
|
||||
credentialWatch *credentialWatch
|
||||
|
||||
cleanups []func()
|
||||
}
|
||||
|
||||
@@ -214,7 +223,7 @@ func (b *boot) cleanup() {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *boot) loadConfig(_ context.Context, cfgPath, overlayPath string) error {
|
||||
func (b *boot) loadConfig(ctx context.Context, cfgPath, overlayPath string) error {
|
||||
loader, doc, err := servicekit.Resolve(b.log, cfgPath, overlayPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -224,20 +233,23 @@ func (b *boot) loadConfig(_ context.Context, cfgPath, overlayPath string) error
|
||||
b.cfg = b.doc.Config
|
||||
b.cfgHolder = config.NewHolder(b.cfg)
|
||||
b.currentProvenance.Store(&b.doc.Provenance)
|
||||
b.setupLogging()
|
||||
return nil
|
||||
return b.setupLogging(ctx)
|
||||
}
|
||||
|
||||
// setupLogging stays on stderr for an offline command (stderrLog): creating,
|
||||
// appending to or rotating the deployment's log is a side effect a diagnosis
|
||||
// must not have.
|
||||
func (b *boot) setupLogging() {
|
||||
func (b *boot) setupLogging(ctx context.Context) error {
|
||||
if b.stderrLog {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
logs, err := servicekit.Logging(ctx, b.cfg, "daemon")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logs := servicekit.Logging(b.cfg, "daemon")
|
||||
b.log, b.logFeed, b.taskLogs = logs.Log, logs.Feed, logs.TaskLogs
|
||||
b.addCleanup(func() { _ = logs.Closer.Close() })
|
||||
return nil
|
||||
}
|
||||
|
||||
// openStores wires the secret registry and the conversation store. The
|
||||
@@ -259,23 +271,44 @@ func (b *boot) openForge(ctx context.Context) {
|
||||
b.forgeClient, b.token = resolveForge(ctx, b.cfg.Forge, "default", b.secrets, b.forgeExt, b.log)
|
||||
}
|
||||
|
||||
// reopenForge re-resolves the instance's forge connection from the settings
|
||||
// the layering just published. Every holder of the client is replaced, so a
|
||||
// rotated credential, a changed host or a removed connection reaches the next
|
||||
// operation rather than dying with the process that booted. It runs from the
|
||||
// connections watch alone, after the config holder carries the change; the
|
||||
// worktree manager is shared by pointer, so its token is the only field to
|
||||
// replace.
|
||||
func (b *boot) reopenForge(ctx context.Context) {
|
||||
client, token := resolveForge(ctx, b.cfgHolder.Get().Forge, "default", b.secrets, b.forgeExt, b.log)
|
||||
b.forgeClient, b.token = client, token
|
||||
if b.trees != nil {
|
||||
b.trees.Token = token
|
||||
}
|
||||
if b.d != nil {
|
||||
b.d.Forge = client
|
||||
}
|
||||
}
|
||||
|
||||
func (b *boot) openStateStoreAdapter(ctx context.Context) error {
|
||||
target := strings.TrimSpace(b.cfg.Services.Get(config.ServiceNameState).Target)
|
||||
if target == "" {
|
||||
return fmt.Errorf("services.state.target is required: archied/archie-gateway no longer own archie.db; the standalone archie-state-store process owns it (docs/prds/state-store-contract.md §12 step 7)")
|
||||
}
|
||||
client, cleanup, err := servicekit.StateStoreClient(presence.Daemon, b.cfg.Services, b.secrets)
|
||||
client, cleanup, err := servicekit.StateStoreClient(presence.Daemon, b.cfg)
|
||||
if err != nil {
|
||||
b.log.Error("state store adapter", "err", err)
|
||||
b.log.ErrorContext(ctx, "state store adapter", "err", err)
|
||||
return err
|
||||
}
|
||||
b.stateStore = client
|
||||
if alerts, ok := b.stateStore.(alert.Store); ok {
|
||||
b.credentialWatch = &credentialWatch{reporter: alert.Reporter{Raiser: alerts, Log: b.log, By: "archied"}}
|
||||
}
|
||||
b.taskModels = client
|
||||
b.taskInstructions = client
|
||||
b.controlPlaneRPC = client.ControlPlane()
|
||||
b.controlPlane = controlplane.NewRPCClient(b.controlPlaneRPC)
|
||||
b.controlPlane = controlplanestore.NewRPCClient(b.controlPlaneRPC)
|
||||
b.applyStatus = applystatus.New(b.processName, client, b.log)
|
||||
b.stateStoreGrants = &staterpc.GrantIssuer{Client: client}
|
||||
b.stateStoreToken = b.cfg.Services.ResolvedToken(config.ServiceNameState, b.secrets.Getenv)
|
||||
b.addCleanup(cleanup)
|
||||
b.startSecretEngines(ctx, client)
|
||||
return nil
|
||||
@@ -292,16 +325,15 @@ func (b *boot) openStateStage(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (b *boot) openAccessChain(ctx context.Context) error {
|
||||
source, ok := b.stateStore.(access.PolicySource)
|
||||
source, ok := b.stateStore.(access.PolicyStore)
|
||||
if !ok {
|
||||
return nil
|
||||
return fmt.Errorf("state store policy reader unavailable")
|
||||
}
|
||||
live, err := infraaccess.NewLive(ctx, source.Policies, b.log)
|
||||
if err != nil {
|
||||
return fmt.Errorf("load stored policies: %w", err)
|
||||
live := infraaccess.NewPending(ctx, source.PoliciesVersion, source.ListPolicies, b.log)
|
||||
if err := live.Reload(ctx); err != nil {
|
||||
b.log.WarnContext(ctx, "workflow policies unavailable; execution remains denied", "err", err)
|
||||
}
|
||||
b.accessChain, b.accessLive = live, live
|
||||
go live.Run(ctx, applystatus.RestampInterval)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -312,10 +344,10 @@ func (b *boot) handleRequeue(ctx context.Context, requeue int64, once bool) (boo
|
||||
return false, nil
|
||||
}
|
||||
if err := manualRequeueTask(ctx, b.stateStore, requeue); err != nil {
|
||||
b.log.Error("requeue failed", "task", requeue, "err", err)
|
||||
b.log.ErrorContext(ctx, "requeue failed", "task", requeue, "err", err)
|
||||
return false, err
|
||||
}
|
||||
b.log.Info("task requeued", "task", requeue)
|
||||
b.log.InfoContext(ctx, "task requeued", "task", requeue)
|
||||
return !once, nil
|
||||
}
|
||||
|
||||
@@ -353,7 +385,7 @@ func (b *boot) connectNATS(ctx context.Context) error { // embedded broker disco
|
||||
var err error
|
||||
natsToken, err = servicekit.NATSToken(cfg.NATS, os.Getenv)
|
||||
if err != nil {
|
||||
log.Error("nats credentials", "err", err)
|
||||
log.ErrorContext(ctx, "nats credentials", "err", err)
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -385,7 +417,7 @@ func (b *boot) connectNATS(ctx context.Context) error { // embedded broker disco
|
||||
FilterSubject: workintake.SubjectTaskWildcard,
|
||||
}, log)
|
||||
if err != nil {
|
||||
log.Error("nats connect failed", "err", err)
|
||||
log.ErrorContext(ctx, "nats connect failed", "err", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -400,18 +432,24 @@ func (b *boot) connectNATS(ctx context.Context) error { // embedded broker disco
|
||||
MaxAge: &reactionMaxAge,
|
||||
}, log)
|
||||
if err != nil {
|
||||
log.Error("nats reaction stream connect failed", "err", err)
|
||||
log.ErrorContext(ctx, "nats reaction stream connect failed", "err", err)
|
||||
natsClient.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
if err := b.startSpanRelay(ctx, url, natsToken); err != nil {
|
||||
log.ErrorContext(ctx, "span relay failed", "err", err)
|
||||
natsClient.Close()
|
||||
reactionClient.Close()
|
||||
return err
|
||||
}
|
||||
b.natsClient = natsClient
|
||||
b.natsURL = url
|
||||
b.natsToken = natsToken
|
||||
b.addCleanup(func() { natsClient.Close() })
|
||||
b.addCleanup(func() { reactionClient.Close() })
|
||||
b.reactionClient = reactionClient
|
||||
log.Info("nats connected", "url", url, "task_stream", nats.DefaultStreamName, "reaction_stream", nats.DefaultReactionStreamName)
|
||||
log.InfoContext(ctx, "nats connected", "url", url, "task_stream", nats.DefaultStreamName, "reaction_stream", nats.DefaultReactionStreamName)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -438,16 +476,16 @@ func (b *boot) startEmbeddedNATS(ctx context.Context) (string, string, error) {
|
||||
}
|
||||
srv, err := nats.StartEmbedded(ctx, opts, log)
|
||||
if err != nil && opts.Port != 0 {
|
||||
log.Warn("embedded nats: previous port unavailable; taking a new one", "port", opts.Port, "err", err)
|
||||
log.WarnContext(ctx, "embedded nats: previous port unavailable; taking a new one", "port", opts.Port, "err", err)
|
||||
opts.Port = 0
|
||||
srv, err = nats.StartEmbedded(ctx, opts, log)
|
||||
}
|
||||
if err != nil {
|
||||
log.Error("embedded nats start failed", "err", err)
|
||||
log.ErrorContext(ctx, "embedded nats start failed", "err", err)
|
||||
return "", "", err
|
||||
}
|
||||
b.addCleanup(func() { srv.Shutdown() })
|
||||
log.Info("embedded nats started", "url", srv.ClientURL())
|
||||
log.InfoContext(ctx, "embedded nats started", "url", srv.ClientURL())
|
||||
if err := servicekit.WriteNATSEndpoint(cfg.StateDir, srv.ClientURL(), srv.Token()); err != nil {
|
||||
srv.Shutdown()
|
||||
return "", "", err
|
||||
@@ -466,19 +504,22 @@ func (b *boot) setupContainers(ctx context.Context) func() {
|
||||
// only enqueues the chat tasks scheduled workflows create.
|
||||
func (b *boot) setupGatewayClient(ctx context.Context) error {
|
||||
b.setupChatTasks(b.cfg)
|
||||
contract, cleanup, err := composeChatContract(b.cfg.Services, b.secrets)
|
||||
contract, cleanup, err := composeChatContract(b.cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b.addCleanup(cleanup)
|
||||
b.chat = &webui.ChatService{Contract: contract}
|
||||
messaging, closeMessaging, err := composeMessaging(b.cfg.Services, b.secrets)
|
||||
messaging, closeMessaging, err := composeMessaging(b.cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b.addCleanup(closeMessaging)
|
||||
b.messaging = messaging
|
||||
go postOutcomes(ctx, b.stateStore, messaging.Deliver, b.log)
|
||||
posted := func(taskID int64) {
|
||||
b.bus.Publish(ctx, events.Event{At: time.Now().UTC(), Kind: events.KindChatOutcome, TaskID: taskID})
|
||||
}
|
||||
go postOutcomes(ctx, b.stateStore, deliverOutcome(contract, messaging), posted, b.log)
|
||||
b.setupReadinessProbes()
|
||||
return nil
|
||||
}
|
||||
@@ -494,30 +535,6 @@ func (b *boot) buildWorktreeManager() {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *boot) buildTreesAndIdentities(ctx context.Context) error {
|
||||
cfg, log := b.cfg, b.log
|
||||
b.buildWorktreeManager()
|
||||
|
||||
for _, idCfg := range cfg.Identities {
|
||||
idForge, idToken := resolveForge(ctx, idCfg.Forge, idCfg.Name, b.secrets, b.forgeExt, log.With("identity", idCfg.Name))
|
||||
idTrees := &worktree.Manager{
|
||||
WorkDir: filepath.Join(cfg.WorkDir, "identity-"+idCfg.Name),
|
||||
Token: idToken,
|
||||
BotUser: idCfg.BotUser,
|
||||
BotEmail: idCfg.BotEmail,
|
||||
BaseURL: idCfg.Forge.Host,
|
||||
}
|
||||
runner, err := daemon.NewIdentityRunner(ctx, idCfg, idForge, idTrees, log)
|
||||
if err != nil {
|
||||
log.Error("identity construction failed", "identity", idCfg.Name, "err", err)
|
||||
return err
|
||||
}
|
||||
b.identityRunners = append(b.identityRunners, runner)
|
||||
log.Info("identity configured", "identity", idCfg.Name, "bot_user", idCfg.BotUser, "repos", len(idCfg.Repos))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *boot) registerNATSRPC() error {
|
||||
log := b.log
|
||||
if b.natsClient == nil {
|
||||
@@ -528,7 +545,17 @@ func (b *boot) registerNATSRPC() error {
|
||||
log.Error("nats connection unavailable for task RPC", "err", err)
|
||||
return err
|
||||
}
|
||||
unsubscribe, err := registerTaskRPCServers(coreConn, b.forgeClient, b.trees, b.identityRunners, b.stateStoreGrants.Client, installedAuthorities{b.stateStoreGrants.Client}, log)
|
||||
unsubscribe, err := registerTaskRPCServers(coreConn, func(ctx context.Context, t *workflow.Task, op string) (daemon.RepositoryAccess, error) {
|
||||
if b.d == nil {
|
||||
return daemon.RepositoryAccess{}, errors.New("repository connections starting")
|
||||
}
|
||||
return b.d.Repository(ctx, t, op)
|
||||
}, func(ctx context.Context, org, channel, chatID, text string) error {
|
||||
if b.messaging == nil {
|
||||
return errors.New("messaging service not configured")
|
||||
}
|
||||
return b.messaging.Deliver(ctx, org, channel, chatID, text)
|
||||
}, b.stateStoreGrants.Client, installedAuthorities{b.stateStoreGrants.Client}, log)
|
||||
if err != nil {
|
||||
log.Error("task RPC server registration failed", "err", err)
|
||||
return err
|
||||
@@ -566,9 +593,10 @@ func (b *boot) registerNATSRPC() error {
|
||||
func (b *boot) buildDaemon() {
|
||||
log := b.log
|
||||
b.d = &daemon.Daemon{
|
||||
ResolveRepository: b.repositoryAccess,
|
||||
Cfg: b.cfgHolder,
|
||||
ConnectedNATS: daemon.NATSEndpoint{URL: b.natsURL, Token: b.natsToken, Scoped: b.cfg.NATS.Mode != config.NATSModeExternal},
|
||||
ConnectedStateStore: daemon.StateStoreEndpoint{URL: strings.TrimSpace(b.cfg.Services.Get(config.ServiceNameState).Target), Token: b.stateStoreToken},
|
||||
ConnectedStateStore: daemon.StateStoreEndpoint{URL: strings.TrimSpace(b.cfg.Services.Get(config.ServiceNameState).Target), CA: b.stateStoreCA()},
|
||||
Store: b.stateStore,
|
||||
Bus: b.bus,
|
||||
Forge: b.forgeClient,
|
||||
@@ -583,7 +611,9 @@ func (b *boot) buildDaemon() {
|
||||
KitLauncher: b.kitLauncher,
|
||||
ModelEgress: b.modelEgress,
|
||||
TaskModels: b.taskModels,
|
||||
Identities: b.identityRunners,
|
||||
TaskInstructions: b.taskInstructions,
|
||||
IssueSources: b.issueSources,
|
||||
OrgPrincipals: b.orgPrincipals,
|
||||
RootIdentityID: identity.StableID(servicekit.IdentityNames(b.cfg)[0]),
|
||||
TaskLogs: b.taskLogs,
|
||||
AgentStatus: b.agentStatus,
|
||||
@@ -595,6 +625,9 @@ func (b *boot) buildDaemon() {
|
||||
if identities, ok := b.stateStore.(identity.Repository); ok {
|
||||
b.d.IdentityRepository = identities
|
||||
}
|
||||
if assignments, ok := b.stateStore.(org.AgentAssignments); ok {
|
||||
b.d.AgentAssignments = assignments
|
||||
}
|
||||
|
||||
if ms, ok := b.stateStore.(storecontract.MappingStore); ok {
|
||||
b.d.Mappings = ms
|
||||
@@ -618,13 +651,11 @@ func (b *boot) buildDaemon() {
|
||||
b.d.WithdrawTask = b.taskActions().Withdraw
|
||||
|
||||
b.d.Access = b.accessChain
|
||||
if b.accessChain != nil {
|
||||
if principals, ok := b.stateStore.(access.PrincipalSource); ok {
|
||||
b.d.Principals = principals
|
||||
}
|
||||
if denials, ok := b.stateStore.(access.DenialRecorder); ok {
|
||||
b.d.Denials = denials
|
||||
}
|
||||
if principals, ok := b.stateStore.(access.PrincipalSource); ok {
|
||||
b.d.Principals = principals
|
||||
}
|
||||
if denials, ok := b.stateStore.(access.DenialRecorder); ok {
|
||||
b.d.Denials = denials
|
||||
}
|
||||
b.d.PlaybookLedger = playbookLedger(b.stateStore, b.log)
|
||||
b.setupForgeWebhook()
|
||||
@@ -680,14 +711,16 @@ func (b *boot) publishConfig(ctx context.Context, cfg config.Config) {
|
||||
// The daemon owns the published configuration view.
|
||||
if b.processName != applystatus.Gateway {
|
||||
b.publishConfigSnapshot(ctx)
|
||||
b.recheckAlerts(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
func (b *boot) configViewInput() webui.ConfigViewInput {
|
||||
catalog := b.catalogState()
|
||||
in := webui.ConfigViewInput{
|
||||
Config: b.cfgHolder.Get(),
|
||||
Catalog: catalogView(catalog),
|
||||
Config: b.cfgHolder.Get(),
|
||||
Catalog: catalogView(catalog),
|
||||
SecretEngines: b.secrets.List(),
|
||||
}
|
||||
if b.lastReload != nil {
|
||||
status := b.lastReload()
|
||||
@@ -707,7 +740,7 @@ func (b *boot) publishConfigSnapshot(ctx context.Context) {
|
||||
|
||||
document, err := json.Marshal(webui.BuildConfigView(b.configViewInput()))
|
||||
if err != nil {
|
||||
b.log.Warn("config snapshot not published", "err", err)
|
||||
b.log.WarnContext(ctx, "config snapshot not published", "err", err)
|
||||
return
|
||||
}
|
||||
err = snapshots.PutConfigSnapshot(ctx, storecontract.ConfigSnapshot{
|
||||
@@ -716,7 +749,7 @@ func (b *boot) publishConfigSnapshot(ctx context.Context) {
|
||||
PublishedAt: time.Now().UTC(),
|
||||
})
|
||||
if err != nil {
|
||||
b.log.Warn("config snapshot not published", "err", err)
|
||||
b.log.WarnContext(ctx, "config snapshot not published", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,12 +770,12 @@ func (b *boot) wireConfigPublishing(ctx context.Context, cfgPath, overlayPath st
|
||||
func (b *boot) startServices(ctx context.Context) error {
|
||||
log := b.log
|
||||
if err := b.d.Startup(ctx); err != nil {
|
||||
log.Error("startup", "err", err)
|
||||
log.ErrorContext(ctx, "startup", "err", err)
|
||||
return err
|
||||
}
|
||||
if b.schedulingEngine != nil {
|
||||
if err := b.schedulingEngine.Start(ctx); err != nil {
|
||||
log.Error("scheduling engine startup", "err", err)
|
||||
log.ErrorContext(ctx, "scheduling engine startup", "err", err)
|
||||
}
|
||||
}
|
||||
for _, startGateway := range b.startGateways {
|
||||
@@ -775,18 +808,15 @@ func (b *boot) runLoop(ctx context.Context, once bool) error {
|
||||
b.health.markServing()
|
||||
b.announceReady()
|
||||
if once {
|
||||
b.d.Cycle(ctx)
|
||||
// A drain pass no longer waits for the tasks it submitted, so a
|
||||
// single-cycle invocation waits for them here: exiting while their
|
||||
// containers still run would kill work this pass accepted.
|
||||
b.d.WaitForTasks()
|
||||
b.d.RunOnce(ctx)
|
||||
return nil
|
||||
}
|
||||
b.log.Info("archied running", "repos", len(b.cfg.Repos), "poll", b.cfg.PollInterval.Std().String(), "label", b.cfg.Label)
|
||||
b.log.InfoContext(ctx, "archied running", "repos", len(b.cfg.Repos), "poll", b.cfg.PollInterval.Std().String(), "label", b.cfg.Label)
|
||||
b.startDrainMonitor(ctx)
|
||||
b.startWatchdog(ctx)
|
||||
b.startAlerts(ctx)
|
||||
if err := b.d.Run(ctx); err != nil && ctx.Err() == nil {
|
||||
b.log.Error("daemon exited", "err", err)
|
||||
b.log.ErrorContext(ctx, "daemon exited", "err", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -815,13 +845,13 @@ func (b *boot) catalogState() modelcatalog.Snapshot { return b.catalog.State() }
|
||||
func (b *boot) loadCatalog(ctx context.Context) {
|
||||
snapshot, err := b.catalog.Fetch(ctx, b.secrets.Getenv, b.cfgHolder.Get().Providers)
|
||||
if err != nil {
|
||||
b.log.Warn("model catalog unavailable; using configured providers and models", "err", err)
|
||||
b.log.WarnContext(ctx, "model catalog unavailable; using configured providers and models", "err", err)
|
||||
return
|
||||
}
|
||||
models := modelcatalog.Apply(&b.cfg, snapshot)
|
||||
b.cfgHolder.Set(b.cfg.Clone())
|
||||
b.catalog.Set(snapshot)
|
||||
b.log.Info("model catalog loaded", "providers", len(snapshot.Providers), "models", len(models))
|
||||
b.log.InfoContext(ctx, "model catalog loaded", "providers", len(snapshot.Providers), "models", len(models))
|
||||
}
|
||||
|
||||
func (b *boot) refreshModelCatalog(ctx context.Context) error {
|
||||
@@ -837,20 +867,35 @@ func (b *boot) refreshModelCatalog(ctx context.Context) error {
|
||||
}
|
||||
b.catalog.Set(snapshot)
|
||||
b.publishConfig(ctx, cfg)
|
||||
b.log.Info("model catalog refreshed", "providers", len(snapshot.Providers), "models", len(models))
|
||||
b.log.InfoContext(ctx, "model catalog refreshed", "providers", len(snapshot.Providers), "models", len(models))
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *boot) startModelCatalogRefresh(ctx context.Context) {
|
||||
modelcatalog.Every(ctx, modelcatalog.RefreshInterval, func() {
|
||||
if err := b.refreshModelCatalog(ctx); err != nil {
|
||||
b.log.Warn("model catalog refresh failed; keeping the loaded catalog", "err", err)
|
||||
b.log.WarnContext(ctx, "model catalog refresh failed; keeping the loaded catalog", "err", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (b *boot) livePlaybooks() *controlplane.LivePlaybooks {
|
||||
live := controlplane.NewLivePlaybooks(b.controlPlaneRPC, b.log)
|
||||
live.ApplyStatus = b.applyStatus
|
||||
return live
|
||||
func (b *boot) livePlaybooks() *controlplanestore.LivePlaybooks {
|
||||
b.playbooks = controlplanestore.NewLivePlaybooks(b.controlPlaneRPC, b.log)
|
||||
b.playbooks.ApplyStatus = b.applyStatus
|
||||
return b.playbooks
|
||||
}
|
||||
|
||||
// playbookRefreshInterval is how often archied re-reads the resources it
|
||||
// would otherwise load only on first use, so their apply status stays reported.
|
||||
const playbookRefreshInterval = 30 * time.Second
|
||||
|
||||
// stateStoreCA is the CA a task container verifies the State Store with;
|
||||
// nil without [tls].
|
||||
func (b *boot) stateStoreCA() []byte {
|
||||
id, err := servicekit.Identity(b.cfg.TLS, presence.Daemon)
|
||||
if err != nil {
|
||||
b.log.Warn("state store CA for containers", "err", err)
|
||||
return nil
|
||||
}
|
||||
return id.CAPEM()
|
||||
}
|
||||
@@ -3,39 +3,37 @@ package archied
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/app/servicekit"
|
||||
"github.com/samcharles93/archie-core/internal/config"
|
||||
"github.com/samcharles93/archie-core/internal/gateway"
|
||||
"github.com/samcharles93/archie-core/internal/domain/presence"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/gatewayrpc"
|
||||
"github.com/samcharles93/archie-core/internal/infrastructure/messagingrpc"
|
||||
"github.com/samcharles93/archie-core/internal/secret"
|
||||
)
|
||||
|
||||
// composeChatContract dials the standalone archie-gateway, the sole owner of
|
||||
// ChatContract, from the daemon's own configuration key. Token resolution is
|
||||
// the daemon's (it owns the config keys and the secret registry); the dial
|
||||
// itself and the fail-closed non-loopback rule belong to the transport, so
|
||||
// they come from gatewayrpc.Dial.
|
||||
func composeChatContract(services config.Services, secrets *secret.Registry, options ...grpc.DialOption) (gateway.ChatContract, func(), error) {
|
||||
target, err := services.RequireTarget(config.ServiceNameGateway)
|
||||
// ChatContract, from the daemon's own configuration key.
|
||||
func composeChatContract(cfg config.Config, options ...grpc.DialOption) (*gatewayrpc.Client, func(), error) {
|
||||
target, err := cfg.Services.RequireTarget(config.ServiceNameGateway)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
// Assigned through a typed variable rather than returned directly: a
|
||||
// direct forward would hand a failed dial's nil *Client back as a
|
||||
// non-nil ChatContract interface.
|
||||
client, cleanup, err := gatewayrpc.Dial(target, services.ResolvedToken(config.ServiceNameGateway, secrets.Getenv), options...)
|
||||
id, err := servicekit.Identity(cfg.TLS, presence.Daemon)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return client, cleanup, nil
|
||||
return gatewayrpc.Dial(target, id, options...)
|
||||
}
|
||||
|
||||
// composeMessaging builds the Messaging Service client. The connection is
|
||||
// lazy, so an absent Messaging Service fails each delivery, not the daemon.
|
||||
func composeMessaging(services config.Services, secrets *secret.Registry) (*messagingrpc.Client, func(), error) {
|
||||
target, err := services.RequireTarget(config.ServiceNameMessaging)
|
||||
func composeMessaging(cfg config.Config) (*messagingrpc.Client, func(), error) {
|
||||
target, err := cfg.Services.RequireTarget(config.ServiceNameMessaging)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return messagingrpc.Dial(target, services.ResolvedToken(config.ServiceNameMessaging, secrets.Getenv))
|
||||
id, err := servicekit.Identity(cfg.TLS, presence.Daemon)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return messagingrpc.Dial(target, id)
|
||||
}
|
||||
Loaded 100 of 1521 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user