Architecture overview
ORIX Sheet is a native macOS spreadsheet (Swift 6 language mode, macOS 14 deployment target, AppKit
document architecture with SwiftUI chrome). The repository is one thin application target
(App/Sources, 9 Swift files) on top of 22 local Swift packages under Packages/. There is no
third-party Swift dependency: the only external binary is the DuckDB C library, vendored as
Vendor/duckdb/CDuckDB.xcframework and fetched by Scripts/fetch-duckdb.sh.
This page is the map. Each subsystem has its own document:
| Subsystem | Document |
|---|---|
| Grid drawing, editing, printing | grid-engine.md |
| Lexer, parser, evaluator, function registry | formula-engine.md |
| Dependencies, recalculation, spills, cycles | calculation-graph.md |
| DuckDB datasets, transforms, pivots | data-engine.md |
| Python subprocess and sandbox | python-runtime.md |
| Charts and Figure Studio | chart-engine.md |
.orixsheet packages, save, import, export |
persistence.md |
| On-device assistance | intelligence.md |
| Threat model | ../security.md |
| Building and running | ../development/setup.md |
1. Package map
The dependency lists below are read from the Package.swift manifests
(.package(path: "../…") entries); nothing is inferred from imports.
1.1 Layers
| Layer | Packages | Role |
|---|---|---|
| Model and calculation core | SheetCore |
Workbook model (Workbook, Sheet, Cell, Value, styles, addresses, date serials), formula lexer/parser/printer, evaluator, dependency graph, CalcEngine, editing with undo, fill, reference rewriting, FunctionRegistry. Depends on nothing. |
| Function libraries | FunctionsNumeric, FunctionsText, FunctionsLookup |
Worksheet functions registered into FunctionRegistry.standard. FunctionsNumeric links Accelerate (LAPACK through the C target CNumericLAPACK); FunctionsLookup also holds the financial functions (FinancialFunctions.register()). |
| Number formats | SheetFormat |
Excel number-format codes: parsing, rendering, format editing helpers, built-in catalogue. |
| Engine bootstrap | SheetEngine |
One file, Bootstrap.swift: ORIXEngine.bootstrap() registers the four libraries once per process. Also the orix-bench executable. |
| File formats | SheetIO |
.orixsheet, XLSX/XLSM, ODS, CSV/TSV, JSON/JSONL readers and writers, own ZIP/Deflate reader (links libz), export preflight. Depends only on SheetCore. |
| Engines without UI | SheetData (DuckDB), SheetCharts (CoreGraphics/CoreText/ImageIO), SheetAnalytics (products Statistics, FinanceModels, WhatIf, Audit; Accelerate), SheetPython, SheetIntelligence |
Each depends on SheetCore; SheetIntelligence additionally on the three function libraries and SheetAnalytics. |
| UI kit | SheetUI |
WorkbookSession, the AppKit GridView, SwiftUI chrome, design tokens, the Workspace extension registry. Depends on SheetCore and SheetFormat only. |
| Features | FeatureAudit, FeatureCharts, FeatureData, FeaturePython, FeatureAnalysis, FeatureIntelligence, FeatureAutomation |
Panels and commands; each pairs SheetUI with one engine and registers itself in Workspace.shared. |
| Automation engine | SheetAutomation |
Workflow model, validator, WorkflowEngine, workflow and trust stores, the AutomationPDF library and the orix-sheet command-line tool. See automation.md. |
| Templates | SheetTemplates |
Fifteen workbook templates built in code, their thumbnails and the TemplateLibrary. See ../templates.md and section 7. |
| Application | App/Sources |
NSApplication entry point, WorkbookDocument (NSDocument), main menu, settings, welcome/help windows, launch arguments. |
Source: Packages/*/Package.swift, App/Sources/*.swift, project.yml.
1.2 Core and engine packages
flowchart TD
SheetEngine["SheetEngine<br/>ORIXEngine.bootstrap"] --> FunctionsNumeric["FunctionsNumeric"]
SheetEngine --> FunctionsText["FunctionsText"]
SheetEngine --> FunctionsLookup["FunctionsLookup<br/>lookup + financial"]
SheetEngine --> SheetFormat["SheetFormat"]
FunctionsText --> SheetFormat
SheetUI["SheetUI<br/>session, grid, chrome"] --> SheetFormat
FunctionsNumeric --> SheetCore["SheetCore<br/>model, parser, CalcEngine"]
FunctionsLookup --> SheetCore
SheetFormat --> SheetCore
SheetIO["SheetIO"] --> SheetCore
SheetData["SheetData<br/>DuckDB"] --> SheetCore
SheetCharts["SheetCharts"] --> SheetCore
SheetAnalytics["SheetAnalytics"] --> SheetCore
SheetPython["SheetPython"] --> SheetCore
SheetIntelligence["SheetIntelligence"] --> SheetAnalytics
SheetIntelligence --> FunctionsNumeric
SVG fallback:
Edges to SheetCore that are implied by another drawn edge are omitted for legibility
(SheetEngine, FunctionsText, SheetUI and SheetIntelligence all depend on SheetCore
directly; SheetIntelligence also depends on FunctionsText and FunctionsLookup). The complete
lists are in the table of section 1.4.
1.3 Feature packages and the application
flowchart TD
App["ORIX Sheet.app<br/>App/Sources"] --> FeatureAudit["FeatureAudit"]
App --> FeatureCharts["FeatureCharts"]
App --> FeatureData["FeatureData"]
App --> FeaturePython["FeaturePython"]
App --> FeatureAnalysis["FeatureAnalysis"]
App --> FeatureIntelligence["FeatureIntelligence"]
App --> FeatureAutomation["FeatureAutomation"]
App --> SheetTemplates["SheetTemplates"]
App --> SheetEngine["SheetEngine"]
App --> SheetIO["SheetIO"]
FeatureAudit --> SheetAnalytics["SheetAnalytics"]
FeatureAnalysis --> SheetAnalytics
FeatureAnalysis --> SheetCharts["SheetCharts"]
FeatureCharts --> SheetCharts
FeatureData --> SheetData["SheetData"]
FeaturePython --> SheetPython["SheetPython"]
FeatureIntelligence --> SheetIntelligence["SheetIntelligence"]
FeatureAutomation --> SheetAutomation["SheetAutomation"]
FeatureAudit --> SheetUI["SheetUI"]
FeatureCharts --> SheetUI
FeatureData --> SheetUI
FeaturePython --> SheetUI
FeatureAnalysis --> SheetUI
FeatureIntelligence --> SheetUI
FeatureAutomation --> SheetUI
SVG fallback:
The six panel features (FeatureAudit, FeatureCharts, FeatureData, FeaturePython,
FeatureAnalysis, FeatureIntelligence) depend on no other feature package and on neither SheetIO
nor SheetEngine: they see the workbook only through SheetCore types and the WorkbookSession they
are handed. Two packages are different, and their extra edges are left out of the diagram for
legibility (the complete lists are in section 1.4):
FeatureAutomationalso depends onSheetEngineandSheetIO, andSheetAutomationdepends on nine packages (SheetCore,SheetEngine,SheetFormat,SheetIO,SheetUI,SheetData,SheetCharts,SheetAnalytics,SheetPython): a workflow opens, converts and exports files and drives the data, chart, audit and Python engines without a window.SheetTemplatesdepends onSheetCore,SheetEngine,SheetCharts,SheetFormatandSheetIOfor the library, and onSheetUI,FeatureChartsandFeatureAuditfor itstemplates-previewharness only (both can be switched off withORIX_TEMPLATES_NO_PREVIEW/ORIX_TEMPLATES_NO_FEATURES).
The application also links SheetCore, SheetFormat and SheetUI directly (project.yml).
1.4 Complete dependency table
| Package | Local package dependencies | Products | System libraries declared |
|---|---|---|---|
| SheetCore | — | library SheetCore |
— |
| SheetFormat | SheetCore | library SheetFormat |
— |
| FunctionsNumeric | SheetCore | library FunctionsNumeric |
Accelerate |
| FunctionsText | SheetCore, SheetFormat | library FunctionsText |
— |
| FunctionsLookup | SheetCore | library FunctionsLookup |
— |
| SheetEngine | SheetCore, SheetFormat, FunctionsNumeric, FunctionsText, FunctionsLookup | library SheetEngine; executable target orix-bench |
— |
| SheetIO | SheetCore | library SheetIO |
libz |
| SheetData | SheetCore | library SheetData; executable orix-data-bench |
binary target CDuckDB (Vendor/duckdb/CDuckDB.xcframework), libsqlite3 |
| SheetCharts | SheetCore | library SheetCharts; executable chart-gallery |
CoreGraphics, CoreText, ImageIO, UniformTypeIdentifiers |
| SheetAnalytics | SheetCore | libraries Statistics, FinanceModels, WhatIf, Audit |
Accelerate |
| SheetPython | SheetCore | library SheetPython |
— |
| SheetIntelligence | SheetCore, SheetAnalytics, FunctionsNumeric, FunctionsText, FunctionsLookup | library SheetIntelligence |
— |
| SheetUI | SheetCore, SheetFormat | library SheetUI; executable target sheet-preview |
— |
| FeatureAudit | SheetCore, SheetUI, SheetAnalytics, FunctionsNumeric | library FeatureAudit; executable audit-preview |
— |
| FeatureCharts | SheetCore, SheetUI, SheetCharts, SheetFormat | library FeatureCharts; executable charts-preview |
— |
| FeatureData | SheetCore, SheetUI, SheetData | library FeatureData; executable data-preview |
— |
| FeaturePython | SheetCore, SheetUI, SheetPython | library FeaturePython; executable python-studio-preview |
— |
| FeatureAnalysis | SheetCore, SheetUI, SheetAnalytics, SheetCharts, FunctionsNumeric, FunctionsLookup | library FeatureAnalysis; executable analysis-preview (+ 4 per-area preview targets) |
— |
| FeatureIntelligence | SheetCore, SheetUI, SheetIntelligence, SheetAnalytics, FunctionsNumeric, FunctionsText, FunctionsLookup | library FeatureIntelligence; executable intelligence-preview |
— |
| SheetTemplates | SheetCore, SheetEngine, SheetFormat, SheetIO, SheetUI, SheetCharts, FeatureAudit, FeatureCharts | library SheetTemplates; executable templates-preview |
CoreGraphics, CoreText, ImageIO |
| SheetAutomation | SheetCore, SheetEngine, SheetFormat, SheetIO, SheetUI, SheetData, SheetCharts, SheetAnalytics, SheetPython | libraries SheetAutomation, AutomationPDF; executable orix-sheet |
— |
| FeatureAutomation | SheetCore, SheetUI, SheetEngine, SheetIO, SheetAutomation | library FeatureAutomation; executable automation-preview |
— |
Source: Packages/*/Package.swift (extracted with a script on 2026-11-21; every manifest declares
swift-tools-version: 6.0 and platforms: [.macOS(.v14)]).
1.5 Size of each package
| Package | Swift files (Sources) | Lines (Sources) | Lines (Tests) |
|---|---|---|---|
| SheetCore | 17 | 4 659 | 465 |
| SheetFormat | 9 | 1 478 | 697 |
| FunctionsNumeric | 21 | 3 497 | 964 |
| FunctionsText | 10 | 1 256 | 523 |
| FunctionsLookup | 11 | 2 325 | 1 232 |
| SheetEngine | 2 | 176 | 81 |
| SheetIO | 31 | 7 500 | 2 915 |
| SheetData | 20 | 4 317 | 1 744 |
| SheetCharts | 45 | 7 220 | 1 306 |
| SheetAnalytics | 93 | 15 239 | 7 239 |
| SheetPython | 10 | 1 655 | 1 409 |
| SheetIntelligence | 12 | 2 375 | 1 080 |
| SheetUI | 20 | 4 929 | 512 |
| FeatureAudit | 28 | 5 983 | 1 372 |
| FeatureCharts | 35 | 6 209 | 1 369 |
| FeatureData | 34 | 7 766 | 1 401 |
| FeaturePython | 15 | 2 925 | 758 |
| FeatureAnalysis | 85 | 9 771 | 2 546 |
| FeatureIntelligence | 6 | 1 597 | 331 |
| SheetTemplates | 22 | 2 980 | 930 |
| SheetAutomation | 20 | 4 182 | 1 631 |
| FeatureAutomation | 16 | 3 125 | 683 |
| App/Sources (tests: App/Tests) | 10 | 1 292 | 235 |
Source: find Packages/<name>/Sources -name '*.swift' | xargs cat | wc -l (and the same for
Tests), run on 2026-11-21 at 03:54 EST. Physical lines, blank lines and comments included. Python,
C and resource files are not counted. Test counts by package are in docs/reports/tests.json,
produced by Scripts/test-all.sh (see ../development/testing.md).
2. What the application target contains
| File | Content |
|---|---|
main.swift |
Creates NSApplication, installs AppDelegate, runs. No SwiftUI App type: the app uses the AppKit document architecture. |
Features.swift |
Features.registerAll(), in this order: ORIXEngine.bootstrap(), AuditFeature.register(), DataFeature.register() (plus the close handler DataWorkspace.close), PythonFeature.register(), ChartsFeature.register() (plus the session observer ChartsFeature.attach(to:)), AnalysisFeature.register(), IntelligenceFeature.register(), AutomationFeature.register(), then Welcome.provider = WelcomeProvider(…) built on TemplateChooser and TemplateLibrary. Also the list of close handlers run when a document closes. |
WorkbookDocument.swift |
The NSDocument subclass: reading, native writing, export, PDF export, printing, window creation, the import report. |
AppDelegate.swift |
Menu actions forwarded to the current WorkbookSession; LaunchArguments (the -ORIX… arguments used by tests, screenshots and localization checks, listed in ../development/setup.md). |
MainMenu.swift |
The menu bar, including the menus generated from Workspace.shared.actions and panes. |
AppSettings.swift |
Preferences stored in UserDefaults: formula separators, appearance, welcome window, background-calculation threshold (default 20 000 pending formulas), default zoom (75–200 %). |
Welcome.swift |
The welcome window that hosts the template chooser (Welcome.provider, assigned by Features.registerAll()) and the Help window with the shortcut list. |
TemplateChooser.swift |
The SwiftUI template chooser shown at launch and from File ▸ New from Template… (categories, thumbnails, blank workbook, open existing), and ORIXSheetIntents, the AppIntentsPackage that includes the intents of FeatureAutomation. |
CompatibilityReport.swift, PageSetupView.swift |
The import/export report sheet and the page-setup sheet. |
project.yml also declares an app-hosted XCTest bundle, ORIXSheetTests (App/Tests, 9 tests; result
in docs/reports/app-tests.json). No script in Scripts/ runs it; the command is in
../development/testing.md.
Source: App/Sources/*.swift, project.yml.
3. Threading model
There are four kinds of execution context. Swift strict concurrency is set to complete for the
application target (project.yml).
| Context | What runs there | Where it is defined |
|---|---|---|
| Main actor | WorkbookSession (@MainActor @Observable), every view, Workspace, NSDocument reading and writing (the document overrides are nonisolated and hop with MainActor.assumeIsolated; canConcurrentlyReadDocuments returns false), all model mutations (session.perform). |
SheetUI/Session/WorkbookSession.swift, App/Sources/WorkbookDocument.swift |
| Deep-stack calculation thread | Every CalcEngine.recalculate body, and every ad-hoc evaluation that calls CalcEngine.runDeep (conditional-format evaluation, validation, formula/error explainers, name rules in the auditor). runDeep starts a Thread with stackSize = 1 << 29 bytes (512 MiB), QoS user-initiated, and blocks the caller on a semaphore until the body returns; a call made from such a thread runs inline. |
SheetCore/Engine/CalcEngine.swift (runDeep) |
| Session calculation queue | Serial DispatchQueue ai.spboucher.orix.sheet.calc. Used only when more formulas are pending than syncCalcThreshold (20 000 by default, user setting): the queue calls engine.recalculate(progress:isCancelled:), which in turn uses a deep-stack thread. |
WorkbookSession.runCalc |
| Feature background work | Data: serial queues ai.spboucher.orix.sheet.data.work and …data.pages (DuckDB work and grid paging). Charts: concurrent queue ai.spboucher.orix.charts.render. Analysis tools and scenarios: Task.detached(priority: .userInitiated). Python: a child process plus reader threads. Intelligence and the workflow engine are Swift actors. |
FeatureData/Core/DataWorkspace.swift, FeatureCharts/Render/ChartRenderCache.swift, FeatureAnalysis/…/ToolRunner.swift, SheetPython/Spawn.swift, SheetIntelligence/Intelligence.swift |
Source: the files named in the last column.
3.1 The engine lock
CalcEngine is declared @unchecked Sendable and is not re-entrant: its documentation
requires callers to serialize all mutations and recalculate calls. The session provides that
serialization (everything goes through the main actor, and a background recalculation is halted
before any mutation, see below).
CalcEngine.lock (an NSLock) is held while computed values are written. Readers that may run
while a background recalculation is in progress take the same lock: the selection summary in the
status bar (WorkbookSession.selectionSummary), and the document when it serializes the workbook
(WorkbookDocument.writeOnMain and export lock the engine around WorkbookWriter.save).
3.2 A mutation, step by step
sequenceDiagram
participant V as View or menu action
participant S as WorkbookSession (main actor)
participant E as CalcEngine
participant T as Deep-stack thread
V->>S: perform(label, body)
S->>S: haltCalculation()
S->>E: transaction(label) body
E-->>S: changeCount changed
S->>S: registerUndo(label)
S->>E: recalculate()
E->>T: runDeep(recalcBody)
T-->>E: RecalcStats
S->>V: invalidate(content: true)
SVG fallback:
performfirst callshaltCalculation(): if a background recalculation is running it sets the cancel flag, waits for the calculation queue to drain (calcQueue.sync {}) and clears the flag. The engine polls the flag between top-level dirty entries, once at least 4 096 cells have been evaluated since the previous poll (a long chain evaluated on demand from one entry is not interrupted); cells not yet evaluated stay dirty.- The body runs inside
engine.transaction(label), which groups its edits into one undo step. - If
engine.changeCountmoved, an undo action is registered with the document'sUndoManager(the session is given the document's undo manager inWorkbookDocument.adoptandmakeWindowControllers). Registering the undo is what marks theNSDocumentas edited. runCalc()recalculates: inline whenengine.pendingCount <= syncCalcThreshold(the main thread waits for the deep-stack thread), otherwise on the calculation queue with a throttled progress reporter; on completion the main actor stores the statistics and invalidates views.invalidate(content: true)bumpsrevisionandcontentRevisionand calls the listeners (the grid registers one inGridView.init).
WorkbookSession.onChange ("called after every committed change") is invoked by the session and by
several features after changes that do not go through the engine's undo (for example saving a
Python script, a transform pipeline, a figure setting or scenario data into workbook attachments).
WorkbookDocument.adopt assigns it (session.onChange = { updateChangeCount(.changeDone) }), so such a
change marks the document edited even though it registers no undo action. For undoable transactions the
session does not call onChange when an undo manager is attached: the registered undo marks the
document.
What is deliberately not done: formulas are not evaluated on several threads, and there is no iterative calculation. See calculation-graph.md.
4. Document flow
flowchart TD
Open["Open a file"] --> Detect["FileFormat.detect(url)"]
Detect --> Load["WorkbookReader.load"]
Load --> Native{"Format is .orixsheet?"}
Native -->|yes| Trust["Adopt workbook<br/>cached values trusted"]
Native -->|no| Import["Adopt workbook, recalculate all<br/>document becomes untitled"]
Import --> Report["Import report<br/>issues, macros, external links"]
Trust --> Session["WorkbookSession + window"]
Report --> Session
Session --> Save["Save / autosave<br/>.orixsheet only"]
Session --> Export["File - Export To<br/>preflight report, then write"]
Session --> Print["Print / Export PDF<br/>PrintRenderer"]
SVG fallback:
- Reading.
WorkbookDocument.read(from:ofType:)detects the format from the file (FileFormat.detect) and falls back to the declared type, loads throughWorkbookReader.load, and refuses a file without any sheet. A native file is adopted withtrustCachedValues: true(stored values are shown without recalculating). Any other format is recalculated in full and remembered asimportedFrom. - Import as untitled. When the window is created for an imported file, the document clears its
fileURL, sets its type to the native type and keeps the source's base name as display name. Saving then asks for a location and writes an.orixsheet; the source file is never overwritten.writableTypes(for:)returns the native type only. - Import report. If the reader reported issues, or the file has macros or external links, the compatibility report is shown 0.4 s after the window appears. Macros are never run; external links are never fetched (see ../security.md).
- Saving.
autosavesInPlaceistrue.write(to:ofType:)stamps the modification date and application version, takes the engine lock and callsWorkbookWriter.save. The parts preserved from an imported XLSX (PreservedParts) are passed along so that an export back to XLSX/XLSM can re-emit them. - Export.
export(as:)commits any in-progress edit, runsWorkbookWriter.preflight, shows the report with an "Export Anyway" confirmation when the format cannot hold everything, then writes under the engine lock. The open workbook is not modified by an export. - Printing and PDF. Both go through
SheetUI'sPrintRenderer/SheetPrintView(grid-engine.md). - Closing.
close()runsFeatures.closeHandlers(the data feature closes its DuckDB workspace for the session).
Details, including the package layout and integrity checks: persistence.md and ../compatibility/formats.md.
5. Extension points
Features never subclass or patch the UI kit. They register values in the process-wide
Workspace.shared (SheetUI/Session/Providers.swift, main-actor isolated) at launch.
| Extension point | Type | Used for | Registered by (in the shipped feature list) |
|---|---|---|---|
| Panes | WorkspacePane with placement .inspector, .bottom, .sidebar or .studio |
A panel built from a WorkbookSession. A studio replaces the grid area until "Back to Sheet". Sorted by (order, id). |
Every feature |
| Actions | WorkspaceAction in group Insert, Data, Analyze or Tools, optional ⌘-shortcut |
Commands shown in the toolbar menus and the menu bar (performWorkspaceAction). A requested shortcut already claimed by an earlier action is dropped (MainMenu.workspaceItems), so the menu bar never has a duplicate key equivalent |
Every feature |
| Object renderers | ObjectRenderer per SheetObject.kind: draw(object, session, CGContext, rect, dark) and open(object, session) |
Embedded objects drawn inside the grid and in print output | FeatureCharts (chart objects) |
| Session observers | sessionObservers: [(WorkbookSession) -> Void], called at the end of WorkbookSession.init |
Attaching per-workbook state | App/Sources/Features.swift appends ChartsFeature.attach(to:) |
| Display provider | CellDisplayProvider |
Value → display text and colour. The default and the app both use FormatDisplayProvider (SheetFormat). |
AppDelegate |
| Effects provider | CellEffectsProvider |
Conditional-format results per visible range, called on the main thread before drawing | FeatureAudit (ConditionalEffectsAdapter) |
| Input validator | InputValidator |
Data validation on commit, drop-down items | FeatureAudit (ValidationAdapter) |
| Formula assist | closure (text, cursor, session) -> FormulaAssist? |
Completion candidates and signature hints in the formula editor | FeatureAudit (AssistAdapter) |
| Format tools | NumberFormatTools |
Toolbar buttons (decimals, currency, percent, thousands) and the format catalogue | Default value built on SheetFormat |
| Structural observers | CalcEngine.structuralObservers[key]: (RefTransform, Workbook) -> Void |
Remapping references kept in object payloads when rows, columns or sheets move; runs under the engine lock, inside the undo snapshot | FeatureCharts (ChartStructure) |
| Session listeners | WorkbookSession.addListener |
Redraw notifications after invalidate |
GridView, features |
| Function registry | FunctionRegistry.standard |
Worksheet functions | The three function libraries through ORIXEngine.bootstrap() |
Source: Packages/SheetUI/Sources/SheetUI/Session/Providers.swift,
Packages/SheetCore/Sources/SheetCore/Engine/CalcEngine.swift, and a search for
Workspace.shared. assignments and register( calls across Packages/*/Sources and App/Sources.
Feature state that must travel with the file is stored in the workbook itself
(Workbook.attachments, SheetObject payloads, sheet metadata) so that the native format
persists it without SheetIO knowing the feature.
6. What runs where
| Work | Process | Thread or queue |
|---|---|---|
| Editing, selection, undo, drawing the grid | App | Main actor |
Recalculation of at most syncCalcThreshold pending formulas |
App | Deep-stack thread, main thread waiting |
| Larger recalculations | App | Calculation queue → deep-stack thread, cancellable, with progress |
| Conditional formats, validation, formula explanation | App | Deep-stack thread, caller waiting |
| Reading and writing files | App | Main actor (canConcurrentlyReadDocuments is false) |
| Dataset queries, imports into DuckDB, paging | App (DuckDB is linked in-process) | Data work and page queues |
| Chart layout and rasterization for the grid cache | App | Concurrent chart render queue |
| Statistical and financial tools, scenarios | App | Detached tasks |
| Python scripts | Separate interpreter process started with posix_spawn, optionally under sandbox-exec |
Reader threads in the app |
| Python syntax check of AI suggestions | Separate python3 -I -c … process (compile only) |
— |
| On-device language model | The system's Foundation Models service, through the Intelligence actor |
— |
| Workflows run from the Automation studio | App | The WorkflowEngine actor; SQL on the DuckDB queues, a Python step in a separate sandboxed interpreter process |
| Scheduled workflows, command-line use | orix-sheet (embedded at Contents/MacOS/orix-sheet), started by the user or by a per-user LaunchAgent the user installed |
— |
| App Intents (Shortcuts) | The app process, without UI (openAppWhenRun is false) |
— |
Source: sections 3 and 5, python-runtime.md, data-engine.md, chart-engine.md, intelligence.md.
7. Templates and automation
Three packages complete the application. All three are referenced by project.yml, registered in
Features.registerAll() and covered by Scripts/test-all.sh (29, 78 and 28 test functions in
docs/reports/tests.json).
SheetTemplates— workbook templates built in code through a small DSL (DSL/Book.swift,Pad.swift,Styles.swift). Fifteen templates underSources/SheetTemplates/Templates/: BusinessBudget, CashFlowForecast, DCFValuation, Dashboard, FinancialStatements, Gradebook, Inventory, InvestmentAnalysis, Mortgage, PersonalBudget, ProjectPlan, RegressionReport, ResearchDataset, SalesTracking, StatisticalAnalysis. The app shows them in the template chooser (Welcome.provider) at launch and from File ▸ New from Template…;-ORIXTemplate <id>opens one directly. Details and verification: ../templates.md.SheetAutomation— a workflow model serialized as JSON (.orixflow, schema 1) with 25 step kinds, a static validator, theWorkflowEngineactor with staged outputs, a workflow store, a run history and a trust store, and theorix-sheetcommand-line tool (ten commands). Details: automation.md.FeatureAutomation— the Automation studio pane (registered as a.studiopane and a Tools action inAutomationFeature.register(); the action asks for ⌥⌘A, which Audit Workbook already holds, so its menu item has no shortcut), LaunchAgent scheduling (Schedule.swift) and four App Intents (Convert Spreadsheet, Recalculate Workbook, Run ORIX Workflow, Get Cell Value).