Skip to main content

GBC Scene Forge

Version 0.1.1 is a local browser editor with an explicitly supplied Python game connector. It has no runtime Python dependencies. The package contains its HTTP service, browser UI, document storage, task runner and durable transaction store. Atlas decoding, rendering, source translation and game builds belong to the host connector. No connector is discovered or executed automatically.

Installation

python -m pip install gbc-scene-forge==0.1.1

The PyPI package includes the browser UI and service. A host game supplies the connector and launcher described below.

Development

make setup PYTHON=python3.12
make lint test build

The build creates dist/gbc_scene_forge-0.1.1-py3-none-any.whl and a source archive, and tests the wheel in a clean environment. See building and releasing for tooling and manual PyPI publication. For local development, hosts can install this checkout with python -m pip install -e ../gbc-scene-forge or use their dependency manager's editable path support.

Launching

Install the package through the host project's locked dependencies. A host launcher constructs its connector and calls:

from gbc_scene_forge.server import serve

serve(connector, port=8765)

The connector supplies an explicit Workspace(root, drafts, history, reviews). The service binds to loopback and uses a per-session mutation token. Connectors are trusted local Python code, not a sandboxed plugin system. The host must recover existing transactions before importing game modules that require approved sources.

Connector contract version 1

gbc_scene_forge.contract.Connector specifies the interface. Its implementation supplies:

Method Responsibility
catalog() Project identity, capabilities, target profiles, image families and asset entries
load(target, template=False) Working scene, fixed cells, constraints, marker annotations and draft revision
normalize(scene) / check_shape(scene) Legacy document interpretation and structural game validity
source_revision(target) Opaque revision of relevant source dependencies
preview(scene, light, state, frame) PNG data URL, collision grid and authoritative comparison result
validate(scene) Validity, errors/warnings and structured issues
compare(scene) Whether game-relevant content differs; not restricted to the cell grid
asset(name) / export(scene) Encoded image bytes and the connector's portable handoff
input_files(root) / output_files(root) Explicit workspace file inventories
prepare(scene, stage, review_id) Staged candidate and a BuildPlan
approve(plan, stage, review_id) Bind project-specific approval metadata after explicit review confirmation
activity(text, fallback) / refresh() Project-specific activity descriptions and cache invalidation

Catalog profiles declare cell_size, erase_cell, lighting, states, optional guide dimensions and animation_frames/animation_interval_ms/animation_label. Asset entries declare opaque id, display label, family, compatible profiles, and either an explicit image rect or a stamp's cells. Sprite references set reference: true; their rectangles may declare an origin. The browser never decodes IDs or map characters.

Capabilities control Apply, export, templates and composition references. Every project supplies at least one profile and preview mode. Required contract methods remain available even when an operation reports unsupported capabilities.

The working grid schema retains profile as the opaque target key and source_digest as an opaque revision for compatibility. Fixed coordinates are returned as locked; constraints supplies reasons. Conditional game rules stay authoritative in connector validation. Issue objects contain code, message and, when available, a cell or region location.

Documents

New saves and JSON downloads use envelope version 2:

{
  "version": 2,
  "connector": "example-game",
  "id": "draft-name",
  "name": "Draft name",
  "target": "room",
  "source_revision": "opaque-revision",
  "content": {
    "width": 7,
    "height": 5,
    "cells": [],
    "references": []
  }
}

The illustrative cells must contain the declared number of rows and columns in a real document. Connector extensions live inside content and survive saves. Version-1 flat documents pass through connector normalization. Loading leaves their original bytes untouched; saving migrates that file with its existing ID and raw-byte revision guard. Unsupported versions, connector identities and unrecognized envelope fields are rejected without rewriting files. Existing source-staleness checks still apply to migrated drafts.

Original scene snapshots

The first successful draft save for each scene preserves the connector's current game document in Workspace.drafts/.originals/. It captures the live scene before draft edits, including when the first saved draft came from a template or import. The key includes connector identity and target, without interpreting target IDs. Later saves, Apply, Undo and draft deletion never overwrite or remove that file.

Open original appears for the selected scene when its snapshot exists. It loads the preserved content into the editor with an ORIGINAL tag. The button is disabled while that original is open without edits; editing re-enables it, and loaded drafts always allow opening the original even when their content matches. Restoration uses the current source revision for normal validation and reviewed Apply. Loading changes no game files. Open current version continues to load today's game sources; Revert changes still restores the last opened/saved canvas. Unsupported historical content or changed fixed cells still fail connector validation rather than bypass it. Original snapshot bytes remain unchanged when loaded.

Snapshots start with the game state at the first save after this feature is installed; earlier game changes cannot be reconstructed from existing drafts. Keep the .originals/ files with the workspace for long-term restoration.

Apply and recovery

BuildPlan declares candidate source paths, allowed outputs, required artifacts, ordered CheckStep commands, environment, review views and approval data. Commands are argument arrays, run in an isolated candidate directory. Preparation and approval operate on that directory; connectors must not mutate live sources.

The runner checks source, candidate and installed editor-package fingerprints, rejects escaping paths, requires declared artifacts, excludes only declared outputs from the frozen-source comparison, and promotes only declared sources/outputs. It preserves process-group cleanup, bounded output, worker health, reconnectable status, conflict-aware rollback and interrupted-transaction recovery. Existing transaction/job formats are retained; history paths come from the workspace.

Independent acceptance fixture

tests/fixture_connector.py provides a different 7 × 5 scene with four-pixel cells, opaque asset IDs, non-grid game content, JSON sources and a small Python compiler. It imports no host game, atlas library or imaging library. Run:

.venv/bin/python -m unittest discover -s tests -p 'test_*.py'
.venv/bin/python tests/serve_fixture.py --root /tmp/forge-fixture --port 8777
node tests/browser.mjs http://127.0.0.1:8777/

The browser check requires a local Chrome installation; its third argument can override the default macOS executable. The fixture proves this contract is independent of one game. Additional real games may require explicit future capabilities rather than game-specific branches in the editor.

License

MIT. Copyright (c) 2026 Michael Clifford.

Metadata

Release files for gbc-scene-forge 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gbc-scene-forge 0.1.1
File Size Uploaded Provenance Actions
gbc_scene_forge-0.1.1.tar.gz 82.2 kB With provenance Details for gbc_scene_forge-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gbc-scene-forge 0.1.1
File Interpreter ABI Platform Actions
gbc_scene_forge-0.1.1-py3-none-any.whl Python 3 none any Details for gbc_scene_forge-0.1.1-py3-none-any.whl

Total release size: 123.3 kB

Release files / gbc_scene_forge-0.1.1.tar.gz

Download URL gbc_scene_forge-0.1.1.tar.gz
Size 82.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d6edf11d6c6632846aad13ef6d46d51d944bd50c2075998269e85f8c68045358
BLAKE2b-256 checksum
How to use checksums
262669f78703777f3f86b7c80b7e04389318d1b87ca88d1c90f8a724c09d77ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / gbc_scene_forge-0.1.1-py3-none-any.whl

Download URL gbc_scene_forge-0.1.1-py3-none-any.whl
Size 41.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a58716cf0d9c59cdcdd4940697fceb60c7b626dced3d6ae58fd24f62a05d3e15
BLAKE2b-256 checksum
How to use checksums
2a0ce1402c0bdb284d6c8c592736c443e255fd74a120b344f64ab165aa4ecff5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for gbc-scene-forge 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gbc_scene_forge-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page