بنقرة واحدة
agilab-runbook
Runbook for working in the AGILab repo (uv, Streamlit, run configs, packaging, troubleshooting).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Runbook for working in the AGILab repo (uv, Streamlit, run configs, packaging, troubleshooting).
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Maintain repo-managed agent skills across `.claude/skills` and `.codex/skills`, including targeted sync, validation, index regeneration, drift checks, and Tokki skill visibility. Use when adding or updating a shared skill, migrating a user-managed skill into the repo, or reconciling agent skill copies without overwriting unrelated skills.
Review AGILAB changes for security hardening risks. Use when code, docs, or workflows touch installers, Streamlit exposure, cluster/SSH/share behavior, app execution, notebooks, LLM connectors, secrets, PyPI/GitHub/Hugging Face publishing, dependency policy, or external repositories.
Route terse AGILAB operator requests such as "do it", "review AGILAB", "next move", "update repos", "merge it", "check again", "release", and "cluster validation" into the right repo skills, safety mode, validation depth, and output contract using session-derived policy.
Streamlit page authoring patterns for AGILAB (session_state safety, keys, rerun, UX).
Create, edit, inspect, or explain presentation slide decks (`.pptx`) with PptxGenJS, bundled layout helpers, and render/validation utilities. Use when tasks involve building a new PowerPoint deck, recreating slides from screenshots/PDFs/reference decks, modifying content while preserving editable output, extracting or explaining a specific slide, adding charts/diagrams/visuals, or diagnosing layout issues such as overflow, overlaps, and font substitution.
Produce deep AGILAB audit and code-review artifacts with evidence-backed findings, mandatory architecture-foundation readiness, blast-radius tracing, security/test posture, and prioritized recommendations. Use when the user says "review AGILAB", "audit AGILAB", "code review AGILAB", "deep review", "architecture review", "security review", asks for a review document, or asks for comparison-quality critique rather than a quick fix.
| name | agilab-runbook |
| description | Runbook for working in the AGILab repo (uv, Streamlit, run configs, packaging, troubleshooting). |
| license | BSD-3-Clause (see repo LICENSE) |
| metadata | {"short-description":"AGILab repo runbook","updated":"2026-06-19T00:00:00.000Z"} |
Use this skill when you need repo-specific “how we do things” guidance in agilab/: launching Streamlit, regenerating run-config wrappers, debugging installs, or preparing releases.
uv for all runs so dependencies resolve in managed envs:
uv --preview-features extra-build-dependencies run python …uv --preview-features extra-build-dependencies run --extra ui streamlit …uvx: do not run uvx agilab from this checkout (it will run the published wheel and ignore local changes).pkill, killall, pkill -f, or port-based kill pipelines that can match unrelated sessions. Stop only verified PIDs or tool sessions created for the active task. Do not use Codex CLI control shortcuts such as /stop, Esc interruption, or terminal-close actions to manage background terminals unless the terminal/session was created by this active task and its identity is verified. A status banner that says a background terminal is running is not ownership proof. If a port is busy, choose another port or ask before stopping its owner; do not try to "pause" another Codex CLI session from here.tokki run -- <command> so noisy output is digested and full logs stay in private artifacts. Use raw commands instead when a tool needs live streaming, TTY interaction, structured stdout, or exact unwrapped behavior../dev <shortcut> for repeated local validation loops. The
top shortcuts are impact for impact validation, bugfix for impact plus a fast GA-selected
regression run, test for targeted pytest -q, regress for GA-selected fast regression subsets,
builtin-app-tests for app-local built-in app pytest suites, flow for one or more workflow
parity profiles, badge for the explicit release/pre-release coverage-badge guard, and docs
for docs mirror sync plus stamp verification. impact tells you
what must be validated, test runs the narrow pytest slice, bugfix is the default low-load
pre-push loop for normal code fixes, regress optimizes a likely regression subset from changed
files and optional JUnit timings, builtin-app-tests runs each built-in app's tests inside that
app's own uv --project . environment with pytest importlib collection, flow matches local
GitHub workflow profiles, badge checks badge freshness when intentionally requested, and docs
keeps the public mirror aligned. Add --print-only to inspect the expanded commands..idea/runConfigurations/*.xml, regenerate wrappers:
uv --preview-features extra-build-dependencies run python tools/generate_runconfig_scripts.pyuv (agilab) is global and
should point to one AGILAB source checkout at a time. To intentionally switch PyCharm
execution to another checkout, run from the target checkout:
uv syncAGILAB_PYCHARM_ALLOW_SDK_REBIND=1 uv --preview-features extra-build-dependencies run python pycharm/setup_pycharm.py
Do not rerun full install.sh just to switch PyCharm roots; use it only when installer
side effects are needed, such as app installation, .agilab-path updates, dataset
seeding, or install-time tests.$HOME/agi-space/apps/builtin/<app>/.venv in the ORCHESTRATE header, treat it as a
bootstrap/root-selection bug until proven otherwise. Check the active process root,
PyCharm SDK binding, sys.path, ~/.local/share/agilab/.agilab-path, and persisted
~/.agilab/.env keys such as APPS_PATH and IS_SOURCE_ENV. Restart Streamlit after
fixing bootstrap code because st.session_state["env"] and env.active_app can retain
stale paths across reruns.workers_data_path, but canonical share-root storage and app
data_in / data_out resolution belong to the shared worker runtime:
runtime_misc_support.initialize_runtime_state, BaseWorker._resolve_data_dir,
and agi_node.agi_dispatcher.base_worker_path_support. The canonical workflow share
root passed as workers_data_path is clustershare/<user>/<workflow-id>/<session>. App module
subdirectories are appended by app arguments, where the module is the project name without
the _project suffix, yielding clustershare/<user>/<workflow-id>/<session>/<module>/...
for app data. Do not fix duplicated paths such as <module>/<module>/dataset, stale
<project>/<session>/workers, or UI value re-aggregation in one app page only. Fix the
shared resolver when the failure class is generic, keep UI fixes limited to default
selection/persistence, and add regressions at both test_base_worker_path_support.py and
test_base_worker.py plus a focused UI test only when the default/persisted value changes.
Do not preserve backward compatibility for the legacy /workers layout unless an explicit
migration request requires it.agilab run (dev) prints Uninstalled ... or Installed ..., inspect both
the outer run-config command and any launcher-spawned inner uv run command.
The selected default app is not the cause; uv is reconciling the project
environment or the ui extra. Runtime launchers should preserve UV_NO_SYNC
and use uv run --no-sync for the inner Streamlit command. Do dependency
bootstrap explicitly with uv sync --extra ui or a clearly named sync flag
before launch, not silently during normal UI startup.Install PyPI app flow or agilab app search/check/install/list/update/remove.
This route installs agi-app-* packages into the selected Python environment and
discovers apps from agilab.apps entry points. It is separate from APPS_REPOSITORY,
which remains the source-checkout route for editable app repositories.APPS_REPOSITORY, run the app installer directly from src/agilab.
Use APPS_REPOSITORY=/path/to/apps-repo AGILAB_DEV_APPS_REPOSITORY=1 BUILTIN_APPS=__AGILAB_ALL_APPS__ ./install_apps.sh
for all installable source apps and add --test-apps for app tests. Use a
comma-separated BUILTIN_APPS value for a subset, even for repository apps,
because this is the script's model-free selection contract. On Windows, use
the matching install_apps.ps1 -TestApps command with the same environment
variables. Do not replace this with a root reinstall, hand-edited
~/.agilab/.env, or manual pytest loops..idea/modules/, .idea/modules.xml, and
.idea/pyProjectModel.xml as local/generated IDE state. Tracked .idea/modules/*.iml
files should be removed from Git and regenerated by pycharm/setup_pycharm.py.
After setup, the aligned state is:
.idea/*.iml.idea/**/*@*.iml or .idea/**/*#*.imlmodules.xml only references valid $PROJECT_DIR$/.idea/modules/*.iml files.idea/modules/ exists locally but is ignored
If PyCharm is open and recreates duplicate module descriptors, do not kill user-owned
IDE/processes; rerun setup and remove only the stale root/numbered descriptors and
their modules.xml refs.pytest, isolated coverage commands,
py_compile, Sphinx builds, or publish dry-runs. Reserve coverage badge generation for
release/pre-release validation or badge tooling changes. Use CI only for GitHub-only behavior such
as runner differences, OS/Python matrix coverage, permissions/secrets, or the final publish/deploy step../dev --print-only release, .github/workflows/pypi-publish.yaml, and
tools/release_plan.py before saying whether PyPI, GitHub release assets,
Hugging Face sync, release proof, or docs updates are separate manual steps.
If the workflow already performs a step, state its condition instead of adding
a redundant manual follow-up.uv --preview-features extra-build-dependencies run python tools/impact_validate.py --staged
before editing further or pushing. Use its output to decide:
git config core.hooksPath .githooks enabled. The hook
uses tools/pre_push_changed_files.py to run docs mirror checks only for docs mirror inputs,
release-proof checks only for release-proof inputs, and agent-instruction contract checks only
for AGENTS/runbook/skill/discovery inputs. If classification fails, it runs all local guards.
Coverage badge freshness remains an explicit ./dev badge or release/pre-release check.README.md and README.pypi.md aligned with the actual repository guard. If
the public badge moves to a Ruff changed-files guard or another style tool,
update both README files, grep for stale Black, black, or code%20style
badge text, and avoid advertising a tool that is not wired into the local
validation path.dir="$HOME/log/install_logs"; f=$(ls -1t "$dir"/*.log 2>/dev/null | head -1); [ -n "$f" ] && echo "Log: $f" && grep -Eai "error|exception|traceback|failed|fatal|denied|missing|not found" "$f" | tail -n 25 || echo "No logs found."
On Windows PowerShell:
($d = "$HOME\log\install_logs"); $f = Get-ChildItem -LiteralPath $d -File | Sort-Object LastWriteTime -Descending | Select-Object -First 1; if ($f) { Write-Host "Log:" $f.FullName; Select-String -LiteralPath $f.FullName -Pattern '(?i)(error|exception|traceback|failed|fatal|denied|missing|not found)' | Select-Object -Last 25 | ForEach-Object { $_.Line } } else { Write-Host "No logs found." }repo-guardrails clean install matrix are
expected to work on Windows. The source checkout installer still includes POSIX shell paths, so
prefer WSL2 for that path unless the task explicitly targets install.ps1 or native Windows
parity. Do not remove the Windows classifier only because a source install.sh path needs WSL2.shell=False; avoid POSIX-only shlex.quote strings for commands
that may run on Windows. For clone/app-repository links, allow Windows directory junction fallback
when symlink creation is denied, and treat missing link privileges as a recoverable condition
where possible.net use credentials. BaseWorker should
attempt network-drive mapping only when AGILAB_WINDOWS_NET_USE_USER and
AGILAB_WINDOWS_NET_USE_PASSWORD are set, with AGILAB_WINDOWS_NET_USE_DRIVE optionally selecting
the drive letter. Missing credentials should skip mapping with an informational log..venv by symlink for lightweight local experiments.venv and rerun INSTALL before EXECUTE
Do not treat a shared .venv clone as a durable environment, and do not leave renamed projects
with .venv symlinks pointing at the old project path.src/agilab/core/agi-env, src/agilab/core/agi-node, src/agilab/core/agi-cluster,
src/agilab/core/agi-core, shared installer/build/deploy code, and generic helpers reused across apps/pages.
Prefer app-local fixes first. If a core edit looks necessary, stop and explain the required files,
blast radius, and validation plan before making the change.../thales_agilab/docs/source relative to the active AGILAB checkout.docs/html (including docs/html/_sources)
as build output only. Do not hand-edit files in docs/html; always edit source
first and regenerate from ../thales_agilab/docs/source.
uv --preview-features extra-build-dependencies run --project ../thales_agilab --group sphinx python -m sphinx -b html ../thales_agilab/docs/source docs/htmlst.experimental_rerun(); use st.rerun.BaseWorker exposes the shared artifact contract, so DagWorker, PandasWorker, PolarsWorker,
and app workers can call record_artifact(...), record_metric(...), and write_manifest(...)
to produce standard worker evidence without adding dataframe or UI dependencies..claude/skills/ and .codex/skills/
must stay AGILAB-specific, cross-repo reusable for AGILAB work, or directly support this
repository’s workflows. Personal skills or skills for non-AGILAB domains belong in
~/.codex/skills/ or the relevant private repo.bash block
with concrete git -C <repo> commands for each targeted checkout. In AGILAB maintenance, the
default target set is the active agilab checkout plus the sibling ../thales_agilab canonical
docs/apps checkout when it exists; include both in the printed plan or explicitly say why one is
missing, unsafe, or out of scope. Use the fast path by default:
status --porcelain=v1 --untracked-files=no, fetch --prune, rev-list --left-right --count HEAD...@{u}, then merge --ff-only @{u} only for repos that are actually behind. This avoids a
redundant fetch from git pull and avoids slow untracked scans. Group independent repo checks and
fetches in parallel when the tooling allows it. If a checkout has tracked dirty paths, do not
merge it until the dirty paths are reported and the update plan is adjusted. If a dirty feature
checkout blocks direct update of a repo's main, check whether a clean registered main worktree
exists before omitting that repository from the update.Agent Metadata
section with the Tokki version (tokki --version, or not used/unavailable),
agent/runtime name and version when exposed, model name, reasoning effort, and
whether /fast mode was used. Do not infer missing values; write unknown,
unavailable, or not used explicitly.Review Evidence when model or sub-agent review was used, naming the
reviewer model, result, and whether findings were addressed. If sub-agents were
used, state their role/model and whether they edited files or reviewed only.
Bugfix PRs must include Repro, Root Cause, and Regression Test sections;
if automation is impractical, say why and name the closest validation. Any
skipped check must include a reason such as not applicable, GitHub skipped,
or manual validation only. Before marking a PR ready or merging, update the
body if review, CI, validation, or skip status changed after PR creation..external/agilab at a stale AGILAB core branch and GitHub reports that
the branch has no history in common with current main, do not force-merge or
preserve the stale branch by default. Fetch the public AGILAB remote, check
whether the intended fix already exists on origin/main, move the external
pointer to the current public origin/main when it does, rerun the full
private app-local validation against that pointer, then commit only the
pointer update in the integration repository. After the pointer commit is
pushed and validated, delete the stale unmergeable public branch.git -C <worktree> status --short and the branch relationship to
origin/main. If dirty changes are obsolete but still worth preserving, archive
git -C <worktree> diff --binary plus a status snapshot outside the repo before removal. Remove
only clean worktrees or dirty worktrees with an explicit archive path, then run git worktree prune, delete stale branch refs that are already represented on origin/main, and realign local
main to origin/main when the old main worktree has been removed safely..venv, caches, build artifacts).git/objects, .git/lfs).git only, do not touch .venv.du -sh .git .git/objects .git/lfsgit count-objects -vHgit lfs prune --dry-rungit lfs prune when the dry-run shows meaningful reclaimable space.git/lfs without rewriting historygit filter-repo, never ad hoc low-level object surgery--mirror clone, not in the main checkoutgit bundle create /tmp/<repo>-pre-rewrite.bundle --allgh-pages or unrelated refs unless requestedorigin/* history and run:
git reflog expire --expire=now --allgit gc --prune=nowdocs/html/**.idea/shelf/**cd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run python tools/impact_validate.py --stagedcd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run python tools/impact_validate.py --files src/agilab/orchestrate_execute.py test/test_orchestrate_execute.pycd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run --extra ui streamlit run src/agilab/main_page.py -- --openai-api-key "…" --apps-path src/agilab/appscd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run python tools/smoke_preinit.py --active-app src/agilab/apps/builtin/flight_project --timeout 20cd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run pytest -q test/test_view_maps_network.pyagilab first-proof --json --with-ui or the equivalent source command
to create ~/log/execute/flight_telemetry/run_manifest.jsonagilab adoption-report for the human checkpoint, or
agilab adoption-report --json --strict for automationsafe_to_expand=true as permission to try the next demo/notebook lane,
not as production, shared-workstation, secrets, public-exposure, or cluster approvalagi-core
notebooks/lab_stages.ipynb, compatibility-report output, and redacted
strict security-check output together. The notebook handoff removes
dependence on the AGILAB UI/distributed-worker layer, but it still relies on
the stable core runtime and the exported project's dependencies.agilab app search flightagilab app check agi-app-flight-telemetry --jsonagilab app install agi-app-flight-telemetryagilab app list, agilab app update <package>,
agilab app remove <package>cd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run python tools/pypi_publish.py --repo testpypi --dry-run --verbosecd "$PROJECT_DIR" && uv --preview-features extra-build-dependencies run python tools/pypi_publish.py --repo pypi --verbose --git-tag --git-commit-version --git-reset-on-failure
gh) because tools/pypi_publish.py creates or updates the matching GitHub Release after pushing the tag..postN when the date version already
exists. Normal public releases should move to a deliberate new date-based
version or a release candidate/TestPyPI rehearsal first. Public .postN
releases are forbidden for new AGILAB publications; use release_mode=hotfix
with YYYY.MM.DD.N for a same-day public fix.agilab artifact may already exist while split runtime/app/page packages still need publication. Let the preflight/release plan decide what remains instead of checking only the root package.--delete-former-github-release only when the public release page should keep a single current GitHub Release. This deletes the previous GitHub Release entry after the new one is created, but keeps the previous git tag and PyPI files.--delete-pypi-release <version> only when a specific old PyPI version must be removed from the selected packages. This uses an exact pypi-cleanup --version-regex match, requires real PyPI web-login credentials in [pypi_cleanup], and cannot use API tokens or trusted publishing credentials.https://pypi.org/ from a normal browser profile on the
maintainer machine, keep PyPI cookies/site data, and add the Mac Touch ID/passkey under
PyPI account two-factor security-device settings if needed. Do not commit passwords,
recovery codes, cookies, browser profiles, or PyPI session material.cancelled, fetch and compare the cancelled run head SHA with current
origin/main before debugging. A newer push often supersedes coverage on main; follow
the current head's run instead of fixing a cancelled predecessor unless the same failure
reproduces on the latest head.main:
https://github.com/ThalesGroup/agilab/actions/workflows/ci.yml/badge.svg?branch=mainuv --preview-features extra-build-dependencies run python - <<'PY' ... https://api.github.com/repos/ThalesGroup/agilab/actions/workflows/ci.yml/runs?per_page=10 ... PYbadges/:
https://raw.githubusercontent.com/ThalesGroup/agilab/main/badges/pypi-version-agilab.svghttps://pypi.org/pypi/agilab/jsonhttps://pypi.org/simple/agilab/gh release list --limit 5 and gh release view <tag>https://raw.githubusercontent.com/ThalesGroup/agilab/main/badges/pypi-version-agilab.svguv --refresh-package agilab or a fresh cache before
declaring the publish broken.agi-pages / agi-apps umbrellas,
and the top-level agilab package. Do not check only pypi-agi-apps or
pypi-agi-pages; a green umbrella publish can still hide a missing payload
such as pypi-agi-app-flight-project./deployments/pypi page can stay red from older releases because
the current Trusted Publisher/OIDC claim intentionally no longer uses the
generic pypi GitHub environmentuv --preview-features extra-build-dependencies run python tools/release_plan.py --check-workflow .github/workflows/pypi-publish.yamlpypi deployment, confirm it has no rules,
secrets, or variables:
gh api repos/ThalesGroup/agilab/environments/pypi, gh secret list --repo ThalesGroup/agilab --env pypi, and gh variable list --repo ThalesGroup/agilab --env pypipypi environment is only stale legacy status, mark its
latest failed deployment inactive and point the status at the successful
pypi-publish run; do not rewrite a genuinely failed deployment as
successcd /tmp && uv run --refresh-package agilab --no-project --with agilab==<version> python -c "import importlib.metadata as m; print(m.version('agilab'))"cd /tmp && uv --preview-features extra-build-dependencies run --refresh-package agilab --no-project --with 'agilab[examples]==<version>' python -m agilab.lab_run first-proof --json --max-seconds 60agilab[examples] for packaged first-proof smoke; the base agilab
wheel is intentionally lean and may not install demo payload dependencies.sync-hf-space job after GitHub
release assets. It deploys the Hugging Face Space, runs the hosted smoke test,
and records the Space commit in release proof when
needs.release-plan.outputs.pypi_publish_selected == 'true' and
needs.publish-release-assets.result == 'success'. Do not add a separate
manual HF sync step to a release plan unless that job failed, was skipped by
selected package scope, or the user explicitly asks for an out-of-band Space
redeploy.main, PyPI, the README, and release metadata stay aligned.src/agilab/test step is more stable when run from the source tree instead of the full project environment:
PYTHONPATH='src' COVERAGE_FILE=.coverage.agilab uv --preview-features extra-build-dependencies run --no-project --with pytest --with pytest-cov --with toml --with packaging python -m pytest ... --ignore=src/agilab/test/test_model_returns_code.py src/agilab/testsrc/agilab/test/test_model_returns_code.py should be ignored in CI collection, not merely deselected by marker, because import-time behavior can still break collection.agi-env tests need:
./src/agilab/core/agi-env./src/agilab/core/agi-nodesqlalchemysrc/agilab/core/test) need:
./src/agilab/core/agi-env./src/agilab/core/agi-node./src/agilab/core/agi-cluster./src/agilab/core/agi-coresqlalchemypytest-asynciouv --preview-features extra-build-dependencies run --no-project --with coverage --with pytest-cov python -m coverage ...; python_version >= '3.13' instead of downgrading the app or broadening unsupported
Python versions. Tests should parse requirements or compare the unmarked exact pin plus
marker validity, not raw strings only.$HOME/agi-space:
~/.local/share/agilab/.agilab-path and ~/.agilab/.env before trusting UI headersenv
object even after the source code is fixedpyproject.toml scopes (src/agilab/apps/<app>/pyproject.toml and src/agilab/apps/<app>/src/<app>_worker/pyproject.toml).uv --preview-features extra-build-dependencies run python -m ensurepip --upgrade once in the target venv.uv --preview-features extra-build-dependencies run --no-sync python tools/cluster_flight_validation.py --discover-lan --remote-user <user> --json --no-discovery-cache.
Treat nodes with status="no-ssh-port" or missing ARP as stale candidates;
do not use them for validation until a fresh SSH probe succeeds.ssh <user>@<ip> 'echo ok' works,
reproduce the exact non-interactive probe path used by AGILAB before changing UI
display code.ssh <user>@<ip> 'printf "path=%s\n" "$PATH"; command -v python3; command -v nvidia-smi || true; uname -a'.ssh <user>@<ip> 'ssh -o BatchMode=yes <scheduler_user>@<scheduler_ip> hostname'
and the configured cluster-share mount/read-write sentinel.<ip> placeholders, not
LAN addresses remembered from an earlier sessionssh-keygen -R <ip>ssh-keyscan -H -t ed25519 <ip> >> ~/.ssh/known_hostsssh-copy-id agi@<ip>~/.ssh/authorized_keys with 0700 / 0600 permissions.agilab/.env and remount the share before blaming AGILAB:
worker_home="<worker-home>"AGI_CLUSTER_SHARE="$worker_home/clustershare"AGI_LOCAL_SHARE="$worker_home/localshare"sshfs <manager-user>@<manager-ip>:/path/to/manager/clustershare "$worker_home/clustershare"command -v brew can miss Intel Homebrew; check /usr/local/Homebrew/bin/brew before assuming Homebrew is absent.sshfs: ssh <user>@<worker> 'command -v sshfs'.sshfs is under /usr/local/bin but not found over SSH, add /usr/local/bin in the remote user’s ~/.zshenv.ssh <user>@<worker> 'ssh -o BatchMode=yes <manager_user>@<manager_ip> hostname'.known_hosts first, then add the worker public key to the manager account if reverse auth fails.ssh agi@<ip> 'echo ok'ssh agi@<ip> 'ssh -o BatchMode=yes agi@<scheduler_ip> hostname'