Skip to content

Commit 3cc8417

Browse files
committed
Release dev.kit 0.13.0
1 parent 1868279 commit 3cc8417

10 files changed

Lines changed: 114 additions & 24 deletions

File tree

.rabbit/context.yaml

Lines changed: 2 additions & 16 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.12.0
9-
generated_at: 2026-05-27T09:28:30Z
8+
version: 0.13.0
9+
generated_at: 2026-05-27T18:39:54Z
1010
sources:
1111
homepage: https://udx.dev/kit
1212
repository: https://github.com/udx/dev.kit
@@ -56,20 +56,6 @@ commands:
5656
run: make run
5757
source: docs/references/command-surfaces.md
5858

59-
# Gaps — Factors that are missing or only partially supported by current repo signals.
60-
# Note: Base the result on explicit factor rules, not free-form judgment.
61-
# Note: Include message and evidence so the status can be reviewed.
62-
# Note: Prefer traceable refs and missing signals over vague advice.
63-
64-
gaps:
65-
- factor: config
66-
status: partial
67-
message: Found config-bearing repo assets in deploy.yml, but no canonical checked-in config contract is declared yet.
68-
repair_target: deploy.yml or .env.example
69-
reference: docs/references/config-contract-surfaces.md
70-
evidence:
71-
- runtime config: deploy.yml
72-
7359
# Dependencies — Meaningful dependency-repo contracts such as reusable workflows, images, or versioned manifests this repo relies on.
7460
# Note: Capture execution-shaping behavior defined outside the current checkout.
7561
# Note: Avoid promoting standard package inventory or ordinary GitHub action refs into top-level context.

changes.md

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

3+
### 0.13.0
4+
5+
- Allow repo-owned manifests to satisfy config contract coverage when they declare explicit config contract metadata or runtime config sections, avoiding forced `.env.example` files for repos with custom manifest contracts.
6+
37
### 0.12.0
48

59
- Add generator source refs to `.rabbit/context.yaml` so generated context points to the dev.kit homepage, source repo, npm package, and installation guide.

deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ config:
1111
command: "/bin/bash"
1212
args:
1313
- "/workspace/tests/suite.sh"
14-

docs/context-coverage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ gaps:
7979
message: No explicit configuration contract was detected.
8080
```
8181
82-
That should lead to a repo change such as adding config docs, manifest metadata, or a checked-in example file, then regenerating context.
82+
That should lead to a repo change such as adding config docs, adding explicit manifest metadata, declaring runtime config sections in a repo-owned manifest, or adding a checked-in example file, then regenerating context.
8383
8484
## What Does Not Belong There
8585

docs/references/config-contract-surfaces.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Configuration is often declared through:
1111
- `.env.example`, `.env.sample`, or `.env.template`
1212
- focused repo docs such as `README.md` or `docs/config.md`
1313
- deploy manifests such as `deploy.yml`
14-
- versioned YAML/JSON manifests with explicit config metadata
14+
- versioned YAML/JSON manifests with explicit config metadata or runtime config sections
1515
- checked-in example config files when the repo uses a custom format
1616

1717
## Build defaults and runtime overlays
@@ -26,6 +26,8 @@ Example pattern:
2626

2727
That is still one coherent repo contract as long as the split is explicit and checked in.
2828

29+
Custom manifests should not rely on filename rules. For YAML manifests, `dev.kit` treats explicit contract metadata such as `contract: config` or runtime config sections such as `config.env`, `config.environment`, `config.image`, `config.command`, or top-level `env`/`variables`/`settings` as configuration contract evidence.
30+
2931
## Practical rule
3032

3133
When config gaps are detected:

lib/modules/repo_factors.sh

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,89 @@ dev_kit_repo_has_meaningful_dependency_contract() {
5454
return 1
5555
}
5656

57+
dev_kit_manifest_declares_config_contract() {
58+
local manifest_path="$1"
59+
60+
[ -f "$manifest_path" ] || return 1
61+
62+
awk '
63+
/^[[:space:]]*#/ { next }
64+
/^[^[:space:]][^:]*:/ {
65+
in_contracts = 0
66+
in_config = 0
67+
}
68+
/^[[:space:]]*contracts:[[:space:]]*$/ {
69+
in_contracts = 1
70+
next
71+
}
72+
/^[[:space:]]*contracts:[[:space:]]*/ {
73+
value = $0
74+
sub(/^[[:space:]]*contracts:[[:space:]]*/, "", value)
75+
gsub(/["'\''\[\],]/, " ", value)
76+
if (value ~ /(^|[[:space:]])config([[:space:]]|$)/) {
77+
found = 1
78+
}
79+
in_contracts = 0
80+
next
81+
}
82+
/^[[:space:]]*contract:[[:space:]]*/ {
83+
value = $0
84+
sub(/^[[:space:]]*contract:[[:space:]]*/, "", value)
85+
gsub(/["'\''\[\],]/, " ", value)
86+
if (value ~ /(^|[[:space:]])config([[:space:]]|$)/) {
87+
found = 1
88+
}
89+
next
90+
}
91+
in_contracts && /^[[:space:]]*-[[:space:]]*/ {
92+
value = $0
93+
sub(/^[[:space:]]*-[[:space:]]*/, "", value)
94+
gsub(/["'\'',]/, " ", value)
95+
if (value ~ /(^|[[:space:]])config([[:space:]]|$)/) {
96+
found = 1
97+
}
98+
next
99+
}
100+
/^[[:space:]]*config:[[:space:]]*$/ {
101+
in_config = 1
102+
next
103+
}
104+
/^[[:space:]]*(env|environment|secrets|variables|settings):[[:space:]]*/ {
105+
found = 1
106+
next
107+
}
108+
in_config && /^[[:space:]]+[A-Za-z0-9_.-]+:[[:space:]]*/ {
109+
value = $0
110+
sub(/^[[:space:]]+/, "", value)
111+
sub(/:.*/, "", value)
112+
if (value ~ /^(env|environment|secrets|variables|settings|image|images|container|containers|service|services|command|args|volumes)$/) {
113+
found = 1
114+
}
115+
next
116+
}
117+
END { exit(found ? 0 : 1) }
118+
' "$manifest_path"
119+
}
120+
121+
dev_kit_repo_config_contract_manifest_files() {
122+
local repo_dir="$1"
123+
local path=""
124+
125+
while IFS= read -r path; do
126+
[ -n "$path" ] || continue
127+
if dev_kit_manifest_declares_config_contract "${repo_dir}/${path}"; then
128+
printf '%s\n' "$path"
129+
fi
130+
done <<EOF
131+
$(dev_kit_repo_contract_manifest_files "$repo_dir")
132+
EOF
133+
}
134+
135+
dev_kit_repo_has_config_contract_manifest() {
136+
local repo_dir="$1"
137+
[ -n "$(dev_kit_repo_config_contract_manifest_files "$repo_dir")" ]
138+
}
139+
57140
dev_kit_repo_factor_applicable() {
58141
local repo_dir="$1"
59142
local factor="$2"
@@ -120,7 +203,8 @@ _dev_kit_repo_factor_status_compute() {
120203
fi
121204
;;
122205
config)
123-
if dev_kit_repo_has_any_file_from_list "$repo_dir" "config_contract_files"; then
206+
if dev_kit_repo_has_any_file_from_list "$repo_dir" "config_contract_files" || \
207+
dev_kit_repo_has_config_contract_manifest "$repo_dir"; then
124208
printf "%s" "present"
125209
elif dev_kit_repo_has_any_file_from_list "$repo_dir" "config_runtime_files" || dev_kit_repo_documented_env_var "$repo_dir"; then
126210
printf "%s" "partial"
@@ -230,6 +314,13 @@ EOF
230314
fi
231315
done <<EOF
232316
$(dev_kit_detection_list "config_contract_files")
317+
EOF
318+
while IFS= read -r path; do
319+
[ -n "$path" ] || continue
320+
evidence="${evidence}config contract manifest: ${path}
321+
"
322+
done <<EOF
323+
$(dev_kit_repo_config_contract_manifest_files "$repo_dir")
233324
EOF
234325
while IFS= read -r path; do
235326
[ -n "$path" ] || continue

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.12.0",
3+
"version": "0.13.0",
44
"description": "Context-driven engineering toolkit for AI agents and developers",
55
"license": "MIT",
66
"repository": {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
kind: workerDeployConfig
12
version: udx.io/worker-v1/deploy
23

3-
service:
4+
config:
45
image: "acme/docker-repo:latest"

tests/suite.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ DEV_KIT_BIN_DIR="$TEST_HOME/.local/bin"
104104
mkdir -p "$DEV_KIT_BIN_DIR"
105105
ln -sf "$REPO_DIR/bin/dev-kit" "$DEV_KIT_BIN_DIR/dev.kit"
106106
export PATH="$DEV_KIT_BIN_DIR:$PATH"
107+
assert_contains "$(command -v dev.kit)" "$DEV_KIT_BIN_DIR/dev.kit" "suite: uses local dev.kit shim"
108+
assert_contains "$(dev.kit --version)" "$(awk -F'"' '/"version"/{print $4; exit}' "$REPO_DIR/package.json")" "suite: uses checkout dev.kit version"
107109

108110
# shellcheck disable=SC1090
109111
. "$DEV_KIT_HOME/bin/env/dev-kit.sh"
@@ -146,6 +148,8 @@ if should_run_explicit "repo-contract"; then
146148

147149
docker_repo_json="$(cd "$DOCKER_ACTION_REPO" && dev.kit repo --json)"
148150
assert_contains "$docker_repo_json" "\"context\":" "repo contract: docker repo reports context path"
151+
assert_contains "$docker_repo_json" "\"status\": \"present\"" "repo contract: reports present factors"
152+
assert_contains "$docker_repo_json" "config contract manifest: deploy.yml" "repo contract: manifest config shape satisfies config contract"
149153

150154
docker_context_yaml="${DOCKER_ACTION_REPO}/.rabbit/context.yaml"
151155
assert_contains "$(cat "$docker_context_yaml")" "path: deploy.yml" "repo contract: includes deploy manifest"
@@ -364,6 +368,8 @@ if should_run "core"; then
364368

365369
docker_repo_json="$(cd "$DOCKER_ACTION_REPO" && dev.kit repo --json)"
366370
assert_contains "$docker_repo_json" "\"context\":" "docker repo: reports context path"
371+
assert_contains "$docker_repo_json" "\"status\": \"present\"" "docker repo: reports present factors"
372+
assert_contains "$docker_repo_json" "config contract manifest: deploy.yml" "docker repo: manifest config shape satisfies config contract"
367373

368374
docker_context_yaml="${DOCKER_ACTION_REPO}/.rabbit/context.yaml"
369375
assert_contains "$(cat "$docker_context_yaml")" "generator:" "docker repo: includes generator metadata"
@@ -392,6 +398,7 @@ EOF
392398

393399
ignored_repo_json="$(cd "$IGNORED_ACTION_REPO" && dev.kit repo --json)"
394400
assert_contains "$ignored_repo_json" "\"context\":" "ignored repo: reports context path"
401+
assert_contains "$ignored_repo_json" "no canonical checked-in config contract is declared yet" "ignored repo: deploy filename alone does not satisfy config contract"
395402
ignored_context_yaml="${IGNORED_ACTION_REPO}/.rabbit/context.yaml"
396403
assert_not_contains "$(cat "$ignored_context_yaml")" ".next/cache/reference.txt" "ignored repo: excludes gitignored artifact references"
397404

0 commit comments

Comments
 (0)