Improve ClawMesh through small, git-tracked, Red/Green TDD slices.
This workflow is modeled after autoresearch, but optimized for implementation rather than open-ended architecture exploration. The focus is:
- one narrowly scoped behavior at a time
- failing test first
- smallest green implementation
- immediate git commit after green
- repeat until the milestone is complete
Strengthen ClawMesh as a real distributed system before adding more intelligence.
Priority themes:
- peer lifecycle truthfulness
- stable mesh identity + protocol generation
- explicit node roles + passive/viewer clients
- WAN/relay connectivity
- planner leadership + failover
For every slice:
- Red — write one failing test for one visible behavior
- Green — implement the smallest change that makes it pass
- Refactor — only if needed after green
- Commit — one git commit per green slice
- Never combine unrelated features in one slice
- Prefer manager-level or module-level tests before full runtime/integration tests
- Use the runtime harness for fast local multi-node tests
- Validate on the real Jetson only after local tests are green
Commit message shape:
test(mesh): ...feat(mesh): ...refactor(mesh): ...
Example:
feat(mesh): broadcast graceful peer leaving before shutdown
- test_count — total passing tests; must not go down
- test_files — test suite breadth
- source_modules — modularity growth
- god_object_lines —
src/mesh/node-runtime.tssize; lower is better - git_commits_ahead — implementation slices completed since
origin/main
- ✅ Reusable runtime harness for multi-node TDD
- commit:
da99da2 - message:
test(mesh): add reusable runtime harness for multi-node TDD
- commit:
-
✅ Graceful leave broadcast (
peer.leaving)- commit:
82968a1 - message:
feat(mesh): broadcast graceful peer leaving before shutdown
- commit:
-
✅ Hard disconnect propagation (
peer.downbroadcast + handling)- commit:
8b859e0 - message:
feat(mesh): broadcast and handle peer.down on hard disconnect
- commit:
-
✅ Reachability confirmation before honoring
peer.down- commit:
53e9c5e - message:
feat(mesh): confirm peer reachability before honoring peer.down
- commit:
-
✅ Dead-peer suppression / ghost reconnect prevention
- commit:
55a0344 - message:
feat(mesh): suppress auto-connect for confirmed dead peers
- commit:
-
✅ Stable mesh identity (
meshId) in peer handshake- commit:
463e13f - message:
feat(mesh): add stable mesh identity to handshake
- commit:
-
✅ Protocol generation (
gen) on mesh messages- commit:
21ca115 - message:
feat(mesh): add protocol generation checks to mesh events
- commit:
-
✅ Explicit node roles in peer handshake
- commit:
d410c75 - message:
feat(mesh): add explicit node roles to peer handshake
- commit:
-
✅ Viewer/passive clients excluded from capability routing
- commit:
969d8de - message:
feat(mesh): exclude viewer peers from capability routing
- commit:
-
✅ Planner election primitive
- commit:
741e62b - message:
feat(mesh): add deterministic planner election primitive
- commit:
-
✅ Expose peer roles in operational RPC/status surfaces
- commit:
30afe1f - message:
feat(mesh): expose peer roles in mesh status RPCs
- commit:
-
✅ Planner leadership observable in health/runtime surfaces
- commit:
a48c45a - message:
feat(mesh): surface planner leadership in health status
- commit:
-
✅ CLI support for mesh role / mesh name
- commit:
ab4c729 - message:
feat(cli): add runtime role and mesh name options
- commit:
-
✅ Planner activity gating
- commit:
cc1225e - message:
feat(mesh): gate autonomous planner activity by election
- commit:
-
✅ Standby promotion wake-up
- commit:
0284901 - message:
feat(mesh): wake standby planners on promotion
- commit:
-
✅ Planner identity broadcast for duplicate suppression
- commit:
40ba419 - message:
feat(mesh): stamp proposals with planner identity
- commit:
-
✅ Per-planner duplicate suppression keys
- commit:
5094ce0 - message:
feat(mesh): track proposal dedup ownership by planner
- commit:
-
✅ Proposal owner visibility on duplicate rejection
- commit:
ef9affe - message:
feat(mesh): expose duplicate proposal owner to callers
- commit:
-
✅ Planner-owner aware proposal summaries
- commit:
e2cd046 - message:
feat(mesh): surface planner ownership in proposal summaries
- commit:
-
✅ Sticky planner ownership hints
- commit:
f365ec7 - message:
feat(mesh): show proposal owner handoff hints
- commit:
-
✅ Approval/rejection owner visibility
- commit:
119e0b6 - message:
feat(mesh): include planner owner in decision notices
- commit:
-
✅ Planner-owner visibility in status surfaces
- commit:
1ea0593 - message:
feat(mesh): show proposal owners in status surfaces
- commit:
-
✅ Planner-owner visibility in RPC summaries
- commit:
5531bca - message:
feat(mesh): expose proposal owners in mesh status RPC
- commit:
-
✅ Discovery-disabled static/WAN mode
- commit:
1b2a6a2 - message:
feat(mesh): support static-only mode without discovery
- commit:
-
✅ Discovery mode visibility in status surfaces
- commit:
1d8f82a - message:
feat(mesh): expose discovery mode in status surfaces
- commit:
-
✅ Peer transport labeling
- commit:
26b8979 - message:
feat(mesh): add operator-visible peer transport labels
- commit:
-
✅ WAN peer labeling in health surfaces
- commit:
99fd264 - message:
feat(mesh): expose peer transport labels in health
- commit:
-
✅ WAN peer labeling in runtime status commands
- commit:
6de6e93 - message:
feat(mesh): show discovery mode in operator status views
- commit:
-
✅ CLI startup WAN visibility
- commit:
7f671b5 - message:
feat(cli): show discovery mode and peer transport at startup
- commit:
-
✅ Transport-label visibility in startup validation/reporting
- commit:
b12afe3 - message:
feat(cli): report static peer transports in preflight
- commit:
-
✅ Unlabeled WAN peer diagnostics
- commit:
31c377f - message:
feat(cli): warn on unlabeled static peers in WAN mode
- commit:
-
✅ mDNS peer transport labeling
- commit:
3353fcd - message:
feat(mesh): label discovery auto-connect peers as mdns
- commit:
-
✅ Configured static peers in mesh.status
- commit:
18816e1 - message:
feat(mesh): expose configured static peers in mesh status
- commit:
-
✅ Configured static peers in health parity
- commit:
248bab4 - message:
feat(mesh): expose configured static peers in health
- commit:
-
✅ Relay/static peer URL normalization at CLI boundary
- commit:
05e1642 - message:
feat(cli): normalize relay peer https URLs to wss
- commit:
-
✅ Relay/static peer URL normalization in runtime path
- commit:
e55744d - message:
feat(mesh): normalize static peer http URLs at runtime boundary
- commit:
-
✅ Relay/WSS TLS pinning diagnostics
- commit:
5d0fae2 - message:
feat(cli): warn on unpinned relay and wss peers
- commit:
-
✅ Insecure relay transport diagnostics
- commit:
5de49c7 - message:
feat(cli): warn on insecure relay ws peers
- commit:
-
✅ Static peer security posture in status surfaces
- commit:
801431c - message:
feat(mesh): expose static peer security posture in status
- commit:
-
✅ Static peer security posture in operator views
- commit:
f9ed287 - message:
feat(mesh): show static peer posture in operator status views
- commit:
-
✅ Static peer security posture in CLI startup output
- commit:
db7e8e7 - message:
feat(cli): show static peer posture at startup
- commit:
-
✅ Static peer posture in connection logs
- commit:
d9356b8 - message:
feat(mesh): log static peer posture on connect
- commit:
-
✅ Static peer posture in outbound error logs
- commit:
057315d - message:
feat(mesh): include static peer posture in outbound errors
- commit:
-
✅ Relay transport enforcement slice
- commit:
d518ef9 - message:
feat(mesh): refuse insecure relay ws connections
- commit:
-
✅ Pinned relay enforcement slice
- commit:
47a7ba3 - message:
feat(mesh): refuse unpinned relay tls connections
- commit:
-
✅ WAN pinning policy broadening review
- commit:
4087028 - message:
feat(mesh): enforce vpn transport safety like relay
- commit:
-
✅ Generic WAN-labeled transport enforcement
- commit:
b516975 - message:
feat(mesh): treat unknown transport labels as wan
- commit:
-
✅ Explicit local transport alias support
- commit: pending
- message:
feat(mesh): treat local transport label as local
Local transport alias review
Desired behavior:
- decide whether any additional local aliases beyond
lan,mdns, andlocalare worth supporting - keep WAN enforcement strict for everything else
- continue policy refinement without weakening the new safety defaults
This is the next practical WAN milestone slice.
- ✅ runtime harness
- ✅
peer.leaving - ✅
peer.downbroadcast/handling - ✅ reachability confirmation before removal
- ✅ dead-peer suppression / ghost reconnect prevention
- ✅
meshId - ✅ protocol generation / version field
- ✅ reject mismatched mesh IDs
- ✅ reject unsupported generations
- explicit node roles
- passive/viewer clients
- routing restrictions by role
- relay-backed connection mode
- preserve LAN/mDNS path
- trust behavior unchanged across transport
- planner election
- standby promotion
- sticky planner sessions
- no duplicate proposal generation
src/mesh/src/agents/(only when planner leadership/failover work begins)src/cli/(only when role/mesh-id/relay flags are added)
- All existing tests must stay green
- No new npm dependencies unless explicitly justified
- Backward compatible where possible
- Real Jetson validation happens after local green, not instead of it
./autoimplement.sh— prints implementation metrics./autoimplement.checks.sh— runs guardrail checks before/after a slice
The goal is not to turn ClawMesh into mesh-llm. The goal is to borrow distributed-systems discipline from mesh-llm while preserving ClawMesh's core strengths:
- trust-gated actuation
- world model
- capability routing
- farm digital twin
- human-in-the-loop proposal flow