@outerlayer/cli 0.12.0 → 0.14.0

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +9 -4
  3. package/dist/agent-setup-CN2HUBEJ.js +26 -0
  4. package/dist/{build-LELVCWHV.js → build-BG2YENGK.js} +2 -2
  5. package/dist/build-info.json +1 -1
  6. package/dist/{builder-OF67QKDS.js → builder-2D3WSOOY.js} +4 -4
  7. package/dist/{check-RJOJU2WA.js → check-SRGR36KI.js} +37 -37
  8. package/dist/{chunk-XR3BJN33.js → chunk-22RMZBGW.js} +20 -1
  9. package/dist/{chunk-AHZQBGD2.js → chunk-2M63GG56.js} +1 -1
  10. package/dist/{chunk-SZOVKFWB.js → chunk-3NLOVYJQ.js} +4 -4
  11. package/dist/{chunk-USO2DKBD.js → chunk-4KSQKQXE.js} +8 -2
  12. package/dist/{chunk-QEESCZ26.js → chunk-4NPZVMJU.js} +2 -2
  13. package/dist/{chunk-DVT73QJO.js → chunk-4OGPT6I2.js} +14 -14
  14. package/dist/{chunk-ZQUCTFXC.js → chunk-FOJGZYFC.js} +11 -5
  15. package/dist/{chunk-G5XY6CVG.js → chunk-HFKKFTXU.js} +12 -16
  16. package/dist/{chunk-ANW7VHMH.js → chunk-HFKQIZXL.js} +95 -16
  17. package/dist/{chunk-325272HM.js → chunk-J5M7BSJQ.js} +11 -4
  18. package/dist/{chunk-NPXQXYVA.js → chunk-JJEGKEFV.js} +6 -8
  19. package/dist/{chunk-3ZPYPFNM.js → chunk-JXYVA45C.js} +1 -1
  20. package/dist/{chunk-IBB4D4KE.js → chunk-JYIEHQIF.js} +1 -1
  21. package/dist/{chunk-5TGQHOUX.js → chunk-KFRM23WD.js} +3 -3
  22. package/dist/{chunk-GGMRZPEA.js → chunk-KMDLFI4P.js} +1 -1
  23. package/dist/{chunk-G5IEVZGI.js → chunk-LCEXHCHD.js} +1 -1
  24. package/dist/{chunk-27Y7AX2O.js → chunk-MSASO5O4.js} +44 -8
  25. package/dist/chunk-MTF3PHVZ.js +161 -0
  26. package/dist/{chunk-G4RXNF2L.js → chunk-NHDVD7DU.js} +12 -12
  27. package/dist/{chunk-GATMPAMK.js → chunk-NPQWKGUA.js} +2 -2
  28. package/dist/{chunk-YEQL54G5.js → chunk-PQUM37BK.js} +1 -1
  29. package/dist/{chunk-GEBQXUFY.js → chunk-Q2UK3C4P.js} +24 -10
  30. package/dist/{chunk-SKHN72JO.js → chunk-RBKIH5ST.js} +13 -13
  31. package/dist/{chunk-2KLBKHT4.js → chunk-RLYZLUQ7.js} +1 -1
  32. package/dist/chunk-RMWLBUCJ.js +50 -0
  33. package/dist/{chunk-PDRYXERC.js → chunk-SMHOCDCI.js} +5 -5
  34. package/dist/{chunk-6FH2AHJY.js → chunk-SWHQ4LUM.js} +30 -17
  35. package/dist/{agent-setup-52LRZ6AY.js → chunk-SXWS25JC.js} +8 -21
  36. package/dist/{chunk-VK25O2ZM.js → chunk-T5VPP6H7.js} +1 -1
  37. package/dist/{chunk-JOXYKGUV.js → chunk-WUYTWNMA.js} +4 -2
  38. package/dist/{chunk-A56PYPDF.js → chunk-XCK2YAY5.js} +14 -4
  39. package/dist/{chunk-C7N4TDHW.js → chunk-YDSMROTB.js} +5 -5
  40. package/dist/{chunk-FO7KKPYG.js → chunk-ZA5CHAFY.js} +2 -2
  41. package/dist/{cli-JSSRGA6V.js → cli-UW2H3UUW.js} +138 -85
  42. package/dist/{command-3WYZ2ML5.js → command-5LD7G2QQ.js} +27 -27
  43. package/dist/{config-MKBX2ZQD.js → config-N3C6DFQA.js} +1 -1
  44. package/dist/{connect-cmd-A5NGODCJ.js → connect-cmd-JUAW6MU4.js} +5 -5
  45. package/dist/{context-adopt-BAHGXJZV.js → context-adopt-PJUMW2EZ.js} +6 -6
  46. package/dist/{context-materialize-45OVRRK2.js → context-materialize-FDHYKNDT.js} +6 -6
  47. package/dist/{dist-EQDW7MZW.js → dist-LKDWQWZ7.js} +2 -2
  48. package/dist/{docker-VGWEJWI7.js → docker-4J77Q2BF.js} +5 -5
  49. package/dist/{doctor-4FFXTQJ2.js → doctor-H7REBSLQ.js} +29 -29
  50. package/dist/{emit-artifact-cmd-QS7XNKBT.js → emit-artifact-cmd-FOGNJXVR.js} +18 -21
  51. package/dist/emit-cmd-ZEYWLC2C.js +11 -0
  52. package/dist/{emit-criteria-cmd-XN6AKA53.js → emit-criteria-cmd-HBP6XS5C.js} +8 -11
  53. package/dist/{emit-finding-cmd-SQJSEHYS.js → emit-finding-cmd-DLI4MKMN.js} +8 -11
  54. package/dist/{emit-result-cmd-56RHPHOA.js → emit-result-cmd-MUSL7GQA.js} +12 -15
  55. package/dist/{hook-fast-HLESEJAL.js → hook-fast-WYQD6D7T.js} +1 -1
  56. package/dist/{import-capture-cmd-NHMAFDM6.js → import-capture-cmd-6QVCOIHK.js} +10 -13
  57. package/dist/{import-ruler-cmd-UYB32YUT.js → import-ruler-cmd-KLRGRBCP.js} +7 -10
  58. package/dist/index.js +3 -3
  59. package/dist/{init-UZKD4RY7.js → init-NTXA3SN7.js} +28 -28
  60. package/dist/{init-6AY5T3P6.js → init-UBXK6MF7.js} +47 -37
  61. package/dist/{init-cmd-XGSX2BCC.js → init-cmd-NARDUPIG.js} +20 -13
  62. package/dist/init-update-O5YYFGF4.js +165 -0
  63. package/dist/{install-VXXI7UR6.js → install-HDBIPHTX.js} +2 -2
  64. package/dist/{login-browser-7XGSV7MA.js → login-browser-QZCS3WW6.js} +2 -1
  65. package/dist/{loop-4NMI2USY.js → loop-SW2M5VDD.js} +37 -37
  66. package/dist/{machine-4JX2D4TS.js → machine-U66FKVDP.js} +23 -23
  67. package/dist/mcp-install-cmd-FDTPQQS6.js +9 -0
  68. package/dist/{runner-env-WAXTJXZK.js → runner-env-XTC53CHN.js} +3 -3
  69. package/dist/runner-key-3JSMDRJA.js +154 -0
  70. package/dist/{session-sender-T7PN4YRC.js → session-sender-4M247XSV.js} +7 -7
  71. package/dist/starter-pack-IB4UUIX3.js +11 -0
  72. package/dist/{status-OXBIRWJ7.js → status-STZYPU3W.js} +30 -30
  73. package/dist/{sync-cmd-EVXNR47N.js → sync-cmd-UWD5JOFU.js} +6 -6
  74. package/dist/{watch-7NSFOAL5.js → watch-DBNB7R6X.js} +6 -6
  75. package/dist/{work-claim-cmd-KR7UR2AB.js → work-claim-cmd-LY4U6QHN.js} +13 -13
  76. package/dist/{work-cmd-JPM37MLF.js → work-cmd-RVRQ32EH.js} +7 -7
  77. package/dist/{work-comment-cmd-3DC6BC34.js → work-comment-cmd-FFUM4TJU.js} +10 -13
  78. package/dist/{work-open-pr-cmd-XZQRJBNZ.js → work-open-pr-cmd-HLDWP4T2.js} +10 -13
  79. package/dist/{work-pr-cmd-WHGZOP22.js → work-pr-cmd-L77K32WK.js} +7 -7
  80. package/package.json +1 -1
  81. package/skill-pack/maintained/emitting-evidence/SKILL.md +8 -2
  82. package/skill-pack/shipped.json +70 -0
  83. package/skill-pack/template/build/SKILL.md +66 -35
  84. package/skill-pack/template/build/references/agent-briefs.md +4 -2
  85. package/skill-pack/template/build/references/release.md +36 -8
  86. package/skill-pack/template/build/references/review-loop.md +6 -2
  87. package/skill-pack/template/build/scripts/record-criteria.mjs +109 -143
  88. package/skill-pack/template/spec/SKILL.md +33 -22
  89. package/skill-pack/template/writing-specs/SKILL.md +36 -3
  90. package/skill-pack/template/writing-specs/references/agents-snippet.md +57 -0
  91. package/skill-pack/template/writing-tests/SKILL.md +117 -0
  92. package/skill-pack/validators/acceptance-criteria.yaml +35 -0
  93. package/skill-pack/validators/code-review.yaml +4 -2
  94. package/dist/chunk-T6OIJQRT.js +0 -31
  95. package/dist/emit-cmd-LXEIDKLT.js +0 -10
  96. package/dist/mcp-install-cmd-XZARXNYT.js +0 -9
  97. package/dist/starter-pack-Z22VRFPF.js +0 -11
  98. package/dist/{chunk-3FMPZPJQ.js → chunk-R7PF5OOU.js} +1 -1
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: writing-tests
3
+ description: Writes and reviews tests that catch a specific bug - assertion strength, the seam each test binds at, binding a test to an acceptance-criterion id, and checking by mutation that a test would notice a break. Use when writing or changing any test, when binding a test to a criterion id, when reviewing whether a test proves anything, or when a mutation tool reports survivors.
4
+ ---
5
+
6
+ # Writing tests
7
+
8
+ A test earns its place by catching a specific bug. Before keeping one, ask:
9
+ what is the smallest change to production code that would still pass this
10
+ test? If the answer is "almost anything", the test checks wiring, not
11
+ behavior. Strengthen it or delete it.
12
+
13
+ The rules here hold in any language and any test framework. The examples
14
+ use TypeScript with a Jest-style `expect`. Read each one as the equivalent
15
+ assertion in the repository's own framework.
16
+
17
+ ## Assertion strength
18
+
19
+ These pass for almost any implementation, so they are never the only proof
20
+ in a test:
21
+
22
+ - An "is defined" or "is not null" check passes for any value at all.
23
+ - A truthy or falsy check. Assert the exact value instead.
24
+ - "Was called" proves it ran, not what it ran with.
25
+ - "Does not throw" on its own. Assert the return value too.
26
+
27
+ Negative forms state a real expectation and are fine: "was never called",
28
+ "is absent". Prefer:
29
+
30
+ - Exact equality on the actual return value or the whole object shape.
31
+ - "Called with" and the full argument shape.
32
+ - Positional equality on lists. It catches reordering and off-by-one.
33
+ - A negative assertion that pins an injection path shut, such as
34
+ `expect(query).not.toContain(rawUserValue)`.
35
+ - On an error path, the message or status a user or operator sees, not only
36
+ that something failed.
37
+
38
+ Do not pin brittle internals: exact log strings, incidental call counts, the
39
+ order of unrelated calls. Those break on refactors without catching bugs.
40
+
41
+ ## Choose the seam
42
+
43
+ Name the seam before writing the test: the boundary the test drives the code
44
+ through.
45
+
46
+ - Business behavior is proven below the user interface, in the service or
47
+ the pure function.
48
+ - A user interface contract is proven at the component level, through what
49
+ the user sees and does.
50
+ - Behavior that lives in the data store, such as an access rule, a trigger
51
+ or the real shape of a query, is proven against the real store.
52
+ - A criterion that spans two seams gets two tests, one at each.
53
+
54
+ Check two blind spots every time:
55
+
56
+ - **Fake-seam blindness.** A fake that returns every field whatever the query
57
+ asked for proves nothing about the query. Pin the contract: assert the
58
+ request the code sent, make the fake honor what was asked for, or test
59
+ against the real dependency.
60
+ - **Structural pinning.** "X is never called for Y" needs a spy that is
61
+ present and asserts zero calls. A missing fake skips silently, exactly like
62
+ the real skip.
63
+
64
+ A field that crosses a module or package boundary needs an assertion at every
65
+ hop: writer, relay, reader. Pinning only the ends leaves the middle free to
66
+ drop it.
67
+
68
+ ## Bind a test to its criterion
69
+
70
+ When a spec has acceptance criteria with ids, the test that proves a
71
+ criterion carries the id in a comment directly above the test, never in its
72
+ title:
73
+
74
+ ```ts
75
+ // proves LOGIN-03
76
+ it("refuses a password reset for an unknown address without saying so", () => {
77
+ // ...
78
+ });
79
+ ```
80
+
81
+ The title says what the test proves to someone reading a failure. The
82
+ comment lets a reader, or a script, find the test from the criterion. Never
83
+ put a criterion id in a comment that is not that binding, because a reader
84
+ will take it as one.
85
+
86
+ Write the test from the criterion's words, at the seam it names, before the
87
+ implementation exists. Run it and read the failure. It must fail because the
88
+ behavior is absent, not because of a typo or a missing import.
89
+
90
+ A criterion with a proof form such as `(proof: screenshot)` is proven by the
91
+ evidence a reviewer sees, not by a test. It may still have one.
92
+
93
+ ## Mutation: prove the test would notice
94
+
95
+ A green suite proves the tests run, not that they would catch a bug. Check
96
+ the code the change adds or alters.
97
+
98
+ **By hand.** For every condition, guard, limit and assignment the change
99
+ adds, break it: invert it, widen it, drop half of an `and`, ignore the field.
100
+ Run the one test file that should catch it. If nothing fails, write the
101
+ assertion that would. Then take each criterion and break the production code
102
+ it describes. Its test must fail. A test bound to a criterion that survives
103
+ the break is not coverage.
104
+
105
+ **With a tool.** Mutation testing is optional. Where the repository has a
106
+ mutation tool, run it over the changed lines only. Each mutant that survives
107
+ is a test still to write, not a score to accept. Two mutants are equivalent
108
+ only when no observable output can differ; say why when you claim it. Hand
109
+ breaks still matter for files the tool does not mutate, such as SQL, shell
110
+ scripts, markup and configuration.
111
+
112
+ ## The repository's own rules
113
+
114
+ The instructions file may name test commands, required checks, mocking rules
115
+ or coverage thresholds. Those come first where they are stricter than this
116
+ skill. Add them here when they are the team's standard, because this file is
117
+ the team's to edit.
@@ -0,0 +1,35 @@
1
+ # Yours to edit. Written once by outerlayer init; never overwritten.
2
+ #
3
+ # How to satisfy this row: once the pull request is open, have an agent that
4
+ # did not write the change judge each recorded acceptance criterion against
5
+ # the test that cites it. Write its verdicts as an .html file and emit it as
6
+ # a report artifact bound to this check:
7
+ # outerlayer emit artifact criteria.html --for acceptance-criteria --caption "Each criterion judged against the test that cites it"
8
+ # Then run `outerlayer sync`, and copy the report's deep link from the pull
9
+ # request's evidence comment. The link can take up to a minute to appear
10
+ # after the sync. If it is not there yet, wait a minute and read the comment
11
+ # again; do not give up after one look. Never build the link by hand, and
12
+ # never link a pull request comment: a comment can be edited or deleted later.
13
+ #
14
+ # Then record the verdict once, with that link as its proof:
15
+ # outerlayer emit acceptance-criteria --item "$OUTERLAYER_WORK" --result pass --link <the report's deep link>
16
+ # Use --result pass only when the judge found every criterion it judged met.
17
+ # Use --result fail when it found one unmet. A criterion whose proof is a
18
+ # screenshot, video or other artifact is not judged here: its own criterion
19
+ # row asks for that artifact.
20
+ # When there is no criterion to judge, nothing is judged and nothing is
21
+ # recorded, so the row never reads as passed.
22
+ # Until a result is recorded, the row reads "not proven". While a host still
23
+ # holds the work item's claim, it reads as waiting.
24
+ #
25
+ # `where: ci` means the result comes from `outerlayer emit`: OuterLayer runs
26
+ # nothing for this check, and a result from a session, CI or a person counts.
27
+ # The row claims only what that proves: a criteria judge's result is
28
+ # recorded, not that the criteria hold.
29
+ id: acceptance-criteria
30
+ kind: validation
31
+ row: "A criteria judge result is recorded for this change"
32
+ level: warn
33
+ run:
34
+ where: ci
35
+ emit: acceptance-criteria
@@ -5,8 +5,10 @@
5
5
  # clean bill) as an .html file. Emit it as a report artifact with no --for:
