@cassiomc1/forgeloop 1.2.4 → 1.5.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 (92) hide show
  1. package/.github/copilot-instructions.md +1 -0
  2. package/AGENTS.md +1 -0
  3. package/AGENT_COMPATIBILITY.md +4 -0
  4. package/CLAUDE.md +1 -0
  5. package/DOCS_INDEX.md +14 -0
  6. package/EXECUTION_STATE.md +48 -0
  7. package/LOOP_ENGINEERING.md +55 -6
  8. package/LOOP_SYSTEM_DESIGN.md +32 -1
  9. package/PROTOCOL_INTEGRATION.md +71 -0
  10. package/README.md +86 -0
  11. package/TERMINOLOGY.md +15 -0
  12. package/THIRD_PARTY_NOTICES.md +15 -0
  13. package/THREAT_MODEL.md +22 -1
  14. package/docs/ARTIFACT_REFERENCE.md +54 -0
  15. package/docs/CLI_REFERENCE.md +177 -5
  16. package/docs/CROSS_HARNESS_CONTINUITY.md +34 -0
  17. package/docs/DOCUMENTATION_GUIDE.md +31 -0
  18. package/docs/GETTING_STARTED.md +10 -0
  19. package/docs/MCP.md +126 -0
  20. package/docs/RECIPES.md +87 -1
  21. package/docs/RELEASE_CHECKLIST_1_4.md +38 -0
  22. package/docs/RELEASE_CHECKLIST_1_5_MCP.md +78 -0
  23. package/docs/TROUBLESHOOTING.md +243 -40
  24. package/docs/UNIVERSAL_INTEGRATION.md +48 -0
  25. package/package.json +17 -3
  26. package/schemas/execution.schema.json +11 -1
  27. package/schemas/task-recovery.schema.json +61 -0
  28. package/schemas/work-state.schema.json +1 -0
  29. package/src/cli.js +182 -337
  30. package/src/commands/audit.js +5 -0
  31. package/src/commands/doctor.js +22 -0
  32. package/src/commands/inspect.js +6 -0
  33. package/src/commands/migrate-protocol.js +18 -0
  34. package/src/commands/progress.js +6 -2
  35. package/src/commands/protocol-info.js +16 -0
  36. package/src/commands/run-check.js +2 -0
  37. package/src/commands/status.js +17 -0
  38. package/src/commands/task-create.js +42 -3
  39. package/src/commands/task-list.js +14 -1
  40. package/src/commands/task-lock-status.js +29 -0
  41. package/src/commands/task-recover.js +202 -0
  42. package/src/commands/task-repair-legacy-recovery.js +417 -0
  43. package/src/commands/task-resume.js +172 -0
  44. package/src/commands/task-scope.js +23 -4
  45. package/src/commands/task-show.js +21 -7
  46. package/src/commands/task-unlock.js +8 -6
  47. package/src/commands/validate-protocol.js +19 -2
  48. package/src/core/artifact-registry.js +12 -0
  49. package/src/core/artifacts.js +17 -4
  50. package/src/core/audit.js +20 -4
  51. package/src/core/bundles.js +15 -0
  52. package/src/core/cli-command-definitions.js +94 -4
  53. package/src/core/command-executors.js +387 -0
  54. package/src/core/command-input.js +107 -0
  55. package/src/core/command-runtime.js +106 -0
  56. package/src/core/completion-artifacts.js +17 -6
  57. package/src/core/completion-ownership.js +88 -0
  58. package/src/core/completion.js +15 -3
  59. package/src/core/diagnosis.js +15 -11
  60. package/src/core/error-codes.js +136 -1
  61. package/src/core/events.js +239 -9
  62. package/src/core/execution.js +73 -9
  63. package/src/core/filesystem.js +75 -8
  64. package/src/core/inspect.js +27 -0
  65. package/src/core/integration-invocation-policy.js +170 -0
  66. package/src/core/integration-limits.js +20 -0
  67. package/src/core/integration-resources.js +127 -0
  68. package/src/core/next-action-model.js +60 -0
  69. package/src/core/next-action.js +31 -0
  70. package/src/core/phase.js +10 -3
  71. package/src/core/project-root.js +21 -0
  72. package/src/core/protocol-info.js +54 -0
  73. package/src/core/protocol-migration.js +59 -0
  74. package/src/core/reconcile-closure.js +54 -14
  75. package/src/core/recovery-history.js +116 -0
  76. package/src/core/resumability.js +8 -6
  77. package/src/core/schema-validation.js +1 -0
  78. package/src/core/task-claim-state.js +272 -0
  79. package/src/core/task-command.js +8 -4
  80. package/src/core/task-conflict-inspection.js +321 -0
  81. package/src/core/task-context.js +32 -29
  82. package/src/core/task-discovery.js +14 -1
  83. package/src/core/task-lock.js +248 -18
  84. package/src/core/task-migration.js +24 -1
  85. package/src/core/task-paths.js +6 -3
  86. package/src/core/task-recovery-migration.js +192 -0
  87. package/src/core/task-recovery.js +205 -0
  88. package/src/core/task-scope.js +33 -1
  89. package/src/core/templates.js +1 -0
  90. package/src/core/transaction.js +285 -0
  91. package/src/core/work-state.js +70 -6
  92. package/src/integration.js +47 -0
