devcontour-harness 0.1.0-alpha.34 → 0.1.0-alpha.37

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 (125) hide show
  1. package/README.md +22 -2
  2. package/docs/contracts.md +309 -35
  3. package/docs/release-notes/0.1.0-alpha.35.md +27 -0
  4. package/docs/release-notes/0.1.0-alpha.36.md +26 -0
  5. package/docs/release-notes/0.1.0-alpha.37.md +40 -0
  6. package/docs/standalone.md +20 -0
  7. package/docs/toolchains.md +57 -2
  8. package/docs/upgrade.md +143 -0
  9. package/lib/agents/cli-adapter.d.ts +10 -1
  10. package/lib/agents/cli-adapter.js +38 -7
  11. package/lib/agents/schemas.d.ts +84 -2
  12. package/lib/agents/schemas.js +49 -1
  13. package/lib/agents/usage.d.ts +9 -0
  14. package/lib/agents/usage.js +22 -1
  15. package/lib/cli.js +149 -1
  16. package/lib/contracts/cli.d.ts +1544 -171
  17. package/lib/contracts/cli.js +233 -2
  18. package/lib/contracts/diagnosis.d.ts +10 -4
  19. package/lib/contracts/diagnosis.js +4 -0
  20. package/lib/contracts/errors.d.ts +9 -1
  21. package/lib/contracts/errors.js +8 -0
  22. package/lib/contracts/events.d.ts +468 -60
  23. package/lib/contracts/events.js +79 -0
  24. package/lib/contracts/execution.d.ts +301 -50
  25. package/lib/contracts/execution.js +60 -0
  26. package/lib/contracts/failure.d.ts +20 -3
  27. package/lib/contracts/failure.js +14 -2
  28. package/lib/contracts/handoff.d.ts +79 -20
  29. package/lib/contracts/handoff.js +42 -1
  30. package/lib/contracts/index.d.ts +1 -0
  31. package/lib/contracts/index.js +1 -0
  32. package/lib/contracts/input-state.d.ts +13 -0
  33. package/lib/contracts/input-state.js +32 -0
  34. package/lib/contracts/input.d.ts +442 -0
  35. package/lib/contracts/input.js +321 -0
  36. package/lib/contracts/planning.d.ts +4 -0
  37. package/lib/contracts/policy.d.ts +17 -2
  38. package/lib/contracts/policy.js +31 -2
  39. package/lib/contracts/ports.d.ts +64 -2
  40. package/lib/contracts/project.d.ts +127 -0
  41. package/lib/contracts/project.js +99 -0
  42. package/lib/contracts/published.d.ts +631 -92
  43. package/lib/contracts/published.js +4 -1
  44. package/lib/contracts/repair-policy.d.ts +30 -1
  45. package/lib/contracts/repair-policy.js +52 -0
  46. package/lib/contracts/report.d.ts +55 -21
  47. package/lib/contracts/report.js +33 -2
  48. package/lib/contracts/result.d.ts +28 -24
  49. package/lib/contracts/review.d.ts +47 -8
  50. package/lib/contracts/review.js +21 -1
  51. package/lib/control/harness.d.ts +2555 -51
  52. package/lib/control/harness.js +112 -6
  53. package/lib/control/recovery.d.ts +2 -2
  54. package/lib/control/report.js +1 -0
  55. package/lib/control/status.d.ts +30 -22
  56. package/lib/control/status.js +11 -1
  57. package/lib/control/workflow.d.ts +8 -8
  58. package/lib/engine/budget.d.ts +86 -3
  59. package/lib/engine/budget.js +45 -10
  60. package/lib/engine/classify.js +1 -1
  61. package/lib/engine/engine.d.ts +3091 -83
  62. package/lib/engine/engine.js +1209 -101
  63. package/lib/engine/failure.d.ts +1 -1
  64. package/lib/engine/failure.js +1 -1
  65. package/lib/engine/input-policy.d.ts +68 -0
  66. package/lib/engine/input-policy.js +285 -0
  67. package/lib/engine/input-requests.d.ts +64 -0
  68. package/lib/engine/input-requests.js +187 -0
  69. package/lib/engine/measured.d.ts +6 -1
  70. package/lib/engine/measured.js +12 -1
  71. package/lib/engine/prompt.d.ts +4 -2
  72. package/lib/engine/prompt.js +13 -1
  73. package/lib/engine/property-recovery.js +4 -0
  74. package/lib/engine/repair.d.ts +2 -0
  75. package/lib/engine/repair.js +13 -4
  76. package/lib/engine/reuse.js +2 -0
  77. package/lib/engine/runner.d.ts +33 -4
  78. package/lib/engine/runner.js +275 -23
  79. package/lib/environment/lifecycle.d.ts +8 -0
  80. package/lib/environment/lifecycle.js +15 -2
  81. package/lib/explain/state.d.ts +16 -2
  82. package/lib/explain/state.js +262 -79
  83. package/lib/handoff/markdown.js +10 -0
  84. package/lib/handoff/pack.js +42 -1
  85. package/lib/index.d.ts +11 -1
  86. package/lib/index.js +11 -1
  87. package/lib/init/inspect.d.ts +34 -0
  88. package/lib/init/inspect.js +292 -0
  89. package/lib/init/project.js +14 -31
  90. package/lib/integrations/connector/commands.d.ts +12 -12
  91. package/lib/integrations/connector/config.d.ts +4 -4
  92. package/lib/integrations/connector/delivery.d.ts +1 -1
  93. package/lib/integrations/relay-v2/protocol.d.ts +4 -4
  94. package/lib/profiles/resolve.d.ts +2 -1
  95. package/lib/projections/enums.d.ts +1 -1
  96. package/lib/projections/enums.js +4 -0
  97. package/lib/projections/index.d.ts +1 -0
  98. package/lib/projections/index.js +1 -0
  99. package/lib/projections/input.d.ts +17 -0
  100. package/lib/projections/input.js +28 -0
  101. package/lib/projections/stop.d.ts +42 -1
  102. package/lib/projections/stop.js +117 -6
  103. package/lib/report/compute.d.ts +4 -1
  104. package/lib/report/compute.js +26 -0
  105. package/lib/report/document.js +2 -1
  106. package/lib/storage/document.d.ts +68 -28
  107. package/lib/testing/index.d.ts +1 -1
  108. package/lib/testing/index.js +1 -1
  109. package/lib/testing/store-contract.d.ts +8 -1
  110. package/lib/testing/store-contract.js +194 -1
  111. package/lib/verification/confirm.d.ts +3 -3
  112. package/lib/verification/corpus.d.ts +9 -9
  113. package/lib/verification/gates.d.ts +119 -0
  114. package/lib/verification/gates.js +311 -4
  115. package/package.json +1 -1
  116. package/schemas/execution-document.schema.json +141 -0
  117. package/schemas/execution-policy.schema.json +26 -0
  118. package/schemas/handoff-pack.schema.json +155 -4
  119. package/schemas/input-request.schema.json +665 -0
  120. package/schemas/project-facts.schema.json +393 -0
  121. package/schemas/result-envelope.schema.json +2 -0
  122. package/schemas/run-event.schema.json +628 -0
  123. package/schemas/run-result.schema.json +2 -0
  124. package/schemas/stop-diagnosis.schema.json +7 -1
  125. package/schemas/value-report.schema.json +79 -7
