@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.
- package/.github/copilot-instructions.md +1 -0
- package/AGENTS.md +1 -0
- package/CLAUDE.md +1 -0
- package/DOCS_INDEX.md +20 -8
- package/EXECUTION_STATE.md +60 -0
- package/LOOP_ENGINEERING.md +135 -5
- package/LOOP_SYSTEM_DESIGN.md +54 -1
- package/PROTOCOL_INTEGRATION.md +87 -0
- package/QUALITY_SCORECARD.md +2 -0
- package/README.md +69 -9
- package/TERMINOLOGY.md +15 -0
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/THREAT_MODEL.md +59 -1
- package/docs/ARTIFACT_REFERENCE.md +183 -0
- package/docs/CLI_REFERENCE.md +391 -6
- package/docs/CROSS_HARNESS_CONTINUITY.md +23 -0
- package/docs/DIAGNOSTIC_MODEL.md +181 -0
- package/docs/DOCUMENTATION_GUIDE.md +36 -13
- package/docs/EXECUTION_TRACE.md +76 -0
- package/docs/GETTING_STARTED.md +1 -0
- package/docs/MCP.md +159 -0
- package/docs/RECIPES.md +149 -0
- package/docs/RELEASE_CHECKLIST_1_4.md +38 -0
- package/docs/RELEASE_CHECKLIST_1_5_MCP.md +78 -0
- package/docs/TROUBLESHOOTING.md +217 -3
- package/docs/UNIVERSAL_INTEGRATION.md +48 -0
- package/docs/assets/diagrams/forgeloop-engineering-flow.html +13797 -0
- package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +37 -0
- package/docs/assets/diagrams/forgeloop-engineering-flow.svg +5002 -0
- package/docs/diagrams/README.md +55 -0
- package/docs/diagrams/forgeloop-engineering-flow.workflow.json +122 -0
- package/docs/diagrams/manifest.json +42 -0
- package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +20 -0
- package/package.json +21 -8
- package/schemas/action.schema.json +100 -0
- package/schemas/approval.schema.json +51 -0
- package/schemas/capability-policy.schema.json +41 -0
- package/schemas/diagnostic-case.schema.json +85 -0
- package/schemas/execution-receipt.schema.json +16 -0
- package/schemas/hypothesis-disposition.schema.json +16 -0
- package/schemas/intervention.schema.json +27 -0
- package/schemas/policy-lock.schema.json +1 -0
- package/schemas/policy-snapshot.schema.json +2 -0
- package/schemas/task-recovery.schema.json +61 -0
- package/schemas/trajectory-evaluation.schema.json +64 -0
- package/schemas/trajectory-scenario.schema.json +42 -0
- package/src/cli.js +267 -347
- package/src/commands/action-authorize.js +41 -0
- package/src/commands/action-propose.js +10 -0
- package/src/commands/action-reconcile.js +10 -0
- package/src/commands/action-record.js +47 -0
- package/src/commands/action-show.js +10 -0
- package/src/commands/action-verify.js +10 -0
- package/src/commands/advance.js +7 -2
- package/src/commands/approval-request.js +64 -0
- package/src/commands/approval-resolve.js +10 -0
- package/src/commands/audit.js +5 -0
- package/src/commands/baseline.js +3 -3
- package/src/commands/eval.js +6 -0
- package/src/commands/history.js +18 -0
- package/src/commands/init.js +2 -2
- package/src/commands/inspect.js +55 -0
- package/src/commands/metrics.js +7 -0
- package/src/commands/next.js +8 -2
- package/src/commands/policy-discover.js +2 -2
- package/src/commands/progress.js +6 -2
- package/src/commands/record-diagnosis.js +37 -1
- package/src/commands/record-hypothesis-disposition.js +45 -0
- package/src/commands/record-intervention.js +35 -0
- package/src/commands/reflect.js +38 -0
- package/src/commands/report.js +9 -1
- package/src/commands/run-action.js +18 -0
- package/src/commands/status.js +17 -0
- package/src/commands/task-create.js +39 -1
- package/src/commands/task-list.js +14 -1
- package/src/commands/task-lock-status.js +2 -2
- package/src/commands/task-recover.js +202 -0
- package/src/commands/task-repair-legacy-recovery.js +417 -0
- package/src/commands/task-resume.js +172 -0
- package/src/commands/task-scope.js +23 -4
- package/src/commands/task-show.js +18 -4
- package/src/commands/trace.js +34 -0
- package/src/commands/validate-protocol.js +40 -15
- package/src/core/action-authorization.js +106 -0
- package/src/core/action-constants.js +86 -0
- package/src/core/action-execution.js +105 -0
- package/src/core/action-ledger-projection.js +302 -0
- package/src/core/action-model.js +581 -0
- package/src/core/action-readiness.js +141 -0
- package/src/core/action-reconciliation-policy.js +49 -0
- package/src/core/action-reconciliation.js +66 -0
- package/src/core/action-verification.js +111 -0
- package/src/core/actions.js +462 -0
- package/src/core/approvals.js +405 -0
- package/src/core/artifact-registry.js +60 -0
- package/src/core/audit.js +45 -4
- package/src/core/bundles.js +30 -0
- package/src/core/capability-policy.js +226 -0
- package/src/core/cli-command-definitions.js +260 -5
- package/src/core/command-executors.js +543 -0
- package/src/core/command-input.js +107 -0
- package/src/core/command-runtime.js +117 -0
- package/src/core/completion-artifacts.js +39 -15
- package/src/core/completion-ownership.js +88 -0
- package/src/core/completion-recovery-rebind.js +194 -0
- package/src/core/completion.js +70 -0
- package/src/core/continuity-reconciliation.js +24 -5
- package/src/core/diagnostic-model.js +396 -0
- package/src/core/diagnostic-projection.js +51 -0
- package/src/core/diagnostic-record.js +360 -0
- package/src/core/error-codes.js +461 -1
- package/src/core/events.js +171 -2
- package/src/core/execution-prerequisites.js +4 -1
- package/src/core/execution.js +26 -188
- package/src/core/failure-signature.js +70 -0
- package/src/core/failure-surface.js +57 -0
- package/src/core/filesystem.js +55 -6
- package/src/core/history.js +110 -0
- package/src/core/hypothesis-projection.js +85 -0
- package/src/core/information-gain-projection.js +283 -0
- package/src/core/information-gain.js +138 -0
- package/src/core/inspect.js +132 -7
- package/src/core/integration-invocation-policy.js +217 -0
- package/src/core/integration-limits.js +20 -0
- package/src/core/integration-resources.js +178 -0
- package/src/core/next-action-model.js +94 -0
- package/src/core/next-action.js +490 -3
- package/src/core/phase.js +42 -22
- package/src/core/policy-engine.js +113 -6
- package/src/core/preflight-consistency.js +31 -5
- package/src/core/preflight.js +19 -2
- package/src/core/prepared-execution.js +227 -0
- package/src/core/progress.js +41 -4
- package/src/core/project-root.js +21 -0
- package/src/core/protocol-info.js +61 -0
- package/src/core/protocol.js +14 -0
- package/src/core/receipt.js +1 -0
- package/src/core/reconcile-closure.js +35 -10
- package/src/core/recovery-history.js +116 -0
- package/src/core/reflection.js +305 -0
- package/src/core/resumability.js +57 -3
- package/src/core/schema-validation.js +9 -0
- package/src/core/strategy-analysis.js +97 -0
- package/src/core/task-claim-state.js +272 -0
- package/src/core/task-command.js +5 -1
- package/src/core/task-conflict-inspection.js +321 -0
- package/src/core/task-context.js +32 -29
- package/src/core/task-discovery.js +14 -1
- package/src/core/task-lock.js +216 -22
- package/src/core/task-paths.js +31 -2
- package/src/core/task-recovery-migration.js +192 -0
- package/src/core/task-recovery.js +205 -0
- package/src/core/task-scope.js +33 -1
- package/src/core/task-snapshot.js +53 -0
- package/src/core/templates.js +9 -0
- package/src/core/trace.js +548 -0
- package/src/core/trajectory-evaluation.js +71 -0
- package/src/core/trajectory-metrics.js +80 -0
- package/src/core/transaction.js +36 -2
- package/src/core/work-state.js +10 -5
- package/src/integration.js +47 -0
- package/docs/assets/forgeloop-flow.svg +0 -1
- package/docs/forgeloop-flow.mmd +0 -51
|
@@ -8,6 +8,7 @@ Do not treat ForgeLoop as vendor-specific, optional, or to follow only "in spiri
|
|
|
8
8
|
Use these instructions across the repository while preserving local rules.
|
|
9
9
|
|
|
10
10
|
- Read [`LOOP_ENGINEERING.md`](../LOOP_ENGINEERING.md) and [`PROTOCOL_INTEGRATION.md`](../PROTOCOL_INTEGRATION.md).
|
|
11
|
+
- If an official ForgeLoop structured integration is available in your host, prefer it for protocol operations; otherwise use the project-local ForgeLoop CLI. Never simulate ForgeLoop-managed lifecycle, claim, recovery, ledger, or completion state directly.
|
|
11
12
|
- Confirm [`PROJECT_PROFILE.md`](../PROJECT_PROFILE.md) from evidence; initialize if in `template` mode.
|
|
12
13
|
- Select context with [`GUIDE_ROUTER.md`](../GUIDE_ROUTER.md) and report activated guide IDs.
|
|
13
14
|
- Respect the latest request, scope, and higher-level instructions.
|
package/AGENTS.md
CHANGED
|
@@ -7,6 +7,7 @@ Do not treat ForgeLoop as vendor-specific, optional, or to follow only "in spiri
|
|
|
7
7
|
|
|
8
8
|
1. Follow platform rules, the user's latest request, and local instructions first.
|
|
9
9
|
1. Read [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md) and [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md).
|
|
10
|
+
1. If an official ForgeLoop structured integration is available in your host, prefer it for protocol operations; otherwise use the project-local ForgeLoop CLI. Never simulate ForgeLoop-managed lifecycle, claim, recovery, ledger, or completion state directly.
|
|
10
11
|
1. Inspect [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md). Confirm facts from sources; initialize if in `template` mode.
|
|
11
12
|
1. Use [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) to select relevant guides and report activated guide IDs.
|
|
12
13
|
1. Make the smallest coherent change, run specific checks, and proportional regression checks.
|
package/CLAUDE.md
CHANGED
|
@@ -9,6 +9,7 @@ When working in this repository:
|
|
|
9
9
|
|
|
10
10
|
1. Follow higher-level instructions, the user's latest request, and local rules first.
|
|
11
11
|
1. Read [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md) and [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md).
|
|
12
|
+
1. If an official ForgeLoop structured integration is available in your host, prefer it for protocol operations; otherwise use the project-local ForgeLoop CLI. Never simulate ForgeLoop-managed lifecycle, claim, recovery, ledger, or completion state directly.
|
|
12
13
|
1. Verify [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md) against real sources; initialize if in `template` mode.
|
|
13
14
|
1. Consult [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md), select relevant guides, and announce their IDs.
|
|
14
15
|
1. Make small changes, run specific checks, and run proportional regression checks.
|
package/DOCS_INDEX.md
CHANGED
|
@@ -18,9 +18,16 @@ integration and guide context. Use this map before editing documentation.
|
|
|
18
18
|
| Cross-harness continuity | [`docs/CROSS_HARNESS_CONTINUITY.md`](./docs/CROSS_HARNESS_CONTINUITY.md) | Operational handoff and multi-tool resumption |
|
|
19
19
|
| CLI command reference | [`docs/CLI_REFERENCE.md`](./docs/CLI_REFERENCE.md) | Full syntax, options, and JSON examples for all commands |
|
|
20
20
|
| Artifact and schema reference | [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md) | Purpose, mutability, and trust classifications of `.forgeloop/` |
|
|
21
|
+
| Durable actions and trajectory evidence | [`docs/EXECUTION_TRACE.md`](./docs/EXECUTION_TRACE.md) and [`docs/RECIPES.md`](./docs/RECIPES.md) | Action provenance, reconciliation, metrics, and project-local evaluation |
|
|
21
22
|
| Troubleshooting and recovery | [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md) | Symptom-first recovery and stable error code reference |
|
|
22
23
|
| Operational recipes | [`docs/RECIPES.md`](./docs/RECIPES.md) | Short copy-paste recipes for daily workflows |
|
|
24
|
+
| Diagnostic model | [`docs/DIAGNOSTIC_MODEL.md`](./docs/DIAGNOSTIC_MODEL.md) | Structured diagnostic cases, interventions, hypothesis dispositions, information gain |
|
|
25
|
+
| Execution trace and observability | [`docs/EXECUTION_TRACE.md`](./docs/EXECUTION_TRACE.md) | `history`, `trace`, `reflect`, and task-level `inspect` read-only projections |
|
|
26
|
+
| Universal integration API | [`docs/UNIVERSAL_INTEGRATION.md`](./docs/UNIVERSAL_INTEGRATION.md) | Programmatic integration subpath, envelope semantics, and consumer map |
|
|
27
|
+
| Local-first MCP adapter | [`docs/MCP.md`](./docs/MCP.md) | stdio default, optional strict loopback HTTP; server modes/capabilities and canonical resources |
|
|
23
28
|
| Documentation guide | [`docs/DOCUMENTATION_GUIDE.md`](./docs/DOCUMENTATION_GUIDE.md) | Rules and checklist for modifying documentation |
|
|
29
|
+
| ForgeLoop 1.5/MCP release checklist | [`docs/RELEASE_CHECKLIST_1_5_MCP.md`](./docs/RELEASE_CHECKLIST_1_5_MCP.md) | Integration API v1, MCP package, and publication gates |
|
|
30
|
+
| ForgeLoop 1.4 release checklist | [`docs/RELEASE_CHECKLIST_1_4.md`](./docs/RELEASE_CHECKLIST_1_4.md) | Claim-recovery, compatibility, package, and publication gates |
|
|
24
31
|
| Lifecycle, gates, planning, verification, and recovery | [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md) | Normative process for agents and developer workflows |
|
|
25
32
|
| Capability levels, discovery, and degradation | [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md) | Vendor-neutral harness contract |
|
|
26
33
|
| Host/orchestrator integration | [`ORCHESTRATOR_INTEGRATION.md`](./ORCHESTRATOR_INTEGRATION.md) | Serializable phases, transition boundaries, host responsibilities, and no-runtime integration contract |
|
|
@@ -30,7 +37,8 @@ integration and guide context. Use this map before editing documentation.
|
|
|
30
37
|
| Artifact and phase schemas | [`schemas/`](./schemas/) and [`CONTRACT_COVERAGE.md`](./CONTRACT_COVERAGE.md) | Versioned machine-readable contract |
|
|
31
38
|
| CLI/package behavior | [`src/`](./src/) and [`tests/`](./tests/) | Executable implementation and regression evidence |
|
|
32
39
|
| Guide content | [`ENG/`](./ENG/) | Context-specific, English-only operational guides |
|
|
33
|
-
| Diagram | [`docs/
|
|
40
|
+
| Diagram governance | [`docs/diagrams/manifest.json`](./docs/diagrams/manifest.json) | Authoritative taxonomy, renderer mapping, canonical purposes, artifact ownership, and references |
|
|
41
|
+
| Diagram maintainer entrypoint | [`docs/diagrams/README.md`](./docs/diagrams/README.md) | Typed Archify source, animated HTML explorer, animated SVG fallback, review, and regeneration workflow |
|
|
34
42
|
|
|
35
43
|
## Audience map
|
|
36
44
|
|
|
@@ -46,6 +54,8 @@ integration and guide context. Use this map before editing documentation.
|
|
|
46
54
|
| **Fixing a broken or stale state** | [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md) |
|
|
47
55
|
| **Looking for quick recipes** | [`docs/RECIPES.md`](./docs/RECIPES.md) |
|
|
48
56
|
| **Documentation contributor** | [`docs/DOCUMENTATION_GUIDE.md`](./docs/DOCUMENTATION_GUIDE.md) |
|
|
57
|
+
| **Release maintainer (current)** | [`docs/RELEASE_CHECKLIST_1_5_MCP.md`](./docs/RELEASE_CHECKLIST_1_5_MCP.md) |
|
|
58
|
+
| **Release maintainer (historical 1.4)** | [`docs/RELEASE_CHECKLIST_1_4.md`](./docs/RELEASE_CHECKLIST_1_4.md) |
|
|
49
59
|
| **Protocol architect / maintainer** | [`LOOP_SYSTEM_DESIGN.md`](./LOOP_SYSTEM_DESIGN.md) + [`schemas/`](./schemas/) |
|
|
50
60
|
| **Security auditor** | [`THREAT_MODEL.md`](./THREAT_MODEL.md) |
|
|
51
61
|
| **Engineering guide author** | [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) + [`ENG/`](./ENG/) |
|
|
@@ -57,6 +67,7 @@ integration and guide context. Use this map before editing documentation.
|
|
|
57
67
|
- **Check CLI options and syntax**: [`docs/CLI_REFERENCE.md`](./docs/CLI_REFERENCE.md)
|
|
58
68
|
- **Understand what `.forgeloop/` stores**: [`docs/ARTIFACT_REFERENCE.md`](./docs/ARTIFACT_REFERENCE.md)
|
|
59
69
|
- **Fix a blocked, stale, or invalid state**: [`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md)
|
|
70
|
+
- **Recover a stale task or reacquire released claims**: [`docs/RECIPES.md`](./docs/RECIPES.md#recipe-15--release-and-reacquire-claims-for-an-abandoned-task)
|
|
60
71
|
- **Find operational copy-paste commands**: [`docs/RECIPES.md`](./docs/RECIPES.md)
|
|
61
72
|
- **Read the normative protocol specification**: [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md)
|
|
62
73
|
- **Integrate a new AI environment**: [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md)
|
|
@@ -81,25 +92,26 @@ process into adapters or README sections; link to the canonical source.
|
|
|
81
92
|
## Verification and release
|
|
82
93
|
|
|
83
94
|
The Node regression suite, ESLint, c8, dependency policy, package boundary,
|
|
84
|
-
and
|
|
95
|
+
and Archify diagram render are the local executable checks. Python validators remain
|
|
85
96
|
frozen CI-only compatibility tools because they cover historical Markdown,
|
|
86
97
|
loop, and secret-scanning contracts that have not been migrated to Node. Their
|
|
87
98
|
scope, exact commands, and migration boundary are recorded in
|
|
88
99
|
[`scripts/CI_VALIDATORS.md`](./scripts/CI_VALIDATORS.md).
|
|
89
100
|
|
|
90
101
|
The package has no runtime dependencies. Development dependencies are limited
|
|
91
|
-
to ESLint
|
|
102
|
+
to ESLint and c8 and are checked by
|
|
92
103
|
`npm run dependency:policy`. GitHub Actions use `npm ci`, pinned action SHAs,
|
|
93
104
|
CodeQL, dependency review, and generated-release notes; npm publication still
|
|
94
105
|
uses trusted OIDC publishing and is not implied by local verification.
|
|
95
106
|
|
|
96
107
|
## Editing rules
|
|
97
108
|
|
|
98
|
-
- Keep lifecycle prose, the
|
|
99
|
-
synchronized.
|
|
100
|
-
- Keep generated
|
|
101
|
-
source by running `npm run docs:
|
|
102
|
-
the source fingerprint
|
|
109
|
+
- Keep lifecycle prose, the typed Archify source, generated outputs, and the
|
|
110
|
+
text-only README fallback synchronized.
|
|
111
|
+
- Keep the generated HTML, SVG, and receipt synchronized with the Archify
|
|
112
|
+
source by running `npm run docs:diagrams` and `npm run docs:check`. CI
|
|
113
|
+
validates the renderer pin, source fingerprint, artifact hashes, and SVG
|
|
114
|
+
safety constraints.
|
|
103
115
|
- Preserve the distinction between implemented behavior, local evidence, and
|
|
104
116
|
external publication or production state.
|
|
105
117
|
- Run `npm run lint`, `npm run coverage`, `npm run pack:check`, and the Python
|
package/EXECUTION_STATE.md
CHANGED
|
@@ -10,6 +10,27 @@ Compatible agents may persist a handoff checkpoint at:
|
|
|
10
10
|
.forgeloop/task-state/<taskKey>/work-state.json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Claim-release recovery has a separate current-state artifact:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
.forgeloop/task-state/<taskKey>/recovery.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`work-state.json` remains the lifecycle authority. `recovery.json` records a
|
|
20
|
+
request to suspend ordinary mutation and release effective claims; it does not
|
|
21
|
+
change the phase, refresh repository evidence, erase failures, or imply
|
|
22
|
+
completion. Its `recoveryId`, event sequence, previous revision, released
|
|
23
|
+
claims, repository fingerprint, classification, and authority kind are bound
|
|
24
|
+
to the append-only recovery event. Claims are released only after the canonical
|
|
25
|
+
resolver validates that complete relationship. An unresolved recovery event
|
|
26
|
+
with a missing tombstone, or a tombstone without its matching event, is
|
|
27
|
+
`INCONSISTENT`, retains historical claims, and disables mutation. The same
|
|
28
|
+
fail-closed rule applies to completion: `phase: COMPLETE` alone never releases
|
|
29
|
+
claims — the canonical completion ownership proof (validated ledger with the
|
|
30
|
+
task-bound `COMPLETION_VALIDATED` event and coherent state) is required, and a
|
|
31
|
+
forged or unproven COMPLETE state is `INCONSISTENT` with historical claims
|
|
32
|
+
retained.
|
|
33
|
+
|
|
13
34
|
The file is local, ignored by Git, schema-versioned, and never a replacement
|
|
14
35
|
for the manifest or the target project profile (installed as
|
|
15
36
|
`.forgeloop/kit/PROJECT_PROFILE.md`). It contains no secrets and is untrusted
|
|
@@ -66,6 +87,25 @@ Before resuming, compare:
|
|
|
66
87
|
- the protocol version;
|
|
67
88
|
- required artifacts and assumptions recorded by the task.
|
|
68
89
|
|
|
90
|
+
If validated recovery state is active, ordinary lifecycle mutation fails with
|
|
91
|
+
`E_TASK_RECOVERED`. If recovery ownership is inconsistent, mutation fails with
|
|
92
|
+
`E_TASK_CLAIM_OWNERSHIP_INCONSISTENT`. Resume claim ownership explicitly:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
forgeloop task-resume --task <id> --json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Optional repeatable `--claim <path>` arguments replace the historical claim set
|
|
99
|
+
only after normal overlap and clean-checkout enforcement succeeds. Recovery
|
|
100
|
+
state deletion, any descriptor update, and `TASK_RECOVERY_RESUMED` are staged
|
|
101
|
+
transactionally. `TASK_RECOVERY_RESUMED` counts as meaningful activity. A
|
|
102
|
+
missing artifact returns `E_TASK_NOT_RECOVERED` only when the ledger also proves
|
|
103
|
+
there is no unresolved recovery; otherwise it is an ownership inconsistency.
|
|
104
|
+
|
|
105
|
+
Never create, delete, or edit `recovery.json` manually. Never remove recovery
|
|
106
|
+
state to resume a task. Never interpret `recovery.json` without validating its
|
|
107
|
+
ledger binding.
|
|
108
|
+
|
|
69
109
|
Any material difference produces `REVALIDATION_REQUIRED`. A non-Git target
|
|
70
110
|
reports that branch/HEAD drift is not verifiable. Cheap checks may be rerun,
|
|
71
111
|
but a completed destructive or publication action is never rerun automatically.
|
|
@@ -139,3 +179,23 @@ repository context and is always operational context rather than evidence.
|
|
|
139
179
|
| Stale | Any | Changed | Run `forgeloop route` and `forgeloop preflight` to revalidate |
|
|
140
180
|
| Invalid / Corrupted | Any | Any | Fail closed; inspect errors via `forgeloop doctor --json` |
|
|
141
181
|
| Different Task ID | Present | Any | Do not merge contexts; clear or finish previous task first |
|
|
182
|
+
|
|
183
|
+
## Durable actions are a separate external-state checkpoint
|
|
184
|
+
|
|
185
|
+
Action artifacts under `actions/` describe side-effect intent and its canonical
|
|
186
|
+
state; they do not replace `work-state.json`. Approval artifacts bind a single
|
|
187
|
+
decision to the exact action fingerprint, contract fingerprint, task revision,
|
|
188
|
+
and capability. Capability policy is configuration, not host authority.
|
|
189
|
+
|
|
190
|
+
`FORGELOOP_EXECUTED` means ForgeLoop launched exact argv through `run-action`;
|
|
191
|
+
`HOST_REPORTED` means an external host performed the operation; and
|
|
192
|
+
`EXTERNAL_OBSERVED` means a later observation supplied reconciliation evidence.
|
|
193
|
+
If the external outcome is uncertain, the action is `COMMIT_UNKNOWN`. It must
|
|
194
|
+
not be retried or used to satisfy required completion until
|
|
195
|
+
`forgeloop action-reconcile` records `COMMITTED`, `NOT_COMMITTED`, or
|
|
196
|
+
`UNKNOWN`. ForgeLoop does not claim universal exactly-once execution.
|
|
197
|
+
|
|
198
|
+
`metrics` and `eval` read the canonical trace, reflection, action artifacts, and
|
|
199
|
+
ledger events. They never mutate lifecycle truth, invent usage/cost data, or
|
|
200
|
+
create a second execution history; reference efficiency is emitted only when a
|
|
201
|
+
project-local scenario provides comparable steps.
|
package/LOOP_ENGINEERING.md
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
- [Precedence & Stop Conditions](#precedence)
|
|
28
28
|
- [Final Delivery](#final-delivery)
|
|
29
29
|
- [Cross-Harness Continuity](#cross-harness-execution-continuity)
|
|
30
|
+
- [Durable Actions and Trajectory Evidence](#durable-actions-and-trajectory-evidence)
|
|
30
31
|
- [Multi-Task Concurrent Project State](#multi-task-concurrent-project-state)
|
|
31
32
|
|
|
32
33
|
## Protocol applicability
|
|
@@ -1278,6 +1279,86 @@ completion. `CONTINUITY_CANNOT_GRANT_AUTHORITY`: continuity cannot authorize an
|
|
|
1278
1279
|
installation or external action. <a id="FL-CONT-001"></a> **FL-CONT-001 — A receiving harness MUST reconcile**
|
|
1279
1280
|
continuity against the current work state and checkout before acting on it.
|
|
1280
1281
|
|
|
1282
|
+
## Durable Actions and Trajectory Evidence
|
|
1283
|
+
|
|
1284
|
+
Durable actions extend the existing task protocol; they do not turn ForgeLoop
|
|
1285
|
+
into an agent runtime, scheduler, queue, or workflow engine. Action intent,
|
|
1286
|
+
approval, execution provenance, reconciliation, and evaluation are task-local
|
|
1287
|
+
artifacts whose chronology remains in the same hash-chained `events.ndjson`.
|
|
1288
|
+
|
|
1289
|
+
Every side-effecting action declares an explicit capability, effect class,
|
|
1290
|
+
bounded target, immutable idempotency key, and provenance. Project capability
|
|
1291
|
+
policy is a decision input (`ALLOW`, `DENY`, `REQUIRE_AUTHORITY`, or
|
|
1292
|
+
`REQUIRE_APPROVAL`); it is never host authority. `HOST_ATTESTED` authority can
|
|
1293
|
+
only cross the existing host trust boundary, and `run-action` accepts exact
|
|
1294
|
+
argv with no shell mode.
|
|
1295
|
+
|
|
1296
|
+
### Durable action trust boundaries (hardened)
|
|
1297
|
+
|
|
1298
|
+
The following invariants are enforced in core code and are regression-tested:
|
|
1299
|
+
|
|
1300
|
+
- **Authorization is canonical.** No caller-controlled surface (`action-record`,
|
|
1301
|
+
CLI flags, MCP tool arguments, project files, environment) can mint
|
|
1302
|
+
`AUTHORIZED`. Only the core authorization service may transition
|
|
1303
|
+
`PROPOSED -> AUTHORIZED` — through `run-action`, or explicitly through
|
|
1304
|
+
`forgeloop action-authorize`, which is a pure adapter over the same service —
|
|
1305
|
+
and only after the current capability policy, the persisted policy lock, and
|
|
1306
|
+
the task policy snapshot agree. Every modern
|
|
1307
|
+
`ACTION_AUTHORIZED` event binds the capability decision, capability-policy
|
|
1308
|
+
fingerprint, policy-lock digest, task-policy digest, and — for
|
|
1309
|
+
`REQUIRE_AUTHORITY`/`REQUIRE_APPROVAL` — the exact host authority or
|
|
1310
|
+
fingerprint-bound approval. Post-authorization mutation of a bound approval
|
|
1311
|
+
artifact is readiness/audit-visible.
|
|
1312
|
+
- **Verification is canonical, independent, and requirement-bound.**
|
|
1313
|
+
`COMMITTED != VERIFIED`. A command exiting 0 proves only local completion.
|
|
1314
|
+
`VERIFIED` is produced exclusively by `forgeloop action-verify` (or the
|
|
1315
|
+
equivalent core service) against a passed ForgeLoop execution artifact that
|
|
1316
|
+
is independent of the action's own commit execution and whose immutable
|
|
1317
|
+
`requirement` exactly equals the action's requirement. New required actions
|
|
1318
|
+
must declare a non-empty requirement at proposal time; historical required
|
|
1319
|
+
artifacts without one remain readable but can never become trusted-satisfied.
|
|
1320
|
+
- **Reconciliation has exactly one replay truth.** A trusted `COMMITTED`
|
|
1321
|
+
settlement emits `ACTION_RECONCILED(outcome=COMMITTED)` (the transition) plus
|
|
1322
|
+
a same-revision informational mirror `ACTION_COMMIT_RECORDED(reconciled=true)`
|
|
1323
|
+
(corroboration only). Ledger replay applies the transition exactly once and
|
|
1324
|
+
validates mirror identity; forged or orphaned mirrors invalidate the ledger.
|
|
1325
|
+
- **Completion consumes readiness.** Required-action completion truth comes
|
|
1326
|
+
from the canonical action-readiness projection, never from raw state labels.
|
|
1327
|
+
A forged or legacy `VERIFIED` label without trusted authorization and
|
|
1328
|
+
canonical verification evidence yields `UNTRUSTED` and blocks completion.
|
|
1329
|
+
- **Settling ambiguity requires trust.** Recording an `UNKNOWN`
|
|
1330
|
+
reconciliation observation is always safe. Settling `COMMIT_UNKNOWN` as
|
|
1331
|
+
`COMMITTED` or `NOT_COMMITTED` requires a trusted out-of-band host authority
|
|
1332
|
+
context plus bounded evidence references bound to the event. Trusted
|
|
1333
|
+
`NOT_COMMITTED` returns the action to `PROPOSED`, so any retry re-evaluates
|
|
1334
|
+
policy, approval, authority, and the task policy snapshot; stale
|
|
1335
|
+
authorization can never be reused.
|
|
1336
|
+
- **STARTED marks the launch boundary.** Deterministic pre-launch checks
|
|
1337
|
+
(argv normalization, command resolution, installation authority, policy
|
|
1338
|
+
identity, approvals) all run before `ACTION_STARTED`; post-start outcomes
|
|
1339
|
+
remain conservative: spawn failure without launch is `FAILED`; anything
|
|
1340
|
+
unproven is `COMMIT_UNKNOWN`.
|
|
1341
|
+
- **Capability policy participates in policy identity.** When
|
|
1342
|
+
`.forgeloop/policy/capabilities.json` exists, its digest participates in the
|
|
1343
|
+
policy lock, the active task policy snapshot, and authorization evidence.
|
|
1344
|
+
Drift blocks before any side effect (`E_ACTION_POLICY_DRIFT`).
|
|
1345
|
+
- **Host context is out-of-band.** Trusted authority travels as an execution
|
|
1346
|
+
context object supplied by an embedding host (`executeForgeLoopCommand` /
|
|
1347
|
+
`createForgeLoopMcpServer({ authorityContextProvider })`). CLI flags such as
|
|
1348
|
+
`--authority HOST_ATTESTED` are requested kinds, never proof. MCP launch
|
|
1349
|
+
flags expose transport surfaces only; tool arguments can never carry
|
|
1350
|
+
`authorityContext`.
|
|
1351
|
+
- **Guidance never lies about authority.** `forgeloop next` returns a
|
|
1352
|
+
structured `authorityRequired` requirement for host-bound approvals instead
|
|
1353
|
+
of recommending a command that cannot satisfy the blocker.
|
|
1354
|
+
|
|
1355
|
+
Trajectory metrics and reference evaluations are read-only projections over the
|
|
1356
|
+
canonical trace, reflection, actions, and events. Missing tokens, costs,
|
|
1357
|
+
provider, model, or optimal-path data remain `null`/`UNKNOWN`; a comparative
|
|
1358
|
+
efficiency ratio exists only when a project-local reference scenario supplies
|
|
1359
|
+
`reference.comparableSteps`. Existing information-gain, intervention, failure
|
|
1360
|
+
signature, and oscillation diagnostics remain canonical.
|
|
1361
|
+
|
|
1281
1362
|
## Multi-task concurrent project state
|
|
1282
1363
|
|
|
1283
1364
|
ForgeLoop supports isolated, concurrent tasks within the same repository workspace.
|
|
@@ -1289,7 +1370,7 @@ corruption through three fundamental protocol mechanisms:
|
|
|
1289
1370
|
`taskKey` derived as `SHA-256(taskId)` in 64 lowercase hexadecimal characters. All
|
|
1290
1371
|
task-scoped artifacts (`task.json`, `contract.json`, `routing-result.json`,
|
|
1291
1372
|
`preflight.json`, `work-state.json`, `events.ndjson`, `execution-receipt.json`,
|
|
1292
|
-
`continuity.json`, gates, and execution records) are stored strictly under
|
|
1373
|
+
`continuity.json`, `recovery.json`, gates, and execution records) are stored strictly under
|
|
1293
1374
|
`.forgeloop/task-state/<taskKey>/`. Shared repository configuration and sources
|
|
1294
1375
|
(`config.json`, `sources.json`) remain at `.forgeloop/`.
|
|
1295
1376
|
|
|
@@ -1304,16 +1385,65 @@ corruption through three fundamental protocol mechanisms:
|
|
|
1304
1385
|
(`E_TASK_SCOPE_FROZEN`).
|
|
1305
1386
|
- At verification and completion, Git modifications are validated to ensure no changes
|
|
1306
1387
|
escaped the task's declared scope (`E_TASK_CHANGE_OUTSIDE_SCOPE`).
|
|
1388
|
+
- `task.json` retains historical claims. Effective claims are empty only after
|
|
1389
|
+
validator-backed `COMPLETE` or when the canonical claim-state resolver
|
|
1390
|
+
validates `recovery.json` against the descriptor, work state, and complete
|
|
1391
|
+
hash-chained recovery history. A tombstone alone never releases claims.
|
|
1392
|
+
- Fake, missing, corrupt, deleted, or mismatched recovery evidence is
|
|
1393
|
+
`INCONSISTENT`: every provable historical claim remains reserved,
|
|
1394
|
+
`mutationAllowed=false`, and overlapping claim acquisition fails with
|
|
1395
|
+
`E_TASK_CLAIM_OWNERSHIP_INCONSISTENT`.
|
|
1396
|
+
- Recovery is not completion. `task-recover` accepts only deterministic
|
|
1397
|
+
`STALE` or `ABANDONED` classifications, preserves work state, receipts,
|
|
1398
|
+
failures, policy, continuity, and repository fingerprints, and suspends
|
|
1399
|
+
ordinary task mutation with `E_TASK_RECOVERED`.
|
|
1400
|
+
- Only `forgeloop task-resume --task <id>` may remove recovery state. It
|
|
1401
|
+
first validates recovery ownership and lifecycle revision, safely settles
|
|
1402
|
+
only an unchanged stale task lease, then reacquires the released (or
|
|
1403
|
+
explicitly supplied) claims through the normal overlap and clean-checkout
|
|
1404
|
+
checks under the project claims lock. A claim held by another task remains
|
|
1405
|
+
unavailable. `TASK_RECOVERY_RESUMED` is meaningful activity.
|
|
1307
1406
|
|
|
1308
1407
|
3. **Per-Task Exclusive Mutex Locking**:
|
|
1309
1408
|
Mutating lifecycle commands (`advance`, `preflight`, `run-check`, `complete`, etc.)
|
|
1310
|
-
acquire an exclusive filesystem lock at `.forgeloop/
|
|
1409
|
+
acquire an exclusive filesystem lock at `.forgeloop/locks/<taskKey>.lock` using
|
|
1311
1410
|
atomic creation flags (`wx`). Concurrent mutations on the same task reject with
|
|
1312
1411
|
`E_TASK_LOCKED`. Read-only commands (`status`, `audit`, `inspect`, `continuity`) bypass
|
|
1313
|
-
locking.
|
|
1412
|
+
locking. Lock inspection distinguishes `NONE`, `LIVE`, `STALE`, `UNKNOWN`,
|
|
1413
|
+
and `CORRUPT`; unknown or corrupt ownership fails closed. Stale-only release
|
|
1414
|
+
compares the observed lock ID, heartbeat, and owner instance before deletion.
|
|
1415
|
+
|
|
1416
|
+
Recovery that changes claim ownership acquires the project claims lock before
|
|
1417
|
+
the task lock, safely settles an unchanged stale lease, then revalidates phase,
|
|
1418
|
+
work-state revision, ledger sequence, and the `STALE`/`ABANDONED` allowlist
|
|
1419
|
+
before committing `recovery.json` and its append-only event in one transaction.
|
|
1420
|
+
The project claims lock itself uses the same `NONE`/`LIVE`/`STALE`/`UNKNOWN`/
|
|
1421
|
+
`CORRUPT` lease classification and CAS-safe quarantine/restore semantics;
|
|
1422
|
+
unknown, corrupt, or concurrently replaced ownership fails with
|
|
1423
|
+
`E_PROJECT_CLAIMS_LOCK_INCONSISTENT`.
|
|
1424
|
+
The standalone acknowledgement flag does not grant host authority:
|
|
1425
|
+
|
|
1426
|
+
```text
|
|
1427
|
+
--acknowledge-recovery
|
|
1428
|
+
≠
|
|
1429
|
+
HOST_ATTESTED
|
|
1430
|
+
```
|
|
1431
|
+
|
|
1432
|
+
`forgeloop next --task <id> --json` maps conflict evidence to structured
|
|
1433
|
+
`RECONCILE_CLOSURE`, `RECOVER_TASK`, `RESUME_RECOVERED_TASK`, or
|
|
1434
|
+
`RESOLVE_RECOVERY_INCONSISTENCY` guidance. A `RECOVERABLE` task must use its
|
|
1435
|
+
canonical reconciliation path and cannot release claims through `task-recover`.
|
|
1314
1436
|
|
|
1315
1437
|
4. **Task Resolution & Legacy Migration**:
|
|
1316
1438
|
Commands select their target task via `--task <id>`, the `FORGELOOP_TASK` environment
|
|
1317
|
-
variable, or implicit single-task fallback.
|
|
1318
|
-
|
|
1439
|
+
variable, or implicit single-task fallback. Only mutation-active tasks are
|
|
1440
|
+
implicit candidates; recovered, inconsistent, and `COMPLETE` tasks remain
|
|
1441
|
+
explicitly addressable but do not make unrelated work ambiguous. If multiple
|
|
1442
|
+
mutation-active tasks exist without a selector, ForgeLoop fails closed with
|
|
1443
|
+
`E_TASK_AMBIGUOUS`. Legacy ForgeLoop 1.0 single-task
|
|
1319
1444
|
layouts can be migrated into namespaced layout using `forgeloop task-migrate`.
|
|
1445
|
+
|
|
1446
|
+
A project containing active task recovery state requires ForgeLoop 1.4.0 or
|
|
1447
|
+
newer.
|
|
1448
|
+
<a id="FL-CLAIM-002"></a> **FL-CLAIM-002 — Harnesses that cannot validate task-recovery schema v1 and its linked ledger history MUST refuse**
|
|
1449
|
+
ownership mutation rather than fall back to descriptor-only claims.
|
package/LOOP_SYSTEM_DESIGN.md
CHANGED
|
@@ -380,12 +380,33 @@ registry. If it is not available yet, the same commands can run as
|
|
|
380
380
|
documents into `.forgeloop/kit/`, keeps only native instruction shims at the
|
|
381
381
|
target root, and leaves project-scoped configuration under `.forgeloop/` while
|
|
382
382
|
isolating modern mutable task protocol state (contract, route, gate, state,
|
|
383
|
-
event, preflight, and
|
|
383
|
+
event, preflight, receipt, and recovery artifacts) under
|
|
384
384
|
`.forgeloop/task-state/<taskKey>/`. Legacy singleton artifacts remain under
|
|
385
385
|
`.forgeloop/` for compatibility and migration only. Manual copying must
|
|
386
386
|
preserve that target layout; copying package-source root files directly is not
|
|
387
387
|
equivalent to `forgeloop init`.
|
|
388
388
|
|
|
389
|
+
Recovery uses a relational state model: `work-state.json` owns the lifecycle
|
|
390
|
+
phase, `task.json` retains historical claims, `recovery.json` records current
|
|
391
|
+
suspension, and the complete hash-chained ledger proves recovery/resume cycles.
|
|
392
|
+
Only their canonical validated projection can release effective claims. The
|
|
393
|
+
same holds for completion: `RELEASED_BY_COMPLETION` requires the canonical
|
|
394
|
+
completion ownership proof (COMPLETE phase plus a validated ledger containing
|
|
395
|
+
the task-bound `COMPLETION_VALIDATED` event with coherent state and no
|
|
396
|
+
contradicting later lifecycle event); a manually forged COMPLETE state is
|
|
397
|
+
`INCONSISTENT`, retains historical claims, and disables mutation. Any
|
|
398
|
+
missing, corrupt, forged, or mismatched relationship is `INCONSISTENT`, retains
|
|
399
|
+
historical claims, and disables mutation. Recovery never fabricates completion;
|
|
400
|
+
`task-resume` is the only path that rechecks and reacquires ownership before
|
|
401
|
+
removing the recovery artifact. Project claim serialization always precedes
|
|
402
|
+
the per-task lock for create, scope, recover, and resume operations, and both
|
|
403
|
+
lock classes use lease classification plus CAS-safe stale settlement. Task
|
|
404
|
+
locks additionally require complete owner identity (`taskId`, `lockId`,
|
|
405
|
+
`ownerInstanceId`, `operation`, heartbeat, positive lease): incomplete identity
|
|
406
|
+
classifies `UNKNOWN` and is never eligible for stale release. Implicit task
|
|
407
|
+
selection distinguishes read-only discoverability (`READ`: any single healthy
|
|
408
|
+
task) from mutation authority (`MUTATION`: only operationally active tasks).
|
|
409
|
+
|
|
389
410
|
The README explains the file set, activation behavior, current/relative/absolute
|
|
390
411
|
target installation, first-run profile flow, local validation commands, and safe
|
|
391
412
|
update practice.
|
|
@@ -421,3 +442,35 @@ machine and not a general memory subsystem. Work state owns lifecycle truth;
|
|
|
421
442
|
the checkout owns implementation truth; checks/executions own verification
|
|
422
443
|
truth; completion owns certification. Continuity only narrows what a receiving
|
|
423
444
|
executor should inspect and continue.
|
|
445
|
+
|
|
446
|
+
## Durable action and trajectory boundary
|
|
447
|
+
|
|
448
|
+
Durable actions are protocol-owned task artifacts (`actions/`, `approvals/`,
|
|
449
|
+
and `evaluations/`) projected through the existing hash-chained event ledger.
|
|
450
|
+
They record intent, capability policy, approval binding, execution provenance,
|
|
451
|
+
commit uncertainty, reconciliation, and verification without introducing a
|
|
452
|
+
workflow runtime, scheduler, queue, or second ledger.
|
|
453
|
+
|
|
454
|
+
The external side-effect boundary is deliberately conservative: exact argv is
|
|
455
|
+
launched only through `run-action` with no shell mode; project capability
|
|
456
|
+
policy cannot manufacture `HOST_ATTESTED` authority, and trusted host context
|
|
457
|
+
travels out-of-band only (never inside command input, CLI flags, or tool
|
|
458
|
+
arguments). Authorization and verification are canonical core services:
|
|
459
|
+
callers cannot mint `AUTHORIZED` or `VERIFIED`, verification requires an
|
|
460
|
+
independent passed ForgeLoop execution artifact, and required completion
|
|
461
|
+
consumes the canonical action-readiness projection rather than raw state
|
|
462
|
+
labels. Capability policy participates in policy identity: its digest is bound
|
|
463
|
+
into the policy lock, the task policy snapshot, and authorization evidence, so
|
|
464
|
+
drift blocks before any side effect. A started action whose external result is
|
|
465
|
+
uncertain becomes `COMMIT_UNKNOWN`, which forbids retry until explicit
|
|
466
|
+
reconciliation; settling ambiguity as `COMMITTED`/`NOT_COMMITTED` requires
|
|
467
|
+
trusted host attestation plus evidence, and a trusted `NOT_COMMITTED` returns
|
|
468
|
+
the action to `PROPOSED` so stale authorization can never be reused. This
|
|
469
|
+
reduces duplicate-effect risk but cannot provide a universal exactly-once
|
|
470
|
+
guarantee for arbitrary external systems.
|
|
471
|
+
|
|
472
|
+
Metrics and trajectory evaluation are deterministic read-only projections of
|
|
473
|
+
canonical trace/reflection evidence. They preserve unknown usage values and
|
|
474
|
+
only compare efficiency when a project-local reference scenario exists. The
|
|
475
|
+
existing diagnostic and reflection model remains the authority for information
|
|
476
|
+
gain, intervention effectiveness, failure signatures, and oscillation.
|
package/PROTOCOL_INTEGRATION.md
CHANGED
|
@@ -158,6 +158,7 @@ The following protocol artifacts are strictly owned by ForgeLoop:
|
|
|
158
158
|
- `.forgeloop/task-state/<taskKey>/work-state.json`
|
|
159
159
|
- `.forgeloop/task-state/<taskKey>/events.ndjson`
|
|
160
160
|
- `.forgeloop/task-state/<taskKey>/execution-receipt.json`
|
|
161
|
+
- `.forgeloop/task-state/<taskKey>/recovery.json`
|
|
161
162
|
- `.forgeloop/task-state/<taskKey>/executions/<executionId>.json`
|
|
162
163
|
- Canonical check, evidence, and terminal-result state
|
|
163
164
|
|
|
@@ -231,6 +232,21 @@ actor claim ≠ operator grant
|
|
|
231
232
|
Authority cannot be self-issued by the actor consuming it. Boolean fields inside
|
|
232
233
|
verification evidence are not sufficient proof of installation authority.
|
|
233
234
|
|
|
235
|
+
The same rule applies to claim-release recovery. The standalone
|
|
236
|
+
`--acknowledge-recovery` flag records `CALLER_ACKNOWLEDGED`; it is an explicit
|
|
237
|
+
request, not a host grant. The deprecated `--operator-authorized` spelling is
|
|
238
|
+
only a compatibility alias and has identical caller-acknowledgement semantics.
|
|
239
|
+
`HOST_ATTESTED` recovery metadata is valid only when a host integration supplies
|
|
240
|
+
a trusted grant reference through a boundary the active actor cannot mint or
|
|
241
|
+
replace. The standalone CLI does not expose such a self-attestation option.
|
|
242
|
+
|
|
243
|
+
Claim ownership is a validated relationship, not an artifact preference.
|
|
244
|
+
<a id="FL-CLAIM-001"></a> **FL-CLAIM-001 — Every harness MUST consume the canonical claim-state resolver**
|
|
245
|
+
over the descriptor, work state, recovery artifact, and complete validated
|
|
246
|
+
recovery history. The resolver retains historical claims and disables mutation
|
|
247
|
+
when that relationship is `INCONSISTENT`; reading `recovery.json` alone is
|
|
248
|
+
non-conforming.
|
|
249
|
+
|
|
234
250
|
### Authority provenance
|
|
235
251
|
|
|
236
252
|
Authority provenance is external to actor-authored project state. An external
|
|
@@ -261,6 +277,31 @@ configuration
|
|
|
261
277
|
trust
|
|
262
278
|
```
|
|
263
279
|
|
|
280
|
+
For durable actions, trusted host authority travels **out-of-band** through the
|
|
281
|
+
programmatic integration API:
|
|
282
|
+
|
|
283
|
+
```js
|
|
284
|
+
await executeForgeLoopCommand({
|
|
285
|
+
command: "approval-resolve",
|
|
286
|
+
projectPath,
|
|
287
|
+
input: { /* actor-controlled command input only */ },
|
|
288
|
+
authorityContext: trustedHostContext, // host-supplied, never from input
|
|
289
|
+
});
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
`authorityContext` and `runtimeContext` are separate executor parameters; they
|
|
293
|
+
are never merged into `input`, never accepted as tool arguments, and cannot be
|
|
294
|
+
minted by CLI flags, project files, environment variables, or transport
|
|
295
|
+
sessions. MCP embeddings supply an immutable provider instead:
|
|
296
|
+
|
|
297
|
+
```js
|
|
298
|
+
createForgeLoopMcpServer({
|
|
299
|
+
projectPath,
|
|
300
|
+
allowApprovalResolution: true, // transport surface only
|
|
301
|
+
authorityContextProvider: async ({ command }) => trustedContextOrNull,
|
|
302
|
+
});
|
|
303
|
+
```
|
|
304
|
+
|
|
264
305
|
The host-attested source must still resolve outside the actor-writable target. A
|
|
265
306
|
project-local authority reference may identify a grant, but it does not create
|
|
266
307
|
the root of trust.
|
|
@@ -354,4 +395,50 @@ ForgeLoop integrates executable verification rules directly into the lifecycle:
|
|
|
354
395
|
- **Autonomy Principle**: Non-interactive execution is preserved. Tools, commands, and validators operate unattended with standard input closed and without interactive prompt dependencies.
|
|
355
396
|
- **Baseline Protection**: Re-recording baseline debt mid-task is rejected with `E_BASELINE_RECORD_DURING_ACTIVE_TASK`; only monotonic ratchet-down is allowed during active tasks (`baseline --update`). Explicit re-recording requires `--policy-reset-authorized`.
|
|
356
397
|
- **Semantic Recovery**: `forgeloop next` maps policy findings directly to actionable recovery actions (`RESTORE_POLICY`, `REPAIR_CHECKER`, `REPAIR_POLICY`, `REVERIFY_AFTER_POLICY_CHANGE`, `RESTORE_BASELINE`, `CONTINUE_WITH_EXISTING_BASELINE`, `RESOLVE_INERT_CHECK`).
|
|
398
|
+
- **Claim Recovery**: `forgeloop next` maps validated task ownership to `RECONCILE_CLOSURE`, `RECOVER_TASK`, `RESUME_RECOVERED_TASK`, or `RESOLVE_RECOVERY_INCONSISTENCY`. `task-recover` is restricted to `STALE`/`ABANDONED`; it writes durable `recovery.json` plus an append-only event without changing lifecycle evidence. `task-resume` validates the same ownership projection, safely settles an unchanged stale task lock, reuses canonical scope conflict checks, and removes recovery state transactionally.
|
|
357
399
|
- **Task Scoping**: Task-specific policy snapshots and state live under `.forgeloop/task-state/<taskKey>/` to ensure clean multi-task isolation and cross-harness continuity.
|
|
400
|
+
|
|
401
|
+
## Structured integration surfaces
|
|
402
|
+
|
|
403
|
+
When a host provides an official ForgeLoop structured integration, prefer it
|
|
404
|
+
for protocol operations; otherwise use the project-local ForgeLoop CLI. Both
|
|
405
|
+
surfaces execute the same canonical commands and share one protocol authority:
|
|
406
|
+
`.forgeloop/` state written only by ForgeLoop itself.
|
|
407
|
+
|
|
408
|
+
- `@cassiomc1/forgeloop/integration` (integration API version 1): the
|
|
409
|
+
transport-neutral programmatic runtime. Domain rejections keep `ok:true`
|
|
410
|
+
with a non-zero exit code; public error codes are preserved verbatim.
|
|
411
|
+
- `@cassiomc1/forgeloop-mcp` (local stdio MCP): an adapter over the same API.
|
|
412
|
+
It never edits `.forgeloop/` state directly, never synthesizes authority,
|
|
413
|
+
and never derives claim ownership outside the canonical resolver
|
|
414
|
+
(`features.integrationApi.version >= 1` in `protocol-info --json`).
|
|
415
|
+
|
|
416
|
+
ForgeLoop applicability never depends on MCP availability: instruction-only
|
|
417
|
+
hosts remain fully supported through the CLI and instruction adapters.
|
|
418
|
+
|
|
419
|
+
`protocol-info --json` advertises claim-recovery capability version 1 under
|
|
420
|
+
`features.taskClaimRecovery`. A project containing active task recovery state
|
|
421
|
+
requires ForgeLoop 1.4.0 or newer.
|
|
422
|
+
<a id="FL-CLAIM-003"></a> **FL-CLAIM-003 — A reader without `validatedClaimProjection=true` MUST fail closed**
|
|
423
|
+
and must not mutate claims.
|
|
424
|
+
|
|
425
|
+
## Durable actions and authority boundary
|
|
426
|
+
|
|
427
|
+
Durable action support is additive to the integration contract. Read-only
|
|
428
|
+
resources may expose action, approval, metrics, evaluation, and capability
|
|
429
|
+
policy projections, but an integration must not treat transport metadata,
|
|
430
|
+
session IDs, project policy, or actor prose as host authority. `HOST_ATTESTED`
|
|
431
|
+
is accepted only from the existing host trust boundary.
|
|
432
|
+
|
|
433
|
+
`run-action` is an exact-argv surface with no shell mode. Hosts that perform an
|
|
434
|
+
operation themselves must record it as `HOST_REPORTED`; external observations
|
|
435
|
+
used to settle uncertainty are `EXTERNAL_OBSERVED`. A started action whose
|
|
436
|
+
external outcome cannot be proven is `COMMIT_UNKNOWN`: integrations must surface
|
|
437
|
+
`E_ACTION_RECONCILIATION_REQUIRED` and must not retry automatically. The only
|
|
438
|
+
forward path is explicit `action-reconcile` with bounded evidence.
|
|
439
|
+
|
|
440
|
+
Trajectory metrics and evaluations are read-only projections over canonical
|
|
441
|
+
events and trace/reflection data. Missing token/cost/model data remains unknown,
|
|
442
|
+
and efficiency is comparable only when a project-local scenario supplies a
|
|
443
|
+
positive reference step count. ForgeLoop remains an evidence protocol, not an
|
|
444
|
+
agent runtime or workflow engine.
|
package/QUALITY_SCORECARD.md
CHANGED
|
@@ -31,6 +31,8 @@ policy are all present.
|
|
|
31
31
|
| Contextual frontend taste | Taste is routed only to applicable premium frontend work, remains advisory, respects accessibility/performance/evidence, and has attribution without runtime dependency. |
|
|
32
32
|
| Multi-agent coordination | Self-contained briefs, write/write and write/read ownership checks, dependency-set validation, reviewer independence, normalized results, and inline fallback. |
|
|
33
33
|
| Security boundaries | Realpath containment, bounded untrusted JSON, threat model, nested secret scanning, publication evidence, and explicit authority rules. |
|
|
34
|
+
| Durable external actions | Immutable action identity, idempotency conflict rejection, capability policy, fingerprint-bound approvals, exact-argv provenance, `COMMIT_UNKNOWN` reconciliation, completion blocking, and audit evidence. |
|
|
35
|
+
| Trajectory evaluation | Read-only trace/reflection metrics, unknown usage preservation, canonical comparable-step definition, and scenario-bound efficiency without an arbitrary overall score. |
|
|
34
36
|
| Maintenance quality | Small modules, built-in runtime, deterministic JSON contracts, malformed/version fixtures, package gates, and backward-compatible protocol versions. |
|
|
35
37
|
|
|
36
38
|
## Score rules
|