Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
dist
tmp
mnemon
mnemon-harness
mnemond
!harness/cmd/mnemon-harness
!harness/cmd/mnemon-harness/**
!harness/cmd/mnemond
!harness/cmd/mnemond/**
bin
vendor
go.work
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
harness/go.sum
cache-dependency-path: go.sum

- name: Run deterministic test suite
run: make test
4 changes: 1 addition & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
harness/go.sum
cache-dependency-path: go.sum

- name: Run integration suite
run: make test-integration
4 changes: 1 addition & 3 deletions .github/workflows/live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
harness/go.sum
cache-dependency-path: go.sum

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Binary
/mnemon
/mnemon-harness
/mnemond
/bin/

Expand Down
36 changes: 13 additions & 23 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ builds:
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64

archives:
- id: default
format: tar.gz
ids:
- mnemon
formats:
- tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "checksums.txt"
Expand All @@ -44,9 +40,6 @@ changelog:
- "^ci:"
- "^chore:"
- "^Merge"
# Harness modules and evaluations are still experimental. Keep them out of
# stable release notes until their public contract is ready.
- "(?i)harness"
- "(?i)eval"
- "(?i)codex app-server"
- "(?i)skill loop"
Expand All @@ -55,19 +48,18 @@ changelog:
- "(?i)self-evolution"
- "(?i)agent memory"

brews:
- repository:
homebrew_casks:
- name: mnemon
ids:
- default
binaries:
- mnemon
repository:
owner: mnemon-dev
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
directory: Formula
homepage: "https://github.com/mnemon-dev/mnemon"
description: "Persistent memory for LLM agents"
license: "Apache-2.0"
test: |
system "#{bin}/mnemon", "--version"
install: |
bin.install "mnemon"
description: "Persistent memory and durable agency for LLM agents"

release:
github:
Expand All @@ -77,6 +69,4 @@ release:
prerelease: auto
name_template: "v{{.Version}}"
header: |
v{{.Version}} focuses on stable CLI, storage, and entity-graph behavior.

Note: harness modules, harness documentation, and harness evaluation assets in this repository remain experimental and are not part of this release's public stability guarantee.
v{{.Version}} ships Mnemon Memory and the local Agency authority in one `mnemon` binary.
17 changes: 10 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

## Development

- Build with `go build -o mnemon .`.
- Build the single product executable with `go build -o mnemon .`.
- Run `make test` for the deterministic CI suite. It excludes real daemon
readiness, CLI E2E, wall-clock scenarios, Docker, and provider calls.
- Run `make test-integration` explicitly for CLI E2E plus Harness timing, race,
process, and Docker boundaries; it is not a regular CI gate.
- Run `make test-integration` explicitly for CLI E2E plus Agency
timing, race, process, and Docker boundaries; it is not a regular CI gate.
- Run `make test-live` only when explicitly validating the paid Pi/DeepSeek
scenarios.
- Treat `harness/` as an experimental, not-yet-released harness layer. Do not
use it as an implementation dependency for release-path commands such as
`mnemon setup`; formal integrations belong under `cmd/` and `internal/`.
- Treat `cmd/memory` and `cmd/agency` as command namespaces within the single
`mnemon` executable. Keep existing Memory commands at the root; expose Agency
through `mnemon agency ...`. `mnemond` remains the local daemon/protocol role,
not a second executable.
- Keep mnemond boundary suites under `test/mnemond` and their data-only fixtures
under `testdata/mnemond`.
- Treat `.claude/`, `.codex/`, `.openclaw/`, and similar host directories as
local projection surfaces, not canonical project state.

Expand Down Expand Up @@ -39,7 +42,7 @@
Commit title plus one or two focused body paragraphs, with bullets only when
they improve scanning.
- Choose the commit type by the primary project effect:
- `feat` for new developer-facing or harness capabilities.
- `feat` for new developer-facing or Agency capabilities.
- `fix` for correctness repairs.
- `test` for tests, eval scenarios, or fixtures that do not add a new
reusable capability.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
- **Build**: `go build -o mnemon .`
- **Install**: `make install && mnemon setup`
- **Test**: `make test`
- **Integration**: `make test-integration` for CLI E2E and Harness boundaries
- **Integration**: `make test-integration` for CLI E2E and `mnemon agency` boundaries
- **Dependencies**: `modernc.org/sqlite`, `spf13/cobra`, `google/uuid`
- **Optional**: Ollama with `nomic-embed-text` for embedding support
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ make build
## Running Tests

```bash
make test # Required deterministic CI suite for both Go modules
make test # Required deterministic CI suite for the Mnemon product
make test-integration # Opt-in CLI E2E, timing, race, process, and Docker suite
make test-live # Explicit paid Pi/DeepSeek evaluation
```

`make test` must pass before submitting a PR. Run `make test-integration`
proportionally when changing CLI E2E behavior or Harness process, timing,
proportionally when changing CLI E2E behavior or `mnemon agency` process, timing,
transport, or Docker boundaries; it is intentionally outside regular CI.

## Code Style
Expand Down Expand Up @@ -63,7 +63,7 @@ imperative form. The CHANGELOG filter excludes `docs:`, `test:`, `ci:`, and

1. Fork the repository and create a feature branch from `master`.
2. Make your changes and run the proportional test level, including
`make test-integration` for affected Harness boundary behavior.
`make test-integration` for affected `mnemon agency` boundary behavior.
3. Update documentation (USAGE.md, DESIGN.md, or README) if your change affects user-facing behavior.
4. For user-facing changes, describe the release-note impact in the PR body. Maintainers update `CHANGELOG.md` during release preparation unless they explicitly ask for a changelog entry in the PR.
5. Open a pull request against `master`.
Expand All @@ -77,7 +77,9 @@ git tag v0.2.0
git push origin v0.2.0
```

This triggers GitHub Actions → runs tests → builds cross-platform binaries via GoReleaser → publishes a GitHub Release → updates the Homebrew tap.
This triggers GitHub Actions → runs tests → builds platform artifacts for the
single `mnemon` executable via GoReleaser → publishes a GitHub Release →
updates the Homebrew tap.

## License

Expand Down
143 changes: 67 additions & 76 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,98 +1,92 @@
# ──────────────────────────────────────────────────────────────────────
# Mnemon Makefile
# ──────────────────────────────────────────────────────────────────────

BINARY := mnemon
VERSION ?= dev
LDFLAGS := -s -w -X github.com/mnemon-dev/mnemon/cmd.version=$(VERSION)
HARNESS_LDFLAGS := -s -w -X main.version=$(VERSION)
GO_VERSION := $(shell awk '$$1 == "go" { print $$2; exit }' go.mod)
HARNESS_GO_VERSION := $(shell awk '$$1 == "go" { print $$2; exit }' harness/go.mod)
HARNESS_GO := env GOTOOLCHAIN=go$(HARNESS_GO_VERSION) GOFLAGS=-mod=readonly go -C harness
HARNESS_DETERMINISTIC_PKGS := \
./cmd/mnemon-harness \
./internal/agency \
./internal/attach \
./internal/authority \
./internal/cas \
./internal/selector \
./internal/selector/simtest \
./test/architecture \
./test/observer \
./test/r7/domainops/trace \
./test/r8/network/runner/trace
HARNESS_TESTDATA_PKGS := \
./internal/selector/testdata/network/cmd/r8-peer \
./testdata/r7/domain-ops/cmd/domain-load \
./testdata/r7/domain-ops/cmd/domain-world \
./testdata/r7/domain-ops/cmd/domainctl \
./testdata/r7/domain-ops/world
GOBIN := $(shell go env GOBIN)
# Mnemon build and verification entry points.

VERSION ?= dev
GOBIN := $(shell go env GOBIN)
ifeq ($(GOBIN),)
GOBIN := $(shell go env GOPATH)/bin
GOBIN := $(shell go env GOPATH)/bin
endif

.PHONY: deps build harness-build install uninstall test test-integration test-live
BIN_DIR := bin
MNEMON := $(BIN_DIR)/mnemon
MNEMON_LDFLAGS := -s -w -X github.com/mnemon-dev/mnemon/cmd.version=$(VERSION)

# Regular CI deliberately excludes real daemon readiness, process, TCP, Docker,
# JavaScript runtime, and paid-provider tests. Those belong to the explicit
# integration and live tiers below.
DETERMINISTIC_PKGS := \
. \
./cmd \
./cmd/agency \
./cmd/memory \
./internal/agency \
./internal/agencyclient \
./internal/attach \
./internal/authority \
./internal/artifact \
./internal/embed \
./internal/graph \
./internal/importdraft \
./internal/model \
./internal/search \
./internal/setup \
./internal/setup/assets \
./internal/store \
./test/mnemond/architecture \
./test/mnemond/observer \
./test/mnemond/domainops/trace

TESTDATA_PKGS := \
./testdata/mnemond/domainops/cmd/domain-load \
./testdata/mnemond/domainops/cmd/domain-world \
./testdata/mnemond/domainops/cmd/domainctl \
./testdata/mnemond/domainops/world

.PHONY: deps build install uninstall test test-integration test-live
.PHONY: docker-build docker-run compose-up compose-down compose-dev release-snapshot clean help

.DEFAULT_GOAL := help

# ── Build ────────────────────────────────────────────────────────────

deps: ## Download Go dependencies
go mod download
$(HARNESS_GO) mod download

build: ## Build the mnemon binary
go build -ldflags "$(LDFLAGS)" -o $(BINARY) .

harness-build: ## Build the experimental R7 Harness binaries
$(HARNESS_GO) build -ldflags "$(HARNESS_LDFLAGS)" -o ../mnemon-harness ./cmd/mnemon-harness
$(HARNESS_GO) build -ldflags "$(HARNESS_LDFLAGS)" -o ../mnemond ./cmd/mnemond
build: ## Build the mnemon product binary
@mkdir -p $(BIN_DIR)
go build -ldflags "$(MNEMON_LDFLAGS)" -o $(MNEMON) .

# ── Install / Uninstall ─────────────────────────────────────────────

install: build ## Build and install mnemon to $GOBIN
install: build ## Install mnemon to GOBIN
@mkdir -p $(GOBIN)
cp $(BINARY) $(GOBIN)/$(BINARY)
@echo "Installed: $(GOBIN)/$(BINARY)"

uninstall: ## Remove mnemon binary from $GOBIN
rm -f $(GOBIN)/$(BINARY)
@echo "Removed: $(GOBIN)/$(BINARY)"
@echo "Run 'mnemon setup --eject' first to remove integrations."
cp $(MNEMON) $(GOBIN)/mnemon
@echo "Installed: $(GOBIN)/mnemon"

# ── Test ─────────────────────────────────────────────────────────────
uninstall: ## Remove mnemon from GOBIN
rm -f $(GOBIN)/mnemon
@echo "Removed: $(GOBIN)/mnemon"
@echo "Run 'mnemon setup --eject' first to remove Memory integrations."

test: ## Run deterministic tests without E2E, real daemon, or provider calls
test: ## Run the deterministic CI suite
go vet ./...
go test ./...
$(HARNESS_GO) vet ./... $(HARNESS_TESTDATA_PKGS)
$(HARNESS_GO) test $(HARNESS_DETERMINISTIC_PKGS) -count=1
go test $(DETERMINISTIC_PKGS) -count=1

test-integration: ## Run opt-in E2E, timing, race, process, and Docker tests
test-integration: ## Run opt-in E2E, process, network, race, runtime, and Docker tests
bash scripts/e2e_test.sh
$(HARNESS_GO) test -p 1 ./... $(HARNESS_TESTDATA_PKGS) -count=1
$(HARNESS_GO) test -race -p 1 ./internal/... $(HARNESS_TESTDATA_PKGS) -count=1
harness/test/r7/runner/run_cases.sh
harness/test/r7/runtime/pi/run_delegate_oracle.sh
harness/test/r7/domainops/run_world.sh
harness/test/r8/network/runner/run_docker.sh
go test -p 1 ./... $(TESTDATA_PKGS) -count=1
go test -race -p 1 ./internal/... ./cmd/agency $(TESTDATA_PKGS) -count=1
test/mnemond/scenarios/run_cases.sh
test/mnemond/runtime/pi/run_delegate_oracle.sh
test/mnemond/domainops/run_world.sh

test-live: ## Run the paid Pi/DeepSeek smoke and federated operations case
@test -n "$${DEEPSEEK_API_KEY:-}" || { echo "error: DEEPSEEK_API_KEY is required" >&2; exit 2; }
LIVE_PI=1 harness/test/r7/runner/run_live_pi.sh
LIVE_DOMAIN_OPS=1 harness/test/r7/domainops/run_live.sh
LIVE_PI=1 test/mnemond/scenarios/run_live_pi.sh
LIVE_DOMAIN_OPS=1 test/mnemond/domainops/run_live.sh

# ── Containers / Deployment ──────────────────────────────────────────

docker-build: ## Build runtime Docker image
docker-build: ## Build the runtime Docker image
docker build --target runtime --build-arg VERSION=$(VERSION) -t mnemon-dev/mnemon:$(VERSION) .

docker-run: ## Run mnemon status in Docker with local .env
docker run --rm --env-file .env -v mnemon-data:/data mnemon-dev/mnemon:$(VERSION) status
docker run --rm --env-file .env -v mnemon-data:/mnemon mnemon-dev/mnemon:$(VERSION) status

compose-up: ## Start mnemon with Docker Compose
compose-up: ## Start the Mnemon container
docker compose up -d mnemon

compose-down: ## Stop Docker Compose services
Expand All @@ -104,14 +98,11 @@ compose-dev: ## Open a development shell in Docker Compose
release-snapshot: ## Build local GoReleaser snapshot artifacts
goreleaser release --snapshot --clean

# ── Clean ────────────────────────────────────────────────────────────

clean: ## Remove build artifacts and test data
rm -f $(BINARY) mnemon-harness mnemond
rm -f mnemon
rm -f $(BIN_DIR)/mnemon
rm -rf .testdata

# ── Help ─────────────────────────────────────────────────────────────

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
Loading
Loading