Files
multi-agent-mux/deploy/gitea-ci.yml
T
GodopuandClaude Opus 5.5 47fe24e07c feat: multi-agent-mux-update skill and in-place install (Issue #72)
The update is a skill (decision 4); deploy/update.sh and the installed
.mam_deploy/update.sh are gone.

- Phase 1 (installed code, update.sh): publish the update marker under the
  exclusive admission lock; refuse before any change while a running row, a
  live herdr agent in the workspace on any running server, an open job
  (unreadable JSON included, dry_run not), a live loop marker or a
  monitor.lock held by a monitor the skills did not start (U3) is there - the
  calling agent (server + pane, its row and one running job) excepted
  (lib_py/update.py precheck, decisions 1 and 7). Stop the monitor (TERM, then
  KILL and restart it if it does not end; decision 2), handle a leftover
  backup by its state (U4), back up .agents, .mam_deploy, root files, .venv,
  the installer's .mam files and the registry (SQLite backup API under the
  registry lock) into .mam/update-backup/, then exec a copy of
  install_phase.sh outside the tree (decision 5).
- The copy (no lib.sh/lib_py, bash 3.2) runs the installer in place; on
  failure it restores the backup and restarts the monitor from the restored
  tree; on success it runs phase 2, post_update.sh of the new tree, which
  converts the registry with lib_py.registry_format and restarts the monitor
  if it ran. The backup and the marker are removed at the end.
- install.sh updates in place (decisions 3, 4, 9): install_state keys are set,
  one line each; no updater is installed and an old one (.mam_deploy/update.sh,
  or a root update.sh the manifest lists) is removed; framework files the new
  version no longer ships are deleted when unmodified, kept and listed when
  modified, and dropped from base/, the manifest and asset_hashes.txt; a local
  source's .mam is not staged. remove.sh knows the new skill; CI shellchecks
  its scripts; docs point at the skill.
- test_issue8_update_state and test_deploy_layout td6/td27 run the skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 04:06:57 +00:00

114 lines
4.3 KiB
YAML

# ==============================================================================
# Gitea Actions CI/CD Workflow Template
# ==============================================================================
# Place this file in '.gitea/workflows/ci.yml' or use it directly in Gitea's CI.
# It automatically validates shell scripts and checks Python formatting/syntax.
# ==============================================================================
name: Multi-Agent Mux CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main ]
jobs:
lint-shell:
name: Lint Shell Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install ShellCheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Run ShellCheck
run: |
echo "🔍 Linting shell scripts..."
shellcheck .agents/skills/lib.sh
shellcheck .agents/skills/multi-agent-mux-create/scripts/create_session.sh
shellcheck .agents/skills/multi-agent-mux-stop/scripts/stop_session.sh
shellcheck .agents/skills/multi-agent-mux-monitor/scripts/reconcile.sh
shellcheck .agents/skills/multi-agent-mux-loop/scripts/run_loop.sh
shellcheck .agents/skills/multi-agent-mux-loop/scripts/diff_collect.sh
shellcheck .agents/skills/multi-agent-mux-loop/scripts/loop_lock.sh
shellcheck .agents/skills/multi-agent-mux-orc-onboard/scripts/orc_onboard.sh
shellcheck .agents/hooks/loop_delegation_guard.sh
shellcheck deploy/lib_ownership.sh
shellcheck deploy/install.sh
shellcheck deploy/install_mam.sh
shellcheck deploy/generate-env.sh
shellcheck .agents/skills/multi-agent-mux-update/scripts/*.sh
shellcheck deploy/remove.sh
echo "✅ ShellCheck completed successfully."
lint-python:
name: Lint Python Backplane
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pylint
if [ -f .agents/skills/multi-agent-mux-delegate-job/requirements.txt ]; then
pip install -r .agents/skills/multi-agent-mux-delegate-job/requirements.txt
fi
- name: Run Flake8 (Syntax/Error Check)
run: |
echo "🔍 Checking Python syntax with flake8..."
flake8 .agents/skills/multi-agent-mux-delegate-job/scripts/ .agents/skills/lib_py/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 .agents/skills/multi-agent-mux-delegate-job/scripts/ .agents/skills/lib_py/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run Python Syntax Check (Compile test)
run: |
echo "🔍 Verifying Python file compilation..."
python -c "import py_compile, glob; [py_compile.compile(f, doraise=True) for f in glob.glob('.agents/skills/lib_py/**/*.py', recursive=True) + glob.glob('.agents/skills/multi-agent-mux-delegate-job/scripts/*.py')]"
echo "✅ All Python files compiled successfully."
test:
name: Run Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Test Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then
pip install -r requirements-dev.txt
else
pip install pytest
fi
if [ -f .agents/skills/multi-agent-mux-delegate-job/requirements.txt ]; then
pip install -r .agents/skills/multi-agent-mux-delegate-job/requirements.txt
fi
- name: Run Pytest
run: |
echo "🧪 Running full test suite..."
pytest tests/ -q