@cassiomc1/forgeloop 0.1.15 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/DOCS_INDEX.md +60 -0
  2. package/EXECUTION_STATE.md +9 -0
  3. package/LOOP_ENGINEERING.md +15 -0
  4. package/LOOP_SYSTEM_DESIGN.md +8 -0
  5. package/PROTOCOL_INTEGRATION.md +8 -0
  6. package/QUALITY_SCORECARD.md +2 -0
  7. package/README.md +183 -654
  8. package/TERMINOLOGY.md +4 -0
  9. package/THREAT_MODEL.md +9 -0
  10. package/docs/assets/forgeloop-flow.svg +1 -0
  11. package/docs/forgeloop-flow.mmd +51 -0
  12. package/package.json +16 -3
  13. package/schemas/continuity.schema.json +57 -0
  14. package/scripts/CI_VALIDATORS.md +32 -0
  15. package/src/cli.js +307 -204
  16. package/src/commands/clear-continuity.js +9 -0
  17. package/src/commands/continuity.js +25 -0
  18. package/src/commands/doctor.js +17 -2
  19. package/src/commands/reconcile-continuity.js +23 -0
  20. package/src/commands/record-continuity.js +63 -0
  21. package/src/commands/status.js +14 -1
  22. package/src/commands/update.js +12 -13
  23. package/src/commands/validate-protocol.js +19 -0
  24. package/src/core/artifacts.js +1 -0
  25. package/src/core/bundles.js +6 -0
  26. package/src/core/command-resolution.js +295 -0
  27. package/src/core/command-tokenizer.js +122 -0
  28. package/src/core/conformance.js +8 -2
  29. package/src/core/continuity-cli-options.js +58 -0
  30. package/src/core/continuity-conformance.js +46 -0
  31. package/src/core/continuity-observability.js +20 -0
  32. package/src/core/continuity-reconciliation.js +224 -0
  33. package/src/core/continuity.js +245 -0
  34. package/src/core/inspect.js +9 -1
  35. package/src/core/installation-authority.js +178 -0
  36. package/src/core/json-safety.js +17 -13
  37. package/src/core/next-action-artifacts.js +118 -0
  38. package/src/core/next-action-continuity.js +65 -0
  39. package/src/core/next-action-model.js +127 -0
  40. package/src/core/next-action-phases.js +12 -0
  41. package/src/core/next-action.js +22 -249
  42. package/src/core/npm-classifier.js +343 -0
  43. package/src/core/package-manager-classifiers.js +37 -0
  44. package/src/core/preflight-consistency.js +221 -0
  45. package/src/core/preflight-loaders.js +112 -0
  46. package/src/core/preflight-model.js +83 -0
  47. package/src/core/preflight.js +34 -444
  48. package/src/core/protocol.js +7 -0
  49. package/src/core/schema-validation.js +15 -1
  50. package/src/core/templates.js +2 -0
  51. package/src/core/verification-capability.js +31 -1106
  52. package/src/core/verification-constants.js +61 -0
