Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc378484c9 |
@@ -1 +0,0 @@
|
||||
ci-auth-test-1778443313
|
||||
@@ -1 +0,0 @@
|
||||
ci-auth-test2-1778443456
|
||||
@@ -1 +0,0 @@
|
||||
verify-fix-1778444420
|
||||
@@ -4,7 +4,7 @@ Go CLI for the Molecule AI agent platform. Wraps the platform's workspace runtim
|
||||
|
||||
**Users:** Platform operators and developers integrating with the Molecule AI platform.
|
||||
|
||||
**Repo state:** Core commands implemented. 32 integration tests in `cmd/molecule/molecule_test.go`.
|
||||
**Repo state (2026-04-16):** Thin/stub. Go module is initialized; core CLI commands are not yet implemented. CI (Go binary release via GoReleaser + GitHub Actions) is wired up.
|
||||
|
||||
---
|
||||
|
||||
@@ -23,13 +23,15 @@ This CLI is the primary user-facing tool for interacting with the Molecule AI pl
|
||||
# Build the binary to ./bin/molecule (or $GOBIN/molecule)
|
||||
go build -o bin/molecule ./cmd/molecule
|
||||
|
||||
# Run tests — uses httptest.Server fixtures, no live platform required
|
||||
# Run tests (none yet; add as commands are implemented)
|
||||
go test ./...
|
||||
|
||||
# Run the CLI locally (requires platform env vars — see Section 5)
|
||||
./bin/molecule --help
|
||||
```
|
||||
|
||||
There is no `main.go` or `cmd/molecule/main.go` yet. Creating it is the first implementation task. The module path will be auto-detected from `go.mod`.
|
||||
|
||||
## 3. Go Module Conventions
|
||||
|
||||
**Module path:** `go.moleculesai.app/cli` (from `go.mod`)
|
||||
@@ -129,8 +131,8 @@ See `known-issues.md` at the repo root for the full tracked list.
|
||||
- [x] Control plane API client (initialized with `MOLECULE_API_URL`)
|
||||
- [ ] Workspace runtime client (for dev/proxy mode)
|
||||
- [ ] Configuration file (e.g., `~/.config/molecule/cli.yaml`) — workspace template per platform rules
|
||||
- [x] Unit tests for core command logic (32 integration tests)
|
||||
- [x] `molecule init` (bootstrap local workspace config)
|
||||
- [ ] Unit tests for core command logic
|
||||
- [ ] `molecule init` (bootstrap local workspace config)
|
||||
|
||||
**Platform constraint reminders (from `constraints-and-rules.md`):**
|
||||
- Postgres is the source of truth. CLI commands that mutate state ultimately write to Postgres via the control plane.
|
||||
|
||||
+17
-22
@@ -130,29 +130,24 @@ is set to `.` (repo root) since the main package is at `cmd/molecule`.
|
||||
|
||||
## KI-005 — No integration test for the full CLI lifecycle
|
||||
|
||||
**File:** `cmd/molecule/molecule_test.go`, `internal/`
|
||||
**Status:** ✅ Resolved
|
||||
**File:** `tests/` (does not exist)
|
||||
**Status:** Not yet implemented
|
||||
**Severity:** Medium
|
||||
|
||||
### Resolution
|
||||
`cmd/molecule/molecule_test.go` contains 32 table-driven integration tests
|
||||
covering the full CLI command surface. Each test:
|
||||
- Starts a `httptest.Server` that mirrors the platform REST API (workspace CRUD,
|
||||
agent inspection, delegation, health, audit, config, completion scripts).
|
||||
- Builds the `molecule` binary via `go build -o <tempdir>/molecule .`
|
||||
- Executes it with `exec.Command` and validates stdout/stderr output.
|
||||
### Symptom
|
||||
There are no tests at all (per `go test ./...` — no packages match).
|
||||
As subcommands are built, there is no test harness for end-to-end CLI testing
|
||||
(e.g. `molecule workspace create --name test --output json` → verify JSON output).
|
||||
|
||||
Test coverage includes:
|
||||
- Root help, workspace/agent/platform/config help
|
||||
- `workspace list`, `workspace inspect`, `workspace create`, `workspace delete`,
|
||||
`workspace restart`, `workspace audit`, `workspace delegate`
|
||||
- `agent list`, `agent inspect`, `agent send`, `agent peers`
|
||||
- `platform health`, `platform audit`
|
||||
- `config init`, `config list`
|
||||
- `init`, `init --force`
|
||||
- `completion bash/zsh/fish/powershell`
|
||||
- Error paths: missing workspace, missing agent, unknown subcommand,
|
||||
missing required args, duplicate init
|
||||
### Impact
|
||||
Each subcommand will be shipped without regression protection. Manual testing
|
||||
is required for every release. The absence of a `tests/` directory also means
|
||||
there is no fixture for CLI integration testing with recorded API responses.
|
||||
|
||||
Run `go test ./...` from the repo root to execute. No live platform required —
|
||||
all tests use `httptest.Server` fixtures.
|
||||
### Suggested fix
|
||||
Add `tests/` with:
|
||||
- `cmd/molecule/molecule_test.go` — table-driven tests for each subcommand
|
||||
using `exec.Command("molecule", ...)` against a built binary
|
||||
- Use `molecule-sdk-python` fixture server or recorded API responses for
|
||||
offline testing
|
||||
- Add `go test ./...` to CI; require >0 test packages before merge
|
||||
|
||||
Reference in New Issue
Block a user