@erclx/canon 5.57.0 → 5.59.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.
- package/CHANGELOG.md +29 -0
- package/README.md +1 -1
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/context-fold/references/context.md +1 -1
- package/claude/skills/document-health/REQUIREMENT.md +2 -2
- package/claude/skills/document-health/SKILL.md +14 -0
- package/claude/skills/document-health/references/axes.md +12 -0
- package/claude/skills/document-repair/REQUIREMENT.md +6 -1
- package/claude/skills/document-repair/SKILL.md +21 -0
- package/claude/skills/plan-feature/SKILL.md +1 -1
- package/claude/skills/target-update/SKILL.md +5 -1
- package/docs/agents/context-audit.md +1 -1
- package/docs/agents/install-and-sync.md +1 -1
- package/docs/agents/migrate.md +6 -0
- package/docs/target/sync.md +3 -1
- package/docs/workflow/operating-model.md +1 -1
- package/governance/rules/code/routing.md +5 -1
- package/governance/rules/ui/design-taste.md +4 -0
- package/package.json +3 -3
- package/scripts/core/bootstrap.ts +120 -0
- package/scripts/core/install-check.ts +193 -0
- package/src/cli/retired.ts +63 -0
- package/src/cli/ui.ts +3 -5
- package/src/cli.ts +8 -2
- package/src/commands/gov.ts +8 -2
- package/src/commands/migrate.ts +7 -1
- package/src/commands/pr.ts +10 -1
- package/src/context/audit.ts +26 -1
- package/src/gov/adapter.ts +2 -0
- package/src/gov/coverage.ts +62 -0
- package/src/migrate/callers.ts +192 -0
- package/src/migrate/status.ts +11 -3
- package/src/pr/merge.ts +77 -1
- package/src/pr/rest.ts +1 -0
- package/src/sandbox/expect.ts +1 -1
- package/src/sync/engine.ts +84 -0
- package/src/sync/stamp.ts +51 -1
- package/scripts/core/bootstrap.sh +0 -86
- package/scripts/core/install-check.sh +0 -113
- package/scripts/lib/ui.sh +0 -45
|
@@ -1,113 +0,0 @@
|
|
|
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/ui.sh"
|
|
9
|
-
|
|
10
|
-
TMP_ROOT="$PROJECT_ROOT/.canon/tmp/install-check"
|
|
11
|
-
PACK_DIR="$TMP_ROOT/pack"
|
|
12
|
-
EXTRACT_DIR="$TMP_ROOT/extract"
|
|
13
|
-
TARGET_DIR="$TMP_ROOT/target"
|
|
14
|
-
KEEP=0
|
|
15
|
-
|
|
16
|
-
for arg in "$@"; do
|
|
17
|
-
case "$arg" in
|
|
18
|
-
--keep) KEEP=1 ;;
|
|
19
|
-
--help | -h)
|
|
20
|
-
cat <<HELP
|
|
21
|
-
Usage: scripts/core/install-check.sh [--keep]
|
|
22
|
-
|
|
23
|
-
Verifies the published install path end to end:
|
|
24
|
-
1. Packs this repo into a tarball at .canon/tmp/install-check/pack
|
|
25
|
-
2. Extracts it and asserts sandbox is absent from the tree
|
|
26
|
-
3. Runs bun install --production in the extracted tree
|
|
27
|
-
4. Runs the CLI with --help from the extracted tree to confirm it resolves
|
|
28
|
-
5. Scaffolds a fresh project in .canon/tmp/install-check/target
|
|
29
|
-
6. Runs canon init from the extracted package and asserts a scaffold landed
|
|
30
|
-
|
|
31
|
-
Flags:
|
|
32
|
-
--keep Keep the tmp tree on exit for inspection
|
|
33
|
-
HELP
|
|
34
|
-
exit 0
|
|
35
|
-
;;
|
|
36
|
-
esac
|
|
37
|
-
done
|
|
38
|
-
|
|
39
|
-
cleanup() {
|
|
40
|
-
if [ "$KEEP" = "1" ]; then
|
|
41
|
-
log_info "Kept artifacts at $TMP_ROOT"
|
|
42
|
-
else
|
|
43
|
-
rm -rf "$TMP_ROOT"
|
|
44
|
-
fi
|
|
45
|
-
close_timeline
|
|
46
|
-
}
|
|
47
|
-
trap cleanup EXIT
|
|
48
|
-
|
|
49
|
-
rm -rf "$TMP_ROOT"
|
|
50
|
-
mkdir -p "$PACK_DIR" "$EXTRACT_DIR"
|
|
51
|
-
|
|
52
|
-
open_timeline "Install verification"
|
|
53
|
-
|
|
54
|
-
# An absence check over a path the source tree no longer holds passes on
|
|
55
|
-
# nothing, so the excluded tree has to exist here before its absence below can
|
|
56
|
-
# mean the publish left it out.
|
|
57
|
-
log_step "Assert excluded path exists in source"
|
|
58
|
-
if [ ! -f "$PROJECT_ROOT/sandbox/exempt.toml" ]; then
|
|
59
|
-
log_error "sandbox/exempt.toml is missing from the source tree, so the absence check below would pass on nothing"
|
|
60
|
-
fi
|
|
61
|
-
log_info "Present: sandbox/exempt.toml"
|
|
62
|
-
|
|
63
|
-
log_step "Pack"
|
|
64
|
-
TARBALL_PATH="$(cd "$PROJECT_ROOT" && bun pm pack --quiet --ignore-scripts --destination "$PACK_DIR" | tail -n 1)"
|
|
65
|
-
log_info "Packed to $TARBALL_PATH"
|
|
66
|
-
|
|
67
|
-
log_step "Extract"
|
|
68
|
-
tar -xzf "$TARBALL_PATH" -C "$EXTRACT_DIR" --strip-components=1
|
|
69
|
-
log_info "Extracted to $EXTRACT_DIR"
|
|
70
|
-
|
|
71
|
-
log_step "Assert excluded path is absent"
|
|
72
|
-
if [ -e "$EXTRACT_DIR/sandbox" ]; then
|
|
73
|
-
log_error "sandbox shipped in the tarball, and the files field in package.json leaves it out"
|
|
74
|
-
fi
|
|
75
|
-
log_info "Absent: sandbox"
|
|
76
|
-
|
|
77
|
-
log_step "Install dependencies (production)"
|
|
78
|
-
(cd "$EXTRACT_DIR" && bun install --production --ignore-scripts --silent 2>&1 | pipe_output) || log_error "bun install --production failed"
|
|
79
|
-
log_info "Dependencies installed without devDependencies"
|
|
80
|
-
|
|
81
|
-
log_step "Confirm CLI runs"
|
|
82
|
-
(cd "$EXTRACT_DIR" && bun run src/cli.ts --help >/dev/null) || log_error "canon --help failed"
|
|
83
|
-
log_info "canon --help ran clean from the extracted package"
|
|
84
|
-
|
|
85
|
-
log_step "Scaffold fresh project"
|
|
86
|
-
mkdir -p "$TARGET_DIR"
|
|
87
|
-
(cd "$TARGET_DIR" && git init --quiet)
|
|
88
|
-
log_info "Initialized git in $TARGET_DIR"
|
|
89
|
-
|
|
90
|
-
log_step "Run canon init"
|
|
91
|
-
(cd "$TARGET_DIR" && bun run "$EXTRACT_DIR/src/cli.ts" init --stack base </dev/null 2>&1 | pipe_output) || log_error "canon init failed"
|
|
92
|
-
log_info "canon init completed"
|
|
93
|
-
|
|
94
|
-
log_step "Assert scaffold"
|
|
95
|
-
# Every domain canon init installs needs at least one path here. A domain with
|
|
96
|
-
# no assertion can truncate silently: init still exits 0 because run_domain
|
|
97
|
-
# catches a failed domain, and the gate stays green while the target is
|
|
98
|
-
# missing everything that domain provides.
|
|
99
|
-
#
|
|
100
|
-
# Authoring references name no path because they ship inside the plugin's
|
|
101
|
-
# skills rather than installing into a target. The two
|
|
102
|
-
# rule paths stand for the `claude` and `canon` groups `base` takes whole.
|
|
103
|
-
for path in "CLAUDE.md" ".claude" "canon/context/index.md" \
|
|
104
|
-
".oxfmtrc.json" ".lintstagedrc" ".husky/pre-commit" ".github/workflows/verify.yml" "scripts/verify.ts" \
|
|
105
|
-
".claude/rules/canon/claude/output.md" ".claude/rules/canon/canon/scratch.md"; do
|
|
106
|
-
if [ ! -e "$TARGET_DIR/$path" ]; then
|
|
107
|
-
log_error "Missing after canon init: $path"
|
|
108
|
-
fi
|
|
109
|
-
log_info "Found: $path"
|
|
110
|
-
done
|
|
111
|
-
|
|
112
|
-
log_step "Verification passed"
|
|
113
|
-
log_info "Manual check still needed: bun link and global canon invocation"
|
package/scripts/lib/ui.sh
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
if [ "${BASH_VERSINFO[0]:-0}" -lt 4 ]; then
|
|
4
|
-
echo "canon requires bash 4 or newer. Current: ${BASH_VERSION:-unknown}." >&2
|
|
5
|
-
echo "Install via Homebrew: brew install bash" >&2
|
|
6
|
-
exit 1
|
|
7
|
-
fi
|
|
8
|
-
|
|
9
|
-
# The frame writes no color. The scripts left on it run as setup and gate steps,
|
|
10
|
-
# where a pipe or a log reads the output more often than a terminal does.
|
|
11
|
-
|
|
12
|
-
log_info() {
|
|
13
|
-
echo -e "│ ✓ $1" >&2
|
|
14
|
-
}
|
|
15
|
-
log_warn() {
|
|
16
|
-
echo -e "│ ! $1" >&2
|
|
17
|
-
}
|
|
18
|
-
log_error() {
|
|
19
|
-
echo -e "│ ✗ $1" >&2
|
|
20
|
-
exit 1
|
|
21
|
-
}
|
|
22
|
-
log_step() {
|
|
23
|
-
echo -e "│\n├ $1" >&2
|
|
24
|
-
}
|
|
25
|
-
log_add() {
|
|
26
|
-
echo -e "│ + $1" >&2
|
|
27
|
-
}
|
|
28
|
-
log_rem() {
|
|
29
|
-
echo -e "│ - $1" >&2
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
pipe_output() {
|
|
33
|
-
while IFS= read -r line; do echo -e "│ $line" >&2; done
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
open_timeline() {
|
|
37
|
-
echo -e "┌" >&2
|
|
38
|
-
if [ -n "${1:-}" ]; then
|
|
39
|
-
echo -e "│ $1" >&2
|
|
40
|
-
fi
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
close_timeline() {
|
|
44
|
-
echo -e "└" >&2
|
|
45
|
-
}
|