package/DOCS_INDEX.md ADDED
@@ -0,0 +1,60 @@
1
+ # Documentation index
2
+
3
+ ForgeLoop keeps one canonical process and separates protocol behavior from
4
+ integration and guide context. Use this map before editing documentation.
5
+
6
+ ## Ownership map
7
+
8
+ | Need | Canonical source | Boundary |
9
+ | --- | --- | --- |
10
+ | Lifecycle, gates, planning, verification, and recovery | [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md) | Normative process for agents and developer workflows |
11
+ | Capability levels, discovery, and degradation | [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md) | Vendor-neutral harness contract |
12
+ | Durable project facts | [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md) | Target-specific facts only; no prompts or secrets |
13
+ | Guide selection | [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) | Deterministic routing and exclusions |
14
+ | Architecture and safety boundaries | [`LOOP_SYSTEM_DESIGN.md`](./LOOP_SYSTEM_DESIGN.md) and [`THREAT_MODEL.md`](./THREAT_MODEL.md) | Design rationale and residual risk |
15
+ | Artifact and phase schemas | [`schemas/`](./schemas/) and [`CONTRACT_COVERAGE.md`](./CONTRACT_COVERAGE.md) | Versioned machine-readable contract |
16
+ | CLI/package behavior | [`src/`](./src/) and [`tests/`](./tests/) | Executable implementation and regression evidence |
17
+ | Guide content | [`ENG/`](./ENG/) | Context-specific, English-only operational guides |
18
+ | Diagram | [`docs/forgeloop-flow.mmd`](./docs/forgeloop-flow.mmd) | Canonical Mermaid source; SVG is generated output |
19
+
20
+ `README.md` is intentionally a catalog and quickstart. Do not copy the full
21
+ process into adapters or README sections; link to the canonical source.
22
+
23
+ ## Lifecycle reading order
24
+
25
+ 1. Read [`README.md`](./README.md) for scope and quickstart.
26
+ 2. Read [`LOOP_ENGINEERING.md`](./LOOP_ENGINEERING.md) for the process gates.
27
+ 3. Read [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md) for the active
28
+ runtime or harness boundary.
29
+ 4. Inspect [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md) and confirm facts from
30
+ the repository before using them.
31
+ 5. Use [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) to select only relevant guides.
32
+ 6. Use [`LOOP_SYSTEM_DESIGN.md`](./LOOP_SYSTEM_DESIGN.md) and schemas when a
33
+ change affects protocol invariants or artifact shape.
34
+
35
+ ## Verification and release
36
+
37
+ The Node regression suite, ESLint, c8, dependency policy, package boundary,
38
+ and Mermaid render are the local executable checks. Python validators remain
39
+ frozen CI-only compatibility tools because they cover historical Markdown,
40
+ loop, and secret-scanning contracts that have not been migrated to Node. Their
41
+ scope, exact commands, and migration boundary are recorded in
42
+ [`scripts/CI_VALIDATORS.md`](./scripts/CI_VALIDATORS.md).
43
+
44
+ The package has no runtime dependencies. Development dependencies are limited
45
+ to ESLint, c8, and Mermaid CLI and are checked by
46
+ `npm run dependency:policy`. GitHub Actions use `npm ci`, pinned action SHAs,
47
+ CodeQL, dependency review, and generated-release notes; npm publication still
48
+ uses trusted OIDC publishing and is not implied by local verification.
49
+
50
+ ## Editing rules
51
+
52
+ - Keep lifecycle prose, the Mermaid source, and the text-only README fallback
53
+ synchronized.
54
+ - Keep generated `docs/assets/forgeloop-flow.svg` synchronized with the Mermaid
55
+ source by running `npm run docs:flow` and `npm run docs:check`. CI validates
56
+ the source fingerprint instead of comparing renderer-specific SVG geometry.
57
+ - Preserve the distinction between implemented behavior, local evidence, and
58
+ external publication or production state.
59
+ - Run `npm run lint`, `npm run coverage`, `npm run pack:check`, and the Python
60
+ CI-only validators proportionally to the change.
@@ -112,3 +112,12 @@ forgeloop clear-state
112
112
  `clear-state` affects only `.forgeloop/work-state.json` and prints the exact
113
113
  relative path it removed; it never deletes the directory, manifest, or project
114
114
  files.
115
+
116
+ ## Execution continuity companion
117
+
118
+ `.forgeloop/work-state.json` remains the canonical checkpoint and owns phase,
119
+ `completedSteps`, `pendingSteps`, failures, blockers, verification cycles, and
120
+ required artifact fingerprints. `.forgeloop/continuity.json` is an optional
121
+ companion containing only granular implementation-resume context. It is bound
122
+ to the current task, contract fingerprint, work-state fingerprint, phase, and
123
+ repository context and is always operational context rather than evidence.
@@ -1163,3 +1163,18 @@ Publication:
1163
1163
  Never claim that a test, build, platform, device, or integration passed without
1164
1164
  a compatible check. The final response must distinguish local implementation
1165
1165
  from external publication.
