oliver-zehentleitner / maity

runner: deliver the Keep the Why skill everywhere (part 2 of tsk-172s8y208whg)

Sign in to report

tsk-7casfxb7cn49 Done Maity Coder Claude 007

Part 2 of #2056 (tsk-172s8y208whg, merged as 1cb0a03d). #2056 delivers the skill at the commit the hub names for local placements in the single layout. This card does the rest:

  • delivery in the agent_user layout and on ssh hosts. Today both start without the skill and report keep_the_why_unavailable.
  • a skills directory of Codex's own. Today Codex gets only MAITY_KTW_SKILL_DIR.
  • maity runner check reports the delivered copy, and gc prunes old copies. skills.remove_unused exists, but nothing calls it.

Done when:

  • each of these is built, or the KtW records why it is left out;
  • tests;
  • docs/runners.md;
  • a changelog fragment;
  • no sandbox gets a wider allow.

Security leg on the PR.

Notes

  1. Mr. Robot · Nov 21, 2026, 12:17 UTC

    ops 3yc2, live check for tsk-7casfxb7cn49 (xpde; lotse go seq 187386). Codex TEST placements only, oliver-pc01-l, 2026-11-21 12:15–12:17Z.

    Rig:

    • One Codex placement per run, from main 773ea727's adapters.launch(): CODEX_HOME=<scratch>/codex-home, the runner's config.toml, and the login linked as the runner links it. The sandbox profile is the runner's (:workspace plus the maity permissions).
    • codex exec from the generated loop.json, with a read-only prompt.
    • HOME was an empty throwaway dir, so the user-level skills of maity-runner's real home (there is a ~/.agents/skills/keep-the-why) could not be the source.
    • Two runs:
    • control: nothing copied;
    • skill: skills/keep-the-why from keep-the-why v0.20.3 @ 2771046 (SKILL.md, LICENSE, references/, without examples/) copied from outside into <codex-home>/skills/keep-the-why/ before the start, all write bits removed.

    Answers:

    • Codex version: codex-cli 0.171.0 (the runner's managed version).
    • Does it load? Yes, under the name `keep-the-why` (the name: in SKILL.md), listed as loaded from <codex-home>/skills/keep-the-why/SKILL.md.
    • The control run listed only Codex's own system skills: imagegen, openai-docs, skill-creator and skill-installer, which Codex itself writes to <codex-home>/skills/.system/ at start.
    • It said: "No skill named keep-the-why … is available".
    • Flag needed? No. The runner's config.toml has only [features] network_proxy = true, and nothing skill-related was set. In codex features list the relevant ones are on by default: skill_search (stable, true) and skill_mcp_dependency_install (stable, true). skip_host_skill_discovery is false.
    • Can the session read `references/` under the sandbox? Yes.
    • The session cat-ed SKILL.md on its own when it used the skill. Its stderr shows /bin/sh -lc 'cat …/codex-home/skills/keep-the-why/SKILL.md'.
    • It then read references/help.md with sed -n 1,5p and printed the first lines verbatim ("# What Keep the Why is, and what you can ask for" …).
    • The files stayed read-only: dr-xr-xr-x on the skill dir afterwards.

    Note for PR 2: Codex writes its own .system/ skills into <codex-home>/skills/. So the runner should own only skills/<name>/, not the whole skills/ dir, or else expect Codex's .system/ beside it.

    Cleanup: both throwaway projects (including codex-home) and the throwaway homes are removed. The real ~/.codex is unchanged apart from the login being read through the link. Cost: 2 small codex exec runs on maity-runner's Codex login.

  2. Maity Test Team · Nov 21, 2026, 14:12 UTC

    Tester note (maity-test-team), #2089 at main b38fadf7: PASS.

    Tested headless from the clone (venv, editable cli), runner's own user as the agents' user (in-process AsUser), fake agents' home in a scratch dir, real fetch of keep-the-why v0.20.3 @ 27710466.

    • skills.deliver puts the copy at <home>/.local/share/maity-runner/skills/keep-the-why/<commit>-<hash>/plugin; modes only 0644/0755.
    • python -I -m maity.runner.skillop check --home … → exit 0, ok + digest.
    • SKILL.md tampered → mismatch with the reason; the next deliver re-puts it, content restored byte-identical.
    • check without args → exit 2 + usage; put with non-JSON stdin → exit 1, one-line message, no traceback.
    • ~/.local replaced by a symlink → check exit 4 {"result": "link"}; deliver raises Unavailable, nothing written to the link target.
    • pytest test_skillop, test_skills, test_adapters, test_supervisor: all pass.

    Side finding, not from #2089: 17 cases in tests/test_antigravity.py fail on this box (e.g. test_a_place_that_cannot_be_looked_at_refuses_the_start[*-single]: DID NOT RAISE Refused; test_every_side_answers_…[*-agent_user|ssh]: 'refused' == []). The same 17 fail at b38fadf7^, so they predate this PR. uid 1000, CapEff 0, a chmod-0 dir is denied for plain ls here. The cause is not analysed yet. CI on the main push runs no cli pytest job, so it shows nothing about this.

  3. Mr. Robot · Nov 21, 2026, 19:21 UTC

    Ops live check for #2093 at 20c64fdc, the hub-less parts only, run from outside. The setup:

    • the PR's own skills.ensure, the supervisor's _skill_source form, and adapters.launch of one Codex 0.171.0 TEST placement with the sandbox on;
    • a throwaway HOME, so the runner's fixed skills_dir is the test home's and the live runner's is untouched;
    • Codex's login linked as the runner links it;
    • keep-the-why v0.20.3 @ 2771046.

    Point 1: PASS, live-checked from outside, not through a runner.

    • The copy: the launch writes <codex-home>/skills/keep-the-why/, 19 files, identical by name and content to the runner's checked skill dir. Files are 0644, dirs 0755.
    • Codex loads it: Codex lists keep-the-why from skills/keep-the-why/SKILL.md beside its own .system skills, and the session read SKILL.md's first lines from there.
    • `.system/` is unchanged: Codex writes its 53 files there on the first run; the next launch (the skill written whole again) and the run leave them as they were.
    • Points the PR states:
    • a launch naming no skill removes the earlier copy and leaves .system alone;
    • a tampered SKILL.md plus a stray file are replaced by the clean copy at the next launch.
    • A side note, not this PR: on a second run Codex 0.171.0 fetched remote curated plugins into codex-home (plugins/cache/openai-curated-remote: pages, sites, work-pets, visualize, plugin-management) and listed their skills too.

    Point 2: PASS, live-checked with a test config (`--offline`).

    • The four states:
    • with no copy yet, it prints ok … no copy … yet; a start fetches one;
    • a recorded copy is ok … at 2771046616a3 …, checked;
    • with the record removed from skills.json, it is a warn … has no record …; the next start fetches and compares;
    • with one file changed, it is a warn … does not match its manifest; it is not handed out …;
    • after the file is restored, it is ok again.
    • Never an error: the skill line was never an error. rc 1 came only from the test state's missing runner credential.
    • It fetches nothing: strace showed 0 AF_INET connects, and the only exec was the Codex version probe (no git).

    Point 3 (`gc --skills`): not checked yet. It needs the hub's placement list and a running session (a local hub), and the agent_user layout needs the agents' user.

    Point 4: PASS from outside. With the copy removed, the next start writes it again, the same files, and .system is unchanged. A stale placement through the runner is not checked.

    Scripts: ops tmp/probe2093.py. Logs: probe2093b.log.

  4. Mr. Robot · Nov 22, 2026, 09:38 UTC

    Ops 3yc2: point 3 of #2093, maity runner gc --skills, live on main 67204742, in the single layout. It PASSES for what could be checked. Two parts are not checked: the agent_user layout and a running session's key.

    Rig

    • Hub: a local lab hub (SQLite, loopback) with project labowner/lab93, Keep the Why on (skill v0.20.3 @ 2771046).
    • Runner: main's runner code. It runs on the pipx interpreter of the installed a17 and with a throwaway HOME, so the fixed skills_dir is that HOME's, never the live runner's.
    • Placement: one Codex 0.171.0 TEST placement, supervised.

    What was there before gc

    • The active placement's copy: the runner fetched skills/keep-the-why/2771046…-bfcac62d7bb44d70, recorded it in skills.json, and the launch wrote it to <scratch>/codex-home/skills/keep-the-why/.
    • An orphan planted by hand: 1111…-aaaa…, a copy of the same files under a valid key, plus a record in skills.json.
    • An unrelated dir in the agents' home (single layout: the runner's HOME).

    Results

    • PASS, listing without `--yes`: it names only the orphan (removable (no active placement names it and no session runs with it)), and nothing is removed.
    • PASS, service lock: --yes with the runner service running is refused (the runner service is running; stop it …), and nothing changes.
    • PASS, `--yes` with the service stopped:
    • the orphan is removed, and its record is dropped from skills.json;
    • the active placement's copy and its record stay, and so does the copy in the placement's codex-home;
    • the unrelated dir is untouched;
    • outside the lab dirs nothing gc-related changed, and the live runner's skills_dir is unchanged (only live sessions' own files moved).

    Not checked

    • The agent_user layout (skillop remove below the agents' home through sudo): this host has no separate agents' user and no sudo -n.
    • "The copy of a running session stays" (Record.skill_key): the placement could not stay running in my rig. main's runner starts its helpers as <interpreter> -I -m maity.runner.pgenv, and a17's interpreter has no such module, so it crash-looped. The placement stayed active in the hub, which is the list gc keeps by. A running session needs a venv of main's CLI. I have asked Oliver for exactly that for bu49's probe (req-5hw9cfzkbcyd); with it I can rerun this part.

    Files: ops tmp/lh2093/ (runner.log, run.py).