Repository navigation
Release 2.0.7: amber-lsp API lookup and enforced agent setup - #44
Merged
Merged
Conversation
…ommit The fleet gate and setup checks need to prove which amber-lsp build they run; the server previously ignored --version and printed nothing.
…manager structure, story grammar) Four diagnostics rules enforcing the FSDD/Amber V2 standards: full method type interfaces, mandatory doc blocks, process-manager structure (typed initialize + perform), and feature-story grammar validity. Build 0/0, 44 specs pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The spec/amber_lsp/ suite drives AmberLSP::Server in-process over an IO::Memory pair. That proves the code but not the artifact: it cannot catch a stale bin/amber-lsp, a broken build, or a server that goes silent instead of answering. scripts/lsp_smoke.rb spawns the real executable, builds a throwaway Amber-shaped fixture project (shard.yml WITH an `amber` dependency -- ProjectContext.detect keeps the server silent without one), runs a real framed initialize/initialized/didOpen session, and asserts on the textDocument/publishDiagnostics notifications that come back: >= 1 diagnostic for the violating controller, exactly 0 for the clean one. Exit codes are deliberately three-valued: 0 pass, 1 expectations not met, 2 could-not-measure (no binary, handshake failure, timeout). A timeout is never reported as a pass -- a silent server is not a clean server. Ruby 2.6 / stdlib only so it runs under macOS system ruby with no setup. Verified against crystal-alpha 1.21.0 (Crystal 1.21.0 [9c1e8ec64]).
…d ruling) agent_e2e_spec asserted that after the agent fixes the file, diagnostics are empty. They were not: the fixture drew 2x fsdd/doc-block-required and 1x fsdd/method-type-signature. This was never Crystal 1.21 drift -- the spec last changed in 06cdee5 and the FSDD rules landed later in 8781d5b, so the new rules correctly fire on a fixture written before they existed. Two ways to make it green: turn the FSDD rules off by default, or fix the fixture. Owner's standing directive decides it -- we need to be eating our own dog food. The rules STAY ON BY DEFAULT; the fixture was wrong, not the rules. So the corrected code now carries a doc comment on the class and on the action and an explicit return type, and "clean" in this spec means clean by our own conventions rather than merely free of the two violations the fixture was originally written to demonstrate. Anything less and this spec would quietly assert that our own conventions are optional. 253 examples, 0 failures, 0 errors, 0 pending
The version macros required minecart on PATH, so crystal-alpha spec and every build failed with exit 127 for contributors and CI jobs without Minecart. Prefer minecart, then shards-alpha, then shards; all three read the same shard.yml version.
This was referenced Oct 6, 2026
amber-lsp --check declines projects that are not Amber V2 stacks. The post-edit hook passed that decline through as exit 2, so agents saw a failure after every .cr edit in a plain Crystal app or shard. Formatting still runs; Amber findings still fail in covered projects.
amber-lsp with no subcommand runs the language server on stdin, so --help used to wait silently, lookup --help failed, and context --help raised. Each now prints its usage; lookup lists its exit codes.
The Homebrew formula installs stock crystal, so every lookup failed with "crystal-alpha is not available on PATH". Stock crystal builds the same docs index; crystal-alpha stays preferred when installed.
The README's LSP and agent sections assumed an Amber project. One section now says the tooling works in any Crystal project and links a full guide: install, setup and trust, the committed files, what each hook does, every amber-lsp command with exit codes, API cards, and doctor fixes.
The release candidate now merges Minecart's alpha branch (2025.11.25.6) and pins its own dependencies by commit, so its commit and tree changed.
CI runners and Homebrew have stock crystal only, so the installer now uses crystal-alpha when present and crystal otherwise. Minecart .8 compiles on Windows, which the generated-app gate needs.
The lookup spec helper named crystal-alpha, which CI runners do not have; it now uses the same compiler fallback as amber-lsp. The beta contract script still read commands/new.cr, renamed to new_command.cr.
…rsion The macOS install-crystal tarball has no llvm-config, so lookup could not build standard library docs there; Homebrew's Crystal, which users install, does. Two specs pinned Crystal 1.21.0 and broke when runners moved to 1.21.1; they now read the installed compiler's version.
The darwin archive keeps shards only in embedded/bin, so micrate's postinstall (shards build) failed during the frozen install.
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.
Release branch for Amber CLI 2.0.7: amber-lsp API lookup and the agent setup that makes coding agents use it.
Supersedes #43 (
sol/setup-agent) and #39 (luna/rule-packs); both are contained in this branch.What it adds
amber-lsp lookup 'Type.method' | 'Type#method': answers from a layered docs index (project, each shard inlib/, Crystal stdlib). It shows the signature, the resolved return type, the source location, and card notes. Exit codes: 0 found, 3 candidates, 4 unknown, 5 absent, 2 failed.amber-lsp hint: reads compiler output on stdin and adds card hints for known errors..amber-lsp/api/*.yml): libraries ship their own. A Crystal card is bundled inshare/amber_cli/api/, with a compiled-in fallback.amber setup:agentwrites:.amber/agent_setup.jsonamber-agent-hook.credits while the setup is incomplete, which covers a missing binary, a version below the minimum, or a checksum mismatch.amber doctorshows the same checks to a human, plus workspace trust, Codex hook trust, worktree inheritance of the hook files, and index freshness.Evidence
628 specs pass. Zero-warning release builds of
amberandamber-lsp.A/B eval on 40 validated tasks, first-try compile rate:
Source archive at dc97420 (
git archive --prefix=amber_cli-2.0.7/): sha256371194246d586c512282ebe286755642edf1adcf69a800c641d5fe190e0d8886. The tap formula onamberframework/homebrew-amber_clisol/pin-everything-onboardingpins this hash. The CI-built source archive must match it before v2.0.7 is published.Release order
ec583594…).workflow_dispatchon this branch, and confirm the CI source sha256 equals the one above.