Skip to content

Harden collection templates and quality gates#34

Merged
beardedeagle merged 6 commits into
mainfrom
boundary-quality-hardening
May 12, 2026
Merged

Harden collection templates and quality gates#34
beardedeagle merged 6 commits into
mainfrom
boundary-quality-hardening

Conversation

@beardedeagle
Copy link
Copy Markdown
Owner

@beardedeagle beardedeagle commented May 11, 2026

Summary

  • Split the Strata collection-pattern regression tests by behavior surface so helper signatures, helper body matches, return matches, non-concrete dispatch, subset map rules, static template-key checks, and type/capacity validation can be reviewed independently.
  • Split Mantle artifact value-template handling into focused modules for typed definitions, parsing, payload handling, projection validation, template evaluation/admission, and value operations while preserving the existing public artifact surface.
  • Added a stable source-to-runtime performance smoke gate over examples/collection_state.str, covering repeated Strata check/lower and repeated Mantle in-memory execution with broad regression budgets.
  • Extended that performance smoke gate to report wall time, process CPU time, and resident memory for both measured paths; Linux CI reads process CPU from /proc/self/stat and current/peak RSS through /proc, while macOS-class local runs report current RSS through ps.
  • Added a git-tracked performance smoke baseline at benchmarks/performance-smoke.baseline with reviewed reference values, enforced budget ceilings, explicit nanosecond/KiB units, and strict test-side parsing.
  • Added committed fuzz seeds for collection-pattern source, source-to-runtime execution, and Mantle artifact decode coverage; the smoke recipe copies those fixtures into ignored corpus directories before running fuzz so mutation output cannot touch tracked seeds.
  • Expanded Miri smoke coverage for typed map projection validation, payload-dependent map template rejection, and subset collection-pattern checking.
  • Kept the branch scoped to quality and boundary hardening. No external dependency, compatibility path, legacy path, or new language feature was added.

Boundary and correctness notes

  • Strata coverage remains source-facing and immutable: state changes in the covered source continue to flow through whole-value Stop and Continue returns, with no assignment-style source updates introduced.
  • Mantle artifact handling remains typed and language-neutral: artifact values, type IDs, process IDs, process-reference payloads, and enum-backed map projection modes carry semantic meaning across the runtime boundary.
  • String values remain confined to literal values, artifact labels, diagnostics, provenance, metadata, and codec fields. Executable dispatch and semantic references continue to flow through typed IDs and validated artifact structures.
  • The committed .mta fuzz seed is an artifact-decode input only; it is not used as milestone proof and remains internally self-identifying with format, schema version, and source language.
  • Map projection and template validation remain fail-closed for duplicate keys, empty key sets, unsorted projection keys, process-reference misuse, payload-dependent map keys, and invalid structured values.
  • The performance smoke test uses intentionally broad wall, CPU, and RSS budgets so it catches severe regressions without turning shared-runner variance into a review blocker.
  • Local and CI performance smoke runs print current measurements to command logs; git tracks reviewed baseline changes under benchmarks/ rather than committing every measured run.

Verification

  • cargo +stable check -p strata-mantle-acceptance --test performance_smoke
  • cargo +stable fmt --all --check
  • cargo +stable test -p strata source_function_collection_patterns
  • cargo +stable test -p mantle-artifact
  • cargo +stable clippy -p mantle-artifact --all-targets -- -D warnings
  • cargo +stable clippy -p strata --all-targets -- -D warnings
  • just performance-smoke
  • just fuzz-ci
  • just miri-ci
  • just quality
  • git diff --check
  • pre-commit hook passed workspace clippy and format checks
  • pre-push hook passed ci-native

Split the Strata collection-pattern regression tests by behavior surface so helper signatures, helper body matches, return matches, non-concrete dispatch, subset map rules, static template-key checks, and type/capacity validation can be reviewed independently.

Split the Mantle artifact value-template implementation into focused modules for typed definitions, parsing, payload handling, projection validation, template evaluation/admission, and value operations while preserving the existing public artifact surface.

Keep the Strata and Mantle boundary explicit: Strata test coverage remains source-facing and immutable, Mantle continues to operate on typed artifact values and IDs, map projection modes remain enum-backed, and process-reference payloads stay constrained to typed runtime boundaries.

Verification: cargo +stable fmt --all --check; cargo +stable test -p strata source_function_collection_patterns; cargo +stable test -p mantle-artifact; cargo +stable clippy -p mantle-artifact --all-targets -- -D warnings; cargo +stable clippy -p strata --all-targets -- -D warnings; just quality.
Copilot AI review requested due to automatic review settings May 11, 2026 18:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors two areas to make collection-pattern behavior and Mantle value-template handling easier to review and maintain, without changing the public Mantle artifact surface.

Changes:

  • Split the Strata source_function_collection_patterns regression tests into focused modules by behavior surface (helper surfaces, non-concrete dispatch, subset map patterns, template keys, and type/capacity validation).
  • Split Mantle artifact value-template/value handling into a value_template/ module tree (model, parsing, payload, projection, template evaluation/validation, and value operations), preserving the existing exports.
  • Minor cleanup in mantle-artifact imports to reflect the refactor.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/strata/src/language/tests/source_function_collection_patterns/mod.rs New test module root with shared helper and submodule declarations.
crates/strata/src/language/tests/source_function_collection_patterns/helper_surfaces.rs Exercises “happy path” helper surfaces and lowering for list/map patterns and payload-dependent templates.
crates/strata/src/language/tests/source_function_collection_patterns/non_concrete_dispatch.rs Adds targeted tests ensuring non-concrete collection arguments are rejected across dispatch surfaces.
crates/strata/src/language/tests/source_function_collection_patterns/subset_map_patterns.rs Adds focused tests for subset-map pattern overlap/exactness/emptiness rules.
crates/strata/src/language/tests/source_function_collection_patterns/template_keys.rs Adds focused tests for static-template key requirements and duplicate-key rejection.
crates/strata/src/language/tests/source_function_collection_patterns/type_validation.rs Adds focused tests for type-argument validation, capacity validation, and duplicate key enforcement.
crates/strata/src/language/tests/source_function_collection_patterns.rs Removes the previous monolithic test file in favor of the split modules.
crates/mantle-artifact/src/artifact/value_template/mod.rs New module root re-exporting the same value-template/value public types.
crates/mantle-artifact/src/artifact/value_template/model.rs Extracts value/value-template data structures.
crates/mantle-artifact/src/artifact/value_template/parsing.rs Extracts artifact value label parsing helpers.
crates/mantle-artifact/src/artifact/value_template/payload.rs Extracts typed payload wrapper and process-ref payload handling.
crates/mantle-artifact/src/artifact/value_template/projection.rs Extracts map projection parsing/validation helpers.
crates/mantle-artifact/src/artifact/value_template/template.rs Extracts template evaluation and validation logic.
crates/mantle-artifact/src/artifact/value_template/value.rs Extracts artifact value parsing/validation/labeling/projection methods.
crates/mantle-artifact/src/artifact/value_template.rs Removes the previous monolithic value-template implementation file in favor of the split modules.
crates/mantle-artifact/src/artifact.rs Updates validation imports consistent with the refactor (no behavior change).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add a stable source-to-runtime performance smoke test over collection_state that measures checking, lowering, and in-memory Mantle execution with broad regression budgets.

Wire the quality gate and CI job label to include the performance smoke path, and document how the gate should be used without treating it as a precise microbenchmark.

Add committed fuzz seeds for collection, template, artifact decode, and runtime source paths while routing mutation output into ignored corpus directories.

Expand the Miri smoke gate across map projection validation, payload-dependent template rejection, and subset collection pattern checking.

Verification: just fuzz-ci; just miri-ci; just quality; git diff --check.
@beardedeagle beardedeagle changed the title Split collection pattern tests and value templates Harden collection templates and quality gates May 11, 2026
Extend the collection_state performance smoke gate to report wall time, process CPU time, and resident memory for both check/lower and in-memory runtime paths.

Require CPU and RSS metrics on Linux and macOS-class local platforms, keep unsupported platforms timing-only, and preserve broad regression budgets to avoid fragile microbenchmark behavior.

Document the expanded resource signals and the platform-specific RSS behavior in the development gates guide.

Verification: cargo +stable check -p strata-mantle-acceptance --test performance_smoke; just performance-smoke; just quality; git diff --check.
Copilot AI review requested due to automatic review settings May 11, 2026 19:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.

Copy committed fuzz seed fixtures into ignored corpus directories before smoke runs, then run cargo-fuzz only against the ignored corpus paths so mutation output cannot touch tracked seeds.

Prefer Linux process CPU accounting from /proc/self/stat for the performance smoke gate, with schedstat retained as a fallback.

Update development-gate docs to describe the read-only seed flow and Linux CPU metric source.

Verification: cargo +stable check -p strata-mantle-acceptance --test performance_smoke; just performance-smoke; just fuzz-ci; just quality; git diff --check.
Add a git-tracked performance smoke baseline with reviewed reference values and broad budget ceilings for collection_state check/lower and in-memory runtime paths.

Load the baseline from the acceptance smoke test instead of hardcoding iterations and budgets, keeping units explicit and parsing strict without adding dependencies.

Document that local and CI runs print measurements while git tracks reviewed baseline changes rather than raw noisy run history.

Verification: cargo +stable check -p strata-mantle-acceptance --test performance_smoke; just performance-smoke; just quality; git diff --check.
Copilot AI review requested due to automatic review settings May 12, 2026 09:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.

Comment thread crates/mantle-artifact/src/artifact/value_template/parsing.rs Outdated
Comment thread crates/mantle-artifact/src/artifact/value_template/parsing.rs
Comment thread crates/strata-mantle-acceptance/tests/performance_smoke.rs Outdated
Reject top-level artifact value labels with unmatched closing delimiters before record or enum parsing can select a structured parse path, and cover the fail-closed behavior with a focused artifact-value regression test.

Change the performance smoke RSS budget check to enforce current RSS per measured profile while keeping process-lifetime peak RSS as diagnostic output when the platform exposes it.

Document the current-RSS budget behavior in the development gates guide.

Verification: cargo +stable test -p mantle-artifact artifact_value_parse_rejects_unbalanced_top_level_delimiters; cargo +stable test -p mantle-artifact; cargo +stable check -p strata-mantle-acceptance --test performance_smoke; just performance-smoke; just quality; git diff --check.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 29 changed files in this pull request and generated no new comments.

@beardedeagle beardedeagle merged commit 8077907 into main May 12, 2026
13 checks passed
@beardedeagle beardedeagle deleted the boundary-quality-hardening branch May 12, 2026 12:01
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.

2 participants