Repository navigation
Conversation
Plugins that need work after checkout, or that must resolve paths at runtime, had to ship their own installer. Add the lazy.nvim-style pieces Amber was missing: - build option (command, function, or list) run after install, update, or restore when the checkout commit differs from the lockfile's built commit - amber_build action to force a build, and a built state in amber_status - lockfile entries may carry a built commit; a failed build still records the checkout and can be retried - setup is held back (status unbuilt) until the build has run for the locked commit - setup(opts, ctx) with name, dir, module_dir, commit, and data_dir - docs on starting background processes from the plugin; Amber still has no service management Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYR5Nyv85TQGevuubCSZYd
Split an unbalanced assignment in amber.lua and annotate the test stubs that replace rex.json.decode, which the types check reported. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYR5Nyv85TQGevuubCSZYd
- Split manage into three phases: record the checkout under the lockfile guard, run the build with the guard released, then record `built` only if the lock entry still points at the built commit. - Build the locked commit only; refuse a drifted checkout and point to amber_restore instead of recording a build for an unlocked HEAD. - amber_build fails without a lock entry instead of reporting "built". - exec merges opts.env over the AMBER_PLUGIN_* variables; add AMBER_PLUGIN_MODULE_DIR and AMBER_PLUGIN_DATA_DIR, and point AMBER_PLUGIN_DIR at the checkout. - Expose data_dir to build steps and document that build output must be gitignored or kept in data_dir, since restore and update refuse dirty checkouts. Note the shared budget in bulk actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYR5NzbCKe2x4vjWBiynJt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amber can't replace the install scripts that Rex plugins ship today (rex-durable is the one that got me looking). Two things are missing: a way to run something after checkout, and a way for
setupto find out where the plugin lives, so nothing has to be baked in at install time. This adds both, modeled on lazy.nvim'sbuild.buildA plugin spec can take
buildas a shell command, a function, or a list of those. Install, update and restore run it when the locked commit isn't the one recorded as built.amber_buildforces it, andamber_statusshows whether it's current.builtlives next tocommitin the lockfile, so the format stays at 1.A few decisions worth a look:
amber_restore.builtif the entry still points at that commit. This way a slow or killed build can't leave.lockbehind.amber_buildretries it.buildto an existing plugin needs oneamber_buildand a reload. If the lockfile can't be read, nothing is held back.data_dir, since restore and update refuse dirty checkouts.buildis rejected together withpath.setup(opts, ctx)ctxhasname,dir,module_dir,commit(the locked one) anddata_dir(under$XDG_STATE_HOME/rex/amber; Amber names it but doesn't create it). Plugins that ignore the second argument don't notice.Not here
No service management and no launchd/systemd units. For a background watcher the README says to start it from
setup. There's also norex_bininctx, because I don't know a reliable way to find the server binary, and no uninstall oramber_clean.Testing
CI is green. Locally I only had
texlua(Lua 5.3) with a smallpackage.loadersshim, so the suite ran there and formatting was done by hand. I haven't tried it against a real Rex:rex config check,rex.execwithsh -candenv, and the detached-process notes in the README are all unchecked.https://claude.ai/code/session_01HYR5Nyv85TQGevuubCSZYd
Generated by Claude Code