This package follows the Scolta versioning policy. Major versions are synchronized across all Scolta packages; minor and patch versions are released independently per package. Adapters pin scolta-php via composer.lock within their ^1.x constraint. Violations of the major-version rule are blocking errors.
- MUST add
@sinceand@stabilityPHPDoc annotations. - New methods MUST start as
@stability experimentalunless explicitly promoted. - If the method wraps a WASM function, the WASM function must exist in scolta-core.
- NEVER change the signature of a
@stability stablemethod within a major version. - If behavior must change: deprecate the old method, add a new one.
- MUST add
@deprecated X.Y.Z Use newMethod() instead. Removal: NEXT_MAJOR.0.0. - MUST change
@stabilitytodeprecated. - MUST call
trigger_deprecation('tag1/scolta-php', 'X.Y.Z', '...')in the method body (or PHP'strigger_error()withE_USER_DEPRECATED). - Deprecation warnings MUST tell the user what to use instead and when it will be removed.
- NEVER remove a
@stability stablemethod without a deprecation phase. - Removal MUST only happen in a major version bump.
- The
scolta.wasmbinary is a browser-side asset compiled viawasm-pack --target web. - Platform adapters (scolta-wp, scolta-drupal, scolta-laravel) ship the WASM binary as a static file.
- WASM runs in the browser — no server-side PHP extension (FFI, Extism, etc.) is involved.
composer.jsonMUST use caret constraints for scolta-php dependencies from platform adapters:"tag1/scolta-php": "^X.Y".- For development with path repos, use
@dev.
The version field in composer.json is always either a tagged release (0.2.0) or a dev pre-release (0.3.0-dev). See scolta-core/VERSIONING.md for the full workflow. In Composer, -dev maps to a stability level that prevents accidental installation in production without an explicit @dev flag or minimum-stability: dev.
When committing code:
- If the current version already has
-dev, do not change it. Multiple commits accumulate on the same-devversion. - If the current version is a bare release and you are making the first change after that release, bump to the next target with
-devincomposer.json.- Bug fix only →
0.1.1-dev - New feature or deprecation →
0.2.0-dev - Breaking change →
1.0.0-dev(coordinated across all packages)
- Bug fix only →
WARNING: Never commit a bare version bump without tagging it as a release.
- Run:
./vendor/bin/phpunit - Tests run with
./vendor/bin/phpunit. All tests should pass in CI without any native runtime. - All new public methods MUST have unit tests.
- The scoring engine (scolta-core) runs as browser-side WASM via wasm-bindgen. PHP does not invoke WASM directly.
- PHP classes are thin wrappers — don't reimplement algorithms that belong in scolta-core.
- DTOs (ContentItem, AiResponse, TrackerRecord) are immutable readonly classes.
assets/js/scolta.js in this repo is the single canonical source for the browser-side JavaScript. scolta-drupal and scolta-wp commit copies (for non-Composer installation paths), but those copies MUST be byte-identical to this file.
- Never edit scolta.js in scolta-drupal or scolta-wp directly. All changes go here first, then copies are updated.
assets/js/scolta.js.sha256contains the checksum of the canonical file (a bare hash that scolta-laravel reads at runtime). It is derived fromassets/ASSETS.sha256, not hashed independently — regenerate both whenever scolta.js changes withcomposer update-js-checksum(which refreshes the manifest, then extracts the scolta.js line into the standalone file). Never re-hash scolta.js into that file by hand; the manifest is the single source of every asset SHA-256.- After updating scolta.js, copy it to
packages/scolta-drupal/js/scolta.jsandpackages/scolta-wp/assets/js/scolta.js, then open PRs in those repos. - Drupal and WP CI will fail if their copy doesn't match the checksum from scolta-php.
Documentation follows code. When a PR changes behavior, the same PR must update the relevant docs.
- CHANGELOG.md: Every PR that changes code (not docs-only) MUST add an entry under
## [Unreleased]. CI enforces this. - README.md: Update if the change affects installation, usage examples, or the module structure.
- docs/CONFIG_REFERENCE.md: MUST be updated when any
ScoltaConfigproperty is added, removed, renamed, or has its default changed. CI checks freshness. - UPGRADE.md: MUST be updated when introducing breaking changes or deprecations.
- PHPDoc: All public methods MUST have complete PHPDoc including
@sinceand@stability.