Replace internal task tracking (TODO.md, FINDINGS.md) with structured documentation in docs/. Trim CLAUDE.md to agent instructions only. Co-Authored-By: Virgil <virgil@lethean.io>
1.6 KiB
1.6 KiB
CLAUDE.md
Project
go-p2p is the P2P networking layer for the Lethean network. Module path: forge.lthn.ai/core/go-p2p
Commands
go test ./... # Run all tests
go test -run TestName ./... # Single test
go test -race ./... # Race detector (required before any PR)
go test -short ./... # Skip integration tests
go test -cover ./node # Coverage for node package
go test -bench . ./... # Benchmarks
go vet ./... # Static analysis
Key Interfaces
// MinerManager — decoupled miner control (worker.go)
type MinerManager interface {
StartMiner(config map[string]any) error
StopMiner(id string) error
GetStats() map[string]any
GetLogs(id string, lines int) ([]string, error)
}
// ProfileManager — deployment profiles (worker.go)
type ProfileManager interface {
ApplyProfile(name string, data []byte) error
}
Coding Standards
- UK English (colour, organisation, centre)
- All parameters and return types explicitly annotated
- Tests use
testifyassert/require; table-driven subtests witht.Run() - Licence: EUPL-1.2
- Security-first: do not weaken HMAC, challenge-response, Zip Slip defence, or rate limiting
- Use
loggingpackage only — nofmt.Printlnorlog.Printfin library code
Commit Format
type(scope): description
Co-Authored-By: Virgil <virgil@lethean.io>
Documentation
docs/architecture.md— full package and component referencedocs/development.md— build, test, benchmark, standards guidedocs/history.md— completed phases, known limitations, bugs fixed