How poggit-alternative-test/plugin-repository works
Purpose and execution model
Axolotl is a GitHub-native trusted distribution pipeline for PocketMine-MP plugins. It turns an untrusted upstream repository commit into a reviewed, preserved source snapshot, an unprivileged PHAR build, and an immutable GitHub Release. The repository is primarily TypeScript CLI tooling and GitHub Actions rather than a web application.
Primary entry points are command-specific CLIs under src/cli/, invoked by workflows such as .github/workflows/validate-submission.yml, .github/workflows/materialize-storage.yml, .github/workflows/build-trusted.yml, and .github/workflows/publish-release.yml.
Registry: declarative source of truth
The registry records plugin identity and version-specific source/release metadata in a filesystem layout rooted at registry/plugins/. Parsing, schema validation, semantic validation, and writing are separated in:
• src/registry/parser.ts
• src/registry/validator.ts
• src/registry/writer.ts
JSON Schemas define the external registry/submission contracts in schemas/plugin.schema.json, schemas/version.schema.json, and schemas/plugin-submission.schema.json. Registry changes are expected to arrive through PRs and be validated before review or downstream processing.
Submission acquisition and inspection boundary
Submission code treats developer repositories as untrusted input. It acquires candidate metadata/source references, parses plugin manifests, composes results, and emits inspection signals/diagnostics:
• src/submission/acquisition.ts
• src/submission/inspection.ts
• src/submission/github.ts
The src/cli/inspect-submission.ts entry point operationalizes this stage. Submission validation is deliberately distinct from approval: automated checks can establish readiness but cannot authorize publication.
Human review and approval state
Review is a separate domain that binds approval to a candidate’s exact identity/SHA and checks reviewer authorization and approval preconditions:
• src/review/candidate-identity.ts
• src/review/approval-preconditions.ts
• src/review/review-state.ts
Review records and persistence abstractions live in src/review/review-record.ts and src/review/review-storage.ts; reviewer policy/configuration is anchored by config/reviewers.yaml. The key trust transition is from validated candidate to approved exact source revision, not from successful CI to trusted artifact.
Storage materialization
After approval, materialization copies or preserves the reviewed source into the dedicated plugin-storage organization/repository namespace. This domain isolates GitHub authentication and API interaction behind client abstractions:
• src/materialization/materialization-service.ts
• src/materialization/github-client.ts
• src/materialization/real-github-client.ts
Repository naming and transport configuration are explicit in src/materialization/repository-naming.ts and src/materialization/tester-transport-config.ts. GitHub App authentication is implemented in src/materialization/github-app-auth.ts, making GitHub the materialization infrastructure boundary.
Trusted build domain
The build stage runs only against materialized source and produces PHAR artifacts, SHA-256/provenance-related diagnostics, without publication credentials. Its orchestration adapters are:
• src/build/index.ts
• src/build/pharynx-runner.ts
• src/build/composer-runner.ts
The isolated builder package under tools/builder/src/ supplies build-oriented filesystem, manifest validation, and security-scanning capabilities. src/cli/build-trusted.ts is the build entry point; .github/workflows/build-trusted.yml supplies its CI execution boundary.
Privileged publication domain
Publication consumes completed build outputs and publishes releases through a provider abstraction, intentionally without executing plugin code:
• src/publication/publication-service.ts
• src/publication/provider.ts
• src/publication/github-provider.ts
src/cli/publish.ts and .github/workflows/publish-release.yml drive this privileged stage. src/publication/fake-provider.ts supports provider substitution, while the GitHub provider represents the immutable-release external service boundary.
End-to-end control flow and trust separation
The lifecycle is: submission/registry PR → validation → human approval of exact SHA → GitHub storage materialization → unprivileged build → privileged GitHub Release publication. CLI layers coordinate each domain, while src/registry, src/submission, src/review, src/materialization, src/build, and src/publication preserve the major security boundaries. GitHub PRs, Actions, GitHub App/API access, storage repositories, and Releases are the material infrastructure; no custom persistent backend is indicated.
Main entry points: index.ts Trusted build · validator.ts Registry parser & validator · inspection.ts Submission inspection · review-state.ts Approval state
Components 21
Intake & Review
Untrusted submission validation and human approval.
- Plugin registry · Versioned plugin source and release metadata.
- Registry schemas · External registry and submission contracts.
schemas/plugin.schema.json - Registry parser & validator · Parses, semantically validates, and writes registry records.
src/registry/validator.ts - Submission inspection · Acquires candidate references, manifests, and diagnostics.
src/submission/inspection.ts - Inspect submission CLI
src/cli/inspect-submission.ts - Approval state · Binds approval to the exact candidate identity and SHA.
src/review/review-state.ts - Reviewer policy
config/reviewers.yaml
Trusted Supply Chain
Materialize, build, and publish after approval.
- Materialization service · Preserves approved source in dedicated storage repositories.
src/materialization/materialization-service.ts - Trusted build · Builds PHARs and emits SHA-256 and provenance diagnostics without publication credentials.
src/build/index.ts - Isolated builder · Filesystem, manifest validation, and security-scanning capabilities.
- Build trusted CLI
src/cli/build-trusted.ts - Publication service · Publishes completed outputs without executing plugin code.
src/publication/publication-service.ts - Publish CLI
src/cli/publish.ts
GitHub Infrastructure
PR, Actions, API, storage, and release boundaries.
- Validate submission
.github/workflows/validate-submission.yml - Registry PR · Submission and registry changes enter through reviewable PRs.
- Materialize storage
.github/workflows/materialize-storage.yml - GitHub App & API · Authenticated repository materialization access.
src/materialization/github-app-auth.ts - Plugin storage repos · Dedicated namespace containing reviewed source snapshots.
- Build trusted
.github/workflows/build-trusted.yml - Publish release
.github/workflows/publish-release.yml - Immutable GitHub Releases
src/publication/github-provider.ts
Connections 20
- Registry PR → Plugin registry: changes
- Registry schemas → Registry parser & validator: contracts
- Plugin registry → Registry parser & validator: read and validate
- Validate submission → Inspect submission CLI: runs
- Inspect submission CLI → Submission inspection: inspects
- Registry parser & validator → Submission inspection: metadata context
- Submission inspection → Approval state: validated candidate
- Reviewer policy → Approval state: authorizes reviewers
- Approval state → Materialize storage: approved exact SHA
- Materialize storage → Materialization service: runs
- Materialization service → GitHub App & API: uses authenticated API
- GitHub App & API → Plugin storage repos: preserves source
- Plugin storage repos → Build trusted: materialized source
- Build trusted → Build trusted CLI: runs
- Build trusted CLI → Trusted build: orchestrates
- Trusted build → Isolated builder: uses isolated capabilities
- Trusted build → Publish release: completed artifacts
- Publish release → Publish CLI: runs
- Publish CLI → Publication service: orchestrates
- Publication service → Immutable GitHub Releases: publishes immutable release