From 9fc184c68e74ce21c38d051b8035df618a20966c Mon Sep 17 00:00:00 2001 From: "melodic-automation-lanes[bot]" <337595936+melodic-automation-lanes[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 23:17:33 +0000 Subject: [PATCH 1/2] Resolve issue #18050 Lane-Activity: work-resolve-issue/resolve-issue --- ...ssue-issue-18050-44959670298-1-89337e72.md | 11 +++ plugins/testing/README.md | 18 ++-- .../testing/scripts/check-browser-driver.sh | 2 +- plugins/testing/scripts/resolve-config.sh | 86 ++++++++++++++----- .../testing/scripts/resolve-config.test.sh | 79 ++++++++++++++--- .../skills/audit/scripts/cant-fail-scan.sh | 2 +- .../skills/run-e2e/context/e2e-config.md | 8 +- plugins/testing/skills/setup/scripts/setup.sh | 19 ++-- 8 files changed, 173 insertions(+), 52 deletions(-) create mode 100644 .changes/testing/work-resolve-issue-issue-18050-44959670298-1-89337e72.md diff --git a/.changes/testing/work-resolve-issue-issue-18050-44959670298-1-89337e72.md b/.changes/testing/work-resolve-issue-issue-18050-44959670298-1-89337e72.md new file mode 100644 index 00000000000..e2a2667135a --- /dev/null +++ b/.changes/testing/work-resolve-issue-issue-18050-44959670298-1-89337e72.md @@ -0,0 +1,11 @@ +--- +bump: minor +--- + +### Changed + +- `scripts/resolve-config.sh` reads the config-cascade layers. The team layer and the new personal override, `testing.local.yaml`, come from the repository's convention home (`docs/conventions` unless the repository binds another), and a broken convention-home pointer stops the scan config. A `userConfig` value set to anything other than its default now wins over `~/.claude/testing.yaml` for the run-e2e and map keys. `/testing:setup apply` writes the team layer under the same convention home, and `/testing:audit` resolves the config when `docs/conventions/testing.local.yaml` is the only file ([#18050](https://github.com/melodic-software/claude-code-plugins/issues/18050)). + +### Deprecated + +- `~/.claude/testing.yaml`, `.claude/testing.yaml` and `.claude/testing.local.yaml` are still read. Each run prints one warning for each of these files it finds, naming where to move it. The old personal override is ignored once `/testing.local.yaml` exists ([#18050](https://github.com/melodic-software/claude-code-plugins/issues/18050)). diff --git a/plugins/testing/README.md b/plugins/testing/README.md index 710b0f7e9f2..00286849fb6 100644 --- a/plugins/testing/README.md +++ b/plugins/testing/README.md @@ -184,8 +184,10 @@ The team layer is `docs/conventions/testing.yaml`, validated by takes, plus the two run-e2e keys above. Without it, the team layer is the `yaml config` block in `docs/conventions/testing.md` (read for one more release), else `/.claude/testing.yaml`. The first of the three present wins, and the resolver prints one warning for each other one present. -The prose testing rules stay in `docs/conventions/testing.md`. This release still reads the -user-global and `.claude/testing.local.yaml` layers at those paths. +The prose testing rules stay in `docs/conventions/testing.md`. The personal override is +`docs/conventions/testing.local.yaml`. The convention home is the folder that holds these files, +`docs/conventions` by default. When the repository's `AGENTS.md` or `CLAUDE.md` binds another +convention home, the resolver reads all three files from that folder. #### Move the team layer to `docs/conventions/testing.yaml` @@ -196,10 +198,14 @@ user-global and `.claude/testing.local.yaml` layers at those paths. 3. Once every member runs this release, delete the old block or file. Until then every run prints a warning naming both; an older release keeps reading the old one. -This release moves only the team layer. It still reads `~/.claude/testing.yaml` and -`.claude/testing.local.yaml`; keep them there until the plugin migrates -([#17999](https://github.com/melodic-software/claude-code-plugins/issues/17999)), then move them -where [config locations](reference/config-locations.md) says. Reading the block costs the same as reading the file; the measured p50 and p95 are in the +`scripts/resolve-config.sh` still reads the old files, and each run prints one warning for each +old file it finds, naming where to move it. `.claude/testing.yaml` goes to +`docs/conventions/testing.yaml`. `.claude/testing.local.yaml` goes to +`docs/conventions/testing.local.yaml`; once that new file exists, the resolver ignores the old one. +Each setting in `~/.claude/testing.yaml` goes to its `userConfig` option, and a setting with no +option goes to `docs/conventions/testing.local.yaml`. A `userConfig` value other than its default +wins over the old file. The other scripts and skills move in their own changes +([#17999](https://github.com/melodic-software/claude-code-plugins/issues/17999)). Reading the block costs the same as reading the file; the measured p50 and p95 are in the [latency probes](https://github.com/melodic-software/claude-code-plugins/blob/927a5305d238874ce006eaad6b3fa5c3cb07ebc1/docs/specs/tautological-tests/probes.md#team-layer-location-docs-block-or-claudetestingyaml-wsl2), and `plugins/testing/scripts/time-config.sh` reproduces them. diff --git a/plugins/testing/scripts/check-browser-driver.sh b/plugins/testing/scripts/check-browser-driver.sh index 6a69aef14e4..3a44b04c9c7 100755 --- a/plugins/testing/scripts/check-browser-driver.sh +++ b/plugins/testing/scripts/check-browser-driver.sh @@ -33,7 +33,7 @@ fi cat >&2 </.claude/testing.local.yaml). The team layer is -# /docs/conventions/testing.yaml when it exists (schema: +# LAYERS, per the config-cascade convention, in order: user-global, team and a +# gitignored personal override (//testing.local.yaml). is the +# convention home the pointer region binds (lib/resolve-convention-home.sh), +# else docs/conventions; a broken pointer exits 2. The team layer is +# //testing.yaml when it exists (schema: # schemas/testing.schema.json). Without it, the team layer is the ```yaml config -# block of /docs/conventions/testing.md when that file holds one, else +# block of //testing.md when that file holds one, else # /.claude/testing.yaml; the docs block is read for one more release. The # first of the three present wins, and a warning naming it and each other one -# present goes to stderr. Lists concatenate with the first +# present goes to stderr. OLD LOCATIONS, read during the dual-read window: +# ~/.claude/testing.yaml is the user-global layer (the cascade has none; its +# settings move to userConfig), /.claude/testing.yaml the team fallback, +# and /.claude/testing.local.yaml the personal override when +# /testing.local.yaml is absent. Each one read, or ignored beside its new +# file, prints one warning naming it and where to move it. Lists concatenate with the first # occurrence kept; a scalar in a later layer overrides. The format is the # adapters' YAML subset, parsed by skills/audit/scripts/adapter-load.awk # -v MODE=config (its header lists the keys and the block form), so no jq, yq @@ -56,15 +62,16 @@ # script, stops when that command is not on PATH. # It prints ` ` per key, the source being the # layer file, userConfig, or default. Highest first: the personal override, -# docs/conventions/testing.yaml, the user-global file, then the --user value -# (the rendered userConfig option; an unrendered ${user_config.} or an -# empty value is unset). The first that sets the key decides; an unknown, +# /testing.yaml, the --user value (the rendered userConfig option; an +# unrendered ${user_config.}, an empty value or the default is unset), +# then the old user-global file. The first that sets the key decides; an unknown, # nested or unparsable value there is named on stderr and the key takes its # default, never a lower layer's value. The docs block and .claude/testing.yaml are not read for # these keys: a release older than this mode refuses them there, which stops # its scan. Each value goes through parse-concern-value.sh, so the scan keys' # grammar never applies, and a scan config that does not resolve, a missing -# repository or a symlinked layer (skipped with a warning) never stops it. +# repository, a broken convention-home pointer (no layer is read) or a +# symlinked layer (skipped with a warning) never stops it. # # MAP: `resolve-config.sh map` resolves the keys of /testing:run-e2e's map # scope the same way as E2E, --user values and layer order included, and prints @@ -92,12 +99,13 @@ # --root the repository root the team layer, the personal override and # relative paths resolve against. Default: the current directory's git toplevel, # else $CLAUDE_PROJECT_DIR. -# --home the directory holding the user-global layer. Default: $HOME. +# --home the directory holding the old user-global file. Default: $HOME. # --quick skip the adapter load and hook.uncovered: the test-scan.sh path, # where the scanner's own adapter load still refuses a bad extend. # Adapter ids are still checked, against the adapter files' id: lines. # -# Exit: 0 resolved, 2 usage error, a team layer or personal override that is a symlink +# Exit: 0 resolved, 2 usage error, a convention-home pointer that does not resolve +# (scan mode only), a team layer or personal override that is a symlink # or under a symlinked directory inside , or an unreadable, unparsable or invalid # layer (the file and line are named on stderr). @@ -216,6 +224,45 @@ PLUGIN="$PLUGIN/.." # A warning can quote a layer's text: strip non-printing bytes, keeping \t and \n. warn() { printf 'resolve-config: warning: %s\n' "$1" | LC_ALL=C tr -d '\000-\010\013-\037\177' >&2; } +CONV_HOME="" +if [[ -n "$ROOT" ]]; then + CONV_HOME=docs/conventions + home_rc=0 + bound="$(bash "$PLUGIN/lib/resolve-convention-home.sh" --root "$ROOT" 2>/dev/null)" || home_rc=$? + case "$home_rc" in + 0) CONV_HOME="${bound//$'\r'/}" ;; + 1 | 4 | 5) ;; + *) + broken="the convention-home pointer in $ROOT does not resolve (resolve-convention-home.sh exit $home_rc)" + [[ "$MODE" != scan ]] || die "$broken" + warn "$broken; reading no layer under it" + CONV_HOME="" + ;; + esac +fi +NEW_LOC="${CONV_HOME:-}" +TEAM_NEW="${CONV_HOME:+$ROOT/$CONV_HOME/testing.yaml}" +TEAM_DOCS="${CONV_HOME:+$ROOT/$CONV_HOME/testing.md}" +TEAM_YAML="$ROOT/.claude/testing.yaml" +PERSONAL_NEW="${CONV_HOME:+$ROOT/$CONV_HOME/testing.local.yaml}" +PERSONAL_OLD="$ROOT/.claude/testing.local.yaml" +USER_OLD="${USER_HOME_DIR:+$USER_HOME_DIR/.claude/testing.yaml}" + +PERSONAL="" +if [[ -n "$ROOT" ]]; then + if [[ -f "$PERSONAL_NEW" ]]; then + PERSONAL="$PERSONAL_NEW" + [[ ! -f "$PERSONAL_OLD" ]] || + warn "$PERSONAL_NEW and $PERSONAL_OLD both exist; using $PERSONAL_NEW, ignoring the old file: move any setting it still holds into $PERSONAL_NEW" + elif [[ -f "$PERSONAL_OLD" ]]; then + PERSONAL="$PERSONAL_OLD" + warn "$PERSONAL_OLD is an old location, still read for now; move it to $NEW_LOC/testing.local.yaml" + fi +fi +if [[ "$MODE" != write && -f "$USER_OLD" ]]; then + warn "$USER_OLD is an old location, still read for now: there is no user-global file layer; move each setting to its testing userConfig option, else to $NEW_LOC/testing.local.yaml" +fi + # under_link : true when , or a directory above it inside , # is a symlink. A repository could point such a layer at any file. under_link() { @@ -248,8 +295,7 @@ mode_keys() { [[ "$val" != '${user_config.'* ]] || val="" user_val[${u%%=*}]="$val" done - for f in ${ROOT:+"$ROOT/.claude/testing.local.yaml" "$ROOT/docs/conventions/testing.yaml"} \ - ${USER_HOME_DIR:+"$USER_HOME_DIR/.claude/testing.yaml"}; do + for f in ${PERSONAL:+"$PERSONAL"} ${TEAM_NEW:+"$TEAM_NEW"} ${USER_OLD:+"$USER_OLD"}; do [[ -f "$f" ]] || continue if under_link "$f"; then warn "skipping a layer that is a symlink or under a symlinked directory: $f" @@ -277,11 +323,12 @@ mode_keys() { esac val="" src="" raw="" u="${user_val[$key]:-}" for f in ${files[@]+"${files[@]}"}; do + [[ "$f" != "$USER_OLD" || -z "$u" || "$u" == "$def" ]] || break # The first layer with the key's top-level line sets it; only that line # reaches the parser, so a nested, non-scalar or unparsable value reads # as empty and is reported below. lines="$(LC_ALL=C sed -e $'1s/^\xef\xbb\xbf//' -e 's/\r$//' "$f" | grep -E "^${key}[[:space:]]*:")" || continue - if [[ -n "$repo_only" && "$f" == "$USER_HOME_DIR/.claude/testing.yaml" ]]; then + if [[ -n "$repo_only" && "$f" == "$USER_OLD" ]]; then warn "$f: $key is a repository $repo_only; the user-global layer is not read for it" continue fi @@ -319,10 +366,6 @@ elif [[ "$MODE" == write ]]; then exit 0 fi -TEAM_NEW="$ROOT/docs/conventions/testing.yaml" -TEAM_DOCS="$ROOT/docs/conventions/testing.md" -TEAM_YAML="$ROOT/.claude/testing.yaml" - # gather : set layers to the user-global layer, that team layer and # the personal override, as present. layers=() @@ -331,8 +374,7 @@ gather() { local f layers=() layer_seen=() - for f in ${USER_HOME_DIR:+"$USER_HOME_DIR/.claude/testing.yaml"} \ - "$1" "$ROOT/.claude/testing.local.yaml"; do + for f in ${USER_OLD:+"$USER_OLD"} "$1" ${PERSONAL:+"$PERSONAL"}; do [[ -f "$f" && -z "${layer_seen[$f]:-}" ]] || continue ! under_link "$f" || die "layer is a symlink or under a symlinked directory, refusing to read it: $f" [[ -r "$f" ]] || die "layer is not readable: $f" @@ -367,6 +409,8 @@ else gather "$TEAM_YAML" records="$(load)" || exit 2 fi +[[ -z "${layer_seen[$TEAM_YAML]:-}" ]] || + warn "$TEAM_YAML is an old location, still read for now; move it to $CONV_HOME/testing.yaml" [[ ${#layers[@]} -gt 0 ]] || exit 0 out=() diff --git a/plugins/testing/scripts/resolve-config.test.sh b/plugins/testing/scripts/resolve-config.test.sh index bdf5b250b50..ce7c70b94a9 100755 --- a/plugins/testing/scripts/resolve-config.test.sh +++ b/plugins/testing/scripts/resolve-config.test.sh @@ -236,12 +236,15 @@ assert_eq "with both, the docs block is the team layer and the .claude file is s assert_eq "no key from the ignored .claude file merges in" "py-unittest" "$(records adapters.disable)" assert_eq "the personal override still merges over the docs block" "warn" "$(records rules.zero-assertion)" assert_contains "both present: one warning names both paths" "$(errs)" "$DOCS and $REPO/.claude/testing.yaml both exist; using the docs block" -assert_eq "and it is one line" 1 "$(errs | wc -l | tr -d ' ')" +assert_contains "the old personal override draws its own warning" "$(errs)" \ + "$REPO/.claude/testing.local.yaml is an old location, still read for now; move it to docs/conventions/testing.local.yaml" +assert_eq "one line each" 2 "$(errs | wc -l | tr -d ' ')" rm -f "$REPO/.claude/testing.local.yaml" rm -f "$DOCS" run assert_eq "a .claude file alone is the team layer" "$REPO/.claude/testing.yaml" "$(records layer)" -assert_eq "with no warning" "" "$(errs)" +OLD_TEAM_WARN="resolve-config: warning: $REPO/.claude/testing.yaml is an old location, still read for now; move it to docs/conventions/testing.yaml" +assert_eq "with one warning naming where to move it" "$OLD_TEAM_WARN" "$(errs)" cat >"$DOCS" <<'EOF' # Testing @@ -261,7 +264,7 @@ EOF run assert_eq "a docs file with no block falls back to the .claude file" "$REPO/.claude/testing.yaml" "$(records layer)" assert_eq "using its keys" "bash-bats" "$(records adapters.disable)" -assert_eq "without a warning" "" "$(errs)" +assert_eq "with the old-location warning only" "$OLD_TEAM_WARN" "$(errs)" rm -f "$REPO/.claude/testing.yaml" run assert_eq "no block and no .claude file prints nothing" "0:" "$rc:$out" @@ -359,7 +362,8 @@ assert_eq "no key from either ignored file merges in" "yaml-team/**" "$(records assert_eq "the personal override still merges over testing.yaml" "warn" "$(records rules.zero-assertion)" assert_contains "one warning names testing.yaml and the docs file" "$(errs)" "$TY and $DOCS both exist; using $TY" assert_contains "one warning names testing.yaml and the .claude file" "$(errs)" "$TY and $REPO/.claude/testing.yaml both exist; using $TY" -assert_eq "two warnings, one line each" 2 "$(errs | wc -l | tr -d ' ')" +assert_contains "one warning names the old personal override" "$(errs)" "$REPO/.claude/testing.local.yaml is an old location" +assert_eq "three warnings, one line each" 3 "$(errs | wc -l | tr -d ' ')" printf '# Testing\n\nProse only.\n' >"$DOCS" rm -f "$REPO/.claude/testing.yaml" "$REPO/.claude/testing.local.yaml" assert_eq "a docs file of prose with no block draws no warning" "" "$(errs)" @@ -414,16 +418,36 @@ assert_eq "userConfig supplies a value when no file sets the key" \ "e2e_driver playwright userConfig reuse_running_instance false userConfig" "$(head -2 <<<"$out")" printf 'e2e_driver: run\n' >"$HOME/.claude/testing.yaml" +erun +assert_eq "the old user-global file still applies where userConfig sets nothing" "e2e_driver run $HOME/.claude/testing.yaml" "$(head -1 <<<"$out")" +assert_eq "with one warning naming it and where to move it" \ + "resolve-config: warning: $HOME/.claude/testing.yaml is an old location, still read for now: there is no user-global file layer; move each setting to its testing userConfig option, else to docs/conventions/testing.local.yaml" "$err" +erun --user e2e_driver=auto +assert_eq "a userConfig value equal to the default does not hide it" "e2e_driver run $HOME/.claude/testing.yaml" "$(head -1 <<<"$out")" erun --user e2e_driver=playwright -assert_eq "the user-global file wins over userConfig" "e2e_driver run $HOME/.claude/testing.yaml" "$(head -1 <<<"$out")" +assert_eq "userConfig wins over the old user-global file" "e2e_driver playwright userConfig" "$(head -1 <<<"$out")" printf "e2e_driver: 'harness' # the repo's own specs\n" >"$TY" erun --user e2e_driver=playwright -assert_eq "testing.yaml wins over the user-global file" "e2e_driver harness $TY" "$(head -1 <<<"$out")" -printf 'e2e_driver: chrome\r\n' >"$REPO/.claude/testing.local.yaml" +assert_eq "testing.yaml wins over userConfig" "e2e_driver harness $TY" "$(head -1 <<<"$out")" +rm -f "$HOME/.claude/testing.yaml" +PY="$REPO/docs/conventions/testing.local.yaml" +printf 'e2e_driver: chrome\r\n' >"$PY" erun -assert_eq "the personal override wins over testing.yaml (CRLF loads)" "e2e_driver chrome $REPO/.claude/testing.local.yaml" "$(head -1 <<<"$out")" +assert_eq "the personal override wins over testing.yaml (CRLF loads)" "e2e_driver chrome $PY" "$(head -1 <<<"$out")" assert_eq "with nothing on stderr" "" "$err" -rm -f "$REPO/.claude/testing.local.yaml" "$HOME/.claude/testing.yaml" +printf 'e2e_driver: run\nreuse_running_instance: true\n' >"$REPO/.claude/testing.local.yaml" +erun +assert_eq "beside the home file, the old personal override is not read" \ + "e2e_driver chrome $PY +reuse_running_instance auto default" "$(head -2 <<<"$out")" +assert_eq "and one warning names both" \ + "resolve-config: warning: $PY and $REPO/.claude/testing.local.yaml both exist; using $PY, ignoring the old file: move any setting it still holds into $PY" "$err" +rm -f "$PY" +erun +assert_eq "alone, the old personal override still applies" "e2e_driver run $REPO/.claude/testing.local.yaml" "$(head -1 <<<"$out")" +assert_contains "with a warning naming where to move it" "$err" \ + "$REPO/.claude/testing.local.yaml is an old location, still read for now; move it to docs/conventions/testing.local.yaml" +rm -f "$REPO/.claude/testing.local.yaml" # An invalid value never stops the run: the file, key and value are named, and # the key takes its default, never a lower layer's value. @@ -432,11 +456,11 @@ erun --user e2e_driver=playwright assert_eq "an unknown value in testing.yaml exits 0" 0 "$rc" assert_eq "and resolves the default, not the lower userConfig value" "e2e_driver auto default" "$(head -1 <<<"$out")" assert_contains "naming the file, key and value" "$err" "$TY: e2e_driver: unknown value 'cdp'" -printf 'e2e_driver: run\n' >"$REPO/.claude/testing.local.yaml" +printf 'e2e_driver: run\n' >"$PY" erun -assert_eq "a valid higher layer still wins over an invalid one" "e2e_driver run $REPO/.claude/testing.local.yaml" "$(head -1 <<<"$out")" +assert_eq "a valid higher layer still wins over an invalid one" "e2e_driver run $PY" "$(head -1 <<<"$out")" assert_eq "and the lower layer is never read" "" "$err" -rm -f "$REPO/.claude/testing.local.yaml" +rm -f "$PY" erun --user 'reuse_running_instance=maybe' assert_eq "an unknown userConfig value resolves the default" "reuse_running_instance auto default" "$(sed -n 2p <<<"$out")" assert_contains "naming userConfig" "$err" "userConfig: reuse_running_instance: unknown value 'maybe'" @@ -486,7 +510,7 @@ rm -f "$REPO/.claude/testing.local.yaml" # feature_map_dir is retired: a line left in a layer resolves nothing, warns # nothing and stops neither mode. printf 'feature_map_dir: docs/map\npaths:\n exclude: [e2e-file/**]\n' >"$TY" -printf 'feature_map_dir: .claude/skills/feature-map\n' >"$REPO/.claude/testing.local.yaml" +printf 'feature_map_dir: .claude/skills/feature-map\n' >"$PY" erun assert_eq "a leftover feature_map_dir prints only the other keys" \ "0:e2e_driver auto default @@ -496,7 +520,7 @@ assert_eq "and warns nothing" "" "$err" run assert_eq "nor stops the scan config" "0:e2e-file/**" "$rc:$(records paths.exclude)" assert_eq "which prints no record for it" "" "$(records feature_map_dir)" -rm -f "$REPO/.claude/testing.local.yaml" "$TY" +rm -f "$PY" "$TY" # browser_driver: one command name, same layer order as e2e_driver. bd() { grep '^browser_driver ' <<<"$out"; } @@ -695,6 +719,33 @@ erun --user other_key=x assert_eq "--user names only a run-e2e key" 2 "$rc" reset +# --- the layers under a bound convention home --------------------------------- +mkdir -p "$REPO/config" +printf '\nTeam conventions live in `config`.\n\n' >"$REPO/AGENTS.md" +printf 'paths:\n exclude: [bound-team/**]\n' >"$REPO/config/testing.yaml" +printf 'paths:\n exclude: [bound-personal/**]\ne2e_driver: chrome\n' >"$REPO/config/testing.local.yaml" +printf 'paths:\n exclude: [unbound/**]\n' >"$REPO/docs/conventions/testing.yaml" +run +assert_eq "the bound home supplies the team layer and the personal override" \ + "0:$REPO/config/testing.yaml $REPO/config/testing.local.yaml" "$rc:$(records layer)" +assert_eq "and docs/conventions is not read" "bound-team/** bound-personal/**" "$(records paths.exclude)" +assert_eq "with no warning" "" "$(errs)" +erun +assert_eq "the e2e keys read the bound home too" "e2e_driver chrome $REPO/config/testing.local.yaml" "$(head -1 <<<"$out")" +rm -f "$REPO/config/testing.yaml" "$REPO/config/testing.local.yaml" +printf 'rules:\n rule-zero-assertion: warn\n' >"$REPO/.claude/testing.local.yaml" +run +assert_eq "an old personal override alone still applies" "0:warn" "$rc:$(records rules.zero-assertion)" +assert_contains "naming the bound home as where to move it" "$(errs)" "move it to config/testing.local.yaml" +printf '\nTeam conventions live in `missing`.\n\n' >"$REPO/AGENTS.md" +run +assert_eq "a broken convention-home pointer stops the scan config" 2 "$rc" +erun +assert_eq "but never the e2e keys" "0:e2e_driver auto default" "$rc:$(head -1 <<<"$out")" +assert_contains "which name it" "$err" "the convention-home pointer in $REPO does not resolve" +rm -rf "$REPO/AGENTS.md" "$REPO/config" +reset + # --- the whole suite again under mawk ----------------------------------------- if [[ -z "${TCFG_TEST_MAWK_LEG:-}" ]] && command -v mawk >/dev/null 2>&1; then mkdir -p "$T/mawk-shim" diff --git a/plugins/testing/skills/audit/scripts/cant-fail-scan.sh b/plugins/testing/skills/audit/scripts/cant-fail-scan.sh index 12329fbc14d..efa8d087239 100755 --- a/plugins/testing/skills/audit/scripts/cant-fail-scan.sh +++ b/plugins/testing/skills/audit/scripts/cant-fail-scan.sh @@ -393,7 +393,7 @@ REPO_PREFIX="${REPO_PREFIX//$'\r'/}" CFG_ROOT="${TOP:-${CLAUDE_PROJECT_DIR:-$ROOT}}" tc_layers=0 tc_read=0 for f in ${HOME:+"$HOME/.claude/testing.yaml"} "$CFG_ROOT/docs/conventions/testing.yaml" "$CFG_ROOT/docs/conventions/testing.md" \ - "$CFG_ROOT/.claude/testing.yaml" "$CFG_ROOT/.claude/testing.local.yaml"; do + "$CFG_ROOT/docs/conventions/testing.local.yaml" "$CFG_ROOT/.claude/testing.yaml" "$CFG_ROOT/.claude/testing.local.yaml"; do [[ -f "$f" ]] && tc_layers=$((tc_layers + 1)) done tc_extra=() diff --git a/plugins/testing/skills/run-e2e/context/e2e-config.md b/plugins/testing/skills/run-e2e/context/e2e-config.md index 976aeb2a942..24590848412 100644 --- a/plugins/testing/skills/run-e2e/context/e2e-config.md +++ b/plugins/testing/skills/run-e2e/context/e2e-config.md @@ -124,10 +124,10 @@ any file layer, and "drive it with playwright" overrides `e2e_driver`. authority first: 1. Explicit session prompt -2. Personal override (`.claude/testing.local.yaml`) -3. Team (`docs/conventions/testing.yaml`) -4. User-global (`~/.claude/testing.yaml`) -5. The plugin `userConfig` option of the same name +2. Personal override (`/testing.local.yaml`, else the old `.claude/testing.local.yaml`) +3. Team (`/testing.yaml`; `` is `docs/conventions` unless the repository binds another) +4. The plugin `userConfig` option of the same name, when set to a value other than its default +5. The old user-global file (`~/.claude/testing.yaml`) 6. Bundled default (`auto` for the first two, `playwright-cli` for `browser_driver`, and each `map` key's default in [map.md](map.md)) diff --git a/plugins/testing/skills/setup/scripts/setup.sh b/plugins/testing/skills/setup/scripts/setup.sh index 12d661b0986..db2da028518 100755 --- a/plugins/testing/skills/setup/scripts/setup.sh +++ b/plugins/testing/skills/setup/scripts/setup.sh @@ -13,11 +13,12 @@ # hook-entry that test-quality findings come from /testing:audit, and # each consumer glob the shipped test-weaken rows skip # apply writes the answer flags to the team layer in use: the whole of -# /docs/conventions/testing.yaml when it exists (its top-level run-e2e +# //testing.yaml when it exists (its top-level run-e2e # keys are kept), else the body of the config block in -# /docs/conventions/testing.md when that file holds one (its other text +# //testing.md when that file holds one (its other text # stays), else the whole of /.claude/testing.yaml when it exists, else a -# new /docs/conventions/testing.yaml. It keeps the result only when it +# new //testing.yaml. is the convention home the pointer +# region binds, else docs/conventions. It keeps the result only when it # resolves, writes no other file, and refuses when the target or its directory # is a symlink. # @@ -65,6 +66,14 @@ if [[ -z "$ROOT" ]]; then [[ -n "$ROOT" ]] || die "not inside a git repository and no --root given" fi [[ -d "$ROOT" ]] || die "--root '$ROOT' is not a directory" +HOME_REL=docs/conventions +home_rc=0 +bound="$(bash "$PLUGIN/lib/resolve-convention-home.sh" --root "$ROOT" 2>/dev/null)" || home_rc=$? +case "$home_rc" in +0) HOME_REL="${bound//$'\r'/}" ;; +1 | 4 | 5) ;; +*) die "the convention-home pointer in $ROOT does not resolve (resolve-convention-home.sh exit $home_rc)" ;; +esac # q : a single-quoted YAML scalar. q() { printf "'%s'" "${1//\'/\'\'}"; } @@ -78,10 +87,10 @@ flow() { plain_text() { LC_ALL=C sed -e $'1s/^\xef\xbb\xbf//' -e 's/\r$//' "$1"; } apply() { - local new="$ROOT/docs/conventions/testing.yaml" docs="$ROOT/docs/conventions/testing.md" yaml="$ROOT/.claude/testing.yaml" + local new="$ROOT/$HOME_REL/testing.yaml" docs="$ROOT/$HOME_REL/testing.md" yaml="$ROOT/.claude/testing.yaml" local d f bak="" tmp y="" e id field r blk from="" to="" l keep="" # Refuse a linked docs file before the loader reads it. - for l in "$ROOT/docs" "$ROOT/docs/conventions" "$docs" "$new"; do + for l in "$ROOT/${HOME_REL%%/*}" "$ROOT/$HOME_REL" "$docs" "$new"; do [[ ! -L "$l" ]] || die "refusing to read or write through a symlink: $l" done # A flag value is one line: a newline would end the fenced block early. From 5e5c931fe83301ae9e48961b3de910e90d27cd93 Mon Sep 17 00:00:00 2001 From: "melodic-automation-lanes[bot]" <337595936+melodic-automation-lanes[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 23:33:01 +0000 Subject: [PATCH 2/2] Address review feedback on work-resolve-issue/issue-18050-44959670298-1 Lane-Activity: pr-unblock/address-feedback Lane-Thread: PRRT_kwDOTCGFQM66dlZV --- plugins/testing/hooks/judge-lib.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/testing/hooks/judge-lib.sh b/plugins/testing/hooks/judge-lib.sh index 780b1091ab8..44dad0a50d1 100755 --- a/plugins/testing/hooks/judge-lib.sh +++ b/plugins/testing/hooks/judge-lib.sh @@ -241,10 +241,11 @@ judge::drop() { # # The result is cached under derive/, keyed by the sha256 of the info, this # hook directory (so a plugin update re-derives), the file's current content -# and each testing config file (docs/conventions/testing.yaml and .md, and the -# .claude/testing.yaml layers): block identity is name and ordinal in the -# current text, so the same inputs give the same keys and the scanner runs -# again only when one of them changed. A scan that failed is never cached. +# and each testing config file (docs/conventions/testing.yaml, .md and +# .local.yaml, and the .claude/testing.yaml layers; the same list the +# scanner's own pre-check in skills/audit/scripts/cant-fail-scan.sh tests): +# block identity is name and ordinal in the current text, so the same inputs +# give the same keys and the scanner runs again only when one of them changed. A scan that failed is never cached. judge::derive() { local file whole base_ok names lines tmpd rc n=0 re line cur marks=() b s e o name keep m text=() i b_start b_end local root cfg cfgs=() key="" h cache c=() @@ -259,7 +260,8 @@ judge::derive() { fi judge::file_repo "$file" root="${FREPO:-${CLAUDE_PROJECT_DIR:-}}" - for cfg in "${HOME:-}/.claude/testing.yaml" "$root/docs/conventions/testing.yaml" "$root/docs/conventions/testing.md" "$root/.claude/testing.yaml" "$root/.claude/testing.local.yaml"; do + for cfg in "${HOME:-}/.claude/testing.yaml" "$root/docs/conventions/testing.yaml" "$root/docs/conventions/testing.md" \ + "$root/docs/conventions/testing.local.yaml" "$root/.claude/testing.yaml" "$root/.claude/testing.local.yaml"; do [[ -f "$cfg" ]] && cfgs+=("$cfg") done # sha256sum prefixes a line with \ when the file name holds a backslash.