repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

docs(system): naming, versioning, deprecation, system plugin trust laws

b507c00dda514f18f1720c59c093a6950eb94dd2

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

+20 / −0 text lines

Diff layout

.system/research/SMH-RESEARCH-TBKDJHVX-plugin-api-standard-library-lessons/index.md

Modified

+4 / −0 text lines

18518511. Interfaces are the ecosystem unit: contracts publish, implementations swap, binding is explicit (OCaml, Java Collections).
18618612. Mechanisms, not policies: no world interface encodes a workflow (Lua).
18718713. World-first: the WIT world is the only API; no smith-authored SDK ships before 1.0, and an SDK stays optional forever — comfort through raw bindgen is a design requirement.
18814. One world major for the host API (`smith:plugin@N`); plugin-published contracts carry their own majors; versioning every interface separately recreates classpath chaos for no benefit.
18915. Deprecation is metadata with a named replacement and a removal major; enforcement is mechanical at `smith plugin check`, never a breaking change by itself.
19016. Flat interfaces inside one world; the fixed `namespace:package/interface` hierarchy is all the structure a world needs.
19117. Trust flows through the distribution channel — embedded and release-signed, or installed and hash-recorded — never through runtime privilege.
189193## Sources

.system/specs/SMH-SPEC-PLUG0001-plugin-system/index.md

Modified

+16 / −0 text lines

124124Trust does not remove the plugin sandbox or tool boundaries.
126## System plugins
128System plugins ship inside the smith release artifact, hash-pinned at build time; their trust is the release signature, transitively.
129They get no runtime privilege: same sandbox, loader, fuel, and grant model as user plugins.
130The `smith:` package prefix is reserved; external artifacts exporting `smith:` contracts fail validation with a concrete fix.
131Product default grants — for example net-scope for the OAuth plugin — are configuration shipped by the product, not runtime privilege.
133Trust tiers: embedded (signed with the release), installed user (hash recorded at install, grants at install), project (trust-gated before enumeration, grants at trust time).
126135## World surface
128137The `smith:plugin` world is the entire plugin API.
131140Design laws:
133142- Two layers: a core world every plugin sees, plus granted capability interfaces — HTTP via net-scope, credential exchange via secret-proxy, logging — imported only with matching grants.
143- Flat interface set inside one world: `http`, `secrets`, `log`, `stream`, `contrib`; resources carry methods, no prefix hierarchies. Grouping pressure means an interface is too wide.
144- One world major: `smith:plugin@N`; breaking changes bump the world, additive changes stay inside it. Plugin-published contracts carry their own majors (`owner:name@major`). The host embeds the previous world during a deprecation window.
145- Deprecations are metadata: `@deprecated` with since and removal versions plus a named replacement; deprecated items stay functional until the next world major; `smith plugin check` fails new builds targeting them.
146- Append-only inside a major: add functions, never edit signatures or records; supersede with a new function and a deprecation marker.
134147- One naming grammar, one error grammar, one documentation shape across all interfaces.
148- Names follow verb-noun functions, noun types, no abbreviations; symmetric verb pairs; `open` for acquired handles, `create` for pure values; faults are nouns.
149- Parameter order is data first, options record last.
150- One world-wide glossary distinguishes near-synonyms: secret, credential, chunk, frame, provider, effect.
135151- One-purpose interfaces; an interface needs two real consumers before entering the world.
136152- Explicit parameters: buffers, bounds, cancellation, and provenance are arguments, never ambient state.
137153- Precise failure sets: typed result variants per operation family; no single generic error case.