Skip to content

feat(pasqal): validator list-projects mode + sandbox env passthrough (#194) - #198

Merged
kateebonner merged 2 commits into
mainfrom
kate/pasqal-validator-list-mode
Jul 22, 2026
Merged

feat(pasqal): validator list-projects mode + sandbox env passthrough (#194)#198
kateebonner merged 2 commits into
mainfrom
kate/pasqal-validator-list-mode

Conversation

@kateebonner

Copy link
Copy Markdown
Contributor

The amicode-side support for the #194 two-step Pasqal auth (username+password → pick a project). Pairs with harmoniqs/opencode PR #43 (the server + panel). Verified end-to-end live and in the VS Code sandbox.

Changes

scripts/pasqal-connector/pasqal_validate.py — list-projects mode
When PASQAL_PROJECT_ID is absent, authenticate on username+password alone and return the caller's projects so the panel can offer a picker:
{"ok": true, "mode": "list", "projects": [{"id","name"}], "token", "expires_at"}
(via GET account/api/v1/projects, the endpoint Jack's session confirmed). When a project id IS present, the original connect-and-validate behavior is unchanged. Fixed error messages only — no secret ever printed.

src/server_auth.ts — sandbox env passthrough
buildServerSpawnEnv spawns opencode with a deliberately minimal env (PATH + config + per-boot password). Added a fixed allowlist passthrough of non-secret amico state locations (AMICO_PASQAL_FILE / AMICO_CLOUD_FILE / AMICODE_CONNECTIONS_FILE / AMICODE_OPS_DIR / AMICO_PASQAL_KEYCHAIN_SERVICE / AMICO_PASQAL_VALIDATOR / AMICO_PYTHON) when set — keeps the minimal-env discipline (never a process.env spread; unset vars never appear) while letting an isolated sandbox point its ~/.amico + keychain slot elsewhere, separate from the real install.

Verification

  • pnpm --filter amicode run typecheck — clean
  • bun test packages/extension/test/server_auth.test.ts — 12 pass (base env unchanged when the vars are unset; passthrough only adds set keys)
  • python3 -m py_compile pasqal_validate.py — clean; list-mode present
  • Live: the two-step (username+password → list projects → choose → connected) runs against real Pasqal through the compiled binary and in the VS Code extension sandbox.

Notes

🤖 Generated with Claude Code

kateebonner and others added 2 commits July 21, 2026 21:31
)

When PASQAL_PROJECT_ID is absent, authenticate on username+password alone and
return the caller's projects ({ok, mode:'list', projects:[{id,name}], token,
expires_at}) so the panel can offer a picker. When present, the original
connect-and-validate behavior is unchanged. Fixed error messages only; no
secret ever printed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…code server (#194)

Adds a fixed allowlist of non-secret amico state locations (pasqal.json /
cloud.json / connections.json / ops dir / keychain service / validator /
python) that pass through buildServerSpawnEnv when set. Keeps the minimal-env
discipline (never a process.env spread; unset vars never appear) while letting
an isolated sandbox launch its own ~/.amico + keychain, separate from the real
install. Enables the VS Code extension sandbox for #194 testing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kateebonner
kateebonner merged commit 3267d3f into main Jul 22, 2026
5 checks passed
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