Skip to content

BUILDSYS-635: esnacc 7.0.11 — granular @ignorevalidation and validation rules - #143

Merged
JanFellner merged 4 commits into
mainfrom
feature/BUILDSYS-635-ignorevalidation
Aug 6, 2026
Merged

BUILDSYS-635: esnacc 7.0.11 — granular @ignorevalidation and validation rules#143
JanFellner merged 4 commits into
mainfrom
feature/BUILDSYS-635-ignorevalidation

Conversation

@JanFellner

Copy link
Copy Markdown
Contributor

Summary

Release esnacc 7.0.11 with granular ASN.1 comment tag @ignorevalidation, a shared validation-rules registry, and a new validator that rejects legacy optionalParams / AsnOptionalParameters bags unless explicitly grandfathered.

Enables ProCall to run full default validation in vcxproj builds (no per-project -ValidationLevel masking) while keeping legacy published types via inline, rule-specific exemptions in the ASN.1 contracts.

Jira: BUILDSYS-635

Version

Previous (main) 7.0.10 (RELDATE 24.07.2026)
This MR 7.0.11 (RELDATE 06.08.2026)

No git tag on the feature branch — tag 7.0/7.0.11 (or agreed release tag) should be applied on main after merge.

Motivation

  • Remove blanket -ValidationLevel from ProCall ENetConnection_* vcxproj esnacc invocations.
  • Replace coarse validation suppression with per-type, per-rule grandfathering in ASN.1.
  • Add an explicit check forbidding new optionalParams bags; legacy types opt out with @ignorevalidation no-asn-optional-parameters.

Behaviour changes

@ignorevalidation (ASN.1 comments)

  • Bare @ignorevalidation is rejected — at least one named rule is required.
  • Rules are comma/space-separated canonical names (legacy aliases still parse).
  • Applies to SEQUENCE types and OPERATION comments; bitmask stored on comment metadata.
  • @deprecated still exempts a type/operation from all validation checks.

Example (list only rules the type actually violates):

-- @ignorevalidation no-untagged-optional-members, no-asn-optional-parameters
-- @ignorevalidation no-asn-optional-parameters

New validation bit 256: no-asn-optional-parameters

Fails when a SEQUENCE declares optionalParams / AsnOptionalParameters unless exempt via @ignorevalidation or @deprecated.

Single source of truth

compiler/core/snacc-validation-rules.h (+ .cpp) defines all -ValidationLevel bits and @ignorevalidation rule names via SNACC_VALIDATION_RULES_LIST.

Rule name Bit Check
unique-operation-id 1 Operation IDs unique within module
rose-payload-extendable 2 ROSE arg/result/error are SEQUENCE or CHOICE
uniform-operation-error 4 Uniform ERROR type per module
sequence-has-ellipsis 8 SEQUENCE ends with ...
primitive-type-whitelist 16 Primitives from esnacc_whitelist.txt only
rose-invoke-event-shape 32 Invoke vs event ROSE shape
no-mixed-optional-encoding 64 No mix of [n] OPTIONAL and untagged OPTIONAL
no-untagged-optional-members 128 OPTIONAL members must use [n]
no-asn-optional-parameters 256 No optionalParams bag

CLI -ValidationLevel unchanged; ProCall builds use default 0xffffffff (all checks).

Implementation notes

  • IsValidationExemptSequence / IsValidationExemptOperation: @deprecated OR matching @ignorevalidation bit.
  • Comment parser: C++20 starts_with + string_view tag constants; m_nIgnoreValidationMask on ETypeComment (fixes tag length / mask storage bugs).
  • snacc_exit_now declaration wrapped in extern "C" in snacc.h (LNK2019 fix when linking C++ parser).
  • Release workflow documented in .cursor/rules/snacclib7-release-workflow.mdc and AGENTS.md.

Consumer follow-up (not in this repo)

  1. global: MR feature/BUILDSYS-635-ignorevalidation pins libs/snacclib71d51144.
  2. asn1_procall / asn1_ucweb: grandfather legacy types with minimal @ignorevalidation rule lists; regenerate stubs after merge.
  3. Rebuild esnacc7.exe into global/buildtools/ from merged main.

Test plan

  • CMake Release build (compiler target) on VS2022 / vc145
  • ENetROSEInterface.asn1 and full asn1_procall file set compile with default validation + -comments
  • @ignorevalidation tags honoured (no false positives on grandfathered optionalParams types)
  • CI green on this PR
  • After merge: tag release on main, refresh global/buildtools/esnacc7.exe, bump global pin on main

Files (15)

snacc-validation-rules.{h,cpp}, snacc-validators.c, asn_commentparser.{cpp,h}, structure-util.{c,h}, asn_comments.{cpp,h}, snacc.c, snacc.h, version.h, AGENTS.md, release workflow rule.

Add @ignorevalidation on SEQUENCE/operations with named rule masks (snacc-validation-rules.h). New bit 256 forbids AsnOptionalParameters members. Fix tag parsing (C++20 starts_with, mask on ETypeComment). Bump version to 7.0.11.

Made-with: Cursor
Use existing asn-config strcpy_s and platform-functions mytolower instead of MSVC-only _stricmp and strncpy_s/_TRUNCATE.

Made-with: Cursor
Add @ignorevalidation no-asn-optional-parameters so sample ASN.1 used by cpp-lib tests and TS prepare passes full default validation.

Made-with: Cursor
@JanFellner
JanFellner merged commit 10ec578 into main Aug 6, 2026
5 checks passed
@JanFellner
JanFellner deleted the feature/BUILDSYS-635-ignorevalidation branch August 6, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant