@adlc/ticket-sync

中文文档
1.12.0发布于 2026/10/10MITES Module构建来源已验证近 30 天下载 8223

Two-way sync between ADLC tickets and external trackers (GitHub Issues first).

原始使用文档
文档目录5 节
  1. Commands
  2. How it works
  3. Token scopes
  4. Full guide
  5. License

@adlc/ticket-sync

Two-way sync between the canonical ADLC ticket store and an external tracker — GitHub Issues first. Import issues into tickets, create issues for local-only tickets, and write ADLC execution metadata back into the issue body. Dry-run by default; all network I/O goes through the gh CLI.

npm i -g @adlc/ticket-sync
gh auth login                       # the provider shells out to gh
adlc-ticket-sync --help

Commands

CommandWhat it does
adlc-ticket-sync pullImport issues → the active ticket store (3-way reconcile; unions; fails closed on conflict).
adlc-ticket-sync pushWrite tickets back: update synced issues + idempotent create for local-only tickets + display-only status labels/comment.
adlc-ticket-sync syncpull then push (a non-clean pull aborts before push).
adlc-ticket-sync doctorRead-only, offline health checks (config / tickets / schema drift / sidecar / stale lock).

Dry-run by default — pass --write to apply. --json on all commands. --limit <n> caps how many issues pull/push/sync list from the tracker (default 500). A listing that reaches the cap is refused as possibly truncated rather than synced, so raise it (or narrow select in config) when that happens. With select.query set, the listing goes through GitHub's search API, which returns at most 1000 results, so 1000 rows is refused as truncated at any --limit; narrow the query instead. Exit codes: 0 ok · 1 operational · 2 blocked.

adlc-ticket-sync pull               # preview the import
adlc-ticket-sync pull --write       # apply it
adlc-ticket-sync push --write       # create/update issues + status
adlc-ticket-sync doctor             # check repo health, read-only

How it works

  • Metadata GitHub Issues lack lives in a fenced JSON block in the issue body, between <!-- adlc:begin … --> / <!-- adlc:end --> sentinels. Prose around it is preserved verbatim.
  • Sync bookkeeping (node ids, the 3-way base hash, create keys) lives in a gitignored sidecar (.adlc/ticket-sync.state.json) — so routine syncs never touch the rails trust root. Its metadata is rebuildable, but writers durably retain and fail closed around pendingCreates recovery handles.
  • Storage-independent: sharded .adlc/tickets/ is canonical for new repos; legacy .adlc/tickets.json continues to work through the migration bridge.
  • Idempotent create: a stable sentinel key + a pre-create adoption scan + pendingCreates crash-recovery mean a re-run never duplicates an issue. The handle remains until the ID rewrite and hash-chained evidence re-attestation both complete, so a re-run can resume either half. On create, the ticket id is reassigned T<n> → gh:<owner>/<repo>#<n> with a store-wide edge rewrite.
  • Offline-first: all logic is tested offline via an injected gh runner; the one live edge has an opt-in smoke (scripts/ticket-sync-smoke.mjs).

Token scopes

pull needs issues:read; push needs issues:write. Prefer a fine-grained PAT over the broad repo scope. GH_HOST is honored for GitHub Enterprise.

Full guide

See docs/ticket-sync.md for the flag matrix, config reference, the block/sidecar formats, idempotency details, the rails-trust-root interaction, and the live smoke.

License

MIT © Chris Williams (@voodootikigod)

版本与发布记录

@adlc/ticket-sync 共发布 15 个版本,首次发布于 2026/07/11;过去 12 个月发布了 15 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.12.0latest2026/10/1027 天前
1.11.12026/09/091 个月前
1.11.02026/08/252 个月前
1.10.02026/08/112 个月前
1.9.02026/08/092 个月前
1.8.02026/08/082 个月前

关于 @adlc/ticket-sync 的常见问题

@adlc/ticket-sync 是什么?

Two-way sync between ADLC tickets and external trackers (GitHub Issues first).

如何安装 @adlc/ticket-sync?

在项目目录运行 npm install @adlc/ticket-sync,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 adlc-ticket-sync,可以用 npx adlc-ticket-sync 直接运行。

@adlc/ticket-sync 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adlc__ticket-sync 是否存在。

@adlc/ticket-sync 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adlc/ticket-sync 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@adlc/ticket-sync 可以商用吗?

@adlc/ticket-sync 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adlc/ticket-sync 的下载量有多少?

根据 npm 官方下载统计,@adlc/ticket-sync 在 2026/10/05 – 2026/11/03 这 30 天内被下载 8,223 次,日均约 274 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adlc/ticket-sync 还在维护吗?

最新版本 1.12.0 发布于 2026/10/10(27 天前);至今共发布 15 个版本,其中过去 12 个月发布了 15 个;首次发布于 2026/07/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。