Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- SPFsmartGATE/LIVE/BRAIN/DOCS/007ff6fb0df04103.txt +11 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/008622810f9d72c0.txt +2 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/009fa28418eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/00af205718eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/01dc53ef9b837615.txt +12 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0265bc1a18eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/02e08bd318eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/02eef05518eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0331ab1a18eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/034bd4f118eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/03d8d8e7809f8a94.txt +9 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/04166fb8b921cc0e.txt +6 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0457027318eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/056b005d1513cce0.txt +22 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0581ec33ee6fcfd4.txt +6 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/06b31fe9f5b3aa98.txt +9 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0717a2ee750e7cef.txt +10 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/083dfa3dfe01f79f.txt +5 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0a38da86727183f3.txt +5 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0a46534d18eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0a5f8cc218eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0a7dcfd118eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0ab3d58ee3e9a05e.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0ad7f29418eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0b60f4bb18eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0cec091318eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0d6b42d8f3e91b29.txt +16 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/0e458fa3fe6ccccb.txt +2 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/11c43c6118eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/121c379d18eecbfb.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/1253fe12b115e0ca.txt +8 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/128a750040ee6b02.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/129f3961260d6a1f.txt +4 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/12be07c913c60df8.txt +13 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/12c6923340ee6b02.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/12d8ef5a66b94553.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/12fa5bcb66b94553.txt +1 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/14954d750b44d27c.txt +9 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/154caa6a4a34d1d6.txt +11 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/15f067c787caa82f.txt +8 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/16aa7b54961cf8cd.txt +17 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/17400c8a71af6744.txt +9 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/188788fffb723fe9.txt +15 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/19020b938a6e787d.txt +12 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/192fffaf56bfdec8.txt +8 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/1a9a014cf0adfde9.txt +10 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/1ad9ae77aa187c2d.txt +10 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/1c9ec5aee433c2a9.txt +13 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/1d4b83edf5433d0e.txt +10 -0
- SPFsmartGATE/LIVE/BRAIN/DOCS/1d63535dcc18bbf6.txt +9 -0
SPFsmartGATE/LIVE/BRAIN/DOCS/007ff6fb0df04103.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
748 let tls_config = axum_server::tls_rustls::RustlsConfig::from_pem(cert_pem, key_pem)
|
| 2 |
+
749 .await
|
| 3 |
+
750 .expect("[SPF-HTTP] Failed to load TLS config from PEM");
|
| 4 |
+
751
|
| 5 |
+
752 let sock_addr: std::net::SocketAddr = addr.parse()
|
| 6 |
+
753 .expect("[SPF-HTTP] Invalid bind address");
|
| 7 |
+
754
|
| 8 |
+
755 // Graceful shutdown handle (E6)
|
| 9 |
+
756 let handle = axum_server::Handle::new();
|
| 10 |
+
757 let shutdown_handle = handle.clone();
|
| 11 |
+
758 tokio::spawn(async move {
|
SPFsmartGATE/LIVE/BRAIN/DOCS/008622810f9d72c0.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1615 `)H8(q.L),H8(q.L),h4(q.L);if(I8(q.L)==="|"){let H=q.L.b;if(H8(q.L),_.push(R8(q,"|",H,q.L.b,[])),I8(q.L)==="\\"&&I8(q.L,1)===`
|
| 2 |
+
1616 `)H8(q.L),H8(q.L)}else break}if(I8(q.L)===")"){let w=q.L.b;H8(q.L),_.push(R8(q,")",w,q.L.b,[]))}let z=Gv(q,null);_.push(...z);let A=Sz(q.L),O=N9(q.L,"cmd");if(O.type==="OP"&&(O.value===";;"||O.value===";&"||O.value===";;&"))_.push(B5(q,O.value,O));else p5(q.L,A);if(_.length===0)return null;if(z.length===0)for(let w=0;w<_.length;w++){let j=_[w];if(j.type==="extglob_pattern"&&/^[-+?*@!][a-zA-Z]/.test(N76(q,j.startIndex,j.endIndex))&&!/[*?(]/.test(N76(q,j.startIndex,j.endIndex)))_[w]=R8(q,"word",j.startIndex,j.endIndex,[])}let $=_[_.length-1];return R8(q,"case_item",K,$.endIndex,_)}function h4Y(q){h4(q.L);let K=Sz(q.L),_=q.L.b,Y=q.L.i,z=0,A=!1,O=!1,$=!1;while(q.L.i<q.L.len){let J=I8(q.L);if(J==="\\"&&q.L.i+1<q.L.len){H8(q.L),H8(q.L);continue}if(J==='"'||J==="'"){$=!0,H8(q.L);while(q.L.i<q.L.len&&I8(q.L)!==J){if(I8(q.L)==="\\"&&q.L.i+1<q.L.len)H8(q.L);H8(q.L)}if(I8(q.L)===J)H8(q.L);continue}if(J==="("){z++,H8(q.L);continue}if(z>0){if(J===")"){z--,H8(q.L);continue}if(J===`
|
SPFsmartGATE/LIVE/BRAIN/DOCS/009fa28418eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/00af205718eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/01dc53ef9b837615.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
250 "external_memory_brain": "10%",
|
| 2 |
+
251 "user_instructions": "10%",
|
| 3 |
+
252 "discussion": "10%",
|
| 4 |
+
253 "safety_buffer": "5%"
|
| 5 |
+
254 }
|
| 6 |
+
255 },
|
| 7 |
+
256
|
| 8 |
+
257 "memory_triad": {
|
| 9 |
+
258 "description": "Three redundant memory systems — if any one fails, other two recover",
|
| 10 |
+
259 "system_1_brain": {
|
| 11 |
+
260 "type": "Semantic memory (Brain/RAG)",
|
| 12 |
+
261 "stores": "Chunked project knowledge indexed by meaning",
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0265bc1a18eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/02e08bd318eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/02eef05518eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0331ab1a18eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/034bd4f118eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/03d8d8e7809f8a94.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
decouples the underlying training-inference engine from the agent, supporting the integration of arbitrary agents and
|
| 2 |
+
enabling us to optimize the model's generalization across agent scaffolds and tools. To improve system throughput, we
|
| 3 |
+
optimized asynchronous scheduling strategies to balance system throughput against sample off-policyness, and designed a
|
| 4 |
+
tree-structured merging strategy for training samples, achieving approximately 40x training speedup.
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
### [ ][65] Agentic RL Algorithm and Reward Design
|
| 8 |
+
|
| 9 |
+
On the algorithm side, we continued using the CISPO algorithm we proposed at the beginning of last year to ensure the
|
SPFsmartGATE/LIVE/BRAIN/DOCS/04166fb8b921cc0e.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
nature of autistic intelligence II: What about Asperger Syndrome?"][193]. PLOS ONE. 6 (9): 657–62.
|
| 2 |
+
[Bibcode][194]:[2011PLoSO...625372S][195]. [doi][196]:[10.1371/journal.pone.0025372][197]. [PMC][198]
|
| 3 |
+
[3182210][199]. [PMID][200] [21991394][201].
|
| 4 |
+
15. [^][202] ["Qualifying Scores"][203]. International Society for Philosophical Enquiry. Archived from [the
|
| 5 |
+
original][204] on 2012-07-23. Retrieved 2012-08-06.
|
| 6 |
+
16. [^][205] ["The International High IQ Society - Sign-up"][206]. www.ihiqs.org. Retrieved 21 January 2019.
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0457027318eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/056b005d1513cce0.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fine, unless the canvas is [tainted][190] - in this case rendering will rather not succeed.
|
| 2 |
+
* Rendering will failed on huge DOM due to the dataURI [limit varies][191].
|
| 3 |
+
|
| 4 |
+
## Contributing
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
[][192]
|
| 8 |
+
|
| 9 |
+
Please let us know how can we help. Do check out [issues][193] for bug reports or suggestions first.
|
| 10 |
+
|
| 11 |
+
To become a contributor, please follow our [contributing guide][194].
|
| 12 |
+
|
| 13 |
+
[ [Contributors] ][195]
|
| 14 |
+
|
| 15 |
+
## License
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
[][196]
|
| 19 |
+
|
| 20 |
+
The scripts and documentation in this project are released under the [MIT License][197]
|
| 21 |
+
|
| 22 |
+
## About
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0581ec33ee6fcfd4.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
191 16 TR-E ⬜ Build Anchor from brain (extends TR-B) Workflow change + intercept
|
| 2 |
+
192 17 TR-C ⬜ Session file cache (prevent re-reads) New logic in compress_result
|
| 3 |
+
193 18 CLONE ⬜ Test clone SPF + mesh network After next build
|
| 4 |
+
194 19 MB-FC ⬜ FLINT User CLI Separate binary, local socket
|
| 5 |
+
195 20 MB-FA ⬜ Agent Read Interface Block brain WRITE from Stdio
|
| 6 |
+
196 21 MB-FM ⬜ FLINT owns STATUS + WORK_BLOCKS Auto-update on phase change
|
SPFsmartGATE/LIVE/BRAIN/DOCS/06b31fe9f5b3aa98.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
TEST 13: LR scheduler — LR increases during warmup, stays ≤ peak_lr after warmup.
|
| 2 |
+
|
| 3 |
+
TEST 14: Pipeline batch lifecycle — submit_batch → next_task×3 → record_result×3 → is_stream_complete==true, total_completed==3.
|
| 4 |
+
|
| 5 |
+
TEST 15: Worker init from config — init_transformer returns state with correct role, WorkerState.status_json() has mode=="worker".
|
| 6 |
+
|
| 7 |
+
TEST 16: Chat multi-turn context — 5 messages, context contains recent text, get_history(n=2) returns last 2.
|
| 8 |
+
|
| 9 |
+
--- /data/data/com.termux/files/home/SPFsmartGATE/LIVE/BRAIN/DOCS/39c9c324c272a12a.txt (score: 0.31) ---
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0717a2ee750e7cef.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
3969 }
|
| 2 |
+
3970 #[cfg(not(feature = "voice-stt"))]
|
| 3 |
+
3971 json!({"type": "text", "text": "stream_on requires voice-stt feature."})
|
| 4 |
+
3972 }
|
| 5 |
+
3973 "stream_off" => {
|
| 6 |
+
3974 crate::voice::stream_off();
|
| 7 |
+
3975 json!({"type": "text", "text": "Streaming STT stopped."})
|
| 8 |
+
3976 }
|
| 9 |
+
3977 "stream_read" => {
|
| 10 |
+
3978 let active = crate::voice::STREAM_ACTIVE.load(std::sync::atomic::Ordering::SeqCst);
|
SPFsmartGATE/LIVE/BRAIN/DOCS/083dfa3dfe01f79f.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/data/data/com.termux/files/home/SPFsmartGATE/src/src/inspect.rs: fn no_false_positive_evaluate_word() {
|
| 2 |
+
/data/data/com.termux/files/home/SPFsmartGATE/src/src/inspect.rs- let config = default_config();
|
| 3 |
+
/data/data/com.termux/files/home/SPFsmartGATE/src/src/inspect.rs- // "evaluate" mid-sentence in documentation — must NOT flag
|
| 4 |
+
/data/data/com.termux/files/home/SPFsmartGATE/src/src/inspect.rs- let content = "We evaluate the result and check if the system is working correctly.";
|
| 5 |
+
/data/data/com.termux/files/home/SPFsmartGATE/src/src/inspect.rs- let result = inspect_content(content, "STATUS.txt", &config);
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0a38da86727183f3.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
749 if let Ok(json) = serde_json::from_str::<serde_json::Value>(text) {
|
| 2 |
+
750 let content = json.get("result")
|
| 3 |
+
751 .and_then(|r| r.get("content"))
|
| 4 |
+
752 .and_then(|c| c.get(0))
|
| 5 |
+
753 .and_then(|t| t.get("text"))
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0a46534d18eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0a5f8cc218eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0a7dcfd118eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0ab3d58ee3e9a05e.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Edit source=stdio allowed=true label=1.0 weight=1.0 evil=0.00 relevance=0.80 fp=false override=false | context=[Edit,Edit,Edit] | ts=2026-03-20T10:03:58.965607465+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0ad7f29418eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0b60f4bb18eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0cec091318eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0d6b42d8f3e91b29.txt
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"total_pending": total_pending,
|
| 2 |
+
"total_running": total_running,
|
| 3 |
+
"total_submitted": self.total_submitted,
|
| 4 |
+
"total_completed": self.total_completed,
|
| 5 |
+
--
|
| 6 |
+
"requests_processed": s.requests_processed,
|
| 7 |
+
"uptime_secs": s.created_at.elapsed().as_secs(),
|
| 8 |
+
})
|
| 9 |
+
}).collect::<Vec<_>>(),
|
| 10 |
+
})
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
// === API SESSION MANAGEMENT ===
|
| 14 |
+
|
| 15 |
+
/// Open a new API session
|
| 16 |
+
pub fn open_session(&mut self, session_id: &str, peer_key: &str) {
|
SPFsmartGATE/LIVE/BRAIN/DOCS/0e458fa3fe6ccccb.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1719 `):z;return{hints:Y,stripped:A}}function E3Y(q){let K={};for(let _ of q.matchAll(y3Y))K[_[1]]=_[2]??_[3]??"";return K}function L3Y(q){let K=q.trim(),_=K.search(/\s/);return _===-1?K:K.slice(0,_)}function vNq(q){if(Ju1)return;uN8=q,TNq()}function VNq(){if(uN8!==null)uN8=null,TNq()}function NNq(){Ju1=!0}function Xu1(){return uN8}function yNq(){return Ju1}var V3Y,N3Y,k3Y,y3Y,uN8=null,Ju1=!1,fNq,TNq,kNq;var _r6=y(()=>{Y8();V3Y=new Set([1]),N3Y=new Set(["plugin"]),k3Y=/^[ \t]*<claude-code-hint\s+([^>]*?)\s*\/>[ \t]*$/gm,y3Y=/(\w+)=(?:"([^"]*)"|([^\s/>]+))/g;fNq=aW(),TNq=fNq.emit;kNq=fNq.subscribe});function ENq(q){let K=q.trim(),_=K.split(/\s+/)[0]?.toLowerCase();if(!_)return;if(_==="npx"||_==="bunx"){let Y=K.split(/\s+/)[1]?.toLowerCase();if(Y&&Y in Mu1)return Mu1[Y]}return Mu1[_]}function LNq(q){for(let{pattern:K,tool:_}of R3Y)if(K.test(q))return _;return}var Mu1,R3Y;var Du1=y(()=>{Mu1={src:"sourcegraph",cody:"cody",aider:"aider",tabby:"tabby",tabnine:"tabnine",augment:"augment",pieces:"pieces",qodo:"qodo",aide:"aide",hound:"hound",seagoat:"seagoat",bloop:"bloop",gitloop:"gitloop",q:"amazon-q",gemini:"gemini"},R3Y=[{pattern:/^sourcegraph$/i,tool:"sourcegraph"},{pattern:/^cody$/i,tool:"cody"},{pattern:/^openctx$/i,tool:"openctx"},{pattern:/^aider$/i,tool:"aider"},{pattern:/^continue$/i,tool:"continue"},{pattern:/^github[-_]?copilot$/i,tool:"github-copilot"},{pattern:/^copilot$/i,tool:"github-copilot"},{pattern:/^cursor$/i,tool:"cursor"},{pattern:/^tabby$/i,tool:"tabby"},{pattern:/^codeium$/i,tool:"codeium"},{pattern:/^tabnine$/i,tool:"tabnine"},{pattern:/^augment[-_]?code$/i,tool:"augment"},{pattern:/^augment$/i,tool:"augment"},{pattern:/^windsurf$/i,tool:"windsurf"},{pattern:/^aide$/i,tool:"aide"},{pattern:/^codestory$/i,tool:"aide"},{pattern:/^pieces$/i,tool:"pieces"},{pattern:/^qodo$/i,tool:"qodo"},{pattern:/^amazon[-_]?q$/i,tool:"amazon-q"},{pattern:/^gemini[-_]?code[-_]?assist$/i,tool:"gemini"},{pattern:/^gemini$/i,tool:"gemini"},{pattern:/^hound$/i,tool:"hound"},{pattern:/^seagoat$/i,tool:"seagoat"},{pattern:/^bloop$/i,tool:"bloop"},{pattern:/^gitloop$/i,tool:"gitloop"},{pattern:/^claude[-_]?context$/i,tool:"claude-context"},{pattern:/^code[-_]?index[-_]?mcp$/i,tool:"code-index-mcp"},{pattern:/^code[-_]?index$/i,tool:"code-index-mcp"},{pattern:/^local[-_]?code[-_]?search$/i,tool:"local-code-search"},{pattern:/^codebase$/i,tool:"autodev-codebase"},{pattern:/^autodev[-_]?codebase$/i,tool:"autodev-codebase"},{pattern:/^code[-_]?context$/i,tool:"claude-context"}]});import{createHash as h3Y}from"crypto";import{chmod as hNq,copyFile as Yr6,link as S3Y,mkdir as Wu1,readFile as Pu1,stat as zr6,unlink as C3Y}from"fs/promises";import{dirname as SNq,isAbsolute as CNq,join as mN8,relative as b3Y}from"path";import{inspect as I3Y}from"util";function F2(){if(d7())return x3Y();return j8().fileCheckpointingEnabled!==!1&&!n6(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING)}function x3Y(){return n6(process.env.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING)&&!n6(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING)}async function B76(q,K,_){if(!F2())return;let Y=xNq(K),z;if(q((w)=>{return z=w,w}),!z)return;let A=z.snapshots.at(-1);if(!A){H6(Error("FileHistory: Missing most recent snapshot")),d("tengu_file_history_track_edit_failed",{});return}if(A.trackedFileBackups[Y])return;let O;try{O=await INq(K,1)}catch(w){H6(w),d("tengu_file_history_track_edit_failed",{});return}let $=O.backupFileName===null;q((w)=>{try{let j=w.snapshots.at(-1);if(!j||j.trackedFileBackups[Y])return w;let H=w.trackedFiles.has(Y)?w.trackedFiles:new Set(w.trackedFiles).add(Y),J=$36(j);J.trackedFileBackups[Y]=O;let X={...w,snapshots:(()=>{let M=w.snapshots.slice();return M[M.length-1]=J,M})(),trackedFiles:H};return uNq(X),$r6(_,J,!0).catch((M)=>{H6(Error(`FileHistory: Failed to record snapshot: ${M}`))}),d("tengu_file_history_track_edit_success",{isNewFile:$,version:O.version}),k(`FileHistory: Tracked file modification for ${K}`),X}catch(j){return H6(j),d("tengu_file_history_track_edit_failed",{}),w}})}async function EV6(q,K){if(!F2())return;let _;if(q((A)=>{return _=A,A}),!_)return;let Y={},z=_.snapshots.at(-1);if(z)k(`FileHistory: Making snapshot for message ${K}`),await Promise.all(Array.from(_.trackedFiles,async(A)=>{try{let O=Or6(A),$=z.trackedFileBackups[A],w=$?$.version+1:1,j;try{j=await zr6(O)}catch(H){if(!G7(H))throw H}if(!j){Y[A]={backupFileName:null,version:w,backupTime:new Date},d("tengu_file_history_backup_deleted_file",{version:w}),k(`FileHistory: Missing tracked file: ${A}`);return}if($&&$.backupFileName!==null&&!await Zu1(O,$.backupFileName,j)){Y[A]=$;return}Y[A]=await INq(O,w)}catch(O){H6(O),d("tengu_file_history_backup_file_failed",{})}}));q((A)=>{try{let O=A.snapshots.at(-1);if(O)for(let J of A.trackedFiles){if(J in Y)continue;let X=O.trackedFileBackups[J];if(X)Y[J]=X}let w={messageId:K,trackedFileBackups:Y,timestamp:new Date},j=[...A.snapshots,w],H={...A,snapshots:j.length>RNq?j.slice(-RNq):j,snapshotSequence:(A.snapshotSequence??0)+1};return uNq(H),g3Y(A,H).catch(H6),$r6(K,w,!1).catch((J)=>{H6(Error(`FileHistory: Failed to record snapshot: ${J}`))}),k(`FileHistory: Added snapshot for ${K}, tracking ${A.trackedFiles.size} files`),d("tengu_file_history_snapshot_success",{trackedFilesCount:A.trackedFiles.size,snapshotCount:H.snapshots.length}),H}catch(O){return H6(O),d("tengu_file_history_snapshot_failed",{}),A}})}async function pN8(q,K){if(!F2())return;let _;if(q((z)=>{return _=z,z}),!_)return;let Y=_.snapshots.findLast((z)=>z.messageId===K);if(!Y)throw H6(Error(`FileHistory: Snapshot for ${K} not found`)),d("tengu_file_history_rewind_failed",{trackedFilesCount:_.trackedFiles.size,snapshotFound:!1}),Error("The selected snapshot was not found");try{k(`FileHistory: [Rewind] Rewinding to snapshot for ${K}`);let z=await u3Y(_,Y);k(`FileHistory: [Rewind] Finished rewinding to ${K}`),d("tengu_file_history_rewind_success",{trackedFilesCount:_.trackedFiles.size,filesChangedCount:z.length})}catch(z){throw H6(z),d("tengu_file_history_rewind_failed",{trackedFilesCount:_.trackedFiles.size,snapshotFound:!0}),z}}function FN8(q,K){if(!F2())return!1;return q.snapshots.some((_)=>_.messageId===K)}async function Ar6(q,K){if(!F2())return;let _=q.snapshots.findLast(($)=>$.messageId===K);if(!_)return;let Y=await Promise.all(Array.from(q.trackedFiles,async($)=>{try{let w=Or6($),j=_.trackedFileBackups[$],H=j?j.backupFileName:Gu1($,q);if(H===void 0)return H6(Error("FileHistory: Error finding the backup file to apply")),d("tengu_file_history_rewind_restore_file_failed",{dryRun:!0}),null;let J=await B3Y(w,H===null?void 0:H);if(J?.insertions||J?.deletions)return{filePath:w,stats:J};if(H===null&&await G5(w))return{filePath:w,stats:J};return null}catch(w){return H6(w),d("tengu_file_history_rewind_restore_file_failed",{dryRun:!0}),null}})),z=[],A=0,O=0;for(let $ of Y){if(!$)continue;z.push($.filePath),A+=$.stats?.insertions||0,O+=$.stats?.deletions||0}return{filesChanged:z,insertions:A,deletions:O}}async function bNq(q,K){if(!F2())return!1;let _=q.snapshots.findLast((Y)=>Y.messageId===K);if(!_)return!1;for(let Y of q.trackedFiles)try{let z=Or6(Y),A=_.trackedFileBackups[Y],O=A?A.backupFileName:Gu1(Y,q);if(O===void 0)continue;if(O===null){if(await G5(z))return!0;continue}if(await Zu1(z,O))return!0}catch(z){H6(z)}return!1}async function u3Y(q,K){let _=[];for(let Y of q.trackedFiles)try{let z=Or6(Y),A=K.trackedFileBackups[Y],O=A?A.backupFileName:Gu1(Y,q);if(O===void 0){H6(Error("FileHistory: Error finding the backup file to apply")),d("tengu_file_history_rewind_restore_file_failed",{dryRun:!1});continue}if(O===null){try{await C3Y(z),k(`FileHistory: [Rewind] Deleted ${z}`),_.push(z)}catch($){if(!G7($))throw $}continue}if(await Zu1(z,O))await F3Y(z,O),k(`FileHistory: [Rewind] Restored ${z} from ${O}`),_.push(z)}catch(z){H6(z),d("tengu_file_history_rewind_restore_file_failed",{dryRun:!1})}return _}async function Zu1(q,K,_){let Y=MO6(K),z=_??null;if(!z)try{z=await zr6(q)}catch(O){if(!G7(O))return!0}let A=null;try{A=await zr6(Y)}catch(O){if(!G7(O))return!0}return m3Y(z,A,async()=>{try{let[O,$]=await Promise.all([Pu1(q,"utf-8"),Pu1(Y,"utf-8")]);return O!==$}catch{return!0}})}function m3Y(q,K,_){if(q===null!==(K===null))return!0;if(q===null||K===null)return!1;if(q.mode!==K.mode||q.size!==K.size)return!0;if(q.mtimeMs<K.mtimeMs)return!1;return _()}async function B3Y(q,K){let _=[],Y=0,z=0;try{let A=K?MO6(K):void 0,[O,$]=await Promise.all([BN8(q),A?BN8(A):null]);if(O===null&&$===null)return{filesChanged:_,insertions:Y,deletions:z};_.push(q),K76(O??"",$??"").forEach((j)=>{if(j.added)Y+=j.count||0;if(j.removed)z+=j.count||0})}catch(A){H6(Error(`FileHistory: Error generating diffStats: ${A}`))}return{filesChanged:_,insertions:Y,deletions:z}}function p3Y(q,K){return`${h3Y("sha256").update(q).digest("hex").slice(0,16)}@v${K}`}function MO6(q,K){let _=c1();return mN8(_,"file-history",K||k8(),q)}async function INq(q,K){if(q===null)return{backupFileName:null,version:K,backupTime:new Date};let _=p3Y(q,K),Y=MO6(_),z;try{z=await zr6(q)}catch(A){if(G7(A))return{backupFileName:null,version:K,backupTime:new Date};throw A}try{await Yr6(q,Y)}catch(A){if(!G7(A))throw A;await Wu1(SNq(Y),{recursive:!0}),await Yr6(q,Y)}return await hNq(Y,z.mode),d("tengu_file_history_backup_file_created",{version:K,fileSize:z.size}),{backupFileName:_,version:K,backupTime:new Date}}async function F3Y(q,K){let _=MO6(K),Y;try{Y=await zr6(_)}catch(z){if(G7(z)){d("tengu_file_history_rewind_restore_file_failed",{}),H6(Error(`FileHistory: [Rewind] Backup file not found: ${_}`));return}throw z}try{await Yr6(_,q)}catch(z){if(!G7(z))throw z;await Wu1(SNq(q),{recursive:!0}),await Yr6(_,q)}await hNq(q,Y.mode)}function Gu1(q,K){for(let _ of K.snapshots){let Y=_.trackedFileBackups[q];if(Y!==void 0&&Y.version===1)return Y.backupFileName}return}function xNq(q){if(!CNq(q))return q;let K=r1();if(q.startsWith(K))return b3Y(K,q);return q}function Or6(q){if(CNq(q))return q;return mN8(r1(),q)}function gN8(q,K){if(!F2())return;let _=[],Y=new Set;for(let z of q){let A={};for(let[O,$]of Object.entries(z.trackedFileBackups)){let w=xNq(O);Y.add(w),A[w]=$}_.push({...z,trackedFileBackups:A})}K({snapshots:_,trackedFiles:Y,snapshotSequence:_.length})}async function UN8(q){if(!F2())return;let K=q.fileHistorySnapshots;if(!K||q.messages.length===0)return;let Y=q.messages[q.messages.length-1]?.sessionId;if(!Y){H6(Error("FileHistory: Failed to copy backups on restore (no previous session id)"));return}let z=k8();if(Y===z){k(`FileHistory: No need to copy file history for resuming with same session id: ${z}`);return}try{let A=mN8(c1(),"file-history",z);await Wu1(A,{recursive:!0});let O=0;if(await Promise.allSettled(K.map(async($)=>{let w=Object.values($.trackedFileBackups).filter((J)=>J.backupFileName!==null);if(!(await Promise.allSettled(w.map(async({backupFileName:J})=>{let X=MO6(J,Y),M=mN8(A,J);try{await S3Y(X,M)}catch(D){let P=a1(D);if(P==="EEXIST")return;if(P==="ENOENT")throw H6(Error(`FileHistory: Failed to copy backup ${J} on restore (backup file does not exist in ${Y})`)),D;H6(Error("FileHistory: Error hard linking backup file from previous session"));try{await Yr6(X,M)}catch(W){throw H6(Error("FileHistory: Error copying over backup from previous session")),W}}k(`FileHistory: Copied backup ${J} from session ${Y} to ${z}`)}))).some((J)=>J.status==="rejected"))$r6($.messageId,$,!1).catch((J)=>{H6(Error("FileHistory: Failed to record copy backup snapshot"))});else O++})),O>0)d("tengu_file_history_resume_copy_failed",{numSnapshots:K.length,failedSnapshots:O})}catch(A){H6(A)}}async function g3Y(q,K){let _=q.snapshots.at(-1),Y=K.snapshots.at(-1);if(!Y)return;for(let z of K.trackedFiles){let A=Or6(z),O=_?.trackedFileBackups[z],$=Y.trackedFileBackups[z];if(O?.backupFileName===$?.backupFileName&&O?.version===$?.version)continue;let w=null;if(O?.backupFileName){let H=MO6(O.backupFileName);w=await BN8(H)}let j=null;if($?.backupFileName){let H=MO6($.backupFileName);j=await BN8(H)}if(w!==j)E76(A,w,j)}}async function BN8(q){try{return await Pu1(q,"utf-8")}catch{return null}}function uNq(q){if(U3Y)console.error(I3Y(q,!1,5))}var RNq=100,U3Y=!1;var lN=y(()=>{RA6();N8();V8();HV6();E1();Y8();g8();E8();Oq();y8();sq();d8()});function HL(q){return V1("policySettings")?.enabledPlugins?.[q]===!1}var DO6=y(()=>{Q1()});function wr6(q){if(!F8("tengu_lapis_finch",!1))return;if(yNq())return;let K=j8().claudeCodeHints;if(K?.disabled)return;let _=K?.plugin??[];if(_.length>=Q3Y)return;let Y=q.value,{name:z,marketplace:A}=Mq(Y);if(!z||!A)return;if(!Ku(A))return;if(_.includes(Y))return;if(PC(Y))return;if(HL(Y))return;if(mNq.has(Y))return;mNq.add(Y),vNq(q)}async function BNq(q){let K=q.value,{name:_,marketplace:Y}=Mq(K),z=await zf(K);if(d("tengu_plugin_hint_detected",{_PROTO_plugin_name:_??"",_PROTO_marketplace_name:Y??"",result:z?"passed":"not_in_cache"}),!z)return k(`[hintRecommendation] ${K} not found in marketplace cache`),null;return{pluginId:K,pluginName:z.entry.name,marketplaceName:Y??"",pluginDescription:z.entry.description,sourceCommand:q.sourceCommand}}function pNq(q){x8((K)=>{let _=K.claudeCodeHints?.plugin??[];if(_.includes(q))return K;return{...K,claudeCodeHints:{...K.claudeCodeHints,plugin:[..._,q]}}})}function FNq(){x8((q)=>{if(q.claudeCodeHints?.disabled)return q;return{...q,claudeCodeHints:{...q.claudeCodeHints,disabled:!0}}})}var Q3Y=100,mNq;var QN8=y(()=>{o1();V8();_r6();E1();Y8();jM();q$();MD();DO6();mNq=new Set});class jr6{capacity;buffer;head=0;size=0;constructor(q){this.capacity=q;this.buffer=Array(q)}add(q){if(this.buffer[this.head]=q,this.head=(this.head+1)%this.capacity,this.size<this.capacity)this.size++}addAll(q){for(let K of q)this.add(K)}getRecent(q){let K=[],_=this.size<this.capacity?0:this.head,Y=Math.min(q,this.size);for(let z=0;z<Y;z++){let A=(_+this.size-Y+z)%this.capacity;K.push(this.buffer[A])}return K}toArray(){if(this.size===0)return[];let q=[],K=this.size<this.capacity?0:this.head;for(let _=0;_<this.size;_++){let Y=(K+_)%this.capacity;q.push(this.buffer[Y])}return q}clear(){this.buffer.length=0,this.head=0,this.size=0}length(){return this.size}}function p76(q,K,_,Y){if(!K)return{effective:_,status:"valid"};let z=parseInt(K,10);if(isNaN(z)||z<=0){let A={effective:_,status:"invalid",message:`Invalid value "${K}" (using default: ${_})`};return k(`${q} ${A.message}`),A}if(z>Y){let A={effective:Y,status:"capped",message:`Capped from ${z} to ${Y}`};return k(`${q} ${A.message}`),A}return{effective:z,status:"valid"}}var Hr6=y(()=>{Y8()});function LV6(){return p76("BASH_MAX_OUTPUT_LENGTH",process.env.BASH_MAX_OUTPUT_LENGTH,Tu1,fu1).effective}var fu1=150000,Tu1=30000;var Jr6=y(()=>{Hr6()});import{unlink as d3Y}from"fs/promises";var c3Y=8388608,l3Y=1000,i3Y=4096,iA;var RV6=y(()=>{Y8();Q7();Jr6();Wj();iA=class iA{taskId;path;stdoutToFile;#q="";#K="";#_=null;#z=new jr6(1000);#Y=0;#O=0;#A;#w;#H=!1;#j=0;static#$=new Map;static#X=new Map;static#W=null;constructor(q,K,_=!1,Y=c3Y){if(this.taskId=q,this.path=uY(q),this.stdoutToFile=_,this.#A=Y,this.#w=K,_&&K)iA.#$.set(q,this)}static startPolling(q){let K=iA.#$.get(q);if(!K||!K.#w)return;if(iA.#X.set(q,K),!iA.#W)iA.#W=setInterval(iA.#D,l3Y),iA.#W.unref()}static stopPolling(q){if(iA.#X.delete(q),iA.#X.size===0&&iA.#W)clearInterval(iA.#W),iA.#W=null}static#D(){for(let[,q]of iA.#X){if(!q.#w)continue;Ht(q.path,i3Y).then(({content:K,bytesRead:_,bytesTotal:Y})=>{if(!q.#w)return;if(!K){q.#w("","",q.#Y,Y,!1);return}let z=K.length,A=0,O=0,$=0;while(z>0){if(z=K.lastIndexOf(`
|
| 2 |
+
1720 `,z-1),$++,$===5)A=z<=0?0:z+1;if($===100)O=z<=0?0:z+1}let w=_>=Y?$:Math.max(q.#Y,Math.round(Y/_*$));q.#Y=w,q.#O=Y,q.#w(K.slice(A),K.slice(O),w,Y,_<Y)},()=>{})}}writeStdout(q){this.#J(q,!1)}writeStderr(q){this.#J(q,!0)}#J(q,K){if(this.#O+=q.length,this.#Z(q),this.#_){this.#_.append(K?`[stderr] ${q}`:q);return}if(this.#q.length+this.#K.length+q.length>this.#A){this.#P(K?q:null,K?null:q);return}if(K)this.#K+=q;else this.#q+=q}#Z(q){let Y=0,z=[],A=0,O=q.length;while(O>0){let $=q.lastIndexOf(`
|
SPFsmartGATE/LIVE/BRAIN/DOCS/11c43c6118eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/121c379d18eecbfb.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Grep source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[Glob,Glob,Read] | ts=2026-03-18T08:29:57.603263118+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/1253fe12b115e0ca.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2174 let expression = args.get("expression").and_then(|v| v.as_str()).unwrap_or("");
|
| 2 |
+
2175 if expression.is_empty() {
|
| 3 |
+
2176 return json!({"type": "text", "text": "expression required"});
|
| 4 |
+
2177 }
|
| 5 |
+
2178 match browser.lock().unwrap().eval(expression) {
|
| 6 |
+
2179 Ok(result) => json!({"type": "text", "text": result.to_string()}),
|
| 7 |
+
2180 Err(e) => json!({"type": "text", "text": format!("Eval failed: {}", e)}),
|
| 8 |
+
2181 }
|
SPFsmartGATE/LIVE/BRAIN/DOCS/128a750040ee6b02.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=spf_brain_search source=stdio allowed=true label=1.0 weight=1.0 evil=0.00 relevance=0.50 fp=false override=false | context=[spf_brain_search,spf_brain_search,spf_brain_status] | ts=2026-03-21T22:35:33.078407956+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/129f3961260d6a1f.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/data/data/com.termux/files/home/SWARMagents/1/SPFsmartGATE/LIVE/PROJECTS/PROJECTS/DEPLOY/src/identity.rs- }
|
| 2 |
+
/data/data/com.termux/files/home/SWARMagents/1/SPFsmartGATE/LIVE/PROJECTS/PROJECTS/DEPLOY/src/identity.rs- }
|
| 3 |
+
/data/data/com.termux/files/home/SWARMagents/1/SPFsmartGATE/LIVE/PROJECTS/PROJECTS/DEPLOY/src/identity.rs- if !trusted.is_empty() {
|
| 4 |
+
/data/data/com.termux/files/home/SWARMagents/1/SPFsmartGATE/LIVE/PROJECTS/PROJECTS/DEPLOY/src/identity.rs- eprintln!("[SPF] Loaded {} trusted keys from {:?}", trusted.len(), groups_dir);
|
SPFsmartGATE/LIVE/BRAIN/DOCS/12be07c913c60df8.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
204 let (tx_a_to_b, rx_a_to_b) = bounded(buffer_size);
|
| 2 |
+
205 let (tx_b_to_a, rx_b_to_a) = bounded(buffer_size);
|
| 3 |
+
206
|
| 4 |
+
207 let conn_a = MeshConnection {
|
| 5 |
+
208 target: cell_b,
|
| 6 |
+
209 sender: tx_a_to_b,
|
| 7 |
+
210 receiver: rx_b_to_a,
|
| 8 |
+
211 active: AtomicBool::new(true),
|
| 9 |
+
212 sent: AtomicU64::new(0),
|
| 10 |
+
213 received: AtomicU64::new(0),
|
| 11 |
+
214 send_errors: AtomicU64::new(0),
|
| 12 |
+
215 };
|
| 13 |
+
216
|
SPFsmartGATE/LIVE/BRAIN/DOCS/12c6923340ee6b02.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=spf_brain_search source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=false | context=[spf_brain_search,spf_brain_search,spf_brain_search] | ts=2026-03-21T22:39:54.630155981+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/12d8ef5a66b94553.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Read source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=true | context=[Edit,Read,Grep] | ts=2026-03-21T23:49:39.069336238+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/12fa5bcb66b94553.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
GATE SIGNAL | tool=Read source=stdio allowed=true label=-1.0 weight=4.0 evil=0.00 relevance=1.00 fp=true override=true | context=[Edit,Read,Grep] | ts=2026-03-21T23:49:39.069336238+00:00
|
SPFsmartGATE/LIVE/BRAIN/DOCS/14954d750b44d27c.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
4299 [Optional Next step to take]
|
| 2 |
+
4300
|
| 3 |
+
4301 </summary>
|
| 4 |
+
4302 </example>
|
| 5 |
+
4303
|
| 6 |
+
4304 Please provide your summary based on the RECENT messages only (after the retained earlier context), following this structure and ensuring precision and thoroughness in your response.
|
| 7 |
+
4305 `,_XK=`
|
| 8 |
+
4306
|
| 9 |
+
4307 REMINDER: Do NOT call any tools. Respond with plain text only — `+"an <analysis> block followed by a <summary> block. Tool calls will be rejected and you will fail the task."});function a1z(q){return q.map((K)=>{if(K.type!=="user")return K;let _=K.message.content;if(!Array.isArray(_))return K;let Y=!1,z=_.flatMap((A)=>{if(A.type==="image")return Y=!0,[{type:"text",text:"[image]"}];if(A.type==="document")return Y=!0,[{type:"text",text:"[document]"}];if(A.type==="tool_result"&&Array.isArray(A.content)){let O=!1,$=A.content.map((w)=>{if(w.type==="image")return O=!0,{type:"text",text:"[image]"};if(w.type==="document")return O=!0,{type:"text",text:"[document]"};return w});if(O)return Y=!0,[{...A,content:$}]}return[A]});if(!Y)return K;return{...K,message:{...K.message,content:z}}})}function s1z(q){return q}function jXK(q,K){let _=q[0]?.type==="user"&&q[0].isMeta&&q[0].message.content===AXK?q.slice(1):q,Y=KXK(_);if(Y.length<2)return null;let z=GXK(K),A;if(z!==void 0){let $=0;A=0;for(let w of Y)if($+=Nv6(w),A++,$>=z)break}else A=Math.max(1,Math.floor(Y.length*0.2));if(A=Math.min(A,Y.length-1),A<1)return null;let O=Y.slice(A).flat();if(O[0]?.type==="assistant")return[U8({content:AXK,isMeta:!0}),...O];return O}function fo(q){return[q.boundaryMarker,...q.summaryMessages,...q.messagesToKeep??[],...q.attachments,...q.hookResults]}function Oe1(q,K,_){let Y=_??[];if(Y.length===0)return q;return{...q,compactMetadata:{...q.compactMetadata,preservedSegment:{headUuid:Y[0].uuid,anchorUuid:K,tailUuid:Y[Y.length-1].uuid}}}}function $e1(q,K){if(!K)return q||void 0;if(!q)return K;return`${q}
|
SPFsmartGATE/LIVE/BRAIN/DOCS/154caa6a4a34d1d6.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// ====== spf_rag_collect_folder ======
|
| 2 |
+
"spf_rag_collect_folder" => {
|
| 3 |
+
let path = args["path"].as_str().unwrap_or("");
|
| 4 |
+
|
| 5 |
+
session.record_action("rag_collect_folder", "called", Some(path));
|
| 6 |
+
let (success, output) = run_rag(&["collect", "--path", path]);
|
| 7 |
+
let _ = storage.save_session(session);
|
| 8 |
+
if success {
|
| 9 |
+
json!({"type": "text", "text": output})
|
| 10 |
+
} else {
|
| 11 |
+
json!({"type": "text", "text": format!("RAG collect-folder failed: {}", output)})
|
SPFsmartGATE/LIVE/BRAIN/DOCS/15f067c787caa82f.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
684 let tool_name = args["tool"].as_str().unwrap_or("");
|
| 2 |
+
685 let tool_args = args.get("arguments").cloned().unwrap_or(serde_json::json!({}));
|
| 3 |
+
686
|
| 4 |
+
687 if peer_key.is_empty() || tool_name.is_empty() {
|
| 5 |
+
688 json!({"type": "text", "text": "ERROR: peer_key and tool are required"})
|
| 6 |
+
689 } else {
|
| 7 |
+
690 let cfg_dir = crate::paths::spf_root().join("LIVE/CONFIG");
|
| 8 |
+
691 let trusted = crate::identity::load_trusted_keys(&cfg_dir.join("groups"));
|
SPFsmartGATE/LIVE/BRAIN/DOCS/16aa7b54961cf8cd.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
653 "name": mesh_cfg.name,
|
| 2 |
+
654 }
|
| 3 |
+
655 })
|
| 4 |
+
656 }
|
| 5 |
+
657
|
| 6 |
+
658 _ => {
|
| 7 |
+
659 json!({
|
| 8 |
+
660 "jsonrpc": "2.0",
|
| 9 |
+
661 "id": id,
|
| 10 |
+
662 "error": {"code": -32601, "message": format!("Unknown method: {}", method)}
|
| 11 |
+
663 })
|
| 12 |
+
664 }
|
| 13 |
+
665 }
|
| 14 |
+
666 }
|
| 15 |
+
667
|
| 16 |
+
668 // ============================================================================
|
| 17 |
+
669 // FRAMED STREAM HANDLER (Block G + H: persistent bidirectional streams)
|
SPFsmartGATE/LIVE/BRAIN/DOCS/17400c8a71af6744.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
5041 http_state, http_bind, http_port, http_api_key, tls,
|
| 2 |
+
5042 ));
|
| 3 |
+
5043
|
| 4 |
+
5044 // Mesh as async task — same runtime, shared thread pool
|
| 5 |
+
5045 let mesh_task = tokio::spawn(crate::mesh::run(
|
| 6 |
+
5046 mesh_state, mesh_signing_key, mesh_cfg, mesh_receiver,
|
| 7 |
+
5047 ));
|
| 8 |
+
5048
|
| 9 |
+
5049 // Both run concurrently — if either exits, log it
|
SPFsmartGATE/LIVE/BRAIN/DOCS/188788fffb723fe9.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
193 created: Utc::now(),
|
| 2 |
+
194 metadata: None,
|
| 3 |
+
195 }
|
| 4 |
+
196 }
|
| 5 |
+
197
|
| 6 |
+
198 pub fn with_strength(mut self, strength: f32) -> Self {
|
| 7 |
+
199 self.strength = strength.clamp(0.0, 1.0);
|
| 8 |
+
200 self
|
| 9 |
+
201 }
|
| 10 |
+
202 }
|
| 11 |
+
203
|
| 12 |
+
204 // ============================================================================
|
| 13 |
+
205 // CONTEXT - Conversation/Session grouping
|
| 14 |
+
206 // ============================================================================
|
| 15 |
+
207
|
SPFsmartGATE/LIVE/BRAIN/DOCS/19020b938a6e787d.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
143 "User must approve before proceeding"
|
| 2 |
+
144 ]
|
| 3 |
+
145 },
|
| 4 |
+
146
|
| 5 |
+
147 "edit_removal_protocol": {
|
| 6 |
+
148 "description": "Before ANY edit or removal, present HOW and WHY for user approval",
|
| 7 |
+
149 "mandatory": true,
|
| 8 |
+
150 "before_any_edit": [
|
| 9 |
+
151 "Present WHAT will be changed (file path, line numbers)",
|
| 10 |
+
152 "Present HOW it will be changed (old code → new code)",
|
| 11 |
+
153 "Present WHY this change is needed",
|
| 12 |
+
154 "WAIT for explicit user approval"
|
SPFsmartGATE/LIVE/BRAIN/DOCS/192fffaf56bfdec8.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Per layer: self-attn (4 × d_model²) + cross-attn (4 × d_model²) + FFN (2 × d_model × d_ff) + norms
|
| 2 |
+
let per_layer = 4 * self.d_model * self.d_model // self-attention Q/K/V/O
|
| 3 |
+
+ 4 * self.d_model * self.d_model // cross-attention Q/K/V/O
|
| 4 |
+
+ 2 * self.d_model * self.d_ff // FFN w1 + w2 ══
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
══ pub prompt: Option<String>, // spf_transformer_infer: inference prompt
|
| 8 |
+
pub batch_size: Option<u64>, // spf_transformer_train: training batch size
|
SPFsmartGATE/LIVE/BRAIN/DOCS/1a9a014cf0adfde9.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
488 +-- lib.rs # Module exports (NO api/mcp/nexus)
|
| 2 |
+
489 +-- main.rs # Entry point
|
| 3 |
+
490 +-- grid.rs # 54x54 grid manager (cross-stagger)
|
| 4 |
+
491 |
|
| 5 |
+
492 +-- cell.rs # V2 cell with HNSW
|
| 6 |
+
493 +-- cluster.rs # Fibonacci cluster
|
| 7 |
+
494 +-- vector_index.rs # HNSW implementation
|
| 8 |
+
495 +-- types.rs # Core types
|
| 9 |
+
496 +-- constants.rs # Constants
|
| 10 |
+
497 +-- error.rs # Error types
|
SPFsmartGATE/LIVE/BRAIN/DOCS/1ad9ae77aa187c2d.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
518 if GATE_START.elapsed() < std::time::Duration::from_secs(86400) {
|
| 2 |
+
519 return text.to_string();
|
| 3 |
+
520 }
|
| 4 |
+
521
|
| 5 |
+
522 That's it. 7 lines removed. No replacement needed — the FULL/SUMMARY/DIGEST
|
| 6 |
+
523 tiers below (lines 316-353) handle everything correctly already.
|
| 7 |
+
524
|
| 8 |
+
525 WHY: The grace period was a safety measure during development ("let raw data
|
| 9 |
+
526 flow for learning"). Now that FLINT preserves originals in brain before
|
| 10 |
+
527 compression (FL-2, line 198-202), there is no data loss risk. Removing it
|
SPFsmartGATE/LIVE/BRAIN/DOCS/1c9ec5aee433c2a9.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
313 pub fn get_weights(cell: &StoneCell, layer: u32) -> Option<(Vec<i8>, usize, usize)> {
|
| 2 |
+
314 let key = format!("weight_layer_{}", layer);
|
| 3 |
+
315 let entry = cell.storage_b.read().get(&key)?;
|
| 4 |
+
316 let data = u8_to_i8(entry.content.clone());
|
| 5 |
+
317 let rows = entry.metadata.get("rows")?.parse().ok()?;
|
| 6 |
+
318 let cols = entry.metadata.get("cols")?.parse().ok()?;
|
| 7 |
+
319 Some((data, rows, cols))
|
| 8 |
+
320 }
|
| 9 |
+
321 ```
|
| 10 |
+
322
|
| 11 |
+
323 ---
|
| 12 |
+
324
|
| 13 |
+
325 ## WEIGHT STREAMING VIA SYNAPSE RING BUFFER
|
SPFsmartGATE/LIVE/BRAIN/DOCS/1d4b83edf5433d0e.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
93 let mut restored_step: u64 = 0;
|
| 2 |
+
94 let mut restored_checkpoint = String::new();
|
| 3 |
+
95
|
| 4 |
+
96 if checkpoint_path.exists() {
|
| 5 |
+
97 match std::fs::read(&checkpoint_path) {
|
| 6 |
+
98 Ok(data) => {
|
| 7 |
+
99 match crate::checkpoint::deserialize_weights(&data) {
|
| 8 |
+
100 Ok((checkpoint_weights, meta)) => {
|
| 9 |
+
101 let mut model_weights = model.weights_mut();
|
| 10 |
+
102 match crate::checkpoint::apply_weights(&mut model_weights, &checkpoint_weights) {
|
SPFsmartGATE/LIVE/BRAIN/DOCS/1d63535dcc18bbf6.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2477 json!({"type": "text", "text": "Bandwidth tracking removed — brain operates in-process. Use spf_brain_status for system info."})
|
| 2 |
+
2478 }
|
| 3 |
+
2479
|
| 4 |
+
2480 // ====== spf_rag_fetch_url ======
|
| 5 |
+
2481 "spf_rag_fetch_url" => {
|
| 6 |
+
2482 let url = args["url"].as_str().unwrap_or("");
|
| 7 |
+
2483
|
| 8 |
+
2484 session.record_action("rag_fetch_url", "called", None);
|
| 9 |
+
2485 // RG-1: Redirect to brain_store — caller should use spf_web_fetch first then store result
|