assertledger 1.1.1 → 1.3.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 (77) hide show
  1. package/README.fr.md +34 -4
  2. package/README.md +33 -4
  3. package/conformance/schema-extensions.json +25 -0
  4. package/dist/build-info.json +1 -1
  5. package/dist/cli.d.ts +8 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +292 -25
  8. package/dist/cli.js.map +1 -1
  9. package/dist/contracts/index.d.ts +510 -4
  10. package/dist/contracts/index.d.ts.map +1 -1
  11. package/dist/contracts/index.js +230 -16
  12. package/dist/contracts/index.js.map +1 -1
  13. package/dist/contracts/runtime-doctor.d.ts +123 -0
  14. package/dist/contracts/runtime-doctor.d.ts.map +1 -1
  15. package/dist/contracts/runtime-doctor.js +64 -0
  16. package/dist/contracts/runtime-doctor.js.map +1 -1
  17. package/dist/core/index.d.ts.map +1 -1
  18. package/dist/core/index.js +5 -2
  19. package/dist/core/index.js.map +1 -1
  20. package/dist/diagnostics.d.ts.map +1 -1
  21. package/dist/diagnostics.js +26 -2
  22. package/dist/diagnostics.js.map +1 -1
  23. package/dist/engine/adapters/bun-test-profile.d.ts +17 -0
  24. package/dist/engine/adapters/bun-test-profile.d.ts.map +1 -0
  25. package/dist/engine/adapters/bun-test-profile.js +17 -0
  26. package/dist/engine/adapters/bun-test-profile.js.map +1 -0
  27. package/dist/engine/connection.d.ts +25 -1
  28. package/dist/engine/connection.d.ts.map +1 -1
  29. package/dist/engine/connection.js +144 -31
  30. package/dist/engine/connection.js.map +1 -1
  31. package/dist/engine/demo.d.ts +16 -0
  32. package/dist/engine/demo.d.ts.map +1 -0
  33. package/dist/engine/demo.js +51 -0
  34. package/dist/engine/demo.js.map +1 -0
  35. package/dist/engine/git-regression.d.ts +2 -2
  36. package/dist/engine/git-regression.d.ts.map +1 -1
  37. package/dist/engine/git-regression.js.map +1 -1
  38. package/dist/engine/index.d.ts +26 -5
  39. package/dist/engine/index.d.ts.map +1 -1
  40. package/dist/engine/index.js +539 -58
  41. package/dist/engine/index.js.map +1 -1
  42. package/dist/engine/runtime-doctor.d.ts +13 -4
  43. package/dist/engine/runtime-doctor.d.ts.map +1 -1
  44. package/dist/engine/runtime-doctor.js +80 -2
  45. package/dist/engine/runtime-doctor.js.map +1 -1
  46. package/dist/engine/setup.d.ts +39 -0
  47. package/dist/engine/setup.d.ts.map +1 -0
  48. package/dist/engine/setup.js +411 -0
  49. package/dist/engine/setup.js.map +1 -0
  50. package/dist/mcp/index.d.ts.map +1 -1
  51. package/dist/mcp/index.js +36 -6
  52. package/dist/mcp/index.js.map +1 -1
  53. package/dist/sdk/index.d.ts +7 -6
  54. package/dist/sdk/index.d.ts.map +1 -1
  55. package/dist/sdk/index.js +20 -7
  56. package/dist/sdk/index.js.map +1 -1
  57. package/docs/adapter-protocol.md +61 -0
  58. package/docs/architecture.md +4 -1
  59. package/docs/developer-experience.md +39 -5
  60. package/docs/distribution.md +8 -3
  61. package/docs/migration-verification-v3.md +33 -0
  62. package/docs/project-intent.md +7 -5
  63. package/docs/reference.md +9 -5
  64. package/docs/repository-init.md +52 -7
  65. package/docs/runtime-doctor.md +12 -9
  66. package/integrations/bun/assertions.d.mts +4 -0
  67. package/integrations/bun/assertions.mjs +25 -0
  68. package/integrations/bun/driver.d.mts +27 -0
  69. package/integrations/bun/driver.mjs +383 -0
  70. package/integrations/bun/preload.mjs +165 -0
  71. package/integrations/skill/SKILL.md +4 -1
  72. package/package.json +7 -3
  73. package/schemas/evidence-manifest.v3.json +897 -0
  74. package/schemas/repository-init-config.v2.json +210 -0
  75. package/schemas/repository-init-lock.v2.json +162 -0
  76. package/schemas/repository-init-result.v2.json +212 -0
  77. package/schemas/verification-request.v3.json +484 -0
