fix: agents-pointer-migrate.py imports the retired flat module path, breaking ward exec agents-pointer-migrate #423

Closed
opened 2026-07-02 02:07:29 +00:00 by coilysiren · 2 comments
Owner

scripts/agents-pointer-migrate.py (the one-time AGENTS.md pointer rollout, ward exec agents-pointer-migrate) imports from agentic_os.generate_agents_pointer import ... (line 60). agentic-os moved that module into the generators/ subpackage, so it now lives at agentic_os.generators.generate_agents_pointer. load_applier therefore hits ModuleNotFoundError, falls into its except, and sys.exits with "cannot import agentic_os". The rollout cannot run at all today.

This is the blocker behind coilyco-flight-deck/agentic-os#206 ask 1 (execute the migration across the 10 managed repos that still carry a dangling ../AGENTS.md intro). The migration mechanism is this infra script, and it is broken, which is why the sweep has not landed.

Fix: update the import to

from agentic_os.generators.generate_agents_pointer import (
    apply_to_text,
    detect_org_repo,
    is_managed,
)

Then re-run ward exec agents-pointer-migrate (dry-run first, then execute=1) to land the managed block on each managed repo's canonical Forgejo main.

Also note: agentic-os#206 ask 2 (the ansible agents-pointer role's stale hint pointing at a non-existent agentic-os/scripts/agents-pointer-migrate.py) is already resolved - the role was retired in infrastructure#362 and the rollout now rides this script under ward exec agents-pointer-migrate. No hint left to fix.

Origin: agentic-os#206, filed from the agentic-os container run (which could not reach this repo to push the fix itself).

`scripts/agents-pointer-migrate.py` (the one-time AGENTS.md pointer rollout, `ward exec agents-pointer-migrate`) imports `from agentic_os.generate_agents_pointer import ...` (line 60). agentic-os moved that module into the `generators/` subpackage, so it now lives at `agentic_os.generators.generate_agents_pointer`. `load_applier` therefore hits `ModuleNotFoundError`, falls into its `except`, and `sys.exit`s with "cannot import agentic_os". The rollout cannot run at all today. This is the blocker behind **coilyco-flight-deck/agentic-os#206 ask 1** (execute the migration across the 10 managed repos that still carry a dangling `../AGENTS.md` intro). The migration mechanism is this infra script, and it is broken, which is why the sweep has not landed. **Fix:** update the import to ```python from agentic_os.generators.generate_agents_pointer import ( apply_to_text, detect_org_repo, is_managed, ) ``` Then re-run `ward exec agents-pointer-migrate` (dry-run first, then `execute=1`) to land the managed block on each managed repo's canonical Forgejo `main`. **Also note:** agentic-os#206 ask 2 (the ansible `agents-pointer` role's stale hint pointing at a non-existent `agentic-os/scripts/agents-pointer-migrate.py`) is already resolved - the role was retired in infrastructure#362 and the rollout now rides this script under `ward exec agents-pointer-migrate`. No hint left to fix. Origin: agentic-os#206, filed from the agentic-os container run (which could not reach this repo to push the fix itself).
Member

🔒 Reserved by ward agent --driver claude — container engineer-claude-infrastructure-423 on host kais-macbook-pro-2.local is carrying this issue (reserved 2026-07-02T07:22:51Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (2h0m0s TTL); --force overrides.

— Claude (she/her), via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent --driver claude` — container `engineer-claude-infrastructure-423` on host `kais-macbook-pro-2.local` is carrying this issue (reserved 2026-07-02T07:22:51Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (2h0m0s TTL); `--force` overrides. <!-- ward-agent-signature --> — Claude (she/her), via `ward agent`
Author
Owner

WARD-OUTCOME: done - fixed the generators/ import path so ward exec agents-pointer-migrate loads and runs again; landed on canonical main.

The core fix was exactly the one-liner the issue diagnosed: generate_agents_pointer moved into agentic_os.generators, while agentic_os.config stayed put, so only that one import needed repointing. I verified against the /substrate/agentic-os checkout that all three functions live at the new path, then ran the script's dry-run and confirmed it now executes its planning logic instead of sys.exit-ing with "cannot import agentic_os".

What fought back was the pre-commit gate, not the fix. Two unrelated walls: pylint's uv wanted to download Python 3.13 into a root-owned /opt/uv/python (solved by pointing UV_PYTHON_INSTALL_DIR at a writable dir - pylint then scored 10.00/10), and a pre-existing over-length YAML comment in the forgejo-creds ansible role that the repo-wide code-comments hook flagged on every commit. I removed that redundant comment as a small separate chore so the import fix could land clean without --no-verify.

Confidence is high: the change is a mechanical import correction, CI's lint job runs the identical pylint I passed locally, and the full hook suite is green. One rough edge worth flagging: I did not run the actual execute=1 migration across the 10 managed repos (agentic-os#206 ask 1). Those repos aren't in this container's granted set, and the in-container dry-run reported 0 managed repos in scope since it can't reach the operator's tree anyway. That sweep needs a run explicitly granted those repos - worth a follow-up so ask 1 doesn't sit assumed-done.

WARD-OUTCOME: done - fixed the generators/ import path so `ward exec agents-pointer-migrate` loads and runs again; landed on canonical main. The core fix was exactly the one-liner the issue diagnosed: `generate_agents_pointer` moved into `agentic_os.generators`, while `agentic_os.config` stayed put, so only that one import needed repointing. I verified against the `/substrate/agentic-os` checkout that all three functions live at the new path, then ran the script's dry-run and confirmed it now executes its planning logic instead of `sys.exit`-ing with "cannot import agentic_os". What fought back was the pre-commit gate, not the fix. Two unrelated walls: pylint's `uv` wanted to download Python 3.13 into a root-owned `/opt/uv/python` (solved by pointing `UV_PYTHON_INSTALL_DIR` at a writable dir - pylint then scored 10.00/10), and a pre-existing over-length YAML comment in the forgejo-creds ansible role that the repo-wide `code-comments` hook flagged on every commit. I removed that redundant comment as a small separate `chore` so the import fix could land clean without `--no-verify`. Confidence is high: the change is a mechanical import correction, CI's lint job runs the identical pylint I passed locally, and the full hook suite is green. One rough edge worth flagging: I did **not** run the actual `execute=1` migration across the 10 managed repos (agentic-os#206 ask 1). Those repos aren't in this container's granted set, and the in-container dry-run reported `0 managed repos in scope` since it can't reach the operator's tree anyway. That sweep needs a run explicitly granted those repos - worth a follow-up so ask 1 doesn't sit assumed-done.
Sign in to join this conversation.
No description provided.