1166
+
1167
+ ## Cross-harness execution continuity
1168
+
1169
+ A change of model, provider, IDE, process, terminal, or context window does not
1170
+ create a new task when a valid resumable ForgeLoop task already exists.
1171
+ `work-state.json` remains the sole owner of lifecycle progress. An optional
1172
+ `.forgeloop/continuity.json` may record bounded granular implementation context
1173
+ such as current focus, remaining implementation work, known issues, and paths
1174
+ to inspect first.
1175
+
1176
+ `CONTINUITY_CONTEXT_IS_NOT_EVIDENCE`: continuity may guide inspection but can
1177
+ never satisfy verification coverage, publication, production readiness, or
1178
+ completion. `CONTINUITY_CANNOT_GRANT_AUTHORITY`: continuity cannot authorize an
1179
+ installation or external action. The receiving harness MUST reconcile
1180
+ continuity against the current work state and checkout before acting on it.
@@ -399,3 +399,11 @@ update practice.
399
399
  - Structural, Markdown, link, and secret checks pass locally and in CI.
400
400
  - Portable-copy instructions always include third-party notices.
401
401
  - The package does not alter destination commands, dependencies, or behavior without need and applicable authority.
402
+
403
+ ## Cross-harness continuity boundary
404
+
405
+ Execution continuity is intentionally a companion artifact, not a second state
406
+ machine and not a general memory subsystem. Work state owns lifecycle truth;
407
+ the checkout owns implementation truth; checks/executions own verification
408
+ truth; completion owns certification. Continuity only narrows what a receiving
409
+ executor should inspect and continue.
@@ -301,3 +301,11 @@ External planning, interview, or review workflows (such as `/grill-me`, `/plan`,
301
301
  review gates) may assist in clarifying requirements, but they must not silently
302
302
  redefine ForgeLoop `NON_BLOCKING` decisions as `BLOCKING` in autonomous mode.
303
303
  Consult `LOOP_ENGINEERING.md#external-workflow-interaction` for the complete boundary.
304
+
305
+ ## Harness and session continuity
306
+
307
+ Harness identity is not task identity. Session identity is not task identity.
308
+ A compatible environment reopening a resumable task SHOULD inspect the current
309
+ work state, reconcile optional execution continuity, inspect the checkout, and
310
+ continue the existing lifecycle instead of replacing the contract merely
311
+ because the executor changed.
@@ -23,6 +23,8 @@ policy are all present.
23
23
  | Autonomous-mode precedence — structural | Explicit `autonomousMode=true` boundary, explicit interactive opt-in, preservation of `NON_BLOCKING`, and no silent workflow-induced mode switch. |
24
24
  | Pre-contract autonomy — cross-agent live robustness | Independent live-agent behavior across fresh package installs, exact blind prompts, one-process/no-subagent topology, and separate evidence for non-blocking continuation versus blocking clarification. Structural coverage does not imply live cross-agent robustness. |
25
25
  | Resume/checkpoint | Atomic local state, contract/HEAD/artifact freshness, age warning, schema/secret validation, status, safe validation, and bounded clearing without persisting derived freshness fields. |
26
+ | Cross-harness execution continuity — structural | Optional bounded continuity artifact, task/contract/work-state binding, deterministic reconciliation, current-checkout precedence, non-evidence/non-authority semantics, next/status/inspect integration, bundle portability, and cross-process regression coverage. |
27
+ | Cross-harness live continuity | A fresh Harness B resumes an interrupted Harness A task with no manual user summary and reaches validator-backed completion; structural coverage alone does not prove this dimension. |
26
28
  | Protocol activation resumability | `PREFLIGHT_READY` durably creates or reconciles `work-state.json`, preserves blocked history, and exposes a dedicated repair code when the checkpoint is missing. |
27
29
  | Artifact ↔ lifecycle reconciliation | Contract, route, gates, state, preflight, activation events, fingerprints, and append-only hash chronology agree at READY; audit and validate-protocol detect divergence. |
28
30
  | Planned vs present profile truth | `PROJECT_PROFILE.md` distinguishes planned template fields from observed target facts, with hidden-kit bootstrap and legacy migration checks. |