6
6
  # outerlayer emit artifact review.html --caption "Review of the change and what it found"
7
7
  # Then run `outerlayer sync`, and copy the report's deep link from the pull
8
- # request's evidence comment. Never build the link by hand, and never link a
9
- # pull request comment: a comment can be edited or deleted later.
8
+ # request's evidence comment. The link can take up to a minute to appear
9
+ # after the sync. If it is not there yet, wait a minute and read the comment
10
+ # again; do not give up after one look. Never build the link by hand, and
11
+ # never link a pull request comment: a comment can be edited or deleted later.
10
12
  #
11
13
  # Then record the verdict once, with that link as its proof:
12
14
  # outerlayer emit code-review --item "$OUTERLAYER_WORK" --result pass --link <the report's deep link>
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';
4
- import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
5
- import { dirname } from 'path';
6
-
7
- createRequire(import.meta.url);
8
- function readJobFile(path) {
9
- if (!existsSync(path)) return null;
10
- try {
11
- return JSON.parse(readFileSync(path, "utf8"));
12
- } catch {
13
- return null;
14
- }
15
- }
16
- function readJobFileChecked(path) {
17
- if (!existsSync(path)) return { kind: "missing" };
18
- try {
19
- const parsed = JSON.parse(readFileSync(path, "utf8"));
20
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return { kind: "unreadable" };
21
- return { kind: "ok", job: parsed };
22
- } catch {
23
- return { kind: "unreadable" };
24
- }
25
- }
26
- function writeJobFile(path, job) {
27
- mkdirSync(dirname(path), { recursive: true, mode: RUNNER_DIR_MODE });
28
- writeFileSync(path, JSON.stringify(job, null, 2), { mode: RUNNER_FILE_MODE });
29
- }
30
-
31
- export { readJobFile, readJobFileChecked, writeJobFile };
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- export { EmitError, runEmit } from './chunk-G5XY6CVG.js';
4
- import './chunk-FO7KKPYG.js';
5
- import './chunk-AHZQBGD2.js';
6
- import './chunk-325272HM.js';
7
- import './chunk-RA3O54FC.js';
8
- import './chunk-Z5GEFMRW.js';
9
-
10
- createRequire(import.meta.url);
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- export { DEFAULT_MCP_COMMAND, DOCS_MCP_SERVER_NAME, McpInstallError, addDocsMcpEntryIfAbsent, addStdioMcpEntryIfAbsent, buildServerEntry, buildStdioServerEntry, defaultMcpUrl, handleMcpInstallError, runMcpInstall } from './chunk-A56PYPDF.js';
4
- import './chunk-YRYMNBGQ.js';
5
- import './chunk-EABW6AJQ.js';
6
- import './chunk-VNVZDWO3.js';
7
- import './chunk-Z5GEFMRW.js';
8
-
9
- createRequire(import.meta.url);
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- export { StarterPackError, assertKnownTemplate, formatStarterPackOutput, installStarterPack } from './chunk-ZQUCTFXC.js';
4
- import './chunk-YRYMNBGQ.js';
5
- import './chunk-FO7KKPYG.js';
6
- import './chunk-AHZQBGD2.js';
7
- import './chunk-325272HM.js';
8
- import './chunk-RA3O54FC.js';
9
- import './chunk-Z5GEFMRW.js';
10
-
11
- createRequire(import.meta.url);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { startTimeOf, claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-N5FOE5PS.js';
4
3
  import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-QOZKPLVJ.js';
4
+ import { startTimeOf, claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-N5FOE5PS.js';
5
5
  import { CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, TINI_VERSION, GH_VERSION, GH_SHA256, TINI_SHA256 } from './chunk-CX22S5BA.js';
6
6
  import { withGitConfig, tokenHeader } from './chunk-BYT5O5RV.js';
7
7
  import { RUNNER_DIR_MODE, repoCacheDir, imagesDir, attemptStamp, runnerDir, rootfsPathFor, RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';