arcane-cli 0.15.2 → 0.15.4
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.
|
@@ -102,19 +102,19 @@ Rules:
|
|
|
102
102
|
9. **Stage and commit session-close docs.**
|
|
103
103
|
|
|
104
104
|
**Remote-capability check:** classify the state created by `spell-open-session` before branching, staging, push, or PR operations.
|
|
105
|
-
- **Usable supported remote/merge path:**
|
|
105
|
+
- **Usable supported remote/merge path:** requires an authenticated supported provider (`github.com`, `dev.azure.com`, or `visualstudio.com`). Keep the current compliant session/PR/worktree branch, resolve the actual remote name and integration branch, and use the provider-neutral PR path below.
|
|
106
106
|
- **No usable remote/merge path:** remain on the current trunk. Do not create a dead session branch, push, pull, or open a PR. Apply the EF-28 interactive commit approval gate, commit locally on trunk after approval, report `Local-only close: committed on <trunk>; no remote PR/pull performed`, and skip steps 9a, 9c, and 10's remote operations.
|
|
107
107
|
- **Read-only session:** if no repository mutation occurred, do not create a branch or commit.
|
|
108
108
|
|
|
109
109
|
a. **Branch check — create a topic branch before any staging:**
|
|
110
110
|
This remote branch path applies only when the remote-capability check found a usable merge path.
|
|
111
|
-
Run `git branch --show-current`. If you are on
|
|
111
|
+
Run `git branch --show-current`. If you are on the resolved integration branch `<trunk>`, create a topic branch **now** before any `git add`:
|
|
112
112
|
|
|
113
113
|
```powershell
|
|
114
114
|
git checkout -b docs/session-close-YYYY-MM-DD
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
Never commit directly to
|
|
117
|
+
Never commit directly to a remotely protected integration branch — the branch policy rejects direct pushes. If a session branch already exists (created by `spell-open-session`), stay on it.
|
|
118
118
|
|
|
119
119
|
b. **Stage and apply the interactive commit gate from `spell-commit-work`:**
|
|
120
120
|
- Run `git add -A && git diff --stat --cached` to show what changed.
|
|
@@ -129,10 +129,13 @@ Rules:
|
|
|
129
129
|
- Missing/invalid authority visibly downgrades to PR creation only and requires human completion.
|
|
130
130
|
- Interactive Magus+ completion still requires separate authenticated approval tied to the exact PR ID and head SHA.
|
|
131
131
|
|
|
132
|
-
10. **
|
|
133
|
-
|
|
132
|
+
10. **Synchronize the configured integration branch after the PR merges (remote path only):**
|
|
133
|
+
- Skip this entire step for local-only and read-only sessions.
|
|
134
|
+
- Resolve `<remote>` and `<trunk>` from observed Git/provider state: use the usable authenticated remote selected in step 9 and the merged PR's target branch (falling back to that remote's default branch). Never assume `origin` or `main`.
|
|
135
|
+
- Verify through the detected provider that the PR is merged before changing branches.
|
|
136
|
+
- Run `git switch <trunk>` followed by `git pull --ff-only <remote> <trunk>`. Do not end a remote-backed session on a topic branch.
|
|
134
137
|
- Delete the local topic branch: `git branch -d <branch>`.
|
|
135
|
-
|
|
138
|
+
- Verify `git log --oneline -3` shows the merged change at HEAD.
|
|
136
139
|
- If stale local branches exist (merged or older than 7 days), list them and suggest cleanup.
|
|
137
140
|
- See [governance/git-conventions.md](../../governance/git-conventions.md) Post-Merge Cleanup section.
|
|
138
141
|
|
|
@@ -166,7 +169,7 @@ Output format:
|
|
|
166
169
|
|
|
167
170
|
## PR Readiness
|
|
168
171
|
|
|
169
|
-
Enumerate the current end state and the prescribed next action. Use this table to classify where the session landed
|
|
172
|
+
Enumerate the current end state and the prescribed next action. Use this table to classify where the session landed within the provider-neutral lifecycle above:
|
|
170
173
|
|
|
171
174
|
| End state | Next action |
|
|
172
175
|
| --- | --- |
|
|
@@ -175,8 +178,8 @@ Enumerate the current end state and the prescribed next action. Use this table t
|
|
|
175
178
|
| Open PR exists | Docs/changes reach `main` when it merges — show the PR URL. |
|
|
176
179
|
| No PR + docs-only on a branch | Run `spell-create-pull-request --docs-only`. |
|
|
177
180
|
| No PR + mixed code+docs on a branch | Run `spell-create-pull-request` once the feature is complete. |
|
|
178
|
-
| Docs-only commit on
|
|
179
|
-
| Nothing ahead of
|
|
181
|
+
| Docs-only commit on remote-backed `<trunk>` | Create a `chore/docs` branch, then run `spell-create-pull-request --docs-only`. |
|
|
182
|
+
| Nothing ahead of `<remote>/<trunk>` | Branch is fully merged — clean up local/remote branches. |
|
|
180
183
|
|
|
181
184
|
## Carry Forward
|
|
182
185
|
|
|
@@ -186,7 +189,7 @@ Enumerate the current end state and the prescribed next action. Use this table t
|
|
|
186
189
|
|
|
187
190
|
Route the user to the right next spell based on the end state:
|
|
188
191
|
|
|
189
|
-
- **Docs-only commit on
|
|
192
|
+
- **Docs-only commit on remote-backed `<trunk>`** — create a docs branch, then run `spell-create-pull-request --docs-only`.
|
|
190
193
|
- **On a feature branch, ready for review** — run `spell-create-pull-request`.
|
|
191
194
|
- **On a feature branch, still in progress** — next session, run `spell-open-session` to resume.
|
|
192
195
|
- **PR already open** — run `spell-address-review` after reviewers comment.
|
|
@@ -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
|
-
-
|
|
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. **
|
|
49
|
-
-
|
|
50
|
-
-
|
|
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
|
|
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>`.
|