Skip to content

feat(update): report available updates read-only for any install kind (HACK-2218 R14) - #860

Merged
roodboi merged 5 commits into
nextfrom
feat/hack-2218-update-check-observe
Nov 15, 2026
Merged

roodboi merged 5 commits into
nextfrom
feat/hack-2218-update-check-observe

Conversation

@roodboi

@roodboi roodboi commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

taking R14

The desktop app needs to show "Hack vX available" for every install, but hack update --check refuses Homebrew installs and candidate launchers before it checks anything. hack update --check --json --observe now reports, for any install kind:

{"ok":true,"data":{"current":"5.0.0-next.17","channel":"next","latest":"5.0.0-next.18","available":true,"install_kind":"candidate","upgrade_command":["/example/user/.hack-next/bin/hack-next","--manager","upgrade","--version","5.0.0-next.18"],"reason":null,"schema":"hack.update-check.v1"}}
flowchart LR
  A[update --check --json --observe] --> B{version form?}
  B -- other prerelease --> U1[reason: version-unrecognized]
  B -- stable --> L1[GET releases/latest]
  B -- "-next.N" --> L2[GET releases list, newest same-major -next.N]
  L1 & L2 -- fetch error --> U2[reason: network-unavailable]
  L1 & L2 -- bad or no release --> U3[reason: release-unavailable]
  L1 & L2 -- version --> C{newer?}
  C -- no --> N[available: false, no command]
  C -- yes --> K[available: true + upgrade_command for this install]
Loading
Field Value
latest Stable: GitHub's latest release. Next: newest non-draft -next.N with the same major on the first page of up to 100 releases. null when unknown.
available true / false, or null when unknown (never "up to date" by default).
install_kind candidate under a candidate launcher; otherwise the version --json kind.
upgrade_command Only when available: the hack-next launcher's manager upgrade --version, stable Homebrew brew upgrade hack-dance/tap/hack, stable standalone <binary> update; else null (including other candidate launchers such as hack-v5, and next-channel Homebrew/standalone installs, whose update paths install stable).
reason null, network-unavailable, release-unavailable or version-unrecognized.
  • One read of the public GitHub releases API with a 10 s timeout. No download, prompt, install, file write, PATH lookup, hackd, Docker or VM contact.
  • The release list is ordered by creation, not version. A newer -next.N on the one page read is positive evidence; "not available" is reported only when the page is not full or contains the running release, otherwise release-unavailable.
  • --observe requires --check --json and refuses --yes / --tag with E_USAGE before any network read.
  • compareSemver ignores prerelease tags (5.0.0-next.17 equals 5.0.0-next.18 there), so the check uses its own comparison for X.Y.Z and X.Y.Z-next.N only. Plain hack update keeps its existing behaviour and output.
  • Machine-output inventory: new schema variant update --check --observe (hack.update-check.v1); reference table and CLI reference regenerated.

Docs: new update check reference, reference index, next.18 release notes, a line in the v5 install page (unlinked there: that page is pinned to the published release), desktop DESIGN.md R14 row marked as existing.

Validation and gaps are in the ready note.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hack-docs Ready Ready Preview Nov 15, 2026 7:59am UTC

Request Review

@linear-code

linear-code Bot commented Nov 15, 2026

Copy link
Copy Markdown

HACK-2218

roodboi and others added 3 commits November 15, 2026 07:44
`hack update --check --json --observe` returns current, channel, latest,
available, install_kind, upgrade_command and reason in the schema
envelope (hack.update-check.v1). It makes one bounded GitHub releases
read and never downloads, installs, prompts, writes, or refuses a
Homebrew or candidate install. Next-channel installs compare against
the newest same-major -next.N release; unknown evidence is null with a
closed reason. Plain `hack update` is unchanged. HACK-2218 R14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings: the release list is ordered by creation, so one page
proves "nothing newer" only when it is not full or holds the running
release; otherwise the check now reports unknown. Read 100 releases.
Only the hack-next launcher has `--manager upgrade`; other candidate
launchers get no upgrade command. Placeholder paths avoid a home-path
pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi
roodboi marked this pull request as ready for review November 15, 2026 07:51
@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T08:01:49.530589Z f96f219 Manual request
🔒 Security Review ✅ Completed 2026-11-15T08:02:58.895383Z f96f219 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e14a19cc5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/update-observe.ts Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9e14a19cc5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

The launcher exports the same marker for every root, so the command
pointed at the default ~/.hack-next even for a custom --root install.
The root now comes from the native executor the launcher pinned
(<root>/versions/<current>/bundle/hack-native) and the launcher file
must exist; otherwise, including Compose-backend launches, the command
is null. Addresses the Codex review on this PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: f96f219720

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: f96f219720

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: f96f219

HACK-2218 R14, based on next 345dc0d.

hack update --check --json --observe reports {current, channel, latest, available, install_kind, upgrade_command, reason} in the envelope (schema: "hack.update-check.v1"), for every install kind including Homebrew and candidate launchers. One read of the GitHub releases API (10 s timeout). It never downloads, installs, prompts, writes, looks Hack up on PATH, or contacts hackd, Docker or a VM. Plain hack update is unchanged. Inventory variant added; CLI and machine-output references regenerated.

Decision flagged: one documented false negative. The release list is ordered by creation time and the check reads one page of 100. A newer -next.N on the page is reported available. "Not available" is reported only when the page is not full or contains the running version's own release. A newer release created before the running one and pushed off a full page would be missed (available: false). The strict alternative makes every up-to-date next-channel install report unknown, because this repo already has more than 100 releases. The reference page states the case and tells consumers to read available: false as "no newer release in the current listing". The persistent reviewer accepted this as a decision for you.

Fixed during the loop:

  • compareSemver ignores prerelease tags, so the check has its own X.Y.Z / X.Y.Z-next.N comparison.
  • Reviewer: no upgrade command for hack-v5 (it has no manager); the one-page completeness rule above.
  • Codex bot: a custom --root channel was pointed at the default ~/.hack-next launcher. The root now comes from the executor the launcher pinned (<root>/versions/<running version>/bundle/hack-native), and <root>/bin/hack-next must exist; otherwise null (including Compose-backend launches). Thread answered and resolved.

Ran locally (Linux, Bun 1.4.4, temp HOME, HACK_DAEMON_AUTOSTART_DISABLE=1, no real network: fetch is injected or spied): tests/update-observe.test.ts 14 pass; tests/machine-output-contract.test.ts 87; tests/sync-spawn-bound.test.ts 2; update-command 8, self-update 3, update-homebrew-tap 3, version-report 5. Root typecheck and check (including privacy); docs:prepare + docs:check. bun run build, build:config-compiler, check:native-plan-cli: all 8 scripts in the runner pass (the runner on this next lists 8).

Exact-head hosted CI (run 43692353071): every Linux job that ran passed (test shards 4–8 and fan-in, test focus, docker-e2e fan-in, Config compiler ubuntu, Desktop app Linux, docs site, secret scan). Candidate core, Docker e2e shards, linux-process-lifetime and runtime models/images were skipped by change scope. Desktop app (macOS): queued, not waited for. Optional Proof skipped. GitHub reports mergeable. computer pr review-status: CLEAR at f96f219.

Review: persistent Codex reviewer CLEAN at this head (round 4). Codex bot: no major issues and no security issues at f96f219.

Not verified: a real GitHub response from an installed build, Homebrew and candidate installs on a Mac, and the desktop app consuming the field (#823 still uses Unknown). No further pushes planned after this note.

@roodboi
roodboi merged commit 6742759 into next Nov 15, 2026
23 checks passed
@roodboi
roodboi deleted the feat/hack-2218-update-check-observe branch November 15, 2026 09:03
roodboi added a commit that referenced this pull request Nov 15, 2026
…econcile

Brings in next at 34b5053 (#802 Rust lifecycle supervisor, #860 read-only update check, #818 desktop Env tab).

Conflicts:
- src/lib/machine-output.ts and src/cli/json-contracts.ts: both sides added schemas and variants; kept updateCheck / update --check --observe and the four daemon command schemas.
- src/commands/update.ts: kept both the observeUpdate import and handleObserve from #860 and this branch's post-update reconcile. --observe returns before anything else, and plain --check returns before the install, so the read-only check never reaches reconcileDaemonAfterUpdate.

Generated files (CLI reference, machine-output table, error-code reference) were regenerated and match; E_DAEMON_SERVICE kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
roodboi added a commit that referenced this pull request Nov 15, 2026
# Conflicts:
#	apps/desktop/README.md
#	apps/desktop/app/src/screenshots.rs
#	apps/desktop/app/src/view.rs
#	apps/desktop/core/src/source.rs
roodboi added a commit that referenced this pull request Nov 15, 2026
# Conflicts:
#	apps/desktop/README.md
#	apps/desktop/app/src/main.rs
#	apps/desktop/app/src/screenshots.rs
#	apps/desktop/app/src/view.rs
#	apps/desktop/core/src/fixtures.rs
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.

1 participant