Skip to content

Commit f3da68d

Browse files
committed
fix: update issues after review
1 parent a9c1fe9 commit f3da68d

9 files changed

Lines changed: 121 additions & 5 deletions

File tree

.archcore/update/keeping-the-cli-current.prd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Keeping the CLI Current"
3-
status: draft
3+
status: accepted
44
tags:
55
- "cli"
66
- "integrations"

.archcore/update/who-triggers-a-cli-update.rfc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Who Triggers a CLI Update"
3-
status: draft
3+
status: accepted
44
tags:
55
- "cli"
66
- "integrations"

CLAUDE.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ Commands are registered under `cmd/`.
8585
- `config` reads and updates `.archcore/settings.json`.
8686
- `hooks` manages lifecycle hooks.
8787
- `instructions` manages agent instruction files.
88+
- `plugin` installs, updates, removes, and reports the Archcore plugin on hosts that ship one.
8889
- `sync` pushes `.archcore/` state to a configured server.
89-
- `update` updates the CLI.
90+
- `update` updates the CLI and the plugin. `archcore mcp` runs the same update unattended, under the policy in `internal/update`.
9091

9192
When adding a command:
9293

@@ -106,7 +107,10 @@ When adding a command:
106107
- `internal/wiring/` implements host wiring.
107108
- `internal/sync/` implements sync state, hashing, and payload construction.
108109
- `internal/api/` implements the server API client.
109-
- `internal/update/` implements self-update.
110+
- `internal/update/` implements self-update and the unattended update policy.
111+
- `internal/plugin/` plans and executes plugin actions per host.
112+
- `internal/telemetry/` sends the update events.
113+
- `internal/xdg/` resolves the shared state directory.
110114
- `internal/git/` detects repository metadata.
111115
- `internal/display/` formats terminal output.
112116
- `templates/` defines document templates and document types.
@@ -124,6 +128,9 @@ Preserve these constraints:
124128
- Co-located table-driven Go tests.
125129
- Optional settings omit defaults where defined.
126130
- Global Archcore sources are read-only.
131+
- Unattended update refuses without the official-build marker.
132+
- Telemetry stays inert without an injected key.
133+
- The plugin surface never changes behavior outside itself.
127134

128135
## Out-of-scope Directories
129136

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,28 @@ Documents link with directed relations: `related` (general association), `implem
233233
| `archcore hooks install` | Install hooks for detected AI agents |
234234
| `archcore mcp` | Run the MCP stdio server |
235235
| `archcore mcp install` | Install MCP config for detected agents |
236+
| `archcore instructions` | Manage the Archcore hint in instruction files |
237+
| `archcore plugin` | Install, update, or report the Archcore plugin |
236238
| `archcore update` | Update Archcore to the latest version |
237239

238-
`archcore update` checks GitHub Releases, downloads the newer version, verifies the SHA-256 checksum, and atomically replaces the binary.
240+
`archcore update` checks GitHub Releases, downloads the newer version, verifies the SHA-256 checksum, and atomically replaces the binary. It then updates the Archcore plugin on each host that already has it installed, and prints the command to run for a host whose CLI it cannot reach.
241+
242+
`archcore plugin` manages that plugin directly on Claude Code, Cursor, Codex CLI, and GitHub Copilot. `archcore init` installs it for the hosts you select there.
243+
244+
</details>
245+
246+
<details>
247+
<summary><strong>Updating &amp; telemetry</strong></summary>
248+
249+
### Unattended update
250+
251+
From v0.8.0 the CLI also updates itself with nobody watching. `archcore mcp` — the server your agent starts — runs the same check in the background, at most once every 24 hours per machine, and replaces the binary only with a release published by this project, after running the downloaded binary once to prove it starts. The running process is never restarted or interrupted; a new version takes effect the next time the binary launches. Builds you compile yourself, forks, and CI runners never self-update.
252+
253+
No variable and no `.archcore/settings.json` key disables this. If a machine must not update itself, install the binary into a directory its user cannot write — a root-owned location — and every attempt stops before it downloads anything.
254+
255+
### Update analytics
256+
257+
A release build sends one event per update attempt: the versions it moved between, your OS and CPU architecture, whether the run looked like CI, whether you typed the command or the background check ran it, and which step failed when one did. It never sends an error message, a path, a user name, a hostname, or anything about your repository. Set `DO_NOT_TRACK=1` or `ARCHCORE_TELEMETRY_OPTOUT=1` to send nothing at all. Both variables govern analytics only — neither stops the CLI from updating itself. Full detail: [archcore.ai/privacy](https://archcore.ai/privacy).
239258

240259
</details>
241260

test/.archcore/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"sync": "none"
3+
}

test/.claude/settings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"matcher": "",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "archcore hooks claude-code session-start"
10+
}
11+
]
12+
}
13+
],
14+
"PreToolUse": [
15+
{
16+
"matcher": "Write|Edit",
17+
"hooks": [
18+
{
19+
"type": "command",
20+
"command": "archcore hooks claude-code pre-tool-use"
21+
}
22+
]
23+
}
24+
],
25+
"PostToolUse": [
26+
{
27+
"matcher": "mcp__archcore__(create_document|update_document|remove_document|add_relation|remove_relation)|mcp__plugin_archcore_archcore__(create_document|update_document|remove_document|add_relation|remove_relation)|mcp_archcore_(create_document|update_document|remove_document|add_relation|remove_relation)|archcore-(create_document|update_document|remove_document|add_relation|remove_relation)",
28+
"hooks": [
29+
{
30+
"type": "command",
31+
"command": "archcore hooks claude-code post-tool-use"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
}

test/.mcp.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"mcpServers": {
3+
"archcore": {
4+
"command": "archcore",
5+
"args": [
6+
"mcp"
7+
]
8+
}
9+
}
10+
}

test/AGENTS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- archcore:start --> managed by `archcore init` — edit outside these markers
2+
## Archcore — project context for this repo
3+
4+
This repo's architecture, decisions, rules, specs and patterns live in `.archcore/`,
5+
reachable through the Archcore MCP tools. Consult them even on code you think you
6+
know — a decision or rule may already constrain it.
7+
8+
- Touching this repo's real code or behavior → search first; read only what matches.
9+
- A decision was made ("we'll use X", "from now on Y") → record it.
10+
- A module / API / system has no doc — or a search comes back empty → capture it.
11+
- Planning a feature or refactor → scope it against what's already decided.
12+
13+
A `.archcore/` may also mount read-only **global sources** — shared, org-wide
14+
context not shown in the session-start list. `list_documents` / `search_documents`
15+
surface them alongside local docs, tagged `source_kind: "global"`. When present,
16+
treat them as defaults a local doc can override — never edit or relate to one.
17+
18+
The search is cheap — lean on it. Skip it only for turns this repo would have no
19+
opinion on: syntax trivia, throwaway snippets, pure mechanics.
20+
<!-- archcore:end -->

test/CLAUDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- archcore:start --> managed by `archcore init` — edit outside these markers
2+
## Archcore — project context for this repo
3+
4+
This repo's architecture, decisions, rules, specs and patterns live in `.archcore/`,
5+
reachable through the Archcore MCP tools. Consult them even on code you think you
6+
know — a decision or rule may already constrain it.
7+
8+
- Touching this repo's real code or behavior → search first; read only what matches.
9+
- A decision was made ("we'll use X", "from now on Y") → record it.
10+
- A module / API / system has no doc — or a search comes back empty → capture it.
11+
- Planning a feature or refactor → scope it against what's already decided.
12+
13+
A `.archcore/` may also mount read-only **global sources** — shared, org-wide
14+
context not shown in the session-start list. `list_documents` / `search_documents`
15+
surface them alongside local docs, tagged `source_kind: "global"`. When present,
16+
treat them as defaults a local doc can override — never edit or relate to one.
17+
18+
The search is cheap — lean on it. Skip it only for turns this repo would have no
19+
opinion on: syntax trivia, throwaway snippets, pure mechanics.
20+
<!-- archcore:end -->

0 commit comments

Comments
 (0)