Skip to content

feat(runner): add Amp as a read-only external provider (#158) - #208

Merged
mergify[bot] merged 2 commits into
mainfrom
feat/158-amp-runner
Oct 16, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
feat/158-amp-runner

Conversation

@ericlitman

@ericlitman ericlitman commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds Amp as a read-only external provider, restored from 08556cd (reviewed in #196). Under #203, a read-only lane means the read-only settings pstack passes to Amp; the runner adds no refusal or guard because of the operator's own host, account, repository or organization configuration, and the catalog notes say what that configuration can do. Closes #158.

pstack-runner --provider amp --mode read-only
  sidecar: <receipt>.provider/settings.json = Read enabled, every other tool rejected; MCP servers, both skill
           sources, updates and notifications off
  env: allowlist + AMP_API_KEY; AMP_IGNORE_GUIDANCE_FILES=*
  preflight: amp usage
  amp -x --stream-json -m deepseek-v4.1-flash --settings-file <sidecar>/settings.json --visibility private --no-ide --no-notifications -l pstack-runner
  • Family amp-deepseek-v4.1-flash: Amp's official deepseek-v4.1-flash mode, effort default, on the personal ampcode.com login. Proof is the pinned mode in the argv.
  • No .amp/ refusal. The catalog notes state what still loads and what it was measured to do: Amp's own official-modes plugin (no version pin), system plugins under XDG_CONFIG_HOME, personal and workspace plugins from ampcode.com, machine and workspace managed settings, and a repository's .amp/ settings and plugins.

Evidence

  • Direct live checks, Amp CLI 0.0.1792123242-g03edc7, personal login, through this branch's launcher before the rebase onto main (pstack-runner --parent claude --provider amp --model deepseek-v4.1-flash --effort default --mode read-only):
    • Git fixture: exit 0, complete, preflight passed, output equal to the fixture's marker.
    • Git fixture holding .amp/settings.json: exit 0, complete, no refusal, output equal to the marker.
  • Unit: amp.test.ts (argv, settings file, environment, preflight, parser, adapterSuite); run.test.ts lanes, including one in a workspace holding .amp/.
  • Exact-head live gate: passed on cbc2734 from trusted main 1e8e2c6, 10 planned sessions: evidence comment. The Claude and Codex parents each dispatched amp:deepseek-v4.1-flash@default read-only through the installed launcher; both lane receipts read complete with preflight passed, and both parents resolved the regenerated catalog.

Merge Danger

Door: two-way. A new provider that no default role uses; reverting removes it.

Blast Radius: opt-in. Only a model sheet that names amp:... reaches it. Each lane is a private ampcode.com thread and spends Amp credits.

Live gate

Run from trusted main, because the PR does not change the verifier. 10 planned sessions.

Feature Why
claude:runner, codex:runner with --runner-route amp:deepseek-v4.1-flash@default The changed behavior is an Amp lane dispatched by each parent: preflight, launch, parse and receipt.
claude:catalog, codex:catalog The generated catalog gains Amp rows; each parent must still resolve the regenerated catalog.

No setup: setup's behavior does not change.

Acceptance criteria

Criterion (#158) Verification
Current scope: "a read-only lane on Amp's official deepseek-v4.1-flash mode with a run-owned --settings-file that enables only Read, AMP_IGNORE_GUIDANCE_FILES, private threads and the personal ampcode.com login, and no .amp/ refusal" Adapter and amp.test.ts; the two direct live lanes; the exact-head live gate.
Current scope: "The catalog notes say what still loads: machine and workspace managed settings, system, personal and workspace plugins, a repository's .amp/ settings and plugins, and Amp's own official-modes plugin, and that these can enable tools, change modes or run code in a lane." references/model-catalog.md Amp notes, from the batch-158 Amp captures.
Maintainer checklist (#158 comment): non-interactive mode with a machine-readable result; model and effort selection; bounded read-only mode; a way to prove which model ran -x --stream-json; the pinned official mode; the run-owned settings file; pinned-argv proof (Amp's stream never names the model).

Gate results

On head cbc2734 (rebased onto main 1e8e2c6):

Check Exit Summary
bun run test 0 482 pass, 0 fail
bun run typecheck 0
bun run static 0 verifier suite 166 pass, 0 fail
claude plugin validate plugins/pstack 0 Validation passed

Not verified

  • Machine and server-managed settings and personal or workspace plugins: none on the measured Mac or account; the notes say these come from Amp's docs and plugin API.
  • A served-model proof: Amp's stream never names the model.

🤖 Generated with Claude Code

Restores the Amp adapter from 08556cd. A lane runs Amp's official
deepseek-v4.1-flash mode with a run-owned settings file that enables only
Read, private threads and ignored guidance files. Under #203, it runs in
any repository; the catalog notes say what plugins and managed, workspace
and repository settings still load and what each was measured to do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Queue ready pull requests

Automatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head and every review thread is resolved.

  • #review-threads-unresolved = 0
  • -draft
  • check-success=Unfret
  • check-success=live-gate
  • check-success=verify

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -files~=^\.github/
  • base = main

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileTier: plus

[High impact] No actionable defect was found in the changed code; the required exact-head live gate still governs merge readiness.

Summary

Adds Amp as an opt-in external provider for Claude Code and Codex, with deepseek-v4.1-flash@default.

  • Amp runs pinned read-only turns and returns their results.
  • Callers can select Amp’s DeepSeek mode from the runner catalog.

Reviews (1) · Last reviewed commit: "feat(runner): add Amp as a read-only ext..." · Reviewed by Greptile

@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: cbc27344745ee224ddf6d76a030f8042c7e8898b
  • Base SHA: 1e8e2c69271d7b89ed83257c47b0c095c2c5786d
  • Result: PASSED — named features verified
  • Self-test: not requested
  • Planned sessions: 10 (limit 12)
  • Publisher revision: 1e8e2c69271d7b89ed83257c47b0c095c2c5786d
  • Evidence-set SHA-256: 51987f8e3f183fc769ac4317465341e59dacfd77fea8777fe5ca1b73913695a5
  • Installation (claude): CLI 2.1.301 (Claude Code), plugin 1.11.0, candidate cbc27344745ee224ddf6d76a030f8042c7e8898b, tree 3c38ae0be2df81f1db412f56061d6e6ca0e49052763c122d90d02ce744e9e5d0.
  • Installation (codex): CLI codex-cli 0.163.0, plugin 1.11.0, candidate cbc27344745ee224ddf6d76a030f8042c7e8898b, tree 3c38ae0be2df81f1db412f56061d6e6ca0e49052763c122d90d02ce744e9e5d0.
  • Observation (claude / runner): surface claude -p stream-json with the candidate plugin-dir; action recipe runner: route-1, full-access-writer, bounded-writer; result passed 16 assertions; ids retained privately; 16 assertions machine-checked; transcript SHA-256 32ced93ab737422a84979b990316556b1eb19b1ee707bcb330902436764cae2f; artifact-set SHA-256 9c14742130ed7966844a0ef2cc1d50940f313da11ae30d6b6d04e944daa9ee90.
  • Observation (claude / catalog): surface claude -p stream-json with the candidate plugin-dir; action recipe catalog: consume-sheet, consume-sheet-bounded, native-agents; result passed 27 assertions; ids retained privately; 27 assertions machine-checked; transcript SHA-256 0ffb1af6c5977c871a9715bd8572cbc59e5ffe47a659fb89512085eb5c548c9b; artifact-set SHA-256 cadff55f8a150c6ba89e12d633630c3977c3965c04fa5f298aacda29c42f6c17.
  • Observation (codex / runner): surface codex exec --json with the run-owned candidate installation; action recipe runner: route-1, linked-worktree-writer; result passed 10 assertions; ids retained privately; 10 assertions machine-checked; transcript SHA-256 e2e4727cc2fd950a1ca6a598319654c69d1dff5a5ad434cf68bbb21c1fa97868; artifact-set SHA-256 04bdea002955c10f04e6ddd6afb7ce1ee2161ec7579bf8cfeaa398888cb77c31.
  • Observation (codex / catalog): surface codex exec --json with the run-owned candidate installation; action recipe catalog: consume-sheet, consume-sheet-bounded; result passed 24 assertions; ids retained privately; 24 assertions machine-checked; transcript SHA-256 a62fd8871fe6016540e32ced86b898c69b775ecf01ae40e97d8cb172fb1679c9; artifact-set SHA-256 97cd29a6c03b31c8f037dc64c0d26d9740851ac02c9f4de485484813cebfe369.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@unfret-eal

unfret-eal Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ No blocking findings

Walkthrough

Adds Amp as a new read-only external provider for pstack-runner, with one opt-in model family (`amp-deepseek-v4.1-flash`) that pins Amp's official `deepseek-v4.1-flash` mode. Each lane writes its own private settings file that enables only the `Read` tool and turns off MCP servers, skills, updates and notifications. The lane passes only an allowlisted environment plus `AMP_API_KEY`, ignores guidance files, checks login with `amp usage` before starting, and runs as a private, labeled ampcode.com thread. Model proof is the pinned mode in the argv, because Amp's stream never names the model. The runner does not refuse a repository `.amp/` directory, and refuses `isolated-write`. The catalog notes instead document what can still override the lockdown: Amp's unpinned `official-modes` plugin, system, personal and workspace plugins, managed settings, and a repo's `.amp/` settings and plugins. The PR adds tests for argv, settings, environment, preflight classification, stream parsing, and parent-dispatched lanes, including one whose workspace holds `.amp/`.

Area What changes
Amp adapter New provider that launches `amp -x --stream-json` with a run-owned lockdown settings file and stdin prompt. The `result` event decides the outcome: exit-0 errors map to child-failed and SIGINT/SIGTERM maps to cancelled. Assistant usage is summed.
Registry and catalog Registers the `amp` provider and the `amp-deepseek-v4.1-flash` family. The generated catalog gains Amp rows and notes describing state paths, preflight, privacy, and the plugin and settings sources that can re-enable tools.
Tests and fixtures Adds `amp.test.ts` with sanitized Amp captures and adds Amp lane cases to `run.test.ts`. Updates provider lists in the CLI and registry tests.
Details
Lane / stage Model Effort Outcome Duration
broad-gpt-5.6-sol-xhigh / review openai/gpt-5.6-sol → gpt-5.6-sol · primary xhigh succeeded 3 min 43 s
broad-opus-5.5-max / review anthropic/claude-opus-5-5 → claude-opus-5-5 · primary max succeeded 5 min 6 s
focal-gpt-5.6-sol-xhigh copy / review openai/gpt-6.1-sol → gpt-6.1-sol · primary xhigh succeeded 4 min 44 s
focal-gpt-5.6-sol-xhigh copy 2 / review openai/gpt-6.1-sol → gpt-6.1-sol · primary xhigh succeeded 5 min 20 s

First review of this pull request.
4 reviewers finished.
Commit cbc2734.
Check run.
Run: GET /unfret/run/panel:cbc27344745ee224ddf6d76a030f8042c7e8898b:OAqCMcTf6C6:7Z11iIcJHY8.

@unfret review · @unfret status · @unfret help

@unfret-eal unfret-eal Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No blocking findings
Check

@ericlitman

Copy link
Copy Markdown
Owner Author

@Mergifyio refresh

@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-16 19:17 UTC · Rule: default · triggered by merge protections
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-16 19:27 UTC · at 5fb1fca27ec3a46b08d90d09dcecb78ccb62a1a0 · merge

This pull request spent 9 minutes 56 seconds in the queue, including 9 minutes 38 seconds running CI.

Required conditions to merge

@mergify

mergify Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@mergify mergify Bot added the queued label Oct 16, 2026
@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: 753eb851492cd55fa7fc71958f1103088e78c851
  • Base SHA: 0b6970bbe634ce8520210afd45b7cd8efea91343
  • Result: PASSED — named features verified
  • Self-test: not requested
  • Planned sessions: 10 (limit 12)
  • Publisher revision: 0b6970bbe634ce8520210afd45b7cd8efea91343
  • Evidence-set SHA-256: eb6d3167221859b973c58d912aa3c25abb85360ebc373a896523e2546481c04f
  • Installation (claude): CLI 2.1.301 (Claude Code), plugin 1.12.0, candidate 753eb851492cd55fa7fc71958f1103088e78c851, tree 72975858d9e8e5c6b2923caa61fc26809f819278fbf761698303eac20f63a80f.
  • Installation (codex): CLI codex-cli 0.163.0, plugin 1.12.0, candidate 753eb851492cd55fa7fc71958f1103088e78c851, tree 72975858d9e8e5c6b2923caa61fc26809f819278fbf761698303eac20f63a80f.
  • Observation (claude / runner): surface claude -p stream-json with the candidate plugin-dir; action recipe runner: route-1, full-access-writer, bounded-writer; result passed 16 assertions; ids retained privately; 16 assertions machine-checked; transcript SHA-256 a506aec2a5f596d7d7e646a26cff2ece3f68d96baf1c123511cccb4b9ea03331; artifact-set SHA-256 2b5f3e72401fc5d6197b2cac13ba91860e4d3b134fecb7242a42fe7b3e5dadca.
  • Observation (claude / catalog): surface claude -p stream-json with the candidate plugin-dir; action recipe catalog: consume-sheet, consume-sheet-bounded, native-agents; result passed 27 assertions; ids retained privately; 27 assertions machine-checked; transcript SHA-256 3d9d0d104bfd58cd2f52f48bbf49dad3384cdddd13eafcf698c620377a789957; artifact-set SHA-256 9b8548381e72e59140d9fe11c69098ec787faa13aa0ba7d4b025dd16fa11b4ef.
  • Observation (codex / runner): surface codex exec --json with the run-owned candidate installation; action recipe runner: route-1, linked-worktree-writer; result passed 10 assertions; ids retained privately; 10 assertions machine-checked; transcript SHA-256 3655096efaf74b79c2f88a5b4bb978edd5ed8e84a95b22316f8618d6537c6bb6; artifact-set SHA-256 6c1e8c2ac86b55b1f0264679ab630c7b763f5244c69ab8e6823e719ef4e64d90.
  • Observation (codex / catalog): surface codex exec --json with the run-owned candidate installation; action recipe catalog: consume-sheet, consume-sheet-bounded; result passed 24 assertions; ids retained privately; 24 assertions machine-checked; transcript SHA-256 124646fbdcefc30fbbb8afcd1dc41230b3b290c8b66fef75f6ca537ad99091ff; artifact-set SHA-256 a2582f557af348b54486b0c53ae24a39c97c3e904de8eba78ba4e0d4a23db5ea.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@mergify
mergify Bot merged commit 5fb1fca into main Oct 16, 2026
6 checks passed
@mergify mergify Bot removed the queued label Oct 16, 2026
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.

Support Amp as an external provider

1 participant