logicsrc/apps/logicsrc-web
Anthony Ettinger 87266bb815
Some checks are pending
CI / build (push) Waiting to run
test / test (push) Waiting to run
fix(install): build before replacing the working install (#118)
A failed install left the machine with no CLI at all. do_install ran
`rm -rf "$SRC_DIR"` and only then built; if the build failed, or the run
was interrupted, what remained was an unbuilt tree, a wrapper still
pointing at the dist/ that was never produced, and the previous run's
install.json still claiming success. Every later `logicsrc` invocation
died with MODULE_NOT_FOUND, and nothing said why.

That is what happened here: install.json dated 01:57, src/ replaced at
02:59 by a second run that did not finish.

Now the download, npm install and build all happen in a staging
directory, and $SRC_DIR is only touched once packages/cli/dist/index.js
actually exists -- the file the wrapper execs, so its absence is exactly
the failure the user would otherwise hit on their next command. Staging
sits inside $LOGICSRC_HOME so the swap is a rename on one filesystem
rather than a cross-device copy of node_modules, and the previous tree
is kept until the swap succeeds so a failed move can be undone.

Build output was going to /dev/null, so "build failed" carried no reason
at all. It is captured now, with the last 25 lines printed on failure and
the full log left on disk.

Also validates the commit id from the GitHub API before recording it:
anything that is not 40 hex characters is dropped rather than written
into install.json, which `logicsrc update` compares against.

Verified against a stubbed npm/curl in all three paths: a failing build
leaves the existing install running, a build that produces no artifact is
caught, and a clean install still swaps in and writes a correct manifest.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 20:18:46 -07:00
..
contract feat(web): put the one-line install in front of everyone 2026-07-30 12:55:30 -07:00
e2e fix(web): the Top-Level Pages cards led nowhere, and /privacy was not a page (#114) 2026-07-30 14:35:51 -07:00
public fix(install): build before replacing the working install (#118) 2026-07-30 20:18:46 -07:00
src feat(credentials): re-key team vaults, and reach sh1pt's vault as a provider (#117) 2026-07-30 18:41:03 -07:00
.gitignore Migrate logicsrc-web from Vite SPA to Next.js 16 App Router 2026-06-07 03:41:48 +00:00
next.config.ts feat(web): serve the CLI login flow from the apex (#106) 2026-07-30 10:25:16 -07:00
package.json feat(openontology): Phase 2 + Phase 3 — storage, REST/SSE, MCP, RDF/SHACL, adapters, TUI, explorer (#101) 2026-07-28 05:10:33 -07:00
playwright.config.ts Migrate logicsrc-web from Vite SPA to Next.js 16 App Router 2026-06-07 03:41:48 +00:00
tsconfig.json Migrate logicsrc-web from Vite SPA to Next.js 16 App Router 2026-06-07 03:41:48 +00:00
vitest.config.ts Migrate logicsrc-web from Vite SPA to Next.js 16 App Router 2026-06-07 03:41:48 +00:00