Compare commits
11
Commits
rtk-v0.1.0
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5bb0314d1 | ||
|
|
d32143b44b | ||
|
|
96300834ef | ||
|
|
90394464e0 | ||
|
|
c164211480 | ||
|
|
00c93ba03d | ||
|
|
b66f1b838f | ||
|
|
7ee2066407 | ||
|
|
98e8c27cdf | ||
|
|
96307b2a5e | ||
|
|
d16be22b2d |
No files matched your search
@@ -22,6 +22,17 @@
|
||||
}
|
||||
],
|
||||
"_apm_source": "Mortis/Holocron/plugins/git"
|
||||
},
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh\"",
|
||||
"timeout": 10
|
||||
}
|
||||
],
|
||||
"_apm_source": "Mortis/Holocron/plugins/rtk"
|
||||
}
|
||||
],
|
||||
"SessionStart": [
|
||||
|
||||
@@ -21,6 +21,16 @@
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh\"",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SessionStart": [
|
||||
|
||||
+43
-13
@@ -1,5 +1,5 @@
|
||||
lockfile_version: '4'
|
||||
generated_at: '2026-12-05T20:41:35.317702+00:00'
|
||||
generated_at: '2026-12-06T15:33:54.945486+00:00'
|
||||
apm_version: 0.39.3
|
||||
manifest_targets:
|
||||
- claude
|
||||
@@ -7,7 +7,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: ansible
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.1.0
|
||||
virtual_path: plugins/ansible
|
||||
is_virtual: true
|
||||
@@ -25,7 +25,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: bin
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 5.0.0
|
||||
virtual_path: plugins/bin
|
||||
is_virtual: true
|
||||
@@ -75,7 +75,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: core
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 1.1.4
|
||||
virtual_path: plugins/core
|
||||
is_virtual: true
|
||||
@@ -153,7 +153,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: delivery
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.8.1
|
||||
virtual_path: plugins/delivery
|
||||
is_virtual: true
|
||||
@@ -272,7 +272,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: git
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 1.4.0
|
||||
virtual_path: plugins/git
|
||||
is_virtual: true
|
||||
@@ -443,7 +443,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: gitea
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 1.3.10
|
||||
virtual_path: plugins/gitea
|
||||
is_virtual: true
|
||||
@@ -571,7 +571,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: gitops
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.2.0
|
||||
virtual_path: plugins/gitops
|
||||
is_virtual: true
|
||||
@@ -607,7 +607,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: k8s
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.2.0
|
||||
virtual_path: plugins/k8s
|
||||
is_virtual: true
|
||||
@@ -639,7 +639,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: kyberforge
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 2.3.1
|
||||
virtual_path: plugins/kyberforge
|
||||
is_virtual: true
|
||||
@@ -948,7 +948,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: lint
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 1.1.9
|
||||
virtual_path: plugins/lint
|
||||
is_virtual: true
|
||||
@@ -994,7 +994,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: mattpocock
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.5.0
|
||||
virtual_path: plugins/mattpocock
|
||||
is_virtual: true
|
||||
@@ -1012,7 +1012,7 @@ dependencies:
|
||||
- repo_url: Mortis/Holocron
|
||||
name: plan
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 78cfbe2f324efded5d02989a2a21176d7b6df338
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.5.0
|
||||
virtual_path: plugins/plan
|
||||
is_virtual: true
|
||||
@@ -1071,6 +1071,27 @@ dependencies:
|
||||
- path: LICENSE
|
||||
source: LICENSE
|
||||
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||
- repo_url: Mortis/Holocron
|
||||
name: rtk
|
||||
host: git.rkdr.net
|
||||
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||
version: 0.1.0
|
||||
virtual_path: plugins/rtk
|
||||
is_virtual: true
|
||||
package_type: apm_package
|
||||
deployed_files:
|
||||
- .claude/hooks/rtk/.apm/hooks/route-through-rtk.sh
|
||||
deployed_file_hashes:
|
||||
.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh: sha256:55f323f2349748e0d99051d5a6e592ea5c6e9b1e48ca2e8a6377885ab665f562
|
||||
content_hash: sha256:0f258821b61a9d6712a65bcbeeabade2bf899c3dfd82bf695586f7b82d88eae1
|
||||
package_targets:
|
||||
- claude
|
||||
declared_license: MIT
|
||||
carried_licenses:
|
||||
- path: LICENSE
|
||||
source: LICENSE
|
||||
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||
exec_status: deployed
|
||||
- repo_url: fluxcd/agent-skills
|
||||
name: gitops-knowledge
|
||||
host: github.com
|
||||
@@ -1972,6 +1993,15 @@ deployments:
|
||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||
content_hash: sha256:30d9160d25eb712fe7a4d206d12c3779cf13725ccba2f09843713a6f3ebe9ca4
|
||||
- kind: project-relative
|
||||
target: claude
|
||||
value: .claude/hooks/rtk/.apm/hooks/route-through-rtk.sh
|
||||
runtime: null
|
||||
scope: project
|
||||
owners:
|
||||
- git.rkdr.net/Mortis/Holocron/plugins/rtk
|
||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/rtk
|
||||
content_hash: sha256:55f323f2349748e0d99051d5a6e592ea5c6e9b1e48ca2e8a6377885ab665f562
|
||||
- kind: project-relative
|
||||
target: claude
|
||||
value: .claude/skills/agent-author
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Bundled Claude Code skills are turned off with one user-level switch
|
||||
# Bundled Claude Code skills are turned off at user level
|
||||
|
||||
**Status: accepted (2026-12-03).**
|
||||
**Status: accepted (2026-12-03), amended 2026-12-06 (#286).**
|
||||
|
||||
## Context
|
||||
|
||||
@@ -10,27 +10,40 @@ from `skillOverrides` is on, and `Skill(x)` allow rules do not restrict other sk
|
||||
wanted a setting that also covers bundled skills added later. A custom `/ship` is also not loaded
|
||||
where the built-in one is available.
|
||||
|
||||
On Claude Code 2.1.337 the switch does not cover built-in plugins (`cc-plugin-*@builtin`). Their
|
||||
skills `design`, `doctor` and `plugin-authoring` still load, and so do their tools (#286).
|
||||
|
||||
## Decision
|
||||
|
||||
**Bundled skills are turned off with one switch, not a per-name list.** The settings live at user
|
||||
level in `providers/claude-code/settings.json`, which `scripts/install.sh` deploys to
|
||||
**Bundled skills are turned off with one switch; built-in plugin skills need a per-name list.** The
|
||||
settings live at user level in `providers/claude-code/settings.json`, which `scripts/install.sh` deploys to
|
||||
`~/.claude/settings.json`:
|
||||
|
||||
- `disableBundledSkills: true`
|
||||
- `syncClaudeAiSkills: false`
|
||||
- `env.CLAUDE_CODE_DISABLE_SHIP: "1"`, the documented fix for the custom `/ship`.
|
||||
- `skillOverrides.init: "off"`
|
||||
- `skillOverrides` `design`, `doctor` and `plugin-authoring`: `"off"`, for the built-in plugin skills.
|
||||
- `enabledPlugins`: `cc-plugin-easel@builtin` and `cc-plugin-plugin-authoring@builtin` set to `false`.
|
||||
`cc-plugin-privacy`, `-agents-md`, `-telemetry` and `-verbs` stay on: they add no skills and their
|
||||
behaviour has not been checked.
|
||||
- `syncClaudeAiPlugins: false`, the plugin counterpart of `syncClaudeAiSkills`.
|
||||
|
||||
**A per-name `skillOverrides` blocklist is accepted for built-in plugin skills only**, because the
|
||||
single switch does not reach them. Bundled skills stay under the switch. `enabledPlugins` lives in
|
||||
this user-level file, so ADR-0018's ban on it in the project `.claude/settings.json` does not apply.
|
||||
|
||||
Holocron does not distribute these settings to consumer repos. User-level settings already apply to
|
||||
every repo on the machine, and another machine needs its own `install.sh` run.
|
||||
|
||||
**`install.sh` must merge into an existing `~/.claude/settings.json` before these settings are
|
||||
deployed.** Today it copies the file over, which would drop 11 of the operator's 13 top-level keys.
|
||||
The merge is a separate implementation ticket, not part of this ADR's PR.
|
||||
deployed.** It used to copy the file over, which would have dropped 11 of the operator's 13 top-level
|
||||
keys. Done since: `scripts/merge-json.py` merges the file, and `tests/test-install.sh` covers it.
|
||||
|
||||
## Considered options
|
||||
|
||||
**A `skillOverrides` blocklist (rejected).** It needs a new entry for each unwanted skill that ships.
|
||||
**A `skillOverrides` blocklist (rejected as the general mechanism).** It needs a new entry for each unwanted skill that ships.
|
||||
It is now used for built-in plugin skills (#286), but is still rejected as the general mechanism.
|
||||
|
||||
**`skillOverrides` in the committed `.claude/settings.json`, as #266 proposed (rejected).** apm owns
|
||||
that file and `apm audit --ci` fails on hand-added keys (AGENTS.md, ADR-0018, ADR-0019). apm 0.39.3
|
||||
@@ -49,6 +62,9 @@ operator chose to turn off all syncing.
|
||||
2. All synced `anthropic-skills:*` are lost, including `pdf`, `docx`, `xlsx` and
|
||||
`satisfactory-helper`. Claude Code moves the synced copies to `.trash`.
|
||||
3. New built-in commands, as opposed to bundled skills, are not covered.
|
||||
4. Each new built-in plugin skill needs its own `skillOverrides` entry.
|
||||
5. The `cc-plugin-easel` chart tool and the `cc-plugin-plugin-authoring` `scan_secrets` MCP server are
|
||||
lost.
|
||||
|
||||
## Evidence
|
||||
|
||||
@@ -57,6 +73,11 @@ operator chose to turn off all syncing.
|
||||
- **Documented, not tested:** that the custom `/ship` loads in an interactive session with
|
||||
`CLAUDE_CODE_DISABLE_SHIP=1`.
|
||||
- **From the docs only:** the `syncClaudeAiSkills` behaviour.
|
||||
- **Tested** in headless mode on Claude Code 2.1.337, from the `init` event of
|
||||
`claude -p … --output-format stream-json --verbose`: `skillOverrides` for `design`, `doctor` and
|
||||
`plugin-authoring`, and `enabledPlugins` for the two plugins. Confirmed after `scripts/install.sh`:
|
||||
the `init` event lists none of the three skills and only the four plugins kept on.
|
||||
- **From the setting's description in the binary only:** the `syncClaudeAiPlugins` behaviour.
|
||||
- Sources: code.claude.com/docs/en/settings-reference, `/skills` and `/ship-command-troubleshooting`.
|
||||
|
||||
Related: ADR-0018, ADR-0019; #266.
|
||||
Related: ADR-0018, ADR-0019; #266, #286.
|
||||
+15
-6
@@ -1247,22 +1247,31 @@ that `not found in lockfile` form for an identity equal to root `apm.yml`'s own
|
||||
must also exist in the working tree and be absent from the **local** `origin/main`, which must
|
||||
resolve; nothing is fetched. A plugin name must start with a letter or digit and may not contain
|
||||
`..`. Any other output fails closed. The waiver lapses for a plugin by itself: once it is on
|
||||
`origin/main`, the follow-up PR that records it in the lock is required.
|
||||
`origin/main`, the follow-up PR that records it in the lock is required. Because the hook reads
|
||||
only the local `origin/main` ref, a stale or unfetched one keeps the waiver alive after the plugin
|
||||
has landed. That fails safe: the waiver still requires the full 15-check re-run below to pass, so
|
||||
it waives only the `not found in lockfile` rows. `git fetch` refreshes the ref and ends the waiver.
|
||||
|
||||
**The waiver re-runs the full root check set before it passes.** The cut-short run never reaches the
|
||||
other twelve root checks (`content-integrity`, `hook-approval-pins`, `local-bundle-hooks`,
|
||||
`exec-status-current`, `deployed-files-present` and the rest), so the three-check result alone
|
||||
would let a defect in any of them through. Once the conditions above hold, the hook copies the working
|
||||
tree (minus `.git` and `.venv`) into a `mktemp -d` directory with `tar`. In the copy it drops only the
|
||||
`dependencies:` > `apm:` items whose `path:` names a waived plugin, checks that the reduced
|
||||
`apm.yml` differs from the original by those deletions alone, and runs `git init` with the same
|
||||
`origin` URL, the only git state apm reads. It then runs `apm audit --ci` there. The push passes only
|
||||
tree (minus `.git`, `.venv` and `.claude/worktrees`) into a `mktemp -d` directory with `tar`. In the
|
||||
copy it drops only the `dependencies:` > `apm:` items whose `path:` names a waived plugin, checks
|
||||
that the reduced `apm.yml` differs from the original by those deletions alone and that no entry for
|
||||
a waived plugin survived, and runs `git init`. It gives that repo the git state apm reads: the
|
||||
same `origin` URL, for org-policy discovery, and a copy of the real repo's `info/exclude` (from
|
||||
`git rev-parse --git-path info/exclude`, so a linked worktree's shared one), which
|
||||
`deployed-files-present` consults through `git check-ignore`. It then runs `apm audit --ci` there. The push passes only
|
||||
if that run exits 0 and prints `All 15 check(s) passed`. On this branch (holocron#179, apm 0.39.3) it
|
||||
does, and the hook prints `root re-run without the unlanded plugins: All 15 check(s) passed`. A copy
|
||||
was chosen over swapping `apm.yml` in place under a `trap`: the copy never writes the working tree, so
|
||||
the tree stays byte-identical even after `SIGKILL`, and a concurrent apm never sees a reduced
|
||||
manifest. `.git` is not copied because in a linked worktree it points into the shared gitdir. `.venv`
|
||||
is not copied because apm runs from the real one via `uv run --project`. The scratch directory is
|
||||
is not copied because apm runs from the real one via `uv run --project`. `.claude/worktrees` is not
|
||||
copied because each worktree there is a full checkout that can carry its own `.venv`. Leaving it out
|
||||
hides nothing: it is ignored through `info/exclude`, and the root checks look only at lock-recorded
|
||||
deployed paths, none of which is under it. The scratch directory is
|
||||
removed on exit, including on `INT`, `TERM` and `HUP`. The script header records the full reasoning.
|
||||
`tests/test-apm-audit-ci-waiver.sh` covers the waiver, the re-run, and each of its guards.
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ This repo hand-writes its grant in the root `apm.yml` and does not run `apm appr
|
||||
|
||||
### "ambiguous duplicate APM-owned hook entry"
|
||||
|
||||
apm raises this error when `.claude/settings.json` holds more byte-identical copies of an APM-owned hook entry than `.claude/apm-hooks.json` records. It happens when the same hook entry is pasted in by hand or merged in twice. To fix it, remove the duplicate entries from `.claude/settings.json`, keeping none of the hand-added copies, then run `apm install` again.
|
||||
`apm audit` raises this error, with or without `--ci`, unless drift checking is off with `--no-drift`. It reports it as a drift finding on `.claude/settings.json`. `apm export-patch` runs the same check. `apm install --frozen` runs it too, but reports only that an APM-managed hook entry was edited or removed. The cause is `.claude/settings.json` holding more byte-identical copies of an APM-owned hook entry than `.claude/apm-hooks.json` records. It happens when the same hook entry is pasted in by hand or merged in twice. To fix it, remove the duplicate entries from `.claude/settings.json`, keeping none of the hand-added copies, then run `apm install` again.
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
{
|
||||
"disableBundledSkills": true,
|
||||
"enabledPlugins": {
|
||||
"cc-plugin-easel@builtin": false,
|
||||
"cc-plugin-plugin-authoring@builtin": false
|
||||
},
|
||||
"env": {
|
||||
"CLAUDE_CODE_DISABLE_SHIP": "1"
|
||||
},
|
||||
"skillOverrides": {
|
||||
"init": "off"
|
||||
"design": "off",
|
||||
"doctor": "off",
|
||||
"init": "off",
|
||||
"plugin-authoring": "off"
|
||||
},
|
||||
"statusLine": {
|
||||
"command": "bash ~/.claude/statusline-command.sh",
|
||||
"type": "command"
|
||||
},
|
||||
"syncClaudeAiPlugins": false,
|
||||
"syncClaudeAiSkills": false,
|
||||
"theme": "dark"
|
||||
}
|
||||
+29
-5
@@ -116,11 +116,25 @@
|
||||
# reading another path cannot silently see an empty one.
|
||||
# * NOT .git: from a linked worktree it is a pointer file into the shared
|
||||
# gitdir, and a git command run in the copy could then refresh that
|
||||
# worktree's real index. A fresh `git init` with the same origin URL
|
||||
# stands in for it -- apm reads only the origin remote, for org-policy
|
||||
# discovery, and the copy prints the same policy line the real root does.
|
||||
# worktree's real index. A fresh `git init` stands in for it, carrying the
|
||||
# two pieces of git state apm reads: the origin remote's URL (org-policy
|
||||
# discovery; the copy prints the same policy line the real root does) and
|
||||
# the repo's info/exclude, copied from `git rev-parse --git-path
|
||||
# info/exclude` (which resolves to the shared gitdir in a linked worktree)
|
||||
# when it exists. deployed-files-present runs `git check-ignore` on each
|
||||
# lock-recorded path that is absent, and an absent path ignored only
|
||||
# through info/exclude must not count as missing in the copy either.
|
||||
# .gitignore files travel with the tree, and core.excludesFile is the same
|
||||
# user-level config for both runs.
|
||||
# * NOT .venv: apm runs through `uv run --project <repo root>`, so the
|
||||
# environment is the real one; .venv is no apm input and most of the size.
|
||||
# * NOT .claude/worktrees: Claude Code's linked worktrees, each a full
|
||||
# checkout that can carry its own .venv. They are ignored through
|
||||
# info/exclude, and no root check reads them: deployed-files-present and
|
||||
# content-integrity look up lock-recorded paths, none of which is under
|
||||
# .claude/worktrees, and drift compares the replay's deployed files
|
||||
# against the same paths in the tree. Leaving them out hides nothing the
|
||||
# real audit would see.
|
||||
# Only list items under `dependencies:` > `apm:` whose `path:` names a waived
|
||||
# plugin are removed (comments and every other line kept), and the result is
|
||||
# checked to differ from the original by deletions only, each waived entry gone.
|
||||
@@ -276,9 +290,10 @@ trap 'exit 143' TERM HUP
|
||||
# 0 and reports the full root check set passing; otherwise prints why, and
|
||||
# apm's output, on stderr and fails.
|
||||
reduced_root_audit() {
|
||||
local names="$1" origin name rerun rc delta
|
||||
local names="$1" origin exclude name rerun rc delta
|
||||
SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/apm-audit-ci.XXXXXX")" || return 1
|
||||
if ! tar -C . --exclude=./.git --exclude=./.venv -cf - . | tar -C "$SCRATCH" -xf -; then
|
||||
if ! tar -C . --exclude=./.git --exclude=./.venv --exclude=./.claude/worktrees -cf - . |
|
||||
tar -C "$SCRATCH" -xf -; then
|
||||
echo 'apm audit --ci: ref-consistency not waived: could not copy the tree for the re-run' >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -309,6 +324,15 @@ reduced_root_audit() {
|
||||
if origin="$(git remote get-url origin 2>/dev/null)"; then
|
||||
git -C "$SCRATCH" remote add origin "$origin" || return 1
|
||||
fi
|
||||
# The real repo's ignore rules for deployed-files-present (header, "NOT
|
||||
# .git"). --git-path resolves to the shared gitdir from a linked worktree.
|
||||
exclude="$(git rev-parse --path-format=absolute --git-path info/exclude 2>/dev/null)" || exclude=""
|
||||
if [ -n "$exclude" ] && [ -f "$exclude" ]; then
|
||||
if ! mkdir -p "$SCRATCH/.git/info" || ! cp "$exclude" "$SCRATCH/.git/info/exclude"; then
|
||||
echo 'apm audit --ci: ref-consistency not waived: could not copy info/exclude into the re-run copy' >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
rc=0
|
||||
rerun="$(cd "$SCRATCH" && run_apm audit --ci 2>&1)" || rc=$?
|
||||
if [ "$rc" -ne 0 ] || ! grep -qF "$ROOT_FULL_PASS" <<<"$rerun"; then
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
# every plugin directory. The waiver's re-run is told apart by where it runs:
|
||||
# under $TMPDIR, the script's mktemp scratch copy, where the stub saves the manifest it was given ($STUB_RERUN_LOG) and prints
|
||||
# $STUB_RERUN_OUTPUT (default: the full root pass) with exit $STUB_RERUN_RC
|
||||
# (default 0). The fixture is a throwaway git repo whose
|
||||
# (default 0). With $STUB_GIT_LOG set it also saves the copy's
|
||||
# .git/info/exclude and notes whether .claude/worktrees was copied. The fixture
|
||||
# is a throwaway git repo whose
|
||||
# refs/remotes/origin/main is set with update-ref -- nothing is fetched.
|
||||
set -euo pipefail
|
||||
|
||||
@@ -40,6 +42,10 @@ if [[ -f apm.lock.yaml.root-marker ]]; then
|
||||
exit 1
|
||||
fi
|
||||
[[ -z "${STUB_RERUN_LOG:-}" ]] || cp apm.yml "$STUB_RERUN_LOG"
|
||||
if [[ -n "${STUB_GIT_LOG:-}" ]]; then
|
||||
cp .git/info/exclude "$STUB_GIT_LOG.exclude" 2> /dev/null || true
|
||||
[[ ! -e .claude/worktrees ]] || touch "$STUB_GIT_LOG.worktrees"
|
||||
fi
|
||||
printf '%s\n' "${STUB_RERUN_OUTPUT-[*] All 15 check(s) passed}"
|
||||
exit "${STUB_RERUN_RC:-0}"
|
||||
fi
|
||||
@@ -141,8 +147,58 @@ cmp -s "$TMP/apm.yml.orig" "$F/apm.yml" && [[ -z "$(git -C "$F" status --porcela
|
||||
&& pass "leaves the working tree's apm.yml byte-identical" || fail "apm.yml changed"
|
||||
tmp_clean && pass "removes the scratch copy" || fail "scratch left behind: $(ls -A "$TMPD")"
|
||||
|
||||
echo ""
|
||||
echo "--- the re-run copy: carries info/exclude, leaves out .claude/worktrees ---"
|
||||
F="$TMP/excl"
|
||||
make_fixture "$F"
|
||||
printf '%s\n' '# fixture marker' '**/.claude/worktrees/' >> "$F/.git/info/exclude"
|
||||
mkdir -p "$F/.claude/worktrees/wt/.venv"
|
||||
touch "$F/.claude/worktrees/wt/.venv/big"
|
||||
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_GIT_LOG="$TMP/gitlog"
|
||||
[[ $RC -eq 0 ]] && pass "still waived" || fail "exited $RC: $OUT"
|
||||
cmp -s "$F/.git/info/exclude" "$TMP/gitlog.exclude" \
|
||||
&& pass "the copy's .git/info/exclude is the repo's" || fail "info/exclude not carried into the copy"
|
||||
[[ ! -e "$TMP/gitlog.worktrees" ]] && pass ".claude/worktrees is not copied" || fail ".claude/worktrees was copied"
|
||||
|
||||
echo ""
|
||||
echo "--- not waived: the reduction changes a line, not only deletes (deletions-only guard) ---"
|
||||
F="$TMP/nonl"
|
||||
make_fixture "$F"
|
||||
# No trailing newline: awk prints one back, so the reduced manifest's last
|
||||
# line differs from the original's, a change rather than a deletion.
|
||||
printf '%s' "$(cat "$F/apm.yml")" > "$F/apm.yml.new" && mv "$F/apm.yml.new" "$F/apm.yml"
|
||||
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||
&& grep -qF "changed more than the waived entries" <<< "$OUT" \
|
||||
&& pass "fails when the reduced apm.yml differs by more than deletions" || fail "must fail (rc=$RC): $OUT"
|
||||
|
||||
echo ""
|
||||
echo "--- not waived: the reduction leaves an rtk entry in place ---"
|
||||
F="$TMP/blank"
|
||||
make_fixture "$F"
|
||||
# A blank line inside the rtk item: dep_identity skips it and still finds the
|
||||
# entry, but reduce_manifest ends the item there and keeps it whole.
|
||||
sed -i '/# Routes Bash/{n;s|$|\n|}' "$F/apm.yml"
|
||||
grep -qx '' "$F/apm.yml" || fail "fixture: no blank line in the rtk item"
|
||||
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||
&& pass "fails when nothing was removed" || fail "must fail (rc=$RC): $OUT"
|
||||
# A second, blank-split rtk item after a normal one: the normal one is
|
||||
# removed, a pure deletion, so only the post-reduce dep_identity guard sees the
|
||||
# entry that survived.
|
||||
F="$TMP/dup"
|
||||
make_fixture "$F"
|
||||
awk -v e=" - git: https://$IDENTITY.git"$'\n\n'" path: plugins/rtk" \
|
||||
'/^ mcp:/ { print e } { print }' "$F/apm.yml" > "$F/apm.yml.new"
|
||||
mv "$F/apm.yml.new" "$F/apm.yml"
|
||||
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||
&& grep -qF "could not remove plugins/rtk's entry" <<< "$OUT" \
|
||||
&& pass "fails when an rtk entry survives a deletions-only reduction" || fail "must fail (rc=$RC): $OUT"
|
||||
|
||||
echo ""
|
||||
echo "--- not waived: the full-set re-run fails ---"
|
||||
F="$TMP/waived"
|
||||
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_RERUN_RC=1 \
|
||||
STUB_RERUN_OUTPUT="$(printf '%s\n' '| [x] | content-integrity | hidden Unicode |' '[x] 1 of 15 check(s) failed')"
|
||||
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||
|
||||
+13
-1
@@ -109,6 +109,9 @@ check_json() {
|
||||
check_json "$SETTINGS_SRC" \
|
||||
's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False and s["env"]["CLAUDE_CODE_DISABLE_SHIP"] == "1" and s["skillOverrides"]["init"] == "off"' \
|
||||
"repo settings turn off bundled and synced skills"
|
||||
check_json "$SETTINGS_SRC" \
|
||||
'all(s["skillOverrides"][k] == "off" for k in ("design", "doctor", "plugin-authoring")) and s["enabledPlugins"]["cc-plugin-easel@builtin"] is False and s["enabledPlugins"]["cc-plugin-plugin-authoring@builtin"] is False and s["syncClaudeAiPlugins"] is False' \
|
||||
"repo settings turn off built-in plugin skills and synced plugins"
|
||||
|
||||
MERGE_HOME="$(new_home)"
|
||||
MERGED="$MERGE_HOME/.claude/settings.json"
|
||||
@@ -118,7 +121,8 @@ cat > "$MERGED" << 'EOF'
|
||||
"theme": "light",
|
||||
"permissions": {"allow": ["Bash(ls:*)"]},
|
||||
"env": {"MY_VAR": "kept", "CLAUDE_CODE_DISABLE_SHIP": "0"},
|
||||
"skillOverrides": {"other": "off", "init": "on"}
|
||||
"skillOverrides": {"other": "off", "init": "on"},
|
||||
"enabledPlugins": {"operator-plugin@x": true, "cc-plugin-easel@builtin": true}
|
||||
}
|
||||
EOF
|
||||
chmod 640 "$MERGED"
|
||||
@@ -132,6 +136,14 @@ check_json "$MERGED" 's["theme"] == "dark" and s["env"]["CLAUDE_CODE_DISABLE_SHI
|
||||
"the repo's value wins where both set one"
|
||||
check_json "$MERGED" 's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False' \
|
||||
"settings only the repo has are added"
|
||||
check_json "$MERGED" 's["enabledPlugins"]["operator-plugin@x"] is True' \
|
||||
"the operator's own plugin entries are kept"
|
||||
check_json "$MERGED" 's["enabledPlugins"]["cc-plugin-easel@builtin"] is False and s["enabledPlugins"]["cc-plugin-plugin-authoring@builtin"] is False' \
|
||||
"the repo turns off built-in plugins the operator had enabled"
|
||||
check_json "$MERGED" 's["skillOverrides"]["other"] == "off" and all(s["skillOverrides"][k] == "off" for k in ("design", "doctor", "plugin-authoring"))' \
|
||||
"new skill overrides are added beside the operator's own"
|
||||
check_json "$MERGED" 's["syncClaudeAiPlugins"] is False' \
|
||||
"plugin sync is turned off in merged settings"
|
||||
|
||||
if [[ "$(find "$MERGED" -perm 640)" == "$MERGED" ]]; then
|
||||
pass "the existing file's permissions are kept"
|
||||
|
||||
@@ -18,7 +18,8 @@ fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
||||
|
||||
[[ -f "$SRC" ]] || { echo "FAIL: $SRC does not exist"; exit 1; }
|
||||
REAL_RTK="$(command -v rtk || true)"
|
||||
TIMEOUT="$(command -v timeout)"
|
||||
TIMEOUT="$(command -v timeout || true)"
|
||||
[[ -n "$TIMEOUT" ]] || { echo "FAIL: timeout(1) is not on PATH; install coreutils to run these tests"; exit 1; }
|
||||
|
||||
WORK="$(mktemp -d)"
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
@@ -105,6 +106,10 @@ else
|
||||
# so rtk passes it through with no output. A later rtk may add one.
|
||||
run "$HOOK" "$REAL_PATH" "echo hello"
|
||||
if [[ $RC -eq 0 && -z "$OUT" ]]; then pass; else fail "echo hello: want no output, got $RC: $OUT"; fi
|
||||
# Backs the README's "running both hooks is harmless": rtk leaves a command
|
||||
# that already starts with rtk alone, so a second hook adds nothing.
|
||||
run "$HOOK" "$REAL_PATH" "rtk git status"
|
||||
if [[ $RC -eq 0 && -z "$OUT" ]]; then pass; else fail "rtk git status: want no output, got $RC: $OUT"; fi
|
||||
fi
|
||||
|
||||
echo "== hooks.json"
|
||||
|
||||
Reference in new issue
Block a user