Skip to content

feat: archgate adr import — registry import command#296

Merged
rhuanbarreto merged 4 commits into
mainfrom
feature/adr-import
May 11, 2026
Merged

feat: archgate adr import — registry import command#296
rhuanbarreto merged 4 commits into
mainfrom
feature/adr-import

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Adds archgate adr import command enabling import of curated ADR packs from the official registry (packs/<name>), third-party GitHub repos (org/repo/path), or any git URL
  • Includes source resolution with @<ref> pinning, shallow clone deduplication, automatic ID remapping to project numbering, atomic writes with rollback on failure, and an .archgate/imports.json provenance manifest
  • Extends rule-scanner.ts with scanImportedRuleSource() for stricter sandboxing of untrusted imported rules (blocks Bun.env, process.env, require(), WebSocket)

Changes

File Purpose
src/formats/pack.ts Zod schemas: PackMetadata, CommunityLinks, ImportsManifest
src/helpers/registry.ts Source resolver + shallowClone() + detectTarget()
src/commands/adr/import.ts Command implementation (--yes, --json, --dry-run, --prefix, --list)
src/engine/rule-scanner.ts scanImportedRuleSource() stricter scanner
src/commands/adr/index.ts Wire up import subcommand
docs/.../importing-adrs.mdx EN + PT-BR guide pages
docs/astro.config.mjs Sidebar entry
.oxlintrc.json Lint override for test fixtures
tests/ Unit + integration tests (48 new tests)

Test plan

  • bun test — 800 pass, 0 fail
  • bun run validate — lint, typecheck, format, knip, archgate check, build all pass
  • Unit tests cover: schema validation (valid/invalid), source resolution (official/github/url/@ref/errors), command registration, integration with local fixtures (detectTarget, ID remapping, imports.json, --list, --dry-run)
  • Manual: archgate adr import packs/typescript-strict --dry-run against live registry (requires network)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 11, 2026

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f1e6e7
Status: ✅  Deploy successful!
Preview URL: https://9e60124c.archgate-cli.pages.dev
Branch Preview URL: https://feature-adr-import.archgate-cli.pages.dev

View logs

Implements the ADR import command (Phases A.2, C.1-C.7) enabling users to
import curated ADR packs from the official registry, third-party GitHub
repos, or any git URL. Includes source resolution, shallow cloning, ID
remapping, atomic writes with rollback, and an imports.json manifest.

- src/formats/pack.ts: Zod schemas for pack metadata, community links,
  and imports manifest
- src/helpers/registry.ts: Source resolver (official/github/git-url) and
  shallow clone helper with deduplication
- src/commands/adr/import.ts: Full command with --yes, --json, --dry-run,
  --prefix, and --list options
- src/engine/rule-scanner.ts: scanImportedRuleSource() for stricter
  validation of untrusted imported rules
- docs/: Guide and pt-br translation for importing ADRs
- tests/: Unit tests for schemas, resolver, command registration, and
  integration tests with local fixtures

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Proto 0.56.4 cannot install Node 24 on Windows — the binary download
completes but node.exe is never written to disk, causing postinstall
to fail with proto::locate::missing_executable. This is a fresh-install
bug, not a cache issue (verified by deleting all Windows caches).

Pin to Node 22 (LTS) which installs correctly. Node is only used for
the npm postinstall script; the CLI itself runs on Bun.

Reported upstream: moonrepo/proto#1006

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@rhuanbarreto rhuanbarreto merged commit ba42e97 into main May 11, 2026
11 checks passed
@rhuanbarreto rhuanbarreto deleted the feature/adr-import branch May 11, 2026 11:44
@archgatebot archgatebot Bot mentioned this pull request May 11, 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.

1 participant