Commit Graph

50 Commits

Author SHA1 Message Date
Michael Mikovsky e50ebb1e35 Reuse host hook keys during inbound hook resolution 2026-04-25 23:42:28 -06:00
Michael Mikovsky 090c2740f8 Simplify hook state and preallocate frame encoding 2026-04-25 22:42:45 -06:00
Michael Mikovsky 80611a4d74 Avoid cloning call payloads in runtimes 2026-04-25 21:14:02 -06:00
Michael Mikovsky 31a0bd39b0 Simplify endpoint outcome state handling 2026-04-25 20:47:37 -06:00
Michael Mikovsky f2c6a54060 Optimize framed packet encoding 2026-04-25 20:41:02 -06:00
Michael Mikovsky 25988de1e1 Optimize framed packet encoding 2026-04-25 19:03:08 -06:00
Michael Mikovsky 7bea3e2b6b Add procedure-scoped stateful leaves 2026-04-25 17:42:39 -06:00
Michael Mikovsky 5e9b49a4d9 Split remote shell leaf module 2026-04-25 16:27:10 -06:00
Michael Mikovsky 7e266e2a38 Add stateful call leaf runtime 2026-04-25 15:35:08 -06:00
Michael Mikovsky b1ebe34ec1 Add derive-based protocol leaf declarations 2026-04-25 14:41:00 -06:00
Michael Mikovsky 9895248bbf Clarify tree protocol runtime and routing
Document the hook lifecycle, ingress rules, and longest-prefix routing behavior so the tree endpoint code is easier to follow. Keep the pass behavior-neutral while tightening local names and comments around non-obvious protocol paths.
2026-04-25 13:34:18 -06:00
Michael Mikovsky 412960203c Align frame header and extend benchmark driver
Align the framed header section so decode can avoid hidden alignment repair on the hot path, and teach protocol_bench.rs to build and run the standalone tracing binaries directly. The updated benchmark shows lower encode, decode, forward, local call, and hook data costs than the previous baseline.
2026-04-25 13:28:20 -06:00
Michael Mikovsky 4f0042411d Add straceable protocol operation binaries
Factor the benchmark scenarios into standalone example binaries that can be traced directly without cargo run, and simplify the hot call and hook lookup paths using the benchmark output as guidance.
2026-04-25 12:56:29 -06:00
Michael Mikovsky 4a131e6b63 Reformat lines. 2026-04-25 12:41:10 -06:00
Michael Mikovsky 080f55ddd3 Rebuild protocol runtime from scratch
Implement an aligned two-section frame format, a compiled prefix router, a minimal pending and active hook engine, and a header-first receive path that only decodes payloads on local delivery. Recreate the protocol-focused test suite and document the explicit framing deviation in src/protocol/PROTOCOL_CHANGES.md.
2026-04-25 12:37:54 -06:00
Michael Mikovsky 3d92b5cf0d Rewrite protocol flow around compiled routing
Compile routing prefixes once per endpoint, restore minimal pending-to-active hook transitions, and route call/data/fault packets from the header before decoding payloads for local delivery only. Document the remaining protocol-level pressure points in src/protocol/PROTOCOL_CHANGES.md.
2026-04-25 12:15:38 -06:00
Michael Mikovsky 62b22be39f Simplify hook runtime state
Remove the unused pending-hook layer and dead protocol trait wrappers, and resolve active hooks through a direct active-only flow with peer-side indexing instead of scan-based recovery.
2026-04-25 11:57:37 -06:00
Michael Mikovsky 7b5b148ef3 Reduce protocol packet-flow allocations
Replace vector-backed endpoint outcomes with single-action results, skip payload deserialization on forwarded data and faults, and route local call and data emissions without encode/decode roundtrips.
2026-04-25 11:46:45 -06:00
Michael Mikovsky 6bdf59c5c9 Align protocol runtime with spec boundaries
Move demo leaf echo behavior out of the core protocol runtime, treat procedure IDs as opaque protocol fields, and return direct registered children in endpoint introspection to match the spec.
2026-04-25 11:27:29 -06:00
Michael Mikovsky ba3f28a78c Improve Rust code clarity across the workspace
Document public APIs and non-obvious control flow so the protocol, simulator, and macro crates are easier to follow. Tighten a few helper paths and feature gates while preserving behavior and keeping the workspace warning-free.
2026-04-25 11:11:19 -06:00
Michael Mikovsky c1a7a19c58 Update builders.rs 2026-04-24 17:45:04 -06:00
Michael Mikovsky 2b633ce019 add treetest protocol simulator and ui 2026-04-24 16:19:42 -06:00
Michael Mikovsky 555663bd3d refactor: split logger into focused modules 2026-04-24 14:32:59 -06:00
Michael Mikovsky 11674bae8f Add newlines and reformat for better code quality 2026-04-24 14:27:55 -06:00
Michael Mikovsky fc8638d014 refactor: split protocol endpoint into focused modules 2026-04-24 14:25:35 -06:00
Michael Mikovsky 71afc49ac9 fix: remove panics from handle_introspection 2026-04-24 14:15:40 -06:00
Michael Mikovsky 3f1116c26a Improve protocol implementation. 2026-04-24 14:10:03 -06:00
Michael Mikovsky 49901b6370 Reorganize protocol. 2026-04-24 13:37:30 -06:00
Michael Mikovsky dcf0fe230b Work on implementing the protocol. 2026-04-24 12:32:24 -06:00
Michael Mikovsky fcb3b2be17 feat: complete protocol spec and initial implementation
- Write PROTOCOL.md with full wire format spec and 8 real-world scenario
  analyses (reconnect, multi-operator, large files, AV evasion, router crash,
  malformed packets, future pivoting)