package/README.fr.md CHANGED
@@ -9,12 +9,12 @@ Vous obtenez un verdict, les observations qui le justifient et un fichier de pre
9
9
 
10
10
  [Essayer l’exemple](#essayer-lexemple) · [Comprendre le résultat](#comprendre-le-résultat) · [Utiliser votre dépôt](#utiliser-votre-dépôt) · [Documentation](#documentation)
11
11
 
12
- **1.1 · node:test · CLI, SDK et MCP · MIT**
12
+ **1.3 · node:test et bun:test · CLI, SDK et MCP · MIT**
13
13
 
14
14
  Installez l’outil dans votre dépôt avec Node.js 22.15 ou une version ultérieure :
15
15
 
16
16
  ```sh
17
- npm install --save-dev assertledger@1.1.1
17
+ npm install --save-dev assertledger@1.3.0
18
18
  npx assertledger doctor .
19
19
  ```
20
20
 
@@ -57,10 +57,10 @@ flowchart LR
57
57
 
58
58
  ## Essayer l’exemple
59
59
 
60
- Prérequis : **Git**, **Node.js 22.15+** et **pnpm 11.1.2**. Le premier adaptateur intégré utilise `node:test`.
60
+ Prérequis : **Git**, **Node.js 22.15+** et **pnpm 11.1.2**. L’exemple utilise l’adaptateur intégré `node:test`.
61
61
 
62
62
  ```sh
63
- git clone --branch v1.1.1 https://github.com/hoklims/assertledger.git
63
+ git clone --branch v1.3.0 https://github.com/hoklims/assertledger.git
64
64
  cd assertledger
65
65
  pnpm install --frozen-lockfile
66
66
  pnpm build
@@ -71,9 +71,15 @@ L’exemple fourni contient une fonction de parité correcte, sa version invers
71
71
  puis lancez :
72
72
 
73
73
  ```sh
74
+ node dist/cli.js demo --allow-unsafe-execution
75
+ # Ou pour examiner directement le manifeste complet :
74
76
  node dist/cli.js verify examples/node-test/request.json --allow-unsafe-execution --json
75
77
  ```
76
78
 
79
+ `demo` copie l’exemple fourni dans un dossier temporaire jetable, puis le supprime. Son résultat
80
+ démontre uniquement le paquet AssertLedger installé ; il ne constitue pas une preuve sur votre
81
+ dépôt.
82
+
77
83
  > **Exécutez uniquement du code de confiance.** L’option `--allow-unsafe-execution` autorise
78
84
  > l’exécution locale du code. Ce mode est explicitement **UNSANDBOXED**, sans bac à sable :
79
85
  > il ne protège pas votre machine contre du code malveillant.
@@ -145,6 +151,20 @@ node dist/cli.js doctor path/to/your-repository
145
151
  node dist/cli.js doctor path/to/your-repository --json
146
152
  ```
147
153
 
154
+ Pour prévisualiser l’initialisation et la connexion en lecture seule d’un agent dans une seule
155
+ opération contrôlée :
156
+
157
+ ```sh
158
+ node dist/cli.js setup path/to/your-repository --client codex --dry-run
159
+ node dist/cli.js setup path/to/your-repository --client codex --write
160
+ ```
161
+
162
+ Utilisez `--client claude-code` pour Claude Code. Sans option de mode, `setup` reste une
163
+ prévisualisation. La commande contrôle toutes les cibles avant sa première écriture ; un conflit
164
+ apparu après l’initialisation ne retire que les fichiers créés par cette invocation et restés
165
+ strictement identiques. Si une restauration sûre est impossible, la commande renvoie
166
+ `PARTIAL_FAILURE`, le code 5 et la liste explicite des fichiers non restaurés.
167
+
148
168
  `WOULD_CREATE` signifie qu’une configuration peut être préparée. Vous fournissez encore le test
149
169
  candidat et les contrôles. Le [guide d’initialisation](docs/repository-init.md) décrit `init`,
150
170
  la configuration et le verrou des preuves. Détecter un framework ne signifie pas savoir l’exécuter.
@@ -153,6 +173,15 @@ Après l’initialisation, le [diagnostic dynamique](docs/runtime-doctor.md) vé
153
173
  la découverte des tests et l’attribution des assertions avec `doctor --runtime --allow-unsafe-execution`.
154
174
  Pour comprendre un refus, lancez `explain CODE` : la commande indique la prochaine action sûre.
155
175
 
176
+ ### Bun 1.4.2
177
+
178
+ Pour un dépôt `bun:test`, lancez `assertledger doctor . --framework bun:test`. Après `init` et le
179
+ diagnostic dynamique, écrivez des tests candidats v3 avec `assertSame` depuis `assertledger/bun`.
180
+ L’adaptateur cible précisément Bun 1.4.2 et attribue les échecs de cet outil. Les échecs `expect`
181
+ natifs restent des erreurs d’exécution et ne comptent pas comme détection du défaut. Le
182
+ [guide de migration Bun](docs/migration-verification-v3.md) décrit la requête, l’exécution et le
183
+ rejeu. Ce mode exécute du code local de confiance sans bac à sable.
184
+
156
185
  ### Qualifier un test de régression commité
157
186
 
158
187
  Choisissez le commit qui contient le bug (`BEFORE`), sa correction (`AFTER`) et un témoin neutre
@@ -205,6 +234,7 @@ Le guide Git est en français ; les autres références techniques sont en angla
205
234
  | Vous souhaitez… | Commencez ici |
206
235
  | --- | --- |
207
236
  | Préparer un dépôt | [Initialisation](docs/repository-init.md) · [Audit statique](docs/repository-audit.md) |
237
+ | Vérifier une régression Bun | [Migration Bun](docs/migration-verification-v3.md) |
208
238
  | Comprendre un blocage | [Diagnostic dynamique](docs/runtime-doctor.md) · [Explication des motifs](docs/diagnostics.md) |
209
239
  | Essayer une correction historique | [Exemple Unicode-regexp](examples/git-history/README.md) |
210
240
  | Qualifier une correction ou connecter Codex | [Parcours Git](docs/git-regression.md) · [Prise en main](docs/developer-experience.md) |
package/README.md CHANGED
@@ -9,12 +9,12 @@ You get a verdict, the observations behind it and an evidence file you can repla
9
9
 
10
10
  [Try the example](#try-the-example) · [Understand the result](#understand-the-result) · [Use your repository](#use-your-repository) · [Documentation](#documentation)
11
11
 
12
- **1.1 · node:test · CLI, SDK and MCP · MIT**
12
+ **1.3 · node:test and bun:test · CLI, SDK and MCP · MIT**
13
13
 
14
14
  Install in your repository with Node.js 22.15 or later:
15
15
 
16
16
  ```sh
17
- npm install --save-dev assertledger@1.1.1
17
+ npm install --save-dev assertledger@1.3.0
18
18
  npx assertledger doctor .
19
19
  ```
20
20
 
@@ -56,10 +56,10 @@ flowchart LR
56
56
 
57
57
  ## Try the example
58
58
 
59
- You need **Git**, **Node.js 22.15+** and **pnpm 11.1.2**. The first built-in adapter is `node:test`.
59
+ You need **Git**, **Node.js 22.15+** and **pnpm 11.1.2**. The example uses the built-in `node:test` adapter.
60
60
 
61
61
  ```sh
62
- git clone --branch v1.1.1 https://github.com/hoklims/assertledger.git
62
+ git clone --branch v1.3.0 https://github.com/hoklims/assertledger.git
63
63
  cd assertledger
64
64
  pnpm install --frozen-lockfile
65
65
  pnpm build
@@ -69,9 +69,15 @@ The bundled example contains a correct parity function, an inverted version, a n
69
69
  and the two tests above. Inspect [its request](examples/node-test/request.json), then run:
70
70
 
71
71
  ```sh
72
+ node dist/cli.js demo --allow-unsafe-execution
73
+ # Or inspect the complete manifest directly:
72
74
  node dist/cli.js verify examples/node-test/request.json --allow-unsafe-execution --json
73
75
  ```
74
76
 
77
+ `demo` copies the shipped example to a disposable temporary directory and removes it afterward.
78
+ Its result demonstrates the installed AssertLedger package only; it is not evidence about your
79
+ repository.
80
+
75
81
  > **Run trusted code only.** `--allow-unsafe-execution` authorizes local code execution.
76
82
  > This backend is explicitly **UNSANDBOXED**. Use a trusted checkout; it cannot contain hostile code.
77
83
 
@@ -138,6 +144,19 @@ node dist/cli.js doctor path/to/your-repository
138
144
  node dist/cli.js doctor path/to/your-repository --json
139
145
  ```
140
146
 
147
+ To preview initialization and a read-only agent connection as one conflict-checked operation:
148
+
149
+ ```sh
150
+ node dist/cli.js setup path/to/your-repository --client codex --dry-run
151
+ node dist/cli.js setup path/to/your-repository --client codex --write
152
+ ```
153
+
154
+ Use `--client claude-code` for Claude Code. The preview is also the default when neither mode flag
155
+ is present. Setup checks every initialization and connection target before its first managed-file
156
+ write. If a connection conflict appears after initialization, setup removes only init files that
157
+ this invocation created and that still match its exact bytes. Anything it cannot safely restore is
158
+ reported as `PARTIAL_FAILURE` with exit code 5 and an explicit unresolved-file list.
159
+
141
160
  `WOULD_CREATE` means a configuration can be planned. You still supply the candidate and controls.
142
161
  The [initialization guide](docs/repository-init.md) explains `init`, the configuration and evidence
143
162
  lock. Detection of a framework is not proof that AssertLedger can execute it.
@@ -146,6 +165,15 @@ After initialization, [runtime doctor](docs/runtime-doctor.md) can check Node, t
146
165
  discovery and assertion attribution with `doctor --runtime --allow-unsafe-execution`.
147
166
  For a refusal, use `explain CODE` to get a safe next action.
148
167
 
168
+ ### Bun 1.4.2
169
+
170
+ For a `bun:test` repository, run `assertledger doctor . --framework bun:test`. After `init` and
171
+ the runtime doctor, author v3 regression candidates using `assertSame` from `assertledger/bun`.
172
+ The Bun adapter pins version 1.4.2 and attributes failures from this helper. Native Bun `expect`
173
+ failures remain operational failures and cannot count as target detection. See the
174
+ [Bun migration guide](docs/migration-verification-v3.md) for the request, execution and replay
175
+ contract. The execution mode is explicitly unsandboxed and intended for trusted local code.
176
+
149
177
  ### Qualify a committed regression test
150
178
 
151
179
  Choose the buggy commit (`BEFORE`), its correction (`AFTER`) and a neutral control (`NEUTRAL`).
@@ -194,6 +222,7 @@ The [client guide](docs/client-connections.md) covers installation and removal.
194
222
  | You want to… | Start here |
195
223
  | --- | --- |
196
224
  | Set up a repository | [Initialization](docs/repository-init.md) · [Static audit](docs/repository-audit.md) |
225
+ | Verify a Bun regression | [Bun migration](docs/migration-verification-v3.md) |
197
226
  | Diagnose a blockage | [Runtime doctor](docs/runtime-doctor.md) · [Reason-code guidance](docs/diagnostics.md) |
198
227
  | Try a historical correction | [Unicode-regexp example](examples/git-history/README.md) |
199
228
  | Qualify a correction or connect Codex | [Git workflow](docs/git-regression.md) · [Developer entry points](docs/developer-experience.md) |
@@ -22,15 +22,40 @@
22
22
  "rawSha256": "sha256:687dcfd2b1ecef5fd9fc6d9ac118ceebebc3fdb74c9e162fddc2759e360adfc7",
23
23
  "$id": "https://testforge.dev/schemas/evidence-manifest.v2.json"
24
24
  },
25
+ {
26
+ "path": "schemas/evidence-manifest.v3.json",
27
+ "rawSha256": "sha256:460925ce29c51e47a38e439264f56dac9d444f52a07ec103f38b44e59679adbd",
28
+ "$id": "https://testforge.dev/schemas/evidence-manifest.v3.json"
29
+ },
25
30
  {
26
31
  "path": "schemas/evidence-provider-manifest.v1.json",
27
32
  "rawSha256": "sha256:6100995f772cd24b7369e4428fb1aba570f1ba6e1f61295bc42a1f7ce6b5bde3",
28
33
  "$id": "https://testforge.dev/schemas/evidence-provider-manifest.v1.json"
29
34
  },
35
+ {
36
+ "path": "schemas/repository-init-config.v2.json",
37
+ "rawSha256": "sha256:03176fe2fabd53f1b688815f2d163907ed5771b1b4e45be124a15ccf4e9e2328",
38
+ "$id": "https://testforge.dev/schemas/repository-init-config.v2.json"
39
+ },
40
+ {
41
+ "path": "schemas/repository-init-lock.v2.json",
42
+ "rawSha256": "sha256:d3d81aa21491cd545163a63b579ad87e2b21f7de19a89ca70c6f4de98eb22966",
43
+ "$id": "https://testforge.dev/schemas/repository-init-lock.v2.json"
44
+ },
45
+ {
46
+ "path": "schemas/repository-init-result.v2.json",
47
+ "rawSha256": "sha256:41c984107b3bec203bd049fa8fa0df87e1c3b6b0a421c88a4fdeef18f6b1dea5",
48
+ "$id": "https://testforge.dev/schemas/repository-init-result.v2.json"
49
+ },
30
50
  {
31
51
  "path": "schemas/verification-request.v2.json",
32
52
  "rawSha256": "sha256:cefa0fba0a75435165bf6fdc6ee90b638488cecaab3ad8f40f3e98820a6b8d34",
33
53
  "$id": "https://testforge.dev/schemas/verification-request.v2.json"
54
+ },
55
+ {
56
+ "path": "schemas/verification-request.v3.json",
57
+ "rawSha256": "sha256:3b88e4c58425aa9a45da330b27f4a48d778c1f9a2494ac2a9a4c01b29728fd77",
58
+ "$id": "https://testforge.dev/schemas/verification-request.v3.json"
34
59
  }
35
60
  ]
