Skip to content

Commit e4b4f73

Browse files
committed
Prepare release 0.12.0
1 parent e1a3f46 commit e4b4f73

11 files changed

Lines changed: 295 additions & 15 deletions

File tree

.rabbit/context.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ version: udx.dev/dev.kit/v1
55
generator:
66
tool: dev.kit
77
repo: https://github.com/udx/dev.kit
8-
version: 0.11.0
9-
generated_at: 2026-05-19T18:52:32Z
8+
version: 0.12.0
9+
generated_at: 2026-05-27T09:28:30Z
10+
sources:
11+
homepage: https://udx.dev/kit
12+
repository: https://github.com/udx/dev.kit
13+
package: https://www.npmjs.com/package/@udx/dev-kit
14+
installation: https://github.com/udx/dev.kit/blob/latest/docs/installation.md
1015

1116
repo:
1217
name: dev.kit
@@ -23,6 +28,7 @@ refs:
2328
- ./Makefile
2429
- ./docs/references/command-surfaces.md
2530
- ./docs/real-repo-validation.md
31+
- ./docs/references/output-schemas.md
2632
- ./docs/references/repo-design.md
2733
- ./src/configs/archetypes.yaml
2834
- ./src/configs/audit-rules.yaml
@@ -166,6 +172,7 @@ manifests:
166172
source_repo: udx/worker
167173
used_by:
168174
- Makefile
175+
- docs/context-contract.md
169176
- docs/references/command-surfaces.md
170177
- docs/references/config-contract-surfaces.md
171178
- docs/repo-contract-boundary.md
@@ -176,6 +183,7 @@ manifests:
176183
evidence:
177184
- version: udx.io/worker-v1/deploy
178185
- path reference: Makefile
186+
- path reference: docs/context-contract.md
179187
- path reference: docs/references/command-surfaces.md
180188
- path reference: docs/references/config-contract-surfaces.md
181189
- path reference: docs/repo-contract-boundary.md

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,14 @@ All commands support `--json`.
178178

179179
- [How It Works](docs/how-it-works.md)
180180
- [Repo Contract Boundary](docs/repo-contract-boundary.md)
181+
- [Context Contract](docs/context-contract.md)
181182
- [Environment Config](docs/environment-config.md)
182183
- [Context Coverage](docs/context-coverage.md)
183184
- [Integration](docs/integration.md)
184185
- [Real Repo Validation](docs/real-repo-validation.md)
185186
- [Smart Dependency Detection](docs/smart-dependency-detection.md)
186187
- [Reference Docs](docs/references/README.md)
188+
- [Reference: Output Schemas](docs/references/output-schemas.md)
187189
- [Reference: Command and Workflow Surfaces](docs/references/command-surfaces.md)
188190
- [Reference: Agent and Developer Workflow](docs/references/agent-dev-workflow.md)
189191
- [Reference: Repo Design](docs/references/repo-design.md)

changes.md

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

3+
### 0.12.0
4+
5+
- Add generator source refs to `.rabbit/context.yaml` so generated context points to the dev.kit homepage, source repo, npm package, and installation guide.
6+
- Validate generated context portability before writing it, rejecting machine-local absolute paths and excluding temporary context files from repo evidence.
7+
- Add repo-owned context contract and output schema docs to clarify what dev.kit reads, emits, and must not own.
8+
- Harden guarded command timeouts so child processes are cleaned up by process group without disabling timeout protection.
9+
310
### 0.11.0
411

512
- Expose repo-centric workflow status in `dev.kit`, `dev.kit env`, and `dev.kit repo` output so environment checks, context refresh, and gap repair appear as one repo-owned loop

docs/context-contract.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Context Contract
2+
3+
`dev.kit` is a deterministic repo tool. It reads repo-owned evidence, emits a compact generated contract, and exposes weak coverage so humans, agents, scripts, and CI/CD can work from the same repository state.
4+
5+
The generated contract is `.rabbit/context.yaml`.
6+
7+
## What dev.kit Reads
8+
9+
`dev.kit` should prefer repo-owned surfaces that a maintainer can review and repair:
10+
11+
- `.rabbit/context.yaml` when checking existing generated context state
12+
- `AGENTS.md`, `CLAUDE.md`, and similar repo-owned instruction files
13+
- `README.md`, `changes.md`, and focused docs
14+
- `.github/workflows/`
15+
- manifests such as `deploy.yml`, package manifests, Docker files, and structured YAML configs
16+
- scripts, Makefiles, tests, and checked-in examples that define runnable behavior
17+
18+
Live services such as GitHub issues, PRs, reviews, and workflow runs can help a current task, but they should not become durable repo truth inside `.rabbit/context.yaml`.
19+
20+
## What dev.kit Emits
21+
22+
`.rabbit/context.yaml` should contain generated repo evidence and deterministic interpretation:
23+
24+
- generator metadata, version, source refs, and generation timestamp
25+
- repo identity and archetype
26+
- direct-read refs for humans and agents
27+
- detected verify, build, and run commands with sources
28+
- coverage gaps with evidence and repair targets
29+
- dependency contracts such as reusable workflows, images, and versioned manifests
30+
- manifest inventory with provenance and usage evidence
31+
32+
The artifact should be portable. It must not contain machine-local absolute paths, temp files, cache paths, or generated evidence that only exists on one workstation.
33+
34+
## What dev.kit Must Not Own
35+
36+
`dev.kit` must not become the source of truth for:
37+
38+
- global UDX strategy
39+
- app-specific runtime truth
40+
- secrets, credentials, or local machine state
41+
- issue, PR, or Slack conversation history
42+
- long-form agent prompts or subjective workflow narration
43+
- hand-authored corrections to generated context
44+
45+
If a gap needs durable meaning, repair the owning repo asset and rerun `dev.kit repo`.
46+
47+
## Workflow Boundary
48+
49+
The command surface stays small:
50+
51+
- `dev.kit` inspects environment and repo context status.
52+
- `dev.kit env` reports tool, credential, and capability coverage.
53+
- `dev.kit repo` generates or refreshes `.rabbit/context.yaml`.
54+
55+
Inspection should be read-only unless the command is explicitly a writer. Repair should happen in repo-owned assets, not in generated output.
56+
57+
## Integrity Rules
58+
59+
The context contract is useful only when it stays traceable:
60+
61+
- Prefer structured evidence over inferred prose.
62+
- Keep observed facts and inferred relationships visibly separate.
63+
- Emit gaps instead of guessing.
64+
- Record source paths for commands, manifests, and repair references.
65+
- Keep direct-read refs concise.
66+
- Keep generated output portable across machines.
67+
- Treat stale or legacy generator metadata as a reason to rerun `dev.kit repo`.
68+
69+
For the stable machine-readable shapes, see [Reference: Output Schemas](references/output-schemas.md).

docs/references/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Use this directory for compact reference material that helps interpret repo cont
77
- command and workflow contract surfaces
88
- config contract surfaces
99
- dependency contract boundaries
10+
- output schema shapes for tool consumers
1011
- agent and developer workflow practices
1112
- repo design guidance
1213

docs/references/output-schemas.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Output Schemas
2+
3+
This is the stable schema reference for `dev.kit` outputs. It documents the intended shape for humans, agents, scripts, and CI/CD without changing the command surface.
4+
5+
The current contract is intentionally small and may grow by adding fields. Consumers should ignore unknown fields.
6+
7+
## Home Output
8+
9+
Command:
10+
11+
```bash
12+
dev.kit --json
13+
```
14+
15+
Top-level fields:
16+
17+
- `name`: tool name
18+
- `home`: local `dev.kit` home path
19+
- `state`: install state
20+
- `workflow`: environment and repo workflow jobs
21+
- `workspace`: current directory and detected repo state
22+
- `synced`: generated context path, status, reason, and counts
23+
- `localhost_tools`: detected local tools
24+
- `global_context`: capability summary derived from environment detection
25+
- `start_here`: ordered local workflow hints
26+
- `helpers`: supported command entrypoints
27+
28+
Stable status values should stay compact: `ready`, `blocked`, `workspace_only`, `needs_repo_context`, `stale_context`, and `needs_repair`.
29+
30+
## Environment Output
31+
32+
Command:
33+
34+
```bash
35+
dev.kit env --json
36+
```
37+
38+
Top-level fields:
39+
40+
- `command`: `env`
41+
- `home`: local `dev.kit` home path
42+
- `workflow`: environment workflow job
43+
- `tools`: detected tools grouped by category
44+
- `capabilities`: derived capability booleans
45+
- `config`: environment override config path and disabled tool or credential lists
46+
47+
Environment output describes what can be observed safely from the current machine. It should not imply unavailable credentials or tools exist.
48+
49+
## Repo Output
50+
51+
Command:
52+
53+
```bash
54+
dev.kit repo --json
55+
```
56+
57+
Top-level fields:
58+
59+
- `command`: `repo`
60+
- `repo`: repo name
61+
- `path`: repo root path for the current machine
62+
- `mode`: `write` or `check`
63+
- `archetype`: detected repo archetype
64+
- `markers`: root and capability markers
65+
- `factors`: coverage summary by factor
66+
- `gaps`: missing or partial coverage entries
67+
- `actions`: structured next actions
68+
- `workflow`: repo workflow job
69+
- `context`: generated context path
70+
- `dependencies`: dependency contract summary parsed from generated context
71+
- `recommended_repos`: supporting tool repos
72+
73+
Repo JSON may include local paths because it reports the current machine state. `.rabbit/context.yaml` must remain portable and relative.
74+
75+
## Context Artifact
76+
77+
File:
78+
79+
```text
80+
.rabbit/context.yaml
81+
```
82+
83+
Stable sections:
84+
85+
- `kind`
86+
- `version`
87+
- `generator`
88+
- `repo`
89+
- `refs`
90+
- `commands`
91+
- `gaps`
92+
- `dependencies`
93+
- `manifests`
94+
95+
`generator` should include:
96+
97+
- `tool`
98+
- `repo`
99+
- `version`
100+
- `generated_at`
101+
- `sources`
102+
103+
`commands` should stay limited to repo entrypoints such as `verify`, `build`, and `run`. Installation, source, and guide references belong under generator/source metadata or docs, not in `commands`.
104+
105+
## Repair Proposals
106+
107+
Repair guidance should be structured as data, not prose-only advice:
108+
109+
- `factor`: the weak coverage area
110+
- `status`: `missing` or `partial`
111+
- `message`: short explanation
112+
- `repair_target`: repo-owned asset to improve
113+
- `reference`: local guidance doc when available
114+
- `evidence`: observed signals that caused the gap
115+
116+
The repair loop is:
117+
118+
1. inspect the gap
119+
2. update the owning repo asset
120+
3. rerun `dev.kit repo`
121+
4. verify the generated context changed for the right reason

lib/modules/output.sh

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,19 @@ EOF
167167
kill "-${signal}" "$root_pid" 2>/dev/null || true
168168
}
169169

170+
dev_kit_process_signal_list() {
171+
local signal="$1"
172+
local pid_list="$2"
173+
local target_pid=""
174+
175+
while IFS= read -r target_pid; do
176+
[ -n "$target_pid" ] || continue
177+
kill "-${signal}" "$target_pid" 2>/dev/null || true
178+
done <<EOF
179+
$pid_list
180+
EOF
181+
}
182+
170183
dev_kit_run_guarded() {
171184
local label="$1"
172185
local soft_timeout="${2:-$DEV_KIT_PROGRESS_SOFT_TIMEOUT}"
@@ -176,21 +189,31 @@ dev_kit_run_guarded() {
176189

177190
local stdout_file=""
178191
local stderr_file=""
192+
local pgid_file=""
179193
local pid=""
194+
local guarded_pgid=""
180195
local started_at=""
181196
local now=""
182197
local elapsed=0
183198
local soft_announced=0
184199
local status=0
200+
local timeout_pids=""
185201

186202
stdout_file="$(mktemp "${TMPDIR:-/tmp}/dev-kit-guard-out.XXXXXX")" || return 1
187203
stderr_file="$(mktemp "${TMPDIR:-/tmp}/dev-kit-guard-err.XXXXXX")" || {
188204
rm -f "$stdout_file"
189205
return 1
190206
}
207+
pgid_file="$(mktemp "${TMPDIR:-/tmp}/dev-kit-guard-pgid.XXXXXX")" || {
208+
rm -f "$stdout_file" "$stderr_file"
209+
return 1
210+
}
191211

192212
(
193-
"$@"
213+
set -m 2>/dev/null || true
214+
"$@" &
215+
printf '%s\n' "$!" > "$pgid_file"
216+
wait "$!"
194217
) >"$stdout_file" 2>"$stderr_file" &
195218
pid=$!
196219
started_at="$(date +%s)"
@@ -208,18 +231,25 @@ dev_kit_run_guarded() {
208231
fi
209232

210233
if [ "$hard_timeout" -gt 0 ] && [ "$elapsed" -ge "$hard_timeout" ]; then
211-
dev_kit_process_signal_tree TERM "$pid"
212-
sleep 2
213-
if kill -0 "$pid" 2>/dev/null; then
214-
dev_kit_process_signal_tree KILL "$pid"
234+
guarded_pgid="$(cat "$pgid_file" 2>/dev/null || true)"
235+
timeout_pids="$(dev_kit_process_descendants "$pid")
236+
$pid"
237+
if [ -n "$guarded_pgid" ]; then
238+
kill -TERM "-${guarded_pgid}" 2>/dev/null || true
239+
fi
240+
dev_kit_process_signal_list TERM "$timeout_pids"
241+
sleep 1
242+
if [ -n "$guarded_pgid" ]; then
243+
kill -KILL "-${guarded_pgid}" 2>/dev/null || true
215244
fi
245+
dev_kit_process_signal_list KILL "$timeout_pids"
216246
wait "$pid" 2>/dev/null || true
217247
dev_kit_spinner_stop ""
218248
[ -s "$stdout_file" ] && cat "$stdout_file"
219249
[ -s "$stderr_file" ] && cat "$stderr_file" >&2
220250
printf 'dev.kit timeout: %s exceeded %ss and was stopped to prevent an endless run.\n' \
221251
"$label" "$hard_timeout" >&2
222-
rm -f "$stdout_file" "$stderr_file"
252+
rm -f "$stdout_file" "$stderr_file" "$pgid_file"
223253
return 124
224254
fi
225255
done
@@ -230,7 +260,7 @@ dev_kit_run_guarded() {
230260

231261
[ -s "$stdout_file" ] && cat "$stdout_file"
232262
[ -s "$stderr_file" ] && cat "$stderr_file" >&2
233-
rm -f "$stdout_file" "$stderr_file"
263+
rm -f "$stdout_file" "$stderr_file" "$pgid_file"
234264
return "$status"
235265
}
236266

0 commit comments

Comments
 (0)