Skip to content

fix(cyberia): restore the Cyberia CI and saga generation after the seed-to-playable Auto Run - #260

Merged
underpostnet merged 7 commits into
masterfrom
fix/saga-engine-seed-to-gameplay-autorun
Nov 30, 2026
Merged

underpostnet merged 7 commits into
masterfrom
fix/saga-engine-seed-to-gameplay-autorun

Conversation

@underpostnet

@underpostnet underpostnet commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Closes #259

Development type: Bug fix · fix/saga-engine-seed-to-gameplay-autorun

Commits

  • 7c5a608f9 [test] Align the Cyberia integration suites with the seed-to-playable Auto Run
  • 3c4f75410 [cyberia] Put the ready row of an active item render in the visual gate
  • ae8f0509e [cyberia] Return whether the cleanup preview read every external source
  • 96d7ed2d9 [cyberia] Give each saga a badge color its package owns
  • 89472bf43 [cyberia] Key saga AI requests by the generator and retry generations that failed the rules
  • 97e40d701 [cyberia] Require a source for each item a saga offer takes from a player
  • 95513b8b5 [package] Write the deploy catalog pins to the manifest before the install

Summary

Restore the Cyberia CI after #257: the deploy install passes npm pack with the sharp override,
and the mongod suites match the Auto Run. Fix two readiness bugs, the saga AI request key and the
offer source check. Add the saga badge color.

Technical details

  • Deploy install (src/server/build/package.js): installDeployDependencies merges the catalog
    packageDependencies into the manifest with npm pkg set --json, as buildDeployPackageJson does,
    then runs npm install --include=dev.
  • Render gate (saga-report.js): the ready or shared row of an active item render is in the
    visual gate.
  • Cleanup preview (saga-cleanup.js): planNewest passes complete from externalReferences.
  • Request key (saga-dependencies.js, saga-metadata-run.js, saga-generation.js):
    requestBasis() adds generator, the commit of the content checkout. The generate step skips only
    a key that a completed generation answered.
  • Offer sources (saga-coverage.js, saga-report.js): a TAKES table lists what each offer
    takes. items.ingredients becomes items.takes, each entry with its use. TAKE_ROWS names the
    offer and the field. A row of a saga action carries its definition, so Auto Run and Repair with AI
    correct that action.
  • Saga color
    • color on CyberiaSaga and on each workflow candidate, read from pkg.saga.color.
    • sagaColors() resolves by saga code: newest workflow revision, stored record, artifact record,
      source package. The catalog row carries color.
    • Public read-only GET /cyberia-saga/colors; CyberiaSagaService.getColors().
    • Studio: SagaCyberia repaints each [data-saga] badge; the Saga Engine header has a color input
      that saves a new revision. The code hue is #rrggbb.
    • generationContext() keeps the newest color in a new generation.
  • Tests: the cyberia:integration suites assert the feat(cyberia): add the Saga Engine auto run from seed to a playable world #257 behavior (Final Review state, 409 on a
    second publication, fallback renders, beneath-leviathan instance codes).

Testing

Compatibility and breaking changes

  • The coverage report field items.ingredients is now items.takes. Coverage row ids are
    coverage:<use>:....
  • Existing saga AI request keys do not match the new keys. The next Metadata Auto Run can generate
    once more for a saga that a stored request already answered.

Operational and deployment impact

  • New public route GET /cyberia-saga/colors.
  • CyberiaSaga.color is an optional field. No migration.
  • Image builds install the catalog pins through the manifest. This merge turns engine-cyberia CI
    green.
  • Deploy: node bin run template-deploy sync-engine-cyberia from master, after the merge, on
    request.
  • Rollback: revert the squash commit. npm pack fails again while sharp is both a catalog pin and
    an override.

Acceptance criteria

  • npm pack passes with the sharp override.
  • cyberia:integration passes with mongod.
  • Procedural input readiness and the Clean Package hint are correct.
  • Request keys include the generator; failed generations retry within the budget.
  • Every item an offer takes has a source check.
  • Studio badges show saga.color.
  • CI | Pull request protocol and CI | Coverall pass; engine-cyberia CI passes after the merge.

…stall

npm refuses a direct dependency whose spec differs from its `overrides`
entry (EOVERRIDE). The old `npm install <name>@<pin>` wrote npm's own spec,
so a catalog pin that an override also names (sharp) failed the install.

- installDeployDependencies merges the catalog `packageDependencies` into
  the manifest dependencies with `npm pkg set --json`, as each pin is
  written in the catalog, the same as buildDeployPackageJson does.
- A plain `npm install --include=dev` then installs the manifest and keeps
  the dev dependencies when NODE_ENV=production.
- The unit test checks both commands with a pin that an override names.
…ayer

The gameplay gate checked only recipe ingredients. A saga could still ship
a shop, buyback, burn or market that asks for an item no player can get.

