@cassiomc1/forgeloop 1.3.0 → 1.6.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 (163) hide show
  1. package/.github/copilot-instructions.md +1 -0
  2. package/AGENTS.md +1 -0
  3. package/CLAUDE.md +1 -0
  4. package/DOCS_INDEX.md +20 -8
  5. package/EXECUTION_STATE.md +60 -0
  6. package/LOOP_ENGINEERING.md +135 -5
  7. package/LOOP_SYSTEM_DESIGN.md +54 -1
  8. package/PROTOCOL_INTEGRATION.md +87 -0
  9. package/QUALITY_SCORECARD.md +2 -0
  10. package/README.md +69 -9
  11. package/TERMINOLOGY.md +15 -0
  12. package/THIRD_PARTY_NOTICES.md +30 -0
  13. package/THREAT_MODEL.md +59 -1
  14. package/docs/ARTIFACT_REFERENCE.md +183 -0
  15. package/docs/CLI_REFERENCE.md +391 -6
  16. package/docs/CROSS_HARNESS_CONTINUITY.md +23 -0
  17. package/docs/DIAGNOSTIC_MODEL.md +181 -0
  18. package/docs/DOCUMENTATION_GUIDE.md +36 -13
  19. package/docs/EXECUTION_TRACE.md +76 -0
  20. package/docs/GETTING_STARTED.md +1 -0
  21. package/docs/MCP.md +159 -0
  22. package/docs/RECIPES.md +149 -0
  23. package/docs/RELEASE_CHECKLIST_1_4.md +38 -0
  24. package/docs/RELEASE_CHECKLIST_1_5_MCP.md +78 -0
  25. package/docs/TROUBLESHOOTING.md +217 -3
  26. package/docs/UNIVERSAL_INTEGRATION.md +48 -0
  27. package/docs/assets/diagrams/forgeloop-engineering-flow.html +13797 -0
  28. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +37 -0
  29. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +5002 -0
  30. package/docs/diagrams/README.md +55 -0
  31. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +122 -0
  32. package/docs/diagrams/manifest.json +42 -0
  33. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +20 -0
  34. package/package.json +21 -8
  35. package/schemas/action.schema.json +100 -0
  36. package/schemas/approval.schema.json +51 -0
  37. package/schemas/capability-policy.schema.json +41 -0
  38. package/schemas/diagnostic-case.schema.json +85 -0
  39. package/schemas/execution-receipt.schema.json +16 -0
  40. package/schemas/hypothesis-disposition.schema.json +16 -0
  41. package/schemas/intervention.schema.json +27 -0
  42. package/schemas/policy-lock.schema.json +1 -0
  43. package/schemas/policy-snapshot.schema.json +2 -0
  44. package/schemas/task-recovery.schema.json +61 -0
  45. package/schemas/trajectory-evaluation.schema.json +64 -0
  46. package/schemas/trajectory-scenario.schema.json +42 -0
  47. package/src/cli.js +267 -347
  48. package/src/commands/action-authorize.js +41 -0
  49. package/src/commands/action-propose.js +10 -0
  50. package/src/commands/action-reconcile.js +10 -0
  51. package/src/commands/action-record.js +47 -0
  52. package/src/commands/action-show.js +10 -0
  53. package/src/commands/action-verify.js +10 -0
  54. package/src/commands/advance.js +7 -2
  55. package/src/commands/approval-request.js +64 -0
  56. package/src/commands/approval-resolve.js +10 -0
  57. package/src/commands/audit.js +5 -0
  58. package/src/commands/baseline.js +3 -3
  59. package/src/commands/eval.js +6 -0
  60. package/src/commands/history.js +18 -0
  61. package/src/commands/init.js +2 -2
  62. package/src/commands/inspect.js +55 -0
  63. package/src/commands/metrics.js +7 -0
  64. package/src/commands/next.js +8 -2
  65. package/src/commands/policy-discover.js +2 -2
  66. package/src/commands/progress.js +6 -2
  67. package/src/commands/record-diagnosis.js +37 -1
  68. package/src/commands/record-hypothesis-disposition.js +45 -0
  69. package/src/commands/record-intervention.js +35 -0
  70. package/src/commands/reflect.js +38 -0
  71. package/src/commands/report.js +9 -1
  72. package/src/commands/run-action.js +18 -0
  73. package/src/commands/status.js +17 -0
  74. package/src/commands/task-create.js +39 -1
  75. package/src/commands/task-list.js +14 -1
  76. package/src/commands/task-lock-status.js +2 -2
  77. package/src/commands/task-recover.js +202 -0
  78. package/src/commands/task-repair-legacy-recovery.js +417 -0
  79. package/src/commands/task-resume.js +172 -0
  80. package/src/commands/task-scope.js +23 -4
  81. package/src/commands/task-show.js +18 -4
  82. package/src/commands/trace.js +34 -0
  83. package/src/commands/validate-protocol.js +40 -15
  84. package/src/core/action-authorization.js +106 -0
  85. package/src/core/action-constants.js +86 -0
  86. package/src/core/action-execution.js +105 -0
  87. package/src/core/action-ledger-projection.js +302 -0
  88. package/src/core/action-model.js +581 -0
  89. package/src/core/action-readiness.js +141 -0
  90. package/src/core/action-reconciliation-policy.js +49 -0
  91. package/src/core/action-reconciliation.js +66 -0
  92. package/src/core/action-verification.js +111 -0
  93. package/src/core/actions.js +462 -0
  94. package/src/core/approvals.js +405 -0
  95. package/src/core/artifact-registry.js +60 -0
  96. package/src/core/audit.js +45 -4
  97. package/src/core/bundles.js +30 -0
  98. package/src/core/capability-policy.js +226 -0
  99. package/src/core/cli-command-definitions.js +260 -5
  100. package/src/core/command-executors.js +543 -0
  101. package/src/core/command-input.js +107 -0
  102. package/src/core/command-runtime.js +117 -0
  103. package/src/core/completion-artifacts.js +39 -15
  104. package/src/core/completion-ownership.js +88 -0
  105. package/src/core/completion-recovery-rebind.js +194 -0
  106. package/src/core/completion.js +70 -0
  107. package/src/core/continuity-reconciliation.js +24 -5
  108. package/src/core/diagnostic-model.js +396 -0
  109. package/src/core/diagnostic-projection.js +51 -0
  110. package/src/core/diagnostic-record.js +360 -0
  111. package/src/core/error-codes.js +461 -1
  112. package/src/core/events.js +171 -2
  113. package/src/core/execution-prerequisites.js +4 -1
  114. package/src/core/execution.js +26 -188
  115. package/src/core/failure-signature.js +70 -0
  116. package/src/core/failure-surface.js +57 -0
  117. package/src/core/filesystem.js +55 -6
  118. package/src/core/history.js +110 -0
  119. package/src/core/hypothesis-projection.js +85 -0
  120. package/src/core/information-gain-projection.js +283 -0
  121. package/src/core/information-gain.js +138 -0
  122. package/src/core/inspect.js +132 -7
  123. package/src/core/integration-invocation-policy.js +217 -0
  124. package/src/core/integration-limits.js +20 -0
  125. package/src/core/integration-resources.js +178 -0
  126. package/src/core/next-action-model.js +94 -0
  127. package/src/core/next-action.js +490 -3
  128. package/src/core/phase.js +42 -22
  129. package/src/core/policy-engine.js +113 -6
  130. package/src/core/preflight-consistency.js +31 -5
  131. package/src/core/preflight.js +19 -2
  132. package/src/core/prepared-execution.js +227 -0
  133. package/src/core/progress.js +41 -4
  134. package/src/core/project-root.js +21 -0
  135. package/src/core/protocol-info.js +61 -0
  136. package/src/core/protocol.js +14 -0
  137. package/src/core/receipt.js +1 -0
  138. package/src/core/reconcile-closure.js +35 -10
  139. package/src/core/recovery-history.js +116 -0
  140. package/src/core/reflection.js +305 -0
  141. package/src/core/resumability.js +57 -3
  142. package/src/core/schema-validation.js +9 -0
  143. package/src/core/strategy-analysis.js +97 -0
  144. package/src/core/task-claim-state.js +272 -0
  145. package/src/core/task-command.js +5 -1
  146. package/src/core/task-conflict-inspection.js +321 -0
  147. package/src/core/task-context.js +32 -29
  148. package/src/core/task-discovery.js +14 -1
  149. package/src/core/task-lock.js +216 -22
  150. package/src/core/task-paths.js +31 -2
  151. package/src/core/task-recovery-migration.js +192 -0
  152. package/src/core/task-recovery.js +205 -0
  153. package/src/core/task-scope.js +33 -1
  154. package/src/core/task-snapshot.js +53 -0
  155. package/src/core/templates.js +9 -0
  156. package/src/core/trace.js +548 -0
  157. package/src/core/trajectory-evaluation.js +71 -0
  158. package/src/core/trajectory-metrics.js +80 -0
  159. package/src/core/transaction.js +36 -2
  160. package/src/core/work-state.js +10 -5
  161. package/src/integration.js +47 -0
  162. package/docs/assets/forgeloop-flow.svg +0 -1
  163. package/docs/forgeloop-flow.mmd +0 -51
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/intervention.schema.json",
4
+ "title": "ForgeLoop intervention record",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "verificationCycle", "intervention"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "verificationCycle": { "type": "integer", "minimum": 1 },
10
+ "intervention": {
11
+ "type": "object",
12
+ "required": ["id", "kind", "statement", "hypothesisRefs"],
13
+ "properties": {
14
+ "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
15
+ "kind": { "enum": ["CODE_CHANGE", "CONFIG_CHANGE", "TEST_CHANGE", "FIXTURE_CHANGE", "ENVIRONMENT_CHANGE", "DEPENDENCY_CHANGE", "ROLLBACK", "ISOLATION", "INSTRUMENTATION", "NO_MUTATION_EXPERIMENT", "OTHER"] },
16
+ "statement": { "type": "string", "minLength": 1, "maxLength": 4096 },
17
+ "targets": { "type": "array", "maxItems": 32, "items": { "type": "string", "minLength": 1 } },
18
+ "hypothesisRefs": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" } },
19
+ "expectedObservation": { "type": "string", "maxLength": 4096 },
20
+ "reversible": { "type": "boolean" }
21
+ },
22
+ "additionalProperties": false
23
+ },
24
+ "interventionSemanticFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
25
+ },
26
+ "additionalProperties": false
27
+ }
@@ -10,6 +10,7 @@
10
10
  "digest": { "type": "string", "minLength": 1 },
