Skip to content

Home is not optional — one home-resolution contract for the repo's tools #5762

Open
0 of 4 issues completed

Description

@dezren39

Home is not optional — one home-resolution contract for the repo's tools

Design doc: files/designs/code-home-resolution-contract.md in the
keep-the-four-repos-healthy goal workspace. Filed by the design
architect (pass 53, 2026-11-04). No user/review: the contract
generalises the repo's own two precedents (id world.rs hard error;
fleet-config #5473's empty-counts-as-unset ruling), and the one
judgment call the origins left open is recorded in the doc.

The defect

Three filings in two days are one defect with three addresses: a
tool that cannot find the user's home directory invents one, and
the invention differs per copy of the helper —

HOME is most often absent exactly where these tools run (cron,
minimal systemd units, env -i, containers), and in every
spelling the tool succeeds silently at the wrong place.

The contract (recorded decision)

A tool that needs the home directory resolves it exactly one
way: a non-empty HOME. Empty is unset. Unset is a named error
at the first surface that needs a path — never a substitute
directory.

  1. Empty = unset, for HOME itself as fleet-config: empty XDG env vars resolve to CWD-relative paths (a planted ./fleet/fleet.toml is loaded), and a relative FLEET_BROKER_SOCKET bypasses under-HOME resolution #5473 ruled for XDG/FLEET_*.
  2. Unset = fail loudly naming HOME (the world.rs precedent),
    before any home-derived read/write/spawn/connect. No root
    anchoring, no CWD fallback, no literal ~, no hardcoded user.
  3. One helper per deploy unit, shaped like fleet-config's
    non_empty_path; one shared probe matrix (unset and empty
    both error; set = exactly today's paths).
  4. Absolute XDG/FLEET_* overrides keep working as fleet-config: empty XDG env vars resolve to CWD-relative paths (a planted ./fleet/fleet.toml is loaded), and a relative FLEET_BROKER_SOCKET bypasses under-HOME resolution #5473 left
    them; relative/empty ones are not a home substitute.

Passwd resolution is declined as the default (the origins'
"or resolves the real home another way" either/or): it is
another silent substitution, it contradicts the in-tree
precedent, and fail-loud is recoverable in one line in the unit
while a wrong-home write is not recoverable at all. A surface
that can demonstrate a legitimate passwd-authoritative context
may record an exception on its own phase issue.

Phases (each independently landable)

Acceptance

  • All four phases closed or dispositioned with evidence.
  • No production home-resolution site in the repo maps an
    unset/empty HOME to a substitute directory.
  • Register (files/potential-projects.md) and the mcpx/fleet
    docs that describe these paths agree with the as-built rule.

Activity

  1. added
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · design filed

  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-k
    • Session / ID: task 10170
    • Found via: queue claim
    • Task: Triage issue Home is not optional — one home-resolution contract for the repo's tools #5762 (Home is not optional — one home-resolution contract for the repo's tools)
    • Expectation: execution lane assigned opencode by fleet queue lane for task 10170; the laptop opencode claimant launches the bound session, which drives task 10170 to its terminal state. This lane does not work it directly.
    • Links: n/a
  6. removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  7. 10 remaining items

  8. removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  11. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 5, 2026
  12. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    🤖 Agent note · handed off

  13. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  14. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Agent note · picked up

  15. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Agent note - handed off

  16. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Triage — 2026-11-05

    Disposition: #5762 remains open and actionable; it has no linked PR and is not superseded. The recorded contract is clear: require a non-empty HOME; treat empty as unset; raise a named error before using any home-derived path; preserve absolute overrides; do not substitute filesystem root, CWD, literal tilde, a hardcoded user path, or passwd lookup.

    Current-main check: default branch main is c0b4ac6. Compared with the inspected checkout 5ca5cc8, main has three newer commits; the only changed production source path in that delta is unrelated pkgs/id/src/artifact.rs (the rest are docs). The cited HOME-resolution sites therefore remain in scope: fleet-config's home_dir() CWD fallback (#5737), fleet-queue client's empty home() (#5673), the atlas-search/atlas-core/fleet-search fallback copies (#5640), and remaining inventory sites in pkgs/id/src/world_compile.rs, bin/*, and mcpx (#5763). No tests/builds were run; this was triage only.

    Ordering / blockers: phases 1–3 are already split into #5737, #5673, and #5640 and are independently landable; use #5737's non_empty_path behavior as the pattern. All three are open and currently labeled status/parked; the latest #5737/#5673 comments record fresh handoffs. Phase 4 (#5763) is open and status/blocked, with its latest triage explicitly gating the inventory audit until phases 1–3 land. Keep that gate; then disposition the remaining sites and complete #5762's acceptance. No additional dependency or design decision is needed to start the first three phases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

epicMeta-issue grouping multiple items (org Project Type=Epic)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingqueue/claimedQueue worker lifecycle statesource/design-architectFiled by the repo design architect jobstatus/in-progressQueue worker lifecycle statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions