@cassiomc1/forgeloop 0.1.11 → 0.1.12
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/.cursor/rules/project-loop.mdc +16 -18
- package/.github/copilot-instructions.md +16 -19
- package/AGENTS.md +18 -24
- package/AGENT_COMPATIBILITY.md +4 -211
- package/CLAUDE.md +16 -18
- package/LOOP_ENGINEERING.md +64 -0
- package/LOOP_SYSTEM_DESIGN.md +4 -4
- package/PROTOCOL_INTEGRATION.md +171 -0
- package/QUALITY_SCORECARD.md +1 -1
- package/README.md +106 -148
- package/TERMINOLOGY.md +2 -0
- package/THREAT_MODEL.md +3 -0
- package/package.json +5 -4
- package/src/core/discovery-surfaces.js +22 -0
- package/src/core/inspect.js +23 -12
- package/src/core/native-adapters.js +30 -2
- package/src/core/templates.js +1 -0
- package/conformance/README.md +0 -153
- package/conformance/backend-auth/EXPECTED_ROUTE.json +0 -7
- package/conformance/backend-auth/REQUEST.md +0 -4
- package/conformance/backend-auth/REQUIRED_EVIDENCE.json +0 -3
- package/conformance/backend-auth/REQUIRED_GATES.json +0 -3
- package/conformance/blind-premium-website/EXPECTED_ROUTE.json +0 -7
- package/conformance/blind-premium-website/REQUEST.md +0 -6
- package/conformance/blind-premium-website/REQUIRED_EVIDENCE.json +0 -14
- package/conformance/blind-premium-website/REQUIRED_GATES.json +0 -3
- package/conformance/complete-website/EXPECTED_ROUTE.json +0 -7
- package/conformance/complete-website/REQUEST.md +0 -6
- package/conformance/complete-website/REQUIRED_EVIDENCE.json +0 -3
- package/conformance/complete-website/REQUIRED_GATES.json +0 -3
- package/conformance/docs-only/EXPECTED_ROUTE.json +0 -7
- package/conformance/docs-only/REQUEST.md +0 -4
- package/conformance/docs-only/REQUIRED_EVIDENCE.json +0 -3
- package/conformance/docs-only/REQUIRED_GATES.json +0 -3
- package/conformance/runs/2026-08-11-codex-first-live.md +0 -98
- package/conformance/runs/2026-08-11-codex-second-live.md +0 -87
- package/conformance/runs/2026-08-13-codex-fifth-live.md +0 -386
- package/conformance/runs/2026-08-13-codex-fourth-live.md +0 -309
- package/conformance/runs/2026-08-13-codex-sixth-live.md +0 -412
- package/conformance/simple-bug/EXPECTED_ROUTE.json +0 -7
- package/conformance/simple-bug/REQUEST.md +0 -4
- package/conformance/simple-bug/REQUIRED_EVIDENCE.json +0 -3
- package/conformance/simple-bug/REQUIRED_GATES.json +0 -3
- package/src/core/agent-support.js +0 -89
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Protocol Integration
|
|
2
|
+
|
|
3
|
+
ForgeLoop is a portable, project-scoped engineering protocol. It is vendor-neutral
|
|
4
|
+
and is not tied to a specific model, provider, agent product, IDE, or orchestration runtime.
|
|
5
|
+
|
|
6
|
+
The protocol becomes applicable because a project activates ForgeLoop, not because
|
|
7
|
+
an execution environment appears in a compatibility list.
|
|
8
|
+
|
|
9
|
+
<!-- FORGELOOP_PROJECT_PROTOCOL=REQUIRED -->
|
|
10
|
+
|
|
11
|
+
## Universal applicability
|
|
12
|
+
|
|
13
|
+
If the active execution environment discovers a ForgeLoop project adapter,
|
|
14
|
+
the canonical ForgeLoop protocol applies to work performed in that project.
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
PROJECT HAS FORGELOOP ADAPTER
|
|
18
|
+
+
|
|
19
|
+
RUNTIME DISCOVERS IT
|
|
20
|
+
+
|
|
21
|
+
REQUIRED LOCAL CAPABILITIES ARE AVAILABLE
|
|
22
|
+
=
|
|
23
|
+
FORGELOOP APPLIES
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
An execution environment that has not been previously tested is
|
|
27
|
+
`CONFORMANCE_UNVERIFIED`, not unsupported and not exempt from the protocol.
|
|
28
|
+
|
|
29
|
+
Capabilities determine how much of ForgeLoop can be executed. Brand names do not.
|
|
30
|
+
|
|
31
|
+
### Interpretation rules
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
INVALID:
|
|
35
|
+
"I am not a named ForgeLoop integration, therefore ForgeLoop does not apply."
|
|
36
|
+
"I will follow ForgeLoop only in spirit because my harness is not documented."
|
|
37
|
+
|
|
38
|
+
VALID:
|
|
39
|
+
"I discovered the ForgeLoop project adapter. ForgeLoop applies.
|
|
40
|
+
My current runtime may have unverified or limited capabilities, which I will evaluate."
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Integration levels
|
|
44
|
+
|
|
45
|
+
Execution environments integrate with ForgeLoop by capability:
|
|
46
|
+
|
|
47
|
+
### Level 1 — `INSTRUCTION_DISCOVERED`
|
|
48
|
+
|
|
49
|
+
The environment has automatically or explicitly loaded a project-local ForgeLoop
|
|
50
|
+
adapter (such as `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/project-loop.mdc`,
|
|
51
|
+
`.github/copilot-instructions.md`, or manual bootstrap).
|
|
52
|
+
|
|
53
|
+
### Level 2 — `PROTOCOL_CAPABLE`
|
|
54
|
+
|
|
55
|
+
The environment possesses the necessary local capabilities:
|
|
56
|
+
|
|
57
|
+
- Read project files.
|
|
58
|
+
- Write project-local files.
|
|
59
|
+
- Execute local commands.
|
|
60
|
+
- Invoke the project-local ForgeLoop CLI.
|
|
61
|
+
- Preserve project state across lifecycle transitions.
|
|
62
|
+
|
|
63
|
+
When these are available, the environment executes the complete ForgeLoop lifecycle.
|
|
64
|
+
|
|
65
|
+
### Level 3 — `PROTOCOL_LIMITED`
|
|
66
|
+
|
|
67
|
+
The environment discovered ForgeLoop but lacks one or more required local
|
|
68
|
+
capabilities (for example, no command execution or no write access).
|
|
69
|
+
|
|
70
|
+
ForgeLoop **still applies**, but the runtime must:
|
|
71
|
+
|
|
72
|
+
- Fail closed for the affected lifecycle dimension.
|
|
73
|
+
- Report the missing capability explicitly.
|
|
74
|
+
- Never simulate missing capabilities.
|
|
75
|
+
- Never manually fabricate protocol-owned state.
|
|
76
|
+
- Never claim validator-backed completion.
|
|
77
|
+
|
|
78
|
+
### Level 4 — `CONFORMANCE_VERIFIED`
|
|
79
|
+
|
|
80
|
+
A specific runtime, model, version, environment, and configuration has completed a
|
|
81
|
+
recorded blind conformance scenario under standard protocol verification.
|
|
82
|
+
|
|
83
|
+
Conformance verification is **evidence of tested interoperability**; it is
|
|
84
|
+
never an eligibility gate or allowlist for protocol adoption.
|
|
85
|
+
|
|
86
|
+
## Discovery surfaces
|
|
87
|
+
|
|
88
|
+
ForgeLoop provides project-local shims for common instruction-discovery mechanisms:
|
|
89
|
+
|
|
90
|
+
- `AGENTS.md`: Standard discovery surface recognized by multiple AI coding tools and developers.
|
|
91
|
+
- `CLAUDE.md`: Discovery surface for Claude Code.
|
|
92
|
+
- `.cursor/rules/project-loop.mdc`: MDC rule format for Cursor.
|
|
93
|
+
- `.github/copilot-instructions.md`: Repository instructions for GitHub Copilot.
|
|
94
|
+
|
|
95
|
+
These files are discovery aliases. They all point to the same canonical project
|
|
96
|
+
protocol in `.forgeloop/kit/LOOP_ENGINEERING.md` and `.forgeloop/kit/PROTOCOL_INTEGRATION.md`.
|
|
97
|
+
They do not define separate ForgeLoop implementations.
|
|
98
|
+
|
|
99
|
+
### Generic and manual bootstrap
|
|
100
|
+
|
|
101
|
+
For environments, internal enterprise agents, custom harnesses, or developer-operated
|
|
102
|
+
workflows that do not automatically discover one of the default files:
|
|
103
|
+
|
|
104
|
+
1. Read `.forgeloop/kit/LOOP_ENGINEERING.md`.
|
|
105
|
+
2. Read `.forgeloop/kit/PROTOCOL_INTEGRATION.md`.
|
|
106
|
+
3. Resolve the project-local ForgeLoop CLI.
|
|
107
|
+
4. Execute the contract, route, preflight, and lifecycle workflow.
|
|
108
|
+
|
|
109
|
+
A developer or custom automation can execute ForgeLoop identically to an AI agent.
|
|
110
|
+
|
|
111
|
+
## CLI resolution policy
|
|
112
|
+
|
|
113
|
+
Lifecycle-owned protocol state must be managed through the project-local ForgeLoop CLI:
|
|
114
|
+
|
|
115
|
+
1. Project-local `node_modules/.bin/forgeloop`
|
|
116
|
+
2. Package manager local execution (e.g. `npx --no-install forgeloop` or equivalent)
|
|
117
|
+
3. Direct package CLI entry point (`node src/cli.js`)
|
|
118
|
+
4. Verified global `forgeloop` matching the installed package version
|
|
119
|
+
|
|
120
|
+
Do not automatically download a different version during a reproducible run.
|
|
121
|
+
The resolved CLI must match the installed project's package identity.
|
|
122
|
+
|
|
123
|
+
## Protocol-owned state and no-simulation policy
|
|
124
|
+
|
|
125
|
+
The following protocol artifacts are strictly owned by ForgeLoop:
|
|
126
|
+
|
|
127
|
+
- `.forgeloop/preflight.json`
|
|
128
|
+
- `.forgeloop/work-state.json`
|
|
129
|
+
- `.forgeloop/events.ndjson`
|
|
130
|
+
- `.forgeloop/execution-receipt.json`
|
|
131
|
+
- Canonical check, evidence, and terminal-result state
|
|
132
|
+
|
|
133
|
+
If the required CLI or API capability cannot be resolved:
|
|
134
|
+
|
|
135
|
+
- **Do not** fabricate lifecycle state manually.
|
|
136
|
+
- **Do not** synthesize event history.
|
|
137
|
+
- **Do not** manually assign `COMPLETE`.
|
|
138
|
+
- **Do not** construct a fake execution receipt.
|
|
139
|
+
- **Do not** rewrite `events.ndjson` to simulate chronology.
|
|
140
|
+
|
|
141
|
+
Report the corresponding ForgeLoop dimension as `NOT_VERIFIED` / `E_FORGELOOP_CLI_UNAVAILABLE`.
|
|
142
|
+
|
|
143
|
+
## Optional capability extensions
|
|
144
|
+
|
|
145
|
+
The installed loop directs the active actor to inspect native model and harness
|
|
146
|
+
capabilities. When a task requires a missing capability (e.g. multimodal vision),
|
|
147
|
+
the actor may install the smallest task-scoped capability (such as `Qwen-MM-Plugins`)
|
|
148
|
+
through native mechanisms or upstream installers, then verify it before use.
|
|
149
|
+
|
|
150
|
+
API credentials, system packages, and unrelated environment changes remain
|
|
151
|
+
separately gated.
|
|
152
|
+
|
|
153
|
+
## Instruction precedence
|
|
154
|
+
|
|
155
|
+
When multiple instruction layers exist, follow standard precedence:
|
|
156
|
+
|
|
157
|
+
1. Platform, sandbox, and system security rules.
|
|
158
|
+
2. Direct user instructions in the latest prompt.
|
|
159
|
+
3. Target project-specific rules and instructions.
|
|
160
|
+
4. ForgeLoop project protocol (`LOOP_ENGINEERING.md`, `PROTOCOL_INTEGRATION.md`).
|
|
161
|
+
5. Activated domain guides (`GUIDE_ROUTER.md` → `ENG/*.md`).
|
|
162
|
+
6. Technical defaults and safe assumptions.
|
|
163
|
+
|
|
164
|
+
The absence of an environment's name from documentation is never a precedence conflict.
|
|
165
|
+
|
|
166
|
+
## External workflow interaction
|
|
167
|
+
|
|
168
|
+
External planning, interview, or review workflows (such as `/grill-me`, `/plan`, or IDE
|
|
169
|
+
review gates) may assist in clarifying requirements, but they must not silently
|
|
170
|
+
redefine ForgeLoop `NON_BLOCKING` decisions as `BLOCKING` in autonomous mode.
|
|
171
|
+
Consult `LOOP_ENGINEERING.md#external-workflow-interaction` for the complete boundary.
|
package/QUALITY_SCORECARD.md
CHANGED
|
@@ -80,7 +80,7 @@ are both present:
|
|
|
80
80
|
| Hidden kit layout | `src/core/target-layout.js`, safe init/update migration, manifest layout version, native shims, and profile resolver | `tests/hidden-layout.test.js`, package and compatibility tests |
|
|
81
81
|
| Contextual frontend taste | `ENG/taste-frontend-eng.md`, router metadata, attribution, and design/accessibility precedence | `tests/taste-guide.test.js`, route fixtures |
|
|
82
82
|
| Pre-contract autonomy — structural | `LOOP_ENGINEERING.md`, `src/core/decision-classification.js`, `src/core/workflow-compatibility.js`, `CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`, `.cursor/rules/project-loop.mdc` | `tests/decision-classification.test.js`, `tests/workflow-compatibility.test.js`, `tests/autonomy-policy.test.js`, `tests/preflight.test.js` |
|
|
83
|
-
| External workflow compatibility — structural | `LOOP_ENGINEERING.md`, `
|
|
83
|
+
| External workflow compatibility — structural | `LOOP_ENGINEERING.md`, `PROTOCOL_INTEGRATION.md`, `src/core/workflow-compatibility.js`, and sixth-run harness metadata rule | `tests/workflow-compatibility.test.js`, `conformance/README.md` |
|
|
84
84
|
| Instruction-conflict handling — structural | Canonical source-attribution and `WORKFLOW_CONFLICT` policy in `LOOP_ENGINEERING.md` plus adapter references | `tests/autonomy-policy.test.js`, `tests/workflow-compatibility.test.js` |
|
|
85
85
|
| Autonomous-mode precedence — structural | Autonomous/interactive mode contract and harness exclusion metadata | `tests/workflow-compatibility.test.js`, `tests/conformance-scenarios.test.js` |
|
|
86
86
|
| Pre-contract autonomy — cross-agent live robustness | Prior third blind-run result, `conformance/runs/2026-08-13-codex-fourth-live.md`, preserved fifth-run report `conformance/runs/2026-08-13-codex-fifth-live.md`, and the exact blind request | `tests/conformance-scenarios.test.js`; sixth run is not started until mandatory approval is excluded |
|
package/README.md
CHANGED
|
@@ -8,13 +8,14 @@ accessibility, design, and web games across web, mobile, and desktop projects.
|
|
|
8
8
|
|
|
9
9
|
The files are Markdown and can be used as references, as a foundation for
|
|
10
10
|
`AGENTS.md`, `CLAUDE.md`, `.cursor/rules`, and
|
|
11
|
-
`.github/copilot-instructions.md`. The
|
|
12
|
-
in [`
|
|
11
|
+
`.github/copilot-instructions.md`. The integration contract and capability levels are documented
|
|
12
|
+
in [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md). Adopt only the guides
|
|
13
13
|
relevant to the target project.
|
|
14
14
|
|
|
15
|
-
ForgeLoop is
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
ForgeLoop is a portable, verifiable engineering protocol for AI coding environments
|
|
16
|
+
and developer workflows. It turns intent into contract-driven execution with
|
|
17
|
+
deterministic routing, resumable state, evidence-backed verification, recovery, and
|
|
18
|
+
validator-backed completion.
|
|
18
19
|
|
|
19
20
|
The npm package also ships the local `forgeloop` CLI. In a target project it
|
|
20
21
|
installs canonical documents under `.forgeloop/kit/`, keeps only small native
|
|
@@ -54,141 +55,13 @@ target).
|
|
|
54
55
|
The canonical system map, including the routing/state/evidence architecture, is
|
|
55
56
|
in [`LOOP_SYSTEM_DESIGN.md`](./LOOP_SYSTEM_DESIGN.md).
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
hidden["write hidden<br/>kit"]
|
|
65
|
-
verified["verify hidden<br/>bytes"]
|
|
66
|
-
authority["atomic manifest<br/>authority switch"]
|
|
67
|
-
cleanup["hash-checked<br/>legacy cleanup"]
|
|
68
|
-
recovered["healthy or<br/>recoverable"]
|
|
69
|
-
incomplete["doctor:<br/>E_MIGRATION_INCOMPLETE"]
|
|
70
|
-
retry["update + retry<br/>owned cleanup"]
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
subgraph CONTRACT_ROUTING["2. Discovery, Contract & Routing"]
|
|
74
|
-
discovery["discovery +<br/>project profile"]
|
|
75
|
-
contract["current<br/>contract"]
|
|
76
|
-
routing["deterministic<br/>route"]
|
|
77
|
-
gates["required<br/>gates"]
|
|
78
|
-
preflight["preflight"]
|
|
79
|
-
ready["PREFLIGHT_READY"]
|
|
80
|
-
blocker["repair /<br/>blocker"]
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
subgraph EXECUTION_LOOP["3. Execution & Verification Loop"]
|
|
84
|
-
state["work-state<br/>checkpoint"]
|
|
85
|
-
events["append-only<br/>event ledger"]
|
|
86
|
-
lifecycle["PLANNED → EXECUTING<br/>→ VERIFYING"]
|
|
87
|
-
prepare["prepare<br/>completion receipt"]
|
|
88
|
-
checks["checks + structured<br/>evidence"]
|
|
89
|
-
readiness{"canonical evidence<br/>readiness"}
|
|
90
|
-
review["REVIEWING<br/>cycle N"]
|
|
91
|
-
diagnose["DIAGNOSING →<br/>CORRECTING"]
|
|
92
|
-
terminal_result["record-terminal-result<br/>(publication / production)"]
|
|
93
|
-
complete["complete<br/>validator"]
|
|
94
|
-
terminal["COMPLETE"]
|
|
95
|
-
rejected["COMPLETION_REJECTED<br/>(cycle N + 1)"]
|
|
96
|
-
receipt["updated execution<br/>receipt"]
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
subgraph AUDIT_CONFORMANCE["4. Freshness, Audit & Conformance"]
|
|
100
|
-
freshness["freshness<br/>fingerprints"]
|
|
101
|
-
conformance["validate-protocol<br/>/ conformance"]
|
|
102
|
-
audit["audit +<br/>validate-protocol"]
|
|
103
|
-
verdict["VALID / INCOMPLETE /<br/>STALE / INCONSISTENT / INVALID"]
|
|
104
|
-
delegation["optional bundle /<br/>delegation"]
|
|
105
|
-
handoff["handoff to<br/>compatible harness"]
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
root --> entry
|
|
109
|
-
entry --> migration
|
|
110
|
-
migration -->|legacy v1| plan
|
|
111
|
-
plan --> hidden
|
|
112
|
-
hidden --> verified
|
|
113
|
-
verified --> authority
|
|
114
|
-
authority --> cleanup
|
|
115
|
-
cleanup --> recovered
|
|
116
|
-
hidden -. interruption .-> incomplete
|
|
117
|
-
verified -. interruption .-> incomplete
|
|
118
|
-
authority -. interruption .-> incomplete
|
|
119
|
-
cleanup -. interruption .-> incomplete
|
|
120
|
-
migration -->|layout v2| retry
|
|
121
|
-
incomplete --> retry
|
|
122
|
-
|
|
123
|
-
entry --> discovery
|
|
124
|
-
discovery --> contract
|
|
125
|
-
contract --> routing
|
|
126
|
-
contract --> preflight
|
|
127
|
-
routing --> preflight
|
|
128
|
-
gates --> preflight
|
|
129
|
-
preflight -->|READY| ready
|
|
130
|
-
preflight -->|BLOCKED| blocker
|
|
131
|
-
|
|
132
|
-
ready --> state
|
|
133
|
-
ready --> events
|
|
134
|
-
state --> lifecycle
|
|
135
|
-
lifecycle --> prepare
|
|
136
|
-
prepare --> checks
|
|
137
|
-
checks --> readiness
|
|
138
|
-
readiness -->|covered| review
|
|
139
|
-
readiness -->|failed / blocked| diagnose
|
|
140
|
-
diagnose --> checks
|
|
141
|
-
review --> complete
|
|
142
|
-
review --> terminal_result
|
|
143
|
-
terminal_result --> complete
|
|
144
|
-
complete -->|VALID| terminal
|
|
145
|
-
complete -->|evidence-only rejection| rejected
|
|
146
|
-
rejected --> prepare
|
|
147
|
-
checks --> receipt
|
|
148
|
-
terminal_result --> receipt
|
|
149
|
-
|
|
150
|
-
contract --> freshness
|
|
151
|
-
routing --> freshness
|
|
152
|
-
state --> freshness
|
|
153
|
-
checks --> freshness
|
|
154
|
-
routing --> conformance
|
|
155
|
-
state --> conformance
|
|
156
|
-
receipt --> conformance
|
|
157
|
-
freshness --> conformance
|
|
158
|
-
conformance --> verdict
|
|
159
|
-
complete --> audit
|
|
160
|
-
events --> audit
|
|
161
|
-
audit --> verdict
|
|
162
|
-
|
|
163
|
-
routing --> delegation
|
|
164
|
-
checks --> delegation
|
|
165
|
-
delegation --> handoff
|
|
166
|
-
verdict --> handoff
|
|
167
|
-
blocker --> handoff
|
|
168
|
-
|
|
169
|
-
classDef root fill:#08090C,stroke:#6E6AF5,stroke-width:3px,color:#EDEEF0;
|
|
170
|
-
classDef entry fill:#101218,stroke:#3EDBB8,stroke-width:2px,color:#EDEEF0;
|
|
171
|
-
classDef migration fill:#0F766E,stroke:#5EEAD4,stroke-width:2px,color:#FFFFFF;
|
|
172
|
-
classDef routing fill:#4F46E5,stroke:#A5B4FC,stroke-width:2px,color:#FFFFFF;
|
|
173
|
-
classDef state fill:#373A46,stroke:#A1A1AA,stroke-width:2px,color:#FFFFFF;
|
|
174
|
-
classDef evidence fill:#3EDBB8,stroke:#99F6E4,stroke-width:2px,color:#08090C;
|
|
175
|
-
classDef fact fill:#181B24,stroke:#6E6AF5,stroke-width:1px,color:#EDEEF0;
|
|
176
|
-
classDef gate fill:#3730A3,stroke:#A5B4FC,stroke-width:2px,color:#FFFFFF;
|
|
177
|
-
classDef result fill:#C9A876,stroke:#F5D9A6,stroke-width:2px,color:#08090C;
|
|
178
|
-
classDef harness fill:#101218,stroke:#3EDBB8,stroke-width:2px,color:#EDEEF0;
|
|
179
|
-
|
|
180
|
-
class root root;
|
|
181
|
-
class entry,discovery,delegation entry;
|
|
182
|
-
class migration,plan,hidden,verified,authority,cleanup,recovered,retry,incomplete migration;
|
|
183
|
-
class routing,preflight,ready routing;
|
|
184
|
-
class state,events,lifecycle,review state;
|
|
185
|
-
class checks,readiness,receipt,complete,audit,terminal_result evidence;
|
|
186
|
-
class diagnose,rejected,gates,blocker gate;
|
|
187
|
-
class terminal,verdict result;
|
|
188
|
-
class contract,freshness,conformance fact;
|
|
189
|
-
class handoff harness;
|
|
190
|
-
linkStyle default stroke:#8A8F98,stroke-width:1.5px;
|
|
191
|
-
```
|
|
58
|
+
<p align="center">
|
|
59
|
+
<img
|
|
60
|
+
src="./docs/assets/forgeloop-flow.svg"
|
|
61
|
+
alt="ForgeLoop evidence-first engineering flow"
|
|
62
|
+
width="100%"
|
|
63
|
+
/>
|
|
64
|
+
</p>
|
|
192
65
|
|
|
193
66
|
Equivalent reading for text-only environments: adapters load the canonical kit;
|
|
194
67
|
an older target follows validate paths → write hidden files → verify their bytes
|
|
@@ -215,11 +88,13 @@ Request → discovery → profile → routing → plan → execution
|
|
|
215
88
|
└ evidence-only rejection / next cycle
|
|
216
89
|
```
|
|
217
90
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
91
|
+
ForgeLoop is project-scoped, capability-based, and vendor-neutral. Thin
|
|
92
|
+
native adapters support common discovery surfaces including Codex, Claude Code,
|
|
93
|
+
Cursor, and GitHub Copilot, while Antigravity, OpenCode, Hermes, Pi, Command Code,
|
|
94
|
+
Freebuff, custom agents, and developer workflows discover the shared `AGENTS.md`
|
|
95
|
+
entry point or manual bootstrap. All environments delegate to the same canonical
|
|
96
|
+
protocol; see [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md) for
|
|
97
|
+
capability levels, degradation rules, and precedence notes.
|
|
223
98
|
|
|
224
99
|
### Migration recovery and release freeze
|
|
225
100
|
|
|
@@ -249,6 +124,87 @@ requirement-specific terminal result recording, legal repeated verification
|
|
|
249
124
|
cycles, future-result and compound-evidence safeguards, and lifecycle-ledger
|
|
250
125
|
divergence detection.
|
|
251
126
|
|
|
127
|
+
## How to prompt ForgeLoop
|
|
128
|
+
|
|
129
|
+
You do not need a perfect prompt to use ForgeLoop.
|
|
130
|
+
|
|
131
|
+
Describe the outcome you want. ForgeLoop is designed to structure the execution around that request: resolve safe ambiguities, create an execution contract, route the relevant guides, satisfy gates, run preflight checks, implement, verify, correct, and repeat until the work is complete.
|
|
132
|
+
|
|
133
|
+
> **Don't engineer the perfect prompt. Define the outcome and let ForgeLoop engineer the feedback loop.**
|
|
134
|
+
|
|
135
|
+
### Minimal
|
|
136
|
+
|
|
137
|
+
A short request should be enough for ordinary work:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
Create a premium website for a law firm.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Recommended
|
|
144
|
+
|
|
145
|
+
Add the important outcome and product constraints:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
Create a premium website for a law firm.
|
|
149
|
+
|
|
150
|
+
It should feel modern, sophisticated and trustworthy, work well on mobile and desktop, and include a contact form.
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Structured
|
|
154
|
+
|
|
155
|
+
For larger or more constrained tasks, you can optionally use a lightweight task brief:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
Build: Premium law firm website
|
|
159
|
+
|
|
160
|
+
Goal:
|
|
161
|
+
Create a modern, sophisticated and trustworthy experience.
|
|
162
|
+
|
|
163
|
+
Requirements:
|
|
164
|
+
- Responsive on mobile and desktop
|
|
165
|
+
- Accessible navigation
|
|
166
|
+
- Contact form
|
|
167
|
+
- Premium visual design
|
|
168
|
+
- Good performance
|
|
169
|
+
|
|
170
|
+
Done when:
|
|
171
|
+
- The implementation is complete
|
|
172
|
+
- Required verification passes
|
|
173
|
+
- Mobile and desktop layouts are verified
|
|
174
|
+
- The contact form works
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The structured format is optional. It gives ForgeLoop more explicit constraints and success criteria, but it should not be necessary for ordinary tasks.
|
|
178
|
+
|
|
179
|
+
### What not to put in the prompt
|
|
180
|
+
|
|
181
|
+
Avoid recreating the ForgeLoop process inside the prompt:
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
First analyze the task.
|
|
185
|
+
Then create a plan.
|
|
186
|
+
Then inspect the files.
|
|
187
|
+
Then choose the guides.
|
|
188
|
+
Then implement.
|
|
189
|
+
Then run tests.
|
|
190
|
+
If tests fail, fix them.
|
|
191
|
+
Then review everything.
|
|
192
|
+
Then produce a report.
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
That workflow belongs to ForgeLoop.
|
|
196
|
+
|
|
197
|
+
Your prompt should primarily describe:
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
what you want
|
|
201
|
+
important requirements
|
|
202
|
+
real constraints
|
|
203
|
+
observable success conditions
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
ForgeLoop should determine how to execute and verify the work.
|
|
207
|
+
|
|
252
208
|
### Use with npm
|
|
253
209
|
|
|
254
210
|
The npm CLI targets Node.js 20 or newer and installs the kit into an existing
|
|
@@ -371,7 +327,7 @@ are never stored in that file. Status precedence is `INVALID` > `INCONSISTENT`
|
|
|
371
327
|
All protocol-support commands are local and offline-capable by default; the
|
|
372
328
|
package sends no telemetry and has no central trace service.
|
|
373
329
|
Capability gaps and inline/non-Git degraded mode are defined in
|
|
374
|
-
[`
|
|
330
|
+
[`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md); they are reported as
|
|
375
331
|
limitations rather than treated as silent successes.
|
|
376
332
|
|
|
377
333
|
### Live conformance modes
|
|
@@ -526,6 +482,7 @@ must remain thin. The resulting target layout is:
|
|
|
526
482
|
AGENTS.md
|
|
527
483
|
CLAUDE.md
|
|
528
484
|
.forgeloop/.gitignore
|
|
485
|
+
.forgeloop/kit/PROTOCOL_INTEGRATION.md
|
|
529
486
|
.forgeloop/kit/AGENT_COMPATIBILITY.md
|
|
530
487
|
.forgeloop/kit/LOOP_ENGINEERING.md
|
|
531
488
|
.forgeloop/kit/GUIDE_ROUTER.md
|
|
@@ -577,7 +534,7 @@ commands. A generic response that does not mention the loop, router, or sources
|
|
|
577
534
|
indicates that the adapter was not loaded.
|
|
578
535
|
|
|
579
536
|
After installation, start the preferred agent from the target project
|
|
580
|
-
directory. Use `
|
|
537
|
+
directory. Use `PROTOCOL_INTEGRATION.md` to confirm which file it should load and
|
|
581
538
|
which native entry point is expected. A live agent session is not required for
|
|
582
539
|
package installation or its automated tests.
|
|
583
540
|
|
|
@@ -667,7 +624,8 @@ adoption. Local rendering requires Node.js 22+ and FFmpeg.
|
|
|
667
624
|
.
|
|
668
625
|
├── AGENTS.md # shared Codex-compatible entry point
|
|
669
626
|
├── CLAUDE.md # Claude Code entry point
|
|
670
|
-
├──
|
|
627
|
+
├── PROTOCOL_INTEGRATION.md # vendor-neutral capability integration
|
|
628
|
+
├── AGENT_COMPATIBILITY.md # compatibility alias
|
|
671
629
|
├── LOOP_ENGINEERING.md # canonical operating cycle
|
|
672
630
|
├── GUIDE_ROUTER.md # contextual guide selection
|
|
673
631
|
├── PROJECT_PROFILE.md # source profile (target copy is under .forgeloop/kit/)
|
package/TERMINOLOGY.md
CHANGED
|
@@ -19,3 +19,5 @@
|
|
|
19
19
|
| Evidence kind | One of `OBSERVED`, `INFERRED`, `NOT_VERIFIED`, or `BLOCKED`; evidence never upgrades an unverified claim by itself. |
|
|
20
20
|
| Required artifact | A checkpoint-recorded relative path and SHA-256 hash that must still match before resume. |
|
|
21
21
|
| Conformance | Relationship validation across route, state, receipt, task brief, and delegated-result artifacts. |
|
|
22
|
+
| Universal applicability | ForgeLoop applies whenever an execution environment discovers a project adapter, regardless of model, provider, agent, IDE, or tool name. |
|
|
23
|
+
| Integration level | The capability tier of an execution environment (`INSTRUCTION_DISCOVERED`, `PROTOCOL_CAPABLE`, `PROTOCOL_LIMITED`, `CONFORMANCE_VERIFIED`). |
|
package/THREAT_MODEL.md
CHANGED
|
@@ -30,6 +30,9 @@ remaining trust boundaries and their executable evidence.
|
|
|
30
30
|
| Protocol-version confusion | Old/future artifacts are silently reinterpreted | Cross-artifact protocol boundary | Explicit v1 checks and conformance errors for unsupported or mixed versions | A future protocol needs a deliberate migration implementation | `tests/conformance.test.js`, `tests/fixtures/protocol/invalid/` |
|
|
31
31
|
| Dependency-cycle denial of service | Coordination cannot make progress or spends unbounded work | Delegation dependency graph | Deterministic DFS cycle detection, unknown-reference rejection, and bounded JSON | A caller can still submit many valid tasks; host-level quotas remain external | `tests/delegation.test.js`, `tests/delegation-set.test.js` |
|
|
32
32
|
| Oversized JSON artifacts | Excess CPU or memory during validation | Any untrusted JSON artifact | Byte, depth, array, object-key, and string limits before semantic traversal | Limits are conservative defaults, not a complete resource scheduler | `tests/security-limits.test.js`, `src/core/json-safety.js` |
|
|
33
|
+
| Runtime self-exemption | An execution environment discovers ForgeLoop but decides that the protocol does not apply because the environment is not named in documentation | Project adapter discovery and runtime interpretation | Universal applicability marker, capability-based integration, explicit unknown-runtime rule, no finite eligibility allowlist | A non-compliant runtime can ignore project instructions entirely | `tests/discovery-surfaces.test.js`, `tests/test_workflow_policy.py` |
|
|
34
|
+
| Blind oracle exposure | The system under test reads expected route/gate/evidence answers from the installed package and contaminates a blind conformance run | Published npm package and agent-readable target workspace | Exclude conformance oracles from npm package, tarball leak scan in `pack:check`, external harness-owned oracle | A misconfigured external harness may still copy oracle material into target | `tests/package.test.js`, `conformance/README.md` |
|
|
35
|
+
| Lifecycle simulation after CLI resolution failure | A runtime manually writes protocol-owned JSON and falsely claims conformance when the CLI is unresolved | Lifecycle-owned protocol state and CLI availability | CLI-owned artifact policy, universal adapter prohibition, validator-backed completion, append-only ledger hash chain | A privileged local process can tamper with local files; ForgeLoop detects consistency, not remote attestation | `tests/discovery-surfaces.test.js`, `tests/lifecycle.test.js`, `LOOP_ENGINEERING.md` |
|
|
33
36
|
|
|
34
37
|
## Boundary rules
|
|
35
38
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cassiomc1/forgeloop",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Portable, verifiable
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "Portable, verifiable engineering protocol for AI coding environments and developer workflows",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/cassiomc1/forgeloop.git"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"src",
|
|
23
23
|
"ENG",
|
|
24
24
|
"schemas",
|
|
25
|
-
"conformance",
|
|
26
25
|
".forgeloop/forgeloop.gitignore",
|
|
27
26
|
"AGENTS.md",
|
|
28
27
|
"CLAUDE.md",
|
|
29
28
|
"GUIDE_ROUTER.md",
|
|
30
29
|
"LOOP_ENGINEERING.md",
|
|
30
|
+
"PROTOCOL_INTEGRATION.md",
|
|
31
31
|
"LOOP_SYSTEM_DESIGN.md",
|
|
32
32
|
"QUALITY_SCORECARD.md",
|
|
33
33
|
"TERMINOLOGY.md",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"scripts": {
|
|
49
49
|
"test": "node scripts/run-tests.js",
|
|
50
50
|
"pack:check": "node --test tests/package.test.js",
|
|
51
|
-
"release:identity": "node scripts/verify_release_identity.mjs"
|
|
51
|
+
"release:identity": "node scripts/verify_release_identity.mjs",
|
|
52
|
+
"docs:flow": "node scripts/generate-readme-flow.mjs"
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const DISCOVERY_SURFACES = Object.freeze([
|
|
2
|
+
Object.freeze({
|
|
3
|
+
id: "agents-md",
|
|
4
|
+
path: "AGENTS.md",
|
|
5
|
+
kind: "project-instructions",
|
|
6
|
+
}),
|
|
7
|
+
Object.freeze({
|
|
8
|
+
id: "claude-md",
|
|
9
|
+
path: "CLAUDE.md",
|
|
10
|
+
kind: "project-instructions",
|
|
11
|
+
}),
|
|
12
|
+
Object.freeze({
|
|
13
|
+
id: "cursor-rule",
|
|
14
|
+
path: ".cursor/rules/project-loop.mdc",
|
|
15
|
+
kind: "project-instructions",
|
|
16
|
+
}),
|
|
17
|
+
Object.freeze({
|
|
18
|
+
id: "github-repository-instructions",
|
|
19
|
+
path: ".github/copilot-instructions.md",
|
|
20
|
+
kind: "project-instructions",
|
|
21
|
+
}),
|
|
22
|
+
]);
|
package/src/core/inspect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileExists, ensureWithin, readBytes } from "./filesystem.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DISCOVERY_SURFACES } from "./discovery-surfaces.js";
|
|
3
3
|
import { readManifest } from "./manifest.js";
|
|
4
4
|
import { PROTOCOL_VERSION } from "./protocol.js";
|
|
5
5
|
import { inspectSchemaHealth } from "./schema-validation.js";
|
|
@@ -42,15 +42,14 @@ export async function inspectTarget({ target, packageRoot, contractFile = null }
|
|
|
42
42
|
? `${FORGELOOP_KIT_DIR}/schemas`
|
|
43
43
|
: "schemas";
|
|
44
44
|
const doctor = await runDoctor({ target, packageRoot });
|
|
45
|
-
const
|
|
46
|
-
id:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
available: (await Promise.all(
|
|
51
|
-
record.instructionFiles.map(async (relativePath) => fileExists(ensureWithin(target, relativePath))),
|
|
52
|
-
)).some(Boolean),
|
|
45
|
+
const surfaces = await Promise.all(DISCOVERY_SURFACES.map(async (surface) => ({
|
|
46
|
+
id: surface.id,
|
|
47
|
+
path: surface.path,
|
|
48
|
+
kind: surface.kind,
|
|
49
|
+
available: await fileExists(ensureWithin(target, surface.path)),
|
|
53
50
|
})));
|
|
51
|
+
const availableSurfaces = surfaces.filter((surface) => surface.available);
|
|
52
|
+
const protocolActivated = availableSurfaces.length > 0;
|
|
54
53
|
|
|
55
54
|
const findings = [...doctor.findings];
|
|
56
55
|
for (const schema of schemaHealth.schemas) {
|
|
@@ -100,9 +99,20 @@ export async function inspectTarget({ target, packageRoot, contractFile = null }
|
|
|
100
99
|
error: manifestError,
|
|
101
100
|
},
|
|
102
101
|
profile,
|
|
102
|
+
integration: {
|
|
103
|
+
protocolActivated,
|
|
104
|
+
protocolMarker: "FORGELOOP_PROJECT_PROTOCOL=REQUIRED",
|
|
105
|
+
discovery: {
|
|
106
|
+
status: protocolActivated ? "INSTRUCTION_DISCOVERED" : "INSTRUCTION_ABSENT",
|
|
107
|
+
surfaces,
|
|
108
|
+
},
|
|
109
|
+
capability: {
|
|
110
|
+
status: "NOT_VERIFIED",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
103
113
|
adapters: {
|
|
104
|
-
detected:
|
|
105
|
-
|
|
114
|
+
detected: availableSurfaces.map((s) => s.path),
|
|
115
|
+
surfaces,
|
|
106
116
|
},
|
|
107
117
|
protocol: {
|
|
108
118
|
version: PROTOCOL_VERSION,
|
|
@@ -112,7 +122,8 @@ export async function inspectTarget({ target, packageRoot, contractFile = null }
|
|
|
112
122
|
},
|
|
113
123
|
state: { ...state, path: WORK_STATE_PATH, present: statePresent },
|
|
114
124
|
compatibility: {
|
|
115
|
-
|
|
125
|
+
deprecated: true,
|
|
126
|
+
agents: [],
|
|
116
127
|
},
|
|
117
128
|
findings,
|
|
118
129
|
evidence,
|