fix(ibmi-rpg): stage the loss profile and apply the routine loss from the recipe #319

Merged
binjovi-bot merged 1 commit from feat/loss-engine into trunk 2026-09-14 13:23:15 +00:00
Owner

The deploy stage reads the flat release repository, not a source tree, so the first routine loss (rpg-lemonade v0.1.17) failed with released loss profile is missing. This PR stages the declared profile as loss-profile.json in the release and applies the loss with a recipe-owned engine (recipes/ibmi-rpg/source-loss) in the deploy stage. A release made before staging deploys without a loss and says so.

Tests: test-source-loss, test-release-stage, test-deploy-runner; scripts/check passes. tests/rpg-native-release-test needs the cluster-only binjovi-ibmi-recovery and fails locally on trunk too.

https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV

The deploy stage reads the flat release repository, not a source tree, so the first routine loss (rpg-lemonade v0.1.17) failed with `released loss profile is missing`. This PR stages the declared profile as `loss-profile.json` in the release and applies the loss with a recipe-owned engine (`recipes/ibmi-rpg/source-loss`) in the deploy stage. A release made before staging deploys without a loss and says so. Tests: `test-source-loss`, `test-release-stage`, `test-deploy-runner`; `scripts/check` passes. `tests/rpg-native-release-test` needs the cluster-only `binjovi-ibmi-recovery` and fails locally on trunk too. https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV
fix(ibmi-rpg): stage the loss profile and apply the routine loss from the recipe
Some checks failed
binjovi/ci Binjovi will not build this: its base branch must be trunk. Retarget the pull request.
f2c11c2770
The deploy stage reads the fetched release repository, which is the flat
artifact set (save file, casts, objects.env, evidence). It has no source
tree, so the first routine loss failed with "released loss profile is
missing" after the production copy (rpg-lemonade v0.1.17).

- release-stage validates the declared `loss_profile` (safe relative path,
  schema `ibmi-source-loss-profile.v1`, non-empty `routine`) and stages it
  as `loss-profile.json` in the release repository.
- deploy runs the recipe-owned engine `recipes/ibmi-rpg/source-loss`
  against the staged profile, after the production evidence check and
  before result.json. A release that carries no staged profile deploys
  without a loss and says so.
- The engine removes each profile member from the development source file
  (RMVM) and removes observability from each stripped object in the
  production library, then the development library (CHGPGM and CHGMOD
  RMVOBS(*ALL)). Absent members and objects, and programs that already
  read DEBUG_DATA *NO and CREATION_DATA *UNOBS, are recorded and skipped.
  A denied command is a recorded gap and the status is "partial"; any
  other failure stops the run. The staging library is refused. The report
  is `ibmi-source-loss-report.v3` with `runner` and `staging` fields.
- Tests: `test-source-loss` (scripted host: full run, idempotent second
  run, denied gap, hard stop, refusals), `test-release-stage` (staging,
  missing, invalid and unsafe profiles), `test-deploy-runner` (staged
  profile, unstaged release, engine failure). Both new offline tests run
  from `make check`.

Claude-Session: https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV
binjovi-bot deleted branch feat/loss-engine 2026-09-14 13:23:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/binjovi-plans!319
No description provided.