@@ -0,0 +1,48 @@
1
+ # Universal ForgeLoop Integration
2
+
3
+ ForgeLoop applies to any agent, harness, IDE, or orchestration runtime — with
4
+ or without MCP. The universal rule:
5
+
6
+ > If the active host exposes an official ForgeLoop structured integration,
7
+ > prefer it for protocol operations. Otherwise use the project-local ForgeLoop
8
+ > CLI. Never manually synthesize ForgeLoop-managed lifecycle, claim, recovery,
9
+ > ledger, or completion state because an integration is unavailable.
10
+
11
+ ## The programmatic integration API
12
+
13
+ `@cassiomc1/forgeloop/integration` (integration API version 1) is the
14
+ transport-neutral entrypoint:
15
+
16
+ ```js
17
+ import {
18
+ executeForgeLoopCommand,
19
+ validateForgeLoopCommandInput,
20
+ getForgeLoopCapabilities,
21
+ classifyForgeLoopInvocation,
22
+ readForgeLoopIntegrationResource,
23
+ } from "@cassiomc1/forgeloop/integration";
24
+ ```
25
+
26
+ - `executeForgeLoopCommand({command, projectPath, input})` returns a
27
+ deterministic envelope: `{ok, command, exitCode, result, error, metadata}`.
28
+ Domain rejections (preflight BLOCKED, audit INVALID) keep `ok:true` with a
29
+ non-zero exit code; `ok:false` means the command could not be executed and
30
+ preserves the canonical public error code.
31
+ - Ownership values always come from `resolveTaskClaimState()` through the
32
+ `task/ownership` resource — never derived from raw artifacts.
33
+ - Invocation risk classes (READ_ONLY, LOOP_MUTATION, CLAIM_REACQUISITION,
34
+ EXTERNAL_EXECUTION, MAINTENANCE, CLAIM_RELEASE_RECOVERY, LEGACY_MIGRATION,
35
+ FORCE_DESTRUCTIVE) describe what an invocation would do; launch policy
36
+ decides what is allowed.
37
+
38
+ ## Consumers
39
+
40
+ | Surface | Entry |
41
+ | --- | --- |
42
+ | ForgeLoop CLI | human terminal rendering over the same executors |
43
+ | ForgeLoop MCP | `@cassiomc1/forgeloop-mcp`: stdio (default/recommended) plus optional strict-modern loopback-only HTTP; see [MCP.md](./MCP.md) |
44
+ | Studio / IDE / CI adapters | the same integration subpath |
45
+
46
+ All consumers share one protocol authority: `.forgeloop/` state written only
47
+ by canonical ForgeLoop commands, so cross-harness continuity and recovery work
48
+ identically regardless of transport.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cassiomc1/forgeloop",
3
- "version": "1.2.4",
3
+ "version": "1.5.0",
4
4
  "description": "Portable, verifiable engineering protocol for AI coding environments and developer workflows",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,25 +54,39 @@
54
54
  "docs/TROUBLESHOOTING.md",
