Add ASN.1 protocol schema (Tier A) with round-trip validation#42
Draft
Add ASN.1 protocol schema (Tier A) with round-trip validation#42
Conversation
- protocol.asn at repo root with all message types - asn1/DISCOVERY.md with full discovery report (Tier A selected) - asn1/SCHEMA.md with type reference documentation - asn1/Makefile to compile schema and build converter binaries - asn1/run-tests.sh round-trip smoke tests (11/11 pass) - asn1/test-data/ with XER samples for all types - mouse07410/asn1c added as git submodule at asn1c/ - .gitignore updated for generated files Agent-Logs-Url: https://github.com/Preponderous-Software/barony/sessions/1cda833b-4f09-4480-b272-5e3f97de6e10 Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…an target in Makefile Agent-Logs-Url: https://github.com/Preponderous-Software/barony/sessions/1cda833b-4f09-4480-b272-5e3f97de6e10 Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
dmccoystephenson
April 12, 2026 21:57
View session
Member
|
@copilot what is the purpose of including an ASN.1 schema if it is not directly used by the project? |
Contributor
Author
The schema isn't wired into the runtime — it's a Tier A (documentation-only) deliverable. Its purpose is to provide a machine-readable, language-neutral contract for the REST API data types that currently exist only as Java class definitions. Concrete benefits:
That said, if the project doesn't see value in maintaining a separate schema alongside the Java models, this is entirely reasonable to decline — the existing Jackson serialization works well and the models are already typed. Happy to close the PR if this isn't a direction you want to go. |
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.
No machine-readable schema exists for the REST API wire format. Added an ASN.1 schema documenting all message types exchanged between web-client and backend, with constrained types and round-trip smoke tests.
Discovery determined Tier A (Schema Only) is appropriate: serialization is standard Spring Boot Jackson (not hand-rolled), models are typed Java classes (not stringly-typed maps), and no existing
.proto/.thrift/OpenAPI spec was found.Schema (
protocol.asn)LoginRequest,LoginResponse,Command,RulerDecision,RulerStats,Army,Tile,GameState,ErrorResponse,BaronyRequest,BaronyResponseMorale ::= INTEGER (0..200),Coordinate ::= INTEGER (0..19), etc.) derived from clamping logic in model settersENUMERATEDfor magic strings (CommandType,TileType, policy enums)CHOICEdispatch unions (BaronyRequest,BaronyResponse) with extension markersBuild system (
asn1/Makefile)protocol.asnviaasn1csubmodule (mouse07410/asn1c)make testruns XER→DER→XER round-trip for all 11 typesDocumentation
asn1/DISCOVERY.md— wire format analysis, message inventory, call sites, tier justificationasn1/SCHEMA.md— type reference with field-level mapping to Java sources and XER examplesExample XER encoding
All 137 existing backend tests unaffected. Generated files excluded via
.gitignore.