Editor assembly
SheetForge.Editor is the editor-side assembly. It holds the settings asset, the run facade, the delivery and source seams, push approval and the authoring engine.
The Data Studio extension points belong to this assembly too. They have their own page, Studio extension points.
Settings, localization, composition
These types live in SheetForge.Editor.Pipeline and .Localization.
| Type | Kind | Role |
|---|---|---|
SheetForgeSettings | ScriptableObject | The settings asset |
Loc | static | Localization entry point |
PluginRegistry | static | Plugin discovery and composition |
ImportEvents | static | Editor-side event bus |
ImportCompletedArgs | sealed | Completion payload passed to subscribers |
BaselineUpdatedArgs | sealed | Payload of a baseline save |
SheetForgeActions | static | The run facade |
SheetForgeEditorInfo | static | Editor-side version and workbook paths |
GoogleSheetAccessMode | enum | SheetsApi (auth, writable) · ExportUrl (no auth, read-only) |
ExportFormat | enum | Tsv · Csv · Xlsx · Json · MatchSource |
SheetForgeSettings
SheetForgeSettings is the settings asset. To fill in the fields, see Import settings.
sourceProviderIdis the sole source-selection axis. Empty means the built-inLocalFile.assetDeliveryIdis the sole delivery-selection axis. Empty meansaddressables.directRefWritesGuiddecides how a newly filledDirectRefcell is spelled.bakeOutputFolderis drawn as Resources folder in the Resources mode. In that mode it must be a folder namedResourcesitself.gidMapis a list ofGidMapEntry { tabName, gid }.- The other fields are
localFolderPath,generatedCodeFolder,generatedNamespace,exportFolderPath,exportFormat,spreadsheetIdandgoogleAccessMode.
The asset also has Effective* resolved properties.
EffectiveDeliveryId normalizes the id. The id is trimmed and lower-cased, and an empty id becomes DefaultDeliveryId. BuiltInDeliveryIdOrder is the fixed dropdown order of the three built-in modes.
Service-account key path
The settings asset has no service-account key path. This is deliberate, so a shared asset never records where credentials live.
The key path is a per-user setting in the Data Studio's ⚙ Settings. The SHEETFORGE_SHEETS_KEY environment variable is the other place to set it.
An asset saved by an earlier version may still hold a path. SheetForge moves that path into your per-user settings once and rewrites the asset without it.
Loc
Loc is the localization entry point. Its members are Tr(key), TrContent(…), Table and the MenuRoot const.
Tr resolves a key in four steps:
- The plugin-registered string in the current language.
- The plugin-registered string in English.
- The built-in table in the current language.
- The built-in table in English.
When no step has the key, Tr returns the key itself.
The overlay owns the English fallback of the plugin strings. See StringOverlayRegistry.
Plugin strings have exactly one registration channel. The question of which registration wins never comes up.
PluginRegistry
PluginRegistry discovers plugins through TypeCache. It then hands the candidates to PluginComposition.Compose.
Build·BuildValidators·BuildEdgeContributors·BuildStructuralMarkers·BuildTemplates·BuildGraphShapes·BuildCodeRegistries·BuildThemesBuildAllreturns the bundle.InvalidateCache()drops the reload-lifetime cache.SourceProviderRegistry.InvalidateCachefollows the same convention.
InvalidateCache() also drops the compatibility gate's cache, so a changed discovery set is re-judged.
PluginBundle
The nested PluginBundle exposes the composed PluginSet Set. That set is the twelve-slot single truth. A newly grown slot is read through it, without widening the bundle type.
The bundle adds nine convenience windows onto the set: Enums · Parsers · Validators · EdgeContributors · Markers · Templates · GraphShapes · CodeRegistries · Themes.
The six- and eight-argument constructors remain as overloads. They default the later registries to empty. They behave identically to the versions before those contracts existed.
Slot isolation
Isolation belongs to Core, not to PluginRegistry. A plugin that throws while registering is reported by name and skipped. Every other slot and plugin still registers.
ImportEvents
ImportEvents is the editor-side event bus. It is a public contract, so other packages may subscribe.
| Event | Raised by |
|---|---|
event Action<ImportCompletedArgs> ImportCompleted | RaiseImportCompleted(ImportCompletedArgs) |
event Action<BaselineUpdatedArgs> BaselineUpdated | RaiseBaselineUpdated(BaselineUpdatedArgs) |
ImportCompleted fires only when an import ran all the way through bake. A subscriber may therefore read the baked assets.
BaselineUpdated fires whenever a sheet snapshot was saved, including a run that failed validation. This is how an editing tool refreshes on a quarantined import.
The two axes are deliberately not merged. One means "the sheets moved". The other means "the assets moved".
Both payload types carry SettingsGuid/SettingsPath, which name the workbook a notice is about. A subscriber can tell apart workbooks that finish one after another in a joint import or a Pull every workbook run.
When no workbook is named, both values are empty. They are never null.
ImportCompletedArgs
ImportCompletedArgs is the completion payload passed to subscribers.
IReadOnlyList<string> Tabslists the tabs baked by this completion.string BakeFolderis the Database-SO folder.string SettingsGuidis the settings asset's GUID.string SettingsPathis its asset path.
The payload follows the args-object pattern. Future fields won't break the event signature.
BaselineUpdatedArgs
BaselineUpdatedArgs is the baseline-save payload.
IReadOnlyList<string> Tabslists the tabs written to the snapshot.bool Quarantinedsays whether the snapshot just saved failed validation.string SettingsGuidis the settings asset's GUID.string SettingsPathis its asset path.
SheetForgeActions
SheetForgeActions is the run facade. It runs the same cycle a menu click runs. You can call it from a CI script, a build hook or your own button.
RunImport()runs the open workbook, one cycle.RunImport(settings)is the overload that takes a settings asset.RunImportActive()runs every active workbook, in dependency order. With one active workbook it is identical toRunImport().RunImportAll()runs every workbook in the project.RunExport()andRunPush()run over the open workbook or over every active workbook, as Export and Push apply to in the Data Studio's ⚙ Settings says.RunHealthCheck()RunLocalizationSync()
Each method delegates. Settings resolution, the delivery mode's availability check, mutual exclusion, confirmation modals, the progress bar and the codegen→compile→bake resume all stay inside the product.
Exclusive scope and report text
bool IsBusybool TryBeginExclusiveScope(out IDisposable scope)returnsfalsewithscope = nullwhen something is already running.string RenderReportText(ImportReport)returns the product's own sentences in the current editor language. It does not write to the console.
Disposing the scope is what releases the run. A second Dispose cannot free somebody else's run.
Completion semantics
RunImport/RunPush are fire-and-forget. Their bodies are async void because the editor main thread cannot block on network IO. The return is not completion. To learn when an import completes, subscribe to ImportEvents.ImportCompleted.
RunExport/RunHealthCheck/RunLocalizationSync complete synchronously.
RunLocalizationSync runs the sheet → String Table path that an import completion runs. Without the Unity Localization package, it shows the install notice and changes nothing.
SheetForgeEditorInfo
SheetForgeEditorInfo is a small static class in the namespace SheetForge.Editor. It holds the editor-side version and the workbook paths that build scripts and CI steps read.
const Version is the mirror of SheetForgeRuntimeInfo in the Runtime assembly. Use it for feature-gating against the editor-side surface.
Workbook paths
SheetForgeEditorInfo also reports the project's workbooks.
IReadOnlyList<string> AllWorkbookPathslists every settings asset in the project.ActiveWorkbookPathslists the active set.string FocusWorkbookPathis the workbook the Data Studio opens, ornullwhen there is none.
Both lists are sorted by path and are never null. The sort order is not the order an import runs the workbooks in.
Each read scans the project's settings assets once. Read the value from a build step, a CI job or a menu command and keep the result, rather than from per-frame or OnGUI code.
Delivery seam
These types live in SheetForge.Editor.Delivery. They are the editor side of the delivery modes, which decide how baked databases reach the game.
| Type | Role |
|---|---|
IDatabaseDeliveryStrategy | The editor half of a delivery mode |
DeliveryStrategyRegistry (static) | Discovery and resolution |
BakedDatabaseInfo (readonly struct) | One database a bake just produced |
IAssetIndexSource | Source of the two asset indexes |
AssetIndexSources (static) | The one registration point for that source |
IDatabaseDeliveryStrategy
IDatabaseDeliveryStrategy is the editor half of a delivery mode. TypeCache discovers it, like a source provider.
Id·DisplayNameKey·AllowedGatedTypesEnsureAvailableOrGuide()RequiresPackage(out packageId)ValidateBakeOutputFolder(folder, out reasonKey, out suggestedFolder)AssetPathOf(outputFolder, tabName)AfterBake(baked, bakeOutputFolder, errors, preservedTabs)DeliveredKeys()
Custom delivery explains the contract member by member.
DeliveryStrategyRegistry
DeliveryStrategyRegistry is shaped like SourceProviderRegistry.
Alllists the built-ins first in a fixed order, then the plugins sorted by id.TryGet(id, out strategy)ResolveActive(SheetForgeSettings)/ResolveActive(string id)return null for an id nothing offers. The id is never silently repaired.Normalize(id)·KnownIds()·DescribeKnownIds()EnsureActiveAvailableOrGuide()/EnsureAvailableOrGuide(settings)are the availability check every pipeline entry runs first.BuildContext(strategy)builds theDeliveryContextthe validators are injected with.InvalidateCache()
BakedDatabaseInfo
BakedDatabaseInfo describes one database a bake just produced, as AfterBake receives it.
TabName·AssetPath·KeyTablemay be null.Databaseis null when the asset could not be read back.
Asset index sources
IAssetIndexSource is where the pipeline gets two indexes. ResourceRef and DirectRef cells are validated against them.
BuildResourceIndex(registry, errors)BuildProjectIndex(registry, errors)
A null result means "cannot answer". The validators then skip.
AssetIndexSources is the one registration point for that source. Its members are Current, BuildResourceIndex(…) and BuildProjectIndex(…). They give null when nothing is registered.
Source-provider seam
These types live in SheetForge.Editor.Sources. To write your own provider, see Pipeline and sources.
| Type | Role |
|---|---|
ISheetSourceProvider | The provider contract |
ISourceReflectTarget | Write-back target |
SourceVisibility | Which settings fields to show |
SourceProviderRegistry (static) | Discovery and resolution |
ITabSource | Fetch abstraction |
TabSourceResult | What a fetch returns |
TabSourceFormat (enum) | Tsv · Csv · Xlsx · GoogleSheet |
Source-provider members
ISheetSourceProviderhasId·DisplayNameKey·CreateTabSource(settings)·GetVisibility(settings)·CanAuthor(settings)·CreateReflectTarget(dispatcher, settings).ISourceReflectTargethasvoid Reflect().SourceVisibilityhas 5 bool flags.SourceProviderRegistryhasAll·ResolveActive(SheetForgeSettings)·ResolveActive(string providerId)·TryGet·InvalidateCache.ITabSourcehasDescription·Task<TabSourceResult> FetchAsync().TabSourceResulthas the staticCreate.
ResolveActive(string providerId) resolves straight from an id, without a settings asset in hand.
TabSourceResult carries the tabs (name → raw TSV), the diagnostics and the per-tab formats. Partial output is allowed.
Push approval
These types live in SheetForge.Editor.Push.
| Type | Role |
|---|---|
IPushApprover | Approves or rejects a push |
AutoPushApprover | Always approves. For tests and automation |
IPushApprover has two members:
bool Approve(PushPlan, string humanSummary)bool ApproveStructureRewrite(string, bool hasLiveConflicts)
When the approver rejects, nothing is sent.
Authoring engine
These types live in SheetForge.Editor.Structure, .Pipeline and .Export. The authoring engine holds the staged edits and runs the reflect that writes them to the source. How an edit reaches the sheet explains both words.
| Type | Role |
|---|---|
AuthoringSession | Staging state owner |
AuthoringDispatcher | The reflect orchestrator |
AuthoringDispatchCallbacks | View-concern delegates for the dispatcher |
BuiltInSourceDialogs | Opt-in bundle of built-in source dialog delegates |
BaselineStore | Per-tab normalized-TSV baseline snapshots |
BaselineStore is the one type in .Export.
AuthoringSession
AuthoringSession owns the staging state. It is serializable, which gives it Undo and reload survival for free.
Edits·IsolatedEdits·NewRows·StructOps·Reorders·TabRenamesEnumMembersholds the staged enum-sheet member additions.AssetRegistrationsholds the staged Addressables registrations.HasAssetRegistrations·StageAssetRegistration(r)·RemoveAssetRegistrationsWhere(predicate)SetStaged·ResolveBaselineEdits·RemapFieldName/RecordId/Tab·StageTabRenameEffectiveStructOps·PendingStructCount·TabNames·TryGetBaselineTable·LastProjectionResultClearAllclears the registrations too.
Staged asset registrations
Asset registrations are project-level. They take no part in the per-tab gates. They do count for reflect entry, discard and the diff summary.
StageAssetRegistration(r) follows three rules:
- A registration with the same guid replaces the staged one in place. For a group creation, the same group replaces in place.
- The last intent wins.
- A registration without an identity is refused.
AuthoringDispatcher
AuthoringDispatcher is the reflect orchestrator. Its constructor takes (session, callbacks, baselines).
Reflect()BuildProjectionResult()is a side-effect-free projection query.IReadOnlyDictionary<string,string> BuildProjectedTabs()returns the same projection as TSV per tab.void FinalizeReflectSuccess(IReadOnlyList<string> writtenTabs, IReadOnlyList<TabRenameEntry> committedRenames = null)Session·Callbacks·Baselines
BuildProjectedTabs() shows what a write-back target is about to send. You can preview it without writing.
FinalizeReflectSuccess
FinalizeReflectSuccess is the ending that a source's own write-back has to reach. It does three things:
- Pruning of retained staged edits for the tabs it wrote.
- The
ClearUndoboundary. - The automatic re-import.
The built-in paths run the same private body, so an external provider ends exactly the way they do.
An empty list is a no-op that keeps staging intact.
AuthoringDispatchCallbacks
AuthoringDispatchCallbacks holds 13 general view-concern delegates plus an IPushApprover. Among the delegates:
ResolveSettingsRenderReportis anAction<ImportReport>. It is null-tolerated.TriggerReimportConfirmKeyRenamesConfirmTabRenamesis null-tolerated.ClearUndoRebuild
The built-in local-file and Google dialog delegates are not here. They live in the opt-in BuiltInSourceDialogs bundle.
BuiltInSourceDialogs
BuiltInSourceDialogs is an opt-in bundle of 14 built-in local-file and Google source dialog delegates. It is separate from AuthoringDispatchCallbacks. External providers never need them.
NotifyLocalDone takes five arguments. The last is the Addressables registration summary line for the completion dialog. It is null when nothing was staged.
Staging value types
These types live in SheetForge.Editor.Structure. StagedCellEdit/StagedNewRow are in SheetForge.Editor.Windows.
| Type | Role |
|---|---|
StagedCellEdit (struct) | One staged edit |
StagedNewRow | One staged new row |
StructureOp | One structure op |
StructureOpKind (enum) | The kind of a structure op |
TabReorderEntry | Per-tab reorder state |
TabRenameEntry (struct) | OldName · NewName |
StagedEnumMember (struct) | One staged "add this member to this enum" |
StagedAssetRegistration (struct) | One staged change to the project's Addressables settings |
StagedAssetRegistrationKind (enum) | Add · Move · CreateGroup |
TabBaselineAnchor (struct) | TabName · Fingerprint · RecordCount |
IsolatedEdit | A re-anchor-failed edit |
IsolationReason (enum) | External rename / external delete / key conflict |
Staging members
StagedCellEdithasTabName·RowOrdinal·FieldName·RawText·RecordId.RecordIdis the logical key.StagedNewRowhasTabName·FieldNames·CellTexts.StructureOphasKind· coordinates · texts ·Orderpermutation.TabReorderEntryhasTab·ColOrder·RowOrder.IsolatedEdithasEdit·Reason.
StructureOpKind values
AddColumn · RemoveColumn · AddMarker · RemoveMarker · RemoveDataRow · ReorderColumns · ReorderDataRows · RenameColumn · EditColumnType · EditColumnDesc · SetColumnOverlap · SetSheetStyle
StagedEnumMember
StagedEnumMember is one staged "add this member to this enum".
TabNamenames the enum sheet. Empty means search them all.EnumNameMember
A staged enum member is session-level rather than a StructureOp, for the same reason a tab rename is. An enum sheet has no table, no schema and no key column. A cell edit's (tab, record, field) address cannot name "the next member of this enum".
The type is public only because AuthoringSession.EnumMembers is (CS0050).
StagedAssetRegistration
Dropping or picking an asset into an AssetRef@Group cell makes one staged change to the project's Addressables settings.
StagedAssetRegistrationKind KindGuidis the asset. A sub-asset stages its parent.GroupFromGroupis for moves only.Addressis the file name without extension for a new entry. An already-registered asset keeps its address.AssetPathis for display.
The factories are Add(guid, group, address, assetPath), Move(guid, fromGroup, group, address, assetPath) and CreateGroup(group).
A staged registration is executed after the sheet write succeeds, then cleared.
Like StagedEnumMember, the type is public only because AuthoringSession.AssetRegistrations is (CS0050).
Authoring helpers
These types live in SheetForge.Editor.Windows and .Structure.
| Type | Kind | Role |
|---|---|---|
KeyRenamePlanner | static | Key rename and cross-tab propagation planning |
RecordIdMinter | static, pure | Id suggestions |
IntIdMinter | static, pure | Next-IntId suggestion for a new record |
ProjectionErrorMapper | static, pure | Error coordinate → logical address |
EphemeralSoApply | static | Staged-value SO overlay (temporary) |
Helper members
KeyRenamePlannerhasPlan(…)· nestedKeyRenamePlan· sibling structKeyRename.RecordIdMinterhasSuggest·DetectCommonPrefix·Uniquify·StagedNewRowKeys.IntIdMinterhasSuggest(existingIds)→max + 1.ProjectionErrorMapperhasTryMap(…)· nestedLogicalAddress.EphemeralSoApplyhasApply(…)·InvalidateIndex(…)· nestedReport/SkipReason/SkippedEdit.
IntIdMinter is a separate axis from RecordIdMinter. It never re-uses a deleted gap.
Next steps
- Studio extension points
Contracts and tools for your own UI in the Data Studio.
- Runtime assembly
The types your game code loads databases with.
- Pipeline and sources
Write an import source and automate the pipeline.
- Custom delivery
Implement a delivery mode of your own.