Repository navigation
Doctor: check the transcript tailer that the signed tailer_lost reason points at - #801
Conversation
…s at (Cygnux-Labs#797) A tailer_lost gap's signed reason says to run doctor to check the tailer, and doctor had no tailer check. In v2 system mode with Claude Code, doctor now checks client.json's tailer key (D-TAILER-CONFIG), the tailer's user and uid (D-TAILER-USER), /etc/sudoers.d/tracekit-tailer (D-TAILER-SUDO) and, on Linux with getfacl, the ACLs on the agent's home, ~/.claude and ~/.claude/projects (D-TAILER-ACL; skipped with a warning elsewhere, never passed). Signed-off-by: hayatexe <145812188+hayatexe@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
I read this against
If you'd rather not pick these up, say so and we'll finish them with your commits kept. Your CI runs need a maintainer approval first (it's your first PR here). |
D-TAILER-SUDO matches the whole line install._tailer_sudo writes, so a commented-out rule or one for another user or run-as user doesn't pass, and a sudoers file that isn't UTF-8 warns instead of crashing doctor. Tests for getfacl exiting non-zero and for the other:: fallback; the lean: note moves to a comment; drop a dead '~' branch. Signed-off-by: hayatexe <145812188+hayatexe@users.noreply.github.com>
|
Thanks for the careful review! Picked all five up in 5ade16a:
|
|
Checked 5ade16a. All five are in:
It merges once CI is green; the runs are being approved now. |
|
Merged, thank you. If you want a next one: #816 (a shorter "approve or skip?" for held calls, from that same report) and #811 (audit's help text still says Claude Code only) are both small and well scoped. And if you use a coding agent day to day, running Tracekit on your own projects for a week and filing a field report would help us more than anything: https://github.com/Cygnux-Labs/Tracekit/issues/new?template=field-report.yml |
What and why
Fixes #797. When a Claude Code run's transcript tailer stops, the signer signs a
tailer_lostgap whose reason says to runsudo /opt/tracekit/bin/python -I -m tracekit doctorto check the tailer, but doctor had no tailer check.v2_checksnow runs four checks in system mode when client.json'shooks.agentisclaude:D-TAILER-CONFIG: client.json has atailerkey{user, uid, python}. If it doesn't, doctor warns that each session records atailer_lostgap instead of its transcript; the fix is re-running init.D-TAILER-USER: the key's user exists and has the key's uid.D-TAILER-SUDO:/etc/sudoers.d/tracekit-taileris a root-owned 0440 file (fail otherwise), and its rule names<python> -I -m tracekit.tailer(warn if missing or wrong).D-TAILER-ACL: on Linux,getfaclshows the tailer's user can search the agent's home and~/.claudeand read~/.claude/projects(named entry as the mask leaves it, elseother). Without getfacl or on another platform it warns "not checked" and never passes.The ids are listed in
docs/doctor.md. Tests intests/test_doctor_v2.py(Tailer) fake client.json, the sudoers file and getfacl output in a temp folder and need no root; each new check's test fails on main.Open questions for review:
lean:), and its getfacl parsing is tested against faked output only.How I ran it as a user
I don't have a Linux machine with
sudo tracekit init --v2, so there are no real tailer lines from a host yet. I ran doctor's tailer checks on a faked system client.json and printed them through doctor's report:pytest tests/test_doctor_v2.py tests/test_docs.py: 101 passed, 31 skipped (POSIX/root-only), 1 failed. The failure istest_docs.py::DocLinks::test_relative_links_resolve(links intoexamples/v2/demos/), which fails the same way on main on my Windows machine.pyflakesis clean on the changed files. I didn't run the fullmake checklocally (Windows); relying on CI for the Linux run.Checklist
make checkpasses (lint, tests, build);make test-tstoo ifsdk/typescript/changedCHANGELOG.md)docs/doctor.md; no threat-model change)git commit -s, seeCONTRIBUTING.md)Security invariants
Evidence format