Let doctor report the installer's north-star placeholder from the install record - #256
Conversation
packaging/v1/install.sh (pending PR #250, roadmap item 10) writes an installed target's own placeholder .ystack/north-star.md with NO shipped-default marker and no `status: active` entry at all, so check (h)'s existing marker-based detection can only fall through to a generic UNSET/no-active-entry WARN — it never names the installer's placeholder specifically for a target that installed and never committed anything. check (h) now ALSO reads the resolved target root's on-disk .ystack/install-record.json (the installer's own record, not git-committed state) and WARNs when its body.north_star.state is "placeholder-unset", naming the installer's placeholder directly. A record that isn't a regular, non-symlink, <=64 KiB file holding exactly one JSON text WARNs as malformed instead of crashing; any other state, or no record at all, adds nothing. Parsing prefers jq (as check (e) already probes for) and degrades to a scoped regex read when jq is not on PATH. Added 8 cases to the existing scripts/test/north-star-gate.test.sh suite (which already drives doctor.sh check (h) end-to-end): the placeholder-unset WARN, a non-matching state adding nothing, symlink / invalid-JSON / multi-root / oversized malformed refusals, absence adding nothing, and a malformed record never aborting doctor's run. Proof: shellcheck -x -S style clean on both files; the full north-star-gate.test.sh suite passes (235 passed, 0 failed, including the new (24a)-(24i) cases); scripts/check-rename.sh clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Deploying ystack with
|
| Latest commit: |
d897a7f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9d87d4c4.fabrica-6yx.pages.dev |
| Branch Preview URL: | https://ystack-roadmap-10-doctor-ins.fabrica-6yx.pages.dev |
Codex reviewer (cross-vendor, read-only)Reviewed-head: a4877ce Posted verbatim by The added install-record diagnostic can abort or do unbounded reads in the exact malformed-file cases it is meant to handle gracefully. This breaks doctor.sh's no-crash diagnostic behavior. Review comment:
|
The record probe read the file with wc before applying the 64 KiB cap, so an unreadable or very large record could abort doctor under set -e or be read in full first. The size now comes from stat (GNU form first, BSD fallback), an unreadable file is treated as malformed, and the run and summary continue. Proof: north-star-gate 236/236 (new case: an unreadable install record warns as malformed and doctor completes), shellcheck clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…tor-install-record-v1
Codex reviewer (cross-vendor, read-only)Reviewed-head: 4c94be2 Posted verbatim by The added diagnostic can produce a persistent false warning for normally installed targets after they have correctly replaced their north star. That makes the new doctor check misleading in a common success path. Review comment:
|
The install record is written once and never learns that the placeholder north star was later replaced, so a stale placeholder-unset record kept doctor warning forever. The warning now fires only when the on-disk .ystack/north-star.md still has the digest the record recorded for the installer's placeholder; a replaced star, or a record without a digest, adds nothing. Proof: north-star-gate 237/237 (new case: a stale placeholder-unset record adds nothing once the star was replaced), shellcheck clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codex reviewer (cross-vendor, read-only)Reviewed-head: d897a7f Posted verbatim by No actionable correctness issues were found in the diff. The new doctor check and focused tests appear consistent with the intended install-record warning behavior. |
The target installer (roadmap step 10, PR #250) writes a north-star placeholder that deliberately carries no shipped-default marker, and records
north_star.state: "placeholder-unset"in.ystack/install-record.json. Doctor's check (h) detected an unreplaced north star only by the marker, so an installed target's placeholder was invisible and doctor reported a set north star.Check (h) now also reads the target's
.ystack/install-record.jsonwhen it exists as a regular, non-symlink file of at most 64 KiB holding exactly one JSON text:placeholder-unsetemits a WARN of the same style as the marker warning; a symlink, oversized, invalid, or multi-root record emits a distinct malformed WARN and never aborts the run; any other state adds nothing. It parses with jq when present and degrades to a scoped extraction otherwise, and is gated by the same target check the existing anchor resolution uses. Every existing doctor line and exit behaviour is unchanged. The check (h) comment block describes the second source.Tests: nine new assertions in
scripts/test/north-star-gate.test.sh, the suite that already drives check (h) end to end.Proof run on a4877ce:
bash scripts/test/north-star-gate.test.sh→ 235 passed, 0 failed-x -S styleclean;bash scripts/check-rename.shcleanbash scripts/test/portable-core-schema.test.sh→ failures: 0Construction mode: repo-only diagnostic change, no human gate.
🤖 Generated with Claude Code