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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Link to issue or explain the motivation.

## Checklist

- [ ] Tests pass (`make test` and `go test ./...`)
- [ ] Deterministic tests pass (`make test`)
- [ ] Relevant E2E/process/Docker boundaries pass (`make test-integration`, when affected)
- [ ] New/changed behavior is covered by tests
- [ ] Documentation updated (USAGE.md, DESIGN.md, or README) if applicable
- [ ] User-facing release-note impact described in this PR, if applicable
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ concurrency:
jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
Expand All @@ -31,11 +32,5 @@ jobs:
go.sum
harness/go.sum

- name: Run unit tests
run: go test ./...

- name: Run E2E tests
- name: Run deterministic test suite
run: make test

- name: Check release and Harness boundary
run: make harness-validate
59 changes: 0 additions & 59 deletions .github/workflows/harness-deep.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Manual Integration

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: integration-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
harness/go.sum

- name: Run integration suite
run: make test-integration
36 changes: 36 additions & 0 deletions .github/workflows/live.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Live Agent Evaluation

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: live-agent-evaluation
cancel-in-progress: false

jobs:
live:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
harness/go.sum

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.19.0

- name: Run Pi and DeepSeek live evaluation
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
run: make test-live
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ jobs:
with:
go-version-file: go.mod

- name: Run unit tests
run: go test ./...

- name: Run E2E tests
- name: Run deterministic test suite
run: make test

release:
Expand Down
16 changes: 8 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
## Development

- Build with `go build -o mnemon .`.
- Run the E2E suite with `bash scripts/e2e_test.sh` or `make test`.
- Validate harness module manifests with `make harness-validate` when changing
harness module assets.
- Run `make harness-quality` for the pinned Harness quality ratchet and
`make harness-verify` for the complete local Harness build and test gate.
- 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-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/`.
Expand All @@ -25,9 +26,8 @@
- Keep authority, digest, fence, bounds, CAS cardinality, and fail-closed checks
explicit. Every goroutine must have an owner, cancellation, bounded work, and
a wait path.
- In a scope with a tracked engineering-quality baseline, new or modified code
must not increase it. Preserve independent test oracles while compressing
fixtures.
- Preserve independent replay, crash, authorization, and race oracles while
compressing fixtures and shared setup.

## Commit Discipline

Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- **Build**: `go build -o mnemon .`
- **Install**: `make install && mnemon setup`
- **Test**: `bash scripts/e2e_test.sh`
- **Test**: `make test`
- **Integration**: `make test-integration` for CLI E2E and Harness boundaries
- **Dependencies**: `modernc.org/sqlite`, `spf13/cobra`, `google/uuid`
- **Optional**: Ollama with `nomic-embed-text` for embedding support
20 changes: 9 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ make build
## Running Tests

```bash
make unit # Go unit tests (go test ./...)
make test # Full E2E test suite (scripts/e2e_test.sh)
make vet # Static analysis (go vet ./...)
make harness-quality # Pinned Harness format, static, architecture, and debt ratchets
make harness-verify # Harness binaries, declarations, quality, vet, and unit tests
make test # Required deterministic CI suite for both Go modules
make test-integration # Opt-in CLI E2E, timing, race, process, and Docker suite
make test-live # Explicit paid Pi/DeepSeek evaluation
```

Both `make unit` and `make test` must pass before submitting a PR. A change to
the experimental Harness must also pass `make harness-verify`.
`make test` must pass before submitting a PR. Run `make test-integration`
proportionally when changing CLI E2E behavior or Harness process, timing,
transport, or Docker boundaries; it is intentionally outside regular CI.

## Code Style

Expand All @@ -41,8 +40,7 @@ the experimental Harness must also pass `make harness-verify`.
- All exported functions and types must have doc comments
- Use `fmt.Errorf("context: %w", err)` for error wrapping

For architecture, concurrency, persistence, abstraction, test design, and the
incremental quality ratchet, follow the
For architecture, concurrency, persistence, abstraction, and test design, follow the
[Go Engineering Standard](docs/development/go-engineering-standard.md). Design
patterns and Go language features are tools for reducing change amplification,
not quotas or substitutes for explicit safety checks.
Expand All @@ -64,8 +62,8 @@ imperative form. The CHANGELOG filter excludes `docs:`, `test:`, `ci:`, and
## Submitting Changes

1. Fork the repository and create a feature branch from `master`.
2. Make your changes and run the gates that cover them, including
`make harness-verify` for Harness changes.
2. Make your changes and run the proportional test level, including
`make test-integration` for affected Harness 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 Down
71 changes: 33 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ 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)
ifeq ($(GOBIN),)
GOBIN := $(shell go env GOPATH)/bin
endif

.PHONY: deps build harness-build install uninstall test unit vet harness-validate harness-quality harness-verify
.PHONY: harness-live-pi
.PHONY: harness-r8 harness-r8-docker harness-domain-ops harness-domain-ops-live
.PHONY: deps build harness-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
Expand Down Expand Up @@ -48,46 +64,25 @@ uninstall: ## Remove mnemon binary from $GOBIN

# ── Test ─────────────────────────────────────────────────────────────

test: ## Run E2E test suite (the script builds the tested binary once)
bash scripts/e2e_test.sh

unit: ## Run Go unit tests
go test ./...

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

harness-validate: ## Validate the R7 projection, contract, and evidence bindings
$(HARNESS_GO) test ./internal/attach ./tools/corecontract ./test/contracts -count=1

harness-quality: ## Run pinned, non-mutating Harness quality gates
@base_ref="$${HARNESS_QUALITY_BASE_REF:-HEAD}"; \
$(HARNESS_GO) run ./tools/quality check --root .. --base-ref "$$base_ref"
$(HARNESS_GO) vet ./...
$(HARNESS_GO) test ./tools/quality -count=1

harness-live-pi: ## Run the opt-in Pi/DeepSeek live smoke
@test "$${LIVE_PI:-}" = 1 || { echo "error: set LIVE_PI=1" >&2; exit 2; }
@test -n "$${DEEPSEEK_API_KEY:-}" || { echo "error: DEEPSEEK_API_KEY is required" >&2; exit 2; }
harness/test/r7/runner/run_live_pi.sh

harness-r8: ## Test the optional, removable R8 selector and its proof adapters
$(HARNESS_GO) test ./internal/selector ./internal/selector/simtest ./internal/selector/testdata/network/cmd/r8-peer -count=1
$(HARNESS_GO) test -race ./internal/selector ./internal/selector/simtest ./internal/selector/testdata/network/cmd/r8-peer -count=1

harness-r8-docker: harness-r8 ## Run the isolated five-peer R8 network proof
harness/test/r8/network/runner/run_docker.sh

harness-domain-ops: ## Run the opt-in real-service federated operations world
test-integration: ## Run opt-in E2E, timing, race, process, 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

harness-domain-ops-live: ## Run the paid autonomous Pi/DeepSeek operations case
@test "$${LIVE_DOMAIN_OPS:-}" = 1 || { echo "error: set LIVE_DOMAIN_OPS=1" >&2; exit 2; }
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; }
harness/test/r7/domainops/run_live.sh

harness-verify: harness-quality ## Run the complete exact-tree R7 evidence gate and write its report
$(HARNESS_GO) run ./tools/corecontract/cmd/core-gate --root ..
LIVE_PI=1 harness/test/r7/runner/run_live_pi.sh
LIVE_DOMAIN_OPS=1 harness/test/r7/domainops/run_live.sh

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

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ Mnemon architecture.
```bash
make build # build binary
make install # build + install to $GOBIN
make test # run E2E test suite
make test # run deterministic CI tests
make test-integration # opt-in CLI E2E and Harness boundary tests
mnemon setup # interactive setup
mnemon setup --eject # remove all integrations
make help # show all targets
Expand All @@ -395,7 +396,7 @@ See [Development and Deployment](docs/DEPLOYMENT.md) for Docker, Compose, Ollama
## Documentation

- [Mnemon Harness Beta](harness/README.md) — experimental host-agent lifecycle state
- [Go Engineering Standard](docs/development/go-engineering-standard.md) — maintainability, concurrency, persistence, testing, and quality ratchets
- [Go Engineering Standard](docs/development/go-engineering-standard.md) — maintainability, concurrency, persistence, testing, and review thresholds
- [Design & Architecture](docs/DESIGN.md) — current engine architecture, algorithms, integration design
- [Usage & Reference](docs/USAGE.md) — CLI commands, embedding support, architecture overview
- [Memory Import Guide](docs/IMPORT.md) — schema and LLM prompt for importing historical chats
Expand Down
6 changes: 3 additions & 3 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Prerequisites:

- Go 1.24.6 or newer in the 1.24 series
- `make`
- `jq` for the E2E test script
- `jq` only when running the opt-in CLI E2E/integration suite

Common commands:

```bash
make deps
make build
make unit
make test
make test # deterministic CI suite
make test-integration # optional E2E/process/Docker suite
make install
```

Expand Down
Loading
Loading