Skip to content

softschema 0.1.4

Choose a tag to compare

@jlevy jlevy released this 11 Jun 10:17
· 21 commits to main since this release
edbd902

Synchronized patch release of the Python (PyPI) and TypeScript (npm) packages following a full engineering review and four-phase remediation. Both packages release together at exact behavioral parity, now proven under Node (the published npm runtime) as well as Bun.

Behavior changes

  • status: enforced now has teeth. When the effective status is enforced, structural validation treats object schemas that declare properties but omit additionalProperties as closed (additionalProperties: false); an explicit additionalProperties always wins, and soft/permissive behavior is unchanged. The overlay is validation-time only; compiled sidecars never change.
  • Unknown keys in the softschema: block are rejected (per the spec), and a contract ID must be a non-empty string.
  • validate works without --model/--schema as a metadata-only check (frontmatter parses, the softschema: block is well-formed, the envelope resolves), making the CLI useful from the soft stage.
  • Library envelope inference now follows the spec: a contract with no envelope_key infers the single non-softschema top-level key, and rejects zero-key (envelope_missing) or multi-key (envelope_ambiguous) documents instead of merging them.
  • Pure-yaml artifacts recognize a root softschema: block as metadata (never payload); an explicit envelope key nests the payload, otherwise the remaining root is the payload.
  • The maintainer-internal agents and publishing docs topics were removed from softschema docs and the package bundles.

Fixes and hardening

  • Clean CLI error handling everywhere: missing files, malformed frontmatter/metadata, and bad --model specs exit 2 with a one-line message (no tracebacks); generate runtime errors exit 2 with exit 1 reserved for drift; identical exit codes across both CLIs.
  • TypeScript CLI: agent --help epilog (npx bootstrap now works), --version, EPIPE/SIGINT handling, no stdout truncation on exit, cached Ajv validators, ./cli export, public readFrontmatter.
  • Python CLI: --version, atomic skill installs, git-root-aware skill --install; the wheel now ships the typescript-design doc topic.
  • Cross-language parity hardening: Python-style number rendering in TS error messages, byte-identical frontmatter edge-case handling (empty/whitespace/unterminated), x-softschema merge semantics, and validate reads the document once.
  • Skill: allowed-tools frontmatter, format=f01 stamp on installed mirrors, runner-selection ladder and doctor command.

Testing and release safety

  • The golden corpus now covers the whole CLI surface and runs under Python 3.11-3.14, Node, and Bun, with a direct Python-vs-TypeScript byte-comparison job in CI.
  • publint gates the npm package layout in CI and the publish workflow.

Full details in the repository's review and plan documents under docs/project/.