Skip to content

impl(042): increment 8, spec 034 bundles and signing - #441

Merged
bartekus merged 1 commit into
mainfrom
impl/042-bundle-profiles
Nov 2, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/042-bundle-profiles

Conversation

@bartekus

@bartekus bartekus commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Spec 042, increment 8: spec 034 bundles and signing (3.3.1, 3.3.3, 3.3.6, 3.3.8 as ratified in A-71).

  • rustev-contract: rustev.plan-bundle/1 gains profile, variant ({"named": ...}) and profile_bases (1 to 64, only with a profile), each omitted when unused; the bundle's definition may be a spec 034 template; rustev.plan-registration/1 gains profile_id (leaf ProfileId, omitted for none); SigningMode::DenyUnsignedForProfiles (1 to 1024 ids); the compile refusal document admits the instantiation refusal and the profiled compile refusal rustev-surface renders. Schemas and TypeScript declarations regenerated.
  • rustev-serve: registration instantiates with exactly the bundle's inputs (compile_profiled_with, no version pin); deny_unsigned_for_profiles refuses an unsigned bundle whose leaf or any profile of its resolved chain is listed; the record carries the leaf's ProfileId.
  • Owner's reading recorded in the implementation record (3.3.1, 3.3.3 and 3.3.8 quoted): absence is the only spelling of no profile ("profile": "none" is invalid_document), so a bundle and registration without one keep their bytes and RegistrationId.
  • Tests: crates/rustev-contract/tests/042_serve_documents.rs bundles_carry_profiles_variants_and_bases_and_omit_them_when_unused; integrations/rustev-serve/tests/profiles.rs (section 5 rows: variant-required, profile-missing, bases without a profile, "variant": "none" / empty profile_bases, a listed base, unreached-base registration_conflict; leaf ProfileId; listed leaf).

Stacked on increment 7 part 3.

Carry the profile, variant and base profiles in plan bundles, record the
leaf ProfileId, apply deny_unsigned_for_profiles to the resolved chain,
and instantiate registrations with exactly the bundle's inputs (3.3.8).
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff against governance context and looking for bugs, security issues, and inconsistencies.

plan_bundle.rs – BundleDefinition::parse – double parse on the success path
When Definition::parse(bytes).is_ok() the function immediately calls parse_bounded a second time to obtain the serde_json::Value. Both calls use DEFINITION_V1 limits, so in practice the second call cannot fail if the first succeeded; the code is correct but redundant.

plan_bundle.rs – BundleVariant::valid length check
self.named.len() <= 64 is a byte-length check, not a char-count check. Because all characters that pass the subsequent is_ascii_* guards are single-byte ASCII, byte length equals char count for any string that would be accepted. An empty string is correctly rejected by chars.next().is_some_and(...). The logic matches the regex [a-z][a-z0-9_]{0,63}.

serve.rs – CompilerRefusalShape untagged ordering
CompilerRefusalFields and ProfiledCompileFields both carry deny_unknown_fields. A document with stage fails the CompilerRefusalFields arm, falls through to ProfiledCompileFields (requires stage: "compile" and parameters), then InstantiationFields (requires stage: "instantiate" and code). The ordering is sound; no variant overlaps the next.

service.rs – two-phase unsigned check is correct and intentional
The leaf is checked before compilation (fast path); the resolved chain (ProfileChain::Chain) is checked after. The test deny_unsigned_for_profiles_covers_every_profile_of_the_chain covers both leaf and base. The pre-compilation check on the leaf is a superset of what the post-compilation check would catch for the leaf, so there is no gap.

service.rs – compile() – .unwrap() calls on document() and id()
Both are called on a PlanBundle that has already been successfully parsed; the underlying embedded documents are valid by the time this code runs. This is consistent with the existing codebase pattern.

service.rs – profile_bases with no profile
PlanBundle::validate rejects profile_bases without profile, so the fast-path check (Some(d), None, None) cannot be reached when profile_bases is set.

BundleDefinition::SCHEMA constant
SCHEMA is pinned to the v1 schema string even though BundleDefinition also accepts v2 templates at runtime. The comment acknowledges this explicitly ("which is unchanged"), and the spec increment confirms the JSON Schema is intentionally left unchanged. This is documented design, not a defect.

No concrete defects found.

{"head": "42f5fb8484ffad2fb8926df4ed29b940ef0ca1c7", "verdict": "no-findings", "findings": []}

Subject: cf797a0...42f5fb8, diff digest 7f52d4c02e7293b908c215aa31aef74e5efe318f29b52e5b2fef17c88c966eca, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 3dc1e1c Nov 2, 2026
30 checks passed
@bartekus
bartekus deleted the impl/042-bundle-profiles branch November 2, 2026 06:09
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