@cassiomc1/forgeloop 0.1.10 → 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.
Files changed (69) hide show
  1. package/.cursor/rules/project-loop.mdc +16 -18
  2. package/.github/copilot-instructions.md +16 -19
  3. package/AGENTS.md +18 -24
  4. package/AGENT_COMPATIBILITY.md +4 -211
  5. package/CLAUDE.md +16 -18
  6. package/LOOP_ENGINEERING.md +73 -0
  7. package/LOOP_SYSTEM_DESIGN.md +9 -5
  8. package/ORCHESTRATOR_INTEGRATION.md +4 -0
  9. package/PROTOCOL_INTEGRATION.md +171 -0
  10. package/QUALITY_SCORECARD.md +1 -1
  11. package/README.md +123 -103
  12. package/TERMINOLOGY.md +2 -0
  13. package/THREAT_MODEL.md +4 -0
  14. package/package.json +5 -4
  15. package/schemas/current-contract.schema.json +48 -2
  16. package/schemas/evidence.schema.json +1 -0
  17. package/schemas/execution-receipt.schema.json +2 -0
  18. package/schemas/work-state.schema.json +44 -1
  19. package/src/cli.js +48 -4
  20. package/src/commands/record-terminal-result.js +18 -0
  21. package/src/commands/validate-protocol.js +14 -2
  22. package/src/core/checks.js +20 -0
  23. package/src/core/completion-artifacts.js +266 -11
  24. package/src/core/completion-recovery.js +15 -0
  25. package/src/core/completion-relationships.js +23 -9
  26. package/src/core/completion.js +130 -2
  27. package/src/core/contract.js +82 -4
  28. package/src/core/coverage.js +17 -12
  29. package/src/core/discovery-surfaces.js +22 -0
  30. package/src/core/events.js +183 -2
  31. package/src/core/evidence-readiness.js +333 -0
  32. package/src/core/evidence.js +22 -4
  33. package/src/core/execution-prerequisites.js +6 -1
  34. package/src/core/inspect.js +23 -12
  35. package/src/core/native-adapters.js +30 -2
  36. package/src/core/next-action.js +103 -27
  37. package/src/core/phase.js +68 -5
  38. package/src/core/protocol.js +28 -1
  39. package/src/core/receipt.js +5 -0
  40. package/src/core/schema-validation.js +28 -6
  41. package/src/core/templates.js +1 -0
  42. package/src/core/work-state.js +27 -0
  43. package/conformance/README.md +0 -148
  44. package/conformance/backend-auth/EXPECTED_ROUTE.json +0 -7
  45. package/conformance/backend-auth/REQUEST.md +0 -4
  46. package/conformance/backend-auth/REQUIRED_EVIDENCE.json +0 -3
  47. package/conformance/backend-auth/REQUIRED_GATES.json +0 -3
  48. package/conformance/blind-premium-website/EXPECTED_ROUTE.json +0 -7
  49. package/conformance/blind-premium-website/REQUEST.md +0 -6
  50. package/conformance/blind-premium-website/REQUIRED_EVIDENCE.json +0 -14
  51. package/conformance/blind-premium-website/REQUIRED_GATES.json +0 -3
  52. package/conformance/complete-website/EXPECTED_ROUTE.json +0 -7
  53. package/conformance/complete-website/REQUEST.md +0 -6
  54. package/conformance/complete-website/REQUIRED_EVIDENCE.json +0 -3
  55. package/conformance/complete-website/REQUIRED_GATES.json +0 -3
  56. package/conformance/docs-only/EXPECTED_ROUTE.json +0 -7
  57. package/conformance/docs-only/REQUEST.md +0 -4
  58. package/conformance/docs-only/REQUIRED_EVIDENCE.json +0 -3
  59. package/conformance/docs-only/REQUIRED_GATES.json +0 -3
  60. package/conformance/runs/2026-08-11-codex-first-live.md +0 -98
  61. package/conformance/runs/2026-08-11-codex-second-live.md +0 -87
  62. package/conformance/runs/2026-08-13-codex-fifth-live.md +0 -386
  63. package/conformance/runs/2026-08-13-codex-fourth-live.md +0 -309
  64. package/conformance/runs/2026-08-13-codex-sixth-live.md +0 -412
  65. package/conformance/simple-bug/EXPECTED_ROUTE.json +0 -7
  66. package/conformance/simple-bug/REQUEST.md +0 -4
  67. package/conformance/simple-bug/REQUIRED_EVIDENCE.json +0 -3
  68. package/conformance/simple-bug/REQUIRED_GATES.json +0 -3
  69. package/src/core/agent-support.js +0 -89