- Rewrite workspace structure:
  - unshell lib: protocol types (PacketHeader, TreeRequest/Response,
    HandshakeMessage/Ack), Transport trait, TcpTransport, Tree routing
  - ush-router: router binary with per-node threads, NodeRegistry with
    longest-prefix path matching, packet relay
  - ush-payload: implant binary with reconnect loop, module tree, InfoModule
  - ush-cli: operator REPL with rustyline, session management, command parser

- Protocol design: two-part rkyv frame [header][payload]; router reads only
  header for routing, payload bytes forwarded opaque

- All code documented with doc comments and examples
- Zero warnings, zero errors across entire workspace
- 32 tests pass (unit tests for tree routing, TCP transport, framing,
  command parsing, node registry)
2026-04-20 23:38:02 -06:00
Michael Mikovsky 959ea469a8 Fix bug in proc_impl_switcher.rs 2026-04-20 23:14:07 -06:00
Michael Mikovsky 512823585f Fix core dump bug in tree path search 2026-03-18 12:01:21 -06:00
Michael Mikovsky 95d335a271 Add tree type 2026-03-17 17:29:36 -06:00
Michael Mikovsky f3a59f5082 Convert to no_std, add request type 2026-03-17 16:40:05 -06:00
Michael Mikovsky 3a5605bc0d Remove error type 2026-03-17 15:15:37 -06:00
Michael Mikovsky 2c3962fa99 Remove warnings from unused colors. 2026-03-04 12:22:23 -07:00
Michael Mikovsky 07e3f83bcf Put logging time behind log_debug 2026-03-04 10:00:06 -07:00
Michael Mikovsky 76eb533911 Fix error in pretty logger. 2026-03-04 09:30:27 -07:00
Michael Mikovsky 55d2deef1c Add init checking to PrettyLogger 2026-02-20 15:55:21 -07:00
Michael Mikovsky 5a60f3f503 Obfuscation macros are now defined more easily 2026-02-20 15:47:58 -07:00
Michael Mikovsky 6c6625e9ad Make the log macro's definition more consise 2026-02-20 14:34:32 -07:00
Michael Mikovsky 219c7254fb Remove old code 2026-02-20 14:13:41 -07:00
Michael Mikovsky 2a18639d84 Rename things to ush for brevity. Add Tree system. 2026-02-09 10:27:15 -07:00
Michael Mikovsky d089c2a8aa Work on new tree system 2026-02-08 12:02:50 -07:00
Michael Mikovsky fc625e89d2 Start reworking the manager system 2026-02-04 22:19:16 -07:00
Michael Mikovsky 82d8e1ba10 Work on custom binaries 2026-01-30 14:05:07 -07:00
Michael Mikovsky a4411d378f Fix unshell_obfuscate error. remove default encryption key error when there isn't any encryption 2026-01-27 15:37:19 -07:00
Michael Mikovsky 2edb4f3187 Clean up some package stuff 2026-01-27 15:12:20 -07:00
Michael Mikovsky 2aa61e80eb Make unshell-obfuscate into a re-export 2026-01-26 09:47:40 -07:00
Michael Mikovsky 5d6d746985 Move everything into workspace 2026-01-26 09:13:46 -07:00