11
11
  "rulesDigest": { "type": "string" },
12
12
  "baselineDigest": { "type": "string" },
13
+ "capabilityPolicyDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
13
14
  "capturedAt": { "type": "string" }
14
15
  },
15
16
  "additionalProperties": false
@@ -10,6 +10,8 @@
10
10
  "rules": { "type": "array", "items": { "type": ["string", "object"] } },
11
11
  "baseline": { "type": "object" },
12
12
  "baselineDigest": { "type": "string" },
13
+ "capabilityPolicyDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
14
+ "capabilityPolicyFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
13
15
  "capturedAt": { "type": "string" }
14
16
  },
15
17
  "additionalProperties": false
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/task-recovery.schema.json",
4
+ "title": "ForgeLoop Task Recovery State",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "protocolVersion",
9
+ "taskId",
10
+ "status",
11
+ "recoveredAt",
12
+ "recoveryId",
13
+ "recoveryEventSeq",
14
+ "classificationAtRecovery",
15
+ "reasonCodes",
16
+ "releasedClaims",
17
+ "previousPhase",
18
+ "previousRevision",
19
+ "repositoryFingerprint",
20
+ "authority"
21
+ ],
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "schemaVersion": { "const": 1 },
25
+ "protocolVersion": { "const": 1 },
26
+ "taskId": { "type": "string", "minLength": 1 },
27
+ "status": { "const": "RECOVERED" },
28
+ "recoveredAt": { "type": "string", "format": "date-time" },
29
+ "recoveryId": { "type": "string", "pattern": "^recovery-[A-Za-z0-9-]+$" },
30
+ "recoveryEventSeq": { "type": "integer", "minimum": 1 },
31
+ "classificationAtRecovery": { "enum": ["STALE", "ABANDONED", "LEGACY_BOUNDARY_MIGRATED"] },
32
+ "reasonCodes": {
33
+ "type": "array",
34
+ "items": { "type": "string", "minLength": 1 }
35
+ },
36
+ "releasedClaims": {
37
+ "type": "array",
38
+ "items": { "type": "string", "minLength": 1 }
39
+ },
40
+ "previousPhase": { "type": "string", "minLength": 1 },
41
+ "previousRevision": { "type": "integer", "minimum": 0 },
42
+ "repositoryFingerprint": {
43
+ "type": "object",
44
+ "required": ["branch", "head"],
45
+ "additionalProperties": false,
46
+ "properties": {
47
+ "branch": { "type": ["string", "null"] },
48
+ "head": { "type": ["string", "null"] }
49
+ }
50
+ },
51
+ "authority": {
52
+ "type": "object",
53
+ "required": ["kind"],
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "kind": { "enum": ["CALLER_ACKNOWLEDGED", "HOST_ATTESTED"] },
57
+ "grantRef": { "type": "string", "minLength": 1 }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/trajectory-evaluation.schema.json",
4
+ "title": "ForgeLoop trajectory evaluation artifact",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "evaluationId",
9
+ "scenarioId",
10
+ "taskId",
11
+ "result",
12
+ "completionValid",
13
+ "safetyValid",
14
+ "evaluationFingerprint"
15
+ ],
16
+ "properties": {
17
+ "schemaVersion": { "const": 1 },
18
+ "evaluationId": { "type": "string", "pattern": "^eval-[A-Za-z0-9_-]+$" },
19
+ "scenarioId": { "type": "string", "minLength": 1, "maxLength": 128 },
20
+ "scenarioFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
21
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 256 },
22
+ "result": { "enum": ["PASS", "FAIL"] },
23
+ "completionValid": { "type": "boolean" },
24
+ "safetyValid": { "type": "boolean" },
25
+ "missingMilestones": {
26
+ "type": "array",
27
+ "items": { "type": "string", "minLength": 1 }
28
+ },
29
+ "limits": {
30
+ "type": "object",
31
+ "additionalProperties": {
32
+ "type": "object",
33
+ "required": ["actual"],
34
+ "properties": {
35
+ "actual": { "type": ["integer", "null"] },
36
+ "max": { "type": "integer" },
37
+ "pass": { "type": "boolean" }
38
+ },
39
+ "additionalProperties": true
40
+ }
41
+ },
42
+ "efficiency": {
43
+ "oneOf": [
44
+ {
45
+ "type": "object",
46
+ "required": ["referenceComparableSteps", "actualComparableSteps", "ratio"],
47
+ "properties": {
48
+ "referenceComparableSteps": { "type": "integer", "minimum": 1 },
49
+ "actualComparableSteps": { "type": "integer", "minimum": 0 },
50
+ "ratio": { "type": "number", "minimum": 0 }
51
+ },
52
+ "additionalProperties": false
53
+ },
54
+ { "type": "null" }
55
+ ]
56
+ },
57
+ "computedAt": { "type": "string", "minLength": 1 },
58
+ "source": {
59
+ "enum": ["PROJECT_LOCAL_REFERENCE"]
60
+ },
61
+ "evaluationFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
62
+ },
63
+ "additionalProperties": false
64
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "forgeloop://schemas/trajectory-scenario.schema.json",
4
+ "title": "ForgeLoop trajectory reference scenario",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "scenarioId", "requiredMilestones"],
7
+ "properties": {
8
+ "schemaVersion": { "const": 1 },
9
+ "scenarioId": { "type": "string", "minLength": 1, "maxLength": 128 },
10
+ "description": { "type": "string", "maxLength": 512 },
11
+ "requiredMilestones": {
12
+ "type": "array",
13
+ "minItems": 1,
14
+ "items": { "type": "string", "minLength": 1, "maxLength": 64 }
15
+ },
16
+ "forbidden": {
17
+ "type": "object",
18
+ "properties": {
19
+ "completionBeforeVerification": { "type": "boolean" },
20
+ "unresolvedRequiredAction": { "type": "boolean" }
21
+ },
22
+ "additionalProperties": false
23
+ },
24
+ "limits": {
25
+ "type": "object",
26
+ "properties": {
27
+ "maxVerificationCycles": { "type": "integer", "minimum": 1 },
28
+ "maxNonInformativeInterventions": { "type": "integer", "minimum": 0 },
29
+ "maxAmbiguousActions": { "type": "integer", "minimum": 0 }
30
+ },
31
+ "additionalProperties": false
32
+ },
33
+ "reference": {
34
+ "type": "object",
35
+ "properties": {
36
+ "comparableSteps": { "type": "integer", "minimum": 1 }
37
+ },
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "additionalProperties": false
42
+ }