@@ -1,148 +0,0 @@
1
- # ForgeLoop conformance scenarios
2
-
3
- These scenarios are adapter-facing contracts. They describe requests and the
4
- artifacts a live agent must produce; they do not invoke a model runtime and are
5
- not part of the deterministic `npm test` execution path.
6
-
7
- The current published baseline for new runs is
8
- `@cassiomc1/forgeloop@0.1.9`. Pin that version when preparing a reproducible
9
- blind run; historical reports retain the exact package version they used.
10
-
11
- The frozen baseline was verified on 2026-08-13 with this identity:
12
-
13
- ```text
14
- package: @cassiomc1/forgeloop@0.1.9
15
- npm gitHead: 0e48240894671ecda2458b15671020b0a7255e70
16
- release commit: 0e48240894671ecda2458b15671020b0a7255e70
17
- GitHub tag: v0.1.9 -> 0e48240894671ecda2458b15671020b0a7255e70
18
- tarball URL: https://registry.npmjs.org/@cassiomc1/forgeloop/-/forgeloop-0.1.9.tgz
19
- tarball SHA-1: fef7587ebd878e845e9746b4d049a6fe6ef333c5
20
- npm SHA-512 integrity: sha512-sCvPEDOYT1svNnA8+zw57dJ97N6sNCUH8eDbM6f3cS6eXLCIFFXRPkCAASA+ZPu5mAKbcNaU1TaFKjojbL3DEA==
21
- release identity: RELEASE_IDENTITY_VALID
22
- ```
23
-
24
- The repository may contain documentation or executable commits after this
25
- frozen package. Those commits do not change the package used by the blind run;
26
- the repository's `0.1.10` candidate includes completion-validation and cleanup
27
- TOCTOU fixes that are not in `0.1.9`. If a blind run needs those executable
28
- changes, publish and tag the candidate, then repeat the complete identity check
29
- before starting the run.
30
-
31
- Run a scenario in a disposable target using the Standard profile first:
32
-
33
- ```bash
34
- npx @cassiomc1/forgeloop preflight --json
35
- npx @cassiomc1/forgeloop next --json
36
- npx @cassiomc1/forgeloop audit --json
37
- npx @cassiomc1/forgeloop complete --json
38
- ```
39
-
40
- The expected post-implementation path is:
41
-
42
- ```text
43
- implementation
44
- → forgeloop next
45
- → advance --to VERIFYING
46
- → forgeloop next
47
- → prepare-completion
48
- → forgeloop next
49
- → checks + record-check
50
- → forgeloop next
51
- → advance --to REVIEWING
52
- → forgeloop next
53
- → complete
54
- ```
55
-
56
- Use the Strict profile only as a separate experiment:
57
-
58
- ```bash
59
- # .forgeloop/kit/PROJECT_PROFILE.md must be verified before this profile starts.
60
- npx @cassiomc1/forgeloop preflight --strict --json
61
- npx @cassiomc1/forgeloop audit --strict --json
62
- npx @cassiomc1/forgeloop complete --strict --json
63
- ```
64
-
65
- Do not mix Standard and Strict criteria in one conformance result. Live-run
66
- diagnostic records belong under [`conformance/runs/`](./runs/); they must not
67
- contain secrets, credentials, hidden reasoning, or unnecessary conversation
68
- history.
69
-
70
- ## Release identity evidence
71
-
72
- Every live-run report records the exact published package used by the target.
73
- Include all of these fields before sending the blind prompt:
74
-
75
- ```text
76
- package: @cassiomc1/forgeloop@X.Y.Z
77
- npm gitHead: <40-character commit SHA>
78
- release commit: <40-character commit SHA>
79
- GitHub tag: vX.Y.Z -> <40-character commit SHA>
80
- tarball URL: https://registry.npmjs.org/...
81
- tarball SHA-1: <40-character hex digest>
82
- npm SHA-512 integrity: sha512-<base64 digest>
83
- release identity: RELEASE_IDENTITY_VALID
84
- ```
85
-
86
- Run the repository's read-only verifier against the exact release commit:
87
-
88
- ```bash
89
- RELEASE_COMMIT="$(git rev-list -n1 vX.Y.Z)"
90
- npm run release:identity -- --version X.Y.Z --release-commit "$RELEASE_COMMIT"
91
- ```
92
-
93
- Do not interpret a local package version, a green build, or a tarball URL by
94
- itself as publication proof. If the verifier cannot establish every identity
95
- field, record `RELEASE_IDENTITY_NOT_VERIFIED` or
96
- `RELEASE_IDENTITY_INVALID` and do not start the blind run.
97
-
98
- The complete-website scenario deliberately fails when implementation starts
99
- before the contract, route, and required gates exist.
100
-
101
- ## Migration compatibility evidence
102
-
103
- The real published `0.1.6` fixture at
104
- [`tests/fixtures/legacy-0.1.6/`](../tests/fixtures/legacy-0.1.6/) is frozen
105
- with package, tarball, SHA-1, SHA-512, `gitHead`, and extraction-date metadata.
106
- The migration tests run from those local bytes and cover interruptions after
107
- hidden writes, after hidden verification, after the manifest authority switch,
108
- and during legacy cleanup. An interrupted target must be diagnosed as
109
- `E_MIGRATION_INCOMPLETE`; a later `update` may retry only hash-owned cleanup.
110
- User-modified, unmanaged, and `preserve=true` files remain untouched even when
111
- that leaves a root residual. ForgeLoop revalidates the recorded ownership hash
112
- immediately before deleting each managed legacy file. This narrows the race
113
- window but does not provide OS-level filesystem locking against a separately
114
- privileged concurrent process.
115
-
116
- ## Autonomous blind-run isolation
117
-
118
- External workflows may help with local planning, review, tests, or
119
- documentation, but a mandatory approval policy for a ForgeLoop `NON_BLOCKING`
120
- decision is `INCOMPATIBLE WITH AUTONOMOUS MODE`. The harness must exclude that
121
- policy before the blind prompt starts; do not add a hint to the prompt that
122
- changes the scenario. `NON_BLOCKING` must remain non-blocking, and any
123
- compatibility conflict is recorded as `WORKFLOW_CONFLICT`, not as a fake user
124
- blocker.
125
-
126
- For the sixth blind run, record these values before sending the unchanged blind
127
- prompt:
128
-
129
- ```text
130
- mandatory-approval workflows enabled: NO
131
- external brainstorming hard gate enabled: NO
132
- external design approval gate enabled: NO
133
- subagents enabled: NO
134
- delegation enabled: NO
135
- ```
136
-
137
- Also record the available and invoked external workflows, explicit autonomy
138
- mode, process count, subagent count, and delegation status. If the harness
139
- cannot disable a mandatory approval workflow, record `TEST_NOT_STARTED` and do
140
- not interpret the run as a conformance failure or success. An installed
141
- workflow and a compatible workflow are separate claims; use
142
- `INCOMPATIBLE WITH AUTONOMOUS MODE`, not "broken", for the former.
143
-
144
- Every live-run report must classify how it ended with exactly one
145
- `terminationSource`: `AGENT`, `OPERATOR`, `HARNESS`, `TIMEOUT`, or `BLOCKER`.
146
- An operator-terminated run is recorded as `RUN_STATUS: OPERATOR_INTERRUPTED`,
147
- `CONFORMANCE: PARTIAL`, with post-termination capabilities marked
148
- `NOT_REACHED` and the smallest failure class `OPERATOR_INTERRUPTION`.
@@ -1,7 +0,0 @@
1
- {
2
- "workType": "api-auth",
3
- "surfaces": ["api", "auth"],
4
- "risks": ["untrusted-input"],
5
- "platforms": ["server"],
6
- "guides": ["clean", "test", "security", "performance"]
7
- }
@@ -1,4 +0,0 @@
1
- # Backend authentication
2
-
3
- Change an authenticated backend surface with explicit trust-boundary review,
4
- negative tests, and observed verification.
@@ -1,3 +0,0 @@
1
- {
2
- "required": ["security-validation", "negative-test"]
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "required": ["threat-boundary"]
3
- }
@@ -1,7 +0,0 @@
1
- {
2
- "workType": "complete-website",
3
- "surfaces": ["ui", "forms"],
4
- "risks": ["accessibility"],
5
- "platforms": ["web"],
6
- "guides": ["premium", "design", "taste", "accessibility", "clean", "test", "security", "performance"]
7
- }
@@ -1,6 +0,0 @@
1
- # Premium law firm website
2
-
3
- Create a premium website for a law firm.
4
-
5
- It should feel modern, sophisticated and trustworthy, work well on mobile and
6
- desktop, and include a contact form.
@@ -1,14 +0,0 @@
1
- {
2
- "required": [
3
- "accessibility-validation",
4
- "build",
5
- "focus-management",
6
- "keyboard-navigation",
7
- "mobile-viewport",
8
- "performance-validation",
9
- "responsive-validation",
10
- "security-validation",
11
- "tests",
12
- "visual-validation"
13
- ]
14
- }
@@ -1,3 +0,0 @@
1
- {
2
- "required": ["design", "quality", "threat-boundary"]
3
- }
@@ -1,7 +0,0 @@
1
- {
2
- "workType": "complete-website",
3
- "surfaces": ["ui", "forms"],
4
- "risks": ["accessibility"],
5
- "platforms": ["web"],
6
- "guides": ["premium", "design", "taste", "accessibility", "clean", "test", "security", "performance"]
7
- }
@@ -1,6 +0,0 @@
1
- # Complete website
2
-
3
- Create a premium, accessible website. Establish the current contract and
4
- persist deterministic routing before implementation. Satisfy design and
5
- quality gates, then record observed responsive, accessibility, build, and
6
- visual evidence.
@@ -1,3 +0,0 @@
1
- {
2
- "required": ["responsive-validation", "accessibility-validation", "build", "visual-validation"]
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "required": ["design", "quality"]
3
- }
@@ -1,7 +0,0 @@
1
- {
2
- "workType": "documentation",
3
- "surfaces": [],
4
- "risks": [],
5
- "platforms": [],
6
- "guides": []
7
- }
@@ -1,4 +0,0 @@
1
- # Documentation only
2
-
3
- Update domain documentation and verify Markdown, links, paths, and examples.
4
- No design gate is required.
@@ -1,3 +0,0 @@
1
- {
2
- "required": ["documentation-validation"]
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "required": []
3
- }
@@ -1,98 +0,0 @@
1
- # ForgeLoop Live Conformance Run — First Codex Run
2
-
3
- This record preserves the first real blind run as diagnostic evidence. It is
4
- not a protocol artifact and does not contain hidden reasoning, credentials, or
5
- unnecessary conversation history.
6
-
7
- ## Environment
8
-
9
- - ForgeLoop commit: `331e8d4019b61b1decfc063571cb7967238c8037`
10
- - ForgeLoop package: `@cassiomc1/forgeloop@0.1.1`
11
- - Agent: Codex sub-agent (`multi_agent_v1`)
12
- - Model: not exposed by the harness
13
- - Harness: Codex multi-agent runner
14
- - Operating system: macOS
15
- - Date: 2026-08-11, America/Sao_Paulo
16
- - Compliance profile: Standard preflight; strict audit was also inspected as a diagnostic escalation
17
-
18
- ## User request
19
-
20
- ```text
21
- Create a premium website for a law firm.
22
-
23
- It should feel modern, sophisticated and trustworthy, work well on mobile and
24
- desktop, and include a contact form.
25
- ```
26
-
27
- The request did not mention ForgeLoop, Loop Engineering, contracts, routing,
28
- gates, preflight, evidence, audit, completion, or project instruction files.
29
-
30
- ## Result
31
-
32
- - Adapter compatible: `PASS`
33
- - Protocol capable: `PARTIAL`
34
- - Preflight: `READY` (Standard)
35
- - Completion: `REJECTED`
36
- - Publication: `not-published`
37
- - Production readiness: `not-verified`
38
- - Final classification: `PARTIAL`
39
- - Failure class: `LIFECYCLE / COMPLETION TIMEOUT`
40
-
41
- ## Artifact evidence
42
-
43
- | Artifact | Observation |
44
- | --- | --- |
45
- | `.forgeloop/current-contract.json` | Present and schema-valid; task `law-firm-premium-site` |
46
- | `.forgeloop/routing-result.json` | Present; deterministic premium website route with seven guides |
47
- | `.forgeloop/gates/` | `design`, `quality`, and `threat-boundary` present and satisfied |
48
- | `.forgeloop/work-state.json` | Present but left at `EXECUTING`; no completed steps |
49
- | `.forgeloop/events.ndjson` | Present with 13 hash-linked events; ended at `EXECUTION_STARTED` |
50
- | `.forgeloop/execution-receipt.json` | Missing |
51
- | Target implementation | `index.html`, `styles.css`, `script.js`, and `tests/site.test.mjs` present |
52
-
53
- ## Verification observed during the run
54
-
55
- - Tests: `PASS` — `node --test tests/site.test.mjs` (4/4)
56
- - JavaScript syntax: `PASS` — `node --check script.js`
57
- - Build: `NOT_VERIFIED` — no build command existed for the dependency-free static target
58
- - Accessibility: `PARTIAL` — structural checks only; no browser or assistive-technology run
59
- - Responsiveness: `PARTIAL` — source/structure checks only; no viewport execution recorded
60
- - Visual: `NOT_VERIFIED`
61
- - Security: `PARTIAL` — local-only form behavior check; no validator-backed receipt or production endpoint review
62
- - Performance: `NOT_VERIFIED`
63
-
64
- ## Capability-level result
65
-
66
- | Capability | Result |
67
- | --- | --- |
68
- | Blind bootstrap | `PASS` |
69
- | Instruction discovery | `PASS` |
70
- | Contract creation | `PASS` |
71
- | Deterministic routing | `PASS` |
72
- | Gate enforcement | `PASS` |
73
- | Preflight chronology | `PASS` |
74
- | Implementation | `PASS` |
75
- | Verification execution | `PARTIAL` |
76
- | Evidence serialization | `FAIL` |
77
- | Review transition | `FAIL` |
78
- | Receipt generation | `FAIL` |
79
- | Lifecycle closure | `FAIL` |
80
- | False-completion prevention | `PASS` |
81
- | Full conformance | `PARTIAL` |
82
-
83
- ## Chronology
84
-
85
- - Implementation began after `PREFLIGHT_READY`: `PASS` — `PREFLIGHT_READY` preceded `EXECUTION_STARTED`.
86
- - Work state advanced beyond `EXECUTING`: `FAIL`.
87
- - `VERIFICATION_RECORDED` existed: `FAIL`.
88
- - Execution receipt existed and validated: `FAIL`.
89
- - Completion was validator-backed: `FAIL` — `audit` and `complete` rejected the incomplete artifact set.
90
- - The protocol prevented a false `COMPLETE`: `PASS`.
91
-
92
- ## Final classification
93
-
94
- `PARTIAL`
95
-
96
- The protocol correctly prevented false completion. The observed defect was
97
- lifecycle closure and evidence ergonomics, not routing, graph readiness,
98
- checkpoint semantics, or the security boundary.
@@ -1,87 +0,0 @@
1
- # ForgeLoop Live Conformance Run — Second Codex Run
2
-
3
- This record preserves the second blind run after the completion-ergonomics
4
- changes. It contains only observable run metadata and no credentials, hidden
5
- reasoning, or unnecessary prompt history.
6
-
7
- ## Environment
8
-
9
- - ForgeLoop base commit: `331e8d4019b61b1decfc063571cb7967238c8037`
10
- - Evaluated tree: corrected local working tree based on that commit; no new commit was created for this local-only experiment
11
- - ForgeLoop package: `@cassiomc1/forgeloop@0.1.1`
12
- - Package tarball SHA-1: `0c196af2d412fad4dc81528f7091b49ebedb818a`
13
- - Agent: Codex CLI non-interactive run
14
- - Model: not exposed by the harness
15
- - Operating system: macOS
16
- - Date: 2026-08-11, America/Sao_Paulo
17
- - Compliance profile: Standard intended; no preflight was reached
18
-
19
- ## User request
20
-
21
- ```text
22
- Create a premium website for a law firm. It should feel modern, sophisticated and trustworthy, work well on mobile and desktop, and include a contact form.
23
- ```
24
-
25
- The request did not mention ForgeLoop, Loop Engineering, contracts, routing,
26
- gates, preflight, evidence, audit, completion, or project instruction files.
27
-
28
- ## Result
29
-
30
- - Adapter compatible: `PASS` — the target adapter files were present and the agent reported reading the repository instructions
31
- - Protocol capable: `PARTIAL` — protocol artifacts were not created in this run
32
- - Pre-contract autonomy: `FAIL` — the run stopped on a non-blocking fictional-brand clarification instead of recording an agent assumption and continuing locally
33
- - Preflight: `NOT_REACHED`
34
- - Completion: `NOT_REACHED`
35
- - Publication: `not-published`
36
- - Production readiness: `not-verified`
37
- - Final classification: `PARTIAL`
38
- - Failure class: `PROTOCOL ACTIVATION / PRE-IMPLEMENTATION CLARIFICATION STOP`
39
-
40
- ## Artifact evidence
41
-
42
- | Artifact | Observation |
43
- | --- | --- |
44
- | `.forgeloop/manifest.json` | Present from package initialization |
45
- | `.forgeloop/current-contract.json` | Missing |
46
- | `.forgeloop/routing-result.json` | Missing |
47
- | `.forgeloop/gates/` | Missing |
48
- | `.forgeloop/work-state.json` | Missing |
49
- | `.forgeloop/events.ndjson` | Missing |
50
- | `.forgeloop/execution-receipt.json` | Missing |
51
- | Product implementation | Not started |
52
-
53
- ## Observed behavior
54
-
55
- The agent inspected the empty target and then asked whether it should use a
56
- fictional law-firm brand and demonstrative contacts. No implementation or
57
- ForgeLoop lifecycle transition followed that clarification request.
58
-
59
- ## Capability-level result
60
-
61
- | Capability | Result |
62
- | --- | --- |
63
- | Blind bootstrap | `PASS` |
64
- | Instruction discovery | `PASS` |
65
- | Contract creation | `FAIL` |
66
- | Deterministic routing | `NOT_REACHED` |
67
- | Gate enforcement | `NOT_REACHED` |
68
- | Preflight chronology | `NOT_REACHED` |
69
- | Implementation | `NOT_STARTED` |
70
- | Verification execution | `NOT_REACHED` |
71
- | Evidence serialization | `NOT_REACHED` |
72
- | Review transition | `NOT_REACHED` |
73
- | Receipt generation | `NOT_REACHED` |
74
- | Lifecycle closure | `NOT_REACHED` |
75
- | False-completion prevention | `NOT_REACHED` |
76
- | Full conformance | `PARTIAL` |
77
-
78
- ## Classification
79
-
80
- `PARTIAL`
81
-
82
- This run exposed an agent-level pre-implementation clarification stop, not a
83
- completion-validator defect. The fictional branding question was a
84
- non-blocking clarification stop, not a downstream protocol failure. It did not
85
- provide evidence to justify changing the routing, phase, receipt, or evidence
86
- protocol. A later run should repeat the same prompt after resolving the
87
- pre-contract autonomy behavior without adding ForgeLoop coaching.