arcane-cli 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,8 +61,8 @@ stale number is invisible until someone tries.
61
61
  - **Spell prompts and instructions this framework ships**
62
62
  (`.github/prompts/*.prompt.md`, `.github/instructions/*.md`): **plain text only —
63
63
  cite the bare ID, no link at all** (`ARC-035`, not `[ARC-035](...)`). A full
64
- canonical URL is *also* unsafe here, not just a same-repo link: it bakes
65
- `github.com/codemagicianhq/arcane` — this project's own org and repo name — into
64
+ canonical URL is *also* unsafe here, not just a same-repo link: it bakes a literal
65
+ `github.com/{GITHUB_ORG}/{REPO_NAME}` — this project's own org and repo name — into
66
66
  content the org-token portability gate (`scripts/org-token-lint.ts`, D2 in
67
67
  `spell-authoring-standards.md`) exists specifically to keep out of distributed
68
68
  spells. **Confirmed live 2026-08-31 (BC-06):** the build's `Org-token lint` failed
@@ -90,8 +90,8 @@ missing one. The first fix replaced it with a same-repo wiki-link to this repo's
90
90
  `DECISIONS.md` — itself the exact cross-repo defect this section warns about
91
91
  (`DECISIONS.md` doesn't ship). The second fix replaced that with a full canonical
92
92
  URL, which held up locally but failed the build's org-token portability gate: a
93
- `github.com/codemagicianhq/arcane` URL bakes this project's own org into a file the
94
- gate treats as distributed content (see Doc-ID Link Format above). Settled on the
93
+ literal `github.com/{GITHUB_ORG}/{REPO_NAME}` URL bakes this project's own org into a
94
+ file the gate treats as distributed content (see Doc-ID Link Format above). Settled on the
95
95
  bare ID — the gate's own documented safe form.
96
96
 
97
97
  When completing a PR via `az repos pr update`, do **not** pass `--squash true`. The correct command:
package/dist/index.js CHANGED
@@ -2287,6 +2287,29 @@ async function isHookInstalled(cwd, hookName, body) {
2287
2287
  async function isHookEnforced(cwd) {
2288
2288
  return isHookInstalled(cwd, "pre-push", PRE_PUSH_HOOK_BODY);
2289
2289
  }
2290
+ var CLOSED_PR_WARNING_HOOK_BODY = `#!/bin/sh
2291
+ # Installed by Arcane (ARC-035 decision 4): warns when the branch being
2292
+ # pushed already has a closed or merged PR, instead of accepting the push
2293
+ # into a void with no signal at all. Never blocks -- pushing to a branch
2294
+ # behind a closed PR is sometimes intentional.
2295
+ remote_url="$2"
2296
+ case "$remote_url" in
2297
+ *github.com*) ;;
2298
+ *) exit 0 ;;
2299
+ esac
2300
+ command -v gh >/dev/null 2>&1 || exit 0
2301
+ branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || exit 0
2302
+ state=$(gh pr view "$branch" --json state --jq .state 2>/dev/null) || exit 0
2303
+ case "$state" in
2304
+ CLOSED|MERGED)
2305
+ echo "arcane: WARNING -- the PR for branch '$branch' is already $state. Pushing anyway (not blocked)." >&2
2306
+ ;;
2307
+ esac
2308
+ exit 0
2309
+ `;
2310
+ async function installClosedPrWarningHook(cwd) {
2311
+ return installHook(cwd, "pre-push", CLOSED_PR_WARNING_HOOK_BODY);
2312
+ }
2290
2313
  async function defaultHooks(cwd) {
2291
2314
  let hooksDir;
2292
2315
  try {
@@ -2980,6 +3003,15 @@ async function runInit(options, targetDir, assetsDir, packageVersion) {
2980
3003
  );
2981
3004
  }
2982
3005
  }
3006
+ if (push_policy !== "blocked") {
3007
+ try {
3008
+ const hook = await installClosedPrWarningHook(targetDir);
3009
+ if (hook.status === "installed") {
3010
+ printInfo("Installed a pre-push hook that warns when the current branch's PR is already closed or merged.");
3011
+ }
3012
+ } catch {
3013
+ }
3014
+ }
2983
3015
  try {
2984
3016
  const hook = await installSecretsPrecommitHook(targetDir);
2985
3017
  if (hook.status === "installed") {