@@ -733,6 +733,9 @@
733
733
  ],
734
734
  "additionalProperties": false
735
735
  },
736
+ "writerDependencies": {
737
+ "type": "boolean"
738
+ },
736
739
  "dependencyBuild": {
737
740
  "default": [],
738
741
  "type": "array",
@@ -2071,6 +2074,29 @@
2071
2074
  },
2072
2075
  "additionalProperties": false
2073
2076
  },
2077
+ "inputPolicy": {
2078
+ "type": "object",
2079
+ "properties": {
2080
+ "threshold": {
2081
+ "default": 7,
2082
+ "type": "integer",
2083
+ "minimum": 1,
2084
+ "maximum": 11
2085
+ },
2086
+ "criticalPaths": {
2087
+ "default": [],
2088
+ "maxItems": 50,
2089
+ "type": "array",
2090
+ "items": {
2091
+ "type": "string",
2092
+ "minLength": 1,
2093
+ "maxLength": 500,
2094
+ "pattern": "^(?!\\/)(?!.*[\\\\:*?\\[\\]\\x00])(?!(?:.*\\/)?\\.{1,2}(?:\\/|$))(?=.{1,500}$).+$"
2095
+ }
2096
+ }
2097
+ },
2098
+ "additionalProperties": false
2099
+ },
2074
2100
  "maxAttempts": {
2075
2101
  "default": 3,
2076
2102
  "type": "integer",
@@ -140,6 +140,7 @@
140
140
  "environment",
141
141
  "timeout",
142
142
  "stalled",
143
+ "context-exhausted",
143
144
  "stale-base",
144
145
  "empty-result",
145
146
  "unfinished",
@@ -151,6 +152,7 @@
151
152
  "cancelled",
152
153
  "budget",
153
154
  "needs-lead",
155
+ "needs-input",
154
156
  "unknown"
155
157
  ]
156
158
  }
@@ -185,6 +187,8 @@
185
187
  "BUDGET_EXHAUSTED",
186
188
  "BUDGET_UNKNOWN",
187
189
  "ATTEMPTS_EXHAUSTED",
190
+ "CONTEXT_EXHAUSTED",
191
+ "INPUT_REQUIRED",
188
192
  "REVISION_CONFLICT",
189
193
  "CANCELLED",
190
194
  "NOT_FOUND",
@@ -229,7 +233,9 @@
229
233
  "user-decision",
230
234
  "resume-queue",
231
235
  "fix-environment",
232
- "fix-access"
236
+ "fix-access",
237
+ "answer-input",
238
+ "apply-input"
233
239
  ]
234
240
  }
235
241
  },
@@ -497,6 +503,7 @@
497
503
  "environment",
498
504
  "timeout",
499
505
  "stalled",
506
+ "context-exhausted",
500
507
  "stale-base",
501
508
  "empty-result",
502
509
  "unfinished",
@@ -508,6 +515,7 @@
508
515
  "cancelled",
509
516
  "budget",
510
517
  "needs-lead",
518
+ "needs-input",
511
519
  "unknown"
512
520
  ]
513
521
  },
@@ -590,6 +598,8 @@
590
598
  "BUDGET_EXHAUSTED",
591
599
  "BUDGET_UNKNOWN",
592
600
  "ATTEMPTS_EXHAUSTED",
601
+ "CONTEXT_EXHAUSTED",
602
+ "INPUT_REQUIRED",
593
603
  "REVISION_CONFLICT",
594
604
  "CANCELLED",
595
605
  "NOT_FOUND",
@@ -654,7 +664,9 @@
654
664
  "user-decision",
655
665
  "resume-queue",
656
666
  "fix-environment",
657
- "fix-access"
667
+ "fix-access",
668
+ "answer-input",
669
+ "apply-input"
658
670
  ]
659
671
  },
660
672
  "step": {
@@ -744,6 +756,8 @@
744
756
  "BUDGET_EXHAUSTED",
745
757
  "BUDGET_UNKNOWN",
746
758
  "ATTEMPTS_EXHAUSTED",
759
+ "CONTEXT_EXHAUSTED",
760
+ "INPUT_REQUIRED",
747
761
  "REVISION_CONFLICT",
748
762
  "CANCELLED",
749
763
  "NOT_FOUND",
@@ -765,6 +779,7 @@
765
779
  "environment",
766
780
  "timeout",
767
781
  "stalled",
782
+ "context-exhausted",
768
783
  "stale-base",
769
784
  "empty-result",
770
785
  "unfinished",
@@ -776,6 +791,7 @@
776
791
  "cancelled",
777
792
  "budget",
778
793
  "needs-lead",
794
+ "needs-input",
779
795
  "unknown",
780
796
  "runtime-missing",
781
797
  "controller-busy",
@@ -826,7 +842,9 @@
826
842
  "user-decision",
827
843
  "resume-queue",
828
844
  "fix-environment",
829
- "fix-access"
845
+ "fix-access",
846
+ "answer-input",
847
+ "apply-input"
830
848
  ]
831
849
  },
832
850
  "retryPlanned": {
@@ -971,6 +989,7 @@
971
989
  "environment",
972
990
  "timeout",
973
991
  "stalled",
992
+ "context-exhausted",
974
993
  "stale-base",
975
994
  "empty-result",
976
995
  "unfinished",
@@ -982,6 +1001,7 @@
982
1001
  "cancelled",
983
1002
  "budget",
984
1003
  "needs-lead",
1004
+ "needs-input",
985
1005
  "unknown"
986
1006
  ]
987
1007
  },
@@ -1011,6 +1031,8 @@
1011
1031
  "BUDGET_EXHAUSTED",
1012
1032
  "BUDGET_UNKNOWN",
1013
1033
  "ATTEMPTS_EXHAUSTED",
1034
+ "CONTEXT_EXHAUSTED",
1035
+ "INPUT_REQUIRED",
1014
1036
  "REVISION_CONFLICT",
1015
1037
  "CANCELLED",
1016
1038
  "NOT_FOUND",
@@ -1205,6 +1227,125 @@
1205
1227
  "additionalProperties": false
1206
1228
  }
1207
1229
  },
