Skip to content

fix(writ): writ detects the Linux distribution; detectDistro reads /etc/os-release before it closes it - #986

Merged
David-Noble-at-work merged 3 commits into
developfrom
fix/959-writ-never-detects-the-linux
Sep 30, 2026
Merged

David-Noble-at-work merged 3 commits into
developfrom
fix/959-writ-never-detects-the-linux

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 18 of #949, alone; #944 follows as lane 19 (ruled 2026-09-30: "we'll do lane 18 followed by lane 22. two prs and at the end we'll be done with selectors. we'll have common selectors for writ and lore.").

  • The bug: detectDistro closed /etc/os-release before scanning it, so the DISTRO segment has been empty on every Linux host since 57a9fd20 (Phase 8: the workflow-engine foundation for devlore operations #288), and no directory with a distribution suffix matched anywhere.
  • The fix: detectDistro calls readDistro(path), which defers the close straight after the open. DISTRO is the ID field, capitalized, as before: debian matches .Debian.
  • The tests: readDistro against six os-release fixtures, through the file, and TestDetectSegments checks DISTRO on Linux. Both failed against the old close and pass now. The adopt test that pinned the bug refuses NoSuchPlatform instead of Ubuntu, which Ubuntu now matches.
  • On a Linux host: DISTRO is Ubuntu on Ubuntu, and a .Ubuntu project deploys there; writ adopt --platform Ubuntu is accepted. The lineage (Ubuntu also matching .Debian) is One selector API: writ and lore detect the host and match platform selectors through the same code, along os-release's lineage #944.

Also: PR B's plan takes its two owed ticks and is complete.

  • Plan — docs/plans/fix/959-writ-never-detects-the-linux.md. It stays active: its last boxes are DANOBLE-UD24-1's convergence and telling the other session.

Resolves #959

Test plan

Time

Marker UTC Elapsed
opened (first commit) 2026-09-30T01:39:48Z —
submitted (PR opened) 2026-09-30T01:58:26Z 0.3 h after opened
merged 2026-09-30T02:42:21Z 0.7 h after submitted; 1 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

detectDistro closes /etc/os-release before reading it, so DISTRO has been
empty on every Linux host since 57a9fd2. The plan: readDistro(path)
opens, defers the close, and scans; tests that go through the file and
fail first; the adopt test that pinned the bug refuses a word no host
detects; PR B's owed ticks. Lane 18 of #949; #944 follows as lane 19.

Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
…tc/os-release before it closes it

detectDistro closed /etc/os-release between the open and the scan, so
every read failed and the DISTRO segment has been empty on every Linux
host since 57a9fd2 (#288): no directory with a distribution suffix
matched anywhere. It now calls readDistro(path), which defers the close
straight after the open.

The path is the seam the tests use: readDistro runs against os-release
fixtures (Ubuntu with its ID_LIKE, Debian, a quoted ID, an unknown ID,
no ID, no file), and TestDetectSegments checks DISTRO on a Linux host
whose os-release carries an ID. Both failed against the old close and
pass now. The adopt test that pinned the bug refused "Ubuntu", which is
matched on Ubuntu now; it refuses NoSuchPlatform instead.

DISTRO stays the ID field, capitalized: `debian` matches `.Debian`. The
lineage, so that Ubuntu also matches `.Debian`, is #944, the next PR.

PR B's plan takes its two owed ticks, the installers jobs on #984 and
the site's sync, and is complete.

Resolves #959

Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
@David-Noble-at-work
David-Noble-at-work merged commit ea5cebd into develop Sep 30, 2026
13 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/959-writ-never-detects-the-linux branch September 30, 2026 02:47
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.

writ never detects the Linux distribution: detectDistro closes /etc/os-release before reading it, so no .Debian or .Ubuntu directory deploys anywhere

1 participant