<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sl0ppi.git/cli/test/init.test.ts, branch main</title>
<subtitle>a sl0p.foo repository</subtitle>
<id>https://git.sl0p.foo/sl0ppi.git/atom/cli/test/init.test.ts?h=main</id>
<link rel='self' href='https://git.sl0p.foo/sl0ppi.git/atom/cli/test/init.test.ts?h=main'/>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/sl0ppi.git/'/>
<updated>2026-08-12T20:35:05Z</updated>
<entry>
<title>cli: init and doctor, and stop one bad project breaking a root</title>
<updated>2026-08-12T20:35:05Z</updated>
<author>
<name>user</name>
<email>user@clank</email>
</author>
<published>2026-08-12T20:35:05Z</published>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/sl0ppi.git/commit/?id=04a851c5aa543c362968ea562335cde64e4bc6b4'/>
<id>urn:sha1:04a851c5aa543c362968ea562335cde64e4bc6b4</id>
<content type='text'>
Slices 3 and 5 of docs/cli-design.md.

`init` writes .sl0ppi/layout.kdl. The template is mostly comments, because the
purpose vocabulary and the start_suspended habit are the two things nobody can
guess, and the point of use is the cheapest place to explain them. A test
asserts the template passes doctor's own fragment check -- shipping people a
starting point that fails our validation would be embarrassing.

`doctor` splits into gathering facts (IO) and judging them (pure), so the rules
are testable. It is honest about its limits: sl0ppij has no parse-only mode, so
fragments get a structural check (empty, unbalanced braces, a whole `layout {}`
pasted in, a `tab` node sl0ppi owns) rather than a claim of validity. It also
reports the known packaging hole -- pir needs python3 and fzf, neither of which
is in the tarball.

Driving them for real turned up a worse bug than either command:

  a single broken fragment took down the entire root

On session creation every tab shares one layout file, so one unbalanced brace
made the whole `up` fail and no project opened at all. Fragments are now checked
before use on BOTH paths, broken ones are skipped with the reason, and the rest
open. `up` also registers the root even when some projects failed, since
forgetting it would orphan the tabs that did open.

Two smaller fixes from the same session:

  - falling open with no tty used to spawn a bare sl0ppij, which silently
    CREATES a session; that is where a handful of randomly-named junk sessions
    came from during testing. It now reports and exits.
  - a rename leftover: `setup --check` still described "the configuration of
    zellij".

Test isolation lesson worth recording: sessions live in the runtime dir
(/run/user/1000/sl0ppij), not TMPDIR, so setting TMPDIR alone does not isolate
them -- an earlier test session called `root` was silently reused by a later
test. SL0PPIJ_SOCKET_DIR is what actually isolates.

88 tests green.
</content>
</entry>
</feed>