1230
+ "inputs": {
1231
+ "maxItems": 10,
1232
+ "type": "array",
1233
+ "items": {
1234
+ "type": "object",
1235
+ "properties": {
1236
+ "requestId": {
1237
+ "type": "string",
1238
+ "maxLength": 201
1239
+ },
1240
+ "workId": {
1241
+ "type": "string",
1242
+ "pattern": "^[A-Za-z0-9_-]{1,80}$"
1243
+ },
1244
+ "kind": {
1245
+ "type": "string",
1246
+ "enum": [
1247
+ "question",
1248
+ "follow-up"
1249
+ ]
1250
+ },
1251
+ "state": {
1252
+ "type": "string",
1253
+ "enum": [
1254
+ "awaiting-answer",
1255
+ "answered-not-applied",
1256
+ "applied-awaiting-claim",
1257
+ "carry-stale"
1258
+ ]
1259
+ },
1260
+ "severity": {
1261
+ "type": "integer",
1262
+ "minimum": 1,
1263
+ "maximum": 10
1264
+ },
1265
+ "question": {
1266
+ "type": "string",
1267
+ "maxLength": 301
1268
+ },
1269
+ "options": {
1270
+ "maxItems": 6,
1271
+ "type": "array",
1272
+ "items": {
1273
+ "type": "string",
1274
+ "maxLength": 201
1275
+ }
1276
+ },
1277
+ "answer": {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "revision": {
1281
+ "type": "integer",
1282
+ "exclusiveMinimum": 0,
1283
+ "maximum": 9007199254740991
1284
+ },
1285
+ "digest": {
1286
+ "type": "string",
1287
+ "pattern": "^[a-f0-9]{64}$"
1288
+ },
1289
+ "excerpt": {
1290
+ "type": "string",
1291
+ "maxLength": 501
1292
+ }
1293
+ },
1294
+ "required": [
1295
+ "revision",
1296
+ "digest",
1297
+ "excerpt"
1298
+ ],
1299
+ "additionalProperties": false
1300
+ },
1301
+ "origin": {
1302
+ "type": "object",
1303
+ "properties": {
1304
+ "graphDigest": {
1305
+ "type": "string",
1306
+ "pattern": "^[a-f0-9]{64}$"
1307
+ },
1308
+ "orderDigest": {
1309
+ "type": "string",
1310
+ "pattern": "^[a-f0-9]{64}$"
1311
+ },
1312
+ "contextDigest": {
1313
+ "anyOf": [
1314
+ {
1315
+ "type": "string",
1316
+ "pattern": "^[a-f0-9]{64}$"
1317
+ },
1318
+ {
1319
+ "type": "null"
1320
+ }
1321
+ ]
1322
+ }
1323
+ },
1324
+ "required": [
1325
+ "graphDigest",
1326
+ "orderDigest",
1327
+ "contextDigest"
1328
+ ],
1329
+ "additionalProperties": false
1330
+ },
1331
+ "targetDigest": {
1332
+ "type": "string",
1333
+ "pattern": "^[a-f0-9]{64}$"
1334
+ }
1335
+ },
1336
+ "required": [
1337
+ "requestId",
1338
+ "workId",
1339
+ "kind",
1340
+ "state",
1341
+ "severity",
1342
+ "question",
1343
+ "options",
1344
+ "origin"
1345
+ ],
1346
+ "additionalProperties": false
1347
+ }
1348
+ },
1208
1349
  "next": {
1209
1350
  "type": "object",
1210
1351
  "properties": {
@@ -1238,7 +1379,9 @@
1238
1379
  "user-decision",
1239
1380
  "resume-queue",
1240
1381
  "fix-environment",
1241
- "fix-access"
1382
+ "fix-access",
1383
+ "answer-input",
1384
+ "apply-input"
1242
1385
  ]
1243
1386
  },
1244
1387
  "step": {
@@ -1307,6 +1450,8 @@
1307
1450
  "BUDGET_EXHAUSTED",
1308
1451
  "BUDGET_UNKNOWN",
1309
1452
  "ATTEMPTS_EXHAUSTED",
1453
+ "CONTEXT_EXHAUSTED",
1454
+ "INPUT_REQUIRED",
1310
1455
  "REVISION_CONFLICT",
1311
1456
  "CANCELLED",
1312
1457
  "NOT_FOUND",
@@ -1381,6 +1526,12 @@
1381
1526
  "minimum": 0,
1382
1527
  "maximum": 9007199254740991
1383
1528
  },
1529
+ "inputs": {
1530
+ "default": 0,
1531
+ "type": "integer",
1532
+ "minimum": 0,
1533
+ "maximum": 9007199254740991
1534
+ },
1384
1535
  "intentions": {
1385
1536
  "type": "integer",
1386
1537
  "minimum": 0,