Contributing
Repositories
| Repo | Scope |
|---|---|
| counterparty-core | domain, registries, risk engine, adapters, contract tests |
| counterparty-ai | AI risk research |
| counterparty-laravel | Laravel bridge |
| counterparty-bundle | Symfony bundle |
Each is a standalone Composer package with its own tests and CI.
Local setup
git clone https://github.com/igorgawrys1/counterparty-core
cd counterparty-core
composer install
composer check # php-cs-fixer + PHPStan max + Psalm level 1 + PHPUnit
composer cs:fix # apply the coding standard
The ai, laravel and bundle packages depend on core (and bundle/laravel on ai).
All are on Packagist, so composer install resolves them normally. To develop against a local
checkout of core, add a path repository to the dependent’s composer.json:
"repositories": [{ "type": "path", "url": "../counterparty-core" }]
Ground rules
- Keep
composer checkgreen. PHPStan at level max (larastan / phpstan-symfony on the bridges), Psalm at error level 1. - Never weaken a static-analysis baseline to make an error pass - fix the code.
- Add tests. Domain logic is unit-tested; external APIs are mocked (no live network).
New registry drivers must pass
RegistryDriverContractTestCase. - English for code, comments, docblocks and commit messages; conventional commits.
- Target PHP 8.2+, strict types everywhere.
- The AI subsystem stays advisory: every claim grounded in a tool source; bump
RiskPromptBuilder::VERSIONwhen prompts change.
Releasing (maintainers)
Each package repo carries a Release GitHub Actions workflow (.github/workflows/release.yml)
that fires on a v* tag. Publishing a version is therefore just:
- Add a
## [0.1.x]section to that package’sCHANGELOG.md. - Tag and push:
git tag v0.1.x && git push --tags.
The workflow then, automatically:
- creates a GitHub Release whose notes are the matching
CHANGELOG.mdsection, and - calls the Packagist update API so the new version is indexed immediately.
Deploys are authenticated with two repo secrets, PACKAGIST_USERNAME and PACKAGIST_TOKEN
(a Packagist API token). Rotate the token in the Packagist profile and re-set the secret with
gh secret set PACKAGIST_TOKEN --repo <owner>/<package> if it ever leaks.
Keep the ^0.1 constraints aligned across the dependent packages when they move together.
Historical: before publication the dependent repos resolved
core/aifrom private GitHub repos viarepositories: { type: vcs }and a CICOMPOSER_AUTHsecret. Both were removed once the packages went public on Packagist.
Security
Report vulnerabilities privately (see each repo’s SECURITY.md) - do not open public issues
for security problems. Never commit secrets; .env is git-ignored.