2026-08-30 22:38:54 +02:00
|
|
|
.PHONY: start install install-cli dashboard-install dashboard-check db db-tools migrate seed api dashboard dashboard-local sync check-primary primary-port-clear check check-local test test-python clean register-project register-codex-project register-mcp configure-codex bootstrap-env dev-hub edge-relay mcp-profile validate-adr add-domain rename-domain add-repo list-repos register-path register-from-classification register-from-classification-all cleanup-stale tunnels-up tunnels-status tunnels-check bridges install-hooks install-hooks-all gitea-inventory token-reconcile railiance-state-hub-render railiance-state-hub-client-dry-run railiance-state-hub-server-dry-run
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
|
|
|
|
COMPOSE = docker compose -f infra/docker-compose.yml --env-file .env
|
2026-05-23 13:59:05 +02:00
|
|
|
PYTHON ?= python3
|
2026-06-25 15:15:30 +02:00
|
|
|
HELM ?= $(shell command -v helm 2>/dev/null || if [ -x "$$HOME/.local/bin/helm" ]; then printf "%s" "$$HOME/.local/bin/helm"; else printf "%s" "helm"; fi)
|
|
|
|
|
KUBECTL ?= $(shell command -v kubectl 2>/dev/null || if [ -x "$$HOME/.local/bin/kubectl" ]; then printf "%s" "$$HOME/.local/bin/kubectl"; else printf "%s" "kubectl"; fi)
|
|
|
|
|
|
|
|
|
|
RAILIANCE_STATE_HUB_RELEASE ?= state-hub
|
|
|
|
|
RAILIANCE_STATE_HUB_NAMESPACE ?= state-hub
|
|
|
|
|
RAILIANCE_STATE_HUB_CHART ?= deploy/railiance/apps/charts/state-hub
|
|
|
|
|
RAILIANCE_STATE_HUB_VALUES ?= deploy/railiance/apps/helm/state-hub-values.yaml
|
2026-07-06 11:08:50 +02:00
|
|
|
RAILIANCE_STATE_HUB_IMAGE_TAG ?= f2e042a
|
2026-06-25 15:15:30 +02:00
|
|
|
RAILIANCE_STATE_HUB_PLATFORM_DIR ?= deploy/railiance/platform
|
|
|
|
|
RAILIANCE_STATE_HUB_APP_MANIFESTS ?= deploy/railiance/apps/manifests
|
2026-06-07 19:49:17 +02:00
|
|
|
# Codex/WSL non-login shells may not source ~/.profile; keep uv discoverable.
|
|
|
|
|
UV ?= $(shell command -v uv 2>/dev/null || if [ -x "$$HOME/.local/bin/uv" ]; then printf "%s" "$$HOME/.local/bin/uv"; else printf "%s" "uv"; fi)
|
2026-08-30 22:38:54 +02:00
|
|
|
RMGR ?= $(shell command -v rmgr 2>/dev/null || if [ -x "$$HOME/repo-manager/.venv/bin/rmgr" ]; then printf "%s" "$$HOME/repo-manager/.venv/bin/rmgr"; else printf "%s" "rmgr"; fi)
|
|
|
|
|
STATE_HUB_API_BASE ?= http://127.0.0.1:8000
|
|
|
|
|
SYNC_PATH ?= .
|
|
|
|
|
SYNC_PUSH ?= 1
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
2026-04-25 23:15:30 +02:00
|
|
|
start:
|
2026-08-30 22:38:54 +02:00
|
|
|
@echo "# Normal production UI access (run in order)"
|
|
|
|
|
@echo "make bridges # connect local :8000 to the railiance01 primary"
|
|
|
|
|
@echo "make dashboard # verify the primary, then serve the UI on :3000"
|
|
|
|
|
@echo "make sync # push file-backed records and reconcile the exact forge commit"
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "# Optional local MCP adapter"
|
|
|
|
|
@echo "make mcp-http # local SSE adapter on :8001; not needed by the UI"
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "# Local fallback/development only"
|
|
|
|
|
@echo "make api # local Postgres + API; conflicts with the production :8000 tunnel"
|
|
|
|
|
@echo "make dashboard-local # dashboard against the deliberate local API"
|
2026-04-25 23:15:30 +02:00
|
|
|
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
install:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) sync
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
2026-05-17 20:55:05 +02:00
|
|
|
dashboard/node_modules/.bin/observable: dashboard/package.json dashboard/package-lock.json
|
|
|
|
|
cd dashboard && npm ci
|
|
|
|
|
|
|
|
|
|
dashboard-install: dashboard/node_modules/.bin/observable
|
|
|
|
|
|
|
|
|
|
dashboard-check: dashboard-install
|
|
|
|
|
cd dashboard && npm run build
|
|
|
|
|
|
2026-02-24 22:55:41 +01:00
|
|
|
## Symlink the custodian CLI into ~/.local/bin so it's on PATH system-wide
|
|
|
|
|
install-cli: install
|
|
|
|
|
mkdir -p ~/.local/bin
|
|
|
|
|
ln -sf "$(shell pwd)/.venv/bin/custodian" ~/.local/bin/custodian
|
2026-06-05 13:09:25 +02:00
|
|
|
ln -sf "$(shell pwd)/.venv/bin/statehub" ~/.local/bin/statehub
|
2026-02-24 22:55:41 +01:00
|
|
|
@echo "Installed: custodian → $$(readlink -f ~/.local/bin/custodian)"
|
2026-06-05 13:09:25 +02:00
|
|
|
@echo "Installed: statehub → $$(readlink -f ~/.local/bin/statehub)"
|
2026-02-24 22:55:41 +01:00
|
|
|
@echo "Make sure ~/.local/bin is on your PATH:"
|
|
|
|
|
@echo " echo 'export PATH=\"\$$HOME/.local/bin:\$$PATH\"' >> ~/.bashrc && source ~/.bashrc"
|
|
|
|
|
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
db:
|
|
|
|
|
$(COMPOSE) up -d postgres
|
|
|
|
|
|
|
|
|
|
db-tools:
|
|
|
|
|
$(COMPOSE) --profile tools up -d
|
|
|
|
|
|
|
|
|
|
migrate:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run alembic upgrade head
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
|
|
|
|
seed:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/seed.py
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
2026-03-19 00:05:56 +01:00
|
|
|
## Start (or restart) the MCP SSE server on :8001 — primary transport for Claude Code.
|
|
|
|
|
## Remote clients (e.g. COULOMBCORE) connect via the ops-bridge tunnel (port 18001).
|
|
|
|
|
## Registration: claude mcp add-json -s user state-hub '{"type":"sse","url":"http://127.0.0.1:8001/sse"}'
|
2026-03-16 00:13:14 +01:00
|
|
|
mcp-http:
|
2026-03-19 00:05:56 +01:00
|
|
|
@fuser -k 8001/tcp 2>/dev/null && echo "Stopped running MCP server" || true
|
2026-06-07 19:49:17 +02:00
|
|
|
MCP_TRANSPORT=sse MCP_PORT=8001 $(UV) run python mcp_server/server.py
|
2026-03-16 00:13:14 +01:00
|
|
|
|
2026-08-30 22:38:54 +02:00
|
|
|
## Require the production identity before serving the normal dashboard. This
|
|
|
|
|
## prevents an accidental local `make api` from presenting an empty fallback DB
|
|
|
|
|
## as the live State Hub.
|
|
|
|
|
check-primary:
|
|
|
|
|
@health="$$(curl -fsS --max-time 5 http://127.0.0.1:8000/state/health 2>/dev/null)" || { \
|
|
|
|
|
echo "ERROR: State Hub primary is not reachable on 127.0.0.1:8000." >&2; \
|
|
|
|
|
echo "Run 'make bridges' first." >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
}; \
|
|
|
|
|
identity="$$(printf '%s' "$$health" | $(PYTHON) -c 'import json, sys; d=json.load(sys.stdin); print("{}/{}".format(d.get("instance_role", ""), d.get("instance_label", "")))')"; \
|
|
|
|
|
if [ "$$identity" != "primary/railiance01" ]; then \
|
|
|
|
|
echo "ERROR: 127.0.0.1:8000 is '$$identity', not the primary/railiance01 State Hub." >&2; \
|
|
|
|
|
echo "Stop the local API, then run 'make bridges'. Use 'make dashboard-local' only for intentional local development." >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
## Refuse to start the production tunnel when a non-primary API already owns
|
|
|
|
|
## port 8000. With no listener, bridge is free to establish the tunnel.
|
|
|
|
|
primary-port-clear:
|
|
|
|
|
@if health="$$(curl -fsS --max-time 2 http://127.0.0.1:8000/state/health 2>/dev/null)"; then \
|
|
|
|
|
identity="$$(printf '%s' "$$health" | $(PYTHON) -c 'import json, sys; d=json.load(sys.stdin); print("{}/{}".format(d.get("instance_role", ""), d.get("instance_label", "")))')"; \
|
|
|
|
|
if [ "$$identity" != "primary/railiance01" ]; then \
|
|
|
|
|
echo "ERROR: port 8000 is occupied by '$$identity'." >&2; \
|
|
|
|
|
echo "Stop the local 'make api' process before starting the production tunnel." >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dashboard: check-primary
|
2026-03-18 23:18:31 +01:00
|
|
|
@fuser -k 3000/tcp 2>/dev/null && echo "Stopped running dashboard" || true
|
2026-05-17 20:55:05 +02:00
|
|
|
$(MAKE) dashboard-install
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
cd dashboard && npm run dev
|
|
|
|
|
|
2026-08-30 22:38:54 +02:00
|
|
|
## Deliberate local-development dashboard; bypasses the production identity gate.
|
|
|
|
|
dashboard-local:
|
|
|
|
|
@echo "WARNING: serving the dashboard against the local/fallback API on :8000."
|
|
|
|
|
@fuser -k 3000/tcp 2>/dev/null && echo "Stopped running dashboard" || true
|
|
|
|
|
$(MAKE) dashboard-install
|
|
|
|
|
cd dashboard && npm run dev
|
|
|
|
|
|
|
|
|
|
## Fast work-record path. Repo Manager assigns only missing deterministic IDs,
|
|
|
|
|
## verifies the primary/railliance01 bridge, and asks central to derive the
|
|
|
|
|
## exact pushed Forgejo commit in one transactional request.
|
|
|
|
|
sync:
|
|
|
|
|
$(RMGR) sync --path "$(SYNC_PATH)" --api-base "$(STATE_HUB_API_BASE)" $(if $(filter 1 true yes,$(SYNC_PUSH)),--push,)
|
|
|
|
|
|
|
|
|
|
check: check-primary
|
|
|
|
|
@echo "State Hub primary/railiance01 is healthy."
|
|
|
|
|
|
|
|
|
|
check-local:
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
curl -sf http://127.0.0.1:8000/state/health | python3 -m json.tool
|
|
|
|
|
|
2026-08-24 23:46:05 +02:00
|
|
|
# CUST-WP-0067-T09. The chart ships a copy of the-custodian canon allowed-values
|
|
|
|
|
# because a container has no checkout to read it from. Regenerate after any
|
|
|
|
|
# canon vocabulary change; the -check target fails on drift so a release cannot
|
|
|
|
|
# validate classification against a stale vocabulary.
|
|
|
|
|
sync-classification-allowed:
|
|
|
|
|
python3 scripts/sync_classification_allowed.py
|
|
|
|
|
|
|
|
|
|
check-classification-allowed:
|
|
|
|
|
python3 scripts/sync_classification_allowed.py --check
|
|
|
|
|
|
|
|
|
|
railiance-state-hub-render: check-classification-allowed
|
2026-06-25 15:15:30 +02:00
|
|
|
$(HELM) template $(RAILIANCE_STATE_HUB_RELEASE) $(RAILIANCE_STATE_HUB_CHART) \
|
|
|
|
|
--namespace $(RAILIANCE_STATE_HUB_NAMESPACE) \
|
|
|
|
|
-f $(RAILIANCE_STATE_HUB_VALUES) \
|
|
|
|
|
--set image.tag=$(RAILIANCE_STATE_HUB_IMAGE_TAG)
|
|
|
|
|
|
|
|
|
|
railiance-state-hub-client-dry-run:
|
|
|
|
|
@set -e; \
|
|
|
|
|
tmpdir="$$(mktemp -d)"; \
|
|
|
|
|
trap 'rm -rf "$$tmpdir"' EXIT; \
|
|
|
|
|
$(HELM) template $(RAILIANCE_STATE_HUB_RELEASE) $(RAILIANCE_STATE_HUB_CHART) \
|
|
|
|
|
--namespace $(RAILIANCE_STATE_HUB_NAMESPACE) \
|
|
|
|
|
-f $(RAILIANCE_STATE_HUB_VALUES) \
|
|
|
|
|
--set image.tag=$(RAILIANCE_STATE_HUB_IMAGE_TAG) > "$$tmpdir/state-hub.yaml"; \
|
|
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_PLATFORM_DIR)/state-hub-db-credentials.sops.yaml.template; \
|
|
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_PLATFORM_DIR)/state-hub-db-cluster.yaml; \
|
|
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_PLATFORM_DIR)/state-hub-db-networkpolicies.yaml; \
|
2026-06-25 15:39:53 +02:00
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_APP_MANIFESTS)/state-hub-namespace.yaml; \
|
2026-06-25 15:15:30 +02:00
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_APP_MANIFESTS)/state-hub-env.secret.sops.yaml.template; \
|
2026-06-25 15:39:53 +02:00
|
|
|
$(KUBECTL) apply --dry-run=client -n $(RAILIANCE_STATE_HUB_NAMESPACE) -f "$$tmpdir/state-hub.yaml"
|
2026-06-25 15:15:30 +02:00
|
|
|
|
|
|
|
|
railiance-state-hub-server-dry-run:
|
|
|
|
|
@set -e; \
|
|
|
|
|
tmpdir="$$(mktemp -d)"; \
|
|
|
|
|
trap 'rm -rf "$$tmpdir"' EXIT; \
|
|
|
|
|
$(HELM) template $(RAILIANCE_STATE_HUB_RELEASE) $(RAILIANCE_STATE_HUB_CHART) \
|
|
|
|
|
--namespace $(RAILIANCE_STATE_HUB_NAMESPACE) \
|
|
|
|
|
-f $(RAILIANCE_STATE_HUB_VALUES) \
|
|
|
|
|
--set image.tag=$(RAILIANCE_STATE_HUB_IMAGE_TAG) > "$$tmpdir/state-hub.yaml"; \
|
|
|
|
|
$(KUBECTL) apply --dry-run=server -f $(RAILIANCE_STATE_HUB_PLATFORM_DIR)/state-hub-db-credentials.sops.yaml.template; \
|
|
|
|
|
$(KUBECTL) apply --dry-run=server -f $(RAILIANCE_STATE_HUB_PLATFORM_DIR)/state-hub-db-cluster.yaml; \
|
|
|
|
|
$(KUBECTL) apply --dry-run=server -f $(RAILIANCE_STATE_HUB_PLATFORM_DIR)/state-hub-db-networkpolicies.yaml; \
|
2026-06-25 15:39:53 +02:00
|
|
|
$(KUBECTL) apply --dry-run=server -f $(RAILIANCE_STATE_HUB_APP_MANIFESTS)/state-hub-namespace.yaml; \
|
2026-06-25 15:15:30 +02:00
|
|
|
if $(KUBECTL) get namespace $(RAILIANCE_STATE_HUB_NAMESPACE) >/dev/null 2>&1; then \
|
|
|
|
|
$(KUBECTL) apply --dry-run=server -f $(RAILIANCE_STATE_HUB_APP_MANIFESTS)/state-hub-env.secret.sops.yaml.template; \
|
2026-06-25 15:39:53 +02:00
|
|
|
$(KUBECTL) apply --dry-run=server -n $(RAILIANCE_STATE_HUB_NAMESPACE) -f "$$tmpdir/state-hub.yaml"; \
|
2026-06-25 15:15:30 +02:00
|
|
|
else \
|
|
|
|
|
echo "Namespace $(RAILIANCE_STATE_HUB_NAMESPACE) does not exist; validating namespaced app manifests with client dry-run."; \
|
2026-06-25 15:39:53 +02:00
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_APP_MANIFESTS)/state-hub-namespace.yaml; \
|
2026-06-25 15:15:30 +02:00
|
|
|
$(KUBECTL) apply --dry-run=client -f $(RAILIANCE_STATE_HUB_APP_MANIFESTS)/state-hub-env.secret.sops.yaml.template; \
|
2026-06-25 15:39:53 +02:00
|
|
|
$(KUBECTL) apply --dry-run=client -n $(RAILIANCE_STATE_HUB_NAMESPACE) -f "$$tmpdir/state-hub.yaml"; \
|
2026-06-25 15:15:30 +02:00
|
|
|
fi
|
|
|
|
|
|
2026-05-17 20:55:05 +02:00
|
|
|
test: test-python dashboard-check
|
|
|
|
|
|
|
|
|
|
test-python:
|
feat(tests): pytest-asyncio test suite — 119 tests across 3 modules
Infrastructure (T01):
- tests/conftest.py: sync schema setup (psycopg2), per-test table
truncation, async ASGI client with get_session override
- pyproject.toml: [tool.pytest.ini_options] asyncio_mode=auto
- Makefile: make test target with TEST_DATABASE_URL
Core router tests (T02): 19 tests
- domains, topics, workstreams, tasks, decisions + state summary
- Caught real bug: topic router missing duplicate-slug 409 guard (fixed)
TD/EP/Contributions/SBOM tests (T03): 10 tests
- CRUD + status transitions + lifecycle guard + SBOM ingest
MCP smoke tests (T04): 12 tests
- get_state_summary, create_task, update_task_status,
add_progress_event, flag_for_human HTTP shapes
CI gate (T05): make test documented in CLAUDE.md session protocol
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 12:00:06 +01:00
|
|
|
TEST_DATABASE_URL=postgresql+asyncpg://custodian:changeme@127.0.0.1:5432/custodian_test \
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run pytest -x -q
|
feat(tests): pytest-asyncio test suite — 119 tests across 3 modules
Infrastructure (T01):
- tests/conftest.py: sync schema setup (psycopg2), per-test table
truncation, async ASGI client with get_session override
- pyproject.toml: [tool.pytest.ini_options] asyncio_mode=auto
- Makefile: make test target with TEST_DATABASE_URL
Core router tests (T02): 19 tests
- domains, topics, workstreams, tasks, decisions + state summary
- Caught real bug: topic router missing duplicate-slug 409 guard (fixed)
TD/EP/Contributions/SBOM tests (T03): 10 tests
- CRUD + status transitions + lifecycle guard + SBOM ingest
MCP smoke tests (T04): 12 tests
- get_state_summary, create_task, update_task_status,
add_progress_event, flag_for_human HTTP shapes
CI gate (T05): make test documented in CLAUDE.md session protocol
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 12:00:06 +01:00
|
|
|
|
2026-06-22 16:27:32 +02:00
|
|
|
## Benchmark /state/summary revision cache (API must be running on :8000)
|
|
|
|
|
benchmark-summary-cache:
|
|
|
|
|
$(UV) run python scripts/benchmark_summary_cache.py
|
|
|
|
|
|
2026-03-27 22:32:51 +01:00
|
|
|
## ops-bridge managed tunnels
|
feat(capability-requests): add routing_note, PATCH endpoint, word-boundary fix, and ops-bridge tunnel targets
- Add `routing_note` column (migration l9g0h1i2j3k4) to persist why a request was routed to a given domain
- Fix substring-match bug in `_route_capability`: use `\b` word-boundary regex so 'postgres' no longer matches inside 'postgresql'
- Include `title` in keyword scoring for better routing accuracy
- Return `routing_note` string from `_route_capability` and store it on the request
- Add `PATCH /capability-requests/{id}` endpoint + `CapabilityRequestPatch` schema to correct mutable metadata (catalog_entry_id, priority, blocking_task_id, fulfilling_workstream_id)
- Add `patch_capability_request` MCP tool wrapping the new endpoint
- Add 105 lines of routing tests (word-boundary, title-match, multi-entry scoring, broadcast fallback)
- Add `tunnels-up`, `tunnels-status`, `tunnels-check` Makefile targets for ops-bridge managed tunnels
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:47:54 +01:00
|
|
|
## Requires ops-bridge: bridge is at /home/worsch/.local/bin/bridge
|
2026-08-30 22:38:54 +02:00
|
|
|
tunnels-up: primary-port-clear
|
feat(capability-requests): add routing_note, PATCH endpoint, word-boundary fix, and ops-bridge tunnel targets
- Add `routing_note` column (migration l9g0h1i2j3k4) to persist why a request was routed to a given domain
- Fix substring-match bug in `_route_capability`: use `\b` word-boundary regex so 'postgres' no longer matches inside 'postgresql'
- Include `title` in keyword scoring for better routing accuracy
- Return `routing_note` string from `_route_capability` and store it on the request
- Add `PATCH /capability-requests/{id}` endpoint + `CapabilityRequestPatch` schema to correct mutable metadata (catalog_entry_id, priority, blocking_task_id, fulfilling_workstream_id)
- Add `patch_capability_request` MCP tool wrapping the new endpoint
- Add 105 lines of routing tests (word-boundary, title-match, multi-entry scoring, broadcast fallback)
- Add `tunnels-up`, `tunnels-status`, `tunnels-check` Makefile targets for ops-bridge managed tunnels
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:47:54 +01:00
|
|
|
bridge up
|
|
|
|
|
|
|
|
|
|
tunnels-status:
|
|
|
|
|
bridge status
|
|
|
|
|
|
|
|
|
|
## End-to-end check: verifies SSH process alive + remote port listening on COULOMBCORE.
|
|
|
|
|
## Exits non-zero if any tunnel is not fully operational.
|
|
|
|
|
tunnels-check:
|
|
|
|
|
bridge check
|
|
|
|
|
|
2026-04-01 21:53:51 +02:00
|
|
|
## Ensure all ops-bridge tunnels are up and healthy.
|
|
|
|
|
## Brings up any stopped/stale tunnels, shows final status, exits non-zero if anything is still down.
|
2026-08-30 22:38:54 +02:00
|
|
|
bridges: primary-port-clear
|
2026-04-01 21:53:51 +02:00
|
|
|
@echo "==> Bringing up all tunnels..."
|
|
|
|
|
bridge up
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "==> Tunnel status:"
|
|
|
|
|
bridge status
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "==> Checking tunnel health..."
|
|
|
|
|
bridge check
|
|
|
|
|
|
2026-08-30 22:38:54 +02:00
|
|
|
## Start (or restart) the LOCAL FALLBACK backend — db + migrate + uvicorn.
|
|
|
|
|
## This replaces anything on :8000, including the production State Hub tunnel.
|
2026-03-18 23:20:45 +01:00
|
|
|
api: db
|
2026-08-30 22:38:54 +02:00
|
|
|
@echo "WARNING: starting the local fallback API; this is not the railiance01 primary."
|
2026-03-18 23:16:44 +01:00
|
|
|
@echo "Waiting for postgres..."; \
|
|
|
|
|
for i in 1 2 3 4 5 6 7 8 9 10; do \
|
|
|
|
|
nc -z 127.0.0.1 5432 2>/dev/null && break; \
|
|
|
|
|
sleep 1; \
|
|
|
|
|
done
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
$(MAKE) migrate
|
2026-03-18 23:18:31 +01:00
|
|
|
@fuser -k 8000/tcp 2>/dev/null && echo "Stopped running API" || true
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run uvicorn api.main:app --reload --reload-dir api --reload-dir mcp_server --reload-dir task_flow_engine --host 127.0.0.1 --port 8000
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
|
2026-04-26 13:17:50 +02:00
|
|
|
## Register a project (Claude Code): make register-project DOMAIN=railiance PROJECT_PATH=/home/worsch/railiance
|
2026-02-24 22:22:53 +01:00
|
|
|
register-project:
|
|
|
|
|
@test -n "$(DOMAIN)" || (echo "ERROR: DOMAIN is required. Usage: make register-project DOMAIN=<domain> PROJECT_PATH=<path>"; exit 1)
|
|
|
|
|
@test -n "$(PROJECT_PATH)" || (echo "ERROR: PROJECT_PATH is required."; exit 1)
|
|
|
|
|
scripts/register_project.sh "$(DOMAIN)" "$(PROJECT_PATH)"
|
|
|
|
|
|
2026-04-26 13:17:50 +02:00
|
|
|
## Register a Codex project (AGENTS.md + HTTP API): make register-codex-project DOMAIN=capabilities PROJECT_PATH=/home/worsch/my-repo
|
|
|
|
|
register-codex-project:
|
|
|
|
|
@test -n "$(DOMAIN)" || (echo "ERROR: DOMAIN is required. Usage: make register-codex-project DOMAIN=<domain> PROJECT_PATH=<path>"; exit 1)
|
|
|
|
|
@test -n "$(PROJECT_PATH)" || (echo "ERROR: PROJECT_PATH is required."; exit 1)
|
|
|
|
|
scripts/register_project.sh "$(DOMAIN)" "$(PROJECT_PATH)" --codex
|
|
|
|
|
|
2026-05-23 13:59:05 +02:00
|
|
|
## Register State Hub MCP for Claude Code. Optional: make register-mcp MCP_URL=http://127.0.0.1:18001/sse
|
|
|
|
|
register-mcp:
|
|
|
|
|
scripts/register-mcp.sh \
|
|
|
|
|
$(if $(MCP_URL),--url "$(MCP_URL)",) \
|
|
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",) \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run,)
|
|
|
|
|
|
2026-08-09 16:19:53 +02:00
|
|
|
## Configure Codex workspace-write networking for local State Hub access.
|
|
|
|
|
configure-codex:
|
|
|
|
|
scripts/configure-codex.sh \
|
|
|
|
|
$(if $(CODEX_HOME),--codex-home "$(CODEX_HOME)",) \
|
|
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",) \
|
|
|
|
|
$(if $(WITH_MCP),--with-mcp,) \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run,)
|
|
|
|
|
|
2026-05-23 13:59:05 +02:00
|
|
|
## Bootstrap a new operator/collaborator environment. Optional: make bootstrap-env ARGS="--install-missing"
|
|
|
|
|
bootstrap-env:
|
|
|
|
|
scripts/bootstrap-env.sh $(ARGS)
|
|
|
|
|
|
2026-07-08 11:42:49 +02:00
|
|
|
## Files-first local dev hub (CUST-WP-0054-T07): postgres + migrate + seed + API + repo registration.
|
|
|
|
|
## Optional: WITH_EDGE=1 WITH_MCP=1 make dev-hub
|
|
|
|
|
## Fleet tunnel when reachable: make dev-hub PROFILE=fleet
|
|
|
|
|
dev-hub:
|
|
|
|
|
bash scripts/dev_hub_up.sh $(if $(PROFILE),$(PROFILE),dev)
|
|
|
|
|
|
|
|
|
|
## Local edge relay for offline write buffering (STATE-WP-0068).
|
|
|
|
|
edge-relay:
|
|
|
|
|
@fuser -k 18080/tcp 2>/dev/null && echo "Stopped running edge relay" || true
|
|
|
|
|
STATEHUB_UPSTREAM_URL=$${STATEHUB_UPSTREAM_URL:-http://127.0.0.1:8000} \
|
|
|
|
|
$(UV) run uvicorn api.edge.relay:app --host 127.0.0.1 --port 18080
|
|
|
|
|
|
|
|
|
|
## Switch MCP/API profile: make mcp-profile PROFILE=dev|fleet|status
|
|
|
|
|
mcp-profile:
|
|
|
|
|
@test -n "$(PROFILE)" || (echo "ERROR: PROFILE is required (dev|fleet|status)."; exit 1)
|
|
|
|
|
bash scripts/mcp_hub_profile.sh "$(PROFILE)"
|
|
|
|
|
|
feat(state-hub): implement v0.5 — dynamic domains & multi-repo
Replaces the hardcoded 6-domain PostgreSQL ENUM with a first-class
`domains` DB table, and adds a `managed_repos` table for multi-repo
support per domain.
P1 — Domain as a DB entity:
- Migration b1c2d3e4f5a6: creates `domains` table, migrates topics.domain
ENUM column to domain_id FK, drops the domain ENUM type
- Domain ORM model (api/models/domain.py) + Pydantic schemas
- Domain API router: GET/POST /domains/, GET/PATCH /domains/{slug}/,
rename and archive endpoints with EP/TD cascade on rename
- Topic model updated: domain_id FK + @property domain_slug for
backwards-compatible JSON serialization (field renamed domain → domain_slug)
- TopicCreate/TopicRead updated; seed.py rewritten to use FK lookup
P2 — Multi-repo support:
- ManagedRepo ORM model (api/models/managed_repo.py) + schemas
- Repo API router: GET/POST /repos/, GET/PATCH /repos/{slug}/, archive
- Makefile: add-domain, rename-domain, add-repo, list-repos targets
- register_project.sh: verify domain via /domains/ API + POST /repos/
P3 — MCP tools & live validation:
- 6 new MCP tools: list_domains, create_domain, rename_domain,
archive_domain, list_domain_repos, register_repo
- EP/TD routers: replace hardcoded VALID_DOMAINS set with per-request
DB lookup — returns 422 with list of valid slugs on unknown domain
- State summary: adds domains: list[DomainSummary] (slug, name,
repo_count, active_workstream_count, ep_count, td_count)
- TOOLS.md updated with domain management section
P4 — Dashboard:
- New domains.md page with KPI row + domain cards + repo lists
- domains.json.py + repos.json.py data loaders
- Domains page added to observablehq.config.js nav
- workstreams.md, extensions.md, techdept.md: domain_slug fix +
dynamic domain list loaded from /domains/ API (no longer hardcoded)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 15:20:15 +01:00
|
|
|
## Add a second repo to an existing domain: make add-repo DOMAIN=railiance REPO_PATH=/home/worsch/railiance-infra
|
|
|
|
|
add-repo:
|
|
|
|
|
@test -n "$(DOMAIN)" || (echo "ERROR: DOMAIN is required."; exit 1)
|
|
|
|
|
@test -n "$(REPO_PATH)" || (echo "ERROR: REPO_PATH is required."; exit 1)
|
|
|
|
|
scripts/register_project.sh "$(DOMAIN)" "$(REPO_PATH)" --additional
|
|
|
|
|
|
|
|
|
|
## Create a new domain: make add-domain DOMAIN=my_domain NAME="My Domain"
|
|
|
|
|
add-domain:
|
|
|
|
|
@test -n "$(DOMAIN)" || (echo "ERROR: DOMAIN is required (slug)."; exit 1)
|
|
|
|
|
@test -n "$(NAME)" || (echo "ERROR: NAME is required (display name)."; exit 1)
|
|
|
|
|
curl -sf -X POST http://127.0.0.1:8000/domains/ \
|
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
|
-d "{\"slug\": \"$(DOMAIN)\", \"name\": \"$(NAME)\"}" | python3 -m json.tool
|
|
|
|
|
|
|
|
|
|
## Rename a domain: make rename-domain DOMAIN=old_slug NEW_SLUG=new_slug NEW_NAME="New Name"
|
|
|
|
|
rename-domain:
|
|
|
|
|
@test -n "$(DOMAIN)" || (echo "ERROR: DOMAIN (old slug) is required."; exit 1)
|
|
|
|
|
@test -n "$(NEW_SLUG)" || (echo "ERROR: NEW_SLUG is required."; exit 1)
|
|
|
|
|
@test -n "$(NEW_NAME)" || (echo "ERROR: NEW_NAME is required."; exit 1)
|
|
|
|
|
curl -sf -X PATCH http://127.0.0.1:8000/domains/$(DOMAIN)/rename \
|
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
|
-d "{\"new_slug\": \"$(NEW_SLUG)\", \"new_name\": \"$(NEW_NAME)\"}" | python3 -m json.tool
|
|
|
|
|
|
2026-03-16 16:30:55 +01:00
|
|
|
## Register this machine's local path for a repo: make register-path REPO=marki-docx PATH=/home/tegwick/marki-docx
|
|
|
|
|
register-path:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required. Usage: make register-path REPO=<slug> PATH=<path>"; exit 1)
|
|
|
|
|
@test -n "$(PATH)" || (echo "ERROR: PATH is required. Usage: make register-path REPO=<slug> PATH=<path>"; exit 1)
|
2026-04-26 15:13:01 +02:00
|
|
|
curl -sf -X POST "http://127.0.0.1:8000/repos/$(REPO)/paths" \
|
2026-03-16 16:30:55 +01:00
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
|
-d "{\"host\": \"$$(hostname)\", \"path\": \"$(PATH)\"}" | python3 -m json.tool
|
|
|
|
|
|
feat(state-hub): implement v0.5 — dynamic domains & multi-repo
Replaces the hardcoded 6-domain PostgreSQL ENUM with a first-class
`domains` DB table, and adds a `managed_repos` table for multi-repo
support per domain.
P1 — Domain as a DB entity:
- Migration b1c2d3e4f5a6: creates `domains` table, migrates topics.domain
ENUM column to domain_id FK, drops the domain ENUM type
- Domain ORM model (api/models/domain.py) + Pydantic schemas
- Domain API router: GET/POST /domains/, GET/PATCH /domains/{slug}/,
rename and archive endpoints with EP/TD cascade on rename
- Topic model updated: domain_id FK + @property domain_slug for
backwards-compatible JSON serialization (field renamed domain → domain_slug)
- TopicCreate/TopicRead updated; seed.py rewritten to use FK lookup
P2 — Multi-repo support:
- ManagedRepo ORM model (api/models/managed_repo.py) + schemas
- Repo API router: GET/POST /repos/, GET/PATCH /repos/{slug}/, archive
- Makefile: add-domain, rename-domain, add-repo, list-repos targets
- register_project.sh: verify domain via /domains/ API + POST /repos/
P3 — MCP tools & live validation:
- 6 new MCP tools: list_domains, create_domain, rename_domain,
archive_domain, list_domain_repos, register_repo
- EP/TD routers: replace hardcoded VALID_DOMAINS set with per-request
DB lookup — returns 422 with list of valid slugs on unknown domain
- State summary: adds domains: list[DomainSummary] (slug, name,
repo_count, active_workstream_count, ep_count, td_count)
- TOOLS.md updated with domain management section
P4 — Dashboard:
- New domains.md page with KPI row + domain cards + repo lists
- domains.json.py + repos.json.py data loaders
- Domains page added to observablehq.config.js nav
- workstreams.md, extensions.md, techdept.md: domain_slug fix +
dynamic domain list loaded from /domains/ API (no longer hardcoded)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 15:20:15 +01:00
|
|
|
## List repos for a domain: make list-repos DOMAIN=railiance
|
|
|
|
|
list-repos:
|
|
|
|
|
@test -n "$(DOMAIN)" || (echo "ERROR: DOMAIN is required."; exit 1)
|
|
|
|
|
curl -sf "http://127.0.0.1:8000/repos/?domain=$(DOMAIN)" | python3 -m json.tool
|
|
|
|
|
|
2026-03-12 04:40:26 +01:00
|
|
|
## Ingest SBOM data for a repo (all mechanisms: lockfiles + ansible + sbom-tools.yaml).
|
|
|
|
|
## Auto-detect all sources: make ingest-sbom REPO=the-custodian REPO_PATH=/home/worsch/the-custodian
|
feat(sbom): scan mode, domain grouping dashboard, SBOM convention doc
- ingest_sbom.py: add --scan flag (recursive lockfile discovery) +
--lockfile repeatable for explicit multi-file ingestion; skip
.venv/node_modules/.git/dist/etc; Makefile gains SCAN= and REPO_PATH= vars
- sbom.md: add /domains/ fetch; domain-level summary table; per-repo
accordion with details/summary; domain filter on package table; dual-
licence false-positive note; +1 KPI card (Domains Covered)
- canon/standards/sbom-convention_v0.1.md: authoritative lockfile table,
ingest workflow (single/scan/explicit), snapshot semantics, direct-vs-
transitive caveats, licence governance + copyleft escalation, update
cadence, multi-repo domain pattern, planned enhancements
First ingest: the-custodian — 420 pkgs (88 python + 332 node), 13 licence
groups, 1 copyleft flag (jszip dual-licensed MIT OR GPL-3.0-or-later)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:15:40 +01:00
|
|
|
## Single lockfile (explicit): make ingest-sbom REPO=the-custodian LOCKFILE=/path/to/uv.lock
|
2026-03-12 04:40:26 +01:00
|
|
|
## Dry-run (no submit): make ingest-sbom REPO=the-custodian REPO_PATH=... DRY_RUN=1
|
|
|
|
|
## Tip: run capture-tools first for repos with system-level tool dependencies.
|
2026-02-28 17:28:49 +01:00
|
|
|
ingest-sbom:
|
feat(sbom): scan mode, domain grouping dashboard, SBOM convention doc
- ingest_sbom.py: add --scan flag (recursive lockfile discovery) +
--lockfile repeatable for explicit multi-file ingestion; skip
.venv/node_modules/.git/dist/etc; Makefile gains SCAN= and REPO_PATH= vars
- sbom.md: add /domains/ fetch; domain-level summary table; per-repo
accordion with details/summary; domain filter on package table; dual-
licence false-positive note; +1 KPI card (Domains Covered)
- canon/standards/sbom-convention_v0.1.md: authoritative lockfile table,
ingest workflow (single/scan/explicit), snapshot semantics, direct-vs-
transitive caveats, licence governance + copyleft escalation, update
cadence, multi-repo domain pattern, planned enhancements
First ingest: the-custodian — 420 pkgs (88 python + 332 node), 13 licence
groups, 1 copyleft flag (jszip dual-licensed MIT OR GPL-3.0-or-later)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:15:40 +01:00
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required."; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/ingest_sbom.py --repo "$(REPO)" \
|
feat(sbom): scan mode, domain grouping dashboard, SBOM convention doc
- ingest_sbom.py: add --scan flag (recursive lockfile discovery) +
--lockfile repeatable for explicit multi-file ingestion; skip
.venv/node_modules/.git/dist/etc; Makefile gains SCAN= and REPO_PATH= vars
- sbom.md: add /domains/ fetch; domain-level summary table; per-repo
accordion with details/summary; domain filter on package table; dual-
licence false-positive note; +1 KPI card (Domains Covered)
- canon/standards/sbom-convention_v0.1.md: authoritative lockfile table,
ingest workflow (single/scan/explicit), snapshot semantics, direct-vs-
transitive caveats, licence governance + copyleft escalation, update
cadence, multi-repo domain pattern, planned enhancements
First ingest: the-custodian — 420 pkgs (88 python + 332 node), 13 licence
groups, 1 copyleft flag (jszip dual-licensed MIT OR GPL-3.0-or-later)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:15:40 +01:00
|
|
|
$(if $(LOCKFILE),--lockfile "$(LOCKFILE)") \
|
2026-03-12 04:40:26 +01:00
|
|
|
$(if $(REPO_PATH),--repo-path "$(REPO_PATH)") \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run)
|
|
|
|
|
|
feat(capability-requests): add cross-domain capability catalog and request routing
Introduces a capability catalog (CUST-WP-0022) so domains can advertise what
they provide and agents can request capabilities from other domains with
auto-routing, lifecycle tracking, and task-unblocking on completion.
- New models: CapabilityCatalog, CapabilityRequest with full lifecycle
(requested → accepted → in_progress → ready_for_review → completed/rejected/withdrawn)
- Migration i6d7e8f9a0b1: capability_catalog + capability_requests tables
- Router /capability-catalog and /capability-requests with accept/status endpoints
- 7 new MCP tools: register_capability, list_capabilities, request_capability,
accept_capability_request, update_capability_request_status,
list_capability_requests, get_capability_request
- StateSummary gains open_capability_requests count
- Dashboard: capability-requests.md page + docs/capabilities.md + docs/scope.md
- SCOPE.md: three seed capabilities documented (MCP registration, state tracking, SBOM)
- scope.template: Provided Capabilities section with example block
- scripts/ingest_capabilities.py + make ingest-capabilities[/-all] targets
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 21:07:50 +01:00
|
|
|
## Ingest capability declarations from SCOPE.md into the catalog.
|
|
|
|
|
## Usage: make ingest-capabilities REPO=the-custodian [REPO_PATH=/home/worsch/the-custodian]
|
|
|
|
|
## Or: make ingest-capabilities-all
|
|
|
|
|
## Add DRY_RUN=1 to preview without writing.
|
|
|
|
|
ingest-capabilities:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required."; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/ingest_capabilities.py --repo "$(REPO)" \
|
feat(capability-requests): add cross-domain capability catalog and request routing
Introduces a capability catalog (CUST-WP-0022) so domains can advertise what
they provide and agents can request capabilities from other domains with
auto-routing, lifecycle tracking, and task-unblocking on completion.
- New models: CapabilityCatalog, CapabilityRequest with full lifecycle
(requested → accepted → in_progress → ready_for_review → completed/rejected/withdrawn)
- Migration i6d7e8f9a0b1: capability_catalog + capability_requests tables
- Router /capability-catalog and /capability-requests with accept/status endpoints
- 7 new MCP tools: register_capability, list_capabilities, request_capability,
accept_capability_request, update_capability_request_status,
list_capability_requests, get_capability_request
- StateSummary gains open_capability_requests count
- Dashboard: capability-requests.md page + docs/capabilities.md + docs/scope.md
- SCOPE.md: three seed capabilities documented (MCP registration, state tracking, SBOM)
- scope.template: Provided Capabilities section with example block
- scripts/ingest_capabilities.py + make ingest-capabilities[/-all] targets
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 21:07:50 +01:00
|
|
|
$(if $(REPO_PATH),--repo-path "$(REPO_PATH)") \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run)
|
|
|
|
|
|
|
|
|
|
ingest-capabilities-all:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/ingest_capabilities.py --all \
|
feat(capability-requests): add cross-domain capability catalog and request routing
Introduces a capability catalog (CUST-WP-0022) so domains can advertise what
they provide and agents can request capabilities from other domains with
auto-routing, lifecycle tracking, and task-unblocking on completion.
- New models: CapabilityCatalog, CapabilityRequest with full lifecycle
(requested → accepted → in_progress → ready_for_review → completed/rejected/withdrawn)
- Migration i6d7e8f9a0b1: capability_catalog + capability_requests tables
- Router /capability-catalog and /capability-requests with accept/status endpoints
- 7 new MCP tools: register_capability, list_capabilities, request_capability,
accept_capability_request, update_capability_request_status,
list_capability_requests, get_capability_request
- StateSummary gains open_capability_requests count
- Dashboard: capability-requests.md page + docs/capabilities.md + docs/scope.md
- SCOPE.md: three seed capabilities documented (MCP registration, state tracking, SBOM)
- scope.template: Provided Capabilities section with example block
- scripts/ingest_capabilities.py + make ingest-capabilities[/-all] targets
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 21:07:50 +01:00
|
|
|
$(if $(DRY_RUN),--dry-run)
|
|
|
|
|
|
2026-03-20 01:08:18 +01:00
|
|
|
## Check Repository Definition of Integrated (DoI) criteria for a repo.
|
|
|
|
|
## Usage: make check-doi REPO=llm-connect
|
|
|
|
|
## Or: make check-doi-all
|
|
|
|
|
## Add JSON=1 for machine-readable output.
|
|
|
|
|
check-doi:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required."; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/check_doi.py --repo "$(REPO)" $(if $(JSON),--json)
|
2026-03-20 01:08:18 +01:00
|
|
|
|
|
|
|
|
check-doi-all:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/check_doi.py --all $(if $(JSON),--json)
|
2026-03-20 01:08:18 +01:00
|
|
|
|
feat(tpsc): Third-Party Services Catalog (CUST-WP-0023)
Introduces TPSC for tracking external service dependencies with GDPR
compliance maturity (CNIL/IAPP CMMI scale), pricing model, ToS, and
data retention information across all repos.
Primary data:
- canon/tpsc/{openai,anthropic,gemini,openrouter}-api.yaml — service definitions
- tpsc.yaml in each repo (llm-connect seeded with 4 services)
State-hub additions:
- Migration j7e8f9a0b1c2: tpsc_catalog + tpsc_snapshots + tpsc_entries
- api/models/tpsc.py, api/schemas/tpsc.py, api/routers/tpsc.py
- /tpsc/catalog/, /tpsc/ingest/, /tpsc/snapshots/, /tpsc/report/gdpr endpoints
- 4 MCP tools: register_service, list_services, ingest_tpsc_tool, get_gdpr_report
- scripts/ingest_tpsc.py + make ingest-tpsc[/-all] targets
- Dashboard: tpsc.md page + docs/tpsc.md
GDPR maturity scale: unknown | non_compliant | initial | developing | defined | managed | certified
Warnings triggered at: unknown, non_compliant, initial
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:15:26 +01:00
|
|
|
## Ingest tpsc.yaml service declarations from a repo into the TPSC catalog.
|
|
|
|
|
## Usage: make ingest-tpsc REPO=llm-connect
|
|
|
|
|
## Or: make ingest-tpsc-all
|
|
|
|
|
## Add DRY_RUN=1 to preview without writing.
|
|
|
|
|
ingest-tpsc:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required."; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/ingest_tpsc.py --repo "$(REPO)" \
|
feat(tpsc): Third-Party Services Catalog (CUST-WP-0023)
Introduces TPSC for tracking external service dependencies with GDPR
compliance maturity (CNIL/IAPP CMMI scale), pricing model, ToS, and
data retention information across all repos.
Primary data:
- canon/tpsc/{openai,anthropic,gemini,openrouter}-api.yaml — service definitions
- tpsc.yaml in each repo (llm-connect seeded with 4 services)
State-hub additions:
- Migration j7e8f9a0b1c2: tpsc_catalog + tpsc_snapshots + tpsc_entries
- api/models/tpsc.py, api/schemas/tpsc.py, api/routers/tpsc.py
- /tpsc/catalog/, /tpsc/ingest/, /tpsc/snapshots/, /tpsc/report/gdpr endpoints
- 4 MCP tools: register_service, list_services, ingest_tpsc_tool, get_gdpr_report
- scripts/ingest_tpsc.py + make ingest-tpsc[/-all] targets
- Dashboard: tpsc.md page + docs/tpsc.md
GDPR maturity scale: unknown | non_compliant | initial | developing | defined | managed | certified
Warnings triggered at: unknown, non_compliant, initial
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:15:26 +01:00
|
|
|
$(if $(DRY_RUN),--dry-run)
|
|
|
|
|
|
|
|
|
|
ingest-tpsc-all:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/ingest_tpsc.py --all \
|
feat(tpsc): Third-Party Services Catalog (CUST-WP-0023)
Introduces TPSC for tracking external service dependencies with GDPR
compliance maturity (CNIL/IAPP CMMI scale), pricing model, ToS, and
data retention information across all repos.
Primary data:
- canon/tpsc/{openai,anthropic,gemini,openrouter}-api.yaml — service definitions
- tpsc.yaml in each repo (llm-connect seeded with 4 services)
State-hub additions:
- Migration j7e8f9a0b1c2: tpsc_catalog + tpsc_snapshots + tpsc_entries
- api/models/tpsc.py, api/schemas/tpsc.py, api/routers/tpsc.py
- /tpsc/catalog/, /tpsc/ingest/, /tpsc/snapshots/, /tpsc/report/gdpr endpoints
- 4 MCP tools: register_service, list_services, ingest_tpsc_tool, get_gdpr_report
- scripts/ingest_tpsc.py + make ingest-tpsc[/-all] targets
- Dashboard: tpsc.md page + docs/tpsc.md
GDPR maturity scale: unknown | non_compliant | initial | developing | defined | managed | certified
Warnings triggered at: unknown, non_compliant, initial
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:15:26 +01:00
|
|
|
$(if $(DRY_RUN),--dry-run)
|
|
|
|
|
|
2026-03-12 04:40:26 +01:00
|
|
|
## Run SBOM capture agent for a repo — generates/updates sbom-tools.yaml.
|
|
|
|
|
## Usage: make capture-tools REPO=railiance-infra [REPO_PATH=/home/worsch/railiance-infra]
|
|
|
|
|
## Add DRY_RUN=1 to preview without writing.
|
|
|
|
|
capture-tools:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required."; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/capture_sbom_tools.py --repo "$(REPO)" \
|
2026-03-12 04:40:26 +01:00
|
|
|
$(if $(REPO_PATH),--repo-path "$(REPO_PATH)") \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run)
|
2026-02-28 17:28:49 +01:00
|
|
|
|
feat(custodian): add ADR-001 compliance validator
Scripts, Makefile target, and MCP tool for checking a repository
against ADR-001 (workplans as repo artefacts, state-hub as cache).
Checks performed:
File-side: workplans/ dir exists, valid YAML frontmatter (required
fields, type, status, id format), filename matches id, embedded
task blocks have id/status/priority.
State-hub cross-reference: state_hub_workstream_id references
resolve to real DB records; orphan detection flags active DB
workstreams with no backing workplan file.
Usage:
make validate-adr REPO=<path> [DOMAIN=<slug>]
validate_repo_adr(repo_path, domain_slug?) # MCP tool
Running against the-custodian itself correctly surfaces the 4
pre-ADR-001 workstreams that still need workplan files written.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 12:00:09 +01:00
|
|
|
## Check a repo for ADR-001 compliance: make validate-adr REPO=/path/to/repo [DOMAIN=custodian]
|
|
|
|
|
validate-adr:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required. Usage: make validate-adr REPO=<path> [DOMAIN=<slug>]"; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/validate_repo_adr.py "$(REPO)" $(if $(DOMAIN),--domain "$(DOMAIN)",)
|
feat(custodian): add ADR-001 compliance validator
Scripts, Makefile target, and MCP tool for checking a repository
against ADR-001 (workplans as repo artefacts, state-hub as cache).
Checks performed:
File-side: workplans/ dir exists, valid YAML frontmatter (required
fields, type, status, id format), filename matches id, embedded
task blocks have id/status/priority.
State-hub cross-reference: state_hub_workstream_id references
resolve to real DB records; orphan detection flags active DB
workstreams with no backing workplan file.
Usage:
make validate-adr REPO=<path> [DOMAIN=<slug>]
validate_repo_adr(repo_path, domain_slug?) # MCP tool
Running against the-custodian itself correctly surfaces the 4
pre-ADR-001 workstreams that still need workplan files written.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 12:00:09 +01:00
|
|
|
|
2026-06-07 19:49:17 +02:00
|
|
|
## Consistency exit contract:
|
|
|
|
|
## - Direct scripts/consistency_check.py: 0 clean, 2 warnings-only, 1 failures.
|
|
|
|
|
## - Agent/operator Make wrappers below normalize warning-only 2 to shell success
|
|
|
|
|
## while preserving visible WARN output and keeping real failures non-zero.
|
2026-03-16 16:30:55 +01:00
|
|
|
## Check a single repo for ADR-001 consistency: make check-consistency REPO=the-custodian [REPO_PATH=/override]
|
2026-06-07 19:49:17 +02:00
|
|
|
## Exit 0 = clean or warnings-only (warnings stay visible), exit 1 = failures
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
check-consistency:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required. Usage: make check-consistency REPO=<slug>"; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py --repo "$(REPO)" \
|
2026-03-16 16:30:55 +01:00
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",) \
|
2026-03-20 23:48:13 +01:00
|
|
|
$(if $(REPO_PATH),--repo-path "$(REPO_PATH)",); \
|
|
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
|
2026-03-16 16:30:55 +01:00
|
|
|
## Check and auto-fix a single repo: make fix-consistency REPO=the-custodian [REPO_PATH=/override]
|
2026-06-07 19:49:17 +02:00
|
|
|
## Exit 0 = clean or warnings-only (warnings stay visible), exit 1 = failures
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
fix-consistency:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required. Usage: make fix-consistency REPO=<slug>"; exit 1)
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py --repo "$(REPO)" --fix \
|
2026-03-16 16:30:55 +01:00
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",) \
|
2026-03-20 23:48:13 +01:00
|
|
|
$(if $(REPO_PATH),--repo-path "$(REPO_PATH)",); \
|
|
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
|
2026-06-22 23:15:15 +02:00
|
|
|
## Normalize workplan frontmatter and task status literals in attached repos.
|
|
|
|
|
## Usage: make normalize-attached-workplans REPO=artifact-store
|
|
|
|
|
## make normalize-attached-workplans DIRTY=1
|
|
|
|
|
normalize-attached-workplans:
|
|
|
|
|
$(UV) run python scripts/normalize_attached_repo_workplans.py \
|
|
|
|
|
$(if $(REPO),--repo "$(REPO)",) \
|
|
|
|
|
$(if $(DIRTY),--dirty,) \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run,)
|
|
|
|
|
@test -n "$(REPO)$(DIRTY)" || (echo "ERROR: set REPO=<slug> or DIRTY=1"; exit 1)
|
|
|
|
|
|
|
|
|
|
## Regenerate AGENTS.md / CLAUDE.md / .claude/rules from templates.
|
|
|
|
|
## Usage: make update-agent-instructions REPO=artifact-store
|
|
|
|
|
## make update-agent-instructions DIRTY=1
|
|
|
|
|
update-agent-instructions:
|
|
|
|
|
$(UV) run python scripts/update_agent_instruction_files.py \
|
|
|
|
|
$(if $(REPO),--repo "$(REPO)",) \
|
|
|
|
|
$(if $(DIRTY),--dirty,)
|
|
|
|
|
@test -n "$(REPO)$(DIRTY)" || (echo "ERROR: set REPO=<slug> or DIRTY=1"; exit 1)
|
|
|
|
|
|
2026-05-23 13:59:05 +02:00
|
|
|
## Reconcile measured token sources against State Hub.
|
|
|
|
|
## Usage: make token-reconcile [SINCE=2026-05-19] [APPLY=1] [ZERO_FALLBACKS=1]
|
|
|
|
|
token-reconcile:
|
|
|
|
|
$(PYTHON) scripts/token_reconcile.py \
|
|
|
|
|
$(if $(SINCE),--since "$(SINCE)",) \
|
|
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",) \
|
|
|
|
|
$(if $(CODEX_HOME),--codex-home "$(CODEX_HOME)",) \
|
|
|
|
|
$(if $(CLAUDE_HOME),--claude-home "$(CLAUDE_HOME)",) \
|
|
|
|
|
$(if $(APPLY),--apply,) \
|
|
|
|
|
$(if $(ZERO_FALLBACKS),--zero-superseded-fallbacks,)
|
|
|
|
|
|
2026-03-26 14:38:30 +01:00
|
|
|
## Pull then fix: single repo or all repos if REPO omitted
|
|
|
|
|
## make fix-consistency-remote — smart pull+fix all repos that need it
|
|
|
|
|
## make fix-consistency-remote REPO=slug — pull+fix one repo
|
2026-03-26 10:19:23 +01:00
|
|
|
fix-consistency-remote:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py \
|
2026-03-26 14:38:30 +01:00
|
|
|
$(if $(REPO),--repo "$(REPO)",--all) \
|
|
|
|
|
--remote \
|
|
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",) \
|
|
|
|
|
$(if $(NO_WRITEBACK),--no-writeback,); \
|
|
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
2026-03-26 10:19:23 +01:00
|
|
|
|
2026-03-28 23:28:22 +01:00
|
|
|
## Infer repo slug from git remote URL and check: make check-consistency-here [REPO_PATH=/path/to/repo]
|
|
|
|
|
## Omit REPO_PATH to use the Python script's CWD (i.e. pass an empty --here flag).
|
|
|
|
|
check-consistency-here:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py \
|
2026-03-28 23:28:22 +01:00
|
|
|
--here $(if $(REPO_PATH),"$(REPO_PATH)",) \
|
|
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",); \
|
|
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
|
|
|
|
|
|
|
|
|
## Infer repo slug from git remote URL and fix: make fix-consistency-here [REPO_PATH=/path/to/repo]
|
|
|
|
|
fix-consistency-here:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py \
|
2026-03-28 23:28:22 +01:00
|
|
|
--here $(if $(REPO_PATH),"$(REPO_PATH)",) \
|
|
|
|
|
--fix \
|
|
|
|
|
$(if $(API_BASE),--api-base "$(API_BASE)",); \
|
|
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
|
|
|
|
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
## Check all registered repos for ADR-001 consistency
|
|
|
|
|
check-consistency-all:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py --all $(if $(API_BASE),--api-base "$(API_BASE)",); \
|
2026-03-20 23:48:13 +01:00
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
|
|
|
|
|
## Check and auto-fix all registered repos
|
|
|
|
|
fix-consistency-all:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/consistency_check.py --all --fix $(if $(API_BASE),--api-base "$(API_BASE)",); \
|
2026-03-20 23:48:13 +01:00
|
|
|
e=$$?; [ $$e -eq 2 ] && exit 0 || exit $$e
|
feat(consistency): implement ADR-001 consistency checking engine (CUST-WP-0008)
Adds state-hub/scripts/consistency_check.py with C-01 through C-12 checks:
bidirectional file↔DB validation, --fix for auto-fixable issues, --all for all
repos, --json output, exit codes 0/1/2.
MCP tool: check_repo_consistency(repo_slug, fix=False)
Makefile: check-consistency, fix-consistency, check-consistency-all, fix-consistency-all
Auto-fixes applied across all repos:
- C-09: activity-core-foundation + activity-core-triggers-ops repo_id → activity-core
- C-04: railiance phase-0-operational-baseline status → completed
- C-05: railiance phase-0 title synced from file
- C-10/C-11: task status drifts resolved; state_hub_task_id injected into
CUST-WP-0006 and CUST-WP-0007 task blocks
Remaining orphans reported for human review: repo-integration-activity-core,
infospace-s3-closeout, testdrive-jsui-publication, staged-promotion-lifecycle,
three-phoenix-ha-cluster, current-env-safety-net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 08:16:00 +01:00
|
|
|
|
2026-03-02 00:32:35 +01:00
|
|
|
## Cancel open tasks belonging to completed/archived workstreams.
|
|
|
|
|
## Safe to run at any time; also suitable for a daily cron job.
|
2026-05-17 20:01:21 +02:00
|
|
|
## Cron example: 0 3 * * * cd ~/state-hub && make cleanup-stale
|
2026-03-02 00:32:35 +01:00
|
|
|
cleanup-stale:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/cleanup_stale_tasks.py
|
2026-03-02 00:32:35 +01:00
|
|
|
|
2026-03-16 01:41:16 +01:00
|
|
|
## Install custodian post-commit sync hook into one repo: make install-hooks REPO=marki-docx
|
|
|
|
|
install-hooks:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required. Usage: make install-hooks REPO=<slug>"; exit 1)
|
|
|
|
|
bash scripts/install_hooks.sh --repo "$(REPO)"
|
|
|
|
|
|
|
|
|
|
## Install custodian post-commit sync hook into all active registered repos
|
|
|
|
|
install-hooks-all:
|
|
|
|
|
bash scripts/install_hooks.sh --all
|
|
|
|
|
|
|
|
|
|
## Remove custodian post-commit sync hook from one repo: make remove-hooks REPO=marki-docx
|
|
|
|
|
remove-hooks:
|
|
|
|
|
@test -n "$(REPO)" || (echo "ERROR: REPO is required. Usage: make remove-hooks REPO=<slug>"; exit 1)
|
|
|
|
|
bash scripts/install_hooks.sh --repo "$(REPO)" --remove
|
|
|
|
|
|
|
|
|
|
## Compare Gitea coulomb org repos against state-hub registered repos
|
|
|
|
|
## Requires GITEA_TOKEN in env or .env: make gitea-inventory GITEA_TOKEN=<token>
|
|
|
|
|
gitea-inventory:
|
2026-06-07 19:49:17 +02:00
|
|
|
$(UV) run python scripts/gitea_inventory.py $(if $(JSON),--json)
|
2026-03-16 01:41:16 +01:00
|
|
|
|
2026-06-22 13:52:13 +02:00
|
|
|
## Register/update one repo from .repo-classification.yaml:
|
|
|
|
|
## make register-from-classification REPO=state-hub
|
|
|
|
|
## make register-from-classification PATH=/path/to/repo
|
|
|
|
|
## Optional: DRY_RUN=1
|
|
|
|
|
register-from-classification:
|
|
|
|
|
@test -n "$(REPO)" -o -n "$(PATH)" || (echo "ERROR: REPO or PATH is required."; exit 1)
|
|
|
|
|
$(UV) run python scripts/register_from_classification.py \
|
|
|
|
|
$(if $(PATH),--repo-path "$(PATH)",--slug "$(REPO)") \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run,)
|
|
|
|
|
|
|
|
|
|
## Bulk register/update all active repos with accessible local paths
|
|
|
|
|
register-from-classification-all:
|
|
|
|
|
$(UV) run python scripts/register_from_classification.py --bulk \
|
|
|
|
|
$(if $(DRY_RUN),--dry-run,)
|
|
|
|
|
|
Add state-hub v0.1 — local-first state service for the Custodian
Implements the first live layer of the Custodian cognitive infrastructure:
PostgreSQL schema, FastAPI REST API, FastMCP stdio server, and Observable
Framework telemetry dashboard.
- state-hub/: full stack (docker-compose, FastAPI, Alembic, MCP server, dashboard)
- 5 DB tables: topics, workstreams, tasks, decisions, progress_events
- 11 MCP tools + 5 resources registered in .mcp.json
- Observable dashboard: Overview, Workstreams, Decisions, Progress pages
- CLAUDE.md: session protocol (get_state_summary / add_progress_event ritual)
- ~/.claude/CLAUDE.md: global cross-project reference to the hub
- scripts/pull_image.py: WSL2 TLS-resilient Docker image downloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 17:47:49 +01:00
|
|
|
clean:
|
|
|
|
|
$(COMPOSE) down -v
|