Skip to content

Commit b17d511

Browse files
authored
feat: implement Codencer v2 local self-host path (#2)
* feat: implement Codencer v2 local self-host path Implement the full v2 local/self-host bridge path in this session: - harden the local daemon with explicit repo-root targeting, stable instance identity, manifest-backed discovery, truthful runtime compatibility reporting, artifact content retrieval, run reconciliation, and gate lifecycle closure - add the outbound connector with persistent Ed25519 identity, enrollment, signed challenge/response session auth, reconnect/heartbeat behavior, explicit instance sharing, and a narrow allowlisted proxy to the local daemon - add the self-host relay with sqlite-backed connector/enrollment state, planner auth scopes, connector session tracking, planner-facing /api/v2 routes, audit persistence, and resource routing hints - add the relay MCP surface with codencer.* tools on /mcp, keeping /mcp/call as a compatibility path while preserving relay auth and instance scoping - rewrite operator-facing architecture, security, connector, relay, self-host, and MCP docs to match current runtime truth, add WSL/Windows/Antigravity topology guidance, and record the v2 work in the changelog Verification performed: - go test ./internal/app ./internal/service ./internal/connector ./internal/relay ./internal/mcp -count=1 - go test ./... -count=1 Known alpha limitations remain explicit in docs: best-effort abort, opportunistic relay routing for previously unseen resource IDs, bounded artifact transport, and static self-host auth. * chore: clean and harden Codencer v2 alpha surfaces Remove tracked local build output and collapse duplicate public command entrypoints by deleting the legacy connector and relayd mains and keeping codencer-connectord and codencer-relayd as the canonical binaries. Update build ignores and the Makefile so local command artifacts are not recommitted and duplicate bin targets are not produced. Tighten daemon async dispatch and abort handling by moving background step submission onto RunService.DispatchStepAsync, reusing that path for retry dispatch, and making abort report success only when the active step actually reaches cancelled. Fail closed when no execution was registered or when adapter cancellation is not confirmed, and cover the immediate-abort race with focused service tests. Clarify MCP hierarchy and public surfaces by marking the daemon-local /mcp/call endpoint as a legacy local compatibility/admin bridge, keeping the relay MCP as the canonical remote integration surface, and adding explicit surface headers to distinguish the two. Bring runtime truth and docs back into alignment across README, relay, connector, self-host, MCP, and v2 contract notes so the repo now documents the actual alpha-grade guarantees and limitations: no raw shell, no arbitrary filesystem browsing, narrow remote routing, best-effort abort, bounded artifact transport, and static self-host auth. Verification: gofmt -w on touched Go files; go test ./internal/service ./internal/app ./internal/relay ./internal/connector ./internal/mcp -count=1; go test ./... -count=1 * chore: finalize alpha cleanup and repo truth pass Remove committed extension dependency and build artifacts by deleting extension/node_modules and extension/out while keeping the extension manifests and source. Unify repo version/status truth on v0.2.0-alpha across the Makefile, runtime version string, public docs, validation scenario assets, and extension metadata. Tighten publication-facing wording so relay MCP remains the canonical remote surface, daemon-local MCP stays clearly local compatibility/admin only, and adapter/readiness claims defer to runtime compatibility instead of stale static support labels. Harden local runtime behavior with nanosecond attempt IDs, safer worktree reclamation for reused run branches, and clearer abort error wording when cancellation cannot be confirmed. Fix and stabilize service tests by isolating validation worktree tests from the real checkout and correcting the success provenance adapter so it reports completion instead of hanging the suite. Verification: go test ./internal/app ./internal/connector ./internal/relay ./internal/mcp -count=1; go test ./internal/service -count=1; go test ./... -count=1 * feat: complete Codencer v2 self-host alpha path Finalize the current v2 implementation for practical daily self-use without changing the core bridge-not-brain architecture. Daemon hardening: - fail closed for aborts against paused_for_gate runs and only report success when the active step really reaches cancelled - tighten restart recovery to restore evidence-backed terminal/gated states and move ambiguous active work to needs_manual_attention - add local read routes for gate metadata and artifact metadata by id - make log and artifact selection deterministic across multiple attempts - remove repo-root fallback/path leaks and harden worktree cleanup on provisioning and adapter start failures Connector completion: - add persisted local connector status snapshots with session state, heartbeat/error fields, and shared instance ids - add codencer-connectord status --json for offline operator inspection - keep explicit sharing only and extend the allowlist narrowly for safe relay route probing of artifact and gate metadata Relay completion: - add relay admin/status endpoints for status, connectors, and recent audit - resolve step/artifact/gate routes deterministically by probing only authorized online shared instances when route hints are missing - persist discovered route hints and keep ambiguous or offline lookups fail-closed Relay MCP and operator flow: - update relay MCP resource tools to use deterministic routing without requiring prior observation of resource ids - add a practical self-host smoke script and broker build target - sync README and operator docs to the current alpha-grade runtime truth, including canonical binaries, relay MCP hierarchy, bootstrap-only enrollment_secret wording, and honest abort/auth limitations Verification performed: - go test ./internal/app ./internal/service ./internal/storage/sqlite -count=1 - go test ./internal/connector ./internal/relay ./internal/mcp ./cmd/codencer-connectord -count=1 - go test ./... -count=1 - go build ./cmd/orchestratord ./cmd/orchestratorctl ./cmd/codencer-connectord ./cmd/codencer-relayd - (cd cmd/broker && go build ./...) - make build - live self-host smoke path against local daemon + relay + connector * Finish practical v2 self-host path * Finish practical v2 delta hardening * Add cloud control plane alpha foundation * Deepen cloud runtime control plane * Harden cloud control plane alpha * Finalize beta tracks and confirm v0.2.0-beta This commit lands the full beta-finalization program for the current Codencer repository and promotes the repo-wide release truth from v0.2.0-alpha to v0.2.0-beta. It includes the completed work across the frozen beta workstreams: - cloud self-host finalization - close tenant-scope and token-revocation gaps - harden cloud runtime HTTP and cloud MCP parity - strengthen composed cloud runtime, MCP, and SDK proof - relay/runtime connector finalization - fix share --instance-id so shared state cannot drift into unroutable fake-shared entries - harden connector re-advertise and stale session pruning - keep relay HTTP and relay MCP scoped and behaviorally aligned - local core finalization - fix the local same-run wait/finalization race - stabilize retry/result lifecycle truth - make legacy v1/local parity smoke repeatable - planner/client integration finalization - freeze the public compatibility matrix to proven vs expected vs compatibility-only claims - package relay/cloud MCP guidance and client examples - provider connector finalization - preserve repeated webhook history as append-only event storage - enforce Jira webhook deferment truthfully - enrich provider action and audit logs - release engineering and public testability - add explicit repo-level verification entrypoints - improve public tester routing and self-host documentation - keep deployment packaging and Docker compose proof aligned with repo truth - final beta confirmation - rerun the frozen verification matrix - rerun Docker-backed cloud stack proof on a live Docker daemon host - add the durable beta confirmation report - update public and internal release surfaces to v0.2.0-beta Public truth after this commit: - Codencer is beta for the supported local, self-host relay/runtime, self-host cloud, planner/client, and provider tracks - compatibility-only and deferred surfaces remain explicitly outside the beta promise - non-blocking linker warning noise remains documented but does not block the beta claim Verification performed: - make build-supported - make verify-beta - make cloud-stack-smoke - detached temporary worktree overlay: make build-supported && make verify-beta - make verify-beta-docker * Preserve beta confirmation docs for merge * Finalize beta launch docs, walkthroughs, and public CI Rewrite the README around the durable execution record and planner-to-executor bridge while preserving the v0.2.0-beta status block, quickstart commands, and beta track table. Restructure setup docs into a platform hub, add dedicated macOS, Windows, WSL, and remote VPS walkthroughs, and consolidate scattered limits into docs/KNOWN_LIMITATIONS.md. Add planner-side MCP walkthroughs for ChatGPT, Claude Desktop/claude.ai, and Gemini CLI plus minimal example JSON files, keeping ChatGPT and Claude compatibility-only and Gemini expected-only. Add operator-facing v0.2.0-beta release notes and cross-platform public-testability workflows for macOS and Windows, with Windows scoped truthfully to agent-broker build coverage while BG-011 remains a known secondary-surface test failure.
1 parent 598bc78 commit b17d511

402 files changed

Lines changed: 39507 additions & 506527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Public Testability (macOS)
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
verify-macos:
12+
runs-on: macos-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
23+
- name: Cache Go build and module directories
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/go/pkg/mod
28+
~/Library/Caches/go-build
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
33+
- name: Install macOS verification prerequisites
34+
run: |
35+
brew update
36+
brew install jq docker docker-compose
37+
mkdir -p ~/.docker/cli-plugins
38+
ln -sf "$(brew --prefix docker-compose)/bin/docker-compose" ~/.docker/cli-plugins/docker-compose
39+
docker compose version
40+
41+
- name: Build supported beta-track binaries
42+
run: make build-supported
43+
44+
- name: Run supported public verification
45+
run: make verify-beta
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Public Testability (Windows)
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
verify-windows-broker:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
23+
- name: Cache Go build and module directories
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/go/pkg/mod
28+
~/AppData/Local/go-build
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
33+
- name: Install GNU Make
34+
shell: pwsh
35+
run: choco install make -y
36+
37+
- name: Verify make availability
38+
shell: bash
39+
run: make --version
40+
41+
- name: Build Windows agent-broker only
42+
shell: bash
43+
run: make build-broker
44+
45+
- name: Run nested broker tests (BG-011 still secondary and allowed to fail)
46+
id: broker_tests
47+
continue-on-error: true
48+
shell: bash
49+
working-directory: cmd/broker
50+
run: go test ./...
51+
52+
- name: Report nested broker test status
53+
if: always()
54+
shell: bash
55+
run: |
56+
if [ "${{ steps.broker_tests.outcome }}" = "success" ]; then
57+
echo "Nested cmd/broker tests passed in this run."
58+
else
59+
echo "BG-011 remains open: nested cmd/broker tests still fail, so the workflow only enforces the documented Windows claim that agent-broker builds on windows-latest."
60+
fi
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Public Testability
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
verify:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
23+
- name: Install CGO build prerequisites
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y --no-install-recommends build-essential
27+
28+
- name: Build supported beta-track binaries
29+
run: make build-supported
30+
31+
- name: Run supported public verification
32+
run: ./scripts/verify_beta.sh

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# Build artifacts
22
bin/
3+
node_modules/
4+
extension/out/
35
orchestratorctl
46
!cmd/orchestratorctl/
57
!cmd/orchestratorctl/*.go
8+
/cmd/broker/agent-broker
9+
/cmd/broker/agent-broker.exe
10+
/cmd/codencer-connectord/codencer-connectord
11+
/cmd/codencer-connectord/codencer-connectord.exe
12+
/cmd/codencer-relayd/codencer-relayd
13+
/cmd/codencer-relayd/codencer-relayd.exe
14+
/cmd/orchestratord/orchestratord
15+
/cmd/orchestratord/orchestratord.exe
16+
/cmd/orchestratorctl/orchestratorctl
17+
/cmd/orchestratorctl/orchestratorctl.exe
618
*.test
719
*.out
820
service.test

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ You are a principal engineer implementing a production-oriented local orchestrat
99

1010
## General rules
1111
- follow the docs strictly
12+
- treat current code, tests, and smoke results as release truth when historical docs disagree
1213
- implement one phase at a time
1314
- do not widen scope
14-
- do not add cloud
15+
- do not add new cloud product scope; existing self-host cloud control-plane code is in scope for truthful maintenance
1516
- do not skip tests
1617
- do not skip docs when behavior changes
1718
- do not bypass service boundaries

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.0-beta] - 2026-04-23
11+
1012
### Added
13+
- Self-hostable v2 relay path with:
14+
- stable daemon instance identity and manifest-backed discovery
15+
- outbound authenticated connector sessions with explicit shared-instance allowlists
16+
- self-host relay planner API, enrollment token flow, audit persistence, and relay-side MCP tools
17+
- Cloud control-plane self-host surface with `codencer-cloudd`, `codencer-cloudctl`, and `codencer-cloudworkerd`, plus bootstrap/status/org/workspace/project/token/install/event/audit flows.
18+
- Cloud installation enable/disable routes and matching `cloudctl install enable|disable` subcommands.
19+
- Truthful cloud docs and smoke guidance for the bootstrap and control-plane path.
1120
- **OpenClaw (acpx) Adapter**: 🧪 Experimental support for OpenClaw-compatible executors via the standardized ACP bridge.
1221
- Official sequential wrapper examples for bash/zsh, PowerShell, and Python under `examples/automation/`.
1322
- Wrapper-friendly sample task lists and prompt/task inputs for ordered execution.
1423
- New `scripts/smoke_test_v1.sh` for verifying all 6 primary submission modes.
24+
- Public beta tester guide in `docs/BETA_TESTING.md` with exact local, relay, cloud, planner/client, and provider test-track entrypoints.
25+
- `make build-supported`, `make verify-beta`, and `make verify-beta-docker` as explicit repo-level verification entrypoints for the supported tracks.
26+
- Planner-client walkthroughs for ChatGPT, Claude Desktop plus `claude.ai`, and Gemini CLI under `docs/mcp/integrations/`.
27+
- Per-platform setup walkthroughs for macOS, Windows plus `agent-broker`, WSL, and remote VPS dev-server layouts.
28+
- Consolidated operator boundary reference in `docs/KNOWN_LIMITATIONS.md`.
29+
- Operator-facing beta launch notes in `docs/RELEASE_NOTES_v0.2.0-beta.md`.
30+
- Cross-platform public-testability CI on `macos-latest` and `windows-latest`.
1531

1632
### Changed
17-
- **Unified v1 Documentation Truth-Pass**: Cleaned and synchronized all public-facing docs (README, AI Guide, Runbook, Automation) for 100% alignment with the CLI contract.
33+
- Adopted `v0.2.0-beta` as the truthful build/version string for the current v2 local/self-host beta repo state.
34+
- Rewrote operator-facing v2 docs to match the implemented local/self-host path and current runtime truth.
35+
- Clarified that the relay is the public remote HTTP/MCP surface and the daemon-local `/mcp/call` endpoint is only a local compatibility/admin surface.
36+
- Documented current self-host beta boundaries explicitly: best-effort abort, bounded artifact transport, static-token auth, and relay routing that now probes only authorized online shared instances before failing closed.
37+
- Removed duplicate public connector/relay binary surfaces in favor of the canonical `codencer-connectord` and `codencer-relayd` entrypoints.
38+
- Tightened abort reporting so Codencer only reports success when the active step really reaches `cancelled`.
39+
- Removed committed extension dependency/build output directories and kept only the extension manifests plus source.
40+
- Added relay admin/status routes, connector local status snapshots, and a practical self-host smoke flow for daily operator use.
41+
- **Unified Documentation Truth-Pass**: Cleaned and synchronized current public-facing docs (README, AI Guide, Runbook, Automation) for alignment with the implemented CLI and relay surfaces.
1842
- Expanded automation documentation to make the shell-planner story explicit and machine-oriented.
1943
- Clarified that ordered task execution in v1 is wrapper-based and not a native workflow engine.
2044
- Hardened smoke/example guidance around strict JSON parsing and machine-safe CLI usage.
45+
- Clarified the public test-track boundaries so local, relay/runtime, cloud, planner/client, and provider testing route to the right docs without mixing surfaces.
46+
- Parameterized the Docker cloud image build version through the compose environment instead of hardcoding it only inside the Dockerfile.
2147

2248
## [0.1.0-beta] - 2026-03-28
2349

@@ -49,3 +75,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4975
---
5076

5177
[0.1.0-beta]: https://github.com/lookmanrays/codencer/releases/tag/v0.1.0-beta
78+
[0.2.0-beta]: https://github.com/lookmanrays/codencer/releases/tag/v0.2.0-beta

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to Codencer
22

3-
Thank you for your interest in contributing to Codencer! As a **Public Beta (v0.1.0-beta)** project, we are actively looking for feedback on our orchestration protocols, CLI ergonomics, and adapter reliability.
3+
Thank you for your interest in contributing to Codencer! As an **open-source beta (`v0.2.0-beta`)** project, we are actively looking for feedback on the current local/self-host execution path, CLI ergonomics, and adapter reliability.
44

55
## 🏛 The Relay Philosophy
66
Before contributing, please remember that Codencer is a **Defensive Relay**, not a "Brain." We prioritize:

Makefile

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
1+
VERSION ?= v0.2.0-beta
2+
LDFLAGS := -X agent-bridge/internal/app.Version=$(VERSION)
3+
14
all: lint test build
25

6+
build-supported: build build-cloud build-mcp-sdk-smoke
7+
38
build:
9+
@mkdir -p bin
410
@echo "==> Building orchestratord..."
5-
@go build -ldflags "-X agent-bridge/internal/app.Version=v1.0-release-candidate" -o bin/orchestratord ./cmd/orchestratord
11+
@go build -ldflags "$(LDFLAGS)" -o bin/orchestratord ./cmd/orchestratord
612
@echo "==> Building orchestratorctl..."
7-
@go build -ldflags "-X agent-bridge/internal/app.Version=v1.0-release-candidate" -o bin/orchestratorctl ./cmd/orchestratorctl
13+
@go build -ldflags "$(LDFLAGS)" -o bin/orchestratorctl ./cmd/orchestratorctl
14+
@echo "==> Building codencer-connectord..."
15+
@go build -ldflags "$(LDFLAGS)" -o bin/codencer-connectord ./cmd/codencer-connectord
16+
@echo "==> Building codencer-relayd..."
17+
@go build -ldflags "$(LDFLAGS)" -o bin/codencer-relayd ./cmd/codencer-relayd
18+
19+
build-cloud:
20+
@mkdir -p bin
21+
@echo "==> Building codencer-cloudctl..."
22+
@go build -ldflags "$(LDFLAGS)" -o bin/codencer-cloudctl ./cmd/codencer-cloudctl
23+
@echo "==> Building codencer-cloudd..."
24+
@go build -ldflags "$(LDFLAGS)" -o bin/codencer-cloudd ./cmd/codencer-cloudd
25+
@echo "==> Building codencer-cloudworkerd..."
26+
@go build -ldflags "$(LDFLAGS)" -o bin/codencer-cloudworkerd ./cmd/codencer-cloudworkerd
27+
28+
build-broker:
29+
@mkdir -p bin
30+
@echo "==> Building agent-broker (nested module)..."
31+
@cd cmd/broker && go build -o ../../bin/agent-broker ./...
32+
33+
build-mcp-sdk-smoke:
34+
@mkdir -p bin
35+
@echo "==> Building mcp-sdk-smoke (official MCP SDK proof helper)..."
36+
@go build -o bin/mcp-sdk-smoke ./cmd/mcp-sdk-smoke
837

938
test:
1039
@echo "==> Running tests..."
@@ -116,6 +145,38 @@ smoke: build
116145
@echo "==> Running automated smoke test..."
117146
@./scripts/smoke_test.sh
118147

148+
self-host-smoke: build
149+
@echo "==> Running self-host relay/connector smoke test..."
150+
@./scripts/self_host_smoke.sh
151+
152+
self-host-smoke-all: build build-mcp-sdk-smoke
153+
@echo "==> Running self-host relay/connector smoke test with all optional scenarios..."
154+
@SMOKE_SCENARIOS=all ./scripts/self_host_smoke.sh
155+
156+
self-host-smoke-mcp: build build-mcp-sdk-smoke
157+
@echo "==> Running self-host relay/connector smoke test with MCP coverage..."
158+
@SMOKE_SCENARIOS=status,audit,mcp,mcp-sdk ./scripts/self_host_smoke.sh
159+
160+
cloud-smoke: build-cloud
161+
@echo "==> Running cloud control-plane smoke test..."
162+
@./scripts/cloud_smoke.sh
163+
164+
cloud-stack-config:
165+
@ENV_FILE=deploy/cloud/.env; \
166+
if [ ! -f "$$ENV_FILE" ]; then ENV_FILE=deploy/cloud/.env.example; fi; \
167+
echo "==> Validating docker compose cloud stack with $$ENV_FILE..."; \
168+
docker compose --env-file "$$ENV_FILE" -f deploy/cloud/docker-compose.yml config > /dev/null
169+
170+
cloud-stack-smoke:
171+
@echo "==> Running docker-compose cloud stack smoke test..."
172+
@./deploy/cloud/smoke.sh
173+
174+
verify-beta: build-supported
175+
@./scripts/verify_beta.sh
176+
177+
verify-beta-docker: build-supported
178+
@./scripts/verify_beta.sh --docker
179+
119180
validate: build
120181
@echo "==> Running Codex validation scenario (Internal Version Bump)..."
121182
@./bin/orchestratorctl run start validation-run-01 validation-project || true

0 commit comments

Comments
 (0)