- Coverage: a TAKES table lists what each action offer takes: recipe
  ingredients, barter prices (the wallet coin price is exempt), buyback
  and burn items and market item listings. coverageWorld looks up stored
  sources for all of them; `items.ingredients` becomes `items.takes`, each
  entry with its `use`.
- Report: TAKE_ROWS names the offer and the field of each row (Recipe N,
  Shop line N, the buyback, the burn, the market). A row of an action the
  saga defines carries its `definition`, so the Metadata Auto Run and
  Repair with AI correct that action.
- Only an ingredient reports `not-carried`; the content rules own that
  problem for the other uses.
- Docs: the explanation states the source rule for each offer use and how
  a repair places a foundation or saga provider before it defines a new one.
- Tests: unit coverage of each use, the report row of a saga action, and
  the Auto Run repair targets of the buyback, burn and craft actions.
… that failed the rules

A request key without the generator blocked a run after a cyberia-content
fix: the same key looked answered. A generation whose package failed the
content rules also blocked its own request forever.

- Dependencies: requestBasis() adds `generator`, the commit of the content
  checkout (contentCheckoutRevision), to the validation basis.
- Metadata Auto Run and Repair with AI key each request by revision
  digest, requirements, repairs, world, content digest, runtime contract
  and generator.
- The generate step skips only a key that a `completed` generation
  answered. A generation that ended `invalid` or `stale` runs again in
  this run and in a later run, within the generation budget.
- The Repair refusal names the generator with the other request inputs.
- Docs: the explanation and the reference state the new key and the
  retry rule.
- Tests: three invalid generations spend the budget and block the run; a
  retry with a valid premise generates the saga; a completed request still
  ends `no_progress`.
A saga badge took a fixed hue of its code. A moderator can now choose the
color in the package identity (`saga.color`), and every Studio badge shows it.

- Data: `color` on the CyberiaSaga record and on each workflow candidate;
  candidateOf reads it from `pkg.saga.color`, and the workflow summary
  shows the color of the newest revision.
- Resolution: sagaColors() takes, by saga code, the newest revision of the
  newest workflow, else the stored record, the artifact record, else the
  source package. The first that holds the saga decides; ignored sagas
  stay out. The catalog row carries the same `color`.
- API: public read-only `GET /cyberia-saga/colors`, and getColors() in the
  client service.
- Studio: SagaCyberia keeps a color map, loads it once and repaints each
  `[data-saga]` badge when a color changes. The code hue is now `#rrggbb`.
  ContextPanel copies a badge `dataset` to its node.
- Saga Engine header: a color input saves a new revision with only the
  color changed, and "Hue of the code" clears it. It refuses while the
  package editor holds unsaved changes or the metadata stage is locked.
- Generation: generationContext() puts the newest revision color in the
  saga identity of the request, so a new generation keeps it.
- Docs and tests: the colors route, the catalog field and the header
  control; the color resolution and the badge repaint.
The Clean Package view reads `complete` from the cleanup preview, but
cleanupPreview never returned it. planNewest now passes the `complete`
flag of externalReferences, and the preview includes it. The view then
shows when an external source cannot be read on this host.
The other render rows of an item already sit in the `visual` gate. The
`ready` or `shared` row of an active render had no gate, so the visual
gate of the completeness report missed it.
… Auto Run

These mongod suites still asserted behavior that the Saga Engine auto run
(e1f150a) replaced. Only the tests change.

- Saga Auto Run: Final Review approval runs once; the Auto Run approves
  the render of an unplaced item; a published revision refuses a second
  publication with 409; render rows show `state` and `candidate` in place
  of `approved` and the old ready label; finding and definition checks
  ignore extra fields and order; the latest revision is read from
  `candidates`; a procedural approval holds `digest`.
- Render readiness: the three primitive fallbacks are fallback renders the
  publication binds, with no moderator approval.
- Saga workflow: the generator stub returns the provider, model and stop
  reason fields; a removal is refused while a generation works and runs
  after it; the stub request holds a premise.
- Content lifecycle: bind the instance codes the release serves.
- Procedural graph and draft contracts: a placed floor entity, a redrawn
  asset so the publish runs, and the new message of an entity-type default
  that loses its last instance reference.
- Saga sync: bind the merchant item too.
@underpostnet underpostnet added the type: fix Bug correction or defect resolution label Nov 30, 2026
@underpostnet underpostnet self-assigned this Nov 30, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in cyberia Nov 30, 2026
@underpostnet underpostnet added this to the v4.8.0 milestone Nov 30, 2026
@underpostnet
underpostnet merged commit 64effa2 into master Nov 30, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in cyberia Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug correction or defect resolution

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(cyberia): restore the Cyberia CI and saga generation after the seed-to-playable Auto Run

1 participant