clean-room-skill 0.1.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 (56) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.claude-plugin/plugin.json +20 -0
  3. package/.codex-plugin/plugin.json +36 -0
  4. package/LICENSE +21 -0
  5. package/README.md +376 -0
  6. package/agents/clean-architect.md +27 -0
  7. package/agents/clean-qa-editor.md +27 -0
  8. package/agents/contaminated-manager-verifier.md +35 -0
  9. package/agents/contaminated-source-analyst.md +26 -0
  10. package/bin/install.js +535 -0
  11. package/examples/codex/.codex/agents/clean-architect.toml +17 -0
  12. package/examples/codex/.codex/agents/clean-qa-editor.toml +17 -0
  13. package/examples/codex/.codex/agents/contaminated-manager-verifier.toml +21 -0
  14. package/examples/codex/.codex/agents/contaminated-source-analyst.toml +17 -0
  15. package/hooks/check-artifact-leakage.py +317 -0
  16. package/hooks/clean-room-hook.py +88 -0
  17. package/hooks/clean_room_paths.py +130 -0
  18. package/hooks/deny-clean-room-shell.py +30 -0
  19. package/hooks/deny-clean-source-read.py +104 -0
  20. package/hooks/deny-contaminated-clean-write.py +134 -0
  21. package/hooks/hooks.json +44 -0
  22. package/hooks/require-clean-room-env.py +127 -0
  23. package/hooks/validate-handoff-package.py +140 -0
  24. package/hooks/validate-json-schema.py +283 -0
  25. package/lib/fs-utils.cjs +123 -0
  26. package/lib/hooks.cjs +214 -0
  27. package/package.json +49 -0
  28. package/plugin.json +20 -0
  29. package/skills/attended/SKILL.md +25 -0
  30. package/skills/clean-room/SKILL.md +134 -0
  31. package/skills/clean-room/assets/behavior-spec.schema.json +367 -0
  32. package/skills/clean-room/assets/contamination-incident.schema.json +60 -0
  33. package/skills/clean-room/assets/coverage-ledger.schema.json +139 -0
  34. package/skills/clean-room/assets/evidence-ledger.schema.json +80 -0
  35. package/skills/clean-room/assets/handoff-package.schema.json +114 -0
  36. package/skills/clean-room/assets/qc-report.schema.json +248 -0
  37. package/skills/clean-room/assets/skeleton-manifest.schema.json +239 -0
  38. package/skills/clean-room/assets/source-index.schema.json +622 -0
  39. package/skills/clean-room/assets/task-manifest.schema.json +593 -0
  40. package/skills/clean-room/examples/README.md +18 -0
  41. package/skills/clean-room/examples/minimal-spec-package/behavior-spec.json +61 -0
  42. package/skills/clean-room/examples/minimal-spec-package/coverage-ledger.json +27 -0
  43. package/skills/clean-room/examples/minimal-spec-package/evidence-ledger.json +17 -0
  44. package/skills/clean-room/examples/minimal-spec-package/handoff-package.json +26 -0
  45. package/skills/clean-room/examples/minimal-spec-package/qc-report.json +25 -0
  46. package/skills/clean-room/examples/minimal-spec-package/skeleton-manifest.json +45 -0
  47. package/skills/clean-room/examples/minimal-spec-package/source-index.json +156 -0
  48. package/skills/clean-room/examples/minimal-spec-package/task-manifest.json +220 -0
  49. package/skills/clean-room/references/LEAKAGE-RULES.md +92 -0
  50. package/skills/clean-room/references/PROCESS.md +185 -0
  51. package/skills/clean-room/references/SPEC-SCHEMA.md +185 -0
  52. package/skills/clean-room/references/TARGET-LANGUAGE-GUIDE.md +43 -0
  53. package/skills/clean-room/scripts/build_source_index.py +1253 -0
  54. package/skills/clean-room/scripts/clean_room_tool_manager.py +199 -0
  55. package/skills/clean-room/scripts/clean_room_tooling.py +370 -0
  56. package/skills/unattended/SKILL.md +26 -0
