arcane-cli 0.15.1 → 0.15.3

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.
@@ -44,6 +44,10 @@ Concrete detectors to run (in addition to general contradiction/stale-date check
44
44
  - **Journal chronology** — journal entries and their dates must be in sane order. Flag out-of-order entries, duplicate session numbers, and any future or otherwise contradictory dates.
45
45
  - **Done vs. carry-forward consistency** — items marked done must not still appear as open or carry-forward items, and items listed as open/carry-forward must not also be marked done elsewhere.
46
46
  - **Decision-ID existence** — decision IDs referenced in TODO, journal, or other docs must exist in `DECISIONS.md`, and the IDs in the decisions log must be sequential and unique (no gaps that imply a missing entry, no duplicates).
47
+ - **Canonical vs. installed-copy parity** — for every managed root file that has a canonical counterpart under `src/assets/`, compare bytes first. If bytes differ, normalize `CRLF` and lone `CR` to `LF` in both files and compare again:
48
+ - If normalized content differs, report **real content drift** with normal severity grading.
49
+ - If normalized content matches, report **line-ending-only drift** separately. Do not count these paths as real content findings and do not include them in severity totals or the Go / No-Go decision.
50
+ - Report exact path counts for both classes. Never summarize all byte-different files as content drift.
47
51
 
48
52
  For each drift finding include:
49
53
 
@@ -68,12 +72,18 @@ Output format:
68
72
 
69
73
  - **Scope:** the `--scope` value (`all`/`journal`/`todos`/`decisions`/`git`), any free-text hint, and mode (`report-only` or `--fix`).
70
74
  - **Date:** ISO date of this run.
71
- - **Findings:** total count, broken down per severity.
75
+ - **Real content findings:** total count, broken down per severity.
76
+ - **Line-ending-only drift:** path count, reported separately and excluded from severity totals.
72
77
 
73
- ## Drift Findings
78
+ ## Real Content Drift Findings
74
79
 
75
80
  - One line per finding with `file:line` references (or nearest locator) and its severity rationale.
76
81
 
82
+ ## Line-Ending-Only Drift
83
+
84
+ - List byte-different paths whose contents match after line-ending normalization, or `None`.
85
+ - Keep this list separate from real content findings even when it is long; a count plus path list is sufficient.
86
+
77
87
  ## Fixes Applied
78
88
 
79
89
  - List edits applied (only possible in `--fix` mode), or `None`.
@@ -94,4 +104,6 @@ Rules:
94
104
 
95
105
  - Prefer ADR decisions and latest journal facts when conflicts exist.
96
106
  - Do not rewrite historical journal content.
107
+ - Treat `src/assets/` as canonical when comparing a managed root dogfood copy with its distributable source counterpart.
108
+ - A line-ending-only difference is review noise, not evidence of contradictory content; never let it create a Critical/High finding or a `NO-GO` verdict by itself.
97
109
  - Keep changes minimal and traceable.
@@ -25,7 +25,12 @@ Use these files first:
25
25
  Workflow:
26
26
 
27
27
  1. **Check git status and guard the branch** — run `git status` to see what changed, and confirm the current branch.
28
- - **Protected-branch guard:** if the current branch is `main` or `master`, **STOP — do not stage or commit directly.** Tell the user that committing straight to the integration branch is not allowed, and instruct them to create a topic branch first (e.g., `sessions/YYYY-MM-DD-<slug>` per the session model). Once on a valid topic branch, continue the workflow normally (commit immediately as usual).
28
+ - Classify the Git/remote state before enforcing the protected-branch guard. A usable merge path requires a configured remote on a supported provider (`github.com`, `dev.azure.com`, or `visualstudio.com`) and authenticated provider tooling. A remote URL alone is insufficient.
29
+ - Apply exactly one path:
30
+ - **Supported, authenticated GitHub/ADO remote + `main` or `master` checked out:** **STOP — do not stage or commit directly.** Create and switch the current worktree to a compliant topic branch (for example, `sessions/YYYY-MM-DD-<slug>`), then continue.
31
+ - **Supported, authenticated GitHub/ADO remote + valid topic/PR branch checked out:** stay on that branch and continue.
32
+ - **No remote, unsupported remote, or provider authentication unavailable:** remain on the current trunk. Print `Local-only checkpoint: no usable remote merge path; commit remains on <trunk> and no remote push/PR will run.` Continue through the local commit gate, then skip Steps 9 and 10 entirely.
33
+ - If the current worktree, branch, provider, or authentication state cannot be determined, fail closed before staging and ask the operator. Never strand a local-only commit on a topic branch with no usable merge path.
29
34
 
30
35
  2. **Run tests and verify coverage** _(skip only if zero source files changed — e.g., pure docs/config commit)_:
31
36
  - Detect the project stack from the root of the changed repo:
@@ -45,19 +50,21 @@ Workflow:
45
50
  - Run the detected formatter, then `git add` the resulting changes so they are part of this commit.
46
51
  - **If no formatter is configured, skip this step gracefully** — do not install one and do not block the commit.
47
52
 
48
- 3. **Analyze changes** — categorize the work:
49
- - What was the intent? (new feature, bug fix, docs, refactor, etc.)
50
- - What scope/area was affected? (prompts, agents, security, infrastructure, journal, etc.)
51
- - Is this part of a larger initiative or a standalone change?
52
- - **Commit-splitting heuristic:** if the staged changes span clearly unrelated concerns (e.g., a feature change + an unrelated refactor + a dependency bump), recommend splitting them into multiple focused commits, each with its own message, rather than a single mixed commit. A single commit is fine when the changes serve one purpose. When splitting, stage and commit each concern separately.
53
- - **Wiki-link check:** For any new `.md` files being committed, verify each has at least one outbound `[[...]]` wiki-link connecting it to the knowledge graph. Orphaned docs (no outbound links) break Obsidian's graph view. If missing, add a `Related:` or `See also:` line before committing. See the CLAUDE.md wiki-link conventions for the correct format.
54
-
55
- 4. **Determine authorship** — who produced this content? See [governance/git-conventions.md](../../governance/git-conventions.md) Agent Attribution Model section and ADR-028.
53
+ 3. **Determine authorship and partition the batch** — who produced each changed file or inseparable change set? See [governance/git-conventions.md](../../governance/git-conventions.md) Agent Attribution Model section and ADR-028.
54
+ - **Invariant: one commit has exactly one author.** Changes spanning authors must be split into separate commits.
55
+ - Partition changed files by author first. Step 4 then groups by concern within each author partition; concern grouping must never recombine authors.
56
56
  - **Human wrote it:** no `--author` override needed (uses global Git config)
57
57
  - **AI agent/tool produced it:** use `--author` with the agent's registered identity:
58
58
  - Roster agent: `--author="{AGENT_NAME} <{AGENT_EMAIL}>"` — resolve `{AGENT_NAME}` / `{AGENT_EMAIL}` from the active agent config (see [[agent-policies]] / [[naming-conventions]]); ask if unset.
59
59
  - Generic CLI/IDE tool: `--author="{TOOL_NAME} <{TOOL_NAME_LOWER}@{OPERATOR_DOMAIN}>"` — resolve `{TOOL_NAME}` from the channel in use and `{OPERATOR_DOMAIN}` from `.arcane.json`; ask if unset.
60
- - When in doubt, ask the user who produced the content.
60
+ - When authorship is unknown or disputed, stop and ask. Never select one identity for a mixed-author batch.
61
+
62
+ 4. **Analyze and group changes within each author partition** — categorize the work:
63
+ - What was the intent? (new feature, bug fix, docs, refactor, etc.)
64
+ - What scope/area was affected? (prompts, agents, security, infrastructure, journal, etc.)
65
+ - Is this part of a larger initiative or a standalone change?
66
+ - **Commit-splitting heuristic:** within one author partition, if the changes span clearly unrelated concerns (e.g., a feature change + an unrelated refactor + a dependency bump), recommend splitting them into multiple focused commits, each with its own message, rather than a single mixed commit. A single commit is fine when one author's changes serve one purpose. When splitting, stage and commit each concern separately.
67
+ - **Wiki-link check:** For any new `.md` files being committed, verify each has at least one outbound `[[...]]` wiki-link connecting it to the knowledge graph. Orphaned docs (no outbound links) break Obsidian's graph view. If missing, add a `Related:` or `See also:` line before committing. See the CLAUDE.md wiki-link conventions for the correct format.
61
68
 
62
69
  4.5. **Resolve execution authority before any commit or merge command:**
63
70
  - Declare `interaction_context: interactive | autonomous`. VS Code chat, editor chat, Claude Code, and any live operator session are `interactive`; never infer `autonomous` from tool access.
@@ -131,6 +138,8 @@ Workflow:
131
138
 
132
139
  9. **Push branch and run platform-specific PR flow:**
133
140
 
141
+ **Local-only exit:** if Step 1 classified the repository as having no usable remote merge path, skip this entire step and Step 10. Print `Local-only checkpoint: committed on <trunk>; no remote push/PR performed.` The local commit is the completed checkpoint.
142
+
134
143
  **Separate merge authorization gate:** commit approval never authorizes merge. Bind any interactive merge approval to the exact PR ID and current head SHA, and re-check both immediately before completion. Missing/changed approval invalidates the gate. Never invoke merge, auto-merge, auto-complete, or `--status completed` below loader-validated Magus authority; create/update the PR, print the visible downgrade, and leave completion to a human.
135
144
 
136
145
  a. Run `git push origin <branch>`.
@@ -76,7 +76,7 @@ Before anything else, check:
76
76
  - If current branch is non-compliant and no active PR depends on it, record the required rename for the Mutation Guard. Do not rename during a read-only session.
77
77
  - If an active PR uses the old branch name, do not force-delete the old remote branch; flag it and continue with a follow-up rename plan.
78
78
  - **Stale local branches:** Run `git branch --merged main` to list branches already merged that should be deleted.
79
- - **Tracker configuration check (early):** resolve active tracking settings before planning. Read `.arcane.json` first (if present), then the current feature PRD frontmatter if available:
79
+ - **Tracker configuration check (early):** resolve active tracking settings before planning. Read root `.arcane.json` first (if present), then the current feature PRD frontmatter if available. A self-host marker under `src/assets/` is doctor metadata, not active repository configuration; never use it as tracking provenance. If neither active source sets tracking, ask the operator and treat the answer as session-scoped until EF-14 defines persistent configuration:
80
80
  - `tracking_mode: internal | external`
81
81
  - `external_provider: ado | jira | other`
82
82
  - If missing, ask the operator to choose now. Default to `external` + `ado` only when existing ADO context already exists (backward compatibility).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-cli",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "description": "Arcane framework CLI — scaffold and manage governance files in consuming repositories",
5
5
  "keywords": [
6
6
  "arcane",
@@ -40,6 +40,8 @@
40
40
  "test:coverage": "vitest run --coverage",
41
41
  "lint": "eslint src test",
42
42
  "typecheck": "tsc --noEmit",
43
+ "check:self-host-parity": "tsx scripts/self-host-parity.ts --check",
44
+ "fix:self-host-parity": "tsx scripts/self-host-parity.ts --fix",
43
45
  "check:version-bump": "tsx scripts/check-version-bump.ts",
44
46
  "prepare": "husky"
45
47
  },