toga-ai 1.0.1023 → 1.0.1024

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.
@@ -5,7 +5,7 @@
5
5
  | [Memory Scope Guard — Keep Team Rules Out of Local Claude Memory](features/memory-scope-guard.md) | Rule + PostToolUse warn hook + `/finish` sweep that keep team build rules in the KB, not in one developer's private Claude memory. |
6
6
  | [Review-Enforcement Hooks — Mandatory sql-reviewer / php-reviewer Routing on Write](features/review-enforcement-hooks.md) | PostToolUse hooks that force a specialist review (`sql-reviewer` / `php-reviewer`) after SQL/PHP writes; open before turning either into a pre-write gate. |
7
7
  | [ClickUp Ticket Workflow — /start, /commit, /pseudocode, /finish](workflows/clickup-ticket-workflow.md) | Every Claude session is tied to one ClickUp ticket: the 4 skills, the ticket-write rules, the field ids, and the tested ClickUp facts. |
8
- | [Harness Distribution — How a knowledge.js Fix Reaches Teammates](workflows/harness-distribution.md) | How a `knowledge.js` fix reaches teammates — two copies exist, only the git clone matters; `npx toga-ai` pulls it. |
8
+ | [Harness Distribution — How Harness Updates (skills, hooks, knowledge.js) Reach Teammates](workflows/harness-distribution.md) | How harness updates reach teammates — npm bundle (skills/agents/rules/hooks) + git clone (knowledge.js), both via `npx toga-ai@latest`. |
9
9
  | [Knowledge Base Publish / Push Pipeline](workflows/knowledge-publish-pipeline.md) | How `/finish` and `/session-save` push knowledge docs to `agilantsolutions/claude` `_main` — the git sequence, retry, and the `47fbdc4` PUSH_FAILED fix. |
10
10
  | [MCP Tool Usage — "Talos" Means the Internal Knowledge Base, and Run Your Own SELECTs](workflows/mcp-tool-usage.md) | "Talos" means the Internal Knowledge Base MCP (not the repo); run your own `toga-db` SELECTs unprompted. |
11
11
  | [Ticket-Branch Creation Safety — How the Retired /work-ticket Armed Pushes to Production Branches](workflows/ticket-branch-creation-safety.md) | How `/work-ticket` armed VS Code Commit+Sync to push ticket code straight to production branches — root cause, fixes, recovery. |
@@ -1,22 +1,24 @@
1
1
  ---
2
- title: Harness Distribution — How a knowledge.js Fix Reaches Teammates
2
+ title: Harness Distribution — How Harness Updates (skills, hooks, knowledge.js) Reach Teammates
3
3
  framework: "standalone"
4
4
  repo: claude
5
5
  project: Claude Harness
6
6
  client: shared
7
7
  type: workflow
8
8
  status: active
9
- updated: 2026-10-09
9
+ updated: 2026-10-14
10
10
  owners: ["jcardinal"]
11
11
  files:
12
12
  - claude/scripts/install.js
13
+ - claude/scripts/hooks/harness-version-check.js
14
+ - claude/scripts/hooks/lib/npm-latest.js
13
15
  - claude/knowledge.js
14
16
  - claude/.claude/settings.json
15
17
  related:
16
18
  - standalone/apps/claude/workflows/knowledge-publish-pipeline.md
17
19
  ---
18
20
 
19
- How a `knowledge.js` fix reaches teammates — two copies exist, only the git clone matters; `npx toga-ai` pulls it. Open when a harness fix "didn't take".
21
+ How harness updates reach teammates — npm bundle (skills/agents/rules/hooks) + git clone (knowledge.js), both via `npx toga-ai@latest`. Open when a harness fix "didn't take".
20
22
 
21
23
  ## Summary
22
24
 
@@ -24,10 +26,14 @@ There are **two copies** of `knowledge.js` on a developer's machine, and the ski
24
26
 
25
27
  ## Steps
26
28
 
29
+ 0. **Update command is always `npx toga-ai@latest`.** Bare `npx toga-ai` reuses the npx cache and reinstalls the old version. npm is the only update path: `sync-skills.js` and `/sync-team-skills` are retired.
30
+ - SessionStart hook `scripts/hooks/harness-version-check.js` compares `<project>/.claude/toga-ai.version` to npm latest (`scripts/hooks/lib/npm-latest.js`) and warns "Run: npx toga-ai@latest" every session until updated. Warn-only, exit 0, never blocks. Cache `~/.claude/toga-ai-latest.json`: 1h; 10 min after a failed lookup; a future `checkedAt` counts as expired. Opt-out `TOGA_VERSION_CHECK_DISABLED=1`.
31
+ - **Decided (dev + CTO, TRUE-82829): warn, never auto-update at session start.** Auto-update overwrites loaded skills/hooks/settings mid-session and fails silently on Windows.
32
+
27
33
  1. The two copies:
28
34
  - `/finish`, `/start`, `/session-save` all invoke `node "<TEAM_REPO>/knowledge.js"` — the **git clone's** copy at `~/toga-tech/knowledge.js`.
29
35
  - The npm bundle installs a *separate* copy into the project's `.claude/knowledge.js`. The skills do not run it, so a new published npm version alone changes nothing about captures.
30
- 2. Deliver a fix: run `npx toga-ai`. It calls `tryGitPull()` (`scripts/install.js`, ~lines 182-210, called at ~line 548), which does `git pull --ff-only` inside `~/toga-tech`. **That pull is what actually delivers a fixed `knowledge.js`.**
36
+ 2. Deliver a fix: run `npx toga-ai@latest`. It calls `tryGitPull()` (`scripts/install.js`, ~lines 182-210, called at ~line 548), which does `git pull --ff-only` inside `~/toga-tech`. **That pull is what actually delivers a fixed `knowledge.js`.**
31
37
  3. Equivalent manual route: `git -C ~/toga-tech pull`.
32
38
  4. Verify a teammate has a given fix:
33
39
 
@@ -39,11 +45,13 @@ There are **two copies** of `knowledge.js` on a developer's machine, and the ski
39
45
 
40
46
  ## Gotchas
41
47
 
48
+ - **On Windows, `spawnSync('npm', {shell:false})` fails** (needs `npm.cmd`). This silently killed install.js's "newer version" warning, so devs ran stale harnesses. Use the shared `lib/npm-latest.js` lookup, not a raw spawn.
49
+
42
50
  - **`npx toga-ai` can silently fail to update the knowledge repo** (open issue, not yet fixed). On a non-zero `git pull --ff-only` exit, `tryGitPull()` returns `{ pulled: false, newDocs: 0, message: null }` — the git stderr is discarded and **nothing is printed to the developer**. A teammate whose pull is refused (e.g. local edits to a tracked file the incoming commits also touch — `.claude/settings.json` is the usual culprit) will believe they are up to date while still running old tooling. Suggested fix, not applied: surface the git stderr in the `pulled: false` path so a refused pull is visible. Same defect class as the swallowed-stderr bug in the publish pipeline.
43
51
  - Until that is fixed, if a harness fix "didn't take", check the pull manually rather than trusting `npx toga-ai`'s output.
44
52
 
45
53
  - **The harness `.claude` lives only at the workspace root, never in a sub-repo.** Hook commands must anchor on `$CLAUDE_PROJECT_DIR` (`node "$CLAUDE_PROJECT_DIR/.claude/hooks/toga/X.js"`), not relative paths: relative paths resolve against cwd, so a sub-repo cwd gives MODULE_NOT_FOUND. A hook error naming a sub-repo `.claude` path is a path-resolution bug, not a folder to create. The settings file ships from the bundle, so the fix must live upstream or `npx toga-ai` reverts it.
46
- - **Publish Action (`.github/workflows/publish.yml`, on push to `_main`: bump patch, `npm publish`).** Devs get a change only after a version bump (`/start` runs `npx toga-ai@latest` when installed != latest).
54
+ - **Publish Action (`.github/workflows/publish.yml`, on push to `_main`: bump patch, `npm publish`).** Devs get a change only after a version bump (the SessionStart version-check hook tells them to run `npx toga-ai@latest`).
47
55
  - `npm publish` **E404** ("could not be found or you do not have permission") = auth failure, not a missing package: the `NPM_TOKEN` secret in the repo's **Actions environment** expired. Fix: new npm Automation token, update the secret, re-run only the latest failed run.
48
56
  - A publish ships the whole tip of `_main`, so earlier failed runs are not lost. Do not retry old runs (they hit "version already published").
49
57
  - **Removing a permission rule from the shipped `.claude/settings.json` does not remove it from devs.** `mergeSettings()` only adds template rules. To retire one, also list it in `RETIRED_TOGA_PERMISSIONS` (`scripts/install.js`); `npx toga-ai` then filters it out of the dev's existing lists.
@@ -51,6 +59,7 @@ There are **two copies** of `knowledge.js` on a developer's machine, and the ski
51
59
 
52
60
  ## Change history
53
61
 
62
+ - 2026-10-14 — Added `@latest` rule, SessionStart version-check hook, warn-not-auto-update decision, Windows npm.cmd gotcha; sync-team-skills retired (TRUE-82829). (jcardinal)
54
63
  - 2026-10-09 — Added permission-retire (`RETIRED_TOGA_PERMISSIONS`) and auto-mode settings-edit gotchas. (jcardinal)
55
64
 
56
65
  ## Related
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.1023",
3
+ "version": "1.0.1024",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",