Skip to content

Commit 586783d

Browse files
authored
Merge pull request #30 from udx/fix/post-0.20-copilot-followups
Prepare dev.kit 0.20.1 context scaffold fixes
2 parents 3f82ee0 + c7a33ee commit 586783d

9 files changed

Lines changed: 83 additions & 12 deletions

File tree

.rabbit/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Rabbit Context
2+
3+
This directory keeps Rabbit-facing repo context and generated `dev.kit` evidence.
4+
5+
- `context.yaml` is generated by `dev.kit repo`; do not edit it manually.
6+
- Keep human-authored Rabbit CI notes, delivery entry points, and repo-specific workflow guidance in this README.
7+
- After changing repo docs, manifests, scripts, or workflows, run `dev.kit repo` to refresh generated context.

.rabbit/context.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ version: udx.dev/dev.kit/v1
55
generator:
66
tool: dev.kit
77
repo: https://github.com/udx/dev.kit
8-
version: 0.20.0
9-
generated_at: 2026-07-08T15:15:15Z
8+
version: 0.20.1
9+
generated_at: 2026-07-10T09:48:47Z
1010
sources:
1111
homepage: https://udx.dev/kit
1212
repository: https://github.com/udx/dev.kit

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
<https://udx.dev/kit>
44

5-
`dev.kit` turns repositories into self-explaining repo contracts for humans, scripts, and CI/CD.
5+
`dev.kit` provides repo context coverage for every handoff.
6+
7+
It reads repo-owned docs, manifests, workflows, commands, dependencies, and gaps, then writes `.rabbit/context.yaml` so humans, agents, scripts, and CI/CD systems such as Rabbit CI can work from the same declared contract.
68

79
It helps teams and repositories:
810

911
1. understand how the repo actually works
1012
2. keep repo standards, manifests, refs, and dependency contracts traceable
11-
3. regenerate reliable context from repo signals instead of tribal knowledge
13+
3. regenerate reliable handoff context from repo signals instead of tribal knowledge
1214

1315
The model is:
1416

changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes
22

3+
### 0.20.1
4+
5+
- Keep declared root YAML contract discovery aligned with repo file filtering so gitignored local/private YAML is not promoted into generated context.
6+
- Seed missing `.rabbit/README.md` files so repos initialized by `dev.kit repo` have a clear Rabbit-facing notes surface without adding a generic `docs/README.md` stub.
7+
38
### 0.20.0
49

510
- Discover root YAML config contracts from explicit top-level `contract` / `contracts` metadata or typed `kind` + `version` manifests instead of filename-specific allowlists.

docs/how-it-works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How It Works
22

3-
`dev.kit` turns repo-declared structure into a working repo contract.
3+
`dev.kit` turns repo-declared structure into context coverage for repo handoffs.
44

55
The default starting point is:
66

