Skip to content

feat(github-app): amico[bot] identity — gh PATH shim + git credential helper - #400

Closed
aarontrowbridge wants to merge 2 commits into
mainfrom
399-github-app-identity-amicobot-acts-for-amicode-on-harmoniqs-repos-token-core-+-ghgit-shims
Closed

feat(github-app): amico[bot] identity — gh PATH shim + git credential helper#400
aarontrowbridge wants to merge 2 commits into
mainfrom
399-github-app-identity-amicobot-acts-for-amicode-on-harmoniqs-repos-token-core-+-ghgit-shims

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #399

What

Amicode gets its own GitHub face: an org-level GitHub App whose installation tokens arm every gh call and https git push in an agent session — bot PRs, human-authored commits (the Claude Code split).

  • github_app.ts — pure core: RS256 JWT mint (node:crypto, no new deps), installation-token fetch, 0600 atomic cache with 5-min reuse skew, token-free ConfigErrors (~/.amico/github.json, `` override — the pasqal credential-file pattern)
  • launcher/gh — PATH shim in the launcher bin dir the extension already prepends: unconfigured → byte-identical passthrough; configured → GH_TOKEN env into the real gh (recursion-guarded lookup). Every current and future gh call — agent sessions, handoff verb, repo-sync — becomes the bot with zero call-site changes
  • launcher/amico-git-credential — git credential helper for https github.com, registered via GIT_CONFIG_* spawn env ONLY when the connection file exists; silent fallthrough otherwise; never blocks auth
  • assert_packaged_cli.mjs — fail-closed gate extended: behavioral probes for both new bins (malformed-credential-file seeds, hermetic, no network)

Verification

  • 28 new hermetic tests (unit + through the built bundles); typecheck clean both packages
  • cli-gate: 23/23 PASS against the freshly staged bins
  • Remaining suite failures (opencode_dev provenance, agent_spawn config-dir, live-creds e2e) verified pre-existing on the clean tree
  • gh stays out of every node_modules/.bin — pnpm-script surface untouched

Phase 0 (manual, org owner — blocking for real use)

Create the org App (contents/PRs/issues RW, members R, administration RW), install on all repos, then write ~/.amico/github.json: {app_id, installation_id, pem_path}. Revoking the PEM is the kill switch.

Phase 2 (Connection panel UI) and Phase 3 (fleet propagation) follow as separate issues.

…ATH shim, git credential helper (#399)

Every gh/git action in an agent session rides the researcher's personal login;
this gives Amicode its own GitHub App face. Unconfigured = byte-identical
passthrough; configured = self-refreshing 1-hour installation tokens, token
carriage env/protocol-only, bot PRs with human-authored commits.
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4354a795-acc4-43ea-a3a6-4add46030a55

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

…TH only (#399)

A bin-map entry made pnpm link gh into node_modules/.bin, where it shadowed
the developer's gh for every pnpm script: CI's fetch:opencode resolved to the
shim, which re-found the .bin alias, and pnpm's wrapper prepended NODE_PATH on
every recursive pass until exec hit E2BIG. The shadowing contract is
agent-session-only: gh now stages via amicode.shadowBins into the extension's
bin dir, gated + pinned like every declared bin. resolveRealGh additionally
compares realpath'd candidate FILES, so a symlink alias of the shim in any
PATH dir is skipped instead of recursing.
@aarontrowbridge

Copy link
Copy Markdown
Member Author

Superseded by /pull/401 — the auto-generated branch name carried +, which the .buildinfo provenance charset guard rejects; same commits, renamed branch.

@aarontrowbridge
aarontrowbridge deleted the 399-github-app-identity-amicobot-acts-for-amicode-on-harmoniqs-repos-token-core-+-ghgit-shims branch August 17, 2026 10:00
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.

GitHub App identity: amico[bot] acts for Amicode on harmoniqs repos (token core + gh/git shims)

1 participant