36
61
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sourceRevision": {
3
3
  "status": "RECORDED",
4
- "commit": "14565465647e7694eabcc3ea1d07d4095d2bbcde",
4
+ "commit": "b9407bff214e37f55e75af9f50e49191a48b8229",
5
5
  "worktree": "CLEAN"
6
6
  }
7
7
  }
package/dist/cli.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env node
2
+ import { runFixtureDemo } from "./engine/demo.js";
3
+ import { setupRepository } from "./engine/setup.js";
2
4
  export interface CliIo {
3
5
  cwd: string;
4
6
  readStdin(): Promise<string>;
5
7
  writeStdout(text: string): void;
6
8
  writeStderr(text: string): void;
7
9
  }
8
- export declare function runCli(argv: string[], io: CliIo): Promise<number>;
10
+ export interface CliDependencies {
11
+ setupEntry?: string;
12
+ setupRepository?: typeof setupRepository;
13
+ runFixtureDemo?: typeof runFixtureDemo;
14
+ }
15
+ export declare function runCli(argv: string[], io: CliIo, dependencies?: CliDependencies): Promise<number>;
9
16
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAwBA,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AA6eD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CA0kBvE"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,OAAO,EAAgD,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWlG,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,eAAe,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;CACxC;AAkoBD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,EAAE,KAAK,EACT,YAAY,GAAE,eAAoB,GACjC,OAAO,CAAC,MAAM,CAAC,CAuvBjB"}