Skip to content

feat(dev): a4 dev promote --check lists what exists only in the environment - #481

Merged
adiman9 merged 4 commits into
mainfrom
feat/dev-promote-check
Oct 30, 2026
Merged

adiman9 merged 4 commits into
mainfrom
feat/dev-promote-check

Conversation

@adiman9

@adiman9 adiman9 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

a4 dev promote --check lists what an app uses that exists only in the dev environment, each with the command that publishes it, and exits non-zero while anything remains, so CI can gate a production deploy on it.

Kind Source Fix it names
local-protocol-build an arete.lock entry with local_build a4 protocol deploy in the protocol's project, then a4 install --locked
program-release-override an environment program_release override for a program the lock pins (a program dependency, or a program of a stack or protocol) at another release deploy to mainnet, a4 program push <idl>, a4 install
stack-alias-override an environment stack_alias override whose StackManifest is a locked stack a4 up, point the dependency at it, a4 install
  • Without a dev environment for the project it checks arete.lock only, and says so.
  • --json prints {clean, environment, pending: [{kind, name, detail, fix}]}.
  • a4 dev promote without --check refuses; the check is the only mode for now.
  • Docs: "Before you deploy" section on the local development page.

Not covered yet:

  • Local SDK extensions. That category needs the local_extension lock marker, which lands with the local-extensions change; the check gains it there.
  • Registry stacks the environment loaded at a manifest the lock doesn't pin. The environment's stack listing doesn't expose each deployment's StackManifest hash yet, so this needs a small API addition first.

Independent of the edge PR (#475): based on main.

Tests: unit tests for the lock and override rules, run locally. Clippy was clean on the edge branch before the rebase; the rebase onto main changed only mod.rs and the dev_env.rs method placement. CI compiles it on main.

…onment

Local protocol builds, program release overrides and project stacks under a
dependency's alias, each with the command that publishes it; exits non-zero
while any remain so CI can gate a production deploy.
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
arete-docs Ready Ready Preview Oct 30, 2026 1:58am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking correction needed in the suggested program recovery command.

Fix All in Claude CodeFindings

  1. P2 Suggested fix keeps old release ▶
Fix with agent prompt
### Issue 1
cli/src/commands/dev/promote.rs:113
For an already-installed registry program, publishing a new release and running `a4 install` keeps the old release in `arete.lock` when the dependency declaration is unchanged. The reported `program-release-override` therefore remains pending after the user follows this fix.

Recommend `a4 update program <alias>` to select the new release, and update the matching documentation row.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds a4 dev promote --check to report local protocol builds and environment overrides, with plain or JSON output and a failing exit code while items remain.

  • Apps can check for development-only dependencies before a production deploy.

Reviewed the full PR because the previous and current revisions have different merge bases with the target branch. No tests were run.

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread cli/src/commands/dev/promote.rs Outdated
Comment thread cli/src/commands/dev/promote.rs Outdated
Comment thread cli/src/commands/dev/promote.rs Outdated
Comment thread rust/arete-mcp/src/dev_env.rs Outdated
…and sees protocol stacks

- A malformed or unreadable environment selection fails the check; only a
  missing one checks the lock alone.
- Stack alias overrides also match the stacks a protocol pins, reported
  under the protocol.
- A protocol never published is fixed with `a4 install`; `--locked` is
  offered only to go back to a pinned release.
- An overrides answer without an `overrides` list is an error, not a
  clean environment.
# Conflicts:
#	cli/src/commands/dev/mod.rs
#	rust/arete-mcp/src/dev_env.rs
"program {key} runs a changed release in the environment ({target}); arete.lock pins {}",
pinned.unwrap_or("no release")
),
fix: "Deploy the program to mainnet and push its IDL (`a4 program push <idl>`), then `a4 install` the new release".into(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Suggested fix keeps old release

For an already-installed registry program, publishing a new release and running a4 install keeps the old release in arete.lock when the dependency declaration is unchanged. The reported program-release-override therefore remains pending after the user follows this fix.

Recommend a4 update program <alias> to select the new release, and update the matching documentation row.

Knowledge Base Used: CLI workflows

Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/src/commands/dev/promote.rs
Line: 113

Comment:
**Suggested fix keeps old release**

For an already-installed registry program, publishing a new release and running `a4 install` keeps the old release in `arete.lock` when the dependency declaration is unchanged. The reported `program-release-override` therefore remains pending after the user follows this fix.

Recommend `a4 update program <alias>` to select the new release, and update the matching documentation row.

**Knowledge Base Used:** [CLI workflows](https://app.greptile.com/arete/-/custom-context/knowledge-base/aretea4/arete/-/docs/cli-workflows.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@adiman9
adiman9 merged commit 973714d into main Oct 30, 2026
35 checks passed
@adiman9
adiman9 deleted the feat/dev-promote-check branch October 30, 2026 02:27

This branch was successfully deployed

1 active deployment
Preview — b1783635 Deployed Oct 30, 2026 by vercel[bot]
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