55
55
  "docs/RECIPES.md",
56
56
  "docs/DOCUMENTATION_GUIDE.md",
57
- "scripts/CI_VALIDATORS.md"
57
+ "docs/RELEASE_CHECKLIST_1_4.md",
58
+ "scripts/CI_VALIDATORS.md",
59
+ "docs/MCP.md",
60
+ "docs/UNIVERSAL_INTEGRATION.md",
61
+ "docs/RELEASE_CHECKLIST_1_5_MCP.md"
58
62
  ],
59
63
  "scripts": {
60
64
  "test": "node scripts/run-tests.js",
61
65
  "pack:check": "node --test tests/package.test.js",
66
+ "pack:smoke": "node scripts/package_smoke.mjs",
62
67
  "release:identity": "node scripts/verify_release_identity.mjs",
63
68
  "docs:flow": "node scripts/generate-readme-flow.mjs",
64
69
  "docs:diagram:check": "node scripts/check-generated-diagram.mjs",
65
70
  "docs:generate": "node scripts/generate_documentation_reference.mjs --write",
66
71
  "docs:generated:check": "node scripts/generate_documentation_reference.mjs --check",
67
72
  "docs:conformance": "node scripts/validate_documentation_conformance.mjs",
73
+ "docs:examples:check": "node scripts/validate_documentation_examples.mjs",
74
+ "docs:report": "node scripts/report_documentation_health.mjs",
68
75
  "docs:check": "node scripts/run-docs-check.js",
69
76
  "lint": "eslint .",
70
77
  "coverage": "c8 --all --include=src/**/*.js --reporter=text --reporter=lcov --check-coverage --lines=80 --functions=75 --branches=70 --statements=80 node scripts/run-tests.js",
71
- "dependency:policy": "node scripts/check-dependency-policy.mjs"
78
+ "dependency:policy": "node scripts/check-dependency-policy.mjs",
79
+ "mcp:test": "node --test integrations/mcp/tests/*.test.js",
80
+ "mcp:setup": "node scripts/mcp-setup.mjs",
81
+ "mcp:pack:check": "node scripts/mcp-package-smoke.mjs"
72
82
  },
73
83
  "devDependencies": {
74
84
  "@mermaid-js/mermaid-cli": "^11.16.0",
75
85
  "c8": "^12.0.0",
76
86
  "eslint": "^9.39.5"
87
+ },
88
+ "exports": {
89
+ ".": "./src/cli.js",
90
+ "./integration": "./src/integration.js"
77
91
  }
78
92
  }
@@ -57,7 +57,17 @@
57
57
  "startedAt": { "type": "string", "minLength": 1 },
58
58
  "finishedAt": { "type": "string", "minLength": 1 },
59
59
  "status": { "enum": ["passed", "failed"] },
60
- "exitCode": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] }
60
+ "exitCode": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
61
+ "durationMs": { "type": "integer", "minimum": 0 },
62
+ "termination": { "enum": ["exit", "signal", "timeout", "spawn-error"] },
63
+ "signal": { "oneOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }] },
64
+ "stdoutSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
65
+ "stderrSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
66
+ "stdoutBytes": { "type": "integer", "minimum": 0 },
67
+ "stderrBytes": { "type": "integer", "minimum": 0 },
68
+ "outputTruncated": { "type": "boolean" }
69
+ ,"timeoutMs": { "type": "integer", "minimum": 1 }
70
+ ,"terminationGraceMs": { "type": "integer", "minimum": 1 }
61
71
  },
62
72
  "additionalProperties": false
63
73
  }
@@ -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
+ }
@@ -59,6 +59,7 @@
59
59
  "failures": { "type": "array", "items": { "type": "object" } },
60
60
  "blockers": { "type": "array", "items": { "type": "object" } },
61
61
  "lastUpdated": { "type": "string", "minLength": 1 },
62
+ "revision": { "type": "integer", "minimum": 0 },
62
63
  "previousPhase": { "type": "string" },
63
64
  "diagnosedHypothesis": { "type": "string", "minLength": 1 },
64
65
  "verificationEvidence": { "type": "array", "items": { "type": "object" } },