Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ jobs:
- run: cargo check --locked -p octoscript-sandbox --tests --target aarch64-unknown-linux-gnu
- run: cargo check --locked -p octoscript-sandbox --tests --target riscv64gc-unknown-linux-gnu
- run: cargo check --locked -p octoscript-sandbox --tests --target x86_64-pc-windows-gnu
- run: cargo test --manifest-path vendor/makepad/Cargo.toml -p makepad-script
- run: cargo test --manifest-path vendor/makepad/Cargo.toml -p makepad-regex
# The VM is a pinned git dependency (OctoSense-org/makepad, branch octoscript);
# -p resolves it from Cargo.lock so no separate checkout or second pin is needed.
- run: cargo test -p makepad-script
- run: cargo test -p makepad-regex
# The project-quota positive-path test requires an explicitly provisioned host fixture.
- run: >
sudo -E env RUSTUP_HOME="$HOME/.rustup"
Expand Down Expand Up @@ -193,5 +195,5 @@ jobs:
- run: cargo +nightly miri setup
- name: Check re-entrant VM body reload under Miri
run: >
cargo +nightly miri test --manifest-path vendor/makepad/Cargo.toml -p makepad-script
cargo +nightly miri test -p makepad-script
reentrant_reload_of_the_active_body_does_not_keep_an_opcode_pointer
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/target/
vendor/makepad/target/
/fuzz/artifacts/
/fuzz/corpus/*
!/fuzz/corpus/syntax/
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Contributing

Octoscript accepts changes to the language core, capability host, workflow engine,
or compatibility import only when the security boundary remains explicit.
Octoscript accepts changes to the language core, capability host, or workflow
engine only when the security boundary remains explicit.

- Do not register filesystem, subprocess, raw socket, or HTTP server modules
in `octoscript-core`.
- Add effects as reviewed tool adapters in `octoscript-capabilities` with limits,
audit coverage, and a documented containment strategy.
- Preserve Makepad provenance. Changes below `vendor/makepad/` need an entry
in `vendor/makepad/PATCHES.md` and an upstream-sync note.
- Do not patch the VM here. `makepad-script` is a pinned git dependency on the
`octoscript` branch of `OctoSense-org/makepad`; VM changes land there first
and reach this repository through a rev bump (see `UPSTREAM.md`).
- Keep new language behavior in an executable fixture or regression test.

Before opening a change, run the checks in `docs/development.md`.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ default-members = [
"crates/octoscript-cli",
"crates/octoscript-lsp",
]
exclude = ["vendor/makepad"]
resolver = "2"

[workspace.package]
Expand Down
15 changes: 9 additions & 6 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Octoscript contains a vendored compatibility core derived from Makepad.
Octoscript ships a compatibility core derived from Makepad. It is consumed as
the `makepad-script` git dependency pinned in `crates/octoscript-core/Cargo.toml`
and `crates/octoscript-capabilities/Cargo.toml`, taken from the `octoscript`
branch of https://github.com/OctoSense-org/makepad.

Upstream project: https://github.com/makepad/makepad
Upstream revision: 4f9ce7a8bb3fd19e5c61dcf13edd2e6d4a04cefc
Imported paths: platform/script and the required leaf dependencies under libs/.
Original import revision: 4f9ce7a8bb3fd19e5c61dcf13edd2e6d4a04cefc
Shipped paths: platform/script and the leaf dependencies it pulls under libs/.
Copyright (c) 2023 Makepad B.V.
License: MIT (see LICENSE). Individual imported crates may additionally be
licensed under Apache-2.0 as declared in their manifests.

The vendored copy of smallvec is Copyright (c) The Servo Project Developers
and is dual licensed under MIT OR Apache-2.0. Its license texts are retained
under vendor/makepad/libs/smallvec/.
The copy of smallvec carried by that dependency is Copyright (c) The Servo
Project Developers and is dual licensed under MIT OR Apache-2.0. Its license
texts are retained under libs/smallvec/ in the dependency's source tree.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ and keeps UI support optional rather than making UI the language boundary.

## Current baseline

- A standalone, vendored VM and parser with upstream provenance.
- A standalone VM and parser with upstream provenance, consumed as a pinned
git dependency on the `octoscript` branch of `OctoSense-org/makepad`.
- An effect-free, bounded canonical-language preflight with structured
diagnostics for generated source and editor tooling, plus token-aware
lowering of canonical newline statement boundaries for the inherited VM.
Expand Down Expand Up @@ -235,7 +236,7 @@ and keeps UI support optional rather than making UI the language boundary.
- A small `octoscript` CLI for local evaluation and the workflow example.

No ambient filesystem, subprocess, raw socket, HTTP client/server, or Makepad
platform/debug module is source-reachable by default. The vendored VM bootstrap
platform/debug module is source-reachable by default. The inherited VM bootstrap
retains compatibility objects internally, but `Runtime` masks their source
entry points before either canonical or compatibility evaluation. The optional
fixed-file and fixed-endpoint catalogs are explicit, bounded tools rather than
Expand Down Expand Up @@ -757,10 +758,11 @@ both keys with JSON `null`. See [editor workflow-data projection](docs/workflow-
declaration symbols, and bounded same-document lexical navigation, hover, and
highlights plus lexical completion and version-bound guarded rename for open
editor documents.
- `vendor/makepad`: provenance-preserving compatibility import.
- `makepad-script` (git dependency, `OctoSense-org/makepad` branch
`octoscript`): the inherited VM and parser; see `UPSTREAM.md`.

See [SECURITY.md](SECURITY.md) for the current threat model and [UPSTREAM.md](UPSTREAM.md)
for the import boundary. The [worker protocol](docs/worker-protocol.md)
for the dependency boundary. The [worker protocol](docs/worker-protocol.md)
defines the handoff to contained adapters. The [host tool catalog](docs/tool-catalog.md)
defines safe discovery for an LLM orchestrator. [JSON tool contracts](docs/schema-contracts.md)
define the executable structured-data boundary. [External tools](docs/external-tools.md)
Expand Down
67 changes: 48 additions & 19 deletions UPSTREAM.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
# Upstream Policy

`vendor/makepad/` is a compatibility import from Makepad, not an ambient
runtime dependency. The initial import is pinned to:
Octoscript does not carry its own copy of the Makepad VM. The language VM,
parser, derive crate, and their leaf dependencies come from the `octoscript`
branch of the OctoSense fork of Makepad, consumed as a pinned git dependency:

```text
makepad/makepad dev
4f9ce7a8bb3fd19e5c61dcf13edd2e6d4a04cefc
```toml
makepad-script = { git = "https://github.com/OctoSense-org/makepad.git", rev = "1fdce273bf888239079754a1834734635eaed34f" }
```

Only the language VM, parser, derive crate, and their direct leaf
dependencies are imported. Makepad widgets, platform scripting, filesystem,
process, timer, and network modules are intentionally excluded.
The pin appears in exactly two manifests, `crates/octoscript-core/Cargo.toml`
and `crates/octoscript-capabilities/Cargo.toml`, and must be the same rev in
both. `fuzz/Cargo.toml` reaches the VM only through path dependencies on those
crates and carries no pin of its own; if it ever depends on `makepad-script`
directly it must use the same rev. `Cargo.lock` records the resolved checkout.

The vendor tree is intentionally excluded from the Octoscript Cargo workspace.
It remains a path dependency of `octoscript-core`, but its upstream lint backlog
does not dilute the lint gate for Octoscript-owned crates. Run its test suite
explicitly with `cargo test --manifest-path vendor/makepad/Cargo.toml -p makepad-script`.
The `octoscript` branch descends from `makepad/makepad dev` (the original
import point was `4f9ce7a8bb3fd19e5c61dcf13edd2e6d4a04cefc`). Octoscript's VM
hardening, which this repository previously carried as local vendor patches,
was ported to that branch on 2026-09-13 in fork PR #1 and now lives there.
`docs/vm-hardening-history.md` keeps the description of those changes as a
history note. This repository no longer carries local patches to the VM: a VM
change is made as a pull request against the fork's `octoscript` branch, then
reaches Octoscript through a rev bump.

Upstream changes are reviewed and imported as explicit commits. New host
capabilities belong in `crates/octoscript-capabilities`, never in the vendored VM.
Only the VM, parser, derive crate, and their direct leaf dependencies are used.
Makepad widgets, platform scripting, filesystem, process, timer, and network
modules are not depended on. New host capabilities belong in
`crates/octoscript-capabilities`, never in the VM. A behavioral change to the
VM is allowed only when it implements a published Octoscript language
contract, carries focused compatibility and streaming regressions, and does
not add ambient host authority to the VM.

Every local vendor patch is documented in `vendor/makepad/PATCHES.md` and must
be reapplied or retired during each upstream update. Behavioral changes are
allowed only when they implement a published Octoscript language contract, carry
focused compatibility and streaming regressions, and do not add ambient host
authority to the VM.
The VM is not a workspace member, so its upstream lint backlog does not dilute
the lint gate for Octoscript-owned crates. Its test suite is still run
explicitly, resolved from the pinned checkout:

```sh
cargo test -p makepad-script
cargo test -p makepad-regex
```

## Bumping the pin

1. Land the change on the fork's `octoscript` branch first.
2. Move `rev` to the new commit in both manifests and run
`cargo update -p makepad-script` so `Cargo.lock` follows.
3. Run the Octoscript regression suite and the explicit `makepad-script` and
`makepad-regex` tests above, especially streaming precedence and
`try/catch` recovery.
4. Bump OctoSense and Octoscript-Makepad to the same rev in the same change
window. The three consumers are expected to track one commit of the
`octoscript` branch; a lone bump here is a divergence, not a release.

Syncing the fork with `makepad/makepad` upstream happens on the fork, not
here; Octoscript sees the result as an ordinary rev bump.
18 changes: 10 additions & 8 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ The test only reads and validates quota state; it never enables, changes, or
disables quota enforcement. It must fail rather than be skipped when that
explicit host-provisioned fixture is invalid.

The Makepad compatibility import is deliberately outside the workspace lint
scope. Verify it explicitly after an upstream import or vendor patch:
The Makepad VM is a pinned git dependency, not a workspace member, so it is
outside the workspace lint scope. Verify it explicitly after a rev bump; Cargo
resolves the packages from the pinned checkout:

```sh
cargo test --manifest-path vendor/makepad/Cargo.toml -p makepad-script
cargo test --manifest-path vendor/makepad/Cargo.toml -p makepad-regex
cargo test -p makepad-script
cargo test -p makepad-regex
```

This keeps failures in source owned by Octoscript actionable while preserving
separate behavioral coverage for the imported VM.
separate behavioral coverage for the inherited VM.

## Sustained fuzzing

Expand Down Expand Up @@ -86,8 +87,9 @@ RUSTFLAGS='--cfg fuzzing' cargo +nightly fuzz tmin --sanitizer none syntax artif
Then add a focused unit or integration regression and, when it improves the
campaign, a reviewed text, JSON, or `.seed` input under `fuzz/corpus`. Do not
commit raw generated corpus entries or `fuzz/artifacts`; they can include
unreviewed input and are intentionally ignored. Keep vendor parser fixes
documented in `vendor/makepad/PATCHES.md`.
unreviewed input and are intentionally ignored. Parser fixes belong in the
`octoscript` branch of `OctoSense-org/makepad` and reach this repository
through a rev bump (see `UPSTREAM.md`).

## Language server

Expand Down Expand Up @@ -366,7 +368,7 @@ Octoscript source cap.
## Syntax fuzzing

The standalone `fuzz` package has bounded targets. `syntax` differentially
exercises the canonical profile and the vendored VM parser under a rotating set
exercises the canonical profile and the inherited VM parser under a rotating set
of valid resource profiles, from 64 bytes, 8 tokens, and 2 nesting levels up
to a 16 KiB source cap, a 2,048-token cap, and a 64-level nesting cap. It also
sends every bounded UTF-8 input through the broader VM-compatibility preflight,
Expand Down
2 changes: 1 addition & 1 deletion docs/makepad-ui-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runtime. It does not execute through `octoscript-cli`, render widgets, install
`mod.prelude.widgets`, inject `ui`, or provide Makepad event-loop semantics.
Use it only with a Makepad UI host that supplies those bindings. The fixture
also is not an assertion of compatibility with every upstream Octoscript feature;
the vendored VM is intentionally smaller than a full Makepad checkout. In
the inherited VM is intentionally smaller than a full Makepad checkout. In
particular, the standalone compatibility check rejects Makepad `@(index)`
host-value tokens because it does not accept a host value table.

Expand Down
3 changes: 2 additions & 1 deletion docs/positioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ embedded by a trusted application. Upstream modules and host bindings can be
appropriate for a UI runtime, but they are not a stable capability boundary for
untrusted generated programs.

This repository vendors that substrate with provenance, then defines a
This repository consumes that substrate as a pinned git dependency of the
`octoscript` branch of `OctoSense-org/makepad`, then defines a
separate portable language contract and host model:

| Area | Makepad-oriented substrate | Octoscript runtime profile |
Expand Down
7 changes: 4 additions & 3 deletions docs/scoped-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ question of *who emits* the declaration. §5.10.1 adds an obligation this docume
carry: whoever owns the cells must be handed instance identity, because L0 rebuilds subtrees on
data changes and a cell that cannot be re-found is a cell that is lost.

`UPSTREAM.md` permits a behavioural change to the vendored VM "only when [it]
`UPSTREAM.md` permits a behavioural change to the inherited VM "only when [it]
implements a published Octoscript language contract". This is that contract. It is
deliberately narrow: it publishes the smallest state mechanism that lets an
interaction be handled locally, and defers everything that can be deferred.

**This contract has more than one implementer.** Octoscript's vendored VM
(`vendor/makepad/platform/script`, pinned to upstream `4f9ce7a8`) and the VM that
**This contract has more than one implementer.** Octoscript's VM
(`platform/script` on the `octoscript` branch of `OctoSense-org/makepad`, a
pinned git dependency of `octoscript-core`) and the VM that
ships on device in octos-one (`makepad/platform/script`) are independent
lineages — neither contains the other's history. That is a deliberate position,
not an accident awaiting a merge, and it has one consequence that governs
Expand Down
10 changes: 9 additions & 1 deletion vendor/makepad/PATCHES.md → docs/vm-hardening-history.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Local Vendor Patches
# VM hardening history

The changes described below were Octoscript's local patches to its formerly
vendored copy of the Makepad VM (`vendor/makepad/PATCHES.md`). They were ported
to the `octoscript` branch of OctoSense-org/makepad on 2026-09-13 (fork PR #1)
and no longer live in this repository; Octoscript consumes them through the
pinned `makepad-script` git dependency described in `UPSTREAM.md`. The text is
kept as written, as a record of what was changed and why. The upstream-sync
notes it contains refer to the old vendoring workflow and are historical.

## `platform/script`: language review fixes (#9–#18)

Expand Down
Loading
Loading