@erclx/aitk 0.65.1 → 0.66.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aitk",
3
3
  "description": "Automated governance, versioning, and discovery tools for Claude Code.",
4
- "version": "0.65.1",
4
+ "version": "0.66.0",
5
5
  "author": {
6
6
  "name": "Eric Le",
7
7
  "url": "https://github.com/erclx"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erclx/aitk",
3
3
  "type": "module",
4
- "version": "0.65.1",
4
+ "version": "0.66.0",
5
5
  "description": "Infrastructure and quality tooling for developer workflows",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/tooling.sh"
9
+
10
+ TOOLKIT_TOKEN="aitk"
11
+ TOOLING_ROOT="$PROJECT_ROOT/tooling"
12
+
13
+ # `find` writes to stderr and returns non-zero for a missing root, inside a
14
+ # process substitution whose status nothing reads. Without this the walk covers
15
+ # nothing and the check reports the seeds independent having never read one.
16
+ if [ ! -d "$TOOLING_ROOT" ]; then
17
+ echo "No tooling root at ${TOOLING_ROOT#"$PROJECT_ROOT/"}, seed independence unverifiable." >&2
18
+ exit 1
19
+ fi
20
+
21
+ # An empty discovery is a real state rather than a broken walk, and the Seed
22
+ # standards stage already reports it as a skip. Failing here would have the two
23
+ # stages disagree about what the same condition means.
24
+ seed_roots=$(collect_seed_roots)
25
+ if [ -z "$seed_roots" ]; then
26
+ echo "No seed root carries .claude/, nothing to check." >&2
27
+ exit 0
28
+ fi
29
+
30
+ # Markdown alone. The seed tree also ships hooks that call the toolkit CLI on
31
+ # purpose, each reporting a named stale-index warning when the binary is absent,
32
+ # and scoping by extension leaves them outside this walk without an exemption
33
+ # list that would have to be maintained against them.
34
+ cited=""
35
+ measured=0
36
+ while IFS= read -r seed_root; do
37
+ while IFS= read -r file; do
38
+ measured=$((measured + 1))
39
+ while IFS= read -r hit; do
40
+ cited="$cited ${file#"$PROJECT_ROOT/"}:$hit"$'\n'
41
+ done < <(grep -n "$TOOLKIT_TOKEN" "$file" || true)
42
+ done < <(find "$PROJECT_ROOT/$seed_root" -type f -name '*.md')
43
+ done <<<"$seed_roots"
44
+
45
+ # Roots resolved and no markdown under any of them is a walk that covered
46
+ # nothing, which is the verdict-without-a-measurement the guards above refuse for
47
+ # a missing tree. Reporting a pass here would say the seeds cite no CLI on the
48
+ # strength of having read no prose.
49
+ if [ "$measured" -eq 0 ]; then
50
+ echo "Seed roots resolved but carry no markdown, seed independence unverifiable." >&2
51
+ exit 1
52
+ fi
53
+
54
+ if [ -n "$cited" ]; then
55
+ echo "Seed prose cites the toolkit CLI:" >&2
56
+ printf '%s' "$cited" >&2
57
+ echo "A scaffolded project may not have $TOOLKIT_TOKEN installed. State the capability the line needs rather than the binary that supplies it." >&2
58
+ exit 1
59
+ fi
@@ -7,6 +7,7 @@ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
7
 
8
8
  source "$PROJECT_ROOT/scripts/lib/ui.sh"
9
9
  source "$PROJECT_ROOT/scripts/lib/worktree.sh"
10
+ source "$PROJECT_ROOT/scripts/lib/tooling.sh"
10
11
 
11
12
  NESTED="${VERIFY_NESTED:-false}"
12
13
  WRITE="${VERIFY_WRITE:-true}"
@@ -127,16 +128,6 @@ assert_hero_pair() {
127
128
  [ "$html_commit" = "$png_commit" ]
128
129
  }
129
130
 
130
- # Whatever stacks the repo currently carries, so a new one is covered without an
131
- # edit here. A seed root holding no `.claude/` seeds nothing a standard governs.
132
- collect_seed_roots() {
133
- local dir
134
- for dir in "$PROJECT_ROOT"/tooling/*/seeds; do
135
- [ -d "$dir/.claude" ] || continue
136
- printf '%s\n' "${dir#"$PROJECT_ROOT"/}"
137
- done
138
- }
139
-
140
131
  # Entries the audit actually measured, summed across the folders it resolved.
141
132
  # `--json` carries one `"entries":<n>` per folder object, and the top-level key
142
133
  # of that name holds an array, so the numeric match reaches folders alone.
@@ -214,6 +205,15 @@ main() {
214
205
  run_check "bash $PROJECT_ROOT/scripts/core/check-plugin-boundary.sh" "Plugin ships toolkit-internal content."
215
206
  log_info "Plugin boundary clean"
216
207
 
208
+ # Seed prose is installed into every scaffolded project and read there as
209
+ # instruction about that project, so a line naming this repository's CLI hands
210
+ # a target a verb it may not be able to run. This gates for the reason the
211
+ # Seed standards stage below gates: a defect authored once propagates into
212
+ # every project scaffolded after it.
213
+ log_step "Seed independence"
214
+ run_check "bash $PROJECT_ROOT/scripts/core/check-seed-independence.sh" "Seed prose cites the toolkit CLI."
215
+ log_info "Seed prose cites no toolkit CLI"
216
+
217
217
  # A stack entry naming a rule folder takes every rule in it, which is what
218
218
  # stops a new rule from needing a second edit to reach a target. The failure
219
219
  # it leaves open is a rule authored into a folder no stack names, which
@@ -22,3 +22,14 @@ list_tooling_stacks() {
22
22
  echo "$name"
23
23
  done < <(find "$tooling_dir" -mindepth 1 -maxdepth 1 -type d | sort)
24
24
  }
25
+
26
+ # Seed roots that carry a `.claude/`, emitted relative to `PROJECT_ROOT`. Every
27
+ # stage measuring seed content discovers through this rather than naming a stack,
28
+ # so a stack seeding `.claude/` later arrives covered with no edit to any caller.
29
+ collect_seed_roots() {
30
+ local dir
31
+ for dir in "$PROJECT_ROOT"/tooling/*/seeds; do
32
+ [ -d "$dir/.claude" ] || continue
33
+ printf '%s\n' "${dir#"$PROJECT_ROOT"/}"
34
+ done
35
+ }
@@ -74,7 +74,7 @@
74
74
  - Write all memory files to `.claude/memory/`, not `~/.claude/projects/`
75
75
  - A fact about a domain goes to that domain's `.claude/context/` entry, not to memory. `claude-memory-capture` routes it there and `claude-docs` folds it in. Memory keeps only what no context entry owns.
76
76
  - Never delete a memory entry. Retire one by moving it to `.claude/.tmp/memory-archive/`. A bulk retire runs through the shell, where no file edit fires a path-scoped rule, and the folder is gitignored with nothing to recover from.
77
- - Follow `.claude/standards/memory.md` for the filename and type prefix, the frontmatter, the body shape each type carries, and the lifecycle. Run `aitk records validate memory` to check the pen against it.
77
+ - Follow `.claude/standards/memory.md` for the filename and type prefix, the frontmatter, the body shape each type carries, and the lifecycle. Check every entry in the pen against that standard and fix what breaks it, since nothing keeps the folder conforming on its own.
78
78
 
79
79
  ## Scratch
80
80
 
@@ -87,4 +87,4 @@
87
87
  - From a linked worktree, every `Edit` or `Write` to a tracked file (source, docs) must use a path starting with `pwd`.
88
88
  - From a linked worktree, `Edit` and `Write` are refused for every main-root path, session scratch included. The refusal names session isolation and points at the worktree copy, which is a second gitignored file no later session reads, so never take that redirect.
89
89
  - `Read` resolves against the main root normally from a linked worktree. A main-root write reaches it only through `Bash`, as one plain command rather than a compound one, which is refused for complexity.
90
- - Route a main-root write by what it does to the file. Creating a whole file goes out as one plain `Bash` command carrying a heredoc. Changing a line inside a file that already exists goes through an `aitk` verb, which resolves the main root in-process, because the shell route for that case is the stream editor this file bans.
90
+ - Route a main-root write by what it does to the file. Creating a whole file goes out as one plain `Bash` command carrying a heredoc. Changing a line inside a file that already exists goes through a command that resolves the main root in-process, because the shell route for that case is the stream editor this file bans.