Repository navigation
Conversation
…pi, tasks and start logic - Replace the agentapi module with coder-utils; drop Tasks/web-app inputs, start script, and the task-reporting MCP server. - Install via the official installer (AMP_VERSION pin, temp file + bash -n, retrying curl); drop npm install. - Make workdir optional; merge amp_settings (was base_amp_config) and mcp into ~/.config/amp/settings.json, existing MCP servers win. - Add managed_settings (/etc/ampcode/managed-settings.json); write instruction_prompt to ~/.config/amp/AGENTS.md. - Drop mode (use --mode in the launcher); add scripts output, main.tftest.hcl, container tests; bump to 4.0.0.
Module Scorecard Check
|
| Presentation & Onboarding | Agent Integration | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|---|
| 10 / 17 | 10 / 25 | 20 / 20 | 7 / 20 | 10 / 10 | 62 / 100 |
Drilldown
Presentation & Onboarding — 10 / 17
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 10 | Four README examples cover basic install, standalone launcher app, settings/MCP/guidance, and script serialization. However, the install_amp = false (pre-installed binary) mode—documented only in the variable description in main.tf—has no dedicated README example, leaving a major operational mode under-documented. |
| Visual preview | 5 | 0 | No embedded image, GIF, or video in the README. The icon frontmatter field references an SVG logo, which does not count as a preview of the module in action. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | amp_api_key is declared sensitive = true in main.tf. All README examples reference var.amp_api_key (a Terraform variable), never an inline literal or placeholder key. |
| Non-hardcoded auth path | 4 | 4 | The README Authentication section explicitly documents two paths: "Set amp_api_key (exported as AMP_API_KEY) or run amp login in the workspace." The amp login interactive path avoids pasting a raw key into templates. |
Restricted-Environment Readiness — 7 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 5 | 0 | The install URL https://ampcode.com/install.sh is hardcoded in scripts/install.sh.tftpl. No module input variable overrides this URL. amp_version pins a release but does not change the download source. |
| Bring-your-own binary | 10 | 5 | install_amp = false skips the installer and validates an existing amp on PATH (tested in main.test.ts). The variable description in main.tf documents this, but the README contains no example or section demonstrating the pre-installed-binary path, making it under-documented for end users. |
| Egress transparency | 3 | 0 | No dedicated README section enumerates external endpoints. The only external call (https://ampcode.com/install.sh) is visible only in the install script source, not in a network/offline/air-gapped section. |
| Runs without sudo | 2 | 2 | The install script operates entirely within $HOME (~/.amp/bin, ~/.local/bin, shell profiles). No sudo invocation appears anywhere in scripts/install.sh.tftpl. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All 11 variables have clear descriptions and sensible defaults. Complex inputs (base_amp_config, mcp, instruction_prompt) include links to Amp documentation. amp_api_key is marked sensitive. Types are appropriate (bool for install_amp, string for the rest). |
| Test coverage | 4 | 4 | main.tftest.hcl covers business logic (defaults, workdir trimming, conditional env-var creation, version passthrough, scripts output ordering). main.test.ts provides 11 end-to-end tests executing real scripts in containers, covering happy path, pre-installed binary, installer download/failure, workdir creation, config overwrite, MCP merge semantics, JSONC handling, API-key leakage, and pre/post scripts. |
Agent Integration — 10 / 25
| Criterion | Max | Score | Notes |
|---|---|---|---|
| AI governance | 10 | 0 | No mention of Coder AI Gateway or Agent Firewall in the README or any module file. The module installs and configures Amp but does not document how Coder governs auth, routing, or policy enforcement for the agent. |
| Dashboard entry point | 5 | 5 | The "Standalone mode with a launcher app" example in the README documents a coder_app resource with slug, display_name, icon, open_in = "slim-window", and a launch command. |
| Session continuity | 5 | 0 | No documentation of session resumption, session IDs, or persistent session managers (tmux, screen, boo) in the README or module files. |
| Managed configuration | 5 | 5 | The "Settings, MCP servers, and guidance" example documents base_amp_config (overwrites ~/.config/amp/settings.json), mcp (adds to amp.mcpServers), and instruction_prompt (writes ~/.config/AGENTS.md), with links to Amp docs for each. |
Overall — 62 / 100
Raw 57 / 92 → round(57 / 92 × 100) = 62
Tip
You can run this locally by telling your agent: "review this module against .github/scorecard/SCORECARD.md".
Scored against SCORECARD.md with solstice-1. Language-model scores are advisory.
|
Maybe we can repurpose this module to use Coder workspaces as Amp runners? |
|
Ack, will check this out. |
…to agentapi removal and current docs Keep base_amp_config (merged, no defaults) instead of renaming it, drop managed_settings, variable validations, and installed-version checks, warn per skipped duplicate MCP server, keep ~/.config/AGENTS.md, and trim the README.
…ings with base_amp_config base_amp_config now overwrites settings.json on every start instead of merging keys; mcp is applied afterwards.
…config and mcp handling
…mples and doc links
…n README examples
|
Automated review requested by @matifali. Please sanity-check before acting on it.
Verdict: request changes. No blockers. It's still a draft, and it has the same upgrade-leftover problem as #1159 (worse here: it includes an agent token), plus an undocumented change to MCP merge precedence. What's good
Findings
CI and reviews
Consistency with the series
|
…rsion >= 1.0 Nothing in the module needs Terraform 1.9.
Closes REG-86
Refactor
coder-labs/sourcegraph-ampto install and configure Amp only, matching the claude-code, codex, copilot, and cursor-cli (#1152) migrations. Changes beyond the AgentAPI removal are limited to what the current Amp docs require.order,group,cli_app,web_app_display_name,cli_app_display_name,install_agentapi,agentapi_version,report_tasks,ai_prompt,mode), the start script, thetask_app_idoutput, and the task-reportingcoderMCP server (which also renderedCODER_AGENT_TOKENinto settings).https://ampcode.com/install.sh), passingamp_versionasAMP_VERSION. Withinstall_amp = trueit always runs; withfalsethe module only checksampis onPATH.install_via_npmis removed.workdiris optional and created if missing.base_amp_configoverwrites~/.config/amp/settings.jsonon every start (no stale default keys), thenmcpis added intoamp.mcpServerswith existing servers winning, matchingamp mcp add. If the file is JSONC or invalid JSON,mcpis skipped with a warning.instruction_promptstill writes~/.config/AGENTS.md.amp_api_keyis exported asAMP_API_KEYonly when set and never rendered into the script.scriptsoutput; README reduced to examples and doc links; rewrite tests. Bump to4.0.0.Important
Not verified in a live Amp session (no Amp access token): that MCP servers written by the module start.
amp mcp listwith the real binary lists them, andamp mcp doctorshowseverythingconnected.Decision log
0.0.1791914780-gdfd130)install.shhonorsAMP_VERSION(empty = latest), installs to~/.amp/bin, links~/.local/bin/ampinstall_via_npm--modeflag only; oldfree|rush|smartvalues are gonemode, document the flagamp mcp addexits 1 with "already exists" and keeps the stored server (verified)AMP_SETTINGS_FILEoverrides the pathmcponly to strict JSON, honor the overridebase_amp_configmcp; no defaults~/.config/AGENTS.mdand~/.config/amp/AGENTS.mdare always loaded~/.config/AGENTS.mdamp_versionis base64-encoded into the scriptTesting
terraform test(6 passed),bun test main.test.ts(12 passed, container-based),terraform fmt, prettier, shellcheck on the rendered scriptcodercom/enterprise-node:latest: install, workdir, AGENTS.md, usersharedserver kept with a warning whileeverythingand abase_amp_configserver were added, unrelated keys preserved,amp mcp listshows all three, rerun succeedsbase_amp_configoverwritessettings.jsonandmcpis added with base servers winning; JSONCbase_amp_configis written as is andmcpis skipped with a warningGenerated with Coder Agents.