Repository navigation
Integrate runtime hardening, code-intel refresh, and Go toolchain pin #272
Changes from all commits
873aaea
8ff94cf
ff2de22
ed817de
0f2535b
900d3df
2639b74
13fa734
3549929
51aca24
ea10cf7
e2af2eb
3810efd
210c6d1
205a7e1
97504e8
5a803de
e963686
fb811f2
f473cc7
0161a76
eb70e13
0ad2426
b254581
bd26b8a
fbac01f
be70dda
eb0d640
dd6a7ad
a017a6e
1f312fb
fb0a79d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ UV ?= uv | |
| PYTHON ?= python | ||
| GO ?= go | ||
| GOFMT ?= gofmt | ||
| GO_TOOLCHAIN ?= go1.26.8 | ||
| CARGO ?= cargo | ||
| GO_BUILD_FLAGS ?= -trimpath -buildvcs=false | ||
| GO_BUILD_CACHE_DIR ?= $(LOCAL_REPO_ROOT)/.coding-ethos/cache/go-build | ||
|
|
@@ -41,6 +42,7 @@ UV_CACHE_DIR ?= $(LOCAL_REPO_ROOT)/.coding-ethos/cache/uv | |
| export GOCACHE := $(GO_BUILD_CACHE_DIR) | ||
| export GOPATH := $(GO_PATH_DIR) | ||
| export GOMODCACHE := $(GO_MODULE_CACHE_DIR) | ||
| export GOTOOLCHAIN := $(GO_TOOLCHAIN) | ||
| export UV_CACHE_DIR | ||
|
|
||
| empty := | ||
|
|
@@ -109,9 +111,11 @@ GO_MODULE_ROOT_BINARY_OUTPUTS := \ | |
|
|
||
| GO_COVERAGE_MIN ?= 80.0 | ||
| PYTHON_COVERAGE_MIN ?= 80 | ||
| GO_TEST_TIMEOUT ?= 90s | ||
| GO_TEST_TIMEOUT ?= 3m | ||
| GO_COVERAGE_DIR ?= $(LOCAL_BUILD_DIR)/coverage | ||
| REPO ?= $(LOCAL_REPO_ROOT) | ||
| AGENT_HOOK_STATE_ROOT ?= $(LOCAL_BUILD_DIR)/agent-hooks-state | ||
| CONSUMER_AGENT_HOOK_STATE_ROOT ?= $(LOCAL_BUILD_DIR)/consumer-agent-hooks-state | ||
| PRIMARY ?= $(LOCAL_REPO_ROOT)/coding_ethos.yml | ||
| REPO_ETHOS ?= | ||
| REPO_CONFIG ?= | ||
|
|
@@ -198,15 +202,6 @@ define print_kv | |
| printf ' $(COLOR_ACCENT)%-24s$(COLOR_RESET) %s\n' "$(1)" "$(2)" | ||
| endef | ||
|
|
||
| define quiet_build | ||
| tmp="$$(mktemp)"; \ | ||
| trap 'rm -f "$$tmp"' EXIT; \ | ||
| if ! $(MAKE) --no-print-directory build >"$$tmp" 2>&1; then \ | ||
| cat "$$tmp" >&2; \ | ||
| exit 1; \ | ||
| fi | ||
| endef | ||
|
|
||
| .PHONY: \ | ||
| help \ | ||
| status \ | ||
|
|
@@ -373,6 +368,13 @@ ensure-hook-runtime: ## Verify managed hook runtime artifacts already exist with | |
| printf '$(COLOR_WARN)Run `make build` explicitly before tests or diagnostics.$(COLOR_RESET)\n' >&2; \ | ||
| exit 2; \ | ||
| } | ||
| @for tool in coding-ethos-agent-hooks coding-ethos-policy; do \ | ||
| test -x "$(GO_TOOLS_BIN_DIR)/$$tool" || { \ | ||
| printf '$(COLOR_WARN)Managed tool is missing: $(GO_TOOLS_BIN_DIR)/%s.$(COLOR_RESET)\n' "$$tool" >&2; \ | ||
| printf '$(COLOR_WARN)Run `make build` explicitly before tests or diagnostics.$(COLOR_RESET)\n' >&2; \ | ||
| exit 2; \ | ||
| }; \ | ||
| done | ||
| @test -s "$(POLICY_DIR)/policy-bundle.json" || { \ | ||
| printf '$(COLOR_WARN)Compiled policy bundle is missing: $(POLICY_DIR)/policy-bundle.json.$(COLOR_RESET)\n' >&2; \ | ||
| printf '$(COLOR_WARN)Run `make build` explicitly before tests or diagnostics.$(COLOR_RESET)\n' >&2; \ | ||
|
|
@@ -396,16 +398,13 @@ install-runtime: ensure-uv ## Sync only the runtime dependencies. | |
| @$(MAKE) sync-tool-configs | ||
| @$(MAKE) sync-gemini-prompts | ||
|
|
||
| parent-install: ensure-go ## Sync parent repo coding-ethos artifacts with TOON output. | ||
| @$(quiet_build) | ||
| parent-install: ensure-hook-runtime ## Sync parent repo coding-ethos artifacts with TOON output. | ||
| @"$(GO_HOOK)" parent-install --repo "$(HOOK_CONSUMER_ROOT)" | ||
|
|
||
| parent-check: ensure-go ## Verify parent repo coding-ethos artifacts with TOON output. | ||
| @$(quiet_build) | ||
| parent-check: ensure-hook-runtime ## Verify parent repo coding-ethos artifacts with TOON output. | ||
| @"$(GO_HOOK)" parent-check --repo "$(HOOK_CONSUMER_ROOT)" | ||
|
|
||
| parent-lint: ensure-go ## Sync and lint the parent repo with TOON output. | ||
| @$(quiet_build) | ||
| parent-lint: ensure-hook-runtime ## Sync and lint the parent repo with TOON output. | ||
| @"$(GO_HOOK)" parent-lint --repo "$(HOOK_CONSUMER_ROOT)" | ||
|
|
||
| upgrade: upgrade-parent-submodule build parent-install parent-check parent-lint cutover-verify ## Fully upgrade a parent repo coding-ethos submodule and verify the result. | ||
|
|
@@ -566,16 +565,22 @@ _sync-consumer-agent-skills: ensure-go | |
| _sync-agent-hooks: ensure-go go-tools-install | ||
| @$(call print_step,Syncing generated agent hook and MCP settings) | ||
| @$(call print_info,repo: $(REPO)) | ||
| @"$(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks" sync \ | ||
| @CODEX_HOME="$(AGENT_HOOK_STATE_ROOT)/codex-home" \ | ||
| "$(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks" sync \ | ||
| --root "$(REPO)" \ | ||
| --repo-root "$(REPO)" \ | ||
| --state-root "$(AGENT_HOOK_STATE_ROOT)" \ | ||
| --hook-command "$(GO_HOOK) agent-hook" | ||
|
|
||
| _sync-consumer-agent-hooks: ensure-go go-tools-install | ||
| @if [ "$(abspath $(HOOK_CONSUMER_ROOT))" != "$(abspath $(LOCAL_REPO_ROOT))" ]; then \ | ||
| $(call print_step,Syncing generated consumer agent hook and MCP settings); \ | ||
| $(call print_info,repo: $(HOOK_CONSUMER_ROOT)); \ | ||
| "$(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks" sync \ | ||
| CODEX_HOME="$(CONSUMER_AGENT_HOOK_STATE_ROOT)/codex-home" \ | ||
| "$(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks" sync \ | ||
| --root "$(HOOK_CONSUMER_ROOT)" \ | ||
| --repo-root "$(HOOK_CONSUMER_ROOT)" \ | ||
| --state-root "$(CONSUMER_AGENT_HOOK_STATE_ROOT)" \ | ||
| --hook-command "$(GO_HOOK) agent-hook"; \ | ||
| fi | ||
|
|
||
|
|
@@ -592,7 +597,7 @@ sync-provider-matrix: ensure-go go-tools-install ## Generate the provider capabi | |
| @"$(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks" \ | ||
| sync-provider-matrix --root "$(LOCAL_REPO_ROOT)" | ||
|
|
||
| check-provider-matrix: ensure-go go-tools-install ## Fail if the provider capability matrix is out of sync. | ||
| check-provider-matrix: ensure-hook-runtime ## Fail if the provider capability matrix is out of sync. | ||
| @$(call print_step,Checking provider capability matrix) | ||
| @$(call print_info,repo: $(LOCAL_REPO_ROOT)) | ||
| @"$(GO_TOOLS_BIN_DIR)/coding-ethos-agent-hooks" \ | ||
|
|
@@ -607,7 +612,10 @@ purrdf-extractor-check: ## Test the optional PurRDF code-intel extractor when pr | |
| exit 1; \ | ||
| }; \ | ||
| $(call print_step,Testing PurRDF code-intel extractor); \ | ||
| "$(CARGO)" test --locked --manifest-path "$(PURRDF_EXTRACTOR_MANIFEST)"; \ | ||
| "$(CARGO)" test --locked \ | ||
| --config 'build.build-dir="$(PURRDF_EXTRACTOR_DIR)/target"' \ | ||
| --target-dir "$(PURRDF_EXTRACTOR_DIR)/target" \ | ||
| --manifest-path "$(PURRDF_EXTRACTOR_MANIFEST)"; \ | ||
| else \ | ||
| $(call print_info,PurRDF extractor subtree not present in this checkout); \ | ||
| fi | ||
|
|
@@ -619,7 +627,10 @@ purrdf-extractor-install: ## Build and install the optional PurRDF extractor whe | |
| exit 1; \ | ||
| }; \ | ||
| $(call print_step,Building PurRDF code-intel extractor); \ | ||
| "$(CARGO)" build --locked --release --manifest-path "$(PURRDF_EXTRACTOR_MANIFEST)"; \ | ||
| "$(CARGO)" build --locked --release \ | ||
| --config 'build.build-dir="$(PURRDF_EXTRACTOR_DIR)/target"' \ | ||
| --target-dir "$(PURRDF_EXTRACTOR_DIR)/target" \ | ||
| --manifest-path "$(PURRDF_EXTRACTOR_MANIFEST)"; \ | ||
| mkdir -p "$(GO_TOOLS_BIN_DIR)"; \ | ||
| install -m 0755 \ | ||
| "$(PURRDF_EXTRACTOR_DIR)/target/release/$(PURRDF_EXTRACTOR_BINARY)" \ | ||
|
|
@@ -654,17 +665,15 @@ go-hook-runner-install: ensure-go ## Build the bundled Go hook runner into the c | |
|
|
||
| _sync-git-hooks: ensure-go go-tools-install _sync-parent-hook-runtime | ||
| @$(call print_step,Syncing Git hook entrypoints) | ||
| @$(call install_git_hooks,$(LOCAL_HOOKS_DIR),$(GO_HOOK)) | ||
| @$(call install_git_hooks,$(LOCAL_HOOKS_DIR),$(PARENT_HOOK_BIN_DIR)/coding-ethos-run) | ||
| @if [ "$(HOOKS_DIR)" != "$(LOCAL_HOOKS_DIR)" ]; then \ | ||
| $(call install_git_hooks,$(HOOKS_DIR),$(PARENT_HOOK_BIN_DIR)/coding-ethos-run); \ | ||
| fi | ||
|
|
||
| _sync-parent-hook-runtime: ensure-go go-tools-install policy-bundle-install | ||
| _sync-parent-hook-runtime: ensure-go go-tools-install go-hook-runner-install policy-bundle-install | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift Move the complete parent-runtime projection behind a compiled installer.
🧰 Tools🪛 checkmake (0.3.2)[warning] 673-673: Target body for "_sync-parent-hook-runtime" exceeds allowed length of 5 lines (27). (maxbodylength) 🤖 Prompt for AI Agents |
||
| @$(call print_step,Syncing parent hook runtime artifacts) | ||
| @mkdir -p "$(PARENT_HOOK_BIN_DIR)" "$(PARENT_POLICY_DIR)" | ||
| @cp "$(GO_TOOLS_BIN_DIR)"/coding-ethos-* "$(PARENT_HOOK_BIN_DIR)/" | ||
| @cp "$(GO_TOOLS_BIN_DIR)/cerun" "$(PARENT_HOOK_BIN_DIR)/cerun" | ||
| @cp "$(GO_TOOLS_BIN_DIR)/lint" "$(PARENT_HOOK_BIN_DIR)/lint" | ||
| @"$(GO_HOOK)" parent-runtime-sync --repo "$(HOOK_CONSUMER_ROOT)" | ||
| @mkdir -p "$(PARENT_POLICY_DIR)" | ||
| @"$(GO_TOOLS_BIN_DIR)/coding-ethos-policy" compile \ | ||
| --primary "$(LOCAL_REPO_ROOT)/coding_ethos.yml" \ | ||
| --repo-ethos "$(LOCAL_REPO_ROOT)/repo_ethos.yml" \ | ||
|
|
@@ -688,7 +697,6 @@ _sync-parent-hook-runtime: ensure-go go-tools-install policy-bundle-install | |
| --tools-bin-dir "$(PARENT_HOOK_BIN_DIR)" \ | ||
| --runner "$(PARENT_HOOK_BIN_DIR)/coding-ethos-run" \ | ||
| --ethos-root "$(LOCAL_REPO_ROOT)" | ||
| @cp "$(GO_TOOLS_BIN_DIR)/coding-ethos-git-hook" "$(PARENT_HOOK_RUNTIME_DIR)/coding-ethos-git-hook" | ||
| @$(call print_info,runtime: $(PARENT_HOOK_RUNTIME_DIR)) | ||
|
|
||
| policy-bundle-install: ensure-go go-tools-install managed-toolchain-install ## Compile the policy bundle into the checkout-local build directory. | ||
|
|
@@ -715,23 +723,23 @@ cutover-install: build ## Install Git and agent hooks, then verify cutover readi | |
| @$(call print_step,Installing and verifying repo-local hook cutover) | ||
| @"$(GO_HOOK)" cutover install | ||
|
|
||
| cutover-verify: build ## Verify Git and agent hook cutover readiness. | ||
| cutover-verify: ensure-hook-runtime ## Verify Git and agent hook cutover readiness. | ||
| @$(call print_step,Verifying repo-local hook cutover) | ||
| @"$(GO_HOOK)" cutover verify | ||
|
|
||
| pre-commit: build ## Run bundled pre-commit hooks on staged files. | ||
| pre-commit: ensure-hook-runtime ## Run bundled pre-commit hooks on staged files. | ||
| @$(call print_step,Running Go pre-commit hooks on staged files) | ||
| @"$(GO_HOOK)" git-hook pre-commit | ||
|
|
||
| pre-commit-all: build ## Run bundled pre-commit hooks on all files. | ||
| pre-commit-all: ensure-hook-runtime ## Run bundled pre-commit hooks on all files. | ||
| @$(call print_step,Running Go pre-commit hooks on all files) | ||
| @"$(GO_HOOK)" git-hook pre-commit --all-files | ||
|
|
||
| pre-push: build ## Run bundled pre-push hooks. | ||
| pre-push: ensure-hook-runtime ## Run bundled pre-push hooks. | ||
| @$(call print_step,Running Go pre-push hooks) | ||
| @"$(GO_HOOK)" git-hook pre-push | ||
|
|
||
| commit-msg: build ## Run commit-message hooks against MSG=/path/to/file. | ||
| commit-msg: ensure-hook-runtime ## Run commit-message hooks against MSG=/path/to/file. | ||
| ifndef MSG | ||
| @printf '$(COLOR_WARN)Usage: make commit-msg MSG=/path/to/commit-message-file$(COLOR_RESET)\n' >&2 | ||
| @exit 2 | ||
|
|
@@ -740,11 +748,11 @@ else | |
| @"$(GO_HOOK)" git-hook commit-msg "$(MSG)" | ||
| endif | ||
|
|
||
| hook-plan: build ## Print the active Go hook group plan. | ||
| hook-plan: ensure-hook-runtime ## Print the active Go hook group plan. | ||
| @$(call print_step,Printing Go hook group plan) | ||
| @"$(GO_HOOK)" hook-plan | ||
|
|
||
| validate: build ## Validate the bundled hook runtime. | ||
| validate: ensure-hook-runtime ## Validate the bundled hook runtime. | ||
| @$(call print_step,Validating bundled hook runtime) | ||
| @"$(GO_HOOK)" git-hook validate | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.