Skip to content

System init: the clone route in init's refusals names v2 init (#464) - #719

Merged
LoopGlitch26 merged 3 commits into
mainfrom
agent/upkeep-1111
Nov 11, 2026
Merged

LoopGlitch26 merged 3 commits into
mainfrom
agent/upkeep-1111

Conversation

@LoopGlitch26

Copy link
Copy Markdown
Member

What

When system init runs from a Python or a source checkout the agent's user could change, it refuses before changing anything and says how to run it instead (_install_source, tracekit/install.py). Both refusals now give the clone route with the command of the init that refused:

... Clone into a root-owned directory, e.g. sudo git clone https://github.com/Cygnux-Labs/Tracekit /usr/local/src/Tracekit, then cd /usr/local/src/Tracekit && sudo /usr/bin/python3 -m tracekit init --v2 --user <agent-user>

--experimental-macos is added on macOS, and v1 init keeps init --user <agent-user>.

Why

init --v2 runs the same check, but the hint always named v1 init (init --user <agent-user>, no --v2), so following it ran v1 init instead. The untrusted-Python hint said sudo /usr/bin/python3 -m tracekit init, which fails on Debian 12 and Ubuntu 23.04+ where the system Python has no Tracekit and refuses pip install (PEP 668); from inside a root-owned clone it works on every Python, as doctor's re-init hint already says. These are two of the hints #464 lists.

How I ran it

  • tests/test_system_v2.py::InitRefusals::test_an_untrusted_python_or_checkout_names_v2_inits_command drives init_system_v2 (as root on Linux, mocked) into each refusal. On a clean checkout of main both subtests fail (the hints have no --v2); with this change they pass.
  • From my own venv (user-owned, so the check refuses it), _install_source("init --v2 --user <agent-user>") prints:
    the Python running init could be modified by a non-root user (…/python3.11 is not owned by root). Run init with a root-owned Python from a root-owned clone, e.g. sudo git clone https://github.com/Cygnux-Labs/Tracekit /usr/local/src/Tracekit, then cd /usr/local/src/Tracekit && sudo /usr/bin/python3 -m tracekit init --v2 --user <agent-user>
  • Gates on macOS (Python 3.11): make test-ts lint build test passed: TypeScript 152 passed, 0 failed; pytest 4,876 passed, 394 skipped, 10 xfailed. The system-mode paths themselves run as root only on Linux CI.

Left in #464

  • doctor's re-init hint (REINIT) has no --no-hooks for plugin users (the 11-10 comment);
  • the signed tailer_lost reason (tracekit/signer/service.py L1747) points at a doctor tailer check that doesn't exist;
  • v1-only hints still name sudo /usr/bin/python3 -m tracekit init --user <agent-user> (tracekit/install.py migrate_system and the v1 doctor checks), as do docs/doctor.md, docs/signing.md, docs/portability.md and docs/evaluation.md;
  • docs/deploy-compose.md L9 and L80 use sudo tracekit deploy compose.

Part of #464.

When init runs from a Python or a checkout the agent's user could change,
it refuses and gives the clone route. That hint always said
`sudo /usr/bin/python3 -m tracekit init --user <agent-user>`, so after
`init --v2` it led to v1 init, and the untrusted-Python hint named the
system Python alone, which may have no Tracekit and refuse pip (PEP 668).
Both hints now give the clone route with the command of the init that
refused: `init --v2 --user <agent-user>` for v2, plus
`--experimental-macos` on macOS.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
The hint cloned the default branch, so following it put unreleased code in
the root-owned install. Review of #719.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
….md does

With one fixed folder, the next release's clone failed on the existing
directory, and cd-ing into it ran the old release. Final-head review of #719.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26
LoopGlitch26 merged commit ca403f5 into main Nov 11, 2026
34 checks passed
@LoopGlitch26
LoopGlitch26 deleted the agent/upkeep-1111 branch November 11, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant