@tablation/crew 0.137.5 → 0.137.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tablation/crew",
3
- "version": "0.137.5",
3
+ "version": "0.137.6",
4
4
  "description": "A standing team of headless agents that picks work off a Tablation board, does it on a machine you control, and reports back.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: Adopt Repository Contract
3
+ description: How the dev seat writes a repository's `.crew.yaml` from its checkout (hooks, release mode, sandbox section) and how QA verifies it by running the hooks and `crew repos check --strict`. Fetch when a ticket asks the crew to write or adopt a repository's contract.
4
+ ---
5
+ # Adopting a repository: writing its `.crew.yaml`
6
+
7
+ A repository added from the app arrives with a setup ticket asking the crew to
8
+ write its contract: a `.crew.yaml` at the checkout root. The file is the only
9
+ thing that knows how this repository tests, builds and releases, so write it
10
+ from what the checkout shows, never from habit. The repo spec that ships with crew is the field
11
+ reference (`crew repos check` prints what it parsed); this skill is the procedure.
12
+
13
+ ## Dev: write the file
14
+
15
+ 1. **Read the checkout first.** Package manifests (`package.json`,
16
+ `Package.swift`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `Makefile`), the
17
+ README's build and test section, and every CI workflow
18
+ (`.github/workflows/`, `.buildkite/`, and the like). Note which commands CI
19
+ runs: those are the hooks, because they are what the maintainers already trust.
20
+ 2. **Ask the tool for a baseline.** Run `crew repos hooks --json` against the
21
+ checkout (the file-sniff proposal plus detected `recipes`), and `crew repos
22
+ hooks --agent` where the harness allows it (it needs a signed-in toolchain; a
23
+ `reason` such as `not_signed_in` or `unsupported_harness` is not a failure of
24
+ the ticket, so carry on from the sniff and say so). Treat both as a draft:
25
+ where the sniff and CI disagree, CI wins. Never use `--write` on a route for
26
+ this ticket; the contract belongs in the repository, committed on the branch.
27
+ 3. **Choose `release.mode` from what the repository shows.**
28
+ - A release workflow (a tag or merge triggers CI that publishes or deploys):
29
+ `release.mode: ci_auto`, with a `hooks.released` that prints what is live
30
+ (a commit sha or version) and `release.verify.match` to suit. Do not also
31
+ write a `deploy` hook, or the release happens twice.
32
+ - Otherwise: `release.mode: integrate` (the crew merges and tags, nothing is deployed).
33
+ - Do not pick `local` unless the repository has a deploy script a person runs
34
+ today, and then `hooks.deploy` is required. Do not pick `external` or
35
+ `ci_manual` without evidence in the checkout.
36
+ - If `ci_auto` is the right mode but `released` cannot be derived from the
37
+ checkout (no health endpoint, no registry name), that is a question for the
38
+ operator, not a guess (see "Nothing to detect").
39
+ 4. **Versioning.** If the repository keeps a version, point `version`/`bump` or
40
+ `release.versionFiles` at where it lives. If it keeps none, set
41
+ `release.versioning: none`. If it keeps no changelog, `release.changelog: false`.
42
+ 5. **Add a `sandbox:` section only when needed.** The base sandbox image has git,
43
+ curl and the agent toolchain. If the hooks need a runtime or system package
44
+ beyond that (a language toolchain, a database client, a compiler), declare it
45
+ under `sandbox.packages` (apt names), allow run-time downloads the tests
46
+ really make through `sandbox.toolchains`/`sandbox.hosts`, and keep baked
47
+ steps in `sandbox.setup`. A repository whose hooks need nothing extra gets no
48
+ `sandbox:` section.
49
+ 6. **Run every hook once before committing**, from the checkout (or the ticket's
50
+ worktree), in the order `setup`, `test`, `build`, then any `ports`,
51
+ `isolate`, `version` that you wrote. Judge by exit code. A hook that fails
52
+ because the repository itself is broken is not yours to fix on this ticket:
53
+ record it in the file's comment and file it as its own ticket. A hook you
54
+ could not run (a tool missing on this machine) is stated in your comment, not
55
+ assumed to work.
56
+ 7. **Write the file with comments.** Each non-obvious choice gets a one-line
57
+ comment saying what in the checkout justified it ("mode is ci_auto: .github/workflows/release.yml
58
+ publishes on tag"). A reader should be able to audit the file without
59
+ re-deriving it.
60
+ 8. **Check it.** Run `crew repos check --strict` from the checkout and fix
61
+ everything it prints until it exits 0. Quote the summary in your hand-off.
62
+ 9. Commit only `.crew.yaml` (and anything the ticket names). Hand off as usual.
63
+
64
+ ## Nothing to detect
65
+
66
+ If the checkout has no manifest, no CI and no README guidance, so that the test
67
+ or build command would be a guess, do not write one. Stop per the lane's
68
+ person-stop rule: `needs_info`, assigned to the operator, with the **specific**
69
+ question ("What command runs this repository's tests?", "Does a push to main
70
+ deploy it, and how do I see what is live?"). A partial file is fine only when
71
+ the missing part is optional.
72
+
73
+ ## QA: verify the file
74
+
75
+ 1. Cut the branch's worktree and run `crew repos check --strict` on it: exit 0.
76
+ 2. Run the hooks the file declares, verbatim: `setup`, then `test` and `build`.
77
+ Where the repository declares a `sandbox:` section, run them in the sandbox
78
+ when the ship supports it. A hook that was only syntax-checked has not been verified.
79
+ 3. Confirm the choices match the repository: the `release.mode` against the
80
+ workflows actually present, a `released` hook for any `ci_*` mode, no
81
+ `deploy` hook alongside `ci_auto`, no `sandbox:` section with nothing in it.
82
+ 4. Bounce with the failing hook's output quoted. Do not edit the file yourself.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: Adopt Repository Contract
3
+ description: How the dev seat writes a repository's `.crew.yaml` from its checkout (hooks, release mode, sandbox section) and how QA verifies it by running the hooks and `crew repos check --strict`. Fetch when a ticket asks the crew to write or adopt a repository's contract.
4
+ ---
5
+ # Adopting a repository: writing its `.crew.yaml`
6
+
7
+ A repository added from the app arrives with a setup ticket asking the crew to
8
+ write its contract: a `.crew.yaml` at the checkout root. The file is the only
9
+ thing that knows how this repository tests, builds and releases, so write it
10
+ from what the checkout shows, never from habit. The repo spec that ships with crew is the field
11
+ reference (`crew repos check` prints what it parsed); this skill is the procedure.
12
+
13
+ ## Dev: write the file
14
+
15
+ 1. **Read the checkout first.** Package manifests (`package.json`,
16
+ `Package.swift`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `Makefile`), the
17
+ README's build and test section, and every CI workflow
18
+ (`.github/workflows/`, `.buildkite/`, and the like). Note which commands CI
19
+ runs: those are the hooks, because they are what the maintainers already trust.
20
+ 2. **Ask the tool for a baseline.** Run `crew repos hooks --json` against the
21
+ checkout (the file-sniff proposal plus detected `recipes`), and `crew repos
22
+ hooks --agent` where the harness allows it (it needs a signed-in toolchain; a
23
+ `reason` such as `not_signed_in` or `unsupported_harness` is not a failure of
24
+ the ticket, so carry on from the sniff and say so). Treat both as a draft:
25
+ where the sniff and CI disagree, CI wins. Never use `--write` on a route for
26
+ this ticket; the contract belongs in the repository, committed on the branch.
27
+ 3. **Choose `release.mode` from what the repository shows.**
28
+ - A release workflow (a tag or merge triggers CI that publishes or deploys):
29
+ `release.mode: ci_auto`, with a `hooks.released` that prints what is live
30
+ (a commit sha or version) and `release.verify.match` to suit. Do not also
31
+ write a `deploy` hook, or the release happens twice.
32
+ - Otherwise: `release.mode: integrate` (the crew merges and tags, nothing is deployed).
33
+ - Do not pick `local` unless the repository has a deploy script a person runs
34
+ today, and then `hooks.deploy` is required. Do not pick `external` or
35
+ `ci_manual` without evidence in the checkout.
36
+ - If `ci_auto` is the right mode but `released` cannot be derived from the
37
+ checkout (no health endpoint, no registry name), that is a question for the
38
+ operator, not a guess (see "Nothing to detect").
39
+ 4. **Versioning.** If the repository keeps a version, point `version`/`bump` or
40
+ `release.versionFiles` at where it lives. If it keeps none, set
41
+ `release.versioning: none`. If it keeps no changelog, `release.changelog: false`.
42
+ 5. **Add a `sandbox:` section only when needed.** The base sandbox image has git,
43
+ curl and the agent toolchain. If the hooks need a runtime or system package
44
+ beyond that (a language toolchain, a database client, a compiler), declare it
45
+ under `sandbox.packages` (apt names), allow run-time downloads the tests
46
+ really make through `sandbox.toolchains`/`sandbox.hosts`, and keep baked
47
+ steps in `sandbox.setup`. A repository whose hooks need nothing extra gets no
48
+ `sandbox:` section.
49
+ 6. **Run every hook once before committing**, from the checkout (or the ticket's
50
+ worktree), in the order `setup`, `test`, `build`, then any `ports`,
51
+ `isolate`, `version` that you wrote. Judge by exit code. A hook that fails
52
+ because the repository itself is broken is not yours to fix on this ticket:
53
+ record it in the file's comment and file it as its own ticket. A hook you
54
+ could not run (a tool missing on this machine) is stated in your comment, not
55
+ assumed to work.
56
+ 7. **Write the file with comments.** Each non-obvious choice gets a one-line
57
+ comment saying what in the checkout justified it ("mode is ci_auto: .github/workflows/release.yml
58
+ publishes on tag"). A reader should be able to audit the file without
59
+ re-deriving it.
60
+ 8. **Check it.** Run `crew repos check --strict` from the checkout and fix
61
+ everything it prints until it exits 0. Quote the summary in your hand-off.
62
+ 9. Commit only `.crew.yaml` (and anything the ticket names). Hand off as usual.
63
+
64
+ ## Nothing to detect
65
+
66
+ If the checkout has no manifest, no CI and no README guidance, so that the test
67
+ or build command would be a guess, do not write one. Stop per the lane's
68
+ person-stop rule: `needs_info`, assigned to the operator, with the **specific**
69
+ question ("What command runs this repository's tests?", "Does a push to main
70
+ deploy it, and how do I see what is live?"). A partial file is fine only when
71
+ the missing part is optional.
72
+
73
+ ## QA: verify the file
74
+
75
+ 1. Cut the branch's worktree and run `crew repos check --strict` on it: exit 0.
76
+ 2. Run the hooks the file declares, verbatim: `setup`, then `test` and `build`.
77
+ Where the repository declares a `sandbox:` section, run them in the sandbox
78
+ when the ship supports it. A hook that was only syntax-checked has not been verified.
79
+ 3. Confirm the choices match the repository: the `release.mode` against the
80
+ workflows actually present, a `released` hook for any `ci_*` mode, no
81
+ `deploy` hook alongside `ci_auto`, no `sandbox:` section with nothing in it.
82
+ 4. Bounce with the failing hook's output quoted. Do not edit the file yourself.