merge-upstream
Merge new upstream releases of nushell and reedline into Shannon
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Merge new upstream releases of nushell and reedline into Shannon
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Run an in-session adversarial review of Shannon work using a fresh-context reviewer. Use for experiment design gates, experiment result gates, risky Rust changes, Nushell/Reedline subtree upgrades, and workflow compliance.
Ask Claude to review Shannon work. Use when the user requests Claude review or during large/risky experiments before acting on conclusions.
Ask Codex to review Shannon work. Use when the user requests Codex review or during large/risky experiments before acting on conclusions.
Write entertaining commit messages as poetry
Create a new agent skill. Use when creating a new skill for the project.
Store all debug logs in ~/dev/shannon/logs/. Use when running apps, configuring log paths, or troubleshooting output.
| name | merge-upstream |
| description | Merge new upstream releases of nushell and reedline into Shannon |
Shannon tracks nushell and reedline as git subtrees under nushell/ and
reedline/. Every few nushell releases, we pull upstream to pick up new
features and fixes. This skill captures what actually works — because
scripts/sync-upstream.sh alone is not enough when upstream has drifted.
scripts/sync-upstream.sh runs git subtree pull for nushell and reedline,
then cargo build && cargo test. That's fine for tiny drifts. For real upstream
releases it fails because:
cargo build fails deep in nu-protocol or
nu-parser.src/ lags upstream API. src/main.rs and src/run.rs
are copied from nushell's binary and drift every release.Cargo.toml version pins don't auto-bump. The Shannon crate still
references the old 0.N.0 nu-* versions.Keep these exact files across upgrades. Everything else in nushell/ should
come from upstream verbatim:
nushell/Cargo.toml — workspace reedline path dep, shannon package renames
(shannon-nu-cli, shannon-nu-lsp), shannon crate versionsnushell/crates/nu-cli/Cargo.toml — name = "shannon-nu-cli", tree-sitter
deps for BashHighlighternushell/crates/nu-cli/src/bash_highlight.rs — NEW, tree-sitter-based bash
syntax highlighternushell/crates/nu-cli/src/mode_dispatcher.rs — NEW, ModeDispatcher traitnushell/crates/nu-cli/src/lib.rs — declares mod bash_highlight,
mod mode_dispatcher, and re-exports BashHighlighter, ModeDispatcher,
ModeResultnushell/crates/nu-cli/src/repl.rs — dispatch hook in loop_iteration() that
forwards to ModeDispatcher::execute() when $env.SHANNON_MODE is not
"nu"; also a few smaller tweaksnushell/crates/nu-cli/src/nu_highlight.rs — small tweaknushell/crates/nu-command/src/platform/input/input_.rs — small tweaknushell/crates/nu-lsp/Cargo.toml — name = "shannon-nu-lsp", references
shannon-nu-cliVerify this list against the current state before you start:
git diff --stat <last-nushell-import-commit>..HEAD -- nushell/
If new Shannon-modified files appear, add them to the preserve list below.
Work on a branch — never on main.
Clean working tree. Fetch upstream. Count the drift.
git status # must be clean
git fetch upstream-nushell upstream-reedline
git log --oneline <last-merge-base>..upstream-nushell/main | wc -l
Large drifts (100+ commits) are the norm — that's fine, just plan for conflicts.
git checkout -b upgrade/nushell-$(date +%Y-%m-%d)
git subtree pull --prefix nushell upstream-nushell main \
-m "Merge nushell upstream $(date +%Y-%m-%d)"
This will fail with "Automatic merge failed". That is expected.
Before doing anything destructive:
mkdir -p /tmp/shannon_patches
cp nushell/Cargo.toml /tmp/shannon_patches/Cargo.toml
cp nushell/crates/nu-cli/Cargo.toml /tmp/shannon_patches/nu-cli-Cargo.toml
cp nushell/crates/nu-cli/src/bash_highlight.rs /tmp/shannon_patches/bash_highlight.rs
cp nushell/crates/nu-cli/src/mode_dispatcher.rs /tmp/shannon_patches/mode_dispatcher.rs
cp nushell/crates/nu-cli/src/lib.rs /tmp/shannon_patches/lib.rs
cp nushell/crates/nu-cli/src/nu_highlight.rs /tmp/shannon_patches/nu_highlight.rs
cp nushell/crates/nu-cli/src/repl.rs /tmp/shannon_patches/repl.rs
cp nushell/crates/nu-command/src/platform/input/input_.rs /tmp/shannon_patches/input_.rs
cp nushell/crates/nu-lsp/Cargo.toml /tmp/shannon_patches/nu-lsp-Cargo.toml
The unresolved conflict markers in those files are fine — they're snapshots, not for reuse. What you actually need from them is the Shannon side of each hunk, which you'll recreate by hand in step 7. In practice the easier workflow is: commit the broken merge first (step 5), then re-export clean Shannon versions from the main branch:
git show main:nushell/Cargo.toml > /tmp/shannon_patches/Cargo.toml
# ... and so on
Don't try to hand-resolve 100+ conflicts. Just stage whatever's there and commit it — you're about to overwrite the tree anyway.
git checkout --theirs -- $(git diff --name-only --diff-filter=U)
git add -A
git -c core.editor=true commit --no-edit
This is the step that makes everything else tractable. Wipe nushell/ and
re-populate from upstream-nushell/main:
git rm -rqf nushell/
mkdir -p nushell
git archive upstream-nushell/main | tar -x -C nushell/
You now have a pristine copy of upstream's tree at nushell/, free of any
auto-merge weirdness.
cp /tmp/shannon_patches/Cargo.toml nushell/Cargo.toml
cp /tmp/shannon_patches/nu-cli-Cargo.toml nushell/crates/nu-cli/Cargo.toml
cp /tmp/shannon_patches/bash_highlight.rs nushell/crates/nu-cli/src/bash_highlight.rs
cp /tmp/shannon_patches/mode_dispatcher.rs nushell/crates/nu-cli/src/mode_dispatcher.rs
cp /tmp/shannon_patches/lib.rs nushell/crates/nu-cli/src/lib.rs
cp /tmp/shannon_patches/nu_highlight.rs nushell/crates/nu-cli/src/nu_highlight.rs
cp /tmp/shannon_patches/repl.rs nushell/crates/nu-cli/src/repl.rs
cp /tmp/shannon_patches/input_.rs nushell/crates/nu-command/src/platform/input/input_.rs
cp /tmp/shannon_patches/nu-lsp-Cargo.toml nushell/crates/nu-lsp/Cargo.toml
Then update the Shannon files for upstream API churn:
nushell/Cargo.toml — bump all version = "0.OLD.0" entries in the
[dependencies] block to match the new upstream version. Keep the
shannon-nu-cli / shannon-nu-lsp package renames and Shannon crate
versions. Bump reedline in [workspace.dependencies] to the new version and
keep path = "../reedline". The [workspace.package] and [[test]] blocks
may be new from upstream — preserve them.nushell/crates/nu-cli/Cargo.toml — bump all version = "0.OLD.0" in
both [dev-dependencies] and [dependencies]. Add
rust-version.workspace = true and autotests = false if upstream introduced
them.nushell/crates/nu-lsp/Cargo.toml — same pattern.git subtree pull --prefix reedline upstream-reedline main \
-m "Merge reedline upstream $(date +%Y-%m-%d)"
# Resolve Cargo.lock conflict by taking upstream:
git checkout --theirs -- reedline/Cargo.lock
git add reedline/Cargo.lock
git -c core.editor=true commit --no-edit
Reedline has no Shannon-side changes, so conflicts are minimal (usually just
Cargo.lock).
rm nushell/Cargo.lock
(cd nushell && cargo generate-lockfile)
The root Cargo.lock regenerates on the next cargo build.
Cargo.tomlIn /Users/ryan/dev/shannon/Cargo.toml, update:
nu-* = { version = "0.OLD.0", ... } to the new versionreedline = { version = "0.OLD.0", ... } to the new versionA sed one-liner works if the old version is unique:
sed -i '' 's/version = "0.111.0"/version = "0.112.2"/g' Cargo.toml
sed -i '' 's/version = "0.46.0"/version = "0.47.0"/g' Cargo.toml
(macOS sed uses -i ''. Linux: sed -i.)
src/main.rs and src/run.rs for API churnShannon's src/ is copied from nushell's binary and drifts every release. Diff
against upstream to find what changed:
diff src/main.rs nushell/src/main.rs
diff src/run.rs nushell/src/run.rs
Common changes:
std::time::Instant → nu_utils::time::Instant. Nushell migrated to its
own Instant wrapper. Replace everywhere in Shannon's src/.nu_protocol::location!() removed. Calls to
IoError::new_internal_with_path(err, msg, location!(), path) now take only
(err, msg, path) — drop the location!() argument.ShellError::GenericError → ShellError::Generic. (Currently emits
deprecation warnings; not a build failure yet.)evaluate_repl signature changes. Check the argument list against
upstream if you get a type mismatch.The diff against upstream's equivalent file is the fastest way to find all call sites that need updating.
cargo build
First build errors will usually be in nu-parser or nu-protocol complaining
about missing exports. If you see this after a wholesale tree replace, it's
almost always stale incremental compilation artifacts from an earlier failed
build. Force a rebuild of the affected crate:
touch nushell/crates/nu-experimental/src/lib.rs # or whichever crate is stuck
cargo build
Avoid cargo clean — per nushell/AGENTS.md, it just wastes compile time.
Once nushell/ compiles, the next errors will be in shannonshell itself
(src/main.rs, src/run.rs) — those are the API-churn fixes from step 11.
./target/debug/shannon --version
./target/debug/shannon
In the interactive shell:
ls) — verify nu mode worksShift+Tab — verify mode switches to bashecho $HOME) — verify bash mode worksShift+Tab — verify it switches back to nucd /tmp in bash, then
back to nu and check pwd)The build passing is not sufficient — Shannon's ModeDispatcher hook lives
in repl.rs, which upstream rewrites frequently. A merge can compile fine but
silently break the dispatcher.
At this point you should have on the branch:
Cargo.toml / src/ API updatesMerge to main when ready:
git checkout main
git merge --no-ff upgrade/nushell-$(date +%Y-%m-%d)
--squash with git subtree. Shannon's AGENTS.md explicitly
forbids it. Full history across merged projects must be preserved for
blame/log/bisect.Cargo.toml. Bumping only nushell/Cargo.toml is
not enough.cargo build does not exercise the
dispatcher hook.scripts/sync-upstream.sh script is not the source of truth. This
skill is. Update the script if you want, but don't rely on it alone for real
upgrades.Consider opening an issue under issues/ to track any cleanup work —
deprecation warnings to address, features upstream added that Shannon could
expose (e.g. ExternalHinter in repl.rs), or new commands that should be
wired up.