lib/modules/repo_scaffold.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ This repository uses \`dev.kit\` for repo-driven context coverage.
2626
2727
- Run \`dev.kit\` to inspect environment and repo context status
2828
- Run \`dev.kit repo\` to regenerate \`.rabbit/context.yaml\`
29+
"
30+
31+
dev_kit_repo_write_if_missing "${repo_root}/.rabbit/README.md" "# Rabbit Context
32+
33+
This directory keeps Rabbit-facing repo context and generated \`dev.kit\` evidence.
34+
35+
- \`context.yaml\` is generated by \`dev.kit repo\`; do not edit it manually.
36+
- Keep human-authored Rabbit CI notes, delivery entry points, and repo-specific workflow guidance in this README.
37+
- After changing repo docs, manifests, scripts, or workflows, run \`dev.kit repo\` to refresh generated context.
2938
"
3039

3140
dev_kit_repo_write_if_missing "${repo_root}/.github/dependabot.yml" "version: 2
@@ -293,9 +302,21 @@ EOF
293302

294303
dev_kit_repo_declared_root_contract_manifest_files() {
295304
local repo_root="$1"
305+
local candidate_files=""
296306
local manifest_path=""
297307
local manifest_rel=""
298308

309+
if dev_kit_sync_has_git_repo "$repo_root"; then
310+
candidate_files="$(
311+
(
312+
cd "$repo_root" &&
313+
git ls-files -z --cached --others --exclude-standard -- '*.yaml' '*.yml' 2>/dev/null
314+
) | tr '\0' '\n' | awk -v repo_root="$repo_root" 'NF && $0 !~ /\// && $0 !~ /^\./ { printf "%s/%s\n", repo_root, $0 }' | sort
315+
)"
316+
else
317+
candidate_files="$(find "$repo_root" -maxdepth 1 -type f \( -name '*.yaml' -o -name '*.yml' \) 2>/dev/null | sort)"
318+
fi
319+
299320
while IFS= read -r manifest_path; do
300321
[ -f "$manifest_path" ] || continue
301322
manifest_rel="${manifest_path#"${repo_root}/"}"
@@ -310,7 +331,7 @@ dev_kit_repo_declared_root_contract_manifest_files() {
310331
printf '%s\n' "$manifest_rel"
311332
fi
312333
done <<EOF
313-
$(find "$repo_root" -maxdepth 1 -type f \( -name '*.yaml' -o -name '*.yml' \) 2>/dev/null | sort)
334+
$candidate_files
314335
EOF
315336
}
316337

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@udx/dev-kit",
3-
"version": "0.20.0",
3+
"version": "0.20.1",
44
"description": "Context-driven engineering toolkit for AI agents and developers",
55
"license": "MIT",
66
"repository": {

tests/suite.sh

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ DOCUMENTED_SHELL_REPO="$REPO_DIR/tests/fixtures/documented-shell-repo"
1212
DOCKER_REPO="$REPO_DIR/tests/fixtures/docker-repo"
1313
SIMPLE_ACTION_REPO="$TEST_HOME/simple-action-repo"
1414
HOME_ACTION_REPO="$TEST_HOME/home-action-repo"
15+
DOCUMENTED_SHELL_ACTION_REPO="$TEST_HOME/documented-shell-action-repo"
1516
DOCKER_ACTION_REPO="$TEST_HOME/docker-action-repo"
1617
EMPTY_REPO="$TEST_HOME/empty-repo"
1718
IGNORED_ACTION_REPO="$TEST_HOME/ignored-action-repo"
1819
WORKFLOW_CONTRACT_REPO="$TEST_HOME/workflow-contract-repo"
1920
DECLARED_CONFIG_REPO="$TEST_HOME/declared-config-repo"
2021
REFERENCE_DOC_COMMAND_REPO="$TEST_HOME/reference-doc-command-repo"
22+
PRESERVED_RABBIT_REPO="$TEST_HOME/preserved-rabbit-repo"
2123
AVAILABLE_TEST_GROUPS="core repo-contract"
2224
TEST_ONLY="${DEV_KIT_TEST_ONLY:-}"
2325

@@ -115,6 +117,9 @@ setup_declared_config_repo() {
115117
# Declared Config Repo
116118
117119
Runtime variables are declared in `work-conf.yaml`.
120+
EOF
121+
cat > "$repo_dir/.gitignore" <<'EOF'
122+
local-private.yaml
118123
EOF
119124
cat > "$repo_dir/work-conf.yaml" <<'EOF'
120125
---
@@ -134,6 +139,13 @@ contract:
134139
purpose: local automation interface notes
135140
refs:
136141
- README.md
142+
EOF
143+
cat > "$repo_dir/local-private.yaml" <<'EOF'
144+
---
145+
kind: localPrivateConfig
146+
version: example.dev/private-v1/config
147+
config:
148+
env: {}
137149
EOF
138150
cat > "$repo_dir/source-notes.yaml" <<'EOF'
139151
# Source notes with references are useful context, but not a manifest contract.
@@ -235,6 +247,7 @@ if should_run_explicit "repo-contract"; then
235247
declared_config_dependencies="$(awk '/^dependencies:/{flag=1;next} /^# /{if(flag) exit} flag{print}' "$declared_config_context_yaml")"
236248
assert_contains "$declared_config_dependencies" "repo: example/runtime" "repo contract: traces declared root YAML manifest owner as dependency"
237249
assert_not_contains "$(cat "$declared_config_context_yaml")" "path: source-notes.yaml" "repo contract: does not promote source comments alone to manifest"
250+
assert_not_contains "$(cat "$declared_config_context_yaml")" "path: local-private.yaml" "repo contract: excludes gitignored root YAML contracts"
238251
fi
239252

240253
if should_run "core"; then
@@ -382,7 +395,9 @@ if should_run "core"; then
382395
assert_contains "$env_json" "\"command\": \"env\"" "env: reports command name"
383396
assert_contains "$env_json" "\"workflow\": {" "env: reports workflow contract"
384397

385-
repo_json="$(cd "$DOCUMENTED_SHELL_REPO" && dev.kit repo --json)"
398+
cp -R "$DOCUMENTED_SHELL_REPO" "$DOCUMENTED_SHELL_ACTION_REPO"
399+
400+
repo_json="$(cd "$DOCUMENTED_SHELL_ACTION_REPO" && dev.kit repo --json)"
386401
assert_contains "$repo_json" "\"archetype\":" "repo: reports archetype"
387402
assert_contains "$repo_json" "\"context\":" "repo: reports context path"
388403
assert_contains "$repo_json" "\"context_status\": \"current\"" "repo: reports current workflow context after write"
@@ -391,7 +406,7 @@ if should_run "core"; then
391406
assert_contains "$repo_json" "\"id\": \"confirm-research-fix-loop\"" "repo: includes confirmation loop action"
392407
assert_contains "$repo_json" "\"workflow\": {" "repo: reports workflow contract"
393408

394-
repo_text="$(cd "$DOCUMENTED_SHELL_REPO" && dev.kit repo)"
409+
repo_text="$(cd "$DOCUMENTED_SHELL_ACTION_REPO" && dev.kit repo)"
395410
assert_contains "$repo_text" "[workflow]" "repo text: renders workflow section"
396411
assert_contains "$repo_text" "[read first]" "repo text: renders read first section"
397412
assert_contains "$repo_text" "[factors]" "repo text: renders factors section"
@@ -407,7 +422,7 @@ if should_run "core"; then
407422
printf 'boom\n' >&2
408423
return 42
409424
}
410-
dev_kit_cmd_repo text "$DOCUMENTED_SHELL_REPO" 2>&1
425+
dev_kit_cmd_repo text "$DOCUMENTED_SHELL_ACTION_REPO" 2>&1
411426
)"
412427
repo_write_failure_status=$?
413428
set -e
@@ -504,6 +519,7 @@ EOF
504519
declared_config_dependencies="$(awk '/^dependencies:/{flag=1;next} /^# /{if(flag) exit} flag{print}' "$declared_config_context_yaml")"
505520
assert_contains "$declared_config_dependencies" "repo: example/runtime" "declared config repo: traces explicit root YAML manifest owner as dependency"
506521
assert_not_contains "$(cat "$declared_config_context_yaml")" "path: source-notes.yaml" "declared config repo: does not promote source comments alone to manifest"
522+
assert_not_contains "$(cat "$declared_config_context_yaml")" "path: local-private.yaml" "declared config repo: excludes gitignored root YAML contracts"
507523

508524
mkdir -p "$WORKFLOW_CONTRACT_REPO/.github/workflows"
509525
git -C "$WORKFLOW_CONTRACT_REPO" init >/dev/null 2>&1
@@ -558,6 +574,22 @@ EOF
558574
assert_not_contains "$(cat "$reference_doc_context_yaml")" "run: make build" "reference docs repo: ignores reference-only build example"
559575
assert_not_contains "$(cat "$reference_doc_context_yaml")" "run: make run" "reference docs repo: ignores reference-only run example"
560576

577+
mkdir -p "$PRESERVED_RABBIT_REPO/.rabbit" "$PRESERVED_RABBIT_REPO/docs"
578+
git -C "$PRESERVED_RABBIT_REPO" init >/dev/null 2>&1
579+
cat > "$PRESERVED_RABBIT_REPO/README.md" <<'EOF'
580+
# Preserved Rabbit Docs Repo
581+
EOF
582+
cat > "$PRESERVED_RABBIT_REPO/.rabbit/README.md" <<'EOF'
583+
# Existing Rabbit Notes
584+
585+
Keep this repo-specific Rabbit CI guidance.
586+
EOF
587+
preserved_rabbit_json="$(cd "$PRESERVED_RABBIT_REPO" && dev.kit repo --json)"
588+
assert_contains "$preserved_rabbit_json" "\"context\":" "preserved rabbit repo: reports context path"
589+
assert_contains "$(cat "$PRESERVED_RABBIT_REPO/.rabbit/README.md")" "Existing Rabbit Notes" "preserved rabbit repo: keeps existing rabbit README"
590+
assert_not_contains "$(cat "$PRESERVED_RABBIT_REPO/.rabbit/README.md")" "This directory keeps Rabbit-facing repo context" "preserved rabbit repo: does not overwrite rabbit README"
591+
assert_file_missing "$PRESERVED_RABBIT_REPO/docs/README.md" "preserved rabbit repo: does not create generic docs README"
592+
561593
mkdir -p "$EMPTY_REPO"
562594
git -C "$EMPTY_REPO" init >/dev/null 2>&1
563595

@@ -573,11 +605,15 @@ EOF
573605

574606
assert_file_exists "$EMPTY_REPO/README.md" "empty repo: creates README"
575607
assert_file_exists "$EMPTY_REPO/docs" "empty repo: creates docs dir"
608+
assert_file_missing "$EMPTY_REPO/docs/README.md" "empty repo: does not create generic docs README"
576609
assert_file_exists "$EMPTY_REPO/.rabbit" "empty repo: creates rabbit dir"
610+
assert_file_exists "$EMPTY_REPO/.rabbit/README.md" "empty repo: creates rabbit README"
577611
assert_file_exists "$EMPTY_REPO/.github/workflows" "empty repo: creates workflows dir"
578612
assert_file_exists "$EMPTY_REPO/.github/dependabot.yml" "empty repo: creates dependabot config"
579613
assert_contains "$(cat "$EMPTY_REPO/.github/dependabot.yml")" "package-ecosystem: github-actions" "empty repo: dependabot targets github actions"
580614
assert_contains "$(cat "$EMPTY_REPO/README.md")" "This repository uses \`dev.kit\`" "empty repo: seeds README"
615+
assert_contains "$(cat "$EMPTY_REPO/.rabbit/README.md")" "Rabbit-facing repo context" "empty repo: seeds rabbit README"
616+
assert_contains "$(cat "$EMPTY_REPO/.rabbit/README.md")" "\`context.yaml\` is generated by \`dev.kit repo\`" "empty repo: explains generated context"
581617
fi
582618

583619
printf "ok - dev.kit suite completed\n"

0 commit comments

Comments
 (0)