Repository navigation
[Epic] Embeddable engine: stable contracts for front-ends, orchestrators and CI dashboards that drive ForgeLM #1027
Description
Closed as not planned (2026-10-20). The six sub-issues were triaged into the existing wave epics, so this epic is no longer needed; the closing comment says where each one went. The principles and the stage order below remain the design background those issues cite.
Epic · Embeddable engine · 6 sub-issues (EMB-01 … EMB-06)
Scope
ForgeLM is a headless, config-driven engine: a GUI or web application is out of scope for this repository (product strategy, "What ForgeLM Is NOT"). A separate program can still drive it — a desktop or web front-end, a pipeline dashboard, a chat-ops bot — and on 2026-10-20 the project owner decided that any such front-end will be a new application built on top of ForgeLM, not a feature added to it.
That only works if the engine offers contracts a program can rely on without scraping human-readable output. A review of development at 2059b59 against that use case found six gaps. Each has its own issue with the evidence, the proposed design, the alternatives that were rejected and acceptance criteria.
| ID | Gap | Issue | Size |
|---|---|---|---|
| EMB-01 | A run cannot be observed: there is no stable stream of step, epoch, loss, ETA and phase. | #1028 | L |
| EMB-02 | A run cannot be stopped cleanly, least of all on Windows, where terminate() is a hard kill. |
#1029 | M |
| EMB-03 | On Windows the audit log and the approval gate have no cross-process lock; concurrent writers fork the hash chain. | #1030 | M |
| EMB-04 | The quantized GGUF that users actually run cannot be safety-evaluated; safety-eval refuses it. |
#1031 | L |
| EMB-05 | Apple Silicon training is unmeasured: PyTorch-MPS or MLX? A spike and a decision record. | #1032 | M |
| EMB-06 | The contracts that already exist (exit codes, JSON envelope, audit log) are not documented for a calling program. | #1033 | S |
Principles every sub-issue follows
- The engine never depends on a front-end. A need raised by a front-end enters ForgeLM only as a general library, CLI or config feature with tests and documentation. There is no UI code, UI-specific flag or UI-only behaviour in this repository.
- Additive by default. New CLI flags, config fields, JSON keys and events are MINOR changes (release.md). Exit codes 0–6, the
--output-format jsonenvelope and the meaning of existing audit events do not change. - New code goes in new small modules.
forgelm/trainer.pyandforgelm/compliance.pyare over the module-size ceiling with no-growth budgets (their splits are Splitforgelm/trainer.pyinto a sub-package (_kwargs,_runtime,_finalize,_artifacts) — deferred until Phase 16 S4 and S8 have landed #904 and Splitforgelm/compliance.pyinto a sub-package (_audit_log,_annex_iv,_provenance,_gdpr) — deferred until Phase 16 S9 has landed #906); the new behaviour lives in new modules and the existing files gain only the lines that attach it. - Config-driven and opt-in. Behaviour is chosen by validated YAML fields with unchanged defaults; no environment-variable sniffing for behaviour.
- Proved on all three desktop platforms. Each contract is tested on Linux, macOS and Windows. Today Windows and macOS tests run only when a release tag is pushed (Tests run on Windows and macOS only when a release tag is pushed #962); that job is a dependency of EMB-03.
- Documented in English and Turkish in the same pull request, with the CI guards the project already has.
When: stages and the reason for the order
Sequencing is driven by which files Phase 16 steps still own (trainer.py: S4, S8; compliance.py: S8, S9 — S2 and S3 have landed) and by decision "behaviour before contracts before docs".
| Stage | Work | Why here |
|---|---|---|
| A — now, alongside Phase 16 | EMB-03 (new forgelm/_filelock.py; a two-line import swap in compliance.py and in cli/subcommands/_approve.py), the first draft of EMB-06, and the measurement spikes of EMB-04 and EMB-05 (no repository change). |
A new module with near-zero edits in files that steps own. Coordinate the compliance.py swap with S9 (#895). |
B — after S8 (#894) has settled trainer.py |
EMB-01, then EMB-02. | trainer.py is at its no-growth budget and S8 changes the same region. Land the stdout fix (#412) first or together, so the progress tests can assert a clean stdout. EMB-02 reuses EMB-01's callback. |
| C — after S5 (#891) | EMB-04 implementation. | S5 redefines verification outcomes ("three states, not a success bit"); GGUF evaluation must report in that vocabulary. |
| D — after the EMB-05 decision | Backend implementation issues, opened by the decision record. | #541 and #488 must land first; the spike decides whether a second training backend is worth its maintenance. |
Recommendation for a first front-end (MVP): EMB-01 (Experimental tier) + EMB-03 + EMB-06 are the minimum; EMB-02 is strongly advised because a front-end needs a Stop button. EMB-04 and EMB-05 widen trust and platform reach but do not block an MVP.
How to work on it
Claim one sub-issue at a time (see CONTRIBUTING, Finding Work). Each sub-issue states its own acceptance criteria and open design decisions; the decisions are recorded as dated rows in docs/roadmap/risks-and-decisions.md before the code lands.
Done when
- Every sub-issue is closed (done, or closed with a reason).
-
docs/guides/embedding.md(and its Turkish mirror) describes only contracts that exist and are tested.
Raised on 2026-10-20 from an architecture decision (ForgeLM stays a headless engine; front-ends are separate programs built on it). Code links point at 2059b59 on development; line numbers may have moved. Tracking IDs EMB-01 … EMB-06 are stable references for commits and pull requests.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
cemililik commentedon Oct 20, 2026
Closing as not planned: each sub-issue now sits in the existing epic for its wave, so a separate epic would only add a level of nesting.
The ordering constraints are kept as "blocked by" links: #1028 waits for #894 (Phase 16 S8), #1029 for #1028 and #894, #1031 for #891 (S5). The interrupted-run defect EMB-02 builds on (CR-A02-046) keeps its Medium severity in #569.