@@ -0,0 +1,622 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Clean-Room Source Index",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "index_id",
8
+ "task_id",
9
+ "created_at",
10
+ "created_by_role",
11
+ "domain",
12
+ "generator",
13
+ "limits",
14
+ "source_roots",
15
+ "files",
16
+ "relationships",
17
+ "groups",
18
+ "recommended_batches",
19
+ "skipped_entries",
20
+ "aggregate_metrics"
21
+ ],
22
+ "properties": {
23
+ "$schema": {
24
+ "type": "string"
25
+ },
26
+ "index_id": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "task_id": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "created_at": {
35
+ "type": "string",
36
+ "format": "date-time"
37
+ },
38
+ "created_by_role": {
39
+ "enum": [
40
+ "controller-preflight",
41
+ "contaminated-manager-verifier"
42
+ ]
43
+ },
44
+ "domain": {
45
+ "const": "contaminated"
46
+ },
47
+ "generator": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": [
51
+ "name",
52
+ "version",
53
+ "python_version",
54
+ "scanner_modes"
55
+ ],
56
+ "properties": {
57
+ "name": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ },
61
+ "version": {
62
+ "type": "string",
63
+ "minLength": 1
64
+ },
65
+ "python_version": {
66
+ "type": "string",
67
+ "minLength": 1
68
+ },
69
+ "scanner_modes": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string",
73
+ "minLength": 1
74
+ }
75
+ }
76
+ }
77
+ },
78
+ "limits": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": [
82
+ "max_files",
83
+ "max_file_bytes",
84
+ "max_total_bytes",
85
+ "max_batch_tokens",
86
+ "ignore_dirs"
87
+ ],
88
+ "properties": {
89
+ "max_files": {
90
+ "type": "integer"
91
+ },
92
+ "max_file_bytes": {
93
+ "type": "integer"
94
+ },
95
+ "max_total_bytes": {
96
+ "type": "integer"
97
+ },
98
+ "max_batch_tokens": {
99
+ "type": "integer"
100
+ },
101
+ "large_file_words": {
102
+ "type": "integer"
103
+ },
104
+ "large_group_words": {
105
+ "type": "integer"
106
+ },
107
+ "max_file_segments": {
108
+ "type": "integer"
109
+ },
110
+ "ignore_dirs": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string",
114
+ "minLength": 1
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "dependency_report": {
120
+ "type": [
121
+ "object",
122
+ "null"
123
+ ]
124
+ },
125
+ "source_roots": {
126
+ "type": "array",
127
+ "items": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "root_id",
132
+ "path"
133
+ ],
134
+ "properties": {
135
+ "root_id": {
136
+ "type": "string",
137
+ "minLength": 1
138
+ },
139
+ "path": {
140
+ "type": "string",
141
+ "minLength": 1
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "files": {
147
+ "type": "array",
148
+ "items": {
149
+ "type": "object",
150
+ "additionalProperties": false,
151
+ "required": [
152
+ "file_id",
153
+ "root_id",
154
+ "path",
155
+ "language",
156
+ "scanner",
157
+ "metrics",
158
+ "imports",
159
+ "exports"
160
+ ],
161
+ "properties": {
162
+ "file_id": {
163
+ "type": "string",
164
+ "minLength": 1
165
+ },
166
+ "root_id": {
167
+ "type": "string",
168
+ "minLength": 1
169
+ },
170
+ "path": {
171
+ "type": "string",
172
+ "minLength": 1
173
+ },
174
+ "language": {
175
+ "enum": [
176
+ "python",
177
+ "javascript",
178
+ "typescript",
179
+ "go",
180
+ "rust",
181
+ "java",
182
+ "kotlin",
183
+ "swift",
184
+ "c",
185
+ "cpp",
186
+ "csharp",
187
+ "text"
188
+ ]
189
+ },
190
+ "scanner": {
191
+ "enum": [
192
+ "python-ast",
193
+ "python-ast-error",
194
+ "javascript-typescript-scanner",
195
+ "go-scanner",
196
+ "rust-scanner",
197
+ "java-scanner",
198
+ "kotlin-scanner",
199
+ "swift-scanner",
200
+ "c-scanner",
201
+ "cpp-scanner",
202
+ "csharp-scanner",
203
+ "text-metrics"
204
+ ]
205
+ },
206
+ "metrics": {
207
+ "$ref": "#/$defs/metrics"
208
+ },
209
+ "imports": {
210
+ "type": "array",
211
+ "items": {
212
+ "$ref": "#/$defs/import"
213
+ }
214
+ },
215
+ "exports": {
216
+ "type": "array",
217
+ "items": {
218
+ "$ref": "#/$defs/export"
219
+ }
220
+ }
221
+ }
222
+ }
223
+ },
224
+ "file_segments": {
225
+ "type": "array",
226
+ "items": {
227
+ "$ref": "#/$defs/file_segment"
228
+ }
229
+ },
230
+ "relationships": {
231
+ "type": "array",
232
+ "items": {
233
+ "type": "object",
234
+ "additionalProperties": false,
235
+ "required": [
236
+ "from_file_id",
237
+ "to_file_id",
238
+ "specifier",
239
+ "kind"
240
+ ],
241
+ "properties": {
242
+ "from_file_id": {
243
+ "type": "string",
244
+ "minLength": 1
245
+ },
246
+ "to_file_id": {
247
+ "type": [
248
+ "string",
249
+ "null"
250
+ ]
251
+ },
252
+ "specifier": {
253
+ "type": "string",
254
+ "minLength": 1
255
+ },
256
+ "kind": {
257
+ "type": "string",
258
+ "minLength": 1
259
+ }
260
+ }
261
+ }
262
+ },
263
+ "groups": {
264
+ "type": "array",
265
+ "items": {
266
+ "type": "object",
267
+ "additionalProperties": false,
268
+ "required": [
269
+ "group_id",
270
+ "reason",
271
+ "file_ids",
272
+ "metrics",
273
+ "notes"
274
+ ],
275
+ "properties": {
276
+ "group_id": {
277
+ "type": "string",
278
+ "minLength": 1
279
+ },
280
+ "reason": {
281
+ "enum": [
282
+ "dependency-component",
283
+ "directory-cluster"
284
+ ]
285
+ },
286
+ "file_ids": {
287
+ "type": "array",
288
+ "items": {
289
+ "type": "string",
290
+ "minLength": 1
291
+ }
292
+ },
293
+ "metrics": {
294
+ "$ref": "#/$defs/metrics"
295
+ },
296
+ "language_counts": {
297
+ "$ref": "#/$defs/language_counts"
298
+ },
299
+ "relationship_count": {
300
+ "type": "integer"
301
+ },
302
+ "notes": {
303
+ "type": "string"
304
+ }
305
+ }
306
+ }
307
+ },
308
+ "recommended_batches": {
309
+ "type": "array",
310
+ "items": {
311
+ "type": "object",
312
+ "additionalProperties": false,
313
+ "required": [
314
+ "batch_id",
315
+ "group_ids",
316
+ "file_ids",
317
+ "metrics",
318
+ "notes"
319
+ ],
320
+ "properties": {
321
+ "batch_id": {
322
+ "type": "string",
323
+ "minLength": 1
324
+ },
325
+ "group_ids": {
326
+ "type": "array",
327
+ "items": {
328
+ "type": "string",
329
+ "minLength": 1
330
+ }
331
+ },
332
+ "file_ids": {
333
+ "type": "array",
334
+ "items": {
335
+ "type": "string",
336
+ "minLength": 1
337
+ }
338
+ },
339
+ "segment_ids": {
340
+ "type": "array",
341
+ "items": {
342
+ "type": "string",
343
+ "minLength": 1
344
+ }
345
+ },
346
+ "metrics": {
347
+ "$ref": "#/$defs/metrics"
348
+ },
349
+ "language_counts": {
350
+ "$ref": "#/$defs/language_counts"
351
+ },
352
+ "notes": {
353
+ "type": "string"
354
+ }
355
+ }
356
+ }
357
+ },
358
+ "large_items": {
359
+ "type": "array",
360
+ "items": {
361
+ "$ref": "#/$defs/large_item"
362
+ }
363
+ },
364
+ "skipped_entries": {
365
+ "type": "array",
366
+ "items": {
367
+ "type": "object",
368
+ "additionalProperties": false,
369
+ "required": [
370
+ "path",
371
+ "reason",
372
+ "kind"
373
+ ],
374
+ "properties": {
375
+ "path": {
376
+ "type": "string",
377
+ "minLength": 1
378
+ },
379
+ "reason": {
380
+ "type": "string",
381
+ "minLength": 1
382
+ },
383
+ "kind": {
384
+ "enum": [
385
+ "file",
386
+ "directory"
387
+ ]
388
+ }
389
+ }
390
+ }
391
+ },
392
+ "aggregate_metrics": {
393
+ "type": "object",
394
+ "additionalProperties": false,
395
+ "required": [
396
+ "bytes",
397
+ "lines",
398
+ "words",
399
+ "characters",
400
+ "estimated_tokens",
401
+ "file_count",
402
+ "skipped_count",
403
+ "skipped_entries_truncated",
404
+ "relationship_count",
405
+ "resolved_relationship_count",
406
+ "group_count",
407
+ "batch_count"
408
+ ],
409
+ "properties": {
410
+ "bytes": {
411
+ "type": "integer"
412
+ },
413
+ "lines": {
414
+ "type": "integer"
415
+ },
416
+ "words": {
417
+ "type": "integer"
418
+ },
419
+ "characters": {
420
+ "type": "integer"
421
+ },
422
+ "estimated_tokens": {
423
+ "type": "integer"
424
+ },
425
+ "file_count": {
426
+ "type": "integer"
427
+ },
428
+ "file_segment_count": {
429
+ "type": "integer"
430
+ },
431
+ "skipped_count": {
432
+ "type": "integer"
433
+ },
434
+ "skipped_entries_truncated": {
435
+ "type": "boolean"
436
+ },
437
+ "relationship_count": {
438
+ "type": "integer"
439
+ },
440
+ "resolved_relationship_count": {
441
+ "type": "integer"
442
+ },
443
+ "group_count": {
444
+ "type": "integer"
445
+ },
446
+ "batch_count": {
447
+ "type": "integer"
448
+ },
449
+ "large_item_count": {
450
+ "type": "integer"
451
+ }
452
+ }
453
+ }
454
+ },
455
+ "$defs": {
456
+ "metrics": {
457
+ "type": "object",
458
+ "additionalProperties": false,
459
+ "required": [
460
+ "bytes",
461
+ "lines",
462
+ "words",
463
+ "characters",
464
+ "estimated_tokens"
465
+ ],
466
+ "properties": {
467
+ "bytes": {
468
+ "type": "integer"
469
+ },
470
+ "lines": {
471
+ "type": "integer"
472
+ },
473
+ "words": {
474
+ "type": "integer"
475
+ },
476
+ "characters": {
477
+ "type": "integer"
478
+ },
479
+ "estimated_tokens": {
480
+ "type": "integer"
481
+ }
482
+ }
483
+ },
484
+ "language_counts": {
485
+ "type": "object",
486
+ "additionalProperties": {
487
+ "type": "integer"
488
+ }
489
+ },
490
+ "file_segment": {
491
+ "type": "object",
492
+ "additionalProperties": false,
493
+ "required": [
494
+ "segment_id",
495
+ "file_id",
496
+ "ordinal",
497
+ "start_line",
498
+ "end_line",
499
+ "metrics",
500
+ "reason"
501
+ ],
502
+ "properties": {
503
+ "segment_id": {
504
+ "type": "string",
505
+ "minLength": 1
506
+ },
507
+ "file_id": {
508
+ "type": "string",
509
+ "minLength": 1
510
+ },
511
+ "ordinal": {
512
+ "type": "integer"
513
+ },
514
+ "start_line": {
515
+ "type": "integer"
516
+ },
517
+ "end_line": {
518
+ "type": "integer"
519
+ },
520
+ "metrics": {
521
+ "$ref": "#/$defs/metrics"
522
+ },
523
+ "reason": {
524
+ "enum": [
525
+ "large-file-token-count",
526
+ "large-file-word-count"
527
+ ]
528
+ }
529
+ }
530
+ },
531
+ "large_item": {
532
+ "type": "object",
533
+ "additionalProperties": false,
534
+ "required": [
535
+ "item_id",
536
+ "kind",
537
+ "metrics",
538
+ "reason",
539
+ "notes"
540
+ ],
541
+ "properties": {
542
+ "item_id": {
543
+ "type": "string",
544
+ "minLength": 1
545
+ },
546
+ "kind": {
547
+ "enum": [
548
+ "file",
549
+ "group",
550
+ "batch"
551
+ ]
552
+ },
553
+ "metrics": {
554
+ "$ref": "#/$defs/metrics"
555
+ },
556
+ "reason": {
557
+ "enum": [
558
+ "word-count-threshold",
559
+ "token-threshold"
560
+ ]
561
+ },
562
+ "notes": {
563
+ "type": "string"
564
+ }
565
+ }
566
+ },
567
+ "import": {
568
+ "type": "object",
569
+ "additionalProperties": false,
570
+ "required": [
571
+ "specifier",
572
+ "kind",
573
+ "is_relative",
574
+ "names",
575
+ "resolved_file_id"
576
+ ],
577
+ "properties": {
578
+ "specifier": {
579
+ "type": "string",
580
+ "minLength": 1
581
+ },
582
+ "kind": {
583
+ "type": "string",
584
+ "minLength": 1
585
+ },
586
+ "is_relative": {
587
+ "type": "boolean"
588
+ },
589
+ "names": {
590
+ "type": "array",
591
+ "items": {
592
+ "type": "string"
593
+ }
594
+ },
595
+ "resolved_file_id": {
596
+ "type": [
597
+ "string",
598
+ "null"
599
+ ]
600
+ }
601
+ }
602
+ },
603
+ "export": {
604
+ "type": "object",
605
+ "additionalProperties": false,
606
+ "required": [
607
+ "name",
608
+ "kind"
609
+ ],
610
+ "properties": {
611
+ "name": {
612
+ "type": "string",
613
+ "minLength": 1
614
+ },
615
+ "kind": {
616
+ "type": "string",
617
+ "minLength": 1
618
+ }
619
+ }
620
+ }
621
+ }
622
+ }