1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142 | ;; Four SEPARATE builds — one per process entry — so the two native WebRTC
;; stacks can never meet in one module graph (the two-stack law, house rule 11).
;; ONE compile, but the outputs land in TWO npm roots, because node resolves a
;; bare import from the importing FILE's directory upward (deps.edn's classpath
;; law); scripts/build.mjs is what puts each one on the right side:
;; :main → stack-a/dist/main.js peer-kit's clients + social agent
;; :train → stack-a/dist/rl/train.js peer-kit's GYMS — pure simulation,
;; and it imports no transport at all
;; :link → stack-a/dist/fleet/link.js peer-kit identity + friend link
;; :worker → stack-b/dist/worker.js rooms-kit's clients and log stack —
;; never an ardegazu.peer.* namespace
;; NOTHING here imports one of our kits as an npm dist any more: id, social,
;; wallet, train, peer AND rooms all compile from their ClojureScript sources
;; off one classpath, so each build carries exactly one copy of each. What the
;; bundles do name is the FOREIGN transport family, by bare name — and which
;; generation that resolves to is decided by which stack root the bundle sits
;; in, which is the whole point of the two roots.
;; Two things stay out of the live arms by construction, both behind dynamic
;; imports nothing else reaches: train-kit's @tensorflow/tfjs-node (only :train)
;; and peer-kit's @libp2p/webrtc (only the arms that actually open a room).
;; Foreign npm deps stay external ESM imports (:js-provider :import) — the
;; network kits' libdatachannel natives and tfjs-node must never be bundled.
;; scripts/build.mjs assembles the four outputs into the two stacks' dist/ and
;; normalizes gensyms for the deterministic committed dists
;; (deploy/check-dist.sh).
;;
;; :exports on :main are the pure-function surface the black-box test suite
;; exercises against the committed dist (test/*.test.mjs + test/vectors/).
{:deps {:aliases [:dev]}
:builds
{:main
{:target :esm
:output-dir "target/esm-main"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var AND promesa's quoted
;; getBasis meta symbols (name + baked-in hash + constant
;; -pool index) — under parallel compilation the counter
;; interleaves nondeterministically, and THAT class of
;; delta cannot be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn/proto vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:main {:entries [bot.main]
:init-fn bot.main/init
:exports {loadConfig bot.config/load-config
shouldReap bot.main/should-reap
roomKey bot.rooms/room-key
appOfHost bot.rooms/app-of-host
backoffDelay bot.rooms/backoff-delay
workerPath bot.rooms/worker-path
joinWorkerRoom bot.rooms/join-worker-room
attachBehavior bot.behaviors/attach-behavior
initPolicies bot.policies.registry/init-policies
brains bot.policies.registry/brains
brainsOf bot.policies.registry/brains-of
encodeSeanceState bot.rl.seance-policy/encode-seance-state
seanceQs bot.rl.seance-policy/seance-qs
seanceAction bot.rl.seance-policy/seance-action
makeSeanceRecorder bot.rl.seance-policy/make-recorder
neonFeatures bot.rl.neongrid-policy/neon-features
neonQs bot.rl.neongrid-policy/neon-qs
makeNeonGridRecorder bot.rl.neongrid-policy/make-recorder
vbFeatures bot.rl.valleyblocks-policy/vb-features
vbQs bot.rl.valleyblocks-policy/vb-qs
vbFallback bot.rl.valleyblocks-policy/fallback-action
makeValleyBlocksRecorder bot.rl.valleyblocks-policy/make-recorder}}}}
:worker
{:target :esm
:output-dir "target/esm-worker"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var AND promesa's quoted
;; getBasis meta symbols (name + baked-in hash + constant
;; -pool index) — under parallel compilation the counter
;; interleaves nondeterministically, and THAT class of
;; delta cannot be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn/proto vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:worker {:entries [bot.worker]
:init-fn bot.worker/init
;; the banker's and the trader's pure decision surfaces, for the
;; black-box suite (test/banca-plan.test.mjs and
;; test/bursa-plan.test.mjs drive the committed dist) — plus the
;; bursa RL core (test/bursa-rl.test.mjs): the :train build has
;; no :exports, so the gym/live-shared pure surface is vectored
;; here, off the SAME compiled namespace both graphs load
:exports {planActions bot.banca/plan-actions
friendsOfSocial bot.banca/friends-of-social
bursaPlanActions bot.bursa/plan-actions
bursaBanksToOpen bot.bursa/banks-to-open
bursaActKey bot.bursa/act-key
bursaDedupActs bot.bursa/dedup-acts
bursaPxOff bot.rl.bursa-policy/px-off
bursaCandidates bot.rl.bursa-policy/mk-candidates
bursaStats bot.rl.bursa-policy/mk-stats
bursaView bot.rl.bursa-policy/mk-view
bursaFeatures bot.rl.bursa-policy/bursa-features
bursaDecide bot.rl.bursa-policy/decide
bursaGate bot.rl.bursa-policy/gate-verdict}}}}
:train
{:target :esm
:output-dir "target/esm-train"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var AND promesa's quoted
;; getBasis meta symbols (name + baked-in hash + constant
;; -pool index) — under parallel compilation the counter
;; interleaves nondeterministically, and THAT class of
;; delta cannot be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn/proto vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:train {:entries [bot.rl.train]
:init-fn bot.rl.train/init}}}
:link
{:target :esm
:output-dir "target/esm-link"
:compiler-options {:optimizations :simple
:source-map false
;; serial compile: the JVM-global gensym counter numbers
;; every reify/deftype hoisted var AND promesa's quoted
;; getBasis meta symbols (name + baked-in hash + constant
;; -pool index) — under parallel compilation the counter
;; interleaves nondeterministically, and THAT class of
;; delta cannot be text-normalized after the fact the way
;; scripts/normalize-gensyms.mjs renumbers dyn/proto vars
:parallel-build false}
:js-options {:js-provider :import}
:modules
{:link {:entries [bot.fleet.link]
:init-fn bot.fleet.link/init}}}}}
|